VE Lua Documentation

Press F to search!

pairs

Definition


-- @/=[C]:-1
function pairs(...)

Callers

@/lua/ge/extensions/editor/rendererComponents.lua
  level = level + 1
  for _, s in pairs(settingNode) do
    local newPath = path .. '/' .. tostring(s.name)
        s.valMap = {}
        for ck, cv in pairs(s.values) do
          s.valMap[cv] = ck
      if im.BeginCombo((s.title or s.name) .. '##' .. tostring(newPath), s.valMap[s.cVal]) then
        for ck, cv in pairs(s.values) do
          local selected = s.values
  local tabNames = {}
  for _, s in pairs(settings) do
    local tabTitle = s.name or ""
  if im.BeginTabBar("settings") then
    for _, tabName in pairs(tabNames) do
      local entry = settings[tabName]
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua

    for nodeId, tris in pairs(resultData.nodeTriPairs) do
      local node = nodes[nodeId]

      for triId, nodeTriData in pairs(tris) do
        local tri = triangles[triId]

  for k,v in pairs(vdata) do
    if type(v) == 'table' then
@/lua/ge/extensions/ui/liveryEditor/layers.lua
  if M.layerMap then
    for k, layer in pairs(M.layerMap) do
      if not layer.hidden then
M.getLayerByOrder = function(order, parentUid)
  for k, layerMapItem in pairs(M.layerMap) do
    if (not parentUid or parentUid == layerMapItem.parentUid) and layerMapItem.order == order then
@/gameplay/missionTypes/targetjump/customNodes/CalculateZonePointRewardNode.lua
  end
  for _, z in pairs(zones.objects) do
    local points = z.customFields:get('points') or 0
@/lua/ge/extensions/core/vehicle/manager.lua
  vehicles = {}
  for k, v in pairs(data.vehicles) do
    vehicles[k] = lpack.decode(v)
  }
  for k, v in pairs(vehicles) do
    data.vehicles[k] = lpack.encode(v)
@/lua/ge/extensions/flowgraph/nodes/util/timedSequence.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['message_'..i] then
@/lua/common/libs/xlsxlib/tests/tests.lua
  local normalized = {}
  for k, v in pairs(t) do
    if type(k) == "string" and tonumber(k) then

  for k, v in pairs(t1) do
    if type(v) == "table" and type(t2[k]) == "table" then

  for k in pairs(t2) do
    if t1[k] == nil then return false end
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
  if data.boundary then
    for index, pos in pairs(data.old) do
      if data.boundary.vertices[index] then
  if data.boundary then
    for index, pos in pairs(data.new) do
      if data.boundary.vertices[index] then

  for idx, obj in pairs(objects) do
    local distNodeToCam = (obj.pos - mouseInfo.camPos):length()
@/lua/ge/extensions/editor/toolUtilities/geom.lua
  -- Check each graph node in turn.
  for key, node in pairs(nodes) do
    local a, b = intersectsRay_Sphere(rayPos, rayDir, node, mouseToNodetol) -- Get any intersection points between the ray and node sphere.
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/rallySuperCountdown.lua
  -- Set impulse flags and reset them
  for pName, val in pairs(self.flags) do
    self.pinOut[pName].value = val
@/lua/ge/extensions/editor/gen/lib/ui.lua
	local alib = {}
	for _,p in pairs(apth) do
		unrequire(p)
if editor.texObj then
    for key,p in pairs(aicon) do
        dicon[key] = editor.texObj('/lua/ge/extensions/editor/gen/assets/_icon/'..(aicon[key][3] or key)..(p.suf or '.png'))
    if im.BeginTable(id, #adim, cbsort and tableFlags or tableFlagsNoSort) then
        for i,c in pairs(adim) do
            im.TableSetupColumn(ahead and ahead[i] or 'C_'..i
        if data then
            for k,v in pairs(data) do
                cb(k,v)
        while next do
            for i,v in pairs(row) do
                if v.list then
    local cbg = im.GetColorU322(im.ImVec4(0.3, 0.3, 0.3, 0.8)) --im.GetColorU321(im.ImVec4(0.3, 0.3, 0.3, 1)) -- im.Col_FrameBg)
	for i,row in pairs(htree) do
        if #htree == 1 then
            im.SameLine()
            for _,c in pairs(row) do
                local k,v = c[1],c[2]
	local padding = 2
	for i,row in pairs(htree) do
--            im.Indent(10)
			local nextline = false
			for _,c in pairs(row) do
				if _ == 1 then
@/lua/ge/extensions/core/settings/audio.lua
  local audioProviderName = TorqueScriptLua.getVar( '$pref::SFX::providerName' )
  for n, p in pairs(devices) do
    if n == audioProviderName then
    local firstProviderName = ''
    for n, d in pairs(devices) do
      if n ~= 'Null' then

    for n, d in pairs(providers) do
      if n ~= 'Null' then
@/lua/ge/extensions/editor/tech/roadArchitect/staticMesh.lua
  if spanMeshes[roadName] then
    for _, v in pairs(spanMeshes[roadName]) do
      v:delete()
  if singleMeshes[roadName] then
    for _, v in pairs(singleMeshes[roadName]) do
      v:delete()
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/signals/controller.lua
    for i = old, new + 1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinOut['stateName_'..i] or lnk.sourcePin == self.pinOut['stateDuration_'..i] then
@/lua/vehicle/extensions/tech/vehiclePOI.lua
  local wp, ctr = {}, 0
  for _, wheel in pairs(wheels.wheels) do
    ctr = ctr + 1
@/lua/common/libs/lua-luaepnf/epnf.lua
  -- copy lpeg shortcuts
  for k,v in pairs( L ) do
    if string.match( k, "^%u%w*$" ) then
      end
      for k,v in pairs( node ) do
        if k ~= "id" and k ~= "pos" then
@/lua/ge/extensions/core/vehicle/colors.lua
  for i, paint in ipairs(vd.config.paints) do
    for attribute, value in pairs(paint) do
      if type(value) == "table" then
@/lua/common/jsonPrettyEncoderCustom.lua
        local tableKeys = tableKeysWeightSorted(v, tableWeights)
        for _, kk in pairs(tableKeys) do
          local vv = v[kk]
@/lua/ge/extensions/flowgraph/nodes/gameplay/zone.lua
        self.red[3] = self.red[2]
        for _, zone in pairs(sites.zones.objects) do
          zone:drawDebug(nil, not isInside and self.red or self.white, 2, -0.5, isInside)
@/lua/ge/extensions/core/vehicleBridge.lua
  if not M.vehicleData[vehId] then return end
  for key, value in pairs(data) do
    M.vehicleData[vehId].data[key] = value
@/lua/ge/extensions/gameplay/drag/dragTypes/headsUpDrag.lua
  if dragData.racers then
    for _,racer in pairs(dragData.racers) do
      table.insert(dials, {vehId = racer.vehId, dial = 0})
  dragData = dData
  for _, racer in pairs(dragData.racers) do
    racer.currentPhase = pIndex
    local isActivityFinished = true
    for vehId, racer in pairs(dragData.racers) do
      if not racer.isFinished then
    local dependenciesCompleted = true
    for _, r in pairs(dragData.racers) do
      if not r.phases[r.currentPhase].completed then

    --   for vehId, racer in pairs(dragData.racers) do
    --     funcPhases[phase.name](vehId, dtSim)
@/lua/common/jbeam/materials.lua

  for flexKey, flexbody in pairs(vehicle.flexbodies) do
    flexmeshMats[flexbody.mesh] = vehicleObj:getMeshsMaterialsTbl(flexbody.mesh)
      --if(not meshes or #meshes == 0 or (#meshes == 1 and meshes[1] == '')) then log('E', "material.init", "[glowmap] No meshes containing material " .. orgMat) end
      for meshi, mesh in pairs(meshes) do
        local gmat = deepcopy(gm)
            elseif type(gm.simpleFunction) == "table" then
              for fk, fc in pairs(gm.simpleFunction) do
                local s = "(" .. fk .. "*" .. fc .. ")"
          elseif gm.advancedFunction and gm.advancedFunction.triggers and gm.advancedFunction.cmd then
            for _, fc in pairs(gm.advancedFunction.triggers) do
              mv[fc] = 0
  -- debug helper: list all materials on a mesh:
  --for flexKey, flexbody in pairs(vehicle.flexbodies) do
  --    log('D', "material.init", "flexbody mesh '"..flexbody.mesh.."' contains the following materials: " .. dumps(vehicleObj:getMeshsMaterialsTbl(flexbody.mesh)))

  for flexKey, flexbody in pairs(vehicle.flexbodies) do
    if flexbody.deformGroup and flexbody.deformGroup ~= "" then

      for mati, matName in pairs(flexmeshMats[flexbody.mesh]) do
        if matName == "" then

    for i, b in pairs(vehicle.beams) do
      if b.deformGroup then
        local deformGroups = type(b.deformGroup) == "table" and b.deformGroup or {b.deformGroup}
        for _, g in pairs(deformGroups) do
          if switchTmp[g] ~= nil then
          if switchTmp[g] ~= nil then
            for sk, sv in pairs(switchTmp[g]) do
              if b.deformSwitches == nil then
  --log('I', "material.init", "available deformGroups:")
  --for k, va in pairs(assignStats) do
  --    log('I', "material.init", " * " .. k .. " on " .. va .. " beams")
  triggerList = {}
  for _, s in pairs(triggers) do
    matSet[s.msc] = s

  for tk, _ in pairs(triggerSet) do
    table.insert(triggerList, tk)

  for _, s in pairs(matSet) do
    if s.on then

  for _, va in pairs(switches) do
    switchMaterial(vehicleObj, va, nil, matState)
  local triggersCopy = deepcopy(triggers)
  for _, t in pairs(triggersCopy) do
    t.evalFunction = nil
@/lua/ge/extensions/editor/dynamicDecals/news.lua
      local i = 1
      for _, version in pairs(news) do
        if im.CollapsingHeader1(string.format("%s", version.title), i == 1 and im.TreeNodeFlags_DefaultOpen or nil) then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/simpleFollowDecalroad.lua
      local lastP
      for _, p in pairs(self.path.path) do
        debugDrawer:drawSphere(vec3(p), 0.1, ColorF(1,0,1,1))
@/lua/ge/extensions/editor/tech/roadArchitect/decals.lua
local function tryRemoveAll()
  for k, _ in pairs(asphalts) do
    tryRemove(k)
  table.clear(asphalts)
  for k, _ in pairs(decals) do
    tryRemove(k)
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
  local elementNames = {}
  for _, element in pairs(elements) do
    if not element.name or element.name == "" then
    if im.Button("Save & Close##ctrlDefinitions") then
      for _, typeData in pairs(signalCtrlDefinitions.types) do
        if typeData.statesArraySize then

      for _, state in pairs(signalCtrlDefinitions.states) do
        if state._edited then
              local color = imColors.white
              for k, c in pairs(imColors) do
                if string.startswith(state.state, k) then -- can be green, yellow, or red

  for k, v in pairs(timedTexts) do
    if v[2] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceAiParameters.lua

  for id, state in pairs(self.pinIn.raceData.value.states) do
    local veh = getObjectByID(id)
@/lua/ge/extensions/tech/ultrasonicTest.lua
    local ctr = 0
    for i, s in pairs(activeUltrasonicSensors) do
      ctr = ctr + 1
    
    for k, v in pairs(sensorData) do
      print("ultrasonic reading: "..k.." reading value: "..v)
@/lua/ge/extensions/campaign/rewards.lua
  local inv = players[player] or {}
  for k, v in pairs(inv) do
      callback(k, v)

  for k,v in pairs(data.rewards) do
    -- ignore all keys for medals
    earned[k] = earned[k] or {}
    for _,value in pairs(data) do
      table.insert(earned[k], value)
  if rewards then
    for k,data in pairs(rewards) do
      if statistics_statistics.getMedalRanking(k) >= 0 then
      if statistics_statistics.getMedalRanking(k) >= 0 then
        for subKey,value in pairs(data) do
          if subKey == 'choices' then
  local finalResultInfo = {}
  for k,v in pairs(earned) do
    finalResultInfo[k] = v

  for k,v in pairs(pendingChoice) do
    finalResultInfo[k] = v
  if choices then
    for k,v in pairs(choices) do
      core_inventory.addItem("$$$_"..k, v[selectionIndex])
@/lua/ge/extensions/gameplay/util/sortedList.lua
  table.clear(self.sorted)
  for _, o in pairs(self.objects) do
    table.insert(self.sorted, o)
@/lua/ge/extensions/util/calibrateESC.lua
  local blacklistLookup = {}
  for _, v in pairs(vehicleBlacklist) do
    blacklistLookup[v] = true
  local filteredConfigs = {}
  for k, v in pairs(configs) do
    if (not vehicleToTest or v.model_key == vehicleToTest) and ((not pcFileToTest or pcFileToTest == "") or v.key == pcFileToTest) and not blacklistLookup[v.model_key] then
  local progressCount = 1
  for _, v in pairs(filteredConfigs) do
    local vehName = v.model_key
  log("I", logTag, "Vehicles that are skipped:")
  for _, value in pairs(vehicleBlacklist) do
    log("I", logTag, value)
@/lua/ge/extensions/editor/tech/roadArchitect/render.lua
    if isGroupMode or (div[lIdx][7]:squaredDistance(camPos) < innerCullLimSq) then
      for lane, _ in pairs(roadLanes) do
        local dL = div[lane]
@/lua/ge/extensions/core/trafficSignals.lua
  local objData = self:getSignalObjects(true)
  for _, objId in pairs(objData) do
    if scenetree.objectExists(objId) then
    self.targetPos = vec3()
    for _, v in pairs(vectors) do
      self.targetPos:setAdd(v)

    for k, _ in pairs(vectors) do -- sets the same intersection data for all matching instances
      instancesByName[k].targetPos = self.targetPos

  for k, v in pairs(data) do
    self[k] = v
function SignalController:onSerialize()
  for _, state in pairs(self.states) do
    if state.duration and state.duration < 0 then

  for k, v in pairs(data) do
    self[k] = v
function SignalSequence:resolveUpdates(forceUpdate) -- updates all linked signal states and lights
  for _, state in pairs(self.controllerStates) do
    if state._updated or forceUpdate then
      local stateBase = state.controller.states[state.stateIdx]
      for _, instance in pairs(state.instances) do
        if instance.active then

  for _, state in pairs(self.controllerStates) do
    state.stateIdx = state.controller.defaultIndex or 1
      local stateRef = state.controller:getStateData(stateBase.state)
      for _, instance in pairs(state.instances) do
        instance:setLights(stateRef and stateRef.lights)
  else
    for _, state in pairs(self.controllerStates) do
      for _, instance in pairs(state.instances) do
    for _, state in pairs(self.controllerStates) do
      for _, instance in pairs(state.instances) do
        signalUpdates[instance.name] = 'none'

  for k, v in pairs(data) do
    self[k] = v
  end
  for _, instance in pairs(instances) do
    if not instance._invalid then
  if instances[1] then
    for _, instance in pairs(instances) do
      instance.active = false
  if active then
    for stateName, stateDef in pairs(controllerDefinitions.states) do
      if stateDef.flashingActive and stateDef.flashingLights then -- process flashing lights

    for k, state in pairs(signalUpdates) do
      signalUpdateResults[k] = {state = state}

  for k, e in pairs({instances = instances, controllers = controllers, sequences = sequences}) do
    data[k] = {}
  _uid = 0
  for k, e in pairs({instances = instances, controllers = controllers, sequences = sequences}) do
    for i, v in ipairs(e) do
@/lua/ge/extensions/core/vehicle/inplaceEdit.lua

  for _, flexbody in pairs(vBundle.vdata.flexbodies) do
    if not flexbody._blinkTimer then
  --dumpz(part, 2)
  for _, flexbody in pairs(part.flexbodies or {}) do
    vehicle:setMeshAlpha(alpha, flexbody.mesh)

  for _, slot in pairs(part.slots or {}) do
    local chosenPartName = vBundle.chosenParts[slot.type]
@/lua/ge/extensions/gameplay/missions/progress.lua

  for key, val in pairs(attempt.unlockedStars or {}) do
  local bonusStarsUnlockedCount = 0
  for key, _ in pairs(mission.careerSetup._activeStarCache.defaultStarKeysByKey) do
    if attempt.unlockedStars[key] then
  end
  for key, _ in pairs(mission.careerSetup._activeStarCache.bonusStarKeysByKey) do
    if attempt.unlockedStars[key] then
  end
  for star, _ in pairs(attempt.unlockedStars or {}) do
    if mission.careerSetup.starsActive[star] then
    local sumChange = {}
    for key, amount in pairs(starRewards.sums) do
      sumChange[key] = (sumChange[key] or 0) + amount
  local rewardsByAttribute = {}
  for star, rewards in pairs(starRewards.originalRewardsPerStar) do
    for _, reward in ipairs(rewards) do
  -- Create single breakdown entry with total for each attribute
  for _, rewardData in pairs(rewardsByAttribute) do
    if rewardData.total > 0 then

  for progressKey, defaults in pairs(mission.defaultAggregateValues or {}) do
    if progressKey ~= "all" then
      end
      --for key, val in pairs(defaults) do
      --  prog[progressKey].aggregate[key] = val
    -- iterate over progressKeys
    for progressKey, progressData in pairs(saveData.progress) do
  -- iterate over progressKeys
  for progressKey, progressData in pairs(saveData.progress) do
      if saveData.unlockedStars then
        for k, v in pairs(saveData.unlockedStars) do
          if v == false then saveData.unlockedStars[k] = 0 end
  mission.careerSetup._activeStarCache.sortedStarRewardsByKey = {}
  for key, list in pairs(mission.careerSetup.starRewards) do
    local newList = {}
  if career_career.isActive() then
    for key, starCount in pairs(mission.saveData.unlockedStars) do
      if mission.careerSetup.starsActive[key] then
  -- automaticData column headers
  for _, col in pairs(mission.autoUiAttemptProgress or {}) do
    local value = tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission)
  -- genericData column headers
  for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
    table.insert(res.labels, col.columnLabel)
  -- automaticData column headers
  for _, col in pairs(mission.autoUiAttemptProgress or {}) do
    table.insert(res.labels, col.columnLabel)
      -- genericData cells
      for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
        if col.customValue then
      -- automaticData cells
      for _, col in pairs(mission.autoUiAttemptProgress or {}) do
        table.insert(row, tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission))
    -- genericData cells
    for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
      if col.customValue then
    -- automaticData cells
    for _, col in pairs(mission.autoUiAttemptProgress or {}) do
      table.insert(row, tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission))
  -- genericData column headers
  for _, col in pairs(genericUiAggregateProgress or {}) do
    table.insert(res.labels, col.columnLabel)
  -- automaticData column headers
  for _, col in pairs(mission.autoUiAggregateProgress or {}) do
    table.insert(res.labels, col.columnLabel)
  -- build rows
  for _, m in pairs(missions) do
    if not onlySelf or (m == mission) then
        -- genericData cells
        for _, col in pairs(genericUiAggregateProgress or {}) do
          table.insert(row, tryFormatValueForFunction(getValueForAggregateUiProgressType(aggregateForProgressKey, col), col.formatFunction, m))
        -- automaticData cells
        for _, col in pairs(mission.autoUiAggregateProgress or {}) do
          local value = table.insert(row, tryFormatValueForFunction(getValueForAggregateUiProgressType(aggregateForProgressKey, col), col.formatFunction, m))
  local context = {}
  for key, value in pairs(data) do
    if type(value) == 'string' or type(value) == 'number' then

  for key, conf in pairs(bigmapConf.aggregates or {}) do
    local sd = mission.saveData.progress[conf.progressKey or mission.defaultProgressKey]

    for key, value in pairs(aConds) do
      count = count + 1
  local attempt = M.newAttempt(mission:getRandomizedAttempt())
  for k, v in pairs(addAttemptData) do
    attempt[k] = v
@/lua/vehicle/powertrain/electricServo.lua

    for _, nid in pairs(wheel.nodes) do
      local n = v.data.nodes[nid]
@/lua/ge/extensions/flowgraph/graph.lua
  local children = {}
  for _, gr in pairs(self.mgr.graphs) do
    if gr.parentId == self.id then
  -- collect all nodes and additionally put all integrated nodes into a second list.
  for _, node in pairs(self.nodes) do
    if node.nodeType == 'macro/integrated' then
  -- gather all links which are not connected to neither an integrated node nor an IO node.
  for _, link in pairs(self.links) do
    if not (link.sourceNode.nodeType == 'macro/integrated' or link.sourceNode.nodeType == 'macro/io'

    for id, link in pairs(iNode.graph.links) do
      if link.targetNode == iNode then
    -- get links in target graph that connect from either i/o node
    for id, link in pairs(iNode.targetGraph.links) do
      if link.sourceNode == iNode.inputNode then
  local allLinks = {}
  for node, list in pairs(interInfo) do
    if node.nodeType == "macro/integrated" then
    if node.nodeType == "macro/integrated" then
      for pinName, lnkList in pairs(list.inLinks) do
        for _, link in ipairs(lnkList) do
    elseif node.nodeType == "macro/io" and node.ioType == "out" then
      for pinName, lnkList in pairs(list) do
        for _, link in ipairs(lnkList) do
  if self.mgr.gcprobe_enabled then
    for id, node in pairs(allNodes) do
      if gcprobe_grouping == 'type' then
  local nodeInFlows = {}
  for _, link in pairs(allLinks) do
    local tPin = link.targetPin

  for id, node in pairs(allNodes) do
    table.clear(node._flowColors)
        if not node.ignoreAsRoot then
          for _, pin in pairs(node.pinOut) do
            if pin.type == 'flow' then
    -- build dependency map
    for _, pin in pairs(node.pinIn) do
      local parentNode = pin.node

    for _, mPin in pairs(node._mInFlow) do
      for _, pin in ipairs(mPin) do
      local hasOutFlow = false
      for _, pin in pairs(node.pinOut) do
        if pin.type == 'flow' then
    prevOutCount = #outList
    for id, node in pairs(inNodes) do
      local depsOk = true
          local dnode = ndeps[i]
          for color, _ in pairs(dnode._flowColors) do
            node._flowColors[color] = 1
      local sourceColor = node._flowColors
      for _, p in pairs(node.pinOut) do
        if outNodeIdx[p] then
        if outNodeIdx[p] then
          for targetNode, _ in pairs(outNodeIdx[p]) do
            for color, _ in pairs(targetNode._flowColors) do
          for targetNode, _ in pairs(outNodeIdx[p]) do
            for color, _ in pairs(targetNode._flowColors) do
              if sourceColor[color] == nil then
    local n = outList[i]
    for pname, mPin in pairs(n._mInFlow) do
      if #mPin > 1 then
         { __index = {value = function()
           for _,v in pairs(mPin) do
             print(mPin.value)

    for color, _ in pairs(n._flowColors) do
      if rootWork[color] == nil then
        if next(n.pinIn) ~= nil then
          for _, mPin in pairs(n._mInFlow) do
            for _, pin in ipairs(mPin) do
            local hasFlowPin = false
            for _, pin in pairs(n.pinInLocal) do
              if pin.type == 'flow' then
  table.clear(self.hookList)
  for color, orderList in pairs(rootWork) do
    if string.sub(color.name, 1, 2) == 'on' then

    for _, p in pairs(color.pinOut) do
      if p.type == 'flow' then
        table.clear(tmp1)
        for _, p in pairs(cInDeps[node]) do
          local pnum = cInDepsDict[p]
          table.insert(fun, '\n    -- multi-inflow pins')
          for pname, dOutPin in pairs(node._mInFlowPins) do
            table.clear(tmp)
            table.clear(tmp)
            for _, p in pairs(node._mInFlow[pname]) do
              local pnum = cInDepsDict[p]
          table.clear(tmp)
          for p, _ in pairs(cOutDeps[node]) do
            if p.value == nil then
      if gcprobe_grouping == 'individual' then
        table.insert(fun, '\n  for k, v in pairs(currentGarbage) do\n    gcprobeTable.entries[k].total = (gcprobeTable.entries[k].total or 0) + v\n    gcprobeTable.entries[k].count = (gcprobeTable.entries[k].count or 0) + 1\n    gcprobeTable.entries[k].history[self.mgr.frameCount+1] = v\n    gcprobeTable.entries[k].totalHistory[self.mgr.frameCount+1] = gcprobeTable.entries[k].total end ')
        table.insert(fun, '\n  gcprobeTable.total = gcprobeTable.total + garbageTotal\n  gcprobeTable.history[self.mgr.frameCount+1] = garbageTotal\n  gcprobeTable.totalHistory[self.mgr.frameCount+1] = gcprobeTable.total')
  end
  --for id, node in pairs(self.nodes) do
  --  if node.nodeType == "macro/integrated" then
  --end
  for _, node in pairs(self.nodes) do
    node:_destroy()
  -- delete any links to it
  for linkId, link in pairs(self.links) do
    if link.sourceNode == node or link.targetNode == node then
  -- delete any links to it
  for linkId, link in pairs(self.links) do
    if link.sourceNode == node or link.targetNode == node then

  for nid, node in pairs(self.nodes) do
    nodes[nid] = node:__onSerialize()
  local orderedLinks = {}
  for _, link in pairs(self.links) do
    if pinOrder[link.targetPin] then
  --[[
  for childId, child in pairs(data.children) do
    local cid = tonumber(childId) + self.mgr:getGraphNodeOffset()
function C:linkExists(startPin, endPin)
  for k, link in pairs(self.links) do
    if link.sourcePin.id == startPin.id and link.targetPin.id == endPin.id then
function C:hasLink(pin)
  for k, link in pairs(self.links) do
    if pin.type ~= 'flow' and pin.type ~= 'state' and link.targetPin.id == pin.id then
  end
  for typeA, _ in pairs(sourceTypes) do
    if targetTypes['any'] then
function C:_executionStarted()
  for _, node in pairs(self.nodes) do
    if node._executionStarted then
function C:_onClear()
  for _, node in pairs(self.nodes) do
    node:_onClear()
function C:_executionStopped()
  for _, node in pairs(self.nodes) do
    if node._executionStopped then
  --print("Root ID " .. root.id)
  for _, m in pairs(self.mgr.macros) do
    if m.id == root.macroID then
function C:getRecursiveHooksAndDependencies(hooks, deps)
  for _, node in pairs(self.nodes) do
    table.insert(hooks, node)
  end
  for _, g in pairs(self:getChildren()) do
    g:getRecursiveHooksAndDependencies(hooks, deps)
function C:findNodeRecursive(id)
  for _, node in pairs(self.nodes) do
    if node.id == id then
  local ret = nil
  for _, child in pairs(self:getChildren()) do
    if not ret then
function C:forceRecursiveNodeUpdatePosition()
  for _, gr in pairs(self:getChildren()) do
    gr:forceRecursiveNodeUpdatePosition()
  end
  for _, nd in pairs(self.nodes) do
    nd:updateNodePosition()
    local state = nil
    for _, gr in pairs(self.mgr.graphs) do
      if gr.isStateGraph and state == nil then
      if gr.isStateGraph and state == nil then
        for _, node in pairs(gr.nodes) do
          if node:representsGraph() and node:representsGraph().id == self.id then
    local children = self:getChildren()
    for _, node in pairs(self.nodes) do
      if node:representsGraph() and not node:representsGraph().isStateGraph then
      local children = parent:getChildren()
      for _, node in pairs(parent.nodes) do
        if node:representsGraph() and not node:representsGraph().isStateGraph then
    local children = {}
    for _, gr in pairs(self.mgr.graphs) do
      if gr:getParentWithStates() == nil then
    local state = nil
    for _, gr in pairs(self.mgr.graphs) do
      --print(gr.isStateGraph)
      if gr.isStateGraph and state == nil then
        for _, node in pairs(gr.nodes) do
          if node:representsGraph() and node:representsGraph().id == last.id then
@/lua/ge/extensions/gameplay/missions/proceduralMissionGenerators/busModeMissions.lua
    local hasData = false
    for _, file in pairs(busLineFiles) do
      local busLine = jsonReadFile(file)
      local busLine = jsonReadFile(file)
      for _, route in pairs(busLine.routes) do
        -- we save the data per route. route key is unfortunately a composite key of id and variance :(
@/lua/vehicle/input.lua
  if hydros then
    for _, h in pairs(hydros.hydros) do
      if h.inputSource == "steering_input" then --check if it's a steering hydro
    end
    for _, h in pairs(hydros.hydros) do
      if h.inputSource == "steering_input" then
    end
    for _, h in pairs(hydros.hydros) do
      if h.inputSource == "steering_input" then

  for wi, wd in pairs(wheels.wheels) do
    if wd.parkingTorque and wd.parkingTorque > 0 then
  local debug = false
  for wi1, wd1 in pairs(wheels.wheels) do
    local long1, side1 = getLongitudinalLateralPrefix(wd1.name)
      local rearWheels = {}
      for wi2, wd2 in pairs(wheels.wheels) do
        local long2, side2 = getLongitudinalLateralPrefix(wd2.name)
    vehicleMassCache = 0
    for _, n in pairs(v.data.nodes or {}) do
      vehicleMassCache = vehicleMassCache + n.nodeWeight
  local downforce = 0
  for _, wd in pairs(wheels.wheels or {}) do
    downforce = downforce + wd.downForce
    understeerAssistedSurfacesCache = {}
    for k, v in pairs(particles.getMaterialsParticlesTable()) do
      understeerAssistedSurfacesCache[k] = understeerAssistedSurfaces[v.name]
  -- map the values
  for k, e in pairs(M.state) do
    local ival = e.val or 0

  for k, e in pairs(M.state) do
    e.smootherKBD:reset()
@/lua/ge/main.lua

  for _, fn in pairs(filenames or {}) do
    log('I', 'resaveCSFiles', 'converting ts script: ' .. tostring(fn) )
    local newKnownObjects = {}
    for k, v in pairs(knownObjects) do
      newKnownObjects[v] = 1
    local newObjects = {}
    for _, oName in pairs(knownObjects2) do
      if not knownObjects[oName] then

    for _, obj in pairs(newObjects) do
      log('I', '', ' * ' .. tostring(obj:getClassName()) .. ' - ' .. tostring(obj:getName()) )

    for _, obj in pairs(newObjects) do
      local className = obj:getClassName()
      -- dump(filenames)
      for _, fn in pairs(filenames) do
        log('I', 'resaveCSFiles', 'converting ts script: ' .. tostring(fn) )
        local newKnownObjects = {}
        for k, v in pairs(knownObjects) do
          newKnownObjects[v] = 1
        local newObjects = {}
        for _, oName in pairs(knownObjects2) do
          if not knownObjects[oName] then

        for _, obj in pairs(newObjects) do
          log('I', '', ' * ' .. tostring(obj:getClassName()) .. ' - ' .. tostring(obj:getName()) )

        for _, obj in pairs(newObjects) do
          local className = obj:getClassName()
  local fsInfo = Engine.Platform.getFSInfo()
  for k,v in pairs(fsInfo) do
    if v then

  for _,v in pairs(files) do
    --print("onFileChanged: " .. tostring(v.filename) .. ' : ' .. tostring(v.type))
@/lua/ge/extensions/ui/apps.lua
      if origLayout.removedApps then
        for appName, appVersion in pairs(origLayout.removedApps) do
          local userAppIndex = getAppIndexByName(userLayout, appName)
local function onFilesChanged(files)
  for _,v in pairs(files) do
    local filename = v.filename
  end
  for k,v in pairs(layouts[layout]) do
    if v.directive == appDirective then
@/lua/ge/extensions/editor/meshSpline/import.lua
  local uniqueList = {}
  for path in pairs(uniquePaths) do -- Create a list of unique mesh paths.
    table.insert(uniqueList, path)
      local total = #mainMeshes
      for path, count in pairs(uniquePaths) do
        meshInfo[path] = count / total
    local sortedMeshes = {}
    for meshPath, freq in pairs(meshInfo) do
      table.insert(sortedMeshes, { path = meshPath, freq = freq })
  local missingCount = 0
  for id in pairs(originalIds) do -- Count the number of missing TSStatic objects.
    if not orderedIds[id] then
  local extraCount = 0
  for id in pairs(orderedIds) do -- Count the number of extra TSStatic objects.
    if not originalIds[id] then
  local meshesInPolygon = {}
  for _, meshName in pairs(scenetree.findClassObjects("TSStatic")) do
    local obj = scenetree.findObject(meshName)
@/lua/ge/extensions/career/modules/marketplace.lua
M.initials = {}
for initial, probability in pairs(M.initialProbabilities) do
  for i = 1, math.ceil(probability * 100) do
@/lua/common/jbeam/links.lua

  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" then
      local keysLen = 0
      for k, _ in pairs(entry) do
        keysLen = keysLen + 1
          else
            for cellKey,cellValue in pairs(rowValue) do
              --log('D', "jbeam.prepareLinksDestructive"," * key:"..tostring(cellKey).." = "..tostring(cellValue)..".")
  -- walk all sections
  for sectionName, section in pairs(vehicle) do
    if type(section) == "table" then
      local newSection = {}
      for rowKey, rowValue in pairs(section) do
        if vehicle.validTables[sectionName] == true and rowValue.cid then
  -- walk all sections
  for _, entry in pairs(vehicle) do
    -- walk all vehicle sections
    if type(entry) == "table" then
      for _, rowValue in pairs(entry) do
        if type(rowValue) == "table" then
          -- walk all cells
          for cellKey, groupvals in pairs(rowValue) do
            if str_byte(cellKey,1) == 91 then -- [
                -- Create groupvals index
                for _, gvalname in pairs(groupvals) do
                  groupindex[gvalname] = 1
                if sectioname == '' then sectioname = "nodes" end
                for _, val in pairs(vehicle[sectioname]) do
                  local vgn = val[groupname]
                    elseif typevgn == 'table' then
                      for _, gvalname in pairs(vgn) do
                        if groupindex[gvalname] ~= nil then
@/lua/console/bananabench-xml.lua
  str = string.rep("  ", indent).."<"..self.name
  for k,v in pairs(self.attribs) do
    str = str.." "..k.."=\""..v.."\""
  end
  for k, v in pairs(self.children) do
    str = str..v:toString(indent + 1)

    for vecname,v in pairs(res.tests) do
    for dynamicCol = 1, 2 do
        --local t = ''
        --for _,l in pairs(firstTest.logcache) do
          --if l.level then
@/lua/ge/extensions/flowgraph/nodes/ui/missionPopup.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/ge/extensions/gameplay/traffic/roles/empty.lua
  self.actions = {}
  for k, v in pairs(self.baseActions) do
    self.actions[k] = v
@/lua/vehicle/powertrain/supercharger.lua
  if jbeamData.boostController then
    for k, v in pairs(jbeamData.boostController) do
      if type(k) == "number" then

  for k, _ in pairs(assignedEngine.torqueCurve) do
    if type(k) == "number" and k < assignedEngine.maxRPM then
@/lua/common/luaBinding.lua
  while mt ~= nil do
    for k, v in pairs(rawget(mt, 1)) do
      workgetters[k] = workgetters[k] or v

    for k, v in pairs(rawget(mt, 2)) do
      worksetters[k] = worksetters[k] or v

    for k, v in pairs(mt) do
      if type(k) == "string" then
  if luaVMname ~= 'vlua' then
    for k, classtable in pairs(classes) do
      -- search for SimObject's metatables

  for k, v in pairs(classes) do
    -- optimize metatables
        if rawget(v, '__newindex') == nil then
          for f, getter in pairs(v) do
            if type(f) ~= 'number' then
        else
          for f, getter in pairs(v) do
            if type(f) ~= 'number' then
@/lua/ge/extensions/gameplay/taxi.lua
  local taxisToDiscard = {}
  for vehId, state in pairs(blinkerStates) do
    local veh = getObjectByID(vehId)
local function extractTaxiIds()
  for vehId, _ in pairs(map.objects) do
    if isTaxi(vehId) then
  local missingVehIds = {}
  for vehId, _ in pairs(taxiIdsList) do
    if not ignoreTaxiIdsList[vehId] then
@/lua/ge/extensions/ui/appSelector/general.lua
  if apps then
    for _, app in pairs(apps) do
      if app.types then
  local commonFilters = {}
  for _, propName in pairs(filtersWhiteList) do
    if filterByProp[propName] then
      local options = {}
      for option, _ in pairs(filterByProp[propName]) do
        table.insert(options, option)
  local items = {}
  for _, app in pairs(apps) do
    if filterInstance.passesFilters(app) then
  local remainingCategories = {}
  for category, _ in pairs(categoryGroups) do
    table.insert(remainingCategories, category)
    local allButtons = buttonInstance.getAllButtonInfos()
    for buttonId, buttonInfo in pairs(allButtons) do
      if buttonInfo.meta and buttonInfo.meta.label == translateHelper.translate("ui.apps.selector.addToLayout") then
@/lua/ge/extensions/ui/gameplaySelector/general.lua
  if gameplayList then
    for _, item in pairs(gameplayList) do
      for _, propName in pairs(filtersWhiteList) do
    for _, item in pairs(gameplayList) do
      for _, propName in pairs(filtersWhiteList) do
        local propVal = item[propName:lower()]
        if type(propVal) == "table" then
          for _, val in pairs(propVal) do
            filterByProp[propName][val] = true
  local filters = {}
  for _, propName in pairs(filtersWhiteList) do
    local options = {}
    local options = {}
    for option, _ in pairs(filterByProp[propName] or {}) do
      table.insert(options, option)
    if not match then
      for _, propName in pairs(filtersWhiteList) do
        local propVal = item[propName:lower()] or item[propName]
    if filter.type == 'set' then
      for _, option in pairs(filter.options) do
        if propVal == option and not filter.currentFilterValues[option] then
  local validItems = {}
  for _, item in pairs(items) do
    if item.validBackends[M.backendName] then
@/lua/ge/extensions/gameplay/drag/display.lua
      -- Check if at least one light object exists
      for _, light in pairs(laneTree.stageLights) do
        if light and light.obj then
      end
      for _, light in pairs(laneTree.countDownLights) do
        if light and light.obj then
  for _, laneTree in ipairs(dragData.strip.treeLights) do
    for _,group in pairs(laneTree) do
      if type(group) == "table" then
      if type(group) == "table" then
        for _,light in pairs(group) do
          if type(light) == "table" and light.obj and simObjectExists(light.obj) then
  if not dragData then return end
  for _, digitTypeData in pairs(dragData.strip.displayDigits) do
    for _,laneTypeData in ipairs(digitTypeData) do

  for vehId, racer in pairs(dragData.racers) do
    if racer.isPlayable then

  for vehId, racer in pairs(dragData.racers) do
    -- Send times to UI continuously if display signs are not available and racer is in race phase
      for _, laneTree in ipairs(dragData.strip.treeLights) do
        for _, group in pairs(laneTree) do
          if type(group) == "table" then
          if type(group) == "table" then
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
      end
      for _, digitTypeData in pairs(dragData.strip.displayDigits) do
        for _, laneTypeData in ipairs(digitTypeData) do
      for _, laneTree in ipairs(dragData.strip.treeLights) do
        for _, group in pairs(laneTree) do
          if type(group) == "table" then
          if type(group) == "table" then
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
      end
      for _, digitTypeData in pairs(dragData.strip.displayDigits) do
        for _, laneTypeData in ipairs(digitTypeData) do
      for _, laneTree in ipairs(dragData.strip.treeLights) do
        for _, group in pairs(laneTree) do
          if type(group) == "table" then
          if type(group) == "table" then
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
      end
      for _, digitTypeData in pairs(dragData.strip.displayDigits) do
        for _, laneTypeData in ipairs(digitTypeData) do
      for _, laneTree in ipairs(dragData.strip.treeLights) do
        for _, group in pairs(laneTree) do
          if type(group) == "table" then
          if type(group) == "table" then
            for _, light in pairs(group) do
              if type(light) == "table" and light.obj and simObjectExists(light.obj) then
      end
      for _, digitTypeData in pairs(dragData.strip.displayDigits) do
        for _, laneTypeData in ipairs(digitTypeData) do
@/lua/vehicle/controller/tirePressureControl.lua

  for groupName, wheelGroup in pairs(wheelGroups) do
    local groupPressure = 0
    local groupPressure = 0
    for _, wheelData in pairs(wheelGroup.wheelData) do
      wheelData.isWheelBrokenOff = wheels.wheels[wheelData.wheelId].isBroken

    for _, wheelData in pairs(wheelGroup.wheelData) do
      local pressureDiff = preSyncGroupPressure - wheelData.currentPressure
  local pressureChangeInflateDeflate = activeGroupPressureChange * dt
  for groupName, isActive in pairs(activeGroups) do
    local wheelGroup = wheelGroups[groupName]
    if isActive then
      for _, wheelData in pairs(wheelGroup.wheelData) do
        local pressureDiff = activeGroupAvgPressure - wheelData.currentPressure

            for groupName, wheelGroup in pairs(wheelGroups) do
              table.insert(
local function reset(jbeamData)
  for groupName, wheelGroup in pairs(wheelGroups) do
    activeGroups[groupName] = false
    activeGroups[groupName] = false
    for _, wheelData in pairs(wheelGroup.wheelData) do
      wheelData.currentPressure = 0
    local wheelGroupData = tableFromHeaderTable(jbeamData.wheelGroups or {})
    for _, wheelGroup in pairs(wheelGroupData) do
      local groupName = wheelGroup.groupName
        local wheelData = {}
        for _, wheelName in pairs(wheelNames) do
          local wheelId = wheels.wheelIDs[wheelName]
@/lua/ge/extensions/editor/raceEditor/segments.lua
  if not self.path then return end
  for _, seg in pairs(self.path.segments.objects) do
    seg._drawMode = 'normal'
  --self:selectSegment(nil)
  for _, seg in pairs(self.path.segments.objects) do
    seg._drawMode = 'faded'
  self.capsuleIndex = nil
  for _, seg in pairs(self.path.segments.objects) do
    seg._drawMode = (index == seg.id) and 'highlight' or 'normal'

  for _, n in pairs(self.path.pacenotes.objects) do
    if index and index ~= -1 and n.segment == index then
@/lua/common/libs/lunajson/lunajson/encoder.lua
        local tmp = i
        for k, v in pairs(o) do
          if type(k) ~= 'string' then
@/lua/vehicle/extensions/tech/CANBus/CANBusPeak.lua
      if receiveResult == M.errorCodes.OK then
        for _, callback in pairs(canMessageCallbacks) do
          callback(msg)
  M.errorCodeLookup = {}
  for key, value in pairs(M.errorCodes) do
    M.errorCodeLookup[value] = key
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua

  for cautionVal,cautionText in pairs(mapping.caution) do
    if cautionText == '' then
@/lua/ge/extensions/ui/freeroamSelector/general.lua
  if gameplayList then
    for _, item in pairs(gameplayList) do
      for _, propName in pairs(filtersWhiteList) do
    for _, item in pairs(gameplayList) do
      for _, propName in pairs(filtersWhiteList) do
        local propVal = item[propName:lower()]
        if type(propVal) == "table" then
          for _, val in pairs(propVal) do
            filterByProp[propName][val] = true
  local filters = {}
  for _, propName in pairs(filtersWhiteList) do
    local options = {}
    local options = {}
    for option, _ in pairs(filterByProp[propName] or {}) do
      table.insert(options, option)
    if not match then
      for _, propName in pairs(filtersWhiteList) do
        local propVal = item[propName:lower()] or item[propName]
    if filter.type == 'set' then
      for _, option in pairs(filter.options) do
        if propVal == option and not filter.currentFilterValues[option] then
  local validItems = {}
  for _, item in pairs(items) do
    if item.validBackends[M.backendName] then
@/lua/ge/extensions/ui/vehicleVicinityApp.lua
    if vData and vData.vdata and vData.vdata.nodes then
      for nodeId, node in pairs(vData.vdata.nodes) do
        if (node.couplerTag and node.couplerTag:find('fifthwheel')) or (node.tag and node.tag:find('fifthwheel')) then
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
      end
      for name, c in pairs(fromGroup) do
        for j = 1, numSignals do
@/lua/vehicle/scriptai.lua
  local avgWheelNodePos, numOfWheels, maxWheelRadius = vec3(), 0, -math.huge
  for _, wheel in pairs(wheels.wheels) do
    avgWheelNodePos:setAdd(obj:getOriginalNodePositionRelative(wheel.node1))
@/lua/ge/extensions/editor/flowgraph/welcome.lua
    local res, _ = self.examples:getExamplesLookup()
    for r, e in pairs(res.beginner.examples) do
      table.insert(self._examplesSorted, e)

  for k, p in pairs(self.demoProjects) do
    if fancyIconButton('welcomeContentColumn2demo1' .. k, editor.icons.folder_open, editor.icons.folder, p.name, p.description) then
@/lua/ge/extensions/editor/toolShortcuts.lua
  local sortedKeys = {}
  for key, mode in pairs(editor.editModes) do
    if key ~= "objectSelect" and key ~= "createObject" and mode.icon then table.insert(sortedKeys, key) end
@/lua/ge/extensions/ui/gridSelectorUtils/filterModule.lua
      -- Check if any option for this property is locked
      for _, _ in pairs(lockedFiltersByProp[propName]) do
        return true
          -- Fallback to iterating through keys if no options structure in filterList
          for key, _ in pairs(filterOptions) do
            if key ~= 'min' and key ~= 'max' then
    -- Preserve locked filters when updating
    for propName, lockedOptions in pairs(lockedFiltersByProp) do
      if newFilters[propName] then
          -- For set filters, preserve locked options
          for option, lockedValue in pairs(lockedOptions) do
            if newFilters[propName][option] ~= nil then
        if filterByProp[propName] then
          for option, value in pairs(filterByProp[propName]) do
            lockedFiltersByProp[propName][option] = value
      local hasLockedOptions = false
      for _, _ in pairs(lockedFiltersByProp[propName]) do
        hasLockedOptions = true
      if options then
        for option, enabled in pairs(options) do
          if filterByProp[propName][option] ~= nil then
@/lua/ge/extensions/flowgraph/nodes/ui/setUILayout.lua
  local layout = {}
  for tmp, _ in pairs(layout_options) do
    table.insert(layout, {value = tmp})
  local menu = {}
  for tmp, _ in pairs(layout_options) do
    table.insert(menu, {value = tmp})
@/lua/ge/extensions/util/precompileShaders.lua
    local allLevels = core_levels.getList()
    for _, value in pairs(allLevels) do
        if levelsToLoad[string.lower(value.levelName)] == true then
@/lua/ge/extensions/util/dependencyTree.lua
  if n.childs then
    for _, c in pairs(n.childs) do
      for ck, _ in pairs(recurseFindAttribute(c, className, attributeName)) do
    for _, c in pairs(n.childs) do
      for ck, _ in pairs(recurseFindAttribute(c, className, attributeName)) do
          res[ck] = 1
  local dir, filename, ext = path.split(sourceFile)
  for k, fn in pairs(fileList) do
    local dir2, filename2, ext2 = path.split(fn)
  if not fileList then return end
  for k, fn in pairs(fileList) do
    local dir, filename, ext = path.split(fn)

  for k, _ in pairs(rootNode.instances) do
    add(entity.deps, 'simobject', k)
  if n.childs then
    for _, c in pairs(n.childs) do
      processSimObject(c, sourceFile)
  local filenames = findFiles('*.level.json\t*.material.json\t*.datablock.json')
  for _, filename in pairs(filenames) do
    processSimObject(jsonReadFile(filename), filename)

  for _, shapeInfoFn  in pairs(shapeInfoFiles) do
    local rootNode = jsonReadFile(shapeInfoFn)
      local entity = { deps = { material = {}}, provides = { shape = shapeInfoFn:sub(1, -13) }}
      for _, m in pairs(rootNode.materials) do
        table.insert(entity.deps.material, m)
@/lua/ge/extensions/flowgraph/nodes/vehicle/randomConfigProvider.lua
        }
        for _, c in pairs(v.configs) do
          if c["Top Speed"] and c["Top Speed"] > 10 then
@/ui/ui-vue/src/modules/vehicleConfig/parts/search.js

    function* pairs() { // [type, string, query, isMod]
      if (query.name) yield ["slot", slot.chosenPartName, query.name]
    let lastType
    for (const [type, string, query, isMod = false] of pairs()) {
      if (query && match(string, query)) {
@/lua/ge/extensions/flowgraph/modules/driftModule.lua
function C:onUpdate()
  for _, callbackData in pairs(self.callbacks) do
    if callbackData.ttl > 0 then
@/lua/ge/extensions/editor/tech/roadArchitect/junctions.lua
  -- Create the Road Architect roads from each unique road in the hash table.
  for k, uniqueRoad in pairs(roadNetwork) do
    local nodesIn, roadType = uniqueRoad.splineNodes, uniqueRoad.type                                     -- TODO: road_type is not used currently.

  for nodeId, intersectionData in pairs(intersections) do
    local roadIds = intersectionData.connectedRoads
@/lua/ge/extensions/ui/liveryEditor/controls.lua
local disableAllActionMaps = function()
  for key, value in pairs(ACTION_MAPS) do
    popActionMap(value)
@/lua/ge/extensions/flowgraph/nodes/ui/multiDescription.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['value_'..i] then
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local function selectMode(name)
  for k,v in pairs(paintModes) do
    if k == name then
local function setAllPaintModes(active)
  for name, tbl in pairs(materials.materialInfo) do
    tbl.paint[0] = active
local function setupTextures()
  for _, file in pairs(FS:findFiles(materialSettings.directory, "*.dds", -1, true, false)) do
    local fileWithoutExtension = string.sub(file, 1, string.len(file) - 4)

  for _, set in pairs(materialSettings.textureSets) do
    if set.d then set.tex = editor.texObj(set.d)
local function getGroundModelKeyByValue(groundmodel)
  for k, gm in pairs(materialSettings.groundModelNames) do
    if gm == groundmodel then return k end
    local i = 1
    for name, set in pairs(materialSettings.textureSets) do
      if im.ImageButton("##imageButton4", set.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
    local i = 1
    for name, glowMap in pairs(materialSettings.glowMaps) do
      if im.ImageButton("##imageButton5", glowMap.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
  local settings = {}
  for name,v in pairs(menuSettings) do
    if v.type == "bool" then
  if not settings then return end
  for name, v in pairs(settings) do
    if menuSettings[name] then
local function toolbarFromMenuItems(items,sorted)
  for _, v in pairs(sorted) do
    if items[v].icon then

    for _, name in pairs(paintModesSorted) do
      if paintModes[name].active[0] == true then
    if im.BeginMenu(translateLanguage("ui.trackbuilder.menus.windows","Windows")) then
      for k,v in pairs(menuItemsSorted) do
        if im.MenuItem2(menuItems[v].name, "", menuItems[v].isOpen) then
      im.Separator()
      for k,v in pairs(additionalMenuItemsSorted) do
        im.MenuItem2(additionalMenuItems[v].name, "", additionalMenuItems[v].isOpen)
local function showSubWindows()
  for k,v in pairs(menuItems) do
    if v.wasOpen == true and v.isOpen[0] == false then
  end
  for k,v in pairs(additionalMenuItems) do
    if v.wasOpen == true and v.isOpen[0] == false then
    local change = false
    for name,val in pairs(materials.materialInfo) do
      if val.paint[0] then
  local doPaint = false
  for name,val in pairs(materials.materialInfo) do
    doPaint = doPaint or val.paint[0]
    local change = false
    for name, borderPaint in pairs(clickInputModes) do
      if borderPaint[0] == true then
local function trackBuilderEditModeToolbar()
  -- for _, v in pairs(menuItemsSorted) do
  --   if menuItems[v].icon then
  -- im.Separator()
  -- for _, v in pairs(additionalMenuItemsSorted) do
  --   if additionalMenuItems[v].icon then
    local found = false
    for nm, pc in pairs(pieceInfo.free) do
      if pc.piece == info.piece then
      if pc.piece == info.piece then
        for key, val in pairs(pc) do
          if key ~= 'piece' then

  for key, mod in pairs(modifierValues) do
    if not mod.noFill then

  for nm, pc in pairs(pieceInfo.free) do
    if pc.piece == currentPieceName then
    if pc.piece == currentPieceName then
      for key, val in pairs(pc) do
        if key ~= 'piece' then
  if not to then return end
  for name, mat in pairs(materials.materialInfo) do
    mat.value[0] = indexOf(materials[mat.table].matNames,to[name])-1
  --TODO: this must be done everytime level changed? since scenetree will be different
  for i, matName in pairs(materials.matNames) do
    table.insert( materialSettings.materials.center, scenetree.findObject(matName .. 'center') )
@/gameplay/missionTypes/dragStripRace/constructor.lua
  local vehiclesUsedPerStar = saveData.vehiclesUsedPerStar or {}
  for star, achieved in pairs(attempt.unlockedStars or {}) do
    if achieved then
@/lua/common/libs/lua-websockets/websocket/server_copas.lua
  self.broadcast = function(self,...)
    for client in pairs(clients[protocol]) do
      if client ~= self then
  if opts.protocols then
    for protocol in pairs(opts.protocols) do
      clients[protocol] = {}
    if not keep_clients then
      for protocol,clients in pairs(clients) do
        for client in pairs(clients) do
      for protocol,clients in pairs(clients) do
        for client in pairs(clients) do
          coroutine.resume(coroutine.create(function ()
@/lua/vehicle/material.lua
local function switchBrokenMaterial(beam)
  for msc, g in pairs(beam.deformSwitches) do
    --log('D', "material.switchBrokenMaterial", "mesh broke: "..g.mesh.. " with deformGroup " .. g.deformGroup)

  for msc, newMat in pairs(changedMats) do
    if newMat ~= matState[msc] then
  brokenSwitches = {}
  for mid, _ in pairs(matState) do --do not change
    matState[mid] = false
local function reset()
  for mid, _ in pairs(matState) do --do not change
    switchMaterial(mid)
  local funTab = {"return function () ", nil, " end"}
  for _, t in pairs(triggers) do
    local str = t.evalFunctionString or ""
@/lua/vehicle/controller/propAnimation/dualAxisLever.lua
  local modeId = 1
  for _, coordinate in pairs(modeCoordinateTable) do
    modeCoordinates[coordinate.modeName] = {x = coordinate.x, y = coordinate.y, position = modeId}
  local impulseModeCoordinateTable = tableFromHeaderTable(jbeamData.impulseModeCoordinates or {})
  for _, impulseMode in pairs(impulseModeCoordinateTable) do
    --we only support modes here with a length of at least 2

  for _, modeChange in pairs(modeChangesTable) do
    local index1 = modeChange.mode1 .. modeChange.mode2
    modeChanges[index2] = {}
    for _, pos in pairs(modeChange.intermediateCoordinates) do
      --normal order as per jbeam
@/lua/ge/extensions/editor/gen/network.lua
    local aang = {}
    for i,v in pairs(apos) do
        aang[#aang + 1] = {i, math.atan2(v.y, v.x) % (2*math.pi)}
        state = {}
        for i,l in pairs(lines) do
            local a = U.split(l,',')
        local apair = {}
        for o,s in pairs(edges.astamp) do
            if (edges.infaces[s] ~= nil and math.abs(edges.infaces[s]) == 1) or #edges.astamp == 1 then
    end
    for _,n in pairs(anode) do
        n.pos = n.pos + (pos or vec3(0))
    massCenter = vec3(0,0,0)
    for _,n in pairs(anode) do
        massCenter = massCenter + n.pos
    local dpos = pos - massCenter/#anode
    for _,n in pairs(anode) do
        n.pos = n.pos + dpos
    local star, anear = {}, {}
    for _,iuse in pairs(ause) do
        anear[#anear + 1] = iuse - 1
    end
    for _,j in pairs(anear) do
        if j > 0 and j <= #path then
        local dma = 0
        for i,n in pairs(anode) do
            local step = U.stamp({cp, i})
        local crossed, xc, yc
        for o,p in pairs(ap) do
            local w = wa * p.d/dma + wb * p.ang/math.pi + (1 - (wa + wb)) * p.used
                end
                for _,pth in pairs(apath) do
                    crossed = forCross(pth)
                    apath[#apath + 1] = path
                    for _,s in pairs(path) do
                        jointpath[#jointpath + 1] = s
    local aang, angp = {}, 0
    for _,i in pairs(star) do
        local v = anode[i].pos - anode[s].pos
    -- relative to p
    for o,_ in pairs(aang) do
        aang[o][2] = (aang[o][2] - angp) % (2*math.pi)
    lo('>> roadAni:')
    for key,list in pairs(dlist) do
--        U.dump(list, '?? ani_LIST:'..key..':'..#list)
--            U.dump(nodelist, '?? NLIST:'..#nodelist)
        for k,n in pairs(nodelist) do
    --    for k,n in pairs(acnode) do
        for k,n in pairs(nodelist) do
    --    for k,n in pairs(acnode) do
            for i = cedge,nedge do
--            local s = aseg[i]
        for i,s in pairs(aseg) do
--                U.dump(s, '?? for_seg:'..i)
                local an = {s[3]}
                for _,n in pairs(s) do
                    if n.tp and n.tp == 1 then
        local nma = 0
        for _,s in pairs(ani) do
            if #s > nma then
        local epos = road:getMiddleEdgePosition(i)
        for k,n in pairs(acnode) do
            if (n.pos - epos):length() < 0.1 then
            local p = pth[o]
    --        for o,p in pairs(dec) do
            local set = 0
    -- reset heights
    for o,n in pairs(adec) do
        if dbg then
    -- build decal
    for _,r in pairs(roads) do
        local rd = path2decal(r, wHeighway)
    local an = {}
    for _,p in pairs(apos) do
        an[#an + 1] = {pos = p, width = w}
    -- get branches
    for i,r in pairs(roads) do
        local inpath = U.index(r.path, icirc)
--                U.dump(r.apin, '?? r:'..i)
        for _,j in pairs(inpath) do
            inedge[#inedge + 1] = {i, r.apin[r.path2dec[j]][1]}
    local adir = {}
    for _,s in pairs(inedge) do
        print('?? for_s:'..s[1]..':'..s[2])
        -- circles
        for o,n in pairs(anode) do
            local clr = color(255,255,255,255)
        -- paths
        for i,l in pairs(apath) do
            for j,s in pairs(l) do
        for i,l in pairs(apath) do
            for j,s in pairs(l) do
                if j > 1 then
@/lua/ge/extensions/gameplay/rally/util.lua
-- function printFields(obj)
--   for k, v in pairs(obj) do
--     -- if type(v) == "function" then
@/lua/ge/extensions/flowgraph/nodes/career/careerVehicleSelect.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/vehicle/powertrain/linearActuator.lua
  device.actuatorBeams = {}
  for _, tag in pairs(beamTags) do
    local beamCids = beamstate.tagBeamMap[tag]
    if beamCids then
      for _, beamCid in pairs(beamCids) do
        table.insert(device.actuatorBeams, beamCid)
@/lua/ge/extensions/flowgraph/modules/timerModule.lua
function C:afterTrigger()
  for id, timer in pairs(self.timers) do
    -- finalize the pauseFlag
@/lua/ge/extensions/career/modules/milestones/generalMilestones/speedTraps.lua
      local numOfTrapsTriggered = 0
      for name, velocityMilestone in pairs(velocityMilestonesByTrapName) do
        if milestones.saveData.general[velocityMilestone.id].notificationStep > 0 then
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalCircle.lua
function C:work()
  for k, pin in pairs(self.pinInLocal) do
    if pin.type == 'color' then
@/lua/vehicle/powertrain/hydraulicPump.lua
  device.consumerJbeamData = {}
  for _, ph in pairs(v.data.powertrainHydros or {}) do
    if ph.connectedPump == device.name then
  local ptoConsumerNodeNames = jbeamData.hydraulicPTOConsumerCouplerNodeNames or {}
  for _, nodeName in pairs(ptoConsumerNodeNames) do
    if beamstate.nodeNameMap[nodeName] then
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarage2GarageZones.lua

  for spotName, spot in pairs(sitesData.parkingSpots.byName) do
    if spot.zones then
@/lua/vehicle/controller/drivingDynamics/CMU.lua
  M.updateGFX = debugEnabled and updateGFXDebugEnabled or updateGFXDebugNotEnabled
  for _, c in pairs(subControllerLookup) do
    if c.typeName ~= "drivingDynamics/CMU" and c.setDebugMode then
@/lua/ge/extensions/gameplay/backgroundActivities/g2g.lua
        }
        for _, c in pairs(v.configs) do
          local passConfig = true
@/lua/ge/extensions/career/branches.lua
      local children = {}
      for id, branch in pairs(remaining) do
        if branch.parentId == parentId then
    -- Now that all branches are loaded, handle color inheritance
    for _, branch in pairs(branchesById) do
      branch.color = branch.color or getInheritedColor(branch, 'color')
        if mission.careerSetup.showInCareer then
          for branchKey, _ in pairs(mission.unlocks.branchTags) do
            if branchKey == skill.id then
  local saveData = { }
  for id, branch in pairs(getBranches()) do
    saveData[id] = {}
  local data = (savePath and not outdated and jsonReadFile(savePath .. "/career/"..saveFile)) or {}
  for id, branch in pairs(getBranches()) do
    for k, v in pairs(data[id] or {}) do
  for id, branch in pairs(getBranches()) do
    for k, v in pairs(data[id] or {}) do
      --branch[k] = v
local function checkUnlocks()
  for id, branch in pairs(getBranches()) do
    branch.unlocked = true

  for id, branch in pairs(getBranches()) do
    -- for levels
    -- for levels
    for lvl, lvlData in pairs(branch.levels or {}) do
      local unlockFlags = lvlData.unlockFlags or {}
local newAttributeNamesToOldNames = {}
for oldName, newName in pairs(oldAttributeNamesToNewNames) do
  newAttributeNamesToOldNames[newName] = oldName
@/lua/ge/extensions/tech/lidarTest.lua
    local ctr = 0
    for i, s in pairs(activeLidarSensors) do
      ctr = ctr + 1
    local ctr = 0
    for i, s in pairs(lidarPointCloud) do
      ctr = ctr + 1
@/lua/ge/extensions/ui/apps/minimap/topomap.lua
  -- Find bounds from all navgraph nodes
  for nodeId, node in pairs(mapData.nodes) do
    if node.pos then
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
    if iconRendererObj then
      for id, data in pairs(self.iconDataById or {}) do
        data.color = ColorI(0,0,0,0)
    if iconRendererObj then
      for id, _ in pairs(self.iconDataById or {}) do
        iconRendererObj:removeIconById(id)
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
  end
  for key, poisInCluster in pairs(poisByPath) do
    local pm = poisInCluster[1].markerInfo.parkingMarker
@/lua/ge/extensions/core/dynamicProps.lua
function DynamicProps:getFirstPropAvailable()
  for id, value in pairs(self.props) do
    if not value then
  local source
  for id, _ in pairs(self.props) do
    source = scenetree.findObjectById(id)
@/lua/ge/extensions/editor/perfProfiler.lua
      --  self.search:setSameScoreResolvingFunction(sortFun)
      for idx, col in pairs(columns) do
        search:queryElement({
      for _, group in ipairs({"osInfo","cpuInfo","gpuInfo","buildInfo","settingsInfo"}) do
        for key, _ in pairs(allFiles[1][group]) do
          table.insert(columns, {keys = {group, key}, enabled = false})
@/lua/ge/extensions/ui/apps/minimap/roads.lua
    local lIdx = 1
    for nid, n in pairs(map.getMap().nodes) do
      for lid, data in pairs(n.links) do
    for nid, n in pairs(map.getMap().nodes) do
      for lid, data in pairs(n.links) do
        if data.hiddenInNavi then goto continue end
@/lua/common/devUtils.lua
  local res = {}
  for _, entry in pairs(tbl) do
    if type(entry) == 'function' and not visitedEntries[tostring(entry)]  then
  local snapshot = { tables = {}, tablesTmp = {}, vars = {}, extensions = {} }
  for k, v in pairs(_G) do
    if (type(v) == 'table' and (rawget(v, '___type') or rawget(v, '___getters'))) or type(v) == 'function' or k == '_G' or k == 'extensions' or k == 'package' then goto continue end
  -- now cleanup the tables
  for k, v in pairs(snapshot.tablesTmp) do
    if v.module and v.module.__extensionName__ then
local function _tableFindRecursion(tbl, res, path)
  for k, v in pairs(tbl) do
    if type(v) == 'table' then
  local dupeCount = 0
  for k, v in pairs(res) do
    if #v > 1 then
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua

      for key, value in pairs(cleaned.values) do
        if value == true then
  -- Convert map to array
  for _, vehicleModel in pairs(modelsMap) do
    if #vehicleModel.configs > 0 then
      local selectedOptions = {}
      for option, selected in pairs(filter.values) do
        if selected and option ~= 'Other...' then
          if filterInfo then
            for key, _ in pairs(filterInfo) do
              if key ~= 'Other...' and not filter.values[key] then
  local modelList, configList = {}, {}
  for modelName, _ in pairs(core_vehicles.getModelsData()) do
    table.insert(modelList, core_vehicles.getModel(modelName).model)
    table.insert(modelList, core_vehicles.getModel(modelName).model)
    for _, config in pairs(core_vehicles.getModel(modelName).configs or {}) do
      table.insert(configList, config)
        end
        for _, value in pairs(values) do
          filterByProp[propName][value] = true
  for _, model in ipairs(modelList) do
    for _, propName in pairs(filtersWhiteList) do
      local propVal = model[propName]
  -- Then scan configs (for config-level properties like Drivetrain, Config Type, etc.)
  for _, config in pairs(configList) do
    for _, propName in pairs(filtersWhiteList) do
  for _, config in pairs(configList) do
    for _, propName in pairs(filtersWhiteList) do
      local propVal = config[propName]
  local filterUiData = {}
  for _, propName in pairs(filtersWhiteList) do
    if filterByProp[propName] then
        local selectedCount = 0
        for _, selected in pairs(filter.values) do
          if selected then selectedCount = selectedCount + 1 end
        local selectedCount = 0
        for _, selected in pairs(filter.values) do
          if selected then selectedCount = selectedCount + 1 end
          local selectedCount = 0
          for _, selected in pairs(filter.values) do
            if selected then selectedCount = selectedCount + 1 end
          local selectedCount = 0
          for _, selected in pairs(filter.values) do
            if selected then selectedCount = selectedCount + 1 end
  local currentRemovalsCount = 0
  for _ in pairs(e.manualRemovals) do
    currentRemovalsCount = currentRemovalsCount + 1
      e._cachedRemovalsNested = {}
      for configKey, _ in pairs(e.manualRemovals) do
        local model, config = configKey:match("^([^/]+)/(.+)$")
  local allModels = {}
  for modelName, _ in pairs(core_vehicles.getModelsData()) do
    local model = core_vehicles.getModel(modelName)
      local configs = {}
      for configName, _ in pairs(model.configs) do
        table.insert(configs, configName)
@/lua/ge/extensions/util/worker.lua
  local matFiles = FS:findFiles( path, 'materials.cs', -1, true, false)
  for k,v in pairs(matFiles) do
    TorqueScriptLua.exec(v)
  local matFiles = FS:findFiles( path, '*materials.json', -1, true, false)
  for k,v in pairs(matFiles) do
    loadJsonMaterialsFile(v)
@/lua/ge/extensions/core/busRouteManager.lua
  local jFiles = FS:findFiles(mapFolder.."/buslines/", '*.buslines.json', -1, true, false)
  for _,jFilename in pairs(jFiles) do
    local data = jsonReadFile(jFilename)
      if data.version == 1 then
        for k,v in pairs(data.routes) do table.insert( busLines.routes, v ) end
      end
  --checking triggers exist
  for _,route in pairs(busLines.routes) do
    local task_data = {}
    local task_data = {}
    for i,task in pairs(route.tasklist) do
      if triggerPos[task] then
local function setLine(vehId, routeID, variance)
  for k,v in pairs(busLines.routes) do
    if (v.routeID == routeID and v.variance == variance) then
@/lua/ge/extensions/gameplay/police.lua

  for id, veh in pairs(policeVehs) do
    if getObjectByID(id):getActive() then

    for id, veh in pairs(traffic) do
      if id ~= targetId and veh.pursuit.mode >= 1 and veh.pos:squaredDistance(targetVeh.pos) < 6400 then -- during active arrest, clear pursuit level of nearby suspects
  local tempIds = {}
  for pid, p in pairs(policeVehs) do
    if p.role.targetId == id then
  local tempIds = {}
  for pid, p in pairs(policeVehs) do
    if p.role.targetId == id then
  local tempIds = {}
  for pid, p in pairs(policeVehs) do
    if p.role.targetId == id then

  for id, veh in pairs(gameplay_traffic.getTrafficData()) do
    local pursuit = veh.pursuit

                for otherId, otherVeh in pairs(policeVehs) do -- first, check for police vehicles that are out of sight
                  if getObjectByID(otherId):getActive() and otherVeh.role.validTargets[id] and otherVeh.role.validTargets[id].dist > 10000
@/lua/vehicle/extensions/tech/roadsSensor.lua
local function updateGFX(dtSim)
  for sensorId, _ in pairs(roadsSensors) do
    updateRoadsSensorGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(roadsSensors) do
    if vid == objectId then
@/lua/ge/extensions/freeroam/gasStations.lua
      local fuelTranslations = {}
      for fuelType, _ in pairs(fuelTypes) do
        if fuelType ~= "unknown" then
@/lua/ge/extensions/career/modules/milestones/general.lua
  local rewardsLabel = {}
  for _, reward in pairs(milestoneConfig.getRewards(step)) do
    sumChange[reward.attributeKey] = (sumChange[reward.attributeKey] or 0) + reward.rewardAmount
@/lua/vehicle/controller/playerController.lua
local function debugDraw(focusPos)
  for _, v in pairs(debugVectors) do
    obj.debugDrawProxy:drawNodeVector3d(v.thickness or 0.05, v.cid, v.vector, v.color)
  isTouchingGround = false
  for nodeCid, _ in pairs(ballNodes) do
    isTouchingWater = isTouchingWater or obj:inWater(nodeCid)

  for _, beam in pairs(v.data.beams) do
    if beam.tag == jbeamData.stabilizationBeamFront then

  for _, node in pairs(v.data.nodes) do
    if node.tag == "ball" then
@/lua/ge/extensions/career/modules/computer.lua
  -- convert keys of the table to string, because js doesnt support number keys
  for inventoryId, computerFunction in pairs(computerFunctions.vehicleSpecific) do
    computerFunctionsForUI.vehicleSpecific[tostring(inventoryId)] = computerFunction
@/lua/ge/extensions/career/modules/reputation.lua
  for i, levelInfo in ipairs(organization.reputationLevels) do
    for attributeKey, attributeValue in pairs(levelDefaults[i-2]) do
      if levelInfo[attributeKey] then
        if type(levelInfo[attributeKey]) == "table" then
          for key, value in pairs(attributeValue) do
            levelInfo[attributeKey][key] = levelInfo[attributeKey][key] or value
@/lua/console/bananabench-csv.lua

  for vecname, v in pairs(res.tests) do
    for i, test in ipairs(v.tests) do
@/lua/vehicle/hydros.lua
  table.insert(rCurve, 1, {0,0})
  for i, p in pairs(rCurve) do
    p[1] = p[1]/maxx

  for k, f in pairs(inputFlex) do
    local eval = electrics.values[k]
  if v.data.hydros then
    for _, h in pairs(v.data.hydros) do
      h.fIsBroken = obj.beamIsBroken
  if v.data.torsionHydros then
    for _, h in pairs(v.data.torsionHydros) do
      h.fIsBroken = obj.torsionbarIsBroken

  for _, h in pairs(M.hydros) do
    h.inputCenter = h.inputCenter * h.inputFactor
  table.clear(poweredWheelIndices)
  for index, wheel in pairs(wheels.wheels) do
    if poweredWheelNames[wheel.name] then

  for _,h in pairs(M.hydros) do
    h.state = h.center + 1e-28 -- so as it initializes correctly
@/gameplay/missionTypes/chase/constructor.lua
  unlockedStars.completeTraffic = false
  for id, v in pairs(gameplay_traffic.getTrafficData()) do
    if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/vehicle/powertrain/manualGearbox.lua
    }
    for gearIndex, _ in pairs(device.gearRatios) do
      integrityState.synchroWear[gearIndex] = 0

  for k, v in pairs(device.initialGearRatios) do
    device.gearRatios[k] = v
  local reverseGears = {}
  for _, v in pairs(jbeamData.gearRatios) do
    table.insert(v >= 0 and forwardGears or reverseGears, v)
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsOutput) do
      device.gearWhineCoefsOutput[gearIndex] = v
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsInput) do
      device.gearWhineCoefsInput[gearIndex] = v
  local synchroSettingLookup = {}
  for _, settings in pairs(synchroSettings) do
    if settings.gearIndex then
  device.synchroWearCoef = {}
  for i, _ in pairs(device.gearRatios) do
    local gearSettings = synchroSettingLookup[i] or {}
  if not jbeamData.synchronizerSettings then
    for i, _ in pairs(device.gearRatios) do
      if i >= 0 then
@/lua/common/jbeam/slotSystem.lua
    -- traversal of hidden values
    hidden = function() return pairs(mt.__index) end,
    -- traversal of table ordered: returning index, key
    -- traversal of table
    pairs = function(self) return pairs(self) end,
    -- traversal of table ordered: returning key,value
  -- walk and merge all sections
  for sectionKey, section in pairs(source) do
    if sectionKey == 'slots' or sectionKey == 'slots2' or sectionKey == "information" then
        local slotOptionReset = {}
        for k4, v4 in pairs(localSlotOptions) do
          slotOptionReset[k4] = ""
      local localSlotOptions = nil
      for k3, v3 in pairs(section) do
        if tonumber(k3) ~= nil then
        local slotOptionReset = {}
        for k4, v4 in pairs(localSlotOptions) do
          slotOptionReset[k4] = ""
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
    local valid = true
    for k, v in pairs(filters) do -- optional filters by traffic vehicle properties
      if veh[k] ~= nil and veh[k] ~= v then
@/lua/vehicle/controller/tech/cosimulationCoupling.lua
  local ctr = 1
  for _, wheel in pairs(wheels.wheels) do
    wNodePos[ctr] = obj:getNodePosition(wheel.node1)
local function electricsName2Id(name)
  for k, _ in pairs(electrics.values) do                                                            -- First check the first-level keys (which the name already is).
    if k == name then
local function powertrainName2Ids(name)
  for k, dev in pairs(powertrain.getDevices()) do
    if string.find(name, dev.name) then
  local wheelIds, wOrderCtr = wheelIds, 1
  for k, _ in pairs(wheelIds) do
    wheelsOrder[wOrderCtr] = k
  local ctr = 1
  for _, v in pairs(dTable) do
    inDMap[ctr] = v
  ctr = 1
  for _, v in pairs(wTable) do
    inWMap[ctr] = v
  local propulsionTorques = inTorques[1]
  for k, _ in pairs(pTorqueKeys) do                                                                 -- Set wheel propulsion torque only if set to be controlled by 3rd party.
    local wheel = wheelRotators[k]
  local brakeTorques = inTorques[2]
  for k, _ in pairs(bTorqueKeys) do                                                                 -- Set wheel braking torque only if set to be controlled by 3rd party.
    wheelRotators[k].desiredBrakingTorque = -brakeTorques[k]
  local frictionTorques = inTorques[3]
  for k, _ in pairs(fTorqueKeys) do                                                                 -- Set wheel friction torque only if set to be controlled by 3rd party.
    wheelRotators[k].frictionTorque = frictionTorques[k]
@/lua/ge/extensions/editor/api/dynamicDecals/textures.lua

  -- for k, v in pairs(tagsWithRefs) do
  --   print(string.format("%s : %d", k, #v))
@/lua/ge/extensions/career/modules/insurance/repairScreen.lua
  if insuranceModule.doesInsuranceExist(insuranceId) then
    for _, choiceData in pairs(data.repairOptions.insuranceRepairData.repairTimeOptions.choices) do
      if choiceData.id == defaultRepairTimeChoiceData.currentValueId then

  for _, choiceData in pairs(data.repairOptions.noInsuranceRepairData.repairTimeOptions.choices) do
    local totalPrice = choiceData.premiumInfluence + data.vehicleData.damageCost
@/lua/ge/extensions/gameplay/crashTest/crashTestScoring.lua
  for _, stepScoreData in ipairs(scoringDataPerStep) do
    for _, scoreData in pairs(stepScoreData) do
      totalScore = totalScore + scoreData.score
@/lua/ge/extensions/flowgraph/nodes/ui/missionEndScreen.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    local contained = false
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    if nm == action then
  self:closeDialogue()
  for _,pn in pairs(self.pinOut) do
    pn.value = false
@/lua/vehicle/controller/tech/screens.lua

  for _, screen in pairs(screens) do
    local queueString = string.format("extensions.tech_multiscreen.addVehicleView(%q, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, %s)",
@/lua/ge/extensions/core/vehicle/mirror.lua
  if #offset then
    for k,v in pairs(offset) do
      M.setAngleOffset(k,v.angleOffset.x,v.angleOffset.z, veh)
  local mytable = {}
  for k,v in pairs(vdata.vdata.mirrors ) do
    if v.mesh then
  local mid = -1
  for i in pairs(vdata.vdata.mirrors) do
    if vdata.vdata.mirrors[i].mesh == mirrorName then
      imguiSliderData = {}
      for k,v in pairs(imguiMirrordata) do
        imguiSliderData[k] = {im.FloatPtr(v.angleOffset.x or 0), im.FloatPtr(v.angleOffset.z or 0)}
      if im.Button("save") then
        for k,v in pairs(imguiMirrordata) do
          setAngleOffset(k,imguiSliderData[k][1][0], imguiSliderData[k][2][0], nil, true)
      local focusedAny = false
      for k,v in pairs(imguiMirrordata) do
        im.TextUnformatted(dumps(k))
  local viewFrustum = Engine.sceneGetCameraFrustum()
  for i in pairs(vdata.vdata.mirrors) do
    if vdata.vdata.mirrors[i].mesh == mirror_name then
@/lua/vehicle/extensions/tech/platooning.lua
  local keys = {}
  for key in pairs(tbl) do
    table.insert(keys, key)
local function getMass()  -- !!!!!!!!!!!!!!!!!!
  for _, n in pairs(v.data.nodes) do
    mass = mass + n.nodeWeight
  local sum = 0
  for _,v in pairs(t) do
    sum = sum + v
  local vehicles, ctr = {}, 1
  for k, v in pairs(mapmgr.getObjects()) do
    if k == tonumber(vehicleInfront) then -- for dmpc key
    for i, vehicles in ipairs(relayVehicles) do 
      for k, v in pairs(mapmgr.getObjects()) do
        if k == tonumber(vehicles) then
  if next(simData) ~= nil then  -- simData contains the data of the closest vehicles
    for k, v in pairs(simData) do
      if type(v) == "table" then
        if k =="closestVehicles1" then  -- closest detected vehicle
          for k2,v2 in pairs(v) do
            if k2 == "distToPlayerVehicleSq" then
@/lua/common/jbeam/sections/licenseplatesSkins.lua

  for partName, part in pairs(activePartsData or {}) do
    if part.slotType then
@/lua/ge/extensions/flowgraph/nodes/thread/receiveMessage.lua
  if not self.done and self.pinIn.flow.value and self.pinIn.name.value and self.message then
    for name, pin in pairs(self.pinOut) do
      self.pinOut[name].value = self.message[name] or nil
@/lua/common/jbeam/sections/assorted.lua
    local newTable = {}
    for _, v in pairs(vehicle.soundscape) do
      newTable[v.name] = v
@/lua/ge/extensions/editor/terrainEditor.lua
  local name = initialName .. (counter or "")
  for k, mtl in pairs(materialsInJson) do
    if mtl.internalName == name then

  for uniqueID, jsonMtl in pairs(jsonMaterials) do
    if jsonMtl.class ~= "TerrainMaterialTextureSet" then
local function selectPaintMaterialByName(internalName)
  for _, mtl in pairs(paintMaterialProxies) do
    if mtl.internalName == internalName then
  -- attach all terrain blocks
  for tbName, tbData in pairs(terrainBlockProxies) do
    local tb = scenetree.findObjectById(tbData.id)
  -- check if the TerrainBlock with the given name already exist
  for tbName, tbData in pairs(terrainBlockProxies) do
    if string.lower(tbName) == string.lower(terrBlockName) then
  local success = false
  for tbName, tbData in pairs(terrainBlockProxies) do
    local tb = scenetree.findObjectById(tbData.id)
  else
    for name, tbData in pairs(terrainBlockProxies) do
      if tbData then tbData.selected = false end
  if im.BeginCombo("##availableMaterials", "") then
    for id, mat in pairs(materialsInJson) do
      if not hasPaintMaterial(mat.internalName) then
      end
      for id, notification in pairs(notifications) do
        im.TextColored(im.ImVec4(1.0, 0.73, 0.04, 1.0), notification)
    if im.CollapsingHeader1("Select Terrain(s)", im.TreeNodeFlags_DefaultOpen) then
      for tbName, tbData in pairs(terrainBlockProxies) do
        im.Spacing()
  profilerPushEvent("terrainEditor terrainToolsEditModeUpdate")
  for tbName, tbData in pairs(terrainBlockProxies) do
    local tb = scenetree.findObjectById(tbData.id)
M.deleteMaterialInJson = function (name)
  for id, value in pairs(materialsInJson) do
    if value.internalName == name then
M.getTerrainBlockMaterialIndex = function (name)
  for id, value in pairs(paintMaterialProxies) do
    if value.internalName == name then
@/lua/vehicle/extensions/gameplayInterfaceModules/interactMisc.lua
local function latchesOpen()
  for k, v in pairs(controller.getControllersByType("advancedCouplerControl")) do
    v.detachGroup()
local function latchesClose()
  for k, v in pairs(controller.getControllersByType("advancedCouplerControl")) do
    v.tryAttachGroupImpulse()
@/lua/vehicle/extensions/tech/trailSim.lua
    extensions.load("cruiseControl")
    for _, wheel in pairs(wheels.wheels) do
      if wheel.name == "FR" then
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
local function saveBrushesToFile()
  for _, brush in pairs(brushes) do
    if brush["dirty"] then
@/lua/ge/extensions/gameplay/rally/notebook/structured/schema.lua
M.initDefaultFields = function(fields)
  for fieldName, _ in pairs(M.schema) do
    fields[fieldName] = M.schema[fieldName].default
@/lua/ge/extensions/flowgraph/nodes/ui/endStats.lua
      for _, p in ipairs(pinsPerStat) do
        for _, lnk in pairs(self.graph.links) do
          if lnk.targetPin == self.pinInLocal[p[1]..'_'..i] then
@/lua/ge/extensions/editor/biomeTool.lua
    local elements = getElementsForBrush(brushName)
    for id, elementName in pairs(elements) do
      forestBrushElements[id] = elementName
local function removeItemsActionUndo(actionData)
  for _, item in pairs(actionData.items) do
    editor.addForestItem(var.forestData, item)
local function removeItemsActionRedo(actionData)
  for _, item in pairs(actionData.items) do
    editor.removeForestItem(var.forestData, item)
local function addItemsActionUndo(actionData)
  for _, item in pairs(actionData.items) do
    editor.removeForestItem(var.forestData, item)
local function addItemsActionRedo(actionData)
  for _, item in pairs(actionData.items) do
    editor.addForestItem(var.forestData, item)
local function replaceItemsActionUndo(actionData)
  for i, item in pairs(actionData.newItems) do
    editor.removeForestItem(var.forestData, item)
  end
  for i, item in pairs(actionData.oldItems) do
    editor.addForestItem(var.forestData, item)
local function replaceItemsActionRedo(actionData)
  for _, item in pairs(actionData.oldItems) do
    editor.removeForestItem(var.forestData, item)
  end
  for _, item in pairs(actionData.newItems) do
    editor.addForestItem(var.forestData, item)
        local delItems = {}
        for _, item in pairs(itemsToDel) do
          table.insert(delItems, item)
        ---local forestData = forest:getData()
        ---for _, item in pairs(itemsToAdd) do
          --local uids = forestData:generateAndSetItemUid(itemKeys)
        local delItems = {}
        for _, item in pairs(itemsToDel) do
          table.insert(delItems, item)
            local delItems = {}
            for _, item in pairs(itemsToDel) do
              table.insert(delItems, item)
            local delItems = {}
            for _, item in pairs(itemsToDel) do
              table.insert(delItems, item)
@/lua/vehicle/controller/gauges/customModules/combustionEngineData.lua
  engines = powertrain.getDevicesByType("combustionEngine")
  for _, v in pairs(engines) do
    for _, j in pairs(v.registeredEnergyStorages) do
  for _, v in pairs(engines) do
    for _, j in pairs(v.registeredEnergyStorages) do
      table.insert(fuelTanks, j)
@/lua/ge/extensions/freeroam/dragRace.lua
local function resetLights()
  for _,group in pairs(lights) do
    for _,light in pairs(group) do
  for _,group in pairs(lights) do
    for _,light in pairs(group) do
      if light.obj then
  local vehicleConfigs = {}
  for i,v in pairs(configs.configs) do
    local model = core_vehicles.getModel(v.model_key).model

    for _,v in pairs(vehicleConfigs) do
      if currentConfig == (v.model_key .. " " .. v.key) then

    for i,v in pairs(vehicleConfigs) do
      if (v["0-100 km/h"] and zeroToHundred)then

    for i,v in pairs(similarVehicles) do
      similarVehicleCount = similarVehicleCount + 1
    local vehiclesConfigs = {}
    for _,v in pairs(vehicleConfigs) do
      table.insert(vehiclesConfigs, v)
    if started == true then
      for i,v in pairs(vehicles) do
        if v.lane == "right" and v.id == data.subjectID then
@/lua/ge/extensions/util/inputSystemUtils.lua
  local res = {}
  for k, v in pairs(tbl) do
    table.insert(res, {k, v})
@/lua/common/extensions/networking/editorToolchain.lua
  local messages = server:receiveData()
  for _, msg in pairs(messages or {}) do
    onData(msg[1], msg[2])

  for connection, subs in pairs(subscriptions) do
    for _, sub in ipairs(subs) do
        local vPos = veh:getPosition()
        for _, node in pairs(vData.vdata.nodes) do
          local name = node.name or tostring(node.cid)
@/lua/ge/extensions/editor/api/gui.lua
local function hideAllWindows()
  for key, val in pairs(windowsState) do
    if val.visible[0] then
local function setWindowGroupVisibility(groupName, visible)
  for key, val in pairs(windowsState) do
    if val.groupName == groupName then
  state.version = WindowsStateFileFormatVersion
  for key, val in pairs(windowsState) do
    -- we do this because we cant serialize ffi and C++ objects

  for key, val in pairs(windowsState) do
    val.isVisible = false
  -- copy over the state for each window
  for key, val in pairs(wstate.windowsState or {}) do
    windowsState[key] = val
  -- resolve the size, pos and visibility
  for key, val in pairs(windowsState) do
    val.visible = imgui.BoolPtr(val.isVisible or false)
local function callShowWindowHookForVisibleWindows()
  for key, val in pairs(windowsState) do
    if val.visible[0] then
local function defocusFocusedWindow()
  for key, val in pairs(windowsState) do
    if val.focused then
@/lua/vehicle/controller/couplings/fifthwheel.lua
  table.clear(kingpinTimeoutsToDelete)
  for obj2Id, _ in pairs(kingpinRequestTimeouts) do
    kingpinRequestTimeouts[obj2Id] = kingpinRequestTimeouts[obj2Id] - dt
    local minDistanceNodeCid
    for objId, nodeData in pairs(kingpinCache) do
      for nodeCid, data in pairs(nodeData) do
    for objId, nodeData in pairs(kingpinCache) do
      for nodeCid, data in pairs(nodeData) do
        if data.distance < minDistance then
@/lua/ge/extensions/editor/tech/roadArchitect/roads.lua
      local startWidth = nil
      for k, v in pairs(n.widths) do
        if r.profile[k].type == 'road_lane' then
      local laneWidth = max(0.5, min(10.0, startWidth + offset))
      for k, _ in pairs(n.widths) do
        if r.profile[k].type == 'road_lane' then
@/gameplay/missionTypes/targetjump/customNodes/CreateZoneStringNode.lua
  local uniquePointZones = {}
  for _, zone in pairs(zones.objects) do
    for _, uniqueZone in ipairs(uniquePointZones) do
  local string = "Hitting the colored zones gives you points:
    " for _, z in pairs(uniquePointZones) do string = string.."
  • "..z.customFields:get('points').." Points for Zones
  • "
@/lua/ge/extensions/ui/vehicleSelector/tiles.lua
  context.profiler:add("setupValidFilters")
  for _, config in pairs(data.configs) do
    -- VEHICLE-SPECIFIC: Uses vehicle-specific filter logic
  local favouriteGroup, recentGroup = {tiles = {}}, {tiles = {}}
  for _, config in pairs(validConfigs) do
    -- GENERIC: Get groups for item (could work for any item type)
    local groupsForConfig = context.groupingModule.getGroupsForConfig(config, data.displayData.groupMode, data.displayData)
    for _, group in pairs(groupsForConfig) do
      local groupName, groupOrder = group.groupName, group.groupOrder
  -- GENERIC: Process each group to create tiles
  for _, group in pairs(groups) do
    -- Skip clustering for special groups in unclustered mode
      -- Convert configs directly to tiles without clustering
      for _, config in pairs(group.unclusteredConfigs) do
        local tile = context.itemToTileConverter(config, true)
      -- GENERIC: Create tiles for each cluster
      for _, clusteredItems in pairs(itemsClustered) do
        local tiles = context.processClusteredItems(clusteredItems, group, data.displayData.clusterMode)
        -- GENERIC: Add tiles to groups and handle special groups (favourites/recent)
        for _, tile in pairs(tiles) do
          table.insert(group.tiles, tile)
  -- GENERIC: Automatic sorting based on group type and display settings
  for _, group in pairs(groups) do
    --print(string.format("sorting group %s with mode %s %s (in handleAllModelsPath)", group.key, data.displayData.sortMode, data.displayData.groupMode))
  -- VEHICLE-SPECIFIC: Iterate through vehicle configurations
  for _, config in pairs(model.configs) do
    -- VEHICLE-SPECIFIC: Filter by vehicle submodel
@/lua/common/event.lua
function Event.call(self, ...)
  for f, _ in pairs(self.__subscribers) do f(...) end
end
@/lua/ge/extensions/gameplay/missions/proceduralMissionGenerators/timeTrialMissions.lua
            }
            for key, _ in pairs(autoPrefabs) do
              for i, p in ipairs(mission.missionTypeData[key] or {}) do
            -- add automatic prefabs only if they exist
            for list, suf in pairs(autoPrefabs) do
              for _, ext in ipairs(prefabExt) do
@/lua/common/extensions/tech/techCapture.lua
  local filteredFiles = {}
  for i, file in pairs(files) do -- this is a more fine-grained filter to preserve files with similar capture names
    local _, filename = path.split(file)
  elseif t == 'table' then
    for k, v in pairs(data) do
      data[k] = convertBinaryDataToString(v)
  local requestData = {}
  for key, value in pairs(request) do
    if key ~= 'skt' and key ~= 'handled' then
@/lua/ge/extensions/scenario/quickRace.lua
    fg = core_flowgraphManager.loadManager(sc.track.flowgraph.file)
    for name, value in pairs(sc.track.flowgraph.variables or {}) do
      fg.variables:changeBase(name, value)
  if sc.generatedNodes then
    for k, v in pairs(sc.generatedNodes) do
      sc.nodes[k] = v
  if sc.track.reverse then
    for _, node in pairs(sc.nodes) do
      if node.rot ~= nil then
@/lua/common/jbeam/sections/events.lua
  if vehicle.events ~= nil then
    for _, ab in pairs(vehicle.events) do
      _cleanupRows(ab)

    for _, ab in pairs(vehicle.triggers) do
      _cleanupRows(ab)

    for _, lnk in pairs(vehicle.triggerEventLinks) do
      if not lnk.targetEventId then

    for _, lnk in pairs(vehicle.triggerEventLinks2) do
      if not lnk.triggerId then
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
  device.consumerJbeamData = {}
  for _, ph in pairs(v.data.powertrainHydros) do
    if ph.connectedPump == device.name then
  local ptoSupplyNodeNames = jbeamData.hydraulicPTOSupplyCouplerNodeNames or {}
  for _, nodeName in pairs(ptoSupplyNodeNames) do
    if beamstate.nodeNameMap[nodeName] then
  local ptoConsumerNodeNames = jbeamData.hydraulicPTOConsumerCouplerNodeNames or {}
  for _, nodeName in pairs(ptoConsumerNodeNames) do
    if beamstate.nodeNameMap[nodeName] then
@/lua/ge/extensions/editor/api/genericInspector.lua
  local count = 0
  for k, v in pairs(tbl) do
    if type(k) ~= "number" then return false else count = count + 1 end
  -- set the sorted fields array and sort the array fields
  for _, field in pairs(fields) do
    if tableIsArray(field.value) then field.elementCount = #field.value end
      field.sortedFields = {}
      for _, fld in pairs(field.fields) do
        if tableIsArray(fld.value) then fld.elementCount = #fld.value end
      --TODO: use modifiers from the main editor inspector
      for k, v in pairs(self.inspectorFieldModifiers) do
        if v.callback then
@/lua/vehicle/controller/vehicleController/vehicleController.lua
  local hasPressureWheels = false
  for _, wi in pairs(wheels.wheels) do
    if wi.isPropulsed and not wi.isBroken then
  local newBehavior = gearboxHandling.behavior
  for _, v in pairs(gearboxHandling.behaviors) do
    if found then
  local torqueCurve = engine.torqueData.curves[engine.torqueData.finalCurveName].torque
  for k, v in pairs(gearbox.gearRatios) do
    local shiftUpRPM = nil
  -- local energyStorageCount = 0
  -- for _, s in pairs(controlLogicModule.energyStorages or {}) do
  --   local energyStorage = energyStorage.getStorage(s)
    local jbeamDataCopy = deepcopy(jbeamData)
    for _, v in pairs(shiftRPMNames) do
      if type(jbeamDataCopy[v]) ~= "table" then
  gearboxHandling.behaviorLookup = {}
  for _, v in pairs(gearboxHandling.behaviors) do
    gearboxHandling.behaviorLookup[v] = true
  local energyStorageCount = 0
  for _, s in pairs(controlLogicModule.energyStorages or {}) do
    local energyStorage = energyStorage.getStorage(s)

  --for _, v in pairs(drivingStrategy.core.strategies) do
  --  drivingStrategy[v] = require(drivingStrategyModuleDirectory .. v)
@/lua/ge/extensions/core/vehicle/partmgmt.lua
      if node.children then
        for _, childNode in pairs(node.children) do
          recGetPart(childNode, outPartsHighlighted, outPartsHighlightedIdxs, outPartNameToIdx)
  -- enrich the data a bit for the UI
  for partName, uiPartInfo in pairs(availableParts) do
    local richPartInfo = {}
      if not node then return end
      for slotId, child in pairs(node.children or {}) do
        legacySlotMap[child.path] = {
    -- now simplify it
    for path, slotData in pairs(legacySlotMap) do
      if not legacySlotMapSimple[slotData.slotId] then
    -- now discard the complex data
    for key, slotData in pairs(legacySlotMapSimple) do
      if slotData ~= "COLLISION" then
    if not node then return end
    for slotId, child in pairs(node.children or {}) do
      legacySlotMap[child.path] = {
  -- now simplify it
  for path, slotData in pairs(legacySlotMap) do
    if not legacySlotMapSimple[slotData.slotId] then
  -- now discard the complex data
  for key, slotData in pairs(legacySlotMapSimple) do
    if slotData ~= "COLLISION" then
      if node.children then
        for _, childNode in pairs(node.children) do
          if setPaintDesignSlotRec(childNode) then

  for _, file in pairs(files) do
    local basename = string.sub(file, string.len(playerVehicle.vehicleDirectory) + 1, -1)
  if vdata.flexbodies then
    for _, flexbody in pairs(vdata.flexbodies) do
      if flexbody.mesh and flexbody.mesh ~= "" and flexbody.meshLoaded then
  if vdata.props then
    for _, prop in pairs(vdata.props) do
      if prop.mesh and prop.mesh ~= "" and prop.mesh ~= "SPOTLIGHT" and prop.mesh ~= "POINTLIGHT" then
    if node.children then
      for _, childNode in pairs(node.children) do
        highlightNode(childNode)
    if node.children then
      for _, childNode in pairs(node.children) do
        recHighlightNode(childNode, highlight)
@/lua/ge/extensions/util/trackBuilder/basicCenters.lua

for _,shape in pairs(shapes) do computeFaces(shape) end
M.getMeshes = getMeshes
@/lua/ge/extensions/career/modules/branches/leagues.lua
M.clearLeagueUnlockCache = function()
  for _, league in pairs(leaguesById) do league._unlocked = nil end
  starsBySkillCache = {}
  local ret = {}
  for id, _ in pairs(leaguesById) do
    ret[id] = M.isLeagueUnlocked(id)
        local validSkills = {}
        for _, skill in pairs(career_branches.getBranches()) do
          if skill.parentBranch == condition.branchId then
  local ret = {}
  for id, l in pairs(leaguesById) do
    local league = formatLeague(l)
  local ret = {}
  for id, l in pairs(leaguesById) do
    if not before[id] and after[id] then
  local ret = {}
  for id, l in pairs(leaguesById) do
    if tableContains(l.missions, missionId) then
  local leaguesBySkill = {}
  for id, league in pairs(leaguesById) do
    if not leaguesBySkill[league.skillId] then
  -- Sort leagues within each skill group
  for skillId, skillLeagues in pairs(leaguesBySkill) do
    -- First sort by skill stars and file order
  local dirtyFilesById = {}
  for id, league in pairs(leaguesById) do
    local validMissionIds = {}
  end
  for mId, m in pairs(missionsById) do
    local lMap = {}

  for skillId, list in pairs(missionIdsBySkillWithoutLeague) do
    local fallbackLeagueId = "fallback_"..skillId
    log("W","","Some ("..tostring(dirty)..") missions were not set up properly for leagues.")
    for mId, count in pairs(dirtyFilesById) do
      log("W","","Mission " .. mId .. " was not set up properly for leagues " .. count .. " times.")
  loadLeagues()
  for _, spot in pairs(spotsById) do
    spot._isInLeague = nil
  end
  for id, league in pairs(leaguesById) do
    for _, dsId in ipairs(league.driftSpots) do
@/lua/ge/extensions/ui/console.lua

      -- for k,v in pairs(logFiltered) do
      --   lines_count = lines_count+1
          --   local tmp
          --   for k,v in pairs(logFiltered) do
          --     if type(v) == number and (i+logsHead+offset) >k and (i+logsHead+offset)<=v then tmp = true; print("brk");break; end
@/lua/ge/extensions/flowgraph/nodes/career/onRefueling.lua
function C:work(args)
  for _, pin in pairs(self.pinOut) do
    if pin.type == "flow" then
  end
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/gameplay/missionTypes/aiRace/customNodes/collisionTrackingNode.lua

  for id, v in pairs(self.pinIn.raceData.value.states) do
    if self.pinIn.vehId.value ~= id and map.objects[id] then
@/lua/common/libs/luamqtt/mqtt/protocol5.lua
		local order = {}
		for name, value in pairs(args.properties) do
			assert(type(name) == "string", "expecting property name to be a string: "..tostring(name))
		local order = {}
		for name, val in pairs(args.user_properties) do
			local ntype = type(name)
@/lua/ge/spawn.lua
  --Walk through the groups until we find a valid object
  for i,v in pairs(spawnDefaultGroups) do
    if scenetree.findObject(spawnDefaultGroups[i]) then
@/lua/vehicle/extensions/tech/idealRADARSensor.lua
local function updateGFX(dtSim)
  for sensorId, _ in pairs(idealRADARs) do
    updateIdealRADARsGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(idealRADARs) do
    if vid == objectId then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
local function analyzeJBeamFile(filePath, fileName, jbeamFileData)
  for parts, partData in pairs(jbeamFileData) do
    for section, sectionData in pairs(partData) do
  for parts, partData in pairs(jbeamFileData) do
    for section, sectionData in pairs(partData) do
      --if section == 'beams' or section == 'nodes' or section == 'triangles' or section == 'flexbodies' or section == 'props' or section == 'torsionbars' then
          if mods then
            for modifier, _ in pairs(mods) do
              if not allSections[section][modifier] then
          if mods then
            for modifier, _ in pairs(mods) do
              if not allSections.beams[modifier] then
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
      im.BeginChild1("DynamicDecals_Notification_NotificationsChild", im.ImVec2(0, im.GetContentRegionAvail().y - (math.ceil(im.GetFontSize()) + 2*style.ItemSpacing.y)), true)
      for sectionName, sectionData in pairs(notifications) do
@/lua/ge/extensions/flowgraph/nodes/ui/customUiLayout.lua
    local sorted = {}
    for key, layout in pairs(layouts) do
      if type(layout) == "table" and #layout > 0 then
@/lua/vehicle/powertrain/rangeBox.lua
  local reverseGears = {}
  for _, v in pairs(jbeamData.gearRatios) do
    table.insert(v >= 0 and forwardGears or reverseGears, v)
@/lua/common/libs/LuaIRC/init.lua
    if hooks then
        for id,f in pairs(hooks) do
            if f(...) then
            if (type(t)=="table") then
                for pos,val in pairs(t) do
                    if (type(val)=="table") then
@/lua/ge/extensions/util/saveDynamicData.lua
  local blacklistLookup = {}
  for _, v in pairs(vehicleBlacklist) do
    blacklistLookup[v] = true
  local filteredConfigs = {}
  for k, v in pairs(configs) do
    if (not vehicleToTest or v.model_key == vehicleToTest) and ((not pcFileToTest or pcFileToTest == "") or v.key == pcFileToTest) and not blacklistLookup[v.model_key] then
  local progressCount = 1
  for _, v in pairs(filteredConfigs) do
    local vehName = v.model_key
  log("I", logTag, "Vehicles that are skipped:")
  for _, value in pairs(vehicleBlacklist) do
    log("I", logTag, value)
@/lua/ge/extensions/gameplay/rally/tools/rallyToolbox.lua
  -- Preload items: Populates the self.items table
  for id, item in pairs(self.racePathAiPath) do
    kdT:preLoad(id, item.x, item.y, item.z)
--   -- Preload items: Populates the self.items table
--   for id, item in pairs(self.pacenoteWaypoints) do
--     kdT:preLoad(id, item.x, item.y, item.z)

  for id, item in pairs(self.routeWaypointsIndex) do
    kdT:preLoad(id, item.pos.x, item.pos.y, item.pos.z)
@/lua/ge/extensions/ui/liveryEditor/resources.lua
  M.textures = {}
  for tag, taggedTextures in pairs(taggedTextures) do
    local categorizedTextures = {

    for key, file in pairs(taggedTextures) do
      local _, filename, _ = path.split(file)
@/lua/ge/extensions/flowgraph/link.lua
  local targetPins = {}
  for _, link in pairs(self.graph.links) do
    if link.sourcePin == sourcePin then
    local foundName = false
    for _, node in pairs(self.graph.nodes) do
      for _, pin in pairs(node.pinList) do
    for _, node in pairs(self.graph.nodes) do
      for _, pin in pairs(node.pinList) do
        if pin.quickAccess and pin.accessName == name then
  sourcePin.accessName = name
  for _,pin in pairs(targetPins) do
    pin.quickAccess = true
@/lua/ge/extensions/freeroam/levelStats.lua
  local result = {}
  for levelName, data in pairs(getStats().levels) do
    table.insert(result, { levelName = levelName, count = data.count, lastUsed = data.lastUsed })
  local result = {}
  for spawnPointName, data in pairs(getStats().levels[levelName] and getStats().levels[levelName].spawnPoints or {}) do
    table.insert(result, { spawnPointName = spawnPointName ~= "__default__" and spawnPointName or nil, count = data.count, lastUsed = data.lastUsed })
@/lua/vehicle/powertrain/combustionEngine.lua

  for k, v in pairs(device.torqueCurve) do
    if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then

    for k, v in pairs(device.torqueCurve) do
      if type(k) == "number" and k < maxRPM then
local function updateEnergyStorageRatios(device)
  for _, s in pairs(device.registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
  local remainingFuelRatio = 0
  for _, s in pairs(device.registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
  local nodeCids = {}
  for _, nodePair in pairs(exhaustNodeIDPairs) do
    table.insert(nodeCids, nodePair[2])
  local nodeCids = {}
  for _, nodePair in pairs(exhaustNodeIDPairs) do
    table.insert(nodeCids, nodePair[2])
      endNodeIDPairs = {}
      for _, v in pairs(endNodes) do
        maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
  bdebug.clearTypeNodeDebugText("CombustionEngine " .. device.name)
  for _, soundData in pairs(device.soundLocations) do
    for _, nodeCid in ipairs(soundData.nodes) do
          endNodeIDPairs = {}
          for _, v in pairs(device.thermals.exhaustEndNodes) do
            maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
          endNodeIDPairs = {}
          for _, v in pairs(exhaustEndNodes) do
            maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
    local hasValidReactioNodes = true
    for _, v in pairs(torqueReactionNodes_nodes) do
      if type(v) ~= "number" then
  local maxAvailableRPM = 0
  for _, v in pairs(baseTorqueTable) do
    maxAvailableRPM = max(maxAvailableRPM, v.rpm)
    local rawTorqueMultPoints = {}
    for _, v in pairs(multTorqueTable) do
      maxAvailableRPM = max(maxAvailableRPM, v.rpm)
    local rawIntakePoints = {}
    for _, v in pairs(intakeTorqueTable) do
      maxAvailableRPM = max(maxAvailableRPM, v.rpm)
    local rawExhaustPoints = {}
    for _, v in pairs(exhaustTorqueTable) do
      maxAvailableRPM = max(maxAvailableRPM, v.rpm)
    local rawPoints = {}
    for _, v in pairs(compressionBrakeTorqueTable) do
      maxAvailableRPM = max(maxAvailableRPM, v.rpm)
  tempBurnEfficiencyTable = {}
  for k, v in pairs(copy) do
    if type(k) == "number" then
  device.invBurnEfficiencyCoef = 1
  for k, v in pairs(tempBurnEfficiencyTable) do
    device.invBurnEfficiencyTable[k] = 1 / v
@/lua/ge/extensions/career/modules/vehicleShopping.lua
local function removeUnusedPlayerVehicles()
  for inventoryId, vehId in pairs(career_modules_inventory.getMapInventoryIdToVehId()) do
    if inventoryId ~= career_modules_inventory.getCurrentVehicle() then

  for partName, part in pairs(newParts) do
    part.year = vehicle.year
    if part.description.slotInfoUi then
      for slot, _ in pairs(part.description.slotInfoUi) do
        allSlotsInVehicle[slot] = true
  --[[ local slotsToRemove = {}
  for slot, partName in pairs(vehicle.config.parts) do
    if not allSlotsInVehicle[slot] then
  end
  for slot, _ in pairs(slotsToRemove) do
    vehicle.config.parts[slot] = nil
  -- in both cases we change the slot to a unified ""
  for slot, partName in pairs(vehicle.config.parts) do
    if not vehicle.originalParts[slot] then
  local inspectedVehicleInfo = career_modules_inspectVehicle.getSpawnedVehicleInfo()
  for shopId, status in pairs(vehicleWatchlist) do
    if status == "unsold" and (not inspectedVehicleInfo or inspectedVehicleInfo.shopId ~= shopId) then
@/lua/ge/extensions/gameplay/drag/debug.lua
local function getLastElement(dragData)
  for vehId,_ in pairs(dragData.racers) do
    selectedVehicle = vehId

      for nameType, p in pairs(dragData.prefabs) do
        im.Text("Prefab: " .. nameType)
      end
      for vehId, _ in pairs(dragData.racers or {}) do
        if im.Selectable1(string.format("Racer ID: %d Lane: %d", vehId, dragData.racers[vehId].lane), vehId == selectedVehicle) then
          im.Text("(Click to dump, hover to preview)")
          for key, laneData in pairs(dragData.strip.lanes[dragData.racers[selectedVehicle].lane]) do
            if im.Button("Lanedata: " .. key) then
@/lua/ge/extensions/editor/tech/roadArchitect/profiles.lua

  for k, nativeLaneType in pairs(lNew) do
    profile[k] = {
@/lua/ge/extensions/core/multiSpawn.lua

  for k, filter in pairs(params.filters) do -- each inner table pair should have a coefficient: {Type = {car = 1, truck = 0.4}}
    local configValue = config[k] or 'default' -- unsure about this actually
      local filterKeyFound = false
      for k, v in pairs(configValue) do
        if type(filter[k]) == 'number' then -- filter value

  for _, model in pairs(core_vehicles.getModelList().models) do
    local officialModel = isOfficialSource(model)

      for _, config in pairs(core_vehicles.getModel(model.key).configs) do
        local officialConfig = isOfficialSource(config)
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
function C:hasFoldersOnly(dir)
  for k,v in pairs(dir) do
    if type(v) == 'table' then
      local sorted = {}
      for dir, v in pairs(self.filteredTemplates) do if not v.isEmpty then table.insert(sorted,dir) end end
      table.sort(sorted)
        if im.TreeNodeEx1("Project Variables") then
          for _, nm  in pairs(self.mgr.variables.sortedVariableNames) do
            local var = self.mgr.variables:getFull(nm)
        if im.TreeNodeEx1("Graph Variables") then
          for _, nm  in pairs(self.mgr.graph.variables.sortedVariableNames) do
            local var = self.mgr.graph.variables:getFull(nm)
          self:refreshMacro()
          for mn,data in pairs(self.filteredMacro) do
            self:displayMacro(mn,data,menuPos)
    if parent then
      for _, nd in pairs(parent.nodes) do
        if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
        if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
          for _, pin in pairs(nd.pinOut) do
            table.insert(exits, pin.name)
      local sorted = {}
      for dir, v in pairs(self.filteredTemplates) do if not v.isEmpty then table.insert(sorted,dir) end end
      table.sort(sorted)
  local _, flat = core_flowgraphManager.getAvailableNodeTemplates()
  for path, info in pairs(flat) do
    if not info.node.hidden and self:pinsFilter(info) and (editor.getPreference("flowgraph.general.showObsoleteNodes") or not info.node.obsolete) then
function C:findVar(source, sourceName, sourceNameTag)
  for _, nm  in pairs(source.sortedVariableNames) do
    local var = source:getFull(nm)
  local _, flat = core_flowgraphManager.getAvailableStateTemplates()
  for path, info in pairs(flat) do
    self.search:queryElement({
  if parent then
    for _, nd in pairs(parent.nodes) do
      if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
      if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
        for _, pin in pairs(nd.pinOut) do
          table.insert(exits, pin.name)

  for k,v in pairs(dir) do
    if k == mode then
    if k == mode then
      for nName, nVal in pairs(v) do
        local passedNameFilter = true--self:namesFilter(nVal, mode)
  local dirs = {}
  for n, d in pairs(dir) do
    if n ~= mode then
  local res = nil
  for k,v in pairs(dir) do
    local passedNameFilter = true--self:macroNameFilter(k)
    self.stateTemplatesSorted = {}
    for name, s in pairs(self.stateTemplates) do
      table.insert(self.stateTemplatesSorted, name)
    self.filteredFolders = {}
    for k,v in pairs(templates) do
      local nd = self:filterNodes(v, filterPins, mode)
    end
    for name, dir in pairs(self.filteredTemplates) do
      if name ~= mode then
  -- display subfolder tree nodes
  for dirName, dirVal in pairs(dir) do
    if dirName ~= elementFieldName and dirName ~= 'isEmpty' then
  if dir[elementFieldName] then
    for elemName, elem in pairs(dir[elementFieldName]) do
      elementFunction(self, dir, menuPos, elemName, elem)
      local p = nil
      for _, pin in pairs(node.pinOut) do
        p = pin
        local availablePins = {}
        for _, pin in pairs(n.pinInLocal) do
          if self.mgr.graph:canCreateLink(self.newNodeLinkPin, pin) then
        local availablePins = {}
        for _, pin in pairs(n.pinOut) do
          if self.mgr.graph:canCreateLink(pin, self.newNodeLinkPin) then
  local pins = {names = {}, pins = {}}
  for dir, list in pairs(self.mgr:getAvailableNodeTemplates()) do
    self:recursiveGetTags(list, tags, pins)
  table.insert(libtxt, header)
  for dir, list in pairs(self.mgr:getAvailableNodeTemplates()) do
    self:printDir(list, dir, tags, libtxt)

  for nName, node in pairs(dir.nodes) do
    local vals = {}
  end
    for dName, dir in pairs(dir) do
    if dName ~= 'nodes' then
function C:recursiveGetTags(dir, list, pins)
  for dName, c in pairs(dir) do
    if dName ~= 'nodes' then
  end
  for nName, node in pairs(dir.nodes) do
    -- manage Tags
    -- manage Tags
    for _, tag in pairs(node.node.tags or {} ) do
      if arrayFindValueIndex(list, tag) == false then
@/lua/ge/extensions/flowgraph/nodes/logic/switchcase.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinOut['match_'..i] then
@/lua/vehicle/electrics.lua

  for f, v in pairs(vals) do
    if M.disabledState[f] ~= nil then
  --apply the smoothers as the last thing
  for f, s in pairs(smoothers) do
    if values[f] ~= nil then

  for _, s in pairs(smoothers) do
    s:reset()
  local combinedSmootherSettings = {}
  for _, setting in pairs(defaultSmoothersSettings) do
    combinedSmootherSettings[setting.electricsName] = setting
  end
  for _, setting in pairs(jbeamSmootherSettings) do
    combinedSmootherSettings[setting.electricsName] = setting
  --iterate over all desired smoothers and create them with the correct settings
  for _, smootherSetting in pairs(combinedSmootherSettings) do
    smoothers[smootherSetting.electricsName] = newSmoother(smootherSetting.smootherType, smootherSetting.params)
  --set all smoothers to the starting value of their respective electrics value
  for electricsName, smoother in pairs(smoothers) do
    if M.values[electricsName] ~= nil then
@/lua/ge/extensions/career/modules/painting.lua
  local colors
  for partPath, partCondition in pairs(partConditions) do
    if not colors then
    vehicle.config.paints = deepcopy(chosenPaints)
    for partPath, partCondition in pairs(vehicle.partConditions) do
      if partCondition.visualState and partCondition.visualState.paint.originalPaints then
@/lua/vehicle/controller/pneumatics/actuators.lua

  for _, g in pairs(beamGroups) do
    g.averagePressure = 0
  -- first, initialize the pressure and group count to 0
  for _, g in pairs(crossFlowGroups) do
    g.bufferPressure = 0
  -- now calculate the sum of all beam groups' pressures and the number of beam groups in each cross-flow group
  for _, g in pairs(beamGroups) do
    local crossFlowGroup = crossFlowGroups[g.crossFlowTag]
  -- finally, normalize the sum to an average using the beam group count, and calculate the stored energy
  for _, g in pairs(crossFlowGroups) do
    g.bufferPressure = g.beamGroupCount == 0 and 0 or g.bufferPressure / g.beamGroupCount
  -- now calculate the sum of all beam groups' pressures and the number of beam groups in each cross-flow group
  for _, bg in pairs(beamGroups) do
    if bg.crossFlowTag == crossFlowTag then
local function setBeamGroupsValveState(groupNames, valveState)
  for _, g in pairs(groupNames) do
    setBeamGroupValveState(g, valveState)
local function toggleBeamGroupsValveState(groupNames)
  for _, g in pairs(groupNames) do
    toggleBeamGroupValveState(g)
local function setBeamGroupsMaximumSupplyPressure(groupNames, maxSupplyPressure)
  for _, g in pairs(groupNames) do
    setBeamGroupMaximumSupplyPressure(g, maxSupplyPressure)

  for _, g in pairs(beamGroups) do
    local crossFlowGroup = crossFlowGroups[g.crossFlowTag]

    for _, v in pairs(g.beams) do
      local beamLength = max(obj:getBeamLength(v.cid) - v.lengthOffset, 0)
local function updateGFX(dt)
  for _, g in pairs(crossFlowGroups) do
    if g.enableDebug then

  for _, g in pairs(beamGroups) do
    if g.enableDebug then

    for _, v in pairs(g.beams) do
      if v.enableDebug then
local function reset()
  for _, g in pairs(beamGroups) do
    for _, v in pairs(g.beams) do
  for _, g in pairs(beamGroups) do
    for _, v in pairs(g.beams) do
      local beamLength = obj:getBeamLength(v.cid)
  local pressuredBeamNames = {}
  for _, v in pairs(pressureBeamData) do
    local name = v.beamName
  crossFlowGroups = {}
  for _, crossFlowData in pairs(crossFlowGroupData) do
    local groupTag = crossFlowData.crossFlowTag
  beamGroups = {}
  for _, pressureData in pairs(pressureBeamData) do
    local name = pressureData.beamName

  for _, v in pairs(pressureBeamSoundData) do
    local groupData = beamGroups[v.groupName]
local function resetSounds()
  for _, g in pairs(beamGroups) do
    if g.soundLoopIncrease then
@/lua/common/utils/heatmap.lua
  -- draw edges
  for nid, n in pairs(m.nodes) do
    for lid, dif in pairs(n.links) do
  for nid, n in pairs(m.nodes) do
    for lid, dif in pairs(n.links) do
      local p1 = transformPoint(n.pos - terrainPosition)
  local nodes = svg.Group()
  for nid, n in pairs(m.nodes) do
    local p = transformPoint(n.pos - terrainPosition)

  --for k,v in pairs(map.objects) do
  --  heatSVG:drawIcon(pos - terrainPosition, 'x', ColorI(255, 0, 0, 255))
  if heatSVG and terrainPosition then
    for mk, mv in pairs(map.objects) do
      -- {active = isactive, pos = pos, vel = vel, dirVec = dirVec, damage = damage}
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua
  for _, child in ipairs(layer.children) do
    for _, property in pairs(properties) do
  if im.BeginPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId)) then
    for cat, properties in pairs(api.properties) do
      im.TextColored(editor.color.beamng.Value, cat)
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
  }
  for k,_ in pairs(self.partConfig.parts) do
    table.insert(keys.parts, k)
  end
  for k,_ in pairs(self.partConfig.vars) do
    table.insert(keys.vars, k)
@/lua/ge/extensions/core/settings/settings.lua
  local cloudValues = {}
  for k, v in pairs(values) do
    if values[k] == M.impl.defaultValues[k] then -- TODO do a deep table compare instead
  if withValue then
    for k,o in pairs(options) do
      if type(o.get) == 'function' then
  end
  for k,o in pairs(options) do
    if type(o.getModes) == 'function' then

  for _, l in pairs(locales) do
    local key = string.match(l, 'locales/(.*).json')
  local sortedKeys = {}
  for k,_ in pairs(newState) do
    if not tableContains(graphicQualityGroups, k) then
 -- fix the options up and combine the keys and values into the dict
  for k,v in pairs(options) do
    if v.keys and v.values and not v.dict then
  -- add C++ propagation wherever possible
  for k,v in pairs(M.impl.defaults) do
    if CppSettings[k] ~= nil then -- check if C++ side cares about this setting
  local settingFileChanged = false
  for _,v in pairs(files) do
    if (v.filename == M.impl.pathLocal or v.filename == M.impl.pathCloud) and (os.clock()-lastSavedTime) > 5 then
@/lua/ge/extensions/editor/flowgraph/examples.lua
function C:findExamples(match)
  for _, info in pairs(examplesLookup.lookup) do
    self.search:queryElement({
    local sortedExamples = {}
    for k, v in pairs(element.examples) do if k ~= folderName then table.insert(sortedExamples, k) end end
  local sortedKeys = {}
  for k, v in pairs(element) do if k ~= folderName then table.insert(sortedKeys, k) end end
  table.sort(sortedKeys, function(a,b)
@/lua/ge/extensions/core/ropeVisualTest.lua
    local anyRopeHasDebugNodes = false
    for _, settings in pairs(ropeDebugSettings) do
      if settings.debugNodes then

  for ropeId, _ in pairs(perfStats.ropeSimTimes) do
    if not activeRopeIds[ropeId] then
  else
    for _, settings in pairs(ropeDebugSettings) do
      if settings.debugNodes then
@/lua/ge/extensions/ui/ambientSound.lua
  local soundTable={}
  for k,v in pairs(soundFile) do
    soundTable[k]=v
@/lua/ge/extensions/core/settings/rally.lua
      if levelData then
        for k,v in pairs(levelData) do
          settings.setValue(k, v)
  local ngrcPreset = rallyPresets.NGRC
  for key, value in pairs(ngrcPreset) do
    if settings.getValue(key) ~= value then
@/lua/ge/extensions/flowgraph/nodes/input/blacklistActionFilter.lua
  local listByKey = {}
  for key, active in pairs(self.activeTemplates) do
    if active then
@/lua/vehicle/controller/drivingDynamics/supervisors/components/brakeControl.lua
  debugPacket.wheelData = debugPacket.wheelData or {}
  for k, v in pairs(wheelControlData) do
    debugPacket.wheelData[k] = debugPacket.wheelData[k] or {}

  for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
    debugPacket.tractionControl.wheelGroupControl[k] = debugPacket.tractionControl.wheelGroupControl[k] or {}
  debugPacket.absControl.wheelData = debugPacket.absControl.wheelData or {}
  for k, v in pairs(absWheelData) do
    debugPacket.absControl.wheelData[k] = debugPacket.absControl.wheelData[k] or {}
local function registerWheelBrakeUpdates()
  for wheelName, _ in pairs(absWheelData) do
    wheels.setWheelBrakeUpdate(wheelName, updateBrakeNoABS, updateBrakeABS)
local function applyControlParameters()
  for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
    wheelGroupControlData[k].slipThreshold = v.slipThreshold
  if controlParameters.tractionControl.wheelBrakingPID then
    for k, v in pairs(controlParameters.tractionControl.wheelBrakingPID) do
      if wheelControlData[k].tractionControlBrakingPID then

  for k, v in pairs(controlParameters.absControl.wheelSettings) do
    absWheelData[k].slipThreshold = v.slipThreshold

    for _, setting in pairs(jbeamPIDSettings) do
      controlParameters.yawControl.PIDSettings[setting.type] = {

    for _, wheel in pairs(CMU.vehicleData.wheelAccess) do
      if not wheelControlData[wheel.name] then
    local wheelSettings = tableFromHeaderTable(jbeamData.absControl.wheelSettings or {})
    for _, wheelSetting in pairs(wheelSettings) do
      if absControl.absControlledWheels[wheelSetting.wheelName] then

  for k, _ in pairs(wheelGroupControlData) do
    CMU.applyParameter(controlParameters, initialControlParameters, parameters, "tractionControl.wheelBrakingPID." .. k .. ".kP")
  --ABS Control
  for k, _ in pairs(absWheelData) do
    CMU.applyParameter(controlParameters, initialControlParameters, parameters, "absControl.wheelSettings." .. k .. ".kP")
@/lua/ge/extensions/editor/sitesEditor/tags.lua
  end
  for k, _ in pairs(self.tags) do
    table.insert(self.sortedTags, k)
@/lua/ge/extensions/career/modules/delivery/generator.lua
  local validAps = {}
  for name, ap in pairs(accessPointsByName) do
    if ap[typeLookupKey] and ap[typeLookupKey][logisticType] then
    log("E","","Could not find any access point with logisticType " .. logisticType .. " in this list via " .. typeLookupKey)
    for name, ap in pairs(accessPointsByName) do
      print(name .. " -> " .. dumps(ap[typeLookupKey]))
    for _,file in ipairs(files) do
      for k, v in pairs(jsonReadFile(file) or {}) do
        local item = v
                if f.logisticTypesReceivedLookup[template.logisticType] then
                  for name, ap in pairs(f.accessPointsByName) do
                    if ap.logisticTypesReceivedLookup[template.logisticType] then
    for _,file in ipairs(files) do
      for id, filter in pairs(jsonReadFile(file) or {}) do
        filter.id = id
    for _,file in ipairs(files) do
      for id, data in pairs(jsonReadFile(file) or {}) do
        data.id = id
  local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.dropOffSpots[1]:getPath()}
  for materialType, storage in pairs(fac.materialStorages) do
    if storage.isReceiver then
    local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.pickUpS pots[1]:getPath()}
    for materialType, storage in pairs(fac.materialStorages) do
      if storage.isProvider then
      --dump(fac.logisticTypeLookup)
      for key, _ in pairs(generator.logisticTypesLookup) do
        match = match or item.logisticType == key
        --local systems = generatorToSystem[generator.type](generator)
        --for sys, _ in pairs(systems) do
        --  fac[dir][sys] = true

      for name, ap in pairs(accessPointsByName) do
        ap.name = name
        allTypes[type] = true
        for sys, en in pairs(logisticTypeToSystem(type, fac)) do
          if en then
        allTypes[type] = true
        for sys, en in pairs(logisticTypeToSystem(type, fac)) do
          if en then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathStored.lua
    if im.BeginCombo("Selector",tostring(self.currentID)) then
      for id, rec in pairs(editor_scriptAIManager.getCurrentRecordings()) do
        if im.Selectable1(tostring(id), tostring(id) == self.currentID) then
@/lua/vehicle/jbeam/stage2.lua
  local dedup = {}
  for i, beam in pairs(vehicle.beams) do
    if beam.breakGroup == '' then beam.breakGroup = nil end
  local cids = {}
  for _, rail in pairs(vehicle.rails) do
    if rail["links:"] ~= nil then
      if rail["broken:"] ~= nil then
        for _, nid in pairs(rail["broken:"]) do
          brokenmap[nid] = 1
  if vehicle.slidenodes == nil then return end
  for _, snode in pairs(vehicle.slidenodes) do
    local attached = 1
  local tbi = tableEndC(vehicle.torsionbars)
  for i, hydro in pairs(vehicle.torsionHydros) do
    vehicle.torsionbars[tbi] = hydro; tbi = tbi + 1
  if vehicle.torsionbars == nil then return end
  for _, tb in pairs(vehicle.torsionbars) do
    local spring = tb.spring
  local n = vehicle.nodes
  for _, triangle in pairs(vehicle.triangles) do
    if triangle.breakGroup == '' then triangle.breakGroup = nil end
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/campaignTiles.lua
  if campaign.meta and campaign.meta.subsections then
    for _, subsection in pairs(campaign.meta.subsections) do
      if subsection.locations then
      if subsection.locations then
        for _ in pairs(subsection.locations) do
          scenarioCount = scenarioCount + 1
@/lua/ge/extensions/editor/flowgraph/missionVariableHelper.lua
  local notFound = 0
  for name, value in pairs(missionTypeData) do
    if mgr.variables:variableExists(name) then
@/lua/ge/extensions/gameplay/markers/walkingMarker.lua
  end
  for key, poisInCluster in pairs(poisByObjectNames) do
    local wm = poisInCluster[1].markerInfo.walkingMarker
@/lua/ge/extensions/career/modules/spawnPoints.lua

    for _,spawnPoint in pairs(levelInfo.spawnPoints) do
      if not M.isSpawnPointDiscovered(currentLevel, spawnPoint.objectname) then
@/lua/ge/extensions/gameplay/speedTrapLeaderboards.lua
  local files = FS:findFiles(folderPath, '*.json', 0, false, false)
  for _, filePath in pairs(files) do
    local leaderboardFileData = jsonReadFile(filePath)
  log("I", logTag, "Saving leaderboards to " .. folderPath)
  for levelName, levelLeaderboards in pairs(leaderboards) do
    if dirtyLevels[levelName] or forceOverwrite then
@/lua/ge/extensions/flowgraph/nodes/career/onIntroPopupCareerClosed.lua
  self.pinOut.closed.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/editor/api/history.lua
  local t1Len = 0
  for k, v in pairs(t1) do
    t1Len = t1Len + 1
  local t2Len = 0
  for k in pairs(t2) do
    t2Len = t2Len + 1
@/lua/common/libs/luasec/https.lua
   local mt = getmetatable(conn.sock).__index
   for name, method in pairs(mt) do
      if type(method) == "function" then
   -- Default settings
   for k, v in pairs(cfg) do 
      params[k] = params[k] or v
@/lua/vehicle/extensions/test/csvMetrics.lua
    }
    for k, v in pairs(electrics.values.wheelThermals) do
      table.insert(header, 'BrakeCoreTemp' .. k)
    end
    for k, v in pairs(powertrain.getDevicesByType('combustionEngine')) do
      if v.thermals ~= nil then
    }
    for k, v in pairs(electrics.values.wheelThermals) do
      table.insert(dataRow, v.brakeCoreTemperature or 0)
    end
    for k, v in pairs(powertrain.getDevicesByType('combustionEngine')) do
      table.insert(dataRow, v.thermals.engineBlockTemperature)
@/lua/vehicle/mapmgr.lua
    buf:put('{')
    for k, v in pairs(states) do
      buf:putf('[%q]=%s,', k, v)
@/lua/vehicle/extensions/vehicleStatsLogger.lua
local function updateStreams()
  for _, moduleID in pairs(moduleIdx) do
    if settings.useModule[moduleID] then
local function createCSVs()
  for _, moduleID in pairs(moduleIdx) do
    local header = getCSVHeader(moduleID)
local function initOutput()
  for _, moduleID in pairs(moduleIdx) do
    local fpath = settings.outputDir .. "\\" .. moduleID .. ".csv"
local function flushOutputStream()
  for _, moduleID in pairs(moduleIdx) do
    local fpath = outputStreams[moduleID].fpath

  for _, moduleID in pairs(moduleIdx) do
    settings.useModule[moduleID] = true

  for _, moduleID in pairs(moduleIdx) do
    if s.useModule[moduleID] ~= nil then

  -- for moduleID, useModule in pairs(settings.useModule) do
  --     log("D", logTag, moduleID..": "..tostring(useModule))

  for moduleID, useModule in pairs(settings.useModule) do
    s.useModule[moduleID] = useModule
@/lua/ge/extensions/editor/sitesEditor.lua
          end
          for name, list in pairs(spotsByName) do
            if #list > 1 then
    local emptyLevelNamesSorted = {}
    for level, sites in pairs(levelSites) do
      if #sites > 0 then
@/lua/ge/extensions/gameplay/markers/crawlMarker.lua
  end
  for key, poisInCluster in pairs(poisByObjectNames) do
    local cm = poisInCluster[1].markerInfo.crawlMarker
@/lua/vehicle/controller/tech/idealRADARSensor.lua
  local keys = {}
  for key in pairs(tbl) do
    table.insert(keys, key)
  local vehicles, ctr = {}, 1
  for k, _ in pairs(mapmgr.getObjects()) do
    if k ~= objectId then
@/lua/vehicle/electricsCustomValueParser.lua
  --include all math functions and constants
  for k, v in pairs(math) do
    customElectricsEnv[k] = v
  keyworkdWhiteListLookup = {}
  for _, v in pairs(keywordWhiteList) do
    keyworkdWhiteListLookup[v] = true
  --TODO invesitgate if we maybe only want to update the values that are actually used within the custom value functions
  for electricsName, electricsValue in pairs(electrics.values) do
    customElectricsEnv.electrics[electricsName] = electricsValue
local function updateElectrics(dt)
  for electricsName, customValue in pairs(customElectricsEnv.electrics) do
    electrics.values[electricsName] = customValue
  --dump(customDefaultValues)
  for electricsName, value in pairs(customDefaultValues) do
    electrics.values[electricsName] = value
@/lua/common/jbeam/tableSchema.lua
    -- recursive replace
    for k, v in pairs(val) do
      val[k] = replaceSpecialValues(v)
  -- walk everything and look for options
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) ~= "table" then
  -- then walk all (keys) / entries of that vehicle
  for keyEntry, entry in pairs(vehicle) do
    -- verify key names to be proper formatted
@/lua/vehicle/extensions/tech/powertrainSensor.lua
local function updateGFX(dtSim)
  for sensorId, _ in pairs(powertrains) do
    updatePowertrainGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(powertrains) do
    if vid == objectId then
@/lua/ge/extensions/editor/levelValidator.lua
  local count = 0
  for _ in pairs(ignoredObjects) do
    count = count + 1
  local sortedFields = {}
  for field, _ in pairs(data) do
    table.insert(sortedFields, field)
  -- Check which sceneObjectNodes are planted
  for i, node in pairs(sceneObjectNodes) do
    if node.planted then

  for i, node in pairs(forestItemNodes) do
    if node.planted then

  for id, node in pairs(sceneObjectNodes) do
    if not node.planted then
  job.yield()
  for _, node in pairs(forestItemNodes) do
    if not node.planted then
        local foundDuplicate = false
        for id2, hash2 in pairs(objectHashes) do
          if hash == hash2 then
        local filterFunctions = {}
        for logLevel, _ in pairs(logLevelFilters) do
          table.insert(filterFunctions, filterLogLevel(logLevel))
  }
  for type, idx in pairs(types) do
    aggregatedElements.elementsByType[idx] = { elements = {}, count = 0, type = type }
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathFromFile.lua
  if im.BeginCombo("File##file" , self.fnShort) then
    for _, fileName in pairs(self.files) do
      local fnShort = string.sub(fileName, string.len(trackFilePath) + 1)
@/lua/ge/extensions/editor/terraform/fetchSources.lua
  local meshRoadsInSelection = {}
  for _, v in pairs(editor.selection.object) do
    local sel = scenetree.findObjectById(v)
@/gameplay/missionTypes/drift/customNodes/extractWaypointsNode.lua

  for _, pathNode in pairs(self.pinIn.pathData.value.pathnodes.sorted) do
    table.insert(self.extractedWaypoints, pathNode.pos)
@/lua/ge/extensions/scenario/race_marker.lua
local function hide()
  for _, m in pairs(idToMarker) do
    m:hide()
local function show()
  for _, m in pairs(idToMarker) do
    m:show()
  --if not markers[name] then return end
  for id, marker in pairs(markers[name] or {}) do
    marker:clearMarkers()
   -- blend all markers.
  for _, m in pairs(idToMarker) do
    m:update(dt, dtSim)
local function setModes(wpModes)
  for name, marker in pairs(markers[markerListName] or {}) do
    marker:setMode(wpModes[name] or 'hidden')
local function setToCheckpoints(data)
  for name, marker in pairs(markers[markerListName] or {}) do
    if data[name] then
local function drawOnMinimap(td)
  for _, marker in pairs(markers[markerListName] or {}) do
    if marker.drawOnMinimap then
@/lua/ge/extensions/util/docCreator.lua
  local res = {}
  for _, l in pairs(locales) do
    local key = string.match(l, 'locales/(.*).json')
  if type(tbl) == 'table' then
    for k, v in pairs(tbl) do
      if type(v) == 'table' then

  for k,info in pairs(mergedInfo) do
    local entry = {}
  local materialsClean = {}
  for i, m in pairs(materials) do
    table.insert(materialsClean, m.name) -- {m.colorR, m.colorG, m.colorB}
@/lua/ge/extensions/scenario/demolitionDerby.lua
      reset()
      for vName, vData in pairs(scenario.vehicles) do
        local vObj = scenetree.findObject(vName)
    local playersStoped = {}
    for vName, vObj in pairs(scenarioVehicles) do
        if not lastPosition[vName] then lastPosition[vName] = vObj:getPosition() end
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptLimit.lua
  local counts = {}
  for name, pin in pairs(self.pinInLocal) do
    if self.pinIn[name].value ~= nil and pin.type == 'number' then
@/lua/common/libs/luasocket/socket/http.lua
    local h = "\r\n"
    for f, v in base.pairs(tosend) do
        h = (canonic[f] or f) .. ": " .. v .. "\r\n" .. h
    -- override with user headers
    for i,v in base.pairs(reqt.headers or lower) do
        lower[string.lower(i)] = v
    -- explicit components override url
    for i,v in base.pairs(reqt) do nreqt[i] = v end
    if nreqt.port == "" then nreqt.port = 80 end
@/lua/vehicle/extensions/dynamicVehicleData.lua

  for k, v in pairs(newData) do
    --print(k .. ": " .. v)
  --dump(data)
  for _, v in pairs(whiteList) do
    data[v] = nil
    local torqueData = {}
    for _, v in pairs(engines) do
      local tData = v:getTorqueData()
      local engineCurves = td.curves[td.finalCurveName]
      for rpm, torque in pairs(engineCurves.torque) do
        torqueCurve[rpm] = (torqueCurve[rpm] or 0) + torque
      end
      for rpm, power in pairs(engineCurves.power) do
        powerCurve[rpm] = (powerCurve[rpm] or 0) + power
    end
    for rpm, torque in pairs(torqueCurve) do
      if torque > maxTorque then
    end
    for rpm, power in pairs(powerCurve) do
      if power > maxPower then
  local motors = powertrain.getDevicesByCategory("engine")
  for _, v in pairs(motors) do
    if v.type == "combustionEngine" then
  local engines = powertrain.getDevicesByType("combustionEngine")
  for _, v in pairs(engines) do
    if v.turbocharger.isExisting then
  local energyStorages = energyStorage.getStorages()
  for _, v in pairs(energyStorages) do
    if v.type == "fuelTank" then
  local transmissions = powertrain.getDevicesByCategory("gearbox")
  for _, v in pairs(transmissions) do
    if v.type == "automaticGearbox" then
  end
  -- for _, wd in pairs(adjustedWheels) do
  --   print(wd.name)
  local avgWheelPos = vec3(0, 0, 0)
  for _, wd in pairs(adjustedWheels) do
    wheelCount = wheelCount + 1
    local propulsedWheelLocations = {fr = 0, fl = 0, rr = 0, rl = 0}
    for _, wd in pairs(adjustedWheels) do
      if wd.isPropulsed then
      local centerDiff
      for _, v in pairs(orderedDevices) do
        if centerDiff then
        end
        for _, w in pairs(actualDiffs) do
          if w.name == v.name then

  for _, diff in pairs(powertrain.getDevicesByType("differential")) do
    if diff.mode ~= "locked" then

  for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
    if shaft.mode ~= "connected" then

  for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
    if rangebox.mode ~= "high" then

  for _, diff in pairs(powertrain.getDevicesByType("differential")) do
    if diff.mode ~= "locked" then

  for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
    if shaft.mode ~= "connected" then

  for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
    if rangebox.mode ~= "high" then

  for _, diff in pairs(powertrain.getDevicesByType("differential")) do
    if diff.mode ~= "locked" then

  for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
    if shaft.mode ~= "connected" then

  for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
    if rangebox.mode ~= "low" then
@/lua/ge/extensions/editor/api/preferencesRegistry.lua
  end
  for _, pref in pairs(prefs) do
    -- we only have a single pair in the table, the table is used to keep the item order like it was written in the code
  -- check the current preferences.json items if they still exist in the registry
  for catName, cat in pairs(self.preferences) do
    if type(cat) ~= "table" then
    else
      for subcatName, subcat in pairs(cat) do
        if type(subcat) ~= "table" then
        else
          for itemName, item in pairs(subcat) do
            local itemPath = catName .. "." .. subcatName .. "." .. itemName
    if json[categoryName] then
      for subCatName, subCat in pairs(json[categoryName]) do
        for itemName, itemValue in pairs(subCat) do
      for subCatName, subCat in pairs(json[categoryName]) do
        for itemName, itemValue in pairs(subCat) do
          local path = categoryName .. "." .. subCatName .. "." .. itemName
  local val = nil
  for subcatName, subcat in pairs(self.preferences[categoryName]) do
    for itemName, item in pairs(subcat) do
  for subcatName, subcat in pairs(self.preferences[categoryName]) do
    for itemName, item in pairs(subcat) do
      local itemPath = categoryName .. "." .. subcatName .. "." .. itemName
  -- prune prefs that have default values, no need to be in the file
  for catName, cat in pairs(self.preferences) do
    for subcatName, subcat in pairs(cat) do
  for catName, cat in pairs(self.preferences) do
    for subcatName, subcat in pairs(cat) do
      for itemName, _ in pairs(subcat) do
    for subcatName, subcat in pairs(cat) do
      for itemName, _ in pairs(subcat) do
        local itemPath = catName .. "." .. subcatName .. "." .. itemName
    if not cat then return false end
    for _, subCat in pairs(cat.subcategories) do
      for _, item in pairs(subCat.items) do
    for _, subCat in pairs(cat.subcategories) do
      for _, item in pairs(subCat.items) do
        self:set(item.path, deepcopy(item.defaultValue))
@/lua/vehicle/controller/advancedCouplerControl.lua
      couplerNodePairData.availableCid2 = {}
      for _, cid2 in pairs(cnp.cid2) do
        table.insert(couplerNodePairData.availableCid2, beamstate.nodeNameMap[cid2])
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua

    for _, nodeID in pairs(vertLocNodes) do
      if nodeID ~= -1 then
    -- Go through each vertex's locator nodes to render lines
    for _, nodeID in pairs(vertLocNodes) do
      if nodeID ~= -1 then
@/lua/ge/extensions/flowgraph/nodes/vehicle/touchingStatic.lua
function C:reset()
  for _, pin in pairs(self.pinOut) do
    pin.value = false
  self.pinOut.isTouching.value = false
  for k, v in pairs(self.points) do
    local dist = v.pos:distance(self.center)
  if self.active and self.pinIn.debugMode.value then
    for k, v in pairs(self.points) do
      local color = v.hit and ColorF(1, 0, 0, 1) or ColorF(0, 1, 0, 0.5)
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
local function foreachMaterial(matTable, cb)
  for file, mats in pairs(matTable) do
    for key, mat in pairs(mats) do
  for file, mats in pairs(matTable) do
    for key, mat in pairs(mats) do
      cb(file, key, mat)
  local out, count = {}, 0
  for file, mats in pairs(map) do
    local hasAny = false
    local hasAny = false
    for _, issues in pairs(mats) do
      if not tableIsEmpty(issues) then
      out[file] = {}
      for matName, issues in pairs(mats) do
        if not tableIsEmpty(issues) then
    local forestItem
    for k,v in pairs(forestContent) do
      if v.shapeFile == shape then
    for layer = 0, layers - 1 do
      for k,v in pairs(meta) do
        if v["type"] == "filename" then
  duplicatedM = {}
  for _,v in pairs(duplicatelist) do
    local name, mapTo = v[1], v[2]
    job.progress = 75
    for k,v in pairs(isOld) do
      job.yield()
      local duplicatelist = {}
      for file, mats in pairs(matTable) do
        for k, mat in pairs(mats) do
      for file, mats in pairs(matTable) do
        for k, mat in pairs(mats) do
          if mat and mat.name then
    job.sleep(0.001)
    for k,_ in pairs(duplicatedM) do
      countduplicate = countduplicate + 1
    job.sleep(0.001)
    for k,_ in pairs(outdatedFiles) do
      log('I', '', 'Saved materials to '..k )
              matData[fn][obj:getName()] = {}
              for k,v in pairs(texfields) do
                matData[fn][obj:getName()][k] = v
            local texfields = {}
            for k,v in pairs(obj:getFields()) do
              if v["type"] == "filename" then
            matData[fn][obj:getName()] = {}
            for k,v in pairs(texfields) do
              matData[fn][obj:getName()][k] = v
      local cases = {".color.png", ".normal.png", ".data.png", ".color.dds", ".normal.dds", ".data.dds", ".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
      for e,t in pairs(matData) do
        fileIsMissing[e] = {}
        incorrectPathCooker[e] = {}
        for k,v in pairs(t) do
          if job.progress < 75 then job.progress = job.progress + 0.001 end
          incorrectPathCooker[e][k] = {}
          for m,d in pairs(v) do
            job.yield()
            if d and d ~= "" then
              for _,b in pairs(cases) do
                if d:find(b) then
    local sorted = {}
    for k,v in pairs(materialFiles) do
      if string.find(v, '/terrains/') and string.find(v, '/terrain/') then
              matData[fn][obj:getName()] = {}
              for k,v in pairs(texfields) do
                matData[fn][obj:getName()][k] = v
      end
      for e,t in pairs(matData) do
        pow2[e] = {}
        cooker[e] = {}
        for k,v in pairs(t) do
          if job.progress < 75 then
          cooker[e][k] = {}
          for m,d in pairs(v) do
            if abort(job) then return end
    job.sleep(0.001)
    for _,v in pairs(objmatTable) do
      if job.progress < 90 then job.progress = job.progress + 0.01 end
      if (luaType(v[1]) == "table") then
        for _,j in pairs(v[1]) do
          if not mapping[j] then
  local shapesprepare = {}
  for k,_ in pairs(shapeList) do
    if abort(job) then return end
  table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
  for _,v in pairs(shapesprepare) do
    local sizeS = string.format("%.2f", v[2] / 1048576)
  local shapesprepare = {}
  for k,_ in pairs(shapeList) do
    if abort(job) then return end
  table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
  for _,v in pairs(shapesprepare) do
    local sizeS = string.format("%.2f", v[2] / 1048576)
  local shapes = {}
  for k,_ in pairs(shapeList) do
    if abort(job) then return end
    job.sleep(0.001)
    for _,v in pairs(meshNames) do
      if abort(job) then return end
    job.sleep(0.001)
    for k,_ in pairs(shapeList) do
      if abort(job) then return end
    local meshNames2 = scenetree.findClassObjects('TSStatic')
    for _,v in pairs(meshNames2) do
      job.yield()
    job.sleep(0.001)
    for _,v in pairs(objmatTable) do
      job.yield()
      if (luaType(v) == "table") then
        for _,vv in pairs(v) do
          mats[vv] = true
    local meshNames3 = scenetree.findClassObjects('TerrainBlock')
    for _,v in pairs(meshNames3) do
      job.yield()
    job.sleep(0.001)
    for _,v in pairs(terrainMats) do
      job.yield()
      job.yield()
      for _,vv in pairs(v) do
        mats[vv:getInternalName()] = true
    local meshNames4 = scenetree.findClassObjects('GroundPlane')
    for _,v in pairs(meshNames4) do
      job.yield()
    local meshNames5 = scenetree.findClassObjects('GroundCover')
    for _,v in pairs(meshNames5) do
      job.yield()
    local meshNames6 = scenetree.findClassObjects('DecalRoad')
    for _,v in pairs(meshNames6) do
      job.yield()
    local meshNames7 = scenetree.findClassObjects('MeshRoad')
    for _,v in pairs(meshNames7) do
      job.yield()
    local meshNames8 = scenetree.findClassObjects('DecalData')
    for _,v in pairs(meshNames8) do
      job.yield()
      log('I', '', 'parsing all materials')
      for path, mats in pairs(matTable) do
        job.yield()
        job.yield()
        for k,v in pairs(mats) do
          local mat = v
    local tmpMats = {}
    for k,_ in pairs(mats) do
      job.yield()
    mats = tmpMats
    for k,v in pairs(materialFilesdata) do
      job.yield()
    job.sleep(0.001)
    for k,_ in pairs(unused) do
      job.yield()
    local toRemove = {}
    for k,_ in pairs(unused) do
      job.yield()
    local prefabInstances = scenetree.findClassObjects('Prefab')
    for _,v in pairs(prefabInstances) do
      job.yield()
    job.sleep(0.001)
    for _,v in pairs(meshNames) do
      if abort(job) then return end
    job.sleep(0.001)
    for k,_ in pairs(shapeList) do
      if abort(job) then return end
    local meshNames2 = scenetree.findClassObjects('TSStatic')
    for _,v in pairs(meshNames2) do
      job.yield()
    job.sleep(0.001)
    for _,v in pairs(objmatTable) do
      job.yield()
      if (luaType(v) == "table") then
        for _,vv in pairs(v) do
          mats[vv] = true
    local meshNames3 = scenetree.findClassObjects('TerrainBlock')
    for _,v in pairs(meshNames3) do
      job.yield()
    job.sleep(0.001)
    for _,v in pairs(terrainMats) do
      job.yield()
      job.yield()
      for _,vv in pairs(v) do
        mats[vv:getInternalName()] = true
    local meshNames4 = scenetree.findClassObjects('GroundPlane')
    for _,v in pairs(meshNames4) do
      job.yield()
    local meshNames5 = scenetree.findClassObjects('GroundCover')
    for _,v in pairs(meshNames5) do
      job.yield()
    local meshNames6 = scenetree.findClassObjects('DecalRoad')
    for _,v in pairs(meshNames6) do
      job.yield()
    local meshNames7 = scenetree.findClassObjects('MeshRoad')
    for _,v in pairs(meshNames7) do
      job.yield()
    local meshNames8 = scenetree.findClassObjects('DecalData')
    for _,v in pairs(meshNames8) do
      job.yield()
    if abort(job) then return end
    for k,_ in pairs(mats) do
      job.yield()
        if texfields then
          for _,h in pairs(texfields) do
            local file = h
        local countMat = 0
        for _,h in pairs(allMatsUsages) do
          if h == k then countMat = countMat + 1 end
    job.sleep(0.001)
    for k,v in pairs(mats) do
      job.yield()
    end
    for k,v in pairs(mats) do
      job.yield()
    table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
    for k,v in pairs(shapes) do
      shapes[k] = v[1]
    sizeTotal = string.format("%.2f", sizeTotal/1048576)
    for k,v in pairs(matsInObjects) do
      if (luaType(v) == "table") then
      if (luaType(v) == "table") then
        for _,p in pairs(v) do
          if not usages[p] then usages[p] = {} end
    local prefabInstances = scenetree.findClassObjects('Prefab')
    for _,v in pairs(prefabInstances) do
      job.yield()
    end
    for _, fn in pairs(prefabs) do
      if abort(job) then return end
      job.yield()
      for _,v in pairs(forestObject:getData():getItems()) do
        if not staticInstances[v:getData():getShapeFile()] then
    local meshNames = scenetree.findClassObjects('TSStatic')
    for _,v in pairs(meshNames) do
      job.yield()
    end
    for k,v in pairs(staticInstances) do
      if abort(job) then return end
    end
    for k,v in pairs(staticInstances) do
      job.yield()
      if v and v.ColPolygons > 0 then
        for _,c in pairs(v.collision) do
          if c == "Collision Mesh" then colMeshInst = colMeshInst + 1 end
      if v and v.VisPolygons > 0 then
        for _,c in pairs(v.collision) do
          if (c == "Visible Mesh" or c == "Visible Mesh Final")  then visMeshInst = visMeshInst + 1 end
    table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
    for k,v in pairs(shapes) do
      shapes[k] = v[1]
    local meshNames = scenetree.findClassObjects('TSStatic')
    for _,v in pairs(meshNames) do
      if abort(job) then return end
    local forestModels = {}
    for _,v in pairs(meshNames2) do
      job.yield()
    local forestFiles = FS:findFiles("/levels/"..levelname.."/forest/", "*forest4.json", -1, true, false)
    for _,v in pairs(forestFiles) do
      job.yield()
    local meshNames3 = scenetree.findClassObjects('GroundCover')
    for _,v in pairs(meshNames3) do
      job.yield()
    job.sleep(0.001)
    for k,v in pairs(forestModels) do
      job.yield()
    job.sleep(0.001)
    for k,_ in pairs(models) do
      job.yield()
    local tempMdl = {}
    for k,_ in pairs(models) do
      job.yield()
    local meshFiles = FS:findFiles("/levels/"..levelname.."/", "*.dae\t*.dts\t*.cdae", -1, true, false)
    for _,v in pairs(meshFiles) do
      job.yield()
    job.progress = 75
    for _,v in pairs(forestModels) do
      forestShapes[string.lower(v)] = true
    job.sleep(0.001)
    for k,_ in pairs(unused) do
      job.yield()
    local toRemove = {}
    for k,_ in pairs(unused) do
      job.yield()
    local meshNames = scenetree.findClassObjects('Material')
    for _,v in pairs(meshNames) do
      job.yield()
        if texfields then
          for _,vv in pairs(texfields) do
            textures[vv] = true
    local meshNames2 = scenetree.findClassObjects('TerrainMaterial')
    for _,v in pairs(meshNames2) do
      if abort(job) then return end
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    local meshNames3 = scenetree.findClassObjects('WaterPlane')
    for _,v in pairs(meshNames3) do
      job.yield()
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    local meshNames4 = scenetree.findClassObjects('WaterBlock')
    for _,v in pairs(meshNames4) do
      job.yield()
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    local meshNames5 = scenetree.findClassObjects('River')
    for _,v in pairs(meshNames5) do
      job.yield()
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    local meshNames6 = scenetree.findClassObjects('CloudLayer')
    for _,v in pairs(meshNames6) do
      job.yield()
    local meshNames7 = scenetree.findClassObjects('ScatterSky')
    for _,v in pairs(meshNames7) do
      job.yield()
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    local meshNames8 = scenetree.findClassObjects('CubemapData')
    for _,v in pairs(meshNames8) do
      job.yield()
      else
        for k,f in pairs(m:getFields()) do
          job.yield()
    if meshNames9 then
      for k,v in pairs(meshNames9) do
        job.yield()
        if k == "previews" then
          for _,t in pairs(v) do
            textures[t] = true
        if k == "spawnPoints" then
          for _,t in pairs(v) do
            for i,m in pairs(t) do
          for _,t in pairs(v) do
            for i,m in pairs(t) do
              if i == "preview" then
    local texTemp = {}
    for k,_ in pairs(textures) do
      job.yield()
    local blacklist = {"buslines", "quickrace", "scenarios", "scenarios", "lights", "export", "import", "minimap"}
    for _,v in pairs(texFiles) do
      job.yield()
    job.sleep(0.001)
    for k,_ in pairs(unused) do
      job.yield()
    local toRemove = {}
    for k,_ in pairs(unused) do
      job.yield()
      if not tableIsEmpty(selected) then
        for k,_ in pairs(selected) do
          local entry = k:gsub(' ','')
      if not tableIsEmpty(materialsToRemove) then
        for k,v in pairs(materialsToRemove) do
          if string.find(v, levelname) then
      if not tableIsEmpty(selected) then
        for k,_ in pairs(selected) do
          table.insert(shapesToRemove, k)
      if not tableIsEmpty(shapesToRemove) then
        for _,v in pairs(shapesToRemove) do
          local file
      if not tableIsEmpty(selected) then
        for k,_ in pairs(selected) do
          table.insert(texturesToRemove, k)
      if not tableIsEmpty(texturesToRemove) then
        for _,v in pairs(texturesToRemove) do
          log('I', '', 'Removing unused texture '..v )
    job.sleep(0.001)
    for file,mats in pairs(dummyMat) do
      if FS:fileExists(file) then
        local materialFile = jsonReadFile(file) or {}
        for key,_ in pairs(mats) do
          if materialFile[key] then materialFile[key] = nil end
    local prefabInstances = scenetree.findClassObjects('Prefab')
    for _,v in pairs(prefabInstances) do
      if abort(job) then return end
    local uniqueModels = {}
    for k,_ in pairs(prefabModels) do uniqueModels[k] = true end
    for k,_ in pairs(staticFiles)  do uniqueModels[k] = true end
    for k,_ in pairs(prefabModels) do uniqueModels[k] = true end
    for k,_ in pairs(staticFiles)  do uniqueModels[k] = true end
    local seen = {}
    for k,_ in pairs(uniqueModels) do
      if abort(job) then return end
        if type(names) == "table" then
          for _,n in pairs(names) do matsUsed[n] = true end
        end
      if o and o.getMaterials then
        for _,tm in pairs(o:getMaterials()) do
          matsUsed[tm:getInternalName()] = true
    local seenTex = {}
    for matName,_ in pairs(matsUsed) do
      if abort(job) then return end
        if texfields then
          for _,file in pairs(texfields) do
            local f = file
@/lua/ge/extensions/core/inventory.lua
  found = true
    for k,v in pairs(item) do
      found = found and valueObj[k] == v
  if onEventData then
    for key,entry in pairs(onEventData) do
      if key == 'remove' then
      if key == 'remove' then
        for subKey,data in pairs(entry) do
          if subKey == 'gold' or subKey == 'silver' or subKey == 'bronze' then
            if earnedMedal and subKey == earnedMedal then
              for invType,value in pairs(data) do
                processTable('remove', invType, value)
@/lua/common/lpack.lua
      local arrayidx, prefix = 1, "{"
      for kk, vv in pairs(v) do
        if kk == arrayidx then
      buf:put('\0'):put(char(min(#v, 250)))
      for kk, vv in pairs(v) do
        if kk == arrayidx then

        for kk, vv in pairs(v) do
          if kk == arrayidx then

        for kk, vv in pairs(v) do
          dictlen = dictlen + 1
@/lua/ge/extensions/editor/gen/utils.lua
		local alib = {}
		for _,p in pairs(apth) do
			unrequire(p)
	if U.out.agraph then
		for _,g in pairs(U.out.agraph) do
			Render.graph(g.list, g.c, g.w)
	end
	for _,s in pairs(U.out.aset) do
--			lo('?? U_draw_set:')
	end
	for _,o in pairs(U.out.atext) do
		Render.label(o.list, o.c)
		else
			for o,e in pairs(t) do
	--            lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
		if not lvlma or lvl < lvlma then
			for o,e in pairs(t) do
	--            lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
	if not list then return end
	for _,p in pairs(list) do
		local r = rma * math.sqrt((p - core_camera.getPosition()):length())
	local out = {}
	for _,v in pairs(list) do
		out[#out + 1] = v + plus
	local s = ''
	for _,step in pairs(path) do
		s = s..step..'/'
	local s = ''
	for _,v in pairs(arr) do
		s = s..tostring(v)..delim
	if not list then return apos end
	for i,_ in pairs(list) do
--    for i = 1,#list do
	local isprop = type(cb) == 'string'
	for k,v in pairs(list) do
		ret[#ret+1] = isprop and v[cb] or cb(k,v)
	local tnew = {}
	for k,v in pairs(arr) do
		tnew[k] = v
	if not b then return a end
	for j,q in pairs(b) do
		if #index(a, q) == 0 then
	local c = vec3(0,0,0)
	for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
		for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
	for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
		for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
			for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
		for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
			for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
				out.avedit[#out.avedit+1] = vec3(x, y, z)
		if type(ai) == 'table' then
			for o,i in pairs(ai) do
				ai[o] = (i - 1) % n + 1
	local mi = math.huge
	for i,p in pairs(aplane) do
		local d = intersectsRay_Plane(line[1], line[2]-line[1], p[1], (p[2]-p[1]):cross(p[3]-p[1]))
  sence = sence or 0
  for _,p in pairs(list) do
    if (a-p):cross(b-p):length() > sence then
  local L,d = (a-b):length()
  for _,p in pairs(list) do
	d = math.abs((p-a):length()+(p-b):length()-L)
	local dmi,imi = math.huge
	for i,v in pairs(base) do
		local d = p:distance(v)
	local pleft,pright
	for i,p in pairs(ahit) do
		local dp = p[2]-a
	local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
	for i,v in pairs(set) do
		if v.x < mi.x then
	local imap12 = {}
	for k,v in pairs(map) do
		imap12[#imap12+1] = imap[v]
	local imap21 = {}
	for k,v in pairs(map) do
		imap21[#imap21+1] = imap[v]
	-- initial objects linking
	for i,loop in pairs(aeref) do
--            nvert = nvert + #loop
			local c,d
			for i,e in pairs(ae) do
--                isend = false
					lo('??______________________________________ is_3_5:')
					for i,_ in pairs(estamp) do
						lo('?? if_STAMP:'..i..':'.._)
		local ama,ima = -math.huge
		for _,iv in pairs(astar) do
			local u = (v4e[iv[1].ind].p - v4e[n2].p):normalized()
		local rc = {}
		for i,list in pairs(e4v) do
				lo('?? for_edge:'..i)
				local pth = {}
				for _,p in pairs(rc) do
					pth[#pth+1] = v4e[p].p
--[[
		for _,rc in pairs(arc) do
			local pth = {}
			local pth = {}
			for _,p in pairs(rc) do
				pth[#pth+1] = v4e[p].p
	local morig,mscale = mrc[1],mrc[2] --{0,0},{1,1}
	for _,n in pairs(v4e) do
		av[#av+1] = n.p
	local e4v,v4e = {},{}
	for i,pth in pairs(aeref) do
		for j=2,#pth do
	local iep = 0
	for i,loop in pairs(aloop) do
		for j,p in pairs(loop) do
	for i,loop in pairs(aloop) do
		for j,p in pairs(loop) do
			iep = iep + 1
			local ie = 0
			for ir,pth in pairs(aeref) do
--                cmi = nil
	end
	for i,pth in pairs(aeref) do
--            dump(pth, '?? for_pth:'..i..'/'..#aloop)
	local dmi,imi,cmi = math.huge
	for i,e in pairs(ae) do
	--            lo('?? for_edge:'..i..':'..tostring(e[1])..':'..tostring(e[2]))
	local ae = {}
	for i,loop in pairs(aloop) do
		for j = 1,#loop-1 do

	for i,loop in pairs(aloop) do
			dump(loop, '?? for_loop:'..i..'/'..#loop)
			dump(loop, '?? for_loop:'..i..'/'..#loop)
		for j,p in pairs(loop) do
--                lo('?? for_p:'..j..':'..tostring(p))
	for i = fr,to,-dir do
--    for i,e in pairs(ae) do
		if (ae[i][1][axis] - p[axis])*dir <= 0 then
	local aex,aey = {},{} --clone(ahole)
	for i,h in pairs(ahole) do
--        aex[#aex+1] = {h[1],{h[1].x,h[2].y},i,1}

	for i,e in pairs(aex) do
			U.dump(e, '??======================== for_E_VERT:'..i)
	local aflag = {}
	for _,c in pairs(astem) do
		local lst = ard[c[1]].list
	local av = {}
	for _,p in pairs(apos) do
		local pproj = U.proj2D(p)
	for i=1,#list do
--    for i,rc in pairs(list) do
		local rc = prop == nil and list[i] or list[i][prop]
@/lua/common/jbeam/sections/meshs.lua
  if vehicleObj and vehicle.triangles then
    for _, triangle in pairs(vehicle.triangles) do
      -- skip denormalized tris
    local prop_count = 0
    for propKey, prop in pairs(vehicle.props) do
      if disableSteeringProp and prop.func == 'steering' then
  if vehicle.flexbodies ~= nil and vehicleObj then
    for flexKey, flexbody in pairs(vehicle.flexbodies) do
      local flexnodeCount = #flexbody['_group_nodes']
    profilerPushEvent('flexmesh_rotate')
    for _, v in pairs(vehicle.flexbodies) do
      local x, y, z, rx, ry, rz = jbeamUtils.getFlexbodyPosRotAfterNodeRotateOffsetMove(v, v.pos and v.pos.x or 0, v.pos and v.pos.y or 0, v.pos and v.pos.z or 0, v.rot and v.rot.x or 0, v.rot and v.rot.y or 0, v.rot and v.rot.z or 0)
    if vehicle.props ~= nil then
      for _, prop in pairs(vehicle.props) do
        if prop.mesh ~= "SPOTLIGHT" and prop.mesh ~= "POINTLIGHT" then
    if vehicle.flexbodies ~= nil then
      for _, flexbody in pairs(vehicle.flexbodies) do
        vehicleObj:requestMesh(flexbody.mesh)
@/lua/ge/extensions/editor/toolUtilities/render.lua
  local nodes = navGraph.nodes
  for _, v in pairs(nodes) do
    if hoverNode and v == hoverNode then
@/lua/ge/extensions/editor/missionEditor.lua
    local passed = true
    for key, fun in pairs(filterFunctions) do
      passed = passed and ( filterFunctions[key](mission, filter[key]))
  table.sort(result.sortedKeys)
  for key, list in pairs(result.missions) do
    table.sort(list, idSort)
    else
      for key, list in pairs(mission.careerSetup.starRewards) do
        local newRewards = {}
  -- if the value didn't exist in the preferences, use the default bool by skipping the item
  for k, v in pairs(_showWindows) do
    if v ~= nil then
@/lua/ge/extensions/flowgraph/nodes/ui/endScreen.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
     if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    if nm == action then
  self:closeDialogue()
  for _,pn in pairs(self.pinOut) do
    pn.value = false
@/lua/ge/extensions/ui/apps/genericMissionData.lua
  -- Try to match the category as a lua pattern
  for category, _ in pairs(missionData.elements) do
    if string.match(category, args.category) then
  local newOrder = {}
  for category, element in pairs(missionData.elements) do
    table.insert(newOrder, {
@/lua/ge/extensions/editor/dynamicDecals/docs.lua
  im.Indent()
  for k, v in pairs(section.children) do
    checkSection(v, string.format("%s/%s", id, k))
@/lua/ge/extensions/career/modules/delivery/vehicleOfferManager.lua
  local status = {}
  for tag, info in pairs(vehicleTags) do
    status[tag] = isVehicleTagUnlocked(tag)
    local tagsByTier = {}
    for key, info in pairs(vehicleTags) do
      local tier = 1
    end
    for tier, list in pairs(tagsByTier) do
      table.sort(list)
    local tagsByTier = {}
    for key, info in pairs(vehicleTags) do
      local tier = 1
    end
    for tier, list in pairs(tagsByTier) do
      table.sort(list)
  local same = true
  for k, v in pairs(a) do
    same = same and a[k] == b[k]
@/lua/ge/extensions/util/autoAnnotation.lua
  key = string.lower(key)
  for pattern, annotation in pairs(tab) do
    pattern = string.lower(pattern)
@/lua/ge/extensions/core/vehicles.lua
  local pcfiles = FS:findFiles("/vehicles/" .. vehicleName .. "/", "*.pc", 0, true, false)
  for _, fn in pairs(pcfiles) do
    local dir, filename, ext = path.split(fn)
local function _fillAggregates(data, destination)
  for key, value in pairs(data) do
    if tableContains(range, key) then
      if type(value) == 'table' then
        for value, active in pairs(value or {}) do
          if active then
local function _mergeAggregates(data, destination)
  for key, value in pairs(data) do
    if tableContains(range, key) or tableContains(convertToRange, key) then
      end
      for value, active in pairs(value or {}) do
        if active then
      else
        for key2, _ in pairs(value) do
          destination[key][key2] = true
local shouldBeDict = { "Region" }
for key, _ in pairs(displayInfo.units) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.predefinedUnits) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.units) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.predefinedUnits) do table.insert(shouldBeNumber, key) end
local shouldBeStringLookup = tableValuesAsLookupDict(shouldBeString)
  local newData = deepcopy(data)
  for key, value in pairs(data) do
    if shouldBeStringLookup[key] and type(value) ~= "string" then
        newData[key] = tableValuesAsLookupDict(newData[key])
        for k, v in pairs(newData[key]) do
          newData[key][k] = true
        if fileData then
          for partName, part in pairs(fileData) do
            if part.slotType == 'main' then
  local paints = {}
  for name, data in pairs(info.colors or {}) do
    if type(data) == 'string' then

  for configFilename, configName in pairs(vehFiles.configs) do
    local contentSource = getSourceAttr(configFilename)
      local validatedPaints = {}
      for name, data in pairs(readData.paints or {}) do
        if type(data) ~= 'table' then
    local validatedPaints = {}
    for name, data in pairs(data.paints or {}) do
      if type(data) ~= 'table' then
    missingInfoConfigs = data.configs
    for mConfigName, mConfig in pairs(missingInfoConfigs) do
      mConfig.is_default_config = false
  local aggHelper = {}
  for _, config in pairs(cache[key].configs) do
    _mergeAggregates(config.aggregates, aggHelper)
  if list then
    for _, value in pairs(list) do
      for propName, propVal in pairs(value.aggregates) do
    for _, value in pairs(list) do
      for propName, propVal in pairs(value.aggregates) do
        if tableContains(finalRanges, propName) then
          end
          for key,_ in pairs(propVal) do
            if type(key) == 'table' then
            if type(key) == 'table' then
              for _, key2 in pairs(key) do
                filter[propName][key2 .. ''] = true
  local models = {}
  for modelName, _ in pairs(getModelsData()) do
    local model = getModel(modelName)
  local configList = {}
  for modelName, _ in pairs(getModelsData()) do
    local model = getModel(modelName)
    if model.configs and not tableIsEmpty(model.configs) then
      for _, config in pairs(model.configs) do
        if array then
  if not model.configs then return end
  for _, config in pairs(model.configs) do
    if configKey == config.key then
  local modelList, configList = {}, {}
  for modelName, _ in pairs(getModelsData()) do
    if p then p:add("model begin") end
    if p then p:add("model insert") end
    for _, config in pairs(model.configs or {}) do
      table.insert(configList, config)
    configList = {}
    for id, vehicle in pairs(vehicles) do
      -- configList
  local vehicles = {}
  for i,m in pairs(models) do
    local vehicle = getModel(m.key)

    for childVehId, initChildVehData in pairs(initVehData.children or {}) do
      buildInitVehCollectionCacheRec(initVehData, initChildVehData, vehData, vehData.children[childVehId])

    for childVehId, childVehData in pairs(vehData.children or {}) do
      buildVehCollectionCacheRec(vehData, childVehData)
local function removeVehicleCollection(collection)
  for vehId, vehData in pairs(collection.vehsData) do
    M.vehIdToVehCollection[vehId] = nil
  collection.vehsData[vehData.vehId] = vehData
  for childVehId, childVehData in pairs(vehData.children or {}) do
    addVehicleToNewCollectionRec(collection, childVehData)
  -- Add the remaining vehicles to new collections
  for childVehId, childVehData in pairs(vehData.children or {}) do
    local newCollection = initVehicleCollection()
    M.vehIdToVehCollection[vehId] = nil
    for childVehId, childVehData in pairs(vehData.children or {}) do
      removeVehicleFromCollectionRec(collection, childVehData)

    for childVehId, childVehData in pairs(vehData.children or {}) do
      local childVeh = getObjectByID(childVehId)
local function getNodeByCid(vehicleData, nodeCid)
  for nodeId, node in pairs(vehicleData.vdata.nodes) do
    if node.cid == nodeCid then
  if not vdata or not vdata.nodes then return end
  for nodeId, node in pairs(vdata.nodes) do
    if node.name == nodeName then
  local couplerOffset = {}
  for _, c in pairs(couplerCache) do
    if c.couplerTag == couplerTag or c.tag == couplerTag or couplerTag == "" or not couplerTag then
    -- get all vehicles to reuse from the other vehicle collection
    for vehId, _ in pairs(otherVehCollection.vehsData) do
      table.insert(state.vehsToReuse, vehId)
--       -- Remove the vehicles from the other collections
--       for otherMainVehId, otherCollection in pairs(M.vehCollections) do
--         for vehId, vehData in pairs(collection.vehsData) do
--       for otherMainVehId, otherCollection in pairs(M.vehCollections) do
--         for vehId, vehData in pairs(collection.vehsData) do
--           if otherCollection.vehsData[vehId] then

--   for mainVehId, vehCollection in pairs(M.vehCollections) do
--     buildVehCollectionCache(vehCollection)

    for k,fn in pairs(designData.gen.patternData) do
      if type(fn) == "table" then
    end
    for _,curFormat in pairs(formats) do
      designData={}; designData.data=design.data.format[curFormat]

  for _, n in pairs(vdata.nodes) do
    if n.couplerTag or n.tag then
    local players = M.vehiclePlayersMap[vid]
    for player, _ in pairs(players) do
      M.playerVehicleMap[player] = nil
    -- Place the children vehicles relative to us
    for childVehId, childVehData in pairs(vehData.children or {}) do
      local childVeh = getObjectByID(childVehId)
  --     local parentVehData = parentCollection.vehsData[parentVehicleId]
  --     for vehId, vehData in pairs(parentVehData.children or {}) do
  --       if vehData.offsetData and vehData.offsetData.type == "coupledNodes" then

--   for childVehId, childVehData in pairs(vehData.children or {}) do
--     if childVehData.offsetData and childVehData.offsetData.type == "coupledNodes" then
  -- Don't serialize the vehsData list in the vehicle collections
  for mainVehId, initVehCollection in pairs(M.initVehCollections) do
    for vehId, vehData in pairs(initVehCollection.vehsData) do
  for mainVehId, initVehCollection in pairs(M.initVehCollections) do
    for vehId, vehData in pairs(initVehCollection.vehsData) do
      vehData.parent = nil
  end
  for mainVehId, collection in pairs(M.vehCollections) do
    for vehId, vehData in pairs(collection.vehsData) do
  for mainVehId, collection in pairs(M.vehCollections) do
    for vehId, vehData in pairs(collection.vehsData) do
      vehData.parent = nil

  for mainVehId, initVehCollection in pairs(M.initVehCollections) do
    buildVehCollectionCache(initVehCollection)
  end
  for mainVehId, collection in pairs(M.vehCollections) do
    buildVehCollectionCache(collection)
--     im.Text('  -' .. vehData.vehId)
--     for childVehId, childVehData in pairs(vehData.children or {}) do
--       drawVehicleCollectionRec(childVehData)
--   if im.Begin("Vehicle Collections Debug") then
--     for mainVehId, collection in pairs(M.vehCollections) do
--       im.Text('Main Veh ID: ' .. mainVehId)
@/lua/ge/extensions/ui/vehicleSelector/tileClustering.lua
  local lowestRecentIdx = math.huge
  for _configKey, config in pairs(clusteredItems.configsByKey) do
    local favouriteIdx = ui_vehicleSelector_general.isFavourite(config.model_key, config.key) or 0
      local configsByConfigTypeName = {}
      for _, config in pairs(clusteredItems.configsByKey) do
        table.insert(configsByConfigTypeName, config)
  local allAuxiliary = true
  for _, config in pairs(clusteredItems.configsByKey) do
    if not config.isAuxiliary then
  local sourcesByIconCount = {}
  for _, config in pairs(clusteredItems.configsByKey) do
    local sources = getSources(config, model.model, true)
  local allAuxiliary = true
  for _, config in pairs(clusteredItems.configsByKey) do
    if not config.isAuxiliary then
  local sourcesByIconCount = {}
  for _, config in pairs(clusteredItems.configsByKey) do
    local sources = getSources(config, model.model, true)
  local clusteredItems = {}
  for _, config in pairs(configs) do
    local group = clusterModeFunctions[clusterMode](config) or "No Data"
@/lua/ge/extensions/flowgraph/nodes/util/getMapObjectsDynField.lua
  local objects = {}
  for objId, _ in pairs(map.objects) do
    local object = getObjectByID(objId)
@/lua/ge/extensions/util/compileMeshes.lua
  local matFiles = FS:findFiles( path, 'materials.cs', -1, true, false)
  for k,v in pairs(matFiles) do
    TorqueScriptLua.exec(v)
  local matFiles = FS:findFiles( path, '*materials.json', -1, true, false)
  for k,v in pairs(matFiles) do
    loadJsonMaterialsFile(v)
  log('I', 'work', 'Will process .dae meshes in following dirs: ')
  for k,v in pairs(compilePaths) do
	log('I', 'work', v )
  -- we need to load the separate folders isolated, as the names of materials and objects will clash otherwise
  for _, baseDir in pairs(compilePaths) do
    local dirs = getDirectories(baseDir)

    for _, dir in pairs(dirs) do
      local inited = false
  else
    for i, f in pairs(allFilesCheckOnly) do
      if not compiledFiles[f] and not isPathIgnored(f) then
@/lua/vehicle/extensions/tech/LINBus/LINBusPeak.lua
        local msg = msgBuffer[i]
        for _, callback in pairs(linMessageCallbacks) do
          callback(msg)
  M.errorCodeLookup = {}
  for key, value in pairs(M.errorCodes) do
    M.errorCodeLookup[value] = key
@/lua/ge/extensions/editor/sitesEditor/zones.lua
  local clrSelected = ColorF(0.91, 0.49, 0.24, 0.75)
  for idx, obj in pairs(objects) do
    local distNodeToCam = (obj.pos - mouseInfo.camPos):length()
local function draggingUndo(actionData)
  for idx, pos in pairs(actionData.oldPos) do
    actionData.self.current.vertices[idx].pos = pos
local function draggingRedo(actionData)
  for idx, pos in pairs(actionData.newPos) do
    actionData.self.current.vertices[idx].pos = pos
  local minDistance = math.huge
  for _, obj in pairs(objects) do
    if obj.vertices then
@/lua/ge/extensions/editor/roadUtils.lua

  for k,filename in pairs(roadTemplateFiles) do
    local jsonData = jsonReadFile(filename)
  local allRoadsCopy = shallowcopy(editor.getAllRoads())
  for roadID, _ in pairs(allRoadsCopy) do
    local road = scenetree.findObjectById(roadID)
@/lua/ge/extensions/flowgraph/nodes/ui/customButtonTEST.lua
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
@/lua/ge/extensions/flowgraph/nodes/activity/autoStarGoals.lua
  local context = {}
  for key, value in pairs(data) do
    if type(value) == 'string' or type(value) == 'number' then
@/lua/vehicle/powertrain/turbocharger.lua
  if type(turbo.wastegateStart) == "table" then
    for k, v in pairs(turbo.wastegateStart) do
      wastegateStart[k] = v * constants.psiToPascal
  if type(turbo.wastegateLimit) == "table" then
    for k, v in pairs(turbo.wastegateLimit) do
      wastegateLimit[k] = v * constants.psiToPascal
  else
    for k, v in pairs(wastegateStart) do
      wastegateLimit[k] = v + 0.01 * constants.psiToPascal
  maxWastegateRange = 1
  for k, v in pairs(wastegateStart) do
    local start = v

  for k, _ in pairs(assignedEngine.torqueCurve) do
    if type(k) == "number" and k < assignedEngine.maxRPM then
@/lua/common/jbeam/sections/vropes.lua
local function findPropIdByName(vehicle, propName)
  for _, prop in pairs(vehicle.props) do
    if prop.name == propName then
    -- After tableSchema processing, ropes is now a dictionary/object
    for ropeName, ropeConfig in pairs(vehicle.vropes) do
      --dump({"ropeName", ropeName, "ropeConfig", ropeConfig})
@/lua/ge/extensions/editor/decalSpline/populate.lua
  if decalsBySpline then
    for material, v in pairs(decalsBySpline) do
      local numDecalsByShape = #v
  -- Now check if any templates are no longer needed, and remove them.
  for material, numInstances in pairs(instanceCounters) do
    if numInstances < 1 then
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/onRecoveryPromptAction.lua
function C:work(args)
  for _, pin in pairs(self.pinOut) do
    pin.value = false
  self.pinOut.flow.value = self.pinIn.flow.value
  for key, val in pairs(self.flags) do
    if self.pinOut[key] then
@/lua/ge/extensions/flowgraph/manager.lua
  else
    for _, graph in pairs(self.graphs) do
      if graph.nodes[i] then
    if not occupied then
      for _, macro in pairs(self.macros) do
        if macro.nodes[i] then
    else
      for _, graph in pairs(self.graphs) do
        if graph.nodes[i] then
      if not occupied then
        for _, macro in pairs(self.macros) do
          if macro.nodes[i] then
  local max = 0
  for grId, graph in pairs(self.graphs) do
    max = math.max(max, grId)
    max = math.max(max, grId)
    for nId, node in pairs(graph.nodes) do
      max = math.max(max, nId)
  end
  for mId, macro in pairs(self.macros) do
    max = math.max(max, mId)
    max = math.max(max, mId)
    for nId, node in pairs(macro.nodes) do
      max = math.max(max, nId)
    local occupied = false
    for _, graph in pairs(self.graphs or {}) do
      if graph.pins[i] or graph.links[i] then
    end
    for _, graph in pairs(self.macros or {}) do
      if graph.pins[i] or graph.links[i] then
  self.moduleOrder = {}
  for k, _ in pairs(self.modules) do
    table.insert(self.moduleOrder, k)
  if self.graph then
    for _, node in pairs(self.graph.nodes) do
      node._isSelected = nil
    end
    for _, link in pairs(self.graph.links) do
      link._isSelected = nil
  -- find all links that are connected to this node.
  for lid, link in pairs(graph.links) do
    if link.sourceNode.id == node.id then
  local pins = {}
  for _, pin in pairs(node.pinList) do
    table.insert(pins, pin)
  -- remove all links and pins.
  for _, link in pairs(inLinks) do
    graph:deleteLink(link)
  end
  for _, link in pairs(outLinks) do
    graph:deleteLink(link)
  end
  for _, pin in pairs(pins) do
    node:removePin(pin)
  local inPins, outPins = node:gatherPins()
  for name, vals in pairs(hardCoded) do
    if node.pinInLocal[name] ~= nil then
  end
  for name, _ in pairs(hidden.p_in) do
    if node.pinInLocal[name] ~= nil then
  end
  for name, _ in pairs(hidden.p_out) do
    if node.pinOut[name] ~= nil then
  if #inLinks > 0 then
    for _, link in pairs(inLinks) do
      local newPin = nil
  if #outLinks > 0 then
    for _, link in pairs(outLinks) do
      local newPin = nil
  if graph:getParent() then
    for _, n in pairs(graph:getParent().nodes) do
      if n.nodeType == 'macro/integrated' then
  --print("Update Subgraphs is called.")
  for id, node in pairs(graph.nodes) do
    if (node.nodeType == "macro/integrated") then
    local graphIds = {}
    for id, graph in pairs(self.graphs) do
      table.insert(graphIds, graph.id)
  ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)
  for id, graph in pairs(self.graphs) do
    if graph.type == "instance" then
  --[[local oldGraph
  for id,graph in pairs(self.macros) do
    if graph.macroPath == savedata.filepath then
    local graphIds = {}
    for id, graph in pairs(self.graphs) do
      table.insert(graphIds, graph.id)
  --ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)
  for id, macro in pairs(self.macros) do
    if macro.macroPath == path then
  local contained = false
  for _, gr in pairs(self.graphs) do
    contained = contained or gr == graph
  end
  for _, gr in pairs(self.macros) do
    contained = contained or gr == graph
    local iNode = nil
    for nId, node in pairs(graph:getParent().nodes) do
      if node:representsGraph() and node:representsGraph().id == graph.id then
    -- check all graphs, there is probably be one in the state graphs.
    for _, g in pairs(self.graphs) do
      for nId, node in pairs(g.nodes) do
    for _, g in pairs(self.graphs) do
      for nId, node in pairs(g.nodes) do
        --dump(g.id.."/"..nId)
  local dir = originPin.direction
  for _, node in pairs(self.graph.nodes) do
    self._creationWorkflowInfo[node.id] = { allowed = true }
    local nextEdge = {}
    for nId, _ in pairs(edge) do
      local node = self.graph.nodes[nId]

            for _, v in pairs(self.graph.links) do
              if self.graph:linkExists(startPin, v.targetPin) then
            --[[
            for _, v in pairs(self.graph.links) do
              if self.graph:linkExists(v.sourcePin, endPin) then
            local p2 = self.graph:findPin(ui_flowgraph_editor.PtrToId(endPinId))
            for k, v in pairs(self.graph.links) do
              if v.targetPin.id == p2.id then
  if ui_flowgraph_editor.BeginDelete() then
    for lId, _ in pairs(self.linksToRemove) do
      ui_flowgraph_editor.DeleteLink(lId)
    end
    for nId, _ in pairs(self.nodesToRemove) do
      ui_flowgraph_editor.DeleteNode(nId)
  end
  for id, node in pairs(self.graph.nodes) do
    node._isSelected = self.selectedNodes[node.id]
  end
  for id, link in pairs(self.graph.links) do
    link._isSelected = self.selectedLinks[link.id]
function C:findLinkIdFromHiddenLinkId(hiddenId)
  for _, link in pairs(self.graph.links) do
    if link.hiddenId == hiddenId then
  }
  for id, _ in pairs(self.selectedNodes) do
    self.copyData.minId = math.min(id, self.copyData.minId)

  for id, link in pairs(self.graph.links) do
    if self.selectedNodes[link.targetNode.id] ~= nil and self.selectedNodes[link.sourceNode.id] ~= nil
  --dumpz(self.copyData,2)
  --for _, gr in pairs(self.copyData.graphs) do
  --  dumpz(gr.nodes,1)
  local center = im.ImVec2(0, 0)
  for _, nodeData in pairs(self.copyData.nodes) do
    center.x = center.x + nodeData.pos[1]--.x
  --local oldIdMap = {}
  for id, nodeData in pairs(self.copyData.nodes) do
    if nodeData then
  end
  for id, node in pairs(ids) do
    if node.nodeType == 'macro/integrated' then
  end
  for id, linkData in pairs(self.copyData.links) do
    local sourceNode = ids[linkData[1]]
  if self.allowEditing then
    for id, _ in pairs(self.selectedNodes) do
      local node = self.graph.nodes[id]

    for id, _ in pairs(self.selectedLinks) do
      local link = self.graph.links[id]
  end
  for k, node in pairs(graph.nodes) do
    ui_flowgraph_editor.DeleteNode(node.id)
  end
  for k, link in pairs(graph.links) do
    ui_flowgraph_editor.DeleteLink(link.id)
function C:deleteGraphs()
  for k, graph in pairs(self.graphs) do
    self:deleteGraph(graph)
  end
  for k, macro in pairs(self.macros) do
    self:deleteGraph(macro)
        local newGraphs = {}
        for gId, g in pairs(currentGraphs) do
          for cId, c in pairs(g.children or {}) do
        for gId, g in pairs(currentGraphs) do
          for cId, c in pairs(g.children or {}) do
            --dump(cId)
    end
    --for k, v in pairs(oldIdMap) do print(k .. "=>" .. (v.nodeType ~= nil and "Node" or "Graph") .. dumps(v.name)) end
    -- rebuild stategraph or create new one

    for _, graph in pairs(self.graphs) do
      for _, node in pairs(graph.nodes) do
    for _, graph in pairs(self.graphs) do
      for _, node in pairs(graph.nodes) do
        node:_postDeserialize()
    ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)
    for _, gr in pairs(self.graphs) do
      for _, node in pairs(gr.nodes) do
    for _, gr in pairs(self.graphs) do
      for _, node in pairs(gr.nodes) do
        node:updateEditorPosition()
    end
    for _, gr in pairs(self.macros) do
      for _, node in pairs(gr.nodes) do
    for _, gr in pairs(self.macros) do
      for _, node in pairs(gr.nodes) do
        node:updateEditorPosition()
    ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)
    for _, gr in pairs(self.graphs) do
      for _, node in pairs(gr.nodes) do
    for _, gr in pairs(self.graphs) do
      for _, node in pairs(gr.nodes) do
        node:updateNodePosition()
function C:findMacrosUsedInChildren(graph, list)
  for id, child in pairs(graph.children or {}) do
    if child.macroID then

  for id, macro in pairs(serializedMacros) do
    local list = {}
    local resolved = {}
    for id, list in pairs(map) do
      if next(list) == nil then
    for _, res in ipairs(resolved) do
      for id, list in pairs(map) do
        if arrayFindValueIndex(list, res) then
local function revertMacroInstanceToSubgraph(self)
  for nodeId, _ in pairs(self.selectedNodes) do
    local oldNode = self.graph.nodes[nodeId]
  local hooks = {}
  for h, ms in pairs(moduleHooks) do
    hooks[h] = function(mh, ...)
  -- put all the nodes in there (if not in there already)
  --[[for _, graph in pairs(self.graphs) do
    if graph.type ~= 'macro' then
    if graph.type ~= 'macro' then
      for _, node in pairs(graph.nodes) do
        table.insert(hookList, node)
  local depKeys = {}
  for _, graph in pairs(self.graphs) do
    if graph.type ~= 'macro' then
    if graph.type ~= 'macro' then
      for _, node in pairs(graph.nodes) do
        for _, dep in ipairs(node.dependencies or {}) do
  end
  for _, m in pairs(self.modules) do
    for _, dep in ipairs(m.dependencies or {}) do
  local deps = {}
  for k, _ in pairs(depKeys) do
    table.insert(deps, k)
  local dualColorChecked = {}
  for _, graph in pairs(self.graphs) do
    for _, node in pairs(graph.nodes) do
  for _, graph in pairs(self.graphs) do
    for _, node in pairs(graph.nodes) do
      local chk = node._flowColors
      local triggerNodes = {}
      for i, c in pairs(chk) do
        table.insert(insert, i.id)
    self.garbageData = nil
    for _, g in pairs(self.graphs) do
      if g.parentId == nil then
      --[[
      for _, graph in pairs(self.graphs) do
        for _, node in pairs(graph.nodes) do
      for _, graph in pairs(self.graphs) do
        for _, node in pairs(graph.nodes) do
          if node.changedRunningState then

  for _, graph in pairs(self.graphs) do
    graph:_executionStarted()

  for _, graph in pairs(self.graphs) do
    graph:_onClear()
    }
  for grId, graph in pairs(self.graphs) do
    graph:_executionStopped()
    self.garbageData.graphs[grId] = graph.gcprobeTable
    for nId, entry in pairs(graph.gcprobeTable.entries or {}) do
      self.garbageData.nodes[nId] = entry
function C:getGraphByName(name)
  for _, gr in pairs(self.graphs) do
    if gr.name == name then
  self.variables:finalizeChanges()
  for _, graph in pairs(self.graphs) do
    graph.variables:finalizeChanges()
@/gameplay/missions/gridmap_v2/collection/002-blenderbowl/script.lua
  -- Loop through all spinners and update their timers
  for id, timer in pairs(spinnerTimers) do
    timer = timer + dtSim
@/lua/common/tech/techUtils.lua
  if type(tbl) ~= 'table' then return tbl end
  for k, v in pairs(tbl) do
    local newV = tableToVec3OrQuat(v)
  if type(tbl) ~= 'table' then return tbl end
  for k, v in pairs(tbl) do
    if migrateKeysMapping[k] ~= nil then
@/lua/ge/extensions/core/recoveryPrompt.lua
  active = false
  for _, o in pairs(buttonOptions) do o.active = false end
end
  active = true
  for _, o in pairs(buttonOptions) do o.active = false end
  buttonOptions.towToRoad.active = true
  active = true
  for _, o in pairs(buttonOptions) do o.active = false end
  buttonOptions.towToRoad.active = true
  active = true
  for _, o in pairs(buttonOptions) do o.active = true end
end

local function deactivateAllButtons() for _, o in pairs(buttonOptions) do o.active = false end end
  local highest = 0
  for _, o in pairs(buttonOptions) do
    highest = math.max(highest, o.order)
  local orders = {}
  for _, o in pairs(buttonOptions) do
    if orders[o.order] then log("E","Order Collision for buttons: " .. orders[o.order] .. "/"..o.id) end
local function setButtonLimits(limits)
  for _, o in pairs(buttonOptions) do o.limit = nil end
  for id, limit in pairs(limits or {}) do
  for _, o in pairs(buttonOptions) do o.limit = nil end
  for id, limit in pairs(limits or {}) do
    if limit == -1 then
local function resetButtonLimitCounters(onlyFor)
  for id, o in pairs(buttonOptions) do
    if not onlyFor or onlyFor[id] then
  local ret = {}
  for id, o in pairs(buttonOptions) do
    ret[id] = {limit = o.limit, count = o.count}
  }
  for id, btn in pairs(buttonOptions) do
    ret.buttons[id] = btn.active or false
  active = data.active
  for id, btnActive in pairs(data.buttons or {}) do
    setButtonActiveById(id, btnActive)
  local buttons = {}
  for id, option in pairs(buttonOptions) do
    if (option.type or "none") == target.type and option.active then
  local recoveryOptions = {}
  for recoveryOptionId, recoveryOptionData in pairs(buttonOptions) do
    recoveryOptions[recoveryOptionId] = {
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaController.lua
local function emitInputs()
  for buttonName, buttonValue in pairs(hardwareState.buttons) do
    if lastHardwareState.buttons[buttonName] ~= buttonValue then

  for axisName, axisValue in pairs(hardwareState.axes) do
    if lastHardwareState.axes[axisName] ~= axisValue then
  buttonStateLookup = {}
  for key, value in pairs(buttonTypes) do
    buttonTypeLookup[value] = key
  end
  for key, value in pairs(buttonStates) do
    buttonStateLookup[value] = key
@/lua/ge/extensions/editor/meshSpline/populate.lua
  if meshesBySpline then
    for _, v in pairs(meshesBySpline) do
      local numMeshesByShape = #v
@/gameplay/missionTypes/timeTrial/constructor.lua
  local vehiclesUsedPerStar = saveData.vehiclesUsedPerStar or {}
  for star, achieved in pairs(attempt.unlockedStars or {}) do
    if achieved then
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/dragTimes.lua
  self.timerData = timers
  for timerId, data in pairs(self.timerData) do
    self:createPin("out", "flow", 'flow_' .. timerId).impulse = true

  for timerId, data in pairs(self.timerData) do
    if data.type ~= "timer" and data.isSet then
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaKombi.lua
  local payload = {counter + counterHighBits}
  for _, dataByte in pairs(data) do
    table.insert(payload, dataByte)
  local payload = {counter}
  for _, dataByte in pairs(data) do
    table.insert(payload, dataByte)
  local payload = {counter}
  for _, dataByte in pairs(data) do
    table.insert(payload, dataByte)
  local payload = {firstByte, (counter + lshift(counterHighBits, 4))}
  for _, dataByte in pairs(data) do
    table.insert(payload, dataByte)
@/lua/common/libs/luasocket/socket/url.lua
    local parsed = {}
    for i,v in base.pairs(default or parsed) do parsed[i] = v end
    -- empty url is parsed to nil
@/lua/ge/extensions/core/lapTimes.lua
  slowStreamData.bestSegmentTimesFormatted = {}
  for segmentIndex, time in pairs(bestSegmentTimes) do
    local lap = bestSegmentLaps[segmentIndex] or 1
@/lua/ge/extensions/core/levels.lua

  for _, d in pairs(level_dirs) do
    -- check if its a valid folder really

  for _, l in pairs(found_levels) do
    -- so, enrich the data of the levels for the user interface below
      local newPreviews = {}
      for _, img in pairs(info["previews"]) do
        table.insert(newPreviews, l.dir..'/' .. img)
    if type(info.spawnPoints) == 'table' then
      for _, point in pairs(info.spawnPoints) do
        if not point.previews then point.previews = {} end
        local newPreviews = {}
        for _, img in pairs(point.previews) do
          table.insert(newPreviews, l.dir..'/' .. img)
  local jsonLevels = {}
  for _, level in pairs(levels) do
    if string.find(level.fullfilename, ".json") then
  local newLevels = {}
  for _, level in pairs(levels) do
    -- check if there is a json version of this, thus hide the old .mis file format
local function onFilesChanged(files)
  for _,v in pairs(files) do
    local filename = v.filename
@/lua/vehicle/powertrain/nitrousOxideInjection.lua
  local counter = 0
  for _, s in pairs(registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
local function updateEnergyStorageRatios()
  for _, s in pairs(registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
  local previousTankCount = storageWithEnergyCounter
  for _, s in pairs(registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
  local addedTorque = {}
  for k, _ in pairs(assignedEngine.torqueCurve) do
    if type(k) == "number" and k < assignedEngine.maxRPM then
@/lua/ge/extensions/editor/forestEditor.lua
                local delItems = {}
                for _, item in pairs(deletedItems) do
                  table.insert(delItems, item)
                -- make sure old and new transforms are in the same order as items
                for itemKey, item in pairs(itemsUnique) do
                  table.insert(itemsTbl, item)
                  table.insert(itemsTbl, item)
                  for sKey, transformTbl in pairs(snappedItems) do
                    if sKey == itemKey then
                  end
                  for newTransformKey, transform in pairs(newTransforms) do
                    if newTransformKey == itemKey then
@/lua/ge/extensions/core/settings/graphic.lua
      local modes = o.GraphicDisplayDriver.getModes()
      for _,v in pairs(modes.keys) do
        if current == v then
      -- log('I','','Overall quality to be applied is '..value..' : '..dumps(levelData))
      for k,v in pairs(levelData) do
        o[k].set(v)
      local temp = {}
      for index, group in pairs(overallQualityPresets) do
        for key, presetValue in pairs(group) do
      for index, group in pairs(overallQualityPresets) do
        for key, presetValue in pairs(group) do
          temp[key] = true
      presetKeys = {}
      for k,v in pairs(temp) do
        table.insert(presetKeys, k)
      local matchedGroupIndex = nil
      for index, group in pairs(overallQualityPresets) do
        -- log('I','','  Checking group: '..tostring(index))

  for k,v in pairs(data) do
    if graphicsOptions[k] and type(graphicsOptions[k].init) == 'function' then
    data.GraphicFullscreen = true
    for k, v in pairs(data) do
      settings.setValue(k, v)
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua

      for _,l in pairs(currentAttemptsByKey.labels) do
        im.TableSetupColumn(l)
      im.TableNextColumn()
      for _, missionData in pairs(currentAttemptsByKey.rows) do
        for _, c in pairs(missionData) do
      for _, missionData in pairs(currentAttemptsByKey.rows) do
        for _, c in pairs(missionData) do
          im.Text(tostring(c.text or "(notext?)"))
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/fileRace.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['vehId_'..i] then
@/gameplay/missionTypes/crawl/customNodes/getDynamicObjectsFromPrefabNode.lua
    local dF = child:getDynamicFields()
    for _, value in pairs(dF or {}) do
      if type(value) == "string" and value == self.pinIn.dynamicName.value then
@/lua/ge/extensions/flowgraph/nodes/gameplay/removeOtherVehicles.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.targetPin == self.pinInLocal[pinName..i] then
@/lua/ge/extensions/editor/sceneTree.lua
    end
    for _, node in pairs(parentNode.children) do
      local child = findNodeById(instance, node, objId)
    if node.children then
      for childId,child in pairs(node.children) do
        cacheGroupNodeInternal(instance, child, groupsToChildren, nestingLevel + 1)
  if node.children then
    for _, child in pairs(node.children) do
      removeNodeByObjectId(child, objId)
  if node.children and tableSize(node.children) then
    for _, child in pairs(node.children) do
      applyFilterRecursive(instance, child)
  if node.children then
    for _, child in pairs(node.children) do
      getNodeOpenStatus(child, res)
  if node.children then
    for _, child in pairs(node.children) do
      applyNodeOpenStatus(child, openStatus)

  for index, instance in pairs(guiInstancer.instances) do
    local openStatus
    node.parent.open = true
    for index, instance in pairs(guiInstancer.instances) do
      instance.rootNodeSizeCache = nil
  if node.children then
    for _, child in pairs(node.children) do
      updateNodeSelection(instance, child)
local function onEditorObjectSelectionChanged()
  for index, instance in pairs(guiInstancer.instances) do
    if instance.selectedNodes then
    if instance.selectedNodes then
      for _, node in pairs(instance.selectedNodes) do
        node.selected = false
        if group then
          for _, instance in pairs(guiInstancer.instances) do
            local groupNode = findNodeByObject(instance, nil, group)
    editingNodeName = nil
    for index, instance in pairs(guiInstancer.instances) do
      instance.rootNodeSizeCache = nil
local function moveSelectionIndex(up)
  for index, instance in pairs(guiInstancer.instances) do
    if instance.focused and instance.currentListIndex then
  if parent then
    for _, node in pairs(instance.selectedNodes) do
      if parent.id == node.id then
local function refreshAllNodes(incomingObjectIds)
  for _, instance in pairs(guiInstancer.instances) do
    cacheGroupNode(instance, instance.rootNode, incomingObjectIds, 0)
    if recursive then
      for _, child in pairs(node.children) do
        sortGroupNode(instance, child, recursive)
  if not node.children then return end
  for _, child in pairs(node.children) do
    child.open = false
local function removeObjectFromSet(object, simset)
  for _, instance in pairs(guiInstancer.instances) do
    removeNodesByObjectIds(instance, {object:getID()})
  refreshAllNodes()
  for index, instance in pairs(guiInstancer.instances) do
    refreshNodeCache(instance)
      local group = scenetree.findObjectById(groupId)
      for _, instance in pairs(guiInstancer.instances) do
        local groupNode = findNodeByObject(instance, nil, group)
    elseif operation == opRemoveObject then
      for _, instance in pairs(guiInstancer.instances) do
        removeNodesByObjectIds(instance, batchedData)

    for index, instance in pairs(guiInstancer.instances) do
      refreshNodeCache(instance)

  for _, instance in pairs(guiInstancer.instances) do
    if instance.rootNode then
local function selectChildrenRecursive(instance, parent, objectIDs)
  for _, node in pairs(parent.children) do
    if node.isGroup then
  table.insert(objectIDs, node.id)
  for _, n in pairs(node.children or {}) do
    setFieldRec(n, v, objectIDs)
    end
    for _, n in pairs(node.children or {}) do
      setFieldRec(n, newValue, objectIDs)
  entrySize = round(math.max(imgui.CalcTextSize("W").y, smallIconSize.y * imgui.uiscale[0]) + imgui.GetStyle().FramePadding.y + 1) + 4
  for index, instance in pairs(guiInstancer.instances) do
    currentSceneTreeInstanceIndex = index
          instance.selectionRange = {}
          for nodeListIndex, _ in pairs(dragSelectionList) do
            instance.selectionRange[nodeListIndex] = true
  recacheAllNodes()
  for key, instance in pairs(guiInstancer.instances) do
    instance.nameFilter = imgui.ImGuiTextFilter()
  local instancesCopy = deepcopy(guiInstancer.instances)
  for key, instance in pairs(guiInstancer.instances) do
    instance.nameFilter = nil
  recacheAllNodes()
  for index, instance in pairs(guiInstancer.instances) do
    instance.selectedNodes = {}
  recacheAllNodes()
  for index, instance in pairs(guiInstancer.instances) do
    instance.selectedNodes = {}
  editor.hideAllSceneTreeInstances = function()
    for _, wnd in pairs(guiInstancer.instances) do
      editor.hideWindow(wnd.windowName)
  editor.showAllSceneTreeInstances = function()
    for _, wnd in pairs(guiInstancer.instances) do
      editor.showWindow(wnd.windowName)
local function onWindowGotFocus(windowName)
  for index, instance in pairs(guiInstancer.instances) do
    if windowName == sceneTreeWindowNamePrefix .. index then
  local allLostFocus = true
  for index, instance in pairs(guiInstancer.instances) do
    if windowName == sceneTreeWindowNamePrefix .. index then
  recacheAllNodes(true)
  for index, instance in pairs(guiInstancer.instances) do
    refreshNodeCache(instance)
  if not objectIds then return end
  for index, instance in pairs(guiInstancer.instances) do
    local renamer = function(func, node, objectIds)
      if node.isGroup then
        for _, child in pairs(node.children) do
          func(func, child, objectIds)

  for index, instance in pairs(guiInstancer.instances) do
    for _, id in ipairs(selectedIds) do
local function closeAllInstances()
  for index, instance in pairs(guiInstancer.instances) do
    local wndName = instance.windowName
  if object then
    for index, instance in pairs(guiInstancer.instances) do
      local node = findNodeByObject(instance, nil, object)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imNumbers.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = nil
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/setDragVehicle.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['vehId_'..i] then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imButton.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/ge/extensions/editor/gen/lib/jbeam.lua
	local alib = {}
	for _,p in pairs(apth) do
		unrequire(p)
        local dparam = {}
        for i,s in pairs(cnt[nm].beams) do
            if not s[1] then
            if not s[1] then
                for k,v in pairs(s) do
                    dparam[k] = v
--        dump(aflex, '?? AFLEX:')
    for key,p in pairs(pvd.vdata.activePartsData) do
        local p,f = jbeamIO.getPart(vehData.ioCtx, key)
--        dump(pvd.vdata.beams,'?? beams:',nil,2)
    for i,b in pairs(pvd.vdata.beams) do
        if p2f[b.partOrigin] then
@/lua/ge/extensions/editor/tech/roadArchitect/import.lua
      -- Iterate over the first children.
      for _, v1 in pairs(d[2]) do
          local pred, succ, geom, elev, sElev, lanes, laneOffsets = nil, nil, {}, {}, {}, {}, {}
          for _, v2 in pairs(v1) do
            if v2.label == 'link' then
              for _, v3 in pairs(v2) do
                if v3.label == 'predecessor' then
            elseif v2.label == 'planView' then
              for _, v3 in pairs(v2) do
                local gInner = {}
                if v3.label == 'geometry' then
                  for _, v4 in pairs(v3) do
                    if v4.label == 'line' then
            elseif v2.label == 'elevationProfile' then
              for _, v3 in pairs(v2) do
                if v3.label == 'elevation' then
            elseif v2.label == 'lateralProfile' then
              for _, v3 in pairs(v2) do
                if v3.label == 'superelevation' then
            elseif v2.label == 'lanes' then
              for _, v3 in pairs(v2) do
                if v3.label == 'laneSection' then
                  local lSecData = { s = tonumber(v3.xarg.s) }
                  for _, v4 in pairs(v3) do
                    if v4.label == 'left' or v4.label == 'right' then
                    if v4.label == 'left' or v4.label == 'right' then
                      for _, v5 in pairs(v4) do
                        if v5.label == 'lane' then
                          lSecData[laneId] = { type = tonumber(lD.type), dir = lD.direction, widths = {}, heights = {} }
                          for _, v6 in pairs(v5) do
                            local lA = v6.xarg
                            elseif v6.label == 'link' then
                              for _, v7 in pairs(v6) do
                                if v7.label == 'predecessor' then
          local jId, jType, conn = tonumber(v1.xarg.id), v1.xarg.type, {}
          for _, v2 in pairs(v1) do
            if v2.label == 'connection' then
              local links = {}
              for _, v3 in pairs(v2) do
                if v3.label == 'laneLink' then
@/lua/console/test.lua
        log('I', "lua.test", "* loading jbeam files:")
        for k,v in pairs(jbeamFiles) do
            local content = readFile(v)
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
    if im.BeginPopup(string.format("WidgetTypePopup_%s", widgetId)) then
      for name, id in pairs(api.widgetTypes[propType]) do
        if im.Selectable1(name, id == (property.widgetType or 0)) then
local function editModeUpdate(dtReal, dtSim, dtRaw)
  for id, _ in pairs(highlightedWidgets) do
    highlightedWidgets[id].time = highlightedWidgets[id].time - dtReal
@/lua/vehicle/guistreams.lua
  table.clear(wheelInfo)
  for i, wd in pairs(wheels.wheelRotators) do
    local w = wheelCache[i] or {}
local function update()
  for k, _ in pairs(streamControl) do
    local handler = streamsHandlers[k]
  table.clear(streamControl)
  for _, streamName in pairs(state) do
    streamControl[streamName] = true
@/lua/ge/extensions/editor/tech/roadArchitect/groups.lua
  local roadArray, ctr = {}, 1
  for _, v in pairs(roads) do
    roadArray[ctr] = v
@/lua/vehicle/powertrain/automaticGearbox.lua
  local reverseGears = {}
  for k, v in pairs(jbeamData.gearRatios) do
    if type(k) == "number" then
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsOutput) do
      device.gearWhineCoefsOutput[gearIndex] = v
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsInput) do
      device.gearWhineCoefsInput[gearIndex] = v
@/lua/ge/extensions/gameplay/missions/missions.lua
}
for _, att in pairs(additionalAttributes) do
  att.valuesByKey = {}
  local bonusStarKeysCache = {}
  for key, act in pairs(mission.careerSetup.starsActive or {}) do
    if act then
  mission.careerSetup._activeStarCache.bonusStarCount = #bonusKeysSorted
  for key, list in pairs(mission.careerSetup.starRewards) do
    for _, reward in ipairs(list) do
  mission.careerSetup._activeStarCache.sortedStarRewardsByKey = {}
  for key, list in pairs(mission.careerSetup.starRewards) do
    local newList = {}
  -- update starRewards attributeKey for backwards compatibility
  for _, list in pairs(missionData.careerSetup.starRewards) do
    for _, reward in ipairs(list) do
  -- sort starReward entries by attributeKey
  for _, list in pairs(missionData.careerSetup.starRewards) do
    -- only order if there's at least 2 elements
  local isNonNumeric = false
  for idx, key in pairs(missionData.careerSetup.defaultStarKeys) do
    if type(idx) ~= "number" then
  missionData.recommendedAttributes = {}
  for k, v in pairs(missionData.recommendedAttributesKeyBasedCache or {}) do
    if v then
  if data.careerSetup.starRewards then
    for key, list in pairs(data.careerSetup.starRewards) do
      for _, reward in ipairs(list) do
          local missionConstructor = require(customPath)() -- gets it as if it was a module, then merges all non-init pairs
          for k, v in pairs(missionConstructor) do
            if k ~= "init" then
  local ret = {}
  for _, mission in pairs(missionsById) do
    if mission.missionType == type then
@/lua/vehicle/controller/braking/brakedDifferentialSteering.lua
  local brakeLName = jbeamData.leftBrakeName or "brake_L"
  for _, wd in pairs(wheels.wheelRotators) do
    if wd.name == brakeLName then
@/lua/vehicle/extensions/gameplayInterfaceModules/interactCargoContainers.lua
  local idx = 1
  for _, container in pairs(v.data.cargoStorage or {}) do
    -- generate an entry for the list that will be sent back to geLua.
  -- store all nodes for groups
  for _, node in pairs(v.data.nodes) do
    if node.cargoGroup and cargoContainerGroupIdToCacheIndex[node.cargoGroup .. node.partPath] then
      local hasValidFunction = true
      for functionName, _ in pairs(functionFieldNames) do
        if node[functionName] then
  -- store all beams for groups
  for _, beam in pairs(v.data.beams) do
    if beam.cargoGroup and cargoContainerGroupIdToCacheIndex[beam.cargoGroup .. beam.partPath] then
      local hasValidFunction = true
      for functionName, _ in pairs(functionFieldNames) do
        if beam[functionName] then
local function clearFunctionResults()
  for _, data in pairs(functionCache) do
    data.result = nil
  anyContainerNeedsUpdate = false
  for _, container in pairs(cargoContainerById) do
    if not container.reachedTarget then
  -- set all container weights according to the params data.
  for _, setContainerData in pairs(params[1] or {}) do
    -- first check if all containers have proper data
  anyContainerNeedsUpdate = false
  for id, _ in pairs(cargoContainerById) do
    local setContainerData = (params[1] or {})[id]
@/lua/vehicle/extensions/tech/impactgen/damageEvaluation.lua

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damaged) do
    damaged[k] = {damage = damaged[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damaged) do
    damaged[k] = {damage = damaged[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damage) do
    damage[k] = {damage = damage[k]}

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1

  for k, v in pairs(damaged) do
    damaged[k] = {damage = damaged[k] / beamCounts[k]}

  for i, beam in pairs(v.data.beams) do
    local part = beam.partPath

  for k, v in pairs(beamCounts) do
    if partData[k] ~= nil and partData[k].beamsBroken ~= nil then
  local nodeProperties = {}
  for k, v in pairs(v.data.nodes[id]) do
    if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then
  local beamProperties = {}
  for k, v in pairs(beam) do
    if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then

  for i, beam in pairs(v.data.beams) do
    local id1 = beam.id1
@/lua/ge/extensions/gameplay/util/damageAssessment.lua

  for _, location in pairs(damageLocationNames) do
    textualDamageLocations.damagedLocations[location.name] =

  -- for _, location in pairs(damageLocationNames) do
  --   if textualDamageLocations.damagedLocations[location.name] then
  local highestScore = 0
  for locationName, locationData in pairs(textualDamageLocations.damagedLocations) do
    if locationData.damageLocationScore > highestScore then
  else
    for cellId, cellDamageInfo in pairs(data.oldSectionsDamageRaw) do
      data.oldSectionsDamageRaw[cellId] = cellDamageInfo[damageType]
    data.newSectionsDamageInfoRaw = {}
    for cellId, cellDamageInfo in pairs(getSectionsDamageInfoRaw(data.vehId)) do
      data.newSectionsDamageInfoRaw[cellId] = cellDamageInfo[damageType]
  else
    for cellId, cellDamageInfo in pairs(data.newSectionsDamageInfoRaw) do
      data.newSectionsDamageInfoRaw[cellId] = cellDamageInfo[damageType]
@/lua/ge/extensions/core/funstuff.lua
        }
        for _, c in pairs(v.configs) do
          local passConfig = true
@/flowgraphEditor/Tower/customNodes/towerNode.lua
local all = {}
for _, rList in pairs(rooms) do
  for _, r in ipairs(rList) do
    local allChildrenIds = {}
    for type, list in pairs(data.allChildrenIds) do
      if type ~= "Prefab" then
@/lua/ge/extensions/flowgraph/nodes/ui/buttons/simpleMultipleButtons.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.targetPin == self.pinInLocal['hideWhenDone_'..i] then
@/lua/ge/extensions/flowgraph/nodes/activity/aggregateAttempt.lua
      local hasDefaultUnlockedStar = false
      for starKey, _ in pairs(attempt.unlockedStars) do
        if self.mgr.activity.careerSetup._activeStarCache.defaultStarKeysByKey[starKey] then
    self.pinOut.change.value = totalChange or {}
    for key, val in pairs(aggregateChange) do
      if self.pinOut[key] then
@/lua/ge/extensions/util/precompileVehicles.lua
    local allModels = core_vehicles.getModelList().models
    for model, _ in pairs(allModels) do
        if vehiclesToLoad[string.lower(model)] == true then
@/lua/vehicle/controller/controlModes.lua
  local control = controlModes[M.controlModeIndex].electrics
  for _, v in pairs(control) do
    local config = configurations[v]
  inputs = {}
  for _, v in pairs(config) do
    configurations[v.electric] = v
        generator = function(entries)
          for k, v in pairs(controlModes) do
            local entry = {
@/lua/ge/extensions/flowgraph/nodes/activity/starsActive.lua
      local unflattenedSettings = {}
      for k, v in pairs(mission.lastUserSettings) do
        table.insert(unflattenedSettings, {key = k, value = v})

    for _, pin in pairs(self.pinOut) do
      if pin.type == 'flow' then
  else
    for _, pin in pairs(self.pinOut) do
      if pin.type == 'flow' then
@/lua/ge/extensions/career/modules/inspectVehicle.lua
        -- find the corresponding route of the current parking spot
        for i, parkingSpotRoute in pairs(dealership.testDrive.parkingSpotRoutes) do
          if parkingSpotRoute.parkingSpotName == parkingSpot.name then
@/lua/ge/extensions/editor/gen/lib/ai.lua
	local alib = {}
	for _,p in pairs(apth) do
		unrequire(p)
--            dump(g, '?? for_g:'..N)
        for i,c in pairs(ac) do
            ac[i] = ac[i] + g[i]*1
--            dump(g, '?? for_g:'..N)
        for i,c in pairs(ac) do
            ac[i] = ac[i] + g[i]*5
        local s = 0
        for i,p in pairs(set) do
            local ds = (p - (a + u*(p-a):dot(u))):length()
--    local c = vec3(0,0,0)
--    for i,p in pairs(set) do
--        c = c + p
@/lua/ge/extensions/flowgraph/nodes/career/onVehicleShoppingEvent.lua
  self.pinOut.vehicleSpawned.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/common/libs/luamqtt/mqtt/protocol.lua
		local res = {}
		for k, v in pairs(value) do
			if type(k) == "number" then
	local res = {}
	for k, v in pairs(packet) do
		res[#res + 1] = str_format("%s=%s", k, value_tostring(v))
@/lua/ge/extensions/editor/gen/top.lua
		if rest then
			for _,i in pairs(rest) do
				dbase[#dbase+1] = dbasepre[i]
			end
			for _,i in pairs(chunk) do
				dchunk[#dchunk+1] = dbasepre[i]
	local af = {}
	for _,c in pairs(achunk) do
		af = M.zip(c, af)
				-- check winding/cross-bounds
				for _,p in pairs(apair) do
					local ps = deepcopy(p)
		local pair,mult = pairsUp(base)
		for _,m in pairs(mult) do
			if #m > 1 then

				for _,v in pairs(ap) do
					av[#av+1] = v
				end
				for _,v in pairs(aP) do
					av[#av+1] = v
			if dbg then
				for i,d in pairs(adata) do
--                    U.dump(d[1], '?? for_DATA:')
--        U.dump(amult, '??+++++ AMULT:')
	for _,l in pairs(amult) do
		if #l > 1 then return false end

	for key,list in pairs(amult) do
--            lo('?? for_M:'..key..':'..#list)
	if #apair == 0 then athread[#athread+1] = cthread end
	for i,t in pairs(athread) do
		if #t % 2 ~= 0 then
	local achunk = {}
	for i,t in pairs(athread) do
		local cbase = {}
		local cbase = {}
		for _,k in pairs(t) do
			cbase[#cbase+1] = base[k]
--        U.dump(cchunk, '?? for_CCHUNK:'..i)
		for _,c in pairs(cchunk) do
			local chunk = {}
			local chunk = {}
			for _,j in pairs(c) do
				chunk[#chunk+1] = t[j]
	local archunk = {}
	for i,p in pairs(apair) do
		archunk[#archunk+1] = {

	for i,p in pairs(apair) do
		--- get centers
--        U.dump(athread, '?? for_THREAD:')
	for _,t in pairs(athread) do
		local cbase = {}
		local cbase = {}
		for _,i in pairs(t) do
			cbase[#cbase+1] = sbase[i]
--            lo('??*************** child_REM:'..#floor.top.achild, true)
			for _,c in pairs(floor.top.achild) do
				if c.id then
--                lo('?? fR_param:'..#achild)
			for i,c in pairs(achild) do
				c.id = floor.top.achild[i].id
						imi = {i,j}
						for _,p in pairs(apair) do
							local ps = deepcopy(p)
--[[
		for key,_ in pairs(noridge) do
				U.dump(achunk[key], '??***************** for_chunk:'..key)
			local cbase = {}
			for _,i in pairs(achunk[key]) do
				cbase[#cbase+1] = sbase[i]
			local isin
			for k,c in pairs(achunk) do
	--                U.dump(c, '?? if_inchunk:'..p[1]..':'..p[2]..':'..#U.index(c,p[1]))
						local b = av[#av-6+j]
	--                for _,b in pairs(baseext) do
						auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
	local ref = base[1]
	for _,b in pairs(baseext) do
		auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
		local ref = base[1]
		for _,b in pairs(baseext) do
			auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
		local ajoin = {}
	--    for k,p in pairs(apair) do
		for k = 1,#apair-1 do
@/lua/ge/extensions/flowgraph/nodes/mission/knockAwayCheck.lua
      self.positions = {}
      for id, val in pairs(prefabData.originalVehicleTransforms) do
        if getObjectByID(id) and not string.find(getObjectByID(id):getInternalName() or "",'ignore') then
        local modes = {}
        for id, val in pairs(self.originalVehicleTransforms) do
          if getObjectByID(id) and not string.find(getObjectByID(id):getInternalName() or "",'ignore') then
    local change, changed  = {}, false
    for id, val in pairs(self.originalVehicleTransforms) do
      change[id] = 'hidden'
function C:onDrawOnMinimap(td)
  for id, pos in pairs(self.positions) do
    if not self.vehicleHit[id] then
@/lua/ge/extensions/flowgraph/utils.lua
local sortedString = {}
for name, val in pairs(mergeFunctionsAll) do
  mergeFunctionsAny[name] = val
end
for name, val in pairs(mergeFunctionsNumber) do
  mergeFunctionsAny['num_'.. name] = val
end
for name, val in pairs(mergeFunctionsBool) do
  mergeFunctionsAny['bool_'.. name] = val
end
for name, val in pairs(mergeFunctionsVec) do
  mergeFunctionsAny['vec_'.. name] = val
end
for name, val in pairs(mergeFunctionsString) do
  mergeFunctionsAny['any_'.. name] = val
@/lua/ge/extensions/career/modules/vehicleClassGrouping.lua

  for _, model in pairs(core_vehicles.getModelList().models) do
    local modelType = model.Type or "Unknown"
    if (modelType == "Car" or modelType == "Truck") and not checkFilter(modelFilter, model.key, invertedFilters.modelFilter) then
      for _, config in pairs(core_vehicles.getModel(model.key).configs) do
        local modelConfigKey = string.format("%s/%s", model.key, config.key)
@/lua/vehicle/controller/gauges/genericGauges.lua
  electricsConfig = {}
  for _, v in pairs(config) do
    table.insert(electricsConfig, v)
  local mergedConfig = {}
  for _, v in pairs(tableFromHeaderTable(config)) do
    mergedConfig[v.deviceName] = mergedConfig[v.deviceName] or {}
  powertrainConfig = {}
  for k, v in pairs(mergedConfig) do
    local device = powertrain.getDevice(k)
  local mergedConfig = {}
  for _, v in pairs(tableFromHeaderTable(config)) do
    mergedConfig[v.moduleName] = mergedConfig[v.moduleName] or {}
  local controllerPath = "gauges/customModules/"
  for k, v in pairs(mergedConfig) do
    local c = controller.getController(controllerPath .. k)
  --dump(configData)
  for k, v in pairs(jbeamData) do
    if k:sub(1, #"configuration_") == "configuration_" then
@/lua/ge/extensions/flowgraph/nodes/math/math.lua
  --include all math functions and constants
  for k, v in pairs(math) do
    env[k] = v
  --dumpz(self.graph.links,2)
  for _, l in pairs(self.graph.links) do
    if l.targetNode.id == self.id then
  self.keyworkdWhiteListLookup = {}
  for _, v in pairs(keywordWhiteList) do
    self.keyworkdWhiteListLookup[v] = true
@/lua/common/jit/p.lua
  local t, n = {}, 0
  for k in pairs(count1) do
    n = n + 1
  local ms = 0
  for k, v in pairs(count1) do
    local pct = floor(v*100/samples + 0.5)
@/lua/ge/extensions/career/modules/loanerVehicles.lua
  }
  for id, offer in pairs(markedForSpawningLoaners) do
    -- spawn vehicle and trigger initialization
  local result = {}
  for inventoryId, vehInfo in pairs(career_modules_inventory.getVehicles()) do
    if vehInfo.owningOrganization then
local function onUpdate(dtReal, dtSim, dtRaw)
  for inventoryId, vehId in pairs(career_modules_inventory.getMapInventoryIdToVehId()) do
    local vehInfo = career_modules_inventory.getVehicles()[inventoryId]

  for inventoryId, loanedVehInfo in pairs(loanedVehiclesInfo) do
    local vehInfo = career_modules_inventory.getVehicles()[inventoryId]
  local counter = 0
  for inventoryId, vehicleInfo in pairs(career_modules_inventory.getVehicles()) do
    if vehicleInfo.owningOrganization == organizationId then
  local numberNonTrailers, numberTrailers = 0, 0
  for id, offer in pairs(markedForSpawningLoaners) do
    local configInfo = core_vehicles.getConfig(offer.model, offer.config)
@/lua/ge/extensions/editor/sceneView.lua
  end
  for sceneViewName, view in pairs(sceneViews) do
    if editor.beginWindow(sceneViewName, sceneViewName) and view.control.renderView  then
    sceneViews = {}
    for name, view in pairs(deserializedData.sceneViews or {}) do
      createNewSceneView(name, view)
  local viewsSerialized = {}
  for sceneViewName, view in pairs(sceneViews) do
    viewsSerialized[sceneViewName] = {
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua

  for _, o in pairs(self.objects) do
    for _, tag in ipairs(o.customFields.sortedTags) do
  end
  for _, o in pairs(self.objects) do
    o._drawMode = 'normal'

  for _, o in pairs(self.objects) do
    o._drawMode = 'faded'

  for _, o in pairs(self.objects) do
    o._drawMode = 'normal'
  else
    for t, _ in pairs(self.sharedSelectedTags or {}) do
      if im.GetCursorPosX() + im.CalcTextSize(t).x + 10 > totalWidth then
    if im.BeginCombo("##tagSelect", "...") then
      for tag, _ in pairs(self.currTags) do
        if im.Selectable1(tag) then
@/lua/vehicle/controller/loggerTemplate.lua
  local storages = energyStorage.getStorages()
  for _, storage in pairs(storages) do
    -- filter for electric batteries
@/lua/ge/extensions/career/modules/delivery/parcelManager.lua
  local same = true
  for k, v in pairs(a) do
    same = same and a[k] == b[k]
  -- check loaner cut for cargo
  for organizationId, _ in pairs(cargo.loanerOrganisations or {}) do
    local organization = freeroam_organizations.getOrganization(organizationId)
  for _, bd in ipairs(breakdown) do
    for key, amount in pairs(bd.rewards) do
      adjustedRewards[key] = (adjustedRewards[key] or 0) + amount
  -- format each group individually
  for gId, group in pairs(cargoByGroupId) do
     -- this function is copied over from cargoscreen... TODO: cleanup
@/lua/ge/extensions/gameplay/sites/sitesManager.lua
  }
  for fp, site in pairs(sitesCache) do
    ret.sitesCache[fp] = site:onSerialize()
  currentLevel = data.currentLevel or getCurrentLevelIdentifier()
  for fp, s in pairs(data.sitesCache) do
    local site = require('/lua/ge/extensions/gameplay/sites/sites')()
@/lua/ge/extensions/career/modules/linearTutorial.lua
  if saveData.linearStep == -1 then
    for key, _ in pairs(saveData.flags) do
      saveData.flags[key] = true

  for k, v in pairs(gameplay_traffic.getTrafficData()) do
    if v.role.name == "police" then

  for k, v in pairs(gameplay_traffic.getTrafficData()) do
    if v.role.name == "police" then

for key, values in pairs(introPopupTable) do
  M[key] = function()
  M.showNonTutorialWelcomeSplashscreen()
  for key, values in pairs(introPopupTable) do
    M[key]()
@/lua/common/libs/LuaIRC/handlers.lua
    if o.track_users then
        for channel, v in pairs(o.channels) do
            v.users[user.nick] = nil
    if o.track_users then
        for channel, v in pairs(o.channels) do
            local users = v.users
@/lua/ge/extensions/flowgraph/nodes/career/onGarageEvent.lua
  self.pinOut.beforeGarageVehicleSelected.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/common/jbeam/groups.lua
  local groups = {}
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" then
    if type(entry) == "table" then
      for rowKey, row in pairs(entry) do
        if type(row) == "table" then
    --log('D', "jbeam.postProcess"," - processed "..tableSize(vehicle.groups).." groups")
    --for k, g in pairs(vehicle.groups) do
    --    log('D', "jbeam.postProcess","  - "..k.." : "..g)
@/gameplay/missionTypes/evade/customNodes/scatterTrafficAwayNode.lua
function C:workOnce()
  for id, v in pairs(gameplay_traffic.getTrafficData()) do
    if v.isAi then
@/lua/ge/extensions/gameplay/missions/startTrigger.lua
    local cluster = {}
    for level, locations in pairs(locationsByLevel) do
      local qt = quadtree.newQuadtree()
@/lua/ge/extensions/editor/raceEditor/startPositions.lua
  if not self.path then return end
  for _, sp in pairs(self.path.startPositions.objects) do
    sp._drawMode = 'normal'
  --self:selectStartPosition(nil)
  for _, sp in pairs(self.path.startPositions.objects) do
    sp._drawMode = 'faded'
  self.index = id
  for _, sp in pairs(self.path.startPositions.objects) do
    sp._drawMode = (id == sp.id) and 'highlight' or 'normal'
  local closestSP = nil
  for idx, sp in pairs(self.path.startPositions.objects) do
    local distToCam = (sp.pos - self.mouseInfo.camPos):length()
@/lua/vehicle/controller/lineLock.lua
  wheelNamesString = ""
  for _, v in pairs(jbeamData.lockedLines or {}) do
    lockedLines[v] = true
@/lua/ge/extensions/util/terrainGenerator.lua
  local blanks = 0
  for k, v in pairs(self.materialsToTextureMaps) do
    if not v then -- if material to texture map entry is still false
@/lua/common/libs/copas/copas/http.lua
    local h = "\r\n"
    for f, v in base.pairs(tosend) do
        h = (canonic[f] or f) .. ": " .. v .. "\r\n" .. h
    -- override with user headers
    for i,v in base.pairs(reqt.headers or lower) do
        lower[string.lower(i)] = v
    -- explicit components override url
    for i,v in base.pairs(reqt) do nreqt[i] = v end
    if nreqt.port == "" then nreqt.port = 80 end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua

        for name2, _ in pairs(sMeshes) do
          if name2 ~= name then
      local i = 1
      for name, _ in pairs(sMeshes) do
        if im.ImGuiTextFilter_PassFilter(meshesFilter, name) then
@/lua/common/extensions/ui/flowgraph/editor.lua
local types = {}
for type, color in pairs(typeColors) do
  types[type] = { ['color'] = color }
-- some style setup
for g, info in pairs(graphTypes) do
  info.tabColor = info.tabColor or lerpVec4(info.color, im.ImVec4(1, 1, 1, 1), 0.4)
    local sortedConfigs = { }
    for k, v in pairs(self.configs) do
      table.insert(sortedConfigs, { key = k, value = v })
            local sortedConfigs = { }
            for k, v in pairs(self.configs) do
              table.insert(sortedConfigs, { key = k, value = v })
                local sortedConfigs = { }
                for k, v in pairs(self.configs) do
                  table.insert(sortedConfigs, { key = k, value = v })
      for mIdx, m in ipairs(self.models) do
        for cIdx, c in pairs(core_vehicles.getModel(m.key).configs) do
          vehSearch:queryElement({
              local sortedConfigs = { }
              for k, v in pairs(self.configs) do
                table.insert(sortedConfigs, { key = k, value = v })
@/lua/common/settings.lua
  local result = {}
  for originalSetting,v in pairs(settings) do
    local setting = upgradeSetting(originalSetting)
    M.internalValues = upgradeSettings(internalValues)
    for k,v in pairs(M.internalValues) do
      local definition = M.defaults[k]
  steamdeckValues = upgradeSettings(steamdeckValues)
  for k,v in pairs(steamdeckValues) do
    local definition = M.defaults[k]
M.defaultValues = {}
for k,v in pairs(M.defaults) do
  M.defaultValues[k] = v[2]
    if CppSettings then
      for k,value in pairs(values) do
        if CppSettings[k] ~= nil then
@/lua/ge/extensions/util/configListGenerator.lua
local function doesVehiclePassFiltersList(vehicleInfo, filters)
  for filterName, parameters in pairs(filters) do
  local popList = {}
  for model_key, pop in pairs(modelPops) do
    table.insert(popList, {model_key = model_key, pop = pop})
  local configData = deepcopy(core_vehicles.getConfigList())
  for _, vehicleInfo in pairs(configData.configs) do
    if vehicleInfo.aggregates.Type
@/lua/common/guihooks.lua
  vehicleLuaSpecific()
  for streamName, data in pairs(cache) do
    queueStreamDataJS(streamName, jsonEncodeWorkBuffer(data))
@/lua/common/jbeam/variables.lua
    local d = stack[stackidx]
    for key, v in pairs(d) do
      local typev = type(v)
    local passed = false
    for k, v in pairs(slotVars) do
      if str_byte(v,1) == 36 then -- $
  local vars = {}
  for kv,vv in pairs(allVariables) do
    if vv.type == 'range' then
  local newVars = {}
  for k, v in pairs(allVariables) do
    if type(v) == 'table' and k ~= '$components' then
  local res = {}
  for k, v in pairs(tbl_readonly_src) do
    -- replace key
  --dump(slot.variables or {})
  for sectionKey, section in pairs(source_raw) do
    if sectionKey == 'components' then
    if sectionKey == 'components' then
      for k3, v3 in pairs(section) do
        if type(v3) == 'table' then
local function setFunctionsToNil(t)
  for k, v in pairs(t) do
    if type(v) == "function" then
  -- remove any variables that are hidden
  for k, v in pairs(vehicle.variables) do
    if v.hidden == true then
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
  parkButtonLookup = {}
  for key, value in pairs(leverStates) do
    leverStateLookup[value] = key
  end
  for key, value in pairs(parkButtonStates) do
    parkButtonLookup[value] = key
@/lua/console/bananabench.lua
  local timeTotalSum = 0
  for k,vehicle in pairs(vehicles) do
    local testVehicle = 'vehicles/' .. vehicle .. '/'
@/lua/ge/extensions/flowgraph/nodes/vehicle/touchingProps.lua
    if self.pinIn.propsIds.value then
      for k,v in pairs(self.pinIn.propsIds.value) do
        if cols[v] then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua

  for var, varData in pairs(varsData) do
    local vdataVar = vdataVars[var]
  vehData.config.vars = vehData.config.vars or {}
  for var, varData in pairs(varsData) do
    if varData.valPtr then
local function onEditorInitialized()
  for k, view in pairs(carViews) do
    view.img = imguiUtils.texObj(view.imgPath)
@/lua/ge/extensions/core/commandhandler.lua
  uiReady = true
  for k, v in pairs(cachedSchemes) do
    onSchemeCommand(v.sc, v.startArg)
@/lua/common/jbeamWriter.lua
        local tableKeys = tableKeysSorted(v)
        for _, kk in pairs(tableKeys) do
          local vv = v[kk]
@/lua/ge/extensions/core/vehicleMirrors.lua
  local mirrorCamPos = vec3()
  for _, m in pairs(vehicleMirrorData) do
    local id1 = vec3(veh:getNodePosition(m.id1))
  -- add some more stuff
  for _, m in pairs(vehicleMirrorData) do
    m.userCorrection = vec3()
@/lua/ge/extensions/editor/raceEditor.lua
  local closestNode = nil
  for idx, node in pairs(currentPath.pathnodes.objects) do
    local distNodeToCam = (node.pos - mouseInfo.camPos):length()
@/lua/vehicle/controller/drivingDynamics/supervisors/components/motorTorqueControl.lua

  for k, v in pairs(wheelGroupControlData) do
    debugPacket.wheelGroups[k] = debugPacket.wheelGroups[k] or {}
  if controlParameters.tractionControl then
    for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
      debugPacket.tractionControl.wheelGroupControl[k] = debugPacket.tractionControl.wheelGroupControl[k] or {}
  if controlParameters.tractionControl then
    for k, _ in pairs(controlParameters.tractionControl.wheelGroupSettings) do
      wheelGroupControlData[k].tractionControlPID:reset()
  if controlParameters.tractionControl then
    for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
      wheelGroupControlData[k].slipThreshold = v.slipThreshold

    for _, setting in pairs(jbeamPIDSettings) do
      controlParameters.yawControl.PIDSettings[setting.type] = {
    controlParameters.yawControl.controlledMotorNames = {}
    for _, v in pairs(yawControlledMotors) do
      relevantMotorNames[v] = true

  for k, _ in pairs(relevantMotorNames) do
    table.insert(controlledMotors, k)

  for k, _ in pairs(wheelGroupControlData) do
    CMU.applyParameter(controlParameters, initialControlParameters, parameters, "tractionControl.wheelGroupSettings." .. k .. ".kP")
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/wheelDistance.lua
    if self.data.debug and closestWheels then
      for k, v in pairs(closestWheels) do
          -- Line from each closest wheel to start line
@/lua/common/tcpServer.lua

    for connection, dataChunks in pairs(recData) do
      for _, dataRaw in ipairs(dataChunks) do
@/lua/ge/extensions/core/quickAccess.lua
  if savedRecentActions then
    for category, actions in pairs(savedRecentActions) do
      recentActions[category] = {}
      recentActions[category] = {}
      for key, action in pairs(actions) do
        local idx = tonumber(key) -- sometimes the key is a number, sometimes it's a string. stupid json
  local savedDynamicSlotSettings = {}
  for key, value in pairs(dynamicSlotSettings) do
    savedDynamicSlotSettings[key] = {
local baseDynamicSlotSettings = {}
for key, value in pairs(dynamicSlotSettings) do
  baseDynamicSlotSettings[key] = {
  if savedDynamicSlotSettings then
    for key, value in pairs(savedDynamicSlotSettings) do
      local slot = dynamicSlotSettings[key]

  for path, value in pairs(flatData) do
    -- Check if path starts with any valid root
    local isValidRoot = nil
    for root in pairs(validRoots) do
      if string.find(path, "^" .. root) then
    -- Add the final value to the leaf node
    for k, v in pairs(value) do
      v.level = path -- Assign the full path to the leaf node
local function addTitleToTreeItems(tree)
  for key, value in pairs(tree.items) do
    if value.path then
    if value.path then
      for key2, value2 in pairs(tree.items) do
        if value2["goto"] and value2["goto"] == value.path then
  local sortedItems = {}
  for key, value in pairs(tree.items) do
    value._key = key
    local newMenuTreeCopyForUI = {}
    for key, value in pairs(menuTreeCopyForUI) do
      if string.find(key, dynamicSlotSettingsData.pathFilter) then
  end
  for key, value in pairs(menuTreeCopyForUI) do
    for _, action in pairs(value or {}) do
  for key, value in pairs(menuTreeCopyForUI) do
    for _, action in pairs(value or {}) do
      action.icon = updateIcon(action.icon, action.title)
    local replaced = false
    for k, v in pairs(menuTree[args.level]) do
      if v.uniqueID == args.uniqueID then
        if vData and vData.vdata and type(vData.vdata.triggers) == 'table' then
          for _, trg in pairs(vData.vdata.triggers or {}) do
            local trigger = veh:getTrigger(trg.abid)
  -- Check each occupied slot to see if it falls within our range
  for slot, _ in pairs(occupiedSlots) do
    local normalizedSlot = ((slot - 1) % maxSlotAmount) + 1

  for path, items in pairs(menuTreeCopy) do
    for _, e in ipairs(items) do

  for path, items in pairs(menuTreeCopy) do
    for i = #items, 1, -1 do
  }
  --for _, path in pairs(favoriteActionsPaths) do
  --  protectedPaths[path] = true
  -- First pass: check all levels for emptiness
  for level, items in pairs(menuTreeCopy) do
    if level ~= "/root/" and not protectedPaths[level] then
  if hasChanges then
    for level, items in pairs(menuTreeCopy) do
      for i = #items, 1, -1 do
  if playerVehId ~= -1 then
    for k, vehicleLevel in pairs(vehicleMenuTrees[playerVehId]) do
      if menuTreeCopy[k] then
  ::gotoButtonsStart::
  for levelPath, levelInfo in pairs(menuTreeCopy) do
    if countLevels(levelPath) >= 2 then
  end
  for level, tree in pairs(menuTreeCopy) do
    local dynamicItems = {}
local function renderTree(node, path)
  for key, value in pairs(node) do
    local currentPath = (path and (path .. "/" .. key) or key)
      -- Check if the current node is a lowest-level table and extract the title if available
      for subKey, subValue in pairs(value) do
        if type(subValue) == "table" then
@/lua/common/libs/xlsxlib/tests/TestManager.lua
    local testNames = {}
    for name, func in pairs(tests) do
      if type(func) == "function" and name:match("^test") then
@/lua/vehicle/powertrain.lua
  local i = 1
  for _, device in pairs(powertrainDevices) do
    serializeInfoRes[i] = serializeInfoRes[i] or {}
      deviceData.children = {}
      for _, v in pairs(device.children) do
        table.insert(deviceData.children, v.name or "unknown")
  if streams.willSend("powertrainDeviceData") then
    for _, v in pairs(powertrainDevices) do
      deviceStream[v.name] = deviceStream[v.name] or {outputTorque = {}, outputAV = {}, isBroken = false, uiSimpleModeControl = v.uiSimpleModeControl}
      local di = 1
      for i, _ in pairs(v.outputPorts) do
        deviceStream[v.name].outputTorque[di] = v[outputTorqueStr[i]]
  local devices = {}
  for _, d in pairs(powertrainDevices) do
    if d.parent.isFake then
      local inverseMap = {}
      for _, d1 in pairs(d.children) do
        inverseMap[d1.inputIndex] = d1.name
      end
      for i, _ in pairs(d.outputPorts) do
        table.insert(device.children, inverseMap[i])
  if playerInfo.firstPlayerSeated then
    for _, device in pairs(powertrainDevices) do
      if device.sendTorqueData then
local function updateSimpleControlButtons()
  for _, device in pairs(powertrainDevices) do
    if device.updateSimpleControlButtons then
  if t.requiredExternalInertiaOutputs then
    for _, index in pairs(t.requiredExternalInertiaOutputs) do
      local hasMatchingChild = false
      local hasMatchingChild = false
      for _, child in pairs(t.children or {}) do
        if child.inputIndex == index then
  if t.children then
    for _, v in pairs(t.children) do
      if not t.outputPorts[v.inputIndex] then
    deviceJbeamData = {}
    for _, jbeamData in pairs(deepcopy(v.data.powertrain)) do
      tableMergeRecursive(jbeamData, v.data[jbeamData.name] or {})
        if type(jbeamData.visualPositionRelativeChildren) == "table" and tableSize(jbeamData.visualPositionRelativeChildren) > 0 then
          for _, childRelativePosition in pairs(jbeamData.visualPositionRelativeChildren) do
            device.visualPositionRelativeChildren = device.visualPositionRelativeChildren or {}

    for _, device in pairs(deviceLookup) do
      if not device.parent then

    for _, device in pairs(powertrainDevices) do
      device.parent = device.parent or {isFake = true, outputTorque0 = 0, outputTorque1 = 0, outputTorque2 = 0, deviceCategories = {}}

    --    for _,device in pairs(powertrainDevices) do
    --      print(device.name)
    --dump(beamBrokenEvents)
    --    for k,v in pairs(powertrainDevices) do
    --      print(v.name)

    for _, v in pairs(v.data.beams) do
      if v.name and v.name ~= "" and beamTriggers[v.name] then
    canResetDevices = true
    for _, device in pairs(powertrainDevices) do
      local hasReset = device.reset ~= nil
    if not tableIsEmpty(previousDeviceModes) then
      for k, v in pairs(previousDeviceModes) do
        powertrainDevices[k]:setMode(v)
  torsionReactorIndexes = {}
  for _, rotator in pairs(wheels.wheelRotators) do
    if rotator.torsionReactor then

  for _, device in pairs(powertrainDevices) do
    if device.initSounds then

  for _, device in pairs(powertrainDevices) do
    for _, groupData in ipairs(device.deformGroups) do
  torqueReactionCoefs2 = {}
  for _, rotator in pairs(wheels.wheelRotators) do
    if rotator.torsionReactor then

  for _, device in pairs(powertrainDevices) do
    if device.resetSounds then
  local newMode = device.mode
  for _, v in pairs(device.availableModes) do
    if found then
local function toggleDefaultDiffs()
  for _, v in pairs(powertrainDevices) do
    if v.type == "differential" and v.defaultToggle then
  local result = {}
  for _, v in pairs(powertrainDevices) do
    if v.type == deviceType then
  local result = {}
  for _, v in pairs(powertrainDevices) do
    if v.deviceCategories[category] then
  local poweredWheels = {}
  for _, wheel in pairs(wheels.wheels) do
    local propulsionDevice = powertrain.getPropulsionDeviceForWheel(wheel.name)

  for _, wheel in pairs(wheels.wheels) do
    local propulsionDevice = powertrain.getPropulsionDeviceForWheel(wheel.name)
  local propulsionDevices = {}
  for propulsionDevice, _ in pairs(duplicatedPropulsionDevices) do
    table.insert(propulsionDevices, powertrain.getDevice(propulsionDevice))
@/lua/ge/extensions/flowgraph/modules/actionModule.lua
  local list = {}
  for k, v in pairs(self.actionsByName) do
    table.insert(list, k)
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
  local objects = {}
  for objId, _ in pairs(map.objects) do
    local object = getObjectByID(objId)
  local playerWasInvolved = false
  for vehId, _ in pairs(crashEndData.sanitizedData.touchedVehIds) do
    if vehId == currentStepParameters.plVehId then
@/lua/common/libs/LuaIRC/asyncoperations.lua
    if not b then
        for k,v in pairs(self.channels) do
            self.channels[k] = nil
@/lua/ge/extensions/flowgraph/nodes/career/onMissionPromptShown.lua
  self.pinOut.openedMenu.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
	local alib = {}
	for _,p in pairs(apth) do
		unrequire(p)
    ageopin = {}
    for i,part in pairs(ajpart) do
        if (part.sel or part.key == cpart) and daedata.dgeo then
--        if part.sel and daedata.dgeo then
            for _,k in pairs(part.amesh) do
--                    lo('?? to_SEL:'..k)
        elseif part.key == unsel then
            for _,k in pairs(part.amesh) do
                local ind = U.index(ageopin, daedata.dgeo[name2ind[k] ].key)[1]
--                dump(beamdata.abeampick,'?? for_BEAMS_p:')
            for i,b in pairs(beamdata.abeampick) do
                cstr = cstr + (b.strength == 'FLT_MAX' and 20000 or b.strength)
        end
        for k,v in pairs(dparam) do
            env.ui['in_'..k] = v
        end
        for k,v in pairs(dparam) do
            env.ui['in_'..k] = v
        ajpart = {}
        for k,v in pairs(djpart) do
            ajpart[#ajpart+1] = v

    for i,d in pairs(daedata.ageo) do
        if d.key == key and d.abeam then
    local set = {}
    for i,b in pairs(beamdata.abeam) do
        local a,b =
    beamdata.agroup = {}
    for k,v in pairs(beamdata.opart.dgroup) do
--        beamdata.dgroup[v.key] = k

        for i,p in pairs(ajpart) do
            if p.name == 'pickup_hood' then
            W.onVal('group_in',gkey)
            for i,g in pairs(beamdata.agroup) do
                if g.key == gkey then
--[[
        for j,d in pairs(data.configs) do
            if d.model_key == 'pickup' then
        local data = ui_vehicleSelector_general.getUiData()
        for j,d in pairs(data.configs) do
            if d.model_key == 'pickup' then
        local dgeo = {}
        for i,m in pairs(am) do
            dgeo[#dgeo+1] = {name=m.name,m=m,mat={nm='WarningMaterial', body=nil, c=c}}
        daedata.ageo = {}
        for k,d in pairs(dgeo) do
            daedata.ageo[#daedata.ageo+1] =
                local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
                for i,v in pairs(pvd.vdata.nodes) do
                    if v.pos.x < mi.x then
    --            local s = 0
            for k,bbag in pairs(dbeam) do
    --                s = s + #b
                    local dmi,pmi = math.huge
                    for j,m in pairs(am) do
                        if m.name == 'pickup_hood' then
                                end),c={0,1,0},w=0.005}
                            for _,b in pairs(bbag) do
                                local a = pvd.vdata.nodes[b.av[1]]
                                local a = pvd.vdata.nodes[b.av[1]]
                                for _,v in pairs(m.verts) do
            --                            dump(a, '?? for_v:'..tostring(v))
--[[
        for k,v in pairs(dbeam) do
            for _,d in pairs(daedata.ageo) do
        for k,v in pairs(dbeam) do
            for _,d in pairs(daedata.ageo) do
                if string.find(d.name,k) == 1 then
        end)
        for i,m in pairs(am) do
--                lo('?? for_PART:'..i..':'..m.name)
--            dump(U.out.agraph[1].list,'?? apath:'..tostring(apath[1][1])..'/'..#apath)
--        for i,b in pairs(pvd.vdata.beams) do
--            if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
        local dicon = {}
        for i,mod in pairs(amodel) do
            local hit
            local hit
            for j,d in pairs(data.configs) do
                if d.model_key == mod then

        for _, config in pairs(data.configs) do
            if not data.displayData.showAuxContent and config.isAuxiliary then
    if true then
        for modelName, _ in pairs(core_vehicles.getModelsData()) do
            lo('?? for_model:'..modelName..':'..tostring(core_vehicles.getModel(modelName).model))
        local vid
        for i,id in pairs(aveh) do
            if false and i == 1 then
            beamdata.m = am[1]
                for k,v in pairs(dbeam) do
--                    dump(v,'??==================== vehDATA_dbeam:'..tableSize(dbeam),nil)
                end
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
                    if string.find(d.name,k) == 1 then
    local matFiles = FS:findFiles('/art/shapes/', '*'..'materials.json', -1, true, false)
    for k,f in pairs(matFiles) do
        local list = extensions.editor_resourceChecker_resourceUtil.getSimObjects(f)
--            lo('?? matFile:'..#list..':'..f)
        for i,m in pairs(list) do
--            lo('?? for_MAT:'..tostring(m.name))
    -- models list
    for modelName, _ in pairs(core_vehicles.getModelsData()) do
        amodel[#amodel+1] = modelName
--    local list = {}
	for k,v in pairs(matFiles) do
--			lo('?? for_mat_FILE:'..tostring(v))
			}
			for _,nm in pairs(wrCommon) do
				local mo = scenetree.findObject(nm)
    fsnode.astep = {'/'}
    for i,s in pairs(astep) do
        fsnode.astep[#fsnode.astep+1] = '/'..s
    local out,outf = {},{}
    for i,f in pairs(adir) do
        f = U.split(f, '/', true)
--        lo('?? pre_FAV:'..#afav)
    for i,p in pairs(afav) do
--            lo('?? if_fav:'..p..':'..fsnode.path)
        if string.find(p, fsnode.path) == 1 then
            for j,d in pairs(out) do
--                    lo('?? if_FAV:'..(fsnode.path..d.s))
--        lo('?? f_list:'..#list)
    for i,f in pairs(list) do
--            lo('?? fof:'..i..':'..tostring(f))
--        dump(daedata.dgeo, '?? DGEO:'..val..':'..n..':'..tableSize(daedata.dgeo),nil,2)
    for k,d in pairs(daedata.dgeo) do
        m = m + 1
                daedata.djoint[k] = jnt
                for i,iv in pairs(jnt) do
                    astick[#astick+1] = daedata.dgeo[val].m.verts[iv]+pos
    local n = 0
    for _,k in pairs(cval['geo_drag'].akey) do
        n = n + 1
    local am = {}
    for k,v in pairs(daedata.dgeo) do
        am[#am+1] = v.m
        lo('>> meshClear:'..#amesh)
    for i,d in pairs(amesh) do
--    if amesh[1] then
    local cfr,cto = vec3(0,0.9,0.2),vec3(0,0,1)
    for i,b in pairs(abeam) do
        w,c,alpha =
local function groupExtract(val, abeamsel, keepbeams)
    for i,d in pairs(beamdata.agroup) do
        if not val or d.key == val then
--[[
            for _,a in pairs(d.list) do
                for _,b in pairs(beamdata.abeam) do
            for _,a in pairs(d.list) do
                for _,b in pairs(beamdata.abeam) do
                    if b.stamp == a.stamp then
]]
            for _,b in pairs(beamdata.abeam) do
                local hit
                for _,a in pairs(d.list) do
                    if b.stamp == a.stamp and val then
    if abeam then
        for i,s in pairs(abeam) do
            abeampick[#abeampick+1] = s
    local npick = 0
    for i,b in pairs(abeam) do
        if not dfrom[b.prn] then dfrom[b.prn] = {} end
    local groupn,beamn = 0,0
    for i,s in pairs(aline) do
        if string.find(s, '"'..beamdata.cpart.name..'":') then
--[[
            for k,d in pairs(djpart['pickup_body'].abeam) do
                local stamp = U.stamp({
        ajpart = {}
        for k,v in pairs(djpart) do
            ajpart[#ajpart+1] = v
    -- models list
--    for modelName, _ in pairs(core_vehicles.getModelsData()) do
--        amodel[#amodel+1] = modelName
    ajpart = {}
    for k,v in pairs(djpart) do
        ajpart[#ajpart+1] = v
        -- cleanup params
        for k,p in pairs(dextparam) do
            lo('?? for_PARAM:'..k..':'..tostring(p == nil)..':'..tostring(tostring(p) == '')..'>'..tostring(p)..'<')
            dump(oval,'?? values_OVAL:')
--        for k,v in pairs(oval) do
--            dextparam[k] = v
        local file = io.open(beamdata.cpart.file,'w')
        for i,s in pairs(aline) do
            file:write(s, '\n')
--        partUp(beamdata.cpart)
        for i,g in pairs(beamdata.agroup) do
            if g.key == 1 then
            ajpart = {}
            for k,v in pairs(djpart) do
                ajpart[#ajpart+1] = v
            ajpart = {}
            for k,v in pairs(djpart) do
                ajpart[#ajpart+1] = v
        local npick = 0
        for i,b in pairs(beamdata.abeampick) do
            if b.prn ~= keyto then
        local groupn,beamn = 0,0
        for i,s in pairs(aline) do
            if string.find(s, '"'..beamdata.cpart.name..'":') then
        local groupn,beamn = 0,0
        for i,s in pairs(aline) do
            if string.find(s, '"'..beamdata.cpart.name..'":') then
                                lo('?? to_TARGET:'..i..':'..groupn..':'..#linemove)
                            for j,s in pairs(linemove) do
                                table.insert(aline, i, s)
            'w')
        for i,s in pairs(aline) do
            file:write(s, '\n')
        partUp(beamdata.cpart)
        for i,g in pairs(beamdata.agroup) do
            if g.key == keyto then
            ajpart = {}
            for k,v in pairs(djpart) do
                ajpart[#ajpart+1] = v
    --            dump(aveh, '?? aVEH:')
            for i,id in pairs(aveh) do
                scenetree.findObjectById(id):delete()
            ajpart = {}
            for k,v in pairs(djpart) do
                ajpart[#ajpart+1] = v
            if cg then
                for j,g in pairs(beamdata.agroup) do
                    if g.key == cg then
]]
--        for i,d in pairs(beamdata.agpick)
--        val.sel = not val.sel
        local cbeam = {}
        for i,b in pairs(beamdata.cgroup) do
            if val == b.stamp then
        local part
        for i,p in pairs(ajpart) do
            if val == p.key then
--[[
        for i,part in pairs(ajpart) do
            if part.sel and daedata.dgeo then
            if part.sel and daedata.dgeo then
                for _,k in pairs(part.amesh) do
    --                    lo('?? if_IND:'..tostring(name2ind[k]))
            elseif part.key == unsel then
                for _,k in pairs(part.amesh) do
                    local ind = U.index(ageopin, daedata.dgeo[name2ind[k] ].key)[1]
        ageopin = {}
        for i,p in pairs(ajpart) do
            p.sel = false
            {m=m,aiv={},aif=fbag})
        for i,p in pairs(apiece) do
            dump(geo.fbag[p],'?? piece:'..p)
            dump(geo.fbag[p],'?? piece:'..p)
            for _,fi in pairs(geo.fbag[p]) do
                dump(fi, '?? fbag_SRC:'..p)
            local pos = amesh[env.ui['lod_up']].body:getPosition()
            for i,d in pairs(apiece) do
--                    dump(geo.abag[d], '?? bag:')
--                    dump(geo.abag[d], '?? bag:')
                for _,ind in pairs(geo.abag[d]) do
                    local v = cval['piece_rot'].verts[ind]+pos
        local apath = {}
        for i,d in pairs(apiece) do
            local fbag = geo.fbag[d]
            local fbag = geo.fbag[d]
            for i,fi in pairs(fbag) do
                apath[#apath+1] = {
        local aline = {}
        for i,geotgt in pairs(daedata.dgeo) do
            if i ~= env.ui['geo_up'] then
            aline = {aline[#aline]}
        for i,line in pairs(aline) do
            local c = (line.ab[1]+line.ab[2])/2
        local pos = amesh[env.ui['lod_up']].body:getPosition()
        for i,fi in pairs(fbag) do
            apath[#apath+1] = {
        if val == env.ui[key] or not editor.keyModifiers.ctrl then return end
        for i,m in pairs(amesh) do
--                lo('?? if_HIT:'..val..':'..i..':'..m.name..':'..daedata.alod[val].name)
                local dicon = {}
                for i,mod in pairs(amodel) do
                    local hit
                    local hit
                    for j,d in pairs(data.configs) do
                        if d.model_key == mod then
            dump(aveh, '?? aVEH:')
        for i,id in pairs(aveh) do
            scenetree.findObjectById(id):delete()
        local list = {}
        for i,f in pairs(fbag[val].list) do
            list[#list+1] = {m.verts[m.faces[f].v+1]+pos,m.verts[m.faces[f+1].v+1]+pos,m.verts[m.faces[f+2].v+1]+pos} -- [#av-0],av[#av-2],av[#av-1],av[#av-0]}
        local am = amesh[1].data
        for i,cm in pairs(am) do
            if cm.key == cgeo then
        local pos = amesh[1].body:getPosition()
        for i,f in pairs(flist) do
            av[#av+1] = m.verts[m.faces[f].v+1]+pos
        local am = {}
        for k,d in pairs(daedata.dgeo) do
            if k == cgeo then
                if val > 0 then
                    for i,k in pairs(geonode.apart) do
    --                    am[#am+1] = daedata.dgeo[k].m
            if val>0 then
                for _,k in pairs(geonode.apart) do
                    am[#am+1] = daedata.dgeo[k].m
        if not cval['DragPos'] then
            for k,d in pairs(daedata.dgeo) do
                if k == cgeo then
                            lo('?? for_POS:'..tostring(d.pos))
                        for i,p in pairs(cval['DragPos'].m.verts) do
                            cval['DragPos'].m.verts[i] = p - d.pos
        local am = {}
        for k,d in pairs(daedata.dgeo) do
            if k == cgeo then
            if k == cgeo then
                for i,p in pairs(cval['DragPos'].m.verts) do
                    d.pos = vec3(val,0,0)
        local am = {}
        for i,m in pairs(mesh.data) do
            local ds = sma*(i-(nm - 1)/2-1)
--[[
        for k,g in pairs(daedata.dgeo) do
            lo('?? for_geo:'..k)
--            local nm = daedata.dgeo[key].name
            for i,d in pairs(ajpart) do
                if d.sel then
            local p1,p2
            for i,d in pairs(daedata.ageo) do
                if d.key == ageopin[1] then
--                local apath = {}
                for i,b in pairs(abeam) do
    --                    lo('?? pp:'..i..':'..tostring(anode[b.av[1]].partOrigin)..':'..tostring(anode[b.av[2]].partOrigin))
                    lo('?? for_PART:')
                for i,b in pairs(abeam) do
                    if anode[b.av[1]].partOrigin == p1 or anode[b.av[2]].partOrigin == p1 then
            local cfr,cto = vec3(0,0.5,0.5),vec3(0,0,1)
            for i,b in pairs(list) do
                w,c,alpha =
            local nm = daedata.dgeo[key].name
            for i,d in pairs(ajpart) do
--                if d.sel then
]]
                for j,k in pairs(d.amesh) do
                    if k == nm then
                local list = {}
                for i,b in pairs(abeam) do
    --                    lo('?? foS:'..i..':'..b.stamp..'/'..'rb8r_rb8rr'..'<')
        if abeam then
            for i,b in pairs(abeam) do
                w,c,alpha =

        for i,d in pairs(daedata.ageo) do
            -- i ~= d.key since sorting
                    local mid,mad = math.huge,-math.huge
                    for i,b in pairs(d.abeam) do
                        if b.strength < math.huge and b.strength < mis then
                        lo('?? if_BEAMS:'..#d.abeam)
                for i,b in pairs(d.abeam) do
--                        w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)

                for i,b in pairs(abeam) do
                        w = 2
        local item
        for i,d in pairs(daedata.ageo) do
            if d.key == val then
        local mi,ma=vec3(math.huge,math.huge,math.huge),vec3(-math.huge,-math.huge,-math.huge)
        for i,v in pairs(daedata.dgeo[val].m.verts) do
            if v.x < mi.x then
        if false then
            for k,d in pairs(daedata.dgeo) do
    --                k='Mesh_160-mesh'
                    if jnt then
                        for i,iv in pairs(jnt) do
                            astick[#astick+1] = daedata.dgeo[val].m.verts[iv]+pos
                        local bv = {}
                        for s,f in pairs(d.m.faces) do
                            bv[#bv+1] = d.m.verts[f.v+1]+pos
]]
        for i,m in pairs(am) do
            if m.key == cgeo then
        local pm = {}
        for i,flist in pairs(fbag) do
            pm[#pm+1] = deepcopy(am[idel])
--                dump(pm[#pm].faces, '?? list:'..i)
            for j,f in pairs(flist.list) do
--                    lo('?? fo_F:'..tostring(f))
            om:createMesh({})
            for i,m in pairs(am) do
                if m.key ~= cgeo then
        ageopin = {}
        for k,v in pairs(daedata.alod[val].list) do
--                dump(v.mat, '?? for_MAT2:'..v.mat.body)
--[[
        for k,d in pairs(dgeo) do
            daedata.ageo[#daedata.ageo+1] =
--[[
                for k,d in pairs(djpart['pickup_body'].abeam) do
                    local stamp = U.stamp({
            ajpart = {}
            for k,v in pairs(djpart) do
                ajpart[#ajpart+1] = v
                local po = {}
                for _,b in pairs(pvd.vdata.beams) do
--                    lo('?? for_beam:'..i..':'..tostring(b.partOrigin))
            end)
            for k,g in pairs(alod) do
--                alod[#alod+1] = {key=k,name=g.name or 'NONE',area=g.area,nface=g.nface}
                    local am = {}
                    for i,d in pairs(g.list) do
                        d.m.material = d.mat.nm
        daedata.ageo = {}
        for k,d in pairs(dgeo) do
            daedata.ageo[#daedata.ageo+1] =
                dump(pvd.vdata.nodes[1], '?? NODES_1:')
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
                    if string.find(d.name,k) == 1 then
                local po = {}
                for _,b in pairs(pvd.vdata.beams) do
--                    lo('?? for_beam:'..i..':'..tostring(b.partOrigin))
            local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
            for i,v in pairs(beamdata.anode) do
                if v.pos.x < mi.x then
            am = {}
            for k,d in pairs(dgeo) do
                am[#am+1] = d.m
        daedata.ageo = {}
        for k,d in pairs(dgeo) do
            daedata.ageo[#daedata.ageo+1] =
            local dbeam = M.forBeams(extensions.core_vehicle_manager.getPlayerVehicleData().vdata)
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
            for k,v in pairs(dbeam) do
                for _,d in pairs(daedata.ageo) do
                    if string.find(d.name,k) == 1 then
                dump(aveh, '?? aVEH:')
            for i,id in pairs(aveh) do
                scenetree.findObjectById(id).hidden = false
            dump(aveh, '?? aVEH:')
        for i,id in pairs(aveh) do
            scenetree.findObjectById(id).hidden = true
        if true then
            for k,d in pairs(dgeo) do
                daedata.ageo[#daedata.ageo+1] = {key=k,name=d.name or 'NONE',area=d.area}
            local am = {}
            for k,d in pairs(dgeo) do
                am[#am+1] = d.m
		if M.valid(am) then
            for i,m in pairs(amesh) do
                local obj = scenetree.findObjectById(m.id)
                                if v.exp then
                                    for _,d in pairs(v.amesh) do
                                        im.TableNextColumn()
--                                im.SetCursorPosX(curx)
                                for k,v in pairs(geonode.astep) do
                                    if daedata.dgeo[v] then
                                        im.PushStyleColor2(im.Col_Text, im.ImVec4(0.6,1,0.9,0.9))
                                        for i,b in pairs(v.list) do
                                            im.TableNextColumn()
-------------------------
                                for k,v in pairs(geonode.apart) do
                                    im.Text(daedata.dgeo[v] and tostring(daedata.dgeo[v].name) or 'NONE')
                                    forParam()
--                                    for k,v in pairs(dparam) do
                                    for j,k in pairs({'strength','deform','spring','damp'}) do
--                                    for k,v in pairs(dparam) do
                                    for j,k in pairs({'strength','deform','spring','damp'}) do
                                        UI.sliderC(k,'in_'..k, {dparam[k]/2,
                                    if fbag then
                                        for i,b in pairs(fbag) do
                                            im.TableNextColumn()
--[[
                            for i,af in pairs(fbag) do
                                im.Text(''..#af)
                                if env.ui['geo_up'] then
                                    for i,d in pairs(daedata.dgeo[env.ui['geo_up'] ].abag) do
                                        im.Text('Piece '..i..' /'..#d..'/')
                        im.Columns(#bag4surf, "geoSurf", true)
                        for i,list in pairs(bag4surf) do
                            im.Text(toroman[i])
                            if im.BeginListBox(id, im.ImVec2(-1,-1)) then
                                for j,af in pairs(list) do
                                    im.PushItemWidth(200)
--                                lo('??***** PIN:'..tostring(inhover)..':'..#ageopin)
                        for c,d in pairs(daedata.dgeo) do
                            if (inhover and editor.keyModifiers.ctrl) or #ageopin>0 then
                        -- JOINTS
                        for c,d in pairs(daedata.dgeo) do
                            if djoint[c] then -- and inhover and inpanel~=1 then
                        if geonode.astep then
                            for _,k in pairs(geonode.astep) do
                                if _ == #geonode.astep then
    --                                lo('?? toPIN:'..tableSize(djoint))
                            for c,d in pairs(daedata.dgeo) do
                                if djoint[c] and c~=inhover then
                            if geonode.astep then
                                for _,k in pairs(geonode.astep) do
                                    if _ == #geonode.astep then
--                                lo('?? toPIN:'..tableSize(djoint))
                        for c,d in pairs(daedata.dgeo) do
                            if djoint[c] and c~=inhover then
                        if geonode.astep then
                            for _,k in pairs(geonode.astep) do
                                if _ == #geonode.astep then
                        im.SetColumnWidth(1, panelW-80)
                        for j,d in pairs(fsnode.afile) do
                            if j == fsnode.cfile then
        --                im.SetColumnWidth(2, 26)
                        for j,s in pairs(fsnode.astep) do
        --                for i=1,#fsnode.astep do
            local set = {}
            for i,b in pairs(beamdata.abeam) do
                local a,b =
            beamdata.agroup = {}
            for k,v in pairs(beamdata.opart.dgroup) do
                beamdata.agroup[#beamdata.agroup+1] = v
                local n = 0
                for _,k in pairs(cval['geo_drag'].akey) do
                    n = n + 1
                local am = {}
                for k,v in pairs(daedata.dgeo) do
                    am[#am+1] = v.m
                    ajpart = {}
                    for k,v in pairs(djpart) do
                        ajpart[#ajpart+1] = v
            local partname
            for i,d in pairs(ajpart) do
                for j,k in pairs(d.amesh) do
            for i,d in pairs(ajpart) do
                for j,k in pairs(d.amesh) do
                    if k == nm then
            local partname
            for i,p in pairs(ajpart) do
                if p.key == env.ui['jpart_pick'] then
    end
    for k,v in pairs(danim) do
        if v.cb then
            meshTarget = nil
            for c,d in pairs(daedata.dgeo) do
                d.mat.c[4] = _conf.alpha
                        local cm = vec3(0,0,0)
                        for _,v in pairs(daedata.dgeo[key].m.verts) do
                            cm = cm + v
--            local pos = amesh[1].body:getPosition()
            for i,d in pairs(daedata.ageo) do
                -- i ~= d.key since sorting
                        local mid,mad = math.huge,-math.huge
                        for i,b in pairs(d.abeam) do
                            if b.strength < math.huge and b.strength < mis then
                    U.out.agraph = {}
                    for i,b in pairs(d.abeam) do
--                        w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)
                        lo('?? to_BR:'..#d.abeam)
                    for i,b in pairs(d.abeam) do
                        w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)
                    U.out.agraph = {}
                    for i,b in pairs(d.abeam) do
                        U.out.agraph[#U.out.agraph+1] = {
--[[
                    for i,list in pairs(bag4surf) do
                        im.Text(toroman[i])
                    im.PushFont3("cairo_regular_medium")
                    for i,list in pairs(bag4surf) do
--                        im.Text(tostring(cgeo))
--                    im.NextColumn()
                    for i,list in pairs(bag4surf) do
                        im.Text('AAA')
                        if im.BeginListBox(id, im.ImVec2(-1,-1)) then
                            for j,af in pairs(list) do
                                im.Text(j)
                                im.Columns(#bag4surf, "geoSurf", true)
                                for i,list in pairs(bag4surf) do
                                    im.SameLine()
                                    lo('??***** PIN:'..tostring(inhover)..':'..#ageopin)
                            for c,d in pairs(daedata.dgeo) do
                                if (inhover and editor.keyModifiers.ctrl) or #ageopin>0 then
--                                lo('?? toPIN:'..tableSize(djoint))
                            for c,d in pairs(daedata.dgeo) do
                                if djoint[c] and c~=inhover then
                            inhover = false
                            for k,v in pairs(daedata.dgeo) do
                                color = im.ImVec4(0.8, 0.8, 0.8, 1) --U.index(ageopin,k)[1] and im.ImVec4(0.9, 0.2, 0.9, 1) or im.ImVec4(0.8, 0.8, 0.8, 1)
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/parkingspot.lua
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions or {}, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
@/lua/ge/extensions/editor/assemblySpline/molecule.lua
  -- Convert valid join groups to mesh attachment data.
  for joinName, joinGroup in pairs(joinGroups) do
    local points = joinGroup.points
      if not isPlaced[i] then
        for j, _ in pairs(isPlaced) do -- Iterate over all placed meshes.
          local placedMesh = rigids[j]
@/lua/ge/extensions/gameplay/speedTraps.lua
  local res = {}
  for _, obj in pairs(objs) do
    if obj.speedTrapType == speedTrapType then
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua

    for id, gr in pairs(self.mgr.garbageData.graphs) do self:computeStats(gr) gr.meta = {type = "graph", graph = self.mgr.graphs[id]} end
    for id, n  in pairs(self.mgr.garbageData.nodes) do self:computeStats(n) n.meta = {type = "node", node = self.mgr.graphs[n.graphId].nodes[id]} end
    for id, gr in pairs(self.mgr.garbageData.graphs) do self:computeStats(gr) gr.meta = {type = "graph", graph = self.mgr.graphs[id]} end
    for id, n  in pairs(self.mgr.garbageData.nodes) do self:computeStats(n) n.meta = {type = "node", node = self.mgr.graphs[n.graphId].nodes[id]} end
    }
    for _, gr in pairs(self.mgr.garbageData.graphs) do
      graphSum.total = graphSum.total + gr.total
    self.maxValue = 0
    for _, gr in pairs(self.mgr.garbageData.graphs) do self:setSortingValue(gr) end
    for _, n  in pairs(self.mgr.garbageData.nodes) do self:setSortingValue(n) end
    for _, gr in pairs(self.mgr.garbageData.graphs) do self:setSortingValue(gr) end
    for _, n  in pairs(self.mgr.garbageData.nodes) do self:setSortingValue(n) end
    self:setSortingValue(self.mgr.garbageData.graphSum)
@/lua/ge/extensions/editor/rallyEditor/static.lua

  for name,variants in pairs(self.systemPacenotes) do
    for i,variant in ipairs(variants) do
  -- for _,spn in ipairs(self.path.static_pacenotes.sorted) do
  --   for lang,langData in pairs(spn.notes) do
  --     im.Text(spn.name)
@/lua/vehicle/ve_utils.lua
      local rvcc = 0
      for rk, rv in pairs(rowValue) do
        --log('D', "jbeam.processTableWithSchema", "### "..header[rk].."//"..tostring(newRow[header[rk]]))
      local localColumnCount = 0
      for _, _ in pairs(data) do
        localColumnCount = localColumnCount + 1
      local i = 1
      for k, v in pairs(data) do
        if type(v) == "table" then
      for i = 1, #data, 1 do
        --k,v in pairs(data) do
        local v = data[i]
@/lua/ge/extensions/gameplay/rally/driveline/drivelineRoute.lua
local updateStableIdIndexes = function(stableIdIndex, insertItem)
  for k, item in pairs(stableIdIndex) do
    if item.idx >= insertItem.idx then
  -- gcprobe() -- about 3000
  for percent, hit in pairs(event.cornerPercentHit) do
    -- gcprobe() -- a couple on first pass after full reset
  -- gcprobe() -- none
  for offset, hit in pairs(event.csMeterOffsetHit) do
    distOffset = offset
  -- gcprobe() -- needs attention
  for offset, hit in pairs(event.ceMeterOffsetHit) do
    local distOffset = offset
  local s = ""
  for k, v in pairs(t) do
    s = s .. tostring(k) .. "=" .. valToStr(v) .. " "
        local md = {}
        for k,v in pairs(point.metadata) do
          if type(v) == "table" then
@/lua/ge/extensions/flowgraph/nodes/util/file/saveData.lua
  if self.pinIn.file.value then
    for name, pin in pairs(self.pinIn) do
      if name ~= 'flow' and name ~= 'reset' and name ~= 'file' then
@/lua/ge/extensions/util/vehicleRopeDebug.lua

  for ropeId, _ in pairs(perfStats.ropeSimTimes) do
    if not activeRopeIds[ropeId] then
@/lua/console/resave-pcs.lua
    local configCount = 0
    for _,vdir in pairs(vehicles) do
      --do we have a vehicle that is known to fail on spawning?
      if #configs == 0 then goto skipme end
      for _,config in pairs(configs) do
          io.write("\tresaving config " .. config .. "\n")
@/lua/ge/extensions/flowgraph/nodes/activity/activityAttempt.lua
    local added = false
    for name, pin in pairs(self.pinIn) do
      if not pin.fixed then
@/lua/common/libs/lustach/src/lustache/renderer.lua
  local max, n = 0, 0
  for k, _ in pairs(array) do
    if not (type(k) == "number" and k > 0 and math_floor(k) == k) then
@/lua/ge/extensions/editor/toolUtilities/util.lua
  local sum = 0.0
  for _, v in pairs(t) do
    sum = sum + v
@/lua/ge/extensions/gameplay/missions/missionTypes/flowMission.lua
  local setup = deepcopy(gameplay_missions_missions.getMissionProgressSetupData(self.missionType))
  for k, v in pairs(setup) do
  --  self[k] = v
  end
  for name, value in pairs(self.progressVariables) do
    if self.progress[name] ~= nil then
  end
  for name, value in pairs(variables or {}) do
    if self.progressVariables[name] ~= nil then

    for k, v in pairs(self.oneOffVariables or {}) do
      tempVariables[k] = v
  -- setup existing progress variables.
  for name, v in pairs(self.progressVariables or {}) do
    local value = v
  if self.userSettings then
    for name, value in pairs(self.userSettings) do
      if self:addOrSetVariable(name, value) then
function C:retrieveProgressFromFlowgraph()
  for name,_ in pairs(self.progressVariables or {}) do
    local value, exists = self.mgr.variables:get(name)
  table.clear(results)
  for id, btn in pairs(byId) do
    table.insert(results, btn)
  o:init()
  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/vehicle/extensions/api.lua
    local data = {}
    for vk,vs in pairs(data_ref) do
        data[vk] = {}
        -- for nodeid, beamnid
        for _,vv in pairs(vs) do
            data[vk][vv.cid] = {}
            data[vk][vv.cid] = {}
            for vk,vi in pairs(vv) do
                if whitelist[vk] then
    local tris = {}
    for k, s in pairs(v.data.beams) do
        if not s.wheelID then
    end
    for k, s in pairs(v.data.nodes) do
        if not s.wheelTreadBeamDeform then
    end
    for k, s in pairs(v.data.triangles) do
        if s.cid then
@/lua/vehicle/energyStorage/fuelTank.lua

  for k, v in pairs(storage.fuelNodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
  --apply final weight as soon as possible
  for k, v in pairs(storage.fuelNodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
  if jbeamData.fuel and jbeamData.fuel._engineGroup_nodes then
    for _, n in pairs(jbeamData.fuel._engineGroup_nodes) do
      storage.fuelNodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the fuel node weights
  --apply final weight as soon as possible
  for k, v in pairs(storage.fuelNodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
@/lua/common/introspection.lua
  local function gather_from_table(tbl, class_name, is_static)
    for key, value in pairs(tbl) do
      if type(key) == "string" and type(value) == "function" then
  -- Iterate over global variables
  for global_key, global_value in pairs(_G) do
    -- Ignore the global variable named "extensions"
@/gameplay/tutorials/customNodes/registerLocationsNode.lua
  --Add the locations to the cars so we can keep track
  for _,car in pairs(self.mgr._fgTutoTestCarsStep.carsData) do
    car.locationsLeft = {1,2,3}
@/lua/vehicle/energyStorage/pressureTank.lua

  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.remainingMass * storage.nodeMassCoef)
  --apply final weight as soon as possible
  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.remainingMass * storage.nodeMassCoef)
  if jbeamData.nodes and jbeamData.nodes._engineGroup_nodes then
    for _, n in pairs(jbeamData.nodes._engineGroup_nodes) do
      storage.nodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the node weights
  --apply final weight as soon as possible
  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
  local ptoSupplyNodeNames = jbeamData.pneumaticPTOSupplyCouplerNodeNames or {}
  for _, nodeName in pairs(ptoSupplyNodeNames) do
    if beamstate.nodeNameMap[nodeName] then
  local ptoConsumerNodeNames = jbeamData.pneumaticPTOConsumerCouplerNodeNames or {}
  for _, nodeName in pairs(ptoConsumerNodeNames) do
    if beamstate.nodeNameMap[nodeName] then
@/lua/vehicle/powertrain/sequentialGearbox.lua
  local reverseGears = {}
  for _, v in pairs(jbeamData.gearRatios) do
    table.insert(v >= 0 and forwardGears or reverseGears, v)
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsOutput) do
      device.gearWhineCoefsOutput[gearIndex] = v
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsInput) do
      device.gearWhineCoefsInput[gearIndex] = v
@/lua/ge/extensions/editor/assemblySpline/populate.lua
  meshPools[splineId] = meshPools[splineId] or {}
  for meshPath, neededCount in pairs(neededMeshes) do
    meshPools[splineId][meshPath] = meshPools[splineId][meshPath] or {}
  -- Delete meshes for paths that are no longer needed.
  for meshPath, pathPool in pairs(meshPools[splineId]) do
    if not neededMeshes[meshPath] then
  -- Clear the existing meshes by path table for reuse.
  for path, meshList in pairs(existingMeshesByPath) do
    table.clear(meshList)
  table.clear(counters)
  for meshPath, _ in pairs(neededMeshes) do
    counters[meshPath] = 1
  if meshPools[splineId] then
    for _, pathPool in pairs(meshPools[splineId]) do
      for i = #pathPool, 1, -1 do
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
  if editor.isWindowVisible(toolWindowName) then
    for _, fn in pairs(onEditorGuiFunctions) do
      fn()

  for _, onUpdateFn in pairs(editorOnUpdateFunctions) do
    onUpdateFn(dtReal, dtSim, dtRaw)
  if not selectedLayers then return end
  for uid, layer in pairs(selectedLayers) do
    editor.selection["dynamicDecalLayer"][uid] = deepcopy(api.getLayerByUid(uid))
  if not selectedLayers then return end
  for uid, layer in pairs(selectedLayers) do
    editor.selection["dynamicDecalLayer"][uid] = deepcopy(api.getLayerByUid(uid))
@/lua/ge/extensions/flowgraph/modules/uiModule.lua
  -- Find highest predefined order
  for _, config in pairs(pageConfig) do
    if config.order > nextOrder then
    if element.pages then
      for pageName, enabled in pairs(element.pages) do
        if not career_career.isActive() and pageConfig[pageName].hideInCareer then
  local unflattenedSettings = {}
  for k, v in pairs(mission.lastUserSettings) do
    table.insert(unflattenedSettings, {key = k, value = v})
  local perfStatsRows = {}
  for _, statData in pairs(driftStats.perfStats) do
    table.insert(perfStatsRows, {
  local totalTiersScore = 0
  for _, statData in pairs(driftStats.tiersStats) do
    totalTiersScore = totalTiersScore + statData.totalScore
  local totalDriftEventsScore = 0
  for _, eventData in pairs(driftStats.driftEvents) do
    totalDriftEventsScore = totalDriftEventsScore + eventData.totalScoreEarned
@/lua/ge/extensions/editor/iconOverview.lua
    local i = 0
    for k,v in pairs(icons) do
      if imgui.ImGuiTextFilter_PassFilter(filter, v) then
@/lua/ge/extensions/career/modules/delivery/cargoCards.lua
  -- build grouping data on cards
  for id, card in pairs(cardsById) do
    local groupTags = {}
  -- build group lists (new groups might have been added)
  for key, group in pairs(groupsByKey) do
    group.cardIdsUnsorted = {}
  -- add card ids to groups
  for id, card in pairs(cardsById) do
    for groupKey, _ in pairs(card.groupTags) do
  for id, card in pairs(cardsById) do
    for groupKey, _ in pairs(card.groupTags) do
      table.insert(groupsByKey[groupKey].cardIdsUnsorted, id)
      table.insert(groupsByKey[groupKey].cardIdsUnsorted, id)
      for filterKey, _ in pairs(card.filterTags) do
        groupsByKey[groupKey].filterTags[filterKey] = true
    end
    for filterKey, _ in pairs(card.filterTags) do
      if not usePlayerCards then
  local destinationGroups = {}
  for key, group in pairs(groupsByKey) do
    if key ~= "destination_noDestination" and key:startswith('destination_') then
    local taskGroups = {}
    for key, group in pairs(groupsByKey) do
      if key:startswith('task_') then
  local idx = 1
  for _, card in pairs(cardsById) do
    card.sortValues = {}
  -- give the groups in the groupsets the sorting values.
  for _, groupSet in pairs(groupSets) do
    for _, group in ipairs(groupSet.groups) do
  local itemCount = 0
  for _, card in pairs(cardsById) do
    if card.isPlayerCard and
@/lua/ge/extensions/util/renderComponentsAPI.lua
    if s.tsVar then
      for k, v in pairs(s) do
        if k ~= 'settings' then
local function setMultiSettings(keyvars)
  for key, var in pairs(keyvars or {}) do
    setSetting(key, var)
@/lua/ge/extensions/editor/flowgraph/basewindow.lua
  local baseInit = o.init
  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/vehicle/extensions/tech/advancedIMU.lua
local function updateGFX(dtSim)
  for sensorId, _ in pairs(advancedIMUs) do
    updateAdvancedIMUGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(advancedIMUs) do
    if vid == objectId then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imDialogue.lua
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    table.insert(outPins, pn)
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
@/lua/vehicle/tech/techVehicleUtils.lua
  local withWheels = not withoutWheels
  for _, n in pairs(v.data.nodes) do
    local cid = n.cid
  local cidList = {}
  for _, n in pairs(v.data.nodes) do
    if n.name then
@/lua/ge/extensions/gameplay/playmodeMarkers.lua
  playmodeKd = nil
  for _, marker in pairs(markersByClusterId) do
    marker:clearObjects()
  local poisByMarkerType = {}
  for markerType, _ in pairs(playmodeMarkerTypeNames) do
    poisByMarkerType[markerType] = {}
  -- let each markertype cluster their own markers in their own way
  for markerType, _ in pairs(playmodeMarkerTypeNames) do
    local factory = require('lua/ge/extensions/gameplay/markers/'..markerType)
@/lua/ge/extensions/util/richPresence.lua
  end
  for k,v in pairs(timelineEvents) do
    gameplay_statistic.callbackRegister(k, false, statCbTimeline)
  end
  for k,v in pairs(timelineEvents) do
    gameplay_statistic.callbackRemove(k, false, statCbTimeline)
  M.richPresenceEnabled = enabled
  for k, v in pairs(toggleableFunctions) do
    M[k] = enabled and v or nop
@/lua/common/json-ast.lua
local function _convertTableSchema(fileRoot)
  for _, partRoot in pairs(fileRoot) do
    if type(partRoot) == 'table' then
    end
    for k, v in pairs(node) do
      _cleanupData(v)
@/lua/ge/extensions/core/audioRibbon.lua
  table.clear(axes[5])
  for k, ribbonIdx in pairs(nearList) do
    local ribbon = ribbons[ribbonIdx]
  for i = 1, 5 do
    for _, sfxEmitterOnAxis in pairs(sfxEmitters[i]) do
      sfxEmitterOnAxis.vol = 0.0
    local axis = axes[i]
    for eventName, event in pairs(axis) do
      if sfxEmitters[i][eventName] == nil then
  for i = 1, 5 do
    for _, sfxEmitterOnAxis in pairs(sfxEmitters[i]) do
      if simObjectExists(sfxEmitterOnAxis.emitter) then
  for i = 1, 5 do
    for _, sfxEmitterByAxis in pairs(sfxEmitters[i]) do
      if sfxEmitterByAxis.emitter and simObjectExists(sfxEmitterByAxis.emitter) then
@/lua/ge/extensions/editor/gen/exp_solidflex.lua
    local alib = {}
    for _,p in pairs(apth) do
        unrequire(p)
    aed = {}
    for i,d in pairs(aax) do
        dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
    for i=1,#aa do
--    for i,a in pairs(ac) do
--            U.dump(avp,'??----------- NEXT:'..i..':'..aind[i])
        for i=1,(cvneigh and #dedge or #dedge-2) do
--        for i,s in pairs(dedge) do
            local ab = U.split(dedge[i], '_')
        end
--        for i,d in pairs(aax) do
--            elist[#elist+1] = {d[1][1],d[2][1]}
--        dedge = {U.stamp({1,2})}
        for i,d in pairs(aax) do
            dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
            local ai2 = U.split(dedge[i],'_')
            for _,ind in pairs(ai2) do
                if de[ind] then
                if not cvover then
                    for i,d in pairs(segpick) do
                        if d.on then
                            dedge = {}
                            for i,d in pairs(aax) do
                                dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
            local amil,amir,vmil,vmir = math.huge,math.huge
            for i,v in pairs(m.verts) do
                local ang = U.vang(U.proj2D(v-campos),U.proj2D(tocur-campos),true)
                -- check side hit
                for i,d in pairs(segpick) do
                    d.on = nil
            local hit
            for i,v in pairs(m.verts) do
                local ang = U.vang(v-campos,tocur-campos)
            if not cvover then
                for i,d in pairs(segpick) do
                    if d.on then
                        dedge = {}
                        for i,d in pairs(aax) do
                            dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
--------------------------
    for i,d in pairs(danim) do
        if d.cb then
            local ami1,ami2,vmi1,vmi2
            for i,v in pairs(m.verts) do
                local ang = U.vang(v-campos,tocur-campos)
@/lua/ge/extensions/gameplay/discover/discover_037.lua

for _, discover in pairs(freeroamExperiences) do
  table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
table.insert(D.pageInfo.sections[1].discoverIds, "johnson_valley")
for _, mission in pairs(missions) do
  table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/flowgraph/nodes/scene/raceLineParking.lua
    self:_executionStopped()
    for _, p in pairs(self.pinOut) do p.value = nil end
  end
@/lua/vehicle/extensions/chassisData.lua
  local wheelCount = 0
  for _, wheel in pairs(wheels.wheels) do
    local wheelNodePos = vec3(v.data.nodes[wheel.node1].pos) --find the wheel position

  for _, wheel in pairs(wheels.wheels) do
    local wheelNodePos = vec3(v.data.nodes[wheel.node1].pos) --find the wheel position
  local RL2 = 0
  for _, n in pairs(v.data.nodes) do
    if n.cid == frontRightWheel.node1 then
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
    allCategories = {}
    for name, info in pairs(allActions) do
      allCategories[info.cat] = allCategories[info.cat] or {}
    --  self.search:setSameScoreResolvingFunction(sortFun)
    for name, info in pairs(allActions) do
      self.search:queryElement({
    self.list = {}
    for k, v in pairs(listKeys) do
      if v then
@/lua/ge/extensions/flowgraph/nodes/debug/drawGraph.lua
  local i = 1
  for l, pin in pairs(self.pinIn) do
    if pin.value and type(pin.value) == "number" then
  local i = 0
  for l, pin in pairs(self.pinInLocal) do
    if pin.type == "number" and self.pinIn[l].value then
    for i = old, new + 1, -1 do
      for _, link in pairs(self.graph.links) do
        if link.targetPin == self.pinInLocal['value'..i]then
@/lua/ge/extensions/freeroam/bigMapPoiProvider.lua
  local activeGroups = {}
  for groupKey, isVisible in pairs(groupVisibilityState) do
    if isVisible then
  local allGroups = {}
  for groupKey, _ in pairs(groupVisibilityState) do
    table.insert(allGroups, groupKey)
M.resetAllGroupsToVisible = function()
  for groupKey, _ in pairs(groupVisibilityState) do
    groupVisibilityState[groupKey] = true

    for key, val in pairs(gameplay_missions_progress.formatSaveDataForBigmap(mission.id) or {}) do
      ret[key] = val

  for _, diff in pairs(gameplay_missions_missions.getAdditionalAttributes().difficulty.valuesByKey) do
    groupData["difficulty_"..diff.key] = {label = "Difficulty: " ..diff.translationKey}
  end
  for _, v in pairs(gameplay_missions_missions.getAdditionalAttributes().vehicle.valuesByKey) do
    groupData["vehicleUsed_"..v.key] = {label = "Vehicle Used: " .. v.translationKey}

  for groupKey, gr in pairs(groupData) do
    gr.elements = {}

      for tag, act in pairs(filterData.groupTags) do
        if act then
  -- Sort elements in each group
  for key, gr in pairs(groupData) do
    local elementsAsPois = {}
  if cachedGroupData then
    for groupKey, gr in pairs(cachedGroupData) do
      gr.visible = M.getGroupVisibility(groupKey)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imColor.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/vehicle/bdebugImpl.lua

    for _, wd in pairs(wheels.wheels) do
      local pressureGroupID = v.data.pressureGroups[wd.pressureGroup]

        for _, nid in pairs(wd.treadNodes or {}) do
          obj.debugDrawProxy:drawNodeSphere(nid, 0.02, ironbowColor((obj:getNodeTemperature(nid) - baseTemp) * 0.004))
        end
        for _, nid in pairs(wd.nodes or {}) do
          obj.debugDrawProxy:drawNodeSphere(nid, 0.02, ironbowColor((obj:getNodeTemperature(nid) - baseTemp) * 0.004))
    M.nodeCollision = nodeCollision
    for _, c in pairs(wheelContacts) do
      obj.debugDrawProxy:drawSphere(0.02, (c.contactPoint / c.totalForce), color(255, 0, 0, 255))

    for nodeCID, data in pairs(M.state.vehicle.nodeDebugTextModes[modeID].data) do
      local nodePos = obj:getAbsNodePosition(nodeCID)
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
          local k = 1
          for _,v in pairs(node.group) do
            txt = txt .. v
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderNodeTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    tempVec:set(obj:getPositionXYZ())
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderBeamTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderBeamTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
    initRenderBeamTexts(partsSelected, showWheels)
    for groupID, entries in pairs(groupIDToEntries) do
      local text = ''
          local breakGroups = type(beam.breakGroup) == "table" and beam.breakGroup or {beam.breakGroup}
          for _, g in pairs(breakGroups) do
            if not groupsData[g] then
    end
    for g, groupData in pairs(groupsData) do
      local groupPos = groupData[2]
          local deformGroups = type(beam.deformGroup) == "table" and beam.deformGroup or {beam.deformGroup}
          for _, g in pairs(deformGroups) do
            if not groupsData[g] then
    end
    for g, groupData in pairs(groupsData) do
      local groupPos = groupData[2]
    local ampScaler = 1 / ampMax
    for beamID, energy in pairs(beamFreqModeAmp) do
      local a = min(255, energy * ampScaler * 255 * alpha)
    -- Find beams between t nodes
    for name, rail in pairs(v.data.rails or {}) do
      if name ~= 'cids' then
  if modeID == 2 then
    for name, rail in pairs(v.data.rails or {}) do
      if name ~= 'cids' then
  elseif modeID == 3 or modeID == 4 or modeID == 5 then
    for name, rail in pairs(v.data.rails or {}) do
      if name ~= 'cids' then
  M.debugDraw = nop
  for k, v in pairs(M.state.vehicle) do
    if type(v) ~= "table" and v ~= M.initState.vehicle[k] and M.state.vehicleDebugVisible then
  M.state.vehicle = M.state.vehicle or deepcopy(M.initState.vehicle)
  for k, v in pairs(M.state.vehicle) do
    if type(v) ~= "table" and v ~= M.initState.vehicle[k] then
@/lua/ge/extensions/flowgraph/nodes/mission/getCustomVehicleData.lua

    for name, pin in pairs(self.pinOut) do
      if name ~= 'flow' and not pin.fixed then
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
      self.configs = {}
      for k, v in pairs(modelData.configs) do
        table.insert(self.configs, v)
@/gameplay/missionTypes/drift/customNodes/updateTaskListObjectivesNode.lua
  local context = {}
  for key, value in pairs(data) do
    if type(value) == 'string' or type(value) == 'number' then
      local unflattenedSettings = {}
      for k, v in pairs(mission.lastUserSettings) do
        table.insert(unflattenedSettings, {key = k, value = v})
@/lua/ge/extensions/core/multiseatCamera.lua
  -- avg position
  for pid, _ in pairs(plvehicles) do
    local k = be:getPlayerVehicleID(pid)
  -- max distance
  for k, _ in pairs(plvehicles) do
    local v = map.objects[be:getPlayerVehicleID(k)]
@/gameplay/tutorials/customNodes/registerTestCarsNode.lua
  self.mgr._fgTutoTestCarsStep.getCarBySortedId = function(id)
    for _,car in pairs(self.mgr._fgTutoTestCarsStep.carsData) do
      if car.id == id then return car end
@/lua/common/extensions.lua
  local autoModulesSize = 0
  for k, m in pairs(luaMods) do
    if m.__manuallyLoaded__ then
      log('W', logTag, 'Unloading the following modules. Their dependencies could not be resolved:')
      for k, v in pairs(failedModules) do
        log('W', logTag, '    ' .. tostring(k) .. ' dependencies not resolved: '..dumps(v))
  -- nop the function cache so that existing hook iterations do not get invalidated as they are used
  for fName, fList in pairs(luaExtensionFuncs) do
    for i, _ in ipairs(fList) do
  if #{...} > 1 then
    for k,array in pairs({...}) do
      for i, v in pairs(array) do
    for k,array in pairs({...}) do
      for i, v in pairs(array) do
        table.insert(exceptionList, v)
    if deprecatedExtensions then
      for name,data in pairs(deprecatedExtensions) do
        if type(m[name]) == 'function' then
  for j, m in ipairs(resolvedModules) do
    for name, value in pairs(m) do
      if type(value) == "function" and name ~= "wrapAllExtensions" then
local function extSafetyCheck(m, extName, extPath)
  for k, v in pairs(m) do
    if type(v) == 'function' then
  if profileAllExtensionFunctions then
    for memberName, member in pairs(m) do
      if type(member) == "function" then
  local luaFiles = FS:findFiles(directory, '*.lua', -1, true, false)
  for _,luaFilename in pairs(luaFiles) do
    load(luaFilename:sub(1,-5))  -- strip '.lua'
      local skip = false
      for _,subDir in pairs(excludeSubdirectories) do
        if string.find(file, subDir) then
  local loadedModules = {}
  for k, m in pairs(luaMods) do
    local ignoreExtension = tableContains(doNotSerializeModules, m.__extensionName__)
    local extbatch = {}
    for extName,extPath in pairs(extensionsData.loadedModules) do
      local tempExtName = luaPathToExtName(extPath)
    if not m then return end
    for k, func in pairs(m) do
      if string.sub(k, 1, 2) == 'on' and type(func) == 'function' then
  local hookLists = {}
  for _, m in pairs(hookableTablesInstances) do
    walkTable(hookLists, m, m)
  self.hookProxies = {}
  for k, sinkList in pairs(hookLists) do
    self.hookProxies[k] = function(...)
    self.hookProxies[k] = function(...)
      for _, m in pairs(sinkList) do
        m[k](m, ...)
  local loadedNames = {}
  for k, data in pairs(luaMods) do
    if not excludeVirtual or not data.__virtual__ then
@/lua/ge/extensions/editor/raceEditor/pacenotes.lua
  if not self.path then return end
  for _, n in pairs(self.path.pacenotes.objects) do
    n._drawMode = 'normal'

  for _, seg in pairs(self.path.segments.objects) do
    seg._drawMode = 'faded'
  --self:selectPacenote(nil)
  for _, n in pairs(self.path.pacenotes.objects) do
    n._drawMode = 'none'
  self.index = id
  for _, note in pairs(self.path.pacenotes.objects) do
    note._drawMode = (id == note.id) and 'highlight' or 'normal'
  else
    for _, seg in pairs(self.path.segments.objects) do
      seg._drawMode = 'faded'
  local closestNote = nil
  for idx, note in pairs(self.path.pacenotes.objects) do
    local distNoteToCam = (note.pos - self.mouseInfo.camPos):length()
      self:selector('Segment','segment', 'Associated Segment')
      for _, seg in pairs(self.path.segments.objects) do
        seg._drawMode = note.segment == -1 and 'normal' or (note.segment == seg.id and 'normal' or 'faded')
@/lua/ge/extensions/core/vehiclePaints.lua
  multiPaintSetupsByIdCache = {}
  for _, paintFilePath in pairs(core_vehicles.getPaintFiles()) do
    local paintFile = core_vehicles.getFilesParsed()[paintFilePath]

    for id, paint in pairs(paintFile.paints or {}) do
      paint.sources = nil
    end
    for id, collection in pairs(paintFile.collections or {}) do
      for _, paintName in pairs(collection.paints) do
    for id, collection in pairs(paintFile.collections or {}) do
      for _, paintName in pairs(collection.paints) do
        paintCollectionsByIdCache[id] = collection
    end
    for id, setup in pairs(paintFile.multiPaintSetups or {}) do
      multiPaintSetupsByIdCache[id] = setup
  end
  for cId, collection in pairs(paintCollectionsByIdCache) do
    local cleanCollection = {}
    local cleanCollection = {}
    for pId, paint in pairs(collection.paints) do
      if type(paint) == 'string' then paint = {id = paint} end
  end
  for id, paint in pairs(paintsByIdCache) do
    paint.id = id
  local multiNames = 0
  for name, paints in pairs(paintsByNameAsListCache) do
    if #paints > 1 then
  -- add names to old paint format
  for name, paint in pairs(model.paints) do
    paint.name = name
  -- convert paint names from library to actual paint data
  for _, paint in pairs(model.libraryPaints or {}) do
    if type(paint) == 'string' then paint = {id = paint} end
  -- convert paint collections to actual paint data
  for _, collectionId in pairs(model.paintCollections or {}) do
    local collection = getPaintCollectionById(collectionId)
    if collection then
      for _, paint in pairs(collection) do
        debugLog("adding paint from model.paintCollections to model: " .. dumps(paint.id) .. "/" .. dumps(paint.name) .. " (from collection " .. dumps(collectionId) .. ")")
  -- process all the setups already in the model
  for _, multiPaintSetup in pairs(multiPaintSetupsToProcess) do
    local multiPaintSetupWithNames = resolveMultiPaintSetupHelper(model, multiPaintSetup, paintIdsToPaintNames, multiPaintSetupsByIdOrName)
  -- process configs
  for _, config in pairs(configs) do
    debugConfigKey = config.key
  -- validate paints and set up factory and custom paints lists
  for _, paint in pairs(model.paints) do
    if not paint.class then
  model.customPaintNames = {}
  for _, paint in pairs(model.paints) do
    if paint.class == 'factory' then
  local newRandomPaintDistributionModel = {}
  for paintNameOrId, probability in pairs(model.randomPaintDistribution) do
    local paint = model.paints[paintNameOrId]
  -- then add all the remaining paint names with 1 probability
  for paintName, _ in pairs(model.paints) do
    newRandomPaintDistributionModel[paintName] = newRandomPaintDistributionModel[paintName] or defaultRandomPaintProbability
  local newRandomMultiPaintDistributionModel = {}
  for multiPaintSetupNameOrId, probability in pairs(model.randomMultiPaintDistribution) do
    local multiPaintSetup = multiPaintSetupsByName[multiPaintSetupNameOrId]
  local allPaintResults = {}
  for paintName, probability in pairs(newRandomPaintDistributionModel) do
    totalProbability = totalProbability + probability
  end
  for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionModel) do
    totalProbability = totalProbability + probability
    debugLog("model " .. dumps(key) .. " has " .. #allPaintResults .. " paint results with total probability " .. totalProbability)
    for _, paintResult in pairs(allPaintResults) do
      debugLog("paint result: " .. dumps(paintResult.type) .. ", " .. dumps(paintResult.paintName1) .. ", " .. dumps(paintResult.paintName2) .. ", " .. dumps(paintResult.paintName3) .. ", probability: " .. dumps(paintResult.probability))
  -- now do the same for each config
  for _, config in pairs(configs) do
    debugConfigKey = config.key
    local newRandomPaintDistributionConfig = {}
    for paintNameOrId, probability in pairs(config.randomPaintDistribution or {}) do
      local paint = model.paints[paintNameOrId]
    if not config.ignoreModelRandomPaintDistribution then
      for paintName, probability in pairs(newRandomPaintDistributionModel) do
        newRandomPaintDistributionConfig[paintName] = newRandomPaintDistributionConfig[paintName] or newRandomPaintDistributionModel[paintName] or probability
    -- then add all the remaining paint names with 1 probability
    for paintName, _ in pairs(model.paints) do
      newRandomPaintDistributionConfig[paintName] = newRandomPaintDistributionConfig[paintName] or defaultRandomPaintProbability
    local newRandomMultiPaintDistributionConfig = {}
    for multiPaintSetupNameOrId, probability in pairs(config.randomMultiPaintDistribution or {}) do
      local multiPaintSetup = multiPaintSetupsByName[multiPaintSetupNameOrId]
    if not config.ignoreModelRandomMultiPaintDistribution then
      for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionConfig) do
        newRandomMultiPaintDistributionConfig[multiPaintSetupName] = newRandomMultiPaintDistributionModel[multiPaintSetupName] or probability
    local allPaintResults = {}
    for paintName, probability in pairs(newRandomPaintDistributionConfig) do
      totalProbability = totalProbability + probability
    end
    for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionConfig) do
      totalProbability = totalProbability + probability
      debugLog("config " .. dumps(config.key) .. " has " .. #allPaintResults .. " paint results with total probability " .. totalProbability)
      for _, paintResult in pairs(allPaintResults) do
        debugLog("paint result: " .. dumps(paintResult.type) .. ", " .. dumps(paintResult.paintName1) .. ", " .. dumps(paintResult.paintName2) .. ", " .. dumps(paintResult.paintName3) .. ", probability: " .. dumps(paintResult.probability))
  local sortedResults = {}
  for name, count in pairs(resultsByName) do
    table.insert(sortedResults, {name = name, count = count})
@/lua/ge/extensions/gameplay/drag/saveSystem.lua
      if lane.waypoints then
        for waypointType, waypoint in pairs(lane.waypoints) do
          convertedLane.waypoints[waypointType] = {

  for vehId, racer in pairs(dragData.racers) do
    if racer.timers and racer.timers.time_1_4 and racer.isPlayable then
          for i, racerInfo in ipairs(historyEntry.racerInfos) do
            for rVehId, rRacer in pairs(dragData.racers) do
              if rRacer.lane == racerInfo.laneNum then
  local result = {}
  for configHash, data in pairs(dialTimes) do
    result[configHash] = {
  local allHistory = {}
  for configHash, data in pairs(dialTimes) do
    if data.history then
@/lua/ge/extensions/editor/tech/roadArchitect/export.lua
    local widthCubics = {}
    for key, _ in pairs(laneKeys) do
      local k = laneKeys[key]
    local laneHOffsets = {}
    for key, _ in pairs(laneKeys) do
      local k = laneKeys[key]
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceNodeReached.lua

    for name, pin in pairs(self.pinOut) do
      if not pin.fixed then
    self.pinOut.nodeName.value = nil
    for name, pin in pairs(self.pinOut) do
      if not pin.fixed then pin.value = nil end
@/lua/vehicle/controller/shiftLights.lua
  flashingLEDsOff = {}
  for _, v in pairs(jbeamData.flashingOutputElectrics or {}) do
    table.insert(flashingLEDsOn, v)
  end
  for _, v in pairs(jbeamData.flashingAlternateOutputElectrics or {}) do
    table.insert(flashingLEDsOff, v)
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceMarkers.lua
        local wps = {}
        for _, m in pairs(self.minimapMarkers) do
          m.mode = 'hidden'
        if self.pinIn.ignoreRecovery.value then
          for k, v in pairs(wps) do
            if v == 'recovery' then
  --if not self.pinIn.raceData.value then return end
  for _, m in pairs(self.minimapMarkers or {}) do
    local clr = m.color
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
    local idx = 1
    for bmId, data in pairs(visibleBigMapIdsToCardIds) do
      for cardId, _ in pairs(data.cardIds) do
    for bmId, data in pairs(visibleBigMapIdsToCardIds) do
      for cardId, _ in pairs(data.cardIds) do
        local card = cardsById[cardId]
  -- format each group individually
  for _, group in pairs(cargoByGroupId) do
    local formatted = formatCargoGroup(group, playerCargoContainers, updateFirstSeen)
    local vehicleInfoList = {}
    for vehId, vehicleInfo in pairs(uiData.player.vehicles) do
      --table.sort(vehicleInfo.containers, function(a,b) return a.name < b.name end)
  --[[
  for poiId, list in pairs(visibleBigMapIdsToCardIds) do
    for _, cargo in ipairs(list) do
      local maxDelay = 0
      for _, delay in pairs(data) do
        maxDelay = math.max(delay, maxDelay)
          step.makeStepReturnTrueFunction(function()
            for vehId, data in pairs(data) do
              local veh = scenetree.findObjectById(vehId)
        -- no delay, no freeze
        for vehId, data in pairs(data) do
          local veh = scenetree.findObjectById(vehId)
  targetsById[sourceId] = nil
  for otherFacId, targetData in pairs(targetsById) do
    local dist = targetData.distances[sourceId]

  for tgtId1, targetData1 in pairs(targetsById) do
    for tgtId2, targetData2 in pairs(targetsById) do
  for tgtId1, targetData1 in pairs(targetsById) do
    for tgtId2, targetData2 in pairs(targetsById) do
      if tgtId1 ~= tgtId2 and tgtId1 ~= "player" and tgtId2 ~= "player" then
    if elem then
      for cardId, _ in pairs(elem.cardIds) do
        cardIds[cardId] = true
  visibleBigMapIdsToCardIds = {}
  for cardId, card in pairs(cardsById) do
    --print("Card Id: " .. cardId)
    --print("Card Id: " .. cardId)
    for bigMapId, _ in pairs(card.bigMapIds or {}) do
      --print("  -> " ..bigMapId)
@/lua/ge/extensions/editor/sitesEditor/parkingSpots.lua
  if mouseInfo.down then
    for idx, node in pairs(objects) do
      local tmpSpotAmount = 1
  local currScale = "Custom"
  for name, vehScale in pairs(psVehScales) do
    if self.current.scl == vehScale then
  if im.BeginCombo("##psScaleSelect", currScale) then
    for name, vehScale in pairs(psVehScales) do
      if im.Selectable1(name) then
@/lua/ge/extensions/editor/audioEventsList.lua

  for _, event in pairs(eventsList) do
    local entry = {name = event.eventName, score = 1}
@/lua/common/extensions/ui/improfiler.lua
  local t, n = {}, 0
  for k in pairs(count1) do
    n = n + 1
  local ms = 0
  for k, v in pairs(count1) do
    local pct = floor(v*100/samples + 0.5)
@/lua/ge/extensions/tech/openDriveExporter.lua
  coords2d = {}
  for k, p in pairs(coords3d) do
    coords2d[k] = vec3(p.x, p.y, 0.0)
  local ctr = 0
  for k, v in pairs(table) do
    if type(v) == 'table' then
local function doesCollectionContainSegment(collection, testSeg)
  for k, trialSeg in pairs(collection) do
    local matches = 0
    local matches = 0
    for k1, v1 in pairs(trialSeg) do
      for k2, v2 in pairs(testSeg) do
    for k1, v1 in pairs(trialSeg) do
      for k2, v2 in pairs(testSeg) do
        if v1 == v2 then
local function doesSegmentContainKey(currentPath, nextSuccessorKey)
  for k, v in pairs(currentPath) do
    if v == nextSuccessorKey then
  local keys = {}
  for key in pairs(tbl) do
    table.insert(keys, key)
  local ctr = 1
  for headKey, v1 in pairs(graph) do
    local firstChildren = getChildren(graph[headKey])
    -- Remove condition that filtered out nodes with 2 children
    for childKey, v2 in pairs(successors) do
      local currentPath = {}
        local allSuccessorsVisited = true
        for nextSuccessorKey, _ in pairs(nextSuccessors) do
          if not doesSegmentContainKey(currentPath, nextSuccessorKey) then
        local didFind = false
        for nextSuccessorKey, v3 in pairs(nextSuccessors) do
          if doesSegmentContainKey(currentPath, nextSuccessorKey) == false then
  local avgWidths = {}
  for k, seg in pairs(pathSegments) do
    local subTotal = 0.0
    local ctr = 0
    for i, key in pairs(seg) do
      subTotal = subTotal + widths[key]
  local ctr = 1
  for i, v in pairs(pathSegments) do
    -- Use the sorted iteration map to choose the segment processing order here.
  local ctr = 0
  for i, seg in pairs(pathSegments) do
    -- Test if the path segment's first node is a true junction (no dead ends). Only add if we haven't already found it previously.
local function updateConnectivityData()
  for k, r in pairs(roads) do
    local predecessor = 'none'
    for j, r2 in pairs(roads) do
      if k ~= j and r['start'] == r2['finish'] then
    local successor = 'none'
    for j, r2 in pairs(roads) do
      if k ~= j and r['finish'] == r2['start'] then
  local jCtr = 1
  for key, id in pairs(junctionMap) do
    local connectionRoads = {}
    local ctr = 1
    for rid, r in pairs(roads) do
      if key == r['start'] then
  -- Write the road data.
  for rid, r in pairs(roads) do
  -- Write the junction data, in order.
  for jid, j in pairs(junctions) do
    f:write('\n')
    local ctr = 0
    for i1, ra in pairs(j['connectionRoads']) do
      for i2, rb in pairs(j['connectionRoads']) do
    for i1, ra in pairs(j['connectionRoads']) do
      for i2, rb in pairs(j['connectionRoads']) do
        if i1 ~= i2 then
@/lua/ge/extensions/core/trailerRespawn.lua
local function getPreviousAttachedVehicleId(vehId)
  for previousId, connectionInfo in pairs(trailerReg) do
    if type(connectionInfo) == "table" and connectionInfo.trailerId == vehId then

  for vId, coupleInfo in pairs(trailerReg) do
    if coupleInfo and coupleInfo.trailerId == vehId then

  for vID,c in pairs(core_vehicles.vehsCouplerOffset) do
    local veh = getObjectByID(vID)
      local pos = veh:getPosition()
      for ci,cpos in pairs(c) do
        debugDrawer:drawSphere( (pos+cpos), 0.05, ColorF(1, 0, 0, 1))
@/lua/ge/extensions/editor/crawlEditor/waypoints.lua

  for _, node in pairs(self.path.pathnodes.objects) do
    node._drawMode = (id == node.id) and 'highlight' or 'normal'
  local closestNode = nil
  for idx, node in pairs(self.path.pathnodes.objects) do
    if node.pos then

  for idx, node in pairs(self.path.pathnodes.objects) do
    if node.pos then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imSeparator.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/ge/extensions/gameplay/crawl/saveSystem.lua
local function onSaveCurrentSaveSlot(currentSavePath)
  for id, trail in pairs(M.getPlayerCrawlTrailsById()) do
    if trail._dirty then
@/lua/ge/extensions/tech/impactgen/crashOutput.lua
local function fuzzyTableLookup(d, n)
  for k, v in pairs(d) do
    if string.find(string.lower(k), string.lower(n)) ~= nil then

  for k, v in pairs(outParts) do
    local data = fuzzyTableLookup(parts, k)

  for k, v in pairs(outParts) do
    if ret[k] == nil then

  for part, v in pairs(parts) do
    local partEntry = {}
@/lua/ge/extensions/editor/aiTests.lua

  for k, v in pairs(params) do
    vehicles[id][k] = v[1][0]
  if not id or not vehicles[id] then return end
  for k, v in pairs(params) do
    v[1][0] = vehicles[id][k]
        local pos, rot = firstVeh:getPosition(), firstVeh:getRotation()
        for k, v in pairs(vehicles) do
          getObjectByID(k):setPosRot(pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)

        for k, v in pairs(vehicles) do
          local obj = getObjectByID(k)
          local aiParams = {}
          for key, _ in pairs(params) do
            aiParams[key] = v[key]
      if im.Button("Stop##aiParams") then
        for k, v in pairs(vehicles) do
          getObjectByID(k):queueLuaCommand("ai.setMode('stop')")
    if im.Button("Reset##aiParams") then
      for k, v in pairs(vehicles) do
        getObjectByID(k):setPosRot(v.pos.x, v.pos.y, v.pos.z, v.rot.x, v.rot.y, v.rot.z, v.rot.w)
    if im.Button("Reload##aiParams") then
      for k, v in pairs(vehicles) do
        getObjectByID(k):reload()
@/lua/common/utils/perf.lua
  local fcts = {}
  for k,v in pairs(timings_tmp) do
    if calls_tmp[k] > 0 then
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
    table.sort(sortedKeys)
    for _, key in pairs(sortedKeys) do
      if key ~= "fieldName" and string.startswith(key, "fieldName") then
      -- find all field with fieldname
      for _, key in pairs(sortedKeys) do
        if key ~= "fieldName" and string.startswith(key, "fieldName") then
  C.__index = C
  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/common/libs/ezSVG/EzSVG.lua
  local num = 0
  for _, _ in pairs(tbl) do num = num + 1 end
  return num
local function mergeTable(dst, src)
  for k, v in pairs(src) do
    if not dst[k] then  dst[k] = src[k] end
local function overwriteTable(dst, src)
  for k, v in pairs(src) do
    dst[k] = src[k]
  local ret = {}
  for k, v in pairs(tbl) do
    local nk = string.gsub(k, "_", "-")
local function processPropertyValues(tbl, run)
  for k,v in pairs(tbl) do
    if serializableValue(k, v) then
  if not run.preflight then
    for k,v in pairs(tbl) do
      if serializableValue(k, v) then

    for k,v in pairs(tbl["__style"]) do
      if serializableValue(k, v) then

  for k, v in pairs(tbl["__functions"]) do
    if serializableValue(k, v) then
      local func = ""
      for i, vv in pairs(v) do
        if i == 1 then func = string.format("%s%s(", func, vv)
    local stringTable = {}
    for k, v in pairs(tbl) do
      if serializableValue(k, v) then
  else
    for _, v in pairs(EzSVG.styles) do
      v[key] = value
  EzSVG.styles = {}
  for _, v in pairs(EzSVG.knownTags) do
    EzSVG.styles[v] = {}
  local style = {}
  for k, v in pairs(EzSVG.styles) do
    style[k] = {}
    style[k] = {}
    for kk, vv in pairs(v) do
      style[k][kk] = vv
    tag = value -- promote
    for k, v in pairs(key) do
      setDefaultStyles(k, v, tag)
      local seperator = ""
      for k, v in pairs(tbl["__d"]) do
        if serializableValue(k, v) then
    local i = 0
    for _, v in pairs(tbl["__points"]) do
      if i ~= 0 then
    -- Put referenced objects not in the tree to 
    for _, v in pairs(preflightRun["referencedObjects"]) do
      if v["lastRunID"] ~= preflightRun["id"] then
@/lua/ge/extensions/editor/gen/world.lua
	if not list then list = {} end
	for k,v in pairs(matFiles) do
		loadJsonMaterialsFile(v)
			}
			for _,nm in pairs(wrCommon) do
				local mo = scenetree.findObject(nm)
	local terrBlockName = ffi.string(terrainImpExp.terrainName)
	for tbName, tbData in pairs(terrainBlockProxies) do
		if string.lower(tbName) == string.lower(terrBlockName) then
	local pref,prep = forPrefix(afile[1])
	for i,p in pairs(afile) do
		-- get world box
			local ma,ima = 0
			for i,c in pairs({'x','y','z'}) do
				local L = math.abs(ddae[p].fr[c]-ddae[p].to[c])
	end
	for i,d in pairs(daePath[tp]) do
		local str = type(d) == 'string' and d or d[1]
	local adsc = {}
	for _,id in pairs(aid) do
		adsc[#adsc+1] = adesc[id]
	end
	for i,f in pairs(desc.afloor) do
		for j,w in pairs(f.awall) do
	for i,f in pairs(desc.afloor) do
		for j,w in pairs(f.awall) do
			local tocall = false
		if forall and desc.aspline and desc.aspline[i] then
			for key,s in pairs(desc.aspline[i]) do
				if aij and #U.index(aij[i], key) > 0 then
		if U._PRD == 0 then
			for id,d in pairs(adesc) do
				cedit.mesh = id
	forBuilding(desc, function(w,ij)
		for pth,list in pairs(w.df) do
			for _,id in pairs(list) do
		for pth,list in pairs(w.df) do
			for _,id in pairs(list) do
				local item = dforest[id].item
	if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
		for i,f in pairs(desc.selection) do
			for _,key in pairs(f) do
		for i,f in pairs(desc.selection) do
			for _,key in pairs(f) do
				if not tonumber(key) then
	end
	for i,f in pairs(desc.afloor) do
		aij[#aij + 1] = {}
	local akey = {}
	for k,r in pairs(buf) do
		akey[#akey+1] = k
	local aij = forSide({akey[1], buf[akey[1]][1]})
	for i,row in pairs(buf) do
		if not aij[i] then
		end
		for _,j in pairs(row) do
			if #U.index(aij[i],j) == 0 then
	if not tosave then
		for j,c in pairs(shmap) do
			for i,h in pairs(c) do
		for j,c in pairs(shmap) do
			for i,h in pairs(c) do
				tb:setHeightWs(vec3(j,i), h)
	if desctop and desctop.df ~= nil then
		for dae,list in pairs(desctop.df) do
			for i,key in ipairs(list) do
	if forestoff ~= false then
		for _,s in pairs(dforest) do
			editor.removeForestItem(fdata, s.item)
		end
		for id,d in pairs(adesc) do
			local obj = scenetree.findObjectById(id)
	local aid = {}
	for id,d in pairs(jdesc) do
		lo('?? for_desc:'..id..':'..tostring(adesc[tonumber(id)]))
		adesc[cid] = U.fromJSON(d)
		for i,d in pairs(adesc) do
			if d.idr == cid then
		if d.acorner_ then
			for i,c in pairs(d.acorner_) do
				for _,s in pairs(c.list) do
			for i,c in pairs(d.acorner_) do
				for _,s in pairs(c.list) do
					for j,p in pairs(s) do
				for _,s in pairs(c.list) do
					for j,p in pairs(s) do
						if s[j..''] and tonumber(j) then
		end
		for _,f in pairs(d.afloor) do
			f.awplus = {}
			end)
			for i,f in pairs(desc.afloor) do
				forestClean(f)

			for _,s in pairs(dforest) do
				editor.removeForestItem(fdata, s.item)
	desc.selection = nil
	for i,f in pairs(desc.afloor) do
		if f.achild then
		if f.achild then
			for k,c in pairs(f.achild) do
				c.id = nil
				c.id = nil
				for ci,cf in pairs(c.afloor) do
					for cj,cw in pairs(cf.awall) do
				for ci,cf in pairs(c.afloor) do
					for cj,cw in pairs(cf.awall) do
						cw.id = nil
						cw.id = nil
						for dae,cd in pairs(cw.df) do
							cw.df[dae] = {scale = cd.scale}
					end
					for dae,cd in pairs(cf.top.df) do
						cf.top.df[dae] = {scale = cd.scale}
		end
		for j,w in pairs(f.awall) do
			w.id = nil
			w.id = nil
			for dae,d in pairs(w.df) do
				w.df[dae] = {scale = d.scale}
		end
		for dae,d in pairs(f.top.df) do
			f.top.df[dae] = {scale = d.scale}
	forBuilding(desc, function(w,ij)
		for pth,list in pairs(w.df) do
			for _,id in pairs(list) do
		for pth,list in pairs(w.df) do
			for _,id in pairs(list) do
				local item = dforest[id].item
		lo('??+++++++++++++++++ f_CLEAN:'..#W.out.adf[desc.idpersist])
		for _,df in pairs(W.out.adf[desc.idpersist]) do
			for dae,list in pairs(df) do
		for _,df in pairs(W.out.adf[desc.idpersist]) do
			for dae,list in pairs(df) do
				for i,key in ipairs(list) do
		forBuilding(desc, function(w, ij)
			for pth,list in pairs(w.df) do
				for _,id in pairs(list) do
			for pth,list in pairs(w.df) do
				for _,id in pairs(list) do
					local item = dforest[id].item
					local its = fdata:getItemsCircle(pos, 1.2)
					for i,o in pairs(its) do
						local key = o:getKey()
		lo('?? to_HIDE:'..tableSize(dhide))
		for k,f in pairs(dhide) do
			f:setPosition(f:getPosition()+vec3(0,0,-100))
		if FS:directoryExists(dirname) then
			for _,o in pairs(list) do
				local om = scenetree.findObjectById(tonumber(o))
				lo('?? for_path:'..tostring(ok))
			for _,tp in pairs({'balcony','corner','doors','pillar','store_front','stairs',
				'windows',
			end
			for k,v in pairs(W.adae) do
				cnt[k] = v
		if U._MODE == 'conf' then
			for _,p in pairs(decalPath) do
				adec = D.decalsLoad()--, grid)
		local aid = {}
		for id,d in pairs(adesc) do
		aid[#aid+1] = id

		for i,id in pairs(aid) do
			lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
		-- clean up awplus
		for i,wp in pairs(f.awplus) do
			if wp.id then
			local adec = editor.getAllRoads()
			for id,_ in pairs(adec) do
				local obj = scenetree.findObjectById(id)
	if mode ~= 'conf' and forest then
		for id,desc in pairs(adesc) do
			local obj = scenetree.findObjectById(id)
			if obj ~= nil then
				for i,f in pairs(desc.afloor) do
					for j,w in pairs(f.awall) do
				for i,f in pairs(desc.afloor) do
					for j,w in pairs(f.awall) do
						forestClean(w)
		end
		for _,s in pairs(dforest) do
			editor.removeForestItem(fdata, s.item)
			local list = fdata:getItems()
			for _,f in pairs(list) do
				editor.removeForestItem(fdata, f)
		base = {}
		for k,iw in pairs(aw) do
			local wall = desc.afloor[ifloor].awall[iw]
			if #saforest>0 and inupdate and not sdata.spacefit then
				for ind,_ in pairs(aforest) do
					if ind<=#saforest then
				-- update forest positions
				for _,d in pairs(aforest) do
					d.p.x = d.p.x + dwl
		lo('?? for_AFOR:'..#aforest)
		for i,d in pairs(aforest) do
			local w,h = d.list and d.list[2]:distance(d.list[1]) or ddae[d.dae].w,ddae[d.dae].h
	if not sdata.ahole then sdata.ahole = {} end
	for i,h in pairs(sdata.ahole) do
		ahole[#ahole+1] = h
	local margin = 0.06
	for i,d in pairs(aforest) do
		if d.scale then
	end
	for i,d in pairs(afpos) do
		aforest[i].pos = (d[1]+d[2])/2 + vec3(0,0,d[3].y)
			local pos = 0
			for k,dae in pairs(desc.storefront.adae) do
				local a = U.vang(U.vturn(desc.u, -math.pi/2), ddae[dae].front, true)
			if desc.arcext then
				for _,rce in pairs(desc.arcext) do
					arc[#arc+1] = rce
						local am = {alod[1].list[1].m}
						for _,d in pairs(alod[1].list) do
							for k,v in pairs(d.m.verts) do
						for _,d in pairs(alod[1].list) do
							for k,v in pairs(d.m.verts) do
								d.m.verts[k] = d.m.verts[k] + shift
						local pset = {}
						for i,v in pairs(am[1].verts) do
							local a = desc[tp].skew
						end
						for i,n in pairs(am[1].normals) do
							local ang = U.vang(vec3(1,1,0),n)
					U.dump(aplinth, '??____ APLINTH_:')
				for _,p in pairs(aplinth) do
					local list = M.fillSegment(
						local ckey
						for _,d in pairs(list) do
							local k = d:getKey()
					if list then
						for _,d in pairs(list) do
							local k = d:getKey()
				local ckey
				for _,d in pairs(list) do
					ckey = d:getKey()
			local vn = desc.v:normalized()
			for k,p in pairs(mbody.verts) do
				mbody.verts[k] = un*p.x + vn*p.y
	if false then
		for _,plus in pairs(desc.avplus) do
			lo('??____________________________________ desc_plus:'..tostring(desc.plus))
				af[#af + 1] = {v = #av+1, n = 0, u = #av+1}
				for _,p in pairs(plus) do
					av[#av + 1] = p -- desc.pos
				af[#af + 1] = {v = #av+2, n = 0, u = #av+2}
				for _,p in pairs(plus) do
					av[#av + 1] = p -- desc.pos
	-- set position
	for o,v in pairs(av) do
		av[o] = av[o] + desc.pos -- desc.pos is the bottom-left corner
						out.avedit = {}
						for _,v in pairs(b1) do
							out.avedit[#out.avedit + 1] = v + vec3(0,0,1)
	local base = {}
	for i,b in pairs(cbase) do
		base[#base+1] = vec3(b.x,b.y)
	end
	for _,p in pairs(base) do
		p.z = lift
	local aid = #asel > 0 and asel or {cedit.mesh}
	for _,id in pairs(aid) do
		local dfcorner = {}
			U.dump(desc.acorner_, '?? frame_CORNER:')
			for i,c in pairs(desc.acorner_) do
				for j,f in pairs(c.list) do
			for i,c in pairs(desc.acorner_) do
				for j,f in pairs(c.list) do
					if not dfcorner[f[1]] then
					local H = forHeight(desc.afloor,ij[1]-1)
					for _,d in pairs(s.aforest) do
						if d.dae == forestMeshName then
					end
					for i,b in pairs(desc.aspline[ij[1]][ij[2]].base) do
						out.dyell[ij[1]][i] = {b+vec3(0,0,H),b+vec3(0,0,H+desc.afloor[ij[1]].h)}
					if w.df[forestMeshName] then
						for _,key in pairs(w.df[forestMeshName]) do
							local h = ddae[forestMeshName].to.z - ddae[forestMeshName].fr.z
				else
					for d,list in pairs(w.df) do
						for _,key in ipairs(list) do
						if desc.aspline and desc.aspline[ij[1]] then
							for key,_ in pairs(desc.aspline[ij[1]]) do
								local aw = U.split(key,'_')
						if w['win'..'_inf'] and w['win'..'_inf'].ddae then
							for k,dae in pairs(w['win'..'_inf'].ddae) do
								-- get key
								if w.df[dae] then
									for _,key in pairs(w.df[dae]) do
										if cedit.fscope ~= 1 or key == cedit.forest then
											U.dump(cw.pilaster, '?? has_PIL:'..j..':'..#cw.df[forestMeshName])
										for _,key in pairs(cw.df[forestMeshName]) do
											akey[#akey+1] = key
								end
								for _,key in pairs(akey) do
									out.aforest[#out.aforest + 1] = dforest[key].item:getPosition()
					elseif ({corner=1})[ddae[forestMeshName].type] and desc.acorner_ then
						for i,s in pairs(desc.acorner_) do
							for _,n in pairs(s.list) do
						for i,s in pairs(desc.acorner_) do
							for _,n in pairs(s.list) do
								if n[1] == ij[1] and n[2] == ij[2] then
			local H = forHeight(desc.afloor,cij[1]-1)
			for _,d in pairs(s.aforest) do
				if #U.index(cedit.aforest, d.key)>0 then
						local base = U.polyMargin(child.base, child.margin or 0)
						for _,p in pairs(base) do
							pth[#pth+1] = adesc[cedit.mesh].pos + floor.pos + p + vec3(0,0,h+(child.fat or 0)) + posplus
					local achunk = T.forChunks(floor.base)
					for k,rc in pairs(achunk) do
						for _,i in pairs(rc) do
					for k,rc in pairs(achunk) do
						for _,i in pairs(rc) do
							local p = floor.base[i]
					local base = U.polyMargin(floor.base, marginplus + (floor.top.margin or 0))
					for _,p in pairs(base) do
						pth[#pth+1] = adesc[cedit.mesh].pos + floor.pos + p + vec3(0,0,h+(floor.top.fat or 0)) + posplus
	if desc.achild then
		for i,c in pairs(desc.achild) do
			if c.id then
	local ax, ay = {0}, {0}
	for k,list in pairs(mskip) do
		for s in pairs(list) do
	for k,list in pairs(mskip) do
		for s in pairs(list) do
			if k % 2 == 0 then
				else
					for _,c in pairs(floor.top.achild) do
						c.shape = 'flat'
					floor.top.body = {}
					for _,c in pairs(floor.top.achild) do
						-- cleanup
			if floor.top.shape ~= 'flat' then
				for _,w in pairs(floor.awall) do
					if w.roofborder then
				floor.top.ridge.on = false
				for _,c in pairs(floor.top.achild) do
					if c.id then
	local cheight = 0
	for i,f in pairs(desc.afloor) do
		cheight = cheight + f.h
		cheight = cheight + f.h
		for j,w in pairs(f.awall) do
			if ij ~= nil then
	-- update walls
	for j,w in pairs(floor.awall) do
		w.u = U.proj2D(U.mod(j+1,base) - base[j])
		end
		for _,m in pairs(am) do
			for i=1,#m.verts do
			local ref = base[1]
			for _,a in pairs(arc) do
				local ai = {}
				M.zip(ai,af) --,true)
				for k,b in pairs(a) do
					av[#av+1] = b
			local ref = base[1]
			for _,a in pairs(arc) do
				local ai = {}
				M.zip(ai,af) --,true)
				for _,b in pairs(a) do
					av[#av+1] = b
    if not av or #av == 0 then return end
		for i,_ in pairs(av) do
			av[i] = av[i] + prn.pos + vec3(0,0,H)
	local amdata = {mdata}
	for _,m in pairs(am) do
		amdata[#amdata+1] = m
		if desctop.df ~= nil then
			for dae,list in pairs(desctop.df) do
				for i,key in pairs(list) do
			for dae,list in pairs(desctop.df) do
				for i,key in pairs(list) do
					if key == cedit.forest then
			dC = 0.17
	--                    for i,v in pairs(dsc.av) do
	--                        lo('?? for_v:'..i..':'..tostring(v-desc.pos))
				local c = desctop.achild[1]
	--            for _,c in pairs(desctop.achild) do
--                    U.dump(c, '?? for_child:')
		lo('!! houseUp_NODESC:'..tostring(toedit)..':'..tableSize(adesc)..':'..tostring(adesc[tonumber(toedit)])..':'..tostring(adesc[toedit..'']))
	--      for k,d in pairs(adesc) do
	--      return
	local mdata
	for i,f in pairs(desc.afloor) do
		forestClean(f.top)
		if not f.awplus then f.awplus = {} end
		for k,wp in pairs(f.awplus) do
--                U.dump(wp, '?? for_WP:'..i..':'.._)
				lo('?? FLOOR_children:'..#f.achild, true)
			for _,c in pairs(f.achild) do
					lo('?? child_id:'..tostring(c.id)..':'..tostring(c.prn),true)
				lo('?? if_SPLINE:'..i..':'..#desc.aspline..':'..#cedit.aforest) --..':'..tostring(s))
			for k,s in pairs(desc.aspline[i]) do
				local ij = {i,k}
						local iforest = {}
						for fi,d in pairs(afpos) do
							local dz = aforest[fi].type == 'win' and -ddae[wall.win].fr.z*(aforest[fi].scale and aforest[fi].scale.z or 1) or 0
    	local botext
		for j,w in pairs(f.awall) do
			-- check splined
--				U.dump(desc.aspline,'??_______________ ASPLINE:'..i)
				for ifloor,aw in pairs(desc.aspline) do
					if ifloor == i then
--							U.dump(aw,'??****************** for_SPLf:'..ifloor..':'..j)
						for kwall,s in pairs(aw) do
							if string.find(kwall, '_'..j..'_') then
						-- initialize
						for je,b in pairs(base) do
							fe.awall[je].arcext = nil
						end
						for je,b in pairs(base) do
						local un = we.u:normalized()
						for k,rc in pairs(arcext) do
			--                      lo('?? to_check:'..tostring(base[je])..':'..tostring(U.mod(je+1,base))..'<'..tostring(f.base[j]+(w.u:normalized()*rc[1].x)))
								end
								for ie,v in pairs(rc) do
								rc[ie] = rc[ie] - vec3(ds,f.h,0) -- (U.mod(j+1,f.base) - f.base[j]):normalized()*ds
							if dext[je] then
							for _,v in pairs(dext[je]) do
								bote[#bote+1] = v
						if f.top.achild and #f.top.achild>0 then
							for k,c in pairs(f.top.achild) do
			--                    U.dump(c, '??^^^^^^^^^^^^^^^^^ for_CEST:'..k)
							local botec
							for icb,je in pairs(c.imap) do
								if botext[je] then
						desc.afloor[i+1].botext = nil
						for k,w in pairs(desc.afloor[i+1].awall) do
						w.arcext = nil
					-- link forest items
					for dae,list in pairs(w.df) do
						for _,key in ipairs(list) do
						local isvalid = true
						for _,m in pairs(cam) do
							if not m or #m.faces == 0 or #m.verts == 0 then
					if not indrag then lo('?? for_cover: i='..i..' ifchild:'..#f.top.achild..':'..cheight..':'..tostring(forsplit)..':'..tostring(dirty)..':'..#f.top.achild) end
			for _,w in pairs(f.awall) do
				w.avplus = {}
				local auvdim = {}
				for ic,c in pairs(f.top.achild) do
					if c.uvref then
				else
					for ic,c in pairs(f.top.achild) do
						if auvdim[ic] then
				elseif mdata then
					for j,q in pairs(cbase) do
						for k,p in pairs(mdata.verts) do
					for j,q in pairs(cbase) do
						for k,p in pairs(mdata.verts) do
							if (U.proj2D(p) - U.proj2D(q)):length() < small_dist then
				local ref = base[1]
				for _,a in pairs(arc) do
					local ai = {}
					M.zip(ai,af) --,true)
					for _,b in pairs(a) do
						av[#av+1] = b
--                if forsplit or (ischild and dsc.id == nil) then
				for i,m in pairs(adata) do
					if false and m.material == out.defmat then
					-- to solid building
					for _,d in pairs(adata) do
						am[#am + 1] = d
				end
				for ic,c in pairs(f.top.achild) do
							lo('?? for_CHILD:'..ic..':'..tostring(c.shape)..':'..tostring(c.fat))
						end
						for k,d in pairs(amd) do
							asi = forFat(d, c.base, c)
						local am = {}
						for _,d in pairs(desctop.adata) do
						if desctop.uvref then
						end
						for k,sd in pairs(asubdata) do
							am[#am+1] = sd
					end
					for k,d in pairs(amd) do
						asi = forFat(d, f.base, f.top)
					local am = {}
					for _,d in pairs(desctop.adata) do
						if desctop.uvref then
					-- add side plates
					for k,sd in pairs(asubdata) do
						am[#am+1] = sd
--                        end
					for _,uv in pairs(auvb) do
						uv.u = uv.u*f.top.border.uvscale[1]
				end
				for k,n in pairs(base) do
--                        if k > 4 then break end
--				U.dump(f.awplus,'??++++++++++++ for_SUBROOF:'..i)
			for k,wp in pairs(f.awplus) do
--					lo('?? for_K:'..k)
--                        U.dump(wp.list, '?? for_AWP:'..i..':'..tostring(dirty))
					for _,list in pairs(wp.list) do
--							U.dump(list,'??++++++++++++++++ for_WP:')
--							U.dump(list,'??++++++++++++++++ for_WP:')
						for key,p in pairs(list) do
--                                lo('?? if_key:'..tostring(key)..':'..tostring(tonumber(key)))
--                U.dump(desc.acorner_, '??>>>>>> for_CORNER:'..tableSize(desc.acorner_))
		for i,s in pairs(desc.acorner_) do
--            if i > 1 then break end
		if false then
			for i,f in pairs(desc.afloor) do
				if f.achild then
				if f.achild then
					for k,c in pairs(f.achild) do
							lo('??^^^^^^^^^^^^^^^^+++++++++++++++ to_CHILD_PRN:'..k,true)
		if desctop and desctop.df ~= nil then
			for dae,list in pairs(desctop.df) do
				for _,key in ipairs(list) do
			lo('?? for_child:'..desc.floor) --#desc.prn.afloor[desc.floor].achild)
		for k,c in pairs(adesc[desc.prn].afloor[desc.floor-1].achild) do
--                    lo('?? for_child:'..k..':'..tostring(c.id))
	if not fkeep then
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
				forestClean(w)
	else
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
				adf[#adf+1] = w.df
	local fnew = deepcopy(desc.afloor[i])
	for j,w in pairs(fnew.awall) do
		w.id = nil
		w.id = nil
		for dae,d in pairs(w.df) do
			w.df[dae] = {scale = d.scale}
		lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ building4test:'..tostring(pth)..':'..tableSize(amesh))
	for i,s in pairs(list) do
--			lo('?? for_file:'..i..':'..s)
	list = FS:findFiles(pth, '*.json', -1, true, false)
	for i,s in pairs(list) do
		FS:removeFile(s)
--		lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
	for i,s in pairs(list) do
--			lo('?? for_file:'..i..':'..s)
		desc.id = nil
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
				w.id = nil
--    toJSON(desc)
--        for key,b in pairs(adesc) do
--            U.dump(adesc[key].afloor[1].base, '<< buildingGen:'..key..':'..tostring(adesc[key].pos))
	local xma,yma = 0,0
	for _,path in pairs(apth) do
		local img = imguiUtils.texObj(path)
	local cx = 0
	for i,img in pairs(aimg) do
		arc[#arc+1] = {fr={cx/xma,(1-img.size.y/yma)}, to={(cx+img.size.x)/xma,1}}
		else
			for i,c in pairs(desctop.achild) do
				if cb then cb(c) end
			local v = -u:cross(vec3(0,0,1))
			for i,uv in pairs(mesh.uvs) do
				uv.u = suvs[i].u + ds:dot(u)
--            U.dump(w.agrid, '?? for_AGRID:')
		for _,xy in pairs(w.agrid) do
--                lo('?? for_XY1:'..tostring(xy[1])..':'..tostring(xy[2]), true)
--            lo('?? duvs:'..ij[1]..':'..ij[2]..' suvs:'..#suvs..' verts:'..#mesh.verts)
		for i,p in pairs(mesh.verts) do
			auv[#auv+1] = {}
	local auv = {}
	for _,xy in pairs(desc.agrid) do
		auv = M.uv4grid({desc.uv[1], desc.uv[3]}, {desc.uv[2], desc.uv[4]},
local function bufToggle(buf, ij, yes)
	for i,r in pairs(buf) do
		for j,c in pairs(r) do
	for i,r in pairs(buf) do
		for j,c in pairs(r) do
			for k,cij in pairs(c) do
		for j,c in pairs(r) do
			for k,cij in pairs(c) do
				if ij[1] == cij[1] and ij[2] == cij[2] then
		local hit
		for i,s in pairs(acorner) do
			if (s.pos-U.proj2D(v)):length() < small_dist then
					lo('?? f_SPLINE:'..ij[2]..':'..tostring(s))
				for _,d in pairs(s.aforest) do
					if #U.index(cedit.aforest,d.key)>0 then
				end
				for d,list in pairs(w.df) do
					iforest = U.index(w.df[d], cedit.forest)[1]
--					U.dump(forspline.aforest, '?? for_SPLINE:'..cedit.forest..':'..cedit.fscope..':'..tp)
				for i,d in pairs(forspline.aforest) do
					if d.type == tp then
								local hmax = 0
								for _,w in pairs(floor.awall) do
					--                            local dae = w[tp]
	if desc and desc.selection then
		for i,row in pairs(desc.selection) do
			for _,key in pairs(row) do
		for i,row in pairs(desc.selection) do
			for _,key in pairs(row) do
--					lo('?? for_SPLINE:'..i..':'..key..':'.._)
		if #dmesh[cmesh].sel == 0 then
			for _,m in pairs(dmesh[cmesh].data) do
				m.material = nm
			lo('?? for selection:')
			for _,m in pairs(dmesh[cmesh].sel) do
				m.material = nm
			local info = currentMaterial:getFieldInfo('normalMap', 1)
			for k,v in pairs(info) do
--                lo('?? KV:'..tostring(k)..':'..tostring(v))
		elseif #floor.top.achild > 0 then
			for _,c in pairs(floor.top.achild) do
				c.mat = nm
--[[
	for _,f in pairs(desc.afloor) do
		for o,w in pairs(f.awall) do
	for _,f in pairs(desc.afloor) do
		for o,w in pairs(f.awall) do
			w.mat = nm
		local mat = adesc[cedit.mesh].afloor[cij[1] ].top.mat
		for i,m in pairs(dmat.roof) do
--                lo('?? for_mat:'..tostring(m))
			local apair,amult = T.pairsUp(base)
			for _,m in pairs(amult) do
				if #m > 1 then
			local len,pos
			for i,r in pairs(aij) do
				for j,n in pairs(r) do
			for i,r in pairs(aij) do
				for j,n in pairs(r) do
					if desc.afloor[i].awall[n].doorind then
			lo('?? hide_AFOREST:'..#cedit.aforest..':'..tostring(s))
		for i,d in pairs(s.aforest) do
			if d.skip then
				local s = adesc[cedit.mesh].selection[ij[1] ][ij[2] ]
				for i,d in pairs(s.aforest) do
					if d.skip then
		local dae = dforest[cedit.forest].item:getData():getShapeFile()
		for k,key in pairs(dsc.df[dae]) do
			if key == cedit.forest then
	forBuilding(desc, function(w, ij)
		for _,akey in pairs(w.df) do
			if #U.index(akey, key) > 0 then
  if achunk then
    for i,c in pairs(achunk) do
      table.insert(floor.top.achild, floor.top.cchild, {
--!!    houseUp(adesc[cedit.mesh], cedit.mesh)
	for ic,wp in pairs(floor.awplus) do
		if wp.id then
	local bpos = floor.pos + adesc[cedit.mesh].pos + vec3(0, 0, aint[1][1].z) -- basic outer position
	for j,v in pairs(floor.base) do
		local p = v + bpos
	end
	for k,v in pairs(avclose) do
		if v[2] == 0 then
	local list = {}
	for i,rc in pairs(arc) do
		floor.top.body[#floor.top.body + 1] = rc
	list = {}
	for i,rc in pairs(arc) do
		floor.top.body[#floor.top.body + 1] = rc
	if desctop.achild then
		for i,c in pairs(desctop.achild) do
		local cobj = scenetree.findObjectById(c.id)
	local jmi = math.huge
	for i,r in pairs(buf) do
		table.sort(r)
			if j < jmi then jmi = j end
--        for _,j in pairs(r) do
			local ij = {i,j}
--[[
	for _,ij in pairs(aij) do
	end
	end
	for i,r in pairs(buf) do
		for _,j in pairs(r) do
	for i,r in pairs(buf) do
		for _,j in pairs(r) do
			-- split walls
			for i,e in pairs(out.asplit) do
					U.dump(e, '?? u:'..i..':'..e.u..':'..tostring(base2world(adesc[cedit.mesh], e.ij)))
	local desc = adesc[cedit.mesh]
	for _,e in pairs(out.asplit) do
		local base = desc.afloor[e.ij[1]].base
	if #its > 0 then
		for _,itm in pairs(its) do
			local key = itm:getKey()
--                        U.dump(desctop.base,'??^^^^^^^^^^^^^^^^^^^^^ ifHit:'..tostring(desctop.shape)..':'..tostring(phit)..':'..tostring(p))
	for k,c in pairs(floor.top.achild) do
		local cbase = {}
		local base = c.base or floor.base
		for _,b in pairs(base) do
			cbase[#cbase+1] = base2world(desc,{i,1},b)+vec3(0,0,floor.h)
		local arc = coverUp(cbase)
		for _,rc in pairs(arc) do
			for j=1,#rc do
  if floor.top.achild then
    for i,c in pairs(floor.top.achild) do
      if c.id then
local function floorClean(floor)
	for j,w in pairs(floor.awall) do
		for dae,r in pairs(w.df) do
	for j,w in pairs(floor.awall) do
		for dae,r in pairs(w.df) do
			w.df[dae] = {scale = r.scale or 1}
	end
	for dae,r in pairs(floor.top.df) do
		floor.top.df[dae] = {scale = r.scale or 1}
		local ima = 0
		for i,r in pairs(house.selection) do
			if i > ima then ima = i end
			afloor[#afloor+1] = f
			for j,w in pairs(f.awall) do
				for dae,_ in pairs(w.df) do
			for j,w in pairs(f.awall) do
				for dae,_ in pairs(w.df) do
					w.df[dae] = {scale = w.df[dae].scale or 1}
			end
			for dae,_ in pairs(f.top.df) do
				f.top.df[dae] = {scale = f.top.df[dae].scale or 1}
		end
	--                for k,f in pairs(afloor) do
		for k = #afloor,1,-1 do
	--            table.insert(house.afloor, ito, newfloor)
		for j,w in pairs(newfloor.awall) do
			for dae,_ in pairs(w.df) do
		for j,w in pairs(newfloor.awall) do
			for dae,_ in pairs(w.df) do
				w.df[dae] = {scale = w.df[dae].scale or 1}
		end
		for dae,_ in pairs(newfloor.top.df) do
			newfloor.top.df[dae] = {scale = newfloor.top.df[dae].scale or 1}
			floor.top.body = coverUp(floor.base)
			for i,c in pairs(floor.top.achild) do
				c.ridge = {}
	desc.afloor[#desc.afloor + 1] = newfloor
	for i,w in pairs(floor.awall) do
		w.roofborder = {yes=false}
  	W.floorClear(desc.afloor[#desc.afloor-1])
	for j,w in pairs(newfloor.awall) do
		w.ij[1] = newfloor.ij[1]
--    lo('>> forHit:')
	for i,f in pairs(desc.afloor) do
--            lo('?? forHit_f:'..i)
					local cbase = {}
					for _,b in pairs(base) do
						cbase[#cbase+1] = base2world(desc,{i,1},b)+vec3(0,0,f.h)
--[[
				for _,b in pairs(desctop.base) do
					base[#base+1] = base2world(desc,{i,1},b)
			if #f.top.achild > 0 then -- and not f.top.ridge then -- (not f.top.ridge or not f.top.ridge.on) then
				for _,c in pairs(f.top.achild) do
--                        U.dump(c.base,'?? forHit_child:'..i..':'..tostring(c.shape)..':'.._)
		if false and f.awplus then
			for j,wp in pairs(f.awplus) do
--                U.dump(wp, '?? for_WP:'..i..':'..j)
--                U.dump(wp, '?? for_WP:'..i..':'..j)
				for k,r in pairs(wp.list) do
					local vn = (r[2]-r[1]):cross(r[3]-r[2])
		-- walls
		for j,w in pairs(f.awall) do
      -- local phit = U.ray2plane(ray,p,vec3(0,0,1))
	--                    lo('?? for_build:'..ij[1]..':'..ij[2])
						for _,akey in pairs(w.df) do
							local cind = U.index(akey, key)
						dae = desc[tp][1]
						for _,akey in pairs(desc.df) do
							local cind = U.index(akey, key)
			local desc = (id and adesc[id]) and adesc[id] or adesc[cedit.mesh] --or adesc[id]
--            for _,f in pairs(desc.afloor) do
--                f.top.cchild = nil
--        data = cedit.cval['Drag_Z'][2]
		for ord,m in pairs(data) do
	--        for i = 1,6,6 do
	local dpop,dtrans = forFaces(cedit.cval['Drag_Z'].afaces)
	for ord,m in pairs(dmesh[meshID].data) do
		m.faces = U.clone(cedit.cval['Drag_Z'].afaces[ord])
	local dpopsel,dtranssel = forFaces(cedit.cval['Drag_Z'].aselfaces)
	for ord,m in pairs(dmesh[meshID].sel) do
		m.faces = U.clone(cedit.cval['Drag_Z'].aselfaces[ord])
	dmesh[meshID].buf = {}
	for ord,m in pairs(cedit.cval['Drag_Z'].abuffaces) do
		dmesh[meshID].buf[ord] = {
	-- dtranssel->dtrans
	for ord,list in pairs(dtranssel) do
		for _,i in pairs(list) do
	for ord,list in pairs(dtranssel) do
		for _,i in pairs(list) do
--            dtrans[ord][#dtrans[ord] + 1] = i
		-- dtrans->dpop
		for ord,list in pairs(dtrans) do
			for _,i in pairs(list) do
		for ord,list in pairs(dtrans) do
			for _,i in pairs(list) do
				dpop[ord][#dpop[ord] + 1] = i

	for ord,m in pairs(dmesh[meshID].data) do
		amesh[#amesh + 1] = m
--				if true then return end
			for i,f in pairs(desc.selection) do
--				lo('?? fsel:'..tableSize(f))
				if tableSize(f) == 1 then
					for j,key in pairs(f) do
--							lo('?? if_SPL:'..tostring(s))
							if s.base then
								for k,b in pairs(s.base) do
	--									lo('?? if_NODE:'..k..':'..tostring(b+vec3(0,0,s.box.minExtents.z))..':'..tostring(b+vec3(0,0,s.box.maxExtents.z)))
											local aind = U.split(key,'_')
											for _,iw in pairs({aind[1],aind[#aind]+1}) do
--												lo('?? for_I:'..iw)
						lo('?? rcp:'..tostring(rayCast.pos))
					for i,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
						if d.key == cedit.forest then
					cedit.cval['DragPos'].cpos = p
					for i,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
						if d.key == cedit.forest then
				local db = (U.proj2D(rayCast.pos - base2world(desc, out.acorner[1].ij))):dot(u)
				for k,e in pairs(out.acorner) do
					desc.afloor[e.ij[1]].base[e.ij[2]] = desc.afloor[e.ij[1]].base[e.ij[2]] + db*u
--------------------
							for k,c in pairs(incorner) do
								-- corossing with opposite side
								for j,b in pairs(base) do
									if math.abs(j-ind) > 1 then
		--                    U.dump(floor.top.achild, '?? achild:')
						for i,c in pairs(floor.top.achild) do
							if c.id then
				if db:length() > 0 then
					for k,e in pairs(incorner) do
	--                    for k,e in pairs(out.acorner) do
					for k,e in pairs(incorner) do
	--                    for k,e in pairs(out.acorner) do
		--                    db = vec3(0.1,0,0)
	--                            _dbdrag = true
							for i,s in pairs(cedit.cval['DragPos'].insplit) do
								local base = desc.afloor[s.floor].base
		if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
			for i,f in pairs(desc.selection) do
				for _,key in pairs(f) do
			for i,f in pairs(desc.selection) do
				for _,key in pairs(f) do
					if not tonumber(key) then
				cedit.cval['DragPos'] = {}
				for _,f in pairs(desc.afloor) do
					cedit.cval['DragPos'][#cedit.cval['DragPos'] + 1] = U.clone(f.base)
				U.dump(side, '?? SIDE:'..tostring(cij))
			for i,f in pairs(side) do
				for j,w in pairs(f) do
			for i,f in pairs(side) do
				for j,w in pairs(f) do
					local ij = {i, w}
					lo('?? dv:'..tostring(dirhit)..':'..tostring(dv))
				for ord,m in pairs(dmesh[cmesh].data) do
					for i = 1,#m.verts do
	]]
				for ord,m in pairs(dmesh[cmesh].data) do
					afaces[#afaces+1] = U.clone(m.faces)
					if dmesh[cmesh].trans[ord] ~= nil then
						for _,f in pairs(dmesh[cmesh].trans[ord].faces) do
							list[#list + 1] = f
					if dmesh[cmesh].buf[ord] ~= nil then
						for _,f in pairs(dmesh[cmesh].buf[ord].faces) do
	--                        list[#list + 1] = f
	--[[
				for _,m in pairs(dmesh[cmesh].trans) do
	--                afaces[#afaces+1] = U.clone(m.faces)
				local aselfaces = {}
				for _,m in pairs(dmesh[cmesh].sel) do
					aselfaces[#aselfaces+1] = U.clone(m.faces)
				local abuffaces = {}
				for _,m in pairs(dmesh[cmesh].buf) do
					abuffaces[#abuffaces+1] = U.clone(m.faces)
						-- TODO: use childRebase?
						for _,c in pairs(floor.top.achild) do
							if c.imap then
--                                    U.dump(c.imap, '?? for_c_map:'..ij[2])
								for k,m in pairs(c.imap) do
									if m == ij[2] then
							local floor = desc.afloor[ij[1]]
							for i,c in pairs(incorner) do
								if c.ij[1] == ij[1] and c.ij[2] == ij[2] then
									-- TODO: use childRebase?
									for _,c in pairs(floor.top.achild) do
										if c.imap then
--                                                U.dump(c.imap, '?? for_c_map:'..ij[2])
											for k,m in pairs(c.imap) do
												if m == ij[2] then
		local dmi,bmi = near_dist
		for k,q in pairs(base) do
			local d = a:distanceToLine(U.mod(k+1,base), q)
		local hit = false
		for j,p in pairs(floor.base) do
			a = p + floor.pos
			end
			for k,q in pairs(floorpre.base) do
				b = q + floorpre.pos
--            local dmi,imi = math.huge
			for k,q in pairs(floorpre.base) do
				local d = a:distanceToLineSegment(U.mod(k+1,floorpre.base), q)
			local ishit
			for i1,f1 in pairs(desc.afloor) do
				for i2,f2 in pairs(adesc[desc.prn].afloor) do
			for i1,f1 in pairs(desc.afloor) do
				for i2,f2 in pairs(adesc[desc.prn].afloor) do
					a,b,tp = forNear(f1, f2, desc)
						local isperp = true
						for k,v in pairs(ashift) do
								lo('?? if diff:'..i1..':'..i2..':'..k..':'..U.vang(v, b-a)..':'..tostring(U.vang(v, b-a) % math.pi))
		forBuilding(adesc[cedit.mesh], function(w, ij)
			for _,k in pairs({'plinth','roofborder'}) do
				if w[k] then
				local dmi,ijmi,ds=math.huge
				for i,a in pairs(basea) do
					for j,b in pairs(baseb) do
				for i,a in pairs(basea) do
					for j,b in pairs(baseb) do
						local d = (a+pa-b+pb):length()
					dmi,ds=math.huge,nil
					for i,a in pairs(basea) do
						for j,b in pairs(baseb) do
					for i,a in pairs(basea) do
						for j,b in pairs(baseb) do
							local d = U.toLine(a+pa,{b+pb,U.mod(j+1,baseb)+pb})
				U.dump(out.ahole, '??__________ inhole:'..tostring(base2world(adesc[cedit.mesh], cij))..':'..tostring(cw.u))
			for i=1,4 do -- in pairs(out.ahole) do
				rc[#rc+1] = world2wall(out.ahole[i], cw)
					local aij = forSide(cij)
					for i,r in pairs(aij) do
						if i == cij[1] then
							local jmi = math.huge
							for _,j in pairs(r) do
								awall[#awall+1] = floor.awall[j]
			lo('?? if_edit:'..tostring(cedit.mesh)..':'..tostring(id)..':'..tableSize(adesc))
--      for k,d in pairs(adesc) do
--        lo('?? if_DESC:'..k..':'..tostring(adesc[k]))
		cedit.aforest = {}
		for i,f in pairs(desc.aspline) do
			for key,s in pairs(f) do
		for i,f in pairs(desc.aspline) do
			for key,s in pairs(f) do
				if s.id == id then
					-- dforest[key].type
					for i,p in pairs(cw.achild[ihole].base) do
	--                    lo('?? for_p:'..tostring(cw.pos)..':'..tostring(p)..':'..tostring(cw.u)..':'..tostring(cw.v))
--                    out.ahole = nil
--            for _,c in pairs(cw.achild) do
--            end
					elseif inrc ~= nil then
						for i,c in pairs(floor.top.achild) do
--                            U.dump(c, '?? for_LIST:'..i..':'..inrc..' scch:'..tostring(scchild)..':'..#U.index(c.list, inrc))
				else
					for i,m in pairs(dmat.wall) do
						if tostring(m) == cmat then

--            for i,f in pairs(desc.afloor) do
--            end
--[[
			for ord,m in pairs(dmesh[id].sel) do
				for _,f in pairs(m.faces) do
			for ord,m in pairs(dmesh[id].sel) do
				for _,f in pairs(m.faces) do
					out.avedit[#out.avedit + 1] = m.verts[f.v + 1]
				local apick = {}
				for _,f in pairs(m.faces) do
					if #U.index(apick, f.v) == 0 then
			out.avedit = {}
			for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
				for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
			for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
				for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
					for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
				for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
					for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
						out.avedit[#out.avedit+1] = vec3(x, y, z)
			local function forNear(floor, floorpre, child)
				for j,p in pairs(floor.base) do
					local a = p + floor.pos
					local hit = false
					for k,q in pairs(floorpre.base) do
						local b = q + floorpre.pos
					local dmi,imi = math.huge
					for j,q in pairs(floorpre.base) do
						local d = a:distanceToLineSegment(U.mod(j+1,floorpre.base), q)
				forBuilding(desc, function(w, ij)
					for d,list in pairs(w.df) do
						for _,k in ipairs(list) do
						if inrc ~= nil then
							for i,c in pairs(floor.top.achild) do
--                                U.dump(c, '?? for_LIST2:'..i..':'..inrc..' scch:'..tostring(scchild)..':'..#U.index(c.list, inrc))
				out.asplit = nil
				for i,a in pairs(desc.aspline) do
					local H = forHeight(desc.afloor, i-1)
					local H = forHeight(desc.afloor, i-1)
					for j,d in pairs(a) do
--							U.dump(d, '?? for_D:'..d.id..':'..id..':'..tostring(tostring(d.id) == tostring(id)))
							local hit = false
							for k,v in pairs(d.base) do
								if true then
				local center = vec3(0,0,0)
				for _,v in pairs(dmesh[cmesh].apick) do
					center = center + m.verts[v+1]
				local dr = dirobj*0.02
				for _,v in pairs(dmesh[cmesh].apick) do
					m.verts[v+1] = m.verts[v+1] + dir*dr
				local amesh = dmesh[cmesh].data
				for _,m in pairs(amesh) do
					for _,v in pairs(m.verts) do
				for _,m in pairs(amesh) do
					for _,v in pairs(m.verts) do
						center = center + v
				local dr = dirobj*0.02
				for i,m in pairs(amesh) do
					local m = amesh[i]
					local m = amesh[i]
					for j,v in pairs(m.verts) do
						m.verts[j] = m.verts[j] + dir*dr
			set(floor, 'h', floor.h + dir*0.02) -- 0.2 * dir)
			for _,w in pairs(floor.awall) do
				set(w, 'v', vec3(0,0,floor.h))
				local floor = house.afloor[#house.afloor]
				for _,w in pairs(floor.awall) do
					for i,key in pairs(w.df[w.win]) do
				for _,w in pairs(floor.awall) do
					for i,key in pairs(w.df[w.win]) do
--                    for i,key in pairs(w.awin) do
					for i,key in pairs(w.df[w.win]) do
--                    for i,key in pairs(w.awin) do
						editor.removeForestItem(fdata, dforest[key].item)
				--- update u's
				for j,w in pairs(f.awall) do
					w.u = base[j % #base + 1] - base[j]
		if desc.selection then
			for _,s in pairs(desc.selection) do
				forWall(U.split(s, '_'))
--                        U.dump(asij, '?? asij:')
				for i,f in pairs(asij) do
					for _,j in pairs(f) do
				for i,f in pairs(asij) do
					for _,j in pairs(f) do
--                            lo('?? for_wall:'..tostring(f)..':'..tostring(j))
						_dbdrag = true
				for i,floor in pairs(adesc[cedit.mesh].afloor) do
--                    forFloor(floor, i)
local function floor2level(f, ind)
	for _,w in pairs(f.awall) do
		w.ij[1] = ind
	if f.achild then
--        for _,c in pairs(f.achild) do
--        end
--            floor2level(desc.afloor[cij[1]], cij[1])
			for _,w in pairs(floor.awall) do
				w.ij[1] = w.ij[1]+dir
			end
			for _,w in pairs(desc.afloor[cij[1] ].awall) do
				w.ij[1] = w.ij[1]-dir
			if floor.achild then
				for _,c in pairs(floor.achild) do
					c.floor = c.floor + dir
			if desc.afloor[cij[1]].achild then
				for _,c in pairs(desc.afloor[cij[1]].achild) do
					c.floor = c.floor - dir
--[[
			for _,w in pairs(floor.awall) do
				w.ij[1] = w.ij[1]+dir
			end
			for _,w in pairs(desc.afloor[cij[1] ].awall) do
				w.ij[1] = w.ij[1]-dir
					local ima = 0
					for i,r in pairs(house.selection) do
						if i > ima then ima = i end
						afloor[#afloor+1] = f
						for j,w in pairs(f.awall) do
							for dae,_ in pairs(w.df) do
						for j,w in pairs(f.awall) do
							for dae,_ in pairs(w.df) do
								w.df[dae] = {scale = w.df[dae].scale or 1}
						end
						for dae,_ in pairs(f.top.df) do
							f.top.df[dae] = {scale = f.top.df[dae].scale or 1}
					end
	--                for k,f in pairs(afloor) do
					for k = #afloor,1,-1 do
		--            table.insert(house.afloor, ito, newfloor)
					for j,w in pairs(newfloor.awall) do
						for dae,_ in pairs(w.df) do
					for j,w in pairs(newfloor.awall) do
						for dae,_ in pairs(w.df) do
							w.df[dae] = {scale = w.df[dae].scale or 1}
					end
					for dae,_ in pairs(newfloor.top.df) do
						newfloor.top.df[dae] = {scale = newfloor.top.df[dae].scale or 1}
				floor.h, floor.awall[1], cij[1] + 1)
				for j,w in pairs(awall) do
					w.mat = floor.awall[j].mat
				floor2level(f, i)
--                    for j,w in pairs(f.awall) do
--                        w.ij[1] = w.ij[1] + 1
				newfloor.top.ij = {#house.afloor}
				for j,w in pairs(newfloor.awall) do
					w.ij[1] = newfloor.ij[1]
				floor = house.afloor[#house.afloor]
				for _,w in pairs(floor.awall) do
					forestClean(w)
					lo('?? unsel:'..#dmesh[cmesh].sel..':'..#dmesh[cmesh].data)
--                for _,m in pairs(dmesh[cmesh].sel) do
--                end
				local amesh = {} --dmesh[cmesh].data
				for _,m in pairs(dmesh[cmesh].data) do
					amesh[#amesh + 1] = m
				end
				for _,m in pairs(dmesh[cmesh].sel) do
					amesh[#amesh + 1] = m
	local floor = desc.afloor[ind]
	for j,w in pairs(floor.awall) do
		forestClean(w)
  elseif floor.top.achild then
    for i,c in pairs(floor.top.achild) do
      local cobj = scenetree.findObjectById(c.id)
	if string.find(cmd, 'scope') then
		for _,t in pairs({'building','floor','wall','top'}) do
			if string.find(cmd, t) then
	if scope == 'top' then
		for _,t in pairs({'gable','shed','pyramid','flat'}) do
			if string.find(cmd,t) then
			local dset = {o=0,y=0,g=0,b=0}
			for _,list in pairs(conf.set) do
				for j,p in pairs(list) do
			for _,list in pairs(conf.set) do
				for j,p in pairs(list) do
					if p == 'a' then
--        lo('?? for_save:')
--            for j,f in pairs(desc.afloor) do
--                lo('?? for_child:'..j..':'..tostring(f.achild))
				floor.top.cchild = nil
				for i,c in pairs(floor.top.achild) do
					if c.id then
					lo('?? for_child:'..desc.floor) --#desc.prn.afloor[desc.floor].achild)
				for k,c in pairs(adesc[desc.prn].afloor[desc.floor-1].achild) do
--                    lo('?? for_child:'..k..':'..tostring(c.id))
			end
			for i,f in pairs(desc.afloor) do
				for j,w in pairs(f.awall) do
			for i,f in pairs(desc.afloor) do
				for j,w in pairs(f.awall) do
					forestClean(w)
			local floor = desc.afloor[cij[1] ]
			for j,w in pairs(floor.awall) do
				forestClean(w)
--            lo('?? for_fwhite:'..#out.fwhite)
		for _,v in pairs(out.fwhite) do
			debugDrawer:drawLine(v[1], v[2], ColorF(1,1,1,1), 4)
	if out.fmtop then
		for _,pth in pairs(out.fmtop) do
			for i=1,#pth-1 do
	if false and out.dyell then
		for i,row in pairs(out.dyell) do
			for j,pth in pairs(row) do
		for i,row in pairs(out.dyell) do
			for j,pth in pairs(row) do
				local incorner
						U.dump(out.acorner, '?? acorn:')
					for i,c in pairs(out.acorner) do
						if c.ij[1] == i and c.ij[2] == j then
--            lo('?? for_fwhite:'..#out.fwhite)
		for _,pth in pairs(out.fyell) do
--            Render.path(pth, color(255,255,150,155), 4)
		for i=2,#out.ahole do
--        for _,v in pairs(out.ahole) do
			debugDrawer:drawLine(out.ahole[i-1], out.ahole[i], ColorF(1,1,0,1), 4)
	if out.aforest then
		for _,s in pairs(out.aforest) do
			local r = 0.02*math.sqrt((s-core_camera.getPosition()):length())
		for i = 1,#out.aedge.e-1 do
--        for _,d in pairs(out.aedge.e) do
			debugDrawer:drawLine(out.aedge.e[i], out.aedge.e[i+1], ColorF(1,1,1,1), 4)
	if out.flbl then
		for _,l in pairs(out.flbl) do
			if l[2] then
--            U.dump(out.asplit, '?? mark_split:')
		for _,e in pairs(out.asplit) do
			debugDrawer:drawLine(e[1], e[2], ColorF(1,1,0,1))
--			lo('?? for_DYELL:')
		for i,row in pairs(out.dyell) do
--			if row.noz then
--			end
			for j,pth in pairs(row) do
--					if not tonumber(j) and j ~= 'len' then
--                        U.dump(out.acorner, '?? acorn:')
					for _,c in pairs(out.acorner) do
						if i==c.ij[1] then
							local floor = desc.afloor[ij[1]]
							for k,p in pairs({
								base2world(desc, ij),
			--                    lo('?? ab:'..tostring(a)..':'..tostring(b)..':'..tostring(desc.pos)..':'..tostring(rayCast.pos))
							for k,p in pairs({a, b}) do
								local campos = core_camera.getPosition()
	--                        if scope == 'floor' then
	--                            for i,_ in pairs(base) do
	--                            end
						local pmi,pma,mi,ma = math.huge,0
						for i,r in pairs(aside) do
							if i == cij[1] then
							if i == cij[1] then
								for _,j in pairs(r) do
									local prj = (U.mod(j,base) - base[cij[2]]):dot(u)
							local jp = cij[2]
							for k,j in pairs(aside[cij[1]]) do
								local p1,p2 = (base[j] - base[cij[2]]):dot(u),(U.mod(j+1,base) - base[cij[2]]):dot(u)
		end)
		for i,f in pairs(desc.afloor) do
			forestClean(f)
		desc.id = nil
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
		for i,f in pairs(desc.afloor) do
			for j,w in pairs(f.awall) do
				w.id = nil
				if tableSize(incopy) == 1 then
					for id,buf in pairs(incopy) do
						local akey = {}
						local akey = {}
						for k,r in pairs(buf) do
							akey[#akey + 1] = k
						local afloor = {}
						for _,k in pairs(akey) do
--                        for i,r in pairs(buf) do
						for _,k in pairs(akey) do
--                        for i,r in pairs(buf) do
							local r = buf[k]
							-- append floors
							for _,f in pairs(afloor) do
								floorClean(f)
					if tableSize(incopy) == 1 then
						for id,b in pairs(incopy) do
							buf = b
				local akey = {}
				for k,r in pairs(buf) do
					akey[#akey+1] = k
							local jmi = math.huge
							for _,j in pairs(buf[akey[1]]) do
	--                            for j,_ in pairs(buf[akey[1]]) do
							for _,j in pairs(buf[akey[1]]) do
	--                            for j,_ in pairs(buf[akey[1]]) do
								awall[#awall+1] = deepcopy(dsrc.afloor[akey[1]].awall[j])
	--[[
							for _,j in pairs(buf[akey[1] ]) do
	--                            for j,_ in pairs(buf[akey[1] ]) do
							for _,j in pairs(buf[akey[1] ]) do
	--                            for j,_ in pairs(buf[akey[1] ]) do
	end
	end
	for _,j in pairs(buf[akey[1] ]) do
	--                                    for j,_ in pairs(buf[akey[1] ]) do
	for _,j in pairs(buf[akey[1] ]) do
	--                                    for j,_ in pairs(buf[akey[1] ]) do
	end
								local L = amm.L[1] + (amm.L[2] - amm.L[1])*c
								for j,q in pairs(ain.base) do
									if ain.dir < 0 then
									local n = 0
									for _,j in pairs(buf[akey[1]]) do
	--                                    for j,_ in pairs(buf[akey[1]]) do
									for _,j in pairs(buf[akey[1]]) do
	--                                    for j,_ in pairs(buf[akey[1]]) do
										local w = awall[n+1] -- deepcopy(dsrc.afloor[akey[1]].awall[j])
										local w = awall[n+1] -- deepcopy(dsrc.afloor[akey[1]].awall[j])
										for dae,r in pairs(w.df) do
											w.df[dae] = {scale = r.scale}
									n = 1
									for _,j in pairs(buf[akey[1]]) do
	--                                    for j,_ in pairs(buf[akey[1]]) do
									for _,j in pairs(buf[akey[1]]) do
	--                                    for j,_ in pairs(buf[akey[1]]) do
	--                                        lo('?? inserting:'..(ij[2]+n), true)
								-- cleanup
								for j,w in pairs(floor.awall) do
									forestClean(w)
								end
								for j,w in pairs(newfloor.awall) do
									for dae,r in pairs(w.df) do
								for j,w in pairs(newfloor.awall) do
									for dae,r in pairs(w.df) do
										w.df[dae] = {scale = r.scale or 1}
								end
								for dae,r in pairs(newfloor.top.df) do
									newfloor.top.df[dae] = {scale = r.scale or 1}
									local buf = {}
									for i,r in pairs(desc.selection) do
										table.sort(r)
												U.dump(buftgt, '?? BT:')
										for i,r in pairs(buftgt) do
											ftgt = desc.afloor[i]
												lo('?? for_row:'..i..':'..tostring(desc)..':'..tostring(ftgt))
											for j,_ in pairs(r) do
												acol[#acol+1] = j
											lo('?? ftgt_pre:'..#acol..':'..jmi..':'..#ftgt.base)
										for o,j in pairs(acol) do
											if o > 1 then
										-- insert
										for n,j in pairs(acol) do
									local akeytgt = {}
									for k,r in pairs(buftgt) do
										akeytgt[#akeytgt+1] = k
									local awall = {}
									for _,j in pairs(buf[akey[1]]) do
		--                            for j,_ in pairs(buf[akey[1]]) do
									for _,j in pairs(buf[akey[1]]) do
		--                            for j,_ in pairs(buf[akey[1]]) do
											lo('?? for_wall:'..j)
										local w = awall[#awall]
										for dae,d in pairs(w.df) do
											w.df[dae] = {scale = d.scale}
		--                                    lo('?? iind:'..iind)
									for j,w in pairs(awall) do
										-- to base
								dnew.afloor[1].top.ij[1] = #akey - #dnew.afloor + 1
								for _,w in pairs(dnew.afloor[1].awall) do
									for dae,r in pairs(w.df) do
								for _,w in pairs(dnew.afloor[1].awall) do
									for dae,r in pairs(w.df) do
										w.df[dae] = {scale = w.df[dae].scale}
									if i == 1 then
										for j,w in pairs(desc.afloor[akey[i]].awall) do
											objDown(w)
--        U.dump(out.acorner, '?? AC2:')
		for _,e in pairs(out.acorner) do
			debugDrawer:drawLine(e.line[1], e.line[2], ColorF(1,1,0,1), 2)
--            U.dump(out.asplit, '?? mark_split:')
		for _,e in pairs(out.asplit) do
			debugDrawer:drawLine(e.line[1], e.line[2], ColorF(1,1,0,1))
	if out.fcyan then
		for _,v in pairs(out.fcyan) do
			debugDrawer:drawLine(v[1], v[2], ColorF(0,1,1,1), 4)
--				U.dump(s.aforest,'>> windowsToggle:'..tostring(s))
			for _,h in pairs(s.areg) do
				local av = U.spline2plane(h, s.ap, s.adist)
--            U.dump(desc.acorner_, '?? to_SUBTRACT:', true)
		for n,p in pairs(acorner) do
--            local isext
			local hit
			for m,q in pairs(desc.acorner_) do
--                local hit
				for i,a in pairs(p.list) do
					for j,b in pairs(q.list) do
				for i,a in pairs(p.list) do
					for j,b in pairs(q.list) do
						if a[1] == b[1] and a[2] == b[2] then
					local hit
					for i,a in pairs(p.list) do
						for j,b in pairs(q.list) do
					for i,a in pairs(p.list) do
						for j,b in pairs(q.list) do
							if a[1] == b[1] and a[2] == b[2] then
		if not daePath[tp..'_corner'] then return end
		for _,s in pairs(daePath[tp..'_corner']) do
			-- parse the name
	local p = U.proj2D(cw.pos)
	for _,d in pairs(awall) do
		if U.proj2D(d.pos):distance(p) < small_dist and math.abs(d.u:length() - cw.u:length()) < small_dist then
						local p = U.proj2D(cw.pos)
						for k,d in pairs(desc.afloor[i].awall) do
--								lo('?? if_POS:'..i..':'..k..':'..tostring(U.proj2D(d.pos))..':'..tostring(p)..':'..tostring(d.pilaster))
					U.dump(dfirst,'?? to_DEL:'..ndel)
				for f,jfirst in pairs(dfirst) do
					for j = 1,ndel do
--[[
				for _,d in pairs(adel) do
					local buf = {}
			local lastrow = 0
			for i,row in pairs(desc.selection) do
				for _,j in pairs(row) do
			for i,row in pairs(desc.selection) do
				for _,j in pairs(row) do
					if not p then
	--			U.dump(desc.selection, '?? for_SPLIT:'..lastrow)
			for i,s in pairs(asplit) do
--					U.dump(s, '??______************ for_S:'..i..':'..s[1]..'/'..lastrow)
						if U._PRD == 0 then list = deepcopy(daePath[tp]) end
					for i,pth in pairs(list) do
						local m = ddae[pth]
--            U.dump(desc.acorner_, '?? to_SUBTRACT:', true)
			for _,p in pairs(acorner) do
				for _,q in pairs(desc.acorner_) do
			for _,p in pairs(acorner) do
				for _,q in pairs(desc.acorner_) do
					if (p.pos-q.pos):length() < small_dist then
						local hit
						for i,a in pairs(p.list) do
							for j,b in pairs(q.list) do
						for i,a in pairs(p.list) do
							for j,b in pairs(q.list) do
								if a[1] == b[1] and a[2] == b[2] then
	for i=#list,1,-1 do
--	for i,d in pairs(list) do
		if ddae[list[i]] and ddae[list[i]].mute then
	local apair = T.pairsUp(base)
	for i,p in pairs(apair) do
		if ij[2] == p[1] then
    local base,imap = U.polyStraighten(floor.base)
    for k,v in pairs(imap) do
      if v == ij[2] then
    if apair then
      for i,p in pairs(apair) do
        local fit
	local vb,ve = sbase[U.mod(j,#sbase)], sbase[U.mod(j+1,#sbase)]
	for k,c in pairs(achild) do
		-- for top children
		-- for top children
		for _,ib in pairs({j,U.mod(j+1,#sbase)}) do
			-- if wall ends are in the child vertex mapping
--                            U.dump(c, '?? for_child: floor:'..i..' wall:'..j..':'..#aind)
				for _,ic in pairs(aind) do
					local pchild = cbase[k][ic] --c.base[ic]
	local rebuild
	for i,row in pairs(buf) do
		local floor = adesc[cedit.mesh].afloor[i]

		for _,r in pairs(row) do
--            local v = -U.perp(U.mod(r+1, base) - base[r]):normalized()
				w.id = nil
				for dae,d in pairs(w.df) do
					w.df[dae] = {scale = d.scale}
				w.id = nil
				for dae,d in pairs(w.df) do
					w.df[dae] = {scale = d.scale}
		-- move base
		for _,j in pairs(row) do
			-- walls to move
			local vb,ve = asbase[i][U.mod(j,#asbase[i])],asbase[i][U.mod(j+1,#asbase[i])]
			for k,c in pairs(floor.top.achild) do
				-- for top children
				-- for top children
				for _,ib in pairs({j,U.mod(j+1,#base)}) do
--                    U.dump(c.imap, '?? in_map:'..ib..' j:'..j)
--                            U.dump(c, '?? for_child: floor:'..i..' wall:'..j..':'..#aind)
						for _,ic in pairs(aind) do
							local pchild = acbase[i][k][ic] --c.base[ic]
				local av = {}
				for _,f in pairs(m.faces) do
					if #U.index(av, f.v) == 0 then
					U.dump(av, '?? h_IVERTS:'..tostring(w.u)..':'..tostring(dmesh[w.id]))
				for _,v in pairs(av) do
	--                    lo('?? for_v:'..tostring(m.verts[v+1]))
		lo('?? mat2xml.for_node:'..tostring(xml))
--		for i,k in pairs(xml.kids) do
--			lo(k.name)
	local list = {}
	for i,desc in pairs(ahouse) do
		editor.clearObjectSelection()
			--		U.dump(w.df, '?? for_wall:'..ij[1]..':'..ij[2])
				for pth,list in pairs(w.df) do
					for _,id in pairs(list) do
				for pth,list in pairs(w.df) do
					for _,id in pairs(list) do
						local item = dforest[id].item
			if desc.selection and tableSize(desc.selection) == 1 then
				for j,aw in pairs(desc.selection) do
					if not desc.aspline then desc.aspline = {} end --{aij={}} end
		-- clean folder
		for i,s in pairs(amesh) do
			lo('?? for_file:'..i..':'..s)
		scope = 'building'
		for _,d in pairs(adesc) do
			if not df[d.id] then df[d.id] = {list={},apos={}} end
			forBuilding(d, function(w, ij)
				for pth,list in pairs(w.df) do
					for _,id in pairs(list) do
				for pth,list in pairs(w.df) do
					for _,id in pairs(list) do
						local item = dforest[id].item
			local list = groupBat:getObjects()
			for _,o in pairs(list) do
				local om = scenetree.findObjectById(tonumber(o))
		local item,key
		for id,list in pairs(dpos) do
			for _,p in pairs(list) do
		for id,list in pairs(dpos) do
			for _,p in pairs(list) do
				for _,o in pairs(df[id].list) do
			for _,p in pairs(list) do
				for _,o in pairs(df[id].list) do
					local mtx = o.mtx
--[[
		for i,o in pairs(af) do
			item = fdata:createNewItem(o.obj, o.mtx, o.scale)
		local df = {}
		for _,d in pairs(sdesc) do
			for _,p in pairs(dpos[d.id]) do
		for _,d in pairs(sdesc) do
			for _,p in pairs(dpos[d.id]) do
				lo('?? topos:'..d.id..':'..tostring(p))
				forBuilding(d, function(w, ij)
					for pth,list in pairs(w.df) do
						for _,id in pairs(list) do
					for pth,list in pairs(w.df) do
						for _,id in pairs(list) do
				local item = dforest[id].item
		if false then
			for i,desc in pairs(adesc) do
				local ascan = W.buildingScan(desc, function(ascan)
			scope = nil
			for _,d in pairs(adesc) do
				local nm = 'b_'..d.id
				lo('?? deld:'..tostring(scope))
			for _,nm in pairs(list) do
				if not scenetree.findObject(nm) then
					local i = 1
					for id,d in pairs(adesc) do
						if i > istart then
]]
					for i,id in pairs(aid) do
							lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
				local aid = {}
				for id,d in pairs(adesc) do
				d.id = nil
				end
				for i,id in pairs(aid) do
					lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
				-- top childs to floor childs
				for _,c in pairs(floor.top.achild) do
			-- new floor child
					child.awall = {}
					for i,b in pairs(child.base) do
						child.awall[#child.awall+1] = deepcopy(floor.awall[c.imap[i]])

					for _,w in pairs(child.awall) do
						for dae,r in pairs(w.df) do
					for _,w in pairs(child.awall) do
						for dae,r in pairs(w.df) do
							w.df[dae] = {scale = w.df[dae].scale}
				end
				for j,w in pairs(floor.awall) do
					objDown(w)
			out.avedit = {}
			for i,a in pairs(cchild.base) do
				for _,c in pairs(achild) do
			for i,a in pairs(cchild.base) do
				for _,c in pairs(achild) do
					if _ ~= desc.afloor[cij[1] ].top.cchild then
					if _ ~= desc.afloor[cij[1] ].top.cchild then
						for j,b in pairs(c.base) do
							if (a-b):length() < small_dist then
				f.ij[1] = f.ij[1]+1
				for j,w in pairs(f.awall) do
					w.ij[1] = w.ij[1]+1
--                U.dump(desc.acorner_, '?? corners_shift:')
				for i,b in pairs(desc.acorner_) do
					for j,f in pairs(b.list) do
				for i,b in pairs(desc.acorner_) do
					for j,f in pairs(b.list) do
						f[1] = f[1] + 1
			if desc.acorner_ then
				for i,b in pairs(desc.acorner_) do
					for j,f in pairs(b.list) do
				for i,b in pairs(desc.acorner_) do
					for j,f in pairs(b.list) do
						f[1] = f[1] - 1
      if desc.afloor[2] then
        for _,w in pairs(desc.afloor[2].awall) do
          w.doorstairs = nil
			if floor.top.achild then
				for j,c in pairs(floor.top.achild) do
					cbase[#cbase+1] = U.clone(c.base)
--            U.dump(dmove, '?? to_move:')
		for ic,c in pairs(cedit.cval['DragPos'].cbase) do
			for ib,b in pairs(c) do
		for ic,c in pairs(cedit.cval['DragPos'].cbase) do
			for ib,b in pairs(c) do
				floor.top.achild[ic].base[ib] = b + dmove[ic][ib]
			out.ahole = {}
			for i,p in pairs(b.base) do
				out.ahole[#out.ahole+1] = cw.pos + p.x*cw.u:normalized() + p.y*cw.v:normalized()
				local floor = desc.afloor[#desc.afloor]
				for _,w in pairs(floor.awall) do
					forestClean(w)
			cedit.cval['DragVal'] = {}
			for i,f in pairs(desc.afloor) do
				cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = {base = U.clone(f.base), achild = {}}
				local achild = cedit.cval['DragVal'][#cedit.cval['DragVal']].achild
				for i,c in pairs(f.top.achild) do
--                    cedit.cval['DragVal'][#cedit.cval['DragVal']].achild[cedit.cval['DragVal'][#cedit.cval['DragVal']].achild+1] = U.clone(c.base)
					local fchild = {}
					for i,d in pairs(f.achild) do
						fchild[i] = {}
						fchild[i] = {}
						for j,fc in pairs(d.afloor) do
							fchild[i][#fchild[i]+1] = U.clone(fc.base)
			local base = cedit.cval['DragVal'][ij[1]].base
			for j,_ in pairs(base) do
				desc.afloor[ij[1]].base[j] = center + U.vturn(base[j]-center, 2*math.pi*val/360)
--            if ij[1] == #desc.afloor and floor.top.achild then
				for k,c in pairs(floor.top.achild) do
--                    U.dump(c, '?? for_child:'..k)
			if floor.achild then
				for i,d in pairs(floor.achild) do
					local basechild = cedit.cval['DragVal'][ij[1]].fchild[i]
					local basechild = cedit.cval['DragVal'][ij[1]].fchild[i]
					for j,f in pairs(d.afloor) do
--                            U.dump(basechild, '?? fo_fch:'..i..':'..j)
			local u = (base[2]-base[1]):normalized()
			for j,_ in pairs(base) do
				desc.afloor[ij[1] ].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
			cedit.cval['DragVal'] = {}
			for i,f in pairs(desc.afloor) do
				cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = U.clone(f.base)
			local u = (base[2]-base[1]):normalized()
			for j,_ in pairs(base) do
				desc.afloor[ij[1]].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
			cedit.cval['DragVal'] = {}
			for i,f in pairs(desc.afloor) do
				cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = U.clone(f.base)
			local u = U.perp(base[2]-base[1]):normalized()
			for j,_ in pairs(base) do
				desc.afloor[ij[1]].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
			local cbase = {} -- children bases
			for f,_ in pairs(desc.selection) do
				abase[f] = U.clone(desc.afloor[f].base)
					cbase[f] = {}
					for j,c in pairs(desc.afloor[f].top.achild) do
						-- check consistency with top children
--                            U.dump(abase[f], '??^^^^^^^^^^^ for_fbase:'..j..':'..f)
						for a,isel in pairs(desc.selection[f]) do
							if c.base then
							if c.base then
								for b,ic in pairs(c.base) do
										lo('?? if_cross:'..a..':'..isel..':'..b..':'..tostring(abase[f][isel]))
					floor.top.shape = 'flat'
					for _,c in pairs(floor.top.achild) do
						scenetree.findObjectById(c.id):delete()
--                U.dump(desc.afloor[cij[1]].top.achild, '?? AW_children:')
			for _,wp in pairs(desc.afloor[cij[1]].awplus) do
				wp.dirty = true
			-- clear previous
			for j,w in pairs(cedit.cval['DragExt'].awall) do
				if w.id then
					cedit.cval['DragPos'] = {dpos={}} --, val = val}
					for i,d in pairs(s.aforest) do
						if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
				end
				for i,d in pairs(s.aforest) do
					if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
					cedit.cval['DragPos'] = {dpos={}} --, val = val}
					for i,d in pairs(s.aforest) do
						if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
				end
				for i,d in pairs(s.aforest) do
					if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
--					U.dump(desc.aspline,'?? win_bot:'..ij[2])
				for _,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
					if d.key == cedit.forest then
				if w['win'..'_inf'] then
				for i,dae in pairs(w['win'..'_inf'].ddae) do
					for j,k in pairs(w.df[dae]) do
				for i,dae in pairs(w['win'..'_inf'].ddae) do
					for j,k in pairs(w.df[dae]) do
		--                U.dump(dforest[k], '?? in_dforest:'..j)
@/lua/common/libs/resty/template/html.lua
    if attr then
        for k, v in pairs(attr) do
            if type(k) == "number" then
@/lua/ge/extensions/editor/materialEditor.lua
  local fields = mat:getFields() or {}
  for k, v in pairs(fields) do
    if v.type == "filename" then

  for k, f in pairs(fields) do
    if f.type == "filename" then
  local rows = {}
  for mesh, count in pairs(usageByMesh) do
    table.insert(rows, { mesh = mesh, count = count })
  local forestRows = {}
  for mesh, count in pairs(forestUsageByShape) do
    table.insert(forestRows, { mesh = mesh, count = count })
  table.sort(sortedTags, sortFunc)
  for tagName, materials in pairs(tags) do
    table.sort(materials, sortFunc)

      for mat, _ in pairs(tbl) do
        if mat ~= "" then

      for mat, _ in pairs(tbl) do
        table.insert(materialObjectNames, mat)

  for k, v in pairs(materialObjectNames) do
    if im.ImGuiTextFilter_PassFilter(matFilter, v) and v then
  local i = 0
  for k, val in pairs(sortedMaterialObjectNamesAtTop) do
    local mat = scenetree.findObject(val)
  end
  for k, val in pairs(sortedMaterialObjectNames) do
    local mat = scenetree.findObject(val)
local function saveAllDirtyMaterials()
  for matName, _ in pairs(v.dirtyMaterials) do
    local mat = scenetree.findObject(matName)
  local field = currentMaterial:getField(property, layer)
  for k, v in pairs(items) do
    if v == field then
  else
    for k, v in pairs(items) do
      if v == translucentBlendOp then
      local files = {}
      for k,v in pairs(currentMaterial:getFields()) do
        if v.type == "filename" then
          local tooltipMsg = "Save all dirty materials:\n"
          for k,v in pairs(v.dirtyMaterials) do
            tooltipMsg = tooltipMsg .. "* " .. k .. "\n"
local function onFilesChanged(files)
  for _,v in pairs(files) do
    local path = v.filename
@/lua/ge/extensions/freeroam/bigMapMode.lua
  if mapData and mapData.nodes then
    for _, node in pairs(mapData.nodes) do
      if node.pos:length() < 1e14 then
@/lua/common/jbeam/io.lua
    local partCounter = 0
    for partName, part in pairs(data) do
      parts[partName] = {}
  -- walk all file caches to build the global caches together
  for filename, cacheData in pairs(fileCache) do
    --dumpz({"cacheData: ", cacheData}, 8)
    --dumpz({"cacheData: ", cacheData}, 8)
    for partName, partData in pairs(cacheData.parts) do
      for _, slotType in ipairs(partData.slotTypes) do
    -- merge manually to catch errors
    for partName, partDesc in pairs(partNameMap[dir]) do
      if res[partName] then
    -- merge manually to catch errors
    for slotName, partList in pairs(partSlotMap[dir]) do
      if not res[slotName] then res[slotName], slotsPartMap[slotName] = {}, {} end
@/lua/vehicle/controller/driveModes.lua
local function updateSimpleControlButtons()
  for _, buttonData in pairs(simpleControlButtons) do
    updateSimpleControlButton(buttonData)
local function updateGFX(dt)
  for _, buttonData in pairs(simpleControlButtons) do
    local desiredColor = (electrics.values[buttonData.offColorElectric] and electrics.values[buttonData.offColorElectric] >= 1) and buttonData.offColor or buttonData.color
    local defaultSettingData = tableFromHeaderTable(defaults)
    for _, v in pairs(defaultSettingData) do
      local key = v.key or v.controllerName or v.type
  local modeData = {}
  for k, v in pairs(jbeamData) do
    if k:sub(1, #"modes") == "modes" then
    if k:sub(1, #"enabledModes") == "enabledModes" then
      for _, modeKey in pairs(v) do
        enabledModeKeys[modeKey] = true

  for k, mode in pairs(modeData) do
    if driveModes[mode.order] then
      driveModes[k].settingsOrder = {}
      for _, newSetting in pairs(modeSettings) do
        local key = newSetting.key or newSetting.deviceName or newSetting.electricsName or newSetting.controllerName or newSetting.type

      for settingsKey, _ in pairs(driveModes[k].settings) do
        table.insert(driveModes[k].settingsOrder, settingsKey)

  for _, mode in pairs(modeSorting) do
    table.insert(enabledDriveModes, mode.key)

  -- for name, mode in pairs(modeSorting) do
  --   if driveModeOrder[mode.order] then
@/lua/ge/extensions/util/trackBuilder/obstaclePlacer.lua

for name,_ in pairs(shapeNames) do obstacleTypes[#obstacleTypes+1] = name end
local objects = {}

  for name,list in pairs(data) do
    expandTruncateList(name,#list)
@/lua/ge/extensions/ui/gameplaySelector/tiles.lua
  local validItems = {}
  for _, item in pairs(items) do
    if backend.passesFilters(item) then
    -- Group items by the specified group mode (similar to vehicle selector approach)
    for _, item in pairs(validItems) do
      -- Get groups for this item (including special groups)
      -- Create groups and add items
      for _, groupInfo in pairs(groupsForItem) do
        local groupName = groupInfo.groupName
    -- Process each group to create tiles
    for _, group in pairs(groups) do
      local tiles = group.tiles

        for clusterKey, clusterData in pairs(clusteredItems) do
          -- Skip clustering for "None" results (e.g., campaign system in automatic mode)
            -- For "None" clustering, add items directly without clustering
            for _, item in pairs(clusterData.itemsByKey) do
              table.insert(tiles, item)
    if displayData.showFavouritesMode == 'completeClusters' or displayData.showRecentMode == 'completeClusters' then
      for _, group in pairs(groups) do
        if not group.isFavouriteGroup and not group.isRecentGroup then
        if not group.isFavouriteGroup and not group.isRecentGroup then
          for _, tile in pairs(group.tiles) do
            -- Duplicate tiles for favourites group if needed
                local favouriteTile = {}
                for k, v in pairs(tile) do
                  favouriteTile[k] = v
                local recentTile = {}
                for k, v in pairs(tile) do
                  recentTile[k] = v
    -- Sort tiles within each group
    for _, group in pairs(groups) do
      if group.isRecentGroup then
      if group.isRecentGroup then
        for _, tile in pairs(group.tiles) do
          tile.recentIdx = backend.isRecent(tile.key) or math.huge
    local groupsList = {}
    for _, group in pairs(groups) do
      if #group.tiles > 0 then
  -- Filter items based on the automatic clustering rules
  for _, item in pairs(items) do
    -- Apply general filters first
    local hasDefaultTile = false
    for _, tile in pairs(filteredItems) do
      tile.isDefaultSelected = false
  local items = data.items
  for _, item in pairs(items) do
    item.showFavouriteIconPercent = backend.isFavourite(item.key) and 1 or 0
    validItems = {}
    for _, item in pairs(items) do
      if item.validBackends[backend.backendName] then
@/lua/ge/extensions/gameplay/drift/saveLoad.lua
local function onSaveCurrentSaveSlot(currentSavePath)
  for id, spot in pairs(M.getDriftSpotsById()) do
    if spot._dirty then
      -- immediately hide the objects found
      for id, line in pairs(spotData.spatialInfo.lines) do
        for _, name in ipairs(line.markerObjects or {}) do
  local spotsForLevel = {}
  for _, spot in pairs(getDriftSpotsById()) do
    if spot.level == getCurrentLevelIdentifier() then
@/lua/ge/extensions/gameplay/traffic/baseRole.lua
  self.flowgraph.transient = true -- prevent flowgraph from restarting flowgraphs after ctrl+L
  for key, value in pairs(varData or {}) do
    if self.flowgraph.variables:variableExists(key) then
  local personality = {}
  for _, v in pairs({'aggression', 'patience', 'bravery'}) do
    local mod = {}
      local valid = false
      for _, state in pairs(sequence.controllerStates) do
        local ctrlState = state.controller.states[state.stateIdx]

  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/ge/extensions/gameplay/drift/bounds.lua

  for _, zone in pairs(sites.zones.objects) do
    zone:drawDebug(nil, isOutOfBounds and red or white, 2, -0.5, not isOutOfBounds)
@/lua/ge/extensions/career/modules/branches/landing.lua
  --Get the names of the rewards
  for _, tierData in pairs(rewards) do
    for _, reward in ipairs(tierData) do
  --dump("getting skills for " .. branchId)
  for _, skill in pairs(career_branches.getSortedBranches()) do
    --dump(branchId .. " is a skill of " .. skill.id.." / "..dumps( skill.parentId))
  }
  for key, value in pairs(fac.providedSystemsLookup) do
    if value then

  for key, value in pairs(fac.receivedSystemsLookup) do
    if value then
  local ret = {}
  for key, value in pairs(facility.providedSystemsLookup) do
    if value then
  end
  for key, value in pairs(facility.receivedSystemsLookup) do
    if value then

  for _, subBranch in pairs(career_branches.getSortedBranches()) do
    if subBranch.parentId == branchId then
@/lua/ge/extensions/flowgraph/modules/prefabModule.lua

    for k, v in pairs(objectsByType) do
      if not ignoredClasses[k] then
  moreData = moreData or {}
  for k, v in pairs(moreData) do data[k] = v end
  if data then
    for vid, val in pairs(data.originalVehicleTransforms or {}) do
      local veh = scenetree.findObjectById(vid)
  local vehicleTransforms = {}
  for k, _ in pairs(self.prefabs[id].originalVehicleTransforms) do
    local veh = scenetree.findObjectById(k)
  obj:delete()
  for k, v in pairs(vehicleTransforms) do
    --dump("Extracting object: " .. i)
@/lua/vehicle/extensions/tech/wheelForces.lua

  for id, wd in pairs(wheels.wheels) do
    local data = {}

    for _, beamId in pairs(rimBeams) do
      local rBeam = v.data.beams[beamId]

    for _, beamId in pairs(sidewallBeams) do
      local sBeam = v.data.beams[beamId]

    for _, beamId in pairs(sidewallReinfBeams) do
      local rBeam = v.data.beams[beamId]
--dump(v.data.beams)
    for beamId, beam in pairs(v.data.beams) do
      --we only care for non-rim beams

    for _, treadNodeId in pairs(v.data.wheels[id].treadNodes) do
      table.insert(data.treadNodes, treadNodeId)
@/lua/ge/extensions/career/modules/playerDriving.lua

    for k, v in pairs(gameplay_traffic.getTrafficData()) do
      if v.role.name == "police" then
    playerData.preStartTicks = playerData.preStartTicks - 1
    for k, v in pairs(freeroam_specialTriggers.getTriggers()) do
      if not v.vehIds[be:getPlayerVehicleID(0)] then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imText.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
    if mapData and mapData.graph then
      for nid, pos in pairs(mapData.positions) do
        local n = mapData.graph[nid]
        if n then
           for lid, _ in pairs(n) do
             local lPos = mapData.positions[lid]

  for _, col in pairs(index) do
    for _, tile in pairs(col) do
  for _, col in pairs(index) do
    for _, tile in pairs(col) do
      tile._roadMarkingSet = nil
         if n then
           for lid, _ in pairs(n) do
             local lPos = mapData.positions[lid]
        -- Iterate over all cached tiles
        for key, data in pairs(activeTileCache) do
            local ctx = data.metadata.tileX
@/lua/common/utils.lua
        local prefix = '{"'
        for kk, vv in pairs(v) do
          bufTmp:put(prefix, type(kk) == 'string' and escapeString(kk) or kk, '":')
        local tableKeys = tableKeysSorted(v)
        for _, kk in pairs(tableKeys) do
          local vv = v[kk]
  if not data then return nil end
  for k,v in pairs(data) do
    for k2,v2 in pairs(v) do
  for k,v in pairs(data) do
    for k2,v2 in pairs(v) do
      if k2 > 1 then
  local tblSize = #tbl
  for k, _ in pairs(tbl) do
    if type(k) ~= 'number' or k < 1 or k > tblSize then return false end
  local keysidx = 0
  for k in pairs(tbl) do
    keysidx = keysidx + 1
  local res = target or table.new(#tbl, 4)
  for _, tb in pairs(tbl) do
    res[tb] = 1
function tableMerge(dst, src)
  for k, v in pairs(src) do
    dst[k] = v
function tableMergeRecursive(t1, t2)
  for k, v in pairs(t2) do
    if type(v) == "table" and type(t1[k]) == "table" then
function tableMergeRecursiveArray(t1, t2)
  for k, v in pairs(t2) do
    if type(v) == "table" and type(t1[k]) == "table" then
  local count = 0
  for _ in pairs(tbl) do
    count = count + 1
function tableFindKey(t, element)
  for k, v in pairs(t) do
    if v == element then
  element = string.lower(element)
  for _, value in pairs(table) do
    if string.lower(value) == element then
  local depth = 1
  for k, v in pairs(tbl) do
    if type(k) == "table" then
    local copy = table.new(#orig, 0)
    for k, v in pairs(orig) do
      copy[k] = v
  lookup_table[object] = new_table
  for index, value in pairs(object) do
    if type(index) == 'table' then
    profilerPushEvent("readFiles readClose batch")
    for filename, f in pairs(batchFiles) do
      if f ~= nil then
local function tableMergeExceptFunc(dst, src)
  for k, v in pairs(src) do
    dst[k] = type(v) ~= "function" and v or nil
  local tmp = {}
  for k, v in pairs(package.loaded) do
    if isPackage(k, v) and type(v) == 'table' and (v['onDeserialized'] ~= nil or v['onSerialize'] ~= nil) then

  for k,v in pairs(package.loaded) do
    if isPackage(k, v) and (filter == nil or k == filter) and type(v) == 'table' and (v['onDeserialized'] ~= nil or v['onDeserialize'] ~= nil) and data[k] ~= nil then
  local dkeys = {}
  for k in pairs(d) do table.insert(dkeys, k) end
  table.sort(dkeys)
  -- save the text
  for _, k in pairs(dkeys) do
    local v = d[k]
      if type(incl) == "table" then
        for kk, vv in pairs(v) do
          if incl[kk] then
      else
        for kk, vv in pairs(v) do
          bufTmp:putf(type(kk) == 'string' and "%q;" or "%s;", kk)
      local prefix = "{"
      for kk, vv in pairs(v) do
        if kk == arrayidx then

  for _, k in pairs(keys) do
    local v = tbl[k]
local function _unflattenTable_rec(tbl, tableRegister, path)
  for k, v in pairs(tbl) do
    if type(v) == 'table' then
  local i = 0
  for k in pairs(t) do
    i = i + 1
@/lua/ge/extensions/flowgraph/nodes/scene/rectMarker.lua
    self:clear()
    for _, p in pairs(self.pinOut) do p.value = nil end
    return
  local corner, found, hit
  for k,marker in pairs(self.markerObjects)do
    if k == 1 then --top left
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local function renderPickedJBeamObjs()
  for k, node in pairs(pickedNodes) do
    local nodeID = node.cid

  for k, beam in pairs(pickedBeams) do
    local dispText = getBeamDisplayText(beam)
        if im.BeginCombo("##beamTypesCombobox", "Set beam types to pick...", im.ComboFlags_HeightLarge) then
          for k, enabled in pairs(beamTypesRendering) do
            local beamType = beamTypesNames[k]
  -- Populate beamTypesRendering table
  for k,v in pairs(beamTypesNames) do
    beamTypesRendering[k] = im.BoolPtr(true)
@/lua/ge/ge_utils.lua
  local fields = player:getFields()
  for k, f in pairs(fields) do
    if k ~= 'dataBlock' and k ~= 'parentGroup' then -- why do we need to exclude these?
function setAudioChannelsVolume(data)
  for k, v in pairs(data) do
    local AudioChannel = scenetree[k]
  if not o or #o == 0 then return nil end
  for _, v in pairs(o) do
    table.insert(res, scenetree.findObject(v))
  local obj = SimGroup()
  for k, v in pairs(t) do
    obj[k] = v

      for k, v in pairs(modelDataPaints) do
        local bc = v.baseColor
    result = {}
    for vid,v in pairs(data) do
      local vehicle = getObjectByID(vid)
    result = {}
    for vehicleName,v in pairs(data) do
      local vehicle = scenetree.findObject(vehicleName)
  local residx = 1
  for _, value in pairs(files) do
    -- because for some reason there are files inside the result if recursive level is >0
  local n = 0
  for k, v in pairs(t) do
    n = n + 1
  local dirs = {}
  for _,v in pairs(files) do
    if FS:directoryExists(v) and not FS:fileExists(v) then
  }
  for _, f in pairs(files) do
    --print( ' - ' .. string.upper(f) .. ' = ' .. hashStringSHA1(string.upper(f)))
    local resSorted = {}
    for k, v in pairs(res) do
      table.insert(resSorted, k);
@/lua/ge/extensions/ui/vehicleSelector/vehicleSpecifications.lua
  end
  for _, paint in pairs(modelDetails.paints) do
    table.insert(paintData.factoryPaints, paint)
@/gameplay/missionTypes/garageToGarage/constructor.lua
  if self.missionTypeData then
    for key, value in pairs(self.missionTypeData) do
      -- Exclude complex data structures that flowgraph can't handle
      }
      for _, c in pairs(v.configs) do
        local passConfig = true
  local removalsNested = {}
  for configKey, _ in pairs(manualRemovals or {}) do
    local model, config = configKey:match("^([^/]+)/(.+)$")
      local selectedOptions = {}
      for option, selected in pairs(filter.values) do
        if selected and option ~= 'Other...' then
@/lua/ge/extensions/editor/shapeEditor.lua
    highestDetail = -1
    for k,v in pairs(shapeInfo.details) do
      if v.size < 0 then goto continue_info end
      comboSeqCtxTxt = ""
      for k,v in pairs(shapeInfo.sequences) do
        log("I","info.seq", dumps(k).."|"..dumps(v.name))
    f:write(string.format("function %s::onLoad(%%this)\n{\n", filenameNoExt))
    for k,v in pairs(meshConstructor.createMeshLOD) do
      if v.sloppy then
  local fdata = originalMaterial:getFieldsForEditor()
  for k,v in pairs(fdata) do
    if arrayFindValueIndex(skipFields,k) == false then
  end
  for k,v in pairs(fdata.Stages_beginarray.fields) do
    for i = 0, 3 do
  end
  for k,v in pairs(meshConstructor.createMeshLOD) do
    if v.dest == dest then
        -- im.Columns(2)
        -- for k,v in pairs(shapePrev:getMeshStat()) do
        --   im.Text(k)
          if data then
            for k, v in pairs(data) do
              if type(v) ~= 'table' then
        if meshConstructor and meshConstructor.createMeshLOD and not lodBrokenMesh then
          for k,v in pairs(meshConstructor.createMeshLOD) do
            local src = tostring(v.src)
@/lua/vehicle/particlefilter.lua
    if mmap ~= nil then
      for _, r in pairs(mmap) do
        if r.compareFunc(p) then
@/lua/ge/extensions/flowgraph/nodes/mission/ARunForLife.lua
  local i = 0
  for _, id in pairs(containers) do
    local veh = scenetree.findObjectById(id)
  coinAvailable = false
  for id, t in pairs(buffs) do
    if t.available then
function C:doBuffsTime()
  for id, t in pairs(buffs) do
    if t.useTime then --make sure the current buff actually uses timers

  for id, t in pairs(buffs) do
    if t.onScreen and t.pos[2] - camPos.y > propDespawn then
function C:getBuffByName(name)
  for id, t in pairs(buffs) do
    if t.name == name then
function C:getPropByName(name)
  for id, t in pairs(propsInfo) do
    if t.name == name then
  local i = 0
  for id, t in pairs(propsInfo) do
    if t.decal then

  for id, t in pairs(propsInfo) do
    if t.decal then
@/lua/ge/extensions/editor/fileDialog.lua

      for _, file in pairs(fileCache) do
        if not (options.select_folder and file.filetype ~= 'dir') then
  local cols = editor.getPreference("files.fileDialog.columns")
  for columnName, visible in pairs(cols) do
    for _, column in ipairs(columns) do
@/lua/ge/extensions/flowgraph/nodes/thread/sendMessage.lua
    local added = false
    for name, pin in pairs(self.pinIn) do
      if not pin.fixed then
@/lua/vehicle/extensions/profiling/p.lua
  local t, n = {}, 0
  for k in pairs(count1) do
    n = n + 1
  local ms = 0
  for k, v in pairs(count1) do
    local pct = floor(v*1000/samples + 0.5)/10
@/lua/ge/extensions/gameplay/rally/notebook/missionSettings.lua
  local files = FS:findFiles(notebooksFullPath, '*.notebook.json', -1, true, false)
  for _,fname in pairs(files) do
    table.insert(paths, fname)
@/lua/common/libs/luasocket/socket/smtp.lua
    local lower = {}
    for i,v in base.pairs(headers or lower) do
        lower[string.lower(i)] = v
    local h = "\r\n"
    for f,v in base.pairs(tosend) do
        h = (canonic[f] or f) .. ': ' .. v .. "\r\n" .. h
@/lua/ge/extensions/flowgraph/nodes/activity/getProgress.lua

    for key, val in pairs(aggregate) do
      if self.pinOut[key] then
@/lua/ge/extensions/flowgraph/states.lua

  for name, state in pairs(self.states) do
    -- clear extProxy
  -- find all links that have our node as the source node.
  for id, link in pairs(stateGraph.links) do
    if link.sourceNode.id == node.id then
  local deps = {}
  for k, i in pairs(kDeps) do
    table.insert(deps, k)
  for _, node in ipairs(hooks) do
    for k, func in pairs(node) do
      if string.sub(k, 1, 2) == 'on' and type(func) == 'function' then
function C:startAutoStartStates()
  for name, state in pairs(self.states) do
    if state.autoStart then
  -- find out if there is a connection from the entry node to any exit node. if so, this subgraph is invalid.
  for _, link in pairs(graph.links) do
    if link.sourceNode.nodeType == "states/stateEntry" and link.targetNode.nodeType == "states/stateExit" then
  table.insert(currentDepth, graph.id)
  for _, node in pairs(graph.nodes) do
    if node.nodeType ~= 'debug/comment' then
        local parent = nil
        for id, nd in pairs(group) do
          if nd.targetGraph.id == node.graph.id then

  for _, link in pairs(graph.links) do
    local elem = {
  local validNodes = {}
  for id, node in pairs(nodes) do
    if not node.isConnector then
  local rootNodes = {}
  for id, node in pairs(nodes) do
    if node.isRoot then
  for _, root in ipairs(rootNodes) do
    for name, port in pairs(root.ports or {}) do
      for _, targetId in ipairs(port.targets) do
  -- now that the heavy work is done, we can build the actual states :)
  for id, node in pairs(portedNodes) do
    if not node.stopProjectWhenReached then
  local deps = {}
  for id, state in pairs(self.states) do
    table.insert(deps, state.extProxy.extName)
function C:getStateIdForNode(node)
  for id, state in pairs(self.states) do
    if state.graph.id == node.graph:getRootGraph().id then return id end
function C:findStateNodeInStateGraphRecursive(graph, id)
  for _, node in pairs(graph.nodes) do
    if node.nodeType == 'states/stateNode' and node.targetGraph and node.targetGraph.id == id then return node end
  local ret = nil
  for _, child in pairs(graph:getChildren()) do
    if not ret then
        log("D","","Adding to transition stack of " .. dumps(self.states[id].name).."/"..dumps(id)..":")
        for key, val in pairs(onStates[id][3] or {}) do
          self.states[id].transitionStack[key] = val
        end
        for key, val in pairs(onStates[id][2] or {}) do
          self.states[id].transitionStack[key] = val
  local ids = {}
  for id, state in pairs(self.states) do
    if tableContains(state.depth, lastId) then
function C:broadcastCall(functionName, ...)
  for id, state in pairs(self.states) do
    if state.extProxy and state.extProxy.hookProxies and state.extProxy.hookProxies[functionName] then
function C:broadcastCallReturn(functionName, results, ...)
  for id, state in pairs(self.states) do
    if state.extProxy and state.extProxy.hookProxies and state.extProxy.hookProxies[functionName] then
@/lua/ge/extensions/editor/flowgraph/nodePreview.lua

      for id, node in pairs(self.hover.nodes) do
        ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)

      for _, link in pairs(self.hover.links) do
        link:draw()
@/lua/vehicle/controller/gauges/customModules/electricMotorData.lua
  motors = powertrain.getDevicesByType("electricMotor")
  for _, v in pairs(motors) do
    for _, j in pairs(v.registeredEnergyStorages) do
  for _, v in pairs(motors) do
    for _, j in pairs(v.registeredEnergyStorages) do
      table.insert(batteries, j)
@/lua/ge/extensions/flowgraph/nodes/ui/threeElementSelect.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/vehicle/controller/vehicleController/shiftLogic/automaticGearbox.lua
  automaticHandling.availableModeLookup = {}
  for _, v in pairs(automaticHandling.availableModes) do
    automaticHandling.availableModeLookup[v] = true
  if jbeamData.hShifterModePositions then
    for mode, index in pairs(jbeamData.hShifterModePositions) do
      automaticHandling.hShifterModeLookup[index] = mode
@/lua/ge/extensions/editor/missionEditor/startTrigger.lua
local startTriggersSorted = {}
for k, _ in pairs(startTriggerTypes) do table.insert(startTriggersSorted, k) end
table.sort(startTriggersSorted)
@/lua/common/libs/xlsxlib/xlsxlib.lua
  local maxRow, maxCol = 0, 0
  for r, row in pairs(sheetData) do
    if r > maxRow then maxRow = r end
    if r > maxRow then maxRow = r end
    for c in pairs(row) do
      if c > maxCol then maxCol = c end
  local keys = {}
  for k in pairs(t) do
    table.insert(keys, k)
  local workbookRel = nil
  for _, rel in pairs(packageRels) do
    if rel.type == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" then
  local sharedStringsFile = nil
  for _, rel in pairs(workbookRels) do
    if rel.type == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" then
    -- Try to find the sheet ignoring case
    for name, path in pairs(xlsx.sheets) do
      if name:lower() == sheetName:lower() then
@/lua/ge/extensions/career/modules/milestones/generalMilestones/branches.lua
M.onGeneralMilestonesSetupCallbacks = function()
  for attKey, milestone in pairs(attKeyToMilestone) do
    M.setNotificationTarget(attKey)
local function onPlayerAttributesChanged(change)
  for attKey, val in pairs(change) do
    if val > 0 then
@/lua/ge/extensions/core/gamestate.lua
local function containsOnly (arr, val)
  for _, l in pairs(arr) do
    if l ~= val then
@/lua/ge/extensions/flowgraph/nodes/ui/onBigmapStateChange.lua
  self.pinOut.exitedEnd.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/vehicle/fire.lua
  local minDistanceTemperature = 0
  for k, v in pairs(hotNodes) do
    local squareDistance = obj:nodeSquaredLength(k, cid)
  -- Particles --
  for hotcid, node in pairs(hotNodes) do
    if hotcid ~= currentNodeKey then
  if v.data.beams then
    for k, b in pairs(v.data.beams) do
      if b.containerBeam then
    local centreNodeDist = 100
    for _, node in pairs(v.data.nodes) do
      local nodeDist = sqrt((node.pos.x * node.pos.x) + (node.pos.y * node.pos.y) + (node.pos.z * node.pos.z))
  if wheels.wheels then
    for id, wd in pairs(wheels.wheels) do
      wheelNodes[wd.node1] = {wheelID = id, node1 = wd.node1, node2 = wd.node2}
  local possibleNodes = {}
  for k, n in pairs(flammableNodes) do
    if n and n.canIgnite and not wheelNodes[k] and n.intensity <= 0 then
  local possibleNodes = {}
  for k, n in pairs(flammableNodes) do
    if n and n.canIgnite and not wheelNodes[k] and n.intensity <= 0 then
local function igniteVehicle()
  for cid, _ in pairs(flammableNodes) do
    if not wheelNodes[cid] then --don't ignite wheelnodes right away to delay the tire popping a bit
local function explodeVehicle()
  for cid, node in pairs(flammableNodes) do
    if node.containerBeam then
local function extinguishVehicle()
  for cid, node in pairs(flammableNodes) do
    node.temperature = tEnv
local function extinguishVehicleSlowly()
  for _, node in pairs(flammableNodes) do
    node.chemEnergy = 0
@/lua/ge/extensions/util/maptiles.lua
  if m then
    for nid, n in pairs(m.getMap().nodes) do
      local pos = n.pos
  local navgraph = {}
  for nid, n in pairs(map.getMap().nodes) do -- remember edges are now single sided
    local a = map.getMap().nodes[nid]
    local a = map.getMap().nodes[nid]
    for lid, link in pairs(n.links) do
      local b = map.getMap().nodes[lid]
@/lua/ge/extensions/tech/techCore.lua
      local resp = {}
      for _, v in pairs(vehicleInfo) do
        resp[v.name] = v
M.onDrawDebug = function(dtReal, lastFocus)
  for _, sphere in pairs(debugObjects.spheres) do
    debugDrawer:drawSphere(sphere.coo, sphere.radius, sphere.color)
  end
  for _, dSphere in pairs(debugObjects.dynamicSpheres) do
    local spec = dSphere.getSpec()
  end
  for _, polyline in pairs(debugObjects.polylines) do
    for _, segment in pairs(polyline.segments) do
  for _, polyline in pairs(debugObjects.polylines) do
    for _, segment in pairs(polyline.segments) do
      debugDrawer:drawLine(segment.origin, segment.target, polyline.color)
  end
  for _, cylinder in pairs(debugObjects.cylinders) do
    debugDrawer:drawCylinder(cylinder.circleAPos, cylinder.circleBPos, cylinder.radius, cylinder.color)
  end
  for _, triangle in pairs(debugObjects.triangles) do
    if type(triangle.color) == "number" then
  end
  for _, rectangle in pairs(debugObjects.rectangles) do
    debugDrawer:drawQuadSolid(rectangle.a, rectangle.b, rectangle.c, rectangle.d, rectangle.color)
  end
  for _, line in pairs(debugObjects.text) do
    debugDrawer:drawText(line.origin, line.content, line.color)
  end
  for _, prism in pairs(debugObjects.squarePrisms) do
    debugDrawer:drawSquarePrism(prism.sideA, prism.sideB, prism.sideADims, prism.sideBDims, prism.color)
M.onFilesChanged = function(files)
  for _, v in pairs(files) do
    local filename = v.filename:lower()

  for _, client in pairs(clients) do
    client:close()
  if frameDelayFuncQueue then
    for idx, item in pairs(frameDelayFuncQueue) do
      item.frameCountDown = item.frameCountDown-1
  if obsoleteFuncIndices then
    for k, idx in pairs(obsoleteFuncIndices) do
      table.remove(obsoleteFuncIndices, idx)
  if exts then
    for idx, ext in pairs(exts) do
      command = 'extensions.load("' .. ext .. '")'
    local roadData = {}
    for fieldName, _ in pairs(road:getFields()) do
      roadData[fieldName] = road:getField(fieldName, '')
    local roadData = {}
    for fieldName, _ in pairs(road:getFields()) do
      roadData[fieldName] = road:getField(fieldName, '')
  local converted = {}
  for key, val in pairs(colors) do
    converted[key] = {val.r, val.g, val.b}
  local annotations = AnnotationManager.getAnnotations()
  for k, v in pairs(annotations) do
    annotations[k] = {v.r, v.g, v.b}
    obj['options'] = {}
    for fld, nfo in pairs(object:getFieldList()) do
      if fld ~= 'position' and fld ~= 'rotation' and fld ~= 'scale' and fld ~= 'id' and fld ~= 'type' and fld ~= 'name' then

  for model, modelData in pairs(models) do
    local data = {
    data.configurations = {}
    for key, config in pairs(configs) do
      if config.model_key == model then
M.handleRemoveDebugObjects = function(request)
  for _, idx in pairs(request.objIDs) do
    debugObjects[request.objType][idx] = nil
    response = {}
    for i, scenario in pairs(scenarios) do
      if levelSet[scenario.levelName] then

  for k, veh in pairs(getAllVehicles()) do
    if not veh:getActive() then goto continue end
  local fields = obj:getFieldList()
  for field, props in pairs(fields) do
    if ignoreNames[field] == nil then

  for k, v in pairs(config) do
    if k == 'rotation' then
  local sensorsOfType = sensors[sensorType]
  for name, id in pairs(sensorsOfType) do
    if id == sensorId then
@/lua/console/json-performance.lua
local totalSize = 0
for _, filename in pairs(filenames) do
  fileContent[filename] = readFile(filename)
  for i = 1, reruns do
    for filename, content in pairs(fileContent) do
      --print(' * ' ..tostring(filename))
local luaContent = {}
for filename, content in pairs(fileContent) do
  --print(' * ' ..tostring(filename))
  for i = 1, reruns do
    for filename, content in pairs(luaContent) do
      --print(' * ' ..tostring(filename))
  for i = 1, reruns do
    for filename, content in pairs(lpackContent) do
      --print(' * ' ..tostring(filename))
  for i = 1, reruns do
    for filename, content in pairs(luaContent) do
      --print(' * ' ..tostring(filename))
  for i = 1, reruns do
    for filename, content in pairs(luaContent) do
      strbufContent[filename] = tostring(buffer.encode(content))
  for i = 1, reruns do
    for filename, content in pairs(strbufContent) do
      buffer.decode(content)
@/lua/ge/extensions/gameplay/crawl/utils.lua
    local dF = child:getDynamicFields()
    for _, value in pairs(dF or {}) do
      if type(value) == "string" and value == dynamicName then
    -- Don't clear if any active crawl is from mission
    for crawlerId, state in pairs(crawlStates) do
      if state and state.active and state.isFromMission then

    for crawlerId, _ in pairs(crawlStates) do
      clearCrawler(crawlerId)
  -- Mark completed nodes as finished (green)
  for pathnodeId, _ in pairs(state.completedPathnodes) do
    markerModes[tostring(pathnodeId)] = 'finished'
  if state.skippedPathnodes then
    for skippedId, _ in pairs(state.skippedPathnodes) do
      -- Only mark as skipped if not completed (skipped nodes can be completed later)
  local sortedPathnodeIndices = {}
  for idx, _ in pairs(state.pathnodeTimings or {}) do
    table.insert(sortedPathnodeIndices, idx)
  if not force then
    for crawlerId, state in pairs(crawlStates) do
      if state and state.active and state.isFromMission then

  for crawlerId, state in pairs(crawlStates) do
    if not state or not state.active then

  for crawlerId, state in pairs(crawlStates) do
    if state.active then
M.getActiveCrawlerId = function()
  for crawlerId, state in pairs(crawlStates) do
    if state and state.active then
  commands.dropPlayerAtCameraNoReset = function(player)
    for crawlerId, state in pairs(crawlStates) do
      if state and state.active then
  recovery.startRecovering = function(useAltMode)
    for crawlerId, state in pairs(crawlStates) do
      if state and state.active then
local function trackVehReset()
  for crawlerId, state in pairs(crawlStates) do
    if state and state.active and state.crawlerData then
@/lua/vehicle/beamstate.lua
  -- highlight all coupling nodes
  for _, coupler in pairs(couplerCache) do
    if not coupler.couplerLock and not coupler.couplerWeld and ((coupler.couplerTag and externalCouplerVisibilityTags[coupler.couplerTag]) or (coupler.tag and externalCouplerVisibilityTags[coupler.tag])) then
    visibleTags = {}
    for _, c in pairs(couplerCache) do
      if not c.couplerWeld and not c.couplerLock and c.couplerTag then
  local nodetag = _nodetag or ""
  for _, val in pairs(couplerCache) do
    if (val.couplerWeld ~= true and val.couplerTag and (_nodetag == nil or val.couplerTag == nodetag)) and val.cid then
  local nodetag = _nodetag or ""
  for _, val in pairs(couplerCache) do
    if ((val.couplerLock ~= true or forceLocked) and (val.couplerWeld ~= true or forceWelded) and val.couplerTag and (_nodetag == nil or val.couplerTag == nodetag)) and val.cid then
  -- check for manual coupler
  for nid, c in pairs(couplerCache) do
    if not c.couplerWeld and not c.couplerLock and c.couplerTag and (nodeTag == nil or c.couplerTag == nodeTag) then
  --otherwise we'd detect the secondary one as "attached" here even if it's locked or welded
  for nid, _ in pairs(attachedCouplers) do
    if couplerCache[nid] and not couplerCache[nid].couplerWeld and not couplerCache[nid].couplerLock and (nodeTag == nil or couplerCache[nid].couplerTag == nodeTag) then
    local isAttached = false
    for cid, coupler in pairs(couplerCache) do
      if coupler.couplerTag == _nodetag then
  local breakGroups = type(n.breakGroup) == "table" and n.breakGroup or {n.breakGroup}
  for _, g in pairs(breakGroups) do
    couplerBreakGroupCache[g] = couplerBreakGroupCacheOrig[g]
      local breakGroups = type(n.breakGroup) == "table" and n.breakGroup or {n.breakGroup}
      for _, g in pairs(breakGroups) do
        breakBreakGroup(g)
  local couplerOffset = {}
  for _, c in pairs(couplerCache) do
    if c.couplerTag == couplerTag or c.tag == couplerTag or couplerTag == "" or not couplerTag then
  if data.inputs then
    for k, v in pairs(data.inputs) do
      input.event(k, v, 2)
    if wheel.treadNodes ~= nil and wheel.treadBeams ~= nil then
      for _, nodecid in pairs(wheel.treadNodes) do
        local frictionCoef = v.data.nodes[nodecid].frictionCoef

      for _, beamcid in pairs(wheel.treadBeams) do
        obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * 0.1, 2, -1, -1)
    if wheel.sideBeams ~= nil then
      for _, beamcid in pairs(wheel.sideBeams) do
        obj:setBeamSpringDamp(beamcid, 0, 10, -1, -1)
    if wheel.peripheryBeams ~= nil then
      for _, beamcid in pairs(wheel.peripheryBeams) do
        obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * 0.1, 2, -1, -1)
    if wheel.reinfBeams ~= nil then
      for _, beamcid in pairs(wheel.reinfBeams) do
        obj:setBeamSpringDamp(beamcid, 0, 0.7, 0, 0)
    if wheel.pressuredBeams ~= nil then
      for _, beamcid in pairs(wheel.pressuredBeams) do
        obj:setBeamPressureRel(beamcid, 0, math.huge, -1, -1)
  local damageSum = 0
  for k, partData in pairs(partDamageData) do
    local partValue = partData.value
    if autoCouplingTimer > 0.5 then
      for nodeTag, _ in pairs(autoCouplingVisibleTags) do
        attachCouplers(nodeTag)
  -- transmit data
  for _, coupler in pairs(transmitCouplers) do
    if coupler.obj2id then
        data.electrics = {}
        for _, v in pairs(coupler.exportElectrics) do
          data.electrics[v] = electrics.values[v]
        data.inputs = {}
        for _, v in pairs(coupler.exportInputs) do
          data.inputs[v] = electrics.values[v] or input[v]
  if part.parts then
    for _, subSlot in pairs(part.parts) do
      for _, subPart in pairs(subSlot) do
    for _, subSlot in pairs(part.parts) do
      for _, subPart in pairs(subSlot) do
        searchForActiveParts(subPart, activeParts)

    for _, beam in pairs(vehicle.beams) do
      local b1, b2 = beam.id1, beam.id2

    for _, tri in pairs(vehicle.triangles) do
      local t1, t2, t3 = tri.id1, tri.id2, tri.id3
    collTriState = {}
    for _, t in pairs(v.data.triangles) do
      if t.cid and t.beamCount then
          local breakGroups = type(t.breakGroup) == "table" and t.breakGroup or {t.breakGroup}
          for _, g in pairs(breakGroups) do
            triangleBreakGroupCache[g] = triangleBreakGroupCache[g] or {}

  for _, n in pairs(v.data.nodes or {}) do
    if n.name then
          local breakGroups = type(n.breakGroup) == "table" and n.breakGroup or {n.breakGroup}
          for _, g in pairs(breakGroups) do
            couplerBreakGroupCache[g] = couplerBreakGroupCache[g] or {}

  for _, c in pairs(couplerCache) do
    if c.couplerStartRadius and c.cid then
  M.activeParts = {}
  for _, slot in pairs(v.data.slotMap or {}) do
    for _, part in pairs(slot) do
  for _, slot in pairs(v.data.slotMap or {}) do
    for _, part in pairs(slot) do
      searchForActiveParts(part, M.activeParts)
  if v.data.activeParts and v.data.activePartsData then
    for partPath, partName in pairs(v.data.activeParts) do
      local part = v.data.activePartsData[partName]
  if v.data.beams then
    for bid, b in pairs(v.data.beams) do
      if b.tag then
        local breakGroups = type(b.breakGroup) == "table" and b.breakGroup or {b.breakGroup}
        for _, g in pairs(breakGroups) do
          if not breakGroupCache[g] then
        local deformGroups = type(b.deformGroup) == "table" and b.deformGroup or {b.deformGroup}
        for _, g in pairs(deformGroups) do
          local group = M.deformGroupDamage[g] or {eventCount = 0, damage = 0, maxEvents = 0, invMaxEvents = 0}
  if v.data.torsionbars then
    for _, t in pairs(v.data.torsionbars) do
      if type(t.precompressionTime) == "number" and t.precompressionTime > 0 then

  for k, v in pairs(invBodyPartBeamCount) do
    invBodyPartBeamCount[k] = 1 / v
local function breakAllBreakgroups()
  for _, b in pairs(v.data.beams) do
    if b.breakGroup ~= nil then
  --break groups that ONLY exist with couplers in them
  for breakgroup, _ in pairs(couplerBreakGroupCache) do
    breakBreakGroup(breakgroup)
local function breakHinges()
  for _, b in pairs(v.data.beams) do
    if b.breakGroup ~= nil then
      -- multiple break groups
      for _, g in pairs(breakGroups) do
        if type(g) == "string" and (string.find(g, "hinge") ~= nil or string.find(g, "latch") ~= nil) then
  --break groups that ONLY exist with couplers in them
  for breakgroup, _ in pairs(couplerBreakGroupCache) do
    if type(breakgroup) == "string" and (string.find(breakgroup, "hinge") ~= nil or string.find(breakgroup, "latch") ~= nil) then
local function deflateTires()
  for i, _ in pairs(wheels.wheels) do
    deflateTire(i)
  local inflatedTires = {}
  for k, v in pairs(wheels.wheels) do
    if not v.isTireDeflated then
  end
  for _, b in pairs(v.data.beams) do
    if b.deformSwitches ~= nil then
      local deformSwitchesT = type(b.deformSwitches) == "table" and b.deformSwitches or {b.deformSwitches}
      for _, g in pairs(deformSwitchesT) do
        if g.deformGroup == group then
  local data = {}
  for _, beam in pairs(v.data.beams) do
    local n1 = v.data.nodes[beam.id1]
local function hasCouplers(couplerTag)
  for _, val in pairs(couplerCache) do
    if (val.couplerWeld ~= true and val.couplerTag) and val.cid and (couplerTag == nil or val.couplerTag == couplerTag or val.tag == couplerTag) then
  save.hydros = {}
  for _, h in pairs(hydros.hydros) do
    table.insert(save.hydros, h.state)
  save.nodes = {}
  for _, node in pairs(v.data.nodes) do
    local d = {obj:getNodePosition(node.cid):toTable()}
  save.beams = {}
  for _, beam in pairs(v.data.beams) do
    local d = {

  for k, h in pairs(save.hydros) do
    hydros.hydros[k].state = h

  for cid, node in pairs(save.nodes) do
    cid = tonumber(cid) - 1

  for cid, beam in pairs(save.beams) do
    cid = tonumber(cid) - 1
  local damageData = {}
  for partName, partData in pairs(partDamageData) do
    local brokenCoef = clamp(partData.beamsBroken / partData.brokenBeamsThreshold, 0, 1)
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua

          for materialName, materialData  in pairs(data) do
            if materialData.mapTo == material then
@/lua/ge/extensions/editor/api/dynamicDecals.lua
M.blendModesMap = {}
for k, v in pairs(M.blendModes) do M.blendModesMap[v.name] = v.value end
M.textureResolutions = {
M.layerTypesMap = {}
for k, v in pairs(M.layerTypes) do M.layerTypesMap[v] = k end
M.layerBakingStatusCode = {
M.typesMap = {}
for k, v in pairs(M.types) do M.typesMap[v] = k end
M.widgetTypes = {
M.propertiesMap = {}
for _, cat in pairs(M.properties) do
  for _, prop in ipairs(cat) do
      local meshNames = {}
      for name, enabled in pairs(sMeshes) do
        if enabled then
      local mNames = M.getShapeMaterialNames()
      for k, materialName in pairs(mNames) do
        if materials[materialName] then
      local mNames = M.getShapeMaterialNames()
      for k, materialName in pairs(mNames) do
        if materialName == vehicleName then
  local materials = {}
  for materialId, materialName in pairs(mNames) do
    materials[materialId] = materialName
  local layerData = {}
  for _, layer in pairs(layerStack) do
    table.insert(layerData, serializeLayer(layer))
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
  local avgWheelPositions = {[-1] = vec3(), [1] = vec3()}
  for wheelSideIndex, wheelSide in pairs(relevantWheels) do
    for _, wheel in ipairs(wheelSide.wheels) do

  for wheelSideIndex, avgWheelPosition in pairs(avgWheelPositions) do
    local wheelVector = avgWheelPosition - avgDiffPosition --create a vector from our "center" to the wheel
@/lua/vehicle/powertrain/combustionEngineThermals.lua
  local emitLargeParticulates = particleTicks.exhaustSmokeParticleTick > 1 and particulateEmission >= 0.3
  for _, n in pairs(nodes.exhaustEnds) do
    --regular exhaust smoke
  --if a node is underwater we want to increase the block to air cooling to simulate water cooling of the block
  for _, v in pairs(nodes.engine) do
    underWaterBlockCoolingCoef = underWaterBlockCoolingCoef + (obj:inWater(v) and 1000 or 0)
  --if a node is underwater we want to increase the block to air cooling to simulate water cooling of the block
  for _, v in pairs(nodes.engine) do
    underWaterBlockCoolingCoef = underWaterBlockCoolingCoef + (obj:inWater(v) and 100 or 0)

    for _, n in pairs(nodes.exhaustEnds) do
      if particleTicks.exhaustOilParticleTick > 1 and not parentEngine.isDisabled then

  for k, child in pairs(branch.children) do
    --if at this point something broke away or we reached the original end of the branch
  --search for the exhaust start node
  for _, n in pairs(v.data.nodes) do
    if n.isExhaust and (type(n.isExhaust) == "boolean" or n.isExhaust == parentEngine.name) then
  --find all exhaust beams
  for _, b in pairs(v.data.beams) do
    if b.isExhaust and (type(b.isExhaust) == "boolean" or b.isExhaust == parentEngine.name) then
local function exhaustBeamBroken(id, exhaustTree)
  for _, v in pairs(exhaustTree.children) do
    --if the broken beam matches one of our tree beams
local function resetExhaustTree(exhaustTree)
  for _, v in pairs(exhaustTree.children) do
    --if one of the children are already broken

  for k, _ in pairs(exhaustBeams) do
    exhaustBeams[k] = true
  burnEfficiencyCoef = {}
  for k, v in pairs(parentEngine.invBurnEfficiencyTable) do
    burnEfficiencyCoef[k] = v - 1
  end
  for _, n in pairs(jbeamData.engineBlock._engineGroup_nodes) do
    engineBlockMass = engineBlockMass + v.data.nodes[n].nodeWeight
@/lua/ge/extensions/editor/dynamicDecals/export.lua
  tblx = {}
  for _, fileType in pairs(exportTexturesFileTypes) do
    table.insert(tblx, fileType)
@/lua/ge/extensions/core/repository.lua
  --guihooks.trigger('downloadStateChanged', r);
  for k,v in pairs(progressQueue) do
    if v.id == r.id then
  log('D', 'repo.deleteUpdateQueue', 'delete ' .. tostring(data.filename) ..'   URI=' .. tostring(data.filename))
  for k,v in pairs(updateQueue) do
    if v.uri == data.uri then

  for k,v in pairs(updateQueue) do
    if v.id == idlook then return true end

  for k,v in pairs(updateQueue) do
    if v.id == idlook then return v.state end
  -- local toDelete = {}
  for k,v in pairs(updateQueue) do
    -- log('D', 'repo.updateDownloadQueue',v.filename.."  update="..tostring(v.update) .."   state="..tostring(v.state) )
  -- if(#toDelete>0) then
  --   for k,v in pairs(toDelete) do
  --     deleteUpdateQueue(v)

  for k,v in pairs(updateQueue) do
    if v.update and v.state == "updating" and downloading < parDownloads then
  --log('I', 'repo.changeStatusUpdateQueue', ' ' .. tostring(fname))
  for k,v in pairs(updateQueue) do
    if v.filename == fname then
    data.modID = string.match(uri, '%w+')
    for k,v in pairs(progressQueue) do
      if v.id == r.id then
    end
    for k,v in pairs(updateQueue) do
      if v.id==data.modID then
      end
      for k,v in pairs(updateQueue) do
        if v.id==data.modID then table.remove( updateQueue, k ) end
      guihooks.trigger("toastrMsg", {type="error", title="Repo Error", msg="Could not download the file, File missing"})
      for k,v in pairs(updateQueue) do
        if v.id==data.modID then table.remove( updateQueue, k ) end
    local finished = true
    for k,v in pairs(updateQueue) do
      if v.update and v.state ~= "done" then
      -- log('I', 'repo.finish', "updateQueue"..dumps(updateQueue) )
      for k,v in pairs(updateQueue) do
        if v.state == "done" then
      request.responseData.automationMsg = repoAutomationMsg
      for k,v in pairs(modList) do
        modList[k].pending = idInUpdateQueue(v.tagid)
    request.responseData.automationMsg = repoAutomationMsg
    for k,v in pairs(modList) do
      modList[k].pending = idInUpdateQueue(v.id)

  for k,v in pairs(updateQueue) do
    if v.id == mod_id then log('E', 'repo.modSubscribe', "Subscription '"..tostring(mod_id).."' already in update list"); return end

    for k,v in pairs(updateQueue) do
      if v.reason ~= "subscription" then v.update = false end
  log('D', 'repo.modUnsubscribe', tostring(mod_id).." -> "..tostring(modName))
  for k,v in pairs(updateQueue) do
    if v.id == mod_id then
local function addUpdateQueue(data)
  for k,v in pairs(updateQueue) do --no duplicate
    if v.id == data.id then return end
  updatingRepo = true
  for k,v in pairs(updateQueue) do
    if v.action == "update" then
  updatingRepo = true
  for k,v in pairs(updateQueue) do
    if v.id == id then
  updatingRepo = true
  for k,v in pairs(updateQueue) do
    if v.action == "missing" then
  if repoCmd.forceInstall then
    for k,v in pairs(repoCmd.forceInstall) do
      if core_modmanager.getModNameFromID(v) == nil then
  if repoCmd.forceRemove then
    for k,v in pairs(repoCmd.forceRemove) do
      if core_modmanager.getModNameFromID(v) ~= nil then
  if repoCmd.forceDisable then
    for k,v in pairs(repoCmd.forceDisable) do
      guihooks.trigger('repoError', 'force Disable : '..v)
  if #subList > 0 and core_modmanager.isReady() and Engine.Online.isAuthenticated() then
    for k,v in pairs(subList) do
      modSubscribe(v)
@/lua/ge/extensions/flowgraph/nodes/ui/vehicleSelector.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/ge/extensions/editor/createObjectTool.lua
  if actionData.onBuildFuncFields then
    for _, val in pairs(actionData.onBuildFuncFields) do
      obj:setField(val[1], val[2], val[3])
      if fieldsSetOnBuildFunc[currentCreateObjectItem.classname] then
        for _, val in pairs(fieldsSetOnBuildFunc[currentCreateObjectItem.classname]) do
          -- If this field has been set in buildFunc, serialize it.
@/lua/ge/extensions/flowgraph/baseStateNode.lua
  --setmetatable(o, C)
  for k, v in pairs(C) do
    --print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
  local baseInit = o.init
  for k, v in pairs(derivedClass) do
    --print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
@/lua/ge/extensions/util/nodeBeamExport.lua

  for _, b in pairs(vdata.vdata.beams or {}) do
    if b and b.id1 and b.id2 then
@/lua/ge/extensions/scenario/waypoints.lua
    -- add all successors of successors to a list and render them
    for _, from in pairs(nextWps) do
      for i, s in pairs(M.state.branchGraph[from.branch][from.index].successors) do
    for _, from in pairs(nextWps) do
      for i, s in pairs(M.state.branchGraph[from.branch][from.index].successors) do
        if not (M.state.branchGraph[from.branch][from.index].isFinalWaypoint and not (w.lap + 1 < scenario.lapCount or scenario.lapCount == 0)) then
  -- insert successors into graph
  for _,f in pairs(from) do
    -- if the branch does nt exist, create it
    end
    for _,t in pairs(to) do
     -- check if successor already exists
      local existing = false
      for _,s in pairs(M.state.branchGraph[f.branch][f.index].successors) do
        if s.index == t.index and s.branch == t.branch then
  local paths = {}
  for name, branch in pairs(scenario.lapConfigBranches or {}) do
    paths[name] = branch
  M.state.lapConfigName = name
  for pName, path in pairs(paths) do
    --M.state.branchGraph[pName] = {}
    if scenario.BranchLapConfig then
      for bName, branch in pairs(scenario.lapConfigBranches or {}) do
        M.state.waypointBranches[bName] = {}
    if scenario.BranchLapConfig then
      for bName, branch in pairs(scenario.lapConfigBranches or {}) do
        M.state.waypointBranches[bName] = {}
  local allWPs = {}
  for _, wpb in pairs(M.state.branchGraph) do
    for _, wp in pairs(wpb) do
  for _, wpb in pairs(M.state.branchGraph) do
    for _, wp in pairs(wpb) do
      allWPs[wp.cpName] = true
  local wpList = {}
  for wp, _ in pairs(allWPs) do
    local node = scenario.nodes[wp]
  if scenario.lapConfig and #scenario.lapConfig > 0 then
    for _, vid in pairs(scenario.vehicleNameToId) do
      initialiseVehicleData(vid)
  local vehicleWaypointsData = M.state.vehicleWaypointsData or {}
  for vid, vehWpData in pairs(vehicleWaypointsData) do
    local vehicle = getObjectByID(vid)
    if successors and vehicle and vehicleData then
      for k, v in pairs(successors) do
        local nextWp = scenario.nodes[v.cpName]
local function drawDebug()
  for vid, vehWpData in pairs(M.state.vehicleWaypointsData or {}) do
    for i = 1, #vehWpData.previousCorners do
@/lua/vehicle/extensions/advancedwheeldebug.lua
  isDebugEnabled = false
  for _,v in pairs(debugUsers) do
    isDebugEnabled = isDebugEnabled or v
  local data = {}
  for _,wd in pairs(v.data.wheels) do
    local name = wd.name
@/lua/vehicle/controller/pneumatics/airbrakes.lua
local function setBrakedWheelsUpdate()
  for _, wd in pairs(wheels.wheels) do
    if brakedWheelsLookup[wd.name] then

  for _, v in pairs(torqueTable) do
    minBrakePressure = min(minBrakePressure, v.pressure)

  for _, v in pairs(torqueTable) do
    minSpringBrakePressure = min(minSpringBrakePressure, v.pressure)
  brakedWheelsLookup = {}
  for _, brakedWheelName in pairs(brakedWheels) do
    brakedWheelsLookup[brakedWheelName] = true
@/lua/ge/extensions/util/groundModelDebug.lua

  for name, gm in pairs(groundModels) do
    tbl.colors[name] = {}
  if tbl then
    for name, color in pairs(tbl.colors) do
      if groundModels[name] then
  if #groundModels[name].aliases > 0 then
    for _,alias in pairs(groundModels[name].aliases) do
      be:setGroundModel(alias, gm.data)
  local data = {}
  for k,v in pairs(groundModels) do
    data[k] = {}
    data[k] = {}
    for propertyName, propertyVal in pairs(v.cdata) do
      data[k][propertyName] = propertyVal[0]
      if im.SmallButton("Enable All") then
        for _,k in pairs(gms) do
          groundModels[k].active[0] = true
      if im.SmallButton("Disable All") then
        for _,k in pairs(gms) do
          groundModels[k].active[0] = false

      for _,k in pairs(gms) do
        local v = groundModels[k]
            if #v.aliases > 0 then
              for _, name in pairs(v.aliases) do
                groundModels[name].active[0] = groundModels[k].active[0]
      -- no groundtype filtering: draw them all!
      for _,k in pairs(gms) do
        local gm = groundModels[k]
@/lua/ge/extensions/ui/liveryEditor/selection.lua
    local layerTypeCount = 0
    for k, _ in pairs(layerTypes) do
      layerType = k
@/lua/ge/extensions/campaign/photoSafari.lua
          M.count = 1
          for k,v in pairs(subLocationsHints) do
            unlockedHints[k] = subLocationsHints[k][1]
          M.count = #seen +1
          for k,v in pairs(subLocationsHints) do
            if not  M.foundLocation[k] then
@/lua/ge/extensions/flowgraph/nodes/string/format.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['value_'..i] then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua

    for partName, _ in pairs(partsList) do
      local part, jbeamFilename = jbeamIO.getPart(ioCtx, partName)
            partsViewCount = 0
            for _, v in pairs(parts) do
              local partName = tostring(v[2])
          local isSelectedPart = false
          for k, v in pairs(parts) do
            if v[1] then
@/lua/ge/extensions/editor/bulkRename.lua

  for id, entry in pairs(previewNames) do
    table.insert(ids, id)
local function findCollisionWithNewName(ownerId, newName)
  for id, entry in pairs(previewNames) do
    -- we skip the id we check with the others

  for id, entry in pairs(previewNames) do
    local objId
        -- Populate rows
        for id, entry in pairs(previewNames) do
            imgui.TableNextRow()
@/lua/ge/extensions/editor/missionEditor/conditions.lua
    local aConds = require(file:sub(0,-5))
    for key, value in pairs(aConds) do
      missionConditions[key] = value
    local mans = {}
    for model, info in pairs(core_vehicles.getModelList().models) do
      if info.Brand then
    end
    for k, _ in pairs(mans) do table.insert(self.manufacturerList, k) end
    table.sort(self.manufacturerList)
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua
  -- set out pins according to flags and reset flags
  for pName, val in pairs(self.flags) do
    self.pinOut[pName].value = val
@/lua/ge/extensions/editor/vehicleEditor/api/nodeTransformer.lua

  for _,node in pairs(vEditor.selectedNodes) do
    lastPickedNodesPos[node.name] = node.pos
  -- Center transforming axes arrows on node selection
  for _, node in pairs(vEditor.selectedNodes) do
    axesArrowPos:setAdd(node.pos)
@/lua/ge/extensions/gameplay/discover.lua
  local pages = {}
  for id, pageInfo in pairs(pageInfosById) do
    local page = deepcopy(pageInfo)
  local devices = {}
  for k, v in pairs(core_input_bindings.bindings) do
    if v.contents.devicetype and v.contents.imagePack then
@/lua/vehicle/extensions/gameplayInterface.lua
local function registerModule(name, actions, lookups)
  for k, _ in pairs(actions) do
    if registeredActions[k] then
  end
  for k, _ in pairs(lookups) do
    if registeredLookups[k] then
@/lua/ge/extensions/career/modules/insurance/insurance.lua
    if not data.bodyStyle then return false end
    for _, bodyStyle in pairs(values) do
      if data.bodyStyle[bodyStyle] then
    if not data.commercialClass then return false end
    for _, commercialClass in pairs(values) do
      if commercialClass == data.commercialClass then
    if insuranceInfo.perks then
      for perkId, perkInfo in pairs(insuranceInfo.perks) do
        local perkStaticData = perks[perkId]
      insuranceInfo.coverageOptions.deductible.perkText = insuranceInfo.perks.reduceDeductible.intro
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.deductible.choices) do
        coverageOptionInfo.oldValue = coverageOptionInfo.value
      insuranceInfo.coverageOptions.paintRepair.perkText = insuranceInfo.perks.freeRepaintDuringRepair.intro
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.paintRepair.choices) do
        coverageOptionInfo.oldPremiumInfluence = coverageOptionInfo.premiumInfluence
      insuranceInfo.coverageOptions.roadsideAssistance.perkText = insuranceInfo.perks.freeTowing.intro
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.roadsideAssistance.choices) do
        coverageOptionInfo.oldPremiumInfluence = coverageOptionInfo.premiumInfluence
      insuranceInfo.coverageOptions.repairTime.perkText = insuranceInfo.perks.repairTimeDiscount.intro
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.repairTime.choices) do
        coverageOptionInfo.premiumInfluence = coverageOptionInfo.premiumInfluence * (1 - repairTimeDiscountPerkValue)
      insuranceInfo.coverageOptions.repairTime.perkText = insuranceInfo.perks.instantRepair.intro
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.repairTime.choices) do
        if coverageOptionInfo.value > 0 then

    for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.roadsideAssistance.choices) do
      coverageOptionInfo.choiceText = string.format("%i tows", coverageOptionInfo.value)
    end
    for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.repairTime.choices) do
      coverageOptionInfo.choiceText = coverageOptionInfo.value / 60 > 0 and string.format("%i min", coverageOptionInfo.value / 60) or "Instant"
    end
    for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.deductible.choices) do
      coverageOptionInfo.choiceText = string.format("%i$", coverageOptionInfo.value)
    insuranceInfo.slogan = translateLanguage(insuranceInfo.slogan, insuranceInfo.slogan, true)
    for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions) do
      for choiceId, choiceInfo in pairs(coverageOptionInfo.choices) do --add id to each choice to make it more practical
    for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions) do
      for choiceId, choiceInfo in pairs(coverageOptionInfo.choices) do --add id to each choice to make it more practical
        choiceInfo.id = choiceId
    plInsurancesData = {}
    for _, insuranceInfo in pairs(availableInsurances) do
      plInsurancesData[insuranceInfo.id] = {
      }
      for gestureName, gestureInfo in pairs(insuranceInfo.gestures) do
        plInsurancesData[insuranceInfo.id].gesturesData[gestureName] = {
      end
      for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions) do
        if availableCoverageOptions[coverageOptionName].isInsuranceWide then
      -- convert string keys to numbers
      for k, v in pairs(savedPlInsuranceData.invVehs) do
        invVehs[tonumber(k) or k] = v

  for partPath, info in pairs(data.partConditions) do
    if info.integrityValue then
        -- keep the fuel level
        for _, tankData in pairs(info.integrityState.energyStorage) do
          for attributeName, value in pairs(tankData) do
        for _, tankData in pairs(info.integrityState.energyStorage) do
          for attributeName, value in pairs(tankData) do
            if attributeName ~= "storedEnergy" then
  local totalCost = 0
  for _, cost in pairs(costs) do
    totalCost = totalCost + cost
  if not score then score = plDriverScore end
  for _, tierData in pairs(driverScoreTiers) do
    if score >= tierData.min and score <= tierData.max then
  if repairOptionData.cost then
    for _, cost in pairs(repairOptionData.cost) do
      totalCost = totalCost + cost

  for coverageOptionId, coverageOptionValueId in pairs(currentCoverageOptions) do
    table.insert(coverageOptionsData, sanitizeCoverageOption(insuranceId, coverageOptionId, invVehId))
  local invVehList = {}
  for invVehId, data in pairs(invVehs) do
    if data.insuranceId == insuranceId then
  local invVehList = {}
  for invVehId, data in pairs(invVehs) do
    if availableInsurances[data.insuranceId] and availableInsurances[data.insuranceId].class == classId then
  local sendDataToUI = false
  for _, invVehInsuranceData in pairs(invVehs) do
    if invVehInsuranceData.insuranceId > 0 then
  local plInsuranceData = plInsurancesData[activeInsuranceId]
  for gestureName, _ in pairs(insuranceData.gestures) do -- every gesture is based on driven distance for now
    local lastHappenedAt = plInsuranceData.gesturesData[gestureName].lastHappenedAt or 0
  local insurances = {}
  for _, insuranceInfo in pairs(availableInsurances) do
    if insuranceInfo.class == class then
  if conditionData.jsonInsuranceClass then
    for className, value in pairs(conditionData.jsonInsuranceClass) do
      if value == true then

  for _, classInfo in pairs(availableClasses) do
    if classInfo.applicableConditions then
    if classInfo.applicableConditions then
      for condition, values in pairs(classInfo.applicableConditions.conditions) do -- that's an or condition
        if conditions[condition](conditionData, values) then
  local totalValue = 0
  for _, invVehData in pairs(getInvVehsUnderInsurance(insuranceId)) do
    if invVehData.initialValue then
  -- find the tier that the total value falls into
  for _, tier in pairs(groupDiscountTiers) do
    if tier.max then

    for coverageOptionId, coverageOptionData in pairs(potentialCoverageOptions or availableInsurances[insuranceId].coverageOptions) do
      if not availableCoverageOptions[coverageOptionId].isInsuranceWide then
    -- Insured vehicle: use current coverage options
    for coverageOptionId, coverageOptionValueId in pairs(potentialCoverageOptions or invVeh.insuranceData.coverageOptionsData.currentCoverageOptions) do
      totalDiscount = totalDiscount * availableInsurances[insuranceId].coverageOptions[coverageOptionId].choices[coverageOptionValueId].premiumInfluence

  for _, invVehData in pairs(getInvVehsUnderInsurance(insuranceId)) do
    hasVehicles = true
  if hasVehicles then
    for coverageOptionName, coverageOptionValueId in pairs(potentialCoverageOptions or plInsurancesData[insuranceId].coverageOptionsData.currentCoverageOptions) do
      local coverageOption = availableInsurances[insuranceId].coverageOptions[coverageOptionName]

  for detailName, detailPrice in pairs(details.items) do
    details.totalPrice = details.totalPrice + detailPrice.price
  local totalValue = 0
  for _, invVehData in pairs(getInvVehsUnderInsurance(insuranceId)) do
    if invVehData.initialValue then

  for _, invVehData in pairs(carsInsured) do
    invVehData.insuranceData.currentPremiumPrice = calculateVehiclePremium(invVehData.id).cost
  local count = 0
  for _, invVehData in pairs(invVehs) do
    if invVehData.insuranceId > 0 then
  local applicableInsurances = getInsurancesByClass(context.insuranceClassId)
  for _, insuranceInfo in pairs(applicableInsurances) do
    local sanitizedData
  -- format the data to make it easier to use in the UI
  for invVehId, invVehData in pairs(invVehs) do
    local invVehTileData = career_modules_inventory.getVehicleUiData(invVehId)

  for classId, classData in pairs(availableClasses) do
    local carsInsured = #getInvVehsUnderClass(classId)
    }
    for _, insuranceInfo in pairs(getInsurancesByClass(classId)) do
      table.insert(data.plClassesData[classId].insurances, getInsuranceSanitizedData(insuranceInfo.id))
    -- set the default vehicle specific coverage options
    for coverageOptionName, coverageOptionValue in pairs(availableInsurances[newInsuranceId].coverageOptions) do
      if not availableCoverageOptions[coverageOptionName].isInsuranceWide then
    if #getInvVehsUnderInsurance(newInsuranceId) == 0 then
      for coverageOptionName, coverageOptionValue in pairs(availableInsurances[newInsuranceId].coverageOptions) do
        if availableCoverageOptions[coverageOptionName].isInsuranceWide then
local function changeInvVehInsuranceCoverageOptions(invVehId, changedCoverageOptions)
  for coverageOptionName, coverageOptionValue in pairs(changedCoverageOptions) do
    local coverageOptionValueIndex = tableFindKey(availableInsurances[invVehs[invVehId].insuranceId].coverageOptions[coverageOptionName].changeability.changeParams.choices, coverageOptionValue)
  -- collect all insurances that match the class
  for _, insuranceInfo in pairs(availableInsurances) do
    if insuranceInfo.class == insuranceClassId then
@/lua/ge/extensions/ui/uiMods.lua
  local vueModsChanged = false
  for _,v in pairs(files) do
    if not modModulesChanged and string.startswith(v.filename, "/ui/modModules/") then
@/lua/vehicle/extensions/inputAnalyzer.lua
local function checkInput(dt)
  for k, v in pairs(iV) do
    lastInputs[k] = inputs[k]
  local keyPressed = false
  for k, v in pairs(inputs) do
    if v and v ~= lastInputs[k] then
  if keyPressed then
    for k, v in pairs(inputs) do
      if v and v ~= lastInputs[k] then
@/lua/ge/extensions/flowgraph/basenode.lua
  if self.pinSchema then
    for _, v in pairs(self.pinSchema) do
      local dir = v.dir
  if self.pinSchema then
    for _, v in pairs(self.pinSchema) do
      local dir = v.dir
      -- sorts pins
      for _, p in pairs(pinOrder) do
        if p[1] == pin.name and p[2] == pin.direction then
  if self.pinSchema then
    for _, v in pairs(self.pinSchema) do
      if v.type == 'flow' then
  if self.pinSchema then
    for _, v in pairs(self.pinSchema) do
      if v.dir == 'in' then

  for _, p in pairs(self.pinOut) do
    p.value = nil
  -- remove links
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourcePin == pin or lnk.targetPin == pin then
  if self.clearOutPinsOnStart then
    for _, p in pairs(self.pinOut) do
      p.value = nil
  local targets = {}
  for lid, link in pairs(self.graph.links) do
    if link.sourceNode.id == self.id then
  if editor.getPreference("flowgraph.general.showNodeBehaviours") then
    for k, v in pairs(self.behaviour) do iconWidth = iconWidth + 24 end
  end
      im.TextUnformatted('Errors:')
      for k, v in pairs(self._error) do
        im.TextUnformatted(v)
  builder:Middle()
  for k, pin in pairs(self.pinIn) do
    im.TextUnformatted('> ' .. k .. '[' .. pin.type .. ']')
  end
  for k, pin in pairs(self.pinInLocal) do
    im.TextUnformatted('L> ' .. k .. '[' .. pin.type .. ']')
  end
  for k, pin in pairs(self.pinOut) do
    im.TextUnformatted(k .. '[' .. pin.type .. '] >')
  local hasActivePins = false
  for _, pin in pairs(self.pinList) do
    if pin:isActive() then
  local hiddenCount = 0
  for _, pin in pairs(self.pinList) do
    local show = not pin.hidden
  local inCount = 0
  for _, pin in pairs(self.pinList) do
    if pin.direction == 'in' then

  --for parentNode, _ in pairs(self._flowColors) do
  --  im.TextUnformatted(tostring(parentNode.id))
  -- outputs
  for _, pin in pairs(self.pinList) do
    if pin.direction == 'out' and (isSimple or pin.type ~= 'delegate')  then
  ui_flowgraph_editor.Suspend()
  for _, pin in pairs(self.pinList) do
    pin:hoverDraw(self.mgr)
        local selectedNodes = {}
        for id, _ in pairs(self.mgr.selectedNodes) do
          table.insert(selectedNodes, self.graph.nodes[id])

  for k, v in pairs(self.data) do

  for _, pin in pairs(self.pinIn) do
    if pin._hardcodedDummyPin then
  end
  for _, pin in pairs(self.pinList) do
    if pin.quickAccess then
  -- deserialize data/values
  for k, v in pairs(nodeData.data) do
    if self.data[k] ~= nil then
  if nodeData.hardcodedPins then
    for pinName, val in pairs(nodeData.hardcodedPins) do
  if nodeData.quickAccess then
    for pinName, val in pairs(nodeData.quickAccess.p_in) do
      if self.pinInLocal[pinName] then
    end
    for pinName, val in pairs(nodeData.quickAccess.p_out) do
      if self.pinOut[pinName] then
  if nodeData.hiddenPins then
    for pinName, val in pairs(nodeData.hiddenPins.p_in) do
      if val then
    end
    for pinName, val in pairs(nodeData.hiddenPins.p_out) do
      if val then
  local baseInit = o.init
  for k, v in pairs(derivedClass) do
    --print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
@/lua/ge/extensions/flowgraph/nodes/scene/pointOnDecalroad.lua
  self.roadObj = nil
  for _, p in pairs(self.pinOut) do
    p.value = nil
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
    -- recursive replace
    for k, v in pairs(val) do
      val[k] = replaceSpecialValues(v)

    for sectionName, section in pairs(part) do
      if type(section) == "table" and #section > 1 then
            -- Line is dictionary, so it declares modifier(s)
            for mod, modVal in pairs(lineData) do
              if mod ~= "__astNodeIdx" then
  end
  for mod, modData in pairs(modsScalers) do
    partsModsScalers[modData.partPath] = partsModsScalers[modData.partPath] or {}

    for mod, modData in pairs(newSectionModifiers) do
      --local vehDataModVal = item[mod]

    for mod, modData in pairs(newSectionModifiers) do
      local vehDataModVal = item[mod]

    for sectionName, section in pairs(part) do
      local outModsSection = outMods[sectionName]
              -- Line is dictionary, so it declares modifier(s)
              for mod, modVal in pairs(lineData) do
                if mod ~= "__astNodeIdx" then
                if type(colData) == 'table' and tableIsDict(colData) and #lineData > headerSize then
                  for mod, modVal in pairs(colData) do
                    if mod ~= "__astNodeIdx" then
              -- If current modifiers part origin is not equal to current part and the modifier is not a default value, modifiers are considered leaking
              for mod, modData in pairs(sectionModsCopy) do
                if modsScalers[mod] then
      local mods = partsModsScalers[partName]
      for mod, modVal in pairs(mods) do
        for sectionName, outModsSection in pairs(outMods) do
      for mod, modVal in pairs(mods) do
        for sectionName, outModsSection in pairs(outMods) do
          outModsSection[partName] = outModsSection[partName] or {}
  if runTest then
    for k,v in pairs(testSectionsWrongCounter) do
      print(k .. ": " .. v .. " errors")
  local sortedTbl = tableKeysSorted(sectionsPartsMods)
  for k,v in pairs(sortedTbl) do
    sectionNamesSorted[k] = v
  sectionsModNamesSorted = {}
  for sectionName, mods in pairs(outSectionsAllModNames) do
    sortedTbl = tableKeysSorted(mods)

    for k,v in pairs(sortedTbl) do
      sectionsModNamesSorted[sectionName][k] = v
    str = "{"
    for k,v in pairs(tbl) do
      if i > 1 then str = str .. ", " end
@/lua/vehicle/extensions/core/quickAccess.lua
    local replaced = false
    for k, v in pairs(menuTree[args.level]) do
      if v.uniqueID == args.uniqueID then

  for path, items in pairs(menuTreeCopy) do
    for _, e in ipairs(items) do

  for path, items in pairs(menuTreeCopy) do
    for i = #items, 1, -1 do
  local item
  for path, items in pairs(menuTreeCopy) do
    for i = 1, #items do
@/lua/vehicle/extensions/scenario/shiftBooster.lua
  --[[
    for _, node in pairs(v.data.nodes) do
        print("node = " .. tostring(node.cid) .. ' > ' .. tostring(forceVec))
@/lua/ge/extensions/career/modules/tuning.lua
  local total = 0
  for varName, value in pairs(changedVars) do
    local varData = tuningData[varName]
  local shoppingCartUI = {items = {}}
  for name, info in pairs(shoppingCart.items) do
    table.insert(shoppingCartUI.items, {varName = info.name, level = 1, title = info.title, price = info.price, type = info.type})
    table.insert(shoppingCartUI.items, {varName = info.name, level = 1, title = info.title, price = info.price, type = info.type})
    for name, info in pairs(info.items or {}) do
      table.insert(shoppingCartUI.items, {varName = info.name, level = 2, title = info.title, price = info.price, type = info.type})
      table.insert(shoppingCartUI.items, {varName = info.name, level = 2, title = info.title, price = info.price, type = info.type})
      for name, info in pairs(info.items or {}) do
        table.insert(shoppingCartUI.items, {varName = info.name, level = 3, title = info.title, price = info.price, type = info.type})
  local res = {}
  for varName1, value1 in pairs(vars1) do
    if vars2[varName1] ~= value1 then
  -- fill the vehicleVarsBefore with the missing default values
  for varName, varTuningData in pairs(tuningData) do
    if not vehicleVarsBefore[varName] then
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/vehicleAction.lua
  if actions then
    for name, act in pairs(actions) do
      if not act.ctx or act.ctx == 'vlua' then
@/lua/vehicle/controller/sbrGauges.lua
    local energyLeft = 0
    for k, _ in pairs(batteriesUsed) do
      local storage = energyStorage.getStorage(k)
  local motors = powertrain.getDevicesByType("electricMotor")
  for _, v in pairs(motors) do
    for _, j in pairs(v.registeredEnergyStorages) do
  for _, v in pairs(motors) do
    for _, j in pairs(v.registeredEnergyStorages) do
      batteriesUsed[j] = true

  for k, _ in pairs(batteriesUsed) do
    local storage = energyStorage.getStorage(k)
@/lua/ge/extensions/editor/flowgraphEditor.lua

  for id,graph in pairs(mgr.graphs) do
    if graph.type == "graph" or not graph.macroPath then
  end
  for id,macro in pairs(mgr.macros) do
    if not macro.macroPath then
    im.Text('The unsaved macros are the following: ')
    for id,_ in pairs(dirtyChildren) do
      im.Text(mgr.macros[id].name)
      local originalFileNames = {}
      for fo, elem in pairs(filesByOriginal) do
        table.insert(originalFileNames, fo)
  im.PopStyleVar()
  for _, win in pairs(windows) do
    win:draw(dtReal,dtSim,dtRaw)
        local stateIds = {}
        for id, state in pairs(mgr.states.states) do
          if state.active then
  if mgr.selectedLinkCount == 1 then
    for lId, _ in pairs(mgr.selectedLinks) do
      local link = mgr.graph.links[lId]
    local onCount, offCount = 0,0
    for lId, _ in pairs(mgr.selectedLinks) do
      local link = mgr.graph.links[lId]
    end
    for lId, _ in pairs(mgr.selectedLinks) do
      local link = mgr.graph.links[lId]
  if mgr.selectedLinkCount == 0 then
    for _, link in pairs(mgr.graph.links) do
      if  mgr.selectedNodes[link.targetNode.id] or mgr.selectedNodes[link.sourceNode.id] then
  if mgr.selectedNodeCount == 0 and mgr.selectedLinkCount == 1 then
    for lId, _ in pairs(mgr.selectedLinks) do
      local link = mgr.graph.links[lId]
    local connectedIds = {}
    for nId, _ in pairs(mgr.selectedNodes) do
      local node = mgr.graph.nodes[nId]
  if mgr.selectedNodeCount == 2 then
    for nId, _ in pairs(mgr.selectedNodes) do
      local node = mgr.graph.nodes[nId]
    local availableA, availableB = {},{}
    for _, pin in pairs(nodeA.pinOut) do
      if not pin.hidden then
    end
    for _, pin in pairs(nodeB.pinInLocal) do
      if not pin.hidden and not pin:getFirstConnectedLink() and pin.pinMode ~= "hardcoded" then
  if mgr.selectedNodeCount == 0 then
    for lId, _ in pairs(mgr.selectedLinks) do
      local link = mgr.graph.links[lId]
  else
    for _, link in pairs(mgr.graph.links) do
      if    mgr.selectedNodes[link.targetNode.id] and not mgr.selectedNodes[link.sourceNode.id]
    if #linksToRemove == 0 then
      for _, link in pairs(mgr.graph.links) do
        if mgr.selectedNodes[link.targetNode.id] and mgr.selectedNodes[link.sourceNode.id] then
@/lua/ge/extensions/flowgraph/nodes/career/onTestDriveChanged.lua
  self.pinOut.started.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imCheckbox.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/ge/extensions/editor/raceEditor/tools.lua
local function setFieldsRedo(data)
  for idx, _ in pairs(data.newDataMap) do
    data.self.path.pathnodes.objects[idx][data.field] = data.newDataMap[idx]
  local oldDataMap = {}
  for idx, _ in pairs(newDataMap) do
    oldDataMap[idx] = self.path.pathnodes.objects[idx][field]
    local allTransforms = {}
    for _, pn in pairs(self.path.pathnodes.objects) do
      local transforms = pn:getSideTransforms(self:getSideTransformParameters())
    local newDataMap = {}
    for _, node in pairs(self.path.pathnodes.objects) do
      newDataMap[node.id] = core_terrain.getTerrainHeight(node.pos)
    local newDataMap = {}
    for _, node in pairs(self.path.pathnodes.objects) do
      if node.hasNormal then
    local newDataMap = {}
    for _, node in pairs(self.path.pathnodes.objects) do
      newDataMap[node.id] = nodeSize[0]
  if im.Button("Remove Redundant BeamNGWaypoints") then
    for _, node in pairs(self.path.pathnodes.objects) do
      if scenetree.findObject(node.name) then
  if im.Button("Align All Pathnodes to Grid") then
    for _, node in pairs(self.path.pathnodes.objects) do
      node.pos.x = round(node.pos.x)
@/lua/ge/extensions/career/modules/playerAttributes.lua
  -- make statistic
  for attributeName, value in pairs(change) do
    attributes[attributeName] = attributes[attributeName] or deepcopy(baseAttribute)
    attribute.value = clamp(attribute.value + value, attribute.min or -math.huge, attribute.max or math.huge)
    for tag, en in pairs(reason.tags) do
      if en and value > 0 then
  local ch = {}
  for attributeName, newValue in pairs(newValues) do
    local attribute = attributes[attributeName] or deepcopy(baseAttribute)

  for name, data in pairs(jsonData) do
    local mappedName = oldAttributeNamesToNewNames[name] or name
    attributes[mappedName] = attributes[mappedName] or deepcopy(baseAttribute)
    for k,v in pairs(data) do
      attributes[mappedName][k] = v
      local updatedChanges = {}
      for oldName, value in pairs(change.attributeChange) do
        local newName = oldAttributeNamesToNewNames[oldName] or oldName
    local msg = "Updated attribute names:"
    for oldName, newName in pairs(updatedNames) do
      msg = msg .. string.format("\n  %s -> %s", oldName, newName)
local function onCareerModulesActivated()
  for orgId, organization in pairs(freeroam_organizations.getOrganizations()) do
    if not attributes[orgId .. "Reputation"] then
@/lua/ge/extensions/flowgraph/nodes/scene/sevensegmentDisplay.lua
function C:clearObjects()
    for _, obj in pairs(self.objects) do
        if obj then
@/lua/ge/extensions/career/modules/payment.lua
local function canPay(price)
  for currency, info in pairs(price) do
    if not info.canBeNegative and info.amount > 0 and career_modules_playerAttributes.getAttributeValue(currency) < info.amount then
  local change = {}
  for currency, info in pairs(price) do
    change[currency] = -info.amount
@/lua/vehicle/backwardsCompatibility.lua

    for k, _ in pairs(uniqueWheels) do
      local axleBeamsWheel = wheels[k] and (wheels[k].axleBeams or {}) or {}
      engine.torque = {{"rpm", "torque"}}
      for _, v in pairs(v.data.enginetorque) do
        table.insert(engine.torque, {v.rpm, v.torque})
  if engineData then
    for _, e in pairs(engineData) do
      table.insert(v.data.powertrain, e)
  if diffData then
    for _, e in pairs(diffData) do
      table.insert(v.data.powertrain, e)
    --check if we already have an esc controller
    for _, v in pairs(v.data.controller) do
      if v.filename == "esc" then

  for _, deviceData in pairs(v.data.powertrain or {}) do
    local type = deviceData.type

  for _, controllerData in pairs(v.data.controller or {}) do
    if controllerData.fileName == "vehicleController" then
@/lua/common/libs/lua-MessagePack/MessagePack.lua
  end
  for k, v in pairs(tbl) do
    local typek = type(k)
      local is_map, n, max = false, 0, 0
      for k in pairs(tbl) do
        if type(k) == 'number' and k > 0 then
      local is_map, n, max = false, 0, 0
      for k in pairs(tbl) do
        if type(k) == 'number' and k > 0 then
      local n = 0
      for k in pairs(tbl) do
        n = n + 1
@/lua/ge/extensions/editor/trafficDebug.lua
    if var[0] then
      for id, veh in pairs(traffic) do
        veh.debugLine = true
  im.BeginChild1("Vehicles##trafficDebug", im.ImVec2(180 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
  for id, veh in pairs(traffic) do
    if not veh.isAi then
    if im.TreeNode1("Personality Info") then
      for k, v in pairs(currVeh.role.driver.personality) do
        doBulletTextInfo(k, v)
@/lua/ge/extensions/editor/windows.lua
    local windows = {}
    for name, data in pairs(windowsData) do
      table.insert(windows, data.title or name)
      im.Columns(2, "windowsColumns")
      for _, name in pairs(windows) do
        if im.ImGuiTextFilter_PassFilter(filter, name) then
@/lua/ge/extensions/gameplay/rally/notebook/structured/libCompositor.lua
  local prioritizedModifiers = {}
  for mod,modData in pairs(config.modifiers) do
    table.insert(prioritizedModifiers, { modName = mod, modData = modData })
  for _,rawDistanceBefore in ipairs(rawDistanceBeforeValues) do
    for caution,cautionText in pairs(config.caution) do
      structured.fields.caution = caution
    for _,cornerSeverity in ipairs(config.cornerSeverity) do
      for cornerDirection,_ in pairs(config.cornerDirection) do
        for _,cornerLength in pairs(config.cornerLength) do
      for cornerDirection,_ in pairs(config.cornerDirection) do
        for _,cornerLength in pairs(config.cornerLength) do
          for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
        for _,cornerLength in pairs(config.cornerLength) do
          for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
            structured.fields.cornerSeverity = cornerSeverity.value
    -- for _,cornerSquare in ipairs({true, false}) do
      for cornerDirection,_ in pairs(config.cornerDirection) do
        for _,cornerLength in pairs(config.cornerLength) do
      for cornerDirection,_ in pairs(config.cornerDirection) do
        for _,cornerLength in pairs(config.cornerLength) do
          for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
        for _,cornerLength in pairs(config.cornerLength) do
          for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
            structured.fields.cornerSeverity = -1
  for _,rawDistanceBefore in ipairs(rawDistanceBeforeValues) do
    for modName,modData in pairs(config.modifiers) do
      -- clear modifiers to work with a clean and consistent state.
      for modName,_ in pairs(config.modifiers) do
        structured.fields[modName] = false
@/lua/ge/extensions/core/hardwareinfo.lua
    if manifest and manifest.format == 1 and manifest.integritydata then
      for _,v in pairs(manifest.integritydata) do
        originalSize = originalSize + v[2]
    local rootsize = nil
    for _,v in pairs(diskUsage) do
      if v.name == "rootpath" then
  res.globalState = 'ok'
  for k, v in pairs(res) do
    if type(v) == 'table' then
      if v.warnings and #v.warnings > 0 then
        for k2,v2 in pairs(v.warnings) do
          if settings.getValue('PerformanceWarnings.' .. tostring(v2.msg)) then
    if diskUsage then
      for _,v in pairs(diskUsage) do
        guihooks.trigger('diskInfoCallback', v)
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
  -- set some defaults
  for i, vt in pairs(viewTemplates) do
    vt.zoom = 1
  -- kill objects before serializing and convert pointers
  for _, view in pairs(views or {}) do
    if view and view.runtime and view.runtime.rv then
  -- convert pointers back
  for _, view in pairs(views or {}) do
    view.windowOpen = im.BoolPtr(view.windowOpen or false)

  for i, view in pairs(views or {}) do
    if view.windowOpen[0] then
  local numberOfOpenWindows = 0
  for i, view in pairs(views) do
    if view.windowOpen[0] then
    -- do not render anything
    for _, view in pairs(views or {}) do
      if view and view.runtime and view.runtime.rv then
local function onExtensionUnloaded()
  for _, view in pairs(views or {}) do
    if view and view.runtime and view.runtime.rv then
@/lua/ge/extensions/flowgraph/nodes/ui/monologue.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['message_'..i] then
@/lua/ge/extensions/editor/flowgraph/properties.lua
  local allowList = {}
  for k, v in pairs(types) do if v then table.insert(allowList, k) end end
  table.sort(allowList)
            if im.BeginCombo("##pinType" .. pin.id, pin.type) then
              for typename, type in pairs(ui_flowgraph_editor.getTypes()) do
                if item.allowedManualPinTypes == nil or item.allowedManualPinTypes[typename] then
                    -- Check if the link should be deleted now
                    for k, link in pairs(item.graph.links) do
                      if link.targetPin == pin then
                if im.BeginCombo("##pinType" .. pin.id, hcPin.hardCodeType) then
                  for _, typename in pairs(allowedTypes) do
                    self.mgr:DrawTypeIcon(typename, true, 1)
            if im.BeginCombo("##pinType" .. pin.id, pin.type) then
              for typename, type in pairs(ui_flowgraph_editor.getTypes()) do
                if item.allowedManualPinTypes == nil or item.allowedManualPinTypes[typename] then
                    -- Check if the link should be deleted now
                    for k, link in pairs(item.graph.links) do
                      if link.sourcePin == pin then
    local colWidth = 10
    for pid, pin in pairs(item.pinList) do
      if pin.direction == 'in' then

    for pid, pin in pairs(item.pinList) do
      if pin.direction == 'in' then
                if im.BeginCombo("##pinType" .. pin.id, hcPin.hardCodeType) then
                  for _, typename in pairs(allowedTypes) do
                    self.mgr:DrawTypeIcon(typename, true, 1)
    local colWidth = 10
    for pid, pin in pairs(item.pinList) do
      if pin.direction == 'out' then
    im.SetColumnWidth(0, colWidth)
    for pid, pin in pairs(item.pinList) do
      if pin.direction == 'out' then
  -- if im.Begin('Properties', self.windowOpen) then
    for n,_ in pairs(self.mgr.selectedNodes) do
      local node = self.mgr.graph.nodes[n]
function C:showAvailableMacroTags()
  for i,k in pairs(self.mgr.macroTags) do
    local textinput = im.ArrayChar(256, tostring(k or ''))
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdown.lua
  -- set out pins according to flags and reset flags
  for pName, val in pairs(self.flags) do
    self.pinOut[pName].value = val
@/lua/ge/extensions/statistics/statistics.lua

  for _, instance in pairs(statEntry.instances) do
    local vehicle = nil

  for dataKey,data in pairs(vehicleTable) do
    local entry = {}
    if data.instances then
      for _,instance in pairs(data.instances) do
        if instance.maxPoints and instance.maxPoints  ~= 0 then
  local totalMaxPoints = 0
  for _, entryName in pairs(statsOrder) do
    local data = scenarioStats[entryName]

       for k,v in pairs(statData) do
          if not tableFindKey(ignoreInstanceFields, k) then
    local goalVehicles = scenario_scenarios.getScenario().goals.vehicles or {}
    for _, goal in pairs(goalVehicles) do
      if goal.id ~= 'wayPointAction' then

  for _, vehicleName in pairs(vehicles) do
    if not map.objectNames[vehicleName] or not map.objects[map.objectNames[vehicleName]] then

  for _,instance in pairs(statData.instances) do
    if statData.enabled then
  local totalMaxPoints = 0
  for key, statsData in pairs(vehicleTable) do
    local statPoints = calculateStatPoints(key, statsData)
    end
    for _, instance in pairs(statsData.instances) do
      if instance.maxPoints and instance.maxPoints > 0 then
local function stopStatsGathering(scenario)
  for vehicleID, vehicleTable in pairs(statsTable) do
    local data = vehicleTable[getStatKey('distance')]
        -- 1 mile = 1609.34 meters
      for _,instance in pairs(data.instances) do
        value = value + (instance.value or 0)
    if data and data.enabled then
     for _,instance in pairs(data.instances) do
        value = value + (instance.value or 0)
  if damageData and damageData.enabled then
    for _,instance in pairs(damageData.instances) do
      if instance.source then
  if scenario.state == 'post' then
    for vehicleID, vehicleTable in pairs(statsTable) do
      captureFinalDamageData(vehicleTable[getStatKey('damage')])

  for vehicleID, vehicleTable in pairs(statsTable) do
    local data = vehicleTable[getStatKey('distance')]
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        local vehicle = nil
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        local vehicle = nil
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        local vehicleData = nil
local function onRaceInit()
  for vehicleID, vehicleTable in pairs(statsTable) do
    local data = vehicleTable[getStatKey('distance')]
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        local vehicle = nil
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        local vehicle = nil
local function captureTimeData(time)
 for vehicleID, vehicleTable in pairs(statsTable) do
    local data = vehicleTable[getStatKey('time')]
    if data and data.enabled then
      for _,instance in pairs(data.instances) do
        instance.value = time
@/lua/common/quadtree.lua
  local tree = self.tree
  for i, node in pairs(tree) do
    local itemCount = node.itemCount
  local occupiedNodes, itemCount = 0, 0
  for _, v in pairs(self.tree) do occupiedNodes, itemCount = occupiedNodes + 1, itemCount + v.itemCount end
@/lua/common/jbeam/interaction.lua
    tableMerge(actionCategories, j.actionCategories or {})
    for k,action in pairs(j.actions or {}) do
      action.source = filename
@/lua/ge/extensions/core/online.lua
  local requests_pub = {}
  for id, r in pairs(requests) do
    requests_pub[id] = r.pub
  local data2display = {}
  for _, data in pairs(storedMessages) do
    if data.uid and hidden_ids[data.uid] then

  for _, cmd in pairs(data.cmds) do
    if cmd.type == 'message' then
@/gameplay/missionTypes/scatterPickup/customNodes/scatterPrefabSetupNode.lua
  self.mgr.scatterPickup.states = {}
  for type, points in pairs(self.mgr.scatterPickup.pointsByType) do
    local list = generateList(#points, shapes[type])
@/lua/ge/extensions/gameplay/drag/dragTypes/dragPracticeRace.lua
  if dragData.racers then
    for _, racer in pairs(dragData.racers) do
      table.insert(dials, {vehId = racer.vehId, dial = 0})
    local hasDisqualifiedRacer = false
    for vehId, racer in pairs(dragData.racers) do
      if racer.isDesqualified then

    for vehId, racer in pairs(dragData.racers) do
      if racer.isFinished then
@/lua/vehicle/extensions/gameplayInterfaceModules/interactEnergyStorage.lua
  local result = {}
  for name, storage in pairs(storages) do
    table.insert(result, {
@/lua/ge/extensions/gameplay/race/path.lua
  config.closed = false
  for i, seg in pairs(self.segments.objects) do
    if seg:isValid() then
  -- for every segment, follow the graph backwards and "color" all segments
  for _, elem in pairs(config.graph) do
    local tn = self.pathnodes.objects[elem.targetNode]
  -- now do a similar thing to get the overNextVisibleNodes,
  for _, elem in pairs(config.graph) do
    for _, nvs in ipairs(elem.nextVisibleSegments) do
  config.segmentToPacenotes = {}
  for id, seg in pairs(self.segments.objects) do
    config.segmentToPacenotes[id] = {}
  end
  for _, s in pairs(self.segments.objects) do
    s.from, s.to = s.to, s.from
    -- add automatic prefabs only if they exist
    for list, suf in pairs(autoPrefabs) do
      for _, ext in ipairs(prefabExt) do
@/lua/ge/extensions/flowgraph/nodes/ui/startScreen.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/ge/extensions/editor/gen/mesh.lua
		end
	for _,b in pairs(base) do
		auv[#auv+1] = {u = (b-ref):dot(u), v = (b-ref):dot(v)}
	if not auv then auv = {} end
--    for _,b in pairs(base) do
	for i=istart,istart+#base-1 do
  local poly = {}
  for i,b in pairs(base) do
    poly[#poly+1] = b
      -- append all
      for _,uv in pairs(tuv) do
        auv[#auv+1] = uv
--	if isnan(an) then
		for i,v in pairs(an) do
		--        lo('?? z3_n:'..i..':'..tostring(v))
	local auv = auv ~= nil and auv or {}
	for i,y in pairs(ay) do
		local row = {}
		local row = {}
		for j,x in pairs(ax) do
			auv[#auv + 1] = {u = u1 + (u2 - u1)*x/X, v = v1 + (v2 - v1)*(Y - y)/Y}
	auv = auv ~= nil and auv or {}
	for i,y in pairs(ay) do
		for j,x in pairs(ax) do
	for i,y in pairs(ay) do
		for j,x in pairs(ax) do
			av[#av + 1] = u*x + v*y

	for i,y in pairs(ay) do
		for j,x in pairs(ax) do
	for i,y in pairs(ay) do
		for j,x in pairs(ax) do
			av[#av + 1] = u*x/X + v*y/Y
	if node.kids ~= nil then
		for _,kid in pairs(node.kids) do
			if kid.name == 'geometry' then
					lo('?______ for_aint:'..#kid.kids..':'..tostring(kid.attr.count))
				for _,k in pairs(kid.kids) do
--                        lo('?? skid:'..k.name)
	if node.kids ~= nil then
		for _,kid in pairs(node.kids) do
			if kid.name == 'geometry' then
					local str = ''
					for _,v in pairs(list) do
						if step == 3 then
					lo('?______ for_aint:'..#kid.kids)
				for _,k in pairs(kid.kids) do
--                        lo('?? skid:'..k.name)
						local str = ''
						for o,f in pairs(ageom[cgeom].faces) do
							str = str..f.v..' '..f.n..' '..f.u..' '
	if node.kids ~= nil then
		for _,kid in pairs(node.kids) do
			if kid.name == 'float_array' then
		local nmatch,akid = 0,{}
		for _,kid in pairs(node.kids) do
--				U.dump(path, '?? for_PATH:'..lvl)
--		lo('?? if_VEC:'..tostring(isvec))
	for _,d in pairs(ad) do
		if isvec then
		else
			for k,v in pairs(d) do
				s = s..v..' '
	local af = {}
	for _,f in pairs(m.faces) do
		af[#af+1] = {f.v, f.n, f.u}
		local auv = {}
		for _,uv in pairs(m.uvs) do
			auv[#auv+1] = {uv.u, uv.v}
	local out = {}
	for i,b in pairs(aobeam) do
--	for i,b in pairs(data.beams) do
	for i,b in pairs(aobeam) do
--	for i,b in pairs(data.beams) do
		if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
--		U.dump(dbeam,'?? m.dbeam:',nil,1)
	for part,set in pairs(dbeam) do
--			if part == 'pickup_axle_R' then
		local madam = -math.huge
		for i,b in pairs(set) do
			if b.deform and b.deform > madef then
		-- normalize dynamic vals
		for i,b in pairs(set) do
--                if #U.index({'rb8r_rb8rr','b3ll_rf1l'},b.stamp) > 0 then
	local av,auv = {},{}
	for i,n in pairs(data.nodes) do
		av[#av+1] = n.pos
--		U.dump(abag, '?? aBAG:')
	for i,b in pairs(abag) do
	local mi,ma = math.huge,-math.huge
	for i,f in pairs(data.triangles) do
		if f.id1
--[[
		for j,b in pairs(abag) do
			if b[f.id1] then
		auv = {{u=0,v=0},{u=1,v=0},{u=0,v=1}}
	for i,t in pairs(data.triangles) do
		an[#an+1] = -(av[t.id1]-av[t.id2]):cross(av[t.id1]-av[t.id3]):normalized()
--		local po = {}
	for i,b in pairs(data.beams) do
		if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
local alpha = 0.1
for i,c in pairs(abin) do
	c[#c+1] = alpha
	local dgeo = {}
	for i,m in pairs(am) do
		local c = U.mod(i,abin)
--[[
	for i,b in pairs(abin) do
		local mat = abin[i]
	if ndmat then
		for i,k in pairs(ndmat.kids) do
	--			lo('?? if_MAT:'..i..':'..tostring(k.name))
--		local k = ndgeo.kids[i]
	for i,k in pairs(ndgeo.kids) do
--			print('?? for_i:'..i)
			dgeo[k.attr['id']] = {}
			for j,m in pairs(am) do
				local c = U.mod(#amat,abin)
			local area,nface = 0,0
			for i,g in pairs(dgeo[s]) do
				area = area + g.m.area
	if nd.kids then
		for i,k in pairs(nd.kids) do
			if k.name == name then
	local refnode = forNode(nd, {'mesh','vertices'})
	for i,k in pairs(refnode.kids) do
--			lo('?? for_k:'..k.name)
	local ndtri = atri[1]
	for i,k in pairs(ndtri.kids) do
		if k.name == 'input' then
	local av,an,auv,af = {},{},{},{}
	for i,k in pairs(ndmesh.kids) do
		if k.name == 'source' then
	local stride = 0
	for i,k in pairs(ndtri.kids) do
		if k.name == 'input' then
	local zma = -math.huge
	for i,t in pairs(atri) do
--			lo('??*************** for_TR:'..t.attr.material)
		end
		for j,v in pairs(av) do
			if v.z > zma then
			U.dump(dmat, '?? geoFrom_mat:'..tostring(t.attr.material))
		for k,v in pairs(dmat) do
			if string.find(k,tostring(t.attr.material),1,true) == 1 then
--		lo('?? if_v:'..v:getClassName())
--	for k,val in pairs(v) do
--		lo('?? for_v:'..val)
--		if true then return end
	for i,m in pairs(am) do
--				U.dump(m, '?? for_m:'..m.material)

--	for i,s in pairs(amat) do
--		local ndmat = M.toNode(matlib, 'material', {id='idmat_'..i, name='WarningMaterial'})
	local ndlod = M.toNode(kid, 'node', {id='idlod_'..alod[1], name='nm_L'..alod[1], type='NODE'})
	for j,gid in pairs(agid) do
		kid = M.toNode(ndlod, 'instance_geometry', {url='#'..agid[j]})
		kid = M.toNode(kid, 'technique_common', {})
		for i,s in pairs(amat) do
			M.toNode(kid, 'instance_material', {target='#idmat_'..i, symbol='idmat_'..i})
	local an,av,af,auv = {},{},{},{}
	for i,n in pairs(m.an) do
		vec2buf(n, an)
	end
	for i,v in pairs(m.av) do
		vec2buf(v, av)
		local f = m.af[i]
--	for i,f in pairs(m.af) do
		af[#af+1] = f.v
	local uvo,scalex,scaley = {0.2,0.0}
	for ii,f in pairs(dlod.afloor) do
--		hc = forHeight(dlod.afloor, ii)/H
--							lo('?? for_HEIGHT:'..ii..':'..hp..':'..hc)
		for j,w in pairs(f.awall) do
--								lo('?? for_V:'..ii..':'..j..':'..tostring(w.pos))
	local H = 0
	for _,f in pairs(desc.afloor) do
		H = H + f.h
	if not obj then obj = {} end
	for key,val in pairs(obj) do
		kid.attr[#kid.attr+1] = {name=key, value=val}
	if not nd then return end
	for key,val in pairs(obj) do
		if not nd.attr then nd.attr = {} end
		local match
		for i,a in pairs(nd.attr) do
			if a.name == key then
	if node.kids ~= nil then
		for _,kid in pairs(node.kids) do
		if kid.name == prop and not val then
--[[
		for _,k in pairs(kid.kids) do
--                    lo('?? skid:'..k.name)
--		lo('?? if_mat:'..tostring(scenetree.findObject(nm))..':'..mat:getField("translucentBlendOp", 0))
--	for t,c in pairs({orange='1 0.5 0 1', green='0 1 0 1', blue='0 0 1 1',yellow='1 1 0 1'}) do
--	end
	if node.kids ~= nil then
		for _,kid in pairs(node.kids) do
      print('?? for_kid:'.._)
]]
  for _,s in pairs({'library_images', 'library_materials', 'library_effects'}) do
    kidsList(node, 1, s) --, nil, nil, true)
	local dmi,imi = math.huge
	for k,m in pairs(am) do
		local av = m.verts
	local ngeo = 0
	for key,g in pairs(afloat) do
		ngeo = ngeo + 1

		for i,list in pairs(aint[key]) do
			lo('?? FOF:'..i..':'..key..':'..ngeo..':'..(#list/step))
	local amesh = {}
	for ord,m in pairs(tmesh.data) do
		amesh[#amesh + 1] = m
	local avi,ani,auvi = {},{},{}
	for ord,m in pairs(tmesh.sel) do
		for _,f in pairs(m.faces) do
	for ord,m in pairs(tmesh.sel) do
		for _,f in pairs(m.faces) do
			if #U.index(avi, f.v) == 0 then
	local m = tmesh.sel[1]
	for o,i in pairs(avi) do
		dvi[i] = o
--            lo('?? vrts:'..tostring(verts[1])..':'..tostring(m.verts[dvi[avi[1]]]))
	for o,i in pairs(ani) do
		dni[i] = o
	end
	for o,i in pairs(auvi) do
		duvi[i] = o
	local afaces = {}
	for ord,m in pairs(tmesh.sel) do
		afaces[ord] = {}
		afaces[ord] = {}
		for _,f in pairs(m.faces) do
--                    U.dump(f, '?? for_f:'.._..':'..tostring(dvi[f.v])..':'..tostring(dni[f.n])..':'..tostring(duvi[f.u]))
	if mat == nil and list ~= nil then mat = 'WarningMaterial' end
	for ord,m in pairs(fr) do
		if mode ~= -1 and to[ord] == nil then
			else
				for _,f in pairs(fr[ord].faces) do
					to[ord].faces[#to[ord].faces + 1] = f
		elseif list[ord] ~= nil then
			for _,i in pairs(list[ord]) do
				if mode ~= -1 then
	out.avedit = {}
	for ord,m in pairs(mdata) do
		for _,f in pairs(m.faces) do
	for ord,m in pairs(mdata) do
		for _,f in pairs(m.faces) do
			out.avedit[#out.avedit + 1] = m.verts[f.v + 1]
	local mi,imi = math.huge,0
	for ord,m in pairs(adata) do
		local av = m.verts
	local dmi,imi = math.huge
	for ord,m in pairs(fr) do
		local av = m.verts
	local center,n = vec3(0,0,0),0
	for _,f in pairs(tri) do
		path[#path + 1] = sto[triord].verts[f.v+1]
	local tri,triord = {}
	for ord,m in pairs(fr) do
		local av = m.verts
		to[ord].faces = {}
		for _,f in pairs(to[ord].ref) do
			to[ord].faces[#to[ord].faces + 1] = f
	local center,n = vec3(0,0,0),0
	for _,f in pairs(tri) do
		center = center + sto[triord].verts[f.v+1]
	local tri,triord = {}
	for ord,m in pairs(fr) do
		local av = m.verts
			lo('?? INV:')
			for _,t in pairs(mto.ref) do
				local d, bx, by = intersectsRay_Triangle(
		to[ord].faces = {}
		for key,list in pairs(to[ord].ref) do
			for _,f in pairs(list) do
		for key,list in pairs(to[ord].ref) do
			for _,f in pairs(list) do
				to[ord].faces[#to[ord].faces + 1] = f
	local center,n = vec3(0,0,0),0
	for _,f in pairs(tri) do
		center = center + sto[triord].verts[f.v+1]
	local tri,triord = {}
	for ord,m in pairs(fr) do
		local av = m.verts
	local center,n = vec3(0,0,0),0
	for _,f in pairs(tri) do
		center = center + sto[triord].verts[f.v+1]
--[[
	for _,m in pairs(sto) do
--        for i = 1,3 do
--            local f = m.faces[i]
		for i,f in pairs(m.faces) do
			center = center + m.verts[f.v+1]
	-- loops to edges
	for j,loop in pairs(aloop) do
	-- cut off intersections with holes
	for i,e in pairs(ae) do
		for j,loop in pairs(aloop) do
	for i,e in pairs(ae) do
		for j,loop in pairs(aloop) do
--		U.dump(aloop, '?? fP_ALOOP:')
	for i,l in pairs(aloop) do
		local nvert = #av
--				U.dump(l,'?? inloop:'..i)
		for j,p in pairs(l) do
--					lo('?? for_loop:'..i..':'..j..':'..tostring(l[j]))
	local apath = {}
	for i,l in pairs(aloop) do
		for j,p in pairs(l) do
	for i,l in pairs(aloop) do
		for j,p in pairs(l) do
			edgeUp(nvert+j, nvert+U.mod(j+1,#l), 1)
	local mi,ma,pmi,pma = math.huge,-math.huge
	for j,p in pairs(aloop[1]) do
		local proj = (p-ref):dot(u)
	local s = 0
--	for i,d in pairs(astep) do
	for i=1,#astep-1 do
--	for s = step,w-step+0.1,step do
-- for i,s in pairs(astep) do
--		aline[#aline+1] = {pmi+u*s,pmi+u*s+dir}
	local np = 0
	for i,l in pairs(aloop) do
		for j,p in pairs(l) do
	for i,l in pairs(aloop) do
		for j,p in pairs(l) do
			l[j] = {pos=p, ind=np+j}
	--						lo('?? for_LK:'..a..':'..b..':'..tostring(l)..':'..tostring(k))
	--			for a,l in pairs(aloop[i]) do
	--				for b,k in pairs(aloop[j]) do
	--			for a,l in pairs(aloop[i]) do
	--				for b,k in pairs(aloop[j]) do
	--						U.dump(l, '?? for_a:'..a)
					local ifrto,jfrto = {},{}
					for a,p in pairs(aloop[i]) do
						if p.ind == frtoa[1] then
					end
					for a,p in pairs(aloop[j]) do
						if p.ind == frtob[1] then
--	av = {}
	for _,v in pairs(av) do
		v.skip = true
	end
	for _,l in pairs(aloop) do
--		local nvert = #av
--		local nvert = #av
		for _,p in pairs(l) do
--				lo('?? vert_RESET:'..p.ind)
	av = {}
	for _,l in pairs(aloop) do
--		local nvert = #av
--		local nvert = #av
		for _,p in pairs(l) do
			av[p.ind] = {pos=p.pos, star={}}
	apath = {}
	for i,l in pairs(aloop) do
			apath[#apath+1] = deepcopy(l)
			apath[#apath] = U.map(apath[#apath], 'pos')
		for j,p in pairs(l) do
			edgeUp(p.ind, U.mod(j+1,l).ind, 1)
		local l = aline[i]
--`	for _,l in pairs(aline) do
		local across = {}
		local across = {}
		for stamp,_ in pairs(de) do
			local seg = U.split(stamp, '_')
				local apt = {{pfr[2],pto[1]},{pto[2],pfr[1]}}
				for _,aind in pairs(apt) do
					pfr,pto = aind[1],aind[2]
		local ami,imi = math.huge
		for ind,_ in pairs(b.star) do
			if ind ~= e[1] then
		done = true
		for k,e in pairs(de) do
--				lo('?? for_LOOPS:'..N..':'..tostring(e))
				local dle = {}
				for j,ind in pairs(ai) do
					local stmp = U.stamp({ind,U.mod(j+1,ai)},true)
				local askip = {}
				for _,d in pairs(aconc) do
--						if nloop == 3 then
							local dmi1,dmi2 = math.huge,math.huge
							for k,_ in pairs(dle) do
								local ift = U.split(k,'_')
								-- check if hit conq
								for ic,dc in pairs(aconc) do
									if dc[2] == ind then

								for _,s in pairs(anew) do
									dle[s] = de[s] --true
					cdone = true
					for stamp,_ in pairs(dle) do
						if dle[stamp] == 2 then
--	end)
	for i,p in pairs(sav) do
		if not av[i] then
	end
	for i,p in pairs(av) do
		avert[i] = p.pos + vec3(0,0,0.1)
	local anorm = {}
	for i,l in pairs(acloop) do
		local pth,map = U.polyStraighten(U.map(l,function(k,v)
					if false then
						for j,ind in pairs(ai) do
							if ind ~= d[1] and ind ~= d[2] then
					else
						for i,ind in pairs(ai) do
							local stamp = U.stamp({ind, U.mod(i+1,ai)}, true)
	local astick = {} -- vertices which lie on boundary
	for i,b in pairs(base) do
		av[#av+1] = {p=b,star={}}
	local aestamp = {}
	for _,l in pairs(aloop) do
--[[
    local pth = {}
    for _,iv in pairs(l) do
      pth[#pth+1] = av[iv].p
    local iseq = {}
    for j,v in pairs(pth) do
      iseq[#iseq+1] = p[map[j] ]
		local p = {}
		for i,b in pairs(l) do
			av[#av+1] = {p=b,star={}}
		local iseq = {}
		for j,v in pairs(pth) do
			iseq[#iseq+1] = p[map[j]]
	local function crossBoundary(loop, k)
		for i,ie in pairs(aebound) do
--                lo('?? onBound:'..)
		if not p then return end
		for i,ie in pairs(aebound) do
--				U.dump(ae[ie],'?? onBoundary:'..i..':'..ie)
	local start = #base
	for i,loop in pairs(aloop) do
--			U.dump(loop, '?? for_loop:'..i) --..':'..#loop..':'..tableSize(loop))
						local idupe -- = start+U.mod(#loop-k+1,#loop)
						for ii,e in pairs(ae) do
							if dstamp == U.stamp(e) then
--[[
	for i,e in pairs(ae) do
		aline[#aline+1] = {av[e[1] ].p,av[e[2] ].p}

	for i,v in pairs(av) do
		if U.index(astick,i)[1] then goto continue end
		local dmi,pmi,emi,smi=math.huge
--		for iv,_ in pairs(v.star) do
--	        U.dump(forSprouts(v),'?? if_V:'..i)
--			end
		for iv,_ in pairs(asprout) do
			for k,e in pairs(ae) do
		for iv,_ in pairs(asprout) do
			for k,e in pairs(ae) do
--					if i == 12 then
  local aeo = {} -- oriented edges
  for i,e in pairs(ae) do
    table.sort(e)
    local pth = {}
    for _,iv in pairs(p) do
      pth[#pth+1] = av[iv].p
    local iseq = {}
    for j,v in pairs(pth) do
      iseq[#iseq+1] = p[map[j]]
    -- go over star for maximal left turn angle
    for c,d in pairs(av[b].star) do
      if c ~= a then
        local nia = 0
  for ia,s in pairs(aeo) do
	nia = nia + 1
--		U.dump(s, '?? for_S:'..ia)
    for ib,d in pairs(s) do
--        lo('??______________________________ in_STAR:'..ia..'>'..ib)
            apath[#apath+1] = path -- U.polyStraighten(path)
            for k,ib in pairs(path) do
              local a,b = ib,U.mod(k+1,path)
  local avert,af,auv = {},{},{}
  for i,v in pairs(av) do
    avert[#avert+1] = v.p + vec3(0,0,0.01)
--      U.dump(base,'??_____________ rcPave:'..tostring(an[1]))
  for i,p in pairs(apath) do
    --- straighten path
    local pth = {}
    for _,iv in pairs(p) do
      pth[#pth+1] = av[iv].p
    local iseq = {}
    for j,v in pairs(pth) do
--      avert[#avert+1] = v
	aline = {}
	for i,e in pairs(ae) do
		aline[#aline+1] = {av[e[1]].p,av[e[2]].p}
  local ne = tableSize(ae)
  for i,e in pairs(ae) do
--    lo('?? ff:'..i)
--                    edgeDown(ie)
					for j,ie in pairs(iecheck) do
--                            U.dump(ae[ie], '?? for_edge:'..j..':'..ie..':'..#ae)
	local irc
	for i,loop in pairs(aloop) do
		local isout
			local b = U.mod(k,loop)
--        for k,b in pairs(loop) do
			if not U.inRC(b, {rc}) then
	-- initial objects linking
	for i,loop in pairs(aeref) do
--            nvert = nvert + #loop
	end
	for i,l in pairs(aloopstick) do
			local c,d
			for i,e in pairs(ae) do
--                isend = false
					lo('??______________________________________ is_3_5:')
					for i,_ in pairs(estamp) do
						lo('?? if_STAMP:'..i..':'.._)
		local ama,ima = -math.huge
		for _,iv in pairs(astar) do
			local u = (v4e[iv[1].ind].p - v4e[n2].p):normalized()
		local rc = {}
		for i,list in pairs(e4v) do
--                U.dump(list, '??___________________ for_edge:'..i)
				local pth = {}
				for _,p in pairs(rc) do
					pth[#pth+1] = v4e[p].p
--[[
		for _,rc in pairs(arc) do
			local pth = {}
			local pth = {}
			for _,p in pairs(rc) do
				pth[#pth+1] = v4e[p].p
	local morig,mscale = mrc[1],mrc[2] --{0,0},{1,1}
	for _,n in pairs(v4e) do
		av[#av+1] = n.p
--        table.remove(arc, 10)
	for i,a in pairs(arc) do
		local stamp = U.stamp(deepcopy(a))
		if istest then U.dump(auv, '?? AF:'..#af..':'..#auv) end
	for i,uv in pairs(auv) do
		auv[i].v = -auv[i].v
	end
	for i,f in pairs(af) do
--        f.u = (f.u - istart + 1) % #auv -- U.mod(f.u+1 + istart,#auv)
	local amdel = {}
	for i,m in pairs(am) do
--            U.dump(m, '?? for_m:'.._)
		local afdel = {}
		for _,f in pairs(m.faces) do
			if not f.u or not f.v or not f.n then
		end
		for j,d in pairs(m.uvs) do
			if not d.u or not d.v then
	local afpos = {}
	for i,s in pairs(ahole) do
--			lo('??====== for_HOLE:'..i..':'..s.p.x..'/'..csstep)
				local loop = {}
				for _,p in pairs(s.list) do
--								lo('?? in_LOOP:'.._..':'..tostring(p)..':'..j..':'..istep)
--	}
	for i,l in pairs(awloop) do
--				if i > 5 then break end
	local av,d = {}
	for i,v in pairs(mbody.verts) do
		d = (v-pmi).x
	local isvalid = true
	for i,v in pairs(av) do
--			lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
--		U.dump(anorm, '?? v_vs_n:'..#mbody.verts..':'..#anorm)
	for i,f in pairs(mbody.faces) do
		f.n = f.v
--	local invalid
	for i,l in pairs(aseq) do
		local loop = U.map(l, function(k,v)
	local aface,av = {},m.verts
	for i,f in pairs(m.faces) do
		aface[#aface+1] = {v=f.v+1,u=f.u+1,n=f.n+1,ae={}}
	local function vnext(iv)
		for i,iu in pairs(astar[iv]) do
			if not U.index(acand,iu)[1] then
		hit = false
		for i,lst in pairs(astar) do
			if #lst>0 then
					-- clean stars
					for j,u in pairs(astar[cv]) do
						U.pop(astar[u],cv)
--		U.dump(abag, '?? aBAG:'..N)
--	for i,bag in pairs(abag) do
--	end
	for i=1,#aface,3 do
		for s,d in pairs(abag) do
			if U.index(d, aface[i].v)[1] then
	local bag4surf = {}
	for i,f in pairs(m.faces) do
		aface[#aface+1] = {v=f.v+1,u=f.u+1,n=f.n+1,ae={}}
	local w4v,avert = {},{}
	for i,v in pairs(m.verts) do
		local s = U.v2stamp(v, 1)
	local function vnext(iv)
		for i,iu in pairs(astar[iv]) do
			if not U.index(acand,iu)[1] then
		hit = false
		for i,lst in pairs(astar) do
			if #lst>0 then
					-- clean stars
					for j,u in pairs(astar[cv]) do
						U.pop(astar[u],cv)
--		U.dump(abag, '?? aBAG:'..N)
--	for i,bag in pairs(abag) do
--	end
	for i=1,#aface,3 do
		for s,d in pairs(abag) do
			if U.index(d, aface[i].v)[1] then
		local hit
		for j,ind in pairs(set) do
			for s,d in pairs(abag) do
		for j,ind in pairs(set) do
			for s,d in pairs(abag) do
				if U.index(d, ind)[1] then
		local n,cfi,ang = 0
		for _,e in pairs(face.ae) do
			if #dedge[e] == 1 then
					--- if has boundary
					for _,e in pairs(cf.ae) do
						if #dedge[e] == 1 then

	for i,b in pairs(fbag) do
--	for i=2,2 do
		dedge = {}
		for j,f in pairs(b) do
--			lo('?? in_BAG:'..i..':'..f)
			-- look for boundary face
			for k,af in pairs(dedge) do
	--				lo('?? if_BOUND:'..k)
						-- update adges
						for _,e in pairs(face.ae) do
							U.pop(dedge[e],f)
	if not b.af then return end
	for k,p in pairs(a.aiv) do
		local dmi,imi,fmi,d = math.huge
		-- pick b-face
		for _,f in pairs(b.af) do
--						lo('?? for_AB:'..k..'>'.._..':'..tostring(p)..':'..tostring(f.p)..':'..tostring(f.vn))
		local list = {}
	for i,b in pairs(fbag) do
		b.af = U.map(b.list,function(k,v)
			-- pick a-vertex
			for k,p in pairs(a.av) do
				local dmi,imi,fmi,d = math.huge
				-- pick b-face
				for _,f in pairs(b.af) do
--						lo('?? for_AB:'..tostring(p)..':'..tostring(f.p)..':'..tostring(f.vn))
--	local am = {}
	for i,m in pairs(am) do
		local ds = nm == 1 and sma or sma*(i-(nm - 1)/2-1)
	if M.out.agraph then
		for _,g in pairs(M.out.agraph) do
			Render.graph(g.list, g.c, g.w)
--	if true then return end
	for _,s in pairs(M.out.aset) do
			lo('?? to_SET:')
	end
	for _,o in pairs(M.out.atext) do
		Render.label(o.list, o.c)
@/lua/ge/extensions/freeroam/vueBigMap.lua

    for key, val in pairs(gameplay_missions_progress.formatSaveDataForBigmap(mission.id) or {}) do
      ret[key] = val

  for groupKey, gr in pairs(groupData) do
    gr.elements = {}

      for tag, include in pairs(filterData.groupTags) do
        if include then
  -- Sort elements in each group
  for key, gr in pairs(groupData) do
    local elementsAsPois = {}
@/lua/ge/extensions/freeroam/freeroamConfigurator.lua
  local buttons = {}
  for _, buttonInfo in pairs(buttonsInfos) do
    table.insert(buttons, buttonInfo)
@/lua/ge/extensions/ui/liveryEditor/tools.lua
  dump("liveryEditor_editMode_onStateChanged", data)
  for k, v in pairs(data) do
    M.editModeState[k] = v
@/lua/ge/extensions/editor/missionEditor/objectives.lua
  if next(self.missionInstance.sortedStarKeys or {}) then
    for key, act in pairs(m.careerSetup.starsActive) do
      starSet = starSet or act
      -- check rewards being 0
      for key, rewards in pairs(m.careerSetup.starRewards) do
        for _, re in ipairs(rewards) do
  local sums = {all = {}, defaultOnly = {}, bonusOnly = {}}
  for key, rewards in pairs(self.mission.careerSetup.starRewards) do
    for _, re in ipairs(rewards) do
@/lua/ge/extensions/core/environment.lua
  local knownProblems = {hydrodnamicFriction='hydrodynamicFriction', flowBehaviourIndex='flowBehaviorIndex'}
  for j, _ in pairs(v) do
    if knownProblems[j] then
  local newGms = {}
  for k, v in pairs(gms) do
    if string.len(k) > 31 then
  local sortedGmNames = {}
  for k, v in pairs(gms) do
    if k ~= 'ASPHALT' then
    -- filter paths to only return filename without extension
    for _,fn in pairs(files) do
      tableMerge(allGroundModels, loadGroundModelFile(fn));
local function onFilesChanged(files)
  for _,v in pairs(files) do
    local filename = v.filename
      filename = string.upper(filename)
      for _, f in pairs(M.loadedGroundModelFiles) do
        if string.upper(f) == filename then
local function onClientEndMission()
  for k,v in pairs(myTexture) do
    myTexture[k] = nil
@/lua/vehicle/extensions/vehicleeditor/nodes.lua
  local min = math.huge
  for _,node in pairs(nodesTbl) do
    totalWeight = totalWeight + obj:getNodeMass(node.cid)
@/lua/ge/extensions/editor/flowgraph/search.lua
  local displayIds = editor.getPreference("flowgraph.debug.displayIds")
  for _, graph in pairs(self.mgr.graphs) do
    if graph.type == 'graph' then
@/lua/vehicle/controller/airplaneSurfaces.lua

  for k, v in pairs(trimming) do
    if abs(v - lastTrimValues[k]) > 0.005 then
@/lua/ge/extensions/editor/roadSpline/import.lua
      if entry.fields then
        for k, v in pairs(entry.fields) do
          obj:setField(k, 0, v)
  local decalRoadsInPolygon, ctr = {}, 1
  for _, name in pairs(scenetree.findClassObjects("DecalRoad")) do
    local obj = scenetree.findObject(name)
@/lua/ge/extensions/career/modules/vehicleDeletionService.lua
local function onUpdate()
  for vehId, data in pairs(flaggedVehicles) do
    local obj = getObjectByID(vehId)
local function deleteFlaggedVehicles()
  for vehId, _ in pairs(flaggedVehicles) do
    deleteVehicle(vehId)
@/lua/ge/extensions/ui/gameplaySelector/tileSorting.lua
M.SORT_MODE_TO_UI = {}
for uiValue, sortMode in pairs(M.UI_TO_SORT_MODE) do
  M.SORT_MODE_TO_UI[sortMode] = uiValue
@/lua/ge/extensions/editor/shortcutLegend.lua
      if editor.editMode and not tableIsEmpty(currentActionNames) then
        for controlFlag, title in pairs(currentActionNames) do
          local control
          local control
          for modifierFlag, modifierName in pairs(modifierNames) do
            if type(controlFlag) == "number" then
        if editor.editMode and editor.editMode.auxShortcuts then
          for controlFlag, title in pairs(editor.editMode.auxShortcuts) do
            local control
            local control
            for modifierFlag, modifierName in pairs(modifierNames) do
              if type(controlFlag) == "number" then
@/lua/ge/extensions/editor/scriptAIManager.lua
              -- TODO: FIXME
              for _, vii in pairs(vehInfo[vehId]) do
                if vii and vii.scriptTime then
        local files = FS:findFiles(trackFilePath, '*' .. trackFileExt, -1, true, false)
        for _, filename in pairs(files) do
    if recordings[vehId] and displayDebugBoolPtr[vehId] and displayDebugBoolPtr[vehId][0]then
      for k, p in pairs(recordings[vehId].path) do
        dbgPt:set(p.x, p.y, p.z)
@/lua/vehicle/controller.lua
local function settingsChanged()
  for _, v in pairs(loadedControllers) do
    if v.settingsChanged then
  local controllers = {}
  for _, c in pairs(loadedControllers) do
    if c.typeName == typeName then
  local controllers = {}
  for _, v in pairs(loadedControllers) do
    if v.typeName:sub(1, #path) == path then
local function updateSimpleControlButtons()
  for _, v in pairs(loadedControllers) do
    if v.updateSimpleControlButtons then
  table.clear(sortedControllers)
  for _, v in pairs(loadedControllers) do
    table.insert(sortedControllers, v)
  table.clear(sortedControllers)
  for _, v in pairs(loadedControllers) do
    table.insert(sortedControllers, v)
  blacklistLookup = {}
  for _, v in pairs(blacklist) do
    blacklistLookup[v] = true
  local controllers = {}
  for _, v in pairs(jbeamControllers) do
    if v.fileName and not blacklistLookup[v.fileName] then
  local directory = "controller/"
  for k, c in pairs(controllers) do
    local filePath = directory .. c.fileName

  for _, v in pairs(loadedControllers) do
    table.insert(sortedControllers, v)

  --  for k,v in pairs(sortedControllers) do
  --    print(string.format("%s -> %d", v.name, v.order))

  for name, _ in pairs(controllerNameLookup) do
    controllerNameLookup[name] = {}
local function initSecondStage()
  for _, v in pairs(sortedControllers) do
    if v.initSecondStage then
local function initLastStage()
  for _, v in pairs(sortedControllers) do
    if v.initLastStage then
local function initSounds()
  for _, v in pairs(sortedControllers) do
    if v.initSounds then

  for _, v in pairs(sortedControllers) do
    if not v.reset then
local function resetSecondStage()
  for _, v in pairs(sortedControllers) do
    if v.reset then
local function resetLastStage()
  for _, v in pairs(sortedControllers) do
    if v.resetLastStage then
local function resetSounds()
  for _, v in pairs(sortedControllers) do
    if v.resetSounds then

  for name, controllerData in pairs(data) do
    if name and loadedControllers[name] and loadedControllers[name].deserialize then
@/lua/ge/extensions/editor/flowgraph/overview.lua
    local sortedNodeIds = {}
    for id, node in pairs(graph.nodes) do
      table.insert(sortedNodeIds, id)
function C:fillPassedGraphsArray()
  for id, graph in pairs(self.mgr.graphs) do
    -- Check if the graph passes the filter
    if not self.passedGraphIds[id] and editor.getPreference("flowgraph.debug.displayNodesInOverview") then
      for _, node in pairs(graph.nodes) do
        if node.nodeType ~= "macro/integrated" and im.ImGuiTextFilter_PassFilter(self.filter, node.name) then
  end
  for id, graph in pairs(self.mgr.macros) do
    -- Check if the graph passes the filter
    if not self.passedGraphIds[id] and editor.getPreference("flowgraph.debug.displayNodesInOverview") then
      for _, node in pairs(graph.nodes) do
        if node.nodeType ~= "macro/integrated" and im.ImGuiTextFilter_PassFilter(self.filter, node.name) then
    self.passedGraphIds = {}
    for id, graph in pairs(self.mgr.graphs) do
      if graph.parentId == nil then
    end
    for id, graph in pairs(self.mgr.macros) do
      if graph.parentId == nil then
        print("-- Graphs --")
        for id, gr in pairs(self.mgr.graphs) do
          gr:printStructure()
        print("-- Macros --")
        for id, gr in pairs(self.mgr.macros) do
          gr:printStructure()

        for _, macro in pairs(self.mgr.macros) do
          if macro.parent == nil then
@/lua/ge/extensions/editor/textEditor.lua
local function onEditorGui()
  for index, instance in pairs(guiInstancer.instances) do
    if instance.registerNameAsync then
  local removeList = {}
  for index, instance in pairs(guiInstancer.instances) do
    for _, objId in ipairs(objIds) do
local function onDeserialize(state)
  for index, instance in pairs(state) do
    newTextEditorInstance(instance.objIds, instance.fieldName)
  local instancesCopy = deepcopy(guiInstancer.instances)
  for key, instance in pairs(instancesCopy) do
    instance.textInput = nil
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalLine.lua
function C:work()
  for k, pin in pairs(self.pinInLocal) do
    if pin.type == 'color' then
@/lua/common/jbeam/expressionParser.lua
  }
  for k, v in pairs(math) do
    c[k] = v
@/lua/ge/extensions/flowgraph/nodes/ui/selectButtons.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
  end
  for _,pn in pairs(self.pinOut) do
    pn.value = false
@/lua/common/jbeam/sections/nodeBeam.lua

  for k, v in pairs(vehicle.nodes) do
    local x, y, z = jbeamUtils.getPosAfterNodeRotateOffsetMove(v, v.posX, v.posY, v.posZ)
  if not vehicle.hydros then return end
  for i, hydro in pairs(vehicle.hydros) do
    hydro.beamType = BEAM_HYDRO
  if not vehicle.ropes then return end
  for i, rope in pairs(vehicle.ropes) do
    rope.segments = rope.segments or 1
  local tbi = tableEndC(vehicle.triangles)
  for _, quad in pairs(vehicle.quads) do
    local tri1 = deepcopy(quad)
@/lua/ge/extensions/gameplay/drift/general.lua
local function commonReset()
  for extensionName, _ in pairs(loadedExtensions) do
    if extensionName ~= "gameplay_drift_general" and extensions.isExtensionLoaded(extensionName) and _G[extensionName].reset then
local function updateExtensions()
  for extensionName, data in pairs(variableExtensions) do
    if not data.manualLoad then

      for extensionName, extensionData in pairs(loadedExtensions) do
        if extensionData.loaded then
@/lua/ge/extensions/core/groundMarkerArrows.lua
  -- Look through proxies to find an unused arrow
  for id, proxy in pairs(arrowProxies) do
    if proxy.state == "unused" then
  -- Delete all arrow objects through their proxies
  for id, proxy in pairs(arrowProxies) do
    local arrow = scenetree.findObjectById(id)
    -- Reset all proxies to unused state
    for id, proxy in pairs(arrowProxies) do
      proxy.state = "unused"
        if nodeToNodeAngle <= 25 then
          for wpId, edgeInfo in pairs(map.getGraphpath().graph[path[i].wp]) do
            if path[i-1].wp ~= wpId then

  for id, proxy in pairs(arrowProxies) do
    if not usedWpIds[proxy.wp] then
  -- Update all arrow objects based on their proxies
  for id, proxy in pairs(arrowProxies) do
    if proxy.state == "unused" then
  --[[
  for wpId, wpLog in pairs(lastWpLog) do
    simpleDebugText3d(string.format("Wp %s: nodeToNodeAngle=%0.3f, %s, %s, links: %d, %0.1f", wpId, wpLog.nodeToNodeAngle or -1, wpLog.routeHasSmallestAngle and "smallest Angle" or "", wpLog.wp, wpLog.linkCount or -1, wpLog.distToVehicle or -1), wpLog.pos)

      for id, proxy in pairs(arrowProxies) do
        if proxy.state ~= "unused" then

      for id, proxy in pairs(arrowProxies) do
        if proxy.state == "unused" then
      -- Show wpToArrowId mappings
      for wp, arrowId in pairs(wpToArrowId) do
        im.TableNextColumn()
@/gameplay/missionTypes/evade/customNodes/getClosestTrafficNode.lua
    self.pos:setFromTable(self.pinIn.position.value)
    for k, v in pairs(gameplay_traffic.getTrafficData()) do
      if not role or role == v.role.name then
@/lua/ge/extensions/ui/vehicleSelector/general.lua
  if configList then
    for _, config in pairs(configList) do
      for _, propName in pairs(filtersWhiteList) do
    for _, config in pairs(configList) do
      for _, propName in pairs(filtersWhiteList) do
        local propVal = config[propName]
            end
            for value, active in pairs(propVal or {}) do
              if active then
  local filterUiData = {}
  for _, propName in pairs(filtersWhiteList) do
    if filterByProp[propName] then
      local matchesAny = false
      for value, active in pairs(propVal or {}) do
        if filter.currentFilterValues[value] then
    elseif filter.type == 'set' then
      for _, option in pairs(filter.options) do
        if propVal == option and not filter.currentFilterValues[option] then
  p:add("displayData")
  for modelName, _ in pairs(core_vehicles.getModelsData()) do
    table.insert(modelList, core_vehicles.getModel(modelName).model)
    table.insert(modelAndConfigList, core_vehicles.getModel(modelName).model)
    for _, config in pairs(core_vehicles.getModel(modelName).configs or {}) do
      table.insert(configList, config)
@/lua/ge/extensions/editor/trafficManager.lua
local function deleteVehicles()
  for id, data in pairs(session.vehicles) do
    if scenetree.objectExists(id) and not data.locked then
  local maxId = 0
  for id, _ in pairs(session.signalElements) do -- quick element id duplicate check (maybe do this after loading signals)
    if session._elementId == id then

  for id, data in pairs(session.vehicles) do
    if not data.locked then

  for id, data in pairs(session.vehicles) do
    if not data.locked then
  if editor.uiIconImageButton(editor.icons.refresh, imSizes.medium) then
    for id, data in pairs(session.vehicles) do
      if scenetree.objectExists(id) and not data.locked then
    if im.Selectable1("Unlock All Vehicles##trafficManagerAllVehicles") then
      for id, data in pairs(session.vehicles) do
        data.locked = false

  for _, data in pairs(session.vehicles) do
    local mapVehData = map.objects[data.id] -- ensures only drivable vehicles get stat updates

  for _, data in pairs(session.vehicles) do
    if vehId == data.id then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceEndScreen.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    table.insert(outPins, pn)
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    self.pinOut[nm].value = nm == action
    self:reset()
    for _,pn in pairs(self.pinOut) do
      pn.value = false
@/lua/ge/extensions/campaign/campaignsLoader.lua
  local files = FS:findFiles('/campaigns/', '*.json', 1, true, false)
  for k,filename in pairs(files) do
    local fileData = jsonReadFile(filename) or {}
  local campaignList = {}
  for _,campaignfile in pairs(campaignInfofiles) do
    local entry = loadCampaign(campaignfile)
  local campaigns = getList()
  for _,campaign in pairs(campaigns) do
    if campaign.meta.subsections then
    if campaign.meta.subsections then
      for subsectionKey,subsection in pairs(campaign.meta.subsections) do
        for locationKey,location in pairs(subsection.locations) do
      for subsectionKey,subsection in pairs(campaign.meta.subsections) do
        for locationKey,location in pairs(subsection.locations) do
           if isLocationForScenario(campaign, subsectionKey, locationKey) then
  local campaignScenarios = getCampaignScenarios()
  for _,path in pairs(campaignScenarios) do
    if scenarioFullPath == path then

  for k,subsection in pairs(newCampaign.meta.subsections) do
    subsection.locations = subsection.locations or {}
    subsection.locations = subsection.locations or {}
    for locationKey, locationData in pairs(subsection.locations) do
      locationData.info = locationData.info or {}
      locationData.onEvent = locationData.onEvent or {}
      for eventKey, eventData in pairs(locationData.onEvent) do
        if eventData.disableEndUI then
    local statusTable = processedCampaign.state.locationStatus
    for subsectionKey,subsection in pairs(processedCampaign.meta.subsections) do
      subsection.key = subsectionKey
      subsection.key = subsectionKey
      for locationKey,location in pairs(subsection.locations) do
          statusTable[subsectionKey..'.'..locationKey] = {attempts = 0, state = 'ready', medal=''}

  for k,filename in pairs(files) do
    local fileData = jsonReadFile(filename) or {}
    local saveInfo = getCampaignSaveInfo()
    for k,entry in pairs(saveInfo) do
      if entry.title == title then
  local savedData = jsonReadFile(saveFilename)
  for name,data in pairs(savedData) do
    if name ~= 'campaign_campaigns' then
@/gameplay/tutorials/customNodes/blacklistedCarsNode.lua
function C:work()
  for id,car in pairs(self.mgr._fgTutoTestCarsStep.carsData) do
    self.pinOut["car"..tostring(car.id).."Blacklisted"].value = car.blacklisted
@/lua/common/libs/lua-websockets/websocket/handshake.lua
  if req.extra_headers then
    for k,v in pairs(req.extra_headers) do
      tinsert(lines, string.format('%s: %s',k,v))
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua

  for name,variants in pairs(systemPacenotes) do
    sysNotes[name] = {}
  local compacted = {}
  for distStr,n in pairs(out) do
    compacted[n] = distStr
  local keys = {}
  for k in pairs(compacted) do table.insert(keys, k) end
  table.sort(keys)
  local systemCount = 0
  for name,variants in pairs(self:getSystemPacenotes()) do
    systemCount = systemCount + #variants
@/lua/vehicle/extensions/skeleton.lua

  for _, beam in pairs(v.data.beams) do
    obj.debugDrawProxy:drawBeam3d(beam.cid, 0.01, color(44, 71, 112, 230))

  for _, node in pairs(v.data.nodes) do
    obj.debugDrawProxy:drawNodeSphere(node.cid, 0.03, color(170, 57, 57, 230))
@/lua/vehicle/controller/pneumatics/autoLevelSuspension.lua

  return pairs(groups)
end
local function updateFixedStep(dt)
  for _, controlGroup in pairs(controlGroups) do
    local controlBeamId = controlGroup.controlBeamId
local function reset()
  for _, g in pairs(controlGroups) do
    g.targetLength = g.defaultTargetLength or 0

  for _, v in pairs(actuatorGroupsData) do
    controlBeamNames[v.controlBeamName] = true

  for _, v in pairs(beams) do
    if v.name and controlBeamNames[v.name] then
  controlGroups = {}
  for _, groupData in pairs(actuatorGroupsData) do
    local controlBeamName = groupData.controlBeamName
@/ui/ui-vue/dist/index.js
      `,overlayDiv.textContent=count$1.toString(),overlayElement.appendChild(overlayDiv),overlayDivs.set(element,overlayDiv)}catch{}}function updateOverlayText(){if(!overlayActive||overlayDivs.size===0)return;let appsStats=getUIAppsStats(),counts=appsStats.sortedList.map(item=>item.count),maxCount=Math.max(...counts,1),minCount=Math.min(...counts,0);for(let{element,count:count$1}of appsStats.sortedList){let overlayDiv=overlayDivs.get(element);overlayDiv&&(overlayDiv.textContent=count$1.toString(),overlayDiv.style.opacity=getOverlayOpacity(count$1,minCount,maxCount))}}function destroyOverlay(){overlayUpdateTimer&&=(clearInterval(overlayUpdateTimer),null),overlayDivs.forEach(overlayDiv=>overlayDiv.remove()),overlayDivs.clear(),overlayElement&&=(overlayElement.remove(),null),overlayActive=!1}function toggleOverlay(){return overlayActive?(destroyOverlay(),!1):(overlayActive=!0,createOverlay(),updateOverlayDivs(),overlayUpdateTimer=setInterval(updateOverlayText,500),!0)}function refreshOverlay(){overlayActive&&updateOverlayDivs()}var isBrowser=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}var assign=Object.assign;function applyToParams(fn,params){let newParams={};for(let key in params){let value=params[key];newParams[key]=isArray(value)?value.map(fn):fn(value)}return newParams}var noop$1=()=>{},isArray=Array.isArray;function mergeOptions(defaults,partialOptions){let options={};for(let key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos,searchPos>=0&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos,hashPos>0?hashPos:location$1.length),query=parseQuery$1(searchString.slice(1))),hashPos>=0&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+searchString+hash,path,query,hash:decode(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b){let aLastIndex=a$1.matched.length-1,bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b.query)&&a$1.hash===b.hash}function isSameRouteRecord(a$1,b){return(a$1.aliasOf||a$1)===(b.aliasOf||b)}function isSameRouteLocationParams(a$1,b){if(Object.keys(a$1).length!==Object.keys(b).length)return!1;for(let key in a$1)if(!isSameRouteLocationParamsValue(a$1[key],b[key]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b){return isArray(a$1)?isEquivalentArray(a$1,b):isArray(b)?isEquivalentArray(b,a$1):a$1===b}function isEquivalentArray(a$1,b){return isArray(b)?a$1.length===b.length&&a$1.every((value,i)=>value===b[i]):a$1.length===1&&a$1[0]===b}function resolveRelativePath(to,from){if(to.startsWith(`/`))return to;if(!to)return from;let fromSegments=from.split(`/`),toSegments=to.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position--;else break;return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},NavigationType=function(NavigationType$1){return NavigationType$1.pop=`pop`,NavigationType$1.push=`push`,NavigationType$1}({}),NavigationDirection=function(NavigationDirection$1){return NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``,NavigationDirection$1}({});function normalizeBase(base){if(!base)if(isBrowser){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}var computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position){let scrollToOptions;if(`el`in position){let positionEl=position.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key,scrollPosition){scrollPositions.set(key,scrollPosition)}function getSavedScrollPosition(key){let scroll$1=scrollPositions.get(key);return scrollPositions.delete(key),scroll$1}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name){return typeof name==`string`||typeof name==`symbol`}var ErrorTypes=function(ErrorTypes$1){return ErrorTypes$1[ErrorTypes$1.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,ErrorTypes$1}({}),NavigationFailureSymbol=Symbol(``);ErrorTypes.MATCHER_NOT_FOUND,ErrorTypes.NAVIGATION_GUARD_REDIRECT,ErrorTypes.NAVIGATION_ABORTED,ErrorTypes.NAVIGATION_CANCELLED,ErrorTypes.NAVIGATION_DUPLICATED;function createRouterError(type,params){return assign(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let searchParams=(search$1[0]===`?`?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value$1=>{value$1!==void 0&&(search$1+=(search$1.length?`&`:``)+key,value$1!=null&&(search$1+=`=`+value$1))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key in query){let value=query[key];value!==void 0&&(normalizedQuery[key]=isArray(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value)}return normalizedQuery}var matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$1=[];function add$2(handler$1){return handlers$1.push(handler$1),()=>{let i=handlers$1.indexOf(handler$1);i>-1&&handlers$1.splice(i,1)}}function reset$1(){handlers$1=[]}return{add:add$2,list:()=>handlers$1.slice(),reset:reset$1}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){let enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid=>{valid===!1?reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED,{from,to})):valid instanceof Error?reject(valid):isRouteLocation(valid)?reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT,{from:to,to:valid})):(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid==`function`&&enterCallbackArray.push(valid),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){let guards=[];for(let record of matched)for(let name in record.components){let rawComponent=record.components[name];if(!(guardType!==`beforeRouteEnter`&&!record.instances[name]))if(isRouteComponent(rawComponent)){let guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved,record.components[name]=resolvedComponent;let guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function extractChangingRecords(to,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}return stripBase(pathname,base)+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index=listeners.indexOf(callback);index>-1&&listeners.splice(index,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){if(document.visibilityState===`hidden`){let{history:history$1}=window;if(!history$1.state)return;history$1.replaceState(assign({},history$1.state,{scroll:computeScrollPosition()}),``)}}function destroy$1(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`pagehide`,beforeUnloadListener),document.removeEventListener(`visibilitychange`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`pagehide`,beforeUnloadListener),document.addEventListener(`visibilitychange`,beforeUnloadListener),{pauseListeners,listen,destroy:destroy$1}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history$1.state,buildState(historyState.value.back,to,historyState.value.forward,!0),data,{position:historyState.value.position}),!0),currentLocation.value=to}function push(to,data){let currentState=assign({},historyState.value,history$1.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0),changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),!1),currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}var TokenType=function(TokenType$1){return TokenType$1[TokenType$1.Static=0]=`Static`,TokenType$1[TokenType$1.Param=1]=`Param`,TokenType$1[TokenType$1.Group=2]=`Group`,TokenType$1}({}),TokenizerState=function(TokenizerState$1){return TokenizerState$1[TokenizerState$1.Static=0]=`Static`,TokenizerState$1[TokenizerState$1.Param=1]=`Param`,TokenizerState$1[TokenizerState$1.ParamRegExp=2]=`ParamRegExp`,TokenizerState$1[TokenizerState$1.ParamRegExpEnd=3]=`ParamRegExpEnd`,TokenizerState$1[TokenizerState$1.EscapeNext=4]=`EscapeNext`,TokenizerState$1}(TokenizerState||{}),ROOT_TOKEN={type:TokenType.Static,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message){throw Error(`ERR (${state})/"${buffer$1}": ${message}`)}let state=TokenizerState.Static,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&=(state===TokenizerState.Static?segment.push({type:TokenType.Static,value:buffer$1}):state===TokenizerState.Param||state===TokenizerState.ParamRegExp||state===TokenizerState.ParamRegExpEnd?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:TokenType.Param,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),``)}function addCharToBuffer(){buffer$1+=char}for(;ib.length?b.length===1&&b[0]===PathScore.Static+PathScore.Segment?1:-1:0}function comparePathParserScore(a$1,b){let i=0,aScore=a$1.score,bScore=b.score;for(;i0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:!1,end:!0,sensitive:!1};function createRouteRecordMatcher(record,parent,options){let matcher=assign(tokensToParser(tokenizePath(record.path),options),{record,parent,children:[],alias:[]});return parent&&!matcher.record.aliasOf==!parent.record.aliasOf&&parent.children.push(matcher),matcher}function createRouterMatcher(routes,globalOptions){let matchers=[],matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){let isRootAdd=!originalRecord,mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;let options=mergeOptions(globalOptions,record),normalizedRecords=[mainNormalizedRecord];if(`alias`in record){let aliases=typeof record.alias==`string`?[record.alias]:record.alias;for(let alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher,originalMatcher;for(let normalizedRecord of normalizedRecords){let{path}=normalizedRecord;if(parent&&path[0]!==`/`){let parentPath=parent.record.path,connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}if(matcher=createRouteRecordMatcher(normalizedRecord,parent,options),originalRecord?originalRecord.alias.push(matcher):(originalMatcher||=matcher,originalMatcher!==matcher&&originalMatcher.alias.push(matcher),isRootAdd&&record.name&&!isAliasRecord(matcher)&&removeRoute(record.name)),isMatchable(matcher)&&insertMatcher(matcher),mainNormalizedRecord.children){let children=mainNormalizedRecord.children;for(let i=0;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index=matchers.indexOf(matcherRef);index>-1&&(matchers.splice(index,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1});name=matcher.record.name,params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location$1.params&&pickParams(location$1.params,matcher.keys.map(k=>k.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1,currentLocation});name=matcher.record.name,params=assign({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){let newParams={};for(let key of keys)key in params&&(newParams[key]=params[key]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name in record.components)propsObject[name]=typeof props==`object`?props[name]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1;comparePathParserScore(matcher,matchers[mid])<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to=unref(props.to);return router$1.resolve(to)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate$1(e={}){if(guardEvent(e)){let p$1=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$1),p$1}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate:navigate$1}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link=reactive(useLink(props)),{options}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}return e.preventDefault&&e.preventDefault(),!0}}function includesParams(outer,inner){for(let key in inner){let innerValue=inner[key],outerValue=outer[key];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance$1,to,name],[oldInstance,from,oldName])=>{to&&(to.instances[name]=instance$1,from&&from!==to&&instance$1&&instance$1===oldInstance&&(to.leaveGuards.size||(to.leaveGuards=from.leaveGuards),to.updateGuards.size||(to.updateGuards=from.updateGuards))),instance$1&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance)&&(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance$1))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],component=h(ViewComponent,assign({},routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,attrs,{onVnodeUnmounted:vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;let slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){let matcher=createRouterMatcher(options.routes,options),parseQuery$1=options.parseQuery||parseQuery,stringifyQuery$1=options.stringifyQuery||stringifyQuery,routerHistory=options.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser&&options.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name){let recordMatcher=matcher.getRecordMatcher(name);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign({},rawLocation.params);for(let key in targetParams)targetParams[key]??delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to==`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(ErrorTypes.NAVIGATION_CANCELLED,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:!0}))}function handleRedirectRecord(to,from){let lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to,from):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign({query:to.query,hash:to.hash,params:newTargetLocation.path==null?to.params:{}},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to),from=currentRoute.value,data=to.state,force=to.force,replace$1=to.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign({},data,shouldRedirect.state):data,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(ErrorTypes.NAVIGATION_DUPLICATED,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate$1(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,ErrorTypes.NAVIGATION_GUARD_REDIRECT))return pushWithRedirect(assign({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign({},data,failure$1.to.state):data,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to,from){let error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){let app$1=installedApps.values().next().value;return app$1&&typeof app$1.runWithContext==`function`?app$1.runWithContext(fn):fn()}function navigate$1(to,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,ErrorTypes.NAVIGATION_CANCELLED)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data)):routerHistory.push(toLocation.fullPath,data)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to),shouldRedirect=handleRedirectRecord(toLocation,router$1.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate$1(toLocation,from).catch(error=>isNavigationFailure(error,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_CANCELLED)?error:isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?(pushWithRedirect(assign(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,ErrorTypes.NAVIGATION_CANCELLED)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to,from){markAsReady(error);let list=errorListeners.list();return list.length?list.forEach(handler$1=>handler$1(error,to,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$1$1,reject)=>{readyHandlers.add([resolve$1$1,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$1$1,reject])=>err?reject(err):resolve$1$1()),readyHandlers.reset()),err}function handleScroll(to,from,isPush,isFirstNavigation){let{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>position&&scrollToPosition(position)).catch(err=>triggerError(err,to,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app$1){app$1.component(`RouterLink`,RouterLink),app$1.component(`RouterView`,RouterView),app$1.config.globalProperties.$router=router$1,Object.defineProperty(app$1.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:!0});app$1.provide(routerKey,router$1),app$1.provide(routeLocationKey,shallowReactive(reactiveRoute)),app$1.provide(routerViewLocationKey,currentRoute);let unmountApp=app$1.unmount;installedApps.add(app$1),app$1.unmount=function(){installedApps.delete(app$1),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}function spawnUiApp(appName,appId,params,apps){let props=params?params.props:null,appKey=`${appName}${appId}`;apps.push({name:appName,appId,appKey,comp:appName,props,teleport:`#${appName+appId}`})}function destroyUiApp(appName,apps){let index=apps.findIndex(x=>x.name===appName);index>-1&&apps.splice(index,1)}function registerApps(app$1,componentsMap){Object.keys(componentsMap).forEach(key=>app$1.component(key,componentsMap[key]))}var _sfc_main$325={};function _sfc_render$5(_ctx,_cache){return null}var layoutEmpty_default=__plugin_vue_export_helper_default(_sfc_main$325,[[`render`,_sfc_render$5]]);const LAYOUT_ALIGNMENTS={left:`flex-start`,right:`flex-end`,center:`center`};var _sfc_main$324={},_hoisted_1$287={class:`layout-wrapper layout-safezones`},_hoisted_2$235={class:`layout-content`};function _sfc_render$4(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock(`div`,_hoisted_1$287,[createBaseVNode(`div`,_hoisted_2$235,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createTextVNode(`Content here`,-1)])])])}var layoutSingle_default=__plugin_vue_export_helper_default(_sfc_main$324,[[`render`,_sfc_render$4]]);const useEvents=(onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),events$3={_on:{},_once:{},on(name,func){name in events$3._on||(events$3._on[name]=[]),events$3._on[name].indexOf(func)===-1&&(bridge$4.events.on(name,func),events$3._on[name].push(func))},once(name,func){name in events$3._once||(events$3._once[name]=[]),events$3._once[name].indexOf(func)===-1&&(bridge$4.events.once(name,()=>{let idx=events$3._once[name].indexOf(func);idx>-1&&events$3._once[name].splice(idx,1)}),bridge$4.events.once(name,func),events$3._once[name].push(func))},off(name=void 0,func=void 0){if(!name){for(let name$1 in events$3._on){for(let func$1 of events$3._on[name$1])bridge$4.events.off(name$1,func$1);delete events$3._on[name$1]}return}if(name in events$3._on)if(func){let idx=events$3._on[name].indexOf(func);idx>-1&&(bridge$4.events.off(name,func),events$3._on[name].splice(idx,1)),events$3._on[name].length===0&&delete events$3._on[name]}else{for(let func$1 of events$3._on[name])bridge$4.events.off(name,func$1);delete events$3._on[name]}},emit(name,...values){bridge$4.events.emit(name,...values)}};return onDispose(()=>{for(let type of[`_on`,`_once`])for(let name in events$3[type]){for(let func of events$3[type][name])bridge$4.events.off(name,func);delete events$3[type][name]}}),events$3},useStreams=(names,callback,onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),enabled=!1,streams={on(){enabled||(enabled=!0,bridge$4.streams.add(names),bridge$4.events.on(`onStreamsUpdate`,callback))},off(){enabled&&(enabled=!1,bridge$4.streams.remove(names),bridge$4.events.off(`onStreamsUpdate`,callback))}};return streams.on(),onDispose(streams.off),streams};var hints_default=`ui.hints.quickSteerResponse,ui.hints.raceBrakesEffectiveness,ui.hints.quickCameraMovement,ui.hints.grabVehicleParts,ui.hints.funStabilityControl,ui.hints.recoverVehicle,ui.hints.oldCarsBurn,ui.hints.smokingWheels,ui.hints.carsBurnFuel,ui.hints.delicateCars,ui.hints.stabilityControlPresent,ui.hints.absWasOptional,ui.hints.installRollCage,ui.hints.spatialNavigation,ui.hints.repairHood,ui.hints.slowMotionPhysics,ui.hints.removeRearSeats,ui.hints.tuning,ui.hints.customLicensePlate,ui.hints.driveAtNight,ui.hints.moonGravity,ui.hints.unlockExtraFunctionality,ui.hints.playMultiseat,ui.hints.increaseGroundClearance,ui.hints.tiresBurstOnBumps,ui.hints.blueSmokeIsPistonDamage,ui.hints.keepTheEngineUpright,ui.hints.thermalDebugApp,ui.hints.rollPitchApps,ui.hints.cruiseControlApp,ui.hints.driveTheCanon,ui.hints.vehicleSkins,ui.hints.toggleMods,ui.hints.importveFramerate,ui.hints.photoModeMenu,ui.hints.publishScreenshots,ui.hints.towTrailer,ui.hints.brakesAndSteeringVary,ui.hints.countersteerEarly,ui.hints.startSlow,ui.hints.parkingbrakeForTurning,ui.hints.carefulWithOldSportsCars,ui.hints.corneringWithKeyboard,ui.hints.adaptToBadRoads,ui.hints.notAllCarsCanRace,ui.hints.changeBrakePads,ui.hints.useTurnSignals,ui.hints.showStandalonePcs,ui.hints.tweakFOV,ui.hints.driveWithMouse,ui.hints.liftOffOversteer,ui.hints.snapOversteer,ui.hints.slideBackWithParkingBrake,ui.hints.customizeSpecializedBindings,ui.hints.toggleFogLights,ui.hints.toggleLightBars,ui.hints.TrackIRSupported,ui.hints.chooseShiftingMode,ui.hints.saveRestoreVehicleHome,ui.hints.switchVehicle,ui.hints.coolantVaporizes,ui.hints.dontRunIntoTheCar`.split(`,`),_hoisted_1$286={key:0,class:`progress-box`},_hoisted_2$234={class:`progress-icon-group`},_hoisted_3$208={class:`progress-bar-container`},_hoisted_4$178={class:`progress-status`},_hoisted_5$153={class:`progress-history`},_hoisted_6$132={class:`custom-left-container`},_hoisted_7$118={key:0,class:`custom-text-panel`},_hoisted_8$99={key:1,class:`text`},_hoisted_9$89={key:1,class:`custom-indeterminate-panel`},_hoisted_10$77={class:`custom-right-container`},_hoisted_11$69={key:2,class:`tips-bar`},_hoisted_12$57={class:`tips-bar-title`},_hoisted_13$49={class:`tips-bar-tip`},_hoisted_14$44={key:0,class:`loading-cache`},_hoisted_15$42=[`src`],imagesAmount=18,activeRepeatTime=1e4,fadeInDefault=1e3,fadeOutDefault=2e3,_sfc_main$323={__name:`LoadingScreen`,setup(__props){useCssVars(_ctx=>({v79c091d8:fadeInTimeVar.value,v07559aed:fadeOutTimeVar.value}));let events$3=useEvents(),{lua}=useBridge(),navBlocker=useUINavBlocker(),lastImageNum=-1,repeatTimer=null,customTimer=null,iconsList=[{id:`terrain`,icon:icons.terrain},{id:`environment`,icon:icons.water},{id:`forest`,icon:icons.trafficCone},{id:`meshes`,icon:icons.garage01},{id:`roads`,icon:icons.road},{id:`beamng`,icon:icons.beamNG}],state=reactive({active:!1,visible:!1,fading:!1,shown:!1,autoActivate:!0,highSeas:!1,mode:`progress`,image:null,iconState:{},currentEntries:[],historyEntriesDisplay:[],customContent:null,fadeInTime:fadeInDefault,fadeOutTime:fadeOutDefault,customPause:-1});function resetState(){state.mode=`progress`,state.customContent=null,state.iconState={},state.currentEntries=[],state.historyEntriesDisplay=[],state.fadeInTime=fadeInDefault,state.fadeOutTime=fadeOutDefault,state.customPause=-1}let tip=ref(``),setTip=(txt=void 0,_retrying=!1)=>{let idx=~~(Math.random()*hints_default.length);tip.value=txt||hints_default[idx],(!tip.value||tip.value===`undefined`)&&(logger_default.debug(`Loading Screen tip is undefined!\nARG: ${JSON.stringify(txt)} TIP: ${JSON.stringify(tip.value)} IDX: ${idx}/${hints_default.length}`),_retrying?tip.value=``:setTip(void 0,!0))},fadeInTimeVar=computed(()=>state.fadeInTime+`ms`),fadeOutTimeVar=computed(()=>state.fadeOutTime+`ms`),progressValue=computed(()=>state.currentEntries[0]?.progress||0),currentStatus=computed(()=>state.currentEntries[0]?.message||``);events$3.on(`LoadingScreen`,data=>{if(window.beamng?.ingame){if((!data||typeof data!=`object`)&&(data={}),state.autoActivate=!1,state.active=!!data.active,data.custom&&(state.mode=`custom`,state.fadeInTime=data.custom.fadeIn>0?data.custom.fadeIn*1e3:state.fadeInTime||0,state.fadeOutTime=data.custom.fadeOut>0?data.custom.fadeOut*1e3:state.fadeOutTime||0),state.active)data.custom?(state.customPause=data.custom.pause?data.custom.pause*1e3:-1,state.customContent=data.custom.data,state.customContent?.image&&(state.image=state.customContent.image)):(resetState(),window.bngVue.gotoAngularState(`blank`)),setTip(state.customContent?.tips);else if(state.mode===`progress`&&`gotoMainMenu`in data){let args=[];data.gotoMainMenu?args.push(`menu.mainmenu`):args.push(`menu`,[`loading`]),window.globalAngularRootScope?.$broadcast(`ChangeState`,...args),window.vueEventBus?.emit(`onChangeState`,...args)}}}),events$3.on(`UpdateLoadingProgressV2`,data=>{if(!window.beamng?.ingame||!state.autoActivate&&!state.active)return;let{currentEntries,historyEntries}=data;(!currentEntries||!Array.isArray(currentEntries))&&(currentEntries=[]),(!historyEntries||!Array.isArray(historyEntries))&&(historyEntries=[]),state.currentEntries=currentEntries,state.historyEntriesDisplay=historyEntries.slice(Math.max(historyEntries.length-3,1)),state.iconState={};for(let{name,progress}of currentEntries)state.iconState[name.toLowerCase()]=progress;for(let{name}of historyEntries)state.iconState[name.toLowerCase()]=100;state.autoActivate&&(state.active=currentEntries.length>0||historyEntries.length>0)});let onFadeIn=()=>{state.fading=!1,state.mode===`progress`?(lua.core_gamestate.loadingScreenActive(),repeatTimer=setTimeout(()=>{lua.core_gamestate.loadingScreenActive()},activeRepeatTime)):state.mode===`custom`&&(lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(1),state.customPause!==-1&&(customTimer=setTimeout(()=>{lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(2)},state.customPause*1e3)))},onFadeOut=()=>{state.fading=!1,state.shown=!1,state.mode===`custom`&&lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(3),resetState(),loadNextImage()};watch(()=>state.active,(newActive,oldActive)=>{window.beamng?.ingame&&(newActive&&!oldActive?activateLoading():!newActive&&oldActive&&deactivateLoading())});let activateLoading=()=>{state.active&&(deactivateLoading.cancel(),navBlocker.allowOnly([]),nextTick(()=>{state.visible=!0,state.fading=!0,state.shown=!0}))},deactivateLoading=debounce(()=>{state.active||(clearTimers(),navBlocker.clear(),nextTick(()=>{state.visible=!1,state.fading=!0}))},100),getRandomImageNum=()=>{let rnd=~~(Math.random()*imagesAmount)+1;return rnd===lastImageNum?getRandomImageNum():(lastImageNum=rnd,rnd)},getNextImageUrl=()=>{let url;return url=state.highSeas?`images/mainmenu/unofficial_version.jpg`:`images/loading/drive/${getRandomImageNum()}.jpg`,getAssetURL(url)},loadNextImage=async()=>{let url=getNextImageUrl();state.image!==url&&(await loadImage$1(url),state.image=url)},loadImage$1=url=>new Promise((resolve$1,reject)=>{let img=new Image;img.onload=()=>resolve$1(url),img.onerror=()=>reject(url),img.src=url}),clearTimers=()=>{repeatTimer&&=(clearTimeout(repeatTimer),null),customTimer&&=(clearTimeout(customTimer),null)},initLoadingScreen=()=>bngApi.engineLua(`sailingTheHighSeas`,async ahoy=>{state.highSeas=ahoy===!0,await loadNextImage(),setTip(),lua.core_gamestate.loadingScreenActive(),window.loadingTest=active=>{events$3.emit(`LoadingScreen`,{active})}});return onMounted(()=>{linkLoadingScreenState(state),initLoadingScreen()}),onUnmounted(()=>clearTimers()),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(Transition,{name:`loading-fade`,onAfterEnter:onFadeIn,onAfterLeave:onFadeOut},{default:withCtx(()=>[state.visible?(openBlock(),createElementBlock(`dialog`,{key:0,open:``,class:normalizeClass([`loading-screen`,`loading-screen-${state.mode}`])},[createBaseVNode(`div`,{class:`loading-background`,style:normalizeStyle({backgroundImage:state.image?`url('${state.image}')`:`none`})},null,4),state.mode===`progress`?(openBlock(),createElementBlock(`div`,_hoisted_1$286,[createBaseVNode(`div`,_hoisted_2$234,[(openBlock(),createElementBlock(Fragment,null,renderList(iconsList,iconInfo=>createBaseVNode(`div`,{key:iconInfo.id,class:`progress-icon-box`,style:normalizeStyle({backgroundPosition:`0 ${state.iconState[iconInfo.id]||0}%`})},[createVNode(unref(bngIcon_default),{type:iconInfo.icon,color:`#fff`,class:`progress-icon`},null,8,[`type`])],4)),64))]),createBaseVNode(`div`,_hoisted_3$208,[createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,value:progressValue.value},null,8,[`value`])]),createBaseVNode(`div`,_hoisted_4$178,toDisplayString(currentStatus.value||_ctx.$tt(`ui.common.loading`)),1),createBaseVNode(`div`,_hoisted_5$153,[(openBlock(!0),createElementBlock(Fragment,null,renderList(state.historyEntriesDisplay,(item,idx)=>(openBlock(),createElementBlock(`div`,{key:idx},toDisplayString(item.message),1))),128))])])):createCommentVNode(``,!0),state.mode===`custom`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`custom-box`,{"custom-with-tips":state.customContent?.tips}])},[createBaseVNode(`div`,_hoisted_6$132,[state.customContent&&(state.customContent.title||state.customContent.text)?(openBlock(),createElementBlock(`div`,_hoisted_7$118,[state.customContent.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:[_ctx.$tt(state.customContent.subtitle)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(state.customContent.title)),1)]),_:1},8,[`preheadings`])):createCommentVNode(``,!0),state.customContent.text?(openBlock(),createElementBlock(`p`,_hoisted_8$99,[createVNode(unref(dynamicComponent_default),{"translate-id":state.customContent.text,bbcode:``,"translate-context":``},null,8,[`translate-id`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_9$89,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.common.loading.short`)),1)]),_:1}),createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,indeterminate:``})]))]),createBaseVNode(`div`,_hoisted_10$77,[state.customContent&&state.customContent.image?(openBlock(),createElementBlock(`div`,{key:0,class:`custom-image-panel`,style:normalizeStyle({backgroundImage:`url('${state.customContent.image}')`})},null,4)):createCommentVNode(``,!0)])],2)):createCommentVNode(``,!0),state.mode===`progress`||state.customContent?.tips?(openBlock(),createElementBlock(`div`,_hoisted_11$69,[createBaseVNode(`div`,_hoisted_12$57,toDisplayString(_ctx.$tt(`ui.loadingScreen.tips`))+`:`,1),createBaseVNode(`div`,_hoisted_13$49,[createVNode(unref(dynamicComponent_default),{"translate-id":tip.value,bbcode:``},null,8,[`translate-id`])])])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)]),_:1}),state.image?(openBlock(),createElementBlock(`div`,_hoisted_14$44,[createBaseVNode(`img`,{src:state.image,alt:``},null,8,_hoisted_15$42)])):createCommentVNode(``,!0)],64))}},LoadingScreen_default=__plugin_vue_export_helper_default(_sfc_main$323,[[`__scopeId`,`data-v-2f135df0`]]),_hoisted_1$285={class:`pause-button-wrapper`},_sfc_main$322={__name:`pauseButton`,props:{teleportTo:[String,Object]},setup(__props){let route=useRoute(),events$3=useEvents(),gameContext=useGameContextStore(),isGamePaused=ref(!1),physicsMaybePaused=ref(!1),replayActive=ref(!1),replayPaused=ref(!1);events$3.on(`physicsStateChanged`,state=>{physicsMaybePaused.value=!state}),events$3.on(`replayStateChanged`,core_replay=>{replayActive.value=core_replay.state===`playback`,replayPaused.value=replayActive.value&&core_replay.paused}),events$3.on(`simTimeAuthority.pauseStateChanged`,data=>{isGamePaused.value=data.paused});let isInMenu=computed(()=>route.name?.startsWith(`menu`)&&!gameContext.activities?.length&&sysInfo_default.gameState.value!==void 0&&sysInfo_default.gameState.value!==`loading`),isPhysicsPaused=computed(()=>physicsMaybePaused.value),isReplayPaused=computed(()=>replayActive.value&&replayPaused.value),showPauseButton=computed(()=>isInMenu.value||isPhysicsPaused.value||isReplayPaused.value),isPaused=computed(()=>isGamePaused.value||isPhysicsPaused.value||isReplayPaused.value),buttonState=computed(()=>isInMenu.value&&isPaused.value?`menu-paused`:isInMenu.value?`menu`:isPaused.value?`paused`:`default`),togglePause=()=>{Lua_default.simTimeAuthority.togglePause()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$285,[(openBlock(),createBlock(Teleport,{disabled:!__props.teleportTo,to:__props.teleportTo},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:normalizeClass([`pause-button`,buttonState.value]),accent:unref(ACCENTS).custom,"no-sound":``,onClick:togglePause,"bng-no-nav":``},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{class:`pause-button-binding-bg`,action:`pause`}),createVNode(unref(bngIcon_default),{class:`pause-button-icon`,type:isPaused.value?unref(icons).pause:unref(icons).play},null,8,[`type`])]),_:1},8,[`class`,`accent`])),[[vShow,showPauseButton.value],[unref(BngTooltip_default),_ctx.$tt(`ui.inputActions.general.pause.title`),void 0,{bottom:!0}]])],8,[`disabled`,`to`]))]))}},pauseButton_default=__plugin_vue_export_helper_default(_sfc_main$322,[[`__scopeId`,`data-v-ea9a26b4`]]),UIAppStorage,setupDone;const useUIApps=()=>(setupDone||setup(),service);var setup=()=>{UIAppStorage||=window.UIAppStorage,setupDone=!!UIAppStorage},setLayout=layoutName=>{layoutName==`blank`?_broadcast(`appContainer:clear`):_broadcast(`appContainer:loadLayoutByType`,layoutName)},setVisible=state=>{_broadcast(`ShowApps`,!!state)},service={setLayout,setVisible,get currentLayout(){return UIAppStorage.currentLayout}},_broadcast=(...params)=>{window.globalAngularRootScope&&window.globalAngularRootScope.$broadcast(...params)},_sfc_main$321={};function _sfc_render$3(_ctx,_cache){return openBlock(),createElementBlock(`span`)}var NotFound_default=__plugin_vue_export_helper_default(_sfc_main$321,[[`render`,_sfc_render$3]]);function useGridSelector(backendName=`gridSelector`,defaultPath={keys:[`missions`]},defaultDetailsMode=`detail`){let currentPath=ref(defaultPath),previousPath=ref(null),groups=ref([]),filterList=ref([]),filterByProp=ref([]),commonFilters=ref([]),lockedFiltersByProp=ref([]),activeFilters=ref([]),onlyCommonFilters=ref(!0),detailsMode=ref(defaultDetailsMode),selectedItem=ref(null),selectedItemDetails=ref(null),prevSelectedItem=ref(null),previewItem=ref(null),previewItemDetails=ref(null),managementDetails=ref(null),autoFocusKey=ref(null),showScreenHeader=ref(!0),screenHeaderTitle=ref(`Grid Selector`),screenHeaderPath=ref([{text:`Menu`,gotoAngularState:`menu`}]),{events:events$3}=useBridge(),backFromDetailsCallback=null,refreshAllHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshAll`),loadTiles(),loadFilters(),loadManagementDetails())},refreshCurrentItemDetailsHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshCurrentItemDetails`),setSelectedItem(selectedItem.value))};events$3.on(`gridSelectorRefreshAll`,refreshAllHandler),events$3.on(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler);let log=(...args)=>{},displayData=ref([]),searchText$1=ref(``);async function getSearchText(){try{let data=await Lua_default.ui_gridSelector.getSearchText(backendName);return searchText$1.value=data||``,data||``}catch(error){return logger_default.error(`Failed to get search text:`,error),``}}async function setSearchText(value){try{await Lua_default.ui_gridSelector.setSearchText(backendName,value),searchText$1.value=value||``,await loadTiles(),await loadFilters(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to set search text:`,error)}}let isInitializing=ref(!1),safeArray=arr=>Array.isArray(arr)?arr:[];async function setCurrentPath(path){currentPath.value=path,await loadTiles()}async function loadTiles(){currentPath.value;try{let data=await Lua_default.ui_gridSelector.getTiles(backendName,currentPath.value,previousPath.value!==currentPath.value);if(Lua_default.ui_gridSelector.profilerFinish(backendName,`received lua data on UI`),groups.value=safeArray(data),groups.value,!selectedItem.value&&(detailsMode.value===`advanced`||detailsMode.value===`detail`)&&previousPath.value!==currentPath.value)for(let group of groups.value)for(let tile of group.tiles)tile.isDefaultSelected&&(autoFocusKey.value=tile.key,tile.name,tile.forceAutoFocus&&backFromDetailsCallback());previousPath.value=currentPath.value,Lua_default.ui_gridSelector.profilerFinish(backendName,`loaded tiles into reactive state`)}catch(error){logger_default.error(`Failed to load tiles:`,error)}}async function loadFilters(){try{let data=await Lua_default.ui_gridSelector.getFilters(backendName);filterList.value=safeArray(data.filterList),filterByProp.value=data.filterByProp,commonFilters.value=safeArray(data.commonFilters)||[],lockedFiltersByProp.value=data.lockedFiltersByProp||[],activeFilters.value=safeArray(data.activeFilters),onlyCommonFilters.value=data.onlyCommonFilters,filterList.value,filterByProp.value,activeFilters.value,onlyCommonFilters.value}catch(error){logger_default.error(`Failed to load filters:`,error)}}async function loadManagementDetails(){try{managementDetails.value=await Lua_default.ui_gridSelector.getManagementDetails(backendName),managementDetails.value}catch(error){logger_default.error(`Failed to load management details:`,error)}}async function toggleFilter(propName,option){try{await Lua_default.ui_gridSelector.toggleFilter(backendName,propName,option),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to toggle filter:`,error)}}async function updateRangeFilter(propName,min$1,max$1){try{await Lua_default.ui_gridSelector.updateRangeFilter(backendName,propName,min$1,max$1),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update range filter:`,error)}}async function resetRangeFilter(propName){console.log(`Resetting range filter:`,propName);try{await Lua_default.ui_gridSelector.resetRangeFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset range filter:`,error)}}async function resetSetFilter(propName){try{await Lua_default.ui_gridSelector.resetSetFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset set filter:`,error)}}async function loadDisplayData(){try{displayData.value=safeArray(await Lua_default.ui_gridSelector.getDisplayDataOptions(backendName));let searchOption=displayData.value.find(option=>option.key===`searchText`);searchOption&&(searchText$1.value=searchOption.value||``),displayData.value}catch(error){logger_default.error(`Failed to load display data:`,error)}}async function updateDisplayData(key,value){try{await Lua_default.ui_gridSelector.setDisplayDataOption(backendName,key,value),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update display data:`,error)}}async function resetDisplayDataToDefaults(){try{await Lua_default.ui_gridSelector.resetDisplayDataToDefaults(backendName),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset display data to defaults:`,error)}}function setDetailsMode(mode){detailsMode.value=mode}async function setSelectedItem(item){if(!item||!item.showDetails){autoFocusKey.value=null,selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails();return}try{item.showDetails;let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);autoFocusKey.value=item.key,selectedItem.value=item,selectedItemDetails.value=details,details?.paintData&&details?.paints&&selectedItemDetails.value?.paints&&(selectedItemDetails.value.paints.multiPaintSetups=safeArray(selectedItemDetails.value.paints.multiPaintSetups),selectedItemDetails.value.paints.factoryPaints=safeArray(selectedItemDetails.value.paints.factoryPaints)),setDetailsMode(`detail`)}catch(error){logger_default.error(`Failed to get item details:`,error),autoFocusKey.value=null,selectedItem.value=item,selectedItemDetails.value=null}}async function clearSelectedItem(){selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails()}async function setPreviewItem(item){if(!item||!item.showDetails){previewItem.value=null,previewItemDetails.value=null;return}try{let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);previewItem.value=item,previewItemDetails.value=details,setDetailsMode(`detail`)}catch{previewItem.value=item,previewItemDetails.value=null}}function clearPreviewItem(){previewItem.value=null,previewItemDetails.value=null}let activeItem=computed(()=>selectedItem.value||previewItem.value),activeItemDetails=computed(()=>selectedItem.value?selectedItemDetails.value:previewItemDetails.value);async function executeButton(buttonId,additionalData){try{if(additionalData?.waitForLoadingScreen)window.vueEventBus?.emit(`LoadingScreen`,{active:!0}),await startLoading(async()=>{await waitForLoadingScreenFadeIn();let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)});else{let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)}}catch(error){logger_default.error(`Failed to execute button:`,error)}}let executeButtonHandler=(backendName$1,buttonId,additionalData)=>{backendName$1===backendName$1&&executeButton(buttonId,additionalData)};events$3.on(`gridSelectorExecuteButton`,executeButtonHandler);async function toggleFavourite(item){await Lua_default.ui_gridSelector.toggleFavourite(backendName,item.showDetails);let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);selectedItem.value=item,selectedItemDetails.value=details,await loadTiles()}function clearSearch(){setSearchText(``)}function updateSearch(newSearchText){setSearchText(newSearchText||``)}function commitSearch(){setSearchText(searchText$1.value||``)}function isFilterLocked(propName,option=null){return lockedFiltersByProp.value[propName]?option?lockedFiltersByProp.value[propName][option]!==void 0:Object.keys(lockedFiltersByProp.value[propName]).length>0:!1}async function updateScreenHeaderData(){try{let headerData=await Lua_default.ui_gridSelector.getScreenHeaderTitleAndPath(backendName,currentPath.value);screenHeaderTitle.value=headerData.title||`Grid Selector`,screenHeaderPath.value=headerData.pathSegments}catch(error){logger_default.error(`Failed to update screen header title:`,error),screenHeaderTitle.value=`Grid Selector`,screenHeaderPath.value=[{text:`Menu`,gotoAngularState:`menu`}]}}function isFilterOptionLocked(propName,option){return isFilterLocked(propName,option)}function isRangeFilterLocked(propName){return isFilterLocked(propName)}watch(currentPath,()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch([filterByProp,activeFilters],()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch(displayData,()=>{updateScreenHeaderData()},{deep:!0});function notifyUIReady(tag){Lua_default.ui_gridSelector.profilerFinish(backendName,tag)}function setOnBackFromDetailsCallback(callback){backFromDetailsCallback=callback}async function initialize(){if(!isInitializing.value)try{isInitializing.value=!0,await Promise.all([loadFilters(),loadDisplayData(),loadManagementDetails(),getSearchText()])}catch(error){logger_default.error(`Failed to initialize GridSelector composable:`,error)}finally{isInitializing.value=!1}}return onUnmounted(()=>{logger_default.debug(`GridSelector composable unmounting`),events$3.off(`gridSelectorRefreshAll`,refreshAllHandler),events$3.off(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler),events$3.off(`gridSelectorExecuteButton`,executeButtonHandler)}),{groups,filterList,filterByProp,lockedFiltersByProp,commonFilters,activeFilters,onlyCommonFilters,displayData,currentPath,detailsMode,selectedItem,selectedItemDetails,prevSelectedItem,previewItem,previewItemDetails,activeItem,activeItemDetails,managementDetails,isInitializing,searchText:searchText$1,getSearchText,setSearchText,autoFocusKey,showScreenHeader,screenHeaderTitle,screenHeaderPath,initialize,setCurrentPath,loadTiles,loadFilters,loadManagementDetails,toggleFilter,updateRangeFilter,resetRangeFilter,resetSetFilter,loadDisplayData,updateDisplayData,resetDisplayDataToDefaults,setDetailsMode,setSelectedItem,clearSelectedItem,setPreviewItem,clearPreviewItem,executeButton,notifyUIReady,isFilterLocked,isFilterOptionLocked,isRangeFilterLocked,toggleFavourite,clearSearch,updateSearch,commitSearch,updateScreenHeaderData,exploreFolder:function(path){Lua_default.ui_gridSelector.exploreFolder(backendName,path)},goToMod:function(modId){Lua_default.ui_gridSelector.goToMod(backendName,modId)},setOnBackFromDetailsCallback}}var _hoisted_1$284=[`bng-scoped-nav-autofocus`],_hoisted_2$233={class:`image-container`},_hoisted_3$207={key:0,class:`sub-element-count-badge`},_hoisted_4$177={class:`item-label`},_hoisted_5$152={class:`item-name`},_hoisted_6$131={class:`icons-container`},_hoisted_7$117=[`src`],_hoisted_8$98={key:0,class:`sub-element-count-badge`},_hoisted_9$88={key:1},sizes={tiny:{width:7.5,margin:.5,fontSize:.8},small:{width:9.5,margin:.5,fontSize:1},medium:{width:12,margin:.5,fontSize:1},large:{width:16,margin:.5,fontSize:1},huge:{width:20,margin:.5,fontSize:1.5},list:{width:22,height:3,margin:.5,fontSize:.9}},thumbAspectRatio=16/9.5,captionHeightEm=2,getSizeCalc=displaySize=>ctx=>{let size$3=sizes[displaySize]||sizes.medium;if(displaySize===`list`)return{width:size$3.width,height:size$3.height,margin:size$3.margin};let height$1=size$3.width/thumbAspectRatio+size$3.fontSize*captionHeightEm-size$3.margin*2;return{width:size$3.width,height:height$1,margin:size$3.margin}},__default__$6={getSizeCalc},_sfc_main$320=Object.assign(__default__$6,{__name:`Tile`,props:{tile:{type:Object,required:!0},isFavourite:Boolean,isConfig:Boolean,displaySize:String,tileImagesTopAligned:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`click`,`dblclick`],setup(__props,{expose:__expose,emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,gridSelectionState=inject(`gridSelectionState`,null),state=computed(()=>{let res={selected:!1,dimmed:!1,isAutoFocused:!1};return gridSelectionState&&gridSelectionState.value&&(res.selected=gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey===props.tile.key,res.dimmed=showIfController.value&&gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey!==props.tile.key,res.isAutoFocused=gridSelectionState.value.autoFocusKey===props.tile.key),res}),emit$1=__emit,elTile=ref(null);__expose({getElement:()=>elTile.value});let isListItem=computed(()=>props.displaySize===`list`);function onClick(){emit$1(`click`)}function onFocus(){emit$1(`focus`)}function onBlur(){emit$1(`blur`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tile-wrapper`,`tile-size-${__props.displaySize}`]),style:normalizeStyle({"--tile-font-size":sizes[__props.displaySize].fontSize+`em`})},[_cache[0]||=createBaseVNode(`div`,{class:`tile-bg`},null,-1),withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`elTile`,ref:elTile,"bng-scoped-nav-autofocus":state.value.isAutoFocused,class:normalizeClass({tile:!0,selected:state.value.selected,dimmed:state.value.dimmed,auxiliary:__props.tile.isAuxiliary,"is-career-only":__props.tile.isCareerOnly}),onClick:withModifiers(onClick,[`stop`]),onFocus,onBlur,"bng-nav-item":``},[createBaseVNode(`div`,_hoisted_2$233,[createVNode(unref(bngImage_default),{class:normalizeClass([`item-image`,{"top-aligned":__props.tileImagesTopAligned}]),src:__props.tile.preview},null,8,[`class`,`src`]),isListItem.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`div`,_hoisted_3$207,toDisplayString(__props.tile.subElementCount),1)):createCommentVNode(``,!0),__props.isFavourite||__props.tile.showFavouriteIconPercent>=1?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:`star`})):createCommentVNode(``,!0)],64))]),createBaseVNode(`div`,_hoisted_4$177,[createBaseVNode(`span`,_hoisted_5$152,toDisplayString(__props.tile.name),1),createBaseVNode(`div`,_hoisted_6$131,[__props.tile.sourceIcons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.tile.sourceIcons,sourceIcon=>(openBlock(),createElementBlock(Fragment,{key:sourceIcon},[sourceIcon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:sourceIcon.icon,class:`source-icon`,color:`var(--bng-cool-gray-100)`},null,8,[`type`])):createCommentVNode(``,!0),sourceIcon.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:sourceIcon.svg,alt:``},null,8,_hoisted_7$117)):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0),isListItem.value&&__props.tile.showFavouriteIconPercent>0?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:__props.tile.showFavouriteIconPercent>=1?`star`:`starSecondary`},null,8,[`type`])):createCommentVNode(``,!0)]),isListItem.value&&!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`span`,_hoisted_8$98,toDisplayString(__props.tile.subElementCount),1)):isListItem.value?(openBlock(),createElementBlock(`span`,_hoisted_9$88)):createCommentVNode(``,!0)])],42,_hoisted_1$284)),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0,bubble:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`],[unref(BngDoubleClick_default),__props.tile.doubleClickDetails?()=>emit$1(`dblclick`):null,__props.tile.doubleClickMode]])],6))}}),Tile_default=__plugin_vue_export_helper_default(_sfc_main$320,[[`__scopeId`,`data-v-51fd3377`]]),_hoisted_1$283={class:`group-header`,"bng-list-title":``},_sfc_main$319={__name:`GroupHeader`,props:{label:{type:String,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$283,[createVNode(bngCardHeading_default,{class:`header-label`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.label),1)]),_:1}),_cache[0]||=createBaseVNode(`div`,{class:`header-line`},null,-1)]))}},GroupHeader_default=__plugin_vue_export_helper_default(_sfc_main$319,[[`__scopeId`,`data-v-28596ef8`]]),_sfc_main$318={__name:`Grid`,props:{autoFocusKey:{type:String,default:null},activeItem:{type:Object,default:null},groups:{type:Array,required:!0},isConfig:{type:Boolean,default:!1},displaySize:{type:String,default:`medium`,validator:value=>[`tiny`,`small`,`medium`,`large`,`huge`,`list`].includes(value)},inDetails:{type:Boolean,default:!1},backendName:{type:String,default:`gridSelector`},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null}},emits:[`select-item`,`deselect-item`,`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,gridListRef=ref(),containerWidth=ref(0),baseFontSize=ref(16),tileSizeCalc=ctx=>Tile_default.getSizeCalc(props.displaySize)(ctx),maxTilesPerRow=computed(()=>{if(!containerWidth.value)return 1/0;let size$3=Tile_default.getSizeCalc(props.displaySize)({}),tileWidthPx=(size$3.width+size$3.margin)*baseFontSize.value;return(Math.floor(containerWidth.value/tileWidthPx)||1)*(props.displaySize===`list`?2:1)}),limitedGroups=computed(()=>props.groups.map(group=>({...group,tiles:group.isRecentGroup?group.tiles.slice(0,maxTilesPerRow.value):group.tiles}))),updateContainerWidth=()=>{gridListRef.value?.$el&&(containerWidth.value=gridListRef.value.$el.clientWidth,baseFontSize.value=parseFloat(getComputedStyle(document.documentElement).fontSize)||16)},resizeObserver;onMounted(()=>{updateContainerWidth(),gridListRef.value?.$el&&(resizeObserver=new ResizeObserver(debounce(updateContainerWidth,100)),resizeObserver.observe(gridListRef.value.$el))}),onUnmounted(()=>{resizeObserver&&resizeObserver.disconnect()}),provide(`gridSelectionState`,computed(()=>({inDetails:props.inDetails,activeItemKey:props.activeItem?.key||null,autoFocusKey:props.autoFocusKey})));let focusItem=tile=>{props.inDetails||(showIfController.value&&preselectItem(tile),emit$1(`focus-item`,tile))},selectItem=tile=>{preselectItem.cancel(),emit$1(`select-item`,tile)},preselectItem=debounce(tile=>emit$1(`select-item`,tile,!1),200),handleDoubleClick=async item=>{if(console.log(`handleDoubleClick`,item),item.doubleClickDetails)try{props.doubleClickOverride?props.doubleClickOverride(item):await Lua_default.ui_gridSelector.executeDoubleClick(props.backendName,item.doubleClickDetails)}catch(error){console.error(`Failed to execute double click:`,error)}};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngList_default),{ref_key:`gridListRef`,ref:gridListRef,class:`grid-list`,layout:unref(LIST_LAYOUTS).TILES,"no-background":``,big:``,immediate:``,"keep-alive":500,"title-width":20,"title-height":1.5,"title-margin":.5,"tile-size-calc":tileSizeCalc},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(limitedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[group.label?(openBlock(),createBlock(GroupHeader_default,{key:0,label:group.label,"bng-list-title":``},null,8,[`label`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.tiles,tile=>(openBlock(),createBlock(Tile_default,{key:tile.key,tile,"is-config":__props.isConfig,"display-size":__props.displaySize,"is-favourite":group.label===`Favourites`,"tile-images-top-aligned":__props.tileImagesTopAligned,onFocus:$event=>focusItem(tile),onClick:$event=>selectItem(tile),onDblclick:$event=>handleDoubleClick(tile)},null,8,[`tile`,`is-config`,`display-size`,`is-favourite`,`tile-images-top-aligned`,`onFocus`,`onClick`,`onDblclick`]))),128))],64))),128))]),_:1},8,[`layout`]))}},Grid_default$1=__plugin_vue_export_helper_default(_sfc_main$318,[[`__scopeId`,`data-v-efa73a51`]]),_hoisted_1$282={class:`display-controls-container`},_hoisted_2$232={class:`control-group-label`},_hoisted_3$206={key:0,class:`reset-button-container`},_sfc_main$317={__name:`DisplayControls`,props:{displayData:{type:Array,required:!0},detailsMode:{type:String,required:!0},updateDisplayData:{type:Function,required:!0},resetDisplayDataToDefaults:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,booleanToStringByKey=computed(()=>{let valuesByKey={};for(let option of props.displayData)if(option.type===`checkbox`){valuesByKey[option.key]={};for(let checkboxOption of option.options)valuesByKey[option.key][checkboxOption.value]=checkboxOption.label||(checkboxOption.value?`Yes`:`No`)}return valuesByKey}),controls$1=computed(()=>props.displayData.filter(x=>x.showInModes?.[props.detailsMode]).map(x=>({...x,checkboxLabel:x.type===`checkbox`?booleanToStringByKey.value[x.key]?.[x.value]:void 0}))),onOptionChanged=(key,newValue)=>{props.updateDisplayData(key,newValue),emit$1(`focus-item`,key)},resetToDefaults=()=>{props.resetDisplayDataToDefaults()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$282,[createBaseVNode(`div`,{class:normalizeClass([`display-controls`,{"display-controls-list":__props.detailsMode===`displayControls`||__props.detailsMode===`default`}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(controls$1.value,option=>(openBlock(),createElementBlock(`div`,{key:option.key,class:normalizeClass([`control-group`,{"force-full-width":__props.detailsMode===`default`}])},[createBaseVNode(`div`,_hoisted_2$232,toDisplayString(option.label),1),createVNode(bngTooltip_default,{text:option.description||`No description available`,position:`top`},{default:withCtx(()=>[option.type===`dropdown`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,items:option.options||[],"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),threshold:8},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`checkbox`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,class:normalizeClass([`full-width-checkbox`,{active:option.value}]),modelValue:option.value,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),labelBefore:``,alwaysTransparent:``},{default:withCtx(()=>[createTextVNode(toDisplayString(option.checkboxLabel),1)]),_:2},1032,[`class`,`modelValue`,`onUpdate:modelValue`])):option.type===`number`?(openBlock(),createBlock(unref(bngInputNew_default),{key:2,modelValue:option.value,min:option.min,max:option.max,showExternalButton:!1,type:`number`,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue)},null,8,[`modelValue`,`min`,`max`,`onUpdate:modelValue`])):createCommentVNode(``,!0)]),_:2},1032,[`text`])],2))),128))],2),__props.detailsMode===`displayControls`?(openBlock(),createElementBlock(`div`,_hoisted_3$206,[createVNode(unref(bngButton_default),{onClick:resetToDefaults,accent:`attention`,iconLeft:`trashBin1`,class:`reset-button`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Reset to Defaults `,-1)]]),_:1})])):createCommentVNode(``,!0)]))}},DisplayControls_default=__plugin_vue_export_helper_default(_sfc_main$317,[[`__scopeId`,`data-v-863e411a`]]),_sfc_main$316={__name:`SearchBar`,props:{searchText:{type:String,required:!0},setSearchText:{type:Function,required:!0},placeholder:{type:String,default:`Search...`},fullWidth:{type:Boolean,default:!1},showClearAllButton:{type:Boolean,default:!1}},emits:[`focus-item`,`clear-all`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clearSearch=()=>{props.setSearchText(``),emit$1(`focus-item`,`search`)},commitSearch=()=>{},onSearchChanged=value=>{props.setSearchText(value),emit$1(`focus-item`,`search`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`search-container`,{"full-width":__props.fullWidth}])},[createVNode(unref(bngInput_default),{class:`search-input`,modelValue:__props.searchText,placeholder:__props.placeholder,onValueChanged:onSearchChanged,onKeydown:withKeys(commitSearch,[`enter`]),onBlur:commitSearch,onFocus:_cache[0]||=$event=>emit$1(`focus-item`,`search`)},null,8,[`modelValue`,`placeholder`]),createBaseVNode(`div`,{class:normalizeClass([`search-icon-container`,{active:__props.searchText}]),onClick:clearSearch},[createVNode(unref(bngIcon_default),{type:unref(icons).search,class:`search-icon show-unhovered`},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).trashBin2,class:`search-icon show-hovered`},null,8,[`type`])],2)],2))}},SearchBar_default=__plugin_vue_export_helper_default(_sfc_main$316,[[`__scopeId`,`data-v-67aff9c0`]]),_hoisted_1$281={class:`filters`},_hoisted_2$231={key:0,class:`search-section`},_hoisted_3$205={key:1,class:`filter-options-grid`},_hoisted_4$176={class:`option-label`},_hoisted_5$151={class:`option-icon`},_hoisted_6$130={key:2,class:`filters-container`},_hoisted_7$116={class:`filter-container`,navigable:``,tabindex:`0`},_hoisted_8$97={class:`filter-content`},_hoisted_9$87={key:0,class:`filter-options`},_hoisted_10$76={class:`filter-options-grid`},_hoisted_11$68={class:`option-label`},_hoisted_12$56={class:`option-icon`},_hoisted_13$48={key:1,class:`filter-options`},_hoisted_14$43={class:`range-bar-container`},_hoisted_15$41={class:`range-bar`},_hoisted_16$39={class:`range-inputs`},_hoisted_17$32={class:`range-input-group`},_hoisted_18$29={class:`range-input-group`},_sfc_main$315={__name:`DetailedFilters`,props:{filterList:{type:Array,required:!0},filterByProp:{type:Object,required:!0},searchText:{type:String,default:``},commonFilters:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},onlyCommonFilters:{type:Boolean,default:!0},isFilterLocked:{type:Function,required:!0},isFilterOptionLocked:{type:Function,required:!0},isRangeFilterLocked:{type:Function,required:!0},toggleFilter:{type:Function,required:!0},updateRangeFilter:{type:Function,required:!0},resetRangeFilter:{type:Function,required:!0},setSearchText:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,expandedAccordions=ref({}),pendingRangeUpdates=ref({}),debouncedUpdateFunctions=ref({}),getDebouncedUpdate=propName=>(debouncedUpdateFunctions.value[propName]||(debouncedUpdateFunctions.value[propName]=debounce(()=>{if(pendingRangeUpdates.value[propName]){let{min:min$1,max:max$1}=pendingRangeUpdates.value[propName];props.updateRangeFilter(propName,min$1,max$1),delete pendingRangeUpdates.value[propName]}},300)),debouncedUpdateFunctions.value[propName]);onUnmounted(()=>{Object.values(debouncedUpdateFunctions.value).forEach(debouncedFn=>{debouncedFn&&debouncedFn.cancel&&debouncedFn.cancel()}),debouncedUpdateFunctions.value={},pendingRangeUpdates.value={}});let formatFilterName=key=>key,getFilterOptionClass=(propName,option)=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||!filter.options)return``;let allEnabled=filter.options.every(opt=>props.filterByProp[propName]?.[opt]===!0),currentOptionEnabled=props.filterByProp[propName]?.[option]===!0;return allEnabled?`filter-neutral`:currentOptionEnabled?`filter-active`:`filter-inactive`},hasActiveFilters=propName=>{if(!props.filterList)return!1;let filter=props.filterList.find(f=>f.propName===propName);if(!filter)return!1;if(filter.type===`range`){let filterData=props.filterByProp[propName];if(!filterData)return!1;let currentMin=filterData.min,currentMax=filterData.max,defaultMin=filter.min,defaultMax=filter.max;return currentMin>defaultMin||currentMaxprops.filterByProp[propName]?.[option]===!1)},toggleFilter=(propName,option,event)=>{if(props.isFilterOptionLocked(propName,option)){console.log(`Cannot toggle locked filter:`,propName,option);return}event&&(event.preventDefault(),event.stopPropagation()),emit$1(`focus-item`,`filters`),props.toggleFilter(propName,option)},onRangeFilterChanged=(propName,newValue,field)=>{if(props.isRangeFilterLocked(propName)){console.log(`Cannot update locked range filter:`,propName);return}let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return;let filterData=props.filterByProp[propName];if(!filterData)return;let currentPending=pendingRangeUpdates.value[propName],min$1=currentPending?currentPending.min:filterData.min,max$1=currentPending?currentPending.max:filterData.max;field===`min`?min$1=newValue:field===`max`&&(max$1=newValue),min$1=Math.max(filter.min,Math.min(filter.max,min$1)),max$1=Math.max(filter.min,Math.min(filter.max,max$1)),min$1>max$1&&([min$1,max$1]=[max$1,min$1]),pendingRangeUpdates.value[propName]={min:min$1,max:max$1},getDebouncedUpdate(propName)(),emit$1(`focus-item`,propName)},isFilterActive=filter=>hasActiveFilters(filter.propName),getRangeBarStyle=propName=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return{};let filterData=props.filterByProp[propName];if(!filterData)return{};let currentMin=filterData.min,currentMax=filterData.max,totalRange=filter.max-filter.min,leftPosition=(currentMin-filter.min)/totalRange*100,width$1=(currentMax-currentMin)/totalRange*100;return{left:`${leftPosition}%`,width:`${width$1}%`,backgroundColor:`var(--bng-orange-500)`}};return onMounted(()=>{props.filterList&&props.filterList.forEach(filter=>{hasActiveFilters(filter.propName)&&(expandedAccordions.value[filter.propName]=!0)})}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$281,[__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_2$231,[createVNode(SearchBar_default,{searchText:__props.searchText,setSearchText:__props.setSearchText,placeholder:`Search items...`,"full-width":!0,onFocusItem:_cache[0]||=$event=>emit$1(`focus-item`,$event)},null,8,[`searchText`,`setSearchText`])])):createCommentVNode(``,!0),__props.detailsMode===`filter`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_3$205,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.commonFilters,(filter,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter[0],filter[1]),{"filter-locked":props.isFilterOptionLocked(filter[0],filter[1])}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter[0],filter[1])?`not-allowed`:`pointer`}),"bng-nav-item":``,onClick:$event=>toggleFilter(filter[0],filter[1])},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$176,toDisplayString(filter[1]),1),createBaseVNode(`span`,_hoisted_5$151,[__props.filterByProp&&__props.filterByProp[filter[0]]&&__props.filterByProp[filter[0]][filter[1]]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).xmark},null,8,[`type`])),props.isFilterOptionLocked(filter[0],filter[1])?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])),__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_6$130,[createVNode(unref(accordion_default),{class:`filters-accordion`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.filterList,filter=>(openBlock(),createElementBlock(`div`,{key:filter.propName,class:`filter-wrapper`},[createVNode(unref(accordionItem_default),{navigable:``,static:!filter.options||filter.options.length===0,"arrow-big":``,"expand-hint-inline":``,expanded:expandedAccordions.value[filter.propName],class:normalizeClass({"has-active-filters":isFilterActive(filter)}),onFocus:$event=>emit$1(`focus-item`,filter.propName)},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$116,[createBaseVNode(`div`,_hoisted_8$97,toDisplayString(formatFilterName(filter.propName)),1)])]),default:withCtx(()=>[filter.type===`set`&&filter.options?(openBlock(),createElementBlock(`div`,_hoisted_9$87,[createBaseVNode(`div`,_hoisted_10$76,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filter.options,(option,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter.propName,option),{"filter-locked":props.isFilterOptionLocked(filter.propName,option)}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter.propName,option)?`not-allowed`:`pointer`}),onClick:$event=>toggleFilter(filter.propName,option)},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_11$68,toDisplayString(option),1),createBaseVNode(`span`,_hoisted_12$56,[__props.filterByProp[filter.propName][option]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).abandon},null,8,[`type`])),props.isFilterOptionLocked(filter.propName,option)?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])])):createCommentVNode(``,!0),filter.type===`range`?(openBlock(),createElementBlock(`div`,_hoisted_13$48,[createBaseVNode(`div`,_hoisted_14$43,[createBaseVNode(`div`,_hoisted_15$41,[createBaseVNode(`div`,{class:`range-selection`,style:normalizeStyle(getRangeBarStyle(filter.propName))},null,4)])]),createBaseVNode(`div`,_hoisted_16$39,[createBaseVNode(`div`,_hoisted_17$32,[_cache[1]||=createBaseVNode(`label`,{class:`range-label`},`Min:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`min`,modelValue:__props.filterByProp[filter.propName].min,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`min`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))]),createBaseVNode(`div`,_hoisted_18$29,[_cache[2]||=createBaseVNode(`label`,{class:`range-label`},`Max:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`max`,modelValue:__props.filterByProp[filter.propName].max,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`max`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))])])])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`class`,`onFocus`])]))),128))]),_:1})])):createCommentVNode(``,!0)]))}},DetailedFilters_default=__plugin_vue_export_helper_default(_sfc_main$315,[[`__scopeId`,`data-v-a4758924`]]),_hoisted_1$280={key:1},_hoisted_2$230={key:1},_hoisted_3$204={key:1},_hoisted_4$175={key:1},_sfc_main$314={__name:`HeaderButtons`,props:{canSwitchDetails:{type:Boolean,default:!1},hiddenTabs:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},slim:{type:Boolean,default:!1}},emits:[`switch-details-mode`],setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`header-buttons`,{slim:__props.slim}])},[withDirectives(createVNode(unref(bngBinding_default),{class:`header-buttons-binding`,"ui-event":`context`,controller:``,"track-ignore":``},null,512),[[vShow,__props.canSwitchDetails]]),__props.hiddenTabs.includes(`detail`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`detail`}]),accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>_ctx.$emit(`switch-details-mode`,`detail`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).info},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_1$280,`Details`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Details`,`top`]]),__props.hiddenTabs.includes(`advanced`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`advanced`}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>_ctx.$emit(`switch-details-mode`,`advanced`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).laneProperties},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_2$230,`Advanced`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Advanced`,`top`]]),__props.hiddenTabs.includes(`filter`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`filter`}]),accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>_ctx.$emit(`switch-details-mode`,`filter`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).filter},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_3$204,`Filters`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Filters`,`top`]]),__props.hiddenTabs.includes(`displayControls`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`displayControls`}]),accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>_ctx.$emit(`switch-details-mode`,`displayControls`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).adjust},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_4$175,`Display`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Display`,`top`]])],2))}},HeaderButtons_default=__plugin_vue_export_helper_default(_sfc_main$314,[[`__scopeId`,`data-v-157cdc63`]]),_sfc_main$313={__name:`Slideshow`,props:{images:Array,transition:Boolean,delay:{type:Number,default:1e4},parent:Object,shuffle:Boolean},setup(__props,{expose:__expose}){useCssVars(_ctx=>({v095d52f4:imgPrev.value,v095f8174:imgNext.value}));let props=__props,anim=ref(!1),imgPrev=ref(``),imgNext=ref(``),imgIndex=ref(-1),sequence=[],sequenceIndex=-1,tmrMain,tmrAnim,wImages,wParent;__expose({imgIndex,nextImage,carousel:{showNext:nextImage}}),onUnmounted(stopTimers);function stopTimers(){tmrMain&&=(clearTimeout(tmrMain),null),tmrAnim&&=(clearTimeout(tmrAnim),null)}watch(()=>props.parent,parent=>{wImages&&=(wImages(),null),wParent&&=(wParent(),null),parent?wParent=watch([()=>props.images,()=>parent.imgIndex],([images,index])=>{images&&(imgIndex.value=index,images.length>0&&nextTick(nextImage))},{immediate:!0}):wImages=watch([()=>props.images,()=>props.shuffle],([images,shuffle])=>{images&&(imgIndex.value=-1,images.length>0&&(shuffle&&(sequenceIndex=-1,sequence=Array.from(images).map((_,i)=>i).sort(()=>Math.random()-.5)),nextTick(nextImage)))},{immediate:!0})},{immediate:!0});function nextImage(){stopTimers(),props.parent||(props.shuffle&&sequence.length>0?(sequenceIndex=++sequenceIndex%props.images.length,imgIndex.value=sequence[sequenceIndex]):imgIndex.value=++imgIndex.value%props.images.length);let img=`url("${getAssetURL(props.images[imgIndex.value])}")`;props.transition?(imgNext.value=img,anim.value=!0,tmrAnim=setTimeout(()=>{tmrAnim=null,anim.value=!1,imgPrev.value=imgNext.value,imgNext.value=``},1e3)):imgPrev.value=img,!props.parent&&props.images.length>1&&(tmrMain=setTimeout(nextImage,props.delay))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({anim:anim.value})},null,2))}},Slideshow_default=__plugin_vue_export_helper_default(_sfc_main$313,[[`__scopeId`,`data-v-f788946d`]]),_hoisted_1$279={key:0,class:`blur-wrap`},_sfc_main$312={__name:`BlurBackground`,setup(__props){let parentCarousel=inject(`mainBackground`),backgroundsBlur=inject(`mainBackgroundBlur`),bgRequired=sysInfo_default.mainMenuBackgroundRequired;return(_ctx,_cache)=>unref(bgRequired)?(openBlock(),createElementBlock(`div`,_hoisted_1$279,[createVNode(Slideshow_default,{class:`blur-carousel`,images:unref(backgroundsBlur),parent:unref(parentCarousel),transition:``},null,8,[`images`,`parent`])])):createCommentVNode(``,!0)}},BlurBackground_default=__plugin_vue_export_helper_default(_sfc_main$312,[[`__scopeId`,`data-v-cc1c4815`]]),_hoisted_1$278={class:`header-container`},_hoisted_2$229={key:1},_hoisted_3$203={class:`content-container`},_hoisted_4$174={class:`header-back-button`},_hoisted_5$150={key:0,class:`header-title-container`},_hoisted_6$129={class:`header-back-button`},_hoisted_7$115={class:`header-back-button`},_hoisted_8$96={key:0,class:`scrollable-content`},_hoisted_9$86={class:`details-mode-buttons`},_hoisted_10$75={key:1,class:`scrollable-content`},_hoisted_11$67={key:0,class:`details-content`},_hoisted_12$55={key:1,class:`scrollable-content`},_sfc_main$311={__name:`GridSelector`,props:{backendName:{type:String,default:`gridSelector`},routePath:{type:String,default:`/grid-selector`},defaultPath:{type:Object,default:()=>({keys:[`allModels`]})},defaultDetailsMode:{type:String,default:`detail`},hiddenTabs:{type:Array,default:()=>[]},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null},noBreadcrumbs:{type:Boolean,default:!1},overrideBackFromGrid:{type:Function,default:null},inlineHeaderContainer:{type:Boolean,default:!0},selectCallback:{type:Function,default:null},bubbleEvents:{type:Array,default:()=>[]}},setup(__props,{expose:__expose}){let props=__props,{showIfController}=storeToRefs(controls_default()),store$1=useGridSelector(props.backendName,props.defaultPath,props.defaultDetailsMode),{groups,displayData,detailsMode,selectedItem,showScreenHeader,screenHeaderTitle,screenHeaderPath,activeItemDetails,activeItem,activeFilters}=store$1,route=useRoute(),router$1=useRouter(),detailsModeTitles={detail:`Details`,advanced:`Advanced`,filter:`Filters`,displayControls:`Display`},detailsModeBackTo={filter:`advanced`,displayControls:`advanced`};watch(()=>[props.backendName,props.defaultPath,props.defaultDetailsMode],([newBackendName,newDefaultPath,newDefaultDetailsMode],[oldBackendName,oldDefaultPath,oldDefaultDetailsMode])=>{newBackendName!==oldBackendName&&newDefaultPath&&newDefaultPath.keys&&store$1.setCurrentPath(newDefaultPath),newDefaultDetailsMode!==oldDefaultDetailsMode&&store$1.setDetailsMode(newDefaultDetailsMode)},{deep:!0});let scopedNavState=reactive({isGridActive:!1,isDetailsActive:!1}),setBack=inject(`setBack`),showTopbarTabBindings=inject(`showTopbarTabBindings`),showTopbarBackBinding=inject(`showTopbarBackBinding`),showBreadcrumbsBack=ref(!1),canUseTopbar=ref(!0);watch(()=>scopedNavState.isDetailsActive,val=>{canUseTopbar.value=!val,showTopbarTabBindings(canUseTopbar.value)}),watch(screenHeaderPath,val=>{showBreadcrumbsBack.value=val&&val.length>2,showTopbarBackBinding(!showBreadcrumbsBack.value)});let switchSeq=computed(()=>[`detail`,`advanced`,`displayControls`].filter(tab=>!props.hiddenTabs.includes(tab))),getNextSwitchSeq=mode=>{mode||=detailsMode.value,mode===`filter`&&(mode=`advanced`);let seq=switchSeq.value;if(seq.length===0)return`detail`;let currentIndex=seq.indexOf(mode);return currentIndex===-1?seq[0]:seq[(currentIndex+1)%seq.length]},canSeeDetails=ref(!0),hasSelectedItem=computed(()=>!!store$1.selectedItem.value),canSwitchDetails=computed(()=>activeSectionScope.value!==`default`||detailsMode.value===`advanced`);function switchDetailsMode(mode){console.log(`switchDetailsMode`,mode),typeof mode!=`string`&&(mode=getNextSwitchSeq(mode)),mode===`detail`&&!canSeeDetails.value&&(mode=getNextSwitchSeq(mode)),console.log(`switchDetailsMode`,mode),store$1.setDetailsMode(mode),switchScope(`details`)}function onToggleSectionScope(){activeSectionScope.value===`grid`?switchScope(`details`):switchDetailsMode()}let activeSectionScope=ref(`grid`);function switchScope(name,force=!1){name||=activeSectionScope.value===`grid`?`details`:`grid`,name===`details`?(scopedNavState.isGridActive=!1,force&&(scopedNavState.isDetailsActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isDetailsActive=!0})):(scopedNavState.isDetailsActive=!1,force&&(scopedNavState.isGridActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isGridActive=!0}))}let onGridActivate=()=>{scopedNavState.isGridActive=!0},onGridDeactivate=event=>{scopedNavState.isGridActive=!1},onDetailsActivate=()=>{scopedNavState.isDetailsActive=!0},onDetailsDeactivate=event=>{scopedNavState.isDetailsActive=!1},setDetailsScope=info=>{switchScope(`details`)},canBubbleGridEvent=event=>!!(event.detail.name===`rotate_v_cam`||event.detail.name===`menu`||canUseTopbar.value&&(event.detail.name===`tab_l`||event.detail.name===`tab_r`)||props.bubbleEvents.includes(event.detail.name)),canBubbleDetailsEvent=event=>!!(event.detail.name===`rotate_v_cam`||props.bubbleEvents.includes(event.detail.name)),canDeactivateGrid=()=>screenHeaderPath.value.length<=1,onBackFromDetails=()=>{if(detailsMode.value===`displayControls`||detailsMode.value===`filter`){toggleDetailsMode(`advanced`);return}switchScope(`grid`)},onToggleFavorite=()=>{store$1.toggleFavourite(activeItem.value)},gridContentRef=ref(null),scrollPositions$1=ref(new Map),scrollTimeout=null,displaySize=computed(()=>{let option=displayData.value.find(option$1=>option$1.key===`displaySize`);return option?option.value:`medium`});store$1.initialize(),store$1.setOnBackFromDetailsCallback(()=>{onBackFromDetails()}),props.defaultPath.keys;let currentPathSegments=computed(()=>{let pathMatch=route.params.pathMatch;if(!pathMatch)return props.defaultPath?.keys||(Array.isArray(props.defaultPath)?props.defaultPath:[]);let segments=Array.isArray(pathMatch)?pathMatch.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(pathMatch)];if(route.params.itemDetails){let itemDetails=Array.isArray(route.params.itemDetails)?route.params.itemDetails.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(route.params.itemDetails)];segments.push(...itemDetails)}return segments}),saveScrollPosition$1=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),scrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(pathKey,scrollTop)},debouncedSaveScrollPosition=()=>{scrollTimeout&&clearTimeout(scrollTimeout),scrollTimeout=setTimeout(()=>{saveScrollPosition$1()},100)},restoreScrollPosition=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),savedPosition=scrollPositions$1.value.get(pathKey);savedPosition!==void 0&&nextTick(()=>{gridContentRef.value.scrollTop=savedPosition})};watch(groups,async newGroups=>{newGroups&&(await nextTick(),await nextTick(),store$1.notifyUIReady(),restoreScrollPosition())},{immediate:!0}),watch([currentPathSegments],async([segments],[oldSegments])=>{if(oldSegments&&gridContentRef.value){let oldPathKey=oldSegments.join(`/`),currentScrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(oldPathKey,currentScrollTop)}let path={keys:segments};await store$1.setCurrentPath(path)},{immediate:!0}),watch(gridContentRef,newElement=>{if(newElement){let handleScroll=()=>{debouncedSaveScrollPosition()};newElement.addEventListener(`scroll`,handleScroll),newElement._scrollHandler=handleScroll}},{immediate:!0}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`gridSelector`)}),onMounted(()=>{setBack(props.backendName,onBackFromGrid),nextTick(()=>{scopedNavState.isGridActive=!0})}),onUnmounted(()=>{setBack(props.backendName),gridContentRef.value&&gridContentRef.value._scrollHandler&&gridContentRef.value.removeEventListener(`scroll`,gridContentRef.value._scrollHandler),scrollTimeout&&clearTimeout(scrollTimeout),Lua_default.ui_gridSelector.closedFromUI(props.backendName),Lua_default.simTimeAuthority.popPauseRequest(`gridSelector`)});let onItemFocus=item=>{item&&item.showDetails&&store$1.setPreviewItem(item)},onItemSelect=async(item,doNavigation=!0)=>{if(item.gotoPath&&Array.isArray(item.gotoPath))store$1.prevSelectedItem.value=item.key,doNavigation&&routeNav(item),store$1.clearSelectedItem(),doNavigation&&switchScope(`grid`),props.selectCallback&&await props.selectCallback(item,doNavigation);else if(item.showDetails){item.key,selectedItem.value?.key;let consumed=!1;props.selectCallback&&(consumed=await props.selectCallback(item,doNavigation)),consumed||(await store$1.setSelectedItem(item),doNavigation&&switchScope(`details`))}},onGridWrapperClick=event=>{store$1.clearSelectedItem(),switchScope(`grid`,!0)},onDetailsWrapperClick=event=>{switchScope(`details`,!0)},onItemDeselect=()=>{store$1.clearSelectedItem()},toggleDetailsMode=mode=>{store$1.setDetailsMode(mode)};function routeNav(item){if(item.gotoAngularState)return;let encodedPath=item.gotoPath.map(segment=>encodeURIComponent(segment)).join(`/`);router$1.push(`${props.routePath}/${encodedPath}`)}let onBackFromGrid=()=>{if(console.log(`onBackFromGrid`,screenHeaderPath.value),props.overrideBackFromGrid&&screenHeaderPath.value.length<=2)return props.overrideBackFromGrid();if(screenHeaderPath.value.length>1){let item=screenHeaderPath.value[screenHeaderPath.value.length-2];return store$1.prevSelectedItem.value&&(store$1.autoFocusKey.value=store$1.prevSelectedItem.value),gotoHeaderItem(item),!1}return!0},onBreadBack=()=>nextTick(onBackFromGrid),clearSearch=()=>{store$1.setSearchText(``)},clearFilters=()=>{console.log(`clearFilters`,activeFilters.value);for(let filter of activeFilters.value)console.log(`clearFilter`,filter),filter&&filter.type===`range`?store$1.resetRangeFilter(filter.propName):store$1.resetSetFilter(filter.propName)},setCurrentPath=path=>{store$1.setCurrentPath(path)},gotoHeaderItem=item=>{console.log(`gotoHeaderItem`,item),item.gotoAngularState?window.bngVue.gotoAngularState(item.gotoAngularState):item.gotoPath&&(item.clearSearch&&clearSearch(),item.clearFilters&&clearFilters(),setCurrentPath({keys:item.gotoPath}),routeNav(item),switchScope(`grid`))};return __expose({screenHeaderPath,clearSearch,clearFilters,setCurrentPath}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`grid-selector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$278,[__props.noBreadcrumbs?(openBlock(),createElementBlock(`div`,_hoisted_2$229)):(openBlock(),createBlock(unref(bngBreadcrumbs_default),{key:0,class:`header-breadcrumbs`,items:unref(screenHeaderPath),limit:`5`,simple:``,"disable-last-item":``,"show-back-button":showBreadcrumbsBack.value,onClick:gotoHeaderItem,onBack:onBreadBack},null,8,[`items`,`show-back-button`])),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createBlock(HeaderButtons_default,{key:2,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]))]),createBaseVNode(`div`,_hoisted_3$203,[createBaseVNode(`div`,{class:normalizeClass([`grid-wrapper`,{active:activeSectionScope.value===`grid`}])},[createVNode(BlurBackground_default),unref(showScreenHeader)?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-row`,{active:activeSectionScope.value===`grid`&&unref(showIfController),"no-controller":!unref(showIfController)}])},[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(screenHeaderTitle)),1)]),_:1}),withDirectives(createBaseVNode(`div`,_hoisted_4$174,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`grid`&&unref(showIfController)&¤tPathSegments.value.length>1]])],2)):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,{class:`grid-content`,ref_key:`gridContentRef`,ref:gridContentRef,"bng-nav-scroll":``,"bng-no-nav":`true`,tabindex:`-1`,onActivate:onGridActivate,onDeactivate:onGridDeactivate,onClick:onGridWrapperClick},[createVNode(Grid_default$1,{"in-details":activeSectionScope.value===`details`&&unref(detailsMode)===`detail`,"display-size":displaySize.value,"backend-name":props.backendName,"auto-focus-key":unref(store$1).autoFocusKey.value,"active-item":unref(store$1).activeItem.value,groups:unref(groups),"tile-images-top-aligned":__props.tileImagesTopAligned,onFocusItem:onItemFocus,onSelectItem:onItemSelect,onDeselectItem:onItemDeselect,"double-click-override":__props.doubleClickOverride},null,8,[`in-details`,`display-size`,`backend-name`,`auto-focus-key`,`active-item`,`groups`,`tile-images-top-aligned`,`double-click-override`])],32)),[[unref(BngScopedNav_default),{activated:scopedNavState.isGridActive,canBubbleEvent:canBubbleGridEvent,canDeactivate:canDeactivateGrid,preferAutoFocus:!0,autoFocusDelay:400}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onBackFromGrid,`back`],[unref(BngUiNavScroll_default)]])],2),withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details-wrapper wide`,{active:activeSectionScope.value===`details`,"no-controller":!unref(showIfController)}]),tabindex:`-1`,"bng-no-nav":`true`,onActivate:onDetailsActivate,onDeactivate:onDetailsDeactivate,onClick:onDetailsWrapperClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,{class:normalizeClass([`header-row`,{active:activeSectionScope.value===`details`&&unref(showIfController),"no-controller":!unref(showIfController)}]),"bng-no-child-nav":`true`},[createVNode(HeaderButtons_default,{slim:``,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$150,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(detailsModeTitles[unref(detailsMode)]),1)]),_:1}),detailsModeBackTo[unref(detailsMode)]?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,onClick:_cache[0]||=$event=>toggleDetailsMode(detailsModeBackTo[unref(detailsMode)]),accent:unref(ACCENTS).outlined,iconRight:`undo`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``})]),_:1},8,[`accent`])):createCommentVNode(``,!0),withDirectives(createBaseVNode(`div`,_hoisted_6$129,[createVNode(unref(bngIcon_default),{type:unref(icons).adjust},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`context`,controller:``})],512),[[vShow,activeSectionScope.value===`grid`||!unref(showIfController)]]),withDirectives(createBaseVNode(`div`,_hoisted_7$115,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`details`&&unref(showIfController)]])]))],2),unref(detailsMode)===`advanced`?(openBlock(),createElementBlock(`div`,_hoisted_8$96,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createBaseVNode(`div`,_hoisted_9$86,[createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>toggleDetailsMode(`filter`),accent:unref(ACCENTS).secondary,iconLeft:`filter`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` More filters... `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:_cache[2]||=$event=>toggleDetailsMode(`displayControls`),accent:unref(ACCENTS).secondary,iconLeft:`adjust`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Display Options `,-1)]]),_:1},8,[`accent`])]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Management`,-1)]]),_:1}),renderSlot(_ctx.$slots,`management-details`,{managementDetails:unref(store$1).managementDetails.value,executeButton:unref(store$1).executeButton},void 0,!0)])):unref(detailsMode)===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_10$75,[createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`])])):unref(detailsMode)===`displayControls`?(openBlock(),createBlock(DisplayControls_default,{key:2,class:`scrollable-content`,displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`])):unref(detailsMode)===`detail`?(openBlock(),createElementBlock(Fragment,{key:3},[hasSelectedItem.value?(openBlock(),createElementBlock(`div`,_hoisted_11$67,[renderSlot(_ctx.$slots,`item-details`,{activeItem:unref(store$1).activeItem.value,activeItemDetails:unref(store$1).activeItemDetails.value,executeButton:unref(store$1).executeButton,toggleFavourite:unref(store$1).toggleFavourite,exploreFolder:unref(store$1).exploreFolder,goToMod:unref(store$1).goToMod,onFocusItem:setDetailsScope},void 0,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$55,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Info`,-1)]]),_:1}),_cache[7]||=createBaseVNode(`div`,{class:`scrollable-content`},` Please select an item to see details. `,-1)]))],64)):createCommentVNode(``,!0)],34)),[[unref(BngScopedNav_default),{activated:scopedNavState.isDetailsActive,canDeactivate:()=>!1,canBubbleEvent:canBubbleDetailsEvent,bubbleWhitelistEvents:[`menu`]}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onToggleFavorite,`action_2`],[unref(BngUiNavLabel_default),`Toggle favorite`,`action_2`],[unref(BngOnUiNav_default),onBackFromDetails,`back`,{focusRequired:!0}]])])]),_:3})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>{},`rotate_h_cam,rotate_v_cam`]])}},GridSelector_default=__plugin_vue_export_helper_default(_sfc_main$311,[[`__scopeId`,`data-v-d340d12f`]]),_hoisted_1$277={class:`details`,"bng-nav-scroll":``},_hoisted_2$228={key:0,class:`preview`},_hoisted_3$202={key:1,class:`content-header`},_hoisted_4$173={key:0,class:`description`},_hoisted_5$149={key:0,class:`specs-grid`},_hoisted_6$128={class:`specs-grid-container`},_hoisted_7$114={class:`spec-content`},_hoisted_8$95={class:`spec-label`},_hoisted_9$85={class:`spec-value`},_hoisted_10$74={key:2,class:`buttons-section`},_sfc_main$310={__name:`AppDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,required:!0},toggleFavourite:{type:Function,required:!0}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$277,[__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_2$228,[createVNode(unref(aspectRatio_default),{class:`preview-image`,ratio:`16:8`,"external-image":__props.activeItemDetails.preview},null,8,[`external-image`])])):createCommentVNode(``,!0),__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_3$202,[__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_4$173,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$149,[createBaseVNode(`div`,_hoisted_6$128,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$114,[createBaseVNode(`div`,_hoisted_8$95,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_9$85,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)),__props.activeItemDetails?.buttonInfo?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$74,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128))])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]])}},AppDetails_default=__plugin_vue_export_helper_default(_sfc_main$310,[[`__scopeId`,`data-v-c8fb13f2`]]),_sfc_main$309={__name:`AppSelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`appSelector`,routePath:`/app-selector`,defaultPath:{keys:[`allApps`]},defaultDetailsMode:`advanced`},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite})=>[createVNode(AppDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`])]),_:1}))}},AppSelector_default=_sfc_main$309,routes_default=[{name:`menu.appselector`,path:`/app-selector/:pathMatch(.*)*`,component:AppSelector_default,props:!0,meta:{clickThrough:!1,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.appedit`,path:`/app-edit/`,component:NotFound_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0},topBar:{visible:!0}}}],_hoisted_1$276={class:`main-info`},_hoisted_2$227={class:`heading`},_hoisted_3$201={key:0,class:`stars`},_hoisted_4$172={key:1,class:`aggregate-primary`},_hoisted_5$148={class:`label`},_hoisted_6$127={class:`value`},_hoisted_7$113={key:2,class:`empty-gap`},_sfc_main$308={__name:`PoiCard`,props:{poi:{type:Object,required:!0},shown:{type:Boolean,default:!0}},emits:[`select`,`hover`],setup(__props,{emit:__emit}){let debugLog$1=(message,data)=>{},props=__props,emit$1=__emit,onSelect=()=>{props.poi.id,props.poi.name,emit$1(`select`,props.poi.id)},thumbLoaded=props.shown&&!!props.poi?.thumbnail,thumbShown=ref(thumbLoaded),thumb=ref(thumbLoaded?`url("${props.poi?.thumbnail}")`:`none`),lastThumb=thumbLoaded?props.poi?.thumbnail:void 0;return watch([()=>props.shown,()=>props.poi],()=>{if(props.shown&&props.poi?.thumbnail){let url=props.poi.thumbnail;if(lastThumb!==url){lastThumb=url,thumbLoaded=!1;let img=new Image;img.src=url,img.onload=()=>{lastThumb===url&&(thumbLoaded=!0,thumb.value=`url("${url}")`,thumbShown.value=!0)}}}else props.poi?.thumbnail||(lastThumb=void 0,thumbLoaded=!1,thumb.value=`none`,thumbShown.value=!1)},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`poi-item`,{highlighted:__props.poi.isSelected}]),onClick:onSelect,"bng-nav-item":``},[createBaseVNode(`div`,{class:normalizeClass([`card-info`,{"content-shown":__props.shown,"thumb-show":thumbShown.value&&!!thumb.value}]),style:normalizeStyle({"--poi-image":thumb.value})},[__props.poi.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`mission-icon`,type:__props.poi.icon,color:`white`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_1$276,[createBaseVNode(`div`,_hoisted_2$227,toDisplayString(__props.poi.name),1),__props.poi.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_3$201,[__props.poi.formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"individual-stars":__props.poi.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6,reverse:``},null,8,[`individual-stars`])):createCommentVNode(``,!0),__props.poi.formattedProgress.unlockedStars&&__props.poi.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,"individual-stars":__props.poi.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individual-stars`])):createCommentVNode(``,!0)])):__props.poi.aggregatePrimary?(openBlock(),createElementBlock(`div`,_hoisted_4$172,[createBaseVNode(`span`,_hoisted_5$148,toDisplayString(__props.poi.aggregatePrimary.label)+`:`,1),createBaseVNode(`span`,_hoisted_6$127,toDisplayString(__props.poi.aggregatePrimary.value),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$113))]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``})],6)],2))}},PoiCard_default=__plugin_vue_export_helper_default(_sfc_main$308,[[`__scopeId`,`data-v-cd49bd11`]]),_hoisted_1$275={class:`poi-list`},_hoisted_2$226={class:`filter-header`},_hoisted_3$200={class:`poi-list-items`},_sfc_main$307={__name:`PoiList`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,poiListContainer=ref(null),shownCards=ref(new Set),{groupData,poiData,selectedPoi,selectPoi,onHover,debugLog:debugLog$1}=props.store,processedPoiData=computed(()=>{let processed={};if(!poiData.value)return processed;for(let[poiId,poi]of Object.entries(poiData.value))poi&&(processed[poiId]={id:poi.id||poiId,name:poi.name?$translate.instant(poi.name):``,icon:poi.icon?icons[poi.icon]:icons._empty,thumbnail:poi.thumbnailFile,formattedProgress:poi.formattedProgress,aggregatePrimary:poi.aggregatePrimary?.label&&poi.aggregatePrimary?.value?{label:$translate.instant(poi.aggregatePrimary.label),value:$translate.instant(poi.aggregatePrimary.value)}:null,isSelected:selectedPoi.value?.id===poi.id});return processed});debugLog$1(`PoiList`,`Component initialized`,{groupDataCount:groupData.value?.length||0,poiDataCount:Object.keys(poiData.value||{}).length,processedPoiCount:Object.keys(processedPoiData.value).length});let observer$2=new IntersectionObserver(entries=>{for(let entry of entries){let poiId=entry.target.getAttribute(`data-poi-id`);poiId&&entry.isIntersecting?shownCards.value.add(poiId):shownCards.value.delete(poiId)}},{threshold:.1,rootMargin:`10px`}),setupObserver=()=>{if(!poiListContainer.value)return;let elms$4=poiListContainer.value.querySelectorAll(`[data-poi-id]`),ids=[];for(let elm of elms$4){let poiId=elm.getAttribute(`data-poi-id`);poiId&&(ids.push(poiId),observer$2.observe(elm))}for(let id of shownCards.value)ids.includes(id)||shownCards.value.delete(id)};return watch(poiListContainer,cont=>cont&&nextTick(setupObserver),{immediate:!0}),watch([groupData,processedPoiData],()=>{nextTick(()=>{observer$2.disconnect(),setupObserver()})},{immediate:!1}),onUnmounted(()=>{shownCards.value.clear(),observer$2.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$275,[createBaseVNode(`div`,{class:`poi-list-content`,ref_key:`poiListContainer`,ref:poiListContainer},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(groupData),section=>(openBlock(),createElementBlock(`div`,{key:section.key,class:`filter-section`},[createBaseVNode(`div`,_hoisted_2$226,[createVNode(unref(bngIcon_default),{type:section.icon},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(section.title?_ctx.$tt(section.title):``),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(section.groups,group=>(openBlock(),createElementBlock(`div`,{key:group.key,class:`mission-group`},[createVNode(unref(bngCardHeading_default),{class:`mission-group-header`,type:`ribbon`,outline:``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(group.label)),1)]),_:2},1024),createBaseVNode(`div`,_hoisted_3$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.elementIds,poiId=>(openBlock(),createBlock(PoiCard_default,{key:poiId,"data-poi-id":poiId,shown:shownCards.value.has(poiId),poi:processedPoiData.value[poiId],onSelect:unref(selectPoi),onHover:unref(onHover)},null,8,[`data-poi-id`,`shown`,`poi`,`onSelect`,`onHover`]))),128))])]))),128))]))),128))],512)]))}},PoiList_default=__plugin_vue_export_helper_default(_sfc_main$307,[[`__scopeId`,`data-v-0ccba230`]]),_hoisted_1$274={class:`header`},_sfc_main$306={__name:`bngAdvCardHeading`,props:{blurDelay:Number,preheadings:Array,divider:Boolean,icon:String,type:{type:String,default:`line`,validator:v=>[`line`,`ribbon`].includes(v)||v===``}},setup(__props){let blurVal=ref(!1);onMounted(()=>window.setTimeout(()=>blurVal.value=!0,~~+props.blurDelay));let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-screen-header`,{[`heading-style-${__props.type}`]:!0,prehead:__props.preheadings}])},[_cache[0]||=createBaseVNode(`div`,{class:`decorator`},null,-1),__props.preheadings?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass([`pre-header`,{"with-divider":__props.divider}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.icon,class:`pre-header-icon`},null,8,[`type`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.preheadings,preheading=>(openBlock(),createElementBlock(`span`,{class:`location`,key:preheading},toDisplayString(preheading),1))),128))],2)):createCommentVNode(``,!0),createBaseVNode(`h1`,_hoisted_1$274,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])],2))}},bngAdvCardHeading_default=__plugin_vue_export_helper_default(_sfc_main$306,[[`__scopeId`,`data-v-16619e8d`]]),_hoisted_1$273={key:0,class:`poi-icons`},_hoisted_2$225=[`onClick`],_hoisted_3$199={key:1,class:`poi-details`},_hoisted_4$171={class:`poi-content`},_hoisted_5$147={class:`poi-scrollable`},_hoisted_6$126={key:0,class:`poi-aggregate-display`},_hoisted_7$112={key:0,class:`poi-stars`},_hoisted_8$94={class:`stars`},_hoisted_9$84={key:1,class:`aggregate-primary`},_hoisted_10$73={class:`label`},_hoisted_11$66={class:`value`},_hoisted_12$54={key:1,class:`poi-description`},_hoisted_13$47={class:`poi-actions`},_sfc_main$305={__name:`PoiDetails`,props:{store:{type:Object,required:!0}},emits:[`setRoute`,`teleport`],setup(__props,{emit:__emit}){let props=__props,{selectedPoi,selectedPoiIds,poiData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiDetails`,`Component initialized`,{selectedPoiId:selectedPoi.value?.id,selectedPoiIdsCount:selectedPoiIds.value?.length||0});let selectedPoisList=computed(()=>{if(!selectedPoiIds.value||selectedPoiIds.value.length===0)return selectedPoi.value?[selectedPoi.value]:[];let pois=[];for(let poiId of selectedPoiIds.value){let poi=poiData.value[poiId];poi&&pois.push(poi)}return debugLog$1(`PoiDetails`,`Final pois list`,pois),pois}),currentPoiIndex=computed(()=>{if(selectedPoisList.value.length<=1)return 0;let index=selectedPoisList.value.findIndex(poi=>poi.id===selectedPoi.value?.id);return index>=0?index:0}),selectPoi=index=>{index>=0&&index{let headings=[];return selectedPoi.value?.label&&headings.push($translate.instant(selectedPoi.value.label)),headings}),preview=computed(()=>selectedPoi.value?.previewFiles?.length>0?selectedPoi.value.previewFiles[0]:selectedPoi.value?.thumbnailFile||null),safeTranslate=key=>{if(!key)return``;try{return typeof key==`string`?$translate.instant(key):(typeof key==`object`&&key.txt,$translate.contextTranslate(key))}catch(e){return console.warn(`Translation failed for key:`,key,e),typeof key==`string`?key:key?.txt||``}},aggregatePrimary=computed(()=>{let poi=selectedPoi.value;return poi?.aggregatePrimary?.label&&poi?.aggregatePrimary?.value?poi.aggregatePrimary:null}),onAction=action=>{props.store.executePoiAction(action.actionId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[selectedPoisList.value.length>=1?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$273,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedPoisList.value,(poi,index)=>(openBlock(),createElementBlock(`div`,{key:poi.id||index,class:normalizeClass([`poi-icon`,{active:index===currentPoiIndex.value}]),onClick:$event=>selectPoi(index)},[createVNode(unref(bngSpriteIcon_default),{src:`map_`+poi.spriteIcon,style:{width:`100%`,height:`100%`}},null,8,[`src`])],10,_hoisted_2$225))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0),unref(selectedPoi)?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$199,[createBaseVNode(`div`,_hoisted_4$171,[createVNode(bngAdvCardHeading_default,{class:`poi-details-header`,type:`line`,preheadings:preheadings.value},{default:withCtx(()=>[createTextVNode(toDisplayString(safeTranslate(unref(selectedPoi).name)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_5$147,[preview.value?(openBlock(),createBlock(aspectRatio_default,{key:0,class:`poi-thumbnail`,ratio:`16:9`,externalImage:preview.value,imageMode:`cover`},{default:withCtx(()=>[aggregatePrimary.value||unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_6$126,[unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_7$112,[createBaseVNode(`div`,_hoisted_8$94,[unref(selectedPoi).formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.8,reverse:``},null,8,[`individualStars`])):createCommentVNode(``,!0),unref(selectedPoi).formattedProgress.unlockedStars&&unref(selectedPoi).formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.8},null,8,[`individualStars`])):createCommentVNode(``,!0)])])):aggregatePrimary.value?(openBlock(),createElementBlock(`div`,_hoisted_9$84,[createBaseVNode(`span`,_hoisted_10$73,toDisplayString(_ctx.$t(aggregatePrimary.value.label))+`:`,1),createBaseVNode(`span`,_hoisted_11$66,toDisplayString(_ctx.$t(aggregatePrimary.value.value)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1},8,[`externalImage`])):createCommentVNode(``,!0),unref(selectedPoi).description?(openBlock(),createElementBlock(`div`,_hoisted_12$54,toDisplayString(safeTranslate(unref(selectedPoi).description)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_13$47,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(selectedPoi).actions,action=>(openBlock(),createBlock(unref(bngButton_default),{key:action.id,accent:unref(ACCENTS).secondary,"icon-right":action.icon,label:action.label,onClick:$event=>onAction(action)},null,8,[`accent`,`icon-right`,`label`,`onClick`]))),128))])])])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))}},PoiDetails_default=__plugin_vue_export_helper_default(_sfc_main$305,[[`__scopeId`,`data-v-35e47e7e`]]),_hoisted_1$272={class:`poi-filters`},_hoisted_2$224={key:0,class:`filter-row`},_hoisted_3$198=[`onClick`],_hoisted_4$170=[`onClick`],_sfc_main$304={__name:`PoiFilters`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,{filterData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiFilters`,`Component initialized`,{filterDataCount:filterData.value?.length||0});let getGroupVisualState=(filter,group)=>{if(!filter||!group||!filter.groups||!Array.isArray(filter.groups))return`inactive`;let visibleGroups=0,totalGroups=0;for(let filterGroup of filter.groups)filterGroup&&filterGroup.elementCount>0&&(totalGroups++,filterGroup.visible&&visibleGroups++);let isAllGroupsActive=visibleGroups===totalGroups,isGroupActive=group.visible;return isAllGroupsActive?`neutral`:isGroupActive?`active`:`inactive`},getGroupColor=(filter,group)=>{switch(getGroupVisualState(filter,group)){case`neutral`:return`var(--bng-off-white)`;case`active`:return`var(--bng-add-green-100)`;case`inactive`:default:return`var(--bng-add-red-300)`}},hasActiveFilters=filter=>{if(!filter||!filter.groups||!Array.isArray(filter.groups))return!1;let visibleGroups=0,totalGroups=0;for(let group of filter.groups)group&&group.elementCount>0&&(totalGroups++,group.visible&&visibleGroups++);return visibleGroups{debugLog$1(`PoiFilters`,`Toggling group visibility`,groupKey),props.store.toggleGroupVisibility(groupKey)},toggleFilterSectionVisibility=filterKey=>{debugLog$1(`PoiFilters`,`Toggling filter section visibility`,filterKey),props.store.toggleFilterSectionVisibility(filterKey)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$272,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(filterData),filterSection=>(openBlock(),createElementBlock(Fragment,{key:filterSection.key},[filterSection&&filterSection.groups?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$224,[createBaseVNode(`div`,{class:normalizeClass([`filter-icon`,{"has-active-filters":hasActiveFilters(filterSection)}]),onClick:$event=>toggleFilterSectionVisibility(filterSection.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(filterSection.title)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:filterSection.icon},null,8,[`type`])]),_:2},1032,[`text`])],10,_hoisted_3$198),_cache[0]||=createBaseVNode(`div`,{class:`filter-separator`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(filterSection.groups,group=>(openBlock(),createElementBlock(Fragment,{key:group.key},[group&&group.elementCount>0?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`filter-group`,{inactive:!group.visible}]),onClick:$event=>toggleGroupVisibility(group.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(group.label)+` ×`+group.elementCount},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:group.icon||`info`,color:getGroupColor(filterSection,group)},null,8,[`type`,`color`])]),_:2},1032,[`text`])],10,_hoisted_4$170)):createCommentVNode(``,!0)],64))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))),128))]))}},PoiFilters_default=__plugin_vue_export_helper_default(_sfc_main$304,[[`__scopeId`,`data-v-43aa27ac`]]);const debugLog=(component,message,data)=>{};function useBigMap(){let selectedPoi=ref(null),selectedPoiIds=ref([]),filterData=ref([]),groupData=ref([]),poiData=ref({}),gameMode=ref(``),levelData=ref({title:``}),isPoiListVisible=ref(!1),isDetailsVisible=ref(!1),{events:events$3}=useBridge(),translatedPreheadings=computed(()=>{let preheadings=[];return gameMode.value&&preheadings.push($translate.instant(`ui.playmodes.${gameMode.value}`)),levelData.value?.title&&preheadings.push($translate.instant(levelData.value.title)),preheadings}),currentFilterTitle=computed(()=>$translate.instant(`bigMap.sideMenu.pois`)),getStaticDataFromLua=async()=>{try{poiData.value=await Lua_default.freeroam_vueBigMap.getPoiData()||{};let gameStateResult=await Lua_default.freeroam_vueBigMap.getGameStateInfo();gameStateResult&&(gameMode.value=gameStateResult.gameMode||``,levelData.value=gameStateResult.levelData||{title:``}),poiData.value,gameMode.value}catch(error){console.error(`Error getting static data from Lua:`,error)}},getDynamicDataFromLua=async()=>{try{filterData.value=await Lua_default.freeroam_vueBigMap.getFilters()||[],groupData.value=await Lua_default.freeroam_vueBigMap.getGroups()||[],filterData.value,groupData.value}catch(error){console.error(`Error getting dynamic data from Lua:`,error)}},handleShowPoiDetails=data=>{let poiIds=data?.poiIds||[];if(selectedPoiIds.value=poiIds,poiIds.length===0){selectedPoi.value=null,isDetailsVisible.value=!1;return}let selectedPoiId=poiIds[0];selectedPoiId&&poiData.value[selectedPoiId]?(selectedPoi.value=poiData.value[selectedPoiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1)},toggleGroupVisibility=async groupKey=>{try{let filterIds=[groupKey];await Lua_default.freeroam_vueBigMap.toggleFiltersByIds(filterIds),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling group visibility:`,error)}},toggleFilterSectionVisibility=async filterKey=>{try{await Lua_default.freeroam_vueBigMap.toggleFilterSectionById(filterKey),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling filter visibility:`,error)}},selectPoi=async poiId=>{try{let result=await Lua_default.freeroam_vueBigMap.selectPoiFromList(poiId);result===`success`?poiId?(selectedPoi.value=poiData.value[poiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1):console.error(`Failed to select POI:`,result)}catch(error){console.error(`Error selecting POI:`,error)}};return{selectedPoi,selectedPoiIds,filterData,groupData,poiData,gameMode,levelData,isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,initialize:async()=>{try{await Lua_default.freeroam_vueBigMap.enterBigMap(),await getStaticDataFromLua(),await getDynamicDataFromLua(),events$3.on(`showPoiDetails`,handleShowPoiDetails)}catch(error){console.error(`Error initializing bigmap:`,error)}},cleanup:async()=>{try{await Lua_default.freeroam_vueBigMap.exitBigMap(),events$3.off(`showPoiDetails`)}catch(error){console.error(`Error cleaning up bigmap:`,error)}},selectPoi,showPoiList:()=>{isPoiListVisible.value=!0},hidePoiList:()=>{isPoiListVisible.value=!1,selectedPoi.value&&selectPoi(null)},onHover:async(poiId,active)=>{try{await Lua_default.freeroam_vueBigMap.hoverPoiFromList(poiId,active)}catch(error){console.error(`Error hovering POI:`,error)}},executePoiAction:async actionId=>{try{await Lua_default.freeroam_vueBigMap.executePoiAction(actionId)}catch(error){console.error(`Error executing POI action:`,error)}},toggleGroupVisibility,toggleFilterSectionVisibility,debugLog}}var _hoisted_1$271={class:`bigmap-container`},_hoisted_2$223={class:`bigmap-content`},_hoisted_3$197={class:`bigmap-left-content`},_hoisted_4$169={class:`bigmap-poilist-outline`},_hoisted_5$146={key:0,class:`bigmap-details-outline`},_sfc_main$303={__name:`BigMap`,setup(__props){let store$1=useBigMap(),{isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,onSetRoute,onTeleport,toggleGroupVisibility,initialize,cleanup,debugLog:debugLog$1}=store$1,handleToggleGroupVisibility=groupKey=>{debugLog$1(`BigMap`,`Toggle group visibility`,groupKey),toggleGroupVisibility(groupKey)};return onMounted(()=>{debugLog$1(`BigMap`,`Component mounted, initializing bigmap`),initialize()}),onUnmounted(()=>{debugLog$1(`BigMap`,`Component unmounted, cleaning up bigmap`),cleanup()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$271,[createVNode(unref(bngScreenHeading_default),{class:`bigmap-heading`,preheadings:unref(translatedPreheadings),divider:!0,type:`line`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(currentFilterTitle)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_2$223,[createBaseVNode(`div`,_hoisted_3$197,[createVNode(PoiFilters_default,{store:unref(store$1),onToggleGroupVisibility:handleToggleGroupVisibility},null,8,[`store`]),createBaseVNode(`div`,_hoisted_4$169,[createVNode(unref(bngDrawer_default),{modelValue:unref(isPoiListVisible),"onUpdate:modelValue":_cache[0]||=$event=>isRef(isPoiListVisible)?isPoiListVisible.value=$event:null,position:`left`,blur:``,header:_ctx.$tt(`bigMap.sideMenu.pois`)},{default:withCtx(()=>[createVNode(PoiList_default,{class:`bigmap-poilist`,store:unref(store$1)},null,8,[`store`])]),_:1},8,[`modelValue`,`header`])])]),_cache[1]||=createBaseVNode(`div`,{class:`bigmap-center-outline`},null,-1),unref(isDetailsVisible)?(openBlock(),createElementBlock(`div`,_hoisted_5$146,[createVNode(PoiDetails_default,{store:unref(store$1),onSetRoute:unref(onSetRoute),onTeleport:unref(onTeleport)},null,8,[`store`,`onSetRoute`,`onTeleport`])])):createCommentVNode(``,!0)])]))}},BigMap_default=__plugin_vue_export_helper_default(_sfc_main$303,[[`__scopeId`,`data-v-e6716bb0`]]),_hoisted_1$270={class:`bigmap-view`},_sfc_main$302={__name:`BigMapView`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$270,[createVNode(BigMap_default)]))}},BigMapView_default=__plugin_vue_export_helper_default(_sfc_main$302,[[`__scopeId`,`data-v-044f4742`]]),routes_default$1=[{path:`/bigmap`,name:`bigmap`,component:BigMapView_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}],_hoisted_1$269={class:`progress-steps`},_hoisted_2$222={class:`step-container`},_hoisted_3$196={class:`step-header`},_hoisted_4$168={class:`step-number`},_hoisted_5$145={class:`step-icon`},_hoisted_6$125={class:`step-label`},_sfc_main$301={__name:`ProgressSteps`,props:{steps:{type:Array,required:!0,validator:steps=>steps.every(step=>step.label&&typeof step.label==`string`||step.title&&typeof step.title==`string`)},currentStep:{type:Number,required:!0,validator:step=>step>=0}},setup(__props){let props=__props,styles={answeredYes:{class:`answered-yes`,icon:`checkboxOn`},answeredNo:{class:`answered-no`,icon:`missionCheckboxCross`},current:{class:`not-answered current`,icon:`arrowLargeRight`},next:{class:`not-answered`,icon:`checkboxOff`}},steps=computed(()=>props.steps.map((step,idx)=>{let answer=step.isAnswered?step.answerType||`yes`:null,status=`next`;return idx(openBlock(),createElementBlock(`div`,_hoisted_1$269,[createBaseVNode(`div`,_hoisted_2$222,[(openBlock(!0),createElementBlock(Fragment,null,renderList(steps.value,(step,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`step`,step.class])},[createBaseVNode(`div`,_hoisted_3$196,[createBaseVNode(`div`,_hoisted_4$168,toDisplayString(index+1),1),step.isLastStep?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`step-connector`},null,-1),createBaseVNode(`div`,_hoisted_5$145,[createVNode(unref(bngIcon_default),{type:step.icon},null,8,[`type`])])],64))]),createBaseVNode(`div`,_hoisted_6$125,toDisplayString(_ctx.$tt(step.label)),1)],2))),128))])]))}},ProgressSteps_default=__plugin_vue_export_helper_default(_sfc_main$301,[[`__scopeId`,`data-v-d5d29cd2`]]);function useWizard(options={}){let{allowSkip=!1,validateSteps=!0}=options,stepRegistry=ref(new Map),currentStepIndex=ref(0),completedSteps=ref(new Set),isFinished=ref(!1),steps=computed(()=>{if(stepRegistry.value.size===0)return[];let res=Array.from(stepRegistry.value.values());for(let step of res)if(!(!step.enabledWhen||step.enabledWhen.length===0)){for(let condition of step.enabledWhen)if(condition.step){let dependencyStep=res.find(s=>s.id===condition.step);if(!dependencyStep)continue;dependencyStep.requiredFor||=[],dependencyStep.requiredFor.includes(step.id)||dependencyStep.requiredFor.push(step.id)}}return res}),registerStep=stepConfig=>stepRegistry.value.set(stepConfig.id,stepConfig),unregisterStep=stepId=>stepRegistry.value.delete(stepId);provide(`registerWizardStep`,registerStep),provide(`unregisterWizardStep`,unregisterStep);let currentStep=computed(()=>steps.value[currentStepIndex.value]||null),isFirstStep=computed(()=>currentStepIndex.value===0),isLastStep=computed(()=>currentStepIndex.value===steps.value.length-1),canGoNext=computed(()=>{if(!validateSteps)return!0;let step=currentStep.value;return!step||!isStepEnabled(step)||step.advanceDisabled?!1:typeof step.validate==`function`?step.validate(step.modelValue||{}):step.type===`choice`&&step.required!==!1?step.modelValue?.choice!==void 0:(step.type,!0)}),isStepEnabled=step=>!step.enabledWhen||step.enabledWhen.length===0?!0:step.enabledWhen.every(condition=>{if(condition.step){let dependencyStepData=steps.value.find(s=>s.id===condition.step)?.modelValue||{};if(condition.value!==void 0)return dependencyStepData?.choice===condition.value||dependencyStepData?.[Object.keys(dependencyStepData)[0]]===condition.value;if(typeof condition.condition==`function`)return condition.condition(dependencyStepData)}return typeof condition.condition==`function`?condition.condition():!0}),canGoBack=computed(()=>!isFirstStep.value),canFinish=computed(()=>validateSteps?isLastStep.value&&canGoNext.value:isLastStep.value),goToStep=index=>{index<=0&&(currentStepIndex.value=0),index>=steps.value.length&&(currentStepIndex.value=steps.value.length-1),currentStepIndex.value=index},nextStep=async()=>{if(await nextTick(),!canGoNext.value)return!1;if(currentStep.value&&completedSteps.value.add(currentStepIndex.value),isLastStep.value)return!0;for(currentStepIndex.value++;currentStepIndex.value=steps.value.length&&(currentStepIndex.value=steps.value.length-1),!0};return{currentStepIndex,currentStep,completedSteps,isFinished,steps,stepRegistry,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress:computed(()=>steps.value.length===0?0:Math.round((currentStepIndex.value+1)/steps.value.length*100)),stepProgress:computed(()=>steps.value.map((step,index)=>{let data=step.modelValue||{},choiceAnalysis=null;if(step.type===`choice`&&step.choices&&data.choice!==void 0){let selectedChoice=step.choices.find(c=>c.value===data.choice),yesChoice=step.choices.find(c=>c.isYes),noChoice=step.choices.find(c=>c.isNo),answerType=null;selectedChoice&&(answerType=selectedChoice.isYes||yesChoice&&selectedChoice.value===yesChoice.value?`yes`:selectedChoice.isNo||noChoice&&selectedChoice.value===noChoice.value?`no`:!yesChoice&&!noChoice?`yes`:step.choices.length===2&&!selectedChoice.isYes&&!selectedChoice.isNo?`no`:`yes`),choiceAnalysis={selectedValue:data.choice,selectedChoice,answerType,hasYesFlag:!!yesChoice,hasNoFlag:!!noChoice}}return{...step,index,isCompleted:completedSteps.value.has(index),isCurrent:index===currentStepIndex.value,isAccessible:index<=currentStepIndex.value,isEnabled:isStepEnabled(step),data,hasData:Object.keys(data).length>0,isAnswered:step.type===`choice`?data.choice!==void 0:Object.keys(data).length>0,answerType:choiceAnalysis?.answerType||null,choiceAnalysis}})),goToStep,nextStep,previousStep:async()=>{if(await nextTick(),!canGoBack.value)return!1;for(currentStepIndex.value--;currentStepIndex.value>=0;){let targetStep=steps.value[currentStepIndex.value];if(isStepEnabled(targetStep)||targetStep.autoSkip===!1)break;currentStepIndex.value--}return currentStepIndex.value<0&&(currentStepIndex.value=0),!0},finish:()=>canFinish.value?(isFinished.value=!0,{success:!0,completedSteps:Array.from(completedSteps.value)}):{success:!1},reset:()=>{currentStepIndex.value=0,completedSteps.value.clear(),isFinished.value=!1},skip:()=>allowSkip?nextStep():!1,isStepEnabled,registerStep,unregisterStep}}var _hoisted_1$268={class:`wizard-container`},_hoisted_2$221={class:`wizard-content`},_hoisted_3$195={class:`wizard-step-content`},_hoisted_4$167={key:0,class:`wizard-validation`},_hoisted_5$144={class:`validation-message`},_hoisted_6$124={class:`wizard-navigation`},_hoisted_7$111={key:2,class:`switch-buttons`};const wizardProps={wizardOptions:{type:Object,default:()=>({})},title:String,preheadings:Array,showDivider:{type:Boolean,default:!0},showProgress:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},allowSkip:{type:Boolean,default:!1},backButtonText:{type:String,default:`ui.common.back`},nextButtonText:{type:String,default:`ui.common.next`},finishButtonText:{type:String,default:`ui.common.finish`},skipButtonText:{type:String,default:`ui.common.skip`},validationMessage:String};var _sfc_main$300={__name:`Wizard`,props:mergeModels(wizardProps,{modelValue:{default:()=>({})},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose,emit:__emit}){let props=__props,modelValue=useModel(__props,`modelValue`),emit$1=__emit,{currentStepIndex,currentStep,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress,stepProgress,nextStep:wizardNextStep,previousStep:wizardPreviousStep,skip:wizardSkip,steps,registerStep:originalRegisterStep}=useWizard({...props.wizardOptions,allowSkip:props.allowSkip}),instance$1=getCurrentInstance(),hasCentralizedModel=computed(()=>!!(instance$1&&instance$1.attrs&&`onUpdate:modelValue`in instance$1.attrs));provide(`currentWizardStep`,currentStep),provide(`wizardNext`,()=>nextStep()),provide(`wizardSteps`,steps),provide(`registerWizardStep`,stepConfig=>hasCentralizedModel.value?originalRegisterStep({...stepConfig,get modelValue(){return modelValue.value?.[stepConfig.id]||{}},updateModelValue:newValue=>{modelValue.value={...modelValue.value,[stepConfig.id]:newValue}}}):originalRegisterStep(stepConfig)),provide(`unregisterWizardStep`,stepId=>{if(hasCentralizedModel.value&&props.modelValue[stepId]){let updatedData={...props.modelValue};delete updatedData[stepId],emit$1(`update:modelValue`,updatedData)}});let currentStepChoices=computed(()=>currentStep.value?.choices||[]),getChoiceButtonClass=(choiceValue,selectedChoice)=>selectedChoice?selectedChoice===choiceValue?`answered-selected`:`answered-not-selected`:`unanswered`,handleChoiceClick=choice=>{currentStep.value?.updateModelValue&&(currentStep.value.updateModelValue({...currentStep.value.modelValue,choice:choice.value}),nextTick(()=>!currentStep.value?.advanceDisabled&&nextStep()))},nextStep=()=>{let stepId=currentStep.value?.id,currentData=currentStep.value?.modelValue||{};emit$1(`step-complete`,{stepId,stepIndex:currentStepIndex.value,step:currentStep.value,data:currentData}),wizardNextStep()&&emit$1(`step-change`,{from:currentStepIndex.value-1,to:currentStepIndex.value,step:currentStep.value})},previousStep=()=>{let prevIndex=currentStepIndex.value;wizardPreviousStep()&&emit$1(`step-change`,{from:prevIndex,to:currentStepIndex.value,step:currentStep.value})},skip=()=>{wizardSkip()&&emit$1(`step-complete`,{stepId:currentStep.value?.id,stepIndex:currentStepIndex.value-1,skipped:!0,data:currentStep.value?.modelValue||{}})},handleFinish=()=>{let allStepData={};steps.value.forEach(step=>{step.modelValue&&Object.keys(step.modelValue).length>0&&(allStepData[step.id]=step.modelValue)}),canFinish.value?emit$1(`wizard-finish`,{success:!0,data:allStepData,completedSteps:Array.from({length:steps.value.length},(_,i)=>i)}):emit$1(`validation-error`,{step:currentStep.value,message:`Cannot finish wizard - validation failed`})};return __expose({currentStepIndex,currentStep,progress,stepProgress,nextStep,previousStep,finish:handleFinish,skip,steps}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$268,[createBaseVNode(`div`,_hoisted_2$221,[_ctx.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:_ctx.preheadings,"show-divider":_ctx.showDivider},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.title)),1)]),_:1},8,[`preheadings`,`show-divider`])):createCommentVNode(``,!0),_ctx.showProgress?(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`wizard-progress-card`},{default:withCtx(()=>[createVNode(ProgressSteps_default,{steps:unref(stepProgress),"current-step":unref(currentStepIndex)},null,8,[`steps`,`current-step`])]),_:1})):createCommentVNode(``,!0),createVNode(unref(bngCard_default),{class:`wizard-main-card`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$124,[_ctx.showBackButton&&!unref(isFirstStep)?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(canGoBack),accent:unref(ACCENTS).secondary,onClick:previousStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.backButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),_ctx.allowSkip&&!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).secondary,onClick:skip},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.skipButtonText)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0),_cache[0]||=createBaseVNode(`div`,{class:`spacer`},null,-1),unref(currentStep)?.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_7$111,[(openBlock(!0),createElementBlock(Fragment,null,renderList(currentStepChoices.value,choice=>(openBlock(),createBlock(unref(bngButton_default),{key:choice.value,class:normalizeClass(getChoiceButtonClass(choice.value,unref(currentStep)?.modelValue?.choice||null)),accent:unref(ACCENTS).custom,icon:unref(currentStep)?.modelValue?.choice===choice.value?unref(icons).checkmark:null,disabled:unref(currentStep)?.advanceDisabled,onClick:$event=>handleChoiceClick(choice)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(choice.label)),1)]),_:2},1032,[`class`,`accent`,`icon`,`disabled`,`onClick`]))),128))])):createCommentVNode(``,!0),!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:!unref(canGoNext),accent:unref(ACCENTS).primary,onClick:nextStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.nextButtonText)),1)]),_:1},8,[`disabled`,`accent`])):unref(isLastStep)?(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:!unref(canFinish),accent:unref(ACCENTS).primary,onClick:handleFinish},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.finishButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[unref(currentStep)?.title?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`step-title`,{step:unref(currentStep)},()=>[createTextVNode(toDisplayString(_ctx.$tt(unref(currentStep).title)),1)],!0)]),_:3})):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$195,[renderSlot(_ctx.$slots,`step`,{step:unref(currentStep),stepData:unref(currentStep)?.modelValue,updateStepData:unref(currentStep)?.updateModelValue,stepIndex:unref(currentStepIndex),isFirst:unref(isFirstStep),isLast:unref(isLastStep)},()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],!0),_ctx.validationMessage?(openBlock(),createElementBlock(`div`,_hoisted_4$167,[createBaseVNode(`div`,_hoisted_5$144,toDisplayString(_ctx.validationMessage),1)])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default)]])]),_:3})])]))}},Wizard_default=__plugin_vue_export_helper_default(_sfc_main$300,[[`__scopeId`,`data-v-69c7b9c4`]]),_sfc_main$299={__name:`WizardView`,props:mergeModels({...wizardProps},{modelValue:{},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose}){let props=__props,slots=useSlots(),wizardRef=ref(),wizardModel=useModel(__props,`modelValue`);return __expose({wizard:wizardRef,get currentStepIndex(){return wizardRef.value?.currentStepIndex},get currentStep(){return wizardRef.value?.currentStep},get progress(){return wizardRef.value?.progress},get stepProgress(){return wizardRef.value?.stepProgress},get steps(){return wizardRef.value?.steps},nextStep:()=>wizardRef.value?.nextStep(),previousStep:()=>wizardRef.value?.previousStep(),finish:()=>wizardRef.value?.finish(),skip:()=>wizardRef.value?.skip()}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`layout-content-full content-center layout-paddings wizard-view`},{default:withCtx(()=>[createVNode(Wizard_default,mergeProps({ref_key:`wizardRef`,ref:wizardRef},props,{modelValue:wizardModel.value,"onUpdate:modelValue":_cache[0]||=$event=>wizardModel.value=$event,onStepChange:_cache[1]||=$event=>_ctx.$emit(`step-change`,$event),onStepComplete:_cache[2]||=$event=>_ctx.$emit(`step-complete`,$event),onWizardFinish:_cache[3]||=$event=>_ctx.$emit(`wizard-finish`,$event),onValidationError:_cache[4]||=$event=>_ctx.$emit(`validation-error`,$event)}),createSlots({_:2},[renderList(unref(slots),(slot,name)=>({name,fn:withCtx(props$1=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(props$1)),void 0,!0)])}))]),1040,[`modelValue`])]),_:3})),[[unref(BngBlur_default)]])}},WizardView_default=__plugin_vue_export_helper_default(_sfc_main$299,[[`__scopeId`,`data-v-e47281c4`]]),_hoisted_1$267={key:0,class:`wizard-summary`},_sfc_main$298={__name:`WizardSummary`,props:{custom:{type:Array,default:()=>[],validator:items$2=>items$2.every(item=>item.label&&item.value!==void 0)},replace:{type:Boolean,default:!1}},setup(__props){let props=__props,steps=inject(`wizardSteps`,ref([])),summaryItems=computed(()=>{let customItems=props.custom.map(item=>({stepId:uniqueId(),title:item.label,selectedLabel:item.value,hasSelection:!item.disabled}));if(props.replace)return customItems;let stepsList=steps.value||[],automaticItems=[];return Array.isArray(stepsList)&&(automaticItems=stepsList.filter(step=>step.type===`choice`&&step.choices&&step.choices.length>0).map(step=>{let selectedChoice=step.modelValue?.choice,choiceOption=step.choices.find(choice=>choice.value===selectedChoice);return{stepId:step.id,title:step.title,selectedLabel:choiceOption?.label||null,hasSelection:!!selectedChoice}}).filter(item=>item.hasSelection)),[...automaticItems,...customItems]});return(_ctx,_cache)=>summaryItems.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$267,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summaryItems.value,item=>(openBlock(),createElementBlock(`div`,{key:item.stepId,class:`summary-item`},[createBaseVNode(`strong`,null,toDisplayString(_ctx.$tt(item.title))+`:`,1),createBaseVNode(`span`,{class:normalizeClass({enabled:item.hasSelection,disabled:!item.hasSelection})},toDisplayString(_ctx.$tt(item.selectedLabel||`ui.common.unknown`)),3)]))),128))])):createCommentVNode(``,!0)}},WizardSummary_default=__plugin_vue_export_helper_default(_sfc_main$298,[[`__scopeId`,`data-v-69c45791`]]),_hoisted_1$266={key:0,class:`wizard-step-container`},_hoisted_2$220={key:0,class:`step-description`},_hoisted_3$194=[`innerHTML`],_hoisted_4$166={class:`step-content`},_hoisted_5$143={key:0,class:`wizard-choice-step`},_hoisted_6$123={key:1,class:`wizard-form-step`},_hoisted_7$110={key:2,class:`wizard-confirmation-step`},_hoisted_8$93={key:3,class:`wizard-custom-step`},_hoisted_9$83={class:`custom-placeholder`},_sfc_main$297={__name:`WizardStep`,props:mergeModels({id:{type:String,required:!0},title:String,description:String,type:{type:String,default:`custom`,validator:value=>[`choice`,`form`,`confirmation`,`custom`].includes(value)},autoSkip:{type:Boolean,default:!0},advanceDisabled:{type:Boolean,default:!1},advanceDelay:{type:Number,default:300},required:{type:Boolean,default:!0},validator:{type:Function,default:null},enabledWhen:{type:Array,default:()=>[]},choices:{type:Array,default:()=>[]},component:{type:[String,Object],default:null},componentProps:{type:Object,default:()=>({})}},{modelValue:{default:()=>({})},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props,{expose:__expose}){let props=__props,modelValue=useModel(__props,`modelValue`),registerStep=inject(`registerWizardStep`,null),unregisterStep=inject(`unregisterWizardStep`,null),currentStep=inject(`currentWizardStep`,null),slots=useSlots(),stepContext={stepId:props.id,stepType:props.type};provide(`wizardStepContext`,stepContext),__expose({stepId:props.id,stepContext});let isCurrentStep=computed(()=>currentStep?.value?.id===props.id);return onMounted(()=>{registerStep?.({id:props.id,title:props.title,description:props.description,type:props.type,autoSkip:props.autoSkip,get advanceDisabled(){return props.advanceDisabled},advanceDelay:props.advanceDelay,required:props.required,enabledWhen:props.enabledWhen,validate:props.validator,component:props.component,componentProps:props.componentProps,choices:props.choices,get modelValue(){return modelValue.value},updateModelValue:value=>{modelValue.value=value},hasDefaultSlot:!!slots.default,hasDescriptionSlot:!!slots.description})}),onUnmounted(()=>{unregisterStep?.(props.id)}),(_ctx,_cache)=>isCurrentStep.value?(openBlock(),createElementBlock(`div`,_hoisted_1$266,[__props.description||_ctx.$slots.description?(openBlock(),createElementBlock(`div`,_hoisted_2$220,[renderSlot(_ctx.$slots,`description`,{},()=>[__props.description?(openBlock(),createElementBlock(`div`,{key:0,innerHTML:__props.description},null,8,_hoisted_3$194)):createCommentVNode(``,!0)],!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$166,[__props.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_5$143,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):__props.type===`form`?(openBlock(),createElementBlock(`div`,_hoisted_6$123,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createBaseVNode(`div`,{class:`form-placeholder`},[createBaseVNode(`p`,null,`Add your form content here using BngInput, BngDropdown, etc.`),createBaseVNode(`p`,{class:`form-note`},`Use v-model bindings to connect to step data.`)],-1)],!0)])):__props.type===`confirmation`?(openBlock(),createElementBlock(`div`,_hoisted_7$110,[renderSlot(_ctx.$slots,`default`,{},()=>[createVNode(WizardSummary_default)],!0)])):(openBlock(),createElementBlock(`div`,_hoisted_8$93,[renderSlot(_ctx.$slots,`default`,{},()=>[createBaseVNode(`div`,_hoisted_9$83,[createBaseVNode(`p`,null,`Custom step content for: `+toDisplayString(__props.title),1),_cache[1]||=createBaseVNode(`p`,{class:`custom-note`},`Add your custom content in the WizardStep default slot`,-1)])],!0)]))])])):createCommentVNode(``,!0)}},WizardStep_default=__plugin_vue_export_helper_default(_sfc_main$297,[[`__scopeId`,`data-v-ede4abc3`]]),_hoisted_1$265={class:`description`},_hoisted_2$219={class:`image-section`},_hoisted_3$193={class:`image-row`},_hoisted_4$165=[`src`],_hoisted_5$142=[`src`],_sfc_main$296={__name:`ButtonLayoutView`,setup(__props){let settings$1=useSettings(),handleFinish=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.mainmenu`)},goToControls=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.options.controls.bindings`)};return onMounted(async()=>{await settings$1.waitForData()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(WizardView_default),{title:`Input Changes`,class:`wizard-view`,"show-progress":!1,"finish-button-text":`ui.common.continue`,onWizardFinish:handleFinish},{default:withCtx(()=>[createVNode(unref(WizardStep_default),{id:`buttonLayout`,title:`Extended Modifier Buttons`,type:`confirmation`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$265,[_cache[1]||=createBaseVNode(`p`,null,` We updated the default button layout for Xbox and Playstation controllers using modifier buttons. Below you see the new default layout. `,-1),_cache[2]||=createBaseVNode(`p`,null,[createBaseVNode(`strong`,{class:`warning-text`},`If you made any changes to the default layout on Xbox or Playstation, we suggest you review your current layout and then either edit it or reset to the default if needed.`)],-1),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:goToControls},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Go to Controls `,-1)]]),_:1},8,[`accent`])])),[[unref(BngUiNavScroll_default)]]),createBaseVNode(`div`,_hoisted_2$219,[_cache[3]||=createBaseVNode(`h4`,null,`New Button Layout`,-1),createBaseVNode(`div`,_hoisted_3$193,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout1.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_4$165),createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout2.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_5$142)])])]),_:1})]),_:1}))}},ButtonLayoutView_default=__plugin_vue_export_helper_default(_sfc_main$296,[[`__scopeId`,`data-v-ff98d0e0`]]),routes_default$2=[{path:`/buttonLayout`,name:`buttonLayout`,component:ButtonLayoutView_default,meta:{infoBar:{visible:!0,showSysInfo:!0},uiApps:{shown:!1}}}],_hoisted_1$264={class:`left`},_hoisted_2$218={class:`branch-icon-assembly`},_hoisted_3$192=[`innerHTML`],_hoisted_4$164=[`innerHTML`],_sfc_main$295={__name:`BranchSkillProgressBar`,props:{skill:Object,mode:{type:String,default:`long`,validator:value=>[`long`,`short`,`simple`,`with-value-label`].includes(value)},showLevel:{type:Boolean,default:!1},showLockedIcon:{type:Boolean,default:!1},isMainProgress:{type:Boolean,default:!1}},setup(__props){let props=__props,headerLeft=computed(()=>props.skill.name),headerRightLevelOrStars=computed(()=>props.skill.isInDevelopment?``:props.skill.unlocked?(props.showLevel&&props.skill.unlocked,props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:props.skill.value,max:props.skill.max}}):props.skill.levelLabel?props.skill.levelLabel:props.skill.level?$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}}):`Level ${props.skill.level}`):$translate.contextTranslate(`ui.career.locked`)),value=computed(()=>props.skill.max===-1?1:props.skill.value-props.skill.min),max$1=computed(()=>props.skill.max===-1?1:props.skill.max-props.skill.min),valueLabelFormat=computed(()=>{if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(!props.skill.unlocked)return $translate.contextTranslate(`ui.career.locked`);if(props.mode===`simple`)return props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:value.value,max:max$1.value}}):$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}});let unit=props.skill.showProgressAsStars?`Stars`:`XP`;return props.skill.max===-1?$translate.contextTranslate({txt:`ui.career.just`+unit,context:{cur:value.value}}):$translate.contextTranslate({txt:`ui.career.slashXP`,context:{cur:value.value,max:max$1.value}})}),skillIcon=computed(()=>props.skill.isInDevelopment?icons.roadblockL:props.skill.unlocked?props.skill.icon||`info`:`lockClosed`),belowValueLabelFormat=computed(()=>{if(!props.skill.unlocked&&props.skill.lockedReason)return $translate.contextTranslate(props.skill.lockedReason?.label||`ui.career.locked`);if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(props.skill.isMaxLevel)return`​`;if(!props.skill.showProgressAsStars)return $translate.contextTranslate({txt:`ui.career.justXP`,context:{cur:props.skill.value}})}),branchBackgroundStyle=computed(()=>{let color=props.skill.accentColor;return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}});return(_ctx,_cache)=>__props.mode===`simple`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`simple-progress`,{"is-locked":!props.skill.unlocked}])},[createBaseVNode(`div`,_hoisted_1$264,[createBaseVNode(`div`,_hoisted_2$218,[!__props.skill.isSkill&&!__props.skill.isBranch?(openBlock(),createElementBlock(`div`,{key:0,class:`branch-background`,style:normalizeStyle(branchBackgroundStyle.value)},null,4)):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{type:skillIcon.value,class:`assembly-icon`},null,8,[`type`])]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(headerLeft.value)),1)]),createBaseVNode(`div`,{class:`right`,innerHTML:valueLabelFormat.value},null,8,_hoisted_3$192)],2)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`flex-column`,{"is-locked":!props.skill.unlocked}])},[createVNode(unref(bngProgressBar_default),{class:normalizeClass([`stat-progress-bar`,{short:__props.mode===`short`,isMainProgress:__props.isMainProgress}]),headerLeft:_ctx.$ctx_t(headerLeft.value),headerRight:_ctx.$ctx_t(headerRightLevelOrStars.value),value:value.value,max:max$1.value+.001,showValueLabel:!0,valueLabelFormat:``,valueColor:`#eeeeee`},null,8,[`class`,`headerLeft`,`headerRight`,`value`,`max`]),!props.skill.unlocked&&__props.mode===`with-value-label`&&props.showLockedIcon?(openBlock(),createElementBlock(Fragment,{key:0},[],64)):createCommentVNode(``,!0),__props.mode===`with-value-label`?(openBlock(),createElementBlock(`div`,{key:1,class:`below-progress-bar`,innerHTML:belowValueLabelFormat.value},null,8,_hoisted_4$164)):createCommentVNode(``,!0)],2))}},BranchSkillProgressBar_default=__plugin_vue_export_helper_default(_sfc_main$295,[[`__scopeId`,`data-v-2f641a65`]]);function hexToRgb(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}function getBranchColorStyle({color,accentColor}){let style={};color&&(color.startsWith(`#`)?style[`--branch-color`]=hexToRgb(color):color.startsWith(`var(--`)&&(style[`--branch-color`]=color));let accent=accentColor||color;return accent&&(accent.startsWith(`#`)?style[`--branch-accent-color`]=hexToRgb(accent):accent.startsWith(`var(--`)&&(style[`--branch-accent-color`]=accent)),style}function getIconBackgroundStyle(color){return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}}var _hoisted_1$263={class:`branch-details`},_hoisted_2$217={class:`backdrop`},_hoisted_3$191={class:`skill-levels-wrapper`},_hoisted_4$163={key:0,class:`branch-name-container`},_hoisted_5$141={key:2,class:`branch-footer`},_hoisted_6$122={key:0,class:`branch-description`},_hoisted_7$109={key:0,class:`branch-description`},_hoisted_8$92={class:`branch-footer-content`},_hoisted_9$82={class:`certification-text`},_hoisted_10$72={class:`status`},_hoisted_11$65={class:`unlock-info-row`},_hoisted_12$53={class:`icon-box`},_hoisted_13$46={class:`certification-text`},_sfc_main$294={__name:`BranchSkillCard`,props:{branchKey:String,displayMode:{type:String,default:`card`}},emits:[`openBranchPage`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,branchData=ref();computed(()=>branchData.value&&`url(${getAssetURL(branchData.value.icon)})`);let branchColor=computed(()=>{let color=branchData.value&&branchData.value.color;return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchAccentColor=computed(()=>{let color=branchData.value&&(branchData.value.accentColor||branchData.value.color);return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchIconType=computed(()=>branchData.value&&branchData.value.isInDevelopment?icons.roadblockL:branchData.value&&branchData.value.unlocked?icons[branchData.value.glyphIcon]:icons.lockClosed),isHalf=computed(()=>{if(!branchData.value)return!1;let hasSkills=branchData.value.skills&&branchData.value.skills.length>0,hasDescription=branchData.value.shortDescription;return!hasSkills&&!hasDescription}),safeArray=arr=>Array.isArray(arr)?arr:[],openBranchPage=branchKey=>emit$1(`openBranchPage`,branchKey);function setup$3(data){branchData.value=data,branchData.value.skills=safeArray(data.skills)}let formatColor=color=>color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`rgb(255, 255, 255)`:``;return onMounted(async()=>{setup$3(await Lua_default.career_modules_branches_landing.getBranchSkillCardData(props.branchKey))}),(_ctx,_cache)=>branchData.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:normalizeClass([`branch-skill-card`,{"row-mode":__props.displayMode===`row`,locked:!branchData.value.unlocked,half:isHalf.value}]),onClick:_cache[0]||=$event=>openBranchPage(__props.branchKey),style:normalizeStyle({"--branch-color":branchColor.value,"--branch-accent-color":branchAccentColor.value})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$263,[_cache[2]||=createBaseVNode(`div`,{class:`indicator left`},null,-1),_cache[3]||=createBaseVNode(`div`,{class:`indicator right`},null,-1),branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`branch-progress`,{"in-development":branchData.value.isInDevelopment}])},[branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`badge`,{"row-badge":__props.displayMode===`row`}])},[createBaseVNode(`div`,_hoisted_2$217,toDisplayString(branchData.value.value.color),1),createVNode(unref(bngIcon_default),{class:`icon-branch`,type:branchIconType.value},null,8,[`type`])],2))],2)),branchData.value.isDomain?(openBlock(),createBlock(unref(aspectRatio_default),{key:1,"external-image":branchData.value.cover,ratio:`16:9`,class:`image-container aspect-ratio`},null,8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$191,[__props.displayMode===`row`?(openBlock(),createElementBlock(`div`,_hoisted_4$163,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,class:`main-stat-progress-bar`,skill:branchData.value,showLevel:!0,mode:(branchData.value.isInDevelopment&&isHalf.value,``)},null,8,[`skill`,`mode`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),isHalf.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$141,[branchData.value.isInDevelopment?(openBlock(),createElementBlock(`div`,_hoisted_6$122,toDisplayString(_ctx.$ctx_t(`ui.career.inDevelopment`)),1)):(openBlock(),createElementBlock(Fragment,{key:1},[branchData.value.shortDescription?(openBlock(),createElementBlock(`div`,_hoisted_7$109,toDisplayString(_ctx.$ctx_t(branchData.value.shortDescription)),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_8$92,[branchData.value.skills?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(branchData.value.skills,skill=>(openBlock(),createElementBlock(`div`,null,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,skill,mode:`simple`},null,8,[`skill`])):createCommentVNode(``,!0)]))),256)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.certifications,certification=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`certification-container`,certification.status])},[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,style:normalizeStyle({color:certification.status===`completed`?`white`:certification.status===`available`?`rgba(255, 255, 255, 0.6)`:`rgba(255, 255, 255, 0.5)`})},null,8,[`type`,`style`]),createBaseVNode(`div`,_hoisted_9$82,[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.certification.name`))+` `,1),createBaseVNode(`span`,_hoisted_10$72,toDisplayString(_ctx.$ctx_t(certification.statusLabel)),1)])],2))),256)),branchData.value.unlockInfos?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[1]||=createBaseVNode(`div`,{class:`unlock-info-title`},`Required Certifications:`,-1),createBaseVNode(`div`,_hoisted_11$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.unlockInfos,unlockInfo=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`unlock-info-item`,unlockInfo.status]),style:normalizeStyle({"--unlock-color":formatColor(unlockInfo.color?unlockInfo.color:`var(--bng-cool-gray-500-rgb)`)})},[createBaseVNode(`div`,_hoisted_12$53,[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,class:`certification-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_13$46,toDisplayString(_ctx.$ctx_t(unlockInfo.label)),1)],6))),256))])],64)):createCommentVNode(``,!0)])],64))]))])]),_:1},8,[`class`,`style`])):createCommentVNode(``,!0)}},BranchSkillCard_default=__plugin_vue_export_helper_default(_sfc_main$294,[[`__scopeId`,`data-v-4321db2f`]]),_hoisted_1$262={class:`condensed`},_hoisted_2$216={key:3,class:`dev-icon-container`},_hoisted_3$190={class:`main-info`},_hoisted_4$162={key:1,class:`stars`},_sfc_main$293={__name:`MissionCard`,props:{mission:Object,isSkeleton:Boolean,showStartableIcons:Boolean},emits:[`clicked`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clicked=()=>emit$1(`clicked`,props.mission),backgroundImageStyle=computed(()=>({backgroundImage:`url(${props.mission.thumbnail})`,maskImage:`linear-gradient(to left, rgba(0, 0, 0, ${props.mission.startable?.75:.2}) 50%, rgba(0, 0, 0, 0.1) 100%)`,filter:props.mission.startable?`none`:`grayscale(100%)`})),iconType$1=computed(()=>props.isSkeleton?icons.medal:icons[props.mission.icon]||icons.medal),iconColor=computed(()=>props.isSkeleton||!props.mission.startable?`var(--bng-cool-gray-600)`:`#fff`),showStartableIcons=computed(()=>!props.isSkeleton&&props.showStartableIcons);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,onClick:clicked,class:normalizeClass({"card-wrapper":!0,"click-startable":__props.mission&&__props.mission.startable})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$262,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,style:normalizeStyle(backgroundImageStyle.value)},null,8,[`style`])),!__props.isSkeleton&&!__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).lockClosed,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.isSkeleton&&showStartableIcons.value?(openBlock(),createElementBlock(Fragment,{key:2},[__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`locked-icon`,type:unref(icons).play,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).mapPoint,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),!__props.isSkeleton&&__props.mission.devMission?(openBlock(),createElementBlock(`div`,_hoisted_2$216,[createVNode(unref(bngIcon_default),{class:`dev-icon`,type:unref(icons).bug,color:`white`},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`dev-text`},` DEV MISSION `,-1)])):createCommentVNode(``,!0),_cache[1]||=createBaseVNode(`div`,{class:`highlight-marker`},null,-1),createVNode(unref(bngIcon_default),{class:`mission-icon`,type:iconType$1.value,color:iconColor.value},null,8,[`type`,`color`]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``}),createBaseVNode(`div`,_hoisted_3$190,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`heading`,{locked:!__props.mission.startable}])},toDisplayString(_ctx.$tt(__props.mission.label)),3)),!__props.isSkeleton&&__props.mission.startable&&__props.mission.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_4$162,[__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalDefaultStarCount?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:__props.mission.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0),__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:__props.mission.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])]),_:1},8,[`class`]))}},MissionCard_default=__plugin_vue_export_helper_default(_sfc_main$293,[[`__scopeId`,`data-v-52ea67db`]]),_hoisted_1$261={class:`rewards-pills-container`},_sfc_main$292={__name:`RewardPill`,props:{icon:String,attributeKey:String,rewardAmount:Number,highlight:Boolean,hideNumbers:Boolean,backgroundColor:{type:String,default:`rgba(var(--bng-cool-gray-900-rgb), 0.5)`}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$261,[createBaseVNode(`div`,{class:`pill`,style:normalizeStyle({backgroundColor:__props.backgroundColor,filter:__props.highlight?`brightness(350%)`:``})},[createVNode(unref(bngUnit_default),mergeProps({[__props.icon?`beamXP`:__props.attributeKey]:__props.rewardAmount},{options:__props.hideNumbers?{formatter:x=>null}:null,iconType:__props.icon?unref(icons)[__props.icon]:null,formatter:__props.attributeKey}),null,16,[`options`,`iconType`,`formatter`])],4)]))}},RewardPill_default=__plugin_vue_export_helper_default(_sfc_main$292,[[`__scopeId`,`data-v-7719e2fc`]]),_hoisted_1$260={class:`rewards-pills-container`},_sfc_main$291={__name:`RewardsPills`,props:{rewards:Object,hideNumbers:Boolean,negativeBackground:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$260,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.rewards,reward=>(openBlock(),createBlock(RewardPill_default,{icon:reward.icon,hideNumbers:__props.hideNumbers,attributeKey:reward.attributeKey,rewardAmount:reward.rewardAmount,highlight:reward.highlight,backgroundColor:__props.negativeBackground&&reward.rewardAmount<0?`rgba(var(--bng-add-red-700-rgb), 0.5)`:void 0},null,8,[`icon`,`hideNumbers`,`attributeKey`,`rewardAmount`,`highlight`,`backgroundColor`]))),256))]))}},RewardsPills_default=__plugin_vue_export_helper_default(_sfc_main$291,[[`__scopeId`,`data-v-40e5103d`]]),_hoisted_1$259={key:0,class:`animated-border claimable`},_hoisted_2$215={key:1,class:`complete`},_hoisted_3$189={key:0,class:`complete`},_hoisted_4$161={key:1,class:`complete-badge`},_hoisted_5$140={key:2,class:`step`},_hoisted_6$121={key:3,class:`step`},_hoisted_7$108={class:`content`},_hoisted_8$91={class:`heading`},_hoisted_9$81={key:0,class:`middle-content`},_hoisted_10$71={key:1,class:`middle-content`},_hoisted_11$64={key:3,class:`progress`},_sfc_main$290={__name:`MilestoneCard`,props:{milestone:Object,isCondensed:Boolean},emits:[`claim`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,claimMilestone=()=>{console.log(`claimMilestone`,props.milestone),props.milestone.claimable&&(emit$1(`claim`,props.milestone),console.log(props.milestone))},milestoneColor=computed(()=>{let color=props.milestone.color;return color?color.startsWith(`#`)?hexToRgb$1(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``});function hexToRgb$1(hex){return`${parseInt(hex.slice(1,3),16)}, ${parseInt(hex.slice(3,5),16)}, ${parseInt(hex.slice(5,7),16)}`}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{"bng-nav-item":``,onClick:claimMilestone,class:`condensed`},[__props.milestone.claimable?(openBlock(),createElementBlock(`div`,_hoisted_1$259)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_2$215)):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,style:normalizeStyle({backgroundColor:`rgb(`+milestoneColor.value+`)`}),ratio:`21:9`},{default:withCtx(()=>[__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_3$189)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_4$161,[createVNode(unref(bngIcon_default),{class:`glyph small`,type:unref(icons).checkmark},null,8,[`type`])])):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.milestone.icon]},null,8,[`type`]),__props.milestone.step!==void 0&&__props.milestone.maxStep!==void 0?(openBlock(),createElementBlock(`div`,_hoisted_5$140,toDisplayString(__props.milestone.step)+`/`+toDisplayString(__props.milestone.maxStep),1)):createCommentVNode(``,!0),__props.milestone.step!==void 0&&__props.milestone.maxStep===void 0?(openBlock(),createElementBlock(`div`,_hoisted_6$121,toDisplayString(__props.milestone.step),1)):createCommentVNode(``,!0)]),_:1},8,[`style`]),createBaseVNode(`div`,_hoisted_7$108,[createBaseVNode(`div`,_hoisted_8$91,toDisplayString(_ctx.$ctx_t(__props.milestone.label)),1),__props.milestone.description?(openBlock(),createElementBlock(`div`,_hoisted_9$81,toDisplayString(_ctx.$ctx_t(__props.milestone.description)),1)):createCommentVNode(``,!0),__props.milestone.rewards?(openBlock(),createElementBlock(`div`,_hoisted_10$71,[createVNode(RewardsPills_default,{rewards:__props.milestone.rewards},null,8,[`rewards`])])):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,value:1,max:1,min:0,valueLabelFormat:`Complete!`,class:`progress`})):createCommentVNode(``,!0),__props.milestone.progress?(openBlock(),createElementBlock(`div`,_hoisted_11$64,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.milestone.progress,prog=>(openBlock(),createBlock(unref(bngProgressBar_default),{class:normalizeClass({claimProgressBar:__props.milestone.claimable}),value:prog.currValue,max:prog.maxValue,min:prog.minValue,valueLabelFormat:__props.milestone.claimable?`Click to claim!`:_ctx.$ctx_t(prog.label)},null,8,[`class`,`value`,`max`,`min`,`valueLabelFormat`]))),256))])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])}},MilestoneCard_default=__plugin_vue_export_helper_default(_sfc_main$290,[[`__scopeId`,`data-v-8fc3424a`]]),_hoisted_1$258={class:`progress-track`},_hoisted_2$214={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_3$188={class:`header`},_hoisted_4$160={class:`name`},_hoisted_5$139={key:0,class:`stars`},_hoisted_6$120={key:1,class:`stars`},_hoisted_7$107={class:`info`},_hoisted_8$90={class:`unlock-condition`},_hoisted_9$80={class:`info`},_hoisted_10$70={class:`label`},_hoisted_11$63={class:`description`},_hoisted_12$52={key:0,class:`cards-container`},_hoisted_13$45={class:`basic-card locked coming-soon`},_hoisted_14$42={class:`label`},_hoisted_15$40={key:1,class:`right`},_sfc_main$289={__name:`LeagueRow`,props:{league:Object,leagueMissionClicked:Function,condensed:Boolean,vertical:Boolean,nowUnlocked:Boolean},setup(__props){let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let leagueStyle=computed(()=>{if(!props.league.accentColor)return{};let style={};return props.league.accentColor.startsWith(`#`)?style[`--league-accent-color`]=hexToRgb$1(props.league.accentColor):props.league.accentColor.startsWith(`var(--`)&&(style[`--league-accent-color`]=props.league.accentColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`league-row`,{locked:!__props.league._unlocked,condensed:__props.condensed}]),style:normalizeStyle(leagueStyle.value)},[createBaseVNode(`div`,_hoisted_1$258,[__props.league._unlocked?(openBlock(),createElementBlock(`div`,_hoisted_2$214)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$188,[createBaseVNode(`div`,_hoisted_4$160,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.league.icon],class:`skill-icon`,color:__props.league._unlocked?`white`:`gray`},null,8,[`type`,`color`]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(__props.league.name)),1)]),__props.nowUnlocked?(openBlock(),createElementBlock(`div`,_hoisted_6$120,[createVNode(unref(bngIcon_default),{type:unref(icons).lockOpened},null,8,[`type`])])):(openBlock(),createElementBlock(`div`,_hoisted_5$139,[__props.league._unlocked?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"unlocked-stars":__props.league.totalStarsObtained,"total-stars":__props.league.totalStarsAvailable,class:`main-stars`,scale:.8,reverse:``,numerical:``},null,8,[`unlocked-stars`,`total-stars`])):createCommentVNode(``,!0)]))]),createBaseVNode(`div`,{class:normalizeClass([`content-row`,{vertical:__props.vertical}])},[createBaseVNode(`div`,_hoisted_7$107,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.unlock,cond=>(openBlock(),createElementBlock(Fragment,null,[cond.hidden?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCard_default),{key:0},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$90,[createBaseVNode(`div`,_hoisted_9$80,[createVNode(unref(bngIcon_default),{class:`icon`,type:cond.met?unref(icons).lockOpened:unref(icons).lockClosed,color:cond.met?`white`:`gray`},null,8,[`type`,`color`]),createBaseVNode(`div`,_hoisted_10$70,toDisplayString(cond.label),1)]),cond.progress?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:cond.progress.cur,min:cond.progress.min,max:cond.progress.max,valueLabelFormat:``,class:`progress`},null,8,[`value`,`min`,`max`])):createCommentVNode(``,!0)])]),_:2},1024))],64))),256)),createBaseVNode(`div`,_hoisted_11$63,toDisplayString(_ctx.$ctx_t(__props.league.description)),1)]),__props.condensed?(openBlock(),createElementBlock(`div`,_hoisted_15$40,toDisplayString(__props.league.missions.length)+` Challenges `,1)):(openBlock(),createElementBlock(`div`,_hoisted_12$52,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.missions,mission=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:mission.id,mission,onClicked:__props.leagueMissionClicked,showStartableIcons:!0},null,8,[`mission`,`onClicked`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.driftSpots,driftSpot=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:driftSpot.id,mission:driftSpot,onClicked:__props.leagueMissionClicked},null,8,[`mission`,`onClicked`]))),128)),__props.league.comingSoon?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.league.comingSoon,info=>(openBlock(),createBlock(unref(bngCard_default),{class:`card-height`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_13$45,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[info.icon],color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_14$42,toDisplayString(info.label),1)])]),_:2},1024))),256)):createCommentVNode(``,!0)]))],2)],6))}},LeagueRow_default=__plugin_vue_export_helper_default(_sfc_main$289,[[`__scopeId`,`data-v-f92a650f`]]),_hoisted_1$257={class:`label`},_hoisted_2$213={class:`text`},_hoisted_3$187={class:`description`},_sfc_main$288={__name:`TaskGoal`,props:{label:[String,Object],description:[String,Object],complete:Boolean,success:Boolean,settings:{type:Object,default:{animate:!1,animateOnMount:!1,successCallback:Function}}},setup(__props){let props=__props,slots=useSlots(),animationSettings=inject(`animationSettings`,props.settings),animate=ref(!1),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description,!0))),checkboxSvgs=computed(()=>({"--checkbox-empty":`url(${getAssetURL(`icons/general/checkbox-empty.svg`)})`,"--checkbox-ok":`url(${getAssetURL(`icons/general/checkbox-ok.svg`)})`,"--checkbox-nope":`url(${getAssetURL(`icons/general/checkbox-nope.svg`)})`}));return watch(()=>[props.complete,props.success],(newValues,oldValues)=>{let isComplete=newValues[0],isSuccess=newValues[1];animate.value=animationSettings.animate&&isComplete,isSuccess&&animationSettings.successCallback()}),onBeforeMount(()=>{animate.value=props.settings.animate&&props.settings.animateOnMount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`task-goal`,{success:__props.complete&&__props.success,fail:__props.complete&&!__props.success,animate:animate.value}])},[createBaseVNode(`div`,_hoisted_1$257,[createBaseVNode(`span`,{class:`checkbox`,style:normalizeStyle(checkboxSvgs.value)},null,4),createBaseVNode(`span`,_hoisted_2$213,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]),createBaseVNode(`span`,_hoisted_3$187,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])],2))}},TaskGoal_default=__plugin_vue_export_helper_default(_sfc_main$288,[[`__scopeId`,`data-v-5a381682`]]),_hoisted_1$256={key:0,class:`wrapper`},_hoisted_2$212={class:`heading`},_hoisted_3$186={class:`description`},_hoisted_4$159={key:1,class:`tasklist wrapper`},_hoisted_5$138={class:`task-content`},_hoisted_6$119={class:`heading`},_hoisted_7$106={class:`description`},_sfc_main$287={__name:`UnlockCard`,props:{data:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[__props.data.type==`tasklist`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$256,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[__props.data.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_2$212,toDisplayString(__props.data.heading),1),createBaseVNode(`div`,_hoisted_3$186,toDisplayString(__props.data.description),1)])),__props.data.type==`tasklist`?(openBlock(),createElementBlock(`div`,_hoisted_4$159,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.data.tasklistData.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_5$138,[createBaseVNode(`div`,_hoisted_6$119,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_7$106,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0)],64))}},UnlockCard_default=__plugin_vue_export_helper_default(_sfc_main$287,[[`__scopeId`,`data-v-c5fa6ca1`]]),_hoisted_1$255={class:`unlock-rows`},_hoisted_2$211={class:`rows-container`},_hoisted_3$185={class:`progress-track`},_hoisted_4$158={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_5$137={class:`header`},_hoisted_6$118={class:`level-name-and-heading`},_hoisted_7$105={class:`level-label`},_hoisted_8$89={key:0,class:`description-heading`},_hoisted_9$79={class:`content-row`},_hoisted_10$69={class:`description-column`},_hoisted_11$62={class:`unlock-condition`},_hoisted_12$51={class:`info`},_hoisted_13$44={class:`label`},_hoisted_14$41={key:1,class:`description-text`},_hoisted_15$39={class:`unlocks-column`},_hoisted_16$38={key:0,class:`unlocks-list`},_sfc_main$286={__name:`UnlockRows`,props:{value:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,required:!0},maxRequiredValue:{type:Number,required:!1},tiers:Array,currentTier:Number,unlocked:Boolean,progressFillColor:{type:String,default:`#ff6600`}},setup(__props){useCssVars(_ctx=>({v1b3c87f1:props.progressFillColor.startsWith(`var(--`)&&props.progressFillColor.endsWith(`-rgb)`)?`rgb(${props.progressFillColor})`:props.progressFillColor}));let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let progressStyle=computed(()=>{if(!props.progressFillColor)return{};let style={};return props.progressFillColor.startsWith(`#`)?style[`--progress-fill-color`]=hexToRgb$1(props.progressFillColor):props.progressFillColor.startsWith(`var(--`)&&(style[`--progress-fill-color`]=props.progressFillColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$255,[createBaseVNode(`div`,_hoisted_2$211,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.tiers,(tier,idx)=>(openBlock(),createElementBlock(`div`,{key:tier.index,class:normalizeClass({"tier-row":!0,"grayed-out":__props.currentTier<=tier.index-1,completed:__props.currentTier+1>tier.index,"in-development":tier.isInDevelopment,"first-tier":idx===0,"last-tier":idx===__props.tiers.length-1})},[createBaseVNode(`div`,_hoisted_3$185,[__props.currentTier+1>tier.index?(openBlock(),createElementBlock(`div`,_hoisted_4$158)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$137,[createBaseVNode(`div`,_hoisted_6$118,[createBaseVNode(`span`,_hoisted_7$105,`Level `+toDisplayString(tier.label?tier.label:tier.index),1),tier.description&&tier.description.heading?(openBlock(),createElementBlock(`span`,_hoisted_8$89,`: `+toDisplayString(tier.description.heading),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$79,[createBaseVNode(`div`,_hoisted_10$69,[tier.isInDevelopment||__props.currentTier+1<=tier.index||!__props.unlocked?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`unlock-condition-card`,style:normalizeStyle(progressStyle.value)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_11$62,[createBaseVNode(`div`,_hoisted_12$51,[createVNode(unref(bngIcon_default),{class:`icon`,type:tier.isInDevelopment?unref(icons).roadblockL:unref(icons).lockClosed,color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_13$44,[tier.isInDevelopment?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Coming Soon! `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(tier.xpCurrent)+` / `+toDisplayString(tier.xpRequired)+` XP `,1)],64))])]),!tier.isInDevelopment&&tier.currentValue&&tier.requiredValue?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:tier.xpCurrent,min:0,max:tier.xpRequired,valueLabelFormat:``,class:`progress`},null,8,[`value`,`max`])):createCommentVNode(``,!0)])]),_:2},1032,[`style`])):createCommentVNode(``,!0),tier.description&&tier.description.description?(openBlock(),createElementBlock(`div`,_hoisted_14$41,toDisplayString(tier.description.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$39,[tier.list&&tier.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$38,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tier.list,(item,idx$1)=>(openBlock(),createBlock(UnlockCard_default,{key:idx$1,class:`unlock-item`,data:item},null,8,[`data`]))),128))])):createCommentVNode(``,!0)])])],2))),128))])]))}},UnlockRows_default=__plugin_vue_export_helper_default(_sfc_main$286,[[`__scopeId`,`data-v-ec31f890`]]),_hoisted_1$254={class:`flex-row`},_hoisted_2$210={class:`player-content`},_hoisted_3$184={class:`stats-row`},_hoisted_4$157={class:`stat-content`},_sfc_main$285={__name:`careerSimpleStats`,setup(__props,{expose:__expose}){let careerStatsData=ref({}),handleCareerSimpleStats=data=>{data.branches.forEach(entry=>{entry.hasOwnProperty(`levelLabel`)&&(entry.name=$translate.contextTranslate(entry.name,!0),entry.levelLabel=$translate.contextTranslate(entry.levelLabel,!0))}),careerStatsData.value=data},updateDisplay=()=>{Lua_default.career_modules_uiUtils.getCareerSimpleStats().then(handleCareerSimpleStats)};return onMounted(()=>{updateDisplay()}),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$254,[createBaseVNode(`div`,_hoisted_2$210,toDisplayString(careerStatsData.value.saveSlotName),1),createBaseVNode(`div`,_hoisted_3$184,[(openBlock(!0),createElementBlock(Fragment,null,renderList(careerStatsData.value.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_4$157,[createVNode(unref(bngProgressBar_default),{class:`stat-progress-bar`,headerLeft:branch.name,headerRight:branch.levelLabel,min:branch.min,value:branch.value,max:branch.max},null,8,[`headerLeft`,`headerRight`,`min`,`value`,`max`])]))),256))])]))}},careerSimpleStats_default=__plugin_vue_export_helper_default(_sfc_main$285,[[`__scopeId`,`data-v-94a9390d`]]),_sfc_main$284={__name:`careerStatus`,props:{slim:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let careerStatusData=ref({}),handleCareerStatusData=data=>careerStatusData.value=data,updateDisplay=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(handleCareerStatusData);return onMounted(updateDisplay),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`career-status-progress`,{slim:__props.slim}])},[createVNode(unref(bngUnit_default),{class:`career-status-value`,insuranceScore:careerStatusData.value.insuranceScore},null,8,[`insuranceScore`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,vouchers:careerStatusData.value.vouchers},null,8,[`vouchers`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,money:careerStatusData.value.money},null,8,[`money`])],2)]))}},careerStatus_default=__plugin_vue_export_helper_default(_sfc_main$284,[[`__scopeId`,`data-v-0446c53b`]]),_hoisted_1$253={key:0},_sfc_main$283={__name:`TutorialButton`,props:{text:{type:String,default:``},icon:{type:Object,default:()=>icons.questionmark},pages:{type:Object,default:[]}},setup(__props){let props=__props,buttonRef=ref(null),seen$3=ref(!0);function clickHandler(){for(let key of props.pages)Lua_default.career_modules_linearTutorial.introPopup(key,!0);seen$3.value=!0}return onMounted(()=>{}),onUnmounted(()=>{}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`buttonRef`,ref:buttonRef,class:normalizeClass([`tut-btn`,{blink:!seen$3.value}]),icon:__props.icon,onClick:withModifiers(clickHandler,[`stop`])},{default:withCtx(()=>[__props.text?(openBlock(),createElementBlock(`span`,_hoisted_1$253,toDisplayString(__props.text),1)):createCommentVNode(``,!0)]),_:1},8,[`icon`,`class`])),[[unref(BngTooltip_default),__props.text?void 0:`View tutorial for this section`]])}},TutorialButton_default=__plugin_vue_export_helper_default(_sfc_main$283,[[`__scopeId`,`data-v-3e539b42`]]),_hoisted_1$252={class:`content`},_hoisted_2$209={class:`insurance-perks-div`},_hoisted_3$183={key:0,class:`leaving-insurance-wrapper`},_hoisted_4$156={class:`breakdown-items-wrapper`},_hoisted_5$136={class:`breakdown-item`},_hoisted_6$117={class:`orange-price`},_hoisted_7$104={class:`breakdown-item`},_hoisted_8$88={class:`red-price`},_hoisted_9$78={class:`breakdown-item total`},_hoisted_10$68={class:`breakdown-item-value-total green-price`},_hoisted_11$61={key:1,class:`no-insurance-wrapper`},_hoisted_12$50={key:2,class:`group-discount-wrapper`},_hoisted_13$43={class:`group-discount-icon-wrapper`},_hoisted_14$40={class:`group-discount-main-text`},_hoisted_15$38={class:`tier-text`},_hoisted_16$37={class:`tier-text`},_hoisted_17$31={class:`discount-text`},_hoisted_18$28={class:`grey-small-text`},_hoisted_19$24={key:3,class:`price-details-wrapper`},_hoisted_20$20={class:`price-tile`},_hoisted_21$18={key:0,class:`old-price-wrapper`},_hoisted_22$16={class:`old-price`},_hoisted_23$15={class:`price-tile-value-wrapper`},_hoisted_24$14={key:1,class:`deductible-discount`},_hoisted_25$13={class:`price-tile`},_hoisted_26$11={class:`price-tile-title`},_hoisted_27$11={class:`price-tile-value-wrapper`},_hoisted_28$10={class:`premium-extra-info`},_hoisted_29$10={class:`renewal-distance`},_sfc_main$282={__name:`insuranceCard`,props:{insuranceData:Object,isSelected:Boolean,isCurrentProvider:{type:Boolean,default:!1}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,{units}=useBridge(),emit$1=__emit,hasNoInsurance=computed(()=>props.insuranceData?.id===-1),pillText=computed(()=>{if(props.isCurrentProvider)return`CURRENT PROVIDER`;if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime)return`MULTI-VEHICLE DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.willBumpTheirDiscount)return`BIGGER DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.currentTierData&&props.insuranceData.groupDiscountData?.currentTierData.id>0)return`MULTI-VEHICLE DISCOUNT ACTIVE`}return null}),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingInsuranceRenewsInFormatted=computed(()=>props.insuranceData?.leavingInsuranceInfo?.renewsIn?units.buildString(`length`,props.insuranceData.leavingInsuranceInfo.renewsIn*1e3,0):``),selectCard=()=>{emit$1(`select`,props.insuranceData.id)},cardStyles=computed(()=>{let styles={};return!hasNoInsurance.value&&props.insuranceData.color&&(styles[`--insurance-card-rgb`]=hexToRgb(props.insuranceData.color)),styles});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-card-container`,{selected:__props.isSelected,"no-insurance-card":hasNoInsurance.value,"current-provider":__props.isCurrentProvider}]),style:normalizeStyle(cardStyles.value),onClick:selectCard,"bng-nav-item":``},[pillText.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`top-pill`,{"no-insurance":hasNoInsurance.value,"orange-pill":__props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime,"current-provider-pill":__props.isCurrentProvider}])},[createBaseVNode(`div`,null,toDisplayString(pillText.value),1)],2)),createBaseVNode(`div`,_hoisted_1$252,[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:__props.insuranceData},null,8,[`insuranceData`]),_cache[13]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_2$209,[hasNoInsurance.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`perks-header`,{"no-insurance":hasNoInsurance.value}])},toDisplayString(hasNoInsurance.value?`Consequences`:`Included Benefits`),3)):createCommentVNode(``,!0),createVNode(unref(insurancePerks_default),{insuranceData:__props.insuranceData},null,8,[`insuranceData`])]),_cache[14]||=createBaseVNode(`div`,{class:`separator`},null,-1),hasNoInsurance.value&&__props.insuranceData.leavingInsuranceInfo&&!__props.isCurrentProvider?(openBlock(),createElementBlock(`div`,_hoisted_3$183,[_cache[4]||=createBaseVNode(`div`,{class:`leaving-insurance-title`},`Cancellation Refund`,-1),createBaseVNode(`div`,_hoisted_4$156,[createBaseVNode(`div`,_hoisted_5$136,[createBaseVNode(`span`,null,` Unused coverage (`+toDisplayString(leavingInsuranceRenewsInFormatted.value)+`) `,1),createBaseVNode(`span`,_hoisted_6$117,[_cache[0]||=createTextVNode(` + `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_7$104,[_cache[2]||=createBaseVNode(`span`,null,` Early Cancellation Fee (25%) `,-1),createBaseVNode(`span`,_hoisted_8$88,[_cache[1]||=createTextVNode(` - `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$78,[_cache[3]||=createBaseVNode(`span`,{class:`breakdown-item-label-total`},` You'll receive `,-1),createBaseVNode(`span`,_hoisted_10$68,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.netRefundPrice},null,8,[`money`])])])])])):createCommentVNode(``,!0),hasNoInsurance.value?(openBlock(),createElementBlock(`div`,_hoisted_11$61,[..._cache[5]||=[createBaseVNode(`span`,{class:`no-insurance-warning`},` You will pay full repair costs `,-1),createBaseVNode(`span`,null,` No coverage or benefits included `,-1)]])):createCommentVNode(``,!0),!hasNoInsurance.value&&__props.insuranceData.groupDiscountData?.mainText?(openBlock(),createElementBlock(`div`,_hoisted_12$50,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_13$43,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_14$40,toDisplayString(__props.insuranceData.groupDiscountData?.mainText),1)]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`span`,{class:`grey-small-text`},` Currently Insured : `,-1),createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{class:`vehicles-icon`,type:unref(icons).car},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_15$38,toDisplayString(__props.insuranceData.carsInsuredCount),1),__props.insuranceData.groupDiscountData?.currentTierData?.id>0?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[6]||=createBaseVNode(`span`,{class:`vertical-separator`},` | `,-1),createBaseVNode(`span`,_hoisted_16$37,` Tier `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.id),1),createBaseVNode(`span`,_hoisted_17$31,` - `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.discount*100)+`% off `,1)],64)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_18$28,toDisplayString(__props.insuranceData.groupDiscountData?.secondaryText),1)])):createCommentVNode(``,!0),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$24,[createBaseVNode(`div`,_hoisted_20$20,[_cache[9]||=createBaseVNode(`span`,{class:`price-tile-title`},`Deductible`,-1),__props.insuranceData.baseDeductibledData?.oldPrice?(openBlock(),createElementBlock(`div`,_hoisted_21$18,[createBaseVNode(`div`,_hoisted_22$16,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.oldPrice},null,8,[`money`]),_cache[8]||=createBaseVNode(`div`,{class:`strike`},null,-1)])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_23$15,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.price,class:normalizeClass(__props.insuranceData.baseDeductibledData.oldPrice?`green-price`:`orange-price`)},null,8,[`money`,`class`])]),_cache[10]||=createBaseVNode(`div`,{class:`deductible-tips`},[createBaseVNode(`div`,null,` - You pay your deductible for each crash repair `),createBaseVNode(`div`,null,` - Customize this value after purchase `)],-1),__props.insuranceData.baseDeductibledData.perkData?(openBlock(),createElementBlock(`div`,_hoisted_24$14,toDisplayString(__props.insuranceData.baseDeductibledData.perkData.discount*100)+`% discount applied `,1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_25$13,[createBaseVNode(`span`,_hoisted_26$11,toDisplayString(__props.insuranceData.amountDue>0?`Amount Due`:`Credit Received`),1),createBaseVNode(`div`,_hoisted_27$11,[createVNode(unref(bngUnit_default),{money:Math.abs(__props.insuranceData.amountDue),class:`green-price`},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_28$10,[createBaseVNode(`div`,null,[_cache[11]||=createTextVNode(` Total policy : `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[12]||=createBaseVNode(`span`,null,`Renews in : `,-1),createBaseVNode(`span`,_hoisted_29$10,toDisplayString(renewsInFormatted.value),1)])])])]))]),createBaseVNode(`div`,{class:normalizeClass([`background`,{"no-insurance":hasNoInsurance.value}])},null,2)],6))}},insuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$282,[[`__scopeId`,`data-v-e481fbef`]]),_hoisted_1$251={class:`premium-wrapper`},_hoisted_2$208={class:`breakdown-item`},_hoisted_3$182={class:`breakdown-item-value`},_hoisted_4$155={class:`premium-value-wrapper`},_hoisted_5$135={class:`breakdown-item`},_hoisted_6$116={class:`breakdown-item-value`},_hoisted_7$103={class:`breakdown-item`},_hoisted_8$87={class:`breakdown-item-value`},_hoisted_9$77={class:`breakdown-item`},_hoisted_10$67={class:`breakdown-item-value orange-text`},_hoisted_11$60={class:`perks`},_hoisted_12$49={key:0,class:`grey-text`},_hoisted_13$42={key:1,class:`grey-text`},_hoisted_14$39={class:`group-discount-savings`},_hoisted_15$37={class:`breakdown-item`},_hoisted_16$36={key:0,class:`grey-text`},_hoisted_17$30={key:1,class:`grey-text`},_hoisted_18$27={class:`buttons`},_sfc_main$281={__name:`smallInsuranceCard`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},setup(__props){let{units}=useBridge(),props=__props,renewsEveryFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0)),renewsInFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsIn*1e3,0)),buttonsDisabled=computed(()=>props.insuranceData.carsInsuredCount===0),openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},tierToDisplay=computed(()=>props.insuranceData.groupDiscountData.currentTierData.id>0?props.insuranceData.groupDiscountData.currentTierData:props.insuranceData.groupDiscountData.groupDiscountTiers[0]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`small-insurance-card`,{"no-vehicles":buttonsDisabled.value}]),style:normalizeStyle({"border-top":`0.7rem solid ${props.insuranceData.color}`,background:`linear-gradient(180deg, ${props.insuranceData.color}80 0%, ${props.insuranceData.color}30 10%, ${props.insuranceData.color}10 35%, var(--bng-cool-gray-800) 50%, var(--blue-shade-100) 100%)`})},[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:props.insuranceData},null,8,[`insuranceData`]),createBaseVNode(`div`,_hoisted_1$251,[createBaseVNode(`div`,_hoisted_2$208,[createBaseVNode(`span`,null,`Premium / `+toDisplayString(renewsEveryFormatted.value),1),createBaseVNode(`span`,_hoisted_3$182,[createBaseVNode(`div`,_hoisted_4$155,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_5$135,[_cache[0]||=createBaseVNode(`span`,null,`Renews in `,-1),createBaseVNode(`span`,_hoisted_6$116,[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` - `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(renewsInFormatted.value),1)],64))])]),createBaseVNode(`div`,_hoisted_7$103,[_cache[1]||=createBaseVNode(`span`,null,`Vehicle Coverage`,-1),createBaseVNode(`span`,_hoisted_8$87,[createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$77,[_cache[2]||=createBaseVNode(`span`,null,`Vehicles`,-1),createBaseVNode(`span`,_hoisted_10$67,toDisplayString(props.insuranceData.carsInsuredCount),1)])]),createBaseVNode(`div`,_hoisted_11$60,[createVNode(unref(insurancePerks_default),{insuranceData:props.insuranceData,noDescription:!0},null,8,[`insuranceData`])]),createBaseVNode(`div`,{class:normalizeClass([`group-discount-wrapper`,{disabled:props.insuranceData.groupDiscountData.currentTierData.id===-1}])},[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(`div`,_hoisted_12$49,` No vehicles insured under this policy `)):props.insuranceData.carsInsuredCount===1?(openBlock(),createElementBlock(`div`,_hoisted_13$42,` Add a second vehicle to unlock Tier 1 (`+toDisplayString(props.insuranceData.groupDiscountData.groupDiscountTiers[0].discount*100)+`%) coverage savings. `,1)):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[4]||=createBaseVNode(`div`,{class:`group-discount`},` MULTI-VEHICLE DISCOUNT `,-1),createBaseVNode(`div`,_hoisted_14$39,[_cache[3]||=createTextVNode(` Savings :`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.groupDiscountSavings},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_15$37,[tierToDisplay.value.max?(openBlock(),createElementBlock(`span`,_hoisted_16$36,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k - `+toDisplayString(tierToDisplay.value.max/1e3)+`k range `,1)):(openBlock(),createElementBlock(`span`,_hoisted_17$30,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k+ range `,1))]),createBaseVNode(`div`,null,[createVNode(unref(insuranceTiers_default),{showTier:!0,tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])])],64))],2),createBaseVNode(`div`,_hoisted_18$27,[createVNode(unref(bngButton_default),{class:`edit-policy-button bigger-button`,accent:`custom`,onClick:openEditPolicy,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).adjust},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`Edit Policy`,2)]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`see-vehicles-button bigger-button`,accent:`custom`,onClick:openVehicleList,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).car},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`See Vehicles`,2)]),_:1},8,[`disabled`])])],6))}},smallInsuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$281,[[`__scopeId`,`data-v-38392c0c`]]),_hoisted_1$250={class:`insurance-details-wrapper`,"bng-ui-scope":`insuranceDetailsPopup`},_hoisted_2$207={class:`card-content`},_hoisted_3$181={class:`header`},_hoisted_4$154={class:`header-left`},_hoisted_5$134={class:`insurance-identity`},_hoisted_6$115={class:`insurance-name`},_hoisted_7$102={class:`insurance-slogan`},_hoisted_8$86={class:`covers-renew-info`},_hoisted_9$76={class:`header-right`},_hoisted_10$66={class:`vehicle-name`},_hoisted_11$59={class:`vehicle-value blue-price`},_hoisted_12$48={key:0,class:`group-discount-wrapper`},_hoisted_13$41={class:`group-discount-header`},_hoisted_14$38={class:`group-discount-icon-wrapper`},_hoisted_15$36={class:`group-discount-text-wrapper`},_hoisted_16$35={class:`group-discount-main-text`},_hoisted_17$29={class:`tiers-wrapper`},_hoisted_18$26={class:`textual-tiers-wrapper`},_hoisted_19$23={class:`tier-number`},_hoisted_20$19={class:`money-bracket`},_hoisted_21$17={key:0},_hoisted_22$15={key:1},_hoisted_23$14={class:`current-after-discount-price`},_hoisted_24$13={class:`tier-discount-price`},_hoisted_25$12={class:`policy-value`},_hoisted_26$10={class:`policy-tier`},_hoisted_27$10={class:`tier-discount-price isFutureTier`},_hoisted_28$9={class:`policy-value`},_hoisted_29$9={class:`policy-tier isFuture`},_hoisted_30$9={class:`price-breakdown-wrapper`},_hoisted_31$9={class:`prices-breakdown-header`},_hoisted_32$9={class:`breakdown-item`},_hoisted_33$9={class:`breakdown-details`},_hoisted_34$9={class:`breakdown-item-value`},_hoisted_35$8={class:`breakdown-value`},_hoisted_36$8={class:`breakdown-item-value orange`},_hoisted_37$7={class:`breakdown-value`},_hoisted_38$6={key:0,class:`breakdown-item-value orange`},_hoisted_39$6={class:`breakdown-label`},_hoisted_40$5={class:`breakdown-value`},_hoisted_41$5={class:`breakdown-item-value result`},_hoisted_42$4={class:`breakdown-value result`},_hoisted_43$4={class:`breakdown-item`},_hoisted_44$4={class:`breakdown-details`},_hoisted_45$4={key:0,class:`breakdown-item-value`},_hoisted_46$2={key:0,class:`strikethrough-line`},_hoisted_47$2={key:1,class:`breakdown-item-value`},_hoisted_48$2={class:`breakdown-label`},_hoisted_49$2={class:`tier-discount-badge`},_hoisted_50$2={class:`breakdown-value green-price`},_hoisted_51$2={key:0,class:`breakdown-item-value`},_hoisted_52$2={class:`breakdown-label`},_hoisted_53$2={class:`breakdown-value`},_hoisted_54$2={class:`breakdown-item-value subtotal`},_hoisted_55$2={class:`breakdown-value`},_hoisted_56$2={class:`breakdown-item-value`},_hoisted_57$1={class:`breakdown-item-value result`},_hoisted_58$1={class:`breakdown-value`},_hoisted_59$1={class:`sum-to-pay`},_hoisted_60$1={class:`sum-to-pay-value`},_hoisted_61$1={class:`closeButton`},__default__$5={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$280=Object.assign(__default__$5,{__name:`purchaseInsuranceDetails`,props:{insuranceData:Object,vehicleInfo:Object,driverScoreData:Object},emits:[`return`],setup(__props,{emit:__emit}){let{units}=useBridge();useUINavScope(`insuranceDetailsPopup`);let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},driverScoreAdjustmentText=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`↓${((1-multiplier)*100).toFixed(0)}%`:multiplier>1?`↑${((multiplier-1)*100).toFixed(0)}%`:`0%`}),driverScoreClass=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`driver-score-discount`:multiplier>1?`driver-score-penalty`:``}),groupDiscountText=computed(()=>{if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime)return`Multi-vehicle discount available`;if(props.insuranceData.groupDiscountData.willBumpTheirDiscount)return`Bigger discount available`;if(props.insuranceData.groupDiscountData.currentTierData&&props.insuranceData.groupDiscountData.currentTierData.id>0)return`Multi-vehicle discount active`}return null}),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$250,[createBaseVNode(`div`,_hoisted_2$207,[createBaseVNode(`div`,_hoisted_3$181,[createBaseVNode(`div`,_hoisted_4$154,[_cache[2]||=createBaseVNode(`div`,{class:`policy-details`},` Policy details `,-1),createBaseVNode(`div`,_hoisted_5$134,[createBaseVNode(`span`,_hoisted_6$115,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_7$102,toDisplayString(props.insuranceData.slogan),1)]),createBaseVNode(`div`,_hoisted_8$86,[createBaseVNode(`span`,null,`Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles`,1),_cache[1]||=createBaseVNode(`span`,{class:`covers-renew-seperator`},null,-1),createBaseVNode(`span`,null,`Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$76,[_cache[4]||=createBaseVNode(`div`,{class:`action-type`},`Adding vehicle`,-1),createBaseVNode(`div`,_hoisted_10$66,toDisplayString(props.vehicleInfo.Name),1),createBaseVNode(`div`,_hoisted_11$59,[_cache[3]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])])]),props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime||props.insuranceData.groupDiscountData.willBumpTheirDiscount||props.insuranceData.groupDiscountData.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_12$48,[createBaseVNode(`div`,_hoisted_13$41,[createBaseVNode(`div`,_hoisted_14$38,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_15$36,[createBaseVNode(`div`,_hoisted_16$35,toDisplayString(groupDiscountText.value),1),_cache[5]||=createBaseVNode(`div`,{class:`group-discount-secondary-text`},` Insurance discounts are based on the total value of your fleet. `,-1)])]),createBaseVNode(`div`,_hoisted_17$29,[createBaseVNode(`div`,_hoisted_18$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.groupDiscountData.groupDiscountTiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,_hoisted_19$23,` Tier `+toDisplayString(tier.id),1),createBaseVNode(`div`,_hoisted_20$19,[createBaseVNode(`span`,null,toDisplayString(tier.min/1e3)+`k`,1),tier.max?(openBlock(),createElementBlock(`span`,_hoisted_21$17,`-`+toDisplayString(tier.max/1e3)+`k`,1)):(openBlock(),createElementBlock(`span`,_hoisted_22$15,`+`))])]))),128))]),createVNode(unref(insuranceTiers_default),{tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])]),createBaseVNode(`div`,_hoisted_23$14,[createBaseVNode(`div`,_hoisted_24$13,[_cache[7]||=createBaseVNode(`div`,{class:`section-label deactivated`},` Current Tier `,-1),createBaseVNode(`div`,_hoisted_25$12,[_cache[6]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_26$10,` Tier `+toDisplayString(Math.max(props.insuranceData.groupDiscountData.currentTierData.id,0))+` - `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off `,1)]),createBaseVNode(`div`,_hoisted_27$10,[_cache[9]||=createBaseVNode(`div`,{class:`section-label`},` After Purchase `,-1),createBaseVNode(`div`,_hoisted_28$9,[_cache[8]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue+props.insuranceData.vehicleValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_29$9,` Tier `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.id)+` - `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.discount*100)+`% off `,1)])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_30$9,[createBaseVNode(`div`,_hoisted_31$9,[createBaseVNode(`div`,_hoisted_32$9,[_cache[13]||=createBaseVNode(`div`,{class:`section-label`},` Vehicle `,-1),createBaseVNode(`div`,_hoisted_33$9,[createBaseVNode(`div`,_hoisted_34$9,[_cache[10]||=createBaseVNode(`span`,{class:`breakdown-label`},` Coverage Cost `,-1),createBaseVNode(`span`,_hoisted_35$8,[createVNode(unref(bngUnit_default),{money:props.insuranceData.nonProRatedVehiclePremium},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_36$8,[_cache[11]||=createBaseVNode(`span`,{class:`breakdown-label`},` Pro-rated Renewal `,-1),createBaseVNode(`span`,_hoisted_37$7,` × `+toDisplayString(props.insuranceData.proRatedPercentage)+`% `,1)]),props.insuranceData.groupDiscountData?.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_38$6,[createBaseVNode(`span`,_hoisted_39$6,` Tier `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.id)+` discount `,1),createBaseVNode(`span`,_hoisted_40$5,` - `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.discount*100)+`% `,1)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_41$5,[_cache[12]||=createBaseVNode(`span`,{class:`breakdown-label`},` Policy Add-On Cost `,-1),createBaseVNode(`span`,_hoisted_42$4,[createVNode(unref(bngUnit_default),{money:props.insuranceData.proRatedVehiclePremium},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_43$4,[_cache[18]||=createBaseVNode(`div`,{class:`section-label`},` New Premium `,-1),createBaseVNode(`div`,_hoisted_44$4,[props.insuranceData.futurePremiumDetails.items.vehsCoverage?(openBlock(),createElementBlock(`div`,_hoisted_45$4,[_cache[14]||=createBaseVNode(`div`,{class:`breakdown-label`},` Vehicles Coverage `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value strikethrough-container`,{"strikethrough-grey":props.insuranceData.futurePremiumDetails.groupDiscountSavings>0}])},[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.priceWithoutGroupDiscount},null,8,[`money`]),props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_46$2)):createCommentVNode(``,!0)],2)])):createCommentVNode(``,!0),props.insuranceData.futurePremiumDetails.items.vehsCoverage&&props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_47$2,[createBaseVNode(`div`,_hoisted_48$2,[createTextVNode(toDisplayString(props.insuranceData.futurePremiumDetails.items.vehsCoverage.name)+` `,1),createBaseVNode(`span`,null,[createTextVNode(`: Tier `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.id)+` `,1),createBaseVNode(`span`,_hoisted_49$2,`(`+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off)`,1)])]),createBaseVNode(`div`,_hoisted_50$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.price},null,8,[`money`])])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.futurePremiumDetails.items,(item,key)=>(openBlock(),createElementBlock(Fragment,{key},[key===`vehsCoverage`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_51$2,[createBaseVNode(`div`,_hoisted_52$2,toDisplayString(item.name),1),createBaseVNode(`div`,_hoisted_53$2,[createVNode(unref(bngUnit_default),{money:item.price},null,8,[`money`])])]))],64))),128)),createBaseVNode(`div`,_hoisted_54$2,[_cache[15]||=createBaseVNode(`div`,{class:`breakdown-label`},` Subtotal `,-1),createBaseVNode(`div`,_hoisted_55$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_56$2,[_cache[16]||=createBaseVNode(`div`,{class:`breakdown-label`},` Driver Score Adjustment `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value`,driverScoreClass.value])},toDisplayString(driverScoreAdjustmentText.value),3)]),createBaseVNode(`div`,_hoisted_57$1,[_cache[17]||=createBaseVNode(`div`,{class:`breakdown-label`},` Total Premium `,-1),createBaseVNode(`div`,_hoisted_58$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])])]),createBaseVNode(`div`,_hoisted_59$1,[_cache[19]||=createBaseVNode(`span`,null,`Amount due today`,-1),createBaseVNode(`span`,_hoisted_60$1,[createVNode(unref(bngUnit_default),{class:`green-price`,money:props.insuranceData.addVehiclePrice},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_61$1,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:closePopup},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Close `,-1)]]),_:1},8,[`accent`])])])]))}}),purchaseInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$280,[[`__scopeId`,`data-v-9f20c127`]]),_hoisted_1$249={class:`content`},_hoisted_2$206={class:`top-banner`},_hoisted_3$180={class:`top-banner-left`},_hoisted_4$153={class:`insurance-details`},_hoisted_5$133={class:`insurance-name`},_hoisted_6$114={class:`insurance-slogan`},_hoisted_7$101={class:`small-grey-text`},_hoisted_8$85={class:`small-grey-text`},_hoisted_9$75={class:`top-banner-right`},_hoisted_10$65={class:`information-wrapper`},_hoisted_11$58={class:`information-value`},_hoisted_12$47={class:`driver-score-tier`},_hoisted_13$40={class:`premium-effect`},_hoisted_14$37={class:`switching-details-wrapper`},_hoisted_15$35={class:`three-columns-grid`},_hoisted_16$34={class:`switching-column column-leaving`},_hoisted_17$28={class:`column-header`},_hoisted_18$25={class:`column-details`},_hoisted_19$22={class:`detail-item`},_hoisted_20$18={class:`detail-value`},_hoisted_21$16={class:`detail-item`},_hoisted_22$14={class:`detail-item divider-above`},_hoisted_23$13={class:`detail-value-positive`},_hoisted_24$12={class:`detail-item`},_hoisted_25$11={class:`detail-value-negative`},_hoisted_26$9={class:`detail-item divider-above`},_hoisted_27$9={class:`detail-value-positive-bold`},_hoisted_28$8={class:`detail-note`},_hoisted_29$8={class:`switching-column column-vehicle`},_hoisted_30$8={class:`vehicle-display-box`},_hoisted_31$8=[`src`],_hoisted_32$8={class:`column-details`},_hoisted_33$8={class:`detail-item`},_hoisted_34$8={class:`detail-value-bold`},_hoisted_35$7={class:`detail-item`},_hoisted_36$7={class:`detail-value-bold`},_hoisted_37$6={class:`detail-item divider-above`},_hoisted_38$5={class:`detail-value-highlight`},_hoisted_39$5={class:`detail-note`},_hoisted_40$4={class:`switching-column column-joining`},_hoisted_41$4={class:`column-header`},_hoisted_42$3={class:`column-details`},_hoisted_43$3={class:`detail-item`},_hoisted_44$3={class:`detail-value`},_hoisted_45$3={class:`detail-item`},_hoisted_46$1={class:`detail-item divider-above`},_hoisted_47$1={class:`detail-value-negative`},_hoisted_48$1={class:`detail-item divider-above`},_hoisted_49$1={class:`detail-item divider-above`},_hoisted_50$1={class:`detail-value-bold`},_hoisted_51$1={class:`detail-note`},_hoisted_52$1={class:`final-amount-content-row`},_hoisted_53$1={class:`final-amount-label`},_hoisted_54$1={class:`final-amount-breakdown`},_hoisted_55$1={class:`buttons`},_hoisted_56$1={key:0},_sfc_main$279={__name:`changeInsuranceDetails`,props:{insuranceData:{type:Object,required:!0},vehicleInfo:{type:Object,default:()=>({})},driverScoreData:{type:Object,default:()=>({})}},emits:[`return`,`switch`],setup(__props,{emit:__emit}){let{units}=useBridge(),props=__props,emit$1=__emit,premiumSavingPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),leavingInfo=computed(()=>props.insuranceData.leavingInsuranceInfo||null),leavingInsuranceName=computed(()=>leavingInfo.value?.currentInsuranceName||`Current Insurance`),tierDropped=computed(()=>leavingInfo.value?leavingInfo.value.discountTierData?.id>leavingInfo.value.newDiscountTierData?.id:!1),tierIncreased=computed(()=>{let current=props.insuranceData.groupDiscountData?.currentTierData?.id||0;return(props.insuranceData.groupDiscountData?.futureTierData?.id||current)>current}),currentTierId=computed(()=>props.insuranceData.groupDiscountData?.currentTierData?.id||0),futureTierId=computed(()=>props.insuranceData.groupDiscountData?.futureTierData?.id||props.insuranceData.groupDiscountData?.currentTierData?.id||0),proRatedPercentage=computed(()=>Math.round(props.insuranceData.proRatedPercentage||100)),driverScoreImpactPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),driverScoreImpactClass=computed(()=>driverScoreImpactPercent.value>0?`saving`:driverScoreImpactPercent.value<0?`increase`:`neutral`),driverScoreImpactText=computed(()=>driverScoreImpactPercent.value>0?`↓${driverScoreImpactPercent.value.toFixed(0)}%`:driverScoreImpactPercent.value<0?`↑${Math.abs(driverScoreImpactPercent.value).toFixed(0)}%`:`0%`),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingRenewsInFormatted=computed(()=>leavingInfo.value?.renewsIn?units.buildString(`length`,leavingInfo.value.renewsIn*1e3,0):``),closePopup=()=>{emit$1(`return`,!0)},onSwitchClick=()=>{Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(props.vehicleInfo.invVehId,props.insuranceData.id),emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$249,[createBaseVNode(`div`,_hoisted_2$206,[createBaseVNode(`div`,_hoisted_3$180,[_cache[2]||=createBaseVNode(`div`,{class:`title`},` Change Insurance `,-1),createBaseVNode(`div`,_hoisted_4$153,[createBaseVNode(`span`,_hoisted_5$133,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_6$114,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1)]),createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$101,` Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles `,1),_cache[1]||=createBaseVNode(`span`,{class:`dot-seperator`},null,-1),createBaseVNode(`span`,_hoisted_8$85,` Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$75,[createBaseVNode(`div`,_hoisted_10$65,[_cache[4]||=createBaseVNode(`div`,{class:`small-grey-text`},` Driver Score `,-1),createBaseVNode(`div`,_hoisted_11$58,toDisplayString(props.driverScoreData.score)+`: `+toDisplayString(props.driverScoreData.tier.risk),1),createBaseVNode(`div`,_hoisted_12$47,toDisplayString(props.driverScoreData.tier.name),1),createBaseVNode(`div`,_hoisted_13$40,[_cache[3]||=createBaseVNode(`span`,{class:`small-grey-text`},` Premium Effect : `,-1),createBaseVNode(`span`,{class:normalizeClass([`premium-effect-value`,{saving:premiumSavingPercent.value>0,increase:premiumSavingPercent.value<0}])},toDisplayString(premiumSavingPercent.value>0?`${premiumSavingPercent.value.toFixed(0)}% saving`:premiumSavingPercent.value<0?`${Math.abs(premiumSavingPercent.value).toFixed(0)}% increase`:`No change`),3)])])])]),createBaseVNode(`div`,_hoisted_14$37,[createBaseVNode(`div`,_hoisted_15$35,[createBaseVNode(`div`,_hoisted_16$34,[createBaseVNode(`div`,_hoisted_17$28,[_cache[5]||=createBaseVNode(`span`,null,`←`,-1),createTextVNode(` Leaving `+toDisplayString(leavingInsuranceName.value),1)]),createBaseVNode(`div`,_hoisted_18$25,[createBaseVNode(`div`,_hoisted_19$22,[_cache[6]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_20$18,toDisplayString(leavingInfo.value.vehicleCount)+` → `+toDisplayString(leavingInfo.value.newVehicleCount),1)]),createBaseVNode(`div`,_hoisted_21$16,[_cache[7]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-down":tierDropped.value}])},toDisplayString(leavingInfo.value.discountTierData.id)+` → `+toDisplayString(leavingInfo.value.newDiscountTierData.id),3)]),createBaseVNode(`div`,_hoisted_22$14,[_cache[9]||=createBaseVNode(`span`,{class:`detail-label`},`Coverage refund:`,-1),createBaseVNode(`span`,_hoisted_23$13,[_cache[8]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_24$12,[_cache[11]||=createBaseVNode(`span`,{class:`detail-label`},`Cancellation fee (25%):`,-1),createBaseVNode(`span`,_hoisted_25$11,[_cache[10]||=createTextVNode(`-`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_26$9,[_cache[12]||=createBaseVNode(`span`,{class:`detail-label-bold`},`Net Refund:`,-1),createBaseVNode(`span`,_hoisted_27$9,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_28$8,toDisplayString(leavingRenewsInFormatted.value)+` unused `,1)])]),createBaseVNode(`div`,_hoisted_29$8,[_cache[16]||=createBaseVNode(`div`,{class:`column-header column-header-center`},`Moving Vehicle`,-1),createBaseVNode(`div`,_hoisted_30$8,[createBaseVNode(`img`,{src:props.vehicleInfo?.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_31$8)]),createBaseVNode(`div`,_hoisted_32$8,[createBaseVNode(`div`,_hoisted_33$8,[_cache[13]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_34$8,toDisplayString(props.vehicleInfo.Name),1)]),createBaseVNode(`div`,_hoisted_35$7,[_cache[14]||=createBaseVNode(`span`,{class:`detail-label`},`Value:`,-1),createBaseVNode(`span`,_hoisted_36$7,[createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_37$6,[_cache[15]||=createBaseVNode(`span`,{class:`detail-label`},`Joining mid-cycle:`,-1),createBaseVNode(`span`,_hoisted_38$5,`× `+toDisplayString(proRatedPercentage.value)+`%`,1)]),createBaseVNode(`div`,_hoisted_39$5,toDisplayString(renewsInFormatted.value)+` remaining in cycle `,1)])]),createBaseVNode(`div`,_hoisted_40$4,[createBaseVNode(`div`,_hoisted_41$4,[createTextVNode(` Joining `+toDisplayString(props.insuranceData.name)+` `,1),_cache[17]||=createBaseVNode(`span`,null,`→`,-1)]),createBaseVNode(`div`,_hoisted_42$3,[createBaseVNode(`div`,_hoisted_43$3,[_cache[18]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_44$3,toDisplayString(props.insuranceData.carsInsuredCount)+` → `+toDisplayString(props.insuranceData.carsInsuredCount+1),1)]),createBaseVNode(`div`,_hoisted_45$3,[_cache[19]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-up":tierIncreased.value}])},toDisplayString(currentTierId.value)+` → `+toDisplayString(futureTierId.value),3)]),createBaseVNode(`div`,_hoisted_46$1,[_cache[21]||=createBaseVNode(`span`,{class:`detail-label`},`Add vehicle cost:`,-1),createBaseVNode(`span`,_hoisted_47$1,[_cache[20]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_48$1,[_cache[22]||=createBaseVNode(`span`,{class:`detail-label`},`Driver Score Impact:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value-impact`,driverScoreImpactClass.value])},toDisplayString(driverScoreImpactText.value),3)]),createBaseVNode(`div`,_hoisted_49$1,[_cache[23]||=createBaseVNode(`span`,{class:`detail-label-bold`},`New Policy Premium:`,-1),createBaseVNode(`span`,_hoisted_50$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_51$1,toDisplayString(renewsInFormatted.value)+` until renewal `,1)])])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-box`,props.insuranceData.netSwitchingCost>0?`amount-credit`:`amount-payment`])},[createBaseVNode(`div`,_hoisted_52$1,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_53$1,toDisplayString(props.insuranceData.netSwitchingCost>0?`Credit Received Today`:`Amount Due Today`),1),createBaseVNode(`div`,_hoisted_54$1,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`]),_cache[24]||=createTextVNode(` refund - `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`]),_cache[25]||=createTextVNode(` new cost `,-1)])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-total`,props.insuranceData.netSwitchingCost<0?`negative`:`positive`])},[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])],2)])],2)]),createBaseVNode(`div`,_hoisted_55$1,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSwitchClick},{default:withCtx(()=>[_cache[27]||=createTextVNode(` Switch for `,-1),props.insuranceData.netSwitchingCost<0?(openBlock(),createElementBlock(`div`,_hoisted_56$1,[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])])):createCommentVNode(``,!0)]),_:1})])]))}},changeInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$279,[[`__scopeId`,`data-v-9624a106`]]),_hoisted_1$248={class:`insurance-tiers`},_hoisted_2$205={key:0},_sfc_main$278={__name:`insuranceTiers`,props:{tiers:{type:Array,required:!0},showTier:{type:Boolean,default:!1}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$248,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.tiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,{class:normalizeClass([`tier-discount`,{isCurrent:tier.isCurrent}])},[props.showTier?(openBlock(),createElementBlock(`div`,_hoisted_2$205,` Tier `+toDisplayString(tier.id),1)):createCommentVNode(``,!0),createBaseVNode(`div`,null,toDisplayString(tier.discount*100)+`% `,1)],2)]))),128))]))}},insuranceTiers_default=__plugin_vue_export_helper_default(_sfc_main$278,[[`__scopeId`,`data-v-ccd1e875`]]),_hoisted_1$247={class:`popup-content`},_hoisted_2$204={class:`top-banner`},_hoisted_3$179={class:`top-info`},_hoisted_4$152={class:`top-info-title`},_hoisted_5$132={class:`top-info-policy-name`},_hoisted_6$113={class:`customize-coverage section`},_hoisted_7$100={class:`premium-details section`},_hoisted_8$84={class:`premium-details-content`},_hoisted_9$74={class:`premium-details-left`},_hoisted_10$64={class:`premium-details-label`},_hoisted_11$57={class:`premium-details-right`},_hoisted_12$46={key:0,class:`price-diff-container`},_hoisted_13$39={class:`premium-details-total premium-details-item`},_hoisted_14$36={class:`premium-details-left`},_hoisted_15$34={class:`driver-score-details-wrapper`},_hoisted_16$33={class:`driver-score-details`},_hoisted_17$27={class:`premium-details-right`},_hoisted_18$24={key:0,class:`price-diff-container`},_hoisted_19$21={class:`buttons`},_sfc_main$277={__name:`editPolicy`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,changedCoverageOptions=ref({}),newPremiumDetails=ref({}),computedNewPremiumDiffs=computed(()=>{if(!newPremiumDetails.value?.items)return{};let diffs={};for(let key in newPremiumDetails.value.items){let newPrice=newPremiumDetails.value.items[key]?.price||0,oldPrice=props.insuranceData.currentPremiumDetails.items[key]?.price||0;diffs[key]={priceDiff:newPrice-oldPrice,newPrice,oldPrice}}return diffs}),computedTotalPriceDiff=computed(()=>newPremiumDetails.value?.totalPrice?newPremiumDetails.value.totalPrice-props.insuranceData.currentPremiumDetails.totalPrice:0),driverScoreColorClass=computed(()=>{let multiplier=props.driverScoreData?.tier?.multiplier;return multiplier?multiplier<1?`driver-score-good`:multiplier>1?`driver-score-bad`:``:``}),hasChangedCoverageOptions=computed(()=>props.insuranceData?.coverageOptionsData?props.insuranceData.coverageOptionsData.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1);onMounted(()=>{props.insuranceData?.coverageOptionsData&&props.insuranceData.coverageOptionsData.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId})});let emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewInsuranceCoverageOptions(props.insuranceData.id,changedCoverageOptions.value),emit$1(`return`,!0)},updatePremiumDetails=async()=>{newPremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,changedCoverageOptions.value,null)},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1,updatePremiumDetails())},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumDetails()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$247,[createBaseVNode(`div`,_hoisted_2$204,[createBaseVNode(`div`,_hoisted_3$179,[createBaseVNode(`div`,_hoisted_4$152,[_cache[0]||=createTextVNode(` Edit Policy: `,-1),createBaseVNode(`span`,_hoisted_5$132,toDisplayString(props.insuranceData.name),1)]),_cache[1]||=createBaseVNode(`div`,{class:`top-info-description`},` These settings apply to all vehicles under this policy. Set deductibles per vehicle by clicking "Edit Vehicles" `,-1)]),createVNode(unref(bngButton_default),{class:`edit-vehicles-button`,accent:`custom`,onClick:openVehicleList},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Edit Vehicles `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_6$113,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.coverageOptionsData,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{key:coverageOption.name,coverageOption,changedCoverageOptions:changedCoverageOptions.value,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))]),createBaseVNode(`div`,_hoisted_7$100,[_cache[5]||=createBaseVNode(`div`,{class:`premium-details-header`},` Premium Breakdown `,-1),createBaseVNode(`div`,_hoisted_8$84,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.currentPremiumDetails.items,(detail,key)=>(openBlock(),createElementBlock(`div`,{class:`premium-details-item`,key},[createBaseVNode(`div`,_hoisted_9$74,[createBaseVNode(`div`,_hoisted_10$64,toDisplayString(detail.name),1)]),createBaseVNode(`div`,_hoisted_11$57,[computedNewPremiumDiffs.value[key]&&computedNewPremiumDiffs.value[key].priceDiff!==0?(openBlock(),createElementBlock(`div`,_hoisted_12$46,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}])},toDisplayString(computedNewPremiumDiffs.value[key].priceDiff>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}]),money:computedNewPremiumDiffs.value[key].priceDiff},null,8,[`class`,`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.items?.[key]?.price||detail.price},null,8,[`money`])])]))),128)),createBaseVNode(`div`,_hoisted_13$39,[createBaseVNode(`div`,_hoisted_14$36,[_cache[4]||=createBaseVNode(`div`,null,` Final Premium `,-1),createBaseVNode(`div`,_hoisted_15$34,[createBaseVNode(`span`,_hoisted_16$33,[_cache[3]||=createTextVNode(` Base Premium : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPrice},null,8,[`money`]),createTextVNode(` × Driver Score `+toDisplayString(props.driverScoreData.score)+` @ `,1)]),createBaseVNode(`span`,{class:normalizeClass([`driver-score`,driverScoreColorClass.value])},toDisplayString(Math.round(props.driverScoreData.tier.multiplier*100))+`% `,3)])]),createBaseVNode(`div`,_hoisted_17$27,[computedTotalPriceDiff.value===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$24,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}])},toDisplayString(computedTotalPriceDiff.value>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}]),money:computedTotalPriceDiff.value},null,8,[`class`,`money`])])),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.totalPriceWithDriverScore||props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_19$21,[createVNode(unref(bngButton_default),{class:`cancel-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`])])]))}},editPolicy_default=__plugin_vue_export_helper_default(_sfc_main$277,[[`__scopeId`,`data-v-081fecf3`]]),_sfc_main$276={__name:`insurancePerkIcon`,props:{perkIconData:{type:Object,required:!0}},setup(__props){let props=__props,computedColor=computed(()=>props.perkIconData.isSignaturePerk===void 0?props.perkIconData.color:props.perkIconData.isSignaturePerk?`green`:`blue`);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"insurance-perk-icon":!__props.perkIconData.iconOnly,[computedColor.value]:computedColor.value})},[createVNode(unref(bngIcon_default),{type:unref(icons).shieldCheckmark,class:normalizeClass({"glowing-icon":!0,[computedColor.value]:computedColor.value})},null,8,[`type`,`class`]),__props.perkIconData.iconOnly?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass({"small-text":!0,[computedColor.value]:computedColor.value})},toDisplayString(__props.perkIconData.smallText),3))],2)),[[unref(BngTooltip_default),__props.perkIconData.iconOnly?null:__props.perkIconData.tooltipText,`top`]])}},insurancePerkIcon_default=__plugin_vue_export_helper_default(_sfc_main$276,[[`__scopeId`,`data-v-d2b025b6`]]),_hoisted_1$246={class:`insurance-perks-container`},_hoisted_2$203={class:`left`},_hoisted_3$178={class:`insurance-perk-icon-wrapper`},_hoisted_4$151={key:1},_hoisted_5$131={class:`insurance-perk-texts`},_hoisted_6$112={class:`insurance-perk-intro`},_hoisted_7$99={key:0,class:`insurance-perk-description`},_hoisted_8$83={key:0,class:`signature-perk-wrapper`},_sfc_main$275={__name:`insurancePerks`,props:{insuranceData:Object,noDescription:Boolean},setup(__props){let props=__props,sortedPerks=computed(()=>props.insuranceData.perks?[...Array.isArray(props.insuranceData.perks)?props.insuranceData.perks:Object.values(props.insuranceData.perks)].sort((a$1,b)=>Number(b.isSignaturePerk||!1)-Number(a$1.isSignaturePerk||!1)):[]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$246,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedPerks.value,perk=>(openBlock(),createElementBlock(`div`,{key:perk.id,class:normalizeClass([`insurance-perk`,{highlighted:perk.isSignaturePerk,"no-insurance":__props.insuranceData.id===-1}])},[createBaseVNode(`div`,_hoisted_2$203,[createBaseVNode(`div`,_hoisted_3$178,[__props.insuranceData.id===-1?(openBlock(),createElementBlock(`span`,_hoisted_4$151,`-`)):(openBlock(),createBlock(insurancePerkIcon_default,{key:0,perkIconData:{iconOnly:!0,isSignaturePerk:perk.isSignaturePerk&&perk.isSignaturePerk||!1}},null,8,[`perkIconData`]))]),createBaseVNode(`div`,_hoisted_5$131,[createBaseVNode(`div`,_hoisted_6$112,toDisplayString(perk.intro),1),__props.noDescription?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$99,toDisplayString(perk.description),1))])]),perk.isSignaturePerk?(openBlock(),createElementBlock(`div`,_hoisted_8$83,[..._cache[0]||=[createBaseVNode(`div`,{class:`signature-perk`},` SIGNATURE PERK `,-1)]])):createCommentVNode(``,!0)],2))),128))]))}},insurancePerks_default=__plugin_vue_export_helper_default(_sfc_main$275,[[`__scopeId`,`data-v-75e74910`]]),_hoisted_1$245={class:`insurance-perk-notice`},_sfc_main$274={__name:`insurancePerkNotice`,props:{perkText:{type:String,required:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$245,[createVNode(insurancePerkIcon_default,{perkIconData:{iconOnly:!0}}),createTextVNode(` `+toDisplayString(props.perkText),1)]))}},insurancePerkNotice_default=__plugin_vue_export_helper_default(_sfc_main$274,[[`__scopeId`,`data-v-a98b3238`]]),_hoisted_1$244={class:`popup-content`},_hoisted_2$202={class:`top-info`},_hoisted_3$177={class:`top-info-title`},_hoisted_4$150={class:`top-info-veh-name`},_hoisted_5$130={class:`top-info-value-and-insurance`},_hoisted_6$111={class:`section`},_hoisted_7$98={class:`section`},_hoisted_8$82={class:`contribution-wrapper`},_hoisted_9$73={class:`contribution-item-value`},_hoisted_10$63={key:0,class:`price-diff-container`},_hoisted_11$56={class:`contribution-item-value`},_hoisted_12$45={key:0,class:`price-diff-container`},_hoisted_13$38={class:`buttons`},_sfc_main$273={__name:`editVehicleCoverage`,props:{insuranceData:{type:Object,required:!0},vehicleData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,newPremiumPrice=ref(0),newInsurancePremiumDetails=ref({totalPriceWithDriverScore:0}),computedNewPremiumDiff=computed(()=>newPremiumPrice.value-props.vehicleData.insuranceData.currentPremiumPrice),computedNewInsurancePremiumDiff=computed(()=>newInsurancePremiumDetails.value.totalPriceWithDriverScore-props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore),hasChangedCoverageOptions=computed(()=>props.vehicleData?.insuranceData?.coverageOptionsData?.currentCoverageOptionsSanitized?props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1),emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},changedCoverageOptions=ref({}),updatePremiumPrice=async()=>{newPremiumPrice.value=(await Lua_default.career_modules_insurance_insurance.calculateVehiclePremium(props.vehicleData.id,null,changedCoverageOptions.value)).cost,newInsurancePremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,null,{[props.vehicleData.id]:changedCoverageOptions.value})},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumPrice()},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1),updatePremiumPrice()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewVehicleCoverageOptions(props.vehicleData.id,changedCoverageOptions.value),emit$1(`return`,!0)},openSwitchProvider=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:props.vehicleData.id}})};return onMounted(()=>{props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId}),updatePremiumPrice()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$244,[createBaseVNode(`div`,_hoisted_2$202,[createBaseVNode(`div`,_hoisted_3$177,[_cache[0]||=createTextVNode(` Select Deductible: `,-1),createBaseVNode(`span`,_hoisted_4$150,toDisplayString(props.vehicleData.name),1)]),createBaseVNode(`div`,_hoisted_5$130,[_cache[1]||=createTextVNode(` Value: `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleData.initialValue},null,8,[`money`]),createTextVNode(` • Policy: `+toDisplayString(props.insuranceData.name),1)]),_cache[2]||=createBaseVNode(`div`,{class:`top-info-description`},` Choose how much you'll pay out-of-pocket when repairing this vehicle. Lower deductibles cost more per km. `,-1)]),createBaseVNode(`div`,_hoisted_6$111,[_cache[3]||=createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:`header title`},` Choose Your Deductible `),createBaseVNode(`div`,{class:`under-title`},` You pay this amount per repair. `)],-1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{class:`coverage-option`,key:coverageOption.name,coverageOption,onlyShowMainText:!0,changedCoverageOptions:changedCoverageOptions.value,dontShowName:!0,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))])]),createBaseVNode(`div`,_hoisted_7$98,[_cache[6]||=createBaseVNode(`div`,{class:`title`},` Policy Impact `,-1),createBaseVNode(`div`,_hoisted_8$82,[createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[4]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Insurance Premium `,-1),createBaseVNode(`div`,_hoisted_9$73,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`]),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_10$63,` → `)):createCommentVNode(``,!0),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newInsurancePremiumDetails.value.totalPriceWithDriverScore},null,8,[`money`])):createCommentVNode(``,!0)])],2),createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[5]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Vehicle Contribution `,-1),createBaseVNode(`div`,_hoisted_11$56,[createVNode(unref(bngUnit_default),{money:props.vehicleData.insuranceData.currentPremiumPrice},null,8,[`money`]),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_12$45,` → `)):createCommentVNode(``,!0),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newPremiumPrice.value},null,8,[`money`])):createCommentVNode(``,!0)])],2)])]),createBaseVNode(`div`,_hoisted_13$38,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[8]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:openSwitchProvider},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(` Switch Provider `,-1)]]),_:1})])]))}},editVehicleCoverage_default=__plugin_vue_export_helper_default(_sfc_main$273,[[`__scopeId`,`data-v-9f014d2d`]]),_hoisted_1$243=[`innerHTML`],_hoisted_2$201={key:2,class:`insurance-icon`},_hoisted_3$176={class:`insurance-name`},_hoisted_4$149={key:3,class:`insurance-slogan`},_sfc_main$272={__name:`insuranceIdentity`,props:{insuranceData:{type:Object,required:!0}},setup(__props){let props=__props,hasInsurance=computed(()=>svgContent.value||props.insuranceData.image),hasNoInsurance=computed(()=>props.insuranceData?.id===-1),svgContent=ref(null);return watch(()=>props.insuranceData.image,async newPath=>{if(newPath&&newPath.endsWith(`.svg`))try{let rawSvg=await getFile(`/${newPath}`);rawSvg?svgContent.value=rawSvg.replace(/]*>([\s\S]*?)<\/script>/gim,``).replace(/ on\w+="[^"]*"/g,``):svgContent.value=null}catch(e){console.warn(`Failed to load SVG inline:`,newPath,e),svgContent.value=null}else svgContent.value=null},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-identity`,{"no-insurance":!hasInsurance.value}])},[svgContent.value?(openBlock(),createElementBlock(`div`,{key:0,class:`insurance-icon`,innerHTML:svgContent.value},null,8,_hoisted_1$243)):props.insuranceData.image?(openBlock(),createBlock(unref(bngImage_default),{key:1,class:`insurance-icon`,src:`/${props.insuranceData.image}`,alt:props.insuranceData.name},null,8,[`src`,`alt`])):(openBlock(),createElementBlock(`div`,_hoisted_2$201,[createBaseVNode(`div`,_hoisted_3$176,[createVNode(unref(bngIcon_default),{class:`insurance-no-icon`,type:unref(icons).danger},null,8,[`type`]),createTextVNode(` `+toDisplayString(hasNoInsurance.value?_ctx.$t(`ui.career.insurance.noInsurance`):props.insuranceData.name),1)])])),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$149,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1))],2))}},insuranceIdentity_default=__plugin_vue_export_helper_default(_sfc_main$272,[[`__scopeId`,`data-v-689b89ea`]]),_hoisted_1$242={key:1,class:`coverage-option-name`},_hoisted_2$200={key:2,class:`choices`},_hoisted_3$175=[`onClick`],_hoisted_4$148={class:`choice-label`},_hoisted_5$129={key:0},_hoisted_6$110={key:0,class:`choice-secondary-text`},_hoisted_7$97={key:1,class:`choice-price`},_hoisted_8$81={key:3,class:`toggle-container`},_hoisted_9$72={class:`toggle-price`},_sfc_main$271={__name:`coverageOption`,props:{coverageOption:{type:Object,required:!0},changedCoverageOptions:{type:Object,required:!1,default:()=>({})},onlyShowMainText:{type:Boolean,default:!1},simpleSelect:{type:Boolean},modelValue:{type:Number,required:!1},showPerkMode:{type:String,default:`deportedLabel`},dontShowName:{type:Boolean,default:!1}},emits:[`choiceClick`,`toggleChange`,`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit;watch(()=>props.coverageOption?.choices,newChoices=>{if(props.modelValue!==void 0&&props.modelValue!==null&&newChoices){let maxValidId=newChoices.length;props.modelValue>maxValidId&&emit$1(`update:modelValue`,1)}},{immediate:!0});let getSelectedValueId=()=>props.modelValue!==void 0&&props.modelValue!==null?Math.min(props.modelValue,props.coverageOption.choices.length):props.changedCoverageOptions[props.coverageOption.key],getToggleValue=coverageOption=>(props.changedCoverageOptions[coverageOption.key]??coverageOption.currentValueId)===coverageOption.choices.findIndex(choice=>choice.value===!0)+1,getTogglePrice=coverageOption=>{let selectedValueId=props.changedCoverageOptions[coverageOption.key]??coverageOption.currentValueId;return coverageOption.choices[selectedValueId-1]?.premiumInfluence||0},onToggleChange=(coverageOption,newValue)=>{emit$1(`toggleChange`,coverageOption,newValue)},onChoiceClick=(coverageOption,choice)=>{choice.disabled||(props.simpleSelect&&(coverageOption.currentValueId=choice.id),props.modelValue!==void 0&&props.modelValue!==null&&emit$1(`update:modelValue`,choice.id),emit$1(`choiceClick`,coverageOption,choice))};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`coverage-options`,{"in-row":__props.coverageOption.choiceType===`toggle`}])},[__props.coverageOption.perkText&&__props.showPerkMode===`deportedLabel`?(openBlock(),createBlock(unref(insurancePerkNotice_default),{key:0,perkText:__props.coverageOption.perkText},null,8,[`perkText`])):createCommentVNode(``,!0),__props.dontShowName?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$242,toDisplayString(__props.coverageOption.name),1)),__props.coverageOption.choiceType===`multiple`?(openBlock(),createElementBlock(`div`,_hoisted_2$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.coverageOption.choices,choice=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`choice`,{selected:choice.id===__props.changedCoverageOptions[__props.coverageOption.key],current:choice.id===getSelectedValueId(),disabled:choice.disabled}]),key:choice,onClick:()=>onChoiceClick(__props.coverageOption,choice)},[createBaseVNode(`div`,_hoisted_4$148,toDisplayString(choice.choiceText),1),__props.onlyShowMainText?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$129,[choice.secondaryText?(openBlock(),createElementBlock(`div`,_hoisted_6$110,toDisplayString(choice.secondaryText),1)):(openBlock(),createElementBlock(`div`,_hoisted_7$97,[createVNode(unref(bngUnit_default),{money:choice.premiumInfluence},null,8,[`money`])]))]))],10,_hoisted_3$175))),128))])):__props.coverageOption.choiceType===`toggle`?(openBlock(),createElementBlock(`div`,_hoisted_8$81,[createVNode(unref(bngSwitch_default),{class:`toggle-switch`,"model-value":getToggleValue(__props.coverageOption),onChange:_cache[0]||=newValue=>onToggleChange(__props.coverageOption,newValue)},null,8,[`model-value`]),createBaseVNode(`div`,_hoisted_9$72,[createVNode(unref(bngUnit_default),{money:getTogglePrice(__props.coverageOption)},null,8,[`money`])])])):createCommentVNode(``,!0)],2))}},coverageOption_default=__plugin_vue_export_helper_default(_sfc_main$271,[[`__scopeId`,`data-v-4921f4f0`]]),_hoisted_1$241={class:`popup-content`},_hoisted_2$199={class:`popup-header`},_hoisted_3$174={class:`top-info`},_hoisted_4$147={class:`top-info-title`},_hoisted_5$128={class:`top-info-policy-name`},_hoisted_6$109={class:`top-info-description`},_hoisted_7$96={class:`vehicle-list`},_hoisted_8$80={class:`closeButton`},_sfc_main$270={__name:`vehicleInsuranceList`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openEditVehicleCoverage=vehicle=>{addPopup(editVehicleCoverage_default,{insuranceData:props.insuranceData,vehicleData:vehicle})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$241,[createBaseVNode(`div`,_hoisted_2$199,[createBaseVNode(`div`,_hoisted_3$174,[createBaseVNode(`div`,_hoisted_4$147,[_cache[0]||=createTextVNode(` Vehicles Insured By `,-1),createBaseVNode(`span`,_hoisted_5$128,toDisplayString(props.insuranceData.name),1)]),createBaseVNode(`div`,_hoisted_6$109,[_cache[1]||=createTextVNode(` Click any vehicle to adjust its deductible • Total Value: `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createVNode(unref(bngButton_default),{class:`policy-coverage-button`,accent:`custom`,onClick:openEditPolicy},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Policy Coverage `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_7$96,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.carsInsured,(vehicle,index)=>(openBlock(),createBlock(unref(insuranceVehTile_default),{key:index,vehicle},{rightContent:withCtx(()=>[createVNode(unref(bngButton_default),{class:`edit-coverage-button bigger-button`,accent:`custom`,disabled:vehicle.needsRepair,onClick:$event=>!vehicle.needsRepair&&openEditVehicleCoverage(vehicle)},{default:withCtx(()=>[createTextVNode(toDisplayString(vehicle.needsRepair?`Edit Coverage (Needs repair)`:`Edit Coverage`),1)]),_:2},1032,[`disabled`,`onClick`])]),_:2},1032,[`vehicle`]))),128))]),createBaseVNode(`div`,_hoisted_8$80,[createVNode(unref(bngButton_default),{class:`close-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Cancel `,-1)]]),_:1})])]))}},vehicleInsuranceList_default=__plugin_vue_export_helper_default(_sfc_main$270,[[`__scopeId`,`data-v-2bd92225`]]),_hoisted_1$240={class:`vehicle-item`},_hoisted_2$198={class:`left`},_hoisted_3$173={class:`vehicle-thumbnail-wrapper`},_hoisted_4$146=[`src`],_hoisted_5$127={class:`name-value-wrapper`},_hoisted_6$108={class:`vehicle-name`},_hoisted_7$95={class:`vehicle-value`},_hoisted_8$79={class:`right`},_sfc_main$269={__name:`insuranceVehTile`,props:{vehicle:{type:Object,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$240,[createBaseVNode(`div`,_hoisted_2$198,[createBaseVNode(`div`,_hoisted_3$173,[createBaseVNode(`img`,{src:__props.vehicle.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_4$146)]),createBaseVNode(`div`,_hoisted_5$127,[createBaseVNode(`div`,_hoisted_6$108,toDisplayString(__props.vehicle.name),1),createBaseVNode(`div`,_hoisted_7$95,[_cache[0]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.initialValue},null,8,[`money`])]),renderSlot(_ctx.$slots,`extra-info`,{},void 0,!0)])]),createBaseVNode(`div`,_hoisted_8$79,[renderSlot(_ctx.$slots,`rightContent`,{},void 0,!0)])]))}},insuranceVehTile_default=__plugin_vue_export_helper_default(_sfc_main$269,[[`__scopeId`,`data-v-b4076016`]]),_hoisted_1$239={class:`popup-content`},_hoisted_2$197={key:0,class:`vehicle-list`},_hoisted_3$172={key:1,class:`no-vehicles-wrapper`},_hoisted_4$145={class:`closeButton`},_sfc_main$268={__name:`uninsuredVehicles`,props:{uninsuredData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openAddCoverage=vehicle=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:vehicle.id}})};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$239,[_cache[5]||=createBaseVNode(`div`,{class:`popup-header`},[createBaseVNode(`span`,{class:`header-title`},`Uninsured Vehicles`)],-1),_cache[6]||=createBaseVNode(`div`,{class:`warning-message`},` These vehicles have no insurance coverage. Add coverage to protect against repair costs. `,-1),props.uninsuredData.carsUninsured&&props.uninsuredData.carsUninsured.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$197,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.uninsuredData.carsUninsured,(vehicle,index)=>(openBlock(),createBlock(unref(insuranceVehTile_default),{key:index,vehicle,class:`uninsured-vehicle-item`},{"extra-info":withCtx(()=>[..._cache[0]||=[createBaseVNode(`div`,{class:`no-coverage-warning`},` No coverage - you pay full repair costs `,-1)]]),rightContent:withCtx(()=>[createVNode(unref(bngButton_default),{class:`add-coverage-button bigger-button`,accent:`custom`,onClick:$event=>openAddCoverage(vehicle)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`button-icon`,type:unref(icons).shieldCheckmark},null,8,[`type`]),_cache[1]||=createTextVNode(` Add Coverage `,-1)]),_:1},8,[`onClick`])]),_:2},1032,[`vehicle`]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_3$172,[createVNode(unref(bngIcon_default),{class:`success-icon`,type:unref(icons).checkmark},null,8,[`type`]),_cache[2]||=createBaseVNode(`div`,{class:`success-title`},`All Vehicles Insured`,-1),_cache[3]||=createBaseVNode(`div`,{class:`success-message`},`You don't have any uninsured vehicles.`,-1)])),createBaseVNode(`div`,_hoisted_4$145,[createVNode(unref(bngButton_default),{class:`close-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Back `,-1)]]),_:1})])]))}},uninsuredVehicles_default=__plugin_vue_export_helper_default(_sfc_main$268,[[`__scopeId`,`data-v-f51ead8e`]]),sharedMode=ref(null),sharedContext=ref(null);function useChooseInsurance(){let{events:events$3}=useBridge(),insurancesData=ref([]),purchaseData=ref({}),vehicleInfo=ref({}),defaultInsuranceId=ref(null),firstSelectedInsuranceId=ref(null),driverScoreData=ref({}),currentInsuranceId=ref(null),handleChooseInsuranceData=data=>{insurancesData.value=data.applicableInsurancesData,purchaseData.value=data.purchaseData,vehicleInfo.value=data.vehicleInfo,driverScoreData.value=data.driverScoreData,defaultInsuranceId.value=data.defaultInsuranceId,firstSelectedInsuranceId.value=data.defaultInsuranceId,currentInsuranceId.value=data.currentInsuranceId};function openChooseInsuranceMenu(menuMode,params){sharedMode.value=menuMode,sharedContext.value=params,Lua_default.career_modules_insurance_insurance.openChooseInsuranceScreen()}function requestDataForCurrentContext(){sharedMode.value===`purchase`&&sharedContext.value?Lua_default.career_modules_insurance_insurance.sendChooseInsuranceDataToTheUI(sharedContext.value.purchaseType,sharedContext.value.shopId,sharedContext.value.insuranceId):sharedMode.value===`change`&&sharedContext.value&&Lua_default.career_modules_insurance_insurance.sendChangeInsuranceDataToTheUI(sharedContext.value.vehicleId)}return events$3.on(`chooseInsuranceData`,handleChooseInsuranceData),onUnmounted(()=>{events$3.off(`chooseInsuranceData`,handleChooseInsuranceData)}),{openChooseInsuranceMenu,requestDataForCurrentContext,insurancesData,purchaseData,vehicleInfo,defaultInsuranceId,firstSelectedInsuranceId,driverScoreData,currentInsuranceId,mode:sharedMode,context:sharedContext}}var _hoisted_1$238={class:`popup-content`},_hoisted_2$196={class:`popup-header`},_hoisted_3$171={class:`content-wrapper`},_hoisted_4$144={class:`buttons-wrapper`},_hoisted_5$126={class:`button-container`},_sfc_main$267={__name:`ChooseInsuranceMain`,props:{menuMode:{type:String,required:!0},params:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){useUINavBlocker().ensureNoBlock([`tab_l`,`tab_r`]);let overflowRef=ref(null),onTabNav=evt=>{evt.detail.value===1&&(console.log(`onTabNav`,evt.detail),console.log(`overflowRef`,overflowRef.value),evt.detail.name===`tab_l`&&overflowRef.value?.activatePrev(),evt.detail.name===`tab_r`&&overflowRef.value?.activateNext())},props=__props,emit$1=__emit,{units}=useBridge(),selectedInsuranceId=ref(null),selectedShelfIndex=ref(0),{insurancesData,purchaseData,defaultInsuranceId,firstSelectedInsuranceId,vehicleInfo,requestDataForCurrentContext,mode,context,driverScoreData,currentInsuranceId}=useChooseInsurance();onMounted(()=>{window.addEventListener(DOM_UI_NAVIGATION_EVENT,onTabNav),mode.value=props.menuMode,context.value=props.params,props.menuMode===`purchase`&&props.params?Lua_default.career_modules_insurance_insurance.sendChooseInsuranceDataToTheUI(props.params.purchaseType,props.params.shopId,props.params.insuranceId):props.menuMode===`change`&&props.params&&Lua_default.career_modules_insurance_insurance.sendChangeInsuranceDataToTheUI(props.params.vehicleId)}),watch(selectedShelfIndex,newIndex=>{insurancesData.value[newIndex]&&(selectedInsuranceId.value=insurancesData.value[newIndex].id)}),watch(defaultInsuranceId,defaultId=>{if(defaultId!==null){selectedInsuranceId.value=defaultId;let index=insurancesData.value.findIndex(ins=>ins.id===defaultId);index!==-1&&(selectedShelfIndex.value=index)}},{immediate:!0});let onShelfClick=(insuranceId,index)=>{selectedInsuranceId.value=insuranceId,selectedShelfIndex.value=index},buttonText=computed(()=>mode.value===`change`?selectedInsuranceId.value===-1?`Remove Coverage`:selectedInsuranceId.value===currentInsuranceId.value?`Current Provider`:`Move vehicle here`:`Select this option`),viewCostBreakdown=()=>{mode.value===`purchase`?addPopup(purchaseInsuranceDetails_default,{insuranceData:insurancesData.value[selectedShelfIndex.value],vehicleInfo:vehicleInfo.value,driverScoreData:driverScoreData.value}):addPopup(changeInsuranceDetails_default,{insuranceData:insurancesData.value[selectedShelfIndex.value],vehicleInfo:vehicleInfo.value,driverScoreData:driverScoreData.value})},continueWithInsurance=()=>{mode.value===`purchase`?(selectedInsuranceId.value!==null&&selectedInsuranceId.value!==void 0&&Lua_default.career_modules_vehicleShopping.updateInsuranceSelection(selectedInsuranceId.value),emit$1(`return`,!0)):mode.value===`change`&&(selectedInsuranceId.value&&context.value?.vehicleId&&Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(context.value.vehicleId,selectedInsuranceId.value),closeLastPopups(3))},cancel=()=>{emit$1(`return`,!0)};return onUnmounted(()=>{window.removeEventListener(DOM_UI_NAVIGATION_EVENT,onTabNav),mode.value=null,context.value=null}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$238,[createBaseVNode(`div`,_hoisted_2$196,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(mode)===`purchase`?`Insure your `:`Switch insurance for your `)+` `+toDisplayString(unref(vehicleInfo).Name),1)]),_:1})]),createBaseVNode(`div`,_hoisted_3$171,[createVNode(unref(bngOverflowContainer_default),{ref_key:`overflowRef`,ref:overflowRef,class:`insurance-shelf`,"scroll-speed":10,"initial-index":selectedShelfIndex.value,"use-bindings-only":``,"show-arrows":``,"no-wheel":``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(insurancesData),(insurance,index)=>(openBlock(),createBlock(unref(insuranceCard_default),{key:insurance.id,insuranceData:insurance,isSelected:selectedInsuranceId.value===insurance.id,vehicleInfo:unref(vehicleInfo),isCurrentProvider:unref(mode)===`change`&&unref(currentInsuranceId)===insurance.id,class:`insurance-card`,onClick:$event=>onShelfClick(insurance.id,index)},null,8,[`insuranceData`,`isSelected`,`vehicleInfo`,`isCurrentProvider`,`onClick`]))),128))]),_:1},8,[`initial-index`])]),createBaseVNode(`div`,_hoisted_4$144,[createBaseVNode(`div`,_hoisted_5$126,[createVNode(unref(bngButton_default),{onClick:cancel,accent:unref(ACCENTS).attention},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(`Cancel`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:viewCostBreakdown,disabled:selectedShelfIndex.value===0||unref(mode)===`change`&&selectedInsuranceId.value===unref(currentInsuranceId),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`View Cost Breakdown`,-1)]]),_:1},8,[`disabled`,`accent`]),createVNode(unref(bngButton_default),{disabled:!selectedInsuranceId.value||unref(mode)===`change`&&selectedInsuranceId.value===unref(currentInsuranceId),onClick:continueWithInsurance},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonText.value),1)]),_:1},8,[`disabled`])])])]))}},ChooseInsuranceMain_default=__plugin_vue_export_helper_default(_sfc_main$267,[[`__scopeId`,`data-v-7bb3e442`]]),_hoisted_1$237={class:`progress-view-actions`},_hoisted_2$195={class:`progress-view-page`},_hoisted_3$170={class:`progress-view-header`},_hoisted_4$143={class:`branch-icon-assembly large`},_hoisted_5$125={key:0,class:`reward-multiplier`},_hoisted_6$107={class:`reward-multiplier-label`},_hoisted_7$94={class:`reward-multiplier-value`},_hoisted_8$78={class:`progress-view-contents`},_hoisted_9$71={class:`progress-view-description`},_hoisted_10$62={class:`progress-view-scrollable`},_sfc_main$266={__name:`ProgressView`,props:{skillInfo:{type:Object,default:null},headingText:{type:String,default:``},breadcrumbItems:{type:Array,required:!0},branchStyle:{type:Object,required:!0},showBackButton:{type:Boolean,default:!0}},emits:[`breadcrumb-click`,`breadcrumb-back`,`exit`,`skill-click`],setup(__props,{emit:__emit}){let emit$1=__emit,handleBreadcrumbClick=item=>{emit$1(`breadcrumb-click`,item)},handleBreadcrumbBack=()=>{emit$1(`breadcrumb-back`)},handleExit=()=>{emit$1(`exit`)};return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`progress-view-layout`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:`progress-view-wrapper`,style:normalizeStyle(__props.branchStyle),"bng-ui-scope":`progressView`},[createBaseVNode(`div`,_hoisted_1$237,[createVNode(unref(bngBreadcrumbs_default),{class:`progress-view-breadcrumbs`,items:__props.breadcrumbItems,limit:`5`,simple:``,"disable-last-item":``,"show-back-button":__props.showBackButton,onClick:handleBreadcrumbClick,onBack:handleBreadcrumbBack},null,8,[`items`,`show-back-button`]),createVNode(unref(careerStatus_default),{class:`progress-view-career-status`,slim:``})]),createBaseVNode(`div`,_hoisted_2$195,[createBaseVNode(`div`,_hoisted_3$170,[__props.skillInfo?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`div`,{class:normalizeClass([`header-skill`,{"is-locked":!__props.skillInfo.unlocked}]),onClick:_cache[0]||=$event=>_ctx.$emit(`skill-click`,__props.skillInfo.id)},[createBaseVNode(`div`,_hoisted_4$143,[createBaseVNode(`div`,{class:`branch-background`,style:normalizeStyle(unref(getIconBackgroundStyle)(__props.skillInfo.color))},null,4),createVNode(unref(bngIcon_default),{type:unref(icons)[__props.skillInfo.unlocked?__props.skillInfo.icon:`lockClosed`],class:`assembly-icon large`},null,8,[`type`])]),createVNode(BranchSkillProgressBar_default,{class:`main-stat-progress-bar skill-progress-bar`,skill:__props.skillInfo,showLevel:!1,mode:`with-value-label`,showLockedIcon:!0,isMainProgress:!0},null,8,[`skill`])],2),__props.skillInfo.rewardMultiplier?(openBlock(),createElementBlock(`div`,_hoisted_5$125,[createBaseVNode(`div`,_hoisted_6$107,[createVNode(unref(bngIcon_default),{type:__props.skillInfo.rewardMultiplierSourceIcon},null,8,[`type`]),_cache[1]||=createTextVNode(` Reward Multiplier: `,-1)]),createBaseVNode(`div`,_hoisted_7$94,[createVNode(unref(bngIcon_default),{type:unref(icons).beamCurrency},null,8,[`type`]),createTextVNode(` ×`+toDisplayString(__props.skillInfo.rewardMultiplier.toFixed(2)),1)])])):createCommentVNode(``,!0)],64)):(openBlock(),createBlock(unref(bngScreenHeadingV2_default),{key:1,type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.headingText),1)]),_:1}))]),createBaseVNode(`div`,_hoisted_8$78,[createBaseVNode(`div`,_hoisted_9$71,[renderSlot(_ctx.$slots,`description`,{},void 0,!0)]),_cache[2]||=createBaseVNode(`div`,{class:`progress-view-divider`},null,-1),createBaseVNode(`div`,_hoisted_10$62,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])])])],4)),[[unref(BngOnUiNav_default),handleExit,`back,menu`]])]),_:3})),[[unref(BngOnUiNav_default),handleExit,`back,menu`],[unref(BngBlur_default)]])}},ProgressView_default=__plugin_vue_export_helper_default(_sfc_main$266,[[`__scopeId`,`data-v-3fa921dc`]]),_hoisted_1$236={class:`description-text`},_hoisted_2$194={key:0,class:`cards-container grid-view`},_hoisted_3$169={key:1,class:`page-progress`},_hoisted_4$142={key:2,class:`facility-rows`},_hoisted_5$124={key:3,class:`buttons-container`},_hoisted_6$106={class:`content`},_hoisted_7$93={key:0,class:`indicator`},_sfc_main$265={__name:`ProgressLanding`,props:{pathId:String,comesFromBigMap:{type:Boolean,default:!1}},setup(__props){let props=__props,landingData=ref({heading:`ui.career.landingPage.name`,description:`ui.career.landingPage.description`,branches:[],showMilestones:!0,showOrganizations:!0}),leagues=ref([]),fetchLandingData=async()=>{landingData.value={heading:`ui.career.landingPage.name`,description:`ui.career.landingPage.description`,branches:[],showMilestones:!0,showOrganizations:!0};let data=await Lua_default.career_modules_branches_landing.getLandingPageData(props.pathId);landingData.value=data,leagues.value=data.leagues||[],console.log(`data`,data),data.breadcrumbs&&(screenHeaderPath.value=data.breadcrumbs,console.log(`screenHeaderPath`,screenHeaderPath.value))},hasUnclaimedMilestones=ref(!1);onMounted(async()=>{await fetchLandingData(),Lua_default.career_modules_milestones_milestones.unclaimedMilestonesCount().then(c=>hasUnclaimedMilestones.value=c)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`progressLanding`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`progressLanding`)}),watch(()=>props.pathId,async(newPathId,oldPathId)=>{newPathId!==oldPathId&&(await fetchLandingData(),Lua_default.career_modules_milestones_milestones.unclaimedMilestonesCount().then(c=>hasUnclaimedMilestones.value=c))});let leagueMissionClicked=mission=>{mission.canStartFromProgressScreen?(Lua_default.extensions.gameplay_missions_missionScreen.setPreselectedMissionId(mission.id),Lua_default.extensions.gameplay_missions_missionScreen.openAPMChallenges(props.pathId,mission.skill[0])):Lua_default.extensions.gameplay_missions_missionScreen.navigateToMission(mission.id)},branchStyle=computed(()=>landingData.value.skillInfo?getBranchColorStyle({color:landingData.value.skillInfo.color,accentColor:landingData.value.skillInfo.accentColor}):{"--branch-accent-color":`var(--bng-cool-gray-500-rgb)`,"--branch-color":`var(--bng-cool-gray-500-rgb)`}),pageHeading=computed(()=>landingData.value.branchHeading||landingData.value.heading),currentDescription=ref(null),pageDescription=computed(()=>currentDescription.value||landingData.value.description),BRANCHES=computed(()=>landingData.value.branches),openBranchPage=branchKey=>{let target=landingData.value.branches.find(b=>b.id===branchKey).target;console.log(`openBranchPage`,branchKey),window.bngVue.gotoGameState(`progressLanding`,{params:{pathId:branchKey}})},exit=()=>{props.pathId&&!props.comesFromBigMap?router_default.back():window.bngVue.gotoAngularState(`menu.careerPause`)},openMilestonesScreen=()=>window.bngVue.gotoGameState(`milestones`),onBranchFocus=branch=>{currentDescription.value=branch.description},onBranchBlur=()=>{currentDescription.value=null},isHalfBranch=branch=>{let hasSkills=branch.skills&&branch.skills.length>0,hasDescription=branch.shortDescription;return!hasSkills&&!hasDescription},currentSkillToShow=computed(()=>landingData.value.skillInfo||null),screenHeaderPath=ref([{label:`Career`,path:`/career`},{label:landingData.value.heading,path:`/career/${landingData.value.id}`}]),gotoHeaderItem=item=>{item.gotoPath&&(window.bngVue.gotoGameState(item.gotoPath.path,{params:item.gotoPath.props}),console.log(`gotoPath`,item.gotoPath)),item.gotoAngularState&&window.bngVue.gotoAngularState(item.gotoAngularState)},onBreadBack=()=>{gotoHeaderItem(screenHeaderPath.value[screenHeaderPath.value.length-2])};return(_ctx,_cache)=>(openBlock(),createBlock(ProgressView_default,{"skill-info":landingData.value.skillInfo,"heading-text":_ctx.$t(pageHeading.value),"breadcrumb-items":screenHeaderPath.value,"branch-style":branchStyle.value,"show-back-button":!0,onBreadcrumbClick:gotoHeaderItem,onBreadcrumbBack:onBreadBack,onExit:exit},{description:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$236,toDisplayString(_ctx.$t(pageDescription.value)),1)]),default:withCtx(()=>[BRANCHES.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$194,[(openBlock(!0),createElementBlock(Fragment,null,renderList(BRANCHES.value,branch=>withDirectives((openBlock(),createBlock(BranchSkillCard_default,{tabindex:`1`,branchKey:branch.id,onOpenBranchPage:openBranchPage,onMouseenter:$event=>onBranchFocus(branch),onMouseleave:onBranchBlur,onFocus:$event=>onBranchFocus(branch),onBlur:onBranchBlur,"bng-nav-item":``,"display-mode":`row`,class:normalizeClass({"full-width":!isHalfBranch(branch)})},null,8,[`branchKey`,`onMouseenter`,`onFocus`,`class`])),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])),256))])):createCommentVNode(``,!0),currentSkillToShow.value&¤tSkillToShow.value.hasLevels&¤tSkillToShow.value.unlockInfo&¤tSkillToShow.value.unlockInfo.length?(openBlock(),createElementBlock(`div`,_hoisted_3$169,[currentSkillToShow.value.hasUnlocks?(openBlock(),createBlock(UnlockRows_default,{key:0,class:`stat-progress-bar bng-progress-bar progress-bar`,headerLeft:_ctx.$ctx_t(currentSkillToShow.value.name),headerRight:_ctx.$ctx_t(currentSkillToShow.value.levelLabel),value:currentSkillToShow.value.value,max:currentSkillToShow.value.max,min:currentSkillToShow.value.min,maxRequiredValue:currentSkillToShow.value.maxRequiredValue,tiers:currentSkillToShow.value.unlockInfo,currentTier:currentSkillToShow.value.unlocked?currentSkillToShow.value.level:-1,unlocked:currentSkillToShow.value.unlocked,progressFillColor:currentSkillToShow.value.accentColor},null,8,[`headerLeft`,`headerRight`,`value`,`max`,`min`,`maxRequiredValue`,`tiers`,`currentTier`,`unlocked`,`progressFillColor`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),leagues.value&&leagues.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_4$142,[(openBlock(!0),createElementBlock(Fragment,null,renderList(leagues.value,league=>(openBlock(),createBlock(LeagueRow_default,{key:league.id,league,leagueMissionClicked},null,8,[`league`]))),128))])):createCommentVNode(``,!0),landingData.value.showMilestones?(openBlock(),createElementBlock(`div`,_hoisted_5$124,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,class:`button milestone-button`,onClick:openMilestonesScreen},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$106,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).checkboxOn},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`label`},` Milestones `,-1),hasUnclaimedMilestones.value>0?(openBlock(),createElementBlock(`div`,_hoisted_7$93)):createCommentVNode(``,!0)])]),_:1})),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])])):createCommentVNode(``,!0)]),_:1},8,[`skill-info`,`heading-text`,`breadcrumb-items`,`branch-style`]))}},ProgressLanding_default=__plugin_vue_export_helper_default(_sfc_main$265,[[`__scopeId`,`data-v-cbe0bb9d`]]),_hoisted_1$235={class:`reward-wrapper`},_hoisted_2$193={class:`card-content`},_hoisted_3$168={class:`rewards-breakdown-container padding-bottom`},_hoisted_4$141={class:`grid-wrapper`},_hoisted_5$123={class:`grid-row grid`},_hoisted_6$105={class:`label primary`},_hoisted_7$92={class:`rewards primary`},_hoisted_8$77={class:`grid-wrapper wide`},_hoisted_9$70={class:`grid`},_hoisted_10$61={class:`label secondary`},_hoisted_11$55={class:`rewards secondary`},_hoisted_12$44={class:`grid-row grid`},_hoisted_13$37={class:`rewards primary`},_hoisted_14$35={class:`padding-bottom`},_hoisted_15$33={key:0,class:`unlocks-wrapper`},__default__$4={wrapper:{fade:!0,blur:!0,style:popupContainer.transparent},position:[popupPosition.center,popupPosition.center]},_sfc_main$264=Object.assign(__default__$4,{__name:`CargoDeliveryReward`,emits:[`return`],setup(__props,{emit:__emit}){useCssVars(_ctx=>({v4c61e8a8:ANIM_DURATION_CSS})),useUINavScope(`deliveryReward`);let ANIMATION_START_DELAY=1e3,ANIMATION_DURATION=2e3,ANIM_DURATION_CSS=ANIMATION_DURATION+`ms`,showBarAnimations=ref(!1),data=storeToRefs(useGameContextStore()).deliveryRewardData,exit=()=>{window.bngVue.gotoGameState(`play`)};function stopAnimations(){showBarAnimations.value=!1}function startProgressBarAnimation(){if(data.value){showBarAnimations.value=!0;for(let[key,value]of Object.entries(data.value.summary.rewards))value.branchInfo&&(value.branchInfo.animValue=value.branchInfo.value);setTimeout(stopAnimations,ANIMATION_DURATION)}}return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`cargoDeliveryReward`)}),onMounted(()=>{getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),showBarAnimations.value=!1,setTimeout(startProgressBarAnimation,1e3)}),onUnmounted(()=>{Lua_default.career_modules_delivery_cargoScreen.unloadCargoPopupClosed(),Lua_default.simTimeAuthority.popPauseRequest(`cargoDeliveryReward`)}),(_ctx,_cache)=>unref(data)?withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{key:0,class:`layout-content-full flex-column layout-paddings layout-align-center`,"bng-ui-scope":`deliveryReward`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$235,[createVNode(unref(bngCard_default),null,{buttons:withCtx(()=>[createVNode(unref(bngButton_default),{onClick:exit},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[5]||=createBaseVNode(`span`,null,`Continue`,-1)]),_:1})]),default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`career-status`}),createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Delivery Complete! `,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$193,[createBaseVNode(`div`,_hoisted_3$168,[_cache[3]||=createBaseVNode(`span`,{class:`span2-heading`},` Reward Breakdown `,-1),createBaseVNode(`div`,_hoisted_4$141,[_cache[2]||=createBaseVNode(`div`,{class:`grid-row grid`},[createBaseVNode(`div`,{class:`label primary`},`Item`),createBaseVNode(`div`,{class:`rewards primary`},`Rewards`)],-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).sortedResults,result=>(openBlock(),createElementBlock(`div`,_hoisted_5$123,[createBaseVNode(`div`,_hoisted_6$105,toDisplayString(result.label),1),createBaseVNode(`div`,_hoisted_7$92,[createVNode(RewardsPills_default,{rewards:result.rewards},null,8,[`rewards`])]),createBaseVNode(`div`,_hoisted_8$77,[(openBlock(!0),createElementBlock(Fragment,null,renderList(result.breakdown,breakdown=>(openBlock(),createElementBlock(`div`,_hoisted_9$70,[createBaseVNode(`div`,_hoisted_10$61,toDisplayString(breakdown.label),1),createBaseVNode(`div`,_hoisted_11$55,[createVNode(RewardsPills_default,{rewards:breakdown.rewards},null,8,[`rewards`])])]))),256))])]))),256)),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_12$44,[_cache[1]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_13$37,[createVNode(RewardsPills_default,{rewards:unref(data).summary.rewards},null,8,[`rewards`])])])])]),createBaseVNode(`div`,_hoisted_14$35,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).summary.rewards,reward=>(openBlock(),createElementBlock(`div`,null,[reward.branchInfo?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,class:normalizeClass({"stat-progress-bar":!0,"animate-progress":showBarAnimations.value}),headerLeft:_ctx.$ctx_t(reward.branchInfo.name),headerRight:_ctx.$ctx_t(reward.branchInfo.level),min:reward.branchInfo.max==-1?0:reward.branchInfo.min,value:reward.branchInfo.max==-1?1:reward.branchInfo.animValue,max:reward.branchInfo.max==-1?1:reward.branchInfo.max,"value-label-format":reward.branchInfo.max==-1?`Max Level Reached`:void 0},null,8,[`class`,`headerLeft`,`headerRight`,`min`,`value`,`max`,`value-label-format`])):createCommentVNode(``,!0)]))),256))]),unref(data).summary.unlocks.length?(openBlock(),createElementBlock(`div`,_hoisted_15$33,[_cache[4]||=createBaseVNode(`span`,{class:`span2-heading`},` Unlocks`,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).summary.unlocks,unlock=>(openBlock(),createBlock(UnlockCard_default,{class:`unlock-item`,data:unlock},null,8,[`data`]))),256))])):createCommentVNode(``,!0)])]),_:1})])]),_:1})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),exit,`back,menu,ok`]]):createCommentVNode(``,!0)}}),CargoDeliveryReward_default=__plugin_vue_export_helper_default(_sfc_main$264,[[`__scopeId`,`data-v-e964374f`]]),_hoisted_1$234={key:0,class:`context`},_hoisted_2$192={key:0,class:`card-label`},_hoisted_3$167={key:1,class:`card-label`},_hoisted_4$140={class:`simple-props-wrapper`},_hoisted_5$122={key:1,class:`to-load`},_hoisted_6$104={class:`chevron-arrow`},_hoisted_7$91={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_8$76={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_9$69={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_10$60={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-orange-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_11$54={key:2},_hoisted_12$43={key:0,class:`modifiers`},_hoisted_13$36={key:1,class:`timer-value`},_hoisted_14$34={key:0,class:`orange`},_sfc_main$263={__name:`CargoCard`,props:{card:{type:Object,required:!1},hideProps:Boolean,hideModsAndTimer:Boolean,focus:String,detailed:Boolean,showButtons:{type:Boolean,default:!0},alwaysShowLoadingWrapper:Boolean,ribbon:{type:Boolean,default:!0}},emits:[`cargoHovered`,`onAmountSelectorChanged`],setup(__props,{emit:__emit}){let emit$1=__emit;function onAmountSelectorChanged(value){emit$1(`onAmountSelectorChanged`,value)}let props=__props,cargoOverviewStore=useCargoOverviewStore(),{units}=useBridge(),getCargoCardClass=card=>({cardRow:!0,"bg-available":card.isFacilityCard&&card.enabled,"bg-available-selected":card.isFacilityCard&&card.enabled&&cargoOverviewStore.selectedCargo===card,"bg-assigned":card.transientMove,"bg-assigned-selected":card.transientMove&&cargoOverviewStore.selectedCargo===card,"bg-locked":card.isFacilityCard&&!card.enabled,"bg-locked-selected":card.isFacilityCard&&!card.enabled&&cargoOverviewStore.selectedCargo===card,"bg-loaded":card.isPlayerCard&&!card.transientMove,"bg-loaded-selected":card.isPlayerCard&&!card.transientMove&&cargoOverviewStore.selectedCargo===card,"highlight-poi-selected":!!(!props.detailed&&cargoOverviewStore.highlightedCards[card.cardId]),"card-disabled":!card.enabled,"with-thumbnail":card.thumbnail}),rewardMoney=computed(()=>props.card.rewardMoney||props.card.rewardMoneyPerLiter||(props.card.loanerCut?-(props.card.loanerCut.value*100-props.card.loanerCut.value*100%1)+`%`:void 0)),hasIds=computed(()=>props.card.rewardMoney&&props.card.ids&&props.card.ids.length>0&&!props.card.materialType),isPerLiter=computed(()=>props.card.rewardMoneyPerLiter),isLoadingFacilityCard=computed(()=>props.card.transientMoveCounts>0||props.card.spawnWhenCommitingCargo||props.card._transientMaterialMoveAmount>0),context=computed(()=>props.card.enabled?props.card.isFacilityCard?`Available`:props.card.transientMoveCounts>0||props.card.spawnWhenCommitingCargo||props.card._transientMaterialMoveAmount?`Assigned`:`Loaded`:`Locked`),isMoving=computed(()=>cargoOverviewStore.cargoData.player.isMoving),chevronProp=computed(()=>{let card=props.card;if(!card.isPlayerCard){if(card.cardType===`parcelGroup`)return card.materialType?card.transientMoveCounts>0||props.alwaysShowLoadingWrapper?{class:card.transientMoveCounts==0?`amount-load no-load`:`amount-load`,valueLabel:card.slots+`L`}:void 0:card.transientMoveCounts>0||props.alwaysShowLoadingWrapper?{class:card.transientMoveCounts==0?`amount-load no-load`:`amount-load`,valueLabel:card.transientMoveCounts+` / `+card.ids.length}:void 0;if(card.cardType===`vehicleOffer`)return card.spawnWhenCommitingCargo?{class:`amount-load`,valueLabel:`Accepted`,iconType:icons.fastTravel}:void 0;if(card.cardType===`storage`)return card._transientMaterialMoveAmount>0||props.alwaysShowLoadingWrapper?{class:card._transientMaterialMoveAmount==0?`amount-load no-load`:`amount-load`,valueLabel:card._transientMaterialMoveAmount+`L / `+card.storage.storedVolume+`L`}:void 0}}),propIcons=computed(()=>{let res=[],card=props.card;if(props.detailed)return res;if(card.enabled&&card.modifiers&&card.modifiers.length)for(let mod of card.modifiers)mod.important&&res.push({type:icons[mod.icon],color:`var(--bng-orange-300)`});return card.disableReason&&card.disableReason.type===`locked`&&res.push({type:icons.lockClosed,color:`var(--bng-add-red-300)`}),res}),cargoProps=computed(()=>{let res=[],card=props.card,detailed=props.detailed,focus$1=props.focus,$tt=$translate.instant,$ctx_t=$translate.contextTranslate,hideProps=props.hideProps;if(card.isFacilityCard&&!card.enabled&&(!card.transientMoveCounts||card.transientMoveCounts<=0)&&(card.disableReason?(card.disableReason.type===`noSpace`&&res.push({iconType:icons.info,keyLabel:detailed?`No Space`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`Not enough space to load this.`:`No Space`,class:`full-width red`,iconColor:`var(--bng-add-red-300)`}),card.disableReason.type===`expired`&&res.push({iconType:icons.info,keyLabel:detailed?`Expired`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`This offer is already expired.`:`Expired`,class:`full-width `}),card.disableReason.type===`limit`&&res.push({iconType:icons.info,keyLabel:detailed?`Limit reached`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`You cannot deliver more cars at the same time.`:`Limit reached`,class:`full-width red`,iconColor:`var(--bng-add-red-300)`})):res.push({iconType:icons.lockClosed,keyLabel:detailed?`Locked..?`:``,valueLabel:detailed?`Not enabled but no disablereason given!`:`Locked..?`,class:`full-width`,iconColor:`var(--bng-add-red-300)`})),card.unlockInfo){let locked=card.disableReason&&card.disableReason.type==`locked`;(detailed||locked)&&res.push({iconType:icons[card.unlockInfo.icon],valueLabel:detailed?$ctx_t(card.unlockInfo.longLabel):``,keyLabel:detailed?locked?`Locked`:``:$ctx_t(card.unlockInfo.shortLabel),class:`full-width `+(locked?`red`:``),iconColor:locked?`var(--bng-add-red-300)`:``})}if(hideProps)return res;if(card.nextTasks&&card.nextTasks.length>0&&(!focus$1||focus$1===`nextTasks`||detailed))for(let task of card.nextTasks)res.push({iconType:icons[task.checked?`checkboxOn`:`checkboxOff`],keyLabel:detailed?`Next Task`:``,valueLabel:task.label,class:`full-width`});if(card.locationName&&(!focus$1||focus$1===`location`||detailed)&&res.push({iconType:icons.locationSource,keyLabel:detailed?`Location`:``,valueLabel:detailed?card.locationNameLong:card.locationName,class:`full-width`}),card.destinationName&&(!focus$1||focus$1===`destination`||detailed)&&res.push({iconType:icons.locationDestination,keyLabel:detailed?`Destination`:``,valueLabel:detailed?card.destinationNameLong:card.destinationName,class:`full-width`}),card.locations&&(!focus$1||focus$1===`destination`)&&!detailed&&res.push({iconType:icons.mapPoint,valueLabel:card.locations.length+` possible Destinations`,class:`full-width`}),card.locations&&detailed)if(card.locations.length==1)res.push({iconType:icons.locationDestination,keyLabel:`Destination`,valueLabel:card.locations[0].name,class:`full-width`});else{res.push({iconType:icons.location2,keyLabel:`Multiple Destinations`,valueLabel:`Deliver this cargo to any of the possible destinations.`,class:`full-width`});let destinationsList=[];for(let location$1 of card.locations)destinationsList.push($tt(location$1.name));destinationsList=destinationsList.map(str=>str.replace(/ /g,` `)),res.push({iconType:icons.mapPoint,keyLabel:`Possible Destinations`,valueLabel:destinationsList.join(`, `),class:`full-width`})}if(card.distance&&(!focus$1||focus$1===`distance`||detailed)&&res.push({iconType:icons.routeSimple,keyLabel:detailed?`Distance`:``,valueLabel:units.buildString(`distance`,card.distance,1),class:``}),card.vehMileage&&(!focus$1||focus$1===`vehMileage`||detailed)&&res.push({iconType:icons.odometer,keyLabel:detailed?`Mileage`:``,valueLabel:units.buildString(`distance`,card.vehMileage,1),class:``}),card.weight&&(!focus$1||focus$1===`weight`||detailed)&&res.push({iconType:icons.weight,keyLabel:detailed?`Weight`:``,valueLabel:units.buildString(`weight`,card.weight,1),class:``}),card.density&&(!focus$1||focus$1===`density`||detailed)&&res.push({iconType:icons.weight,keyLabel:detailed?`Density`:``,valueLabel:units.buildString(`weight`,card.density,2),class:``}),card.storage&&(!focus$1||focus$1===`storage`||detailed)&&res.push({iconType:icons.boxDropOff01,keyLabel:detailed?`Available Volume`:``,valueLabel:(card.storage.storedVolume+(detailed?` / `+card.storage.capacity:``)).replace(/ /g,` `),class:``}),card.slots&&(!focus$1||focus$1===`slots`||detailed)&&res.push({iconType:icons.boxDropOff01,keyLabel:detailed?`Slots`:``,valueLabel:card.slots,class:``}),card.task&&(!focus$1||focus$1===`task`||detailed)&&res.push({iconType:icons.checkboxOff,keyLabel:detailed?`Task`:``,valueLabel:card.task,class:`full-width`}),card.cardType==`loaner`&&(!focus$1||detailed)&&res.push({iconType:icons.steeringWheelSporty,keyLabel:detailed?`Loaner`:``,valueLabel:detailed?card.isFacilityCard?`This vehicle can be loaned for delivery.`:`This vehicle can be used for delivery.`:`Loaner`,class:`full-width`}),card.cardType==`loaner`&&card.loanerCut&&!focus$1&&detailed&&res.push({iconType:icons.carCoins,keyLabel:detailed?`Loaner Cut`:``,valueLabel:detailed?`Organization takes `+(card.loanerCut.value*100-card.loanerCut.value*100%1)+`% of rewards earned with this loaner.`:card.loanerCut.value*100-card.loanerCut.value*100%1+`%`,class:`full-width`}),card.organizationName&&(!focus$1||detailed)&&res.push({iconType:icons.peopleOutline,keyLabel:detailed?`Organization`:``,valueLabel:$tt(card.organizationName),class:``}),card.capacity&&card.capacity.length)for(let cap of card.capacity)res.push({iconType:icons[cap.icon],keyLabel:detailed?`Capacity`:``,valueLabel:detailed?cap.labelLong:cap.labelShort,class:``});if(detailed&&card.modifiers&&card.modifiers.length>0)for(let mod of card.modifiers)res.push({iconType:icons[mod.icon],keyLabel:mod.label,valueLabel:mod.description,class:`full-width`+(mod.important?` orange`:``),iconColor:mod.important?`var(--bng-orange-300)`:``});return res});return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),mergeProps({class:[`card-item`,getCargoCardClass(__props.card)]},!__props.detailed&&{"bng-nav-item":!0,tabindex:1},{onClick:_cache[15]||=withModifiers(()=>{},[`stop`])}),{default:withCtx(()=>[!__props.detailed&&__props.card.thumbnail?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,ratio:`4:3`,"external-image":__props.card.thumbnail},{default:withCtx(()=>[!__props.card.enabled&&__props.card.disableReason.type==`locked`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).lockClosed,class:`icon`},null,8,[`type`])):createCommentVNode(``,!0)]),_:1},8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass({"card-content-flex":!0,"with-actions":!__props.detailed})},[createBaseVNode(`div`,{class:normalizeClass([`heading-wrapper`,{"heading-detailed":__props.detailed}])},[__props.detailed?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:__props.ribbon?`ribbon`:`none`,class:`card-heading`},{default:withCtx(()=>[context.value===``?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,_hoisted_1$234,toDisplayString(context.value),1)),createBaseVNode(`div`,null,[__props.card.vehName?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(__props.card.vehName),1)],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(__props.card.name),1)],64))])]),_:1},8,[`type`])):(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.vehName?(openBlock(),createElementBlock(`div`,_hoisted_3$167,toDisplayString(__props.card.vehName),1)):(openBlock(),createElementBlock(`div`,_hoisted_2$192,toDisplayString(__props.card.name),1))],64)),createBaseVNode(`div`,{class:normalizeClass([`pill pill-blue`,{"pill-orange":isLoadingFacilityCard.value}])},[typeof rewardMoney.value==`number`?(openBlock(),createBlock(unref(bngUnit_default),{key:0,class:`reward-money`,money:rewardMoney.value},null,8,[`money`])):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,class:`reward-money`,iconType:unref(icons).beamCurrency,valueLabel:rewardMoney.value},null,8,[`iconType`,`valueLabel`])),hasIds.value&&!__props.card.transientMove?(openBlock(),createBlock(unref(bngPropVal_default),{key:2,class:`amount-avail`,valueLabel:`×`+__props.card.ids.length},null,8,[`valueLabel`])):createCommentVNode(``,!0),hasIds.value&&__props.card.transientMove?(openBlock(),createBlock(unref(bngPropVal_default),{key:3,class:`amount-avail`,valueLabel:`×`+__props.card.transientMoveCounts},null,8,[`valueLabel`])):createCommentVNode(``,!0),isPerLiter.value?(openBlock(),createBlock(unref(bngPropVal_default),{key:4,class:`amount-avail`,valueLabel:`/L`})):createCommentVNode(``,!0),__props.card.materialType?(openBlock(),createBlock(unref(bngPropVal_default),{key:5,class:`amount-avail`,valueLabel:__props.card.slots+` L`},null,8,[`valueLabel`])):createCommentVNode(``,!0)],2)],2),!__props.card.showAmountSelector&&cargoProps.value.length>0&&__props.detailed?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass({"body-grid":__props.detailed,"body-list-wrapped":!__props.detailed,"content-detailed":__props.detailed})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(cargoProps.value,props$1=>(openBlock(),createBlock(unref(bngPropVal_default),mergeProps({ref_for:!0},props$1),null,16))),256))],2)):createCommentVNode(``,!0),__props.detailed&&isMoving.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`buttons-disabled-reason`,{"disabled-load-actions":!__props.card.enabled||!__props.showButtons,"footer-detailed":__props.detailed}])},[createVNode(unref(bngPropVal_default),{class:`prop`,iconType:unref(icons).info,keyLabel:``,valueLabel:`Cannot modify cargo while any vehicle is moving.`},null,8,[`iconType`])],2)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`load-actions-wrapper`,{"disabled-load-actions":!__props.card.enabled||!__props.showButtons,"footer-detailed":__props.detailed,"chevrons-bg":__props.card.transientMoveCounts>0||__props.card.spawnWhenCommitingCargo||__props.card._transientMaterialMoveAmount>0}])},[createBaseVNode(`div`,_hoisted_4$140,[__props.detailed?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[(openBlock(!0),createElementBlock(Fragment,null,renderList(propIcons.value,icon=>(openBlock(),createBlock(unref(bngIcon_default),mergeProps({class:`icon`},{ref_for:!0},icon),null,16))),256)),(openBlock(!0),createElementBlock(Fragment,null,renderList(cargoProps.value,props$1=>(openBlock(),createBlock(unref(bngPropVal_default),mergeProps({class:`prop`},{ref_for:!0},props$1),null,16))),256))],64))]),__props.card.enabled&&__props.showButtons?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`load-actions-buttons`,{undetailed:!__props.detailed}])},[__props.card.cardType==`parcelGroup`?(openBlock(),createElementBlock(Fragment,{key:0},[__props.card.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:0},[__props.card.transientMoveCounts==0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).secondary,"icon-right":unref(icons).undo,label:__props.detailed?`Clear load`:``,onClick:_cache[0]||=$event=>unref(cargoOverviewStore).clearLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.autoLoadLocations&&__props.card.autoLoadLocations.length==0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).secondary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[1]||=$event=>unref(cargoOverviewStore).loadCargoCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.transientMoveCounts==__props.card.ids.length||__props.card.autoLoadLocations.length==0||!__props.card.autoLoadLocations.length?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,"icon-right":unref(icons).arrowLargeRight,label:__props.detailed?`Load all`:``,onClick:_cache[2]||=$event=>unref(cargoOverviewStore).loadCargoAuto(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`]))],64)):(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.transientMoveCounts>0?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,"icon-right":unref(icons).undo,label:__props.detailed?`Clear Load`:``,onClick:_cache[3]||=$event=>unref(cargoOverviewStore).clearLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,"icon-right":unref(icons).trashBin1,label:__props.detailed?`Throw Away`:``,onClick:_cache[4]||=$event=>unref(cargoOverviewStore).throwAway(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.materialType===void 0?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).primary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[5]||=$event=>unref(cargoOverviewStore).loadCargoCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.materialType!==void 0&&__props.card.transientMove?(openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).primary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom Load`:``,onClick:_cache[6]||=$event=>unref(cargoOverviewStore).modifyMaterialLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):createCommentVNode(``,!0)],64))],64)):createCommentVNode(``,!0),__props.card.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.cardType==`storage`?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[7]||=$event=>unref(cargoOverviewStore).loadStorageCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`vehicleOffer`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).keys1,label:__props.detailed?`Accept Job`:``,onClick:_cache[8]||=$event=>unref(cargoOverviewStore).loadOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`vehicleOffer`&&__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).undo,label:__props.detailed?`Decline Job`:``,onClick:_cache[9]||=$event=>unref(cargoOverviewStore).loadOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).keys1,label:__props.detailed?`Accept Loaner`:``,onClick:_cache[10]||=$event=>unref(cargoOverviewStore).loadLoaner(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:4,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).undo,label:__props.detailed?`Decline Loaner`:``,onClick:_cache[11]||=$event=>unref(cargoOverviewStore).loadLoaner(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0)],64)):(openBlock(),createElementBlock(Fragment,{key:2},[__props.card.cardType==`vehicleOffer`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).trashBin1,label:__props.detailed?`Abandon Job`:``,onClick:_cache[12]||=$event=>unref(cargoOverviewStore).abandonOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&__props.card.isSpawnedLoaner?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).trashBin1,label:__props.detailed?`Return Loaner`:``,onClick:_cache[13]||=$event=>unref(cargoOverviewStore).returnLoaner(__props.card.id),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0)],64))],2)):createCommentVNode(``,!0),chevronProp.value?(openBlock(),createElementBlock(`div`,_hoisted_5$122,[createVNode(unref(bngPropVal_default),mergeProps({class:`amount-load`},chevronProp.value),null,16),createBaseVNode(`div`,_hoisted_6$104,[(openBlock(),createElementBlock(`svg`,_hoisted_7$91,[(openBlock(),createElementBlock(`svg`,_hoisted_8$76,[__props.card.transientMoveCounts===0?(openBlock(),createElementBlock(`path`,_hoisted_9$69)):(openBlock(),createElementBlock(`path`,_hoisted_10$60))]))]))])])):createCommentVNode(``,!0)],2),__props.card.showAmountSelector?(openBlock(),createElementBlock(`div`,_hoisted_11$54,[createTextVNode(` Selected Amount: `+toDisplayString(__props.card.amountSelector)+` `,1),createVNode(unref(bngSlider_default),{class:`slider`,min:0,max:__props.card.maxCount,step:1,modelValue:__props.card.amountSelector,"onUpdate:modelValue":_cache[14]||=$event=>__props.card.amountSelector=$event,onValueChanged:onAmountSelectorChanged},null,8,[`max`,`modelValue`])])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`footer-grid`,{"footer-detailed":__props.detailed}])},[__props.detailed?(openBlock(),createElementBlock(Fragment,{key:0},[(__props.focus===`none`||!__props.focus)&&!__props.hideModsAndTimer?(openBlock(),createElementBlock(`div`,_hoisted_12$43,[__props.detailed?createCommentVNode(``,!0):(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.card.modifiers,mod=>(openBlock(),createBlock(unref(bngIcon_default),{type:unref(icons)[mod.icon]},null,8,[`type`]))),256))])):createCommentVNode(``,!0),__props.card.remainingTime&&(__props.focus===`none`||!__props.focus)&&!__props.hideModsAndTimer?(openBlock(),createElementBlock(`div`,_hoisted_13$36,[__props.card.remainingTime.type===`preLoad`?(openBlock(),createElementBlock(`div`,_hoisted_14$34,`Time for delivery: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)):createCommentVNode(``,!0),__props.card.remainingTime.type===`untilDelayed`?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(` Time until delivery is Delayed: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)],64)):createCommentVNode(``,!0),__props.card.remainingTime.type===`untilLate`?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(` Time until delivery is Late: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)],64)):createCommentVNode(``,!0),__props.card.remainingTime.type===`late`?(openBlock(),createElementBlock(Fragment,{key:3},[createTextVNode(` Delivery is late `)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),__props.card.remainingTime&&__props.card.remainingTime.percent&&__props.card.isPlayerCard?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`timer-progress-bar`,{slim:!__props.detailed}])},[createBaseVNode(`div`,{class:`progress-bar-fill`,style:normalizeStyle({width:__props.card.remainingTime.percent*100+`%`})},null,4)],2)):createCommentVNode(``,!0)],2)],2)]),_:1},16,[`class`]))}},CargoCard_default=__plugin_vue_export_helper_default(_sfc_main$263,[[`__scopeId`,`data-v-bafe8e5e`]]),_hoisted_1$233={class:`info-container`},_hoisted_2$191={key:0,class:`header`},_hoisted_3$166={key:0,class:`label`},_hoisted_4$139={class:`props`},_hoisted_5$121={key:4,class:`prop pill`},_sfc_main$262={__name:`CargoInfo`,props:{label:String,fillInfo:Object,meta:Object},setup(__props){let{units}=useBridge(),props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$233,[__props.meta.type===`hidden`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$191,[__props.label?(openBlock(),createElementBlock(`div`,_hoisted_3$166,[__props.meta.type==`task`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`icon`,type:unref(icons).checkboxOff},null,8,[`type`])):createCommentVNode(``,!0),__props.label?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.$tt(__props.label)),1)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$139,[__props.meta.type==`container`||__props.meta.type==`totalStorage`?(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons)[__props.meta.icon],valueLabel:__props.meta.usedCargoSlots+` / `+__props.meta.totalCargoSlots},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0),__props.meta.type==`location`?(openBlock(),createBlock(unref(bngPropVal_default),{key:1,iconType:unref(icons).mapPoint,valueLabel:unref(units).buildString(`distance`,__props.meta.distance,1),style:{"--icon-size":`1.25em`}},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0),__props.meta.type==`trash`?(openBlock(),createBlock(unref(bngIcon_default),{key:2,class:`icon`,type:unref(icons).trashBin1},null,8,[`type`])):createCommentVNode(``,!0),props&&props.length?(openBlock(!0),createElementBlock(Fragment,{key:3},renderList(props,prop=>(openBlock(),createBlock(unref(bngPropVal_default),{iconType:unref(icons)[prop.icon],valueLabel:prop.label},null,8,[`iconType`,`valueLabel`]))),256)):createCommentVNode(``,!0),__props.fillInfo?(openBlock(),createElementBlock(`div`,_hoisted_5$121,[createVNode(unref(bngPropVal_default),{iconType:unref(icons)[__props.fillInfo.icon],valueLabel:__props.fillInfo.usedSlots+` / `+__props.fillInfo.availableSlots},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)]),__props.meta.fillPercent||__props.meta.fillPercent==0?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`progress-bar`,{trash:__props.meta.type==`trash`}])},[__props.meta.fillPercentHighlight>0?(openBlock(),createElementBlock(`div`,{key:0,class:`progress-bar-fill highlight`,style:normalizeStyle({width:`${__props.meta.fillPercentHighlight*100}%`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`progress-bar-fill`,style:normalizeStyle({width:`${__props.meta.fillPercent*100}%`})},null,4)],2)):createCommentVNode(``,!0)]))]))}},CargoInfo_default=__plugin_vue_export_helper_default(_sfc_main$262,[[`__scopeId`,`data-v-ba3be877`]]),_hoisted_1$232={class:`group`},_hoisted_2$190={class:`cards`},_sfc_main$261={__name:`CardGroup`,props:{label:String,fillInfo:Object,meta:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$232,[createVNode(CargoInfo_default,{label:__props.label,"fill-info":__props.fillInfo,meta:__props.meta},null,8,[`label`,`fill-info`,`meta`]),createBaseVNode(`div`,_hoisted_2$190,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},CardGroup_default=__plugin_vue_export_helper_default(_sfc_main$261,[[`__scopeId`,`data-v-f21d8701`]]),_hoisted_1$231={class:`customload-wrapper`,"bng-ui-scope":`cargoLoadPopup`},_hoisted_2$189={class:`card-container`},_hoisted_3$165={class:`content target-grid`},_hoisted_4$138={key:0,class:`target-tile`},_hoisted_5$120={class:`loading-controls amount-load`},_hoisted_6$103={class:`amount`},_hoisted_7$90={class:`chevron-arrow`},_hoisted_8$75={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_9$68={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_10$59={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_11$53={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-orange-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_12$42={key:1,class:`target-tile trash`},_hoisted_13$35={class:`loading-controls amount-load`},_hoisted_14$33={class:`amount`},_hoisted_15$32={class:`chevron-arrow`},_hoisted_16$32={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_17$26={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_18$23={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_19$20={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-add-red-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_20$17={class:`buttons content`},__default__$3={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$260=Object.assign(__default__$3,{__name:`CargoLoadPopup`,props:{cargo:Object,storageData:Object,throwAway:Boolean},emits:[`return`],setup(__props,{emit:__emit}){let cargoOverviewStore=useCargoOverviewStore(),{events:events$3}=useBridge(),{units}=useBridge();useUINavScope(`cargoLoadPopup`);let emit$1=__emit,props=__props,isFacilityCard=ref(!1),vehicleFilterModel=ref([]),vehicleFilterOptions=ref([]),vehicleFilterChanged=function(filter){for(let target of targetLocations.value)target.hidden=target.containerVehicleInfo&&!filter.includes(target.containerVehicleInfo.vehId)},originalTransientMoveCounts=0,original_transientMaterialMoveAmount=0,card=ref({});ref(0);let throwAwayValue=ref(0),trashMeta=ref({}),loadingName=ref(``),slotsPerItem=ref(0),weightPerItem=ref(0),moneyRewardPerItem=ref(0),targetLocations=ref({}),less=function(target){target?(target.loadSliderValue=Math.max(0,target.loadSliderValue-1),updateSliderAmounts(target)):(throwAwayValue.value=Math.max(0,throwAwayValue.value-1),updateThrowAwayAmount())},more=function(target){target?(target.loadSliderValue=Math.min(target.loadSliderMax,target.loadSliderValue+1),updateSliderAmounts(target)):(throwAwayValue.value=Math.min(totalAvailableAmount.value,throwAwayValue.value+1),updateThrowAwayAmount())},acceptClickHandler=()=>{let loadIdx=0;if(props.cargo)for(let id of props.cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);if(props.storageData&&Lua_default.career_modules_delivery_cargoScreen.clearTransientMovesForStorage(props.storageData.material.id),!props.throwAway)for(let target of targetLocations.value){if(props.cargo)for(let i=0;i{isFacilityCard.value&&(card.value.transientMoveCounts=originalTransientMoveCounts,card.value._transientMaterialMoveAmount=0),emit$1(`return`,!0)},totalAvailableAmount=ref(0),loadedAmount=ref(0),updateSliderAmounts=changedItem=>{loadedAmount.value=0;for(let target of targetLocations.value)target.maxAmount&&(loadedAmount.value+=target.loadSliderValue);let tooMuch=loadedAmount.value-totalAvailableAmount.value;if(tooMuch>0){for(let target of targetLocations.value)if(target.maxAmount&&target!==changedItem){let before=target.loadSliderValue;target.loadSliderValue=Math.max(0,target.loadSliderValue-tooMuch);let diff=target.loadSliderValue-before;tooMuch+=diff}loadedAmount.value=totalAvailableAmount.value}for(let target of targetLocations.value)target.meta.usedCargoSlots=target.usedCargoSlots+target.loadSliderValue*slotsPerItem.value,target.meta.fillPercentHighlight=target.meta.usedCargoSlots/target.meta.totalCargoSlots;isFacilityCard.value&&(throwAwayValue.value=totalAvailableAmount.value-loadedAmount.value,card.value.transientMoveCounts=loadedAmount.value,card.value._transientMaterialMoveAmount=loadedAmount.value,trashMeta.value.fillPercent=throwAwayValue.value/totalAvailableAmount.value)},updateThrowAwayAmount=()=>{loadedAmount.value=0;for(let target of targetLocations.value)target.maxAmount&&(loadedAmount.value+=target.loadSliderValue);let tooMuch=loadedAmount.value-totalAvailableAmount.value+throwAwayValue.value;for(let target of targetLocations.value){if(target.maxAmount){let before=target.loadSliderValue;target.loadSliderValue=Math.min(target.loadSliderMax,Math.max(0,target.loadSliderValue-tooMuch));let diff=target.loadSliderValue-before;tooMuch+=diff}loadedAmount.value=totalAvailableAmount.value}updateSliderAmounts()},splittable=ref(!1);return onMounted(()=>{if(getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),props.cargo){if(loadingName.value=props.cargo.name,slotsPerItem.value=props.cargo.slots,weightPerItem.value=props.cargo.weight,moneyRewardPerItem.value=props.cargo.rewardMoney,targetLocations.value=props.cargo.targetLocations,totalAvailableAmount.value=props.cargo.ids.length,props.cargo.splittable){splittable.value=!0,totalAvailableAmount.value=props.cargo.slots,slotsPerItem.value=1;for(let target of targetLocations.value)target.maxAmount=target.totalCargoSlots-target.usedCargoSlots}card.value=props.cargo,isFacilityCard.value=card.value.isFacilityCard,originalTransientMoveCounts=card.value.transientMoveCounts}props.storageData&&(console.log(props.storageData),loadingName.value=props.storageData.material.name,slotsPerItem.value=1,weightPerItem.value=props.storageData.material.density,moneyRewardPerItem.value=1,targetLocations.value=props.storageData.targetLocations,totalAvailableAmount.value=props.storageData.storage.storedVolume,card.value=props.storageData,isFacilityCard.value=card.value.isFacilityCard),targetLocations.value.length||(targetLocations.value=[]);for(let target of targetLocations.value)target.loadSliderValue=ref(target.selectedAmount),target.loadSliderMax=ref(Math.min(target.maxAmount,totalAvailableAmount.value)),target.meta={type:`container`,usedCargoSlots:target.usedCargoSlots,totalCargoSlots:target.totalCargoSlots,icon:`cardboardBox`,fillPercent:target.usedCargoSlots/target.totalCargoSlots};updateSliderAmounts();let vehicles={};for(let target of targetLocations.value)target.containerVehicleInfo&&(vehicles[target.containerVehicleInfo.vehId]=target.containerVehicleInfo);for(let vehId in vehicleFilterOptions.value=[],vehicles){let veh=vehicles[vehId];vehicleFilterOptions.value.push({value:veh.vehId,label:veh.vehName})}for(let vehId in vehicleFilterOptions.value.sort((a$1,b)=>a$1.name{window.bngVue.getCurrentRoute().name==`unknown`&&getUINavServiceInstance().setFilteredEventsAllExcept(UI_EVENTS.menu,UI_EVENTS.pause,UI_EVENTS.center_cam)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$231,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[__props.throwAway?(openBlock(),createBlock(unref(bngCardHeading_default),{key:1,type:`ribbon`},{default:withCtx(()=>[createTextVNode(` Throwing away `+toDisplayString(loadingName.value),1)]),_:1})):(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Custom Loading`,-1)]]),_:1})),createBaseVNode(`div`,_hoisted_2$189,[createVNode(CargoCard_default,{ribbon:!1,card:card.value,hideProps:!1,hideModsAndTimer:!0,showButtons:!1,detailed:!0,alwaysShowLoadingWrapper:isFacilityCard.value},null,8,[`card`,`alwaysShowLoadingWrapper`])]),_ctx.vehicles&&_ctx.vehicles.length>1?(openBlock(),createElementBlock(Fragment,{key:2},[_cache[5]||=createBaseVNode(`span`,null,`Vehicles`,-1),__props.throwAway?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPillFilters_default),{key:0,modelValue:vehicleFilterModel.value,"onUpdate:modelValue":_cache[0]||=$event=>vehicleFilterModel.value=$event,selectMany:``,options:vehicleFilterOptions.value,showCheckIcon:!1,onValueChanged:vehicleFilterChanged},null,8,[`modelValue`,`options`]))],64)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$165,[targetLocations.value&&!__props.throwAway?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(targetLocations.value,(target,targetIndex)=>(openBlock(),createElementBlock(Fragment,null,[target.hidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$138,[createVNode(CardGroup_default,{label:target.label,meta:target.meta},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`to-load`,{"none-assigned":target.loadSliderValue==0}])},[createBaseVNode(`div`,_hoisted_5$120,[createVNode(unref(bngButton_default),{class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:$event=>less(target)},null,8,[`iconLeft`,`onClick`]),createVNode(unref(bngSlider_default),{"bng-no-nav":``,class:`slider`,min:0,max:target.loadSliderMax,step:1,modelValue:target.loadSliderValue,"onUpdate:modelValue":$event=>target.loadSliderValue=$event,onValueChanged:$event=>updateSliderAmounts(target)},null,8,[`max`,`modelValue`,`onUpdate:modelValue`,`onValueChanged`]),createVNode(unref(bngButton_default),{class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:$event=>more(target)},null,8,[`iconLeft`,`onClick`]),createBaseVNode(`div`,_hoisted_6$103,`×`+toDisplayString(target.loadSliderValue),1)]),createBaseVNode(`div`,_hoisted_7$90,[(openBlock(),createElementBlock(`svg`,_hoisted_8$75,[(openBlock(),createElementBlock(`svg`,_hoisted_9$68,[target.loadSliderValue===0?(openBlock(),createElementBlock(`path`,_hoisted_10$59)):(openBlock(),createElementBlock(`path`,_hoisted_11$53))]))]))])],2)]),_:2},1032,[`label`,`meta`])]))],64))),256)):createCommentVNode(``,!0),__props.cargo&&__props.cargo.throwAwayInfo&&unref(totalAvailableAmount)?(openBlock(),createElementBlock(`div`,_hoisted_12$42,[createVNode(CardGroup_default,{label:`Trash`,meta:trashMeta.value},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`to-load`,{"none-assigned":throwAwayValue.value==0}])},[createBaseVNode(`div`,_hoisted_13$35,[createVNode(unref(bngButton_default),{class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:_cache[1]||=$event=>less()},null,8,[`iconLeft`]),createVNode(unref(bngSlider_default),{"bng-no-nav":``,class:`slider`,min:0,max:unref(totalAvailableAmount),step:1,modelValue:throwAwayValue.value,"onUpdate:modelValue":_cache[2]||=$event=>throwAwayValue.value=$event,onValueChanged:updateThrowAwayAmount},null,8,[`max`,`modelValue`]),createVNode(unref(bngButton_default),{class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:_cache[3]||=$event=>more()},null,8,[`iconLeft`]),createBaseVNode(`div`,_hoisted_14$33,`×`+toDisplayString(throwAwayValue.value),1)]),createBaseVNode(`div`,_hoisted_15$32,[(openBlock(),createElementBlock(`svg`,_hoisted_16$32,[(openBlock(),createElementBlock(`svg`,_hoisted_17$26,[throwAwayValue.value===0?(openBlock(),createElementBlock(`path`,_hoisted_18$23)):(openBlock(),createElementBlock(`path`,_hoisted_19$20))]))]))])],2)]),_:1},8,[`meta`])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_20$17,[withDirectives(createVNode(unref(bngButton_default),{class:`button`,label:`Cancel`,accent:`secondary`,onClick:cancelClickHandler},null,512),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]),__props.cargo&&__props.cargo.throwAwayInfo&&throwAwayValue.value>0?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`button`,accent:`attention`,onClick:acceptClickHandler},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.throwAway?`Throw Away`:`Accept`)+` (`,1),createVNode(unref(bngUnit_default),{money:-__props.cargo.throwAwayInfo.penalty*throwAwayValue.value},null,8,[`money`]),_cache[6]||=createTextVNode(`) `,-1)]),_:1})),[[unref(BngFocusIf_default),!0],[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`button`,label:`Accept`,accent:`main`,onClick:acceptClickHandler},null,512)),[[unref(BngFocusIf_default),!0],[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])]),_:1})]))}}),CargoLoadPopup_default=__plugin_vue_export_helper_default(_sfc_main$260,[[`__scopeId`,`data-v-0d30652e`]]),_hoisted_1$230={class:`settings-wrapper`,"bng-ui-scope":`cargoScreenSettings`},_hoisted_2$188={class:`cardContent`},_hoisted_3$164={class:`content`},_hoisted_4$137={class:`acceptButton`},__default__$2={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$259=Object.assign(__default__$2,{__name:`CargoScreenSettings`,emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`cargoScreenSettings`);let emit$1=__emit,cargoOverviewStore=useCargoOverviewStore();ref();let facilityGroupingItems=[{label:`Item one`,value:1},{label:`Item two`,value:2},{label:`Item three`,value:3},{label:`Item four`,value:4},{label:`Item five`,value:5},{label:`Item six`,value:6},{label:`Item seven`,value:7},{label:`Item eight`,value:8},{label:`Item nine`,value:9},{label:`Item ten`,value:10},{label:`Item eleven`,value:11},{label:`Item twelve`,value:12},{label:`Item thirteen`,value:13},{label:`Item fourteen`,value:14},{label:`Item fifteen`,value:15},{label:`Item sixteen`,value:16},{label:`Item seventeen`,value:17},{label:`Item eighteen`,value:18},{label:`Item nineteen`,value:19},{label:`Item twenty`,value:20}];ref(),ref(),ref();let setFacilityGroupKey=key=>{cargoOverviewStore.facilityGroupingKey=key},setFacilitySortKey=key=>{cargoOverviewStore.facilitySortingKey=key},setPlayerGroupKey=key=>{cargoOverviewStore.playerGroupingKey=key},setPlayerSortKey=key=>{cargoOverviewStore.playerSortingKey=key};onMounted(()=>{console.log(facilityGroupingItems)});let acceptClickHandler=()=>{emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$230,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Settings`,-1)]]),_:1}),createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Facility Display`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$188,[createBaseVNode(`div`,null,[_cache[3]||=createTextVNode(` Group By: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).selectedFilter.groupings,gKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setFacilityGroupKey(gKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[gKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,null,[_cache[4]||=createTextVNode(` Sorting: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].sortings,sKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setFacilitySortKey(sKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[sKey].label),1)]),_:2},1032,[`onClick`]))),256))])]),createBaseVNode(`div`,_hoisted_3$164,[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`My Cargo Display`,-1)]]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[0]||=$event=>unref(cargoOverviewStore).automaticRoute=$event},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`]),createBaseVNode(`div`,null,[_cache[7]||=createTextVNode(` Group By: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerGroupings,gKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setPlayerGroupKey(gKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[gKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,null,[_cache[8]||=createTextVNode(` Sorting: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].sortings,sKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setPlayerSortKey(sKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[sKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,_hoisted_4$137,[withDirectives(createVNode(unref(bngButton_default),{label:`Continue`,accent:unref(ACCENTS).primary,onClick:acceptClickHandler},null,8,[`accent`]),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])])]),_:1})]))}}),CargoScreenSettings_default=__plugin_vue_export_helper_default(_sfc_main$259,[[`__scopeId`,`data-v-9dd4f12f`]]),_forEach=(arr,func)=>Array.isArray(arr)&&arr.length>0&&arr.forEach(func);const useCargoOverviewStore=defineStore(`cargoOverview`,()=>{let{events:events$3}=useBridge(),cargoData=ref(),dropDownData=ref({}),newCargoAvailable=ref(!1),cargoHighlighted=ref(!1),automaticRoute=ref(!1),detailedDropOff=ref(!1),tutorialInfo=ref(),facilityGroupingKey=ref(`destinations`),facilitySortingKey=ref(`rewardMoney`),playerGroupings=[`containers`,`tasklist`,`ungrouped`],playerGroupingKey=ref(`tasklist`),playerSortingKey=ref(`cardId`),facilityId,parkingSpotPath,facilityFilter={value:`facility-info`,label:`Facility Info`,showInFilterTabs:!0,isFacilityPage:!0},filterSets=ref({}),filterSetsByValue=ref({}),selectedFilterRef=ref(),selectedFilter=ref(facilityFilter),selectFilter=f=>{Lua_default.career_modules_delivery_general.setSetting(`selectedFilterKey`,f),Lua_default.career_modules_delivery_cargoScreen.setCargoScreenTab(f);for(let filter of filterSets.value)if(filter.value==f[0]){let prevGrouping=facilityGroupingKey.value,prevSorting=facilitySortingKey.value;if(selectedFilter.value=filter,!filter.isFacilityPage&&(filter.groupings.includes(prevGrouping)||(facilityGroupingKey.value=filter.groupings[0]),cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings.includes(prevSorting)||(facilitySortingKey.value=cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings[0]),selectedCargo.value&&selectedCargo.value.isFacilityCard)){let contained=selectedCargo.value.filterTags[filter.value];if(contained)for(let groupKey of filter.groupings)for(let group of cargoData.value.facilityCardGroupSets[groupKey].groups)contained||=group.cardIdsUnsorted.includes(selectedCargo.value.cardId);contained||(selectedCargo.value=void 0)}}},facilityGroupings=computed(()=>selectedFilter.value?selectedFilter.value.groupings:[]),nextFacilityGrouping=()=>{let groups=facilityGroupings.value;facilityGroupingKey.value=groups[(groups.indexOf(facilityGroupingKey.value)+1)%groups.length]},facilitySortings=computed(()=>cargoData.value&&facilityGroupingKey.value&&cargoData.value.facilityCardGroupSets&&cargoData.value.facilityCardGroupSets[facilityGroupingKey.value]?cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings:[]),nextFacilitySorting=()=>{let group=facilitySortings.value;facilitySortingKey.value=group[(group.indexOf(facilitySortingKey.value)+1)%group.length]},nextPlayerGrouping=()=>{let groups=playerGroupings;playerGroupingKey.value=groups[(groups.indexOf(playerGroupingKey.value)+1)%groups.length]},playerSortings=computed(()=>cargoData.value&&facilityGroupingKey.value&&cargoData.value.playerCardGroupSets&&cargoData.value.playerCardGroupSets[facilityGroupingKey.value]?cargoData.value.playerCardGroupSets[facilityGroupingKey.value].sortings:[]),nextPlayerSorting=()=>{let group=cargoData.value.playerCardGroupSets[facilityGroupingKey.value];playerSortingKey.value=group[(group.indexOf(playerSortingKey.value)+1)%group.length]},currentFilterTutorialInfo=computed(()=>{if(!tutorialInfo.value||!selectedFilter.value)return null;let info=tutorialInfo.value[selectedFilter.value.value];return!info||!info.unlocked||!info.isActive?null:info}),openCargoScreenSettings=()=>{addPopup(CargoScreenSettings_default)},sortedParcelOffersByCargoType=computed(()=>{if(!cargoData.value||!cargoData.value.facility||!cargoData.value.facility.outgoingCargo)return{};let sorted={};for(let cargoType in _forEach(cargoData.value.facility.outgoingCargo,cargo=>{sorted[cargo.type]||(sorted[cargo.type]=[]),sorted[cargo.type].push(cargo)}),sorted)sorted[cargoType]=sortByProperty(sorted[cargoType]);return sorted}),sortedVehicleOffers=computed(()=>!cargoData.value||!cargoData.value.facility?[]:sortByProperty(cargoData.value.facility.vehicleOffers)),sortedTrailerOffers=computed(()=>!cargoData.value||!cargoData.value.facility?[]:sortByProperty(cargoData.value.facility.trailerOffers)),sortedAcceptedOffers=computed(()=>cargoData.value?sortByProperty(cargoData.value.player.acceptedOffers):[]),loanerOffers=computed(()=>{if(!cargoData.value||!cargoData.value.facility||!cargoData.value.facility.loanableVehicles)return[];let result=[];return result=result.concat(cargoData.value.facility.loanableVehicles),result}),menuClosed=()=>{cargoData.value=void 0,dropDownData.value={},selectedFilter.value=facilityFilter,selectedCargo.value=void 0,Lua_default.career_modules_delivery_cargoScreen.showCargoRoutePreview(void 0),loadingPrompt&&loadingPrompt.close(null)},requestCargoData=(_facilityId,_parkingSpotPath,updateMaxTimeStamp)=>{facilityId=_facilityId,parkingSpotPath=_parkingSpotPath,Lua_default.career_modules_delivery_cargoScreen.requestCargoDataForUi(facilityId,parkingSpotPath,updateMaxTimeStamp),updateMaxTimeStamp!=0&&(newCargoAvailable.value=!1)},requestCargoDataSimple=()=>{requestCargoData(facilityId,parkingSpotPath,!1)},moveCargoToLocation=(cargoId,targetLocation,skipRequest)=>{Lua_default.career_modules_delivery_cargoScreen.moveCargoFromUi(cargoId,targetLocation),skipRequest||requestCargoData(facilityId,parkingSpotPath,!1)},requestMoveCargoToLocation=(cargoId,moveData,skipRequest)=>{moveData.extraData?openThrowAwayPopup(cargoId,moveData.location,`Throw this cargo away with a `+moveData.extraData.penalty.toFixed(2)+` penalty?`):moveCargoToLocation(cargoId,moveData.location,skipRequest)};async function openThrowAwayPopup(cargoId,targetLocation,message){await openConfirmation(null,message)?moveCargoToLocation(cargoId,targetLocation):setCargoData()}let setCargoData=data=>{let previousCardId;if(selectedCargo.value&&(previousCardId=selectedCargo.value.cardId),data&&(cargoData.value=data),dropDownData.value={},cargoData.value.player&&cargoData.value.player.vehicles){getAutomaticRoute(data.settings.automaticRoute),getDetailedDropOff(data.settings.detailedDropOff),automaticRoute.value&&setAutomaticRoute(automaticRoute.value),filterSets.value=data.filterSets,filterSets.value.unshift(facilityFilter);for(let filter of filterSets.value)filterSetsByValue.value[filter.value]=filter;selectedFilter.value||=filterSets.value[0],previousCardId&&onCargoSelected(cargoData.value.cardsById[previousCardId]),tutorialInfo.value=data.tutorialInfo}},highlightedCards=ref({}),highlightCardIds=highlightedIdMap=>{highlightedCards.value=highlightedIdMap},focusedCargo=ref();ref();let selectedCargo=ref(),onCargoHovered=cargo=>{focusedCargo.value=cargo,highlightRoute(focusedCargo.value)},onCargoSelected=cargo=>{selectedCargo.value=cargo},highlightRoute=card=>{card?Lua_default.career_modules_delivery_cargoScreen.showRoutePreview(card.route):Lua_default.career_modules_delivery_cargoScreen.showRoutePreview(void 0)},setAutomaticRoute=(newValue,oldValue)=>{newValue!=oldValue&&Lua_default.career_modules_delivery_general.setAutomaticRoute(newValue)};watch(()=>automaticRoute.value,setAutomaticRoute);let getAutomaticRoute=enabled=>{automaticRoute.value=enabled};watch(()=>detailedDropOff.value,(newValue,oldValue)=>{newValue!=oldValue&&Lua_default.career_modules_delivery_general.setDetailedDropOff(newValue)});let getDetailedDropOff=enabled=>{detailedDropOff.value=enabled},setGroupingAndSorting=()=>{},cardClicked=card=>{switch(card.cardType){case`parcelGroup`:loadCargoAuto(card);break;case`vehicleOffer`:loadOffer(card);break;case`storage`:loadStorageCustom(card);break}},cardDeselect=()=>onCargoSelected(),cardHovered=card=>{onCargoHovered(card)},clearLoad=cargo=>{for(let id of cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);requestCargoDataSimple()},throwAway=card=>{loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:card,throwAway:!0}).promise},changeDistribution=cargo=>{for(let[id,card]of Object.entries(cargoData.value.cardsById))if(card.isFacilityCard&&card.cardType==`parcelGroup`&&card.ids.includes(cargo.ids[0])){loadCargoCustom(card);return}},modifyMaterialLoad=cargo=>{for(let[id,card]of Object.entries(cargoData.value.cardsById))if(card.isFacilityCard&&card.cardType==`storage`&&card.storage.materialType==cargo.materialType){loadStorageCustom(card);return}},loadCargoAuto=cargo=>{for(let id of cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);let idx=0;for(let loc of cargo.autoLoadLocations)Lua_default.career_modules_delivery_cargoScreen.moveCargoFromUi(cargo.ids[idx],loc),idx++;requestCargoDataSimple()},loadingPrompt=null,loadCargoCustom=card=>{if(card.transientMove){let cargoId=card.ids[0];for(let[id,otherCard]of Object.entries(cargoData.value.cardsById))if(otherCard.isFacilityCard&&otherCard.cardType==`parcelGroup`&&otherCard.ids.includes(cargoId)){loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:otherCard}).promise;return}}else loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:card}).promise},loadStorageCustom=storageData=>{loadingPrompt=addPopup(CargoLoadPopup_default,{storageData}).promise},loadOffer=offer=>{Lua_default.career_modules_delivery_cargoScreen.toggleOfferForSpawning(offer.id),requestCargoDataSimple()},loadLoaner=offer=>{Lua_default.career_modules_loanerVehicles.markForSpawning(offer),requestCargoDataSimple()},returnLoaner=vehId=>{Lua_default.career_modules_loanerVehicles.returnVehicle(vehId).then(()=>{requestCargoDataSimple()})};async function abandonOffer(card){await openConfirmation(null,`Abandon `+card.name+`? There is a `+card.abandonInfo.penaltyMoney+`$ penalty.`)&&(Lua_default.career_modules_delivery_cargoScreen.abandonAcceptedOffer(card.abandonInfo.vehId),requestCargoDataSimple())}return events$3.on(`automaticRouteSet`,getAutomaticRoute),events$3.on(`cargoDataForUiReady`,setCargoData),events$3.on(`newCargoAvailable`,()=>newCargoAvailable.value=!0),events$3.on(`sendHighlightedCardIds`,highlightCardIds),events$3.on(`requestCargoDataSimple`,requestCargoDataSimple),{cargoData,tutorialInfo,sortedParcelOffersByCargoType,sortedVehicleOffers,sortedTrailerOffers,sortedAcceptedOffers,onCargoHovered,onCargoSelected,loanerOffers,dropDownData,newCargoAvailable,cargoHighlighted,automaticRoute,detailedDropOff,setGroupingAndSorting,requestCargoData,requestCargoDataSimple,requestMoveCargoToLocation,menuClosed,dispose:()=>{events$3.off(`cargoDataForUiReady`),events$3.off(`newCargoAvailable`),events$3.off(`sendHighlightedCardIds`),events$3.on(`requestCargoDataSimple`)},focusedCargo,selectedCargo,cardClicked,cardHovered,cardDeselect,clearLoad,changeDistribution,loadCargoAuto,loadCargoCustom,throwAway,loadStorageCustom,loadOffer,abandonOffer,loadLoaner,returnLoaner,modifyMaterialLoad,filterSets,filterSetsByValue,selectedFilterRef,selectedFilter,selectFilter,highlightedCards,openCargoScreenSettings,nextFacilityGrouping,nextFacilitySorting,nextPlayerGrouping,nextPlayerSorting,facilityGroupingKey,facilitySortingKey,playerGroupingKey,playerSortingKey,facilityGroupings,facilitySortings,playerGroupings,playerSortings,currentFilterTutorialInfo}});var _hoisted_1$229={class:`fill-panel`},_hoisted_2$187={key:1,class:`groupGrid`},_sfc_main$258={__name:`ProvidedOrdersPanel`,props:{groupSets:Object,groupIdx:[Number,String],sortingSets:Object,sortIdx:[Number,String],sortAsc:{type:Boolean,default:!0},ignoreFilter:Boolean},setup(__props){let cargoOverviewStore=useCargoOverviewStore(),props=__props;computed(()=>props.groupSets&&props.groupSets[props.groupIdx]&&props.groupSets[props.groupIdx].groups?props.groupSets[props.groupIdx].groups:[]);let sortedGroups=computed(()=>{let groupSet=props.groupSets[props.groupIdx];if(!cargoOverviewStore.cargoData||!cargoOverviewStore.cargoData.cardsById||!groupSet.groups||!groupSet.groups.length)return[];let groups=groupSet.groups,sortKey=props.sortingSets[props.sortIdx].key;function getHighestSortValue(group){let maxSortValue=-1/0;return group.cardIdsUnsorted&&group.cardIdsUnsorted.length&&group.cardIdsUnsorted.forEach(cardId=>{let card=cargoOverviewStore.cargoData.cardsById[cardId];if(card.filterTags[cargoOverviewStore.selectedFilter.value]||group.ignoreFilter||props.ignoreFilter){let sortValue=card.sortValues&&card.sortValues[sortKey]!==void 0?card.sortValues[sortKey]:1/0;sortValue>maxSortValue&&(maxSortValue=sortValue)}}),maxSortValue}return groups.sort((a$1,b)=>{let minValueA=getHighestSortValue(a$1),minValueB=getHighestSortValue(b);return props.sortAsc?minValueA-minValueB:minValueB-minValueA}),groups}),getSortedCardIds=group=>{if(!cargoOverviewStore.cargoData||!cargoOverviewStore.cargoData.cardsById||!group.cardIdsUnsorted)return[];let cardsById=cargoOverviewStore.cargoData.cardsById,sortKey=props.sortingSets[props.sortIdx].key;return group.cardIdsUnsorted&&group.cardIdsUnsorted.length?group.cardIdsUnsorted.slice().sort((a$1,b)=>{let cardA=cardsById[a$1],cardB=cardsById[b],valueA=cardA&&cardA.sortValues&&cardA.sortValues[sortKey]!==void 0?cardA.sortValues[sortKey]:0,valueB=cardB&&cardB.sortValues&&cardB.sortValues[sortKey]!==void 0?cardB.sortValues[sortKey]:0;return props.sortAsc?valueA-valueB:valueB-valueA}):[]};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$229,[unref(cargoOverviewStore).cargoData?unref(cargoOverviewStore).cargoData.cardsById?(openBlock(),createElementBlock(`div`,_hoisted_2$187,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[(group.cardIdsUnsorted.length>0||group.showEmpty)&&(group.filterTags[unref(cargoOverviewStore).selectedFilter.value]||group.ignoreFilter||__props.ignoreFilter)?(openBlock(),createBlock(CardGroup_default,{key:0,label:group.label,meta:group.meta},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(getSortedCardIds(group),cardId=>(openBlock(),createElementBlock(Fragment,{key:cardId},[unref(cargoOverviewStore).cargoData.cardsById[cardId].filterTags[unref(cargoOverviewStore).selectedFilter.value]||group.ignoreFilter||__props.ignoreFilter?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).cargoData.cardsById[cardId],onClick:withModifiers($event=>unref(cargoOverviewStore).onCargoSelected(unref(cargoOverviewStore).cargoData.cardsById[cardId]),[`stop`]),onMouseover:$event=>unref(cargoOverviewStore).onCargoHovered(unref(cargoOverviewStore).cargoData.cardsById[cardId]),onMouseleave:_cache[0]||=$event=>unref(cargoOverviewStore).onCargoHovered(),hideProps:__props.groupSets[__props.groupIdx].hideProps,hideModsAndTimer:__props.groupSets[__props.groupIdx].hideModsAndTimer},null,8,[`card`,`onClick`,`onMouseover`,`hideProps`,`hideModsAndTimer`])):createCommentVNode(``,!0)],64))),128))]),_:2},1032,[`label`,`meta`])):createCommentVNode(``,!0)],64))),128))])):createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` No data yet... `)],64))]))}},ProvidedOrdersPanel_default=__plugin_vue_export_helper_default(_sfc_main$258,[[`__scopeId`,`data-v-877d97e8`]]),_hoisted_1$228={class:`header-text`},_hoisted_2$186={key:0,class:`disabled-reason noOffers`},_sfc_main$257={__name:`FilterCard`,props:{filter:Object},setup(__props){let props=__props,cargoOverviewStore=useCargoOverviewStore(),disabled=computed(()=>{if(props.filter){if(!props.filter.hasAvailableOffers)return{disabled:!0};if(props.filter.unavailableAtThisFacility)return{disabled:!0,reason:`Unavailable`};if(props.filter.lockedInfo)return{disabled:!0,reason:props.filter.lockedInfo.shortLabel}}return{disabled:!1}});return onMounted(()=>{}),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass([`filterCard`,{disabled:disabled.value.disabled}]),onClick:_cache[0]||=withModifiers($event=>unref(cargoOverviewStore).selectFilter([__props.filter.value]),[`stop`])},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`card-heading`},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$228,toDisplayString(__props.filter.label),1)]),_:1}),createVNode(unref(aspectRatio_default),{class:`image`,ratio:`8:3`},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.filter.icon]},null,8,[`type`]),createBaseVNode(`div`,{class:normalizeClass([`step`,{none:__props.filter.facilityCards===0}])},[createVNode(unref(bngPropVal_default),{class:`amount-avail`,valueLabel:`× `+__props.filter.facilityCards},null,8,[`valueLabel`])],2)]),_:1}),disabled.value.reason?(openBlock(),createElementBlock(`div`,_hoisted_2$186,[createVNode(unref(bngPropVal_default),{class:`amount-avail`,iconType:unref(icons).lockClosed,valueLabel:disabled.value.reason},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)]),_:1},8,[`class`]))}},FilterCard_default=__plugin_vue_export_helper_default(_sfc_main$257,[[`__scopeId`,`data-v-85dcf2d5`]]),_hoisted_1$227={key:0,class:`heading-container`},_hoisted_2$185={class:`status-add`},_hoisted_3$163={class:`controls-row`},_hoisted_4$136={key:1,class:`content-container`},_hoisted_5$119={class:`header-container`},_hoisted_6$102={class:`info-line`},_hoisted_7$89={class:`header-flex padding`},_hoisted_8$74={class:`groupSortButtons`},_hoisted_9$67={class:`scroll-panel`},_hoisted_10$58={key:0,class:`tasklist`},_hoisted_11$52={class:`tasklist-header`},_hoisted_12$41={class:`task-content`},_hoisted_13$34={class:`heading`},_hoisted_14$32={class:`description`},_hoisted_15$31={key:1,class:`empty-cargo-card`},_hoisted_16$31={class:`header-container`},_hoisted_17$25={class:`header-flex`},_hoisted_18$22={key:0,class:`map-overlay`},_hoisted_19$19={key:1,class:`empty-cargo-card`},_hoisted_20$16={class:`header-container`},_hoisted_21$15={class:`info-line`},_hoisted_22$13={class:`header-flex wrap padding`},_hoisted_23$12={class:`groupSortButtons`},_hoisted_24$11={class:`cargohold-info`},_hoisted_25$10={class:`scroll-panel padding`},_hoisted_26$8={class:`content`},_hoisted_27$8={key:0,class:`buttons-wrapper`},_hoisted_28$7={class:`content flex-container`},_hoisted_29$7={key:1,class:`header-flex progress-bar-padding`},_hoisted_30$7={key:0,class:`progress-bar-wrapper wide`},_hoisted_31$7=[`innerHTML`],_hoisted_32$7={class:`info-right`},_hoisted_33$7={key:0},_hoisted_34$7={key:0,class:`header-flex progress-bar-padding`},_hoisted_35$6={class:`progress-bar-wrapper wide`},_hoisted_36$6={class:`content`},_hoisted_37$5={class:`filterSelectGrid`},_sfc_main$256={__name:`CargoOverviewMain`,props:{facilityId:String,parkingSpotPath:String},setup(__props){let tabPills=ref();useUINavScope(`delivery`);let props=__props,cargoOverviewStore=useCargoOverviewStore();async function openDiscardPopup(){await openConfirmation(null,`Discard Changes?`)&&(Lua_default.career_modules_delivery_cargoScreen.cancelDeliveryConfiguration(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))}let close=()=>{cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0&&props.facilityId?openDiscardPopup():(Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))},acceptLoad=()=>{Lua_default.career_modules_delivery_cargoScreen.commitDeliveryConfiguration(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`)};async function openExitModePopup(){await openConfirmation(null,`Throw away all cargo and exit delivery mode?`)&&(Lua_default.career_modules_delivery_cargoScreen.exitDeliveryMode(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))}let exitMode=()=>{openExitModePopup()};async function gotoSkillProgress(panel){cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0||window.bngVue.gotoGameState(`branchPage`,{params:{branchKey:panel.branchId,skillKey:panel.skillId}})}async function gotoOrganizations(id){cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0||window.bngVue.gotoGameState(`organizations`,{params:{orgId:id}})}let facilitySortAsc=ref(!1),playerSortAsc=ref(!0),activePopovers={},popShown=pop=>nextTick(()=>activePopovers[pop.name]=pop),popHidden=pop=>nextTick(()=>delete activePopovers[pop.name]);function popHideAll(){for(let pop of Object.values(activePopovers))pop.hide()}let screenCover=ref(),mapPanel=ref(null),observer$2,mapClipChanged;function resizer(){let elScreen=screenCover.value?.$el||screenCover.value;if(!mapPanel.value||!elScreen){mapClipChanged&&(mapClipChanged=!1,screenCover.value.style.setProperty(`--map-clip`,`unset`));return}let pad=3,{width:width$1,height:height$1}=elScreen.getBoundingClientRect(),rect=mapPanel.value.getBoundingClientRect(),percentile=[(rect.x+3)/width$1,(rect.y+3)/height$1,(rect.x+rect.width-3)/width$1,(rect.y+rect.height-3)/height$1].map(n=>`${n*100}%`);elScreen.style.setProperty(`--map-clip`,`polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, ${percentile[0]} ${percentile[1]}, ${percentile[0]} ${percentile[3]}, ${percentile[2]} ${percentile[3]}, ${percentile[2]} ${percentile[1]}, ${percentile[0]} ${percentile[1]})`),mapClipChanged=!0,Lua_default.freeroam_bigMapMode.setBigmapScreenBounds({width:width$1,height:height$1},rect)}watch(()=>mapPanel.value,(elm,prev)=>{prev&&observer$2.unobserve(prev),elm&&observer$2.observe(elm)},{immediate:!0}),watch(()=>cargoOverviewStore.selectedFilter?.isFacilityPage,()=>nextTick(resizer));let selectedFilters=ref([]);return watch(()=>cargoOverviewStore.selectedFilter,filter=>{selectedFilters.value=[filter.value],cargoOverviewStore.focusedCargo=null}),onMounted(()=>{observer$2=new ResizeObserver(resizer),resizer(),cargoOverviewStore.requestCargoData(props.facilityId,props.parkingSpotPath),selectedFilters.value=[cargoOverviewStore.selectedFilter.value]}),onBeforeUnmount(()=>{observer$2?.disconnect()}),onUnmounted(()=>{Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),cargoOverviewStore.menuClosed()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`cargo-overview-main-layout`,"bng-ui-scope":`delivery`,ref_key:`screenCover`,ref:screenCover},{default:withCtx(()=>[createBaseVNode(`div`,{class:`screen`,onClick:_cache[10]||=$event=>unref(cargoOverviewStore).cardDeselect(),onClickCapture:popHideAll},[unref(cargoOverviewStore).cargoData?(openBlock(),createElementBlock(`div`,_hoisted_1$227,[createVNode(unref(bngScreenHeading_default),{preheadings:[`Delivery Mode`],divider:``},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facility?unref(cargoOverviewStore).cargoData.facility.name:`My Cargo`),1)]),_:1}),createVNode(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default)),createBaseVNode(`div`,_hoisted_2$185,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.skillLevels,(skill,index)=>(openBlock(),createBlock(unref(bngPropVal_default),{key:index,iconType:unref(icons)[skill.icon],valueLabel:_ctx.$ctx_t(skill.levelLabel)},null,8,[`iconType`,`valueLabel`]))),128)),unref(cargoOverviewStore).cargoData.facility&&unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons).peopleOutline,valueLabel:_ctx.$ctx_t(unref(cargoOverviewStore).cargoData.facility.organization.reputation.label)},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0)])]),_:1})])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$163,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`back-button`,accent:unref(ACCENTS).attention,onClick:close},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.common.close`)),1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]),unref(cargoOverviewStore).cargoData&&unref(cargoOverviewStore).filterSets&&__props.facilityId?(openBlock(),createBlock(unref(bngPillFilters_default),{key:0,ref_key:`tabPills`,ref:tabPills,required:``,modelValue:selectedFilters.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedFilters.value=$event,options:unref(cargoOverviewStore).filterSets,onValueChanged:unref(cargoOverviewStore).selectFilter},null,8,[`modelValue`,`options`,`onValueChanged`])):createCommentVNode(``,!0),!__props.facilityId&&unref(cargoOverviewStore).cargoData&&unref(cargoOverviewStore).cargoData.player.penaltyForAbandon.money<0?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:`attention`,iconLeft:unref(icons).trashBin1,onClick:exitMode,class:`right-button`},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(` Abandon all deliveries `,-1)]]),_:1},8,[`iconLeft`])):createCommentVNode(``,!0)]),unref(cargoOverviewStore).cargoData?(openBlock(),createElementBlock(`div`,_hoisted_4$136,[!unref(cargoOverviewStore).selectedFilter.isFacilityPage||!__props.facilityId?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`panel-flex`,{reverse:!__props.facilityId}])},[__props.facilityId?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`content-row provided-orders-panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$119,[unref(cargoOverviewStore).selectedFilter?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`,class:`cardHeadingFlex wide`},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).selectedFilter.label),1),unref(cargoOverviewStore).selectedFilter.howTo?(openBlock(),createBlock(TutorialButton_default,{key:0,class:`howto-button right`,accent:`secondary`,icon:unref(icons).help,pages:unref(cargoOverviewStore).selectedFilter.howTo.pages},null,8,[`icon`,`pages`])):createCommentVNode(``,!0)]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$102,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).selectedFilter.shortDescription),1)]),createBaseVNode(`div`,_hoisted_7$89,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).group,onClick:_cache[1]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Grouping: `+toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`facility-grouping`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverMenu_default),{name:`facility-grouping`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).facilityGroupings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).facilityGroupingKey===key}),onClick:withModifiers(()=>{unref(cargoOverviewStore).facilityGroupingKey=key,hide$2()},[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_8$74,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).order,onClick:_cache[2]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Sorting: `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).facilitySortingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`facility-sorting`,`bottom`,{click:!0}]]),withDirectives(createVNode(unref(bngButton_default),{class:`groupSortButtonSmall`,accent:unref(ACCENTS).text,icon:facilitySortAsc.value?unref(icons).sortAsc:unref(icons).sortDesc,onClick:_cache[3]||=withModifiers($event=>facilitySortAsc.value=!facilitySortAsc.value,[`stop`])},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),facilitySortAsc.value?`Ascending order`:`Descending order`,`top`]])]),createVNode(unref(bngPopoverMenu_default),{name:`facility-sorting`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).facilitySortings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).facilitySortingKey===key}),onClick:()=>{unref(cargoOverviewStore).facilitySortingKey=key,hide$2()}},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1})])]),_cache[12]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_9$67,[unref(cargoOverviewStore).currentFilterTutorialInfo?.tasks?(openBlock(),createElementBlock(`div`,_hoisted_10$58,[createBaseVNode(`div`,_hoisted_11$52,toDisplayString(unref(cargoOverviewStore).selectedFilter.label)+` Tutorial `,1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).currentFilterTutorialInfo.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_12$41,[createBaseVNode(`div`,_hoisted_13$34,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_14$32,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0),createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.facilityCardGroupSets,groupIdx:unref(cargoOverviewStore).facilityGroupingKey,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).facilitySortingKey,sortAsc:facilitySortAsc.value,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`sortAsc`,`onCardHovered`,`onCardClicked`])])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`content-row selected-and-map-panel`,{wide:!__props.facilityId}])},[__props.facilityId?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`cargo-detail`},{default:withCtx(()=>[unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo,detailed:``,"show-buttons":!unref(cargoOverviewStore).focusedCargo&&unref(cargoOverviewStore).selectedCargo||unref(cargoOverviewStore).focusedCargo===unref(cargoOverviewStore).selectedCargo},null,8,[`card`,`show-buttons`])):(openBlock(),createElementBlock(`div`,_hoisted_15$31,`Select a card to view details.`))]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`map`,ref_key:`mapPanel`,ref:mapPanel},[createBaseVNode(`div`,_hoisted_16$31,[createBaseVNode(`div`,_hoisted_17$25,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading wide`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(unref(cargoOverviewStore).cargoData.levelInfo.name)),1)]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[4]||=$event=>unref(cargoOverviewStore).automaticRoute=$event,onClick:_cache[5]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`])])]),__props.facilityId?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$22,[createVNode(unref(bngCard_default),{class:`cargo-detail`},{default:withCtx(()=>[unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo,detailed:``,"show-buttons":!unref(cargoOverviewStore).focusedCargo&&unref(cargoOverviewStore).selectedCargo||unref(cargoOverviewStore).focusedCargo===unref(cargoOverviewStore).selectedCargo},null,8,[`card`,`show-buttons`])):(openBlock(),createElementBlock(`div`,_hoisted_19$19,` Select a card to view details. `))]),_:1})]))],512)],2),createVNode(unref(bngCard_default),{class:`content-row my-cargo-panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_20$16,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeadingFlex wide`},{default:withCtx(()=>[_cache[14]||=createBaseVNode(`span`,null,`My Cargo`,-1),createVNode(TutorialButton_default,{class:`howto-button right`,accent:`secondary`,icon:unref(icons).help,pages:[`delivery/myCargo`,`delivery/parcelDelivery`]},null,8,[`icon`])]),_:1}),createBaseVNode(`div`,_hoisted_21$15,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),_cache[15]||=createBaseVNode(`span`,null,`Check your loaded cargo and other delivery-related tasks.`,-1)]),createBaseVNode(`div`,_hoisted_22$13,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).group,onClick:_cache[6]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Grouping: `+toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).playerGroupingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`player-grouping`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverMenu_default),{name:`player-grouping`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerGroupings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).playerGroupingKey===key}),onClick:()=>{unref(cargoOverviewStore).playerGroupingKey=key,hide$2()}},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_23$12,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).order,onClick:_cache[7]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Sorting: `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).playerSortingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`player-sorting`,`bottom`,{click:!0}]]),withDirectives(createVNode(unref(bngButton_default),{class:`groupSortButtonSmall`,accent:unref(ACCENTS).text,icon:playerSortAsc.value?unref(icons).sortAsc:unref(icons).sortDesc,onClick:_cache[8]||=withModifiers($event=>playerSortAsc.value=!playerSortAsc.value,[`stop`])},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),playerSortAsc.value?`Ascending order`:`Descending order`,`top`]])]),createVNode(unref(bngPopoverMenu_default),{name:`player-sorting`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerSortings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).playerSortingKey===key}),onClick:withModifiers(()=>{unref(cargoOverviewStore).playerSortingKey=key,hide$2()},[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_24$11,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.playerCardGroupSets.totalStorages.groups,(group,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[group.meta.totalCargoSlots?(openBlock(),createBlock(CargoInfo_default,{key:0,class:`info-with-gradient`,meta:group.meta},null,8,[`meta`])):createCommentVNode(``,!0)],64))),128))])])]),_cache[17]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_25$10,[unref(cargoOverviewStore).selectedFilter.noContainers?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`no-container-card`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_26$8,[createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),_cache[16]||=createTextVNode(` You do not have any containers installed that can load this type of cargo. `,-1)]),createVNode(TutorialButton_default,{class:`button`,accent:`secondary`,icon:unref(icons).help,pages:[`delivery/cargoContainerHowTo`],text:`How do I install cargo containers?`},null,8,[`icon`])])]),_:1})):createCommentVNode(``,!0),createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.playerCardGroupSets,groupIdx:unref(cargoOverviewStore).playerGroupingKey,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).playerSortingKey,sortAsc:playerSortAsc.value,ignoreFilter:!0,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`sortAsc`,`onCardHovered`,`onCardClicked`])]),unref(cargoOverviewStore).cargoData&&__props.facilityId?(openBlock(),createElementBlock(`div`,_hoisted_27$8,[unref(cargoOverviewStore).cargoData.confirmButtonInfo.itemCount>0?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`accept-button`,icon:unref(icons).checkmark,onClick:withModifiers(acceptLoad,[`stop`])},{default:withCtx(()=>[createTextVNode(` Continue (`+toDisplayString(unref(cargoOverviewStore).cargoData.confirmButtonInfo.itemCount)+` items) `,1)]),_:1},8,[`icon`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1})],2)):(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`detailedFilterSelector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_28$7,[createVNode(unref(bngCard_default),{class:`info-left`},{default:withCtx(()=>[unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`,class:`cardHeadingFlex`},{default:withCtx(()=>[createBaseVNode(`span`,null,[_cache[18]||=createBaseVNode(`span`,null,`Reputation:\xA0`,-1),createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).cargoData.facility.organization.reputation.label+` (lvl `+unref(cargoOverviewStore).cargoData.facility.organization.reputation.level+`)`),1)]),createVNode(unref(bngButton_default),{icon:unref(icons).signal05a,accent:`secondary`,onClick:_cache[9]||=$event=>gotoOrganizations(unref(cargoOverviewStore).cargoData.facility.organization.id)},{default:withCtx(()=>[..._cache[19]||=[createTextVNode(`Progress`,-1)]]),_:1},8,[`icon`])]),_:1})):createCommentVNode(``,!0),unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createElementBlock(`div`,_hoisted_29$7,[createVNode(unref(bngIcon_default),{class:`progress-icon`,type:unref(icons).peopleOutline},null,8,[`type`]),unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createElementBlock(`div`,_hoisted_30$7,[createVNode(unref(bngProgressBar_default),{class:`bar`,gradient:``,value:unref(cargoOverviewStore).cargoData.facility.organization.reputation.value,max:unref(cargoOverviewStore).cargoData.facility.organization.reputation.nextThreshold,min:unref(cargoOverviewStore).cargoData.facility.organization.prevThreshold,showValueLabel:!1},null,8,[`value`,`max`,`min`])])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,ratio:`5:3`,"external-image":unref(cargoOverviewStore).cargoData.facility.preview},null,8,[`external-image`]),createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Facility Information `,-1)]]),_:1}),createBaseVNode(`div`,{class:`content text-justify`,innerHTML:unref(content_exports).bbcode.parse(unref(cargoOverviewStore).cargoData.facility.longDescription)},null,8,_hoisted_31$7)]),_:1}),createBaseVNode(`div`,_hoisted_32$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.facilityPanels,(panel,index)=>(openBlock(),createBlock(unref(bngCard_default),{key:index,class:`panel`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeadingFlex`},{default:withCtx(()=>[createBaseVNode(`span`,null,[createBaseVNode(`span`,null,toDisplayString(panel.heading)+`:\xA0`,1),panel.skillInfo?(openBlock(),createElementBlock(`span`,_hoisted_33$7,toDisplayString(panel.skillInfo.unlocked?_ctx.$ctx_t(panel.skillInfo.levelLabel):``),1)):createCommentVNode(``,!0)]),panel.skillInfo?(openBlock(),createBlock(unref(bngButton_default),{key:0,icon:unref(icons).signal05a,accent:`secondary`,onClick:$event=>gotoSkillProgress(panel)},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(`Progress`,-1)]]),_:1},8,[`icon`,`onClick`])):createCommentVNode(``,!0)]),_:2},1024),panel.skillInfo?(openBlock(),createElementBlock(`div`,_hoisted_34$7,[createVNode(unref(bngIcon_default),{class:`progress-icon`,type:unref(icons)[panel.skillInfo.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_35$6,[createVNode(unref(bngProgressBar_default),{class:`bar`,gradient:``,value:panel.skillInfo.max==-1?1:panel.skillInfo.value-panel.skillInfo.min,max:panel.skillInfo.max==-1?1:panel.skillInfo.max-panel.skillInfo.min,showValueLabel:!0,valueLabelFormat:panel.skillInfo.max===-1?`Max`:panel.skillInfo.value+` XP`},null,8,[`value`,`max`,`valueLabelFormat`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_36$6,[createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),createTextVNode(` `+toDisplayString(panel.description),1)]),createBaseVNode(`div`,_hoisted_37$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(panel.filterValueButtons,filterKey=>(openBlock(),createBlock(FilterCard_default,{key:filterKey,filter:unref(cargoOverviewStore).filterSetsByValue[filterKey]},null,8,[`filter`]))),128))])])]),_:2},1024))),128))])])]),_:1}))])):createCommentVNode(``,!0)],32)]),_:1},512))}},CargoOverviewMain_default=__plugin_vue_export_helper_default(_sfc_main$256,[[`__scopeId`,`data-v-719883ab`]]),_hoisted_1$226={class:`unlock-wrapper`,"bng-ui-scope":`cargoUnlockPopup`},_hoisted_2$184={class:`cardContent`},_hoisted_3$162={class:`acceptButton`},__default__$1={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$255=Object.assign(__default__$1,{__name:`UnlockPopup`,props:{reward:Object},emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`cargoUnlockPopup`);let emit$1=__emit,acceptClickHandler=()=>{emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$226,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Level Up! `,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$184,[createBaseVNode(`h3`,null,toDisplayString(__props.reward.unlockPopupHeader),1),_cache[2]||=createTextVNode(` Unlocks: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.reward.branchLevels[__props.reward.animationData.level-1].unlocks,item=>(openBlock(),createBlock(UnlockCard_default,{class:`tier-unlocks-item`,data:item},null,8,[`data`]))),256)),createBaseVNode(`div`,_hoisted_3$162,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:acceptClickHandler},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[1]||=createBaseVNode(`span`,null,`Continue`,-1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),acceptClickHandler,`ok`]])])])]),_:1})]))}}),UnlockPopup_default=__plugin_vue_export_helper_default(_sfc_main$255,[[`__scopeId`,`data-v-127ed650`]]),_hoisted_1$225={class:`reward-wrapper`},_hoisted_2$183={class:`card-content`},_hoisted_3$161={class:`scroll-wrapper`},_hoisted_4$135={key:0},_hoisted_5$118={class:`cargo-wrapper`},_hoisted_6$101={class:`header`},_hoisted_7$88={class:`amount-controls`},_hoisted_8$73={class:`amount`},_hoisted_9$66={class:`card-content`},_hoisted_10$57={style:{display:`flex`}},_hoisted_11$51={style:{float:`left`}},_hoisted_12$40={key:0,class:`rewards-breakdown-container padding-bottom`},_hoisted_13$33={class:`grid-wrapper`},_hoisted_14$31={class:`grid-row grid`},_hoisted_15$30={class:`label primary`},_hoisted_16$30={class:`rewards primary`},_hoisted_17$24={class:`grid-wrapper wide`},_hoisted_18$21={class:`grid`},_hoisted_19$18={class:`label secondary`},_hoisted_20$15={class:`rewards secondary`},_hoisted_21$14={class:`grid-row grid`},_hoisted_22$12={class:`rewards primary`},_hoisted_23$11={key:1,class:`rewards-breakdown-container padding-bottom`},_hoisted_24$10={class:`grid-wrapper`},_hoisted_25$9={key:0,class:`grid-row grid`},_hoisted_26$7={class:`rewards primary`},_hoisted_27$7={key:1,class:`grid-row grid`},_hoisted_28$6={class:`rewards primary`},_hoisted_29$6={key:2,class:`grid-row grid`},_hoisted_30$6={class:`rewards primary`},_hoisted_31$6={key:3,class:`grid-row grid`},_hoisted_32$6={class:`rewards primary`},_hoisted_33$6={class:`grid-row grid`},_hoisted_34$6={class:`rewards primary`},_hoisted_35$5={style:{float:`left`}},_hoisted_36$5={key:0,style:{float:`left`}},_hoisted_37$4={key:0,class:`numberReward`},_hoisted_38$4={key:1,class:`numberReward`},_hoisted_39$4={key:2},_hoisted_40$3={key:1,style:{float:`left`,width:`100%`,padding:`0.2em`}},_hoisted_41$3={key:2},__default__={wrapper:{fade:!0,blur:!0,style:popupContainer.transparent},position:[popupPosition.center,popupPosition.center]},_sfc_main$254=Object.assign(__default__,{__name:`CargoDropOff`,props:{facilityId:String,parkingSpotPath:String},setup(__props){let ANIMATION_START_DELAY=400,ANIMATION_DURATION=3e3,ANIMATION_UPDATE_RATE=30,BAR_COLOR_DEFAULT=`#ff6600`,BAR_COLOR_ADDITION=`#ff6600`,BAR_COLOR_SUBTRACTION=`#c00000`,MODES={wait:`wait`,cargoSelection:`cargoSelection`,results:`results`},cargoOverviewStore=useCargoOverviewStore();useUINavScope(`cargoDropOff`);let props=__props,{events:events$3}=useBridge(),mode=ref(MODES.wait),data=ref({}),summary=ref([]),showConfirmDelay=ref(!1),confirmButtonEnabled=ref(!1),confirmButtonTimer=ref(0),confirmButtonTimerId=0,rewardAnimationIndex=ref(-1),animationSkipped=!1,showUnloadingDelay=!0,getLevelFromValue=(value,reward)=>{let branchLevels=reward.branchLevels,levelIndex=-1;for(let i=0;i=levelData.requiredValue&&(levelIndex=i)}let maxLevel=!(branchLevels[levelIndex+1]&&branchLevels[levelIndex+1].requiredValue!=null),displayValue=value-branchLevels[levelIndex].requiredValue;return{min:0,max:maxLevel?displayValue:branchLevels[levelIndex+1].requiredValue-branchLevels[levelIndex].requiredValue,displayValue,levelLabel:reward.type==`reputation`?branchLevels[levelIndex].label+` (Level `+(levelIndex-1)+`)`:branchLevels[levelIndex].levelLabel,level:levelIndex+1,maxLevel}},confirm=()=>{rewardAnimationIndex.value<0?confirmButtonEnabled.value&&confirmDropOff():skipAnimations()},getDeliveryList=()=>summary.value.detailledList.map(delivery=>delivery.label).join(`, `),getNiceTime=()=>confirmButtonTimer.value>0?confirmButtonTimer.value.toFixed(1)+`s remaining...`:`Done!`,exit=()=>{window.bngVue.gotoGameState(`play`)};function updateDisplayValue(reward){if(reward.branchLevels&&reward.branchLevels.length){let displayData=getLevelFromValue(reward.animationData.smoothedValue,reward);reward.animationData.max=displayData.max,reward.animationData.displayValue=displayData.displayValue,reward.animationData.levelLabel=displayData.levelLabel,reward.animationData.level=displayData.level,reward.animationData.maxLevel=displayData.maxLevel;let displayDataBefore=getLevelFromValue(reward.animationData.value-reward.rewardAmount,reward);displayData.level==displayDataBefore.level?(reward.animationData.displayValueBefore=displayDataBefore.displayValue,displayData.displayValue>=displayDataBefore.displayValue?(reward.valueColor=BAR_COLOR_ADDITION,reward.valueBeforeColor=BAR_COLOR_DEFAULT):(reward.valueBeforeColor=BAR_COLOR_SUBTRACTION,reward.valueColor=BAR_COLOR_DEFAULT)):displayData.level>displayDataBefore.level?(reward.animationData.displayValueBefore=0,reward.valueColor=BAR_COLOR_ADDITION,reward.valueBeforeColor=BAR_COLOR_DEFAULT):(reward.animationData.displayValueBefore=displayData.max,reward.valueColor=BAR_COLOR_DEFAULT,reward.valueBeforeColor=BAR_COLOR_SUBTRACTION)}}let startSmoothingValue=(reward,duration)=>{reward.animationData.numStep=(reward.animationData.value-reward.animationData.smoothedValue)/duration*30,clearInterval(reward.animationData.numTimer),reward.animationData.numTimer=setInterval(()=>{reward.animationData.smoothedValue+=reward.animationData.numStep,(reward.animationData.numStep>0?reward.animationData.smoothedValue>=reward.animationData.value:reward.animationData.smoothedValue<=reward.animationData.value)&&(Lua_default.career_modules_delivery_progress.activateSound(``,!1),reward.animationData.smoothedValue=reward.animationData.value,reward.animationData.numStep=0,clearInterval(reward.animationData.numTimer)),reward.highlight=reward.animationData.numStep!=0,updateDisplayValue(reward)},30)};async function openNewLevelPopup(reward){Lua_default.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Progress_LevelUp`),await addPopup(UnlockPopup_default,{reward}).promise,startProgressBarAnimation()}function didPlayerLevelUp(reward){let levelBefore=0,levelAfter=0;return reward.branchLevels&&reward.branchLevels.length&&(levelBefore=getLevelFromValue(reward.animationData.value-reward.rewardAmount,reward).level,levelAfter=getLevelFromValue(reward.animationData.value,reward).level),levelBeforeopenNewLevelPopup(reward),duration):setTimeout(startProgressBarAnimation,duration+400);return}rewardAnimationIndex.value=-1}}let start=()=>{getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),Lua_default.career_modules_delivery_general.setDeliveryTimePaused(!0),Lua_default.career_modules_delivery_cargoScreen.requestDropOffData(props.facilityId,props.parkingSpotPath)},kill=()=>{Lua_default.career_modules_delivery_general.setDeliveryTimePaused(!1),events$3.off(`SetDeliveryDropOffCargoSelection`),events$3.off(`SetDeliveryDropOffRewardResult`),clearInterval(confirmButtonTimerId),Lua_default.career_modules_delivery_cargoScreen.dropOffPopupClosed(mode.value)},confirmSelection=()=>{let confirmedCargoIds=[];data.value.customAmountPerMaterialType.forEach(info=>{info.items.forEach(item=>{item.amountSelector>0&&confirmedCargoIds.push({id:item.ids[0],amount:item.amountSelector})})});let confirmedDropOffs={confirmedCargoIds,confirmedOfferIds:[]};console.log(confirmedDropOffs),Lua_default.career_modules_delivery_cargoScreen.confirmDropOffData(confirmedDropOffs,props.facilityId,props.parkingSpotPath)},confirmDropOff=()=>{exit()},branchInfo;function rewardMapToRewardList(rewards){let newRewards=[];for(let key in rewards){let rewardInfo={attributeKey:key,rewardAmount:rewards[key],order:branchInfo[key].order,animationData:branchInfo[key].animationData,branchLevels:branchInfo[key].branchLevels,showLevelUpPopup:branchInfo[key].showLevelUpPopup,unlockPopupHeader:branchInfo[key].unlockPopupHeader,type:branchInfo[key].type};branchInfo[key].icon&&(rewardInfo.icon=branchInfo[key].icon),newRewards.push(rewardInfo)}return newRewards.sort((a$1,b)=>a$1.order-b.order),newRewards}let cargoBySummaryId=[],calculateSummary=()=>{let simpleBreakdownRewardsByType={base:[],bonus:[],loaner:[],branch:[]};summary.value={detailledList:[],total:{label:`Total`,rewards:{}}};let totalRewards={};for(let id in cargoBySummaryId){let group=cargoBySummaryId[id],first=group.list[0],totalCount=0;for(let cargo of group.list)totalCount+=1;let sum={label:first.name,rewards:rewardMapToRewardList(first.originalRewards),breakdown:[]};for(let i=0;i0&&summary.value.detailledList.push(sum)}if(data.value.rewardOffers.length)for(let veh of data.value.rewardOffers){let sum={label:veh.offer.name,rewards:rewardMapToRewardList(veh.originalRewards),breakdown:[]};if(simpleBreakdownRewardsByType.base.push(veh.originalRewards),veh.breakdown.length)for(let bd of veh.breakdown)sum.breakdown.push({label:bd.label,rewards:rewardMapToRewardList(bd.rewards)}),bd.simpleBreakdownType&&(simpleBreakdownRewardsByType[bd.simpleBreakdownType]||(simpleBreakdownRewardsByType[bd.simpleBreakdownType]=[]),simpleBreakdownRewardsByType[bd.simpleBreakdownType].push(bd.rewards));summary.value.detailledList.push(sum)}for(let type in simpleBreakdownRewardsByType){let sum={};for(let elem of simpleBreakdownRewardsByType[type])for(let attKey in elem)sum[attKey]||(sum[attKey]=0),sum[attKey]+=elem[attKey];simpleBreakdownRewardsByType[type]=rewardMapToRewardList(sum)}summary.value.simpleBreakdown=simpleBreakdownRewardsByType;for(let row of summary.value.detailledList){for(let elem of row.rewards)totalRewards[elem.attributeKey]||(totalRewards[elem.attributeKey]=0),totalRewards[elem.attributeKey]+=elem.rewardAmount;for(let bd of row.breakdown)for(let elem of bd.rewards)totalRewards[elem.attributeKey]||(totalRewards[elem.attributeKey]=0),totalRewards[elem.attributeKey]+=elem.rewardAmount}summary.value.total.rewards=rewardMapToRewardList(totalRewards);let counter$1=0;for(let reward of summary.value.total.rewards)reward.animationData.id!=`missing`&&(reward.animationOrderIndex=counter$1,reward.animationData.smoothedValue=reward.animationData.value-reward.rewardAmount,reward.animationData.numStep=0,reward.highlight=!1,updateDisplayValue(reward),counter$1++);rewardAnimationIndex.value=-1,animationSkipped=!1};events$3.on(`SetDeliveryDropOffCargoSelection`,dd=>{data.value=dd,mode.value=MODES.cargoSelection,branchInfo=dd.branchInfo,showUnloadingDelay=dd.unloadingDelay>.1,data.value.playerVehicleData.length&&data.value.customAmountPerMaterialType.forEach(info=>{let remainingFreeAmount=info.storage.capacity-info.storage.storedVolume;info.items.sort((a$1,b)=>a$1.slots-b.slots),info.items.forEach(item=>{item.amountSelectorPerSlot=item.type===`fluid`||item.type===`dryBulk`,item.maxCount=item.ids.length,item.amountSelectorPerSlot&&(item.maxCount=item.slots),item.amountSelector=ref(Math.max(0,Math.min(item.maxCount,remainingFreeAmount))),remainingFreeAmount-=item.amountSelector,item.showAmountSelector=!0,item.loadSliderMax=Math.min(item.maxCount,info.storage.capacity-info.storage.storedVolume)}),info.meta={type:`container`,usedCargoSlots:info.storage.storedVolume,totalCargoSlots:info.storage.capacity,fillPercent:info.storage.storedVolume/info.storage.capacity,icon:info.material.icon},info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector}),info.meta.fillPercentHighlight=info.meta.usedCargoSlots/info.storage.capacity,info.storage.capacity<=info.storage.storedVolume&&(info.isFull=!0)})});let updateSliderAmounts=(info,changedItem)=>{info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector});let tooMuch=info.meta.usedCargoSlots-info.meta.totalCargoSlots;tooMuch>0&&(info.items.reverse(),info.items.forEach(item=>{if(item!==changedItem){let before=item.amountSelector;item.amountSelector=Math.max(0,item.amountSelector-tooMuch);let diff=item.amountSelector-before;tooMuch+=diff}}),info.items.reverse()),info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector}),info.meta.fillPercentHighlight=info.meta.usedCargoSlots/info.storage.capacity};return events$3.on(`SetDeliveryDropOffRewardResult`,dd=>{if(console.log(`setDropOffRewardResult`,dd),data.value=dd,branchInfo=dd.branchInfo,mode.value=MODES.results,confirmButtonEnabled.value=!0,showConfirmDelay.value=!1,dd.unloadingDelay>.1){confirmButtonEnabled.value=!1,confirmButtonTimer.value=dd.unloadingDelay,showConfirmDelay.value=!0;let endTime=Date.now()+confirmButtonTimer.value*1e3,countdown=()=>{let timeLeft=(endTime-Date.now())/1e3;timeLeft>0?(confirmButtonTimer.value=timeLeft,confirmButtonTimerId=requestAnimationFrame(countdown)):(confirmButtonTimer.value=0,confirmButtonEnabled.value=!0)};confirmButtonTimerId=requestAnimationFrame(countdown),showUnloadingDelay=!0}else showUnloadingDelay=!1;if(dd.rewardParcels.length)for(let cargo of dd.rewardParcels)cargoBySummaryId[cargo.summaryId]||(cargoBySummaryId[cargo.summaryId]={list:[],display:{}}),cargoBySummaryId[cargo.summaryId].list.push(cargo);calculateSummary(),setTimeout(startProgressBarAnimation,400)}),onMounted(start),onUnmounted(kill),(_ctx,_cache)=>mode.value===MODES.wait?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{key:0,class:`cargo-drop-off-wrapper`,"bng-ui-scope":`cargoDropOff`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$225,[mode.value===MODES.cargoSelection?(openBlock(),createBlock(unref(bngCard_default),{key:0},{buttons:withCtx(()=>[createVNode(unref(bngButton_default),{onClick:confirmSelection},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[4]||=createBaseVNode(`span`,null,`Confirm Selection`,-1)]),_:1})]),default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`career-status`}),createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Dropping off...`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$183,[createVNode(unref(bngPropVal_default),{class:`limited-capacity-info`,valueLabel:`This facility has limited capacity for cargo.`,iconType:unref(icons).info},null,8,[`iconType`]),createBaseVNode(`div`,_hoisted_3$161,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value.customAmountPerMaterialType,info=>(openBlock(),createBlock(CardGroup_default,{class:`fullwidth-group`,label:info.material.name,meta:info.meta},{default:withCtx(()=>[info.isFull?(openBlock(),createElementBlock(`div`,_hoisted_4$135,[createVNode(unref(bngPropVal_default),{valueLabel:`The storage for this material is completely filled. Come back later.`,iconType:unref(icons).abandon},null,8,[`iconType`])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(info.items,item=>(openBlock(),createElementBlock(`div`,_hoisted_5$118,[createBaseVNode(`div`,_hoisted_6$101,[createVNode(unref(bngPropVal_default),{valueLabel:item.originName,keyLabel:`Origin`,iconType:unref(icons).locationSource},null,8,[`valueLabel`,`iconType`]),createVNode(unref(bngPropVal_default),{valueLabel:item.containerName,keyLabel:`Container`,iconType:unref(icons).cardboardBox},null,8,[`valueLabel`,`iconType`])]),createBaseVNode(`div`,_hoisted_7$88,[createVNode(unref(bngButton_default),{disabled:info.isFull,class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:_cache[0]||=$event=>_ctx.less(_ctx.target)},null,8,[`disabled`,`iconLeft`]),createVNode(unref(bngSlider_default),{disabled:info.isFull,class:`slider`,min:0,max:item.loadSliderMax,modelValue:item.amountSelector,"onUpdate:modelValue":$event=>item.amountSelector=$event,step:1,onChange:$event=>updateSliderAmounts(info,item)},null,8,[`disabled`,`max`,`modelValue`,`onUpdate:modelValue`,`onChange`]),createVNode(unref(bngButton_default),{disabled:info.isFull,class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:_cache[1]||=$event=>_ctx.more(_ctx.target)},null,8,[`disabled`,`iconLeft`]),createBaseVNode(`div`,_hoisted_8$73,toDisplayString(item.amountSelector)+` / `+toDisplayString(item.slots),1)])]))),256))]),_:2},1032,[`label`,`meta`]))),256))])])]),_:1})):createCommentVNode(``,!0),mode.value===MODES.results?(openBlock(),createBlock(unref(bngCard_default),{key:1},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:rewardAnimationIndex.value<0&&!confirmButtonEnabled.value,onClick:confirm},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{deviceMask:`xinput`}),createBaseVNode(`span`,null,toDisplayString(rewardAnimationIndex.value<0?`Continue`:`Skip`),1)]),_:1},8,[`disabled`])),[[unref(BngFocusIf_default),rewardAnimationIndex.value==0]])]),default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Delivery Complete!`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_9$66,[createBaseVNode(`div`,_hoisted_10$57,[createBaseVNode(`h3`,_hoisted_11$51,`Delivered: `+toDisplayString(getDeliveryList()),1),summary.value.detailledList.length>1?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,style:{float:`right`},modelValue:unref(cargoOverviewStore).detailedDropOff,"onUpdate:modelValue":_cache[2]||=$event=>unref(cargoOverviewStore).detailedDropOff=$event},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Detailed`,-1)]]),_:1},8,[`modelValue`])):createCommentVNode(``,!0)]),summary.value.detailledList.length<=1||unref(cargoOverviewStore).detailedDropOff?(openBlock(),createElementBlock(`div`,_hoisted_12$40,[createBaseVNode(`div`,_hoisted_13$33,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summary.value.detailledList,result=>(openBlock(),createElementBlock(`div`,_hoisted_14$31,[createBaseVNode(`div`,_hoisted_15$30,toDisplayString(result.label),1),createBaseVNode(`div`,_hoisted_16$30,[createVNode(RewardsPills_default,{rewards:result.rewards},null,8,[`rewards`])]),createBaseVNode(`div`,_hoisted_17$24,[(openBlock(!0),createElementBlock(Fragment,null,renderList(result.breakdown,breakdown=>(openBlock(),createElementBlock(`div`,_hoisted_18$21,[createBaseVNode(`div`,_hoisted_19$18,toDisplayString(breakdown.label),1),createBaseVNode(`div`,_hoisted_20$15,[createVNode(RewardsPills_default,{rewards:breakdown.rewards},null,8,[`rewards`])])]))),256))])]))),256)),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_21$14,[_cache[7]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_22$12,[createVNode(RewardsPills_default,{rewards:summary.value.total.rewards},null,8,[`rewards`])])])])])):(openBlock(),createElementBlock(`div`,_hoisted_23$11,[createBaseVNode(`div`,_hoisted_24$10,[summary.value.simpleBreakdown.base.length?(openBlock(),createElementBlock(`div`,_hoisted_25$9,[_cache[8]||=createBaseVNode(`div`,{class:`label primary`},`Base Rewards`,-1),createBaseVNode(`div`,_hoisted_26$7,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.base},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.bonus.length?(openBlock(),createElementBlock(`div`,_hoisted_27$7,[_cache[9]||=createBaseVNode(`div`,{class:`label primary`},`Bonuses`,-1),createBaseVNode(`div`,_hoisted_28$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.bonus},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.loaner.length?(openBlock(),createElementBlock(`div`,_hoisted_29$6,[_cache[10]||=createBaseVNode(`div`,{class:`label primary`},`Loaner Cuts`,-1),createBaseVNode(`div`,_hoisted_30$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.loaner},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.branch.length?(openBlock(),createElementBlock(`div`,_hoisted_31$6,[_cache[11]||=createBaseVNode(`div`,{class:`label primary`},`Logistics Level Multiplier`,-1),createBaseVNode(`div`,_hoisted_32$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.branch},null,8,[`rewards`])])])):createCommentVNode(``,!0),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_33$6,[_cache[12]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_34$6,[createVNode(RewardsPills_default,{rewards:summary.value.total.rewards},null,8,[`rewards`])])])])])),(openBlock(!0),createElementBlock(Fragment,null,renderList(summary.value.total.rewards,reward=>(openBlock(),createElementBlock(`div`,null,[reward.animationData.id==`missing`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass(reward.animationData.numStep==0?``:`animate-progress-background`),style:{display:`flex`,"padding-bottom":`0.5em`,"padding-left":`0.2em`,"padding-right":`0.2em`}},[createBaseVNode(`div`,_hoisted_35$5,[reward.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,style:{"padding-top":`0.5em`,"padding-right":`0.3em`},type:unref(icons)[reward.icon]},null,8,[`type`])):createCommentVNode(``,!0)]),reward.animationData.type==`number`?(openBlock(),createElementBlock(`div`,_hoisted_36$5,[reward.attributeKey==`money`?(openBlock(),createElementBlock(`div`,_hoisted_37$4,[createVNode(unref(bngUnit_default),{money:reward.animationData.smoothedValue,"no-icon":``},null,8,[`money`])])):reward.attributeKey==`beamXP`?(openBlock(),createElementBlock(`div`,_hoisted_38$4,[createVNode(unref(bngUnit_default),{beamXP:reward.animationData.smoothedValue,"no-icon":``},null,8,[`beamXP`])])):(openBlock(),createElementBlock(`div`,_hoisted_39$4,toDisplayString(reward.animationData.smoothedValue.toFixed(2)),1))])):(openBlock(),createElementBlock(`div`,_hoisted_40$3,[createVNode(unref(bngProgressBar_default),{headerLeft:_ctx.$t(reward.animationData.name),headerRight:reward.animationData.levelLabel,value:~~reward.animationData.displayValue,"old-value":~~reward.animationData.displayValueBefore,max:reward.animationData.max,showValueLabel:!0,valueColor:reward.valueColor,oldValueColor:reward.valueBeforeColor,valueLabelFormat:reward.animationData.maxLevel?~~reward.animationData.displayValue+`\xA0XP`:`#value#\xA0XP`,"animate-difference":!0},null,8,[`headerLeft`,`headerRight`,`value`,`old-value`,`max`,`valueColor`,`oldValueColor`,`valueLabelFormat`])]))],2))]))),256)),unref(showUnloadingDelay)?(openBlock(),createElementBlock(`div`,_hoisted_41$3,[createVNode(unref(bngDivider_default)),_cache[13]||=createTextVNode(` Unloading Delay `,-1),createVNode(unref(bngProgressBar_default),{class:`timer`,value:data.value.unloadingDelay-confirmButtonTimer.value,max:data.value.unloadingDelay,min:0,valueLabelFormat:getNiceTime()},null,8,[`value`,`max`,`valueLabelFormat`])])):createCommentVNode(``,!0)])]),_:1})):createCommentVNode(``,!0)])]),_:1})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),confirm,`back,menu`]])}}),CargoDropOff_default=__plugin_vue_export_helper_default(_sfc_main$254,[[`__scopeId`,`data-v-698d9552`]]);const useComputerStore=defineStore(`computer`,()=>{let computerData=ref({}),activeVehicleIndex=ref(0),activeInventoryId=computed(()=>computerData.value.vehicles&&computerData.value.vehicles[activeVehicleIndex.value]?computerData.value.vehicles[activeVehicleIndex.value].inventoryId:`0`),generalComputerFunctions=computed(()=>{if(!computerData.value.computerFunctions)return[];let result=[];return result=Object.values(computerData.value.computerFunctions.general),result.sort((a$1,b)=>a$1.order!=null&&b.order!=null?a$1.order{if(!computerData.value.computerFunctions)return{};let result={};for(let[inventoryId,computerFunctions]of Object.entries(computerData.value.computerFunctions.vehicleSpecific)){let sortedFunctions=Object.values(computerFunctions);sortedFunctions.sort((a$1,b)=>a$1.order!=null&&b.order!=null?a$1.order{computerData.value=data,(computerData.value.vehicles&&computerData.value.vehicles.length<=activeVehicleIndex.value||computerData.value.resetActiveVehicleIndex)&&(activeVehicleIndex.value=0)};return{activeVehicleIndex,activeInventoryId,computerData,generalComputerFunctions,vehicleSpecificComputerFunctions,requestComputerData:()=>{Lua_default.career_modules_computer.getComputerUIData().then(setComputerData)},computerButtonCallback:async(computerFunctionId,inventoryId)=>{await Lua_default.career_modules_computer.computerButtonCallback(computerFunctionId,inventoryId?Number(inventoryId):void 0)},switchActiveVehicle:offset$2=>{activeVehicleIndex.value=(activeVehicleIndex.value+offset$2+computerData.value.vehicles.length)%computerData.value.vehicles.length},onMenuClosed:()=>{Lua_default.career_modules_computer.onMenuClosed()}}});var _hoisted_1$224={class:`task-header`},_hoisted_2$182={class:`description`},_sfc_main$253={__name:`TaskHeader`,props:{title:[String,Object],description:[String,Object]},setup(__props){let props=__props,slots=useSlots(),titleParsed=computed(()=>parse$1($translate.contextTranslate(props.title,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description)));return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$224,[createBaseVNode(`div`,null,[unref(slots).title?renderSlot(_ctx.$slots,`title`,{key:0},void 0,!0):__props.title?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:titleParsed.value},null,8,[`template`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_2$182,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]))}},TaskHeader_default=__plugin_vue_export_helper_default(_sfc_main$253,[[`__scopeId`,`data-v-ae9fa7fe`]]),_hoisted_1$223={class:`task-message`},_hoisted_2$181={class:`label`},_hoisted_3$160={class:`description`},_sfc_main$252={__name:`TaskMessage`,props:{label:String,description:String},setup(__props){let props=__props,slots=useSlots(),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description)));return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$223,[createBaseVNode(`div`,_hoisted_2$181,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$160,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]))}},TaskMessage_default=__plugin_vue_export_helper_default(_sfc_main$252,[[`__scopeId`,`data-v-657447b0`]]),_hoisted_1$222=[`data-id`],_sfc_main$251={__name:`TaskList`,props:{header:Object,tasks:Array,settings:{type:Object,default:{animate:!1,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmpty:!1,animateOnEmptyIntervalDelay:.2,animateNextTask:!1,taskCompleteCallback:{type:Function,required:!1}}}},setup(__props){let props=__props,animationSettings=inject(`animationSettings`,props.settings),previousTasks=ref(null),internalTasks=ref(null),tasksScroller=ref(null),canAnimate=computed(()=>!(!animationSettings.animate||previousTasks.value===null&&!animationSettings.animateOnMount)),nextTask=computed(()=>internalTasks.value.find(x=>x.type===`goal`&&!x.complete&&x.attention)),onBeforeHeaderLeave=el=>{el.style.animationDelay=`0s`},onBeforeLeave=(el,done)=>{el.style.animationDelay=`0s`},onBeforeEnterTask=el=>{let dataId=el.getAttribute(`data-id`),offset$2=props.header?1:0,delay=previousTasks.value===null||previousTasks.value.length===0?animationSettings.animateOnMountIntervalDelay*(Number(dataId)+offset$2):0;el.style.animationDelay=delay+`s`,requestAnimationFrame(()=>{tasksScroller.value&&(tasksScroller.value.scrollTop=tasksScroller.value.scrollHeight)})};onBeforeMount(()=>{(!internalTasks.value||internalTasks.value.length===0)&&(internalTasks.value=unwrapProxy(props.tasks))}),watch(()=>props.tasks,async(newValue,oldValue)=>{internalTasks.value!==null&&(previousTasks.value=internalTasks.value&&internalTasks.value.length>0?unwrapProxy([...internalTasks.value]):[]),internalTasks.value=unwrapProxy(props.tasks)},{deep:!0});function unwrapProxy(reactiveList){return reactiveList.map(x=>Object.assign({},x))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tasks-container`,{animate:unref(animationSettings).animate}])},[createVNode(Transition,{"enter-active-class":`show`,"leave-active-class":`remove`,css:unref(animationSettings).animate,onBeforeLeave:onBeforeHeaderLeave},{default:withCtx(()=>[__props.header?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-wrapper`,{"show-animate":canAnimate.value}])},[createVNode(TaskHeader_default,mergeProps(__props.header,{class:`header`}),null,16)],2)):createCommentVNode(``,!0)]),_:1},8,[`css`]),createBaseVNode(`div`,{class:`tasks-content`,ref_key:`tasksScroller`,ref:tasksScroller},[createVNode(TransitionGroup,{"enter-active-class":`show`,"leave-active-class":`remove`,css:unref(animationSettings).animate,onBeforeLeave,onBeforeEnter:onBeforeEnterTask},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(internalTasks.value,(task,index)=>(openBlock(),createElementBlock(`div`,{key:task.id,class:normalizeClass([`task-wrapper`,{"show-animate":canAnimate.value,"remove-animate":canAnimate.value}]),"data-id":index},[task.type===`message`?(openBlock(),createBlock(TaskMessage_default,mergeProps({key:0,ref_for:!0},task,{class:`task-card`}),null,16)):task.type===`goal`?(openBlock(),createBlock(TaskGoal_default,mergeProps({key:1,ref_for:!0},task,{class:[`task-card`,{glow:unref(animationSettings).animateNextTask&&nextTask.value&&nextTask.value.id===task.id}]}),null,16,[`class`])):createCommentVNode(``,!0)],10,_hoisted_1$222))),128))]),_:1},8,[`css`])],512)],2))}},TaskList_default=__plugin_vue_export_helper_default(_sfc_main$251,[[`__scopeId`,`data-v-5118e548`]]);const useTasksStore=defineStore(`tasks`,()=>{let header=ref(null),tasks=ref([]),{$game}=useLibStore();$game.events.on(`SetTasklistHeader`,setTasklistHeader),$game.events.on(`SetTasklistTask`,setTasklistTask),$game.events.on(`UpdateTasklistItem`,updateTasklistItem),$game.events.on(`SortTasklistItems`,sortTasklistItems),$game.events.on(`CompleteTasklistGoal`,id=>updateTasklistItem(id,{complete:!0,success:!0})),$game.events.on(`FailTasklistGoal`,id=>updateTasklistItem(id,{complete:!0,success:!1})),$game.events.on(`DiscardTasklistItem`,discardTasklistItem),$game.events.on(`HighlightTasklistItem`,highlightTasklistItem),$game.events.on(`HideCareerTasklist`,hideCareerTasklist),$game.events.on(`ClearTasklist`,clearTasklist);function setTasklistHeader(data){data==null||data==``?header.value=null:header.value={title:data.label,description:data.subtext}}function setTasklistTask(data){let id=data.id===null||data.id===void 0?`default`:data.id,index=tasks.value.findIndex(x=>x.id===id);if(index===-1&&data.clear)return;if(data.clear){tasks.value.splice(index,1);return}let isComplete=data.done!==void 0&&data.done||data.fail!==void 0&&data.fail,isSuccess=data.done!==void 0&&data.done||data.fail!==void 0&&!data.fail,description=data.subtext===0?``:data.subtext;index===-1?tasks.value.push({id:data.id,label:data.label,description,type:data.type,attention:data.attention,complete:isComplete,success:isSuccess}):(tasks.value[index].attention=data.attention,tasks.value[index].complete=isComplete,tasks.value[index].success=isSuccess,data.subtext!==void 0&&(tasks.value[index].description=description),data.label!==void 0&&(tasks.value[index].label=data.label),data.type!==void 0&&(tasks.value[index].type=data.type))}function updateTasklistItem(id,data){let index=tasks.value.findIndex(task=>task.id===id);index!==-1&&Object.keys(data).forEach(key=>{tasks.value[index][key]!==void 0&&(tasks.value[index][key]=data[key])})}function sortTasklistItems(order){let inOrderTasks=[],notInOrderTasks=[];tasks.value.forEach(task=>{order.includes(task.id)?inOrderTasks.push(task):notInOrderTasks.push(task)}),inOrderTasks.sort((a$1,b)=>order.indexOf(a$1.id)-order.indexOf(b.id)),tasks.value=[...inOrderTasks,...notInOrderTasks]}function discardTasklistItem(id,delay){delay!==void 0&&delay>0?setTimeout(()=>{setTasklistTask({id,clear:!0})},delay*1e3):setTasklistTask({id,clear:!0})}function highlightTasklistItem(id,duration){setTasklistTask({id,attention:!0}),duration!==void 0&&duration>0&&setTimeout(()=>{setTasklistTask({id,attention:!1})},duration*1e3)}function hideCareerTasklist(){}function clearTasklist(){header.value=null,tasks.value=[]}return{header,tasks,hasItems:computed(()=>tasks.value.length>0||header.value!==null)}});var _hoisted_1$221={class:`heading-container`},_hoisted_2$180={key:0,class:`status-add`},_hoisted_3$159={class:`content-container`},_hoisted_4$134={class:`main-content`},_hoisted_5$117={class:`main-content-slotted`},_hoisted_6$100={class:`side-content-slotted`},_sfc_main$250={__name:`ComputerWrapper`,props:{title:{type:String,default:`My Computer`},path:Array,wallpaperFull:Boolean,wallpaperHalf:Boolean,back:Boolean,close:Boolean},emits:[`back`,`close`],setup(__props,{expose:__expose,emit:__emit}){useUINavScope(`computer`);let{$game}=useLibStore(),computerStore=useComputerStore(),props=__props,breadcrumbItems=computed(()=>[{label:`Career`,closeAllMenus:!0},{label:computerStore.computerData.facilityName},...(props.path||[]).map(path=>({label:path}))]),elStatus=ref(),store$1=useTasksStore();provide(`animationSettings`,{animate:!0,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmptyIntervalDelay:.1,animateOnEmpty:!0,animateNextTask:!0,successCallback:playAudio});function playAudio(){$game.lua.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Checkbox`)}__expose({statusUpdate:()=>elStatus.value.updateDisplay()});function breadcrumbClick(item){item.closeAllMenus&&$game.lua.career_career.closeAllMenus()}let emit$1=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{"bng-ui-scope":`computer`,class:`computer-wrapper-layout`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$221,[createVNode(unref(bngScreenHeadingV2_default),{type:`2`},{preheadings:withCtx(()=>[createVNode(bngBreadcrumbs_default,{class:`breadcrumbs`,simple:``,"disable-last-item":``,"show-back-button":``,navigable:!1,onClick:breadcrumbClick,onBack:_cache[0]||=$event=>emit$1(`back`),items:breadcrumbItems.value},null,8,[`items`])]),default:withCtx(()=>[renderSlot(_ctx.$slots,`title`,{},()=>[createTextVNode(toDisplayString(__props.title),1)],!0)]),_:3}),withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default),{ref_key:`elStatus`,ref:elStatus},null,512),_ctx.$slots.status?(openBlock(),createElementBlock(`div`,_hoisted_2$180,[renderSlot(_ctx.$slots,`status`,{},void 0,!0)])):createCommentVNode(``,!0)]),_:3})),[[unref(BngBlur_default),!0]])]),createBaseVNode(`div`,_hoisted_3$159,[createBaseVNode(`div`,_hoisted_4$134,[createBaseVNode(`div`,_hoisted_5$117,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),createBaseVNode(`div`,_hoisted_6$100,[createVNode(unref(TaskList_default),{class:`task-list`,header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`]),renderSlot(_ctx.$slots,`side`,{},void 0,!0)])])])]),_:3})),[[unref(BngOnUiNav_default),()=>emit$1(`back`),`back`]])}},ComputerWrapper_default=__plugin_vue_export_helper_default(_sfc_main$250,[[`__scopeId`,`data-v-b7460ee1`]]),_hoisted_1$220={class:`indicators-overlay`},_hoisted_2$179={class:`performance-index`},_hoisted_3$158={key:0,class:`lock-reason`},_hoisted_4$133={key:1,class:`lock-time`},_hoisted_5$116={key:1,class:`valueReduced`},_hoisted_6$99={key:0,class:`content`},_hoisted_7$87={class:`header`},_hoisted_8$72={class:`title-section`},_hoisted_9$65={class:`name`},_hoisted_10$56={class:`details`},_hoisted_11$50={class:`location-section`},_hoisted_12$39={class:`location-value`},_hoisted_13$32={key:0,class:`value-section`},_hoisted_14$30={key:0,class:`value-label reduced`},_hoisted_15$29={key:1,class:`value-label`},_hoisted_16$29={key:2,class:`total-value`},_hoisted_17$23={class:`insurance-section`},_hoisted_18$20={class:`insurance-value`},_hoisted_19$17={key:0,class:`warn`},_sfc_main$249=Object.assign({width:100,margin:.25},{__name:`VehicleTileRow`,props:{data:Object,isTutorial:Boolean,selected:Boolean,enableHover:{type:Boolean,default:!0},small:Boolean},setup(__props){let{units}=useBridge(),props=__props,partConditionAvg=computed(()=>{if(!props.data)return 1;if(props.data.partConditions){let conds=Object.values(props.data.partConditions);return conds.reduce((i,c)=>i+c.integrityValue,0)/conds.length}return 1}),colour=computed(()=>props.data?.config?.paints?.[0]?.baseColor??`#ccc`),thumbUrl=computed(()=>props.data.thumbnail?`${props.data.thumbnail}?${props.data.dirtyDate}`:null),location$1=computed(()=>{let res;return res=locked.value&&!locked.value.location?locked.value.reason:props.data.inGarage?`In garage`:props.data.distance?`${units.buildString(`length`,props.data.distance,0)} away`:`Storage`,res}),locked=computed(()=>{let res;if(props.data._message)res={reason:props.data._message};else if(props.data.missingFile)res={reason:`Missing File!`};else if(props.data.timeToAccess){let eta=`${~~(props.data.timeToAccess/60)}:${String(~~props.data.timeToAccess%60).padStart(2,`0`)}`;res=props.data.delayReason===`bought`?{reason:`Out for delivery`,eta}:props.data.delayReason===`repair`?{reason:`Being repaired`,eta}:{reason:`Available in`,eta}}else props.data.needsRepair&&(res={reason:`Needs repair`,location:!0});return res});return(_ctx,_cache)=>__props.data?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass({"vehicle-tile-row":!0,selected:__props.selected,"hover-enabled":__props.enableHover}),role:`button`},[createBaseVNode(`div`,{class:normalizeClass({preview:!0,locked:locked.value,small:__props.small})},[thumbUrl.value?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,ratio:`16:9`,"external-image":thumbUrl.value,class:`preview-image`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$220,[__props.data.favorite?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).star,color:`#fd0`},null,8,[`type`])),[[unref(BngTooltip_default),`Favourite`]]):createCommentVNode(``,!0),__props.data.delayReason===`repair`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).wrench,color:`#fff`},null,8,[`type`])):(openBlock(),createBlock(unref(bngCondition_default),{key:2,integrity:partConditionAvg.value,"integrity-warning":__props.data.needsRepair,color:colour.value,"show-tooltip":``},null,8,[`integrity`,`integrity-warning`,`color`])),createBaseVNode(`div`,_hoisted_2$179,toDisplayString(__props.data.certificationData&&__props.data.certificationData.vehicleClass?__props.data.certificationData.vehicleClass.performanceIndex.toFixed(0):`N/A`),1)]),locked.value?(openBlock(),createElementBlock(`span`,_hoisted_3$158,toDisplayString(locked.value.reason),1)):createCommentVNode(``,!0),locked.value&&locked.value.eta?(openBlock(),createElementBlock(`span`,_hoisted_4$133,toDisplayString(locked.value.eta),1)):createCommentVNode(``,!0)]),_:1},8,[`external-image`])):createCommentVNode(``,!0),!(__props.data.returnLoanerPermission&&__props.data.returnLoanerPermission.allow)&&__props.data.partConditionAvg<1?(openBlock(),createElementBlock(`span`,_hoisted_5$116,`Value reduced!`)):createCommentVNode(``,!0),__props.data.isInsured?createCommentVNode(``,!0):(openBlock(),createBlock(insurancePerkIcon_default,{key:2,class:`not-insured-overlay`,perkIconData:{iconOnly:__props.data.isInsured,color:`red`,smallText:`Not insured`}},null,8,[`perkIconData`]))],2),__props.data._message?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$99,[createBaseVNode(`div`,_hoisted_7$87,[createBaseVNode(`div`,_hoisted_8$72,[createBaseVNode(`div`,_hoisted_9$65,toDisplayString(__props.data.niceName),1)])]),createBaseVNode(`div`,_hoisted_10$56,[createBaseVNode(`div`,_hoisted_11$50,[_cache[0]||=createBaseVNode(`span`,{class:`location-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_12$39,toDisplayString(location$1.value),1)]),__props.data.returnLoanerPermission?.allow?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_13$32,[partConditionAvg.value<1?(openBlock(),createElementBlock(`span`,_hoisted_14$30,`Current Value:`)):(openBlock(),createElementBlock(`span`,_hoisted_15$29,`Value:`)),createVNode(unref(bngUnit_default),{money:__props.data.value},null,8,[`money`]),partConditionAvg.value<1?(openBlock(),createElementBlock(`div`,_hoisted_16$29,[_cache[1]||=createTextVNode(` Total Value: `,-1),createVNode(unref(bngUnit_default),{money:__props.data.valueRepaired},null,8,[`money`])])):createCommentVNode(``,!0)])),createBaseVNode(`div`,_hoisted_17$23,[_cache[2]||=createBaseVNode(`span`,{class:`insurance-label`},`Insurance:`,-1),createBaseVNode(`span`,_hoisted_18$20,toDisplayString(__props.data.insuranceInfo?__props.data.insuranceInfo.name:`n/a`),1),__props.data.isInsured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$17,`Not Insured!`))])])]))],2)),[[unref(BngDisabled_default),__props.data.disabled]]):createCommentVNode(``,!0)}}),VehicleTileRow_default=__plugin_vue_export_helper_default(_sfc_main$249,[[`__scopeId`,`data-v-777a3003`]]),_hoisted_1$219={key:1,class:`computer-actions`},_hoisted_2$178={key:0,class:`vehicle-select-container`},_hoisted_3$157={class:`vehicle-select`},_hoisted_4$132={key:0,class:`actions-list`},_hoisted_5$115=[`onClick`,`onMouseover`,`onFocus`],_hoisted_6$98={class:`label`},_hoisted_7$86={key:1,class:`no-vehicle-container`},_hoisted_8$71={key:2,class:`action-header`},_hoisted_9$64={key:3,class:`general-functions-container`},_hoisted_10$55={class:`actions-list`},_hoisted_11$49=[`onClick`,`onMouseover`,`onFocus`],_hoisted_12$38={class:`label`},_hoisted_13$31={key:0,class:`disable-reason`},_hoisted_14$29=[`innerHTML`],_hoisted_15$28={key:1,class:`disable-reason`},_hoisted_16$28=[`innerHTML`],_sfc_main$248={__name:`ComputerMain`,setup(__props){let computerStore=useComputerStore(),currentVehicleData=ref(null);watch(()=>computerStore.activeInventoryId,newId=>{Number(newId)&&Lua_default.career_modules_inventory.getVehicleUiData(newId).then(data=>{currentVehicleData.value=data})});let showVehicleSelectorButtons=computed(()=>computerStore.computerData.vehicles&&computerStore.computerData.vehicles.length>1),hasVehicles=computed(()=>computerStore.computerData.vehicles&&computerStore.computerData.vehicles.length);computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].vehicleName:``),computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].thumbnail:``),computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].needsRepair?`Assess Performance (Repair Required)`:`Assess Performance`:``);let slowFunctions=[`vehicleShop`,`partInventory`],computerLoading=ref(!1),computerButtonCallback=(computerFunction,inventoryId=void 0)=>{computerFunction.disabled||(slowFunctions.includes(computerFunction.id)?(computerLoading.value=!0,setTimeout(()=>computerStore.computerButtonCallback(computerFunction.id,inventoryId),100)):computerStore.computerButtonCallback(computerFunction.id,inventoryId))},switchActiveVehicle=computerStore.switchActiveVehicle,iconById={painting:icons.sprayCan,partShop:icons.doorFrontCoins,repair:icons.wrench,tuning:icons.cogs,insurances:icons.shieldHandCheckmark,playerAbstract:icons.personSolid,vehicleInventory:icons.keys1,partInventory:icons.engine,vehicleShop:icons.carCoins,performanceIndex:icons.raceFlag},infoById=computed(()=>[...computerStore.generalComputerFunctions,...(computerStore.activeInventoryId?computerStore.vehicleSpecificComputerFunctions[computerStore.activeInventoryId]:void 0)||[]].reduce((res,func)=>(res[func.id]={icon:iconById[func.id]||icons.bug,label:func.label,reason:void 0},func.reason&&(res[func.id].label+=` *`,res[func.id].reason=func.reason.label),res),{})),isTutorialActive=ref(!1),disableReason=ref([null,null]),setReason=(idx,reason=null)=>{disableReason.value[idx]=reason,disableReason.value[(idx+1)%2]=null},close=()=>{computerLoading.value||Lua_default.career_career.closeAllMenus()};return onMounted(async()=>{getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar),computerStore.requestComputerData(),Number(computerStore.activeInventoryId)&&Lua_default.career_modules_inventory.getVehicleUiData(computerStore.activeInventoryId).then(data=>{currentVehicleData.value=data}),Lua_default.career_modules_linearTutorial.isLinearTutorialActive().then(data=>{isTutorialActive.value=data})}),onUnmounted(()=>{computerStore.onMenuClosed(),getUINavServiceInstance().clearFilteredEvents(),computerStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{title:unref(computerStore).computerData.facilityName+` - Home screen`,close:``,onBack:close},{default:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`card-content`},{default:withCtx(()=>[computerLoading.value?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Loading... `,-1)]]),_:1})):createCommentVNode(``,!0),computerLoading.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$219,[_cache[9]||=createBaseVNode(`div`,{class:`action-header`},[createBaseVNode(`div`,{class:`line left`}),createBaseVNode(`div`,{class:`title`},`Vehicle Management`),createBaseVNode(`div`,{class:`line right`})],-1),hasVehicles.value?(openBlock(),createElementBlock(`div`,_hoisted_2$178,[createBaseVNode(`div`,_hoisted_3$157,[showVehicleSelectorButtons.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,style:{height:`3em`},accent:unref(ACCENTS).ghost,onClick:_cache[0]||=$event=>unref(switchActiveVehicle)(-1),icon:unref(icons).arrowLargeLeft},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`tab_l`,deviceMask:`xinput`})]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`tab_l`,{asMouse:!0}]]):createCommentVNode(``,!0),createVNode(VehicleTileRow_default,{class:normalizeClass([`vehicle-tile-row`,{hasButtons:showVehicleSelectorButtons.value}]),data:currentVehicleData.value,enableHover:!1,small:!0},null,8,[`class`,`data`]),showVehicleSelectorButtons.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,style:{height:`3em`},accent:unref(ACCENTS).ghost,onClick:_cache[1]||=$event=>unref(switchActiveVehicle)(1),icon:unref(icons).arrowLargeRight},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`tab_r`,deviceMask:`xinput`})]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`tab_r`,{asMouse:!0}]]):createCommentVNode(``,!0)]),unref(computerStore).activeInventoryId&&unref(computerStore).vehicleSpecificComputerFunctions[unref(computerStore).activeInventoryId]?(openBlock(),createElementBlock(`div`,_hoisted_4$132,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(computerStore).vehicleSpecificComputerFunctions[unref(computerStore).activeInventoryId],(computerFunction,index)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`computer-function-tile`,{"action-disabled":computerFunction.disabled}]),key:computerFunction.id,tabindex:`0`,"bng-nav-item":``,onClick:$event=>computerButtonCallback(computerFunction,unref(computerStore).activeInventoryId),onMouseover:$event=>setReason(0,infoById.value[computerFunction.id].reason),onFocus:$event=>setReason(0,infoById.value[computerFunction.id].reason),onMouseleave:_cache[2]||=$event=>setReason(0),onBlur:_cache[3]||=$event=>setReason(0)},[createVNode(unref(bngIcon_default),{class:`icon`,type:infoById.value[computerFunction.id].icon},null,8,[`type`]),createBaseVNode(`span`,_hoisted_6$98,toDisplayString(infoById.value[computerFunction.id].label),1)],42,_hoisted_5$115)),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),index==0?0:void 0]])),128))])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_7$86,[..._cache[7]||=[createBaseVNode(`span`,null,`No vehicles in garage.`,-1),createBaseVNode(`p`,null,` Place a vehicle in your garage to access modify and manage it.`,-1)]])),unref(computerStore).generalComputerFunctions?(openBlock(),createElementBlock(`div`,_hoisted_8$71,[..._cache[8]||=[createBaseVNode(`div`,{class:`line left`},null,-1),createBaseVNode(`div`,{class:`title`},`General Computer Functions`,-1),createBaseVNode(`div`,{class:`line right`},null,-1)]])):createCommentVNode(``,!0),unref(computerStore).generalComputerFunctions?(openBlock(),createElementBlock(`div`,_hoisted_9$64,[createBaseVNode(`div`,_hoisted_10$55,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(computerStore).generalComputerFunctions,(computerFunction,index)=>(openBlock(),createElementBlock(Fragment,{key:computerFunction.id},[computerFunction.type?createCommentVNode(``,!0):withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`computer-function-tile`,{"action-disabled":computerFunction.disabled}]),tabindex:`0`,"bng-nav-item":``,onClick:$event=>computerButtonCallback(computerFunction),onMouseover:$event=>setReason(1,infoById.value[computerFunction.id].reason),onFocus:$event=>setReason(1,infoById.value[computerFunction.id].reason),onMouseleave:_cache[4]||=$event=>setReason(1),onBlur:_cache[5]||=$event=>setReason(1)},[createVNode(unref(bngIcon_default),{class:`icon`,type:infoById.value[computerFunction.id].icon},null,8,[`type`]),createBaseVNode(`span`,_hoisted_12$38,toDisplayString(infoById.value[computerFunction.id].label),1)],42,_hoisted_11$49)),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),!hasVehicles.value&&index==0?0:void 0]])],64))),128))]),disableReason.value[0]?(openBlock(),createElementBlock(`div`,_hoisted_13$31,[withDirectives(createVNode(unref(bngIcon_default),{class:`disable-icon`,type:unref(icons).info},null,8,[`type`]),[[vShow,disableReason.value[0]]]),createBaseVNode(`span`,{innerHTML:disableReason.value[0]||`\xA0`},null,8,_hoisted_14$29)])):createCommentVNode(``,!0),disableReason.value[1]?(openBlock(),createElementBlock(`div`,_hoisted_15$28,[createVNode(unref(bngIcon_default),{class:`disable-icon`,type:unref(icons).info},null,8,[`type`]),createBaseVNode(`span`,{innerHTML:disableReason.value[1]||`\xA0`},null,8,_hoisted_16$28)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]))]),_:1})),[[unref(BngBlur_default),1]])]),_:1},8,[`title`]))}},ComputerMain_default=__plugin_vue_export_helper_default(_sfc_main$248,[[`__scopeId`,`data-v-10a4ce58`]]);const useInsurancesStore=defineStore(`insurances`,()=>{let{events:events$3}=useBridge(),invVehsInsurancesData=ref({}),plClassesData=ref({}),uninsuredVehsData=ref({}),driverScoreData=ref({});function requestInitialData(){Lua_default.career_modules_insurance_insurance.sendUIData()}return events$3.on(`insurancesData`,data=>{invVehsInsurancesData.value=data.invVehsInsurancesData,plClassesData.value=data.plClassesData,uninsuredVehsData.value=data.uninsuredVehsData,driverScoreData.value=data.driverScoreData}),{dispose:()=>{events$3.off(`insurancesData`)},requestInitialData,closeMenu:Lua_default.career_modules_insurance_insurance.closeMenu,invVehsInsurancesData,plClassesData,uninsuredVehsData,driverScoreData}});var _hoisted_1$218={key:0,class:`cards-wrapper blue-background`},_hoisted_2$177={class:`insurance-tiers-wrapper`},_hoisted_3$156=[`onClick`],_hoisted_4$131={class:`insurance-tier-card-name`},_hoisted_5$114={class:`insurance-tier-card-description`},_hoisted_6$97={class:`insurance-tier-card-cars-insured`},_hoisted_7$85={class:`left-no-insurance`},_hoisted_8$70={class:`no-insurance-text-wrapper`},_hoisted_9$63={class:`no-insurance-title`},_hoisted_10$54={class:`no-insurance-description`},_hoisted_11$48={class:`uninsured-count`},_hoisted_12$37={key:1,class:`small-insurance-cards-wrapper blue-background`},_sfc_main$247={__name:`InsurancesMain`,setup(__props){useComputerStore();let insurancesStore=useInsurancesStore(),selectedInsuranceClassId=ref(null),selectInsuranceClass=classId=>{selectedInsuranceClassId.value=classId},sortedInsuranceClasses=computed(()=>{let classes=insurancesStore.plClassesData;return classes?Object.entries(classes).map(([classId,classData])=>({classId,classData})).sort((a$1,b)=>a$1.classData.priority-b.classData.priority):[]});onBeforeMount(()=>{insurancesStore.requestInitialData()}),onUnmounted(()=>{Lua_default.extensions.hook(`onExitInsurancesComputerScreen`),insurancesStore.$dispose()});let close=()=>{selectedInsuranceClassId.value?selectedInsuranceClassId.value=null:insurancesStore.closeMenu()},openUninsuredVehicles=()=>{addPopup(uninsuredVehicles_default,{uninsuredData:insurancesStore.uninsuredVehsData})};return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,path:[`Insurance`],title:`Insurance`,back:``,onBack:close},{default:withCtx(()=>[createVNode(unref(bngCard_default),{class:`insurances-card blue-background`},{default:withCtx(()=>[selectedInsuranceClassId.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$218,[createBaseVNode(`div`,_hoisted_2$177,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedInsuranceClasses.value,({classId,classData})=>(openBlock(),createElementBlock(`div`,{class:`insurance-tier-card`,key:classId,onClick:$event=>selectInsuranceClass(classId)},[createVNode(unref(bngIcon_default),{class:`insurance-icon`,type:unref(icons)[classData.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_4$131,toDisplayString(classData.name),1),createBaseVNode(`div`,_hoisted_5$114,toDisplayString(classData.description),1),createBaseVNode(`div`,_hoisted_6$97,toDisplayString(classData.carsInsured)+` VEHICLES INSURED `,1)],8,_hoisted_3$156))),128))]),createBaseVNode(`div`,{class:`no-insurance-card`,onClick:openUninsuredVehicles},[createBaseVNode(`div`,_hoisted_7$85,[createVNode(unref(bngIcon_default),{class:`no-insurance-icon`,type:unref(icons).checkmark},null,8,[`type`]),createBaseVNode(`div`,_hoisted_8$70,[createBaseVNode(`div`,_hoisted_9$63,toDisplayString(unref(insurancesStore).uninsuredVehsData.title),1),createBaseVNode(`div`,_hoisted_10$54,toDisplayString(unref(insurancesStore).uninsuredVehsData.description),1)])]),createBaseVNode(`div`,_hoisted_11$48,toDisplayString(unref(insurancesStore).uninsuredVehsData.carsUninsuredCount)+` vehicles `,1)])])),selectedInsuranceClassId.value?(openBlock(),createElementBlock(`div`,_hoisted_12$37,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(insurancesStore).plClassesData[selectedInsuranceClassId.value].insurances,insurance=>(openBlock(),createBlock(unref(smallInsuranceCard_default),{key:insurance.id,insuranceData:insurance,driverScoreData:unref(insurancesStore).driverScoreData},null,8,[`insuranceData`,`driverScoreData`]))),128))])):createCommentVNode(``,!0)]),_:1})]),_:1},512))}},InsurancesMain_default=__plugin_vue_export_helper_default(_sfc_main$247,[[`__scopeId`,`data-v-a9e49ad5`]]),_hoisted_1$217={key:0,class:`content`},_hoisted_2$176={class:`stats-grid-3`},_hoisted_3$155={class:`score-header`},_hoisted_4$130={class:`score-content`},_hoisted_5$113={class:`score-info`},_hoisted_6$96={class:`score-description`},_hoisted_7$84={class:`stat-card`},_hoisted_8$69={class:`stat-value blue`},_hoisted_9$62={class:`stat-card`},_hoisted_10$53={class:`stats-grid-2`},_hoisted_11$47={class:`info-card`},_hoisted_12$36={class:`info-rows`},_hoisted_13$30={class:`info-row`},_hoisted_14$28={class:`info-value orange`},_hoisted_15$27={class:`info-row`},_hoisted_16$27={class:`info-value green`},_hoisted_17$22={class:`info-row total`},_hoisted_18$19={class:`info-value`},_hoisted_19$16={class:`info-card`},_hoisted_20$14={class:`info-rows`},_hoisted_21$13={class:`info-row bottom-border`},_hoisted_22$11={class:`info-value blue`},_hoisted_23$10={class:`info-row`},_hoisted_24$9={class:`info-value red`},_hoisted_25$8={class:`info-row`},_hoisted_26$6={class:`info-value orange`},_hoisted_27$6={class:`info-row`},_hoisted_28$5={class:`info-value yellow`},_hoisted_29$5={class:`info-row total`},_hoisted_30$5={class:`info-value`},_hoisted_31$5={class:`info-summary`},_hoisted_32$5={class:`info-row small`},_hoisted_33$5={class:`info-value green bold`},_hoisted_34$5={class:`reset-card`},_hoisted_35$4={class:`reset-content`},_hoisted_36$4={class:`reset-description`},_hoisted_37$3={class:`highlight`},_hoisted_38$3={class:`reset-details`},_hoisted_39$3={class:`reset-row`},_hoisted_40$2={class:`reset-row`},_hoisted_41$2={class:`reset-value green`},_hoisted_42$2={class:`reset-row cost`},_hoisted_43$2={class:`reset-value yellow large`},_hoisted_44$2={key:0,class:`reset-payback`},_hoisted_45$2=[`disabled`],_sfc_main$246={__name:`DriverAbstract`,setup(__props){let{units}=useBridge(),abstractData=ref(null),driverTier=computed(()=>abstractData.value?.driverScoreTier),totalDistanceFormatted=computed(()=>abstractData.value?units.buildString(`length`,abstractData.value.totalDistanceDriven,0):``),premiumEffectClass=computed(()=>{if(!driverTier.value)return``;let multiplier=driverTier.value.multiplier;return multiplier<1?`green`:multiplier>1?`red`:`neutral`}),premiumEffectText=computed(()=>{if(!driverTier.value)return`Standard Rate`;let multiplier=driverTier.value.multiplier;return multiplier<1?`${Math.round((1-multiplier)*100)}% Savings`:multiplier>1?`${Math.round((multiplier-1)*100)}% Penalty`:`Standard Rate`}),canResetScore=computed(()=>abstractData.value?abstractData.value.driverScore{if(!driverTier.value)return`green`;let multiplier=driverTier.value.multiplier;return multiplier<1?`blue`:multiplier<1.1?`green`:multiplier<1.3?`yellow`:multiplier<1.5?`orange`:`red`},getDriverColor=()=>({blue:`var(--blue-200)`,green:`var(--green-300)`,yellow:`var(--yellow-400)`,orange:`var(--orange-shade-10)`,red:`var(--red-400)`})[getDriverColorClass()]||`var(--green-300)`,loadData=async()=>{try{abstractData.value=await Lua_default.career_modules_playerAbstract.getPlayerAbstractData()}catch(error){console.error(`Failed to load driver abstract data:`,error)}},resetDriverScore=async()=>{try{await Lua_default.career_modules_insurance_insurance.resetDriverScore(),await loadData()}catch(error){console.error(`Failed to reset driver score:`,error)}},close=()=>{Lua_default.career_modules_playerAbstract.closePlayerAbstractMenu()};return onBeforeMount(loadData),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,path:[`Driver's Abstract`],title:`Driver's Abstract`,back:``,onBack:close},{default:withCtx(()=>[createVNode(unref(bngCard_default),{class:`driver-abstract-card`},{default:withCtx(()=>[abstractData.value?(openBlock(),createElementBlock(`div`,_hoisted_1$217,[createBaseVNode(`div`,_hoisted_2$176,[createBaseVNode(`div`,{class:`score-card`,style:normalizeStyle({borderColor:getDriverColor()})},[createBaseVNode(`div`,_hoisted_3$155,[_cache[0]||=createBaseVNode(`div`,{class:`section-title`},`Driver Score: Out of 100`,-1),createVNode(unref(TutorialButton_default),{icon:unref(icons).help,pages:[`driverScore`]},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_4$130,[createBaseVNode(`div`,{class:normalizeClass([`score-value`,getDriverColorClass()])},toDisplayString(abstractData.value.driverScore),3),createBaseVNode(`div`,_hoisted_5$113,[createBaseVNode(`div`,{class:normalizeClass([`score-risk`,getDriverColorClass()])},toDisplayString(abstractData.value.driverScoreTier.risk),3),createBaseVNode(`div`,_hoisted_6$96,toDisplayString(abstractData.value.driverScoreTier.description),1)])])],4),createBaseVNode(`div`,_hoisted_7$84,[_cache[1]||=createBaseVNode(`div`,{class:`section-title`},`Total Distance Driven`,-1),createBaseVNode(`div`,_hoisted_8$69,toDisplayString(totalDistanceFormatted.value),1)]),createBaseVNode(`div`,_hoisted_9$62,[_cache[2]||=createBaseVNode(`div`,{class:`section-title`},`Premium Effect`,-1),createBaseVNode(`div`,{class:normalizeClass([`stat-value`,premiumEffectClass.value])},toDisplayString(premiumEffectText.value),3),_cache[3]||=createBaseVNode(`div`,{class:`stat-note`},` Applies to every insurance provider when premiums renew `,-1)])]),createBaseVNode(`div`,_hoisted_10$53,[createBaseVNode(`div`,_hoisted_11$47,[_cache[7]||=createBaseVNode(`div`,{class:`section-title`},`Repair History`,-1),createBaseVNode(`div`,_hoisted_12$36,[createBaseVNode(`div`,_hoisted_13$30,[_cache[4]||=createBaseVNode(`span`,{class:`info-label`},`Insurance Claims:`,-1),createBaseVNode(`span`,_hoisted_14$28,toDisplayString(abstractData.value.repairHistory.insuranceRepairs),1)]),createBaseVNode(`div`,_hoisted_15$27,[_cache[5]||=createBaseVNode(`span`,{class:`info-label`},`Private Repairs:`,-1),createBaseVNode(`span`,_hoisted_16$27,toDisplayString(abstractData.value.repairHistory.privateRepairs),1)]),createBaseVNode(`div`,_hoisted_17$22,[_cache[6]||=createBaseVNode(`span`,{class:`info-label`},`Total Repairs:`,-1),createBaseVNode(`span`,_hoisted_18$19,toDisplayString(abstractData.value.repairHistory.insuranceRepairs+abstractData.value.repairHistory.privateRepairs),1)])]),_cache[8]||=createBaseVNode(`div`,{class:`info-tip`},` Private repairs don't affect your record `,-1)]),createBaseVNode(`div`,_hoisted_19$16,[_cache[16]||=createBaseVNode(`div`,{class:`section-title`},`Financial Summary`,-1),createBaseVNode(`div`,_hoisted_20$14,[createBaseVNode(`div`,_hoisted_21$13,[_cache[9]||=createBaseVNode(`span`,{class:`info-label`},`Vehicles Currently Insured:`,-1),createBaseVNode(`span`,_hoisted_22$11,toDisplayString(abstractData.value.financialSummary.vehiclesInsuredCount),1)]),createBaseVNode(`div`,_hoisted_23$10,[_cache[10]||=createBaseVNode(`span`,{class:`info-label`},`Premiums Paid:`,-1),createBaseVNode(`span`,_hoisted_24$9,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPremiumPaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_25$8,[_cache[11]||=createBaseVNode(`span`,{class:`info-label`},`Deductibles Paid:`,-1),createBaseVNode(`span`,_hoisted_26$6,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalDeductiblePaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_27$6,[_cache[12]||=createBaseVNode(`span`,{class:`info-label`},`Private Repairs:`,-1),createBaseVNode(`span`,_hoisted_28$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPrivateRepairsPaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_29$5,[_cache[13]||=createBaseVNode(`span`,{class:`info-label`},`Total Spent:`,-1),createBaseVNode(`span`,_hoisted_30$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPaid},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_31$5,[createBaseVNode(`div`,_hoisted_32$5,[_cache[14]||=createBaseVNode(`span`,{class:`info-label`},`Damage Covered by Insurance:`,-1),createBaseVNode(`span`,_hoisted_33$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.damageCoveredByInsurance},null,8,[`money`])])]),_cache[15]||=createBaseVNode(`div`,{class:`info-tip blue italic`},` Insurance saved you from paying full repair costs `,-1)])])]),createBaseVNode(`div`,_hoisted_34$5,[_cache[22]||=createBaseVNode(`div`,{class:`section-title`},`Driver Score Reset`,-1),createBaseVNode(`div`,_hoisted_35$4,[createBaseVNode(`p`,_hoisted_36$4,[_cache[17]||=createTextVNode(` Reset your driver score to `,-1),createBaseVNode(`span`,_hoisted_37$3,toDisplayString(abstractData.value.driverScoreReset.resetTo),1),_cache[18]||=createTextVNode(` to remove premium penalties. `,-1)]),createBaseVNode(`div`,_hoisted_38$3,[createBaseVNode(`div`,_hoisted_39$3,[_cache[19]||=createBaseVNode(`span`,{class:`reset-label`},`Current Score:`,-1),createBaseVNode(`span`,{class:normalizeClass([`reset-value`,canResetScore.value?`red`:`green`])},toDisplayString(abstractData.value.driverScore),3)]),createBaseVNode(`div`,_hoisted_40$2,[_cache[20]||=createBaseVNode(`span`,{class:`reset-label`},`Reset To:`,-1),createBaseVNode(`span`,_hoisted_41$2,toDisplayString(abstractData.value.driverScoreReset.resetTo),1)]),createBaseVNode(`div`,_hoisted_42$2,[_cache[21]||=createBaseVNode(`span`,{class:`reset-label`},`Reset Cost:`,-1),createBaseVNode(`span`,_hoisted_43$2,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.driverScoreReset.resetCost},null,8,[`money`])])]),canResetScore.value&&_ctx.resetSavingsPer100km>0?(openBlock(),createElementBlock(`div`,_hoisted_44$2,` Pays for itself after xxx km `)):createCommentVNode(``,!0)]),createBaseVNode(`button`,{onClick:resetDriverScore,disabled:!canResetScore.value,class:normalizeClass([`reset-button`,{disabled:!canResetScore.value}])},toDisplayString(canResetScore.value?`Reset Score`:`Not Available (Score Already at or Higher than `+abstractData.value.driverScoreReset.resetTo+`)`),11,_hoisted_45$2)])])])):createCommentVNode(``,!0)]),_:1})]),_:1},512))}},DriverAbstract_default=__plugin_vue_export_helper_default(_sfc_main$246,[[`__scopeId`,`data-v-8041df87`]]),_hoisted_1$216={"bng-ui-scope":`logbook`,class:`career-logbook-wrapper`},_hoisted_2$175={class:`career-logbook-container`},_hoisted_3$154={class:`career-logbook-list`},_hoisted_4$129={class:`logbook-list-wrapper`},_hoisted_5$112=[`onClick`],_hoisted_6$95={class:`career-logbook-item-content`},_hoisted_7$83={class:`career-logbook-meta`},_hoisted_8$68={class:`career-logbook-newmark`},_hoisted_9$61={class:`career-logbook-item-label`},_hoisted_10$52={class:`career-logbook-details`},_hoisted_11$46={class:`career-logbook-title-newmark`},_hoisted_12$35={class:`career-logbook-meta`},_hoisted_13$29={key:0},_hoisted_14$27={class:`logbook-description`},_hoisted_15$26={key:1,class:`logbook-description logbook-table`},_hoisted_16$26={key:2},_hoisted_17$21={key:3,class:`logbook-description quest-status`},_hoisted_18$18={class:`quest-stats-wrapper`},_hoisted_19$15={class:`quest-labels`},_hoisted_20$13={class:`progress-label`},_hoisted_21$12={key:0,class:`progressbar-background`},_hoisted_22$10={class:`rewards-wrapper flex-row`},_hoisted_23$9={class:`label`},_hoisted_24$8={class:`rewards-section flex-row`},_hoisted_25$7={class:`flex-row`},_sfc_main$245={__name:`Logbook`,props:{id:String},setup(__props){useUINavScope(`logbook`);let rewardUnitTypes={money:`beambucks`,beamXP:`xp`},props=__props,sectionTabs=ref(),entryId=computed(()=>props.id===void 0?void 0:(``+props.id).replace(/%/g,`/`)),logbookTabs=ref([{id:`info`,name:`Info`,entries:[],filter:i=>i.type===`info`},{id:`history`,name:`History`,entries:[],filter:i=>i.type===`progress`}]),checkForNewLogEntries=()=>logbookTabs.value.forEach(tab=>tab.hasNew=!!tab.entries.some(i=>i.isNew));function setup$3(data){if(data.forEach(entry=>{Object.hasOwn(entry,`text`)&&(entry.text=parse$1($translate.contextTranslate(entry.text,!0)),entry._ready=!0)}),logbookTabs.value.forEach(tab=>tab.entries=data.filter(tab.filter)),checkForNewLogEntries(),entryId.value){for(let tab of logbookTabs.value)for(let entry of tab.entries)if(``+entry.entryId===entryId.value){toggleExpand(entry),tab.isPreselected=!0;return}}logbookTabs.value[0].entries.length&&toggleExpand(logbookTabs.value[0].entries[0])}ref({});let selectedEntry=ref({});ref({});let readTimer,toggleExpand=entry=>setTimeout(()=>{readTimer&&clearTimeout(readTimer),selectedEntry.value=entry,readTimer=window.setTimeout(()=>{selectedEntry.value.isNew=!1,checkForNewLogEntries(),entry.type===`quest`?Lua_default.career_modules_questManager.setQuestAsNotNew(entry.questId):Lua_default.career_modules_logbook.setLogbookEntryRead(entry.entryId,!0)},1e3)},0),tabChange=newTab=>{if(entryId.value){entryId.value=void 0;return}let tab=logbookTabs.value[newTab.id];!tab||!tab.entries||tab.entries.length===0||toggleExpand(tab.entries[0])},claimRewards=entry=>{Lua_default.career_modules_questManager.claimRewardsById(entry.questId),entry.claimable=!1,entry.claimed=!0},exit=()=>setTimeout(()=>window.bngVue.gotoAngularState(`menu.careerPause`),0);return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`logbook`)}),onMounted(()=>{Lua_default.career_modules_logbook.getLogbook().then(setup$3)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`logbook`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`logbook-layout`},{default:withCtx(()=>[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.subHeading`)),1)]),_:1}),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$216,[createBaseVNode(`div`,_hoisted_2$175,[createBaseVNode(`div`,_hoisted_3$154,[createVNode(unref(tabs_default),{ref_key:`sectionTabs`,ref:sectionTabs,onChange:tabChange,class:`bng-tabs`,"make-tab-header-classes":tabDetails=>({flagged:tabDetails.data.hasNew})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(logbookTabs.value,tabDetail=>(openBlock(),createBlock(unref(tab_default),{key:tabDetail.id,heading:_ctx.$t(tabDetail.name),active:tabDetail.isPreselected,data:tabDetail},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$129,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tabDetail.entries,(entry,index)=>withDirectives((openBlock(),createElementBlock(`div`,{key:entry.entryId,"bng-nav-item":``,class:normalizeClass([`career-logbook-item`,{selected:selectedEntry.value!==void 0&&selectedEntry.value.entryId==entry.entryId}]),onClick:$event=>toggleExpand(entry)},[createBaseVNode(`div`,_hoisted_6$95,[createBaseVNode(`div`,_hoisted_7$83,[createBaseVNode(`div`,null,toDisplayString(_ctx.$ctx_t(entry.cardTypeLabel)),1),createVNode(unref(bngDivider_default),{class:`vertical-divider`}),withDirectives(createBaseVNode(`div`,null,null,512),[[unref(BngRelativeTime_default),entry.time]]),withDirectives(createBaseVNode(`div`,_hoisted_8$68,null,512),[[vShow,entry.isNew]])]),createBaseVNode(`div`,_hoisted_9$61,toDisplayString(_ctx.$ctx_t(entry.title)),1)])],10,_hoisted_5$112)),[[unref(BngUiNavFocus_default),tabDetail.entries.length-index],[unref(BngSoundClass_default),`bng_click_generic_small`]])),128))])),[[unref(BngUiNavScroll_default)]])]),_:2},1032,[`heading`,`active`,`data`]))),128))]),_:1},8,[`make-tab-header-classes`])]),createBaseVNode(`div`,_hoisted_10$52,[withDirectives(createVNode(unref(bngCard_default),{class:`career-logbook-content-card`},createSlots({default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`logbook-entry-heading`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(selectedEntry.value&&_ctx.$ctx_t(selectedEntry.value.title))+` `,1),withDirectives(createBaseVNode(`div`,_hoisted_11$46,null,512),[[vShow,selectedEntry.value.isNew]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`exitButton`,onClick:exit,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),_cache[1]||=createTextVNode(`Back`,-1)]),_:1},8,[`accent`])),[[unref(BngSoundClass_default),`bng_back_generic`]])]),_:1}),createBaseVNode(`div`,_hoisted_12$35,[createBaseVNode(`div`,null,toDisplayString(_ctx.$ctx_t(selectedEntry.value.cardTypeLabel)),1),createVNode(unref(bngDivider_default),{class:`vertical-divider`}),withDirectives(createBaseVNode(`div`,null,null,512),[[unref(BngRelativeTime_default),selectedEntry.value.time]])]),createBaseVNode(`div`,{class:normalizeClass({"card-body":!0,"with-rewards":selectedEntry.value.type===`quest`&&selectedEntry.value.rewards.length})},[selectedEntry.value.cover?(openBlock(),createElementBlock(`div`,{key:0,class:`logbook-cover-image`,style:normalizeStyle({backgroundImage:`url(${selectedEntry.value.cover})`})},[selectedEntry.value.coverText?(openBlock(),createElementBlock(`h1`,_hoisted_13$29,toDisplayString(selectedEntry.value.coverText),1)):createCommentVNode(``,!0)],4)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$27,[selectedEntry.value._ready?(openBlock(),createBlock(unref(dynamicComponent_default),{key:0,template:_ctx.$ctx_t(selectedEntry.value.text)},null,8,[`template`])):createCommentVNode(``,!0)]),selectedEntry.value.tables?(openBlock(),createElementBlock(`div`,_hoisted_15$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.tables,(table,keyT)=>(openBlock(),createElementBlock(`table`,{key:keyT},[createBaseVNode(`tbody`,null,[createBaseVNode(`tr`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(table.headers,(header,keyH)=>(openBlock(),createElementBlock(`th`,{key:keyH},toDisplayString(header),1))),128))]),(openBlock(!0),createElementBlock(Fragment,null,renderList(table.rows,(row,keyR)=>(openBlock(),createElementBlock(`tr`,{key:keyR},[(openBlock(!0),createElementBlock(Fragment,null,renderList(row,(data,keyD)=>(openBlock(),createElementBlock(`td`,{key:keyD},[typeof data==`object`&&data&&data.hasOwnProperty(`type`)&&data.type===`rewards`?(openBlock(),createBlock(RewardsPills_default,{key:0,rewards:data.rewards,hideNumbers:!1},null,8,[`rewards`])):(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:_ctx.$ctx_t(data)},null,8,[`template`]))]))),128))]))),128))])]))),128))])):createCommentVNode(``,!0),selectedEntry.value.type===`quest`?(openBlock(),createElementBlock(`hr`,_hoisted_16$26)):createCommentVNode(``,!0),selectedEntry.value.type===`quest`?(openBlock(),createElementBlock(`div`,_hoisted_17$21,[_cache[2]||=createBaseVNode(`h4`,null,`Milestone Status`,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.progress,prog=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,_hoisted_18$18,[createBaseVNode(`div`,_hoisted_19$15,[prog.done?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`check-icon`,type:prog.failed?unref(icons).missionCheckboxCross:prog.done?unref(icons).checkboxOn:unref(icons).checkboxOff},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_20$13,toDisplayString(_ctx.$ctx_t(prog.label)),1)]),prog.type===`progressBar`?(openBlock(),createElementBlock(`div`,_hoisted_21$12,[createBaseVNode(`div`,{class:`progressbar-fill`,style:normalizeStyle({width:(prog.currValue>0?prog.currValue/(prog.maxValue-prog.minValue)*100:0)+`%`})},null,4)])):createCommentVNode(``,!0)])]))),256))])):createCommentVNode(``,!0)],2)]),_:2},[selectedEntry.value.type===`quest`&&selectedEntry.value.rewards.length?{name:`footer`,fn:withCtx(()=>[createBaseVNode(`div`,_hoisted_22$10,[createBaseVNode(`div`,_hoisted_23$9,toDisplayString(_ctx.$t(`ui.career.logbook.rewards`))+`:`,1),createBaseVNode(`div`,_hoisted_24$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.rewards,reward=>(openBlock(),createElementBlock(`div`,_hoisted_25$7,[createVNode(unref(bngUnit_default),mergeProps({class:`reward-icon`},{ref_for:!0},{[rewardUnitTypes[reward.attributeKey]]:reward.rewardAmount},{options:{formatter:x=>~~x}}),null,16,[`options`])]))),256))]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:_cache[0]||=$event=>claimRewards(selectedEntry.value),disabled:!selectedEntry.value.claimable},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.claimRewards`)),1)]),_:1},8,[`disabled`])),[[vShow,!selectedEntry.value.claimed],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{disabled:!0},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.rewardsClaimed`)),1)]),_:1},512),[[vShow,selectedEntry.value.claimed]])])]),key:`0`}:void 0]),1536),[[vShow,selectedEntry.value!==void 0]])])])])),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngOnUiNav_default),sectionTabs.value&§ionTabs.value.goPrev,`tab_l`],[unref(BngOnUiNav_default),sectionTabs.value&§ionTabs.value.goNext,`tab_r`]])]),_:1})),[[unref(BngBlur_default)]])}},Logbook_default=__plugin_vue_export_helper_default(_sfc_main$245,[[`__scopeId`,`data-v-e8139034`]]),_hoisted_1$215={class:`milestones-wrapper`},_hoisted_2$174={"bng-ui-scope":`milestones`,class:`career-milestones-card`},_hoisted_3$153={class:`career-milestones-container`},_hoisted_4$128={class:`actions`},_hoisted_5$111={class:`filters`},_hoisted_6$94={class:`scrollable-container`,"bng-nav-scroll-force":``},_hoisted_7$82={class:`cards-container`},_sfc_main$244={__name:`Milestones`,props:{id:String},setup(__props){useUINavScope(`milestones`);let careerStatusRef=ref(),allEntries=[],entries=ref([]),selectOneFilters=ref(),selectedFilters=ref([`general`]),FILTER_OPTIONS=[{value:`general`,label:`General`},{value:`all`,label:`All`},{value:`mission`,label:`Challenges`},{value:`branch`,label:`Branches`},{value:`delivery`,label:`Delivery`},{value:`money`,label:`Money`},{value:`speedTrap`,label:`Speed Traps`},{value:`insurance`,label:`Insurance`}];function sortMilestones(){entries.value.sort(function(a$1,b){return a$1.claimable&&!b.claimable?-1:b.claimable&&!a$1.claimable?1:!a$1.completed&&b.completed?-1:a$1.completed&&!b.completed?1:a$1.claimId!0):entries.value=allEntries.filter(e=>e.filter[currentFilter]),sortMilestones()}function filterChanged(filterList){filterList&&(currentFilter=filterList[0]),filterEntries()}function setup$3(data){allEntries=data.list;let hasClaimable=!1;data.list.forEach(x=>{x.claimable&&(hasClaimable=!0)}),hasClaimable&&(selectedFilters.value=[`all`],filterChanged(selectedFilters.value)),filterEntries()}Lua_default.career_modules_milestones_milestones.getMilestones().then(setup$3);let claimMilestone=entry=>{Lua_default.career_modules_milestones_milestones.claim(entry.claimId).then(replacementEntry=>{careerStatusRef.value.updateDisplay();let replacementId=allEntries.findIndex(item=>item.claimId===entry.claimId);if(replacementEntry!=null&&replacementId!==-1){allEntries[replacementId]=replacementEntry,filterEntries();return}allEntries[replacementId].claimable=!1,filterEntries()})},exit=()=>{window.bngVue.gotoGameState(`progressLanding`)};return onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`milestones`)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`milestones`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`milestones-layout`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$215,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Milestones`,-1)]]),_:1}),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$174,[createBaseVNode(`div`,_hoisted_3$153,[createBaseVNode(`div`,_hoisted_4$128,[createVNode(unref(bngButton_default),{class:`exitButton`,onClick:exit,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{tabindex:`1`,"ui-event":`back`,deviceMask:`xinput`}),_cache[2]||=createTextVNode(`Back`,-1)]),_:1},8,[`accent`]),createVNode(unref(careerStatus_default),{class:`career-page-status`,ref_key:`careerStatusRef`,ref:careerStatusRef},null,512)]),createBaseVNode(`div`,_hoisted_5$111,[createVNode(unref(bngIcon_default),{class:`career-filter-icon`,type:unref(icons).filter},null,8,[`type`]),createVNode(unref(bngPillFilters_default),{required:``,ref_key:`selectOneFilters`,ref:selectOneFilters,modelValue:selectedFilters.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedFilters.value=$event,options:FILTER_OPTIONS,onValueChanged:filterChanged},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_6$94,[createBaseVNode(`div`,_hoisted_7$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(entries.value,entry=>withDirectives((openBlock(),createBlock(MilestoneCard_default,{tabindex:`1`,milestone:entry,isCondensed:!1,onClaim:claimMilestone},null,8,[`milestone`])),[[unref(BngSoundClass_default),entry.claimable?`bng_click_hover_generic`:`bng_hover_generic`]])),256))])])])])),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngOnUiNav_default),selectOneFilters.value&&selectOneFilters.value.focusPrevious,`tab_l`],[unref(BngOnUiNav_default),selectOneFilters.value&&selectOneFilters.value.focusNext,`tab_r`]])])]),_:1})),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngBlur_default)]])}},Milestones_default=__plugin_vue_export_helper_default(_sfc_main$244,[[`__scopeId`,`data-v-798d8c2a`]]),_hoisted_1$214={class:`panel-flex`},_hoisted_2$173={style:{"overflow-y":`scroll`}},_hoisted_3$152={class:`content-row selected-and-map-panel`},_hoisted_4$127={key:0,class:`content`},TAB_HEADINGS={parcels:`Parcels`,smallFluids:`Fluid Orders`,largeFluids:`Fluid Custom`,smallDryBulk:`Dry Bulk Orders`,largeDryBulk:`Dry Bulk Custom`,vehicles:`Vehicles`,trailers:`Trailers`,loaners:`Loaners`},_sfc_main$243={__name:`MyCargo`,props:{facilityId:String,parkingSpotPath:String},setup(__props){ref(3),ref(1);let{events:events$3}=useBridge();useUINavScope(`myCargo`);let props=__props;ref(null),ref(),ref(TAB_HEADINGS.parcels),ref(),ref();let cargoOverviewStore=useCargoOverviewStore(),updateCargoDataAll=()=>{cargoOverviewStore.requestCargoData(props.facilityId,props.parkingSpotPath)},close=()=>{Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen()};return events$3.on(`updateCargoData`,updateCargoDataAll),onMounted(()=>{Lua_default.career_modules_delivery_cargoScreen.setCargoScreenTab(`all`),updateCargoDataAll()}),onUnmounted(()=>{cargoOverviewStore.menuClosed(),events$3.off(`updateCargoData`,updateCargoDataAll)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[_cache[22]||=createBaseVNode(`div`,{style:{color:`white`}},`#Hello`,-1),unref(cargoOverviewStore).cargoData?(openBlock(),createBlock(ComputerWrapper_default,{key:0,path:[`My Cargo`],title:`My Cargo 2`,back:``,onBack:close},{status:withCtx(()=>[..._cache[10]||=[createTextVNode(` Delivery Lvl 2 | Car Jockey Lvl 3 | Facility Reputation: Good `,-1)]]),top:withCtx(()=>[..._cache[11]||=[createBaseVNode(`div`,{style:{width:`100%`,padding:`0.3em`,background:`#8888ff`}},` FILTERTABS `,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$214,[createVNode(unref(bngCard_default),{class:`content-row provided-orders-panel`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` My Cargo `,-1)]]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[0]||=$event=>unref(cargoOverviewStore).automaticRoute=$event},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngSlider_default),{min:0,max:unref(cargoOverviewStore).cargoData.playerCardGroupSets.length-1,step:1,modelValue:unref(cargoOverviewStore).playerGroupingIdx,"onUpdate:modelValue":_cache[1]||=$event=>unref(cargoOverviewStore).playerGroupingIdx=$event,onChange:unref(cargoOverviewStore).setGroupingAndSorting},null,8,[`max`,`modelValue`,`onChange`]),createVNode(unref(bngSlider_default),{min:0,max:unref(cargoOverviewStore).cargoData.sortingSets.length-1,step:1,modelValue:unref(cargoOverviewStore).playerSortingIdx,"onUpdate:modelValue":_cache[2]||=$event=>unref(cargoOverviewStore).playerSortingIdx=$event,onChange:unref(cargoOverviewStore).setGroupingAndSorting},null,8,[`max`,`modelValue`,`onChange`]),createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[createTextVNode(` Grouped `+toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).playerGroupingIdx].label)+`, Sorted `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).playerSortingIdx].label),1)]),_:1}),createBaseVNode(`div`,_hoisted_2$173,[createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.playerCardGroupSets,groupIdx:unref(cargoOverviewStore).playerGroupingIdx,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).playerSortingIdx,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`onCardHovered`,`onCardClicked`])])]),_:1}),createBaseVNode(`div`,_hoisted_3$152,[createVNode(unref(bngCard_default),{class:`cargo-detail`},createSlots({default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(` Details View `,-1)]]),_:1}),unref(cargoOverviewStore).focusedCargo?(openBlock(),createElementBlock(`div`,_hoisted_4$127,[createVNode(CargoCard_default,{card:unref(cargoOverviewStore).focusedCargo,detailed:``},null,8,[`card`])])):createCommentVNode(``,!0)]),_:2},[unref(cargoOverviewStore).focusedCargo?{name:`buttons`,fn:withCtx(()=>[unref(cargoOverviewStore).focusedCargo.cardType==`parcelGroup`?(openBlock(),createElementBlock(Fragment,{key:0},[unref(cargoOverviewStore).focusedCargo.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.transientMoveCounts==0,accent:`text`,onClick:_cache[3]||=$event=>unref(cargoOverviewStore).clearLoad(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(` Clear Load `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.autoLoadLocations&&unref(cargoOverviewStore).focusedCargo.autoLoadLocations.length==0,accent:`text`,onClick:_cache[4]||=$event=>unref(cargoOverviewStore).loadCargoCustom(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Custom Load `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.autoLoadLocations&&unref(cargoOverviewStore).focusedCargo.autoLoadLocations.length<=unref(cargoOverviewStore).focusedCargo.transientMoveCounts,onClick:_cache[5]||=$event=>unref(cargoOverviewStore).loadCargoAuto(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` Auto Load `,-1)]]),_:1},8,[`disabled`])],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.isPlayerCard?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(bngButton_default),{accent:`text`,disabled:unref(cargoOverviewStore).focusedCargo.transientCargo,onClick:_cache[6]||=$event=>unref(cargoOverviewStore).changeDistribution(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[18]||=[createTextVNode(` Change Distribution `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:unref(cargoOverviewStore).focusedCargo.transientCargo,onClick:_cache[7]||=$event=>unref(cargoOverviewStore).clearLoad(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[19]||=[createTextVNode(` Clear Load `,-1)]]),_:1},8,[`disabled`])],64)):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.cardType==`storage`?(openBlock(),createElementBlock(Fragment,{key:1},[unref(cargoOverviewStore).focusedCargo.isFacilityCard?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(cargoOverviewStore).focusedCargo.enabled,onClick:_cache[8]||=$event=>unref(cargoOverviewStore).loadStorageCustom(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Load Custom `,-1)]]),_:1},8,[`disabled`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.cardType==`vehicleOffer`?(openBlock(),createBlock(unref(bngButton_default),{key:2,disabled:!unref(cargoOverviewStore).focusedCargo.enabled,onClick:_cache[9]||=$event=>unref(cargoOverviewStore).loadOffer(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).focusedCargo.spawnWhenCommitingCargo?`Don't bring out`:`Bring Out`),1)]),_:1},8,[`disabled`])):createCommentVNode(``,!0)]),key:`0`}:void 0]),1024),createVNode(unref(bngCard_default),{class:`map`},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(` Map Screen `,-1)]]),_:1})])])]),_:1})):createCommentVNode(``,!0)],64))}},MyCargo_default=__plugin_vue_export_helper_default(_sfc_main$243,[[`__scopeId`,`data-v-9a756c16`]]),_hoisted_1$213={class:`paint-presets`},_hoisted_2$172={class:`paint-presets-group`},_hoisted_3$151={class:`paint-presets-name`},_hoisted_4$126={class:`presets-items`},_sfc_main$242={__name:`PaintPresets`,props:{presets:{type:Object,required:!0},showText:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},current:{type:Object}},emits:[`apply`],setup(__props,{emit:__emit}){let settings$1=useSettings(),props=__props,emit$1=__emit,factoryPresets=computed(()=>{let presets=props.presets,factoryRes={},customRes={};if(typeof presets==`object`&&!Array.isArray(presets)){let paint=new Paint;for(let name in presets)try{paint.paint=presets[name];let paintObject=paint.paintObject;presets[name]&&typeof presets[name]==`object`&&presets[name].class===`custom`?customRes[name]=paintObject:factoryRes[name]=paintObject}catch{}}return{factory:factoryRes,custom:customRes}}),userPresets=ref({}),presetGroups=computed(()=>{let res=[];Object.keys(factoryPresets.value.factory).length&&res.push({name:`factory`,showTooltip:!0,editable:!1,presets:factoryPresets.value.factory}),Object.keys(factoryPresets.value.custom).length&&res.push({name:`custom`,showTooltip:!0,editable:!1,presets:factoryPresets.value.custom}),props.editable&&res.push({name:`user`,showTooltip:!1,editable:!0,presets:userPresets.value||{}});for(let group of res){let presets=Object.keys(group.presets).map(colname=>({name:colname,...group.presets[colname],css:`rgb(${group.presets[colname].baseColor.slice(0,3).map(val=>val*255)})`}));group.name!==`user`&&(presets=sortColors(presets)),group.presets=presets}return res});function average(arr){return arr.reduce((a$1,b)=>a$1+b)/arr.length}function valComparable(col,thres=.05){let bool=!0,av=average(col);for(let i=0;i=col[i];return bool&&=av>.8||av<.2,bool}function colorHigherHelper(itm){let av=average(itm.orig.baseColor.slice(0,3)),al=itm.orig.baseColor[3]/2,res=Math.abs(av-1)*al;return res===0?(av+al)/2:res+1}function colorHigher(a$1,b){let aColor=valComparable(a$1.orig.baseColor.slice(0,3)),bColor=valComparable(b.orig.baseColor.slice(0,3));if(aColor&&bColor)return colorHigherHelper(b)-colorHigherHelper(a$1);if(aColor&&!bColor)return 1;if(!aColor&&bColor)return-1;for(let i=0;i<3;i++)if(a$1.val[i]!==b.val[i])return a$1.val[i]-b.val[i];return 0}function colorValue(arr){let repitions=8,rgb=[];for(let i=0;i<3;i++)rgb[i]=(1-arr[3]/2)*arr[i]+arr[3]/2*arr[i];let lum=Math.sqrt(.241*rgb[0]+.691*rgb[1]+.068*rgb[2]),hsl=Paint.rgbToHsl(rgb),out=[hsl[0],lum,hsl[1]].map(elem=>elem*8);return out[0]%2==1&&(out[1]=8-out[1],out[2]=8-out[2]),out.push(arr[3]),out}function sortColors(list){return list.map(elem=>({val:colorValue(elem.baseColor),orig:elem})).sort(colorHigher).map(elem=>elem.orig)}function addPreset(){if(!props.current)return;let colour={...props.current,baseColor:toRaw(props.current.baseColor)},idx=1;for(;`Custom ${idx}`in userPresets.value;)idx++;let presetName=`Custom ${idx}`;userPresets.value[presetName]=colour,savePresets(),nextTick(()=>{let presetElements=document.querySelectorAll(`.paint-presets-item`),newPreset=Array.from(presetElements).find(el=>el.getAttribute(`data-preset-name`)===presetName);newPreset&&setFocusExternal(newPreset)})}function removePreset(name){let presetElements=document.querySelectorAll(`.paint-presets-item`),currentIndex=Array.from(presetElements).findIndex(el=>el.getAttribute(`data-preset-name`)===name);delete userPresets.value[name],savePresets(),nextTick(()=>{let group=presetGroups.value.find(g=>g.name===`user`);if(group)if(group.presets.length>0){let newPresetElements=document.querySelectorAll(`.paint-presets-item`);setFocusExternal(newPresetElements[Math.min(currentIndex,newPresetElements.length-1)])}else{let addButton=document.querySelector(`.presets-empty`);addButton&&setFocusExternal(addButton)}})}function savePresets(){settings$1.apply({userPaintPresets:JSON.stringify(Object.values(userPresets.value))})}return onMounted(async()=>{await settings$1.waitForData();let paints={};if(settings$1.values.userPaintPresets&&(paints=JSON.parse(settings$1.values.userPaintPresets.replace(/'/g,`"`)),typeof paints==`object`)){Array.isArray(paints)&&(paints=paints.reduce((res,paint,idx)=>({...res,[`Custom ${idx}`]:paint}),{}));let test=new Paint;for(let name in paints)try{test.paint=paints[name],paints[name]=test.paintObject}catch{delete paints[name]}}userPresets.value=paints}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$213,[(openBlock(!0),createElementBlock(Fragment,null,renderList(presetGroups.value,group=>(openBlock(),createElementBlock(`div`,_hoisted_2$172,[createBaseVNode(`span`,_hoisted_3$151,toDisplayString(_ctx.$t(`ui.color.${group.name}`))+`: `,1),createBaseVNode(`div`,_hoisted_4$126,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.presets,(preset,index)=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:`${index}#${preset.name}`,size:24,paint:preset,"vehicle-name":`factory`,"paint-name":preset.name,"tooltip-position":`top`,class:`paint-presets-item`,"data-preset-name":preset.name,"with-menu":__props.editable&&group.editable,"custom-menu":[{label:`ui.common.delete`,action:()=>removePreset(preset.name)}],onClick:$event=>emit$1(`apply`,preset)},null,8,[`paint`,`paint-name`,`data-preset-name`,`with-menu`,`custom-menu`,`onClick`]))),128)),!group.presets||Object.keys(group.presets).length===0?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`presets-empty`,accent:unref(ACCENTS).text,onClick:addPreset,"bng-nav-item":``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.colorpicker.noPresets`)),1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),group.presets&&Object.keys(group.presets).length>0&&__props.editable&&group.editable?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`paint-presets-button`,accent:unref(ACCENTS).text,onClick:addPreset,icon:unref(icons).mathPlus,"bng-nav-item":``},null,8,[`accent`,`icon`])),[[unref(BngTooltip_default),_ctx.$t(`ui.colorpicker.colToPre`),`top`],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0)])]))),256))]))}},PaintPresets_default=__plugin_vue_export_helper_default(_sfc_main$242,[[`__scopeId`,`data-v-469b2f89`]]),_hoisted_1$212={class:`paint-picker`},_hoisted_2$171={key:0,class:`paint-flex`},_hoisted_3$150={key:0,class:`paint-preview`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 1 1`,preserveAspectRatio:`xMidYMid meet`},_hoisted_4$125={id:`light`,cy:`0.28`,cx:`0.35`,r:`0.3`,spreadMethod:`pad`},_hoisted_5$110=[`offset`],_hoisted_6$93=[`offset`],_hoisted_7$81={id:`colPreview`,x:`0`,y:`0`,width:`1`,height:`1`,patternUnits:`userSpaceOnUse`},_hoisted_8$67=[`fill`],_hoisted_9$60={key:1},_hoisted_10$51={key:0},_hoisted_11$45={key:2},_hoisted_12$34={key:0},_sfc_main$241={__name:`PaintPicker`,props:{modelValue:{type:[String,Object]},legacy:{type:Boolean,default:!1},presets:{type:Object,default:{}},presetsEditable:{type:Boolean,default:!1},showPresets:{type:Boolean,default:!0},showMain:{type:Boolean,default:!0},pickerMode:{type:String,default:`full_luminosity`},showText:{type:Boolean,default:!0},showPreview:{type:Boolean,default:!1},advancedOpen:{type:Boolean,default:!1},showAdvancedSwitch:{type:Boolean,default:!0}},emits:[`update:modelValue`,`change`],setup(__props,{expose:__expose,emit:__emit}){let props=__props;__expose({paintUpdated,setAdvancedVisible}),watch(()=>props.modelValue,init$3);let emitter=__emit,advanced=ref(props.advancedOpen),paint=reactive(new Paint({legacy:props.legacy}));watch(()=>props.legacy,val=>paint.legacy=val);let paintPicker=ref(paint),isPaintObject=!1,factoryPresets=computed(()=>props.presets||{}),hslColour=computed(()=>Paint.hslCssStr(paint.hsl));function init$3(){let defPaint=[1,1,1,1,0,1,1,0];if(!props.modelValue){paint.paint=defPaint;return}if(isPaintObject=props.modelValue instanceof Paint,isPaintObject){paint.paint=props.modelValue.paintObject;return}let newpaint=new Paint({legacy:props.legacy});try{newpaint.paint=props.modelValue}catch{newpaint.paint=defPaint}newpaint.paintString!==paint.paintString&&(paint.paint=newpaint.paintObject)}function returnPaint(){let res;isPaintObject?(res=props.modelValue,res.paint=paint.paintObject):res=paint.paintString,emitter(`change`,res),emitter(`update:modelValue`,res)}function paintUpdated(){init$3(),returnPaint()}function setAdvancedVisible(visible){advanced.value=visible}function applyPreset(preset){paint.paint=preset,returnPaint()}return init$3(),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$212,[__props.showPreview||__props.showPresets?(openBlock(),createElementBlock(`div`,_hoisted_2$171,[__props.showPreview?(openBlock(),createElementBlock(`svg`,_hoisted_3$150,[createBaseVNode(`defs`,null,[createBaseVNode(`radialGradient`,_hoisted_4$125,[createBaseVNode(`stop`,mergeProps({offset:.1+.2*(1-paint.roughness)},{"stop-opacity":.4+.2*paint.roughness},{"stop-color":`#fff`}),null,16,_hoisted_5$110),createBaseVNode(`stop`,{offset:1-paint.roughness*.5,"stop-opacity":`0.0`,"stop-color":`#fff`},null,8,_hoisted_6$93)]),_cache[16]||=createBaseVNode(`radialGradient`,{id:`shadow`,cy:`0.43`,cx:`0.45`,r:`0.55`,spreadMethod:`pad`},[createBaseVNode(`stop`,{offset:`0.7`,"stop-opacity":`0.0`,"stop-color":`#000`}),createBaseVNode(`stop`,{offset:`0.85`,"stop-opacity":`0.2`,"stop-color":`#000`}),createBaseVNode(`stop`,{offset:`1.0`,"stop-opacity":`0.5`,"stop-color":`#000`})],-1),createBaseVNode(`pattern`,_hoisted_7$81,[_cache[13]||=createBaseVNode(`image`,{x:`0`,y:`0`,height:`1`,width:`1`,"xlink:href":`/ui/lib/int/colorpicker/color-chrome.png`},null,-1),createBaseVNode(`rect`,mergeProps({y:`0`,x:`0`,width:`1`,height:`1`,fill:`hsl(${hslColour.value})`},{"fill-opacity":paint.alpha/2},{stroke:`transparent`}),null,16,_hoisted_8$67),_cache[14]||=createBaseVNode(`rect`,{y:`0`,x:`0`,width:`1`,height:`1`,fill:`url(#light)`,stroke:`transparent`},null,-1),_cache[15]||=createBaseVNode(`rect`,{y:`0`,x:`0`,width:`1`,height:`1`,fill:`url(#shadow)`,stroke:`transparent`},null,-1)])]),_cache[17]||=createBaseVNode(`circle`,{cy:`0.5`,cx:`0.5`,r:`0.5`,fill:`url(#colPreview)`,stroke:`transparent`},null,-1)])):createCommentVNode(``,!0),__props.showPresets?(openBlock(),createBlock(PaintPresets_default,{key:1,presets:factoryPresets.value,"show-text":__props.showText,editable:__props.presetsEditable,current:paint.paintObject,onApply:applyPreset},null,8,[`presets`,`show-text`,`editable`,`current`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.showMain?(openBlock(),createElementBlock(`div`,_hoisted_9$60,[__props.showText&&_ctx.$slots.default?(openBlock(),createElementBlock(`span`,_hoisted_10$51,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0),createVNode(unref(bngColorPicker_default),{modelValue:paintPicker.value,"onUpdate:modelValue":_cache[0]||=$event=>paintPicker.value=$event,onChange:_cache[1]||=$event=>returnPaint(),view:__props.pickerMode,"show-text":__props.showText},null,8,[`modelValue`,`view`,`show-text`])])):createCommentVNode(``,!0),__props.showMain?(openBlock(),createElementBlock(`div`,_hoisted_11$45,[__props.showAdvancedSwitch?(openBlock(),createElementBlock(`h3`,_hoisted_12$34,[createVNode(unref(bngSwitch_default),{modelValue:advanced.value,"onUpdate:modelValue":_cache[2]||=$event=>advanced.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.color.configurations`)),1)]),_:1},8,[`modelValue`])])):createCommentVNode(``,!0),advanced.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`paint-slider-group`,{"paint-slider-group-fullrow":_ctx.$simplemenu.value}])},[__props.legacy?(openBlock(),createBlock(unref(bngColorSlider_default),{key:0,modelValue:paint.alpha,"onUpdate:modelValue":_cache[3]||=$event=>paint.alpha=$event,max:2,onChange:_cache[4]||=$event=>returnPaint(),fill:[`hsla(${hslColour.value}, 0)`,`hsla(${hslColour.value}, 2)`]},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.chrominess`)} (${paint.alphaPercent}%)`:null),1)]),_:1},8,[`modelValue`,`fill`])):createCommentVNode(``,!0),createVNode(unref(bngColorSlider_default),{modelValue:paint.metallic,"onUpdate:modelValue":_cache[5]||=$event=>paint.metallic=$event,onChange:_cache[6]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.metallic`)} (${paint.metallicPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.roughness,"onUpdate:modelValue":_cache[7]||=$event=>paint.roughness=$event,onChange:_cache[8]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.roughness`)} (${paint.roughnessPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.clearcoat,"onUpdate:modelValue":_cache[9]||=$event=>paint.clearcoat=$event,onChange:_cache[10]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.clearCoat`)} (${paint.clearcoatPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.clearcoatRoughness,"onUpdate:modelValue":_cache[11]||=$event=>paint.clearcoatRoughness=$event,onChange:_cache[12]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.clearCoatRoughness`)} (${paint.clearcoatRoughnessPercent}%)`:null),1)]),_:1},8,[`modelValue`])],2)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]))}},PaintPicker_default=__plugin_vue_export_helper_default(_sfc_main$241,[[`__scopeId`,`data-v-2d18c0ad`]]),_hoisted_1$211={class:`paintingWrapper`},_hoisted_2$170={style:{overflow:`auto`}},_hoisted_3$149=[`tab-heading`],_hoisted_4$124={class:`paintPicker`},_hoisted_5$109={key:0,class:`clearCoatSection`},_hoisted_6$92={key:0,class:`innerShoppingCart`},_hoisted_7$80={class:`shoppingCartTable`},_hoisted_8$66={class:`price`},_hoisted_9$59={class:`price--total`},_hoisted_10$50={class:`purchase-button-container`},_sfc_main$240={__name:`Painting`,props:{noHeader:Boolean},setup(__props,{expose:__expose}){let{units,events:events$3}=useBridge(),presets=ref({});Lua_default.career_modules_painting.getFactoryPaint().then(data=>presets.value=data);let colorClass=ref(`factory`),paintIndex=ref(0),chosenPackage=ref([{},{},{}]),changedPaint=ref(!1),totalPrice=ref(0),clearCoatActive=ref(!1),clearCoatPolish=ref(0),paints=ref([]),originalPaints=ref([]),prices=ref({}),colorClassData=ref({}),canPay=ref(!1),paintPicker=ref(null),paintClassTabInfo=[{title:`Factory`},{title:`Gloss`,paintClasses:[{id:`matte`,title:`Matte`},{id:`semiGloss`,title:`Semi Gloss`},{id:`gloss`,title:`Full Gloss`}]},{title:`Metallic`,paintClasses:[{id:`semiMetallic`,title:`Semi Metallic`},{id:`metallic`,title:`Metallic`},{id:`chrome`,title:`Chrome`}]},{title:`Custom`}],clearCoatUpdateCallback=newValue=>{clearCoatPolish.value=0,changeClearCoatPolish(0),enableClearCoat(newValue)},enableClearCoat=enabled=>{paints.value[paintIndex.value]._clearcoat=enabled?1:0,paintPicker.value.paintUpdated()},changeClearCoatPolish=value=>{paints.value[paintIndex.value]._clearcoatRoughness=-.13*value+.13,paintPicker.value.paintUpdated()},getShoppingCartTable=()=>{let res=[];for(let[index,paintOptions]of chosenPackage.value.entries())Object.keys(paintOptions).length&&(res.push({name:`Paint `+(index+1)+`: `+getNicePaintClassName(paintOptions.paintClass),price:prices.value.basePrices[paintOptions.paintClass].money.amount,topLevel:!0,index}),paintOptions.clearCoat&&(res.push({name:`Clearcoat`,price:prices.value.clearcoatBase.money.amount}),res.push({name:`Extra Clearcoat Polish`,price:prices.value.clearcoatPolishFactor.money.amount*paintOptions.clearCoatPolish})));return res};events$3.on(`sendPaintingShoppingCartData`,data=>{canPay.value=data.canPay,totalPrice.value=data.totalPrice.money.amount}),Lua_default.career_modules_painting.getPaintData().then(data=>{if(prices.value=data.prices,!data||!Array.isArray(data.colors)){paints.value=[];return}paints.value=data.colors.map(val=>new Paint({paint:val})),originalPaints.value=data.colors.map(val=>new Paint({paint:val})),colorClassData.value=data.colorClassData});let getPickerShowPresets=()=>colorClass.value==`factory`,getPickerPresetsEditable=()=>colorClass.value==`custom`,showPickerMain=()=>colorClass.value!=`factory`,showClearCoatOption=()=>colorClass.value!=`factory`&&colorClass.value!=`custom`,setCurrentColorClass=()=>{paintPicker.value.setAdvancedVisible(!1),paints.value[paintIndex.value]._metallic=colorClassData.value[colorClass.value].metallic,paints.value[paintIndex.value]._roughness=colorClassData.value[colorClass.value].roughness,clearCoatActive.value=!1,enableClearCoat(!1)},changedPaintIndexTab=tab=>{paintIndex.value=tab.index,colorClass.value=chosenPackage.value[paintIndex.value].paintClass||`factory`,paintPicker.value.setAdvancedVisible(colorClass.value==`custom`),clearCoatActive.value=chosenPackage.value[paintIndex.value].clearCoat,clearCoatPolish.value=chosenPackage.value[paintIndex.value].clearCoatPolish},changedTopLevelPaintClassTab=tab=>{let classTab={Factory:`factory`,Custom:`custom`,Gloss:`semiGloss`,Metallic:`metallic`}[tab.heading];classTab&&changedPaintClassTab(classTab)},changedPaintClassTab=paintClass=>{if(paintClass==`factory`){colorClass.value=`factory`;return}if(paintClass==`custom`){colorClass.value=`custom`,paintPicker.value.setAdvancedVisible(!0),clearCoatActive.value=!1;return}colorClass.value=paintClass,setCurrentColorClass()};function resetPaint(index){chosenPackage.value[index]={},Object.assign(paints.value[index],originalPaints.value[index]);let chosenPackageEmpty=!0;for(let[index$1,color]of Object.entries(chosenPackage.value))Object.keys(color).length!==0&&(chosenPackageEmpty=!1);chosenPackageEmpty&&(changedPaint.value=!1),Lua_default.career_modules_painting.setPaints(paints.value.map(paint=>paint.paintObject),chosenPackage.value)}function onChange(){colorClass.value==`factory`&&(clearCoatActive.value=!1),chosenPackage.value[paintIndex.value].paintClass=colorClass.value,chosenPackage.value[paintIndex.value].clearCoat=clearCoatActive.value,chosenPackage.value[paintIndex.value].clearCoatPolish=clearCoatPolish.value,changedPaint.value=!0,Lua_default.career_modules_painting.setPaints(paints.value.map(paint=>paint.paintObject),chosenPackage.value)}let NICE_PAINT_CLASS_NAMES={factory:`Factory`,semiGloss:`Semi Gloss`,gloss:`Gloss`,semiMetallic:`Semi Metallic`,metallic:`Metallic`,matte:`Matte`,chrome:`Chrome`,custom:`Custom`},getNicePaintClassName=paintClass=>NICE_PAINT_CLASS_NAMES[paintClass];function headerClass(tab){return{"painting-tab":!0,[`painting-tab-${tab.index}`]:!0}}let headerVars=computed(()=>paints.value.reduce((res,paint,idx)=>({...res,[`--painting-dot-${idx}`]:`hsl(${Paint.hslCssStr(paint.hsl)})`}),{})),apply$1=()=>Lua_default.career_modules_painting.apply(),close=()=>Lua_default.career_modules_painting.close();return onMounted(()=>{Lua_default.career_modules_painting.onUIOpened()}),onUnmounted(close),__expose({apply:apply$1,close}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$211,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`paintingPage`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$170,[__props.noHeader?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Painting `,-1)]]),_:1})),createVNode(unref(tabs_default),{class:`bng-tabs`,"selected-index":0,"make-tab-header-classes":headerClass,style:normalizeStyle(headerVars.value),onChange:changedPaintIndexTab},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(paints.value,(paint,idx)=>(openBlock(),createBlock(unref(tabs_default),{key:idx,"tab-heading":_ctx.$t(`ui.trackBuilder.matEditor.paint`)+` `+(idx+1),class:`bng-tabs`,"selected-index":0,onChange:changedTopLevelPaintClassTab},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(paintClassTabInfo,(paintClassTab,idx$1)=>createBaseVNode(`div`,{key:idx$1,"tab-heading":paintClassTab.title,style:{margin:`0.3em`,"background-color":`#00000000`}},[(openBlock(!0),createElementBlock(Fragment,null,renderList(paintClassTab.paintClasses,(paintClass,idx$2)=>(openBlock(),createBlock(unref(bngButton_default),{key:idx$2,onClick:$event=>changedPaintClassTab(paintClass.id),accent:colorClass.value==paintClass.id?void 0:unref(ACCENTS).secondary,class:`paint-class-button`},{default:withCtx(()=>[createTextVNode(toDisplayString(paintClass.title),1)]),_:2},1032,[`onClick`,`accent`]))),128))],8,_hoisted_3$149)),64))]),_:2},1032,[`tab-heading`]))),128))]),_:1},8,[`style`]),createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$124,[createVNode(PaintPicker_default,{ref_key:`paintPicker`,ref:paintPicker,modelValue:paints.value[paintIndex.value],"onUpdate:modelValue":_cache[0]||=$event=>paints.value[paintIndex.value]=$event,"show-main":showPickerMain(),presets:getPickerShowPresets()?presets.value:void 0,"presets-editable":getPickerPresetsEditable(),"advanced-open":!1,"show-advanced-switch":!1,onChange},null,8,[`modelValue`,`show-main`,`presets`,`presets-editable`]),showClearCoatOption()?(openBlock(),createElementBlock(`div`,_hoisted_5$109,[createVNode(unref(bngSwitch_default),{modelValue:clearCoatActive.value,"onUpdate:modelValue":_cache[1]||=$event=>clearCoatActive.value=$event,onValueChanged:clearCoatUpdateCallback},{default:withCtx(()=>[createTextVNode(` Add Clear Coat (Baseprice: `+toDisplayString(unref(units).beamBucks(prices.value.clearcoatBase.money.amount))+`) `,1)]),_:1},8,[`modelValue`]),clearCoatActive.value?(openBlock(),createBlock(unref(bngColorSlider_default),{key:0,style:{"margin-top":`0.7em`},modelValue:clearCoatPolish.value,"onUpdate:modelValue":_cache[2]||=$event=>clearCoatPolish.value=$event,onChange:changeClearCoatPolish},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Clear Coat Polish `,-1)]]),_:1},8,[`modelValue`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),_:1})])]),_:1})),[[unref(BngBlur_default),1]]),createVNode(unref(bngCard_default),{class:`shoppingCart`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Shopping Cart`,-1)]]),_:1}),changedPaint.value?(openBlock(),createElementBlock(`div`,_hoisted_6$92,[createBaseVNode(`table`,_hoisted_7$80,[_cache[9]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`),createBaseVNode(`th`,{class:`article`},`Option`),createBaseVNode(`th`,{class:`price`},`Price`)])],-1),createBaseVNode(`tbody`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getShoppingCartTable(),(date,idx)=>(openBlock(),createElementBlock(`tr`,null,[createBaseVNode(`th`,null,[date.topLevel?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:$event=>resetPaint(date.index)},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`remove`,-1)]]),_:1},8,[`onClick`])):createCommentVNode(``,!0)]),createBaseVNode(`th`,{class:normalizeClass(date.topLevel?`article`:`article--subLevel`)},toDisplayString(date.name),3),createBaseVNode(`th`,_hoisted_8$66,toDisplayString(unref(units).beamBucks(date.price)),1)]))),256)),createBaseVNode(`tr`,null,[_cache[7]||=createBaseVNode(`th`,null,null,-1),_cache[8]||=createBaseVNode(`th`,{class:`article--total`},`Total`,-1),createBaseVNode(`th`,_hoisted_9$59,toDisplayString(unref(units).beamBucks(totalPrice.value)),1)])])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_10$50,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`purchase-button`,disabled:!canPay.value||!changedPaint.value,"show-hold":``},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Purchase and Apply `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:()=>apply$1(),holdDelay:1e3,repeatInterval:0}]])])]),_:1})]))}},Painting_default=__plugin_vue_export_helper_default(_sfc_main$240,[[`__scopeId`,`data-v-9dc00fbe`]]),_sfc_main$239={__name:`PaintingMain`,setup(__props){useComputerStore();let elPainting=ref(),close=()=>elPainting.value.close();return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Painting`],title:`Painting`,back:``,onBack:close},{default:withCtx(()=>[createVNode(Painting_default,{ref_key:`elPainting`,ref:elPainting,"no-header":``},null,512)]),_:1}))}},PaintingMain_default=_sfc_main$239;const usePartInventoryStore=defineStore(`partInventory`,()=>{let{events:events$3}=useBridge(),partInventoryData=ref({}),newPartsPopupOpen=ref(!1),newParts=ref([]),searchString=ref(``);function requestInitialData(){Lua_default.career_modules_partInventory.sendUIData()}function closeNewPartsPopup(){newPartsPopupOpen.value=!1}function closeMenu(){searchString.value=``,Lua_default.career_modules_partInventory.closeMenu()}function partInventoryClosed(){Lua_default.career_modules_partInventory.partInventoryClosed()}function dispose$2(){events$3.off(`partInventoryData`)}function openNewPartsPopup(newPartIds){newPartsPopupOpen.value=!0,newParts.value=[];for(let i=0;ipart.description.description.toLowerCase().includes(searchString.value.toLowerCase())||part.name.toLowerCase().includes(searchString.value.toLowerCase()),searchValueChanged=()=>{partInventoryData.value.partList.filter?partInventoryData.value.filteredPartList=partInventoryData.value.partList.filter(doesPartPassFilter):partInventoryData.value.filteredPartList={}};return watch(()=>searchString.value,searchValueChanged),events$3.on(`partInventoryData`,data=>{partInventoryData.value=data,searchValueChanged()}),{closeMenu,closeNewPartsPopup,dispose:dispose$2,newParts,newPartsPopupOpen,openNewPartsPopup,partInventoryClosed,partInventoryData,requestInitialData,searchString}});var _hoisted_1$210={style:{padding:`1em`}},_hoisted_2$169={class:`selectButtons`},_hoisted_3$148={class:`part-info-row`},_hoisted_4$123={class:`partList`},_hoisted_5$108=[`onClick`],_hoisted_6$91={class:`part-info-col`},_hoisted_7$79={class:`part-name`},_hoisted_8$65={class:`part-info-row`},_hoisted_9$58={class:`right`},_hoisted_10$49={class:`right`},_hoisted_11$44={class:`center`},_hoisted_12$33={class:`popup-buttons`},_sfc_main$238={__name:`PartSellingPopup`,props:{parts:{type:Array,default:[]}},emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`partSelling`);let{units}=useBridge(),partsChecked=ref([]),emit$1=__emit,props=__props,saleData=computed(()=>{let total=0,numberOfSelected=0;for(let[index,isChecked]of Object.entries(partsChecked.value))if(isChecked){let part=props.parts[index];total+=part.data.finalValue,numberOfSelected+=1}return{price:total,numberOfSelected}}),buildRefList=()=>{for(let i=0;i{for(let i=0;i{let partIds=[];for(let[index,isChecked]of Object.entries(partsChecked.value))if(isChecked){let part=props.parts[index];partIds.push(part.data.id)}Lua_default.career_modules_partInventory.sellParts(partIds),close()},close=()=>{emit$1(`return`,!0)};return onMounted(buildRefList),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-ui-scope":`partSelling`,class:`sellingCard`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Sell Parts`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_1$210,[createBaseVNode(`div`,_hoisted_2$169,[_cache[5]||=createTextVNode(` Select: `,-1),createBaseVNode(`div`,_hoisted_3$148,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,onClick:_cache[0]||=$event=>selectAll(!0)},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` All `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,onClick:_cache[1]||=$event=>selectAll(!1)},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` None `,-1)]]),_:1},8,[`accent`])])]),createBaseVNode(`div`,_hoisted_4$123,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.parts,(part,index)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`part-item`,partsChecked.value[index]?`partSelected`:``]),"bng-nav-item":``,onClick:$event=>partsChecked.value[index]=!partsChecked.value[index]},[createVNode(unref(bngIcon_default),{class:`selectionCheckbox`,type:partsChecked.value[index]?unref(icons).checkboxOn:unref(icons).checkboxOff},null,8,[`type`]),createBaseVNode(`div`,_hoisted_6$91,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$79,toDisplayString(part.name),1)]),createBaseVNode(`div`,_hoisted_8$65,[createBaseVNode(`span`,_hoisted_9$58,toDisplayString(part.mileage),1),createBaseVNode(`span`,_hoisted_10$49,[createVNode(unref(bngPropVal_default),{iconType:unref(icons).beamCurrency,valueLabel:part.valueFormatted},null,8,[`iconType`,`valueLabel`])]),createBaseVNode(`span`,_hoisted_11$44,toDisplayString(part.model),1)])])],10,_hoisted_5$108))),256))]),createBaseVNode(`div`,_hoisted_12$33,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:saleData.value.numberOfSelected<=0,"show-hold":``},{default:withCtx(()=>[createTextVNode(` Sell `+toDisplayString(saleData.value.numberOfSelected)+` parts for `,1),createVNode(unref(bngUnit_default),{money:saleData.value.price},null,8,[`money`])]),_:1},8,[`disabled`])),[[unref(BngClick_default),{holdCallback:sellSelectedParts,holdDelay:1e3,repeatInterval:0}]]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).attention,onClick:close},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1},8,[`accent`])])])]),_:1})),[[unref(BngOnUiNav_default),close,`back,menu`]])}},PartSellingPopup_default=__plugin_vue_export_helper_default(_sfc_main$238,[[`__scopeId`,`data-v-c325ab7a`]]),_hoisted_1$209={style:{height:`100%`,color:`white`}},_hoisted_2$168={key:0},_hoisted_3$147={class:`veh-part-caption`},_hoisted_4$122={class:`veh-name`},_hoisted_5$107={class:`veh-name-count`},_hoisted_6$90={class:`part-item`,"bng-ui-scope":`veh-part-inv`},_hoisted_7$78={key:0,class:`part-info-col`},_hoisted_8$64={class:`part-name`},_hoisted_9$57={class:`part-info-row`},_hoisted_10$48={class:`right`},_hoisted_11$43={class:`right`},_hoisted_12$32={key:0,class:`center`},_hoisted_13$28={key:1,class:`center`},_hoisted_14$26={class:`center`},_hoisted_15$25={key:0},_hoisted_16$25={class:`center`},_hoisted_17$20={key:0},immediateLimit=15,_sfc_main$237={__name:`PartList`,emits:[`partSold`],setup(__props,{emit:__emit}){let{units}=useBridge(),emit$1=__emit,partInventoryStore=usePartInventoryStore(),groupBy=ref(`location`),groups=ref([]),accordionItems=ref([]),disableInstallButtons=ref(!1),addExpandedFuncToGroup=group=>{group.onExpanded=state=>{let grp=groups.value.find(g=>g.id===group.id);if(grp.expanded=state,!state){delete grp.ready;let elm=document.querySelector(`[data-groupid="${group.id}"] > .bng-accitem-caption`);elm&&elm.focus();return}`ready`in grp||(grp.ready=!1,setTimeout(()=>{let grp$1=groups.value.find(g=>g.id===group.id);grp$1&&typeof grp$1.ready==`boolean`&&(grp$1.ready=!0)},100))}},openSellPopup=async()=>{await addPopup(PartSellingPopup_default,{parts:groups.value[0].parts}).promise&&emit$1(`partSold`)};watchEffect(()=>{if(disableInstallButtons.value=!1,!partInventoryStore||!Array.isArray(partInventoryStore.partInventoryData.partList)||partInventoryStore.partInventoryData.partList.length===0)return[];let res=[];if(groupBy.value==`location`){let group={id:0,name:` Inventory`,parts:[],expanded:!1,icon:icons.BNGFolder};addExpandedFuncToGroup(group),res.push(group);for(let[vehId,vehicle]of Object.entries(partInventoryStore.partInventoryData.vehicles)){let group$1={id:vehId,name:vehicle.niceName,parts:[],expanded:!1,thumbnail:partInventoryStore.partInventoryData.vehicles[vehId].thumbnail};addExpandedFuncToGroup(group$1),res.push(group$1)}}for(let part of partInventoryStore.partInventoryData.filteredPartList){let item={name:part.missingFile?`Missing File`:part.description.description,model:part.vehicleModel,mileage:units.buildString(`length`,part.partCondition.odometer,0),valueFormatted:units.beamBucks(part.finalValue),location:part.location,locationName:part.location===0?` Inventory`:partInventoryStore.partInventoryData.vehicles[part.location].niceName,functions:{install:!1,uninstall:!1,sell:!1},data:part};!part.missingFile&&part.accessible&&(item.functions.install=part.fitsCurrentVehicle&&part.location!==partInventoryStore.partInventoryData.currentVehicle&&(part.location===0||!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[part.location])&&!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[partInventoryStore.partInventoryData.currentVehicle],item.functions.uninstall=part.location!==0&&!part.isInCoreSlot&&!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[part.location],item.functions.sell=part.location===0);let groupId=item[groupBy.value],group=res.find(g=>g.id==groupId);group||(group={id:groupId,name:item[`${groupBy.value}Name`]||item[groupBy.value],parts:[],expanded:!1},part.location>0?group.thumbnail=partInventoryStore.partInventoryData.vehicles[part.location].thumbnail:group.icon=icons.BNGFolder,addExpandedFuncToGroup(group),res.push(group)),group.parts.push(item)}if(res.length>0){let sorter=(a$1,b)=>a$1.name.localeCompare(b.name);res.sort(sorter);for(let group of res)group.parts.sort(sorter)}for(let group of groups.value)if(group.ready){let grp=res.find(g=>g.name===group.name);grp&&(grp.expanded=!0,grp.ready=!0)}groups.value=res});let confirmSellPart=async partToSell=>{await openConfirmation(partToSell.description.description,`Do you want to sell this part for ${units.beamBucks(partToSell.finalValue)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&sellPart(partToSell)},sellPart=part=>{Lua_default.career_modules_partInventory.sellParts([part.id]),emit$1(`partSold`)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$209,[createVNode(unref(bngInput_default),{class:`searchField`,"floating-label":`Search`,"leading-icon":unref(icons).search,modelValue:unref(partInventoryStore).searchString,"onUpdate:modelValue":_cache[0]||=$event=>unref(partInventoryStore).searchString=$event,modelModifiers:{trim:!0}},null,8,[`leading-icon`,`modelValue`]),withDirectives((openBlock(),createBlock(unref(bngCard_default),{style:{"max-height":`90%`}},{default:withCtx(()=>[unref(partInventoryStore)?(openBlock(),createBlock(unref(accordion_default),{key:1,class:`part-groups`,singular:``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(groups.value,(group,index)=>(openBlock(),createBlock(unref(accordionItem_default),{key:group.id,"data-groupid":group.id,ref_for:!0,ref_key:`accordionItems`,ref:accordionItems,navigable:``,onExpanded:group.onExpanded,onSelected:$event=>accordionItems.value[index]?accordionItems.value[index].captionClick():void 0},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$147,[group.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`veh-icon`,type:group.icon},null,8,[`type`])):createCommentVNode(``,!0),group.thumbnail?(openBlock(),createElementBlock(`div`,{key:1,class:`veh-preview`,style:normalizeStyle({backgroundImage:`url('${group.thumbnail}')`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`span`,_hoisted_4$122,[createTextVNode(toDisplayString(group.name)+` `,1),createBaseVNode(`span`,_hoisted_5$107,`(`+toDisplayString(group.parts.length)+`)`,1)])])]),default:withCtx(()=>[group.name==` Inventory`?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).outlined,onClick:_cache[1]||=$event=>openSellPopup()},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Sell Parts `,-1)]]),_:1},8,[`accent`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.parts,(part,index$1)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$90,[group.ready||index$1confirmSellPart(part.data)},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Sell `,-1)]]),_:1},8,[`accent`,`onClick`])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),()=>group.onExpanded(!1),`back`]])),256))]),_:2},1032,[`data-groupid`,`onExpanded`,`onSelected`]))),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_2$168,` Please wait... `))]),_:1})),[[unref(BngDisabled_default),!unref(partInventoryStore)]])])),[[unref(BngBlur_default)]])}},PartList_default=__plugin_vue_export_helper_default(_sfc_main$237,[[`__scopeId`,`data-v-7c222f4e`]]),_hoisted_1$208={style:{width:`100%`}},_sfc_main$236={__name:`PartInventoryAddedParts`,props:{parts:{type:Object,default:{}}},setup(__props){let{units}=useBridge(),getLocationName=part=>part.location?`Vehicle No. `+part.location+` (`+part.vehicleModel+`)`:`Inventory`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[_cache[1]||=createTextVNode(` The following additional parts have been added to the vehicle from your inventory to fill the core slots: `,-1),createBaseVNode(`table`,_hoisted_1$208,[_cache[0]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`,null,`id`),createBaseVNode(`th`,null,`Description`),createBaseVNode(`th`,null,`Location`),createBaseVNode(`th`,null,`Mileage`),createBaseVNode(`th`,null,`Part Value`)])],-1),createBaseVNode(`tbody`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.parts,(part,key)=>(openBlock(),createElementBlock(`tr`,{key},[createBaseVNode(`td`,null,toDisplayString(part.id),1),createBaseVNode(`td`,null,toDisplayString(part.description.description),1),createBaseVNode(`td`,null,toDisplayString(getLocationName(part)),1),createBaseVNode(`td`,null,toDisplayString(unref(units).buildString(`length`,part.partCondition.odometer,0)),1),createBaseVNode(`td`,null,toDisplayString(unref(units).beamBucks(part.finalValue)),1)]))),128))])])]))}},PartInventoryAddedParts_default=__plugin_vue_export_helper_default(_sfc_main$236,[[`__scopeId`,`data-v-8dbd3a82`]]),_sfc_main$235={__name:`PartInventoryMain`,setup(__props){useComputerStore();let wrapper=ref(),partInventoryStore=usePartInventoryStore();watch(()=>partInventoryStore.newPartsPopupOpen,(newVal,oldVal)=>newVal&&confirmAddedParts());let confirmAddedParts=async vehicle=>{await openMessage(``,{component:markRaw(PartInventoryAddedParts_default),props:{parts:partInventoryStore.newParts}}),closeNewPartsPopup()},updateCareerStatus=()=>{wrapper.value.statusUpdate()};onBeforeMount(()=>{partInventoryStore.requestInitialData()}),onUnmounted(()=>{partInventoryStore.partInventoryClosed(),partInventoryStore.$dispose()});let close=()=>{partInventoryStore.closeMenu()},closeNewPartsPopup=()=>{partInventoryStore.closeNewPartsPopup()};return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref_key:`wrapper`,ref:wrapper,path:[`Part Inventory`],title:`Part Inventory`,back:``,onBack:close},{default:withCtx(()=>[createVNode(PartList_default,{class:`part-inventory`,onPartSold:updateCareerStatus})]),_:1},512))}},PartInventoryMain_default=__plugin_vue_export_helper_default(_sfc_main$235,[[`__scopeId`,`data-v-54c60dea`]]);const usePartShoppingStore=defineStore(`partShopping`,()=>{let{events:events$3}=useBridge(),partShoppingData=ref({}),filteredSlots=ref([]),path=ref(``),filteredParts=ref([]),category=ref(``),expandedSlots=ref({}),searchString=``,slotToScrollTo=ref(),backAction=()=>{},slotsDict={},partFilter;function doesNameContainString(name,searchStrings){for(let searchString$1 of searchStrings)if(name.includes(searchString$1))return!0;return!1}function filterParts(){if(filteredParts.value=[],slotsDict={},partShoppingData.value.partsInShop){for(let[_,part]of Object.entries(partShoppingData.value.partsInShop)){if(!part.slot)continue;partFilter?doesNameContainString(part.name,partFilter)&&filteredParts.value.push(part):part.containingSlot===path.value&&filteredParts.value.push(part);let niceName=partShoppingData.value.slotsNiceName[part.slot];niceName==null?slotsDict[part.slot]=part.slot:slotsDict[part.slot]=niceName}filteredParts.value.sort((a$1,b)=>a$1.emptyPlaceholder?-1:b.emptyPlaceholder?1:a$1.partId&&!b.partId?-1:!a$1.partId&&b.partId?1:a$1.description.description0?(filteredSlotsDict=getSlotsFromSearchString(),filteredSlots.value=partShoppingData.value.searchSlotList.filter(doesSlotPassFilter)):filteredSlots.value=[]}function setSlotExpanded(path$1,expanded){expandedSlots.value[path$1]=expanded}function setSlot(_slot){_slot==``&&(slotToScrollTo.value=path.value),path.value=_slot,partFilter=void 0,filterParts()}function setCategory(_category){category.value=_category,filterSlots(),category.value==`everything`||category.value==``?setSlot(``):category.value==`cargo`&&(path.value=`Blablabla`,partFilter=[`cargo_load`],filterParts())}let requestInitialData=()=>{Lua_default.career_modules_partShopping.sendShoppingDataToUI()},cancelShopping=()=>{expandedSlots.value={},Lua_default.career_modules_partShopping.cancelShopping(),setCategory(``)};function fixSlots(slot){if(`children`in slot){Array.isArray(slot.children)||(slot.children=Object.values(slot.children).filter(Boolean)),slot.children.sort((a$1,b)=>(a$1.slotNiceName||a$1.slot)<(b.slotNiceName||b.slot)?-1:1);for(let childSlot of slot.children)fixSlots(childSlot)}}let handleShoppingData=data=>{data.partTree&&fixSlots(data.partTree),partShoppingData.value=data,filterParts(),filterSlots()},searchValueChanged=_searchString=>{searchString=_searchString,filterSlots()},listen=state=>{events$3[state?`on`:`off`](`partShoppingData`,handleShoppingData)};listen(!0);function dispose$2(){listen(!1)}return{partShoppingData,slot:path,filteredSlots,filteredParts,category,expandedSlots,slotToScrollTo,searchValueChanged,setSlot,setCategory,requestInitialData,cancelShopping,dispose:dispose$2,setSlotExpanded,set backAction(actionFunc){backAction=actionFunc},get backAction(){return backAction}}});var _hoisted_1$207={class:`cart-main`},_hoisted_2$167={class:`cart-list`,"bng-nav-scroll":``},_hoisted_3$146={key:0,class:`extra-info-text`},_hoisted_4$121={key:0},_hoisted_5$106={key:1},_hoisted_6$89={class:`cart-row cart-subtotal`},_hoisted_7$77={class:`cart-row cart-tax`},_hoisted_8$63={class:`cart-row cart-total`},_sfc_main$234={__name:`ShoppingCart`,props:{cartData:Object,playerMoney:Number,apply:Function,cancel:Function,confirmButtonText:String},setup(__props){let props=__props,{units}=useBridge(),expanded=ref(!1),subtotal=computed(()=>props.cartData&&props.cartData.total&&props.cartData.taxes?props.cartData.total-props.cartData.taxes:0),salesTax=computed(()=>props.cartData&&props.cartData.taxes?props.cartData.taxes:0);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass([`cart`,{expanded:expanded.value}])},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{"show-hold":``,disabled:!__props.apply||!__props.cartData||__props.cartData.items.length===0||__props.cartData.total>0&&__props.cartData.total>__props.playerMoney},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.confirmButtonText||`Purchase`),1)]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:__props.apply,holdDelay:1e3,repeatInterval:0}]]),createVNode(unref(bngButton_default),{disabled:!__props.cancel,onClick:_cache[1]||=$event=>props.cancel(),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Cancel `,-1)]]),_:1},8,[`disabled`,`accent`])]),default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Shopping Cart `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`cart-expand`,accent:unref(ACCENTS).outlined,icon:expanded.value?unref(icons).arrowLargeDown:unref(icons).arrowLargeUp,onClick:_cache[0]||=$event=>expanded.value=!expanded.value},null,8,[`accent`,`icon`]),createBaseVNode(`div`,_hoisted_1$207,[_cache[9]||=createBaseVNode(`div`,{class:`cart-row cart-header`},[createBaseVNode(`div`),createBaseVNode(`div`,null,`Part`),createBaseVNode(`div`,null,`Price`)],-1),createBaseVNode(`div`,_hoisted_2$167,[__props.cartData?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.cartData.items,item=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`cart-row`,item.type?[`type-${item.type}`]:null])},[createBaseVNode(`div`,null,[item.removeShow?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:`attention`,icon:unref(icons).abandon,disabled:item.removeDisabled,onClick:$event=>item.remove()},null,8,[`icon`,`disabled`,`onClick`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,{style:normalizeStyle({paddingLeft:item.level?`${item.level-1}em`:void 0})},[createTextVNode(toDisplayString(item.name)+` `,1),item.extraInfo?(openBlock(),createElementBlock(`div`,_hoisted_3$146,toDisplayString(item.extraInfo),1)):createCommentVNode(``,!0)],4),item.priceHide?(openBlock(),createElementBlock(`div`,_hoisted_5$106)):(openBlock(),createElementBlock(`div`,_hoisted_4$121,toDisplayString(unref(units).beamBucks(item.price)),1))],2))),256)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$89,[_cache[3]||=createBaseVNode(`div`,null,null,-1),_cache[4]||=createBaseVNode(`div`,null,`Subtotal`,-1),createBaseVNode(`div`,null,toDisplayString(unref(units).beamBucks(subtotal.value)),1)]),createBaseVNode(`div`,_hoisted_7$77,[_cache[5]||=createBaseVNode(`div`,null,null,-1),_cache[6]||=createBaseVNode(`div`,null,`Sales Tax (7%)`,-1),createBaseVNode(`div`,null,toDisplayString(unref(units).beamBucks(salesTax.value)),1)])]),createBaseVNode(`div`,_hoisted_8$63,[_cache[7]||=createBaseVNode(`div`,null,null,-1),_cache[8]||=createBaseVNode(`div`,null,`Total`,-1),createBaseVNode(`div`,null,[createVNode(unref(bngUnit_default),{money:__props.cartData?__props.cartData.total:0},null,8,[`money`])])])])]),_:1},8,[`class`]))}},ShoppingCart_default=__plugin_vue_export_helper_default(_sfc_main$234,[[`__scopeId`,`data-v-e9392f36`]]),_hoisted_1$206={class:`parts-wrapper`},_hoisted_2$166={key:2,class:`parts-list`},_hoisted_3$145={class:`part-info-col`},_hoisted_4$120={class:`part-name`},_hoisted_5$105={key:0},_hoisted_6$88={key:1},_hoisted_7$76={key:2},_hoisted_8$62={class:`part-info-row`},_hoisted_9$56={key:0,class:`mileage-text`},_hoisted_10$47={key:1},_hoisted_11$42={key:2,class:`disabled-reason`},_hoisted_12$31={key:3,class:`right`},_hoisted_13$27={key:0},_sfc_main$233={__name:`PartsList`,setup(__props){let partShoppingStore=usePartShoppingStore(),{units}=useBridge(),oldBack,isPartInShoppingCart=part=>{if(!partShoppingStore.partShoppingData||!partShoppingStore.partShoppingData.shoppingCart)return!1;let partList=partShoppingStore.partShoppingData.shoppingCart.partsInList;for(let i=0;i{oldBack=partShoppingStore.backAction,partShoppingStore.backAction=()=>partShoppingStore.setSlot(``)}),onUnmounted(()=>{partShoppingStore.backAction=oldBack}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$206,[unref(partShoppingStore).category===`cargo`?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Cargo `,-1)]]),_:1})):unref(partShoppingStore).filteredParts[0]?(openBlock(),createBlock(unref(bngCardHeading_default),{key:1},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(partShoppingStore).partShoppingData.slotsNiceName[unref(partShoppingStore).filteredParts[0].containingSlot]),1)]),_:1})):createCommentVNode(``,!0),unref(partShoppingStore).filteredParts?(openBlock(),createElementBlock(`div`,_hoisted_2$166,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(partShoppingStore).filteredParts,part=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`part-item`,{"part-installed":unref(partShoppingStore).partShoppingData.vehicleSlotToPartMap[part.containingSlot]&&unref(partShoppingStore).partShoppingData.vehicleSlotToPartMap[part.containingSlot].description.description===part.description.description,disabled:part.disabled}])},[createBaseVNode(`div`,_hoisted_3$145,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_4$120,[part.partId?(openBlock(),createElementBlock(`div`,_hoisted_5$105,toDisplayString(part.description.description)+` (Inventory) `,1)):part.emptyPlaceholder?(openBlock(),createElementBlock(`div`,_hoisted_6$88,` Remove current part `)):(openBlock(),createElementBlock(`div`,_hoisted_7$76,toDisplayString(part.description.description),1))])]),createBaseVNode(`div`,_hoisted_8$62,[part.partId?(openBlock(),createElementBlock(`span`,_hoisted_9$56,` Mileage: `+toDisplayString(unref(units).buildString(`length`,part.partCondition.odometer,0)),1)):createCommentVNode(``,!0),unref(partShoppingStore).category===`cargo`?(openBlock(),createElementBlock(`span`,_hoisted_10$47,toDisplayString(unref(partShoppingStore).partShoppingData.slotsNiceName[part.containingSlot]),1)):createCommentVNode(``,!0),part.disabled&&part.disabledReason?(openBlock(),createElementBlock(`span`,_hoisted_11$42,toDisplayString(part.disabledReason),1)):createCommentVNode(``,!0),!part.partId&&!part.emptyPlaceholder?(openBlock(),createElementBlock(`span`,_hoisted_12$31,[createVNode(unref(bngPropVal_default),{iconType:unref(icons).beamCurrency,valueLabel:unref(units).beamBucks(part.finalValue)},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)])]),createVNode(unref(bngButton_default),{accent:isPartInShoppingCart(part)?unref(ACCENTS).attention:unref(ACCENTS).outlined,class:`part-button`,disabled:part.disabled||unref(partShoppingStore).partShoppingData.tutorialPartNames!==void 0&&(!unref(partShoppingStore).partShoppingData.tutorialPartNames[part.name]||isPartInShoppingCart(part)),onClick:$event=>isPartInShoppingCart(part)?unref(Lua_default).career_modules_partShopping.removePartBySlot(part.containingSlot):unref(Lua_default).career_modules_partShopping.installPartByPartShopId(part.partShopId),icon:isPartInShoppingCart(part)?unref(icons).undo:``},{default:withCtx(()=>[isPartInShoppingCart(part)?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_13$27,toDisplayString(part.emptyPlaceholder?`Remove`:`Install`),1))]),_:2},1032,[`accent`,`disabled`,`onClick`,`icon`])],2))),256))])):createCommentVNode(``,!0)]))}},PartsList_default=__plugin_vue_export_helper_default(_sfc_main$233,[[`__scopeId`,`data-v-c224fcea`]]),_hoisted_1$205={key:0,class:`highlighted`},_hoisted_2$165={key:1,class:`slot-path`},_hoisted_3$144={class:`buy-button-label`},_sfc_main$232={__name:`SlotItem`,props:{static:Boolean,expanded:Boolean,path:String,nicePath:String,slotNiceName:String,partNiceName:String},setup(__props){let slotItem=ref(),focused$1=ref(!1),props=__props;onMounted(()=>{partShoppingStore.slotToScrollTo&&props.path===partShoppingStore.slotToScrollTo&&slotItem.value.scrollIntoView({block:`center`})});let partShoppingStore=usePartShoppingStore(),itemExpanded=val=>{partShoppingStore.setSlotExpanded(props.path,val)},onFocus=val=>{focused$1.value=!0},onUnfocus=val=>{focused$1.value=!1},selectSlot=val=>{partShoppingStore.setSlot(props.path)};return(_ctx,_cache)=>(openBlock(),createBlock(unref(accordionItem_default),{static:__props.static,expanded:__props.expanded,onExpanded:itemExpanded,onFocus,onUnfocus,onSelected:selectSlot,navigable:``,"primary-action":()=>unref(partShoppingStore).setSlot(__props.path),"expand-hint-inline":``,"primary-hint-inline":``},{caption:withCtx(()=>[unref(partShoppingStore).slotToScrollTo===__props.path?(openBlock(),createElementBlock(`div`,_hoisted_1$205)):createCommentVNode(``,!0),__props.nicePath?(openBlock(),createElementBlock(`span`,_hoisted_2$165,toDisplayString(__props.nicePath),1)):createCommentVNode(``,!0),createBaseVNode(`span`,{ref_key:`slotItem`,ref:slotItem,class:`slot-name`},toDisplayString(__props.slotNiceName),513)]),controls:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{"bng-no-nav":`true`,class:`buy-button`,accent:unref(ACCENTS).outlined,onClick:_cache[0]||=$event=>unref(partShoppingStore).setSlot(__props.path),style:normalizeStyle({backgroundColor:unref(partShoppingStore).slotToScrollTo&&unref(partShoppingStore).slotToScrollTo==__props.path?`rgba(75,75,75,0.8)`:``})},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_3$144,toDisplayString(__props.partNiceName?__props.partNiceName:`-`),1)]),_:1},8,[`accent`,`style`])),[[unref(BngTooltip_default),__props.partNiceName,`top`]])]),default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),_:3},8,[`static`,`expanded`,`primary-action`]))}},SlotItem_default=__plugin_vue_export_helper_default(_sfc_main$232,[[`__scopeId`,`data-v-3223c56d`]]),_sfc_main$231={__name:`PartSubTree`,props:{children:Object},setup(__props){let slotItemRefs=ref([]),partShoppingStore=usePartShoppingStore();return(_ctx,_cache)=>(openBlock(),createBlock(unref(accordion_default),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.children,childSlot=>(openBlock(),createBlock(SlotItem_default,{ref_for:!0,ref_key:`slotItemRefs`,ref:slotItemRefs,static:!childSlot.chosenPartName||!childSlot.children||Object.keys(childSlot.children).length===0,expanded:unref(partShoppingStore).expandedSlots[childSlot.path],path:childSlot.path,slotNiceName:childSlot.slotNiceName,partNiceName:childSlot.chosenPartNiceName},{default:withCtx(()=>[childSlot.children&&Object.keys(childSlot.children).length>0?(openBlock(),createBlock(PartSubTree_default,{key:0,children:childSlot.children},null,8,[`children`])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`path`,`slotNiceName`,`partNiceName`]))),256))]),_:1}))}},PartSubTree_default=_sfc_main$231,_hoisted_1$204={class:`innerList`},_sfc_main$230={__name:`SlotList`,props:{cancel:Function},setup(__props){let partShoppingStore=usePartShoppingStore(),props=__props,searchValue=ref(``),searchValueChanged=()=>{partShoppingStore.searchValueChanged(searchValue.value)};return onMounted(()=>{partShoppingStore.backAction,partShoppingStore.backAction=()=>partShoppingStore.setCategory(``)}),onUnmounted(()=>{partShoppingStore.backAction=()=>props.cancel()}),(_ctx,_cache)=>unref(partShoppingStore).slot===``?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(bngInput_default),{"floating-label":`Search`,"leading-icon":unref(icons).search,modelValue:searchValue.value,"onUpdate:modelValue":_cache[0]||=$event=>searchValue.value=$event,modelModifiers:{trim:!0},onValueChanged:searchValueChanged},null,8,[`leading-icon`,`modelValue`]),createBaseVNode(`div`,_hoisted_1$204,[searchValue.value.length>0?(openBlock(),createBlock(unref(accordion_default),{key:0,class:`slot-flat-view`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(partShoppingStore).filteredSlots,slotInfo=>(openBlock(),createBlock(SlotItem_default,{static:!0,path:slotInfo.path,nicePath:slotInfo.nicePath,slotNiceName:slotInfo.slotNiceName,partNiceName:slotInfo.partNiceName?slotInfo.partNiceName:null},null,8,[`path`,`nicePath`,`slotNiceName`,`partNiceName`]))),256))]),_:1})):unref(partShoppingStore).partShoppingData.partTree.children?(openBlock(),createBlock(PartSubTree_default,{key:1,class:`slot-tree-view`,children:unref(partShoppingStore).partShoppingData.partTree.children},null,8,[`children`])):createCommentVNode(``,!0)])],64)):(openBlock(),createBlock(PartsList_default,{key:0}))}},SlotList_default=__plugin_vue_export_helper_default(_sfc_main$230,[[`__scopeId`,`data-v-f602b7c1`]]),_hoisted_1$203={key:0,class:`mainCategories`},_hoisted_2$164=[`disabled`],_sfc_main$229={__name:`Categories`,props:{cancel:Function},setup(__props){let partShoppingStore=usePartShoppingStore(),props=__props;return onMounted(()=>{partShoppingStore.backAction=()=>props.cancel()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:`categoryList`},{default:withCtx(()=>[unref(partShoppingStore).category===``?(openBlock(),createElementBlock(`div`,_hoisted_1$203,[withDirectives((openBlock(),createElementBlock(`div`,{class:`computer-function-tile`,"bng-nav-item":``,tabindex:`0`,disabled:unref(partShoppingStore).partShoppingData.tutorialPartNames===void 0?void 0:!0,onClick:_cache[0]||=$event=>unref(partShoppingStore).partShoppingData.tutorialPartNames===void 0?unref(partShoppingStore).setCategory(`everything`):void 0},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).doorFrontCoins},null,8,[`type`]),_cache[2]||=createBaseVNode(`span`,{class:`label`},`All Parts`,-1)],8,_hoisted_2$164)),[[unref(BngFocusIf_default),!0]]),createBaseVNode(`div`,{class:`computer-function-tile`,"bng-nav-item":``,tabindex:`0`,onClick:_cache[1]||=$event=>unref(partShoppingStore).setCategory(`cargo`)},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).boxPickUp03},null,8,[`type`]),_cache[3]||=createBaseVNode(`span`,{class:`label`},`Cargo Parts`,-1)])])):(openBlock(),createBlock(SlotList_default,{key:1,cancel:props.cancel},null,8,[`cancel`]))]),_:1}))}},Categories_default=__plugin_vue_export_helper_default(_sfc_main$229,[[`__scopeId`,`data-v-70c591df`]]),CANCEL_MESSAGE$1=`Are you sure you want to cancel?
All changes to your vehicle will be reversed`,_sfc_main$228={__name:`PartShoppingMain`,setup(__props){let{$game}=useLibStore();useComputerStore();let partShoppingStore=usePartShoppingStore(),CONFIRM_BUTTONS=[{label:$translate.instant(`ui.common.yes`),value:!0},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}],confirmCancel=async()=>{(!partShoppingStore.partShoppingData.shoppingCart.partsInList.length||await openConfirmation(null,CANCEL_MESSAGE$1,CONFIRM_BUTTONS))&&cancelShopping()},getPartName=item=>item.description.description+(item.partId?` (Inventory)`:``),cartData=computed(()=>{let cart=partShoppingStore.partShoppingData?partShoppingStore.partShoppingData.shoppingCart:null,res={total:0,taxes:0,items:[]};return cart&&(res.total=cart.total,res.taxes=cart.taxes,Array.isArray(cart.partsInList)&&(res.items=cart.partsInList.map(item=>({name:getPartName(item),price:item.finalValue,extraInfo:item.partCondition?.odometer?`Mileage: `+$game.units.buildString(`length`,item.partCondition.odometer,0):void 0,removeShow:!!item.sourcePart,removeDisabled:!!partShoppingStore.partShoppingData.tutorialPartNames,remove:()=>Lua_default.career_modules_partShopping.removePartBySlot(item.containingSlot)})))),res}),applyShopping=()=>Lua_default.career_modules_partShopping.applyShopping(),cancelShopping=()=>Lua_default.career_modules_partShopping.cancelShopping(),start=()=>{partShoppingStore.setSlot(``),partShoppingStore.requestInitialData(),getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar)},kill=()=>{partShoppingStore.cancelShopping(),getUINavServiceInstance().clearFilteredEvents(),partShoppingStore.$dispose()},close=()=>{partShoppingStore.backAction()};return onBeforeMount(start),onUnmounted(kill),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Part Customization`],title:`Parts`,back:``,onBack:close},{side:withCtx(()=>[createVNode(ShoppingCart_default,{partShoppingData:unref(partShoppingStore).partShoppingData,"cart-data":cartData.value,"player-money":unref(partShoppingStore).partShoppingData.playerMoney,apply:applyShopping,cancel:confirmCancel,"confirm-button-text":`Confirm`},null,8,[`partShoppingData`,`cart-data`,`player-money`])]),default:withCtx(()=>[withDirectives(createVNode(Categories_default,{cancel:confirmCancel},null,512),[[unref(BngBlur_default),1]])]),_:1}))}},PartShoppingMain_default=__plugin_vue_export_helper_default(_sfc_main$228,[[`__scopeId`,`data-v-871a3a9f`]]),_hoisted_1$202={class:`profile-status`},_hoisted_2$163={class:`profile-status-progress`},_hoisted_3$143={class:`status-progress-item`},_hoisted_4$119={class:`status-progress-item`},_hoisted_5$104={class:`status-progress-item`},_hoisted_6$87={key:0,class:`profile-status-levels`},_hoisted_7$75={class:`profile-status-level`},_hoisted_8$61={class:`branch-icon-assembly`},_hoisted_9$55={class:`level-content-wrapper`},_sfc_main$227={__name:`ProfileStatus`,props:{beamXP:{type:Object,required:!0},vouchers:{type:Object,required:!0},money:{type:Object,required:!0},insuranceScore:{type:Object,required:!0},branches:{type:Array,required:!0},expanded:Boolean},setup(__props){let props=__props,formatterFn=num=>shrinkNum(num,1),moneyFormatter=computed(()=>props.money&&props.money>1e5?formatterFn:void 0);computed(()=>props.beamXP&&props.beamXP>1e5?formatterFn:void 0);let vouchersFormatter=computed(()=>props.vouchers&&props.vouchers>1e5?formatterFn:void 0);function getBranchStyle(color){return getIconBackgroundStyle(color)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$202,[createBaseVNode(`div`,_hoisted_2$163,[createBaseVNode(`div`,_hoisted_3$143,[createVNode(unref(bngUnit_default),{insuranceScore:__props.insuranceScore?.value||0},null,8,[`insuranceScore`])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_4$119,[createVNode(unref(bngUnit_default),{vouchers:__props.vouchers?.value||0,formatter:vouchersFormatter.value},null,8,[`vouchers`,`formatter`])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_5$104,[createVNode(unref(bngUnit_default),{money:__props.money?.value||0,formatter:moneyFormatter.value},null,8,[`money`,`formatter`])])]),createVNode(Transition,{name:`expand-height`},{default:withCtx(()=>[__props.branches?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$87,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_7$75,[createBaseVNode(`div`,_hoisted_8$61,[createBaseVNode(`div`,{class:`branch-background`,style:normalizeStyle(getBranchStyle(branch.color))},null,4),createVNode(unref(bngIcon_default),{type:branch.icon,class:`assembly-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_9$55,[createVNode(unref(bngProgressBar_default),{class:`slim`,value:branch.curLvlProgress,min:0,max:branch.neededForNext,headerLeft:_ctx.$ctx_t(branch.label),headerRight:`${_ctx.$ctx_t(branch.levelLabel)} `,valueColor:`white`,showValueLabel:!1},null,8,[`value`,`max`,`headerLeft`,`headerRight`])])]))),256))],512)),[[vShow,__props.expanded]]):createCommentVNode(``,!0)]),_:1})]))}},ProfileStatus_default=__plugin_vue_export_helper_default(_sfc_main$227,[[`__scopeId`,`data-v-26c35504`]]),_hoisted_1$201={style:{position:`absolute`,left:`0`,right:`0`,top:`0`,bottom:`0`,background:`rgba(0,0,0,0.5)`}},_sfc_main$226={__name:`PauseMapPreview`,setup(__props){let levelTitle=ref(``),levelImage=ref(``);function setup$3(data){levelTitle.value=$translate.contextTranslate(data.title,!0),levelImage.value=data.previews[0]}let start=()=>{Lua_default.career_modules_uiUtils.getCareerCurrentLevelName().then(setup$3)};function goToBigMap(){Lua_default.freeroam_bigMapMode.enterBigMap()}return onMounted(start),(_ctx,_cache)=>{let _directive_bng_sound_class=resolveDirective(`bng-sound-class`);return withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{"external-image":`/levels/west_coast_usa/spawns_quarry.jpg`,ratio:`4:3`,onClick:_cache[1]||=$event=>goToBigMap()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$201,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(levelTitle.value),1)]),_:1}),createVNode(unref(bngButton_default),{style:{position:`absolute`,bottom:`1em`,right:`1em`},tabindex:`1`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>goToBigMap()},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Open Map`,-1)]]),_:1},8,[`accent`])])]),_:1})),[[_directive_bng_sound_class,`bng_click_generic`]])}}},PauseMapPreview_default=__plugin_vue_export_helper_default(_sfc_main$226,[[`__scopeId`,`data-v-5a91faef`]]),_hoisted_1$200={class:`content-wrapper`},_hoisted_2$162={class:`cards-container`},_sfc_main$225={__name:`PauseMilestonesPreview`,setup(__props){let milestones=ref([]);function setup$3(data){milestones.value=data.list}let start=()=>{Lua_default.career_modules_milestones_milestones.getMilestones().then(setup$3)};function goToMilestones(){window.bngVue.gotoGameState(`milestones`)}return onMounted(start),(_ctx,_cache)=>{let _directive_bng_sound_class=resolveDirective(`bng-sound-class`);return withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{onClick:_cache[1]||=$event=>goToMilestones(),ratio:`4:3`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$200,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Recent Milestones`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$162,[(openBlock(!0),createElementBlock(Fragment,null,renderList(milestones.value.slice(0,5),entry=>(openBlock(),createBlock(MilestoneCard_default,{milestone:entry,isCondensed:!0},null,8,[`milestone`]))),256))]),createVNode(unref(bngButton_default),{style:{position:`absolute`,bottom:`1em`,right:`1em`},tabindex:`1`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>goToMilestones()},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Go to Milestones`,-1)]]),_:1},8,[`accent`])])]),_:1})),[[_directive_bng_sound_class,`bng_click_generic`]])}}},PauseMilestonesPreview_default=__plugin_vue_export_helper_default(_sfc_main$225,[[`__scopeId`,`data-v-7fcfd236`]]),_hoisted_1$199={class:`pause-body-wrapper`},_hoisted_2$161={class:`heading-container`},_hoisted_3$142={class:`buttons-and-status`},_hoisted_4$118={key:0,class:`indicator`},_hoisted_5$103={class:`save-load-row`},_hoisted_6$86={class:`status-container`},_hoisted_7$74={key:2,class:`vehicle-name`},_sfc_main$224={__name:`Pause`,setup(__props){useUINavScope(`pause`),ref({value:0,label:`Map`,type:`Map`}.type),ref(null),ref(.5);let contextButtons=ref({});function setupContextButtons(data){contextButtons.value=data.buttons}Lua_default.career_modules_uiUtils.getCareerPauseContextButtons().then(setupContextButtons);function onContextButtonClicked(btn){Lua_default.career_modules_uiUtils.callCareerPauseContextButtons(btn.functionId)}function onSaveButtonClicked(){Lua_default.career_saveSystem.saveCurrent(),exit()}async function onLoadButtonClicked(){await openConfirmation(`Load Profile`,`Are you sure you want to load a different profile? Any unsaved progress will be lost.`)&&window.bngVue.gotoGameState(`profiles`)}let exit=()=>window.bngVue.gotoGameState(`play`),saveSlotData=ref(null),currentVehicleName=ref(``);function makeVehicleName(data){return!data||data.key===`unicycle`?`Walking`:data.niceName}return onMounted(async()=>{let data=await Lua_default.career_career.sendCurrentSaveSlotData();saveSlotData.value=data,currentVehicleName.value=makeVehicleName(data.currentVehicle)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`careerPause`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`careerPause`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`career-pause-layout`,"bng-ui-scope":`pause`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$199,[createBaseVNode(`div`,_hoisted_2$161,[createVNode(unref(bngCardHeading_default),{class:`pause-heading`,type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(`Career: Paused`,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_3$142,[createVNode(unref(bngCard_default),{class:`system-buttons`},{default:withCtx(()=>[createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:exit},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Resume`,-1)]]),_:1},8,[`accent`]),contextButtons.value.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(contextButtons.value,btn=>(openBlock(),createBlock(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:$event=>onContextButtonClicked(btn)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(btn.label))+` `,1),btn.showIndicator?(openBlock(),createElementBlock(`div`,_hoisted_4$118)):createCommentVNode(``,!0)]),_:2},1032,[`accent`,`onClick`]))),256)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_5$103,[createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSaveButtonClicked},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Save`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:onLoadButtonClicked},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Load`,-1)]]),_:1},8,[`accent`])])]),_:1}),createBaseVNode(`div`,_hoisted_6$86,[saveSlotData.value?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,class:`profile-name`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(saveSlotData.value.id),1)]),_:1})):createCommentVNode(``,!0),saveSlotData.value?(openBlock(),createBlock(ProfileStatus_default,{key:1,class:`pause-profile-status`,expanded:!0,beamXP:saveSlotData.value.beamXP,vouchers:saveSlotData.value.vouchers,money:saveSlotData.value.money,insuranceScore:saveSlotData.value.insuranceScore,branches:saveSlotData.value.branches},null,8,[`beamXP`,`vouchers`,`money`,`insuranceScore`,`branches`])):createCommentVNode(``,!0),saveSlotData.value?(openBlock(),createElementBlock(`div`,_hoisted_7$74,[createVNode(unref(bngIcon_default),{type:unref(icons).car},null,8,[`type`]),createTextVNode(` `+toDisplayString(currentVehicleName.value),1)])):createCommentVNode(``,!0)])])])]),_:1})),[[unref(BngOnUiNav_default),exit,`menu,back`],[unref(BngBlur_default),!0]])}},Pause_default=__plugin_vue_export_helper_default(_sfc_main$224,[[`__scopeId`,`data-v-c6f22d14`]]),_hoisted_1$198={class:`career-pause-wrapper`},_hoisted_2$160={class:`layout-center-wrapper`},_hoisted_3$141={class:`pause-body-wrapper`},_hoisted_4$117={class:`left-content`},_hoisted_5$102={class:`tabs-group`},_hoisted_6$85={class:`tab-content`},_hoisted_7$73={style:{position:`absolute`,left:`0`,right:`0`,top:`0`,bottom:`0`,background:`rgba(0, 0, 0, 0.5)`}},_hoisted_8$60={class:`right-content`},_hoisted_9$54={class:`bottom-content`},ICON_RATIO=`2.25:1`,_sfc_main$223={__name:`PauseBigMiddlePanel`,setup(__props){useUINavScope(`pause`);let MIDDLE_PILL_OPTIONS=[{value:0,label:`Map`,type:`Map`},{value:1,label:`Milestones`,type:`Milestones`},{value:2,label:`Engine`},{value:3,label:`Transmission`},{value:4,label:`Suspension`},{value:5,label:`Electrics`},{value:6,label:`Electrics1`},{value:7,label:`Electrics2`},{value:8,label:`Electrics3`}],currentPillTypeSelected=ref(MIDDLE_PILL_OPTIONS[0].type),middlePillsContainerRef=ref(null);function onMiddlePillsSelectPrevious(){middlePillsContainerRef.value.selectPrevious()}function onMiddlePillsSelectNext(){middlePillsContainerRef.value.selectNext()}function middlePillsValueChanged(selectedValues){let pillId=selectedValues[0],selectedPill=MIDDLE_PILL_OPTIONS.find(pill=>pill.value===pillId);console.log(selectedPill),currentPillTypeSelected.value=selectedPill.type}let todSliderValue=ref(.5),onTODChanged=v=>{console.log(v)},contextButtons=ref({});function setupContextButtons(data){console.log(data),contextButtons.value=data.buttons}Lua_default.career_modules_uiUtils.getCareerPauseContextButtons().then(setupContextButtons);function onContextButtonClicked(btn){console.log(btn),Lua_default.career_modules_uiUtils.callCareerPauseContextButtons(btn.functionId)}function onExitCareerButtonClicked(){console.log(`onExitCareerButtonClicked`)}function onSaveButtonClicked(){career_saveSystem.saveCurrent()}function onLoadButtonClicked(){console.log(`onLoadButtonClicked`)}function onSettingsButtonClicked(){console.log(`onSettingsButtonClicked`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$198,[createVNode(unref(careerSimpleStats_default)),createBaseVNode(`div`,_hoisted_2$160,[createBaseVNode(`div`,_hoisted_3$141,[createVNode(unref(careerStatus_default),{class:`pause-profile-status`}),createBaseVNode(`div`,_hoisted_4$117,[createVNode(unref(bngImageTile_default),{label:`Exit Career`,icon:unref(icons).abandon,onClick:onExitCareerButtonClicked,ratio:ICON_RATIO},null,8,[`icon`]),createVNode(unref(bngCard_default),{class:`system-buttons`},{default:withCtx(()=>[createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSaveButtonClicked},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Save`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onLoadButtonClicked},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Load`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSettingsButtonClicked},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Settings`,-1)]]),_:1},8,[`accent`])]),_:1})]),createVNode(unref(bngCard_default),{class:`main-content grid`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$102,[createVNode(unref(bngButton_default),{class:`button prev-button`,onClick:onMiddlePillsSelectPrevious,tabindex:`0`,accent:unref(ACCENTS).text},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Previous`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngPillFiltersContainer_default),{class:`tabs-track`,ref_key:`middlePillsContainerRef`,ref:middlePillsContainerRef,"html-id":`middle-pills-container-ref`,options:MIDDLE_PILL_OPTIONS,"select-on-navigation":!1,onValueChanged:middlePillsValueChanged,required:!0,"has-checked-icon":!1},null,512),createVNode(unref(bngButton_default),{class:`button next-button`,onClick:onMiddlePillsSelectNext,tabindex:`0`,accent:unref(ACCENTS).text},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Next`,-1)]]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_6$85,[currentPillTypeSelected.value==`Map`?(openBlock(),createBlock(PauseMapPreview_default,{key:0})):createCommentVNode(``,!0),currentPillTypeSelected.value==`Milestones`?(openBlock(),createBlock(PauseMilestonesPreview_default,{key:1})):createCommentVNode(``,!0),currentPillTypeSelected.value===void 0?withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{key:2,style:{background:`red`},ratio:`4:3`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$73,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Undefined Pill Type!`,-1)]]),_:1})])]),_:1})),[[unref(BngSoundClass_default),`bng_click_generic`]]):createCommentVNode(``,!0)])]),_:1}),createBaseVNode(`div`,_hoisted_8$60,[(openBlock(!0),createElementBlock(Fragment,null,renderList(contextButtons.value,btn=>(openBlock(),createBlock(unref(bngImageTile_default),{label:btn.label,icon:unref(icons)[btn.icon],onClick:$event=>onContextButtonClicked(btn),ratio:ICON_RATIO},null,8,[`label`,`icon`,`onClick`]))),256))]),createBaseVNode(`div`,_hoisted_9$54,[createVNode(unref(bngImageTile_default),{class:`photo-mode`,label:`Photo Mode`,icon:unref(icons).photo,ratio:ICON_RATIO},null,8,[`icon`]),createVNode(unref(bngCard_default),{class:`tod`},{default:withCtx(()=>[_cache[7]||=createBaseVNode(`div`,{class:`icon-box`},`I'm an icon box!`,-1),createVNode(unref(bngSlider_default),{ref:`iptChanged`,min:0,max:1,step:.1,modelValue:todSliderValue.value,"onUpdate:modelValue":_cache[0]||=$event=>todSliderValue.value=$event,onValueChanged:onTODChanged},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{class:`tod-value`})]),_:1})])])]),_cache[8]||=createBaseVNode(`div`,{style:{background:`green`,height:`5em`}},`FOOTER`,-1)])),[[unref(BngBlur_default)]])}},PauseBigMiddlePanel_default=__plugin_vue_export_helper_default(_sfc_main$223,[[`__scopeId`,`data-v-7b3f120b`]]),_hoisted_1$197={class:`back-text`},_sfc_main$222={__name:`BackAside`,emits:[`click`],setup(__props,{emit:__emit}){let emit$1=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`back-aside`,onClick:_cache[0]||=$event=>emit$1(`click`)},[createVNode(unref(bngIcon_default),{class:`back-arrow`,type:unref(icons).arrowLargeLeft},null,8,[`type`]),createBaseVNode(`span`,_hoisted_1$197,[createVNode(unref(bngBinding_default),{class:`back-binding`,"ui-event":`back`,controller:``,"track-ignore":``}),createTextVNode(` `+toDisplayString(_ctx.$tt(`ui.common.back`)),1)])])),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])}},BackAside_default=__plugin_vue_export_helper_default(_sfc_main$222,[[`__scopeId`,`data-v-2fa47f3c`]]);const PROFILE_NAME_MAX_LENGTH=100,useProfilesStore=defineStore(`profiles`,()=>{async function loadProfile(profileName,tutorialEnabled,isAdd=!1){if(console.log(`profileStore.loadProfile`,profileName,tutorialEnabled,isAdd),!profileName)return console.warn(`profileStore.loadProfile: profileName is required. Not loading profile.`),!1;if(profileName.length>100&&isAdd)return console.warn(`profileStore.loadProfile: profileName is too long. Not loading profile.`),!1;console.log(`profileStore.loadProfile: creating or loading career and starting`,profileName),/^ +| +$/.test(profileName)&&(profileName=profileName.replace(/^ +| +$/g,``));let createOrLoadCareerAndStartResult=await Lua_default.career_career.createOrLoadCareerAndStart(profileName,null,tutorialEnabled);console.log(`profileStore.loadProfile: createOrLoadCareerAndStartResult`,createOrLoadCareerAndStartResult);let toastrMessage=isAdd?`added`:`loaded`;window.globalAngularRootScope.$broadcast(`toastrMsg`,{type:`info`,msg:$translate.contextTranslate(`ui.career.notification.${toastrMessage}`),config:{positionClass:`toast-top-right`,toastClass:`beamng-message-toast`,timeOut:5e3,extendedTimeOut:1e3}})}return{loadProfile}});var _hoisted_1$196={class:`profile-card-cover`},_hoisted_2$159={class:`profile-card-container`},_hoisted_3$140={class:`profile-card-title`},_hoisted_4$116={key:0,class:`profile-card-date`},_hoisted_5$101={key:0},_hoisted_6$84={key:1},_hoisted_7$72={class:`profile-card-content`},_hoisted_8$59={key:0,class:`profile-manage`},_hoisted_9$53={key:0,class:`profile-manage-rename`},_hoisted_10$46={key:1,class:`profile-manage-delete`},_hoisted_11$41={key:2,class:`profile-manage-main`},MENU_ITEMS$3={RENAME:`rename`,DELETE:`delete`},_sfc_main$221={__name:`ProfileCard`,props:{id:{type:String,required:!0},date:{type:String,required:!0},creationDate:{type:String,required:!0},incompatibleVersion:Boolean,outdatedVersion:{type:Boolean,required:!0},preview:{type:String,default:`/ui/modules/career/profilePreview_WCUSA.jpg`},beamXP:Object,vouchers:Object,vehicleCount:Number,money:Object,insuranceScore:Object,active:Boolean,branches:Array,disabled:Boolean},emits:[`card:activate`,`load`,`rename`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,isActivated=ref(!1),isManage=ref(!1),currentMenu=ref(null),expanded=ref(!1),internalDisabled=ref(!1),cardStates=reactive({focused:!1,hovered:!1}),validateName=inject(`validateName`),nameError=ref(null),lastPlayedDescription=computed(()=>timeSpan(props.date));watch(()=>props.disabled,value=>{nextTick(()=>{internalDisabled.value=value,value&&(expanded.value=!1)})});let onScopeChanged=value=>{isActivated.value=value},cardFooterStyles$1={"background-color":`hsla(217, 22%, 12%, 1)`},validateFn=name=>{let res=validateName(name);return name===props.id&&(res=null),res?nameError.value=res:nameError.value=null,!res},canDeactivate=()=>!isManage.value,canBubbleEvent=e=>e.detail.name===`menu`&&!isManage.value;function onFocused(focused$1){cardStates.focused=focused$1,updatedExpanded()}function onHover(hover){cardStates.hovered=hover,updatedExpanded()}function updatedExpanded(){let enable=cardStates.focused||cardStates.hovered;!enable&&(isActivated.value||isManage.value)||(expanded.value=enable)}function enableManage(enable=!0){nextTick(()=>isManage.value=enable),enable&&!isActivated.value&&(isActivated.value=!0),emit$1(`card:activate`,enable)}function goBack(){if(saveName.value=props.id,currentMenu.value)currentMenu.value=null;else if(isManage.value)enableManage(!1);else return!0}let saveName=ref(props.id),deleteProfile=()=>{Lua_default.career_saveSystem.removeSaveSlot(props.id),Lua_default.career_career.sendAllCareerSaveSlotsData()},updateProfileName=()=>emit$1(`rename`,saveName.value);return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{backgroundImage:__props.preview,footerStyles:cardFooterStyles$1,hideFooter:!expanded.value&&!isManage.value,class:normalizeClass([{"profile-card-active":__props.active,"manage-active":isManage.value,"profile-outdated":__props.incompatibleVersion},`profile-card`]),animateFooterDelay:expanded.value?`0s`:`0.1s`,animateFooterType:`slide`,onActivate:_cache[5]||=$event=>onScopeChanged(!0),onDeactivate:_cache[6]||=$event=>onScopeChanged(!1),onFocusin:_cache[7]||=withModifiers($event=>onFocused(!0),[`self`]),onFocusout:_cache[8]||=withModifiers($event=>onFocused(!1),[`self`]),onMouseover:_cache[9]||=$event=>onHover(!0),onMouseleave:_cache[10]||=$event=>onHover(!1)},{buttons:withCtx(()=>[isManage.value?(openBlock(),createElementBlock(Fragment,{key:0},[currentMenu.value===MENU_ITEMS$3.RENAME?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:nameError.value!==null||saveName.value===props.id,onClick:updateProfileName},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(` Save `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]):createCommentVNode(``,!0),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`outlined`,onClick:goBack},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` Back `,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_cancel_generic`]])],64)):(openBlock(),createElementBlock(Fragment,{key:1},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`outlined`,onClick:enableManage},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`Manage `,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:_cache[4]||=$event=>_ctx.$emit(`load`,__props.id),disabled:__props.active||__props.incompatibleVersion},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(`Load `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]])],64))]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$196,[createBaseVNode(`div`,_hoisted_2$159,[createBaseVNode(`div`,_hoisted_3$140,toDisplayString(_ctx.$ctx_t(__props.id)),1),isManage.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$116,[__props.active?(openBlock(),createElementBlock(`span`,_hoisted_5$101,toDisplayString(_ctx.$ctx_t(`ui.career.nowplaying`)),1)):(openBlock(),createElementBlock(`span`,_hoisted_6$84,toDisplayString(_ctx.$ctx_t(`ui.career.lastplayed`))+` `+toDisplayString(lastPlayedDescription.value),1))]))])]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_7$72,[isManage.value?(openBlock(),createElementBlock(`div`,_hoisted_8$59,[currentMenu.value===MENU_ITEMS$3.RENAME?(openBlock(),createElementBlock(`div`,_hoisted_9$53,[createVNode(unref(bngInput_default),{modelValue:saveName.value,"onUpdate:modelValue":_cache[0]||=$event=>saveName.value=$event,maxlength:unref(100),validate:validateFn,errorMessage:nameError.value,externalLabel:`Save Name`,onKeydown:_cache[1]||=withKeys(withModifiers(()=>{},[`prevent`]),[`enter`])},null,8,[`modelValue`,`maxlength`,`errorMessage`])])):currentMenu.value===MENU_ITEMS$3.DELETE?(openBlock(),createElementBlock(`div`,_hoisted_10$46,[createBaseVNode(`span`,null,toDisplayString(_ctx.$ctx_t(`ui.career.deletePrompt`)),1),withDirectives(createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.common.yes`),accent:`attention`,onClick:deleteProfile},null,8,[`label`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.common.no`),accent:`secondary`,onClick:goBack},null,8,[`label`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_cancel_generic`]])])):(openBlock(),createElementBlock(`div`,_hoisted_11$41,[withDirectives(createVNode(unref(bngButton_default),{accent:`secondary`,label:_ctx.$ctx_t(`ui.career.rename`),disabled:__props.active,onClick:_cache[2]||=()=>currentMenu.value=MENU_ITEMS$3.RENAME},null,8,[`label`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{accent:`secondary`,label:_ctx.$ctx_t(`ui.career.delete`),disabled:__props.active,onClick:_cache[3]||=()=>currentMenu.value=MENU_ITEMS$3.DELETE},null,8,[`label`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.career.mods`),accent:`secondary`,disabled:``},null,8,[`label`]),createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.career.backup`),accent:`secondary`,disabled:``},null,8,[`label`])]))])):(openBlock(),createBlock(ProfileStatus_default,{key:1,branches:__props.branches,beamXP:__props.beamXP,vouchers:__props.vouchers,vehicleCount:__props.vehicleCount,money:__props.money,insuranceScore:__props.insuranceScore},null,8,[`branches`,`beamXP`,`vouchers`,`vehicleCount`,`money`,`insuranceScore`]))])),[[unref(BngOnUiNav_default),goBack,`menu,back`]])]),_:1},8,[`backgroundImage`,`hideFooter`,`class`,`animateFooterDelay`])),[[unref(BngScopedNav_default),{canDeactivate,canBubbleEvent}],[unref(BngSoundClass_default),`bng_hover_generic`],[unref(BngDisabled_default),internalDisabled.value]])}},ProfileCard_default=__plugin_vue_export_helper_default(_sfc_main$221,[[`__scopeId`,`data-v-16215408`]]),cardFooterStyles={"background-color":`hsla(217, 22%, 12%, 1)`},_sfc_main$220={__name:`ProfileCreateCard`,props:{profileName:{required:!0},profileNameModifiers:{}},emits:mergeModels([`card:activate`,`load`],[`update:profileName`]),setup(__props,{emit:__emit}){let emit$1=__emit,profileName=useModel(__props,`profileName`),tutorialChecked=ref(!0),isActive=ref(!1),validateName=inject(`validateName`),nameError=ref(null),startButton=ref(null),cancelButton=ref(null),validateFn=name=>{let res=validateName(name);return res?nameError.value=res:nameError.value=null,!res},load=()=>emit$1(`load`,profileName.value,tutorialChecked.value);function setActive(value){isActive.value=value,emit$1(`card:activate`,value)}function onCancel(event){setTimeout(()=>{isActive.value=!1,emit$1(`card:activate`,!1)},200)}function onEnter(event){event.preventDefault();let focusButton=nameError.value?cancelButton:startButton;focusButton.value&&nextTick(()=>setFocusExternal(focusButton.value.$el))}function onMenu(){setActive(!1)}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{hideFooter:!isActive.value,footerStyles:cardFooterStyles,class:`profile-create-card`,onActivate:_cache[3]||=()=>setActive(!0),onDeactivate:_cache[4]||=()=>setActive(!1)},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`startButton`,ref:startButton,disabled:nameError.value!==null,onClick:withModifiers(load,[`stop`])},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Start`,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`cancelButton`,ref:cancelButton,accent:`outlined`,onClick:withModifiers(onCancel,[`stop`])},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(`Cancel`,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([{"create-active":isActive.value},`create-content-container`])},[isActive.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngInput_default),{modelValue:profileName.value,"onUpdate:modelValue":_cache[0]||=$event=>profileName.value=$event,maxlength:unref(100),validate:validateFn,errorMessage:nameError.value,externalLabel:`Save Name`,onKeydown:withKeys(onEnter,[`enter`])},null,8,[`modelValue`,`maxlength`,`errorMessage`]),createVNode(unref(bngSwitch_default),{modelValue:tutorialChecked.value,"onUpdate:modelValue":_cache[1]||=$event=>tutorialChecked.value=$event,"label-before":``,inline:!1,"label-alignment":unref(LABEL_ALIGNMENTS).START},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.tutorialCheckDesc`)),1)]),_:1},8,[`modelValue`,`label-alignment`]),createBaseVNode(`span`,{class:normalizeClass([`tutorial-desc`,{checked:tutorialChecked.value}])},toDisplayString(_ctx.$ctx_t(`ui.career.tutorialOnDesc`)),3)],64)):(openBlock(),createElementBlock(`div`,{key:1,"bng-nav-item":``,class:`create-content-cover`,onClick:_cache[2]||=withModifiers($event=>setActive(!0),[`stop`])},[..._cache[5]||=[createBaseVNode(`div`,{class:`cover-plus-container`},[createBaseVNode(`div`,{class:`cover-plus-button`},`+`)],-1)]]))],2)),[[unref(BngOnUiNav_default),onMenu,`menu`]])]),_:1},8,[`hideFooter`])),[[unref(BngScopedNav_default),{activated:isActive.value}],[unref(BngBlur_default)],[unref(BngSoundClass_default),`bng_hover_generic`]])}},ProfileCreateCard_default=__plugin_vue_export_helper_default(_sfc_main$220,[[`__scopeId`,`data-v-1524a2bb`]]),_sfc_main$219={__name:`Profiles`,setup(__props){let store$1=useProfilesStore(),{events:events$3}=useBridge(),profiles=ref([]),activeProfileId=ref(null),selectedCard=ref(null),newProfileName=ref(null),onLoad=async id=>{await store$1.loadProfile(id)},onRename=async(profile,newName)=>{await Lua_default.career_saveSystem.renameSaveSlot(profile.id,newName)&&(profile.id=newName)},onCreateSave=async(profileName,tutorialChecked)=>{await store$1.loadProfile(profileName,tutorialChecked,!0)};function onCardActivated(active,index){active?(selectedCard.value=index,index===-1&&(newProfileName.value=getNewName())):selectedCard.value=null}onMounted(()=>{events$3.on(`allCareerSaveSlots`,onProfilesReceived),Lua_default.career_career.sendAllCareerSaveSlotsData()}),onBeforeUnmount(()=>{events$3.off(`allCareerSaveSlots`,onProfilesReceived)}),provide(`validateName`,validateName);let navigateToMainMenu=e=>{activeProfileId.value?window.bngVue.gotoAngularState(`menu.careerPause`):window.bngVue.gotoGameState(`menu.mainmenu`)};function onDeactivate$1(event){event.detail.force||navigateToMainMenu()}async function onProfilesReceived(data){selectedCard.value=null,activeProfileId.value=null,profiles.value=[],!(!data||!Array.isArray(data)||data.length===0)&&(profiles.value=(await updateActiveProfile(data)).map(p$1=>({id:p$1.id,date:p$1.date,creationDate:p$1.creationDate,incompatibleVersion:p$1.incompatibleVersion,outdatedVersion:p$1.outdatedVersion,preview:p$1.preview,beamXP:p$1.beamXP,vouchers:p$1.vouchers,vehicleCount:p$1.vehicleCount,money:p$1.money,insuranceScore:p$1.insuranceScore,branches:p$1.branches})))}async function updateActiveProfile(data){let currentSave=await Lua_default.career_career.sendCurrentSaveSlotData();if(data.sort((a$1,b)=>new Date(b.date)-new Date(a$1.date)),currentSave){activeProfileId.value=currentSave.id;let current=data.find(x=>x.id===currentSave.id);current||=currentSave,data=data.filter(x=>x.id!==currentSave.id),data.splice(0,0,current)}return data}function validateName(newName){return newName?newName.length>100?`Save name cannot be longer than 100 characters`:/[<>:"/\\|?*]/.test(newName)?`Save name cannot contain invalid characters`:profiles.value&&profiles.value.find(profile=>profile.id.toLowerCase()===newName.toLowerCase())?`Save name already exists`:null:`Save name cannot be empty`}function getNewName(){let prefix$1=$translate.contextTranslate(`ui.career.profile`),id;for(let i=1;i<1e3&&(id=`${prefix$1} ${i}`,!(!profiles.value||!profiles.value.find(profile=>profile.id===id)));i++);return id}return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`profiles`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`profiles`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives((openBlock(),createElementBlock(`div`,{class:`profiles-container`,onDeactivate:onDeactivate$1},[createVNode(unref(bngScreenHeading_default),{class:`profiles-title`,preheadings:[_ctx.$ctx_t(`ui.playmodes.career`)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.savedProgress`)),1)]),_:1},8,[`preheadings`]),withDirectives(createVNode(BackAside_default,{class:`profiles-back`,onClick:navigateToMainMenu},null,512),[[unref(BngOnUiNav_default),navigateToMainMenu,`back,menu`]]),createVNode(unref(bngList_default),{layout:unref(LIST_LAYOUTS).RIBBON,"target-width":22,"target-height":28,"target-margin":1,"no-background":``},{default:withCtx(()=>[createVNode(ProfileCreateCard_default,{profileName:newProfileName.value,"onUpdate:profileName":_cache[0]||=$event=>newProfileName.value=$event,class:`profile-card`,"onCard:activate":_cache[1]||=value=>onCardActivated(value,-1),onLoad:onCreateSave},null,8,[`profileName`]),(openBlock(!0),createElementBlock(Fragment,null,renderList(profiles.value,(profile,index)=>withDirectives((openBlock(),createBlock(ProfileCard_default,{key:index,id:profile.id,date:profile.date,creationDate:profile.creationDate,incompatibleVersion:profile.incompatibleVersion,outdatedVersion:profile.outdatedVersion,preview:profile.preview,beamXP:profile.beamXP,vouchers:profile.vouchers,vehicleCount:profile.vehicleCount,money:profile.money,insuranceScore:profile.insuranceScore,branches:profile.branches,active:activeProfileId.value===profile.id,disabled:selectedCard.value!==null&&selectedCard.value!==index,class:`profile-card`,"onCard:activate":value=>onCardActivated(value,index),onLoad,onRename:newName=>onRename(profile,newName)},null,8,[`id`,`date`,`creationDate`,`incompatibleVersion`,`outdatedVersion`,`preview`,`beamXP`,`vouchers`,`vehicleCount`,`money`,`insuranceScore`,`branches`,`active`,`disabled`,`onCard:activate`,`onRename`])),[[unref(BngPopover_default),profile.incompatibleVersion?`tooltip-outdated-message`:null,`top`]])),128))]),_:1},8,[`layout`])],32)),[[unref(BngScopedNav_default),{activateOnMount:!0}]]),createVNode(unref(bngPopoverContent_default),{name:`tooltip-outdated-message`},{default:withCtx(()=>[..._cache[2]||=[createBaseVNode(`div`,{class:`tooltip-outdated-message`},`This profile was saved with an old version of the game. It can no longer be loaded.`,-1)]]),_:1})],64))}},Profiles_default=__plugin_vue_export_helper_default(_sfc_main$219,[[`__scopeId`,`data-v-6aef0f62`]]);const useRepairStore=defineStore(`repair`,()=>{let repairOptions=ref({}),vehicleData=ref({}),playerAttributes=ref({}),driverScoreTierData=ref({}),futureDriverScore=ref(0),driverScore=ref(0),resetStore=()=>{repairOptions.value={},vehicleData.value={},playerAttributes.value={},driverScoreTierData.value={},futureDriverScore.value=0,driverScore.value=0};return{repairOptions,vehicleData,playerAttributes,getRepairData:()=>{resetStore(),Lua_default.career_modules_insurance_repairScreen.getRepairData().then(data=>{repairOptions.value=data.repairOptions,vehicleData.value=data.vehicleData,playerAttributes.value=data.playerAttributes,driverScoreTierData.value=data.driverScoreTierData,futureDriverScore.value=data.futureDriverScore,driverScore.value=data.driverScore})},driverScoreTierData,futureDriverScore,driverScore,resetStore}});var _hoisted_1$195={class:`content blue-background`},_hoisted_2$158={class:`vehicle-info`},_hoisted_3$139={class:`right-info-wrapper`},_hoisted_4$115={class:`damage-estimate-wrapper`},_hoisted_5$100={class:`damage-estimate-value`},_hoisted_6$83={key:0},_hoisted_7$71={class:`repair-options`},_hoisted_8$58=[`onClick`],_hoisted_9$52={class:`icon-wrapper`},_hoisted_10$45={key:0,class:`option-text-wrapper`},_hoisted_11$40={class:`smaller-text`},_hoisted_12$30={class:`bigger-text`,style:{"margin-top":`-5px`}},_hoisted_13$26={key:1,class:`option-text-wrapper`},_hoisted_14$25={key:0},_hoisted_15$24={class:`details-wrapper`},_hoisted_16$24={class:`detail-wrapper`},_hoisted_17$19={class:`item`},_hoisted_18$17={key:0,class:`accident-forgivenesses-text`},_hoisted_19$14={key:0,class:`item`},_hoisted_20$12={class:`item-value`},_hoisted_21$11={key:1,class:`renews-in-wrapper`},_hoisted_22$9={class:`renews-in-name`},_hoisted_23$8={class:`renews-in-value`},_hoisted_24$7={class:`detail-wrapper`},_hoisted_25$6={class:`item`},_hoisted_26$5={class:`item-value`},_hoisted_27$5={class:`item`},_hoisted_28$4={class:`item-value`},_hoisted_29$4={key:0,class:`item`},_hoisted_30$4={class:`item-value`},_hoisted_31$4={key:1,class:`item`},_hoisted_32$4={class:`item-value`},_hoisted_33$4={class:`item total-cost`},_hoisted_34$4={class:`item-value`},_hoisted_35$3={key:0},_hoisted_36$3={key:1},_hoisted_37$2={class:`confirm-repair-money-wrapper`},_hoisted_38$2={key:2},_hoisted_39$2={class:`confirm-repair-money-wrapper`},_sfc_main$218={__name:`RepairMain`,setup(__props){let{units}=useBridge();useComputerStore();let repairStore=useRepairStore(),selectedRepairOptionKey=ref(null),selectedRepairTimeOptionIndex=ref(1),currentRepairOption=computed(()=>!selectedRepairOptionKey.value||!repairStore.repairOptions?null:repairStore.repairOptions[selectedRepairOptionKey.value]),accidentForgivenessesText=computed(()=>!repairStore.repairOptions.insuranceRepairData.accidentForgivenesses>0?`(No Accident Forgivenesses left)`:`(`+repairStore.repairOptions.insuranceRepairData.accidentForgivenesses+` Accident Forgivenesses left)`),selectedRepairTimeOption=computed(()=>currentRepairOption.value?.repairTimeOptions?.choices?currentRepairOption.value.repairTimeOptions.choices.find(choice=>choice.id===selectedRepairTimeOptionIndex.value):null),renewsInFormatted=computed(()=>currentRepairOption.value?.renewsIn?units.buildString(`length`,currentRepairOption.value.renewsIn*1e3,0):``);watch(()=>repairStore.repairOptions,newOptions=>{if(newOptions&&Object.keys(newOptions).length>0&&!selectedRepairOptionKey.value){let selectedKey=Object.keys(newOptions).find(key=>newOptions[key].useInsurance)||Object.keys(newOptions)[0];selectedRepairOptionKey.value=selectedKey,newOptions[selectedKey]?.repairTimeOptions?.currentValueId&&(selectedRepairTimeOptionIndex.value=newOptions[selectedKey].repairTimeOptions.currentValueId)}},{immediate:!0}),watch(()=>selectedRepairOptionKey.value,newKey=>{newKey&&repairStore.repairOptions[newKey]?.repairTimeOptions?.currentValueId?selectedRepairTimeOptionIndex.value=repairStore.repairOptions[newKey].repairTimeOptions.currentValueId:selectedRepairTimeOptionIndex.value=1});let onRepairOptionClick=key=>{selectedRepairOptionKey.value=key},close=()=>{Lua_default.career_modules_insurance_repairScreen.closeMenu()},startRepair=(repairOptionKey,repairTimeOptionIndex)=>{selectedRepairTimeOption.value&&Lua_default.career_modules_insurance_repairScreen.startRepairInGarage(repairStore.vehicleData.invVehId,{repairTime:selectedRepairTimeOption.value.value,isInsuranceRepair:currentRepairOption.value.useInsurance,cost:{repairTimeCost:selectedRepairTimeOption.value.premiumInfluence,deductible:currentRepairOption.value.useInsurance?repairStore.repairOptions.insuranceRepairData.deductible:repairStore.vehicleData.damageCost}})};return onMounted(()=>{repairStore.getRepairData()}),onUnmounted(()=>{repairStore.resetStore()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Repair`],title:`Repair ${unref(repairStore).vehicleData.name}`,back:``,onBack:close},{default:withCtx(()=>[unref(repairStore).vehicleData.name?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`repairMain blue-background`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$195,[_cache[23]||=createBaseVNode(`div`,{class:`title`},`Vehicle Repair`,-1),createBaseVNode(`div`,_hoisted_2$158,[createVNode(unref(insuranceVehTile_default),{class:`vehicle-tile`,vehicle:unref(repairStore).vehicleData},{rightContent:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$139,[createBaseVNode(`div`,_hoisted_4$115,[_cache[2]||=createBaseVNode(`span`,{class:`damage-estimate-text`},` Damage Estimate: `,-1),createBaseVNode(`span`,_hoisted_5$100,[createVNode(unref(bngUnit_default),{class:`red-price`,money:unref(repairStore).vehicleData.damageCost},null,8,[`money`])])]),unref(repairStore).vehicleData.isInsured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$83,[..._cache[3]||=[createBaseVNode(`span`,{class:`not-insured-text`},` Not Insured! `,-1)]]))])]),_:1},8,[`vehicle`])]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`div`,{class:`repair-options-title`},`Repair Options`,-1),createBaseVNode(`div`,_hoisted_7$71,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(repairStore).repairOptions,(repairOption,key)=>(openBlock(),createElementBlock(`div`,{key,class:normalizeClass([`repair-option`,{selected:selectedRepairOptionKey.value===key}]),onClick:$event=>onRepairOptionClick(key)},[createBaseVNode(`div`,_hoisted_9$52,[createVNode(unref(bngIcon_default),{type:repairOption.useInsurance?unref(icons).shieldCheckmark:unref(icons).wrench},null,8,[`type`])]),createBaseVNode(`div`,null,[repairOption.useInsurance?(openBlock(),createElementBlock(`div`,_hoisted_10$45,[_cache[5]||=createBaseVNode(`div`,{class:`bigger-text`},` Insurance Claim `,-1),createBaseVNode(`div`,_hoisted_11$40,toDisplayString(repairOption.insuranceName),1),createBaseVNode(`div`,_hoisted_12$30,[_cache[4]||=createTextVNode(` Deductible : `,-1),createVNode(unref(bngUnit_default),{class:`unit-no-padding`,money:unref(repairStore).repairOptions.insuranceRepairData.deductible},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_13$26,[..._cache[6]||=[createBaseVNode(`div`,{class:`bigger-text`},` Private Repair `,-1),createBaseVNode(`div`,{class:`smaller-text`},` No Policy Impact `,-1),createBaseVNode(`div`,{class:`bigger-text`},` Full Damage Cost `,-1)]]))])],10,_hoisted_8$58))),128))])]),currentRepairOption.value?(openBlock(),createElementBlock(`div`,_hoisted_14$25,[(openBlock(),createBlock(unref(coverageOption_default),{coverageOption:currentRepairOption.value.repairTimeOptions,key:`repairTime-${selectedRepairOptionKey.value}`,modelValue:selectedRepairTimeOptionIndex.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedRepairTimeOptionIndex.value=$event,simpleSelect:!0,showPerkMode:`none`},null,8,[`coverageOption`,`modelValue`]))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_15$24,[createBaseVNode(`div`,_hoisted_16$24,[_cache[13]||=createBaseVNode(`h3`,null,`Insurance Impact`,-1),createBaseVNode(`div`,_hoisted_17$19,[createBaseVNode(`span`,null,[_cache[8]||=createBaseVNode(`div`,{class:`item-label`},`Driver Score Change`,-1),currentRepairOption.value.useInsurance?(openBlock(),createElementBlock(`div`,_hoisted_18$17,toDisplayString(accidentForgivenessesText.value),1)):createCommentVNode(``,!0)]),createBaseVNode(`span`,{class:normalizeClass([`item-value`,{"red-text":currentRepairOption.value.useInsurance&&unref(repairStore).futureDriverScorestartRepair(selectedRepairOptionKey.value,selectedRepairTimeOptionIndex.value)},{default:withCtx(()=>[unref(repairStore).vehicleData.needsRepair?selectedRepairTimeOption.value?.canPay?(openBlock(),createElementBlock(`div`,_hoisted_38$2,[_cache[22]||=createTextVNode(` Confirm Repair `,-1),createBaseVNode(`div`,_hoisted_39$2,[createVNode(unref(bngUnit_default),{money:selectedRepairTimeOption.value?.totalPrice},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_36$3,[_cache[21]||=createTextVNode(` Insufficient funds `,-1),createBaseVNode(`div`,_hoisted_37$2,[createVNode(unref(bngUnit_default),{money:selectedRepairTimeOption.value?.totalPrice},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_35$3,` Vehicle doesn't need repair `))]),_:1},8,[`disabled`])])]),_:1})):createCommentVNode(``,!0)]),_:1},8,[`title`]))}},RepairMain_default=__plugin_vue_export_helper_default(_sfc_main$218,[[`__scopeId`,`data-v-19ad91be`]]),_hoisted_1$194={class:`awd-container bng-app`},_hoisted_2$157={key:0,class:`awd-table`},_hoisted_3$138={class:`data-name`},_sfc_main$217={__name:`app`,setup(__props,{expose:__expose}){let{$game}=useLibStore(),streamList=[`advancedWheelDebugData`],data=ref([]),hasData=computed(()=>Array.isArray(data.value)&&data.value.length>0),orderedData=computed(()=>Array.isArray(data.value)?data.value.sort((a$1,b)=>a$1.name.toLowerCase().localeCompare(b.name.toLowerCase())):[]);__expose({hasData}),onMounted(()=>{$game.streams.add(streamList),register()}),onUnmounted(()=>{$game.streams.remove(streamList),$game.api.activeObjectLua(`extensions.advancedwheeldebug.registerDebugUser("advancedWheelDebugApp", false)`)});let register=()=>$game.api.activeObjectLua(`extensions.advancedwheeldebug.registerDebugUser("advancedWheelDebugApp", true)`),format$2=value=>value?parseFloat(value).toFixed(3):``;return $game.events.on(`onStreamsUpdate`,streams=>data.value=streams.advancedWheelDebugData),$game.events.on(`VehicleReset`,register),$game.events.on(`VehicleChange`,register),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$194,[orderedData.value&&orderedData.value.length>0?(openBlock(),createElementBlock(`table`,_hoisted_2$157,[_cache[0]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`,null,`Name`),createBaseVNode(`th`,null,`Camber`),createBaseVNode(`th`,null,`Toe`),createBaseVNode(`th`,null,`Caster`),createBaseVNode(`th`,null,`SAI`)])],-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(orderedData.value,w=>(openBlock(),createElementBlock(`tr`,null,[createBaseVNode(`td`,_hoisted_3$138,toDisplayString(w.name),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.camber)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.toe)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.caster)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.sai)),1)]))),256))])):createCommentVNode(``,!0)]))}},app_default$2=__plugin_vue_export_helper_default(_sfc_main$217,[[`__scopeId`,`data-v-5eb5aaaa`]]),_hoisted_1$193={class:`legends-container`},TAG=`[beamng.apps:brakeTorqueGraph]`,_sfc_main$216={__name:`app`,setup(__props){let{$game}=useLibStore(),app$1=ref(null),canvas=ref(null),graphList=ref([]),streamsList$1=[`wheelInfo`,`electrics`],colors=[],chart=new SmoothieChart({minValue:0,millisPerPixel:20,interpolation:`linear`,grid:{fillStyle:`rgba(250, 250, 250, 0.8)`,strokeStyle:`rgba(0,0,0,0.3)`,verticalSections:6,millisPerLine:1e3,sharpLines:!0},labels:{fillStyle:`black`}}),speedGraph=new TimeSeries,appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight}),graphs={},globalMax=2e3;onMounted(()=>{initColors(),initChart(),appResizeObserver.observe(app$1.value),graphList.value=[{title:`ui.apps.brake_torque_graph.speed`,color:colors[0]}],$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleReset`,onVehicleReset),$game.events.on(`VehicleChange`,onVehicleChange)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleReset`,onVehicleReset),$game.events.off(`VehicleChange`,onVehicleChange),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;globalMax=Math.max(globalMax,streams.electrics.airspeed*15);let xPoint=new Date;for(let w in speedGraph.append(xPoint,streams.electrics.airspeed*15),streams.wheelInfo){let wheelName=streams.wheelInfo[w][0];if(!graphs.hasOwnProperty(wheelName)){graphs[wheelName]=new TimeSeries,logger_default.debug(`${TAG} adding graph for ${wheelName}`);let wheelColor=colors[graphList.value.length%colors.length];graphList.value.push({title:wheelName,color:wheelColor}),chart.addTimeSeries(graphs[wheelName],{strokeStyle:wheelColor,lineWidth:2});return}graphs[wheelName].append(xPoint,streams.wheelInfo[w][8]),globalMax=Math.max(globalMax,streams.wheelInfo[w][8])}chart.options.maxValue=globalMax}function onVehicleReset(data){graphs={},graphList.value=[{title:`Speed`,color:colors[0]}]}function onVehicleChange(data){graphs={},graphList.value=[{title:`Speed`,color:colors[0]}]}function initChart(){chart.addTimeSeries(speedGraph,{strokeStyle:colors[0],lineWidth:2}),chart.streamTo(canvas.value,40)}function initColors(){for(let i=15;i>0;i--){let c=rainbow(15,i);colors.push(`rgb(${Math.round(255*c[0])}, ${Math.round(255*c[1])}, ${Math.round(255*c[2])})`)}}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`btg-app`,ref_key:`app`,ref:app$1},[createBaseVNode(`div`,_hoisted_1$193,[(openBlock(!0),createElementBlock(Fragment,null,renderList(graphList.value,graph=>(openBlock(),createElementBlock(`small`,{class:`legend`,style:normalizeStyle({color:graph.color})},toDisplayString(_ctx.$t(graph.title)),5))),256))]),createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas},null,512)],512))}},app_default$3=__plugin_vue_export_helper_default(_sfc_main$216,[[`__scopeId`,`data-v-642d2338`]]),_hoisted_1$192={class:`bus-line bng-app`},_hoisted_2$156={class:`header`},_hoisted_3$137={class:`time`},_hoisted_4$114={class:`logo`},_hoisted_5$99=[`src`],_hoisted_6$82={class:`route-id`},_hoisted_7$70={class:`text`},_hoisted_8$57={class:`destination`},_hoisted_9$51={key:0,class:`display-stops`},_hoisted_10$44={class:`title`},_hoisted_11$39={key:1,class:`next-stop`},_hoisted_12$29={class:`title`},defaultRouteId=`00`,defaultDestination=`Not in service`,defaultRouteColor=`#FFA200`,totalRoutesDisplayed=4,_sfc_main$215={__name:`app`,setup(__props){let{$game}=useLibStore(),timerInterval,navDisplay=reactive({time:``,stopRequested:!1}),localBusRoute=ref(null),routeId=computed(()=>localBusRoute.value&&localBusRoute.value.routeId?localBusRoute.value.routeId.substring(0,3):defaultRouteId),destination=computed(()=>localBusRoute.value&&localBusRoute.value.destination?localBusRoute.value.destination.substring(0,20):defaultDestination),routeColor=computed(()=>localBusRoute.value&&localBusRoute.value.routeColor?localBusRoute.value.routeColor:defaultRouteColor),stops=computed(()=>{if(!localBusRoute.value||!localBusRoute.value.stops)return null;let data=localBusRoute.value.stops.slice(0,-1);return data.length>totalRoutesDisplayed&&(data=data.slice(1).slice(0,totalRoutesDisplayed)),data.reverse()}),nextStop=computed(()=>localBusRoute.value&&localBusRoute.value.stops&&localBusRoute.value.stops.length-1>totalRoutesDisplayed?localBusRoute.value.stops[0]:null);onBeforeMount(()=>{updateTime(),timerInterval=setInterval(()=>{updateTime()},1e3)}),onMounted(()=>{$game.events.on(`BusDisplayUpdate`,onBusDisplayUpdate),$game.events.on(`SetStopRequest`,onSetStopRequest),$game.api.engineLua(`if scenario_busdriver then scenario_busdriver.requestState() end`)}),onUnmounted(()=>{clearInterval(timerInterval),$game.events.off(`BusDisplayUpdate`,onBusDisplayUpdate),$game.events.off(`SetStopRequest`,onSetStopRequest)});function onBusDisplayUpdate(data){console.log(`onBusDisplayUpdate`,data),localBusRoute.value?(localBusRoute.value.routeId=data.routeId,localBusRoute.value.stops=localBusRoute.value.stops.filter(x=>data.tasklist.find(y=>y[0]===x.id))):localBusRoute.value=parseBusData(data)}function onSetStopRequest(data){console.log(`onSetStopRequest`,data),data&&data.stopRequested!==null&&(navDisplay.stopRequested=data.stopRequested)}function updateTime(){let date=new Date;navDisplay.time=`${date.getHours()}:${date.getMinutes()<10?`0`+date.getMinutes():date.getMinutes()}`}function parseBusData(data){return{destination:data.direction,routeId:data.routeId,routeColor:data.routeColor,stops:data.tasklist.map(x=>({id:x[0],name:x[1]}))}}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$192,[createBaseVNode(`div`,{class:`content`,style:normalizeStyle({"--routeColor":routeColor.value})},[createBaseVNode(`div`,_hoisted_2$156,[createBaseVNode(`div`,_hoisted_3$137,toDisplayString(navDisplay.time),1),createBaseVNode(`div`,_hoisted_4$114,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/beamng_logo_50x50.png`)},null,8,_hoisted_5$99)])]),createBaseVNode(`div`,{class:normalizeClass([`route`,{highlight:!stops.value||stops.value.length===0}])},[createBaseVNode(`div`,_hoisted_6$82,[createBaseVNode(`span`,_hoisted_7$70,toDisplayString(routeId.value),1),_cache[0]||=createBaseVNode(`span`,{class:`chevron`},null,-1)]),createBaseVNode(`div`,_hoisted_8$57,toDisplayString(destination.value),1)],2),stops.value?(openBlock(),createElementBlock(`div`,_hoisted_9$51,[(openBlock(!0),createElementBlock(Fragment,null,renderList(stops.value,stop$1=>(openBlock(),createElementBlock(`div`,{class:`stop`,key:stop$1.id},[_cache[1]||=createBaseVNode(`div`,{class:`chevron`},null,-1),createBaseVNode(`div`,_hoisted_10$44,toDisplayString(stop$1.name),1)]))),128))])):createCommentVNode(``,!0),nextStop.value?(openBlock(),createElementBlock(`div`,_hoisted_11$39,[_cache[2]||=createBaseVNode(`div`,{class:`chevron`},null,-1),createBaseVNode(`div`,_hoisted_12$29,toDisplayString(nextStop.value.name),1)])):createCommentVNode(``,!0)],4),createBaseVNode(`div`,{class:normalizeClass([`stop-request`,{requested:navDisplay.stopRequested}])},[createBaseVNode(`div`,{class:normalizeClass([`text`,{glow:navDisplay.stopRequested}])},toDisplayString(_ctx.$t(`ui.busRoute.stopRequested`)),3)],2)]))}},app_default$4=__plugin_vue_export_helper_default(_sfc_main$215,[[`__scopeId`,`data-v-7731db49`]]),_hoisted_1$191={class:`bng-app cd-container`,layout:`column`,"layout-align":`center center`},_sfc_main$214={__name:`app`,setup(__props){let{$game}=useLibStore(),cameraDistance=ref(null);return onMounted(()=>{$game.api.engineLua(`extensions.load("ui_cameraDistanceApp")`)}),onUnmounted(()=>{$game.api.engineLua(`extensions.unload("ui_cameraDistanceApp")`)}),$game.events.on(`cameraDistance`,function(distance,errMsg){distance<0?cameraDistance.value=errMsg:cameraDistance.value=$game.units.buildString(`length`,distance,2)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$191,[createBaseVNode(`span`,null,toDisplayString(cameraDistance.value),1)]))}},app_default$5=__plugin_vue_export_helper_default(_sfc_main$214,[[`__scopeId`,`data-v-d72a4879`]]),_hoisted_1$190={key:0,class:`bng-app thermal-clutch-debug`},_hoisted_2$155={class:`set-name`},_sfc_main$213={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`clutchThermalData`],data=ref([]);onMounted(()=>{$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.streams.remove(streamsList$1)}),$game.events.on(`onStreamsUpdate`,streams=>{streams.clutchThermalData?data.value=parseData(streams.clutchThermalData):data.value=null});function parseData(data$1){return[{str:$game.units.buildString(`temperature`,data$1.clutchTemperature,0),name:`Clutch temperature`,warn:data$1.clutchTemperature>data$1.maxSafeTemp&&data$1.clutchTemperature<=data$1.efficiencyScaleEnd,error:data$1.clutchTemperature>data$1.efficiencyScaleEnd},{str:$game.units.buildString(`temperature`,data$1.maxSafeTemp,0),name:`Max safe temperature`},{str:$game.units.buildString(`temperature`,data$1.efficiencyScaleEnd,0),name:`Efficiency scale end`},{str:data$1.thermalEfficiency.toFixed(3),name:`Clutch efficiency`,warn:data$1.thermalEfficiency<1&&data$1.thermalEfficiency>=.5,error:data$1.thermalEfficiency<.5},{str:$game.units.buildString(`energy`,data$1.energyToClutch,0),name:`Q to clutch`},{str:$game.units.buildString(`energy`,data$1.energyClutchToBellHousing,0),name:`Q clutch to bell housing`}]}return(_ctx,_cache)=>data.value?(openBlock(),createElementBlock(`div`,_hoisted_1$190,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value,(set,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`set`},[createBaseVNode(`div`,_hoisted_2$155,toDisplayString(set.name),1),createBaseVNode(`div`,{class:normalizeClass([`set-value`,{"thermal-warning":set.warn,"thermal-error":set.error}])},toDisplayString(set.str),3)]))),128))])):createCommentVNode(``,!0)}},app_default$6=__plugin_vue_export_helper_default(_sfc_main$213,[[`__scopeId`,`data-v-c0f00383`]]),_hoisted_1$189={width:`100%`,height:`100%`,viewBox:`0 0 244 244`},_hoisted_2$154=[`transform`],_sfc_main$212={__name:`app`,setup(__props){let streamsList$1=[`sensors`],{$game}=useLibStore(),arrow$3=ref(null),circle=ref(null),yawDegrees=ref(0),bbox=computed(()=>arrow$3.value?arrow$3.value.getBBox():null),rotateOrigin=computed(()=>bbox.value?`${yawDegrees.value} ${bbox.value.x+bbox.value.width/2} ${bbox.value.y+bbox.value.height/2}`:0);onMounted(()=>{$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;yawDegrees.value=streams.sensors.yaw*180/Math.PI+180}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$189,[createBaseVNode(`g`,{ref_key:`circle`,ref:circle,transform:`rotate(${rotateOrigin.value})`},[..._cache[0]||=[createStaticVNode(`NESW`,5)]],8,_hoisted_2$154),createBaseVNode(`path`,{d:`M122 90 L105 154 L139 154 Z`,ref_key:`arrow`,ref:arrow$3,class:`arrow`},null,512)]))}},app_default$7=__plugin_vue_export_helper_default(_sfc_main$212,[[`__scopeId`,`data-v-4a5918e7`]]),compassWidth=2e3,_sfc_main$211={__name:`app`,setup(__props){let streamsList$1=[`sensors`],{$game}=useLibStore(),app$1=ref(null),canvas=ref(null),osCanvas=ref(null),widthLess=computed(()=>(compassWidth-canvas.value.width)/2),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight});onMounted(()=>{initOsCanvas(),appResizeObserver.observe(app$1.value),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;let canvasCtx=canvas.value.getContext(`2d`);canvasCtx.clearRect(0,0,canvas.value.width,canvas.value.height),canvasCtx.fillStyle=`rgba(255,255,255,0.8)`,canvasCtx.strokeStyle=`rgba(255,255,255,0.6)`;let heading=streams.sensors.yaw,posX=heading*compassWidth/(2*Math.PI)-widthLess.value;canvasCtx.drawImage(osCanvas.value,posX,0),heading*compassWidth/(2*Math.PI)-widthLess.value>0?canvasCtx.drawImage(osCanvas.value,posX-compassWidth,0):posX+compassWidth(openBlock(),createElementBlock(`div`,{class:`container`,ref_key:`app`,ref:app$1},[createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas,width:`280`,height:`56`},null,512),createBaseVNode(`canvas`,{ref_key:`osCanvas`,ref:osCanvas,class:`os-canvas`},null,512)],512))}},app_default$8=__plugin_vue_export_helper_default(_sfc_main$211,[[`__scopeId`,`data-v-e608df6a`]]),_hoisted_1$188={transform:`translate(-13.701535,-283.48656)`,style:{display:`inline`},id:`carGroup`},_hoisted_2$153={y:`255.49614`,x:`142.73175`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`18.66665649px`,"line-height":`1.25`,"font-family":`roboto`,"-inkscape-font-specification":`roboto`,"letter-spacing":`0px`,"word-spacing":`0px`,fill:`#ffffff`},"xml:space":`preserve`},componentDamageMap={body:{FL:{svgId:`bodyFL`,priority:2,tempDamage:!1},FR:{svgId:`bodyFR`,priority:2,tempDamage:!1},ML:{svgId:`bodyML`,priority:2,tempDamage:!1},MR:{svgId:`bodyMR`,priority:2,tempDamage:!1},RL:{svgId:`bodyRL`,priority:2,tempDamage:!1},RR:{svgId:`bodyRR`,priority:2,tempDamage:!1}},engine:{oilStarvation:{svgId:`engine`,priority:0,damageText:`Oil Starvation`,tempDamage:!0},coolantHot:{svgId:`engine`,priority:0,damageText:`Coolant Overheating`,tempDamage:!1},oilHot:{svgId:`engine`,priority:0,damageText:`Oil Overheating`,tempDamage:!1},pistonRingsDamaged:{svgId:`engine`,priority:0,damageText:`Piston Rings Damaged`,tempDamage:!1},rodBearingsDamaged:{svgId:`engine`,priority:0,damageText:`Rod Bearings Damaged`,tempDamage:!1},headGasketDamaged:{svgId:`engine`,priority:0,damageText:`Head Gasket Damaged`,tempDamage:!1},turbochargerHot:{svgId:`engine`,priority:0,damageText:`Turbocharger Overheating`,tempDamage:!1},engineIsHydrolocking:{svgId:`engine`,priority:0,damageText:`Engine is Hydrolocking`,tempDamage:!1},engineReducedTorque:{svgId:`engine`,priority:0,damageText:`Engine Torque Reduced`,tempDamage:!1},mildOverrevDamage:{svgId:`engine`,priority:0,damageText:`Mild Over Rev Damage`,tempDamage:!1},overRevDanger:{svgId:`engine`,priority:0,damageText:`Over Rev Risk`,tempDamage:!1},overTorqueDanger:{svgId:`engine`,priority:0,damageText:`Over Torque Risk`,tempDamage:!1},engineHydrolocked:{svgId:`engine`,priority:1,damageText:`Engine is Hydrolocked`,tempDamage:!1},engineDisabled:{svgId:`engine`,priority:1,damageText:`Engine Disabled`,tempDamage:!1},blockMelted:{svgId:`engine`,priority:1,damageText:`Block Melted`,tempDamage:!1},engineLockedUp:{svgId:`engine`,priority:1,damageText:`Engine Locked Up`,tempDamage:!1},radiatorLeak:{svgId:`radiator`,priority:1,damageText:`Radiator Leaking`,tempDamage:!1}},powertrain:{wheelaxleFL:{svgId:`wheelaxleFL`,priority:1,damageText:`Front Left Axle Broken`,tempDamage:!1},wheelaxleFR:{svgId:`wheelaxleFR`,priority:1,damageText:`Front Right Axle Broken`,tempDamage:!1},wheelaxleRL:{svgId:`wheelaxleRL`,priority:1,damageText:`Rear Left Axle Broken`,tempDamage:!1},wheelaxleRR:{svgId:`wheelaxleRR`,priority:1,damageText:`Rear Right Axle Broken`,tempDamage:!1},driveshaft:{svgId:`driveshaft`,priority:1,damageText:`Driveshaft Broken`,tempDamage:!1},driveshaft_F:{svgId:`driveshaft`,priority:1,damageText:`Front Driveshaft Broken`,tempDamage:!1},mainEngine:{svgId:`engine`,priority:1,damageText:`Engine Broken`,tempDamage:!1}},energyStorage:{mainTank:{svgId:`fueltank`,priority:1,damageText:`Fuel Tank Damaged`,tempDamage:!1}},wheels:{tireFL:{svgId:`tireFL`,priority:0,damageText:`Front Left Tire Burst`,tempDamage:!1},tireFR:{svgId:`tireFR`,priority:0,damageText:`Front Right Tire Burst`,tempDamage:!1},tireRL:{svgId:`tireRL`,priority:0,damageText:`Rear Left Tire Burst`,tempDamage:!1},tireRR:{svgId:`tireRR`,priority:0,damageText:`Rear Right Tire Burst`,tempDamage:!1},brakeFL:{svgId:`brakeFL`,priority:1,damageText:`FL Brake Damaged`,tempDamage:!1},brakeFR:{svgId:`brakeFR`,priority:1,damageText:`FR Brake Damaged`,tempDamage:!1},brakeRL:{svgId:`brakeRL`,priority:1,damageText:`RL Brake Damaged`,tempDamage:!1},brakeRR:{svgId:`brakeRR`,priority:1,damageText:`RR Brake Damaged`,tempDamage:!1},brakeOverHeatFL:{svgId:`brakeFL`,priority:0,damageText:`FL Brake Fading`,tempDamage:!0},brakeOverHeatFR:{svgId:`brakeFR`,priority:0,damageText:`FR Brake Fading`,tempDamage:!0},brakeOverHeatRL:{svgId:`brakeRL`,priority:0,damageText:`RL Brake Fading`,tempDamage:!0},brakeOverHeatRR:{svgId:`brakeRR`,priority:0,damageText:`RR Brake Fading`,tempDamage:!0},FL:{svgId:`tireFL`,priority:1,damageText:`Front Left Tire Broken`,tempDamage:!1},FR:{svgId:`tireFR`,priority:1,damageText:`Front Right Tire Broken`,tempDamage:!1},RL:{svgId:`tireRL`,priority:1,damageText:`Rear Left Tire Broken`,tempDamage:!1},RR:{svgId:`tireRR`,priority:1,damageText:`Rear Right Tire Broken`,tempDamage:!1}}},textDisplayTime=2e3,orangeColor=`rgba(255, 132, 0, 0.6)`,redColor=`rgba(255, 0, 0, 0.6)`,noDataColor=`rgba(0, 0, 0, 0 )`,streamsList=[`wheelThermalData`,`engineInfo`],_sfc_main$210={__name:`app`,setup(__props){let{$game}=useLibStore(),svg=ref(null),tireFL=ref(null),tireFR=ref(null),tireRL=ref(null),tireRR=ref(null),bodyFL=ref(null),bodyML=ref(null),bodyMR=ref(null),driveShaft=ref(null),engine=ref(null),fueltank=ref(null),radiator=ref(null),wheelaxleFL=ref(null),wheelaxleFR=ref(null),brakeFL=ref(null),brakeFR=ref(null),bodyFR=ref(null),bodyRL=ref(null),bodyRR=ref(null),brakeRL=ref(null),brakeRR=ref(null),wheelaxleRL=ref(null),wheelaxleRR=ref(null),damageContainer=ref(null),damageBox=ref(null),damageText=ref(null),appState=reactive({isAppDisplayed:!1,hasDamage:!1,permanentDamagedParts:0,isProcessingMessages:!1}),damageTextQueue=ref([]),componentDamage=ref({body:{FL:{damageDisplayed:!1,reference:bodyFL},FR:{damageDisplayed:!1,reference:bodyFR},ML:{damageDisplayed:!1,reference:bodyML},MR:{damageDisplayed:!1,reference:bodyMR},RL:{damageDisplayed:!1,reference:bodyRL},RR:{damageDisplayed:!1,reference:bodyRR}},engine:{oilStarvation:{damageDisplayed:!1,reference:engine},coolantHot:{damageDisplayed:!1,reference:engine},oilHot:{damageDisplayed:!1,reference:engine},pistonRingsDamaged:{damageDisplayed:!1,reference:engine},rodBearingsDamaged:{damageDisplayed:!1,reference:engine},headGasketDamaged:{damageDisplayed:!1,reference:engine},turbochargerHot:{damageDisplayed:!1,reference:engine},engineIsHydrolocking:{damageDisplayed:!1,reference:engine},engineReducedTorque:{damageDisplayed:!1,reference:engine},mildOverrevDamage:{damageDisplayed:!1,reference:engine},overRevDanger:{damageDisplayed:!1,reference:engine},overTorqueDanger:{damageDisplayed:!1,reference:engine},engineHydrolocked:{damageDisplayed:!1,reference:engine},engineDisabled:{damageDisplayed:!1,reference:engine},blockMelted:{damageDisplayed:!1,reference:engine},engineLockedUp:{damageDisplayed:!1,reference:engine},radiatorLeak:{damageDisplayed:!1,reference:radiator}},powertrain:{wheelaxleFL:{damageDisplayed:!1,reference:wheelaxleFL},wheelaxleFR:{damageDisplayed:!1,reference:wheelaxleFR},wheelaxleRL:{damageDisplayed:!1,reference:wheelaxleRL},wheelaxleRR:{damageDisplayed:!1,reference:wheelaxleRR},driveshaft:{damageDisplayed:!1,reference:driveShaft},driveshaft_F:{damageDisplayed:!1,reference:driveShaft},mainEngine:{damageDisplayed:!1,reference:engine}},energyStorage:{mainTank:{damageDisplayed:!1,reference:fueltank}},wheels:{tireFL:{damageDisplayed:!1,reference:tireFL},tireFR:{damageDisplayed:!1,reference:tireFR},tireRL:{damageDisplayed:!1,reference:tireRL},tireRR:{damageDisplayed:!1,reference:tireRR},brakeFL:{damageDisplayed:!1,reference:brakeFL},brakeFR:{damageDisplayed:!1,reference:brakeFR},brakeRL:{damageDisplayed:!1,reference:brakeRL},brakeRR:{damageDisplayed:!1,reference:brakeRR},brakeOverHeatFL:{damageDisplayed:!1,reference:brakeFL},brakeOverHeatFR:{damageDisplayed:!1,reference:brakeFR},brakeOverHeatRL:{damageDisplayed:!1,reference:brakeRL},brakeOverHeatRR:{damageDisplayed:!1,reference:brakeRR},FL:{damageDisplayed:!1,reference:tireFL},FR:{damageDisplayed:!1,reference:tireFR},RL:{damageDisplayed:!1,reference:tireRL},RR:{damageDisplayed:!1,reference:tireRR}}}),damageTimeout=ref(null),animTimeout=ref(null);onMounted(()=>{$game.events.on(`DamageData`,onDamageData),$game.events.on(`VehicleReset`,onReset),$game.events.on(`VehicleChange`,onReset),$game.events.on(`VehicleFocusChanged`,onVehicleFocusChanged),$game.streams.add(streamsList)}),onUnmounted(()=>{$game.events.off(`DamageData`,onDamageData),$game.events.off(`VehicleReset`,onReset),$game.events.off(`VehicleChange`,onReset),$game.events.off(`VehicleFocusChanged`,onVehicleFocusChanged),$game.streams.remove(streamsList)});function onDamageData(data){for(let type in data)for(let component in data[type]){if(componentDamageMap[type]===void 0||componentDamageMap[type][component]===void 0)continue;let damagedComponent=componentDamage.value[type][component],damageComponentProps=componentDamageMap[type][component];if(!damagedComponent.damageDisplayed&&(data[type][component]===!0||data[type][component]>0)){if(damageComponentProps.priority===1)appState.permanentDamagedParts+=1,clearTimeout(damageTimeout.value),setComponentDamageStyles(damagedComponent.reference,redColor,`flashAnim`);else if(damageComponentProps.priority===0)appState.permanentDamagedParts+=1,clearTimeout(damageTimeout.value),setComponentDamageStyles(damagedComponent.reference,orangeColor,`flashAnim`);else if(damageComponentProps.priority===2){let damageAmount=Math.round(data[type][component]*1e3),bodyColor=`rgba(${150+damageAmount}, ${150-damageAmount}, 0, 0.6)`;setComponentDamageStyles(damagedComponent.reference,bodyColor,``)}appState.hasDamage=!0,damageComponentProps.damageText!==void 0&&(damageTextQueue.value.push(damageComponentProps.damageText),damagedComponent.damageDisplayed=!0)}else damageComponentProps.tempDamage&&(data[type][component]===!0||data[type][component]>0?setComponentDamageStyles(damagedComponent.reference,orangeColor,`flashAnim`):(damagedComponent.damageDisplayed=!1,appState.permanentDamagedParts=-1,setComponentDamageStyles(damagedComponent.reference,noDataColor,``)))}!appState.isAppDisplayed&&appState.hasDamage&&(appState.isAppDisplayed=!0,processDamageText(),appState.permanentDamagedParts===0?showAppTimed():clearTimeout(damageTimeout.value))}function processDamageText(){damageTextQueue.value&&damageTextQueue.value.length>0?(damageContainer.value.style.opacity=1,damageText.value.textContent=damageTextQueue.value[0],damageTextQueue.value.splice(0,1),animTimeout.value=setTimeout(processDamageText,textDisplayTime)):(damageContainer.value.style.opacity=0,damageText.value.textContent=``,clearTimeout(animTimeout.value))}function onReset(){for(let type in componentDamage.value)for(let component in componentDamage.value[type])componentDamage.value[type][component].reference.style.fill=noDataColor;appState.isAppDisplayed=!1,appState.hasDamage=!1,appState.permanentDamagedParts=0,damageTextQueue.value=[],showAppTimed()}function onVehicleFocusChanged(data){data.mode===!0&&onReset()}function showAppTimed(){damageTimeout.value&&clearTimeout(damageTimeout.value),appState.isAppDisplayed=!0,damageTimeout.value=setTimeout(function(){appState.isAppDisplayed=!1},2700)}function setComponentDamageStyles(componentRef,color,anim){componentRef.style.fill=color,anim===``?componentRef.classList=[]:componentRef.classList.add(anim)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,{ref_key:`svg`,ref:svg,class:`svg-app`,viewBox:`-20 -50 300 527`,style:normalizeStyle({opacity:appState.isAppDisplayed?1:0})},[createBaseVNode(`g`,_hoisted_1$188,[createBaseVNode(`path`,{ref_key:`tireFL`,ref:tireFL,d:`m 40.219516,385.93366 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 212.19799,385.43366 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,ref_key:`tireFR`,ref:tireFR},null,512),createBaseVNode(`path`,{ref_key:`tireRR`,ref:tireRR,d:`m 212.19799,654.14795 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 40.219516,654.14795 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,ref_key:`tireRL`,ref:tireRL},null,512),createBaseVNode(`path`,{ref_key:`bodyFL`,ref:bodyFL,d:`m 139.30351,268.73244 c 0,0 -20.06962,-0.0115 -32.7295,1.35397 -11.849388,1.27802 -23.33457,5.11217 -35.698872,11.89174 -11.963689,6.55991 -22.259598,16.59274 -27.506842,31.58729 -3.060137,8.74465 -3.902495,25.39725 -3.902495,25.39725 l 9.609942,-0.14814 c 0,0 1.636978,-16.52695 5.208997,-24.93149 3.978738,-9.3615 11.635356,-19.52025 21.213285,-24.53523 10.627835,-5.56471 18.689453,-8.01564 32.759185,-10.2291 11.61143,-1.82671 31.13813,-1.14019 31.13813,-1.14019 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`bodyML`,ref:bodyML,d:`m 46.365238,434.85859 c 0,0 -4.37766,0.0905 -6.56641,0.125 -0.0234,2.215 -0.08,17.90873 -0.125,26.86328 0,0 -20.45068,7.80958 -22.22461,10.85938 -1.79329,3.0831 -4.63644,8.09161 -2.46289,8.46094 0,0 25.14091,-3.55661 25.60352,-3.40821 0.0618,2.25563 -0.62153,126.52252 -0.59375,127.77539 1.21285,-0.002 9.6289,0.0312 9.6289,0.0312 l -0.01,-170.70703 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`bodyMR`,ref:bodyMR,d:`m 236.6054,434.90159 -0.0117,170.70899 c 0,0 7.91605,-0.0352 9.1289,-0.0332 0.0278,-1.25287 -0.65555,-125.51976 -0.59375,-127.77539 0.46261,-0.1484 25.60352,3.40821 25.60352,3.40821 2.17355,-0.36933 -0.6696,-5.37589 -2.46289,-8.45899 -1.77393,-3.0498 -22.22266,-10.85937 -22.22266,-10.85937 -0.045,-8.95456 -0.10355,-24.64828 -0.12695,-26.86328 -2.18875,-0.0345 -9.31447,-0.12697 -9.31447,-0.12697 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`driveShaft`,ref:driveShaft,d:`m 146.88019,519.13977 0.34682,-126.1992 c 0,0 14.81582,-18.06715 -4.26439,-17.94569 -19.92,0.12681 -4.95719,17.95354 -4.95719,17.95354 l 0.0408,126.25385 c -0.48292,33.8145 0.52349,126.53492 0.52349,126.53492 -3.70809,6.93305 -6.96405,16.59296 4.6368,16.4848 11.45601,-0.10682 8.66714,-8.10662 4.65438,-16.55312 -1.97544,-4.15814 -0.98066,-126.5291 -0.98066,-126.5291 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`0.99999976`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`engine`,ref:engine,d:`m 122.07373,314.95322 h 33.63152 v 5.9272 h -13.25677 v 5.34505 h 12.93926 l 6.08594,9.31416 h 5.37155 v 4.97461 h 6.00656 v -5.05399 h 8.22927 c 0,0 2.66605,2.98563 3.2282,4.8423 1.71505,5.66443 1.56492,12.04739 0,17.75512 -0.61276,2.23494 -3.54572,5.98011 -3.54572,5.98011 h -7.93821 v -5.39797 h -6.29763 v 11.32517 h -34.98103 l -6.50934,-7.93822 H 113.0771 v -16.51145 h -5.98011 v 15.87643 h -5.1863 v -28.89508 h 4.97462 v 7.62066 h 6.29764 v -7.72651 h 8.99664 v -5.98013 h 14.12999 v -6.19179 h -14.23585 z`,style:{display:`inline`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{d:`m 117.17264,721.33809 -7.7414,-9.05075 c 0,0 -1.6874,1.50785 -2.481,2.29715 -0.685,0.6814 -1.3051,1.5911 0.2757,3.6525 0.5444,0.7098 3.2227,3.9338 3.7903,4.5024 1.6325,1.6355 2.5754,1.6201 3.3309,1.0108 0.9517,-0.7675 2.8255,-2.4121 2.8255,-2.4121 z m -5.4902,-9.02777 c -0.2639,-0.33031 -0.3782,-0.42184 0.023,-0.78103 0.2875,-0.31046 1.9506,-1.87788 2.2512,-2.13637 0.2218,-0.19078 0.3561,-0.42492 0.1149,-0.7236 -0.2412,-0.33308 -2.1908,-2.68012 -2.4982,-3.06097 -0.2198,-0.27232 -0.2732,-0.32108 -0.2732,-0.50554 0,-0.75917 0.011,-34.43177 0.015,-35.00437 0,-0.2149 0.056,-0.3086 0.5162,-0.3086 h 51.67845 c 2.0683,0 3.0251,0.3486 4.3679,1.4435 1.1871,0.9678 2.1659,2.0917 2.17,4.6095 0,0 0.065,37.07605 0.065,38.41705 0,1.2398 -0.1967,4.1364 -1.6325,5.5294 -1.0614,1.0299 -3.8532,1.8924 -4.9438,1.8924 -1.5414,0 -37.80368,-0.016 -38.25553,-0.016 -0.32906,0 -0.70707,-0.079 -0.93514,-0.3163 -0.27185,-0.2826 -2.9151,-3.0777 -3.22317,-3.371 -0.15862,-0.151 -0.25989,-0.4548 -0.64972,-0.097 -0.3899,0.3574 -1.73649,1.4573 -2.04669,1.7218 -0.1403,0.1197 -0.2841,0.2357 -0.5523,-0.032 -0.4136,-0.4769 -5.8261,-6.80285 -6.191,-7.25968 z m 20.26835,-10.96158 c -0.003,-4.55255 -0.0326,-8.19817 0,-12.74562 0,-0.7695 -0.32724,-0.97794 -1.30987,-1.85445 -0.76302,-0.68063 -1.41614,-1.23286 -1.90915,-1.69336 -0.36587,-0.34178 -0.85706,-0.80537 -0.84008,-1.1791 0.0258,-0.56967 0.59396,-1.0422 0.93428,-1.21472 0.54578,-0.27667 0.94727,-0.0528 1.23375,0.23366 0.30382,0.30381 1.84818,1.77993 2.58906,2.39496 0.44759,0.37156 0.58562,0.67733 1.67741,0.67733 5.46749,-0.0217 12.23023,-0.18415 18.32732,0 1.09189,0 1.22992,-0.30577 1.67737,-0.67733 0.74089,-0.61503 2.28521,-2.09115 2.58911,-2.39496 0.2865,-0.28643 0.688,-0.51033 1.2338,-0.23366 0.3404,0.17252 0.9085,0.64505 0.9344,1.21472 0.017,0.37373 -0.4743,0.83732 -0.8402,1.1791 -0.493,0.4605 -1.1461,1.01273 -1.909,1.69336 -0.98279,0.87651 -1.30997,1.08495 -1.30997,1.85445 0,4.55255 0.0323,8.19817 0,12.74562 0,0.76951 0.32718,0.97793 1.30997,1.85447 0.7629,0.68062 1.416,1.23285 1.909,1.69335 0.3659,0.34177 0.857,0.80537 0.8402,1.1791 -0.026,0.56967 -0.594,1.04219 -0.9344,1.21472 -0.5458,0.27667 -0.9473,0.0528 -1.2338,-0.23366 -0.3039,-0.30382 -1.84822,-1.77992 -2.58911,-2.39497 -0.44745,-0.37154 -0.58548,-0.67731 -1.67737,-0.67731 -6.55155,0.019 -11.82218,0.18501 -18.32732,0 -1.09179,0 -1.22982,0.30577 -1.67741,0.67731 -0.74088,0.61505 -2.28524,2.09115 -2.58906,2.39497 -0.28648,0.28644 -0.68797,0.51033 -1.23375,0.23366 -0.34032,-0.17253 -0.90842,-0.64505 -0.93428,-1.21472 -0.017,-0.37373 0.47421,-0.83733 0.84008,-1.1791 0.49301,-0.4605 1.14613,-1.01273 1.90915,-1.69335 0.98263,-0.87654 1.30987,-1.08496 1.30987,-1.85447 z m 2.56799,-10.35082 c 0,2.40538 0,5.36454 0,8.01339 0,0.63296 -0.0236,1.4238 0.45482,1.90048 0.45132,0.44967 1.08277,0.42233 1.81926,0.42233 h 13.2426 c 0.7365,0 1.36798,0.0273 1.81926,-0.42233 0.47837,-0.47668 0.45477,-1.26752 0.45477,-1.90048 v -3.94714 c 0,-1.35542 0,-2.71084 0,-4.06625 0,-0.63296 0.0233,-1.42381 -0.45477,-1.90047 -0.45128,-0.44969 -1.08276,-0.42234 -1.81926,-0.42234 h -13.2426 c -0.73649,0 -1.36794,-0.0273 -1.81926,0.42234 -0.47842,0.47666 -0.45482,1.26751 -0.45482,1.90047 z`,style:{fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},ref_key:`fueltank`,ref:fueltank},null,512),createBaseVNode(`path`,{d:`m 162.19586,303.74311 v 1.62868 c 0,0 -0.0239,0.60243 0.40384,0.86252 0.36641,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -4.32093 c 0,0 -0.004,-0.63642 -0.53018,-0.91858 -0.27049,-0.14492 -2.81926,2.15048 -3.22871,2.49847 -0.49791,0.42318 -0.5886,0.94557 -0.5886,0.94557 z m -8.74296,-2.37979 v 4.00847 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36641,0.22282 3.17759,0.31545 3.59708,-0.042 0.34846,-0.29691 0.34657,-0.78069 0.34657,-0.78069 v -3.43014 c 0,0 -0.004,-0.63642 -0.53018,-0.91857 -0.27049,-0.14493 -2.94617,-0.75348 -3.2287,-0.64521 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.57375,1.15667 v 2.8518 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36641,0.22282 3.17759,0.31545 3.59708,-0.042 0.34846,-0.29691 0.34657,-0.78069 0.34657,-0.78069 v -3.78911 c 0,0 -0.002,-0.37799 -0.24416,-0.68051 -0.072,-0.09 -0.16527,-0.17335 -0.28602,-0.23806 -0.27049,-0.14492 -2.94617,0.76217 -3.2287,0.87043 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.63016,2.23357 v 0.61823 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36642,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -1.35611 c 0,0 -0.004,-0.63641 -0.53017,-0.91857 -0.2705,-0.14492 -2.94617,0.56274 -3.22871,0.671 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.50835,1.48075 c 0.36641,0.22282 3.17758,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.50066 0.34658,-0.50066 0,0 -0.004,-1.03528 -0.53018,-1.31744 -0.27049,-0.14492 -2.94617,-0.0851 -3.22871,0.0232 -0.61018,0.23381 -0.5886,1.10014 -0.5886,1.10014 0,0 -0.0239,0.47668 0.40384,0.73676 z m -9.0904,-2.1588 v 1.29628 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36642,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -0.5584 c 0,0 -0.004,-0.63642 -0.53017,-0.91858 -0.2705,-0.14492 -2.94617,-0.91301 -3.22871,-0.80474 -0.61019,0.23381 -0.5886,0.94556 -0.5886,0.94556 z m 52.345,1.37742 v -16.61221 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 16.63216 c 0,0 -0.004,0.63642 -0.53017,0.91857 -0.2705,0.14493 -2.94617,0.1552 -3.22871,0.0469 -0.61019,-0.23381 -0.5886,-0.94556 -0.5886,-0.94556 z m -8.79938,-16.61221 c 0,0 -0.0239,-0.60242 0.40384,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 3.32029 c 0,0 -0.004,0.63641 -0.53018,0.91857 -0.27049,0.14492 -2.60773,-2.10106 -3.22871,-2.63237 -0.4965,-0.42482 -0.5886,-0.97378 -0.5886,-0.97378 z m -8.74296,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59708,0.042 0.34846,0.29692 0.34657,0.78069 0.34657,0.78069 v 1.74529 c 0,0 -0.004,0.63642 -0.53018,0.91857 -0.27049,0.14493 -2.94617,-0.12683 -3.2287,-0.2351 -0.61019,-0.23381 -0.5886,-0.77636 -0.5886,-0.77636 z m -8.57375,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59708,0.042 0.34846,0.29692 0.34657,0.78069 0.34657,0.78069 v 1.80688 c 0,0 -0.002,0.378 -0.24416,0.68052 -0.072,0.09 -0.16527,0.17335 -0.28602,0.23805 -0.27049,0.14493 -2.94617,1.1141 -3.2287,1.00584 -0.61019,-0.23381 -0.5886,-0.81866 -0.5886,-0.81866 z m -8.63016,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 4.46516 c 0,0 -0.004,0.63641 -0.53017,0.91857 -0.2705,0.14493 -2.94617,0.97309 -3.22871,0.86482 -0.61019,-0.23381 -0.6027,-0.81866 -0.6027,-0.81866 z m -8.91219,0 c 0,0 -0.0239,-0.60242 0.40384,-0.86252 0.36641,-0.22281 3.17758,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 6.04004 c 0,0 -0.004,0.63641 -0.53018,0.91857 -0.27049,0.14493 -2.94617,-0.0986 -3.22871,-0.2069 -0.61018,-0.23381 -0.5886,-0.90327 -0.5886,-0.90327 z m -8.68656,4.20791 v -4.20791 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 4.90473 c 0,0 -0.004,0.63641 -0.53017,0.91857 -0.2705,0.14492 -2.94617,-0.52168 -3.22871,-0.62994 -0.61019,-0.23382 -0.5886,-0.94557 -0.5886,-0.94557 z m 0.0383,3.38266 0.0424,3.80682 c 4.76147,1.58463 12.44208,1.37115 18.62715,0.76876 4.9084,-0.47805 9.46499,-3.13968 14.38678,-3.45098 2.56844,-0.16246 7.67481,0.84058 7.67481,0.84058 l 0.018,4.52569 c 0,0 4.30181,-3.85868 6.85434,-6.08209 0.23182,-0.21672 0.26026,-0.28202 -0.0588,-0.61036 -2.4793,-2.37833 -6.8878,-6.08125 -6.8878,-6.08125 l 0.0141,4.90206 c 0,0 -5.19129,-1.89571 -12.24908,-0.16859 -3.96245,1.32729 -6.76872,2.21825 -10.27188,2.769 -2.7191,0.42749 -5.4997,0.55723 -8.24775,0.4009 -3.33921,-0.18995 -6.69491,-0.50286 -9.90211,-1.62054 z m -15.25121,10.1713 c 0,0.39543 -0.18036,1.62226 1.45209,3.25472 1.40638,1.19302 2.9727,1.1712 3.41028,1.1712 23.19944,0.0992 44.97243,0.0226 68.7019,0 0.43758,0 2.0039,0.0218 3.41029,-1.1712 1.63245,-1.63246 1.45208,-2.85929 1.45208,-3.25472 0.12422,-16.06162 0.0264,-3.05893 0,-19.25937 0,-0.39543 0.18037,-1.62225 -1.45208,-3.25471 -1.40639,-1.19302 -2.97271,-1.1712 -3.41029,-1.1712 -23.19944,-0.0992 -44.97243,-0.0226 -68.7019,0 -0.43758,0 -2.0039,-0.0218 -3.41028,1.1712 -1.63245,1.63246 -1.45209,2.85928 -1.45209,3.25471 -0.11802,17.21566 -0.0338,3.97954 0,19.25937 z m 1.90997,-17.51991 c 0,-0.36657 -0.12323,-2.09175 1.14118,-3.35617 1.05214,-0.89259 3.06543,-0.74668 3.48144,-0.74668 22.55947,-0.021 43.30609,-0.0919 65.36168,0 1.3185,0 2.52269,-0.19776 3.66518,0.74727 1.05732,1.05732 0.95743,2.19932 0.95743,3.35558 0.0252,15.01782 0.11812,0.8913 0,15.78046 0,1.5229 -0.0428,2.46913 -0.90102,3.32738 -1.06456,0.88061 -2.31847,0.77547 -3.72159,0.77547 -22.55947,0.021 -43.30609,0.0919 -65.36168,0 -1.7721,0 -2.45712,0.11664 -3.44156,-0.68686 -1.36393,-1.36393 -1.18106,-1.95258 -1.18106,-3.41599 0.12429,-15.20955 -0.092,-2.68107 0,-15.78046 z m 4.56001,16.37025 v -16.61221 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.1776,-0.31544 3.59708,0.042 0.34846,0.29692 0.34658,0.78069 0.34658,0.78069 v 16.63216 c 0,0 -0.004,0.63642 -0.53019,0.91857 -0.27048,0.14493 -2.94617,0.1552 -3.2287,0.0469 -0.61019,-0.23381 -0.5886,-0.94556 -0.5886,-0.94556 z`,style:{display:`inline`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`0.75000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},ref_key:`radiator`,ref:radiator},null,512),createBaseVNode(`path`,{ref_key:`wheelaxleFL`,ref:wheelaxleFL,d:`m 91.691145,389.0121 c 0,0 -2.43068,0.29676 -2.43068,-4.28053 0,-4.0406 2.22866,-4.30576 2.22866,-4.30576 9.222155,-0.11908 21.694875,-0.0585 30.917405,-0.0594 3.70837,-9.1e-4 6.85841,-0.28274 8.24298,0.90893 0.51207,0.44072 0.75871,1.92799 1.01166,3.17533 0.35371,1.74427 0.74974,2.96105 0.32477,3.71154 -0.50969,0.90009 -2.57006,0.96141 -2.57006,0.96141 -11.49186,0.003 -26.23329,-0.0229 -37.724735,-0.11152 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 193.49174,389.0121 c 0,0 2.43068,0.29676 2.43068,-4.28053 0,-4.0406 -2.22865,-4.30576 -2.22865,-4.30576 -9.22216,-0.11908 -21.44488,-0.0585 -30.66742,-0.0594 -3.70837,-9.1e-4 -6.85841,-0.28274 -8.24298,0.90893 -0.51207,0.44072 -0.75871,1.92799 -1.01166,3.17533 -0.35371,1.74427 -0.74974,2.96105 -0.32477,3.71154 0.50969,0.90009 2.57006,0.96141 2.57006,0.96141 11.49186,0.003 25.98329,-0.0229 37.47474,-0.11152 z`,ref_key:`wheelaxleFR`,ref:wheelaxleFR},null,512),createBaseVNode(`path`,{ref_key:`brakeFR`,ref:brakeFR,d:`m 210.35279,373.43366 h -5.22322 l -0.0446,-11.25 c 0,0 -0.0446,-1.02679 -1.51786,-1.16071 -0.91518,-0.15626 -3.83928,-0.067 -3.83928,-0.067 0,0 -2.04238,-0.11866 -2.0759,1.22768 -0.0626,2.51339 -0.0446,47.43304 -0.0446,47.43304 0,0 -0.0431,1.36663 1.7634,1.40625 1.21935,0.0262 3.83928,0.005 3.83928,0.005 0,0 1.86958,0.12132 1.96428,-1.61256 0.073,-1.33729 -0.0207,-10.46221 -0.0207,-10.46221 l 5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`brakeFL`,ref:brakeFL,d:`m 74.826658,373.43366 h 5.22322 l 0.0446,-11.25 c 0,0 0.0446,-1.02679 1.51786,-1.16071 0.91518,-0.15626 3.83928,-0.067 3.83928,-0.067 0,0 2.04238,-0.11866 2.0759,1.22768 0.0626,2.51339 0.0446,47.43304 0.0446,47.43304 0,0 0.0431,1.36663 -1.7634,1.40625 -1.21935,0.0262 -3.83928,0.005 -3.83928,0.005 0,0 -1.86958,0.12132 -1.96428,-1.61256 -0.073,-1.33729 0.0207,-10.46221 0.0207,-10.46221 l -5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 145.98404,268.73244 c 0,0 19.06962,-0.0115 31.7295,1.35397 11.84939,1.27802 23.33457,5.11217 35.69887,11.89174 11.96369,6.55991 22.2596,16.59274 27.50684,31.58729 3.06014,8.74465 3.9025,25.39725 3.9025,25.39725 l -9.60995,-0.14814 c 0,0 -1.63697,-16.52695 -5.20899,-24.93149 -3.97874,-9.3615 -11.63536,-19.52025 -21.21329,-24.53523 -10.62783,-5.56471 -18.68945,-8.01564 -32.75918,-10.2291 -11.61143,-1.82671 -30.13813,-1.14019 -30.13813,-1.14019 z`,ref_key:`bodyFR`,ref:bodyFR},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 139.36946,758.05809 c 0,0 -20.14699,0.01 -32.81319,-1.1024 -11.855294,-1.0405 -23.346203,-4.162 -35.716671,-9.6818 -11.969654,-5.3407 -20.679708,-11.5646 -25.929569,-23.7724 -3.061663,-7.1197 -5.495432,-24.34913 -5.495432,-24.34913 l 9.614735,0.12066 c 0,0 1.637794,15.18257 5.211595,22.02527 3.980722,7.6218 11.817934,15.0086 21.40064,19.0916 10.633134,4.5306 18.345219,5.9957 32.421962,7.798 11.61723,1.487 31.39781,0.9282 31.39781,0.9282 z`,ref_key:`bodyRL`,ref:bodyRL},null,512),createBaseVNode(`path`,{ref_key:`bodyRR`,ref:bodyRR,d:`m 145.99795,758.05809 c 0,0 19.59077,0.01 32.25697,-1.1024 11.8553,-1.0405 23.34621,-4.162 35.71668,-9.6818 11.96965,-5.3407 20.67971,-11.5646 25.92957,-23.7724 3.06166,-7.1197 5.49543,-24.34913 5.49543,-24.34913 l -9.61473,0.12066 c 0,0 -1.6378,15.18257 -5.2116,22.02527 -3.98072,7.6218 -11.81793,15.0086 -21.40064,19.0916 -10.63314,4.5306 -18.34522,5.9957 -32.42197,7.798 -11.61723,1.487 -30.84159,0.9282 -30.84159,0.9282 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 75.326658,641.12409 h 5.22322 l 0.0446,-11.25 c 0,0 0.0446,-1.02679 1.51786,-1.16071 0.91518,-0.15626 3.83928,-0.067 3.83928,-0.067 0,0 2.04238,-0.11866 2.0759,1.22768 0.0626,2.51339 0.0446,47.43304 0.0446,47.43304 0,0 0.0431,1.36663 -1.7634,1.40625 -1.21935,0.0262 -3.83928,0.005 -3.83928,0.005 0,0 -1.86958,0.12132 -1.96428,-1.61256 -0.073,-1.33729 0.0207,-10.46221 0.0207,-10.46221 l -5.24395,-0.12581 z`,ref_key:`brakeRL`,ref:brakeRL},null,512),createBaseVNode(`path`,{ref_key:`brakeRR`,ref:brakeRR,d:`m 209.87792,642.37917 h -5.22322 l -0.0446,-11.25 c 0,0 -0.0446,-1.02679 -1.51786,-1.16071 -0.91518,-0.15626 -3.83928,-0.067 -3.83928,-0.067 0,0 -2.04238,-0.11866 -2.0759,1.22768 -0.0626,2.51339 -0.0446,47.43304 -0.0446,47.43304 0,0 -0.0431,1.36663 1.7634,1.40625 1.21935,0.0262 3.83928,0.005 3.83928,0.005 0,0 1.86958,0.12132 1.96428,-1.61256 0.073,-1.33729 -0.0207,-10.46221 -0.0207,-10.46221 l 5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 92.206308,649.46453 c 0,0 -2.43068,-0.29676 -2.43068,4.28053 0,4.0406 2.22866,4.30576 2.22866,4.30576 9.222162,0.11908 21.444882,0.0585 30.667412,0.0594 3.70837,9.1e-4 8.80295,0.28274 10.18752,-0.90893 0.51207,-0.44072 0.6941,-2.38196 0.90117,-3.66147 0.26289,-1.62435 0.42635,-2.41047 0.26953,-3.25855 -0.21138,-1.14316 -2.40433,-0.92826 -2.40433,-0.92826 -12.14004,-6.2e-4 -27.27967,0.0179 -39.419282,0.11152 z`,ref_key:`wheelaxleRL`,ref:wheelaxleRL},null,512),createBaseVNode(`path`,{ref_key:`wheelaxleRR`,ref:wheelaxleRR,d:`m 192.84519,649.46453 c 0,0 2.43068,-0.29676 2.43068,4.28053 0,4.0406 -2.22866,4.30576 -2.22866,4.30576 -9.22216,0.11908 -20.31988,0.0585 -29.54242,0.0594 -3.70837,9.1e-4 -8.80295,0.28274 -10.18752,-0.90893 -0.51207,-0.44072 -0.6941,-2.38196 -0.90117,-3.66147 -0.26289,-1.62435 -0.42635,-2.41047 -0.26953,-3.25855 0.21138,-1.14316 2.40433,-0.92826 2.40433,-0.92826 12.14004,-6.2e-4 26.15468,0.0179 38.29429,0.11152 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`g`,{style:{opacity:`0`},ref_key:`damageContainer`,ref:damageContainer},[createBaseVNode(`rect`,{style:{opacity:`0.77399998`,fill:`#3e3e3e`,"stroke-width":`1.99999893`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`},ref_key:`damageBox`,ref:damageBox,width:`206.75557`,height:`28.991379`,x:`39.481575`,y:`234.25491`},null,512),_cache[0]||=createBaseVNode(`path`,{style:{opacity:`1`,fill:`none`,stroke:`#ffffff`,"stroke-width":`1.99999893`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 39.48159,263.2463 206.75556,-2e-5`},null,-1),createBaseVNode(`text`,_hoisted_2$153,[createBaseVNode(`tspan`,{ref_key:`damageText`,ref:damageText,style:{"text-align":`center`,"text-anchor":`middle`,fill:`#ffffff`},y:`255.49614`,x:`142.73175`},` Driveshaft Broken `,512)])],512)])],4))}},app_default$9=__plugin_vue_export_helper_default(_sfc_main$210,[[`__scopeId`,`data-v-f6aa177d`]]),_hoisted_1$187={class:`timeslip`,id:`slip`},_hoisted_2$152={class:`paper`},_hoisted_3$136={class:`header`},_hoisted_4$113={class:`table-wrapper`},_hoisted_5$98={class:`custom-table`},_hoisted_6$81={class:`left-align`},_hoisted_7$69={class:`right-align`},_hoisted_8$56={class:`right-align`},_hoisted_9$50={key:0},_hoisted_10$43={class:`right-align`},_hoisted_11$38={class:`right-align`},_hoisted_12$28={class:`header`},_hoisted_13$25={class:`left`},_hoisted_14$24={class:`right`},_hoisted_15$23={class:`name`},_hoisted_16$23={key:0,class:`rewards`},_hoisted_17$18={class:`reward`},_hoisted_18$16={class:`header`},_hoisted_19$13={key:0},_sfc_main$209={__name:`Timeslip`,props:{slip:Object},setup(__props){let{units}=useBridge(),props=__props,TIMER_ROWS_INFO=[{key:`laneName`,label:`Lane`},{key:null,label:``},{key:`dial`,label:`DIAL`},{key:`reactionTime`,label:`R/T`},{key:`time_60`,label:`60'`},{key:`time_330`,label:`330'`},{key:`time_1_8`,label:`1/8`},{key:`velAt_1_8_kmh`,label:`KM/H`},{key:`velAt_1_8_mph`,label:`MPH`},{key:`time_1000`,label:`1000'`},{key:`time_1_4`,label:`1/4`},{key:`velAt_1_4_kmh`,label:`KM/H`},{key:`velAt_1_4_mph`,label:`MPH`},{key:`dialDiff`,label:`DIFF`}],getRacerByLane=laneNum=>props.slip.racerInfos.find(racer=>racer.laneNum===laneNum),getTimerValue=(laneNum,timerKey)=>{let racer=getRacerByLane(laneNum);if(!racer)return`-`;if(timerKey===null)return``;if(timerKey===`laneName`)return racer.lane||`-`;if(timerKey===`dial`){if(props.slip.dragType!==`bracketRace`)return`-`;let racer$1=getRacerByLane(laneNum);if(!racer$1)return`-`;let value=racer$1.timers.dial;if(value==null)return`-`;let num=parseFloat(value);return isNaN(num)?`-`:num.toFixed(3)}if(timerKey===`dialDiff`){if(props.slip.dragType!==`bracketRace`)return`-`;let racer$1=getRacerByLane(laneNum);if(!racer$1)return`-`;let value=racer$1.dialDiff;return value==null?`-`:formatDialDiff(value)}if(timerKey.includes(`velAt_`)){if(timerKey.includes(`_kmh`)){let baseKey=timerKey.replace(`_kmh`,``);return racer.velocities[baseKey+`_km/h`]||`-`}else if(timerKey.includes(`_mph`)){let baseKey=timerKey.replace(`_mph`,``);return racer.velocities[baseKey+`_mph`]||`-`}}return racer.timers[timerKey]||`-`},formatDialDiff=value=>{if(value===`-`)return`-`;let num=parseFloat(value);return isNaN(num)?`-`:(num>0?`+`:``)+num.toFixed(3)},getWinnerResult=laneNum=>{let racer=getRacerByLane(laneNum);if(!racer)return`-`;if(racer.disqualification)return`DQ`;if(props.slip.racerInfos.length===1)return`-`;let otherRacer=getRacerByLane(laneNum===1?2:1);if(!otherRacer)return`-`;if(otherRacer.disqualification)return`WINNER`;if(props.slip.dragType===`bracketRace`){let thisDiff=parseFloat(racer.dialDiff),otherDiff=parseFloat(otherRacer.dialDiff);return thisDiff===otherDiff?`TIE`:thisDiff>0&&otherDiff>0?thisDiffotherDiff?`WINNER`:`Break Out`}else{let thisTime=parseFloat(racer.finalTime),otherTime=parseFloat(otherRacer.finalTime);return thisTime>otherTime?`+${(thisTime-otherTime).toFixed(3)}`:`WINNER`}};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$187,[_cache[3]||=createBaseVNode(`div`,{class:`rip reverse top`},null,-1),createBaseVNode(`div`,_hoisted_2$152,[createBaseVNode(`div`,_hoisted_3$136,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slip.stripInfo,info=>(openBlock(),createElementBlock(`div`,{key:info},toDisplayString(_ctx.$tt(info)),1))),128))]),createBaseVNode(`div`,_hoisted_4$113,[createBaseVNode(`table`,_hoisted_5$98,[createBaseVNode(`tbody`,null,[(openBlock(),createElementBlock(Fragment,null,renderList(TIMER_ROWS_INFO,(rowInfo,rowIndex)=>createBaseVNode(`tr`,{key:`timer-`+rowIndex,class:normalizeClass({"quarter-mile-row":rowInfo.key===`time_1_4`})},[createBaseVNode(`td`,_hoisted_6$81,toDisplayString(rowInfo.label),1),createBaseVNode(`td`,_hoisted_7$69,toDisplayString(getTimerValue(2,rowInfo.key)),1),createBaseVNode(`td`,_hoisted_8$56,toDisplayString(getTimerValue(1,rowInfo.key)),1)],2)),64)),__props.slip.racerInfos.length>1?(openBlock(),createElementBlock(`tr`,_hoisted_9$50,[_cache[0]||=createBaseVNode(`td`,{class:`left-align`},null,-1),createBaseVNode(`td`,_hoisted_10$43,toDisplayString(getWinnerResult(2)),1),createBaseVNode(`td`,_hoisted_11$38,toDisplayString(getWinnerResult(1)),1)])):createCommentVNode(``,!0)])])]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slip.racerInfos,racer=>(openBlock(),createElementBlock(`div`,{key:racer.name,class:`racer`},[createBaseVNode(`div`,_hoisted_12$28,[createBaseVNode(`div`,_hoisted_13$25,toDisplayString(racer.lane),1),createBaseVNode(`div`,_hoisted_14$24,toDisplayString(racer.licenseText),1)]),createBaseVNode(`div`,_hoisted_15$23,toDisplayString(racer.name),1),Object.keys(racer.rewards).length===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_16$23,[_cache[1]||=createTextVNode(` Rewards... `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(racer.rewards,reward=>(openBlock(),createElementBlock(`div`,_hoisted_17$18,[createTextVNode(toDisplayString(reward)+` BMRA-XP `,1),createVNode(unref(bngIcon_default),{class:`reward-icon`,type:unref(icons).wheelOutline,color:`black`},null,8,[`type`])]))),256)),_cache[2]||=createBaseVNode(`template`,null,[createTextVNode(` ... `)],-1)]))]))),128)),createBaseVNode(`div`,_hoisted_18$16,[createBaseVNode(`div`,null,toDisplayString(unref(units).buildString(`temperature`,__props.slip.env.tempC,1,`c`))+` / `+toDisplayString(unref(units).buildString(`temperature`,__props.slip.env.tempC,1,`f`)),1),__props.slip.env.customGrav?(openBlock(),createElementBlock(`div`,_hoisted_19$13,toDisplayString(_ctx.$tt(`ui.environment.gravity`))+`: `+toDisplayString(__props.slip.env.gravity),1)):createCommentVNode(``,!0)])]),_cache[4]||=createBaseVNode(`div`,{class:`rip bottom`},null,-1)]))}},Timeslip_default=__plugin_vue_export_helper_default(_sfc_main$209,[[`__scopeId`,`data-v-4b627404`]]),_hoisted_1$186={key:0,class:`bng-app`,id:`container`},_hoisted_2$151={class:`slide`},_sfc_main$208={__name:`app`,setup(__props){let{$game}=useLibStore(),slip=ref({});onMounted(()=>{$game.events.on(`onDragRaceTimeslipData`,onDragRaceTimeslipData)}),onUnmounted(()=>{$game.events.off(`onDragRaceTimeslipData`,onDragRaceTimeslipData)});function onDragRaceTimeslipData(rawData){slip.value=rawData,rawData&&(console.log(rawData),Lua_default.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Missions>Timeslip`))}let screenshot=function(){Lua_default.gameplay_drag_dragBridge.screenshotTimeslip()},clear=function(){slip.value=null};return(_ctx,_cache)=>slip.value&&slip.value.stripInfo?(openBlock(),createElementBlock(`div`,_hoisted_1$186,[createBaseVNode(`div`,_hoisted_2$151,[createVNode(Timeslip_default,{slip:slip.value,save:``,clear:``},null,8,[`slip`]),createVNode(unref(bngIcon_default),{class:`clear`,type:unref(icons).trashBin1,onClick:clear},null,8,[`type`]),createVNode(unref(bngIcon_default),{class:`save`,type:unref(icons).floppyDisk,onClick:screenshot},null,8,[`type`])])])):createCommentVNode(``,!0)}},app_default$10=__plugin_vue_export_helper_default(_sfc_main$208,[[`__scopeId`,`data-v-84d60911`]]),_hoisted_1$185={key:0},_hoisted_2$150={class:`lights-container`},_hoisted_3$135={class:`circles-wrapper`},_hoisted_4$112={class:`stage-circle`},_hoisted_5$97={class:`stage-top`},_hoisted_6$80={class:`stage-middle`},_hoisted_7$68={class:`stage-bottom`},_hoisted_8$55={class:`circles-wrapper`},_hoisted_9$49={class:`circles-wrapper`},_hoisted_10$42={class:`circles-wrapper`},_hoisted_11$37={class:`circles-wrapper`},_sfc_main$207={__name:`Treelights`,setup(__props){let events$3=useEvents(),isStaging=ref(!1),stageLights=ref([{stageLights:{prestageLight:!1,stageLight:!1},countDownLights:{amberLight1:!1,amberLight2:!1,amberLight3:!1,greenLight:!1,redLight:!1},globalLights:{blueLight:!1}}]),updateLights=changes=>{changes.stageLights&&(stageLights.value[0].stageLights={...stageLights.value[0].stageLights,...changes.stageLights}),changes.countDownLights&&(stageLights.value[0].countDownLights={...stageLights.value[0].countDownLights,...changes.countDownLights},(changes.countDownLights.greenLight||changes.countDownLights.redLight)&&setTimeout(()=>{isStaging.value=!1},2e3))},updateStaging=isNearby=>{isStaging.value=isNearby};return onMounted(()=>{events$3.on(`updateTreeLightApp`,updateLights),events$3.on(`updateTreeLightStaging`,updateStaging)}),onUnmounted(()=>{events$3.off(`updateTreeLightApp`,updateLights),events$3.off(`updateTreeLightStaging`,updateStaging)}),(_ctx,_cache)=>isStaging.value.valueOf==0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$185,[createBaseVNode(`div`,_hoisted_2$150,[createBaseVNode(`div`,_hoisted_3$135,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{blue:stageLights.value[0].globalLights.blueLight,red:stageLights.value[0].countDownLights.redLight}])},[withDirectives(createBaseVNode(`div`,_hoisted_4$112,[withDirectives(createBaseVNode(`div`,_hoisted_5$97,[..._cache[0]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.prestageLight]]),withDirectives(createBaseVNode(`div`,_hoisted_6$80,[..._cache[1]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.prestageLight&&stageLights.value[0].stageLights.stageLight]]),withDirectives(createBaseVNode(`div`,_hoisted_7$68,[..._cache[2]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.stageLight]])],512),[[vShow,!stageLights.value[0].countDownLights.redLight]])],2)]),createBaseVNode(`div`,_hoisted_8$55,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight1,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_9$49,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight2,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_10$42,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight3,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_11$37,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black go`,{green:stageLights.value[0].countDownLights.greenLight,red:stageLights.value[0].countDownLights.redLight}])},null,2)])])]))}},Treelights_default=__plugin_vue_export_helper_default(_sfc_main$207,[[`__scopeId`,`data-v-c2ff1007`]]),_sfc_main$206={__name:`bngModifierTiles`,props:{modifierActionInfos:{type:Object,required:!0}},setup(__props){let{isControllerUsed}=storeToRefs(controls_default()),props=__props,controllerActions=computed(()=>{let mod1Active=props.modifierActionInfos.customModifier1?.active,mod2Active=props.modifierActionInfos.customModifier2?.active,mod1Disabled=props.modifierActionInfos.customModifier1?.disabled,mod2Disabled=props.modifierActionInfos.customModifier2?.disabled,mod1modifier2Disabled=props.modifierActionInfos.modifier1modifier2?.disabled;return[{actions:[{actionName:`customModifier2`}],active:!mod2Disabled&&mod2Active&&!mod1Active,disabled:mod2Disabled},{actions:[{actionName:`customModifier2`},{actionName:`customModifier1`}],active:!mod1modifier2Disabled&&mod1Active&&mod2Active,disabled:mod1modifier2Disabled},{actions:[{actionName:`customModifier1`}],active:!mod1Disabled&&mod1Active&&!mod2Active,disabled:mod1Disabled}]}),kbmActions=computed(()=>{props.modifierActionInfos.shift?.active;let ctrlActive=props.modifierActionInfos.ctrl?.active!==void 0,altActive=props.modifierActionInfos.alt?.active!==void 0;return[{active:ctrlActive,actions:[{actionName:`kbmModifier1`,device:`keyboard0`,deviceKey:`ctrl`}]},{active:altActive,actions:[{actionName:`kbmModifier3`,device:`keyboard0`,deviceKey:`alt`}]}]}),entries=computed(()=>isControllerUsed.value?controllerActions.value:kbmActions.value),getModifierClass=entry=>{let cls=`modifier-tile`;return entry.active&&(cls+=` active`),entry.disabled&&(cls+=` disabled`),cls};return(_ctx,_cache)=>(openBlock(!0),createElementBlock(Fragment,null,renderList(entries.value,entry=>(openBlock(),createElementBlock(`div`,{class:normalizeClass(getModifierClass(entry))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(entry.actions,(action,actionIdx)=>(openBlock(),createElementBlock(`div`,{key:actionIdx},[actionIdx>0?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`mathPlus`})):createCommentVNode(``,!0),createVNode(unref(bngBinding_default),{action:action.actionName,device:action.device,"device-key":action.deviceKey,"show-unassigned":!1},null,8,[`action`,`device`,`device-key`])]))),128))],2))),256))}},bngModifierTiles_default=__plugin_vue_export_helper_default(_sfc_main$206,[[`__scopeId`,`data-v-ea01b9d8`]]),_hoisted_1$184={key:0,class:`bng-app-binding-display`},_hoisted_2$149={key:0,class:`modifier-bindings`},_hoisted_3$134={class:`label-column`},_hoisted_4$111={key:0,class:`label-text`},_hoisted_5$96={class:`binding-column`},_hoisted_6$79={class:`flexible-area`},_hoisted_7$67={class:`label-column`},_hoisted_8$54={key:0,class:`label-text`},_hoisted_9$48={class:`binding-column`},_hoisted_10$41={key:0,class:`tile-flex`},_hoisted_11$36={key:1,class:`bottom-left-group`},_sfc_main$205={__name:`bngAppBindingDisplay`,setup(__props){let events$3=useEvents(),actions=shallowRef([]),tileActions=shallowRef([]),constantActions=shallowRef([]),modifierActionInfos=shallowRef([]),additionalData=shallowRef({}),isFaded=ref(!1),isHovered=ref(!1),mouseDownAction=ref(``),actionOpacity=ref(1),fadeOutTimeout=null,isFadingOut=ref(!1),showApp=ref(!0),tileRefs=ref([]),isWide=ref([]),narrowSpan=ref(4),setActions=data=>{let newActions=Array.isArray(data.actions)?data.actions:[];showApp.value=data.showApp,constantActions.value=Array.isArray(data.constantActions)?data.constantActions:[],modifierActionInfos.value=data.modifierActionInfos?{...data.modifierActionInfos}:{},additionalData.value=data.additionalData?{...data.additionalData}:{},fadeOutTimeout&&(clearTimeout(fadeOutTimeout),fadeOutTimeout=null,isFadingOut.value=!1),actions.value.length>0&&newActions.length===0?(isFadingOut.value=!0,actionOpacity.value=0,fadeOutTimeout=setTimeout(()=>{actions.value=newActions,actionOpacity.value=1,isFadingOut.value=!1,fadeOutTimeout=null},0)):newActions.length>0&&actions.value.length===0?(actions.value=newActions,actionOpacity.value=0,nextTick(()=>{actionOpacity.value=1})):(actions.value=newActions,actionOpacity.value=1),tileActions.value=actions.value.filter(action=>action.icon),actions.value=actions.value.filter(action=>!action.icon)},getActionClass=(action,isConstant)=>{let cls=`binding-row`;return isConstant?cls+=` is-constant`:isFadingOut.value&&(cls+=` is-fading-out`),!action.onClick&&!action.inputActionOnClick&&(cls+=` no-hover`),action.highlighted&&(cls+=` highlighted`),cls},onActionClickDown=action=>{action.onClick?runRaw(action.onClick):action.inputActionOnClick&&(mouseDownAction.value=action.action,Lua_default.ui_bindingsLegend.triggerInputAction(action.action,1))},onMouseEnter=()=>{isHovered.value=!0},onMouseLeave=()=>{isHovered.value=!1},onGlobalMouseUp=event=>{mouseDownAction.value&&=(Lua_default.ui_bindingsLegend.triggerInputAction(mouseDownAction.value,0),``)};onMounted(()=>{events$3.on(`setActionsForLegend`,setActions),events$3.on(`setBindingsLegendFade`,value=>{isFaded.value=!!value}),Lua_default.ui_bindingsLegend.sendDataToUI(!0),listenFilteredInputEvents(!0),document.addEventListener(`mouseup`,onGlobalMouseUp)}),onBeforeUnmount(()=>{document.removeEventListener(`mouseup`,onGlobalMouseUp),fadeOutTimeout&&=(clearTimeout(fadeOutTimeout),null),actionOpacity.value=1,listenFilteredInputEvents(!1)});function listenFilteredInputEvents(listen){events$3[listen?`on`:`off`](`FilteredInputChanged`,onFilteredInputChanged),Lua_default.WinInput.setForwardFilteredEvents(listen)}function onFilteredInputChanged(data){let updated$2=!1;for(let action of tileActions.value)action.action===data.bindingAction&&(action.value=data.value,updated$2=!0);updated$2&&triggerRef(tileActions)}function setTileRef(i,compOrEl){tileRefs.value[i]=compOrEl&&compOrEl.$el?compOrEl.$el:compOrEl}function classifyTiles(){isWide.value=tileRefs.value.map(el=>!!el?.querySelector?.(`.combo-binding`))}function pickNarrowSpanByCount(n){let options=[{cols:4,span:3},{cols:3,span:4},{cols:2,span:6}],best=options[0],bestR=n%best.cols;for(let opt of options){let r=n%opt.cols;r{await nextTick(),tileRefs.value.length=tileActions.value.length,classifyTiles(),recomputeLayout()}),onMounted(async()=>{await nextTick(),classifyTiles(),recomputeLayout()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-app-binding-display-wrapper`,{"is-faded":isFaded.value&&!isHovered.value}]),onMouseenter:onMouseEnter,onMouseleave:onMouseLeave},[showApp.value?(openBlock(),createElementBlock(`div`,_hoisted_1$184,[modifierActionInfos.value&&additionalData.value.vehicleSpecificStatus!==`enabled`?(openBlock(),createElementBlock(`div`,_hoisted_2$149,[createVNode(bngModifierTiles_default,{"modifier-action-infos":modifierActionInfos.value},null,8,[`modifier-action-infos`])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(constantActions.value,action=>(openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).custom,onMousedown:$event=>onActionClickDown(action),tabindex:`-1`,class:normalizeClass(getActionClass(action,!0))},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$134,[action.label?(openBlock(),createElementBlock(`span`,_hoisted_4$111,toDisplayString(_ctx.$t(action.label)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$96,[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))])]),_:2},1032,[`accent`,`onMousedown`,`class`]))),256)),createBaseVNode(`div`,_hoisted_6$79,[(openBlock(!0),createElementBlock(Fragment,null,renderList(actions.value,(action,index)=>(openBlock(),createBlock(unref(bngButton_default),{key:action.action||action.label,accent:unref(ACCENTS).custom,onMousedown:$event=>onActionClickDown(action),tabindex:`-1`,ref_for:!0,ref:index===0?`actionButton`:void 0,class:normalizeClass(getActionClass(action,!1))},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$67,[action.label?(openBlock(),createElementBlock(`span`,_hoisted_8$54,toDisplayString(_ctx.$t(action.label)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$48,[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))])]),_:2},1032,[`accent`,`onMousedown`,`class`]))),128)),tileActions.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$41,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tileActions.value,(action,i)=>(openBlock(),createBlock(unref(bngBindingTileButton_default),{class:normalizeClass([`tile-grid-item`,{highlighted:action.highlighted}]),action,icon:action.icon,label:_ctx.$t(action.label),layout:action.direction,showValueBar:action.direction!==void 0,isBidirectional:action.isCentered,value:action.value,style:{"--tile-span":4},ref_for:!0,ref:el=>setTileRef(i,el),"show-unassigned":``,"action-variants":``,"bng-no-nav":``,tabindex:`-1`},{default:withCtx(()=>[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))]),_:2},1032,[`class`,`action`,`icon`,`label`,`layout`,`showValueBar`,`isBidirectional`,`value`]))),256))])):createCommentVNode(``,!0)])])):createCommentVNode(``,!0),showApp.value?(openBlock(),createElementBlock(`div`,_hoisted_11$36,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`bottom-left-button`,disabled:additionalData.value.vehicleSpecificStatus===`inactive`,accent:additionalData.value.vehicleSpecificStatus===`enabled`||additionalData.value.vehicleSpecificStatus===`fleeting`?unref(ACCENTS).main:unref(ACCENTS).text,onClick:_cache[0]||=$event=>unref(Lua_default).ui_bindingsLegend.toggleShowVehicleSpecificActions(),"bng-no-nav":``,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:unref(icons).car},null,8,[`type`]),additionalData.value.vehicleSpecificStatus===`enabled`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`bottom-left-lock`,type:unref(icons).lockClosed},null,8,[`type`])):createCommentVNode(``,!0)]),_:1},8,[`disabled`,`accent`])),[[unref(BngTooltip_default),`Press to show/hide vehicle specific actions`,`right`]])])):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{class:`bottom-left-button`,accent:unref(ACCENTS).text,icon:unref(icons).eyeSolidOpened,onClick:_cache[1]||=$event=>unref(Lua_default).ui_bindingsLegend.toggleShowApp(),"bng-no-nav":``,tabindex:`-1`},null,8,[`accent`,`icon`])],34))}},bngAppBindingDisplay_default=__plugin_vue_export_helper_default(_sfc_main$205,[[`__scopeId`,`data-v-cf4052e5`]]),_hoisted_1$183={class:`action`},_hoisted_2$148={key:0,class:`indicators`},_hoisted_3$133={class:`icon-wrapper`},_hoisted_4$110={key:2,class:`tile-fallback-label`},_hoisted_5$95={key:0,class:`value-bar`},_hoisted_6$78={class:`bindings-wrapper`},_sfc_main$204={__name:`bngBindingTileButton`,props:{label:String,icon:[Object,String],showIndicators:{type:Boolean,default:!1},layout:{type:String,default:`horizontal`,validator:v=>[`horizontal`,`vertical`].includes(v)},dark:Boolean,disabled:Boolean,action:{type:Object,required:!0},bindings:{type:Array,default:()=>void 0},actionVariants:Boolean,showValueBar:{type:Boolean,default:!0},value:{type:Number,default:0},targetValue:{type:Number,default:0},isBidirectional:{type:Boolean,default:!1}},emits:[`click`],setup(__props,{expose:__expose}){let props=__props,layoutClass=computed(()=>props.layout===`vertical`?`layout-vertical`:`layout-horizontal`);__expose({icons});let isLikelyImagePath=val=>typeof val==`string`&&(val.includes(`/`)||val.startsWith(`.`)||val.includes(`\\`)),candidateIcon=computed(()=>props.icon??null),useGlyphIcon=computed(()=>{let c=candidateIcon.value;return c?typeof c==`object`?!!c.glyph:typeof c==`string`?!isLikelyImagePath(c)&&c in icons:!1:!1}),resolvedGlyphType=computed(()=>useGlyphIcon.value?candidateIcon.value:null),resolvedImagePath=computed(()=>{let c=candidateIcon.value;return typeof c==`string`&&isLikelyImagePath(c)?c:null});return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),{class:`bng-binding-tile-button`,accent:unref(ACCENTS).custom,disabled:__props.disabled,onClick:_cache[0]||=$event=>_ctx.$emit(`click`)},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`content`,layoutClass.value])},[createBaseVNode(`div`,_hoisted_1$183,[__props.showIndicators?(openBlock(),createElementBlock(`div`,_hoisted_2$148,[(openBlock(),createElementBlock(Fragment,null,renderList(5,i=>createBaseVNode(`div`,{class:normalizeClass([`indicator`,{active:i===2}]),key:i},null,2)),64))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$133,[useGlyphIcon.value?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`icon-glyph`,type:resolvedGlyphType.value},null,8,[`type`])):resolvedImagePath.value?(openBlock(),createBlock(unref(bngImageAsset_default),{key:1,externalSrc:resolvedImagePath.value,class:`icon-img`,mask:``},null,8,[`externalSrc`])):__props.label?(openBlock(),createElementBlock(`div`,_hoisted_4$110,toDisplayString(__props.label),1)):createCommentVNode(``,!0)])]),__props.showValueBar?(openBlock(),createElementBlock(`div`,_hoisted_5$95,[createVNode(unref(bngInputBar_default),{value:__props.value,"target-value":__props.targetValue,"is-bidirectional":__props.isBidirectional,vertical:__props.layout==`vertical`},null,8,[`value`,`target-value`,`is-bidirectional`,`vertical`])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$78,[renderSlot(_ctx.$slots,`binding`,{},()=>[__props.action&&__props.action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:__props.action.action,device:binding.device,"device-key":binding.control,dark:__props.dark,"show-unassigned":``,"action-variants":__props.actionVariants,vertical:__props.layout===`vertical`},null,8,[`action`,`device`,`device-key`,`dark`,`action-variants`,`vertical`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,vertical:__props.layout===`vertical`,action:__props.action&&__props.action.action,dark:__props.dark,"show-unassigned":``,"action-variants":__props.actionVariants},null,8,[`vertical`,`action`,`dark`,`action-variants`]))],!0)])],2)]),_:3},8,[`accent`,`disabled`]))}},bngBindingTileButton_default=__plugin_vue_export_helper_default(_sfc_main$204,[[`__scopeId`,`data-v-db243a30`]]),_hoisted_1$182={class:`message-container`},_sfc_main$203={__name:`bngFlashMessage`,props:{messageSource:{type:String,default:`ScenarioFlashMessage`}},setup(__props){let props=__props,events$3=useEvents(),{api:api$1}=useBridge(),txt=ref(``),messageQueue=ref([]),stepTimeout=ref(null),animationClass=ref(``),fontSizeClass=ref(`font-small`),paused=ref(!1);onMounted(()=>{events$3.on(props.messageSource,data=>{if(Array.isArray(data))data.forEach(item=>{let messageObject={msg:item[0],ttl:item[1],luaCall:item[2]&&typeof item[2]==`string`?item[2]:void 0,jsCallback:item[2]&&typeof item[2]==`function`?item[2]:void 0,big:item[3]===void 0?!1:item[3]};messageQueue.value.push(messageObject)}),messageQueue.value.length>0&&!stepTimeout.value&&playMessagesAnimation();else if(typeof data==`object`){let messageObject={msg:data.msg,ttl:data.ttl,luaCall:data.luaCall||void 0,jsCallback:data.jsCallback||void 0,big:data.big===void 0?!1:data.big};messageQueue.value.push(messageObject),stepTimeout.value||playMessagesAnimation()}else console.warn(`Unexpected data format received for FlashMessage`)}),events$3.on(`physicsStateChanged`,state=>{paused.value=!state,paused.value?stepTimeout.value&&=(clearTimeout(stepTimeout.value),null):state&&playMessagesAnimation()})}),onUnmounted(()=>{stepTimeout.value&&=(clearTimeout(stepTimeout.value),null)});function playMessagesAnimation(){if(messageQueue.value.length===0){resetCountdown();return}animationClass.value=`fade-in`,setTimeout(()=>{animationClass.value=``},200);let msg=messageQueue.value[0];txt.value=msg.msg,fontSizeClass.value=msg.big?`font-large`:`font-small`,msg.luaCall&&typeof msg.luaCall==`string`&&api$1.engineLua(msg.luaCall),msg.jsCallback&&typeof msg.jsCallback==`function`&&msg.jsCallback(),messageQueue.value.shift(),setTimeout(()=>{animationClass.value=`fade-out`},msg.ttl*1e3-200),stepTimeout.value=setTimeout(()=>{playMessagesAnimation()},msg.ttl*1e3)}function resetCountdown(){stepTimeout.value&&clearTimeout(stepTimeout.value),messageQueue.value=[],txt.value=``,stepTimeout.value=null}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$182,[createBaseVNode(`div`,{class:normalizeClass([`message`,[`message`,animationClass.value,fontSizeClass.value]])},toDisplayString(txt.value),3)]))}},bngFlashMessage_default=__plugin_vue_export_helper_default(_sfc_main$203,[[`__scopeId`,`data-v-02941c3f`]]),_hoisted_1$181={class:`track`},_sfc_main$202={__name:`bngInputBar`,props:{value:{type:Number,default:0},targetValue:{type:Number,default:0},isBidirectional:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1}},setup(__props){let props=__props,isVertical=computed(()=>props.vertical),clamp$2=(v,min$1,max$1)=>Math.min(max$1,Math.max(min$1,v)),toUnits=(v,bidir)=>{let vv=clamp$2(v,bidir?-1:0,1);return bidir?(vv+1)/2:vv},zeroUnits=computed(()=>props.isBidirectional?.5:0),actualUnits=computed(()=>toUnits(props.value,props.isBidirectional)),targetUnits=computed(()=>toUnits(props.targetValue,props.isBidirectional)),makeFillStyle=units=>{if(!isVertical.value){if(props.isBidirectional){let start=Math.min(units,zeroUnits.value),end=Math.max(units,zeroUnits.value);return{left:`${start*100}%`,right:`${(1-end)*100}%`}}return{left:`0%`,right:`${(1-units)*100}%`}}if(props.isBidirectional){let start=Math.min(units,zeroUnits.value),end=Math.max(units,zeroUnits.value);return{bottom:`${start*100}%`,top:`${(1-end)*100}%`}}return{bottom:`0%`,top:`${(1-units)*100}%`}},actualStyle=computed(()=>makeFillStyle(actualUnits.value)),targetStyle=computed(()=>makeFillStyle(targetUnits.value)),showTarget=computed(()=>props.targetValue!==void 0&&props.targetValue!==null),knobStyle=computed(()=>isVertical.value?{bottom:`calc(${actualUnits.value*100}% - 2px)`}:{left:`calc(${actualUnits.value*100}% - 2px)`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-input-bar`,{bidirectional:__props.isBidirectional,vertical:isVertical.value}])},[createBaseVNode(`div`,_hoisted_1$181,[showTarget.value?(openBlock(),createElementBlock(`div`,{key:0,class:`fill target`,style:normalizeStyle(targetStyle.value)},null,4)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`fill actual`,style:normalizeStyle(actualStyle.value)},null,4)]),createBaseVNode(`div`,{class:`knob`,style:normalizeStyle(knobStyle.value)},null,4)],2))}},bngInputBar_default=__plugin_vue_export_helper_default(_sfc_main$202,[[`__scopeId`,`data-v-30b04794`]]),_hoisted_1$180={key:1,class:`data-label`},_hoisted_2$147={key:2,class:`data-value`},_hoisted_3$132={key:3,class:`time-container`},_hoisted_4$109={class:`time-seconds`},_hoisted_5$94={class:`time-milliseconds`},_hoisted_6$77={key:4,class:`data-value-extra`},_sfc_main$201={__name:`bngSimpleDataDisplay`,props:{label:{type:String,default:``},value:{type:[String,Number,Object,Array],default:``},icon:{type:String,default:``},minutes:{type:String},seconds:{type:String},milliseconds:{type:String}},setup(__props){let props=__props,iconType$1=computed(()=>props.icon);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`simple-data-display`,{"with-icon":__props.icon}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:iconType$1.value,class:`icon`},null,8,[`type`])):createCommentVNode(``,!0),__props.label&&!__props.icon?(openBlock(),createElementBlock(`div`,_hoisted_1$180,toDisplayString(__props.label),1)):createCommentVNode(``,!0),_ctx.$slots.default?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$147,toDisplayString(__props.value),1)),props.minutes||props.seconds?(openBlock(),createElementBlock(`div`,_hoisted_3$132,[createBaseVNode(`span`,{class:normalizeClass({"time-minutes":!0,zero:__props.minutes===`00`})},toDisplayString(props.minutes),3),_cache[1]||=createTextVNode(` :`,-1),createBaseVNode(`span`,_hoisted_4$109,toDisplayString(props.seconds),1),props.milliseconds?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createTextVNode(` .`,-1),createBaseVNode(`span`,_hoisted_5$94,toDisplayString(props.milliseconds),1)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),_ctx.$slots.default?(openBlock(),createElementBlock(`div`,_hoisted_6$77,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0)],2))}},bngSimpleDataDisplay_default=__plugin_vue_export_helper_default(_sfc_main$201,[[`__scopeId`,`data-v-f2b79846`]]),_sfc_main$200={__name:`app`,props:{showFlash:{type:Boolean,default:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createVNode(Treelights_default),props.showFlash?(openBlock(),createBlock(unref(bngFlashMessage_default),{key:0,"message-source":`DragRaceTreeFlashMessage`})):createCommentVNode(``,!0)]))}},app_default$11=_sfc_main$200,_hoisted_1$179={class:`stage-indicator-container`},_hoisted_2$146={class:`stage-bar`},_hoisted_3$131={key:0,class:`segment grey-segment top`},_hoisted_4$108={key:1,class:`segment grey-segment bottom`},_hoisted_5$93={class:`indicator-line`},THROTTLE_MS=1,HIDE_DELAY_MS=5e3,_sfc_main$199={__name:`app`,setup(__props){let events$3=useEvents(),stageDistance=ref(-100),isVisible$1=ref(!0),hideTimeout,isDetailedView=computed(()=>stageDistance.value>-1&&stageDistance.value<1),indicatorPosition=computed(()=>isDetailedView?70-(stageDistance.value+1)*20:stageDistance.value<-1?10-stageDistance.value:30-(stageDistance.value-1)*(30/3)),lastUpdate=0;function updateStageApp(distance){let now$1=performance.now();now$1-lastUpdate{isVisible$1.value=!1},HIDE_DELAY_MS))}return onMounted(()=>{events$3.on(`updateStageApp`,updateStageApp)}),onUnmounted(()=>{lastUpdate=0,clearTimeout(hideTimeout),events$3.off(`updateStageApp`,updateStageApp)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,null,toDisplayString(stageDistance.value),1),withDirectives(createBaseVNode(`div`,_hoisted_1$179,[createBaseVNode(`div`,_hoisted_2$146,[isDetailedView.value?(openBlock(),createElementBlock(`div`,_hoisted_3$131)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`middle-section`,{"align-top":!isDetailedView.value&&stageDistance.value<-1,"align-bottom":!isDetailedView.value&&stageDistance.value>1}])},[isDetailedView.value?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`segment deep-stage`,style:{height:`20px`}},null,-1),_cache[1]||=createBaseVNode(`div`,{class:`segment stage`,style:{height:`40px`}},null,-1),_cache[2]||=createBaseVNode(`div`,{class:`segment pre-stage`,style:{height:`40px`}},null,-1)],64)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`segment green-segment`,{top:stageDistance.value<-1,bottom:stageDistance.value>1}])},null,2))],2),stageDistance.value<=1?(openBlock(),createElementBlock(`div`,_hoisted_4$108)):createCommentVNode(``,!0)]),createBaseVNode(`div`,{class:`distance-indicator`,style:normalizeStyle({top:indicatorPosition.value+`%`})},[createBaseVNode(`div`,_hoisted_5$93,[createBaseVNode(`div`,{class:normalizeClass([`car-icon`,{"car-icon-detailed":isDetailedView.value}])},null,2)])],4)],512),[[vShow,isVisible$1.value&&stageDistance.value>=-4&&stageDistance.value<=4]])],64))}},app_default$12=__plugin_vue_export_helper_default(_sfc_main$199,[[`__scopeId`,`data-v-5245723d`]]),_hoisted_1$178={class:`main-container drift-app`},_hoisted_2$145={class:`cached-score-wrapper`},_hoisted_3$130={class:`added-score`},_hoisted_4$107={class:`cached-score`},_hoisted_5$92={class:`score-container`},_hoisted_6$76={class:`score`},_hoisted_7$66={class:`combo-wrapper`},_hoisted_8$53=[`id`],_hoisted_9$47=[`id`],_hoisted_10$40=[`stop-color`],_hoisted_11$35=[`stop-color`],_hoisted_12$27=[`id`],_hoisted_13$24={class:`multiplier`,x:`0`,y:`15.5`,fill:`#fff`,"dominant-baseline":`hanging`,"text-anchor":`start`,style:{fontSize:`1.9rem`}},_hoisted_14$23=[`mask`],_hoisted_15$22=[`fill`],_hoisted_16$22={class:`remaining-time`},_hoisted_17$17={class:`wrapper`},_hoisted_18$15={class:`drift-bar`},_hoisted_19$12={class:`drift-scale`},_hoisted_20$11={class:`drift-progress-bar`},FAIL_ANIMATION_DURATION=900,_sfc_main$198={__name:`app`,props:{showFlash:{type:Boolean,default:!0}},setup(__props){let props=__props,{lua}=useBridge(),bgId=uniqueId(``,`_`),events$3=useEvents(),realtimeScorePoints=ref(0),realtimeScoreCombo=ref(0),creep=ref(0),remainingComboTime=ref(0),centerIcon=ref(null),centerMessage=ref(null),centerFailMessage=ref(null),scoreToAdd=ref(0),countdownTimer=null,countdownStartTime=null,delayTimer=null,startTimer=null,centerMessageTimer=null,bonusDisplayAdd=null,bonusDisplayDispose=null,bonusQueue=ref([]),bonusDisplay=ref([]),realtimeAngle=ref(0),steppedPerformanceFactor=ref(1),isCenterMessageFading=ref(!1),isFailActive=ref(!1),isFailAnimating=ref(!1),failAnimationStartTime=null,failAnimationTimer=null,currentModifier=ref(null),isModifierFading=ref(!1),modifierTimer=null;onMounted(()=>{let rafScheduled=!1,buffered={points:0,combo:0,remaining:0,creep:0,angle:0},flushBuffered=()=>{realtimeScorePoints.value=buffered.points,realtimeScoreCombo.value=buffered.combo,remainingComboTime.value=buffered.remaining,creep.value=buffered.creep,realtimeAngle.value=buffered.angle,rafScheduled=!1},scheduleFlush=()=>{rafScheduled||(rafScheduled=!0,requestAnimationFrame(flushBuffered))},streamsList$1=[`drift`];useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;buffered.points=streams.drift.realtimeCachedScoreFloored,buffered.combo=streams.drift.realtimeCombo,buffered.points>0&&(centerMessage.value=null),buffered.remaining=streams.drift.realtimeRemainingComboTime,buffered.creep=streams.drift.realtimeCreep,buffered.angle=-streams.drift.realtimeAngle,steppedPerformanceFactor.value=streams.drift.realtimePerformanceFactor,scheduleFlush()}),events$3.on(`setDriftRealtimeFail`,(reason,icon)=>{cancelTimers(),isFailActive.value=!0,isFailAnimating.value=!0,isCenterMessageFading.value=!1,centerFailMessage.value=reason,centerIcon.value=icon||``,bonusDisplay.value=[],creep.value=0;let initialComboTime=remainingComboTime.value;failAnimationStartTime=performance.now();let animateFailBar=timestamp=>{let elapsed=timestamp-failAnimationStartTime,progress=Math.max(0,1-elapsed/FAIL_ANIMATION_DURATION);remainingComboTime.value=initialComboTime*progress,progress>0&&(failAnimationTimer=requestAnimationFrame(animateFailBar))};failAnimationTimer=requestAnimationFrame(animateFailBar),centerMessageTimer&&clearTimeout(centerMessageTimer),setTimeout(()=>{isFailActive.value=!1,isFailAnimating.value=!1,remainingComboTime.value=0,failAnimationTimer&&=(cancelAnimationFrame(failAnimationTimer),null)},FAIL_ANIMATION_DURATION),centerMessageTimer=setTimeout(()=>{isCenterMessageFading.value=!0},1e3),setTimeout(()=>{centerFailMessage.value=null,centerIcon.value=null,isCenterMessageFading.value=!1},1500)}),events$3.on(`setDriftPersistentDriftScored`,(final,score,combo)=>{centerMessage.value=`+ `,scoreToAdd.value=final,bonusDisplay.value=[],startCountdown()}),events$3.on(`displayDriftScoreModifier`,msg=>{modifierTimer&&clearTimeout(modifierTimer),isModifierFading.value=!1,currentModifier.value=msg,modifierTimer=setTimeout(()=>{isModifierFading.value=!0},1500)})}),onUnmounted(()=>{cancelTimers(),centerMessageTimer&&clearTimeout(centerMessageTimer),clearInterval(bonusDisplayAdd),clearInterval(bonusDisplayDispose),failAnimationTimer&&cancelAnimationFrame(failAnimationTimer),modifierTimer&&clearTimeout(modifierTimer),window.removeEventListener(`resize`,onResize)});let barClass=computed(()=>({"bar-good":!isFailAnimating.value&&steppedPerformanceFactor.value>=3,"bar-warn":!isFailAnimating.value&&steppedPerformanceFactor.value<3,"bar-fail":isFailAnimating.value})),barVarsStyle=computed(()=>({"--bar-scale":String(Math.max(0,Math.min(1,remainingComboTime.value))),"--bar-visible":remainingComboTime.value<=.01?`hidden`:`visible`})),driftProgressStyle=computed(()=>{let pos=Math.abs(calculatePosition(realtimeAngle.value,thresholds,positions))/100;return{left:`50%`,width:`50%`,transform:`scaleX(${((realtimeAngle.value>0?1:-1)>0?1:-1)*(pos/2)})`,opacity:Math.abs(realtimeAngle.value)<7?`0.65`:`1`}}),formattedCombo=computed(()=>parseFloat(realtimeScoreCombo.value).toFixed(1)),formattedRealtimeAngle=computed(()=>Math.abs(Math.round(realtimeAngle.value))),layoutVersion=ref(0),tickLefts=computed(()=>positions.map(p$1=>`${(p$1+100)/2}%`)),onResize=()=>{layoutVersion.value++};window.addEventListener(`resize`,onResize);function cancelTimers(){countdownTimer&&=(cancelAnimationFrame(countdownTimer),null),delayTimer&&=(clearTimeout(delayTimer),null),startTimer&&=(clearTimeout(startTimer),null),failAnimationTimer&&=(cancelAnimationFrame(failAnimationTimer),null)}function startCountdown(){cancelTimers(),startTimer=setTimeout(()=>{let initialScore=scoreToAdd.value,scoreDwindleAnimDuration=1e3;function countdown(timestamp){countdownStartTime||=timestamp;let elapsedTime=timestamp-countdownStartTime;elapsedTime>=scoreDwindleAnimDuration?(scoreToAdd.value=0,countdownStartTime=null,delayTimer=setTimeout(()=>{scoreToAdd.value=-1,centerMessage.value=null,realtimeScorePoints.value=0,realtimeScoreCombo.value=0,creep.value=0,delayTimer=null},1e3)):(scoreToAdd.value=Math.floor(initialScore*(1-elapsedTime/scoreDwindleAnimDuration)),countdownTimer=requestAnimationFrame(countdown))}countdownTimer=requestAnimationFrame(countdown)},1250)}let thresholds=[-110,-60,-20,0,20,60,110],positions=[-100,-70,-35,0,35,70,100],calculatePosition=(y,thresholds$1,positions$1)=>{let clampedY=Math.max(thresholds$1[0],Math.min(thresholds$1[thresholds$1.length-1],y));for(let i=0;i=thresholds$1[i]&&clampedY<=thresholds$1[i+1]){let t=(clampedY-thresholds$1[i])/(thresholds$1[i+1]-thresholds$1[i]);return positions$1[i]+t*(positions$1[i+1]-positions$1[i])}return 0},performanceBgClass=computed(()=>({"perf-good":steppedPerformanceFactor.value>=3,"perf-warn":steppedPerformanceFactor.value<3})),performanceTransformStyle=computed(()=>{let sRaw=Math.min(steppedPerformanceFactor.value/3,1);return{transform:`scale(${sRaw===0?.001:sRaw})`,transformOrigin:`center bottom`,opacity:sRaw===0?0:1}});function onModifierTransitionEnd(e){e.propertyName===`opacity`&&(isModifierFading.value&&=(currentModifier.value=null,!1))}let comboVarsStyle=computed(()=>({"--combo-glow-color":realtimeScoreCombo.value>=25?`210, 110, 0`:`255, 255, 0`,"--combo-glow-alpha":String(creep.value),"--combo-rect-translate":`${-creep.value*2}rem`}));function ensureBonusTimers(){!bonusDisplayAdd&&bonusQueue.value.length>0&&(bonusDisplayAdd=setInterval(()=>{if(bonusQueue.value.length===0)return;let item=bonusQueue.value.pop();bonusDisplay.value.unshift(item)},500)),!bonusDisplayDispose&&bonusDisplay.value.length>0&&(bonusDisplayDispose=setInterval(()=>{bonusDisplay.value.length>0&&bonusDisplay.value.pop()},1e4)),bonusQueue.value.length===0&&bonusDisplay.value.length===0&&(bonusDisplayAdd&&=(clearInterval(bonusDisplayAdd),null),bonusDisplayDispose&&=(clearInterval(bonusDisplayDispose),null))}return watch(bonusQueue,ensureBonusTimers,{deep:!0}),watch(bonusDisplay,ensureBonusTimers,{deep:!0}),onMounted(()=>{lua.extensions.gameplay_drift_general.onDriftAppMounted()}),onUnmounted(()=>{lua.extensions.gameplay_drift_general.onDriftAppUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$178,[createBaseVNode(`div`,_hoisted_2$145,[createBaseVNode(`div`,{class:normalizeClass([`fail-overlay`,{active:isFailActive.value}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`performance-background`,performanceBgClass.value]),style:normalizeStyle(performanceTransformStyle.value)},null,6),centerFailMessage.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`center`,{"fade-out":isCenterMessageFading.value}])},toDisplayString(centerFailMessage.value),3)):centerMessage.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`center`,{"fade-out":isCenterMessageFading.value}])},[createTextVNode(toDisplayString(centerMessage.value)+` `,1),centerMessage.value&&scoreToAdd.value>=0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(scoreToAdd.value),1)],64)):createCommentVNode(``,!0)],2)):(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`div`,_hoisted_3$130,[(openBlock(!0),createElementBlock(Fragment,null,renderList(bonusDisplay.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`score-item`},` +`+toDisplayString(~~item.score),1))),128))]),createBaseVNode(`div`,_hoisted_4$107,[createBaseVNode(`div`,_hoisted_5$92,[(openBlock(),createElementBlock(`div`,{class:normalizeClass([`score-modifier`,{"fade-out":isModifierFading.value}]),key:currentModifier.value,onTransitionend:onModifierTransitionEnd},toDisplayString(currentModifier.value),35)),createBaseVNode(`div`,_hoisted_6$76,toDisplayString(realtimeScorePoints.value),1)]),createBaseVNode(`div`,_hoisted_7$66,[(openBlock(),createElementBlock(`svg`,{id:`svg_${unref(bgId)}`,class:`combo`,viewBox:`0 0 100 30`,style:normalizeStyle([{width:`100%`,height:`3rem`},comboVarsStyle.value]),preserveAspectRatio:`xMinYMid meet`},[createBaseVNode(`defs`,null,[createBaseVNode(`linearGradient`,{id:`grad_${unref(bgId)}`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[_cache[0]||=createBaseVNode(`stop`,{offset:`50%`,"stop-color":`var(--bng-ter-yellow-100)`},null,-1),createBaseVNode(`stop`,{offset:`51%`,"stop-color":realtimeScoreCombo.value>=25?`#ff8400`:`#fff`},null,8,_hoisted_10$40),createBaseVNode(`stop`,{offset:`75%`,"stop-color":realtimeScoreCombo.value>=25?`#ff8400`:`#fff`},null,8,_hoisted_11$35)],8,_hoisted_9$47),createBaseVNode(`mask`,{id:`mask_${unref(bgId)}`},[createBaseVNode(`text`,_hoisted_13$24,` ×`+toDisplayString(formattedCombo.value),1)],8,_hoisted_12$27)]),createBaseVNode(`g`,{mask:`url(#mask_${unref(bgId)})`},[createBaseVNode(`rect`,{width:`100%`,height:`4.2rem`,x:`0`,y:`15.5`,fill:`url(#grad_${unref(bgId)})`,class:`animated-rect`},null,8,_hoisted_15$22)],8,_hoisted_14$23)],12,_hoisted_8$53))])])],64))]),createBaseVNode(`div`,_hoisted_16$22,[createBaseVNode(`div`,_hoisted_17$17,[createBaseVNode(`div`,{class:normalizeClass([`bar`,barClass.value]),style:normalizeStyle(barVarsStyle.value)},null,6)])]),createBaseVNode(`div`,_hoisted_18$15,[createBaseVNode(`div`,_hoisted_19$12,[createBaseVNode(`div`,_hoisted_20$11,[createBaseVNode(`div`,{class:`progress-fill`,style:normalizeStyle(driftProgressStyle.value)},null,4)]),(openBlock(),createElementBlock(`div`,{class:`value-marks`,key:layoutVersion.value},[(openBlock(),createElementBlock(Fragment,null,renderList(thresholds,(threshold,index)=>createBaseVNode(`div`,{class:`line`,key:threshold,style:normalizeStyle({position:`absolute`,left:tickLefts.value[index],width:`0.125rem`,height:`0.24rem`,transform:threshold===0?`translateX(-50%)`:threshold>0?`translateX(-100%)`:`translateX(0%)`,backgroundColor:`white`})},null,4)),64))]))]),(openBlock(),createElementBlock(`div`,{class:`drift-labels`,key:layoutVersion.value},[(openBlock(),createElementBlock(Fragment,null,renderList(thresholds,(threshold,index)=>createBaseVNode(`span`,{key:threshold,style:normalizeStyle({position:`absolute`,left:tickLefts.value[index],transform:`translateX(-50%)`,textAlign:`center`})},toDisplayString(threshold===0?`${formattedRealtimeAngle.value}°`:`${Math.abs(threshold)}°`),5)),64))])),props.showFlash?(openBlock(),createBlock(unref(bngFlashMessage_default),{key:0,"message-source":`DriftFlashMessage`})):createCommentVNode(``,!0)])]))}},app_default$13=__plugin_vue_export_helper_default(_sfc_main$198,[[`__scopeId`,`data-v-aa80ede0`]]),_hoisted_1$177={class:`main-container-grid`},_hoisted_2$144={class:`scores-container`},_hoisted_3$129={class:`permanent`},_hoisted_4$106={class:`points-label`},_sfc_main$197={__name:`app`,setup(__props){let events$3=useEvents(),permanentScore=ref(0),potentialScore=ref(0),isAnimatingPotentialScore=ref(!1),dontUpdateScores=ref(!1),lastPotentialScore=ref(0);onMounted(()=>{events$3.on(`setDriftPersistentDriftScored`,(score,combo)=>{isAnimatingPotentialScore.value=!0,dontUpdateScores.value=!0,potentialScore.value=score,lastPotentialScore.value=potentialScore.value,setTimeout(()=>{isAnimatingPotentialScore.value=!1},1e3),setTimeout(()=>{dontUpdateScores.value=!1},900)})}),onUnmounted(()=>{events$3.off(`setDriftPersistentDriftScored`)});let streamsList$1=[`drift`];return useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;dontUpdateScores.value||(permanentScore.value=streams.drift.permanentScore,potentialScore.value=streams.drift.potentialScore)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$177,[createBaseVNode(`div`,_hoisted_2$144,[createBaseVNode(`div`,_hoisted_3$129,[createBaseVNode(`span`,_hoisted_4$106,toDisplayString(unref($translate).instant(`missions.drift.general.pointsShort`))+`: `,1),createTextVNode(toDisplayString(permanentScore.value),1)]),createBaseVNode(`div`,{class:normalizeClass([`potential`,{"animate-potential-score":isAnimatingPotentialScore.value}])},` + `+toDisplayString(potentialScore.value),3)])]))}},app_default$14=__plugin_vue_export_helper_default(_sfc_main$197,[[`__scopeId`,`data-v-29f9fe6b`]]),_hoisted_1$176={class:`main-container-grid`},_sfc_main$196={__name:`app`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),showButton=ref(!1),handleNextStep=()=>{lua.gameplay_crashTest_scenarioManager.nextStepFromUI(),showButton.value=!1};return onMounted(()=>{events$3.on(`onCrashTestStepFinished`,()=>{console.log(`onCrashTestStepFinished`),showButton.value=!0})}),onUnmounted(()=>{events$3.off(`onCrashTestStepFinished`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$176,[showButton.value?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:handleNextStep,accent:unref(ACCENTS).text,icon:unref(icons).arrowSolidRight,class:normalizeClass({"next-step-button":!0})},{default:withCtx(()=>[createTextVNode(toDisplayString(unref($translate).instant(`missions.crashTest.general.nextStep`)),1)]),_:1},8,[`accent`,`icon`])):createCommentVNode(``,!0)]))}},app_default$15=__plugin_vue_export_helper_default(_sfc_main$196,[[`__scopeId`,`data-v-6d935866`]]),_hoisted_1$175={class:`bng-app`},_sfc_main$195={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`],data=reactive({engineT:0,wheelT:0,rpm:0,gearText:``});onMounted(()=>$game.streams.add(streamsList$1)),onUnmounted(()=>$game.streams.remove(streamsList$1)),$game.events.on(`onStreamsUpdate`,streams=>{streams.engineInfo!==null&&(data.engineT=$game.units.buildString(`torque`,streams.engineInfo[8],0),data.wheelT=$game.units.buildString(`torque`,streams.engineInfo[19],0),data.rpm=streams.engineInfo[4].toFixed(),data.gearText=getGearText(streams.engineInfo[16],streams.engineInfo[6],streams.engineInfo[7]))});let getGearText=(gear,fGear,rGear)=>gear>0?`F `+gear+` / `+fGear:gear<0?`R `+Math.abs(gear)+` / `+rGear:`N`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$175,[createTextVNode(toDisplayString(_ctx.$t(`ui.apps.engineinfo.rpm`))+`: `+toDisplayString(data.rpm),1),_cache[0]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.gear`))+`: `+toDisplayString(data.gearText),1),_cache[1]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.flywheelTorque`))+`: `+toDisplayString(data.engineT)+` `,1),_cache[2]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.wheelTorque`))+`: `+toDisplayString(data.wheelT),1)]))}},app_default$16=_sfc_main$195,_hoisted_1$174={class:`legends`},_hoisted_2$143={class:`torque-flywheel`},_hoisted_3$128={class:`power-flywheel`},_hoisted_4$105={class:`power-wheels`},_hoisted_5$91={class:`rpm`},_hoisted_6$75={class:`content`},_hoisted_7$65={class:`power-label`},_hoisted_8$52={class:`label`},_hoisted_9$46={class:`canvas-container`},_hoisted_10$39={class:`torque-label`},_hoisted_11$34={class:`label`},tickLabels=21,torqueGraphColor=`#000000`,powerGraphColor=`#FF0000`,powerWheelGraphColor=`#FF4400`,rpmGraphColor=`#0000FF`,_sfc_main$194={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`],app$1=ref(null),canvas=ref(null),globalMax=ref(0),torqueUnit=ref(null),powerUnit=ref(null),tickSpacing=ref(0),tickInterval=computed(()=>globalMax.value/10),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth-130,canvas.value.height=entry.target.offsetHeight-20,tickSpacing.value=canvas.value.height/10,console.log(`width`,entry.target.offsetWidth),console.log(`height`,entry.target.offsetHeight),console.log(`tickspacing`,tickSpacing.value),console.log(`canvas`,canvas.value.width,canvas.value.height)}),chart=new SmoothieChart({minValue:0,maxValue:1e3,millisPerPixel:20,interpolation:`bezier`,grid:{fillStyle:`rgba(250,250,250,0.2)`,strokeStyle:`grey`,verticalSections:20,millisPerLine:1e3,sharpLines:!0},labels:{disabled:!0}}),torqueGraph=new TimeSeries,powerGraph=new TimeSeries,powerWheelGraph=new TimeSeries,rpmGraph=new TimeSeries;onMounted(()=>{initChart(),appResizeObserver.observe(app$1.value),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;let xPoint=new Date,torque=$game.units.torque(streams.engineInfo[8]).val,power$1=$game.units.power(streams.engineInfo[4]*.104719755*streams.engineInfo[8]/1e3*1.34102).val,wheelPower=$game.units.power(streams.engineInfo[20]/1e3*1.34102).val,rpm=streams.engineInfo[4]/10;torqueUnit.value=$game.units.torque().unit,powerUnit.value=$game.units.power().unit,globalMax.value=Math.ceil(Math.max.apply(null,[globalMax.value,torque,power$1])/100)*100,chart.options.maxValue=globalMax.value,torqueGraph.append(xPoint,torque),powerGraph.append(xPoint,power$1),powerWheelGraph.append(xPoint,wheelPower),rpmGraph.append(xPoint,rpm)}function initChart(){chart.addTimeSeries(torqueGraph,{strokeStyle:torqueGraphColor,lineWidth:1.5}),chart.addTimeSeries(powerGraph,{strokeStyle:powerGraphColor,lineWidth:1.5}),chart.addTimeSeries(powerWheelGraph,{strokeStyle:powerWheelGraphColor,lineWidth:1.5}),chart.addTimeSeries(rpmGraph,{strokeStyle:rpmGraphColor,lineWidth:1.5}),chart.streamTo(canvas.value,40)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`app`,ref:app$1,class:`engine-dynamometer`},[createBaseVNode(`div`,_hoisted_1$174,[createBaseVNode(`small`,_hoisted_2$143,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.torqueFlywheel`)),1),createBaseVNode(`small`,_hoisted_3$128,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.powerFlywheel`)),1),createBaseVNode(`small`,_hoisted_4$105,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.powerWheels`)),1),createBaseVNode(`small`,_hoisted_5$91,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.rpm`)),1)]),createBaseVNode(`div`,_hoisted_6$75,[createBaseVNode(`div`,_hoisted_7$65,[createBaseVNode(`div`,_hoisted_8$52,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.power`))+` (`+toDisplayString(powerUnit.value)+`) `,1),(openBlock(),createElementBlock(Fragment,null,renderList(tickLabels,(n,index)=>createBaseVNode(`div`,{class:`ruler`,style:normalizeStyle({top:index*tickSpacing.value+`px`})},toDisplayString((globalMax.value-index*tickInterval.value).toFixed(0)),5)),64))]),createBaseVNode(`div`,_hoisted_9$46,[createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas,class:`canvas`},null,512)]),createBaseVNode(`div`,_hoisted_10$39,[createBaseVNode(`div`,_hoisted_11$34,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.torque`))+` (`+toDisplayString(torqueUnit.value)+`) `,1),(openBlock(),createElementBlock(Fragment,null,renderList(tickLabels,(n,index)=>createBaseVNode(`div`,{class:`ruler`,style:normalizeStyle({top:index*tickSpacing.value+`px`})},toDisplayString((globalMax.value-index*tickInterval.value).toFixed(0)),5)),64))])])],512))}},app_default$17=__plugin_vue_export_helper_default(_sfc_main$194,[[`__scopeId`,`data-v-e025129d`]]),_hoisted_1$173={class:`legends`},_hoisted_2$142={class:`water`},_hoisted_3$127={class:`oil`},_hoisted_4$104={class:`block`},_hoisted_5$90={class:`exhaust`},coolantGraphColor=`#333676`,oilGraphColor=`#AA8C39`,blockGraphColor=`#378B2E`,exhaustGraphColor=`#A7383E`,_sfc_main$193={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineThermalData`],app$1=ref(null),canvas=ref(null),isRunning=ref(!1),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight}),chart=new SmoothieChart({minValue:50,maxValue:150,millisPerPixel:40,interpolation:`bezier`,grid:{fillStyle:`rgba(250,250,250,0.8)`,strokeStyle:`black`,verticalSections:0,millisPerLine:0},labels:{fillStyle:`black`}}),coolantGraph=new TimeSeries,oilGraph=new TimeSeries,blockGraph=new TimeSeries,exhaustGraph=new TimeSeries;onMounted(()=>{initChart(),appResizeObserver.observe(app$1.value),$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){if(streams.engineThermalData){isRunning.value||(isRunning.value=!0,chart.start());let xPoint=new Date;coolantGraph.append(xPoint,streams.engineThermalData.coolantTemperature),oilGraph.append(xPoint,streams.engineThermalData.oilTemperature),blockGraph.append(xPoint,streams.engineThermalData.engineBlockTemperature),exhaustGraph.append(xPoint,streams.engineThermalData.exhaustTemperature)}else isRunning.value&&(isRunning.value=!1,chart.stop())}function initChart(){chart.addTimeSeries(coolantGraph,{strokeStyle:coolantGraphColor,lineWidth:1}),chart.addTimeSeries(oilGraph,{strokeStyle:oilGraphColor,lineWidth:1}),chart.addTimeSeries(blockGraph,{strokeStyle:blockGraphColor,lineWidth:1}),chart.addTimeSeries(exhaustGraph,{strokeStyle:exhaustGraphColor,lineWidth:1}),chart.streamTo(canvas.value,40)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`app`,ref:app$1,class:`engine-hdg`},[createBaseVNode(`div`,_hoisted_1$173,[createBaseVNode(`small`,_hoisted_2$142,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.water`)),1),createBaseVNode(`small`,_hoisted_3$127,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.oil`)),1),createBaseVNode(`small`,_hoisted_4$104,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.block`)),1),createBaseVNode(`small`,_hoisted_5$90,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.exhaust`)),1)]),createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas},null,512)],512))}},app_default$18=__plugin_vue_export_helper_default(_sfc_main$193,[[`__scopeId`,`data-v-ac69837e`]]),_hoisted_1$172={class:`bng-app thermal-clutch-debug`},_hoisted_2$141={class:`set-name`},_sfc_main$192={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineThermalData`],data=ref(null);onMounted(()=>{$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.streams.remove(streamsList$1)}),$game.events.on(`onStreamsUpdate`,streams=>data.value=streams.engineThermalData?parseData(streams.engineThermalData):null);function parseData(data$1){return[{str:$game.units.buildString(`temperature`,data$1.coolantTemperature,0),name:`ui.apps.engine_thermal_debug.coolant`,warn:data$1.coolantTemperature>data$1.thermostatTemperature&&data$1.coolantTemperature<120&&data$1.thermostatStatus==1,error:data$1.coolantTemperature>120},{str:$game.units.buildString(`temperature`,data$1.oilTemperature,0),name:`ui.apps.engine_thermal_debug.oil`,warn:data$1.oilTemperature>140,error:data$1.oilTemperature>150},{str:$game.units.buildString(`temperature`,data$1.engineBlockTemperature,0),name:`ui.apps.engine_thermal_debug.block`},{str:$game.units.buildString(`temperature`,data$1.cylinderWallTemperature,0),name:`ui.apps.engine_thermal_debug.cylinderlWall`},{str:$game.units.buildString(`temperature`,data$1.exhaustTemperature,0),name:`ui.apps.engine_thermal_debug.exhaustManifold`},{str:data$1.thermostatStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantThermostat`,warn:data$1.thermostatStatus>.9},{str:data$1.airRegulatorStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.airRegulator`,warn:data$1.airRegulatorStatus>.9},{str:$game.units.buildString(`speed`,data$1.radiatorAirSpeed,0),name:`ui.apps.engine_thermal_debug.radiatorAirSpeed`},{str:data$1.radiatorAirSpeedEfficiency.toFixed(4),name:`ui.apps.engine_thermal_debug.radiatorAirSpeedEfficiency`},{str:data$1.fanActive,name:`ui.apps.engine_thermal_debug.radiatorFanActive`},{str:data$1.coolantMass.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantMass`},{str:data$1.coolantLeakRateOverpressure.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateOverpressure`,warn:data$1.coolantLeakRateOverpressure>0},{str:data$1.coolantLeakRateHeadGasket.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateHeadGasket`,warn:data$1.coolantLeakRateHeadGasket>0},{str:data$1.coolantLeakRateRadiator.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateRadiator`,warn:data$1.coolantLeakRateRadiator>0},{str:data$1.coolantLeakRateOverall.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateOverall`,warn:data$1.coolantLeakRateOverall>0},{str:data$1.coolantEfficiency.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantEfficiency`,warn:data$1.coolantEfficiency<1,error:data$1.coolantEfficiency===0},{str:data$1.oilThermostatStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.oilThermostat`,warn:data$1.oilThermostatStatus>.9},{str:data$1.oilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.oilMass`,warn:data$1.oilMassdata$1.maximumSafeOilMass},{str:data$1.miniumSafeOilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.miniumSafeOilMass`},{str:data$1.maximumSafeOilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.maximumSafeOilMass`},{str:data$1.oilLeakRateOilpan.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateOilpan`,warn:data$1.oilLeakRateOilpan>0},{str:data$1.oilLeakRateRadiator.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateRadiator`,warn:data$1.oilLeakRateRadiator>0},{str:data$1.oilLeakRateGravity.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateGravity`,warn:data$1.oilLeakRateGravity>0},{str:data$1.oilLeakRatePistonRingDamage.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRatePistonRingDamage`,warn:data$1.oilLeakRatePistonRingDamage>0},{str:data$1.oilLeakRateOverall.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateOverall`,warn:data$1.oilLeakRateOverall>0},{str:data$1.oilStarvingSevernessXY.toFixed(3),name:`ui.apps.engine_thermal_debug.oilStarvingSevernessXY`,warn:data$1.oilStarvingSevernessXY>0},{str:data$1.oilStarvingSevernessZ.toFixed(3),name:`ui.apps.engine_thermal_debug.oilStarvingSevernessZ`,warn:data$1.oilStarvingSevernessZ>0},{str:data$1.maximumSafeG.toFixed(3),name:`ui.apps.engine_thermal_debug.maximumSafeG`},{str:data$1.oilLubricationCoef.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLubricationCoef`,warn:data$1.oilLubricationCoef<1},{str:data$1.missingOilDamage.toFixed(3),name:`ui.apps.engine_thermal_debug.missingOilDamage`,warn:data$1.missingOilDamage>0},{str:data$1.engineEfficiency.toFixed(2),name:`ui.apps.engine_thermal_debug.engineEfficiency`},{str:$game.units.buildString(`energy`,data$1.energyToCylinderWall,0),name:`ui.apps.engine_thermal_debug.qtocylinderwall`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToCoolant,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltocoolant`},{str:$game.units.buildString(`energy`,data$1.energyCoolantToAir,0),name:`ui.apps.engine_thermal_debug.qcoolanttoair`},{str:$game.units.buildString(`energy`,data$1.energyCoolantToBlock,0),name:`ui.apps.engine_thermal_debug.qcoolanttoblock`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToBlock,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltoblock`},{str:$game.units.buildString(`energy`,data$1.energyBlockToAir,0),name:`ui.apps.engine_thermal_debug.qblocktoair`},{str:$game.units.buildString(`energy`,data$1.energyToOil,0),name:`ui.apps.engine_thermal_debug.qtooil`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToOil,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltooil`},{str:$game.units.buildString(`energy`,data$1.energyOilToAir,0),name:`ui.apps.engine_thermal_debug.qoilradiatortoair`},{str:$game.units.buildString(`energy`,data$1.energyOilSumpToAir,0),name:`ui.apps.engine_thermal_debug.qoilsumptoair`},{str:$game.units.buildString(`energy`,data$1.energyToExhaust,0),name:`ui.apps.engine_thermal_debug.qtoexhaust`},{str:$game.units.buildString(`energy`,data$1.energyExhaustToAir,0),name:`ui.apps.engine_thermal_debug.qexhausttoair`},{str:data$1.engineBlockOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.blockDamage`,warn:data$1.engineBlockOverheatDamage>0},{str:data$1.oilOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.oilDamage`,warn:data$1.oilOverheatDamage>0},{str:data$1.cylinderWallOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.cylinderwallDamage`,warn:data$1.cylinderWallOverheatDamage>0},{str:data$1.headGasketBlown,name:`ui.apps.engine_thermal_debug.headGasketBlown`,error:data$1.headGasketBlown},{str:data$1.pistonRingsDamaged,name:`ui.apps.engine_thermal_debug.pistonRingsDamaged`,error:data$1.pistonRingsDamaged},{str:data$1.connectingRodBearingsDamaged,name:`ui.apps.engine_thermal_debug.connectingRodBearingsDamaged`,error:data$1.connectingRodBearingsDamaged}]}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$172,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value,(set,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`set`},[createBaseVNode(`div`,_hoisted_2$141,toDisplayString(_ctx.$t(set.name)),1),createBaseVNode(`div`,{class:normalizeClass([`set-value`,{"thermal-warning":set.warn,"thermal-error":set.error}])},toDisplayString(set.str),3)]))),128))]))}},app_default$19=__plugin_vue_export_helper_default(_sfc_main$192,[[`__scopeId`,`data-v-6de0b81a`]]),_hoisted_1$171={"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:cc":`http://creativecommons.org/ns#`,"xmlns:rdf":`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,"xmlns:svg":`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"xmlns:sodipodi":`http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd`,"xmlns:inkscape":`http://www.inkscape.org/namespaces/inkscape`,version:`1.1`,width:`100%`,height:`100%`,viewBox:`0 0 660 660`},_hoisted_2$140={"inkscape:groupmode":`layer`,id:`layer6`,class:`layer6`,"inkscape:label":`new`,style:{display:`inline`}},_hoisted_3$126={"xml:space":`preserve`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`159.64709473px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"letter-spacing":`0px`,"word-spacing":`0px`,"writing-mode":`lr-tb`,"text-anchor":`middle`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},x:`329.85437`,y:`328.48807`,id:`tspan4449-43`,"sodipodi:linespacing":`125%`,"inkscape:label":`#pressureText`},_hoisted_4$103={"xml:space":`preserve`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`65px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"letter-spacing":`0px`,"word-spacing":`0px`,"writing-mode":`lr-tb`,"text-anchor":`middle`,display:`inline`,fill:`#ffffff`,"fill-opacity":`0.78835976`,stroke:`none`},x:`329.03198`,y:`413.62915`,id:`speed_units`,"sodipodi:linespacing":`125%`,"inkscape:label":`#speed_units`,"inkscape:transform-center-y":`-4.486084`},_hoisted_5$89=[`id`,`x`,`y`],_hoisted_6$74=[`id`,`x`,`y`],_hoisted_7$64={"inkscape:groupmode":`layer`,id:`layer3`,"inkscape:label":`FIX`,style:{display:`inline`}},_hoisted_8$51={id:`revcurvemask`,style:{display:`inline`}},_hoisted_9$45={"inkscape:groupmode":`layer`,id:`layer11`,"inkscape:label":`revs`,style:{display:`inline`}},_hoisted_10$38={"inkscape:groupmode":`layer`,id:`layer7`,"inkscape:label":`new2`,style:{display:`inline`}},width=660,height=660,dashSize=5,pressureTextSize=50,dashCount=5,PRESURE_MAX_CONST=150,PRESURE_MIN_CONST=-100,_sfc_main$191={__name:`forcedInduction`,setup(__props,{expose:__expose}){let initialized=ref(!1),pressureTextRef=ref(null),pressureCurveRef=ref(null),pressureCurveLen=computed(()=>pressureCurveRef.value.getTotalLength()),pressureCurveDashesRef=ref(null),pressureCurveDashesLen=computed(()=>pressureCurveDashesRef.value.getTotalLength()),redLineRef=ref(null),redLineLen=computed(()=>redLineRef.value.getTotalLength()),pressureTextGuideLineRef=ref(null),pressureTextGuideLineLen=computed(()=>pressureTextGuideLineRef.value.getTotalLength()),pressureTextRefs=ref([]),pressureTextAttrs=ref([{id:`pressuretext1`,x:197.49423,y:531.5639,text:1},{id:`pressuretext2`,x:124.71793,y:434.92328,text:2},{id:`pressuretext3`,x:110.04411,y:303.35791,text:3},{id:`pressuretext4`,x:165.89227,y:187.39682,text:4},{id:`pressuretext5`,x:284.48657,y:123.71478,text:5},{id:`pressuretext6`,x:419.43579,y:137.55835,text:6},{id:`pressuretext7`,x:520.0791,y:228.94992,text:7},{id:`pressuretext8`,x:520.0791,y:228.94992,text:8},{id:`pressuretext9`,x:520.0791,y:228.94992,text:9},{id:`pressuretext10`,x:520.0791,y:228.94992,text:10}]),pressureTSpanRefs=ref([]),pressureMax=ref(null),pressureMin=ref(null),pressureNeedleRef=ref(null),pressureUnitRef=ref(null),UiUnitscallback=ref(()=>null),roundDecCallback=ref(()=>0);onMounted(()=>{pressureTextRef.value.textContent=``,pressureCurveRef.value.style.strokeDasharray=pressureCurveLen.value+` `+pressureCurveLen.value,pressureTextGuideLineRef.value.style.display=`none`;for(let k=0;k10?0:1),rpSpan.style.visibility=`visible`}initialized.value=!0}applyData(streamData)}function reset$1(){initialized.value=!1;for(let k=0;k1&&(percPos=1),pressureNeedleRef.value.setAttribute(`transform`,`rotate(`+(percPos*270-135)+`,`+width/2+`,`+height/2+`)`),pressureCurveRef.value.style.strokeDashoffset=pressureCurveLen.value-pressureCurveLen.value*percPos}function UnitPressure(val){let convertedVal=UiUnitscallback.value(val,`pressure`);return pressureNeedleRef.value.textContent!==convertedVal.unit&&(pressureUnitRef.value.textContent=convertedVal.unit,initialized.value=!1),convertedVal.val}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$171,[_cache[4]||=createBaseVNode(`defs`,{id:`defs4`},[createBaseVNode(`linearGradient`,{id:`linearGradient3938`},[createBaseVNode(`stop`,{style:{"stop-color":`#ff0000`,"stop-opacity":`1`},offset:`0`,id:`stop3940`}),createBaseVNode(`stop`,{style:{"stop-color":`#00ff4b`,"stop-opacity":`1`},offset:`1`,id:`stop3942`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4607`},[createBaseVNode(`stop`,{id:`stop4609`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.89960396`,id:`stop4611`}),createBaseVNode(`stop`,{id:`stop4613`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4615`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4597`},[createBaseVNode(`stop`,{id:`stop4599`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.99812102`,id:`stop4601`}),createBaseVNode(`stop`,{id:`stop4603`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4605`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4545`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547`}),createBaseVNode(`stop`,{id:`stop4553`,offset:`0.9861111`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4555`}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4549`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,id:`linearGradient4256`},[createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`1`},offset:`0`,id:`stop4258`}),createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`0`},offset:`1`,id:`stop4260`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4365`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367`}),createBaseVNode(`stop`,{id:`stop4373`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4357`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`1`},offset:`0`,id:`stop4359`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.19642857`},offset:`1`,id:`stop4361`})]),createBaseVNode(`marker`,{style:{overflow:`visible`},id:`DistanceStart`,refX:`0`,refY:`0`,orient:`auto`,"inkscape:stockid":`DistanceStart`},[createBaseVNode(`g`,{id:`g2300`},[createBaseVNode(`path`,{style:{fill:`none`,stroke:`#ffffff`,"stroke-width":`1.14999998`,"stroke-linecap":`square`},d:`M 0,0 2,0`,id:`path2306`,"inkscape:connector-curvature":`0`}),createBaseVNode(`path`,{style:{fill:`#000000`,"fill-rule":`evenodd`,stroke:`none`},d:`M 0,0 13,4 9,0 13,-4 0,0 z`,id:`path2302`,"inkscape:connector-curvature":`0`}),createBaseVNode(`path`,{style:{fill:`none`,stroke:`#000000`,"stroke-width":`1`,"stroke-linecap":`square`},d:`M 0,-4 0,40`,id:`path2304`,"inkscape:connector-curvature":`0`})])]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-9`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-8`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-3`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.37015162,0,0,0.37015162,685.90181,-270.76027)`,"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4256`,id:`linearGradient4433`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-4`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363-5`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-6`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-1`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.36968813,0,0,0.36968813,1026.9451,-270.68256)`,"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-49`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4256`,id:`linearGradient4746`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3921`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3923`,d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3925-1`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3927-7`,d:`m 330,10 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 296.74495,71.61583 313.18224,70 330,70 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 417.49749,19.23259 374.82925,10 330,10 z m -67.13867,7.07812 C 202.16219,30.03925 147.84399,60.20471 105.25195,102.23633 l 42.54297,42.3125 C 182.22028,110.72238 226.01669,86.41327 274.9375,75.86328 L 262.86133,17.07812 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 565.93577,105.29347 518.20331,63.82636 461.72461,38.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 575.92383,233.46544 590,280.08649 590,330 l 60,0 C 650,268.39079 632.57195,210.85952 602.40234,162.03516 z M 15.06055,273.02148 C 11.7373,291.51211 10,310.55271 10,330 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 76.98058,398.61583 70,365.12541 70,330 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 L 15.06055,273.02148 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 141.73258,515.3212 111.08736,478.12046 91.96094,434.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 202.04051,629.81227 263.66249,650 330,650 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545`,id:`linearGradient4551`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545-2`,id:`linearGradient4551-8`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4545-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547-4`}),createBaseVNode(`stop`,{id:`stop4553-5`,offset:`0.99000001`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4555-5`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4549-1`})]),createBaseVNode(`linearGradient`,{y2:`282.59341`,x2:`474.60886`,y1:`211.1199`,x1:`480`,gradientUnits:`userSpaceOnUse`,id:`linearGradient4574`,"xlink:href":`#linearGradient4607`,"inkscape:collect":`always`,gradientTransform:`matrix(1,0,0,0.9882541,0,10.359887)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036-1`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0`,id:`radialGradient4363-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4365-4`,id:`radialGradient4371-2`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5`}),createBaseVNode(`stop`,{id:`stop4373-5`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997`,"xlink:href":`#linearGradient4365-4`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4363-4-1`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4001`,"xlink:href":`#linearGradient4357-0-7`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4040`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4045`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7-2`,id:`radialGradient4045-8`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-758.53125,-231)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4063`,"xlink:href":`#linearGradient4357-0-7-2`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4082`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-8`,id:`radialGradient4363-4-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4031-1`,"xlink:href":`#linearGradient4357-0-8-5`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8-5`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7-2`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-3`,id:`radialGradient4363-4-0`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-3`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9-8`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4-01`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8-2`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-8-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4401`,"xlink:href":`#linearGradient4357-0-3`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997-4`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5-8`}),createBaseVNode(`stop`,{id:`stop4373-5-3`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4458`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3653`},[createBaseVNode(`path`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},d:`M 480,84 C 225.94901,84 20,289.94901 20,544 20,798.05099 225.94901,1004 480,1004 734.05099,1004 940,798.05099 940,544 940,289.94901 734.05099,84 480,84 Z m 0,322 c 76.21531,0 138,61.78469 138,138 0,76.21531 -61.78469,138 -138,138 -76.21531,0 -138,-61.78469 -138,-138 0,-76.21531 61.78469,-138 138,-138 z`,id:`path3655`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4490`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 330,10 c -176.15718,3e-6 -319.999997,143.84282 -320,320 0,88.07859 35.961054,168.07824 93.94141,226.05859 l 68.0957,-68.0957 C 131.73748,447.66326 106.91016,391.89131 106.91016,330 c 0,-123.78262 99.30722,-223.08984 223.08984,-223.08984 123.78262,0 223.08984,99.30722 223.08984,223.08984 0,61.89131 -24.82732,117.66326 -65.12695,157.96289 l 68.0957,68.0957 C 614.03895,498.07824 650,418.07859 650,330 650,153.84282 506.15718,10 330,10 Z`,id:`path4492`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4494`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 330,10 c -176.15718,3e-6 -319.999997,143.84282 -320,320 0,88.07859 35.961054,168.07824 93.94141,226.05859 l 68.0957,-68.0957 C 131.73748,447.66326 106.91016,391.89131 106.91016,330 c 0,-123.78262 99.30722,-223.08984 223.08984,-223.08984 123.78262,0 223.08984,99.30722 223.08984,223.08984 0,61.89131 -24.82732,117.66326 -65.12695,157.96289 l 68.0957,68.0957 C 614.03895,498.07824 650,418.07859 650,330 650,153.84282 506.15718,10 330,10 Z`,id:`path4496`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4498`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 240.41631,-226.27417 c -124.56194,124.56194 -124.56194,327.9864 0,452.54834 62.28096,62.28097 144.27756,93.42096 226.27417,93.42095 l 0,-96.30186 c -56.99229,0 -113.98458,-21.88116 -157.74834,-65.64492 -87.52753,-87.527531 -87.52753,-227.969149 0,-315.49668 87.52753,-87.52753 227.96915,-87.52753 315.49668,0 C 668.20258,-113.98457 690.08374,-56.992283 690.08374,0 l 96.30186,0 c 1e-5,-81.996605 -31.13998,-163.9932 -93.42095,-226.27417 -124.56194,-124.56194 -327.98641,-124.56194 -452.54834,0 z`,id:`path4500`,"inkscape:connector-curvature":`0`})])],-1),_cache[5]||=createBaseVNode(`g`,{"inkscape:label":`background`,"inkscape:groupmode":`layer`,id:`layer1`,transform:`translate(-150,-242.36218)`,style:{display:`none`,opacity:`1`}},[createBaseVNode(`rect`,{style:{fill:`#505050`,"fill-opacity":`1`,stroke:`none`},id:`rect4616`,width:`2175.3789`,height:`1458.4727`,x:`-727.47485`,y:`-115.47279`})],-1),createBaseVNode(`g`,_hoisted_2$140,[_cache[0]||=createBaseVNode(`circle`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`url(#radialGradient3997)`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},id:`path4281-5`,cx:`480`,cy:`544`,r:`320`,transform:`translate(-150,-214)`},null,-1),_cache[1]||=createBaseVNode(`path`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`url(#radialGradient4363-4)`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`6`,marker:`none`,"enable-background":`accumulate`},d:`M 480,214 C 297.74603,214 150,361.74603 150,544 150,726.25397 297.74603,874 480,874 662.25397,874 810,726.25397 810,544 810,361.74603 662.25397,214 480,214 Z`,id:`path4281`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`sssss`,"clip-path":`url(#clipPath3653)`,transform:`translate(-150,-214)`},null,-1),createBaseVNode(`text`,_hoisted_3$126,[createBaseVNode(`tspan`,{ref_key:`pressureTextRef`,ref:pressureTextRef,"sodipodi:role":`line`,id:`pressureText`,x:`329.85437`,y:`328.48807`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`159.64709473px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"writing-mode":`lr-tb`,"text-anchor":`middle`,fill:`#ffffff`,"fill-opacity":`1`}},` 0`,512)]),createBaseVNode(`text`,_hoisted_4$103,[createBaseVNode(`tspan`,{ref_key:`pressureUnitRef`,ref:pressureUnitRef,"sodipodi:role":`line`,id:`pressureunit`,x:`329.03198`,y:`413.62915`},`PSI`,512)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(pressureTextAttrs.value,attrs=>(openBlock(),createElementBlock(`text`,{ref_for:!0,ref:el=>pressureTextRefs.value.push(el),"xml:space":`preserve`,class:`pressure-text`,id:attrs.id+`p`,x:attrs.x,y:attrs.y},[createBaseVNode(`tspan`,{ref_for:!0,ref:el2=>pressureTSpanRefs.value.push(el2),id:attrs.id,x:attrs.x,y:attrs.y},toDisplayString(attrs.text),9,_hoisted_6$74)],8,_hoisted_5$89))),256))]),createBaseVNode(`g`,_hoisted_7$64,[createBaseVNode(`g`,_hoisted_8$51,[_cache[2]||=createBaseVNode(`rect`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#000000`,"fill-opacity":`0.37037036`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},id:`rect4001`,width:`683.79401`,height:`683.79401`,x:`127.97179`,y:`-340.09323`,transform:`matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)`,"clip-path":`url(#clipPath4498)`},null,-1),createBaseVNode(`path`,{ref_key:`pressureCurveRef`,ref:pressureCurveRef,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`none`,stroke:`#ffffff`,"stroke-width":`99.31034088`,"stroke-miterlimit":`4`,"stroke-dasharray":`2374.27468498, 2374.27468498`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,marker:`none`,"enable-background":`accumulate`},d:`M 147.9957,528.59996 C 50,420 27.118653,298.1594 119.95323,156.00847 150,110 350,-30 532.60856,149.71493 c 74.5117,73.33098 97.08931,264.86379 -10.87668,369.15745`,id:`pressureCurve`,"clip-path":`url(#clipPath4494)`},null,512),createBaseVNode(`path`,{ref_key:`redLineRef`,ref:redLineRef,style:{color:`#000000`,overflow:`visible`,visibility:`visible`,fill:`none`,stroke:`#9c0000`,"stroke-width":`117.91827393`,"stroke-linecap":`butt`,"stroke-linejoin":`bevel`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`604.6484375`,"stroke-opacity":`0.66137564`,marker:`none`,"enable-background":`accumulate`},d:`M 147.99571,510.41274 C 33.434043,395.42128 59.279735,242.76116 138.14044,153.71911 230,50 387.77546,50.913502 485.67663,112.95746 c 165.77018,105.05531 132.03401,312.46382 37.32761,407.0596`,id:`pressure_redline`,"clip-path":`url(#clipPath4490)`},null,512)])]),createBaseVNode(`g`,_hoisted_9$45,[createBaseVNode(`path`,{ref_key:`pressureCurveDashesRef`,ref:pressureCurveDashesRef,style:{display:`inline`,fill:`none`,stroke:`#000000`,"stroke-width":`96.91100311`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`48.4555, 48.4555`,"stroke-dashoffset":`0`,"stroke-opacity":`0.37566139`},d:`m 137.9887,522.0113 c -106.044908,-106.04491 -106.044903,-277.97769 1e-5,-384.0226 106.04491,-106.044917 277.97767,-106.044914 384.02259,0 106.04491,106.04491 106.04492,277.97769 10e-6,384.0226`,id:`pressureCurve_dashes`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`cssc`,"inkscape:label":`#path4531-4`},null,512),createBaseVNode(`path`,{ref_key:`pressureTextGuideLineRef`,ref:pressureTextGuideLineRef,style:{display:`inline`,fill:`none`,stroke:`#e90000`,"stroke-width":`2.86352348`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`0.24404764`},d:`m 202.03513,457.96488 c -70.12576,-70.12575 -70.12576,-183.82209 0,-253.94784 70.12575,-70.12576 183.82208,-70.12576 253.94784,0 70.12575,70.12575 70.12575,183.82209 0,253.94784`,id:`pressuretextline`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`cssc`,"inkscape:label":`#path4531-4`},null,512)]),createBaseVNode(`g`,_hoisted_10$38,[createBaseVNode(`g`,{ref_key:`pressureNeedleRef`,ref:pressureNeedleRef,id:`pressure_needle_d`,"inkscape:label":`#g4147`,transform:`translate(-1.2852971e-6,1.993565e-6)`},[..._cache[3]||=[createBaseVNode(`rect`,{y:`7.0002151`,x:`322.0993`,height:`103.00317`,width:`12.038266`,id:`rect4625`,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#d70000`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`67.38899994`,marker:`none`,"enable-background":`accumulate`},transform:`matrix(1,0,0.00784004,0.99996927,0,0)`},null,-1),createBaseVNode(`rect`,{transform:`scale(1,-1)`,y:`-660`,x:`322.44037`,height:`660`,width:`15.11928`,id:`rect4625-1`,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#008000`,"fill-opacity":`0`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`67.38899994`,marker:`none`,"enable-background":`accumulate`}},null,-1)]],512)])]))}},forcedInduction_default=__plugin_vue_export_helper_default(_sfc_main$191,[[`__scopeId`,`data-v-a0f39cc4`]]),_sfc_main$190={__name:`app`,setup(__props){let{$game}=useLibStore(),forcedInductionRef=ref(null),fiContainerRef=ref(null),enabled=ref(!1);return onMounted(()=>{forcedInductionRef.value.wireThroughRoundDec(roundDec),forcedInductionRef.value.wireThroughUnitSystem((val,func)=>UiUnits[func](val)),$game.streams.add([`forcedInductionInfo`])}),onUnmounted(()=>{$game.streams.remove([`forcedInductionInfo`])}),$game.events.on(`VechicleChange`,()=>forcedInductionRef.value.reset()),$game.events.on(`VehicleFocusChanged`,data=>{data.mode==1&&forcedInductionRef.value!==null&&forcedInductionRef.value.reset()}),$game.events.on(`onStreamsUpdate`,streams=>{if(forcedInductionRef.value===null)return;let newEnabled=forcedInductionRef.value.isStreamValid(streams);newEnabled?(newEnabled&&!enabled.value&&(fiContainerRef.value.style.opacity=1),forcedInductionRef.value.update(streams)):!newEnabled&&enabled&&(fiContainerRef.value.style.opacity=0),enabled.value=newEnabled}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`fiContainerRef`,ref:fiContainerRef,class:`fi-container`},[createVNode(forcedInduction_default,{ref_key:`forcedInductionRef`,ref:forcedInductionRef},null,512)],512))}},app_default$20=__plugin_vue_export_helper_default(_sfc_main$190,[[`__scopeId`,`data-v-3ea976f6`]]),_hoisted_1$170={class:`fi-debug`},_hoisted_2$139={class:`name`},_hoisted_3$125={class:`value`},_sfc_main$189={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`forcedInductionInfo`],defaultMeasures=[{name:`RPM`,key:`rpm`},{name:`Boost`,key:`boost`,type:`pressure`},{name:`Power Coef`,key:`coef`},{name:`Pressure Pulses`,key:`pulses`},{name:`SC Loss`,key:`loss`},{name:`Exhaust Power`,key:`exhaustPower`},{name:`Friction`,key:`friction`},{name:`Backpressure`,key:`backpressure`},{name:`Wastegate Factor`,key:`wastegateFactor`},{name:`Turbo Temp`,key:`turboTemp`,type:`temperature`}],measures=ref([]),filteredMeasures=computed(()=>measures.value.filter(m=>m.val!==void 0));onMounted(()=>{$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleReset`,init$3),$game.events.on(`VehicleFocusChanged`,init$3),init$3()}),onUnmounted(()=>{$game.streams.remove(streamsList$1),$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleReset`,init$3),$game.events.off(`VehicleFocusChanged`,init$3)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;measures.value.forEach(x=>{let val=streams.forcedInductionInfo[x.key];val!==void 0&&(x.val=x.type===void 0?val.toFixed(2):$game.units.buildString(x.type,val,2))})}function init$3(){measures.value=defaultMeasures}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$170,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filteredMeasures.value,m=>(openBlock(),createElementBlock(`div`,{class:`measure`,key:m.key},[createBaseVNode(`div`,_hoisted_2$139,toDisplayString(m.name),1),createBaseVNode(`div`,_hoisted_3$125,toDisplayString(m.val),1)]))),128))]))}},app_default$21=__plugin_vue_export_helper_default(_sfc_main$189,[[`__scopeId`,`data-v-8094d28b`]]),_sfc_main$188={},_hoisted_1$169={xmlns:`http://www.w3.org/2000/svg`,width:`60`,height:`100`,viewBox:`0 0 60 100`};function _sfc_render$2(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$169,[..._cache[0]||=[createBaseVNode(`rect`,{x:`4`,y:`4`,width:`52`,height:`92`,rx:`25`,ry:`25`,stroke:`black`,"stroke-width":`4`,fill:`none`},null,-1)]])}var accumulator_default=__plugin_vue_export_helper_default(_sfc_main$188,[[`render`,_sfc_render$2]]),_sfc_main$187={},_hoisted_1$168={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`125`,viewBox:`0 0 100 125`,"stroke-width":`4`,stroke:`black`};function _sfc_render$1(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$168,[..._cache[0]||=[createBaseVNode(`circle`,{cx:`50`,cy:`32`,r:`30`,fill:`none`},null,-1),createBaseVNode(`path`,{d:`M50 6 L57 15 L43 15 Z`,fill:`black`},null,-1),createBaseVNode(`line`,{x1:`50`,y1:`61`,x2:`50`,y2:`90`,stroke:`black`},null,-1),createBaseVNode(`path`,{d:`M15 59 L15 115 L85 115 L85 59`,fill:`none`},null,-1)]])}var pump_default=__plugin_vue_export_helper_default(_sfc_main$187,[[`render`,_sfc_render$1]]),_sfc_main$186={},_hoisted_1$167={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`130`,viewBox:`0 0 100 130`,"stroke-width":`4`,stroke:`black`};function _sfc_render(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$167,[..._cache[0]||=[createStaticVNode(``,6)]])}var reliefValve_default=__plugin_vue_export_helper_default(_sfc_main$186,[[`render`,_sfc_render]]),_hoisted_1$166={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`210`,viewBox:`0 0 200 310`},_hoisted_2$138={transform:`translate(100, 0)`},_hoisted_3$124={transform:`translate(0, 110)`},_hoisted_4$102={transform:`translate(110, 190)`},_sfc_main$185={__name:`pumpAssembly`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$166,[createBaseVNode(`g`,_hoisted_2$138,[createVNode(accumulator_default)]),createBaseVNode(`g`,_hoisted_3$124,[createVNode(reliefValve_default)]),createBaseVNode(`g`,_hoisted_4$102,[createVNode(pump_default)]),_cache[0]||=createBaseVNode(`path`,{d:`M56 122 L56 138 M54 120 L128 120 M130 122 L130 98 M130 120 L158 120 M160 118 L160 190`,stroke:`black`,"stroke-width":`4`},null,-1)]))}},pumpAssembly_default=_sfc_main$185,_hoisted_1$165={class:`hydraulics-debug`},_hoisted_2$137={width:`100%`,height:`100%`},_hoisted_3$123={id:`myGradient`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`},_hoisted_4$101=[`offset`],_hoisted_5$88={transform:`translate(0, 150)`,id:`pumpAssembly`},_hoisted_6$73=[`transform`],_hoisted_7$63=[`width`],_sfc_main$184={__name:`app`,setup(__props){let streamsList$1=[],{$game}=useLibStore(),offset$2=ref(0),offsetLeft=computed(()=>`${offset$2.value}%`),increase=()=>{offset$2.value<=100&&(offset$2.value+=10)},decrease=()=>{offset$2.value>0&&(offset$2.value-=10)},consumers=ref([{type:`hydraulicMotor`},{type:`cylinder`}]),addCylinder=function(){consumers.value.push({type:`cylinder`})},addhydraulicMotor=function(){consumers.value.push({type:`hydraulicMotor`})},removeConsumer=function(index=null){index===null?consumers.value.pop():consumers.value.splice(index,1)};onMounted(()=>{$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return}return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[_cache[1]||=createBaseVNode(`h1`,null,`Hydraulics Debug`,-1),createBaseVNode(`button`,{onClick:decrease},`dec`),createBaseVNode(`button`,{onClick:increase},`inc`),createBaseVNode(`button`,{onClick:addhydraulicMotor},`motor`),createBaseVNode(`button`,{onClick:addCylinder},`cylinder`),createBaseVNode(`button`,{onClick:removeConsumer},`Remove Consumer`),createBaseVNode(`div`,null,` offset: `+toDisplayString(offset$2.value)+` left: `+toDisplayString(offsetLeft.value),1),createBaseVNode(`div`,_hoisted_1$165,[(openBlock(),createElementBlock(`svg`,_hoisted_2$137,[createBaseVNode(`defs`,null,[createBaseVNode(`linearGradient`,_hoisted_3$123,[createBaseVNode(`stop`,{offset:offsetLeft.value,"stop-color":`green`},null,8,_hoisted_4$101),_cache[0]||=createBaseVNode(`stop`,{offset:`0`,"stop-color":`black`},null,-1)])]),createBaseVNode(`g`,_hoisted_5$88,[createVNode(pumpAssembly_default)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(consumers.value,(consumer,index)=>(openBlock(),createElementBlock(`g`,{transform:`translate(${(index+1)*100}, 95)`},[createVNode(consumer,{consumerType:consumer.type},null,8,[`consumerType`])],8,_hoisted_6$73))),256)),createBaseVNode(`rect`,{x:`80`,y:`236.5`,width:100*(consumers.value.length-1)+66,height:`2`,fill:`url(#myGradient)`},null,8,_hoisted_7$63)]))])],64))}},app_default$22=__plugin_vue_export_helper_default(_sfc_main$184,[[`__scopeId`,`data-v-a5aea534`]]),_hoisted_1$164={key:0,class:`bindings-app`},_hoisted_2$136={key:0,class:`toggle-icon`},_hoisted_3$122={key:1,class:`toggle-icon`},_hoisted_4$100={key:0,class:`players-binding`},_hoisted_5$87={key:0},_hoisted_6$72={key:1,class:`bindings-container`},_hoisted_7$62={class:`binding-item`},_sfc_main$183={__name:`app`,setup(__props){let{$game}=useLibStore(),bindings=ref([]),small=ref(!0),timeout=ref(null),show=ref(0),players=ref([]),forward=()=>{show.value=(show.value+1)%bindings.value.length},backward=()=>{show.value=show.value===0?bindings.value.length-1:show.value-1},toggleSmall=()=>{small.value=!small.value,clearTimeout(timeout)},goToBindings=(action,control)=>{$game.events.emit(`MenuHide`,!1),bngVue.gotoGameState(`menu.options.controls.bindings.edit`,{params:{action:action.actionName,oldBinding:{control:control.c,device:control.n}}})};onMounted(()=>{$game.events.on(`InputBindingsChanged`,onInputBindingsChanged),$game.events.on(`VehicleChange`,showBriefly),$game.events.on(`VehicleFocusChanged`,showBriefly),$game.api.engineLua(`extensions.core_input_bindings.notifyUI("keys app: link init")`),setTimeout(function(){$game.api.engineLua(`settings.notifyUI()`)},200)}),onUnmounted(()=>{$game.events.off(`InputBindingsChanged`,onInputBindingsChanged),$game.events.off(`VehicleChange`,showBriefly),$game.events.off(`VehicleFocusChanged`,showBriefly)});function showBriefly(){small.value&&(timeout.value=setTimeout(()=>small.value=!0,1e4)),small.value=!1}function onInputBindingsChanged(data){let specialKeys=[];players.value=[];for(let i=0;i=bindings.value.length&&(show.value=0)}function existsAt(arr,ac){return arr.map(function(elem,i){return elem.actionName===ac?i:-1}).filter(function(elem){return elem!==-1})}return(_ctx,_cache)=>players.value.length>1||bindings.value[show.value]&&bindings.value[show.value].length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$164,[createBaseVNode(`div`,{onClick:_cache[0]||=$event=>toggleSmall(),class:`binding-show`},[small.value?(openBlock(),createElementBlock(`span`,_hoisted_2$136,[createVNode(unref(bngIcon_default),{class:`key-icon`,type:unref(icons).arrowSmallLeft},null,8,[`type`])])):(openBlock(),createElementBlock(`span`,_hoisted_3$122,[createVNode(unref(bngIcon_default),{class:`key-icon`,type:unref(icons).arrowSmallRight},null,8,[`type`])]))]),!small.value&&(players.value.length>1||bindings.value[show.value]&&bindings.value[show.value].length>0)?(openBlock(),createElementBlock(`div`,_hoisted_4$100,[!small.value&&players.value.length>1?(openBlock(),createElementBlock(`div`,_hoisted_5$87,[bindings.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:_cache[1]||=$event=>backward()})):createCommentVNode(``,!0),createBaseVNode(`span`,null,`Player `+toDisplayString(show.value),1),bindings.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[2]||=$event=>forward()})):createCommentVNode(``,!0)])):createCommentVNode(``,!0),bindings.value[show.value].length>0&&!small.value?(openBlock(),createElementBlock(`div`,_hoisted_6$72,[(openBlock(!0),createElementBlock(Fragment,null,renderList(bindings.value[show.value],entry=>(openBlock(),createElementBlock(`div`,_hoisted_7$62,[createBaseVNode(`div`,null,toDisplayString(_ctx.$t(entry.action)),1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(entry.control,b=>(openBlock(),createBlock(unref(bngBinding_default),{deviceKey:b.c,device:b.d,"show-unassigned":!0,onClick:$event=>goToBindings(entry,b)},null,8,[`deviceKey`,`device`,`onClick`]))),256))])]))),256))])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)}},app_default$23=__plugin_vue_export_helper_default(_sfc_main$183,[[`__scopeId`,`data-v-b0d8eae9`]]),_hoisted_1$163={class:`bng-app log-vehicle-stats`},_hoisted_2$135={class:`update-period`},_hoisted_3$121={class:`settings-row`},_hoisted_4$99={class:`settings-row`},_hoisted_5$86={class:`settings-row`},_hoisted_6$71={class:`settings-row`},_hoisted_7$61={class:`log-btns`},_sfc_main$182={__name:`app`,setup(__props){const{$game}=useLibStore(),config=reactive({updateTime:5,moduleGeneral:!0,moduleWheels:!0,moduleEngine:!0,moduleInputs:!0,modulePowertrain:!0,outputFileName:`settings.json`,inputFileName:`settings.json`,outputDir:`VSL`}),configChanged=(configName,value)=>{switch(configName){case`moduleGeneral`:config.moduleGeneral=value;break;case`moduleWheels`:config.moduleWheels=value;break;case`moduleEngine`:config.moduleEngine=value;break;case`moduleInputs`:config.moduleInputs=value;break;case`modulePowertrain`:config.modulePowertrain=value;break}},applySettings=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.updateTime = ${config.updateTime}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["General"] = ${config.moduleGeneral}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Wheels"] = ${config.moduleWheels}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Inputs"] = ${config.moduleInputs}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Engine"] = ${config.moduleEngine}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Powertrain"] = ${config.modulePowertrain}`)},useAsOutputDir=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.outputDir = "${config.outputDir}"`)},getNewOutputFilename=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.suggestOutputFilename()`,function(data){config.outputFileName=data})},saveSettingsToJson=()=>{config.outputFileName!==``&&$game.api.activeObjectLua(`extensions.vehicleStatsLogger.writeSettingsToJSON("${config.outputFileName}")`)},importSettingsFromFile=()=>{scope.inputFileName!==``&&($game.api.activeObjectLua(`extensions.vehicleStatsLogger.applySettingsFromJSON("${config.inputFileName}")`),config.moduleGeneral=eval(`${extensions.vehicleStatsLogger.settings.useModule.General}`),config.moduleWheels=eval(`${extensions.vehicleStatsLogger.settings.useModule.Wheels}`),config.moduleInputs=eval(`${extensions.vehicleStatsLogger.settings.useModule.Inputs}`),config.moduleEngine=eval(`${extensions.vehicleStatsLogger.settings.useModule.Engine}`),config.modulePowertrain=eval(`${extensions.vehicleStatsLogger.settings.useModule.Powertrain}`))},startLogging=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.startLogging()`)},stopLogging=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.stopLogging()`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$163,[createBaseVNode(`div`,_hoisted_2$135,[_cache[20]||=createBaseVNode(`span`,{class:`label`},`Update Period:`,-1),createVNode(unref(bngInput_default),{type:`number`,min:1,max:360,step:1,modelValue:config.updateTime,"onUpdate:modelValue":_cache[0]||=$event=>config.updateTime=$event,suffix:`seconds`},null,8,[`modelValue`])]),createBaseVNode(`div`,null,[createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleGeneral,"onUpdate:modelValue":_cache[1]||=$event=>config.moduleGeneral=$event,onValueChanged:_cache[2]||=val=>configChanged(`moduleGeneral`,val)},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(` General`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleWheels,"onUpdate:modelValue":_cache[3]||=$event=>config.moduleWheels=$event,onValueChanged:_cache[4]||=val=>configChanged(`moduleWheels`,val)},{default:withCtx(()=>[..._cache[22]||=[createTextVNode(` Wheels`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleEngine,"onUpdate:modelValue":_cache[5]||=$event=>config.moduleEngine=$event,onValueChanged:_cache[6]||=val=>configChanged(`moduleEngine`,val)},{default:withCtx(()=>[..._cache[23]||=[createTextVNode(` Engine`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleInputs,"onUpdate:modelValue":_cache[7]||=$event=>config.moduleInputs=$event,onValueChanged:_cache[8]||=val=>configChanged(`moduleInputs`,val)},{default:withCtx(()=>[..._cache[24]||=[createTextVNode(` Inputs`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.modulePowertrain,"onUpdate:modelValue":_cache[9]||=$event=>config.modulePowertrain=$event,onValueChanged:_cache[10]||=val=>configChanged(`modulePowertrain`,val)},{default:withCtx(()=>[..._cache[25]||=[createTextVNode(`Powertrain`,-1)]]),_:1},8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_3$121,[_cache[27]||=createBaseVNode(`label`,null,`Apply Settings:`,-1),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[11]||=$event=>applySettings()},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(`Apply`,-1)]]),_:1})]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$99,[_cache[29]||=createBaseVNode(`label`,null,`Set Custom Output Directory:`,-1),createVNode(unref(bngInput_default),{modelValue:config.outputDir,"onUpdate:modelValue":_cache[12]||=$event=>config.outputDir=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[13]||=$event=>useAsOutputDir()},{default:withCtx(()=>[..._cache[28]||=[createTextVNode(`Use`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Subdirectory of the BeamNG.drive/BeamNG.tech directory.`]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_5$86,[_cache[31]||=createBaseVNode(`label`,null,`Settings Output Filename:`,-1),createVNode(unref(bngInput_default),{modelValue:config.outputFileName,"onUpdate:modelValue":_cache[14]||=$event=>config.outputFileName=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[15]||=$event=>saveSettingsToJson()},{default:withCtx(()=>[..._cache[30]||=[createTextVNode(`Write`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Settings files are written to the BeamNG.drive/BeamNG.tech directory.`]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$71,[_cache[33]||=createBaseVNode(`label`,null,`Settings Input Filename:`,-1),createVNode(unref(bngInput_default),{modelValue:config.inputFileName,"onUpdate:modelValue":_cache[16]||=$event=>config.inputFileName=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[17]||=$event=>importSettingsFromFile()},{default:withCtx(()=>[..._cache[32]||=[createTextVNode(`Load`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Settings files are assumed to be in the BeamNG.drive/BeamNG.tech directory.`]]),createBaseVNode(`div`,_hoisted_7$61,[createVNode(unref(bngButton_default),{class:`start-btn`,onClick:_cache[18]||=$event=>startLogging()},{default:withCtx(()=>[..._cache[34]||=[createTextVNode(`Start Log`,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`stop-btn`,onClick:_cache[19]||=$event=>stopLogging()},{default:withCtx(()=>[..._cache[35]||=[createTextVNode(`Stop Log`,-1)]]),_:1})])]))}},app_default$24=__plugin_vue_export_helper_default(_sfc_main$182,[[`__scopeId`,`data-v-686c3ac5`]]),_hoisted_1$162={class:`replay-app-container`,ref:`appContainerRef`},_hoisted_2$134={class:`left-controls`},_hoisted_3$120={class:`filename-container`},_hoisted_4$98={key:1,class:`filename`},_hoisted_5$85={key:1,class:`filename`},_hoisted_6$70={class:`right-controls`},_hoisted_7$60={class:`replay-controls-container`},_hoisted_8$50={class:`play-controls`},_hoisted_9$44={key:0,class:`speed-controls`},_hoisted_10$37={class:`svg-time-container`},_hoisted_11$33={width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},_hoisted_12$26={viewBox:`0 0 200 50`,width:`100%`,height:`100%`,overflow:`visible`},_hoisted_13$23={transform:`translate(100, 25)`},_hoisted_14$22={"text-anchor":`middle`,"dominant-baseline":`middle`,class:`time-text`,"font-size":`40`,"line-height":`1`},_hoisted_15$21={class:`time-display-total`},_hoisted_16$21={class:`position-slider`},replayFolder=`replays/`,replayFileExtension=`.rpl`,_sfc_main$181={__name:`app`,props:{hideFileControls:{type:Boolean,default:!1}},setup(__props){let state=ref(`inactive`),speed=ref(1),paused=ref(!1),renaming=ref(!1),isSeeking=ref(!1),loadedFile=ref(``),positionSeconds=ref(0),totalSeconds=ref(0),positionPercent=ref(0),fpsRec=ref(0),fpsPlay=ref(0),originalFilename=``,lastSeek=0,events$3=useEvents(),resizeObserver=ref(null),replayControlsRef=ref(null),containerWidth=shallowRef(0),layoutState=computed(()=>{let width$1=containerWidth.value;return{isReplayControlsNarrow:width$1<301,isFileControlsNarrow:width$1<361}}),props=__props,formatTime$1=seconds=>new Date(seconds*1e3).toISOString().substr(14,8),debounce$1=(fn,delay)=>{let timer=null;return(...args)=>{timer&&clearTimeout(timer),timer=setTimeout(()=>{fn(...args),timer=null},delay)}},listRecordings=()=>{window.bngVue.gotoGameState(`menu.replay`)},startRenaming=()=>{renaming.value=!0,originalFilename=loadedFile.value},cancelRename=()=>{renaming.value=!1,loadedFile.value=originalFilename},acceptRename=()=>{if(loadedFile.value===originalFilename){cancelRename();return}renaming.value=!1,Lua_default.core_replay.acceptRename(replayFolder+originalFilename+replayFileExtension,replayFolder+loadedFile.value+replayFileExtension)},toggleSpeed=val=>{Lua_default.core_replay.toggleSpeed(val)},togglePlay=()=>{Lua_default.core_replay.togglePlay()},toggleRecording=()=>{Lua_default.core_replay.toggleRecording(!0)},cancelRecording=()=>{Lua_default.core_replay.cancelRecording()},stop$1=()=>{Lua_default.core_replay.stop()},seek=()=>{state.value===`playback`&&(lastSeek=Date.now(),Lua_default.core_replay.pause(!0),Lua_default.core_replay.seek(positionPercent.value))};watch(positionSeconds,(newVal,oldVal)=>{Date.now()-lastSeek>500&&totalSeconds.value>0&&(positionPercent.value=newVal/totalSeconds.value)});let setupResizeObserver=()=>{if(!replayControlsRef.value)return;let rafId=null,updateWidth=debounce$1(width$1=>{containerWidth.value=width$1},100);resizeObserver.value=new ResizeObserver(entries=>{rafId!==null&&cancelAnimationFrame(rafId),rafId=requestAnimationFrame(()=>{for(let entry of entries)updateWidth(entry.contentRect.width);rafId=null})}),resizeObserver.value.observe(replayControlsRef.value)};return onMounted(async()=>{try{Lua_default.core_replay.onInit()}catch(e){console.error(`Error initializing replay state:`,e)}events$3.on(`replayStateChanged`,val=>{renaming.value||(loadedFile.value=val.loadedFile.replace(replayFolder,``).replace(replayFileExtension,``)),positionSeconds.value=val.positionSeconds,totalSeconds.value=val.totalSeconds,speed.value=val.speed,paused.value=val.paused,fpsRec.value=val.fpsRec,fpsPlay.value=val.fpsPlay,state.value=val.state,isSeeking.value=val.jumpOffset!==0,Date.now()-lastSeek>500&&totalSeconds.value>0?positionPercent.value=positionSeconds.value/totalSeconds.value:isSeeking.value=!0}),await nextTick(),setupResizeObserver()}),onUnmounted(()=>{resizeObserver.value&&=(resizeObserver.value.disconnect(),null),events$3.off(`replayStateChanged`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$162,[props.hideFileControls?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`file-controls`,{narrow:layoutState.value.isFileControlsNarrow}])},[createBaseVNode(`div`,_hoisted_2$134,[createVNode(unref(bngButton_default),{class:`recordings-button`,onClick:listRecordings,icon:`folder`,tooltip:`Open recordings`,accent:unref(ACCENTS).text},null,8,[`accent`]),loadedFile.value&&state.value!==`recording`&&!renaming.value?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`recordings-button`,onClick:stop$1,icon:`xmark`,disabled:state.value!==`playback`,tooltip:`Close replay`,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`])):createCommentVNode(``,!0),state.value===`recording`?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:`recordings-button`,onClick:cancelRecording,icon:`undo`,accent:unref(ACCENTS).attention,tooltip:`Cancel recording`},null,8,[`accent`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$120,[loadedFile.value&&state.value!==`recording`?(openBlock(),createElementBlock(Fragment,{key:0},[renaming.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngButton_default),{onClick:cancelRename,icon:`xmark`,accent:unref(ACCENTS).ghost,class:`cancel-rename-button`},null,8,[`accent`]),createVNode(unref(bngInput_default),{id:`replay-filename-input`,class:`filename-input`,prefix:replayFolder,suffix:replayFileExtension,modelValue:loadedFile.value,"onUpdate:modelValue":_cache[0]||=$event=>loadedFile.value=$event,placeholder:`(no file)`,disabled:state.value===`recording`||!loadedFile.value,onKeyup:withKeys(acceptRename,[`enter`])},null,8,[`modelValue`,`disabled`])],64)):(openBlock(),createElementBlock(`div`,_hoisted_4$98,toDisplayString(replayFolder)+toDisplayString(loadedFile.value)+toDisplayString(replayFileExtension),1)),createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>renaming.value?acceptRename():startRenaming(),icon:renaming.value?`checkmark`:`edit`,accent:renaming.value?unref(ACCENTS).main:unref(ACCENTS).ghost},null,8,[`icon`,`accent`])],64)):(openBlock(),createElementBlock(`div`,_hoisted_5$85,` No File loaded `))]),createBaseVNode(`div`,_hoisted_6$70,[createVNode(unref(bngButton_default),{onClick:toggleRecording,icon:state.value===`recording`?`square`:`bigDot`,accent:unref(ACCENTS).text,disabled:state.value===`playback`,tooltip:state.value===`recording`?`Save recording`:`Record new replay`,class:`recordings-button record-button`},null,8,[`icon`,`accent`,`disabled`,`tooltip`])])],2)),createBaseVNode(`div`,_hoisted_7$60,[createBaseVNode(`div`,{class:normalizeClass([`replay-controls`,{narrow:layoutState.value.isReplayControlsNarrow}]),ref_key:`replayControlsRef`,ref:replayControlsRef},[createBaseVNode(`div`,_hoisted_8$50,[createVNode(unref(bngButton_default),{onClick:togglePlay,class:`play-button`,icon:state.value===`playback`&&!paused.value?`pause`:`play`,disabled:state.value===`recording`||!loadedFile.value,accent:unref(ACCENTS).ghost},null,8,[`icon`,`disabled`,`accent`]),state.value===`inactive`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_9$44,[createVNode(unref(bngButton_default),{class:`speed-button small`,onClick:_cache[2]||=$event=>toggleSpeed(-1),icon:`mathMinus`,disabled:!loadedFile.value,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`]),createBaseVNode(`div`,{class:normalizeClass([`playback-speed-display`,{disabled:!loadedFile.value}])},toDisplayString(speed.value.toFixed(2))+`x`,3),createVNode(unref(bngButton_default),{class:`speed-button small`,onClick:_cache[3]||=$event=>toggleSpeed(1),icon:`mathPlus`,disabled:!loadedFile.value,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`])]))]),createBaseVNode(`div`,{class:normalizeClass([`time-display`,{active:loadedFile.value,seeking:isSeeking.value}])},[createBaseVNode(`div`,_hoisted_10$37,[(openBlock(),createElementBlock(`svg`,_hoisted_11$33,[(openBlock(),createElementBlock(`svg`,_hoisted_12$26,[createBaseVNode(`g`,_hoisted_13$23,[createBaseVNode(`text`,_hoisted_14$22,toDisplayString(formatTime$1(positionSeconds.value)),1)])]))]))]),createBaseVNode(`span`,_hoisted_15$21,`(`+toDisplayString(formatTime$1(totalSeconds.value))+`)`,1)],2)],2),createBaseVNode(`div`,_hoisted_16$21,[createVNode(unref(bngSlider_default),{modelValue:positionPercent.value,"onUpdate:modelValue":_cache[4]||=$event=>positionPercent.value=$event,min:0,max:1,step:.001,onInput:seek,disabled:state.value!==`playback`||!loadedFile.value},null,8,[`modelValue`,`disabled`])])])],512))}},app_default$1=__plugin_vue_export_helper_default(_sfc_main$181,[[`__scopeId`,`data-v-bf84291a`]]),_hoisted_1$161={style:{width:`100%`,height:`100%`},class:`bng-app`,layout:`column`},_hoisted_2$133={style:{display:`flex`,"justify-content":`center`,"align-items":`baseline`}},_hoisted_3$119={style:{"font-size":`1.3em`,"font-weight":`bold`}},_hoisted_4$97={style:{color:`rgba(255, 255, 255, 0.8)`}},_hoisted_5$84={style:{"text-align":`center`,color:`rgba(255, 255, 255, 0.8)`,"font-size":`0.75em`}},_sfc_main$180={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`];$game.streams.add(streamsList$1);let numToBig=ref(`1`);ref(NaN);let rpm=ref(0),leadingZeros=ref(null);onMounted(()=>{console.log(`simpleDigTacho mounted`),$game.events.on(`onStreamsUpdate`,onStreamsUpdate)}),onUnmounted(()=>{console.log(`simpleDigTacho unmounted`),$game.streams.remove(streamsList$1),$game.events.off(`onStreamsUpdate`,onStreamsUpdate)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;if(rpm.value=Math.round(streams.engineInfo[4]),rpm.value.toString().length>4){let help=10**(rpm.value.toString().length-4);numToBig.value=help.toString(),rpm.value=Math.round(rpm.value/help)}else numToBig.value=`1`;rpm.value=rpm.value.toString().slice(-4),isNaN(rpm.value)||(leadingZeros.value=`0000`.slice(rpm.value.length))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$161,[createBaseVNode(`div`,_hoisted_2$133,[createBaseVNode(`span`,_hoisted_3$119,[createBaseVNode(`span`,_hoisted_4$97,toDisplayString(leadingZeros.value),1),createBaseVNode(`span`,null,toDisplayString(rpm.value),1)]),_cache[0]||=createBaseVNode(`span`,{style:{"font-size":`0.9em`,"font-weight":`bold`,"margin-left":`2px`}},`RPM`,-1)]),createBaseVNode(`small`,_hoisted_5$84,[createTextVNode(toDisplayString(_ctx.$t(`ui.apps.digTacho.engine`))+` `,1),createBaseVNode(`span`,null,`(x`+toDisplayString(numToBig.value)+`)`,1)])]))}},app_default$25=_sfc_main$180,_hoisted_1$160={"xmlns:svg":`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,version:`1.1`,width:`100%`,height:`100%`,viewBox:`0 0 660 660`},_hoisted_2$132={"xml:space":`preserve`,class:`text1`,x:`329.88641`,y:`289.30463`,id:`tspan4449-43`},_hoisted_3$118={"xml:space":`preserve`,id:`speed_units`,class:`speed-units`,x:`330`,y:`348`},_hoisted_4$96={"xml:space":`preserve`,id:`tspan4449-4-3`,class:`tacho2-gear`,x:`386.67343`,y:`457.94861`,transform:`matrix(1,0,-0.13142611,1,0,0)`},_hoisted_5$83={"xml:space":`preserve`,x:`330.09229`,y:`498.18045`,id:`text4447-2-4`,class:`rpm-text-legend`},_hoisted_6$69={transform:`translate(-150,-214)`,id:`revcurvemask`,class:`revcurvemask`,"clip-path":`url(#clipPath4710)`},rpmTextSize=50,maxRpmTexts=13,tickMarkLength=64,tickInnerOffset=42,_sfc_main$179={__name:`tacho`,setup(__props,{expose:__expose}){let width$1=660,height$1=660,initialized=ref(!1),dashSize$1=5,computeGaugeFullRange=maxrpm=>Math.ceil((maxrpm||0)/1e3)*1e3+1e3,computeGaugeStep=maxrpm=>maxrpm<4e3?500:maxrpm>15e3?2e3:1e3,computeGaugeMarks=maxrpm=>{let fullRange=computeGaugeFullRange(maxrpm),step=computeGaugeStep(maxrpm);return Math.ceil(fullRange/step)+1},rpmTextRefs=ref([]),setRpmRef=(el,i)=>{el&&(rpmTextRefs.value[i]=el)},oilTempBarRef=ref(null),oilTempBarLen=computed(()=>oilTempBarRef.value.getTotalLength()),oilTempIcoOffRef=ref(null),oilTempIcoOnRef=ref(null),speedTextRef=ref(null),gearTextRef=ref(null),revcurveRef=ref(null),revCurveLen=computed(()=>revcurveRef.value.getTotalLength()),revcurveDashesRef=ref(null),revCurveDashesLen=computed(()=>revcurveDashesRef.value.getTotalLength()),fuelBarRef=ref(null),fuelBarLen=computed(()=>fuelBarRef.value.getTotalLength()),fuelWarnIcoOffRef=ref(null),fuelWarnIcoOnRef=ref(null),lastFuelLevel=0,shouldPlayFuelLowSound=!1,lowFuelSoundPlayed=!1,isCareer=!1,redLineRef=ref(null),redLineLen=computed(()=>redLineRef.value.getTotalLength()),rpmTextGuideLineRef=ref(null),rpmTextGuideLineLen=computed(()=>rpmTextGuideLineRef.value.getTotalLength()),tickMarkRefs=ref([]),setTickRef=(el,i)=>{el&&(tickMarkRefs.value[i]=el)},icoHandBrakeOffRef=ref(null),icoHandBrakeOnRef=ref(null),icoABSOffRef=ref(null),icoABSOnRef=ref(null),icoIndicatorLeftOffRef=ref(null),icoIndicatorLeftOnRef=ref(null),icoIndicatorRightOffRef=ref(null),icoIndicatorRightOnRef=ref(null),icoLightsOffRef=ref(null),icoLightsOnRef=ref(null),icoLightsHighRef=ref(null),layer3Ref=ref(null),layer4Ref=ref(null),layer6Ref=ref(null),layer7Ref=ref(null),layer10Ref=ref(null),layer11Ref=ref(null),layer12Ref=ref(null),tickLayerRef=ref(null),speedUnitTextRef=ref(null),rpm_max=ref(8e3),rpmLegendTextRef=ref(null),revNeedleRef=ref(null),displayMode=ref(2);onMounted(()=>{rpmLegendTextRef?.value&&(rpmLegendTextRef.value.textContent=`x1000 RPM`),oilTempBarRef.value.style.strokeDasharray=oilTempBarLen.value+` `+oilTempBarLen.value,speedTextRef.value.textContent=``,revcurveRef.value.style.strokeDasharray=revCurveLen.value+` `+revCurveLen.value,fuelBarRef.value.style.strokeDasharray=fuelBarLen.value+` `+fuelBarLen.value,rpmTextGuideLineRef.value.style.display=`none`;for(let k=0;kisCareer=isActive)});function applyData(data$1){speedTextRef.value.textContent=data$1.speedtext,(speedTextRef.value.textContent==`-Infinity`||speedTextRef.value.textContent==`Infinity`)&&(speedTextRef.value.textContent=`-`),gearTextRef.value.textContent=data$1.geartext,fuelBarRef.value.style[`stroke-dashoffset`]=(1-data$1.fuel)*fuelBarLen.value;let fuelLow=data$1.fuel<.1,fuelGoneLow=lastFuelLevel>=.1&&fuelLow;lastFuelLevel=data$1.fuel,fuelWarnIcoOffRef.value.style.visibility=fuelLow?`hidden`:`visible`,fuelWarnIcoOnRef.value.style.visibility=fuelLow?`visible`:`hidden`,data$1.ignition&&isCareer&&fuelGoneLow&&!shouldPlayFuelLowSound&&setTimeout(()=>shouldPlayFuelLowSound=!0,0),shouldPlayFuelLowSound&&!lowFuelSoundPlayed&&(lowFuelSoundPlayed=!0,Lua_default.ui_audio.playEventSound(`bng_career_fuel`,`low_fuel`)),icoHandBrakeOffRef.value.style.visibility=data$1.parkingBrake?`hidden`:`visible`,icoHandBrakeOnRef.value.style.visibility=data$1.parkingBrake?`visible`:`hidden`,icoABSOffRef.value.style.visibility=data$1.absWorking?`hidden`:`visible`,icoABSOnRef.value.style.visibility=data$1.absWorking?`visible`:`hidden`,icoIndicatorLeftOffRef.value.style.visibility=data$1.signalL?`hidden`:`visible`,icoIndicatorLeftOnRef.value.style.visibility=data$1.signalL?`visible`:`hidden`,icoIndicatorRightOffRef.value.style.visibility=data$1.signalR?`hidden`:`visible`,icoIndicatorRightOnRef.value.style.visibility=data$1.signalR?`visible`:`hidden`;let tempNormalized=Math.max(Math.min((data$1.waterTemp-50)/80,1),0);oilTempBarRef.value.style.strokeDashoffset=(1+tempNormalized)*oilTempBarLen.value;let oilTemp_warn=tempNormalized>.8125;if(oilTempIcoOffRef.value.style.visibility=oilTemp_warn?`hidden`:`visible`,oilTempIcoOnRef.value.style.visibility=oilTemp_warn?`visible`:`hidden`,data$1.lowBeam!==void 0&&data$1.highBeam!==void 0){let nb=!0,lb=data$1.lowBeam>.9,hb=data$1.highBeam>.9;lb&&(nb=!1),hb&&(nb=!1),icoLightsOffRef.value.style.visibility=nb?`visible`:`hidden`,icoLightsOnRef.value.style.visibility=lb?`visible`:`hidden`,icoLightsHighRef.value.style.visibility=hb?`visible`:`hidden`}else icoLightsOffRef.value.style.visibility=`hidden`,icoLightsOnRef.value.style.visibility=`hidden`,icoLightsHighRef.value.style.visibility=`hidden`;let rpm_rotation=data$1.rpm*270-180;rpm_rotation<-180&&(rpm_rotation=-180),rpm_rotation>90&&(rpm_rotation=90),revNeedleRef.value.setAttribute(`transform`,`rotate(`+rpm_rotation+`,330,330)`);let revCurveOffset=(1-data$1.rpm)*revCurveLen.value;revCurveOffset<0&&(revCurveOffset=0),revCurveOffset>revCurveLen.value&&(revCurveOffset=revCurveLen.value),revcurveRef.value.style.strokeDashoffset=revCurveOffset}let data=ref({}),layersVisible=!1;function setlayersVisible(v){if(layersVisible!=v){let val=v?`inline`:`none`;layer3Ref.value.style.display=val,layer4Ref.value.style.display=val,layer6Ref.value.style.display=val,layer7Ref.value.style.display=val,layer10Ref.value.style.display=val,layer11Ref.value.style.display=val,layer12Ref.value.style.display=val,tickLayerRef.value.style.display=val,layersVisible=v}}function reset$1(){setlayersVisible(!1),initialized.value=!1;for(let k=0;k=0?1:-1,inx=nx*sign,iny=ny*sign,x1=pt.x+inx*tickInnerOffset,y1=pt.y+iny*tickInnerOffset,x2=x1+inx*tickMarkLength,y2=y1+iny*tickMarkLength;line.setAttribute(`x1`,x1),line.setAttribute(`y1`,y1),line.setAttribute(`x2`,x2),line.setAttribute(`y2`,y2),line.style.visibility=`visible`}}for(let k=dashCount$1+1;k<=maxRpmTexts;k++){let rp=rpmTextRefs.value[k];rp&&(rp.style.visibility=`hidden`);let line=tickMarkRefs.value[k];line&&(line.style.visibility=`hidden`)}initialized.value=!0}if(!isStreamValid)return!1;if(setlayersVisible(!0),displayMode.value==2)streams.electrics.wheelspeed?(data.speedtext=UnitSpeed(streams.electrics.wheelspeed),streams.electrics.wheelspeed>9e3&&(speedUnitTextRef.value.textContent=`brrrr`)):streams.electrics.airspeed&&(data.speedtext=UnitSpeed(streams.electrics.airspeed)),(function(){if(streams.engineInfo[13]==`manual`){let gear=streams.engineInfo[5],gearStr=gear.toString();gear==0?gearStr=`N`:gear==-1?gearStr=`R`:-gear>1&&(gearStr=`R`+-gear),data.geartext=gearStr}else data.geartext=[`P`,`R`,`N`,`D`,`2`,`1`][Math.round(streams.electrics.gear_A*5)]})(),data.fuel=streams.engineInfo[11]/streams.engineInfo[12],data.parkingBrake=streams.electrics.parkingbrake,data.absWorking=streams.electrics.abs,data.signalL=streams.electrics.signal_L,data.signalR=streams.electrics.signal_R,data.waterTemp=streams.electrics.watertemp,data.lowBeam=streams.electrics.lowbeam,data.highBeam=streams.electrics.highbeam,data.rpm=(streams.electrics.rpmTacho||0)/rpm_max.value;else if(displayMode.value==0){testVar+=.04,testVar>1&&(testVar=1),data.speedtext=Math.round(testVar*100),data.geartext=Math.round(testVar*5),data.fuel=testVar;let boolTest=!0;data.parkingBrake=!0,data.absWorking=!0,data.signalL=!0,data.signalR=!0,data.oilTemp=testVar,data.lowBeam=!0,data.highBeam=!1,data.rpm=testVar,testVar>=1&&(testVar=0,displayMode.value=1)}else if(displayMode.value==1){streams.electrics.wheelspeed?data.speedtext=UnitSpeed(streams.electrics.wheelspeed):(data.speedtext=``,speedUnitTextRef.value.textContent=``),(function(){let gear=streams.engineInfo[5],gearStr=gear.toString();gear==0?gearStr=`N`:gear==-1&&(gearStr=`R`),data.geartext=gearStr})(),data.parkingBrake=streams.electrics.parkingbrake,data.absWorking=streams.electrics.abs,data.signalL=streams.electrics.signal_L,data.signalR=streams.electrics.signal_R,data.lowBeam=streams.electrics.lowbeam,data.highBeam=streams.electrics.highbeam;let oilok=Math.abs(data.oilTemp-streams.electrics.oiltemp)<.005;oilok||(data.oilTemp+=(streams.electrics.oiltemp-data.oilTemp)*.2);let rpmperc=streams.electrics.rpm/rpm_max.value,rpmok=Math.abs(data.rpm-rpmperc)<.005;rpmok||(data.rpm+=(rpmperc-data.rpm)*.2);let fuelperc=streams.engineInfo[11]/streams.engineInfo[12],fuelok=Math.abs(data.fuel-fuelperc)<.005;fuelok||(data.fuel+=(fuelperc-data.fuel)*.2),oilok&&rpmok&&fuelok&&(displayMode.value=2)}return data.engineRunning=streams.electrics.engineRunning,data.ignition=streams.electrics.ignition,applyData(data),!0}function vehicleChanged(){initialized.value=!1}let UiUnitscallback=ref(()=>null);function UnitSpeed(val){let convertedVal=UiUnitscallback.value(val,`speed`);return speedUnitTextRef.value.textContent=convertedVal.unit,Math.round(convertedVal.val)}function wireThroughUnitSystem(callback){UiUnitscallback.value=callback}return __expose({wireThroughUnitSystem,update:update$6,vehicleChanged}),(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$160,[_cache[17]||=createBaseVNode(`defs`,{id:`defs4`},[createBaseVNode(`linearGradient`,{id:`linearGradient3938`},[createBaseVNode(`stop`,{style:{"stop-color":`#ff0000`,"stop-opacity":`1`},offset:`0`,id:`stop3940`}),createBaseVNode(`stop`,{style:{"stop-color":`#00ff4b`,"stop-opacity":`1`},offset:`1`,id:`stop3942`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4607`},[createBaseVNode(`stop`,{id:`stop4609`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.89960396`,id:`stop4611`}),createBaseVNode(`stop`,{id:`stop4613`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4615`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4597`},[createBaseVNode(`stop`,{id:`stop4599`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.99812102`,id:`stop4601`}),createBaseVNode(`stop`,{id:`stop4603`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4605`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4545`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547`}),createBaseVNode(`stop`,{id:`stop4553`,offset:`0.9861111`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4555`}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4549`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4256`},[createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`1`},offset:`0`,id:`stop4258`}),createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`0`},offset:`1`,id:`stop4260`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4365`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367`}),createBaseVNode(`stop`,{id:`stop4373`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4357`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`1`},offset:`0`,id:`stop4359`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.19642857`},offset:`1`,id:`stop4361`})]),createBaseVNode(`marker`,{style:{overflow:`visible`},id:`DistanceStart`,refX:`0`,refY:`0`,orient:`auto`},[createBaseVNode(`g`,{id:`g2300`},[createBaseVNode(`path`,{style:{fill:`none`,stroke:`#ffffff`,"stroke-width":`1.14999998`,"stroke-linecap":`square`},d:`M 0,0 2,0`,id:`path2306`}),createBaseVNode(`path`,{style:{fill:`#000000`,"fill-rule":`evenodd`,stroke:`none`},d:`M 0,0 13,4 9,0 13,-4 0,0 z`,id:`path2302`}),createBaseVNode(`path`,{style:{fill:`none`,stroke:`#000000`,"stroke-width":`1`,"stroke-linecap":`square`},d:`M 0,-4 0,40`,id:`path2304`})])]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4365`,id:`radialGradient4371`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407`},[createBaseVNode(`path`,{id:`path4409`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-9`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-8`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-3`},[createBaseVNode(`path`,{id:`path4409-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.37015162,0,0,0.37015162,685.90181,-270.76027)`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"xlink:href":`#linearGradient4256`,id:`linearGradient4433`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-4`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363-5`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-6`},[createBaseVNode(`path`,{id:`path4409-1`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.36968813,0,0,0.36968813,1026.9451,-270.68256)`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-49`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"xlink:href":`#linearGradient4256`,id:`linearGradient4746`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3921`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3923`,d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3925-1`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3927-7`,d:`m 330,10 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 296.74495,71.61583 313.18224,70 330,70 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 417.49749,19.23259 374.82925,10 330,10 z m -67.13867,7.07812 C 202.16219,30.03925 147.84399,60.20471 105.25195,102.23633 l 42.54297,42.3125 C 182.22028,110.72238 226.01669,86.41327 274.9375,75.86328 L 262.86133,17.07812 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 565.93577,105.29347 518.20331,63.82636 461.72461,38.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 575.92383,233.46544 590,280.08649 590,330 l 60,0 C 650,268.39079 632.57195,210.85952 602.40234,162.03516 z M 15.06055,273.02148 C 11.7373,291.51211 10,310.55271 10,330 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 76.98058,398.61583 70,365.12541 70,330 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 L 15.06055,273.02148 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 141.73258,515.3212 111.08736,478.12046 91.96094,434.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 202.04051,629.81227 263.66249,650 330,650 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545`,id:`linearGradient4551`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545-2`,id:`linearGradient4551-8`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4545-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547-4`}),createBaseVNode(`stop`,{id:`stop4553-5`,offset:`0.99000001`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4555-5`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4549-1`})]),createBaseVNode(`linearGradient`,{y2:`282.59341`,x2:`474.60886`,y1:`211.1199`,x1:`480`,gradientUnits:`userSpaceOnUse`,id:`linearGradient4574`,"xlink:href":`#linearGradient4607`,"inkscape:collect":`always`,gradientTransform:`matrix(1,0,0,0.9882541,0,10.359887)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036-1`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0`,id:`radialGradient4363-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8`},[createBaseVNode(`path`,{id:`path4409-8`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4365-4`,id:`radialGradient4371-2`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5`}),createBaseVNode(`stop`,{id:`stop4373-5`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997`,"xlink:href":`#linearGradient4365-4`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4363-4-1`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4001`,"xlink:href":`#linearGradient4357-0-7`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4040`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4045`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7-2`,id:`radialGradient4045-8`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-758.53125,-231)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4063`,"xlink:href":`#linearGradient4357-0-7-2`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4082`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-8`,id:`radialGradient4363-4-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4031-1`,"xlink:href":`#linearGradient4357-0-8-5`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8-5`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7-2`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-3`,id:`radialGradient4363-4-0`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-3`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9-8`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4-01`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8-2`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-8-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4401`,"xlink:href":`#linearGradient4357-0-3`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997-4`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5-8`}),createBaseVNode(`stop`,{id:`stop4373-5-3`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4458`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4710`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`66.66205597`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 480,224 c -176.33633,0 -320,143.66367 -320,320 0,176.33633 143.66368,320 320,320 l 0,-66.66211 C 339.69052,797.33789 226.66211,684.30947 226.66211,544 226.66211,403.69051 339.69051,290.66211 480,290.66211 620.30948,290.66211 733.33789,403.69052 733.33789,544 L 800,544 C 800,367.66368 656.33632,224 480,224 Z`,id:`path4712`,"inkscape:connector-curvature":`0`})])],-1),createBaseVNode(`g`,{ref_key:`layer6Ref`,ref:layer6Ref,id:`layer6`,class:`layer6`},[_cache[1]||=createBaseVNode(`circle`,{transform:`translate(-150,-214)`,id:`path4281-5`,class:`circle1`,cx:`480`,cy:`544`,r:`320`,d:`M 800,544 C 800,720.73112 656.73112,864 480,864 303.26888,864 160,720.73112 160,544 160,367.26888 303.26888,224 480,224 c 176.73112,0 320,143.26888 320,320 z`},null,-1),_cache[2]||=createBaseVNode(`path`,{transform:`translate(-150,-214)`,id:`path4281`,class:`path1`,d:`M 480,214 C 297.74603,214 150,361.74603 150,544 150,726.25397 297.74603,874 480,874 662.25397,874 810,726.25397 810,544 810,361.74603 662.25397,214 480,214 z`,"clip-path":`url(#clipPath4407-8)`},null,-1),createBaseVNode(`text`,_hoisted_2$132,[createBaseVNode(`tspan`,{ref_key:`speedTextRef`,ref:speedTextRef,id:`tacho2speed`,class:`tacho2-speed`,x:`329.88641`,y:`289.30463`},`0`,512)]),createBaseVNode(`text`,_hoisted_3$118,[createBaseVNode(`tspan`,{ref_key:`speedUnitTextRef`,ref:speedUnitTextRef,id:`speedunit`,x:`330`,y:`348`},`mph`,512)]),createBaseVNode(`text`,_hoisted_4$96,[createBaseVNode(`tspan`,{ref_key:`gearTextRef`,ref:gearTextRef,id:`tacho2gear`,class:`text`,x:`386.67343`,y:`457.94861`},`4`,512)]),(openBlock(),createElementBlock(Fragment,null,renderList(maxRpmTexts,k=>createBaseVNode(`text`,{ref_for:!0,ref:el=>setRpmRef(el,k),"xml:space":`preserve`,x:`0`,y:`0`,class:`rpm-text`},[..._cache[0]||=[createBaseVNode(`tspan`,{x:`0`,y:`0`},null,-1)]],512)),64)),createBaseVNode(`text`,_hoisted_5$83,[createBaseVNode(`tspan`,{ref_key:`rpmLegendTextRef`,ref:rpmLegendTextRef,id:`tspan4449-3-1`,x:`330.09229`,y:`498.18045`},`x1000 RPM`,512)]),_cache[3]||=createBaseVNode(`path`,{"clip-path":`none`,id:`path4258`,class:`path-oil-fuel`,d:`M 462.44226,446.99523 C 489.99031,415.832 506.71155,374.86426 506.71155,330 c 0,-44.86426 -16.72124,-85.832 -44.26929,-116.99523 m -264.88452,0 C 170.00969,244.168 153.28845,285.13574 153.28845,330 c 0,44.86426 16.72124,85.832 44.26929,116.99523`},null,-1),createBaseVNode(`path`,{ref_key:`fuelBarRef`,ref:fuelBarRef,id:`fuel`,class:`fuel-bar`,d:`M 462.44226,446.99523 C 489.99031,415.832 506.71155,374.86426 506.71155,330 c 0,-44.86426 -16.72124,-85.832 -44.26929,-116.99523`},null,512),createBaseVNode(`path`,{ref_key:`oilTempBarRef`,ref:oilTempBarRef,id:`temp`,class:`oil-temp-bar`,d:`M 197.55774,213.00477 C 170.00969,244.168 153.28845,285.13574 153.28845,330 c 0,44.86426 16.72124,85.832 44.26929,116.99523`},null,512)],512),createBaseVNode(`g`,{ref_key:`layer3Ref`,ref:layer3Ref,id:`layer3`,class:`layer3`},[createBaseVNode(`g`,_hoisted_6$69,[_cache[4]||=createBaseVNode(`rect`,{y:`203.90677`,x:`141.28131`,height:`683.79401`,width:`683.79401`,id:`rect4001`,class:`layer3-rect`},null,-1),createBaseVNode(`path`,{ref_key:`revcurveRef`,ref:revcurveRef,class:`revcurve`,id:`revcurve`,"clip-path":`none`,d:`M 330,690 C 131.17749,690 -30,528.82251 -30,330 -30,131.17749 131.17749,-30 330,-30 c 198.82251,0 360,161.17749 360,360`,transform:`matrix(0.80555556,0,0,0.80555556,214.16667,278.16667)`},null,512),createBaseVNode(`path`,{ref_key:`redLineRef`,ref:redLineRef,class:`redline`,id:`rpm_redline`,d:`M 330,610 C 175.36027,610 50,484.63973 50,330 50,175.36027 175.36027,50 330,50 484.63973,50 610,175.36027 610,330`,transform:`matrix(1.038252,0,0,1.038252,137.37687,201.37687)`},null,512)])],512),createBaseVNode(`g`,{ref_key:`layer11Ref`,ref:layer11Ref,id:`layer11`,class:`layer11`},[createBaseVNode(`path`,{ref_key:`revcurveDashesRef`,ref:revcurveDashesRef,id:`revcurve_dashes`,class:`revcurve-dashes`,d:`M 330,616.66897 C 171.6771,616.66897 43.331027,488.3229 43.331027,330 43.331026,171.67709 171.67709,43.33103 330,43.331031 488.3229,43.331031 616.66897,171.6771 616.66897,330`},null,512),createBaseVNode(`path`,{ref_key:`rpmTextGuideLineRef`,ref:rpmTextGuideLineRef,id:`rpmtextline`,class:`rpm-textline`,d:`M 329,550 C 204.73594,550 104,449.26406 104,325 104,200.73593 204.73593,100 329,100 c 124.26406,0 225,100.73594 225,225`},null,512)],512),_cache[18]||=createBaseVNode(`g`,{id:`layer2`,style:{display:`none`}},[createBaseVNode(`g`,{style:{display:`inline`},id:`ico_handbrake_12343525ron`,transform:`translate(-4.2182737e-6,-2.0000051)`},[createBaseVNode(`path`,{transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,style:{display:`inline`,fill:`#ff7900`,"fill-opacity":`1`,stroke:`#ffffff`,"stroke-width":`12`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 631.44636,979.59082 a 65.760933,65.760933 0 0 1 -65.76094,65.76098 65.760933,65.760933 0 0 1 -65.76093,-65.76098 65.760933,65.760933 0 0 1 65.76093,-65.76093 65.760933,65.760933 0 0 1 65.76094,65.76093 z`,id:`path4551-2-7`}),createBaseVNode(`path`,{"sodipodi:nodetypes":`csc`,id:`path4551-7-7-3`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`,style:{display:`inline`,fill:`none`,stroke:`#ffffff`,"stroke-width":`5.26201868`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":`4`,"stroke-opacity":`1`}}),createBaseVNode(`path`,{"sodipodi:nodetypes":`csc`,id:`path4551-7-4-7-72`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`,style:{display:`inline`,fill:`none`,stroke:`#ffffff`,"stroke-width":`5.26201868`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":`4`,"stroke-opacity":`1`}}),createBaseVNode(`g`,{id:`flowRoot5902-7-4`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`55px`,"line-height":`125%`,"font-family":`'Open Sans'`,"-inkscape-font-specification":`'Open Sans Bold'`,"letter-spacing":`-3.45999861px`,"word-spacing":`0px`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,259.17408,95.334998)`},[createBaseVNode(`path`,{id:`path3978-3-5`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 548.35205,1001.1788 -2.84668,-9.34567 -14.31396,0 -2.84668,9.34567 -8.96973,0 13.85742,-39.4238 10.17822,0 13.91114,39.4238 z m -4.83398,-16.32809 c -2.63186,-8.4684 -4.11339,-13.25762 -4.44458,-14.36768 -0.33124,-1.10999 -0.56846,-1.98727 -0.71167,-2.63183 -0.59084,2.29169 -2.28274,7.95819 -5.07569,16.99951 z`}),createBaseVNode(`path`,{id:`path3980-3-4`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 558.77633,961.91614 12.21924,0 c 5.56801,4e-5 9.60975,0.79227 12.12524,2.37671 2.51543,1.5845 3.77316,4.10444 3.77319,7.55981 -3e-5,2.3454 -0.55056,4.27004 -1.65161,5.77393 -1.1011,1.50392 -2.56472,2.40806 -4.39087,2.7124 l 0,0.26855 c 2.48858,0.55504 4.28342,1.59345 5.38453,3.11524 1.10104,1.52182 1.65157,3.54493 1.65161,6.06933 -4e-5,3.58074 -1.29357,6.37371 -3.88062,8.37891 -2.5871,2.00518 -6.10069,3.00778 -10.54077,3.00778 l -14.68994,0 z m 8.32519,15.54931 4.83399,0 c 2.25584,3e-5 3.88954,-0.34909 4.90112,-1.04736 1.01153,-0.69822 1.51731,-1.853 1.51734,-3.46436 -3e-5,-1.50387 -0.55057,-2.58257 -1.65162,-3.23608 -1.10109,-0.65345 -2.84222,-0.98019 -5.22338,-0.98022 l -4.37745,0 z m 0,6.60645 0,10.23193 5.42481,0 c 2.29164,1e-5 3.98354,-0.43863 5.07568,-1.31592 1.0921,-0.87727 1.63816,-2.22004 1.63819,-4.02832 -3e-5,-3.25844 -2.3275,-4.88767 -6.98243,-4.88769 z`}),createBaseVNode(`path`,{id:`path3982-5-4`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 615.44572,990.27551 c -2e-5,3.54493 -1.27566,6.3379 -3.8269,8.37891 -2.55129,2.04098 -6.10069,3.06148 -10.64819,3.06148 -4.18947,0 -7.89552,-0.7877 -11.11817,-2.36324 l 0,-7.73437 c 2.64974,1.18164 4.89217,2.01416 6.7273,2.49755 1.83511,0.48341 3.51358,0.72511 5.0354,0.7251 1.82615,10e-6 3.22711,-0.34911 4.20288,-1.04736 0.97573,-0.69824 1.4636,-1.73665 1.46362,-3.11524 -2e-5,-0.76984 -0.21486,-1.45466 -0.64453,-2.05444 -0.42971,-0.59976 -1.06081,-1.17715 -1.89331,-1.73218 -0.83254,-0.555 -2.5289,-1.44123 -5.08911,-2.65869 -2.3991,-1.12791 -4.19841,-2.21108 -5.39795,-3.24951 -1.19955,-1.03839 -2.15739,-2.24689 -2.87354,-3.62549 -0.71614,-1.37855 -1.07422,-2.98988 -1.07421,-4.83398 -10e-6,-3.47328 1.17716,-6.20358 3.53149,-8.19092 2.35432,-1.98727 5.6083,-2.98092 9.76196,-2.98096 2.041,4e-5 3.98802,0.24174 5.84107,0.7251 1.853,0.48344 3.79107,1.16377 5.81421,2.04102 l -2.68555,6.47216 c -2.09475,-0.85934 -3.82693,-1.45911 -5.19653,-1.79931 -1.36965,-0.34014 -2.7169,-0.51022 -4.04175,-0.51026 -1.57554,4e-5 -2.78403,0.36706 -3.62549,1.10108 -0.84148,0.73408 -1.26222,1.69192 -1.26221,2.87353 -10e-6,0.73408 0.17008,1.37413 0.51026,1.92017 0.34015,0.54609 0.88174,1.07424 1.62475,1.58447 0.74299,0.51028 2.50202,1.42784 5.2771,2.75269 3.67023,1.75457 6.18569,3.51361 7.54639,5.2771 1.36065,1.76352 2.04099,3.92538 2.04101,6.48559 z`})]),createBaseVNode(`g`,{id:`flowRoot5902-7-5`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`55px`,"line-height":`125%`,"font-family":`'Open Sans'`,"-inkscape-font-specification":`'Open Sans Bold'`,"letter-spacing":`-3.45999861px`,"word-spacing":`0px`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,317.47869,20.439182)`},[createBaseVNode(`g`,{transform:`matrix(0.99999322,0.00368229,-0.00368229,0.99999322,0,0)`,style:{"font-style":`normal`,"font-weight":`normal`,"font-size":`94.63018036px`,"line-height":`125%`,"font-family":`sans-serif`,"letter-spacing":`0px`,"word-spacing":`0px`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},id:`text4455`},[createBaseVNode(`path`,{d:`m 607.02483,962.46092 q 0,4.62062 -1.61722,9.05641 -1.61721,4.38958 -4.62061,7.39298 -4.11235,4.06614 -9.19502,6.14542 -5.03647,2.07927 -12.56807,2.07927 l -11.04327,0 0,22.41 -17.74316,0 0,-68.80096 29.20228,0 q 6.56127,0 11.04327,1.15515 4.5282,1.10895 7.99366,3.37305 4.15856,2.72616 6.33024,6.97713 2.2179,4.25096 2.2179,10.21155 z m -18.34384,0.41586 q 0,-2.91099 -1.57101,-4.99026 -1.57101,-2.12549 -3.65028,-2.9572 -2.77237,-1.10895 -5.40612,-1.20136 -2.63375,-0.13862 -7.02334,-0.13862 l -3.0496,0 0,20.60794 5.08267,0 q 4.52821,0 7.43919,-0.55447 2.9572,-0.55447 4.94406,-2.21789 1.70963,-1.4786 2.44893,-3.51167 0.7855,-2.07928 0.7855,-5.03647 z`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`94.63018036px`,"line-height":`125%`,"font-family":`'Open Sans Extrabold'`,"-inkscape-font-specification":`'Open Sans Extrabold, Bold'`,"text-align":`start`,"writing-mode":`lr-tb`,"text-anchor":`start`,fill:`#ffffff`,"fill-opacity":`1`},id:`path4527`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`path`,{transform:`matrix(0.99999322,0.00368229,-0.00368229,0.99999322,0,0)`,style:{fill:`none`,"fill-opacity":`1`,stroke:`#000000`,"stroke-width":`5.69782162`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 28.554777,1230.2663 c -137.847287,0 -270.048717,-54.7596 -367.521467,-152.2324 -97.47276,-97.47273 -152.23238,-229.67416 -152.23238,-367.52145 0,-137.84729 54.75963,-270.04871 152.23238,-367.52146 97.47275,-97.47276 229.67418,-152.23238 367.521467,-152.23238 137.847293,0 270.048713,54.75962 367.521463,152.23238 97.47275,97.47275 152.23238,229.67417 152.23238,367.52146 0,137.84729 -54.75962,270.04871 -152.23238,367.52145 -97.47275,97.4728 -229.67417,152.2324 -367.521463,152.2324`,id:`text_path`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`csssssssc`,"inkscape:label":`#path4459`})])])],-1),createBaseVNode(`g`,{ref_key:`layer7Ref`,ref:layer7Ref,"inkscape:groupmode":`layer`,id:`layer7`,class:`layer7`,"inkscape:label":`new2`},[createBaseVNode(`g`,{ref_key:`revNeedleRef`,ref:revNeedleRef,id:`revneedle`,"inkscape:label":`#g4147`},[..._cache[5]||=[createBaseVNode(`rect`,{y:`7`,x:`322.44037`,height:`72`,width:`12`,id:`rect4625`,class:`rev-needle-rect`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer4Ref`,ref:layer4Ref,"inkscape:groupmode":`layer`,id:`layer4`,class:`layer4`,"inkscape:label":`Icons bottom right`},[createBaseVNode(`path`,{ref_key:`icoIndicatorLeftOffRef`,ref:icoIndicatorLeftOffRef,id:`ico_indicatorl`,class:`ico-indicator-l`,d:`m 386.4512,577.16251 0.0556,17.08797 15.45962,0.24613 0,10.03868 0,10.03869 -15.45962,0.24608 -0.0556,17.08797 -35.33627,-27.37274 z`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`ccccccccc`,"inkscape:label":`#rect4655-9`},null,512),createBaseVNode(`path`,{ref_key:`icoIndicatorRightOffRef`,ref:icoIndicatorRightOffRef,id:`ico_indicatorr`,class:`ico-indicator-r`,d:`m 442.9256,554.57416 -0.0557,17.08798 -15.45965,0.24611 0,10.03869 0,10.03869 15.45965,0.24608 0.0557,17.08796 35.33627,-27.37273 z`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`ccccccccc`,"inkscape:label":`#rect4655-9-3`},null,512),createBaseVNode(`g`,{ref_key:`icoLightsOffRef`,ref:icoLightsOffRef,id:`ico_lights`,class:`ico-lights`,"inkscape:label":`#g4122`,transform:`translate(-12,-2)`},[..._cache[6]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824`,class:`light-source`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoABSOffRef`,ref:icoABSOffRef,id:`ico_abs`,class:`ico-abs-off`,"inkscape:label":`#g4111`},[..._cache[7]||=[createBaseVNode(`path`,{transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,260.26675,95.346428)`,id:`path4551dd`,class:`main`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7`,class:`curve-l`,d:`m 488.18221,555.99526 c -10.19731,-6.9315 -16.91369,-18.60946 -16.96251,-31.87062 -0.0478,-13.00297 6.32573,-24.53106 16.1388,-31.5801`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4`,class:`curve-r`,d:`m 531.48996,555.83579 c 10.14597,-7.00643 16.77617,-18.73351 16.72734,-31.99467 -0.0478,-13.00299 -6.50623,-24.48382 -16.37094,-31.4604`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3978`,class:`text-a`,d:`m 501.24227,531.46506 -1.26336,-4.09346 -6.27665,0.0231 -1.23317,4.10266 -3.93322,0.0145 6.01281,-17.30965 4.46313,-0.0164 6.16367,17.26482 z m -2.14606,-7.15204 c -1.16774,-3.70913 -1.82512,-5.8068 -1.97214,-6.29303 -0.14704,-0.48619 -0.25248,-0.87049 -0.31632,-1.1529 -0.25538,1.00586 -0.98812,3.49334 -2.19823,7.46246 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3980`,class:`text-b`,d:`m 505.7499,514.23161 5.35812,-0.0197 c 2.44157,-0.009 4.21514,0.33189 5.32074,1.02261 1.10557,0.69074 1.66115,1.79369 1.66675,3.30887 0.004,1.02845 -0.23453,1.87329 -0.71491,2.53453 -0.4804,0.66124 -1.12074,1.06007 -1.92101,1.19647 l 4.3e-4,0.11776 c 1.09214,0.23936 1.88085,0.69181 2.36614,1.35733 0.48526,0.66554 0.72994,1.55178 0.73403,2.65873 0.006,1.57015 -0.55694,2.79695 -1.68812,3.6804 -1.1312,0.88345 -2.67028,1.32876 -4.61725,1.33593 l -6.44152,0.0237 z m 3.67569,6.80491 2.1197,-0.008 c 0.98919,-0.004 1.705,-0.15935 2.14745,-0.46718 0.44242,-0.3078 0.66234,-0.81498 0.65975,-1.52156 -0.002,-0.65945 -0.24559,-1.13157 -0.72946,-1.41635 -0.48388,-0.28476 -1.24789,-0.42523 -2.29202,-0.42139 l -1.91951,0.007 z m 0.0107,2.89692 0.0165,4.48668 2.37878,-0.009 c 1.00488,-0.004 1.74606,-0.19878 2.22355,-0.58523 0.47747,-0.38644 0.71474,-0.97613 0.71184,-1.76906 -0.005,-1.42882 -1.0285,-2.13948 -3.06968,-2.13197 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3982`,class:`text-s`,d:`m 530.64514,526.57565 c 0.006,1.55445 -0.54914,2.78122 -1.66456,3.68032 -1.11544,0.89909 -2.6702,1.35231 -4.66427,1.35965 -1.83708,0.007 -3.46345,-0.33266 -4.87912,-1.01833 l -0.0125,-3.39151 c 1.16382,0.51387 2.14846,0.87531 2.95395,1.08431 0.80547,0.20901 1.54187,0.31229 2.20918,0.30983 0.80077,-0.003 1.41452,-0.1583 1.84127,-0.46605 0.42673,-0.30776 0.63898,-0.76389 0.63676,-1.3684 -10e-4,-0.33757 -0.0966,-0.63752 -0.28594,-0.89982 -0.18939,-0.2623 -0.46706,-0.51447 -0.83301,-0.75651 -0.36596,-0.24202 -1.11125,-0.62789 -2.23586,-1.15761 -1.05382,-0.49071 -1.84457,-0.96278 -2.37224,-1.41619 -0.52768,-0.4534 -0.94964,-0.98177 -1.2659,-1.58513 -0.31625,-0.60334 -0.47587,-1.30933 -0.47884,-2.11796 -0.006,-1.52303 0.50616,-2.72216 1.53533,-3.59741 1.02915,-0.87522 2.45441,-1.31619 4.27579,-1.32291 0.89497,-0.003 1.74913,0.0996 2.56247,0.30852 0.81332,0.209 1.66426,0.50419 2.55282,0.8856 l -1.16716,2.84237 c -0.91993,-0.37344 -1.68046,-0.63364 -2.28158,-0.7806 -0.60114,-0.14694 -1.19218,-0.21935 -1.77312,-0.21723 -0.69088,0.003 -1.2202,0.16545 -1.588,0.48868 -0.3678,0.32325 -0.55075,0.74394 -0.54884,1.26208 10e-4,0.32189 0.0768,0.60228 0.22685,0.84116 0.15004,0.23892 0.38838,0.46963 0.71501,0.69217 0.32663,0.22256 1.09944,0.62206 2.31845,1.19853 1.61222,0.76345 2.71809,1.53072 3.3176,2.30181 0.59949,0.77111 0.90131,1.71798 0.90545,2.84063 z`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoHandBrakeOffRef`,ref:icoHandBrakeOffRef,class:`ico-handbrake-off`,id:`ico_handbrake`,"inkscape:label":`#g4115`,transform:`translate(-3.5925881e-6,-2.0000007)`},[..._cache[8]||=[createBaseVNode(`path`,{transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,id:`path4551-2-74-7`,class:`main`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{class:`curve-l`,id:`path4551-7-7-0-4`,"inkscape:connector-curvature":`0`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-7-9-0`,class:`curve-r`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`},null,-1),createBaseVNode(`g`,{class:`text-p`,id:`text4055-4-9`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3269-4`,d:`m 566.88168,447.27286 2.26429,0 c 2.11628,2e-5 3.6998,-0.41806 4.75057,-1.25424 1.05073,-0.83614 1.57611,-2.05338 1.57612,-3.65172 -10e-6,-1.6131 -0.44029,-2.80444 -1.32083,-3.57403 -0.88058,-0.76954 -2.26061,-1.15432 -4.1401,-1.15435 l -3.13005,0 z m 15.53925,-5.15015 c -3e-5,3.49265 -1.09147,6.16392 -3.27434,8.01381 -2.18292,1.84993 -5.28707,2.77488 -9.31245,2.77487 l -2.95246,0 0,11.54344 -6.88167,0 0,-32.45483 10.3669,0 c 3.93659,3e-5 6.92975,0.84729 8.97947,2.54177 2.04967,1.69455 3.07452,4.22153 3.07455,7.58094 z`})],-1)]],512),createBaseVNode(`g`,{ref_key:`oilTempIcoOffRef`,ref:oilTempIcoOffRef,style:{display:`inline`},id:`ico_temp`,class:`ico-temp`,transform:`matrix(0.82879177,0,0,0.82879177,40.706638,69.281349)`,"inkscape:label":`#g4374`},[..._cache[9]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347`,class:`path1`,d:`m 199.61025,285.93078 2e-5,37.83129`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5`,class:`path2`,d:`m 208.85791,292.09588 -7.00577,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-4`,class:`path3`,d:`m 208.8579,301.06329 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-3`,class:`path4`,d:`m 208.85793,309.75049 -7.00583,-1e-5`},null,-1),createBaseVNode(`circle`,{transform:`matrix(0.72059621,0,0,0.72059621,-1146.435,-0.73321691)`,id:`path4392`,class:`path5`,cx:`1867.8225`,cy:`454.9176`,r:`14.849242`,d:`m 1882.6718,454.9176 c 0,8.20101 -6.6483,14.84924 -14.8493,14.84924 -8.201,0 -14.8492,-6.64823 -14.8492,-14.84924 0,-8.20101 6.6482,-14.84924 14.8492,-14.84924 8.201,0 14.8493,6.64823 14.8493,14.84924 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2`,class:`path6`,d:`m 183.69241,332.71741 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3`,class:`path7`,d:`m 223.32319,343.08941 -46.63658,-10e-6`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-34`,class:`path8`,d:`m 222.33239,332.7174 -7.00578,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`fuelWarnIcoOffRef`,ref:fuelWarnIcoOffRef,id:`ico_fuel`,class:`ico-fuel`,transform:`matrix(0.88747678,0,0,0.88747678,64.601263,56.302973)`,"inkscape:label":`#g4368`},[..._cache[10]||=[createBaseVNode(`rect`,{id:`rect4466`,class:`rect1`,y:`284.07593`,x:`420.99237`,height:`38.905876`,width:`22.650679`},null,-1),createBaseVNode(`rect`,{id:`rect4466-1`,class:`rect2`,y:`298.80991`,x:`420.99237`,height:`24.171896`,width:`22.650679`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3`,class:`path1`,d:`m 448.00445,330.93084 -30.96928,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-8`,class:`path2`,d:`m 460.25266,299.90863 0.0166,18.02062 c 0,0 -0.41583,2.18743 -4.92393,2.16693 -4.50811,-0.0205 -4.80496,-2.16693 -4.80496,-2.16693 l 0.0579,-17.71243 -7.25174,-0.0941`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer10Ref`,ref:layer10Ref,"inkscape:groupmode":`layer`,id:`layer10`,class:`layer10`,"inkscape:label":`icons bottom right activated`},[createBaseVNode(`path`,{ref_key:`icoIndicatorLeftOnRef`,ref:icoIndicatorLeftOnRef,class:`ico-indicator-l-on`,d:`m 386.4512,577.16251 0.0556,17.08797 15.45962,0.24613 0,10.03868 0,10.03869 -15.45962,0.24608 -0.0556,17.08797 -35.33627,-27.37274 z`,id:`ico_indicatorl_on`,"inkscape:connector-curvature":`0`,"inkscape:label":`#rect4655-9`},null,512),createBaseVNode(`path`,{ref_key:`icoIndicatorRightOnRef`,ref:icoIndicatorRightOnRef,id:`ico_indicatorr_on`,class:`ico-indicator-r-on`,d:`m 442.9256,554.57416 -0.0557,17.08798 -15.45965,0.24611 0,10.03869 0,10.03869 15.45965,0.24608 0.0557,17.08796 35.33627,-27.37273 z`,"inkscape:connector-curvature":`0`,"inkscape:label":`#rect4655-9-3`},null,512),createBaseVNode(`g`,{ref_key:`icoLightsOnRef`,ref:icoLightsOnRef,id:`ico_lights_on`,class:`ico-lights-on`,"inkscape:label":`#g4122`,transform:`translate(-12,-2.0000028)`},[..._cache[11]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824-4`,class:`path1`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-1`,class:`path2`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-20`,class:`path3`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-8-0`,class:`path4`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-1`,class:`path5`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-5-4`,class:`path6`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoABSOnRef`,ref:icoABSOnRef,transform:`translate(0,-2.8038025e-6)`,id:`ico_abs_on`,class:`ico-abs-on`,"inkscape:label":`#g4106`},[..._cache[12]||=[createBaseVNode(`path`,{id:`path4551-0`,class:`path1`,"inkscape:connector-curvature":`0`,transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,260.26675,95.34643)`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-717`,class:`path2`,d:`m 488.18221,555.99526 c -10.19731,-6.9315 -16.91369,-18.60946 -16.96251,-31.87062 -0.0478,-13.00297 6.32573,-24.53106 16.1388,-31.5801`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-77`,class:`path3`,d:`m 531.48996,555.83579 c 10.14597,-7.00643 16.77617,-18.73351 16.72734,-31.99467 -0.0478,-13.00299 -6.50623,-24.48382 -16.37094,-31.4604`},null,-1),createBaseVNode(`g`,{id:`flowRoot5902-7`,class:`text-path`,transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,259.17408,93.335)`},[createBaseVNode(`path`,{id:`path3978-3`,class:`text-path1`,"inkscape:connector-curvature":`0`,d:`m 548.35205,1001.1788 -2.84668,-9.34567 -14.31396,0 -2.84668,9.34567 -8.96973,0 13.85742,-39.4238 10.17822,0 13.91114,39.4238 z m -4.83398,-16.32809 c -2.63186,-8.4684 -4.11339,-13.25762 -4.44458,-14.36768 -0.33124,-1.10999 -0.56846,-1.98727 -0.71167,-2.63183 -0.59084,2.29169 -2.28274,7.95819 -5.07569,16.99951 z`}),createBaseVNode(`path`,{id:`path3980-3`,class:`text-path2`,"inkscape:connector-curvature":`0`,d:`m 558.77633,961.91614 12.21924,0 c 5.56801,4e-5 9.60975,0.79227 12.12524,2.37671 2.51543,1.5845 3.77316,4.10444 3.77319,7.55981 -3e-5,2.3454 -0.55056,4.27004 -1.65161,5.77393 -1.1011,1.50392 -2.56472,2.40806 -4.39087,2.7124 l 0,0.26855 c 2.48858,0.55504 4.28342,1.59345 5.38453,3.11524 1.10104,1.52182 1.65157,3.54493 1.65161,6.06933 -4e-5,3.58074 -1.29357,6.37371 -3.88062,8.37891 -2.5871,2.00518 -6.10069,3.00778 -10.54077,3.00778 l -14.68994,0 z m 8.32519,15.54931 4.83399,0 c 2.25584,3e-5 3.88954,-0.34909 4.90112,-1.04736 1.01153,-0.69822 1.51731,-1.853 1.51734,-3.46436 -3e-5,-1.50387 -0.55057,-2.58257 -1.65162,-3.23608 -1.10109,-0.65345 -2.84222,-0.98019 -5.22338,-0.98022 l -4.37745,0 z m 0,6.60645 0,10.23193 5.42481,0 c 2.29164,1e-5 3.98354,-0.43863 5.07568,-1.31592 1.0921,-0.87727 1.63816,-2.22004 1.63819,-4.02832 -3e-5,-3.25844 -2.3275,-4.88767 -6.98243,-4.88769 z`}),createBaseVNode(`path`,{id:`path3982-5`,class:`text-path3`,"inkscape:connector-curvature":`0`,d:`m 615.44572,990.27551 c -2e-5,3.54493 -1.27566,6.3379 -3.8269,8.37891 -2.55129,2.04098 -6.10069,3.06148 -10.64819,3.06148 -4.18947,0 -7.89552,-0.7877 -11.11817,-2.36324 l 0,-7.73437 c 2.64974,1.18164 4.89217,2.01416 6.7273,2.49755 1.83511,0.48341 3.51358,0.72511 5.0354,0.7251 1.82615,10e-6 3.22711,-0.34911 4.20288,-1.04736 0.97573,-0.69824 1.4636,-1.73665 1.46362,-3.11524 -2e-5,-0.76984 -0.21486,-1.45466 -0.64453,-2.05444 -0.42971,-0.59976 -1.06081,-1.17715 -1.89331,-1.73218 -0.83254,-0.555 -2.5289,-1.44123 -5.08911,-2.65869 -2.3991,-1.12791 -4.19841,-2.21108 -5.39795,-3.24951 -1.19955,-1.03839 -2.15739,-2.24689 -2.87354,-3.62549 -0.71614,-1.37855 -1.07422,-2.98988 -1.07421,-4.83398 -10e-6,-3.47328 1.17716,-6.20358 3.53149,-8.19092 2.35432,-1.98727 5.6083,-2.98092 9.76196,-2.98096 2.041,4e-5 3.98802,0.24174 5.84107,0.7251 1.853,0.48344 3.79107,1.16377 5.81421,2.04102 l -2.68555,6.47216 c -2.09475,-0.85934 -3.82693,-1.45911 -5.19653,-1.79931 -1.36965,-0.34014 -2.7169,-0.51022 -4.04175,-0.51026 -1.57554,4e-5 -2.78403,0.36706 -3.62549,1.10108 -0.84148,0.73408 -1.26222,1.69192 -1.26221,2.87353 -10e-6,0.73408 0.17008,1.37413 0.51026,1.92017 0.34015,0.54609 0.88174,1.07424 1.62475,1.58447 0.74299,0.51028 2.50202,1.42784 5.2771,2.75269 3.67023,1.75457 6.18569,3.51361 7.54639,5.2771 1.36065,1.76352 2.04099,3.92538 2.04101,6.48559 z`})],-1)]],512),createBaseVNode(`g`,{ref_key:`icoHandBrakeOnRef`,ref:icoHandBrakeOnRef,id:`ico_handbrake_on`,class:`ico-handbrake-on`,"inkscape:label":`#g4115`,transform:`translate(-3.5925881e-6,-2.0000007)`},[..._cache[13]||=[createBaseVNode(`path`,{id:`path4551-2-74`,class:`path1`,transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-7-0`,class:`path2`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-7-9`,class:`path3`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`},null,-1),createBaseVNode(`g`,{class:`text-p`,id:`text4055-4`},[createBaseVNode(`path`,{d:`m 566.88168,447.27286 2.26429,0 c 2.11628,2e-5 3.6998,-0.41806 4.75057,-1.25424 1.05073,-0.83614 1.57611,-2.05338 1.57612,-3.65172 -10e-6,-1.6131 -0.44029,-2.80444 -1.32083,-3.57403 -0.88058,-0.76954 -2.26061,-1.15432 -4.1401,-1.15435 l -3.13005,0 z m 15.53925,-5.15015 c -3e-5,3.49265 -1.09147,6.16392 -3.27434,8.01381 -2.18292,1.84993 -5.28707,2.77488 -9.31245,2.77487 l -2.95246,0 0,11.54344 -6.88167,0 0,-32.45483 10.3669,0 c 3.93659,3e-5 6.92975,0.84729 8.97947,2.54177 2.04967,1.69455 3.07452,4.22153 3.07455,7.58094 z`,id:`path3269`,"inkscape:connector-curvature":`0`})],-1)]],512),createBaseVNode(`g`,{ref_key:`oilTempIcoOnRef`,ref:oilTempIcoOnRef,id:`ico_temp_on`,class:`ico-temp-on`,transform:`matrix(0.82879177,0,0,0.82879177,40.706638,69.281349)`,"inkscape:label":`#g4374`},[..._cache[14]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-7`,class:`path1`,d:`m 199.61025,285.93078 2e-5,37.83129`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-40`,class:`path2`,d:`m 208.85791,292.09588 -7.00577,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-4-9`,class:`path3`,d:`m 208.8579,301.06329 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-3-4`,class:`path4`,d:`m 208.85793,309.75049 -7.00583,-1e-5`},null,-1),createBaseVNode(`circle`,{id:`path4392-8`,class:`circle1`,transform:`matrix(0.72059621,0,0,0.72059621,-1146.435,-0.73321691)`,cx:`1867.8225`,cy:`454.9176`,r:`14.849242`,d:`m 1882.6718,454.9176 c 0,8.20101 -6.6483,14.84924 -14.8493,14.84924 -8.201,0 -14.8492,-6.64823 -14.8492,-14.84924 0,-8.20101 6.6482,-14.84924 14.8492,-14.84924 8.201,0 14.8493,6.64823 14.8493,14.84924 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-8`,class:`path5`,d:`m 183.69241,332.71741 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-2`,class:`path6`,d:`m 223.32319,343.08941 -46.63658,-10e-6`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-34-4`,class:`path7`,d:`m 222.33239,332.7174 -7.00578,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`fuelWarnIcoOnRef`,ref:fuelWarnIcoOnRef,id:`ico_fuel_on`,class:`ico-fuel-on`,transform:`matrix(0.88747678,0,0,0.88747678,64.601263,56.302973)`,"inkscape:label":`#g4368-5`},[..._cache[15]||=[createBaseVNode(`rect`,{id:`rect4466-5`,class:`rect1`,y:`284.07593`,x:`420.99237`,height:`38.905876`,width:`22.650679`},null,-1),createBaseVNode(`rect`,{id:`rect4466-1-1`,class:`rect2`,y:`298.80991`,x:`420.99237`,height:`24.171896`,width:`22.650679`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-7`,class:`path1`,d:`m 448.00445,330.93084 -30.96928,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-8-1`,class:`path2`,d:`m 460.25266,299.90863 0.0166,18.02062 c 0,0 -0.41583,2.18743 -4.92393,2.16693 -4.50811,-0.0205 -4.80496,-2.16693 -4.80496,-2.16693 l 0.0579,-17.71243 -7.25174,-0.0941`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer12Ref`,ref:layer12Ref,"inkscape:groupmode":`layer`,id:`layer12`,class:`layer12`,"inkscape:label":`icons bottom right 2`},[createBaseVNode(`g`,{ref_key:`icoLightsHighRef`,ref:icoLightsHighRef,id:`ico_lights_high`,class:`ico-lights-high`,"inkscape:label":`#g4122`,transform:`translate(-12.000003,-2.0000028)`},[..._cache[16]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824-4-9`,class:`path1`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-1-8`,class:`path2`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-20-1`,class:`path3`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-8-0-8`,class:`path4`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-1-2`,class:`path5`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-5-4-6`,class:`path6`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`tickLayerRef`,ref:tickLayerRef,id:`tickLayer`,class:`tick-layer`},[(openBlock(),createElementBlock(Fragment,null,renderList(maxRpmTexts,k=>createBaseVNode(`line`,{ref_for:!0,ref:el=>setTickRef(el,k),x1:`0`,y1:`0`,x2:`0`,y2:`0`,class:`tick-line`},null,512)),64))],512)]))}},tacho_default=__plugin_vue_export_helper_default(_sfc_main$179,[[`__scopeId`,`data-v-310c7a2d`]]),_hoisted_1$159={class:`tacho-container`},_sfc_main$178={__name:`app`,setup(__props){let{$game}=useLibStore(),tachoRef=ref(null),visible=ref(!1);ref(!1),onMounted(()=>{tachoRef.value.wireThroughUnitSystem((val,func)=>UiUnits[func](val)),$game.streams.add([`electrics`,`engineInfo`]),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleChange`,onVehicleChange),$game.events.on(`VehicleFocusChanged`,onVehicleFocusChanged)}),onUnmounted(()=>{$game.streams.remove([`electrics`,`engineInfo`]),$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleChange`,onVehicleChange),$game.events.off(`VehicleFocusChanged`,onVehicleFocusChanged)});let _done=!1;function onStreamsUpdate(streams){tachoRef.value!==null&&(_done||=!0,tachoRef.value.update(streams)?visible.value||=!0:visible&&(visible.value=!1))}function onVehicleChange(){tachoRef.value!==null&&tachoRef.value.vehicleChanged()}function onVehicleFocusChanged(data){tachoRef.value!==null&&data.mode===!0&&tachoRef.value.vehicleChanged()}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$159,[createVNode(tacho_default,{ref_key:`tachoRef`,ref:tachoRef},null,512)]))}},app_default$26=__plugin_vue_export_helper_default(_sfc_main$178,[[`__scopeId`,`data-v-57c978c8`]]),_sfc_main$177={__name:`app`,setup(__props){let{$game}=useLibStore(),store$1=useTasksStore();provide(`animationSettings`,{animate:!0,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmptyIntervalDelay:.1,animateOnEmpty:!0,animateNextTask:!0,successCallback:playAudio});function playAudio(){$game.lua.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Checkbox`)}return(_ctx,_cache)=>(openBlock(),createBlock(unref(TaskList_default),{header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`]))}},app_default$27=_sfc_main$177,_hoisted_1$158={class:`pacenote`},_hoisted_2$131=[`id`],_hoisted_3$117=[`fill`,`stroke`],_hoisted_4$95=[`id`],_hoisted_5$82=[`fill`,`stroke`],_hoisted_6$68=[`fill`],_hoisted_7$59={class:`content`},_hoisted_8$49={class:`instruction`},_hoisted_9$43={key:0,class:`modifier`},_hoisted_10$36={key:1,class:`add-note`},_hoisted_11$32={key:0,class:`distance`},_sfc_main$176={__name:`PaceNote`,props:{note:{type:Object,required:!0,validator(value){return value.type===`empty`?!0:typeof value.type==`string`},default:()=>({type:`empty`,typeExt:null,turnModifier:null,background:{color:`var(--bng-cool-gray-600)`,strokeColor:`var(--bng-cool-gray-500)`,opacity:.6},isInto:!1,isLeft:!1,size:5,turnTypeValue:null,distance:null,additionalNote:{color:`#fff`,icon:null,text:null}})}},setup(__props){useCssVars(_ctx=>({v5d4f1806:props.note.size,v654d2548:backgroundColor.value,v7d5e0455:colorNoteIcon.value,v7d630d09:colorNoteText.value,v305678bf:colorDistance.value}));let bgId=uniqueId(``,`_`),props=__props,noteUrl=computed(()=>{if(props.note.typeExt)return props.note.typeExt;let assetPath=noteTypes[props.note.type];return assetPath?getAssetURL(assetPath):null}),backgroundColor=computed(()=>props.note.background&&props.note.background.color?props.note.background.color:`var(--bng-cool-gray-600)`),strokeColor=computed(()=>props.note.background&&props.note.background.strokeColor?props.note.background.strokeColor:`var(--bng-cool-gray-500)`),backgroundOpacity=computed(()=>props.note.background&&props.note.background.opacity?props.note.background.opacity:.6),colorNoteIcon=computed(()=>props.note.colorNoteIcon?props.note.colorNoteIcon:`#fff`),colorNoteText=computed(()=>props.note.colorNoteText?props.note.colorNoteText:`#fff`),intoColor=computed(()=>props.note.intoColor?props.note.intoColor:`#fff`),colorDistance=computed(()=>props.note.colorDistance?props.note.colorDistance:`#ececec`);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$158,[createBaseVNode(`div`,{class:`background`,style:normalizeStyle({opacity:backgroundOpacity.value})},[__props.note.isInto?(openBlock(),createElementBlock(`svg`,{key:1,id:`note_${unref(bgId)}`,style:{width:`var(--note-size)`,height:`var(--note-size)`},viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[createBaseVNode(`path`,{d:`M5 47.75H5.54967L5.71519 47.2258L11.3348 29.4304C11.6288 28.4994 11.6288 27.5006 11.3348 26.5696L5.95963 9.54823C5.82856 9.13317 5.7822 8.69601 5.8233 8.26269L6.25669 3.69314C6.41494 2.02457 7.81612 0.75 9.49217 0.75H51.4137C53.3423 0.75 54.8466 2.41974 54.6461 4.33788L49.631 52.3157C49.4572 53.9784 48.0504 55.238 46.3787 55.2278L4.46341 54.9706C2.52935 54.9587 1.03362 53.2707 1.25464 51.3493L1.66867 47.75H5Z`,fill:backgroundColor.value,stroke:strokeColor.value,"stroke-width":`1.5`},null,8,_hoisted_5$82),createBaseVNode(`path`,{d:`M4 11H1L6 28L1 45H4L9.5 28L4 11Z`,fill:intoColor.value},null,8,_hoisted_6$68)],8,_hoisted_4$95)):(openBlock(),createElementBlock(`svg`,{key:0,id:`note_${unref(bgId)}`,style:{width:`var(--note-size)`,height:`var(--note-size)`},viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[createBaseVNode(`path`,{d:`M9.45521 0.75H51.4137C53.3423 0.75 54.8466 2.41974 54.6461 4.33788L49.631 52.3157C49.4572 53.9784 48.0504 55.238 46.3787 55.2278L4.41965 54.9703C2.49833 54.9585 1.00656 53.2915 1.2074 51.3807L6.22301 3.66028C6.39689 2.00598 7.7918 0.75 9.45521 0.75Z`,fill:backgroundColor.value,stroke:strokeColor.value,"stroke-width":`1.5`},null,8,_hoisted_3$117)],8,_hoisted_2$131))],4),createBaseVNode(`div`,_hoisted_7$59,[createBaseVNode(`div`,_hoisted_8$49,[unref(icons)[__props.note.type]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:normalizeClass([`note-icon`,{left:__props.note.isLeft}]),type:__props.note.type},null,8,[`type`,`class`])):__props.note.typeExt&¬eUrl.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`note-icon svg-used`,[__props.note.type,{left:__props.note.isLeft}]]),style:normalizeStyle(noteUrl.value?{maskImage:`url(${noteUrl.value})`,WebkitMaskImage:`url(${noteUrl.value})`}:null)},null,6)):createCommentVNode(``,!0),__props.note.turnTypeValue?(openBlock(),createElementBlock(`div`,{key:2,class:normalizeClass([`turn-value`,{left:__props.note.isLeft,"is-into":__props.note.isInto,"text-2-chars":__props.note.turnTypeValue.length===2}])},toDisplayString(__props.note.turnTypeValue),3)):createCommentVNode(``,!0)]),__props.note.turnModifier?(openBlock(),createElementBlock(`div`,_hoisted_9$43,[createVNode(unref(bngIcon_default),{type:__props.note.turnModifier,class:`icon-small`,color:colorNoteIcon.value},null,8,[`type`,`color`])])):createCommentVNode(``,!0),__props.note.additionalNote&&(__props.note.additionalNote.icon||__props.note.additionalNote.text)?(openBlock(),createElementBlock(`div`,_hoisted_10$36,[__props.note.additionalNote.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.note.additionalNote.icon,color:__props.note.additionalNote.color,class:`icon-small`},null,8,[`type`,`color`])):__props.note.additionalNote.text?(openBlock(),createElementBlock(`span`,{key:1,class:`add-text`,style:normalizeStyle(__props.note.additionalNote.color?{color:__props.note.additionalNote.color}:null)},toDisplayString(__props.note.additionalNote.text),5)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),__props.note.distance?(openBlock(),createElementBlock(`div`,_hoisted_11$32,toDisplayString(__props.note.distance),1)):createCommentVNode(``,!0)]))}},PaceNote_default=__plugin_vue_export_helper_default(_sfc_main$176,[[`__scopeId`,`data-v-8c4cf384`]]),_hoisted_1$157={class:`pacenotes-app`},_hoisted_2$130={class:`notes-container`},FADE_DURATION=250,TOTAL_SLOTS=4,DEFAULT_NOTE_SIZE=1.8,_sfc_main$175={__name:`app`,setup(__props){useCssVars(_ctx=>({v492216b0:noteSize.value}));let incomingQueue=ref([]),noteSize=ref(DEFAULT_NOTE_SIZE),events$3=useEvents(),{lua}=useBridge(),devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),debugSlots=computed(()=>incomingQueue.value.map(slot=>slot?`id=${slot.note.id} pnId=${slot.pacenoteId} ts=${slot.serialNo} type=${slot.note.type} isFading=${slot.isFading} isCurrent=${slot.isCurrent}`:null)),firstFourFromQueue=computed(()=>{let result=[...incomingQueue.value.slice(0,TOTAL_SLOTS)];for(;result.length<4;)result.push({id:-1,type:`empty`});return result});function getNoteKey(slot,index){return!slot||!slot.note?`empty-${index}`:`${slot.note.id}-${index}`}function getNoteWithSize(slot){return!slot||!slot.note?{type:`empty`,size:noteSize.value}:{...slot.note,size:noteSize.value}}let mockNotes=[{id:`q1`,pnId:`1`,type:`turn3`,isLeft:!1,turnTypeValue:`3`,distance:`140`,background:{color:`var(--bng-ter-yellow-300)`,strokeColor:`var(--bng-ter-yellow-200)`,opacity:.8}},{id:`q2`,pnId:`2`,type:`turnHp`,isLeft:!0,isInto:!0,background:{color:`var(--bng-add-red-500)`,strokeColor:`var(--bng-add-red-400)`,opacity:.8},additionalNote:{icon:`scissorsSlashed`,color:`var(--bng-add-red-400)`}},{id:`q3`,pnId:`2`,type:`jumpOverBump`,isLeft:!1,turnModifier:`mathLessThan`,additionalNote:{icon:`circleSlashed`,color:`var(--bng-ter-yellow-100)`}},{id:`q4`,pnId:`3`,type:`turn6`,isLeft:!0,turnTypeValue:`6`,distance:`140`,background:{color:`var(--bng-ter-yellow-300)`,strokeColor:`var(--bng-ter-yellow-200)`,opacity:.8}},{id:`q5`,pnId:`3`,type:`rocks`,isLeft:!0,distance:`50`}];function updateCurrent(){if(incomingQueue.value.length===0||(incomingQueue.value=incomingQueue.value.filter(item=>item!==null),incomingQueue.value.length===0))return;let firstPacenoteId=incomingQueue.value[0].pacenoteId;incomingQueue.value.forEach(slot=>{slot&&!slot.isFading&&(slot.isCurrent=slot.pacenoteId===firstPacenoteId)})}function addToQueue(newItems,serialNo){try{(Array.isArray(newItems)?newItems:[newItems]).forEach(note=>{if(!note.id||!note.type){console.warn(`Invalid note format:`,JSON.stringify(note,null,2));return}let val={note,isVisible:!0,isFading:!1,isCurrent:!1,pacenoteId:note.pnId,serialNo};incomingQueue.value.push(val)}),updateCurrent()}catch(error){console.error(`Error adding to queue:`,error)}}onMounted(()=>{lua.pacenotes&&lua.pacenotes.onPaceNotesAppMounted&&lua.pacenotes.onPaceNotesAppMounted(),events$3.on(`showVisualPacenote2`,pacenoteEvent=>{let serialNo=pacenoteEvent.serialNo,notes=pacenoteEvent.visualPacenotes;addToQueue(notes,serialNo)}),events$3.on(`clearOneVisualPacenote`,serialNo=>{clearOne(serialNo)}),events$3.on(`clearAllVisualPacenotes`,()=>{clearAll()})}),onUnmounted(()=>{lua.pacenotes&&lua.pacenotes.onPaceNotesAppUnmounted&&lua.pacenotes.onPaceNotesAppUnmounted()});let testAddSequence=()=>{console.log(`Adding sequence...`);let fakeSerialNo=666,lastPnid=0;mockNotes.forEach(note=>{note.pnId!==lastPnid&&(fakeSerialNo++,lastPnid=note.pnId),addToQueue(note,fakeSerialNo)}),console.log(`Current queue:`,incomingQueue.value)},clearAll=()=>{incomingQueue.value=[]},clearOne=serialNo=>{let fadeCount=0,fadeExpected=0;incomingQueue.value.forEach((item,index)=>{item.serialNo<=serialNo&&(item.isFading=!0,item.isVisible=!1,item.isCurrent=!1,fadeExpected++),setTimeout(()=>{item&&item.isFading&&(incomingQueue.value[index]=null,fadeCount++,fadeCount===fadeExpected&&updateCurrent())},FADE_DURATION)})},testClearAll=()=>{clearAll()},testClearOne=()=>{let serialNo=incomingQueue.value[0].serialNo;clearOne(serialNo)};(devEnv.env||devEnv.vue)&&(window.testPaceNotes={addSequence:testAddSequence,clearAll:testClearAll,clearOne:testClearOne,getState:()=>({queue:incomingQueue.value,slots:debugSlots.value})});function onAnimationEnd(index){let slot=incomingQueue.value[index];slot&&slot.isVisible&&!slot.isFading&&(slot.hasAnimated=!0)}return ref(null),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$157,[createBaseVNode(`div`,_hoisted_2$130,[_cache[1]||=createBaseVNode(`div`,{class:`spacer`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(firstFourFromQueue.value,(slot,index)=>(openBlock(),createBlock(PaceNote_default,{key:getNoteKey(slot,index),class:normalizeClass({"pacenote-initial":!slot?.hasAnimated,[`position-${index}`]:!0,"fade-out":slot&&slot.isFading,"fade-in":slot&&slot.isVisible&&!slot.isFading&&!slot.hasAnimated,hidden:!slot||!slot.isVisible&&!slot.isFading,current:slot&&slot.isCurrent}),note:getNoteWithSize(slot),onAnimationend:$event=>onAnimationEnd(index)},null,8,[`class`,`note`,`onAnimationend`]))),128))]),createCommentVNode(``,!0)]))}},app_default$28=__plugin_vue_export_helper_default(_sfc_main$175,[[`__scopeId`,`data-v-13adc0e2`]]),_hoisted_1$156={class:`countdown-top`},_hoisted_2$129={key:0,class:`countdown-go`},_hoisted_3$116={class:`countdown-bottom`},_hoisted_4$94={class:`rally-loop-manager-text`},_hoisted_5$81={class:`time-main`},_hoisted_6$67={key:0,class:`time-period`},_sfc_main$174={__name:`CountdownWidget`,props:{rallyLoopManager:{type:String,default:`--:--:--`},period:{type:String,default:null},countdown:{type:Number,default:10}},setup(__props){let props=__props,stage=computed(()=>props.countdown<=0?6:props.countdown>5?0:6-props.countdown);return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,_hoisted_1$156,[stage.value===6?(openBlock(),createElementBlock(`div`,_hoisted_2$129)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=1}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=2}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=3}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=4}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=5}])},null,2)],64))]),createBaseVNode(`div`,_hoisted_3$116,[createBaseVNode(`div`,_hoisted_4$94,[createBaseVNode(`span`,_hoisted_5$81,toDisplayString(__props.rallyLoopManager),1),__props.period?(openBlock(),createElementBlock(`span`,_hoisted_6$67,toDisplayString(__props.period),1)):createCommentVNode(``,!0)])])],64))}},CountdownWidget_default=__plugin_vue_export_helper_default(_sfc_main$174,[[`__scopeId`,`data-v-a0ececba`]]),_hoisted_1$155={class:`vehicle-proximity`},_hoisted_2$128={class:`top-row`},_hoisted_3$115={class:`proximity-status`},_hoisted_4$93={key:2},_sfc_main$173={__name:`VehicleProximity`,props:{vehicleProximity:{type:Object,required:!0},stage:{type:String,required:!0},precision:{type:Number,default:0,validator:value=>value>=0&&value<=2},badgeText:{type:String,default:``},instruction:{type:Object,required:!1,default:()=>({text:``,type:`notice`}),validator:value=>value?typeof value.text==`string`&&[`alert`,`alert-sm`,`notice`].includes(value.type):!0},instruction2:{type:Object,required:!1,default:()=>({structuredText:null})}},setup(__props){let props=__props,distanceDimmed=computed(()=>props.stage===`stop`||props.stage===`staged`),hasLabel=computed(()=>props.stage===`approaching`&&props.badgeText),formattedDistance=computed(()=>{let dist=props.vehicleProximity.distance;if(Math.abs(dist)>200)return`${(dist/1e3).toFixed(2)}km`;if(dist<0){let multiplier=10**props.precision,flooredDist=Math.floor(dist*multiplier)/multiplier;return`${(flooredDist===0?0:flooredDist).toFixed(props.precision)}m`}return`${dist.toFixed(props.precision)}m`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$155,[createBaseVNode(`div`,_hoisted_2$128,[createBaseVNode(`div`,_hoisted_3$115,[createBaseVNode(`div`,{class:normalizeClass([`proximity-status-badge`,[__props.stage,{"has-label":hasLabel.value}]])},[__props.stage===`stop`?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(`STOP`)],64)):__props.stage===`goback`?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(`BACK`)],64)):__props.stage===`slow`?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(`SLOW`)],64)):__props.stage===`staged`?(openBlock(),createElementBlock(Fragment,{key:3},[createTextVNode(`STAGED`)],64)):__props.stage===`approaching`?(openBlock(),createElementBlock(Fragment,{key:4},[createTextVNode(toDisplayString(__props.badgeText),1)],64)):createCommentVNode(``,!0)],2)]),createBaseVNode(`div`,{class:normalizeClass([`proximity-distance`,{dimmed:distanceDimmed.value}])},toDisplayString(formattedDistance.value),3)]),__props.instruction?.text?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`instruction-row`,__props.instruction?.type||`notice`])},toDisplayString(__props.instruction?.text),3)):createCommentVNode(``,!0),__props.instruction2?.structuredText?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`instruction-row`,[__props.instruction2?.type||`notice`,{flash:__props.instruction2?.flash}]])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.instruction2?.structuredText,item=>(openBlock(),createElementBlock(Fragment,{key:item.id},[item.type===`clock`?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(item.class)},toDisplayString(item.val),3)):item.type===`penalty`?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(item.class)},toDisplayString(item.val),3)):(openBlock(),createElementBlock(`span`,_hoisted_4$93,toDisplayString(item),1))],64))),128))],2)):createCommentVNode(``,!0)]))}},VehicleProximity_default=__plugin_vue_export_helper_default(_sfc_main$173,[[`__scopeId`,`data-v-871af6e6`]]),_hoisted_1$154={class:`rally-countdown-app-container`},_hoisted_2$127={class:`panel-countdown`},_hoisted_3$114={key:2,class:`section-interact-hint`},_sfc_main$172={__name:`appCountdown`,setup(__props){useCssVars(_ctx=>({v730cc8f6:themeColor.value}));let{lua}=useBridge(),devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),showDebugInfo=ref(!1),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockTime:null,day:null,totalTime:0,canSkipTimeControls:!1,isTimeControlSkipAvailable:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1,speedLimit:null,speedLimitDisplay:null,speedUnit:`km/h`,isSpeeding:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distM:0,distPct:0}}),countdownData=reactive({countdown:null,state:null}),themeColor=computed(()=>`#07ff00`),canInteract=computed(()=>rallyClockData.canSkipTimeControls||rallyClockData.canSkipCountdown),interactLabel=computed(()=>rallyClockData.canSkipCountdown||rallyClockData.canSkipTimeControls?`[action=gameplay_interact]Skip Clock`:``),proximityStage=computed(()=>{scheduleData.eventType;let distance=vehicleProximityData.distance;return scheduleData.eventType===`ss_start`?vehicleProximityData.isNear&&vehicleProximityData.isStopped?`staged`:distance<0?`goback`:vehicleProximityData.isNear&&!vehicleProximityData.isStopped?`stop`:!vehicleProximityData.isNear&&distance>=0&&distance<=25?`slow`:`approaching`:distance<0?`goback`:vehicleProximityData.isNear?`stop`:!vehicleProximityData.isNear&&distance>=0&&distance<=25||scheduleData.eventType===`ss_stop`?`slow`:`approaching`}),distancePrecision=computed(()=>{let distAbs=Math.abs(vehicleProximityData.distance),closenessThreshold=5;if(scheduleData.eventType===`ss_start`){if(distAbs<5)return proximityStage.value===`stop`||proximityStage.value===`goback`||proximityStage.value===`staged`||proximityStage.value===`slow`?2:0}else if((scheduleData.eventType===`tc`||scheduleData.eventType===`ss_stop`)&&distAbs<5)return proximityStage.value===`stop`||proximityStage.value===`goback`?1:0;return 0}),badgeText=computed(()=>scheduleData.eventType===`ss_start`?`SS${scheduleData.ssLabel}`:scheduleData.eventType===`tc`?scheduleData.label:scheduleData.eventType===`ss_stop`?`SLOW`:scheduleData.eventType===`service_in`?`SERVICE`:``),proximityInstruction2=computed(()=>{let stage=proximityStage.value;if(scheduleData.eventType===`ss_start`)return{structuredText:[`Start in `,{type:`clock`,val:scheduleData.timeDiff,class:`clock-badge`}],flash:!1};if(stage===`approaching`){if(rallyClockData.isTimeControlSkipAvailable&&scheduleData.eventType===`tc`)return{structuredText:[`Slow Down for `,{type:`clock`,val:`Clock Skip`,class:`clock-badge`}],flash:!1};if(scheduleData.eventType===`service_in`||scheduleData.label===`TC0`||scheduleData.eventType===`tc`)return{structuredText:[`Limit `,{type:`penalty`,val:`${scheduleData.speedLimitDisplay}${scheduleData.speedUnit}`,class:`penalty-badge`}],flash:scheduleData.isSpeeding}}else return null}),proximityInstruction=computed(()=>{let stage=proximityStage.value,text=``,type=`notice`;return stage===`slow`?scheduleData.eventType===`ss_start`?text=`Stage vehicle at start line.`:scheduleData.eventType===`tc`||scheduleData.eventType:stage===`stop`?scheduleData.eventType:stage===`goback`||(stage===`staged`?vehicleProximityData.isFrozen:stage===`approaching`&&(scheduleData.eventType===`ss_start`?text=`Stage vehicle at start line.`:scheduleData.eventType===`tc`||scheduleData.eventType===`service_in`||scheduleData.eventType)),{text,type:`notice`}}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),data.showDebugInfo!==void 0&&(showDebugInfo.value=data.showDebugInfo),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function isStageActive(){return activeState.value===ActiveState.STAGE_ACTIVE}return(devEnv.env||devEnv.vue)&&(window.rallyLoopApp={activeState,vehicleProximityData,rallyClockData,scheduleData,stageData,countdownData,proximityStage,distancePrecision,badgeText}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$154,[isStageActive()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`rally-countdown-app`,{"show-active-stage":isStageActive()}])},[activeState.value===ActiveState.VEHICLE_PROXIMITY?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`section-vehicle-positioning`,{"has-interact-hint":canInteract.value}])},[createVNode(VehicleProximity_default,{"vehicle-proximity":vehicleProximityData,stage:proximityStage.value,precision:distancePrecision.value,"badge-text":badgeText.value,instruction:proximityInstruction.value,instruction2:proximityInstruction2.value},null,8,[`vehicle-proximity`,`stage`,`precision`,`badge-text`,`instruction`,`instruction2`])],2)):createCommentVNode(``,!0),activeState.value===ActiveState.COUNTDOWN?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`section-vehicle-positioning`,{"has-interact-hint":canInteract.value}])},[createBaseVNode(`div`,_hoisted_2$127,[createVNode(CountdownWidget_default,{"rally-loop-manager":rallyClockData.wallClockTime?.time||`--:--:--`,period:rallyClockData.wallClockTime?.ampm||``,countdown:countdownData.countdown},null,8,[`rally-loop-manager`,`period`,`countdown`])])],2)):createCommentVNode(``,!0),canInteract.value?(openBlock(),createElementBlock(`div`,_hoisted_3$114,[createVNode(unref(dynamicComponent_default),{template:interactLabel.value,bbcode:``},null,8,[`template`])])):createCommentVNode(``,!0)],2))])]),_:1}))}},appCountdown_default=__plugin_vue_export_helper_default(_sfc_main$172,[[`__scopeId`,`data-v-bde5d1a7`]]),_hoisted_1$153={class:`rally-timecard-app-container`},_hoisted_2$126={key:0,class:`rally-timecard-app`},_hoisted_3$113={class:`interact-label-on-timecard`},_hoisted_4$92={class:`time-card`},_hoisted_5$80={class:`rally-card-header`},_hoisted_6$66={class:`header-top`},_hoisted_7$58=[`src`],_hoisted_8$48={key:0,class:`mission-name`},_hoisted_9$42={class:`rally-card-content`},_hoisted_10$35={key:0,class:`group-divider`},_hoisted_11$31={class:`col-label`},_hoisted_12$25={class:`event-label`},_hoisted_13$22={class:`event-data-container`},_hoisted_14$21={key:0,class:`time-widget`},_hoisted_15$20={class:`col-recorded-time time-widget-value time-taken-value`},_hoisted_16$20={key:0,class:`stage-time`},_hoisted_17$16={key:0,class:`ampm`},_hoisted_18$14={class:`time-widget time-widget-due`},_hoisted_19$11={class:`col-due-time time-widget-value`},_hoisted_20$10={key:0,class:`scheduled-time`},_hoisted_21$10={key:0,class:`ampm`},_hoisted_22$8={class:`time-widget-combined`},_hoisted_23$7={class:`time-widget`},_hoisted_24$6={class:`col-recorded-time time-widget-value actual-value`},_hoisted_25$5={key:0,class:`recorded-time`},_hoisted_26$4={key:0,class:`ampm`},_hoisted_27$4={class:`time-widget`},_hoisted_28$3={class:`col-status time-widget-value status-value`},_hoisted_29$3={key:0,class:`status-text early`},_hoisted_30$3={key:1,class:`status-text late`},_hoisted_31$3={key:2,class:`status-text ok`},_hoisted_32$3={key:0,class:`penalty-card`},_hoisted_33$3={class:`rally-card-header penalty-card-header`},_hoisted_34$3={class:`header-top`},_hoisted_35$2={class:`penalty-total-header`},_hoisted_36$2={class:`total-value`},_hoisted_37$1={class:`penalty-card-content`},_hoisted_38$1={class:`penalty-group-header`},_hoisted_39$1={class:`group-name`},_hoisted_40$1={class:`group-total`},_hoisted_41$1={class:`penalty-list`},_hoisted_42$1={class:`penalty-type`},_hoisted_43$1={class:`penalty-amount`},_hoisted_44$1={key:1,class:`interact-label`},_hoisted_45$1={class:`interact-label-text`},_sfc_main$171={__name:`appTimecard`,setup(__props){useCssVars(_ctx=>({a6aff4e0:themeColor.value}));let{lua}=useBridge(),events$3=useEvents(),penaltyData=ref({totalPenalty:0,groups:[]}),displayMode=ref(1);reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),events$3.on(`RallyGameplayInteract`,data=>{data&&data.forceShowTimecard?displayMode.value=1:displayMode.value===1?displayMode.value=0:displayMode.value=1});let toggleLabel=computed(()=>displayMode.value===1?`Hide`:`Show`),interactLabel=computed(()=>`[action=gameplay_interact]`),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},showDebugInfo=ref(!1),missionName=ref(``),activeState=ref(ActiveState.INACTIVE),timecardData=ref([]),rallyClockData=reactive({}),vehicleProximityData=reactive({}),scheduleData=reactive({}),stageData=reactive({}),countdownData=reactive({}),themeColor=computed(()=>`#07ff00`);function shouldShowApp(){return displayMode.value===1}function formatPenaltyType(type){return type?type.replace(/_/g,` `):``}let streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.timecardData&&(timecardData.value=data.timecardData),data.penaltyData&&(penaltyData.value=data.penaltyData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),data.showDebugInfo!==void 0&&(showDebugInfo.value=data.showDebugInfo),data.missionName!==void 0&&(missionName.value=data.missionName||``),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}return rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$153,[createVNode(Transition,{name:`slide`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_2$126,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_3$113,[createVNode(unref(dynamicComponent_default),{template:`[action=gameplay_interact]${toggleLabel.value} Time Card`,bbcode:``},null,8,[`template`])]),createBaseVNode(`div`,_hoisted_4$92,[createBaseVNode(`div`,_hoisted_5$80,[createBaseVNode(`div`,_hoisted_6$66,[_cache[0]||=createBaseVNode(`span`,{class:`rally-card-title`},`TIME CARD`,-1),createBaseVNode(`img`,{class:`header-beamng-logo`,src:unref(getAssetURL)(`images/beamng-logo-mono_189x174.png`)},null,8,_hoisted_7$58)]),missionName.value?(openBlock(),createElementBlock(`div`,_hoisted_8$48,`Event: `+toDisplayString(missionName.value),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$42,[(openBlock(!0),createElementBlock(Fragment,null,renderList(timecardData.value,(entry,idx)=>(openBlock(),createElementBlock(Fragment,{key:idx},[idx>0&&entry.group!==timecardData.value[idx-1].group?(openBlock(),createElementBlock(`div`,_hoisted_10$35)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`checklist-row`,{completed:entry.recordedTime||entry.stageTime,"stage-entry":entry.isStageEntry,early:entry.status===`early`,late:entry.status===`late`,"on-time":entry.status===`on-time`,pending:!entry.recordedTime&&!entry.stageTime}])},[createBaseVNode(`div`,_hoisted_11$31,[_cache[1]||=createBaseVNode(`div`,{class:`event-label-top`},`\xA0`,-1),createBaseVNode(`div`,_hoisted_12$25,toDisplayString(entry.label),1)]),createBaseVNode(`div`,_hoisted_13$22,[entry.isStageEntry?(openBlock(),createElementBlock(`div`,_hoisted_14$21,[_cache[2]||=createBaseVNode(`div`,{class:`time-widget-label`},`Time Taken`,-1),createBaseVNode(`div`,_hoisted_15$20,[entry.stageTime?(openBlock(),createElementBlock(`div`,_hoisted_16$20,[createTextVNode(toDisplayString(entry.stageTime),1),entry.stageTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_17$16,toDisplayString(entry.stageTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_18$14,[_cache[3]||=createBaseVNode(`div`,{class:`time-widget-label`},`Due`,-1),createBaseVNode(`div`,_hoisted_19$11,[entry.scheduledTime?(openBlock(),createElementBlock(`div`,_hoisted_20$10,[createTextVNode(toDisplayString(entry.scheduledTime.time),1),entry.scheduledTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_21$10,toDisplayString(entry.scheduledTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_22$8,[createBaseVNode(`div`,_hoisted_23$7,[_cache[4]||=createBaseVNode(`div`,{class:`time-widget-label`},`Actual`,-1),createBaseVNode(`div`,_hoisted_24$6,[entry.recordedTime?(openBlock(),createElementBlock(`div`,_hoisted_25$5,[createTextVNode(toDisplayString(entry.recordedTime.time),1),entry.recordedTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_26$4,toDisplayString(entry.recordedTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_27$4,[_cache[5]||=createBaseVNode(`div`,{class:`time-widget-label`},`Status`,-1),createBaseVNode(`div`,_hoisted_28$3,[entry.status===`early`?(openBlock(),createElementBlock(`span`,_hoisted_29$3,`EARLY`)):entry.status===`late`?(openBlock(),createElementBlock(`span`,_hoisted_30$3,`LATE`)):entry.recordedTime||entry.status===`on-time`?(openBlock(),createElementBlock(`span`,_hoisted_31$3,`OK`)):createCommentVNode(``,!0)])])])],64))])],2)],64))),128))])]),penaltyData.value&&penaltyData.value.totalPenalty>0?(openBlock(),createElementBlock(`div`,_hoisted_32$3,[createBaseVNode(`div`,_hoisted_33$3,[createBaseVNode(`div`,_hoisted_34$3,[_cache[7]||=createBaseVNode(`span`,{class:`rally-card-title`},`PENALTIES`,-1),createBaseVNode(`div`,_hoisted_35$2,[_cache[6]||=createBaseVNode(`span`,{class:`total-label`},`Total`,-1),createBaseVNode(`span`,_hoisted_36$2,toDisplayString(penaltyData.value.totalPenalty)+`s`,1)])])]),createBaseVNode(`div`,_hoisted_37$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(penaltyData.value.groups,(group,idx)=>withDirectives((openBlock(),createElementBlock(`div`,{key:idx,class:`penalty-group`},[createBaseVNode(`div`,_hoisted_38$1,[createBaseVNode(`span`,_hoisted_39$1,toDisplayString(group.eventGroup),1),_cache[8]||=createBaseVNode(`span`,{class:`group-mid`},null,-1),createBaseVNode(`span`,_hoisted_40$1,toDisplayString(group.totalPenalty)+`s`,1)]),createBaseVNode(`div`,_hoisted_41$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.penalties,(penalty,pidx)=>(openBlock(),createElementBlock(`div`,{key:pidx,class:`penalty-item`},[createBaseVNode(`span`,_hoisted_42$1,toDisplayString(formatPenaltyType(penalty.type)),1),createBaseVNode(`span`,_hoisted_43$1,toDisplayString(penalty.amount)+`s (x`+toDisplayString(penalty.count)+`)`,1)]))),128))])])),[[vShow,group.totalPenalty>0]])),128))])])):createCommentVNode(``,!0)])])):(openBlock(),createElementBlock(`div`,_hoisted_44$1,[createBaseVNode(`div`,null,[createVNode(unref(dynamicComponent_default),{template:interactLabel.value,bbcode:``},null,8,[`template`]),createBaseVNode(`div`,_hoisted_45$1,[createBaseVNode(`div`,null,toDisplayString(toggleLabel.value),1),_cache[9]||=createBaseVNode(`div`,null,`Time Card`,-1)])])]))]),_:1})]))}},appTimecard_default=__plugin_vue_export_helper_default(_sfc_main$171,[[`__scopeId`,`data-v-216504fd`]]),_hoisted_1$152={class:`rally-dashboard-app-container`},_hoisted_2$125={class:`dashboard-widget widget-rally-clock`},_hoisted_3$112={key:0,class:`period`},_hoisted_4$91={class:`dashboard-widget widget-rally-sstime`},_hoisted_5$79={class:`widget-value`},_hoisted_6$65={class:`dashboard-widget widget-rally-objective`},_hoisted_7$57={class:`widget-value`},_hoisted_8$47={key:2},_sfc_main$170={__name:`appDashboard`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),recoverVehicleTemplate=computed(()=>` Press [action=reset_physics] to recover vehicle.`),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockTime:null,day:null,totalTime:0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),clockFlash=ref(!1);events$3.on(`RallyClockSkipped`,()=>{clockFlash.value=!1,setTimeout(()=>{clockFlash.value=!0},0),setTimeout(()=>{clockFlash.value=!1},1e3)});let scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1,speedLimit:null,speedLimitDisplay:null,speedUnit:`km/h`}),formattedWallClock=computed(()=>rallyClockData.wallClockTime?{time:rallyClockData.wallClockTime.time||`--:--:--`,period:rallyClockData.wallClockTime.ampm||``}:{time:`--:--:--`,period:``}),objectiveText=computed(()=>{let obj=scheduleData;return!obj||!obj.eventType?[]:obj.eventType===`service_in`?[`Drive to your `,{type:`badge`,val:`service bay`,class:`tc-badge`},`.`]:obj.eventType===`tc`&&obj.label===`TC0`?[`Reverse out and reach `,{type:`badge`,val:obj.label,class:`tc-badge`},` between `,{type:`clock`,val:obj.eventWallClockStart,class:`clock-badge`},` - `,{type:`clock`,val:obj.eventWallClockEnd,class:`clock-badge`},`. Penalty for each minute early or late: `,{type:`badge`,val:`+10s`,class:`penalty-badge`},`.`]:obj.eventType===`tc`?[`Reach `,{type:`badge`,val:obj.label,class:`tc-badge`},` between `,{type:`clock`,val:obj.eventWallClockStart,class:`clock-badge`},` - `,{type:`clock`,val:obj.eventWallClockEnd,class:`clock-badge`},`. Penalty for each minute early or late: `,{type:`badge`,val:`10sec`,class:`penalty-badge`},`.`]:[]}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function isStageActive(){return activeState.value===ActiveState.STAGE_ACTIVE}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$152,[isStageActive()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`rally-dashboard-app`,{"show-active-stage":isStageActive()}])},[createBaseVNode(`div`,_hoisted_2$125,[_cache[0]||=createBaseVNode(`div`,{class:`widget-label`},`Event Clock`,-1),createBaseVNode(`div`,{class:normalizeClass([`widget-value clock-value`,{"flash-pink":clockFlash.value}])},[createTextVNode(toDisplayString(formattedWallClock.value.time),1),formattedWallClock.value.period?(openBlock(),createElementBlock(`span`,_hoisted_3$112,toDisplayString(formattedWallClock.value.period),1)):createCommentVNode(``,!0)],2)]),createBaseVNode(`div`,_hoisted_4$91,[_cache[1]||=createBaseVNode(`div`,{class:`widget-label`},`Your Time`,-1),createBaseVNode(`div`,_hoisted_5$79,toDisplayString(rallyClockData.totalTime),1)]),createBaseVNode(`div`,_hoisted_6$65,[_cache[2]||=createBaseVNode(`div`,{class:`widget-label`},`Instructions`,-1),createBaseVNode(`div`,_hoisted_7$57,[(openBlock(!0),createElementBlock(Fragment,null,renderList(objectiveText.value,item=>(openBlock(),createElementBlock(`span`,{key:item},[item.type===`badge`?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(item.class)},toDisplayString(item.val),3)):item.type===`clock`?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(item.class)},toDisplayString(item.val.time)+toDisplayString(item.val.period),3)):(openBlock(),createElementBlock(`span`,_hoisted_8$47,toDisplayString(item),1))]))),128)),createVNode(unref(dynamicComponent_default),{template:recoverVehicleTemplate.value,bbcode:``},null,8,[`template`])])])],2))])]),_:1}))}},appDashboard_default=__plugin_vue_export_helper_default(_sfc_main$170,[[`__scopeId`,`data-v-a3bb6c18`]]),_hoisted_1$151={class:`rally-debug-app-container`},_hoisted_2$124={key:0,class:`debug-info`},_sfc_main$169={__name:`appDebug`,setup(__props){let{lua}=useBridge(),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},showDebugInfo=ref(!0),activeState=ref(ActiveState.INACTIVE),timecardData=ref([]),penaltyData=ref({totalPenalty:0,groups:[]}),rallyClockData=reactive({}),vehicleProximityData=reactive({}),scheduleData=reactive({}),stageData=reactive({}),countdownData=reactive({}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.timecardData&&(timecardData.value=data.timecardData),data.penaltyData&&(penaltyData.value=data.penaltyData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}return rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$151,[showDebugInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_2$124,[createBaseVNode(`div`,null,`activeState: "`+toDisplayString(activeState.value)+`"`,1),createBaseVNode(`div`,null,`rallyClock: `+toDisplayString(rallyClockData),1),createBaseVNode(`div`,null,`countdownData: `+toDisplayString(countdownData),1),createBaseVNode(`div`,null,`vehicleProximityData: `+toDisplayString(vehicleProximityData),1),createBaseVNode(`div`,null,`scheduleData: `+toDisplayString(scheduleData),1),createBaseVNode(`div`,null,`timecardData: `+toDisplayString(timecardData.value),1),createBaseVNode(`div`,null,`penaltyData: `+toDisplayString(penaltyData.value),1),createBaseVNode(`div`,null,`stageData: `+toDisplayString(stageData),1)])):createCommentVNode(``,!0)]))}},appDebug_default=__plugin_vue_export_helper_default(_sfc_main$169,[[`__scopeId`,`data-v-c2c6bfeb`]]),_hoisted_1$150={class:`distance-widget-svg`},_hoisted_2$123=[`x`,`y`,`height`],_hoisted_3$111=[`x`,`y`,`width`,`height`],_hoisted_4$90=[`x`,`y`,`width`,`height`],_hoisted_5$78=[`x`,`y`,`width`,`height`],_hoisted_6$64={x:0,y:`90%`,"text-anchor":`middle`},_hoisted_7$56={class:`tick-label`},_hoisted_8$46={class:`tick-label-unit`,dx:`2`},_hoisted_9$41=[`x`,`y`,`width`,`height`],_hoisted_10$34={x:0,y:`90%`,dx:`20`,"text-anchor":`end`},_hoisted_11$30={key:0,class:`tick-label-bold`},_hoisted_12$24={class:`tick-label-unit`,dx:`2`},_hoisted_13$21=[`x`,`y`,`width`,`height`],PAD_PX=20,PADRIGHT_PX=26,barHeightPct=8,barCenterY=50,tickStrokeWidth=2,tickSize=12,trackingRectSize=14,_sfc_main$168={__name:`DistanceWidgetSVGRect`,props:{distPct:{type:Number,required:!0},totalDistM:{type:Number,required:!0},splits:{type:Array,default:()=>[]},splitPrecision:{type:Number,default:1},themeColor:{type:String,required:!0},unit:{type:String,default:`km`}},setup(__props){useCssVars(_ctx=>({v94238812:__props.themeColor}));let props=__props,barStartX=PAD_PX,barY=barCenterY-barHeightPct/2;100-PADRIGHT_PX,computed(()=>PAD_PX+(100-PAD_PX-PADRIGHT_PX)*props.distPct);let currentX=computed(()=>`calc(${PAD_PX}px + (100% - ${PAD_PX+PADRIGHT_PX}px) * ${props.distPct})`),barWidth=`calc(100% - ${PAD_PX+PADRIGHT_PX}px)`,progressWidth=computed(()=>`calc((100% - ${PAD_PX+PADRIGHT_PX}px) * ${props.distPct})`),barEndX=`calc(100% - ${PADRIGHT_PX}px)`,splitMarkers=computed(()=>props.splits?props.splits.filter(s=>typeof s?.pathnodeType==`string`&&s.pathnodeType.startsWith(`split_`)).map((s,idx)=>{let pct=s.distPct||0,x=`calc(${PAD_PX}px + (100% - ${PAD_PX+PADRIGHT_PX}px) * ${pct})`;return{key:s.pathnodeId??idx,x,label:{val:s.splitLabel,unit:props.unit}}}):[]),finalSplitLabel=computed(()=>!props.splits||props.splits.length===0?{val:null,unit:null}:{val:props.splits[props.splits.length-1]?.splitLabel,unit:props.unit});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$150,[(openBlock(),createElementBlock(`svg`,null,[createBaseVNode(`rect`,{x:unref(barStartX)+`px`,y:barY+`%`,width:barWidth,height:barHeightPct+`%`,fill:`white`},null,8,_hoisted_2$123),createBaseVNode(`rect`,{x:unref(barStartX)+`px`,y:barY-1+`%`,width:progressWidth.value,height:barHeightPct+2+`%`,fill:`var(--theme-color)`},null,8,_hoisted_3$111),createBaseVNode(`rect`,{x:unref(barStartX)-tickSize/2+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,fill:`var(--theme-color)`},null,8,_hoisted_4$90),(openBlock(!0),createElementBlock(Fragment,null,renderList(splitMarkers.value,split=>(openBlock(),createElementBlock(`g`,{key:split.key,style:normalizeStyle(`transform: translateX(${split.x})`)},[createBaseVNode(`rect`,{x:-(tickSize/2)+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,"stroke-width":tickStrokeWidth,fill:`#202020`,stroke:`#ffffff`},null,8,_hoisted_5$78),createBaseVNode(`text`,_hoisted_6$64,[createBaseVNode(`tspan`,_hoisted_7$56,toDisplayString(split.label.val),1),createBaseVNode(`tspan`,_hoisted_8$46,toDisplayString(split.label.unit),1)])],4))),128)),createBaseVNode(`g`,{style:normalizeStyle(`transform: translateX(${barEndX})`)},[createBaseVNode(`rect`,{x:-(tickSize/2)+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,"stroke-width":tickStrokeWidth,fill:`#202020`,stroke:`#ffffff`},null,8,_hoisted_9$41),createBaseVNode(`text`,_hoisted_10$34,[finalSplitLabel.value?(openBlock(),createElementBlock(`tspan`,_hoisted_11$30,toDisplayString(finalSplitLabel.value.val),1)):createCommentVNode(``,!0),createBaseVNode(`tspan`,_hoisted_12$24,toDisplayString(finalSplitLabel.value.unit),1)])],4),createBaseVNode(`g`,{style:normalizeStyle(`transform: translateX(${currentX.value})`)},[createBaseVNode(`rect`,{x:-(trackingRectSize/2)+`px`,y:`calc(`+barCenterY+`% - `+trackingRectSize/2+`px)`,width:trackingRectSize+`px`,height:trackingRectSize+`px`,fill:`var(--theme-color)`},null,8,_hoisted_13$21)],4)]))]))}},DistanceWidgetSVGRect_default=__plugin_vue_export_helper_default(_sfc_main$168,[[`__scopeId`,`data-v-9c6ef477`]]);function rallyStageThemeColor(withAlpha=null){return`#009a1a${withAlpha===!0?`a0`:``}`}var _hoisted_1$149={key:0,class:`rally-stage-timing-app`},_sfc_main$167={__name:`appStageProgress`,setup(__props){useCssVars(_ctx=>({v708a5eb2:themeColor.value}));let{lua}=useBridge();reactive({env:window.beamng&&!window.beamng.shipping,vue:!1});let ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockSecs:null,epochTime:null,day:null,totalPenalty:0,totalTime:0,use24hFormat:!0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distPct:0},unit:`km`}),themeColor=computed(()=>rallyStageThemeColor()),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function shouldShowApp(){return!0}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_1$149,[createVNode(DistanceWidgetSVGRect_default,{"dist-pct":stageData.completion.distPct,"total-dist-m":stageData.completion.totalDistM,splits:stageData.splits,"theme-color":themeColor.value,unit:stageData.unit},null,8,[`dist-pct`,`total-dist-m`,`splits`,`theme-color`,`unit`])])):createCommentVNode(``,!0)]),_:1}))}},appStageProgress_default=__plugin_vue_export_helper_default(_sfc_main$167,[[`__scopeId`,`data-v-a8eba296`]]);function formatSSTime(seconds,activeState){if(activeState===`inactive`)return`--:--:--`;let roundedSeconds=Math.round(seconds*10)/10,hours=Math.floor(roundedSeconds/3600),minutes=Math.floor(roundedSeconds%3600/60),secs=Math.floor(roundedSeconds%60),tenths=Math.round(roundedSeconds%1*10)%10;return hours>0?`${hours}:${String(minutes).padStart(2,`0`)}:${String(secs).padStart(2,`0`)}.${tenths}`:minutes>0?`${minutes}:${String(secs).padStart(2,`0`)}.${tenths}`:`${secs}.${tenths}`}var _hoisted_1$148={key:0,class:`rally-stage-timing-app`},_hoisted_2$122={class:`section-active-stage`},_hoisted_3$110={class:`stage-header`},_hoisted_4$89={class:`stage-time`},_hoisted_5$77={key:0,class:`splits-header`},_hoisted_6$63={key:1,class:`stage-splits`},_hoisted_7$55={class:`stage-split-label`},_hoisted_8$45={class:`stage-split-label-unit`},_hoisted_9$40={class:`stage-split-time`},_hoisted_10$33=[`src`],_sfc_main$166={__name:`appStageTiming`,setup(__props){let{lua}=useBridge(),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockSecs:null,epochTime:null,day:null,totalPenalty:0,totalTime:0,use24hFormat:!0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distM:0,distPct:0}});computed(()=>rallyStageThemeColor(!0));let completedSplits=computed(()=>stageData.splits?.filter(split=>split.time!=null)||[]),splitUnit=computed(()=>`km`),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function shouldShowApp(){return!0}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_1$148,[createBaseVNode(`div`,_hoisted_2$122,[createBaseVNode(`div`,_hoisted_3$110,`STAGE `+toDisplayString(stageData.label)+` / `+toDisplayString(scheduleData.totalSSCount),1),createBaseVNode(`div`,_hoisted_4$89,toDisplayString(unref(formatSSTime)(stageData.currentSSTime,activeState.value)),1),completedSplits.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$77,`SPLITS`)):createCommentVNode(``,!0),completedSplits.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_6$63,[(openBlock(!0),createElementBlock(Fragment,null,renderList(completedSplits.value,split=>(openBlock(),createElementBlock(`div`,{class:`stage-split`,key:split.pathnodeId},[createBaseVNode(`div`,_hoisted_7$55,[createBaseVNode(`span`,null,toDisplayString(split.splitLabel),1),createBaseVNode(`span`,_hoisted_8$45,toDisplayString(splitUnit.value),1)]),createBaseVNode(`div`,_hoisted_9$40,toDisplayString(unref(formatSSTime)(split.time,activeState.value)),1)]))),128))])):createCommentVNode(``,!0),rallyClockData.isNgrcMode?(openBlock(),createElementBlock(`img`,{key:2,class:`stage-ngrc-badge`,src:unref(getAssetURL)(`images/ngrc_logo_dark_128x40.png`),alt:`NGRC`},null,8,_hoisted_10$33)):createCommentVNode(``,!0)])])):createCommentVNode(``,!0)]),_:1}))}},appStageTiming_default=__plugin_vue_export_helper_default(_sfc_main$166,[[`__scopeId`,`data-v-cea09957`]]),_hoisted_1$147={class:`gameplay-apps`},gameplayAppsFlashMessage=`GameplayAppsFlashMessage`,_sfc_main$165={__name:`gameplayApps`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),isDrift=ref(!1),isDragStaging=ref(!1),isRally=ref(!1),isPointsBar=ref(!1),isFlashMessage=ref(!1),isCountdown=ref(!1),appStates={drift:isDrift,drag:isDragStaging,rally:isRally,pointsBar:isPointsBar,flashMessage:isFlashMessage,countdown:isCountdown},setAppVisibility=data=>{data.appId&&appStates[data.appId]&&(appStates[data.appId].value=data.visible),data.hideAll&&Object.values(appStates).forEach(state=>state.value=!1)},loadInitialVisibility=async()=>{try{let visibleApps=await lua.ui_gameplayAppContainers.getVisibleApps(`gameplayApps`);Object.values(appStates).forEach(state=>state.value=!1),Array.isArray(visibleApps)&&visibleApps.forEach(appId=>{appStates[appId]&&(appStates[appId].value=!0)})}catch{}};return onMounted(()=>{events$3.on(`setGameplayAppVisibility`,setAppVisibility),lua.ui_gameplayAppContainers.onGameplayAppContainerMounted(),loadInitialVisibility()}),onUnmounted(()=>{events$3.off(`setGameplayAppVisibility`,setAppVisibility),lua.ui_gameplayAppContainers.onGameplayAppContainerUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$147,[withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isPointsBar.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$28)),mergeProps({class:`app rally`},_ctx.$attrs),null,16)),[[vShow,isRally.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$13)),mergeProps({class:`app`,showFlash:!1},_ctx.$attrs),null,16)),[[vShow,isDrift.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$11)),mergeProps({class:`app`,showFlash:!1},_ctx.$attrs),null,16)),[[vShow,isDragStaging.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(flashMessageApp_default)),mergeProps({class:`app flash-message`,"message-source":gameplayAppsFlashMessage},_ctx.$attrs),null,16)),[[vShow,isFlashMessage.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(countdownApp_default)),mergeProps({class:`countdown`},_ctx.$attrs),null,16)),[[vShow,isCountdown.value]])]))}},gameplayApps_default=__plugin_vue_export_helper_default(_sfc_main$165,[[`__scopeId`,`data-v-8ac28a96`]]),_hoisted_1$146={class:`messages-tasks-apps`},_sfc_main$164={__name:`messagesTasksApps`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),isMessages=ref(!1),isTasks=ref(!1),appStates={messages:isMessages,tasks:isTasks},setAppVisibility=data=>{data.appId&&appStates[data.appId]&&(appStates[data.appId].value=data.visible),data.hideAll&&Object.values(appStates).forEach(state=>{state.value=!1})},loadInitialVisibility=async()=>{try{let visibleApps=await lua.ui_messagesTasksAppContainers.getVisibleApps(`messagesTasksApps`);Object.values(appStates).forEach(state=>{state.value=!1}),Array.isArray(visibleApps)&&visibleApps.forEach(appId=>{appStates[appId]&&(appStates[appId].value=!0)})}catch{}};return onMounted(()=>{events$3.on(`setMessagesTasksAppVisibility`,setAppVisibility),lua.ui_messagesTasksAppContainers.onMessagesTasksAppContainerMounted(),loadInitialVisibility()}),onUnmounted(()=>{events$3.off(`setMessagesTasksAppVisibility`,setAppVisibility),lua.ui_messagesTasksAppContainers.onMessagesTasksAppContainerUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$146,[withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$27)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isTasks.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$32)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isMessages.value]])]))}},messagesTasksApps_default=__plugin_vue_export_helper_default(_sfc_main$164,[[`__scopeId`,`data-v-0ac32403`]]),_sfc_main$163={__name:`countdownApp`,setup(__props){let events$3=useEvents();function convertLegacyMessage(data){return Array.isArray(data)?data.map(item=>({msg:typeof item[0]==`object`?item[0].txt:item[0],ttl:item[1],luaCall:typeof item[2]==`string`?item[2]:void 0,jsCallback:typeof item[2]==`function`?item[2]:void 0,big:item[3]??!1})):data}return onMounted(()=>{events$3.on(`ScenarioFlashMessage`,data=>{let convertedData=convertLegacyMessage(data);if(Array.isArray(convertedData)&&convertedData.length>0){let lastMessage=convertedData[convertedData.length-1];lastMessage.msg===`GO!`&&(lastMessage.jsCallback=()=>{events$3.emit(`CountdownEnded`)})}events$3.emit(`CountdownMessage`,convertedData)}),events$3.on(`ScenarioNotRunning`,()=>{events$3.emit(`CountdownMessage`,{msg:``,ttl:0})})}),(_ctx,_cache)=>(openBlock(),createBlock(bngFlashMessage_default,{"message-source":`CountdownMessage`}))}},countdownApp_default=__plugin_vue_export_helper_default(_sfc_main$163,[[`__scopeId`,`data-v-8ddc025c`]]),_sfc_main$162={__name:`flashMessageApp`,setup(__props){let events$3=useEvents();return onMounted(()=>{events$3.on(`ScenarioFlashMessage`,data=>{let convertedData=Array.isArray(data)?data.map(item=>({msg:typeof item[0]==`object`?item[0].txt:item[0],ttl:item[1],luaCall:typeof item[2]==`string`?item[2]:void 0,jsCallback:typeof item[2]==`function`?item[2]:void 0,big:item[3]??!1})):data;events$3.emit(`SimpleFlashMessage`,convertedData)}),events$3.on(`ScenarioNotRunning`,()=>{events$3.emit(`SimpleFlashMessage`,{msg:``,ttl:0})})}),(_ctx,_cache)=>(openBlock(),createBlock(bngFlashMessage_default,{"message-source":`SimpleFlashMessage`}))}},flashMessageApp_default=__plugin_vue_export_helper_default(_sfc_main$162,[[`__scopeId`,`data-v-48db34d3`]]),_hoisted_1$145={class:`generic-mission-data`},_sfc_main$161={__name:`bngGenericMissionData`,setup(__props){let events$3=useEvents(),{lua}=useBridge(),displayElements=ref([]),getElementValue=element=>element.minutes||element.seconds?``:typeof element.txt==`number`?element.txt:element.style===`text`||element.style===void 0?$translate.instant(element.txt):`Error: Unsupported style`,handleMissionDataChanged=data=>{if(data){for(;displayElements.value.length<=data.index;)displayElements.value.push(null);displayElements.value[data.index]=data.element}},handleMissionDataReset=()=>{displayElements.value=[]};return onMounted(()=>{events$3.on(`SetGenericMissionData`,handleMissionDataChanged),events$3.on(`SetGenericMissionDataResetAll`,handleMissionDataReset),lua.extensions.load(`ui_apps_genericMissionData`),lua.ui_apps_genericMissionData.sendAllData()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$145,[(openBlock(!0),createElementBlock(Fragment,null,renderList(displayElements.value,(element,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[element?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:0,label:_ctx.$tt(element.title),value:getElementValue(element),icon:element.icon,minutes:element.minutes,seconds:element.seconds,milliseconds:element.milliseconds,class:`mission-data-item`},null,8,[`label`,`value`,`icon`,`minutes`,`seconds`,`milliseconds`])):createCommentVNode(``,!0)],64))),128))]))}},bngGenericMissionData_default=__plugin_vue_export_helper_default(_sfc_main$161,[[`__scopeId`,`data-v-1cdb0dd5`]]),_hoisted_1$144={class:`controls-container`},_sfc_main$160={__name:`app`,setup(__props){let{$game}=useLibStore();return ref(!0),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$144,[createVNode(unref(bngAppBindingDisplay_default))]))}},app_default$29=__plugin_vue_export_helper_default(_sfc_main$160,[[`__scopeId`,`data-v-66fafb5f`]]),_hoisted_1$143={class:`main-container-grid`},_hoisted_2$121={class:`points-display`},_hoisted_3$109={class:`star-wrapper`},_sfc_main$159={__name:`app`,setup(__props){let{lua}=useBridge(),fillPercent=ref(0),pointsLabel=ref(`0`),thresholdPercentages=ref([]),thresholdsReached=ref([]),thresholdCount=ref(0),thresholdIndices=computed(()=>Array.from({length:thresholdCount.value},(_,index)=>index));onMounted(()=>{lua.extensions.load(`ui_apps_pointsBar`),lua.ui_apps_pointsBar.requestAllData()}),onUnmounted(()=>{});let streamsList$1=[`pointsBar`];return useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;fillPercent.value=streams.pointsBar.fillPercent,pointsLabel.value=streams.pointsBar.pointsLabel,streams.pointsBar.thresholdPercentages&&Array.isArray(streams.pointsBar.thresholdPercentages)&&(thresholdPercentages.value=streams.pointsBar.thresholdPercentages),streams.pointsBar.thresholdsReached&&Array.isArray(streams.pointsBar.thresholdsReached)&&(thresholdsReached.value=streams.pointsBar.thresholdsReached),thresholdCount.value=streams.pointsBar.thresholdCount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$143,[createBaseVNode(`div`,{class:`progress-bar-container`,style:normalizeStyle({"--threshold-percentage":thresholdPercentages.value[0]||0})},[createBaseVNode(`div`,_hoisted_2$121,toDisplayString(_ctx.$t(pointsLabel.value)),1),createBaseVNode(`div`,{class:`progress-bar`,style:normalizeStyle({width:`${fillPercent.value*100}%`})},null,4),(openBlock(!0),createElementBlock(Fragment,null,renderList(thresholdIndices.value,i=>(openBlock(),createElementBlock(`div`,{key:i,class:normalizeClass([`limit-marker`,{passed:thresholdsReached.value[i]}]),style:normalizeStyle({left:`${thresholdPercentages.value[i]}%`})},[createBaseVNode(`div`,_hoisted_3$109,[createVNode(unref(bngIcon_default),{type:thresholdsReached.value[i]?unref(icons).star:unref(icons).starSecondary,class:normalizeClass([`star-icon`,{passed:thresholdsReached.value[i]}])},null,8,[`type`,`class`])])],6))),128))],4)]))}},app_default=__plugin_vue_export_helper_default(_sfc_main$159,[[`__scopeId`,`data-v-4e2c4ac3`]]),_hoisted_1$142={key:0,class:`minimap-container-additional-info top`},_hoisted_2$120={key:0},_hoisted_3$108={key:1,class:`minimap-container-additional-info bottom`},_hoisted_4$88={key:2},_hoisted_5$76={key:0,class:`minimap-container-additional-info top round`},_hoisted_6$62={key:0},_hoisted_7$54={key:1,class:`minimap-container-additional-info bottom round`},_hoisted_8$44={key:2},transformUpdateAttempts=15,_sfc_main$158={__name:`app`,setup(__props){useCssVars(_ctx=>({v01db66c6:squareSize.value,v32146572:minimapSize.value}));let{lua}=useBridge(),events$3=useEvents(),route=useRoute(),$globalStore=inject(`$globalStore`),uiVisible=ref(!0),initialising=ref(!1),initialised=ref(!1),minimapMode=ref(`circle`),minimapContainerRef=ref(null),containerRef=ref(null);ref(null),ref(null);let resizeObserver=ref(null),mapMetrics=reactive({x:0,y:0,width:0,height:0,xRel:0,yRel:0,widthRel:0,heightRel:0}),allowedRoutes=[`/play`,``],showMinimap=computed(()=>uiVisible.value&&!loadingScreen.shown&&$globalStore.__uiAppsShown&&!$globalStore.__introPopupShown&&!popupsView.popups&&!popupsView.activities&&allowedRoutes.includes(route.path)),additionalInfo=reactive({distToTarget:null,locationName:null,policeMode:`disabled`}),hasTopInfo=computed(()=>!!additionalInfo.locationName),hasBottomInfo=computed(()=>!!(additionalInfo.distToTarget||additionalInfo.policeMode===`visibleToPolice`||additionalInfo.policeMode===`hiddenFromPolice`));watch(hasTopInfo,val=>{showMinimap.value&&requestAnimationFrame(updateDrawTransform)}),watch(hasBottomInfo,val=>{showMinimap.value&&requestAnimationFrame(updateDrawTransform)});let transformUpdateAttempt=0,minimapSize=ref(`100%`),minimapShift=ref(`0px`),squareSize=ref(`100%`);async function updateDrawTransform(){if(minimapMode.value===`circle`&&minimapContainerRef.value){let rect$1=minimapContainerRef.value.getBoundingClientRect(),size$3=Math.min(rect$1.width,rect$1.height),sizepx=size$3+`px`;minimapSize.value!==sizepx&&(minimapSize.value=sizepx,rect$1.width>rect$1.height?minimapShift.value=-(rect$1.width-size$3)/2+`px`:minimapShift.value=`0px`,await nextTick())}if(!initialised.value||!showMinimap.value||!containerRef.value)return;let screen$1={width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY},rect=containerRef.value.getBoundingClientRect();mapMetrics.x=rect.left+screen$1.scrollX,mapMetrics.y=rect.top+screen$1.scrollY,mapMetrics.width=rect.width,mapMetrics.height=rect.height,mapMetrics.xRel=mapMetrics.x/screen$1.width,mapMetrics.yRel=mapMetrics.y/screen$1.height,mapMetrics.widthRel=mapMetrics.width/screen$1.width,mapMetrics.heightRel=mapMetrics.height/screen$1.height;let keys=[`xRel`,`yRel`,`widthRel`,`heightRel`];if(keys.some(key=>mapMetrics[key]<0||mapMetrics[key]>1)||keys.every(key=>mapMetrics[key]===0)){transformUpdateAttempt++,transformUpdateAttempt{val?updateDrawTransform():initialised.value&&sendTransformToLua(!1)}),watch([initialised,containerRef],()=>{updateDrawTransform(),containerRef.value&&!resizeObserver.value&&(resizeObserver.value=new ResizeObserver(()=>{updateDrawTransform()}),resizeObserver.value.observe(containerRef.value))},{immediate:!0}),onMounted(()=>{window.addEventListener(`scroll`,updateDrawTransform),window.addEventListener(`resize`,updateDrawTransform),events$3.on(`onCefVisibilityChanged`,visible=>{uiVisible.value=visible,nextTick(updateDrawTransform)}),initMinimap()}),onUnmounted(()=>{let wasInitialised=initialised.value;initialised.value=!1,window.removeEventListener(`scroll`,updateDrawTransform),window.removeEventListener(`resize`,updateDrawTransform),resizeObserver.value&&=(resizeObserver.value.disconnect(),null),wasInitialised&&sendTransformToLua(!1)}),useStreams([`minimap`],streams=>{streams.minimap&&(additionalInfo.distToTarget=streams.minimap.distToTarget,additionalInfo.locationName=streams.minimap.locationName,additionalInfo.policeMode=streams.minimap.policeMode)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`minimapContainerRef`,ref:minimapContainerRef,class:normalizeClass([`minimap-container-wrapper`,{[`police-`+additionalInfo.policeMode]:minimapMode.value===`rect`,round:minimapMode.value===`circle`}]),onClick:updateDrawTransform},[minimapMode.value===`rect`?(openBlock(),createElementBlock(Fragment,{key:0},[hasTopInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_1$142,[additionalInfo.locationName?(openBlock(),createElementBlock(`span`,_hoisted_2$120,toDisplayString(additionalInfo.locationName),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`minimap-container`,{"round-bottom":!hasBottomInfo.value,"round-top":!hasTopInfo.value}]),ref_key:`containerRef`,ref:containerRef},null,2),hasBottomInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_3$108,[additionalInfo.policeMode===`visibleToPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`eyeSolidOpened`})):createCommentVNode(``,!0),additionalInfo.policeMode===`hiddenFromPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:`eyeSolidClosed`})):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createElementBlock(`span`,_hoisted_4$88,toDisplayString(additionalInfo.distToTarget),1)):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createBlock(unref(bngIcon_default),{key:3,class:``,type:`mapPoint`})):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):minimapMode.value===`circle`?(openBlock(),createElementBlock(Fragment,{key:1},[hasTopInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_5$76,[additionalInfo.locationName?(openBlock(),createElementBlock(`span`,_hoisted_6$62,toDisplayString(additionalInfo.locationName),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`minimap-container round`,{[`police-`+additionalInfo.policeMode]:!0}]),ref_key:`containerRef`,ref:containerRef},null,2),hasBottomInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_7$54,[additionalInfo.policeMode===`visibleToPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`eyeSolidOpened`})):createCommentVNode(``,!0),additionalInfo.policeMode===`hiddenFromPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:`eyeSolidClosed`})):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createElementBlock(`span`,_hoisted_8$44,toDisplayString(additionalInfo.distToTarget),1)):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createBlock(unref(bngIcon_default),{key:3,class:``,type:`mapPoint`})):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0)],2))}},app_default$30=__plugin_vue_export_helper_default(_sfc_main$158,[[`__scopeId`,`data-v-4d3d3a71`]]),_hoisted_1$141={class:`hotlapping-app`},_hoisted_2$119={class:`hotlapping-header`},_hoisted_3$107={class:`header-flex`},_hoisted_4$87={class:`hotlapping-content`},_hoisted_5$75={key:0,class:`grid-header`},_hoisted_6$61={class:`grid-item current-item`},_hoisted_7$53={class:`grid-item current-item`},_hoisted_8$43={class:`grid-item current-item`},_sfc_main$157={__name:`app`,setup(__props){useEvents();let fastData=ref({}),slowData=ref({}),staticData=ref({}),placementData=ref({}),displayMode=ref(`combined`);onMounted(()=>{useStreams([`lapTimes_fast`,`lapTimes_slow`,`lapTimes_static`,`lapTimes_placement`],streams=>{streams.lapTimes_fast&&(fastData.value=streams.lapTimes_fast),streams.lapTimes_slow&&(slowData.value=streams.lapTimes_slow),streams.lapTimes_static&&(staticData.value=streams.lapTimes_static),streams.lapTimes_placement&&(placementData.value=streams.lapTimes_placement)})}),onUnmounted(()=>{});let getLapValue=()=>`${slowData.value?.currentLap||0}/${staticData.value?.totalLaps||0}`,getSegmentValue=()=>`${slowData.value?.currentSegment||0}/${staticData.value?.totalSegments||0}`,getTotalRaceTime=()=>fastData.value?.currentTimeFormatted||`00:00.000`,parseTimeString=timeStr=>{if(!timeStr)return{minutes:`00`,seconds:`00`,milliseconds:`000`};let parts=timeStr.split(`:`);if(parts.length===2){let minutes=parts[0].padStart(2,`0`),secondsParts=parts[1].split(`.`);return{minutes,seconds:secondsParts[0].padStart(2,`0`),milliseconds:secondsParts[1]?secondsParts[1].padEnd(3,`0`):`000`}}else{let secondsParts=parts[0].split(`.`);return{minutes:`00`,seconds:secondsParts[0].padStart(2,`0`),milliseconds:secondsParts[1]?secondsParts[1].padEnd(3,`0`):`000`}}},getTotalRaceTimeMinutes=()=>parseTimeString(getTotalRaceTime()).minutes,getTotalRaceTimeSeconds=()=>parseTimeString(getTotalRaceTime()).seconds,getTotalRaceTimeMilliseconds=()=>parseTimeString(getTotalRaceTime()).milliseconds,isRacing=()=>slowData.value?.status===`started`||slowData.value?.status===`paused`,getCurrentLapDiffClass=()=>{let flavor=fastData.value?.currentLapDiffToBestFlavor;return flavor===`better`?`diff-better`:flavor===`worse`?`diff-worse`:`diff-neutral`},getDiffClass=(flavor,value)=>!value||value===``||value===`N/A`?`diff-neutral`:flavor===`better`?`diff-better`:flavor===`worse`?`diff-worse`:`diff-neutral`,shouldShowToggleIcon=()=>(staticData.value?.totalLaps||0)>1,shouldShowSegmentsByDefault=()=>(staticData.value?.totalLaps||0)<=1,cycleDisplayMode=()=>{if(shouldShowToggleIcon()){let modes=[`combined`,`laps`,`segments`];displayMode.value=modes[(modes.indexOf(displayMode.value)+1)%modes.length]}},getTableHeaderLabel=()=>displayMode.value===`combined`?`Combined`:displayMode.value===`segments`?`Split`:`Lap`,shouldHideVsPrevBest=()=>(staticData.value?.totalLaps||0)<=1,getCurrentTimeFormatted=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?fastData.value?.currentSegmentTimeFormatted:fastData.value?.currentLapTimeFormatted,getCurrentItemNumber=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?`${slowData.value?.currentLap||1}-${slowData.value?.currentSegment||1}`:slowData.value?.currentLap||1,getCurrentDiff=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?fastData.value?.currentSegmentDiffToBestFormatted||``:fastData.value?.currentLapDiffToBestFormatted||``,getCurrentTotalTime=()=>fastData.value?.currentTimeFormatted||``,getFilteredCombinedItems=()=>{if(!slowData.value||!slowData.value.combinedTimes||!Array.isArray(slowData.value.combinedTimes))return[];let filtered=[];return displayMode.value===`combined`?filtered=[...slowData.value.combinedTimes]:displayMode.value===`laps`?filtered=slowData.value.combinedTimes.filter(item=>item.type===`lap`):displayMode.value===`segments`&&(filtered=slowData.value.combinedTimes.filter(item=>item.type===`segment`)),filtered.reverse()},getItemKey=item=>`${item.type}-${item.identifier}`,getItemNumber=item=>item.identifier;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$141,[createBaseVNode(`div`,_hoisted_2$119,[createBaseVNode(`div`,_hoisted_3$107,[staticData.value.totalLaps>1?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:0,class:`header-cell`,label:`Lap`,value:getLapValue()},null,8,[`value`])):createCommentVNode(``,!0),staticData.value.totalSegments>1?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:1,class:`header-cell`,label:`Split`,value:getSegmentValue()},null,8,[`value`])):createCommentVNode(``,!0),createVNode(bngSimpleDataDisplay_default,{class:`header-cell`,label:`Race Clock`,minutes:getTotalRaceTimeMinutes(),seconds:getTotalRaceTimeSeconds(),milliseconds:getTotalRaceTimeMilliseconds()},null,8,[`minutes`,`seconds`,`milliseconds`])])]),createBaseVNode(`div`,_hoisted_4$87,[createBaseVNode(`div`,{class:normalizeClass([`times-grid`,{"single-lap":shouldHideVsPrevBest()}])},[createBaseVNode(`div`,{class:normalizeClass([`grid-header clickable-header`,{"has-toggle":shouldShowToggleIcon()}]),onClick:_cache[0]||=$event=>shouldShowToggleIcon()?cycleDisplayMode():null},toDisplayString(getTableHeaderLabel()),3),_cache[1]||=createBaseVNode(`div`,{class:`grid-header`},`Duration`,-1),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$75,`Vs prev`)),_cache[2]||=createBaseVNode(`div`,{class:`grid-header`},`Total`,-1),isRacing()&&getCurrentTimeFormatted()?(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_6$61,toDisplayString(getCurrentItemNumber()),1),createBaseVNode(`div`,_hoisted_7$53,toDisplayString(getCurrentTimeFormatted()),1),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`grid-item current-item`,getCurrentLapDiffClass()])},toDisplayString(getCurrentDiff()),3)),createBaseVNode(`div`,_hoisted_8$43,toDisplayString(getCurrentTotalTime()),1)],64)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(getFilteredCombinedItems(),item=>(openBlock(),createElementBlock(Fragment,{key:getItemKey(item)},[createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item left-indicator":item.flavor===`best`,"is-lap":item.type===`lap`}])},toDisplayString(getItemNumber(item)),3),createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item":item.flavor===`best`}])},toDisplayString(item.durationFormatted),3),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`grid-item`,[{"best-item":item.flavor===`best`},getDiffClass(item.diffToPreviousFlavor,item.diffToPreviousFormatted)]])},toDisplayString(item.diffToPreviousFormatted||``),3)),createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item":item.flavor===`best`}])},toDisplayString(item.endTimeFormatted||``),3)],64))),128))],2)])]))}},app_default$31=__plugin_vue_export_helper_default(_sfc_main$157,[[`__scopeId`,`data-v-a9e5d83a`]]),_hoisted_1$140={class:`laptimes-section`},_hoisted_2$118={class:`collapse-icon`},_hoisted_3$106={class:`collapsible-content`},_hoisted_4$86={class:`laptimes-data-grid`},_hoisted_5$74={key:0,class:`data-item`},_hoisted_6$60={class:`value`},_hoisted_7$52={key:1,class:`data-item`},_hoisted_8$42={class:`data-item`},_hoisted_9$39={class:`value`},_hoisted_10$32={class:`data-item`},_hoisted_11$29={class:`value`},_hoisted_12$23={class:`data-item`},_hoisted_13$20={class:`value`},_hoisted_14$20={class:`data-item`},_hoisted_15$19={class:`value`},_hoisted_16$19={key:0,class:`laptimes-data-grid`,style:{"margin-top":`1rem`}},_hoisted_17$15={key:0,class:`data-item`},_hoisted_18$13={key:1,class:`data-item`},_hoisted_19$10={key:1,class:`laptimes-data-grid`,style:{"margin-top":`1rem`}},_hoisted_20$9={key:0,class:`data-item`},_hoisted_21$9={key:1,class:`data-item`},_sfc_main$156={__name:`BasicInfo`,props:{fastData:{type:Object,required:!0},staticData:{type:Object,required:!0},slowData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$140,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$118,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Race Info `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$106,[createBaseVNode(`div`,_hoisted_4$86,[__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,_hoisted_5$74,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Current Time:`,-1),createBaseVNode(`span`,_hoisted_6$60,toDisplayString(__props.fastData.currentTimeFormatted||`00:00.000`),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$52,[_cache[2]||=createBaseVNode(`span`,{class:`label`},`Status:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,{active:__props.slowData.status===`started`,paused:__props.slowData.status===`paused`}])},toDisplayString(__props.slowData.status?.toUpperCase()||`STOPPED`),3)])),createBaseVNode(`div`,_hoisted_8$42,[_cache[3]||=createBaseVNode(`span`,{class:`label`},`Lap:`,-1),createBaseVNode(`span`,_hoisted_9$39,toDisplayString(__props.slowData.currentLap||0)+`/`+toDisplayString(__props.staticData.totalLaps||0),1)]),createBaseVNode(`div`,_hoisted_10$32,[_cache[4]||=createBaseVNode(`span`,{class:`label`},`Segment:`,-1),createBaseVNode(`span`,_hoisted_11$29,toDisplayString(__props.slowData.currentSegment||0)+`/`+toDisplayString(__props.staticData.totalSegments||0),1)]),createBaseVNode(`div`,_hoisted_12$23,[_cache[5]||=createBaseVNode(`span`,{class:`label`},`Current Lap Time:`,-1),createBaseVNode(`span`,_hoisted_13$20,toDisplayString(__props.fastData.currentLapTimeFormatted||`00:00.000`),1)]),createBaseVNode(`div`,_hoisted_14$20,[_cache[6]||=createBaseVNode(`span`,{class:`label`},`Current Segment Time:`,-1),createBaseVNode(`span`,_hoisted_15$19,toDisplayString(__props.fastData.currentSegmentTimeFormatted||`00:00.000`),1)])]),__props.fastData.currentLapDiffToBestFormatted||__props.fastData.currentLapDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_16$19,[__props.fastData.currentLapDiffToBestFormatted?(openBlock(),createElementBlock(`div`,_hoisted_17$15,[_cache[7]||=createBaseVNode(`span`,{class:`label`},`Lap Diff to Best:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentLapDiffToBestFlavor||`default`)])},toDisplayString(__props.fastData.currentLapDiffToBestFormatted),3)])):createCommentVNode(``,!0),__props.fastData.currentLapDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_18$13,[_cache[8]||=createBaseVNode(`span`,{class:`label`},`Lap Diff to Previous:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentLapDiffToPreviousFlavor||`default`)])},toDisplayString(__props.fastData.currentLapDiffToPreviousFormatted),3)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.fastData.currentSegmentDiffToBestFormatted||__props.fastData.currentSegmentDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_19$10,[__props.fastData.currentSegmentDiffToBestFormatted?(openBlock(),createElementBlock(`div`,_hoisted_20$9,[_cache[9]||=createBaseVNode(`span`,{class:`label`},`Segment Diff to Best:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentSegmentDiffToBestFlavor||`default`)])},toDisplayString(__props.fastData.currentSegmentDiffToBestFormatted),3)])):createCommentVNode(``,!0),__props.fastData.currentSegmentDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_21$9,[_cache[10]||=createBaseVNode(`span`,{class:`label`},`Segment Diff to Previous:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentSegmentDiffToPreviousFlavor||`default`)])},toDisplayString(__props.fastData.currentSegmentDiffToPreviousFormatted),3)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},BasicInfo_default=__plugin_vue_export_helper_default(_sfc_main$156,[[`__scopeId`,`data-v-4329fa2c`]]),_hoisted_1$139={class:`laptimes-section`},_hoisted_2$117={class:`collapse-icon`},_hoisted_3$105={class:`collapsible-content`},_hoisted_4$85={class:`laptimes-data-grid`,style:{"margin-bottom":`1rem`}},_hoisted_5$73={class:`data-item`},_hoisted_6$59={class:`value`},_hoisted_7$51={key:0,class:`laptimes-data-grid`},_hoisted_8$41={class:`label`},_hoisted_9$38={class:`value`},_sfc_main$155={__name:`BestTimes`,props:{slowData:{type:Object,required:!0}},setup(__props){let props=__props,isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getBestLapDisplay=()=>{let bestTime=props.slowData.bestLapTimeFormatted||`N/A`,bestIndex=props.slowData.bestLapIndex===-1?null:props.slowData.bestLapIndex;return bestTime===`N/A`||bestIndex===null?`N/A`:`${bestTime} in Lap ${bestIndex}`},getBestSegmentDisplayFromData=segmentData=>{if(!segmentData||typeof segmentData!=`object`)return`N/A`;let time=segmentData.time||`N/A`,lap=segmentData.lap;return lap?`${time} in Lap ${lap}`:time};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$139,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$117,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Best Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$105,[createBaseVNode(`div`,_hoisted_4$85,[createBaseVNode(`div`,_hoisted_5$73,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Best Lap:`,-1),createBaseVNode(`span`,_hoisted_6$59,toDisplayString(getBestLapDisplay()),1)])]),__props.slowData.bestSegmentTimesFormatted&&Object.keys(__props.slowData.bestSegmentTimesFormatted).length>0?(openBlock(),createElementBlock(`div`,_hoisted_7$51,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.bestSegmentTimesFormatted,(segmentData,segment)=>(openBlock(),createElementBlock(`div`,{class:`data-item`,key:segment},[createBaseVNode(`span`,_hoisted_8$41,`Best Segment `+toDisplayString(parseInt(segment)+1)+`:`,1),createBaseVNode(`span`,_hoisted_9$38,toDisplayString(getBestSegmentDisplayFromData(segmentData)),1)]))),128))])):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},BestTimes_default=__plugin_vue_export_helper_default(_sfc_main$155,[[`__scopeId`,`data-v-3cd1750d`]]),_hoisted_1$138={class:`laptimes-section`},_hoisted_2$116={class:`collapse-icon`},_hoisted_3$104={class:`collapsible-content`},_hoisted_4$84={class:`table-header`},_hoisted_5$72={key:0},_hoisted_6$58={key:1},_hoisted_7$50={key:0,class:`table-row current-lap-row`},_sfc_main$154={__name:`LapTimes`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getDiffFlavorClass=flavor=>flavor?{"diff-better":flavor===`better`,"diff-worse":flavor===`worse`,"diff-same":flavor===`same`}:``;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$138,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$116,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Lap Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$104,[__props.slowData.lapTimes&&__props.slowData.lapTimes.length>0||__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`laptimes-table`,{"single-lap":__props.staticData.totalLaps<=1}])},[createBaseVNode(`div`,_hoisted_4$84,[_cache[1]||=createBaseVNode(`span`,null,`Lap`,-1),_cache[2]||=createBaseVNode(`span`,null,`Time`,-1),_cache[3]||=createBaseVNode(`span`,null,`Duration`,-1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_5$72,`Diff to Best`)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_6$58,`Diff to Prev`)):createCommentVNode(``,!0)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.lapTimes,lap=>(openBlock(),createElementBlock(`div`,{key:lap.lap,class:normalizeClass([`table-row`,{"best-lap":lap.lapFlavor===`best`,"current-lap":lap.isCurrent}])},[createBaseVNode(`span`,null,toDisplayString(lap.lap),1),createBaseVNode(`span`,null,toDisplayString(lap.timeFormatted||lap.endTimeFormatted||`N/A`),1),createBaseVNode(`span`,null,toDisplayString(lap.durationFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(lap.diffToBestFlavor))},toDisplayString(lap.diffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(lap.diffToPreviousFlavor))},toDisplayString(lap.diffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)],2))),128)),(__props.slowData.status===`started`||__props.slowData.status===`paused`)&&__props.fastData.currentLapTimeFormatted?(openBlock(),createElementBlock(`div`,_hoisted_7$50,[createBaseVNode(`span`,null,toDisplayString(__props.slowData.currentLap||1),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentTimeFormatted),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentLapTimeFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentLapDiffToBestFlavor))},toDisplayString(__props.fastData.currentLapDiffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentLapDiffToPreviousFlavor))},toDisplayString(__props.fastData.currentLapDiffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},LapTimes_default=__plugin_vue_export_helper_default(_sfc_main$154,[[`__scopeId`,`data-v-ed892fc5`]]),_hoisted_1$137={class:`laptimes-section`},_hoisted_2$115={class:`collapse-icon`},_hoisted_3$103={class:`collapsible-content`},_hoisted_4$83={class:`table-header`},_hoisted_5$71={key:0},_hoisted_6$57={key:1},_hoisted_7$49={key:0,class:`table-row current-segment-row`},_sfc_main$153={__name:`SegmentTimes`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getDiffFlavorClass=flavor=>flavor?{"diff-better":flavor===`better`,"diff-worse":flavor===`worse`,"diff-same":flavor===`same`}:``;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$137,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$115,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Segment Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$103,[__props.slowData.segmentTimes&&__props.slowData.segmentTimes.length>0||__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`laptimes-table`,{"single-lap":__props.staticData.totalLaps<=1}])},[createBaseVNode(`div`,_hoisted_4$83,[_cache[1]||=createBaseVNode(`span`,null,`Segment`,-1),_cache[2]||=createBaseVNode(`span`,null,`Time`,-1),_cache[3]||=createBaseVNode(`span`,null,`Duration`,-1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_5$71,`Diff to Best`)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_6$57,`Diff to Prev`)):createCommentVNode(``,!0)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.segmentTimes,segment=>(openBlock(),createElementBlock(`div`,{key:segment.segment,class:normalizeClass([`table-row`,{"best-segment":segment.segmentFlavor===`best`,"current-segment":segment.isCurrent}])},[createBaseVNode(`span`,null,toDisplayString(segment.segment),1),createBaseVNode(`span`,null,toDisplayString(segment.timeFormatted||segment.endTimeFormatted||`N/A`),1),createBaseVNode(`span`,null,toDisplayString(segment.durationFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(segment.diffToBestFlavor))},toDisplayString(segment.diffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(segment.diffToPreviousFlavor))},toDisplayString(segment.diffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)],2))),128)),(__props.slowData.status===`started`||__props.slowData.status===`paused`)&&__props.fastData.currentSegmentTimeFormatted?(openBlock(),createElementBlock(`div`,_hoisted_7$49,[createBaseVNode(`span`,null,toDisplayString(__props.slowData.currentLap||1)+`-`+toDisplayString(__props.slowData.currentSegment||1),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentTimeFormatted),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentSegmentTimeFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentSegmentDiffToBestFlavor))},toDisplayString(__props.fastData.currentSegmentDiffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentSegmentDiffToPreviousFlavor))},toDisplayString(__props.fastData.currentSegmentDiffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},SegmentTimes_default=__plugin_vue_export_helper_default(_sfc_main$153,[[`__scopeId`,`data-v-3801fbed`]]),_hoisted_1$136={key:0,class:`laptimes-section`},_hoisted_2$114={class:`collapse-icon`},_hoisted_3$102={class:`collapsible-content`},_hoisted_4$82={class:`laptimes-data-grid`,style:{"margin-bottom":`1rem`}},_hoisted_5$70={class:`data-item`},_hoisted_6$56={class:`value`},_hoisted_7$48={class:`data-item`},_hoisted_8$40={class:`value`},_hoisted_9$37={class:`laptimes-table`},_hoisted_10$31={class:`table-header`},_hoisted_11$28={key:0},_hoisted_12$22={key:1},_hoisted_13$19={key:0},_hoisted_14$19={key:1},_sfc_main$152={__name:`Placement`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0},placementData:{type:Object,required:!0}},setup(__props){let props=__props,isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},playerVehicleId=computed(()=>{if(props.placementData.vehicleStates){let vehicleIds=Object.keys(props.placementData.vehicleStates);return vehicleIds.length>0?parseInt(vehicleIds[0]):null}return null}),playerPlacement=computed(()=>!playerVehicleId.value||!props.placementData.placements?null:props.placementData.placements[playerVehicleId.value]),totalRacers=computed(()=>props.placementData.placements?Object.keys(props.placementData.placements).length:0),shouldShowLapColumn=computed(()=>{if(!props.staticData.pathConfig)return!1;let pathConfig=props.staticData.pathConfig;return pathConfig.isClosed&&pathConfig.lapCount>1}),shouldShowSegmentColumn=computed(()=>{if(!props.staticData.pathConfig)return!1;let pathConfig=props.staticData.pathConfig;return!pathConfig.isClosed||pathConfig.isClosed&&pathConfig.lapCount>1}),sortedRacers=computed(()=>{if(!props.placementData.placements||!props.placementData.vehicleStates)return[];let racers=[];return Object.entries(props.placementData.placements).forEach(([vehicleId,placement])=>{let vehicleIdNum=parseInt(vehicleId),vehicleState=props.placementData.vehicleStates[vehicleId],timeDiffData=props.placementData.timeDifferencesToFirst?.[vehicleId],timeDiff=timeDiffData?.timeDifference||0;racers.push({vehicleId:vehicleIdNum,placement,currentLap:vehicleState?.currentLap||0,currentSegment:vehicleState?.currentSegment||0,isPlayer:vehicleIdNum===playerVehicleId.value,timeDiff,timeDiffFormatted:timeDiffData?.timeDifferenceFormatted||`0.000`})}),racers.sort((a$1,b)=>a$1.placement-b.placement)}),getTimeDiffClass=timeDiff=>timeDiff==null?``:{"diff-red":timeDiff>0,"diff-green":timeDiff<0,"diff-neutral":timeDiff===0};return(_ctx,_cache)=>__props.placementData.placements&&Object.keys(__props.placementData.placements).length>1?(openBlock(),createElementBlock(`div`,_hoisted_1$136,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$114,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Race Positions `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$102,[createBaseVNode(`div`,_hoisted_4$82,[createBaseVNode(`div`,_hoisted_5$70,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Your Position:`,-1),createBaseVNode(`span`,_hoisted_6$56,toDisplayString(playerPlacement.value||`N/A`),1)]),createBaseVNode(`div`,_hoisted_7$48,[_cache[2]||=createBaseVNode(`span`,{class:`label`},`Total Racers:`,-1),createBaseVNode(`span`,_hoisted_8$40,toDisplayString(totalRacers.value),1)])]),createBaseVNode(`div`,_hoisted_9$37,[createBaseVNode(`div`,_hoisted_10$31,[_cache[3]||=createBaseVNode(`span`,null,`Pos`,-1),_cache[4]||=createBaseVNode(`span`,null,`Vehicle`,-1),shouldShowLapColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_11$28,`Lap`)):createCommentVNode(``,!0),shouldShowSegmentColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_12$22,`Segment`)):createCommentVNode(``,!0),_cache[5]||=createBaseVNode(`span`,null,`Time Diff`,-1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedRacers.value,(racer,index)=>(openBlock(),createElementBlock(`div`,{key:racer.vehicleId,class:normalizeClass([`table-row`,{"player-row":racer.isPlayer,"leader-row":index===0}])},[createBaseVNode(`span`,null,toDisplayString(racer.placement),1),createBaseVNode(`span`,null,toDisplayString(racer.vehicleId===playerVehicleId.value?`You`:`Vehicle ${racer.vehicleId}`),1),shouldShowLapColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_13$19,toDisplayString(racer.currentLap||0),1)):createCommentVNode(``,!0),shouldShowSegmentColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_14$19,toDisplayString(racer.currentSegment||0),1)):createCommentVNode(``,!0),createBaseVNode(`span`,{class:normalizeClass(getTimeDiffClass(racer.timeDiff))},toDisplayString(racer.timeDiffFormatted),3)],2))),128))])],512),[[vShow,!isCollapsed.value]])])):createCommentVNode(``,!0)}},Placement_default=__plugin_vue_export_helper_default(_sfc_main$152,[[`__scopeId`,`data-v-c2373a09`]]),_hoisted_1$135={class:`laptimes-section`},_hoisted_2$113={class:`collapse-icon`},_hoisted_3$101={class:`collapsible-content`},_hoisted_4$81={class:`raw-data-container`},_hoisted_5$69={key:0,class:`data-stream`},_hoisted_6$55={class:`data-content`},_hoisted_7$47={key:1,class:`data-stream`},_hoisted_8$39={class:`data-content`},_hoisted_9$36={key:2,class:`data-stream`},_hoisted_10$30={class:`data-content`},_hoisted_11$27={key:3,class:`data-stream`},_hoisted_12$21={class:`data-content`},_sfc_main$151={__name:`RawData`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0},placementData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!0),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$135,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$113,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Raw Stream Data `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$101,[createBaseVNode(`div`,_hoisted_4$81,[__props.fastData?(openBlock(),createElementBlock(`div`,_hoisted_5$69,[createBaseVNode(`h4`,null,`Fast Stream Data `+toDisplayString(__props.fastData.timestamp),1),createBaseVNode(`pre`,_hoisted_6$55,toDisplayString(JSON.stringify(__props.fastData,null,1)),1)])):createCommentVNode(``,!0),__props.slowData?(openBlock(),createElementBlock(`div`,_hoisted_7$47,[createBaseVNode(`h4`,null,`Slow Stream Data `+toDisplayString(__props.slowData.timestamp),1),createBaseVNode(`pre`,_hoisted_8$39,toDisplayString(JSON.stringify(__props.slowData,null,1)),1)])):createCommentVNode(``,!0),__props.staticData?(openBlock(),createElementBlock(`div`,_hoisted_9$36,[createBaseVNode(`h4`,null,`Static Stream Data `+toDisplayString(__props.staticData.timestamp),1),createBaseVNode(`pre`,_hoisted_10$30,toDisplayString(JSON.stringify(__props.staticData,null,1)),1)])):createCommentVNode(``,!0),__props.placementData?(openBlock(),createElementBlock(`div`,_hoisted_11$27,[createBaseVNode(`h4`,null,`Placement Stream Data `+toDisplayString(__props.placementData.timestamp),1),createBaseVNode(`pre`,_hoisted_12$21,toDisplayString(JSON.stringify(__props.placementData,null,1)),1)])):createCommentVNode(``,!0)])],512),[[vShow,!isCollapsed.value]])]))}},RawData_default=__plugin_vue_export_helper_default(_sfc_main$151,[[`__scopeId`,`data-v-7bc3ab60`]]),_hoisted_1$134={class:`laptimes-app`,style:{"overflow-y":`scroll`}},_sfc_main$150={__name:`appDebug`,setup(__props){useEvents();let fastData=ref({}),slowData=ref({}),staticData=ref({}),placementData=ref({});return onMounted(()=>{useStreams([`lapTimes_fast`,`lapTimes_slow`,`lapTimes_static`,`lapTimes_placement`],streams=>{streams.lapTimes_fast&&(fastData.value=streams.lapTimes_fast),streams.lapTimes_slow&&(slowData.value=streams.lapTimes_slow),streams.lapTimes_static&&(staticData.value=streams.lapTimes_static),streams.lapTimes_placement&&(placementData.value=streams.lapTimes_placement)})}),onUnmounted(()=>{}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$134,[_cache[0]||=createBaseVNode(`div`,{class:`laptimes-header`},[createBaseVNode(`h2`,null,`Lap Times Debug`)],-1),createVNode(BasicInfo_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(BestTimes_default,{slowData:slowData.value},null,8,[`slowData`]),createVNode(LapTimes_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(SegmentTimes_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(Placement_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value,placementData:placementData.value},null,8,[`fastData`,`slowData`,`staticData`,`placementData`]),createVNode(RawData_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value,placementData:placementData.value},null,8,[`fastData`,`slowData`,`staticData`,`placementData`])]))}},appDebug_default$1=__plugin_vue_export_helper_default(_sfc_main$150,[[`__scopeId`,`data-v-49102eaf`]]),_hoisted_1$133={class:`messages-app`},_hoisted_2$112={key:0,class:`icon-cell`},_hoisted_3$100={class:`text-cell`},_hoisted_4$80={key:0},timerIntervalMs=300,_sfc_main$149={__name:`app`,props:{maxMessages:{type:Number,default:void 0},dense:{type:Boolean,default:!1},wrap:{type:Boolean,default:!0},showIcons:{type:Boolean,default:!0}},setup(__props){let props=__props,events$3=useEvents(),messagesByCategory=reactive({}),bypassTtl=ref(!1),getIconProps=item=>{let icon=resolvedType(item.icon);if(icon)return{type:icon};let externalImage=resolvedExternalImage(item.icon);return externalImage?{externalImage}:{type:`info`}},timerId,isAssetPath=icon=>typeof icon==`string`&&icon.startsWith(`/`),resolvedType=icon=>typeof icon==`string`&&!isAssetPath(icon)?icon:void 0,resolvedExternalImage=icon=>typeof icon==`string`&&isAssetPath(icon)?icon:void 0,messagesList=computed(()=>{let list=Object.values(messagesByCategory);return typeof props.maxMessages==`number`&&props.maxMessages>0?list.slice(0,props.maxMessages):list});function resolveTranslation(val){return val==null?``:typeof val==`string`?$translate.instant(val):Array.isArray(val)?$translate.multiContextTranslate(val):typeof val==`object`?$translate.contextTranslate(val):String(val)}function htmlToPlainText(html){if(typeof html!=`string`)return String(html??``);let h$1=html.replace(//gi,` `),el=document.createElement(`div`);el.innerHTML=h$1;let text=el.textContent??el.innerText??h$1;return text=text.replace(/<[^>]*>/g,``),text}function sanitizeTextSegment(text){return text?htmlToPlainText(parse$1?parse$1(text):text):``}function getParts(item){let raw=resolveTranslation(item.text);if(typeof raw!=`string`)return[{t:`text`,v:sanitizeTextSegment(String(raw))}];let parts=[],rgx=/\[action=([^\]]+)\]/gi,lastIndex=0,match;for(;(match=rgx.exec(raw))!==null;){let head=raw.slice(lastIndex,match.index);head&&parts.push({t:`text`,v:sanitizeTextSegment(head)});let actionName=match[1].trim();parts.push({t:`binding`,action:actionName}),lastIndex=match.index+match[0].length}let tail=raw.slice(lastIndex);return tail&&parts.push({t:`text`,v:sanitizeTextSegment(tail)}),parts.length?parts:[{t:`text`,v:sanitizeTextSegment(raw)}]}function normalizePayload(args){let category=args?.category??`default`,clear=!!args?.clear,text=args&&`text`in args?args.text:args&&`msg`in args?args.msg:``,icon=typeof args?.icon==`string`?args.icon:void 0,ttlMs=typeof args?.ttlMs==`number`?args.ttlMs:typeof args?.ttl==`number`?args.ttl*1e3:void 0;return ttlMs??=5e3,{category,clear,text,icon,ttlMs}}let CATEGORY_ICONS=[{match:`vehicle.absBehavior`,icon:`ABSIndicator`},{match:`vehicle.brakingdistance`,icon:`carsFollow`},{prefix:`vehicle.compressionBrake.`,icon:`engine`},{prefix:`vehicle.damage.exhaust`,icon:`exhaustMuffler`},{prefix:`vehicle.damage.deflated.`,icon:`tireDeflated`},{prefix:`vehicle.beamstate.tireDeflated`,icon:`tireDeflated`},{match:`vehicle.damage.mildOverrev`,icon:`powerGauge05`},{match:`vehicle.damage.catastrophicOverrev`,icon:`powerGauge05`},{match:`vehicle.damage.catastrophicOverTorque`,icon:`cogDamaged`},{match:`vehicle.damage.flood`,icon:`water`},{match:`vehicle.engine.isStalling`,icon:`powerGauge01`},{match:`vehicle.ignition.ignitionLevel`,icon:`keys1`},{match:`vehicle.lightbar.mode`,icon:`wigwags`},{match:`vehicle.linelock.status`,icon:`wheelDisc`},{match:`vehicle.postCrashBrake.impact`,icon:`hazardLights`},{prefix:`vehicle.powertrain.diffmode.`,icon:`drivetrainGeneric`},{match:`vehicle.powertrain.nitrousOxideInjection`,icon:`N2OHoriz`},{match:`vehicle.shiftLogic.cannotShift`,icon:`cogsDamaged`},{match:`vehicle.shiftermode`,icon:`transmissionM`},{match:`vehicle.transbrake.status`,icon:`cogs`},{match:`vehicle.twoStep.status`,icon:`signal04a`},{match:`vehicle.tirePressureControl.inflateDeflate`,icon:`tirePressureGaugeOutlined03`},{prefix:`vehicle.wheels.tirePunctured.`,icon:`tireAirPuff`},{prefix:`vehicle.damage.device.`,icon:`cogDamaged`},{match:`vehicle.driveModes`,icon:`ESC`},{prefix:`vehicle.driveModes.`,icon:`ESC`},{match:`vehicle.engine.oilOverheating.true`,icon:`coolantTemp`},{match:`vehicle.engine.blockMelted.true`,icon:`coolantTemp`},{match:`vehicle.engine.headGasketDamaged.true`,icon:`coolantTemp`},{match:`vehicle.engine.coolantOverheating.true`,icon:`coolantTemp`},{match:`vehicle.engine.radiatorLeak.true`,icon:`coolantTemp`},{prefix:`vehicle.engine.`,icon:`engine`},{prefix:`vehicle.recovery.`,icon:`tow`},{match:`rally`,icon:`rallyHelmet`},{match:`fill`,icon:`import`},{match:`align`,icon:`flag`},{match:`delivery`,icon:`boxTruckFast`},{match:`refueling`,icon:`fuelPumpFilling`},{prefix:`refueling-`,icon:`fuelPumpFilling`},{prefix:`ui.camera.`,icon:`movieCamera`},{match:`input`,icon:`gamepad`},{prefix:`ui.apps.damage_app_vehicle_simple.component.`,icon:`cogsDamaged`},{match:`AI debug`,icon:`AIMicrochip`},{match:`debug`,icon:`code`},{match:`hydros`,icon:`steeringWheelCommon`},{match:`GLTFexport`,icon:`loadMesh`},{match:`bigmap.info.reachedTarget`,icon:`raceFlag`}];function deriveIconForCategory(category){if(!category)return`info`;console.debug(`[messages] deriveIconForCategory`,category);for(let{match,prefix:prefix$1,icon}of CATEGORY_ICONS){if(match&&category===match)return console.debug(` -> match:`,match,icon),icon;if(prefix$1&&category.startsWith(prefix$1))return console.debug(` -> prefix:`,prefix$1,icon),icon}return console.debug(` -> no match, fallback to info`),`info`}function onMessage(args){let{category,clear,text,icon,ttlMs}=normalizePayload(args),matched=[];try{let re=new RegExp(category);matched=Object.keys(messagesByCategory).filter(k=>re.test(k))}catch{}matched.length===0&&(matched=[category]);for(let cat of matched){if(clear||typeof text==`string`&&text===``){delete messagesByCategory[cat];continue}let offset$2=Object.keys(messagesByCategory).length*timerIntervalMs*2;messagesByCategory[cat]={_key:cat,text,icon:icon||deriveIconForCategory(cat),ttl:ttlMs+offset$2}}}function onClearAll(){for(let k in messagesByCategory)delete messagesByCategory[k]}function tick(){for(let k in messagesByCategory){let m=messagesByCategory[k];bypassTtl.value||(m.ttl-=timerIntervalMs),m.ttl<=0&&delete messagesByCategory[k]}}return onMounted(()=>{events$3.on(`Message`,onMessage),events$3.on(`ClearAllMessages`,onClearAll),events$3.on(`MessagesDebug`,data=>{data&&typeof data.bypassTtl==`boolean`&&(bypassTtl.value=!!data.bypassTtl)}),timerId=window.setInterval(tick,timerIntervalMs)}),onUnmounted(()=>{timerId&&window.clearInterval(timerId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$133,[(openBlock(!0),createElementBlock(Fragment,null,renderList(messagesList.value,item=>(openBlock(),createElementBlock(`div`,{key:item._key,class:`message-row`},[__props.showIcons&&item.icon?(openBlock(),createElementBlock(`div`,_hoisted_2$112,[createVNode(unref(bngIcon_default),mergeProps({class:`msg-icon`,fallbackType:`info`},{ref_for:!0},getIconProps(item)),null,16)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$100,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getParts(item),(part,i)=>(openBlock(),createElementBlock(Fragment,{key:i},[part.t===`text`?(openBlock(),createElementBlock(`span`,_hoisted_4$80,toDisplayString(part.v),1)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:part.action,"show-unassigned":``},null,8,[`action`]))],64))),128))])]))),128))]))}},app_default$32=__plugin_vue_export_helper_default(_sfc_main$149,[[`__scopeId`,`data-v-ddfd9832`]]),apps_exports=__export({advancedWheelsDebug:()=>app_default$2,brakeTorqueGraph:()=>app_default$3,busLine:()=>app_default$4,cameraDistance:()=>app_default$5,clutchThermalDebug:()=>app_default$6,compass:()=>app_default$7,compassPrecise:()=>app_default$8,countdown:()=>countdownApp_default,crashTestNextStep:()=>app_default$15,damageApp:()=>app_default$9,dragRace:()=>app_default$10,dragRaceStage:()=>app_default$12,dragRaceTree:()=>app_default$11,driftCurrentDrift:()=>app_default$13,driftScores:()=>app_default$14,engineDebug:()=>app_default$16,engineDynamometer:()=>app_default$17,engineHeatDebugGraph:()=>app_default$18,engineThermalDebug:()=>app_default$19,forcedInduction:()=>app_default$20,forcedInductionDebug:()=>app_default$21,gameplayApps:()=>gameplayApps_default,genericMissionData:()=>bngGenericMissionData_default,hydraulicsDebug:()=>app_default$22,inputHints:()=>app_default$29,keyList:()=>app_default$23,lapTimes:()=>app_default$31,lapTimesDebug:()=>appDebug_default$1,logvehiclestats:()=>app_default$24,messages:()=>app_default$32,messagesTasksApps:()=>messagesTasksApps_default,navigation:()=>app_default$30,pointsBar:()=>app_default,rallyCountdown:()=>appCountdown_default,rallyDashboard:()=>appDashboard_default,rallyDebug:()=>appDebug_default,rallyStageProgress:()=>appStageProgress_default,rallyStageTiming:()=>appStageTiming_default,rallyTimecard:()=>appTimecard_default,rallyVisualPacenotes:()=>app_default$28,replayAppV2:()=>app_default$1,simpleDigTacho:()=>app_default$25,simpleFlashMessage:()=>flashMessageApp_default,tacho2:()=>app_default$26,tasklist:()=>app_default$27});const useTuningStore=defineStore(`tuning`,()=>{let{lua,events:events$3}=useBridge(),buckets=ref({}),tuningVariables=ref({}),editedTuningVars={},isCareer=!1,shoppingData=ref({}),noapi=()=>{throw Error(`Tuning store must be initialised first`)},api$1={request:noapi,apply:noapi,reset:noapi,close:()=>{},menuClose:()=>{}};async function init$3(){for(let name in editedTuningVars={},isCareer=await lua.career_career.isActive(),isCareer?(api$1.request=async()=>processTuningData(await lua.career_modules_tuning.getTuningData()),api$1.apply=(values,edited)=>{let res={};for(let[varName,_]of Object.entries(edited))res[varName]=valDisToVal(values[varName]);lua.career_modules_tuning.apply(res)},api$1.reset=()=>{},api$1.close=()=>{events$3.off(`sendTuningShoppingData`,setShoppingData),events$3.off(`updateTuningVariable`,updateTuningVariable),shoppingData.value={}},events$3.on(`sendTuningShoppingData`,setShoppingData),events$3.on(`updateTuningVariable`,updateTuningVariable)):(api$1.request=async()=>await lua.extensions.core_vehicle_partmgmt.sendDataToUI(),api$1.apply=(values,edited)=>{let res={};for(let varName in values)res[varName]=valDisToVal(values[varName]);lua.extensions.core_vehicle_partmgmt.setConfigVars(res)},api$1.reset=async()=>await lua.extensions.core_vehicle_partmgmt.resetVarsToLoadedConfig(),api$1.close=()=>{events$3.off(`VehicleFocusChanged`,api$1.request),events$3.off(`VehicleConfigChange`,processTuningData)},api$1.menuClose=api$1.close,events$3.on(`VehicleFocusChanged`,api$1.request),events$3.on(`VehicleConfigChange`,processTuningData)),api$1)api$1[name]===noapi&&(api$1[name]=()=>{})}function apply$1(){api$1.apply(tuningVariables.value,editedTuningVars),editedTuningVars={}}function setShoppingData(data){shoppingData.value=data}function updateTuningVariable(tuningVar){tuningVariables.value[tuningVar.name].valDis=Number(valToValDis(tuningVar))}let processTuningData=data=>{data.variables&&(data=data.variables),isCareer&&(delete data.$fuel,delete data.$fuel_R,delete data.$fuel_L),buckets.value=[],tuningVariables.value={};for(let varData of Object.values(data)){if(isCareer&&varData.category===`Cargo`||varData.hideInUI)continue;varData.category||=`Other`,varData.subCategory||=`Other`;let cat=(buckets.value.find(cat$1=>cat$1.name===varData.category)||buckets.value[buckets.value.push({name:varData.category,items:[]})-1]).items;(cat.find(sub=>sub.name===varData.subCategory)||cat[cat.push({name:varData.subCategory,items:[]})-1]).items.push(varData),tuningVariables.value[varData.name]={valDis:Number(valToValDis(varData)),minDis:varData.minDis,maxDis:varData.maxDis,min:varData.min,max:varData.max,default:Number(valToValDis(varData,!0))}}let sorter=(a$1,b)=>a$1.name.localeCompare(b.name);buckets.value.sort(sorter);for(let cat of buckets.value){cat.items.sort(sorter);for(let sub of cat.items)sub.items.sort(sorter)}};function countDecimals(num){return typeof num!=`number`||~~num===num?0:num.toString().split(`.`)[1].length||0}function valToValDis(varData,useDef=!1){return roundDec(round(((useDef?varData.default:varData.val)-varData.min)/(varData.max-varData.min)*(varData.maxDis-varData.minDis),varData.stepDis)+varData.minDis,countDecimals(varData.stepDis))}function valDisToVal(varData){return(varData.valDis-varData.minDis)/(varData.maxDis-varData.minDis)*(varData.max-varData.min)+varData.min}function tuningVarChanged(varName){editedTuningVars[varName]=!0}return{init:init$3,buckets,tuningVariables,shoppingData,apply:apply$1,requestInitialData:()=>api$1.request(),close:()=>api$1.close(),notifyOnMenuClosed:()=>api$1.menuClose(),tuningVarChanged,resetTuningData:()=>api$1.reset()}});var _hoisted_1$132={key:0,class:`tuning-form`},_hoisted_2$111={key:0,class:`extra-features`},_hoisted_3$99={class:`category-heading`},_hoisted_4$79={class:`category-name`},_hoisted_5$68={key:0,class:`subcategory-heading`},_hoisted_6$54={class:`subcategory-name`},_hoisted_7$46={class:`variable-title`},_hoisted_8$38={class:`variable-box`},_hoisted_9$35={class:`tuning-static`},_hoisted_10$29={class:`buttons`},_sfc_main$148={__name:`Tuning`,props:{withBackground:Boolean,buttonTarget:{type:Object},closeButton:Boolean},setup(__props,{expose:__expose}){useUINavBlocker().blockOnly([`context`]);let{lua}=useBridge(),tuningStore=useTuningStore(),awdApp=ref(),awdShow=ref(!1),apply$1=()=>{tuningStore.apply()},close=()=>{tuningStore.close()},mirrorsShown=ref(!0),mirrorsEnabled=ref(!1),mirrorsRoute=`menu.vehicleconfig.tuning.mirrors`,toMirrors=()=>{window.bngVue.gotoGameState(mirrorsRoute)},inputs=ref([]),isChanged=computed(()=>inputs.value.some(ipt=>ipt.dirty));__expose({apply:apply$1,close});let autoApply=ref(!1),applyDebounce=debounce(apply$1,1e3);function onChange(varName){tuningStore.tuningVarChanged(varName),autoApply.value&&applyDebounce()}let applySettingChanged=val=>localStorage.setItem(`applyTuningChangesAutomatically`,JSON.stringify(val));watch(()=>tuningStore.buckets,()=>nextTick(()=>{for(let ipt of inputs.value)ipt.markClean()}));async function resetVarsToLoadedConfig(){tuningStore.resetTuningData(),await tuningStore.requestInitialData(),await nextTick();for(let ipt of inputs.value)ipt.markClean()}onBeforeMount(async()=>{let optAutoApply=localStorage.getItem(`applyTuningChangesAutomatically`);if(optAutoApply)try{autoApply.value=!!JSON.parse(optAutoApply)}catch{}await lua.extensions.gameplay_garageMode.isActive()&&(mirrorsRoute=`menu.vehicleconfig.tuning.mirrors.in-garage`),await lua.career_career.isActive()?mirrorsShown.value=!1:mirrorsEnabled.value=(await useSettingsAsync()).values.GraphicDynMirrorsEnabled,await tuningStore.init(),await tuningStore.requestInitialData(),getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar)});let extraFeatures=computed(()=>{let features=[];return mirrorsEnabled.value&&features.push({mirrorsEnabled:!0}),features});return onUnmounted(async()=>{await tuningStore.notifyOnMenuClosed(),tuningStore.close(),tuningStore.$dispose(),getUINavServiceInstance().clearFilteredEvents()}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({innerTuningCard:!0,"with-background":__props.withBackground})},[unref(tuningStore).buckets?(openBlock(),createElementBlock(`div`,_hoisted_1$132,[extraFeatures.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$111,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:toMirrors,accent:`secondary`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.mirrors.name`)),1)]),_:1})),[[unref(BngDisabled_default),!extraFeatures.value.find(f=>f.mirrorsEnabled)]])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(tuningStore).buckets,category=>(openBlock(),createElementBlock(`div`,{class:`tuning-category`,key:category.name},[createBaseVNode(`h2`,_hoisted_3$99,[createBaseVNode(`span`,_hoisted_4$79,toDisplayString(category.name),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(category.items,subCategory=>(openBlock(),createElementBlock(`div`,{class:`tuning-subcategory`,key:subCategory.name},[subCategory.name===`Other`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`h3`,_hoisted_5$68,[createBaseVNode(`span`,_hoisted_6$54,toDisplayString(subCategory.name),1)])),(openBlock(!0),createElementBlock(Fragment,null,renderList(subCategory.items,varData=>withDirectives((openBlock(),createElementBlock(`div`,{key:category.name+subCategory.name+varData.name,class:normalizeClass({"input-container":!0,"variable-box":varData.type===`slider`})},[createBaseVNode(`div`,_hoisted_7$46,toDisplayString(varData.title),1),createBaseVNode(`div`,_hoisted_8$38,[createVNode(unref(bngSlider_default),{ref_for:!0,ref_key:`inputs`,ref:inputs,min:varData.minDis,max:varData.maxDis,step:varData.stepDis,unit:varData.unit,class:normalizeClass({"property-slider":!0}),"with-input":``,"with-reset":``,"orig-value":unref(tuningStore).tuningVariables[varData.name].default,modelValue:unref(tuningStore).tuningVariables[varData.name].valDis,"onUpdate:modelValue":$event=>unref(tuningStore).tuningVariables[varData.name].valDis=$event,onValueChanged:$event=>onChange(varData.name)},null,8,[`min`,`max`,`step`,`unit`,`orig-value`,`modelValue`,`onUpdate:modelValue`,`onValueChanged`])])],2)),[[unref(BngTooltip_default),varData.description,`top`]])),128))]))),128))]))),128))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_9$35,[withDirectives(createVNode(unref(app_default$2),{class:normalizeClass({"awd-app":awdApp.value}),ref_key:`awdApp`,ref:awdApp},null,8,[`class`]),[[vShow,awdShow.value]]),awdApp.value&&awdApp.value.hasData?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,modelValue:awdShow.value,"onUpdate:modelValue":_cache[0]||=$event=>awdShow.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tune.advWheel`)),1)]),_:1},8,[`modelValue`])):createCommentVNode(``,!0),createVNode(unref(bngSwitch_default),{modelValue:autoApply.value,"onUpdate:modelValue":_cache[1]||=$event=>autoApply.value=$event,onValueChanged:applySettingChanged},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.liveUpdates`)),1)]),_:1},8,[`modelValue`]),createBaseVNode(`div`,_hoisted_10$29,[withDirectives(createVNode(unref(bngButton_default),{"show-hold":``,icon:unref(icons).undo,accent:unref(ACCENTS).custom,class:`reset-button`},null,8,[`icon`,`accent`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:resetVarsToLoadedConfig,holdDelay:1e3,repeatInterval:0}],[unref(BngTooltip_default),`Reset to original config`]]),createVNode(unref(bngButton_default),{disabled:autoApply.value||!isChanged.value,onClick:apply$1},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.common.apply`)),1)]),_:1},8,[`disabled`]),__props.closeButton?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:close,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),createTextVNode(toDisplayString(_ctx.$t(`ui.common.close`)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0)])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Tuning_default=__plugin_vue_export_helper_default(_sfc_main$148,[[`__scopeId`,`data-v-907bf291`]]),CANCEL_MESSAGE=`Are you sure you want to cancel?
All changes to your vehicle will be reversed`,_sfc_main$147={__name:`TuningMain`,setup(__props){useComputerStore();let tuningStore=useTuningStore(),CONFIRM_BUTTONS=[{label:$translate.instant(`ui.common.yes`),value:!0},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}],confirmCancel=async()=>{(!(tuningStore.shoppingData.shoppingCart&&tuningStore.shoppingData.shoppingCart.items.length)||await openConfirmation(null,CANCEL_MESSAGE,CONFIRM_BUTTONS))&&cancelShopping()},cartData=computed(()=>{let cart=tuningStore.shoppingData?tuningStore.shoppingData.shoppingCart:null,res={total:0,taxes:0,items:[]};return cart&&(res.total=cart.total,res.taxes=cart.taxes,Array.isArray(cart.items)&&(res.items=cart.items.map(item=>({type:item.type||item.level===1&&`item`,level:item.level,name:item.title,price:item.price,priceHide:!item.price,removeShow:!!item.varName,remove:()=>Lua_default.career_modules_tuning.removeVarFromShoppingCart(item.varName)})))),res}),elCard=ref(),applyShopping=()=>Lua_default.career_modules_tuning.applyShopping(),cancelShopping=()=>Lua_default.career_modules_tuning.cancelShopping();return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Tuning`],title:`Tuning`,back:``,onBack:confirmCancel},{side:withCtx(()=>[createVNode(ShoppingCart_default,{"cart-data":cartData.value,"player-money":unref(tuningStore).shoppingData.playerMoney,"confirm-button-text":`Confirm`,apply:applyShopping,cancel:confirmCancel},null,8,[`cart-data`,`player-money`])]),default:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`tuningCard`,ref_key:`elCard`,ref:elCard},{buttons:withCtx(()=>[..._cache[0]||=[]]),default:withCtx(()=>[createVNode(Tuning_default,{"button-target":elCard.value&&elCard.value.buttonsContainer,"close-button":!1},null,8,[`button-target`])]),_:1})),[[unref(BngBlur_default),1]])]),_:1}))}},TuningMain_default=__plugin_vue_export_helper_default(_sfc_main$147,[[`__scopeId`,`data-v-60311783`]]);const useVehicleInventoryStore=defineStore(`vehicleInventory`,()=>{let{events:events$3}=useBridge(),vehicleInventoryData=ref({}),vehIdToChooseAfterRepairPopup=ref(0),filteredVehicles=computed(()=>{let data=vehicleInventoryData.value;return data.vehicles?Object.values(data.vehicles):[]}),menuOpen=!1;function requestInitialData(){Lua_default.career_modules_inventory.sendDataToUi()}function closeMenu(){Lua_default.career_modules_inventory.closeMenu()}let getExpediteRepairCost=vehicle=>Math.max(vehicle.quickRepairExtraPrice*(vehicle.timeToAccess/vehicle.initialRepairTime),50);function countDownVehicleDelays(){if(menuOpen){for(let vehicle of filteredVehicles.value)vehicle.timeToAccess&&(--vehicle.timeToAccess,vehicle.delayReason==`repair`&&(vehicle.expediteRepairCost=getExpediteRepairCost(vehicle)),vehicle.timeToAccess<=0&&Lua_default.career_modules_inventory.sendDataToUi());setTimeout(countDownVehicleDelays,1e3)}}events$3.on(`vehicleInventoryData`,data=>{Object.values(data.vehicles).forEach(vehicle=>{data.currentVehicleId===vehicle.id&&(vehicle.niceName+=` (Current Vehicle)`),vehicle.owned||(vehicle.niceName+=` (Not owned)`)}),vehicleInventoryData.value=data,vehIdToChooseAfterRepairPopup.value=0,menuOpen||(menuOpen=!0,countDownVehicleDelays())});function menuClosed(){menuOpen=!1}function repairPopupAccept(){Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehIdToChooseAfterRepairPopup.value,1,!0),vehIdToChooseAfterRepairPopup.value=0}function repairPopupDecline(){Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehIdToChooseAfterRepairPopup.value,1,!1),vehIdToChooseAfterRepairPopup.value=0}function chooseVehicle(vehId,buttonIndex){let showRepairPopup=!1,data=vehicleInventoryData.value;if(data.currentVehicleId!==void 0&&vehId!==data.currentVehicleId&&(showRepairPopup=data.vehicles[data.currentVehicleId].needsRepair),showRepairPopup){vehIdToChooseAfterRepairPopup.value=vehId;return}Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehId,buttonIndex+1,!1)}function dispose$2(){events$3.off(`vehicleInventoryData`)}return{filteredVehicles,vehIdToChooseAfterRepairPopup,vehicleInventoryData,requestInitialData,chooseVehicle,repairPopupAccept,repairPopupDecline,menuClosed,closeMenu,dispose:dispose$2}});var _hoisted_1$131={class:`list-vehicle-dialog`},_hoisted_2$110={class:`vehicle-info`},_hoisted_3$98={class:`name`},_hoisted_4$78={key:0,class:`meta`},_hoisted_5$67={key:1,class:`meta`},_hoisted_6$53={class:`price-box`},_hoisted_7$45={class:`price-content`},_hoisted_8$37={class:`price-row`},_hoisted_9$34={class:`step-buttons-group`},_hoisted_10$28={class:`price`},_hoisted_11$26={class:`step-buttons-group`},_sfc_main$146={__name:`ListVehicleDialog`,props:{modelValue:{type:Object,required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,{units}=useBridge(),formModel=computed({get:()=>props.modelValue,set:newValue=>emit$1(`update:modelValue`,newValue)});function adjustPrice(amount){let price=Math.max(0,Math.round(((formModel.value.price||0)+amount)/50)*50);emit$1(`update:modelValue`,{...formModel.value,price})}let priceHint=computed(()=>{let mv=Number(formModel.value.marketValue||0),p$1=Number(formModel.value.price||0);if(!mv||!p$1)return{text:``,class:``};let diff=(p$1-mv)/mv,percent=Math.round(Math.abs(diff)*100);return percent<1?{text:`Fair market value`,class:`ok`}:diff>0?{text:`${percent}% above market value`,class:`high`}:{text:`${percent}% below market value`,class:`low`}}),offerHint=computed(()=>{let mv=Number(formModel.value.marketValue||0),p$1=Number(formModel.value.price||0);if(!mv||!p$1)return{text:`Regular offers expected`,class:`regular`};let ratio=p$1/mv;return ratio<=.9?{text:`More offers expected`,class:`more`}:ratio>=1.2?{text:`Fewer offers expected`,class:`fewer`}:{text:`Regular offers expected`,class:`regular`}}),formModelText=computed(()=>formModel.value.odometerKm?new Intl.NumberFormat().format(Math.round(formModel.value.odometerKm))+` km`:``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$131,[createBaseVNode(`div`,_hoisted_2$110,[createBaseVNode(`div`,_hoisted_3$98,toDisplayString(formModel.value.vehicleName),1),formModelText.value?(openBlock(),createElementBlock(`div`,_hoisted_4$78,toDisplayString(formModelText.value)+` — Market Value: `+toDisplayString(unref(units).beamBucks(formModel.value.marketValue||0)),1)):(openBlock(),createElementBlock(`div`,_hoisted_5$67,` Market Value: `+toDisplayString(unref(units).beamBucks(formModel.value.marketValue||0)),1))]),createBaseVNode(`div`,_hoisted_6$53,[createBaseVNode(`div`,_hoisted_7$45,[_cache[12]||=createBaseVNode(`div`,{class:`label`},`Your Asking Price`,-1),createBaseVNode(`div`,_hoisted_8$37,[createBaseVNode(`div`,_hoisted_9$34,[createVNode(unref(bngButton_default),{class:`step step-large`,accent:unref(ACCENTS).secondary,onClick:_cache[0]||=$event=>adjustPrice(-5e3)},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`-5000`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-medium`,accent:unref(ACCENTS).secondary,onClick:_cache[1]||=$event=>adjustPrice(-500)},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(`-500`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step`,accent:unref(ACCENTS).secondary,onClick:_cache[2]||=$event=>adjustPrice(-50)},{default:withCtx(()=>[..._cache[8]||=[createTextVNode(`-50`,-1)]]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_10$28,toDisplayString(unref(units).beamBucks(formModel.value.price||0)),1),createBaseVNode(`div`,_hoisted_11$26,[createVNode(unref(bngButton_default),{class:`step`,accent:unref(ACCENTS).secondary,onClick:_cache[3]||=$event=>adjustPrice(50)},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(`+50`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-medium`,accent:unref(ACCENTS).secondary,onClick:_cache[4]||=$event=>adjustPrice(500)},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`+500`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-large`,accent:unref(ACCENTS).secondary,onClick:_cache[5]||=$event=>adjustPrice(5e3)},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`+5000`,-1)]]),_:1},8,[`accent`])])]),createBaseVNode(`div`,{class:normalizeClass([`hint`,[priceHint.value.class]])},toDisplayString(priceHint.value.text),3),createBaseVNode(`div`,{class:normalizeClass([`offer-hint`,[offerHint.value.class]])},toDisplayString(offerHint.value.text),3)])])]))}},ListVehicleDialog_default=__plugin_vue_export_helper_default(_sfc_main$146,[[`__scopeId`,`data-v-87a25af5`]]),_hoisted_1$130={class:`vehicle-list-container`},_sfc_main$145={__name:`VehicleList`,setup(__props){let{units}=useBridge(),{$game}=useLibStore(),popover=usePopover(),popId=uniqueId(`veh_options`),popHide=()=>popover.hide(popId),licensePlateTextValid=ref(!0),vehicleNameValid=ref(!0),vehicleInventoryStore=useVehicleInventoryStore(),selectedVehId=ref(),vehSelected=computed(()=>{if(typeof selectedVehId.value==`number`)return listView.value.find(v=>v.id===selectedVehId.value)}),careerStatusData=ref({}),updateCareerStatusData=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(data=>careerStatusData.value=data),cantPayLicensePlate=computed(()=>!careerStatusData.value.money||300>careerStatusData.value.money),listStatus=computed(()=>vehicleInventoryStore?!Array.isArray(vehicleInventoryStore.filteredVehicles)||vehicleInventoryStore.filteredVehicles.length===0?`You don't currently own any vehicles`:null:`Please wait...`),listView=computed(()=>{if(!vehicleInventoryStore||!Array.isArray(vehicleInventoryStore.filteredVehicles)||vehicleInventoryStore.filteredVehicles.length===0)return[];let res=vehicleInventoryStore.filteredVehicles;if(singleFunction.value)for(let veh of res)veh.disabled=!isFunctionAvailable(veh,singleFunction.value);return res.sort((a$1,b)=>a$1.favorite?-1:b.favorite?1:a$1.niceName.localeCompare(b.niceName)),res}),itemLayout=ref({TILE:`tile`,LIST:`row`}.TILE),singleFunction=computed(()=>{if(!vehicleInventoryStore||!vehicleInventoryStore.vehicleInventoryData)return null;let data=vehicleInventoryStore.vehicleInventoryData;return Object.values(data.buttonsActive).includes(!0)||!Array.isArray(data.chooseButtonsData)||data.chooseButtonsData.length!==1?null:data.chooseButtonsData[0]});function select(vehicle,evt){let show=vehicleInventoryStore&&vehicleInventoryStore.vehicleInventoryData&&(Object.values(vehicleInventoryStore.vehicleInventoryData.buttonsActive).includes(!0)||vehicleInventoryStore.vehicleInventoryData.chooseButtonsData.length>0)&&vehicle&&(!vehSelected.value||vehSelected.value.id!==vehicle.id),popover$1;if(evt&&evt.target){let cur=evt.target;for(;popover$1=cur.__popover,!(popover$1||(cur=cur.parentNode,cur===document.body)););}if(vehicle&&singleFunction.value){selectedVehId.value=null,popover$1&&popover$1.hide(),vehicleInventoryStore.chooseVehicle(vehicle.id,0);return}show&&popover$1&&popover$1.hide(),nextTick(()=>{show?(selectedVehId.value=vehicle.id,popover$1&&popover$1.show()):(popover$1&&popover$1.hide(),selectedVehId.value=null)})}let isFunctionAvailable=(vehicle,buttonData)=>!(vehicle.timeToAccess||vehicle.missingFile||buttonData.requiredVehicleNotInGarage&&vehicle.inGarage||buttonData.requiredOtherVehicleInGarage&&!vehicle.otherVehicleInGarage||buttonData.ownedRequired&&!vehicle.owned||buttonData.repairRequired&&vehicle.needsRepair||buttonData.notForSaleRequired&&vehicle.listedForSale),lookAtVehicleListing=()=>{Lua_default.career_modules_marketplace.openMenu(vehicleInventoryStore.vehicleInventoryData.originComputerId)},confirmReturnVehicle=async()=>{let vehicle=vehSelected.value;popHide(),await openConfirmation(``,`Do you want to return this loaned vehicle to the owner?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&Lua_default.career_modules_inventory.returnLoanedVehicleFromInventory(vehicle.id)},personalizeLicensePlate=async()=>{let vehicle=vehSelected.value;popHide(),updateCareerStatusData();let res=await openPrompt(`Enter your new license plate text:`,`Personalize License Plate`,{maxLength:10,defaultValue:vehicle.config.licenseName,buttons:[{label:$translate.instant(`ui.common.cancel`),value:!1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.okay`)+` (Cost: ${units.beamBucks(300)})`,value:text=>text,extras:{disabled:cantPayLicensePlate,accent:ACCENTS.primary}}],validate:text=>(Lua_default.career_modules_inventory.isLicensePlateValid(text).then(valid=>{licensePlateTextValid.value=valid}),licensePlateTextValid.value),errorMessage:`Invalid character in license plate text`,disableWhenInvalid:!0});res!=0&&(Lua_default.career_modules_inventory.purchaseLicensePlateText(vehicle.id,res,300),vehicle.config.licenseName=res)},confirmExpediteRepair=async()=>{let vehicle=vehSelected.value;popHide();let price=vehicle.expediteRepairCost;await openConfirmation(``,`Do you want to expedite the repair for ${units.beamBucks(price)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&Lua_default.career_modules_inventory.expediteRepairFromInventory(vehicle.id,price)},openRepairMenu=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_insurance_repairScreen.openRepairMenu(vehicle,vehicleInventoryStore.vehicleInventoryData.originComputerId)},setFavoriteVehicle=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_inventory.setFavoriteVehicle(vehicle.id),Lua_default.career_modules_inventory.sendDataToUi()},storeVehicle=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_inventory.removeVehicleObject(vehicle.id),Lua_default.career_modules_inventory.sendDataToUi()},renameVehicle=async()=>{let vehicle=vehSelected.value;popHide();let res=await openPrompt(`Enter new vehicle name:`,`Rename Vehicle`,{maxLength:30,defaultValue:vehicle.niceName,buttons:[{label:$translate.instant(`ui.common.cancel`),value:!1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.okay`),value:text=>text,extras:{accent:ACCENTS.primary}}],validate:text=>(Lua_default.career_modules_inventory.isVehicleNameValid(text).then(valid=>{vehicleNameValid.value=valid}),vehicleNameValid.value),errorMessage:`Invalid characters in vehicle name`,disableWhenInvalid:!0});res!=0&&(Lua_default.career_modules_inventory.renameVehicle(vehicle.id,res),vehicle.niceName=res)},listVehicleForSale=async vehicle=>{popHide();let res=await openFormDialog(ListVehicleDialog_default,{vehicleName:vehicle.niceName,odometer:vehicle.odometer,marketValue:vehicle.value,price:Math.max(50,Math.round((vehicle.value||0)/50)*50)},model=>!Number.isFinite(model.price)||model.price<=0?{error:!0,message:`Enter a valid positive price`}:{error:!1},`List a Vehicle for Sale`,void 0,void 0,`90rem`);!res||!res.value||await Lua_default.career_modules_marketplace.listVehicles([{inventoryId:vehicle.id,value:res.formData.price}])},listVehicleForSaleFromContextMenu=async()=>{let vehicle=vehSelected.value;await listVehicleForSale(vehicle),Lua_default.career_modules_marketplace.openMenu(vehicleInventoryStore.vehicleInventoryData.originComputerId)},listVehicleForSaleFromMarketplaceMenu=async vehicle=>{await listVehicleForSale(vehicle),router_default.back()};return $game.events.on(`addListing`,data=>{listVehicleForSaleFromMarketplaceMenu(listView.value.find(v=>v.id===data.inventoryId))}),onUnmounted(()=>{$game.events.off(`addListing`)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$130,[listStatus.value?withDirectives((openBlock(),createBlock(VehicleTileRow_default,{key:0,class:`vehicle-list-item`,data:{_message:listStatus.value},layout:itemLayout.value},null,8,[`data`,`layout`])),[[unref(BngDisabled_default)]]):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(listView.value,vehicle=>withDirectives((openBlock(),createBlock(VehicleTileRow_default,{class:`vehicle-list-item`,key:vehicle.id,data:vehicle,layout:itemLayout.value,selected:vehSelected.value&&vehSelected.value.id===vehicle.id,"is-tutorial":unref(vehicleInventoryStore)&&unref(vehicleInventoryStore).vehicleInventoryData.tutorialActive,money:unref(vehicleInventoryStore)?unref(vehicleInventoryStore).vehicleInventoryData.playerMoney:0,tabindex:`0`,"bng-nav-item":``,onClick:$event=>!vehicle.disabled&&select(vehicle,$event)},null,8,[`data`,`layout`,`selected`,`is-tutorial`,`money`,`onClick`])),[[unref(BngDisabled_default),vehicle.disabled],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngPopover_default),unref(popId),`right-start`,{click:!0}]])),128)),createVNode(unref(bngPopoverMenu_default),{name:unref(popId),focus:``,onHide:_cache[9]||=$event=>selectedVehId.value=null},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleInventoryStore).vehicleInventoryData.chooseButtonsData,(buttonData,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[buttonData.repairRequired&&vehSelected.value&&vehSelected.value.needsRepair&&!unref(vehicleInventoryStore).vehicleInventoryData.tutorialActive?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,disabled:``},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonData.buttonText)+` (Needs repair) `,1)]),_:2},1032,[`accent`])):vehSelected.value&&isFunctionAvailable(vehSelected.value,buttonData)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).menu,onClick:$event=>unref(vehicleInventoryStore).chooseVehicle(vehSelected.value.id,index)},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonData.buttonText),1)]),_:2},1032,[`accent`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)],64))),128)),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.returnLoanerEnabled&&vehSelected.value.returnLoanerPermission.allow?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,onClick:_cache[0]||=$event=>confirmReturnVehicle()},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Return loaned vehicle `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&vehSelected.value.delayReason===`repair`?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).menu,disabled:vehSelected.value.expediteRepairCost>unref(vehicleInventoryStore).vehicleInventoryData.playerMoney,onClick:_cache[1]||=$event=>confirmExpediteRepair(vehSelected.value)},{default:withCtx(()=>[_cache[11]||=createTextVNode(` Expedite Repair `,-1),createVNode(unref(bngUnit_default),{money:vehSelected.value.expediteRepairCost},null,8,[`money`])]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&vehSelected.value.delayReason!==`repair`&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.repairEnabled?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.repairPermission.allow,onClick:_cache[2]||=$event=>openRepairMenu()},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` Repair `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.storingEnabled&&!vehSelected.value.inStorage?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.storePermission.allow,onClick:_cache[3]||=$event=>storeVehicle()},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Put in storage `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.favoriteEnabled?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:4,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.favoritePermission.allow||vehSelected.value.favorite,onClick:_cache[4]||=$event=>setFavoriteVehicle()},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(` Set as Favorite `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:5,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.licensePlateChangePermission.allow,onClick:_cache[5]||=$event=>personalizeLicensePlate(vehSelected.value)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(` Personalize license plate `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:6,accent:unref(ACCENTS).menu,onClick:_cache[6]||=$event=>renameVehicle()},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Rename vehicle `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.sellEnabled&&!vehSelected.value.listedForSale?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:7,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.sellPermission.allow,onClick:_cache[7]||=$event=>listVehicleForSaleFromContextMenu()},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` List vehicle for sale `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.sellEnabled&&vehSelected.value.listedForSale?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:8,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.sellPermission.allow,onClick:_cache[8]||=$event=>lookAtVehicleListing()},{default:withCtx(()=>[..._cache[18]||=[createTextVNode(` Go to vehicle listing `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)]),_:1},8,[`name`])])),[[unref(BngDisabled_default),!unref(vehicleInventoryStore)]])}},VehicleList_default$1=__plugin_vue_export_helper_default(_sfc_main$145,[[`__scopeId`,`data-v-5a84a046`]]),_sfc_main$144=Object.assign({inheritAttrs:!1},{__name:`VehicleInventory`,setup(__props,{expose:__expose}){let vehicleInventoryStore=useVehicleInventoryStore(),attrs=useAttrs();return __expose({closeMenu:vehicleInventoryStore.closeMenu}),onBeforeMount(()=>{vehicleInventoryStore.requestInitialData()}),onUnmounted(()=>{Lua_default.extensions.hook(`onExitVehicleInventory`),vehicleInventoryStore.menuClosed(),vehicleInventoryStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(VehicleList_default$1,normalizeProps(guardReactiveProps(unref(attrs))),null,16))}}),VehicleInventory_default=_sfc_main$144,_sfc_main$143={__name:`VehicleInventoryMain`,setup(__props){let vehicleInventoryStore=useVehicleInventoryStore(),router$1=useRouter(),title=computed(()=>vehicleInventoryStore.vehicleInventoryData.header||`My vehicles`);watch(()=>vehicleInventoryStore.vehIdToChooseAfterRepairPopup,(newId,oldId)=>{!oldId&&newId&&confirmRepair()});let confirmRepair=async vehicle=>{await openConfirmation(``,`Do you want to repair your previous vehicle?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])?vehicleInventoryStore.repairPopupAccept():vehicleInventoryStore.repairPopupDecline()},elInventory=ref(),close=()=>router$1.back();return onUnmounted(()=>{vehicleInventoryStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,title:title.value,back:``,onBack:close},{default:withCtx(()=>[createVNode(VehicleInventory_default,{ref_key:`elInventory`,ref:elInventory,class:`vehicle-inventory`},null,512)]),_:1},8,[`title`]))}},VehicleInventoryMain_default=__plugin_vue_export_helper_default(_sfc_main$143,[[`__scopeId`,`data-v-88176408`]]);const useVehiclePurchaseStore=defineStore(`vehiclePurchase`,()=>{let{events:events$3}=useBridge(),purchaseType=ref(``),vehicleInfo=ref({}),playerMoney=ref(0),alreadyDidTestDrive=ref(!1),inventoryHasFreeSlot=ref(!1),tradeInVehicleInfo=ref({}),tradeInEnabled=ref(!1),forceTradeIn=ref(!1),locationSelectionEnabled=ref(!1),forceNoDelivery=ref(!1),makeDelivery=ref(!1),buyCustomLicensePlate=ref(!1),customLicensePlateText=ref(``),prices=ref({}),insuranceOptions=ref({}),finalPackagePrice=computed(()=>{let price=prices.value.finalPrice;return buyCustomLicensePlate.value&&(price+=prices.value.customLicensePlate),insuranceOptions.value.insuranceId>0&&(price+=insuranceOptions.value.priceMoney),price}),handlePurchaseData=data=>{vehicleInfo.value=data.vehicleInfo,playerMoney.value=data.playerMoney,inventoryHasFreeSlot.value=data.inventoryHasFreeSlot,purchaseType.value=data.purchaseType,tradeInEnabled.value=data.tradeInEnabled,locationSelectionEnabled.value=data.locationSelectionEnabled,forceNoDelivery.value=data.forceNoDelivery,prices.value=data.prices,makeDelivery.value=!1,buyCustomLicensePlate.value=!1,customLicensePlateText.value=``,alreadyDidTestDrive.value=data.alreadyDidTestDrive,forceTradeIn.value=data.forceTradeIn,insuranceOptions.value=data.insuranceOptions,data.tradeInVehicleInfo===void 0?tradeInVehicleInfo.value={}:tradeInVehicleInfo.value=data.tradeInVehicleInfo};function requestPurchaseData(){Lua_default.career_modules_vehicleShopping.sendPurchaseDataToUi()}function buyVehicle(makeDelivery$1){let options={makeDelivery:makeDelivery$1,insuranceId:insuranceOptions.value.insuranceId};buyCustomLicensePlate.value&&(options.licensePlateText=customLicensePlateText.value),Lua_default.career_modules_vehicleShopping.buyFromPurchaseMenu(purchaseType.value,options)}function inventoryIsEmpty(){return Lua_default.career_modules_inventory.isEmpty()}function chooseTradeInVehicle(){Lua_default.career_modules_vehicleShopping.openInventoryMenuForTradeIn()}function removeTradeInVehicle(){Lua_default.career_modules_vehicleShopping.removeTradeInVehicle()}function cancel(){Lua_default.career_modules_vehicleShopping.cancelPurchase(purchaseType.value)}function startTestDrive(){Lua_default.career_modules_inspectVehicle.startTestDrive()}function dispose$2(){listen(!1)}let listen=state=>{events$3[state?`on`:`off`](`vehiclePurchaseData`,handlePurchaseData)};return listen(!0),{buyVehicle,cancel,chooseTradeInVehicle,purchaseType,startTestDrive,dispose:dispose$2,forceNoDelivery,forceTradeIn,inventoryIsEmpty,inventoryHasFreeSlot,locationSelectionEnabled,makeDelivery,playerMoney,prices,finalPackagePrice,removeTradeInVehicle,requestPurchaseData,tradeInEnabled,tradeInVehicleInfo,vehicleInfo,buyCustomLicensePlate,customLicensePlateText,alreadyDidTestDrive,insuranceOptions}});var _hoisted_1$129={class:`header-row`},_hoisted_2$109={class:`header-seller-info`},_hoisted_3$97={class:`purchase-list`},_hoisted_4$77={class:`purchase-row`},_hoisted_5$66={class:`label`},_hoisted_6$52={class:`sub-info`},_hoisted_7$44={class:`price`},_hoisted_8$36={class:`current-price-line`},_hoisted_9$33={key:0,class:`old-price`},_hoisted_10$27={class:`sub-info`},_hoisted_11$25={key:0,class:`purchase-row thin light-blue`},_hoisted_12$20={class:`label category`},_hoisted_13$18={class:`price category`},_hoisted_14$18={class:`purchase-row thin light-blue`},_hoisted_15$18={class:`price`},_hoisted_16$18={key:1,class:`purchase-divider`},_hoisted_17$14={key:2,class:`purchase-row thin green`},_hoisted_18$12={class:`label`},_hoisted_19$9={class:`price`},_hoisted_20$8={class:`purchase-row`},_hoisted_21$8={class:`price`},_hoisted_22$7={class:`purchase-row thin yellow`},_hoisted_23$6={class:`price`},_hoisted_24$5={key:3,class:`purchase-row thin`},_hoisted_25$4={class:`price`},_hoisted_26$3={class:`purchase-row`},_hoisted_27$3={class:`price highlight-category`},_hoisted_28$2={key:4,class:`purchase-row money-warning red`},_hoisted_29$2={class:`label`},_hoisted_30$2={class:`price`},_hoisted_31$2={class:`purchase-customization-group`},_hoisted_32$2={class:`button-group`},_hoisted_33$2={key:0},_hoisted_34$2={key:1},_hoisted_35$1={key:2},_hoisted_36$1={class:`right-side`},_sfc_main$142={__name:`VehiclePurchaseMain`,setup(__props){useUINavScope(`vehiclePurchase`);let{showIfController}=storeToRefs(controls_default()),{units}=useBridge(),router$1=useRouter(),hasVehicle=ref(!1),licensePlateTextValid=ref(!0),vehiclePurchaseStore=useVehiclePurchaseStore(),store$1=useTasksStore(),tradeInButtonMessage=computed(()=>vehiclePurchaseStore.tradeInEnabled?hasVehicle.value?void 0:`You don't own any vehicles`:`Trade in only possible in person at a dealership`),testDriveButtonMessage=computed(()=>{if(vehiclePurchaseStore.purchaseType!==`inspect`)return`Test drive only available for inspect purchases`;if(vehiclePurchaseStore.alreadyDidTestDrive)return`You have already done a test drive`}),vehicleFitsInventory=computed(()=>vehiclePurchaseStore.vehicleInfo.takesNoInventorySpace?!0:vehiclePurchaseStore.inventoryHasFreeSlot||vehiclePurchaseStore.tradeInVehicleInfo.niceName&&!vehiclePurchaseStore.tradeInVehicleInfo.takesNoInventorySpace);vehiclePurchaseStore.inventoryIsEmpty().then(empty=>{hasVehicle.value=!empty});let buy=()=>buyVehicle(!vehiclePurchaseStore.locationSelectionEnabled||vehiclePurchaseStore.makeDelivery),cancel=()=>{router$1.back()},startTestDrive=()=>{vehiclePurchaseStore.startTestDrive()},chooseTradeInVehicle=()=>{vehiclePurchaseStore.chooseTradeInVehicle()},chooseInsurance=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`purchase`,params:{purchaseType:vehiclePurchaseStore.purchaseType,shopId:vehiclePurchaseStore.vehicleInfo.shopId,insuranceId:vehiclePurchaseStore.insuranceOptions.insuranceId}})},negotiatePrice=()=>{Lua_default.career_modules_marketplace.startNegotiateSellingOffer(vehiclePurchaseStore.vehicleInfo.shopId)},removeTradeInVehicle=()=>{vehiclePurchaseStore.removeTradeInVehicle()},buyVehicle=_makeDelivery=>{vehiclePurchaseStore.buyVehicle(_makeDelivery)};return onMounted(()=>{vehiclePurchaseStore.requestPurchaseData()}),onUnmounted(async()=>{await Lua_default.career_modules_inspectVehicle.onPurchaseMenuClosed(),vehiclePurchaseStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`purchase-layout`},{default:withCtx(()=>[unref(vehiclePurchaseStore).vehicleInfo.niceName?withDirectives((openBlock(),createBlock(unref(bngCard_default),{key:0,"bng-ui-scope":`vehiclePurchase`,class:`purchase-screen`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_32$2,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:unref(vehiclePurchaseStore).purchaseType!==`inspect`||unref(vehiclePurchaseStore).alreadyDidTestDrive,onClick:startTestDrive,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(`Test Drive`,-1)]]),_:1},8,[`disabled`,`accent`])),[[unref(BngTooltip_default),testDriveButtonMessage.value,`top`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney||!vehicleFitsInventory.value||unref(vehiclePurchaseStore).forceTradeIn&&!unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName||unref(vehiclePurchaseStore).buyCustomLicensePlate&&!licensePlateTextValid.value,"show-hold":``},{default:withCtx(()=>[unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney?(openBlock(),createElementBlock(`div`,_hoisted_33$2,`Insufficient Funds`)):vehicleFitsInventory.value?(openBlock(),createElementBlock(`div`,_hoisted_35$1,`Purchase`)):(openBlock(),createElementBlock(`div`,_hoisted_34$2,`No free inventory slots`))]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:buy,holdDelay:1e3,repeatInterval:0}]])])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$129,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[_cache[0]||=createTextVNode(` Purchase Information `,-1),createBaseVNode(`div`,_hoisted_2$109,` Purchasing from: `+toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.sellerName),1)]),_:1}),createVNode(unref(bngButton_default),{class:`close-button`,onClick:cancel,accent:unref(ACCENTS).attention,"bng-no-nav":`true`,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`menu`,controller:``}),createVNode(unref(bngIcon_default),{type:`xmarkBold`,color:`var(--bng-cool-gray-100)`})]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_3$97,[createBaseVNode(`div`,_hoisted_4$77,[createBaseVNode(`div`,_hoisted_5$66,[createBaseVNode(`div`,null,toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.year)+` `+toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.niceName),1),createBaseVNode(`div`,_hoisted_6$52,`(`+toDisplayString(unref(units).buildString(`length`,unref(vehiclePurchaseStore).vehicleInfo.Mileage,0))+`)`,1)]),createBaseVNode(`div`,_hoisted_7$44,[createBaseVNode(`div`,_hoisted_8$36,[unref(vehiclePurchaseStore).vehicleInfo.originalSellValue?(openBlock(),createElementBlock(`span`,_hoisted_9$33,[createVNode(unref(bngUnit_default),{money:unref(vehiclePurchaseStore).vehicleInfo.originalSellValue},null,8,[`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.Value},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_10$27,[createBaseVNode(`div`,null,[_cache[1]||=createTextVNode(` Est. Market: `,-1),createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.marketValue},null,8,[`money`])])])])]),_cache[13]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),unref(vehiclePurchaseStore).insuranceOptions.insuranceId>0?(openBlock(),createElementBlock(`div`,_hoisted_11$25,[createBaseVNode(`div`,_hoisted_12$20,toDisplayString(unref(vehiclePurchaseStore).insuranceOptions.spendingReason),1),createBaseVNode(`div`,_hoisted_13$18,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).insuranceOptions.priceMoney},null,8,[`money`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$18,[_cache[2]||=createBaseVNode(`div`,{class:`label`},`Dealership Fees`,-1),createBaseVNode(`div`,_hoisted_15$18,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.fees},null,8,[`money`])])]),unref(vehiclePurchaseStore).tradeInVehicleInfo?.niceName?(openBlock(),createElementBlock(`div`,_hoisted_16$18)):createCommentVNode(``,!0),unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName?(openBlock(),createElementBlock(`div`,_hoisted_17$14,[createBaseVNode(`div`,_hoisted_18$12,`Trade-in: `+toDisplayString(unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName),1),createBaseVNode(`div`,_hoisted_19$9,[createVNode(unref(bngUnit_default),{class:`money`,money:-unref(vehiclePurchaseStore).tradeInVehicleInfo.Value},null,8,[`money`])])])):createCommentVNode(``,!0),_cache[14]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),createBaseVNode(`div`,_hoisted_20$8,[_cache[3]||=createBaseVNode(`div`,{class:`label`},`Subtotal`,-1),createBaseVNode(`div`,_hoisted_21$8,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice-unref(vehiclePurchaseStore).prices.taxes-(unref(vehiclePurchaseStore).buyCustomLicensePlate?unref(vehiclePurchaseStore).prices.customLicensePlate:0)},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_22$7,[_cache[4]||=createBaseVNode(`div`,{class:`label`},`Sales Tax (7%)`,-1),createBaseVNode(`div`,_hoisted_23$6,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).prices.taxes},null,8,[`money`])])]),unref(vehiclePurchaseStore).buyCustomLicensePlate?(openBlock(),createElementBlock(`div`,_hoisted_24$5,[_cache[5]||=createBaseVNode(`div`,{class:`label`},`Custom License Plate`,-1),createBaseVNode(`div`,_hoisted_25$4,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).prices.customLicensePlate},null,8,[`money`])])])):createCommentVNode(``,!0),_cache[15]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),createBaseVNode(`div`,_hoisted_26$3,[_cache[6]||=createBaseVNode(`div`,{class:`label highlight-category`},`Total`,-1),createBaseVNode(`div`,_hoisted_27$3,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice},null,8,[`money`])])]),unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney?(openBlock(),createElementBlock(`div`,_hoisted_28$2,[createBaseVNode(`div`,_hoisted_29$2,[createVNode(unref(bngIcon_default),{type:`danger`}),_cache[7]||=createTextVNode(` Additional funds required`,-1)]),createBaseVNode(`div`,_hoisted_30$2,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice-unref(vehiclePurchaseStore).playerMoney},null,8,[`money`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_31$2,[_cache[12]||=createBaseVNode(`h4`,null,`Purchase Options`,-1),createVNode(unref(bngButton_default),{disabled:!unref(vehiclePurchaseStore).vehicleInfo.negotiationPossible,accent:`secondary`,onClick:negotiatePrice},{default:withCtx(()=>[..._cache[8]||=[createTextVNode(` Negotiate Price `,-1)]]),_:1},8,[`disabled`]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:!unref(vehiclePurchaseStore).tradeInEnabled||!hasVehicle.value,accent:`secondary`,onClick:chooseTradeInVehicle},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(`Choose Trade-In`,-1)]]),_:1},8,[`disabled`])),[[unref(BngTooltip_default),tradeInButtonMessage.value,`top`]]),unref(vehiclePurchaseStore).tradeInEnabled&&unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:removeTradeInVehicle,accent:unref(ACCENTS).attention},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Remove Trade-In`,-1)]]),_:1},8,[`accent`])):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{onClick:chooseInsurance,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`Choose Insurance`,-1)]]),_:1},8,[`accent`])])])]),_:1})),[[unref(BngBlur_default),1]]):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_36$1,[createVNode(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`profile-status`})]),_:1}),createVNode(TaskList_default,{class:`task-list`,header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`])])]),_:1}))}},VehiclePurchaseMain_default=__plugin_vue_export_helper_default(_sfc_main$142,[[`__scopeId`,`data-v-b2028538`]]);const useVehicleShoppingStore=defineStore(`vehicleShopping`,()=>{let selectedSellerId=ref(``),currentSeller=ref({}),vehicleShoppingData=ref({}),filteredVehicles=ref([]),filteredSoldVehicles=ref([]),buildFilteredListByKey=(data,key)=>{if(!data||!data[key])return[];let filteredList=Object.keys(data[key]).reduce((result,itemKey)=>{let item=data[key][itemKey];return selectedSellerId.value?item.sellerId===selectedSellerId.value&&result.push(item):result.push(item),result},[]);return filteredList.length&&filteredList.sort((a$1,b)=>a$1.Value-b.Value),filteredList},updateListsFromData=()=>{filteredVehicles.value=buildFilteredListByKey(vehicleShoppingData.value,`vehiclesInShop`),filteredSoldVehicles.value=buildFilteredListByKey(vehicleShoppingData.value,`soldVehicles`)};return{vehicleShoppingData,filteredVehicles,filteredSoldVehicles,currentSeller,requestVehicleShoppingData:async()=>{vehicleShoppingData.value=await Lua_default.career_modules_vehicleShopping.getShoppingData(),updateListsFromData()},setSelectedSellerId:sellerId=>{selectedSellerId.value=sellerId,updateListsFromData(),currentSeller.value=vehicleShoppingData.value.uiDealershipsData.find(dealership=>dealership.id===sellerId)}}});var _hoisted_1$128={class:`cover-container`},_hoisted_2$108={key:0,class:`sold-overlay`},_hoisted_3$96={class:`car-details`},_hoisted_4$76={class:`car-value`},_hoisted_5$65={class:`name`},_hoisted_6$51={class:`brand`},_hoisted_7$43={class:`main-data`},_hoisted_8$35={key:0,class:`price`},_hoisted_9$32={class:`was`},_hoisted_10$26={class:`sold`},_hoisted_11$24={key:0,class:`market`},_hoisted_12$19={key:1,class:`price`},_hoisted_13$17={key:0},_hoisted_14$17={key:1,style:{color:`rgb(245, 29, 29)`}},_hoisted_15$17={key:2,class:`market`},_hoisted_16$17={class:`car-data`},_hoisted_17$13={style:{width:`100%`}},_hoisted_18$11={key:0,style:{flex:`1 0 auto`,"justify-content":`flex-end`,padding:`0.5em 0.75em`,"font-weight":`400`,"font-family":`var(--fnt-defs)`}},DRIVE_TRAIN_ICONS={AWD:icons.AWD,"4WD":icons[`4WD`],FWD:icons.FWD,RWD:icons.RWD,drivetrain_special:icons.drivetrainSpecial,drivetrain_generic:icons.drivetrainGeneric,defaultMissing:icons.drivetrainGeneric,defaultUnknown:icons.drivetrainGeneric},FUEL_TYPE_ICONS={Battery:icons.charge,Gasoline:icons.fuelPump,Diesel:icons.fuelPump,defaultMissing:icons.fuelPump,defaultUnknown:icons.fuelPump},TRANSMISSION_ICONS={Automatic:icons.transmissionA,Manual:icons.transmissionM,defaultMissing:icons.transmissionM,defaultUnknown:icons.transmissionM},_sfc_main$141={__name:`VehicleCard`,props:{vehicleShoppingData:Object,vehicle:Object},setup(__props){let{units}=useBridge(),props=__props,soldPercent=computed(()=>{let asking=props.vehicle?.Value,sold=props.vehicle?.soldFor;return!asking||!sold?0:(sold-asking)/asking*100}),soldDeltaPrefix=computed(()=>soldPercent.value>=0?`+`:``),soldDeltaClass=computed(()=>soldPercent.value>0?`up`:soldPercent.value<0?`down`:`flat`),confirmTaxi=async vehicle=>{await openConfirmation(``,`Do you want to taxi to this vehicle for ${units.beamBucks(vehicle.quickTravelPrice)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&quickTravelToVehicle(vehicle)},showVehicle=shopId=>{Lua_default.career_modules_vehicleShopping.showVehicle(shopId)},quickTravelToVehicle=vehicle=>{Lua_default.career_modules_vehicleShopping.quickTravelToVehicle(vehicle.shopId)},openPurchaseMenu=(purchaseType,shopId)=>{Lua_default.career_modules_vehicleShopping.openPurchaseMenu(purchaseType,shopId)},getAttributeIcon=(vehicle,attribute)=>{let iconDict;return attribute==`Drivetrain`?iconDict=DRIVE_TRAIN_ICONS:attribute==`Fuel Type`?iconDict=FUEL_TYPE_ICONS:attribute==`Transmission`&&(iconDict=TRANSMISSION_ICONS),vehicle[attribute]?iconDict[vehicle[attribute]]||iconDict.defaultUnknown:iconDict.defaultMissing};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass(`vehicle-card row`)},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_17$13,[__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:0,style:{float:`left`},keyLabel:`Seller:`,valueLabel:__props.vehicle.sellerName},null,8,[`valueLabel`])),__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,style:{float:`left`},keyLabel:`Distance:`,valueLabel:unref(units).buildString(`length`,__props.vehicle.distance,1)},null,8,[`valueLabel`])),createVNode(unref(bngPropVal_default),{style:{float:`left`},keyLabel:`Insurance Class:`,valueLabel:__props.vehicle.insuranceClass?.name??`Unknown`},null,8,[`valueLabel`])]),__props.vehicleShoppingData.disableShopping?(openBlock(),createElementBlock(`span`,_hoisted_18$11,toDisplayString(__props.vehicleShoppingData.disableShoppingReason),1)):createCommentVNode(``,!0),__props.vehicle.sellerId===__props.vehicleShoppingData.currentSeller?(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[0]||=$event=>showVehicle(__props.vehicle.shopId),accent:unref(ACCENTS).secondary,disabled:__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Inspect Vehicle`,-1)]]),_:1},8,[`accent`,`disabled`])):(openBlock(),createBlock(unref(bngButton_default),{key:2,onClick:_cache[1]||=$event=>showVehicle(__props.vehicle.shopId),accent:unref(ACCENTS).secondary,disabled:__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`Set Route`,-1)]]),_:1},8,[`accent`,`disabled`])),__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:__props.vehicleShoppingData.playerAttributes.money.value<__props.vehicle.quickTravelPrice||__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter,onClick:_cache[2]||=$event=>confirmTaxi(__props.vehicle),accent:__props.vehicle.sellerId===`private`?unref(ACCENTS).main:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[12]||=[createBaseVNode(`span`,{style:{flex:`1 0 auto`}},`Take Taxi`,-1)]]),_:1},8,[`disabled`,`accent`])),__props.vehicle.sellerId===`private`?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:__props.vehicleShoppingData.tutorialPurchase||__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter,onClick:_cache[3]||=$event=>openPurchaseMenu(`instant`,__props.vehicle.shopId)},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`Purchase`,-1)]]),_:1},8,[`disabled`]))]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$128,[createVNode(unref(aspectRatio_default),{class:`cover`,ratio:`16:9`,"external-image":__props.vehicle.preview},null,8,[`external-image`]),__props.vehicle.soldViewCounter>0?(openBlock(),createElementBlock(`div`,_hoisted_2$108,`SOLD`)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$96,[createBaseVNode(`div`,_hoisted_4$76,[createBaseVNode(`div`,{class:normalizeClass([`car-name`,{sold:__props.vehicle.soldViewCounter>0}])},[createBaseVNode(`h3`,_hoisted_5$65,toDisplayString(__props.vehicle.year)+` `+toDisplayString(__props.vehicle.Name)+` `+toDisplayString(__props.vehicle.soldViewCounter>0?` (Sold)`:``),1),createBaseVNode(`div`,_hoisted_6$51,toDisplayString(__props.vehicle.Brand),1)],2),createBaseVNode(`div`,_hoisted_7$43,[createVNode(unref(bngPropVal_default),{class:`prop-small`,iconColor:`var(--bng-cool-gray-300)`,iconType:unref(icons).bus,valueLabel:unref(units).buildString(`length`,__props.vehicle.Mileage,0)},null,8,[`iconType`,`valueLabel`]),createVNode(unref(bngPropVal_default),{class:`prop-small`,style:{flex:`1 0 auto`},iconColor:`var(--bng-cool-gray-300)`,iconType:unref(icons).bus,valueLabel:__props.vehicle.Drivetrain},null,8,[`iconType`,`valueLabel`]),__props.vehicle.soldFor?(openBlock(),createElementBlock(`div`,_hoisted_8$35,[createBaseVNode(`div`,_hoisted_9$32,[_cache[4]||=createTextVNode(`Was: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.Value},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_10$26,[_cache[5]||=createTextVNode(`Sold for: `,-1),createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.soldFor},null,8,[`money`])]),createBaseVNode(`div`,{class:normalizeClass([`delta`,soldDeltaClass.value])},toDisplayString(soldDeltaPrefix.value)+toDisplayString(soldPercent.value.toFixed(1))+`% from asking`,3),__props.vehicle.marketValue?(openBlock(),createElementBlock(`div`,_hoisted_11$24,[_cache[6]||=createTextVNode(`Market: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.marketValue},null,8,[`money`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$19,[__props.vehicle.Value<=__props.vehicleShoppingData.playerAttributes.money.value?(openBlock(),createElementBlock(`div`,_hoisted_13$17,[createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.Value},null,8,[`money`]),_cache[7]||=createTextVNode(`*`,-1)])):(openBlock(),createElementBlock(`div`,_hoisted_14$17,[createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.Value},null,8,[`money`]),_cache[8]||=createTextVNode(`* Insufficient Funds`,-1)])),__props.vehicle.marketValue?(openBlock(),createElementBlock(`div`,_hoisted_15$17,[_cache[9]||=createTextVNode(`Market: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.marketValue},null,8,[`money`])])):createCommentVNode(``,!0)]))])]),createBaseVNode(`div`,_hoisted_16$17,[__props.vehicle.Power==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons).powerGauge04,keyLabel:`Power:`,valueLabel:unref(units).buildString(`power`,__props.vehicle.Power,0)},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Mileage==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,iconType:unref(icons).odometer,keyLabel:`Mileage:`,valueLabel:unref(units).buildString(`length`,__props.vehicle.Mileage,0)},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Transmission==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:2,iconType:getAttributeIcon(__props.vehicle,`Transmission`),keyLabel:`Transmission:`,valueLabel:__props.vehicle.Transmission},null,8,[`iconType`,`valueLabel`])),__props.vehicle[`Fuel Type`]==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:3,iconType:getAttributeIcon(__props.vehicle,`Fuel Type`),keyLabel:`Fuel type:`,valueLabel:__props.vehicle[`Fuel Type`]},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Drivetrain==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:4,iconType:getAttributeIcon(__props.vehicle,`Drivetrain`),keyLabel:`Drivetrain:`,valueLabel:__props.vehicle.Drivetrain},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Weight==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:5,iconType:unref(icons).weight,keyLabel:`Weight:`,valueLabel:unref(units).buildString(`weight`,__props.vehicle.Weight,0)},null,8,[`iconType`,`valueLabel`]))])])]),_:1}))}},VehicleCard_default=__plugin_vue_export_helper_default(_sfc_main$141,[[`__scopeId`,`data-v-dea06661`]]),_hoisted_1$127={class:`site-body`,"bng-nav-scroll":``,"bng-nav-scroll-force":``},_hoisted_2$107={class:`heading`},_hoisted_3$95={class:`header-text`},_hoisted_4$75={key:0,class:`vehicle-list`},_hoisted_5$64={key:1,class:`vehicle-list sold-list`},_hoisted_6$50={class:`list-section-title`},_sfc_main$140={__name:`VehicleList`,setup(__props){useUINavScope(`vehicleList`);let vehicleShoppingStore=useVehicleShoppingStore(),getHeaderText=()=>vehicleShoppingStore?.currentSeller?.name||`BeamCar24`;return reactive([{name:`switch`,selected:!0,class:``},{name:`me`,selected:!1,class:``},{name:`please`,selected:!1,class:``}]),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`vehicle-shop-wrapper`,"bng-ui-scope":`vehicleList`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$127,[createBaseVNode(`div`,_hoisted_2$107,[createBaseVNode(`span`,_hoisted_3$95,toDisplayString(getHeaderText()),1),_cache[0]||=createBaseVNode(`span`,{class:`price-notice`},[createBaseVNode(`span`,null,`*\xA0`),createBaseVNode(`span`,null,`Additional taxes and fees are applicable`)],-1)]),unref(vehicleShoppingStore)?(openBlock(),createElementBlock(`div`,_hoisted_4$75,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).filteredVehicles,(vehicle,key)=>(openBlock(),createBlock(VehicleCard_default,{key,vehicleShoppingData:unref(vehicleShoppingStore).vehicleShoppingData,vehicle},null,8,[`vehicleShoppingData`,`vehicle`]))),128))])):createCommentVNode(``,!0),unref(vehicleShoppingStore)&&unref(vehicleShoppingStore).filteredSoldVehicles&&unref(vehicleShoppingStore).filteredSoldVehicles.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$64,[createBaseVNode(`div`,_hoisted_6$50,`Recently Sold Vehicles You Viewed (`+toDisplayString(unref(vehicleShoppingStore).filteredSoldVehicles.length)+`)`,1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).filteredSoldVehicles,(vehicle,key)=>(openBlock(),createBlock(VehicleCard_default,{key,vehicleShoppingData:unref(vehicleShoppingStore).vehicleShoppingData,vehicle},null,8,[`vehicleShoppingData`,`vehicle`]))),128))])):createCommentVNode(``,!0)])]),_:1})),[[unref(BngBlur_default)]])}},VehicleList_default=__plugin_vue_export_helper_default(_sfc_main$140,[[`__scopeId`,`data-v-5045aa89`]]),_hoisted_1$126={class:`veh-part-caption`},_hoisted_2$106={class:`veh-name`},_hoisted_3$94={class:`veh-name-count`},_hoisted_4$74={class:`veh-price`},_hoisted_5$63={class:`veh-remove`},_hoisted_6$49={key:0,class:`offer-card red`},_hoisted_7$42=[`onMouseover`,`onMouseleave`,`onActivate`,`onDeactivate`],_hoisted_8$34={class:`offer-info`},_hoisted_9$31={class:`offer-header`},_hoisted_10$25={class:`buyer-name`},_hoisted_11$23={key:0,class:`expired-badge`},_hoisted_12$18={class:`offer-details`},_hoisted_13$16={class:`detail-row`},_hoisted_14$16={class:`detail-row`},_hoisted_15$16={class:`spec-actions`},_hoisted_16$16={key:1,class:`offer-card`},_sfc_main$139={__name:`VehicleMarketplace`,setup(__props){useComputerStore();let listings=ref([]),confirmRemoveListingScreen=async listingId=>{await openConfirmation(``,`Do you want to remove this listing?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&removeVehicleListing(listingId)},onActivated$1=offer=>{offer.active=!0},onDeactivated$1=offer=>{offer.active=!1},onOfferHovered=offer=>{offer.hovered=!0},onOfferUnhovered=offer=>{offer.hovered=!1},handleListings=data=>{listings.value=data},getNewData=()=>{Lua_default.career_modules_marketplace.getListings().then(handleListings)},acceptOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.acceptOffer(inventoryId,offerIndex+1).then(getNewData)},declineOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.declineOffer(inventoryId,offerIndex+1).then(getNewData)},startNegotiateBuyingOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.startNegotiateBuyingOffer(inventoryId,offerIndex+1).then(getNewData)},removeVehicleListing=inventoryId=>{Lua_default.career_modules_marketplace.removeVehicleListing(inventoryId).then(getNewData)},listVehicle=()=>{Lua_default.career_modules_inventory.openInventoryMenuForChoosingListing()};return onMounted(()=>{Lua_default.career_modules_marketplace.menuOpened(!0),getNewData()}),onUnmounted(()=>{Lua_default.career_modules_marketplace.menuOpened(!1)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(accordion_default),{class:`part-groups`,items:listings.value},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(listings.value,listing=>(openBlock(),createBlock(unref(accordionItem_default),{key:listing.id,expanded:!0,class:normalizeClass([`marketplace-listing`,{disabled:listing.disabled}])},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$126,[listing.thumbnail?(openBlock(),createElementBlock(`div`,{key:0,class:`veh-preview`,style:normalizeStyle({backgroundImage:`url('${listing.thumbnail}')`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`span`,_hoisted_2$106,[createTextVNode(toDisplayString(listing.niceName)+` `,1),createBaseVNode(`span`,_hoisted_3$94,`(`+toDisplayString(listing.offers.length||0)+`)`,1)]),createBaseVNode(`span`,_hoisted_4$74,[createBaseVNode(`div`,null,[_cache[0]||=createTextVNode(` Asking Price: `,-1),createVNode(unref(bngUnit_default),{money:listing.value},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[1]||=createTextVNode(` Estimated Market Value: `,-1),createVNode(unref(bngUnit_default),{money:listing.marketValue},null,8,[`money`])])]),createBaseVNode(`span`,_hoisted_5$63,[createVNode(unref(bngButton_default),{onClick:withModifiers($event=>confirmRemoveListingScreen(listing.id),[`stop`]),icon:unref(icons).trashBin1,accent:unref(ACCENTS).attentionghost},null,8,[`onClick`,`icon`,`accent`])])])]),default:withCtx(()=>[listing.disabled?(openBlock(),createElementBlock(`div`,_hoisted_6$49,toDisplayString(listing.disableReason),1)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(listing.offers,(offer,index)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`offer-card`,{expired:offer.expiredViewCounter==1}]),onMouseover:$event=>onOfferHovered(offer),onMouseleave:$event=>onOfferUnhovered(offer),onActivate:$event=>onActivated$1(offer),onDeactivate:$event=>onDeactivated$1(offer)},[createBaseVNode(`div`,_hoisted_8$34,[createBaseVNode(`div`,_hoisted_9$31,[createBaseVNode(`span`,_hoisted_10$25,toDisplayString(offer.buyerPersonality.name),1),offer.expiredViewCounter?(openBlock(),createElementBlock(`span`,_hoisted_11$23,`EXPIRED`)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_12$18,[createBaseVNode(`div`,_hoisted_13$16,[_cache[3]||=createBaseVNode(`span`,{class:`detail-label`},`Offer:`,-1),createVNode(unref(bngUnit_default),{money:offer.value},null,8,[`money`]),createBaseVNode(`span`,{class:normalizeClass([`delta`,{up:offer.value>listing.value,down:offer.valuelisting.value?`+`:`-`),1),createVNode(unref(bngUnit_default),{money:Math.abs(offer.value-listing.value)},null,8,[`money`]),_cache[2]||=createTextVNode(`) `,-1)],2)]),createBaseVNode(`div`,_hoisted_14$16,[_cache[4]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,null,toDisplayString(listing.niceName),1)])])]),createBaseVNode(`div`,_hoisted_15$16,[createVNode(unref(bngButton_default),{class:`part-button`,onClick:$event=>declineOffer(listing.id,index),accent:unref(ACCENTS).attention},{default:withCtx(()=>[createTextVNode(toDisplayString(offer.expiredViewCounter?`Discard`:`Deny`),1)]),_:2},1032,[`onClick`,`accent`]),offer.expiredViewCounter?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`part-button negotiate-button`,onClick:$event=>startNegotiateBuyingOffer(listing.id,index),accent:unref(ACCENTS).secondary,disabled:!offer.negotiationPossible||offer.value>=listing.value||listing.disabled},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(` Negotiate `,-1)]]),_:1},8,[`onClick`,`accent`,`disabled`])),offer.expiredViewCounter?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:`part-button`,onClick:$event=>acceptOffer(listing.id,index),disabled:listing.disabled||offer.disabled,accent:unref(ACCENTS).main},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Accept Offer `,-1)]]),_:1},8,[`onClick`,`disabled`,`accent`]))])],42,_hoisted_7$42)),[[unref(BngScopedNav_default)]])),256)),Object.keys(listing.offers||{}).length===0?(openBlock(),createElementBlock(`div`,_hoisted_16$16,toDisplayString(unref($translate).instant(`ui.career.vehicleMarketplace.noOffers`)),1)):createCommentVNode(``,!0)]),_:2},1032,[`class`]))),128))]),_:1},8,[`items`]),createVNode(unref(bngButton_default),{class:`add-listing-button`,onClick:listVehicle,accent:unref(ACCENTS).custom},{default:withCtx(()=>[..._cache[7]||=[createBaseVNode(`span`,{class:`add-listing-button-icon`},`+`,-1),createTextVNode(` Add Listing `,-1)]]),_:1},8,[`accent`])],64))}},VehicleMarketplace_default=__plugin_vue_export_helper_default(_sfc_main$139,[[`__scopeId`,`data-v-468e550d`]]),_hoisted_1$125={class:`flex-container`},_hoisted_2$105={class:`content`},_hoisted_3$93={key:0},_hoisted_4$73={class:`seller-grid`},_hoisted_5$62={class:`seller-card__label`},_hoisted_6$48={class:`seller-card__header`},_hoisted_7$41={class:`seller-card__title`},_hoisted_8$33={key:0,class:`seller-card__subtitle`},_hoisted_9$30={class:`seller-card__vehicle-thumbnails`},_hoisted_10$24={class:`seller-card__vehicle-thumbnail`},_hoisted_11$22={key:0,class:`more-label`},_hoisted_12$17={key:1},buyVehicleTitle=`Buy Vehicles`,sellVehicleTitle=`Sell Vehicles`,_sfc_main$138={__name:`VehicleShoppingMain`,props:{screenTag:{type:String,default:``},buyingAvailable:{type:String,default:`true`},marketplaceAvailable:{type:String,default:`true`},selectedSellerId:{type:String,default:``}},setup(__props){useUINavScope(`vehicleShopping`),useComputerStore();let vehicleShoppingStore=useVehicleShoppingStore(),selectedTab=ref(0),selectedSellerId=ref(``),router$1=useRouter(),loaded=ref(!1),selectSeller=sellerId=>{setSelectedSellerId(sellerId),updateRouteScreenTag()},tabs=computed(()=>{let tabs$1=[];return props.buyingAvailable===`true`&&tabs$1.push(buyVehicleTitle),props.marketplaceAvailable===`true`&&tabs$1.push(sellVehicleTitle),tabs$1}),props=__props,processTabInput=event=>{event.detail.name===`tab_l`?selectedTab.value=(selectedTab.value-1+tabs.value.length)%tabs.value.length:event.detail.name===`tab_r`&&(selectedTab.value=(selectedTab.value+1)%tabs.value.length)},onTabsChange=(tab,old)=>{let idx=tabs.value.indexOf(tab&&tab.heading?tab.heading:``);idx!==-1&&(selectedTab.value=idx),selectedTab.value===tabs.value.indexOf(buyVehicleTitle)&&(selectedSellerId.value=``)},headerTitle=computed(()=>{switch(tabs.value[selectedTab.value]){case buyVehicleTitle:return`Buy Vehicles`;case sellVehicleTitle:return`Sell Vehicles`;default:return`Available Vehicles`}}),updateRouteScreenTag=()=>{let screenTag=selectedTab.value===tabs.value.indexOf(sellVehicleTitle)?`marketplace`:`buying`;router$1.replace({name:`vehicleShopping`,params:{screenTag,buyingAvailable:props.buyingAvailable,marketplaceAvailable:props.marketplaceAvailable,selectedSellerId:selectedSellerId.value}})};watch(selectedTab,()=>{updateRouteScreenTag()});let setSelectedSellerId=sellerId=>{selectedSellerId.value=sellerId,vehicleShoppingStore.setSelectedSellerId(selectedSellerId.value)},dealershipVehiclesMap=computed(()=>{let map=new Map;return vehicleShoppingStore.vehicleShoppingData.vehiclesInShop&&vehicleShoppingStore.vehicleShoppingData.vehiclesInShop.filter(vehicle=>vehicle.preview).forEach(vehicle=>{map.has(vehicle.sellerId)||map.set(vehicle.sellerId,[]),map.get(vehicle.sellerId).push(vehicle)}),map}),getDealershipVehicles=dealershipId=>dealershipVehiclesMap.value.get(dealershipId)||[],start=()=>{nextTick(async()=>{await vehicleShoppingStore.requestVehicleShoppingData(),loaded.value=!0,vehicleShoppingStore.vehicleShoppingData.currentSeller?setSelectedSellerId(vehicleShoppingStore.vehicleShoppingData.currentSeller):setSelectedSellerId(props.selectedSellerId),props.screenTag==`buying`?selectedTab.value=tabs.value.indexOf(buyVehicleTitle):props.screenTag==`marketplace`?selectedTab.value=tabs.value.indexOf(sellVehicleTitle):selectedTab.value=0,updateRouteScreenTag()})},kill=async()=>{await Lua_default.career_modules_vehicleShopping.onShoppingMenuClosed(),vehicleShoppingStore.$dispose()},close=()=>{!vehicleShoppingStore.vehicleShoppingData.currentSeller&&selectedTab.value===tabs.value.indexOf(buyVehicleTitle)&&selectedSellerId.value?selectedSellerId.value=``:router$1.back()};return onMounted(start),onUnmounted(kill),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(ComputerWrapper_default,{path:[unref(vehicleShoppingStore).vehicleShoppingData.currentSellerNiceName||`Vehicle Marketplace`],title:headerTitle.value,"bng-ui-scope":`vehicleShopping`,back:``,onBack:close},{status:withCtx(()=>[createTextVNode(` Free Inventory Slots: `+toDisplayString(unref(vehicleShoppingStore)?unref(vehicleShoppingStore).vehicleShoppingData.numberOfFreeSlots:0),1)]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$125,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$105,[createVNode(unref(tabs_default),{class:normalizeClass([`bng-tabs`,{"single-tab":tabs.value.length===1}]),selectedIndex:selectedTab.value,onChange:onTabsChange},{default:withCtx(()=>[createVNode(unref(tabList_default)),props.buyingAvailable===`true`?(openBlock(),createElementBlock(`div`,{key:0,"tab-heading":buyVehicleTitle,class:`buying-tab-content`},[loaded.value&&!selectedSellerId.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`buying-card`},{default:withCtx(()=>[unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData&&Object.keys(unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData).length?(openBlock(),createElementBlock(`div`,_hoisted_3$93,[createBaseVNode(`div`,_hoisted_4$73,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData,dealership=>(openBlock(),createBlock(unref(bngTile_default),{key:dealership.id,class:`seller-card`,style:normalizeStyle({backgroundImage:`linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0)), url(`+(dealership.preview&&dealership.preview[0]===`/`?dealership.preview:`/`+dealership.preview)+`)`}),onClick:$event=>dealership.vehicleCount&&selectSeller(dealership.id)},{label:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$62,[createBaseVNode(`div`,_hoisted_6$48,[createBaseVNode(`div`,_hoisted_7$41,[createVNode(unref(bngIcon_default),{type:dealership.icon},null,8,[`type`]),createTextVNode(toDisplayString(dealership.name),1)]),dealership.description?(openBlock(),createElementBlock(`div`,_hoisted_8$33,toDisplayString(dealership.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$30,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getDealershipVehicles(dealership.id).slice(0,5),(vehicle,index)=>(openBlock(),createElementBlock(`div`,_hoisted_10$24,[createVNode(unref(aspectRatio_default),{ratio:`16:9`,class:`seller-card__vehicle-thumbnail-image`,"external-image":vehicle.preview},{default:withCtx(()=>[index==0&&getDealershipVehicles(dealership.id).length>5?(openBlock(),createElementBlock(`div`,_hoisted_11$22,` +`+toDisplayString(getDealershipVehicles(dealership.id).length-4),1)):createCommentVNode(``,!0)]),_:2},1032,[`external-image`])]))),256))])])]),_:2},1032,[`style`,`onClick`]))),128))])])):(openBlock(),createElementBlock(`div`,_hoisted_12$17,[..._cache[0]||=[createBaseVNode(`span`,null,`No sellers available.`,-1)]]))]),_:1})):loaded.value?(openBlock(),createBlock(VehicleList_default,{key:1})):(openBlock(),createBlock(unref(bngCard_default),{key:2},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{style:{color:`#fff`}},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Please wait...`,-1)]]),_:1})]),_:1}))])):createCommentVNode(``,!0),props.marketplaceAvailable===`true`?(openBlock(),createElementBlock(`div`,{key:1,"tab-heading":sellVehicleTitle,class:`marketplace-tab-content`},[createVNode(VehicleMarketplace_default)])):createCommentVNode(``,!0)]),_:1},8,[`class`,`selectedIndex`])])),[[unref(BngBlur_default),1]])])]),_:1},8,[`path`,`title`])),[[unref(BngOnUiNav_default),processTabInput,`tab_l,tab_r`]])}},VehicleShoppingMain_default=__plugin_vue_export_helper_default(_sfc_main$138,[[`__scopeId`,`data-v-83009aa9`]]),_hoisted_1$124={style:{padding:`1em`,overflow:`auto`}},_hoisted_2$104={class:`performance-class-container`},_hoisted_3$92={key:0,class:`performance-class-wrapper`},_hoisted_4$72={class:`class-badge`},_hoisted_5$61={class:`certification-container`},_hoisted_6$47={class:`specs-section`},_hoisted_7$40={key:0},_hoisted_8$32={key:1,class:`specs-grid`},_hoisted_9$29={class:`spec-row`},_hoisted_10$23={class:`spec-label`},_hoisted_11$21={class:`spec-value`},_hoisted_12$16={class:`spec-row`},_hoisted_13$15={class:`spec-value`},_hoisted_14$15={class:`spec-row`},_hoisted_15$15={class:`spec-label`},_hoisted_16$15={class:`spec-value`},_hoisted_17$12={class:`spec-row`},_hoisted_18$10={class:`spec-label`},_hoisted_19$8={class:`spec-value`},_hoisted_20$7={class:`spec-row`},_hoisted_21$7={class:`spec-label`},_hoisted_22$6={class:`spec-value`},_hoisted_23$5={class:`spec-row`},_hoisted_24$4={class:`spec-value`},_hoisted_25$3={class:`spec-row`},_hoisted_26$2={class:`spec-value`},_hoisted_27$2={class:`specs-section`},_hoisted_28$1={key:0,class:`metrics-grid`},_hoisted_29$1={key:3,class:`performance-index-container`},_hoisted_30$1={class:`progress-wrapper`},_hoisted_31$1={class:`class-markers`},_hoisted_32$1={class:`marker-label`},_hoisted_33$1={class:`history-dropdown-container`},_hoisted_34$1={class:`dropdown`},_sfc_main$137={__name:`VehiclePerformanceTile`,props:{vehicleData:Object},setup(__props){let{units}=useBridge(),props=__props;computed(()=>props.vehicleData.niceName||`No Name`);let startTestTitle=computed(()=>props.vehicleData.needsRepair?`Assess Performance (Repair Required)`:`Assess Performance Now`),startTest=function(){Lua_default.career_modules_vehiclePerformance.startDragTest(props.vehicleData.id)},getColorForValue=(value,min$1=0,max$1=1)=>{let normalizedValue=(value-min$1)/(max$1-min$1),adjustedValue=Math.max(0,normalizedValue-.1)*(1/.9),red,green;return adjustedValue<.5?(red=200,green=Math.round(200*(adjustedValue*2))):(red=Math.round(200*(2-adjustedValue*2)),green=200),`rgb(${red}, ${green}, 0)`},selectedHistoryIndex=ref(0),allCertificationData=computed(()=>[props.vehicleData.certificationData||{noPerformanceData:!0},...props.vehicleData.performanceHistory||[]]),historyOptions=computed(()=>allCertificationData.value.length?allCertificationData.value.map((item,index)=>({value:index,label:index===0?item.noPerformanceData?`Current Test Results: No data`:`Current Test Results - `+new Date(item.timeStamp).toLocaleString():`Previous Test Results - ${new Date(item.timeStamp).toLocaleString()}`})):[]),selectedCertificationData=computed(()=>allCertificationData.value[selectedHistoryIndex.value]);return watch(()=>props.vehicleData,newVal=>{},{immediate:!0}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`card`},{footer:withCtx(()=>[createBaseVNode(`div`,_hoisted_33$1,[createBaseVNode(`div`,_hoisted_34$1,[_cache[8]||=createBaseVNode(`div`,{class:`dropdown-label`},`Previous Assessments`,-1),createVNode(unref(bngDropdown_default),{modelValue:selectedHistoryIndex.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedHistoryIndex.value=$event,items:historyOptions.value,class:`history-select`},{default:withCtx(()=>[createTextVNode(toDisplayString(historyOptions.value[selectedHistoryIndex.value].text),1)]),_:1},8,[`modelValue`,`items`])]),createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>startTest(),disabled:__props.vehicleData.needsRepair||!__props.vehicleData.owned},{default:withCtx(()=>[createTextVNode(toDisplayString(startTestTitle.value),1)]),_:1},8,[`disabled`])])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$124,[createBaseVNode(`div`,null,[createVNode(VehicleTileRow_default,{class:`vehicle-tile-row`,data:__props.vehicleData,enableHover:!1,small:!0},null,8,[`data`]),createBaseVNode(`div`,_hoisted_2$104,[selectedCertificationData.value&&selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_3$92,[createBaseVNode(`span`,_hoisted_4$72,` Class `+toDisplayString(selectedCertificationData.value.vehicleClass.class.name)+` | PI `+toDisplayString(selectedCertificationData.value.vehicleClass.performanceIndex.toFixed(0)),1)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_5$61,[createBaseVNode(`div`,_hoisted_6$47,[_cache[5]||=createBaseVNode(`div`,{class:`section-header`},[createBaseVNode(`h2`,null,`Technical Specifications`)],-1),selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_8$32,[createBaseVNode(`div`,_hoisted_9$29,[createBaseVNode(`div`,_hoisted_10$23,toDisplayString(_ctx.$t(`ui.options.units.weight`)),1),createBaseVNode(`div`,_hoisted_11$21,toDisplayString(_ctx.$game.units.buildString(`weight`,selectedCertificationData.value.weight,0)),1)]),createBaseVNode(`div`,_hoisted_12$16,[_cache[2]||=createBaseVNode(`div`,{class:`spec-label`},`Power/Weight`,-1),createBaseVNode(`div`,_hoisted_13$15,toDisplayString(selectedCertificationData.value.powerPerTon.toFixed(0))+`hp/1000kg`,1)]),createBaseVNode(`div`,_hoisted_14$15,[createBaseVNode(`div`,_hoisted_15$15,toDisplayString(_ctx.$t(`vehicle.info.Drivetrain`)),1),createBaseVNode(`div`,_hoisted_16$15,toDisplayString(selectedCertificationData.value.drivetrain),1)]),createBaseVNode(`div`,_hoisted_17$12,[createBaseVNode(`div`,_hoisted_18$10,toDisplayString(_ctx.$t(`vehicle.info.Fuel Type`)),1),createBaseVNode(`div`,_hoisted_19$8,toDisplayString(selectedCertificationData.value.fuelType),1)]),createBaseVNode(`div`,_hoisted_20$7,[createBaseVNode(`div`,_hoisted_21$7,toDisplayString(_ctx.$t(`vehicle.info.Induction Type`)),1),createBaseVNode(`div`,_hoisted_22$6,toDisplayString(selectedCertificationData.value.inductionType),1)]),createBaseVNode(`div`,_hoisted_23$5,[_cache[3]||=createBaseVNode(`div`,{class:`spec-label`},`Mileage`,-1),createBaseVNode(`div`,_hoisted_24$4,toDisplayString(unref(units).buildString(`length`,selectedCertificationData.value.mileage,0)),1)]),createBaseVNode(`div`,_hoisted_25$3,[_cache[4]||=createBaseVNode(`div`,{class:`spec-label`},`Lateral G-Force`,-1),createBaseVNode(`div`,_hoisted_26$2,toDisplayString(selectedCertificationData.value.lateralGForce.toFixed(2))+` G`,1)])])):(openBlock(),createElementBlock(`div`,_hoisted_7$40,` Vehicle has not been assessed yet. `))]),createBaseVNode(`div`,_hoisted_27$2,[_cache[7]||=createBaseVNode(`div`,{class:`section-header`},[createBaseVNode(`h2`,null,`Metrics`)],-1),selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_28$1,[selectedCertificationData.value.power?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,headerLeft:`Power Output`,headerRight:_ctx.$game.units.buildString(`power`,selectedCertificationData.value.power,0),value:selectedCertificationData.value.power,min:0,max:1e3,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.power,0,1e3),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),createVNode(unref(bngProgressBar_default),{headerLeft:`0-60 mph time (prepped surface)`,headerRight:selectedCertificationData.value.time_0_60?selectedCertificationData.value.time_0_60.toFixed(2)+` s`:`N/A`,value:selectedCertificationData.value.time_0_60?-selectedCertificationData.value.time_0_60:-25,min:-25,max:-2,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.time_0_60?-selectedCertificationData.value.time_0_60:-25,-25,-2),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`]),selectedCertificationData.value.time_1_4?(openBlock(),createBlock(unref(bngProgressBar_default),{key:1,headerLeft:`Quarter Mile`,headerRight:selectedCertificationData.value.time_1_4.toFixed(2)+` s @ `+_ctx.$game.units.buildString(`speed`,selectedCertificationData.value.velAt_1_4,0),value:selectedCertificationData.value.time_1_4?-selectedCertificationData.value.time_1_4:-35,min:-35,max:-8.1,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.time_1_4?-selectedCertificationData.value.time_1_4:-35,-35,-8.1),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),selectedCertificationData.value.performanceAggregateScores.brakingGForceScore?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,headerLeft:`Braking Force`,headerRight:selectedCertificationData.value.brakingG?selectedCertificationData.value.brakingG.toFixed(2)+` G`:`N/A`,value:selectedCertificationData.value.brakingG||0,min:.5,max:1.9,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.brakingG||0,.5,1.9),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),selectedCertificationData.value&&selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_29$1,[createBaseVNode(`div`,_hoisted_30$1,[createVNode(unref(bngProgressBar_default),{headerLeft:`Performance Index`,headerRight:`Class: `+selectedCertificationData.value.vehicleClass.class.name,value:selectedCertificationData.value.vehicleClass.performanceIndex,min:0,max:110,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.vehicleClass.performanceIndex/110),class:`score-progress performance-index`},null,8,[`headerRight`,`value`,`valueColor`]),createBaseVNode(`div`,_hoisted_31$1,[(openBlock(),createElementBlock(Fragment,null,renderList([{pi:101,name:`X`},{pi:86,name:`S`},{pi:66,name:`A`},{pi:41,name:`B`},{pi:21,name:`C`}],(classInfo,index)=>createBaseVNode(`div`,{key:index,class:`class-marker`,style:normalizeStyle({left:`${classInfo.pi/110*100}%`})},[_cache[6]||=createBaseVNode(`div`,{class:`marker-line`},null,-1),createBaseVNode(`div`,_hoisted_32$1,toDisplayString(classInfo.name),1)],4)),64))])])])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])])]),_:1})),[[unref(BngBlur_default),!0]])}},VehiclePerformanceTile_default=__plugin_vue_export_helper_default(_sfc_main$137,[[`__scopeId`,`data-v-ca2efe1a`]]),_hoisted_1$123={key:0,class:`certification-test-in-progress`},_hoisted_2$103={class:`certification-content`},_hoisted_3$91={class:`certification-icon`},_hoisted_4$71={class:`cancelButton`},_hoisted_5$60={key:1},_sfc_main$136={__name:`VehiclePerformanceMain`,props:{inventoryId:String},setup(__props){let router$1=useRouter(),vehicleData=ref({}),assessmentProgressMessage=ref(`Performance Assessment in progress...`),cancellingTest=ref(!1),testInProgress=ref(!1),{$game}=useLibStore(),title=computed(()=>vehicleData.value.niceName?`Performance Index: `+vehicleData.value.niceName:`Performance Index`),props=__props;$game.events.on(`PerformanceTestMessage`,data=>{assessmentProgressMessage.value=data.message,cancellingTest.value=!0}),$game.events.on(`PerformanceTestStarted`,data=>{testInProgress.value=data.testInProgress,getVehicleData()});let close=()=>{router$1.back()},kill=()=>{$game.events.off(`PerformanceTestMessage`),$game.events.off(`PerformanceTestStarted`)},getVehicleData=()=>{Lua_default.career_modules_inventory.getVehicleUiData(Number(props.inventoryId)).then(data=>{vehicleData.value=data})},start=()=>{getVehicleData()},cancelTest=()=>{Lua_default.career_modules_vehiclePerformance.cancelTest()};return onUnmounted(kill),onMounted(start),(_ctx,_cache)=>testInProgress.value?(openBlock(),createElementBlock(`div`,_hoisted_1$123,[createVNode(unref(bngCard_default),{class:`certification-card`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$103,[createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`certificationTestText`,{cancelling:cancellingTest.value}])},toDisplayString(assessmentProgressMessage.value),3)]),createBaseVNode(`div`,_hoisted_3$91,[createVNode(unref(bngIcon_default),{type:unref(icons).timeUnlockOutline},null,8,[`type`])])]),createBaseVNode(`div`,_hoisted_4$71,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).RED,onClick:cancelTest,tabindex:`0`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Cancel Test `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])]),_:1})])):(openBlock(),createElementBlock(`div`,_hoisted_5$60,[createVNode(ComputerWrapper_default,{ref:`wrapper`,path:[`Performance Index`],title:title.value,back:``,onBack:close},{default:withCtx(()=>[createVNode(VehiclePerformanceTile_default,{"vehicle-data":vehicleData.value},null,8,[`vehicle-data`])]),_:1},8,[`title`])]))}},VehiclePerformanceMain_default=__plugin_vue_export_helper_default(_sfc_main$136,[[`__scopeId`,`data-v-ea737c56`]]),_hoisted_1$122={class:`offer-chat-container-wrapper`},_hoisted_2$102={key:0,class:`above`},_hoisted_3$90={key:1,class:`red`},_hoisted_4$70={key:2,class:`green`},_hoisted_5$59={key:3,class:`above`},_hoisted_6$46={key:4,class:`above`},_hoisted_7$39={key:5,class:`price`},_sfc_main$135={__name:`NegotiationChat`,props:{offerHistory:{type:Array,default:()=>[]},negotiationStatus:{type:String,default:``},startingPrice:{type:Number,default:0},amISelling:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let props=__props,offerChatContainer=ref(null),statusTextFromStatus=status=>{switch(String(status||``)){case`counterOffer`:return`Counter offer`;case`counterOfferLastChance`:return`Last chance counter offer`;case`accepted`:return`Accepted`;case`failed`:return`Negotiation failed`;case`refused`:return`Offer refused`;case`initial`:return props.amISelling?`Initial offer`:`Asking Price`;case`thinking`:return`Thinking`;default:return``}},fillInOfferHistory=history$1=>{if(!history$1||!Array.isArray(history$1))return[];let hasSeenMyOffer=!1,isFirstInitialOffer=!0;return history$1.map(item=>{let isMyOffer=item.myOffer!=null,isTheirOffer=item.theirOffer!=null,currentOffer=isMyOffer?item.myOffer:item.theirOffer,difference=null;isTheirOffer&&isFirstInitialOffer?isFirstInitialOffer=!1:difference=currentOffer-props.startingPrice;let offerStatus=null;return isMyOffer&&(hasSeenMyOffer?offerStatus=`counterOffer`:(offerStatus=`initial`,hasSeenMyOffer=!0)),isMyOffer?item.myOffer:isTheirOffer&&item.theirOffer,{theirOffer:item.theirOffer,myOffer:item.myOffer,negotiationStatus:item.negotiationStatus,messageClass:isMyOffer?`sent-message`:`received-message`,difference,offerStatus}})},typingMessageId=ref(null),previousOfferHistoryLength=ref(0);watch(()=>props.negotiationStatus,newStatus=>{newStatus===`typing`&&typingMessageId.value===null&&(typingMessageId.value=`typing-${Date.now()}`)});let processedOfferHistory=computed(()=>{let history$1=fillInOfferHistory(props.offerHistory),currentHistoryLength=(props.offerHistory||[]).length;if(currentHistoryLength>previousOfferHistoryLength.value&&typingMessageId.value!==null){let responseId=typingMessageId.value,responseData=history$1[history$1.length-1],result=[...history$1];return result[result.length-1]={...responseData,typingId:responseId,isTyping:!1},typingMessageId.value=null,previousOfferHistoryLength.value=currentHistoryLength,result}return currentHistoryLength!==previousOfferHistoryLength.value&&(previousOfferHistoryLength.value=currentHistoryLength),props.negotiationStatus===`typing`&&typingMessageId.value!==null?[...history$1,{theirOffer:null,myOffer:null,negotiationStatus:`typing`,messageClass:`received-message`,difference:null,isTyping:!0,typingId:typingMessageId.value}]:history$1});watch(processedOfferHistory,()=>{nextTick(()=>{if(offerChatContainer.value){let container=offerChatContainer.value;container.scrollHeight-container.scrollTop-container.clientHeight<100&&(container.scrollTop=container.scrollHeight)}})},{deep:!0});let scrollToBottom=()=>{nextTick(()=>{offerChatContainer.value&&(offerChatContainer.value.scrollTop=offerChatContainer.value.scrollHeight)})},reset$1=()=>{typingMessageId.value=null,previousOfferHistoryLength.value=(props.offerHistory||[]).length};return onMounted(()=>{reset$1(),scrollToBottom()}),__expose({scrollToBottom,reset:reset$1}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$122,[createBaseVNode(`div`,{ref_key:`offerChatContainer`,ref:offerChatContainer,class:`offer-chat-container`},[createVNode(TransitionGroup,{name:`message`,tag:`div`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(processedOfferHistory.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:item.typingId||`${item.myOffer||item.theirOffer||`message`}-${index}`,class:normalizeClass([`message`,item.messageClass])},[item.isTyping?(openBlock(),createElementBlock(`div`,_hoisted_2$102,[..._cache[0]||=[createBaseVNode(`span`,{class:`spinner`,"aria-label":`Typing`},null,-1),createTextVNode(` Typing... `,-1)]])):item.negotiationStatus===`failed`?(openBlock(),createElementBlock(`div`,_hoisted_3$90,[createVNode(unref(bngIcon_default),{type:`abandon`}),_cache[1]||=createTextVNode(` Negotiation failed! `,-1)])):item.negotiationStatus===`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_4$70,[createVNode(unref(bngIcon_default),{type:`checkmark`,color:`var(--bng-add-green-400)`}),_cache[2]||=createTextVNode(` Accepted! `,-1)])):item.offerStatus?(openBlock(),createElementBlock(`div`,_hoisted_5$59,[item.offerStatus===`initial`?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(props.amISelling?`Asking Price`:`Initial offer`),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(` Counter offer `)],64))])):item.negotiationStatus?(openBlock(),createElementBlock(`div`,_hoisted_6$46,toDisplayString(statusTextFromStatus(item.negotiationStatus)),1)):createCommentVNode(``,!0),!item.isTyping&&item.negotiationStatus!==`failed`&&item.negotiationStatus!==`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_7$39,[createVNode(unref(bngUnit_default),{class:`money`,money:item.myOffer||item.theirOffer||0},null,8,[`money`])])):createCommentVNode(``,!0)],2))),128))]),_:1})],512)]))}},NegotiationChat_default=__plugin_vue_export_helper_default(_sfc_main$135,[[`__scopeId`,`data-v-c4558f29`]]),_hoisted_1$121={class:`price-finder-label right`},_hoisted_2$101={class:`price-finder-track`},_hoisted_3$89={key:0,class:`tick-label`},_hoisted_4$69={class:`price-finder-label left`},_sfc_main$134={__name:`PriceFinder`,props:{offerHistory:{type:Array,default:()=>[]},negotiationStatus:{type:String,default:``},startingPrice:{type:Number,default:0},offerPreview:{type:Number,default:0},actualVehicleValue:{type:Number,default:null},amISelling:{type:Boolean,default:!1}},setup(__props){let{units}=useBridge(),props=__props,priceFinderData=computed(()=>{let history$1=props.offerHistory||[];if(history$1.length===0)return null;let initialTheirOffer=null,initialMyOffer=null;for(let item of history$1)if(initialTheirOffer===null&&item.theirOffer!=null&&(initialTheirOffer=item.theirOffer),initialMyOffer===null&&item.myOffer!=null&&(initialMyOffer=item.myOffer),initialTheirOffer!==null&&initialMyOffer!==null)break;let hasBothInitialOffers=initialTheirOffer!==null&&initialMyOffer!==null;initialTheirOffer===null&&(initialTheirOffer=props.startingPrice),initialMyOffer===null&&(initialMyOffer=props.offerPreview||props.startingPrice);let offers=[],offerIndex=0,lastMyOfferIndex=-1,lastTheirOfferIndex=-1;for(let item of history$1)item.myOffer==null?item.theirOffer!=null&&(offers.push({price:item.theirOffer,isMyOffer:!1,index:offerIndex++,isUnsent:!1}),lastTheirOfferIndex=offers.length-1):(offers.push({price:item.myOffer,isMyOffer:!0,index:offerIndex++,isUnsent:!1}),lastMyOfferIndex=offers.length-1);props.negotiationStatus!==`failed`&&props.negotiationStatus!==`accepted`&&props.offerPreview>0&&(offers.push({price:props.offerPreview,isMyOffer:!0,index:offerIndex++,isUnsent:!0}),lastMyOfferIndex=offers.length-1);let leftPrice=Math.min(initialTheirOffer,initialMyOffer),rightPrice=Math.max(initialTheirOffer,initialMyOffer),topIsTheir=props.amISelling,range=rightPrice-leftPrice||1,{majorTicks,minorTicks}=((min$1,max$1,priceRange)=>{let niceNumbers=[1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4],tickRange=max$1-min$1;if(tickRange===0)return{majorTicks:[],minorTicks:[]};let roughStep=tickRange/4,magnitude=10**Math.floor(Math.log10(roughStep)),normalizedStep=roughStep/magnitude,closestNice=niceNumbers[0],minDiff=Math.abs(normalizedStep-closestNice);for(let nice of niceNumbers){let diff=Math.abs(normalizedStep-nice);diff=min$1&&price<=max$1){let position=(price-leftPrice)/priceRange*100;majorTicks$1.push({price,position:Math.max(0,Math.min(100,position))})}let minorStep=step/5,minorTicks$1=[];for(let price=niceMin;price<=niceMax;price+=minorStep)if(price>=min$1&&price<=max$1&&Math.abs(price%step)>.01){let position=(price-leftPrice)/priceRange*100;minorTicks$1.push({price,position:Math.max(0,Math.min(100,position))})}return{majorTicks:majorTicks$1,minorTicks:minorTicks$1}})(leftPrice,rightPrice,range),hasVisibleTicks=range>0&&majorTicks.length>0,offerPositions=offers.map((offer,index)=>{let position=(offer.price-leftPrice)/range*100,isMostRecent=offer.isMyOffer&&index===lastMyOfferIndex||!offer.isMyOffer&&index===lastTheirOfferIndex;return{...offer,position:Math.max(0,Math.min(100,position)),isMostRecent}}),marketValuePosition=null;if(hasVisibleTicks&&props.actualVehicleValue!=null&&props.actualVehicleValue>0&&props.actualVehicleValue>=leftPrice&&props.actualVehicleValue<=rightPrice){let position=(props.actualVehicleValue-leftPrice)/range*100;marketValuePosition=Math.max(0,Math.min(100,position))}let initialMarkers=[];if(hasVisibleTicks){let theirPosition=initialTheirOffer===leftPrice?0:100;initialMarkers.push({price:initialTheirOffer,isMyOffer:!1,position:theirPosition,isInitial:!0});let myPosition=initialMyOffer===leftPrice?0:100;initialMarkers.push({price:initialMyOffer,isMyOffer:!0,position:myPosition,isInitial:!0})}return{initialTheirOffer,initialMyOffer,leftPrice,rightPrice,topIsTheir,hasBothInitialOffers,majorTicks,minorTicks,offers:offerPositions,marketValuePosition,initialMarkers}});return(_ctx,_cache)=>priceFinderData.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`price-finder-container`,{selling:__props.amISelling,buying:!__props.amISelling}])},[createBaseVNode(`div`,_hoisted_1$121,[createTextVNode(toDisplayString(priceFinderData.value.topIsTheir?`Your`:`Their`)+` Asking Price: `,1),createVNode(unref(bngUnit_default),{class:`money`,money:priceFinderData.value.rightPrice},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_2$101,[(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.minorTicks,(tick,index)=>(openBlock(),createElementBlock(`div`,{key:`minor-`+index,class:`price-finder-tick minor`,style:normalizeStyle({top:100-tick.position+`%`})},null,4))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.majorTicks,(tick,index)=>(openBlock(),createElementBlock(`div`,{key:`major-`+index,class:`price-finder-tick major`,style:normalizeStyle({top:100-tick.position+`%`})},[tick.position>5&&tick.position<95?(openBlock(),createElementBlock(`div`,_hoisted_3$89,toDisplayString(unref(units).beamBucks(tick.price)),1)):createCommentVNode(``,!0)],4))),128)),priceFinderData.value.hasBothInitialOffers?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(priceFinderData.value.offers,(offer,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`price-finder-marker`,{"my-offer":offer.isMyOffer,"their-offer":!offer.isMyOffer,"most-recent":offer.isMostRecent,unsent:offer.isUnsent}]),style:normalizeStyle({top:100-offer.position+`%`})},[..._cache[0]||=[createBaseVNode(`div`,{class:`marker-triangle`},null,-1)]],6))),128)):createCommentVNode(``,!0),priceFinderData.value.marketValuePosition===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:1,class:`price-finder-marker market-value`,style:normalizeStyle({top:100-priceFinderData.value.marketValuePosition+`%`,bottom:`0`})},[..._cache[1]||=[createBaseVNode(`div`,{class:`marker-dot`},null,-1)]],4)),(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.initialMarkers,(marker$1,index)=>(openBlock(),createElementBlock(`div`,{key:`initial-`+index,class:normalizeClass([`price-finder-marker`,{"my-offer":marker$1.isMyOffer,"their-offer":!marker$1.isMyOffer,initial:!0}]),style:normalizeStyle({top:100-marker$1.position+`%`})},[..._cache[2]||=[createBaseVNode(`div`,{class:`marker-triangle`},null,-1)]],6))),128))]),createBaseVNode(`div`,_hoisted_4$69,[createTextVNode(toDisplayString(priceFinderData.value.topIsTheir?`Their`:`Your`)+` initial offer: `,1),createVNode(unref(bngUnit_default),{class:`money`,money:priceFinderData.value.leftPrice},null,8,[`money`])])],2)):createCommentVNode(``,!0)}},PriceFinder_default=__plugin_vue_export_helper_default(_sfc_main$134,[[`__scopeId`,`data-v-ba044f86`]]),_hoisted_1$120={class:`center-wrap`},_hoisted_2$100={class:`header-row`},_hoisted_3$88={key:0,class:`header-seller-info`},_hoisted_4$68={class:`main-content`},_hoisted_5$58={class:`summary`},_hoisted_6$45={key:0,class:`vehicle-info`},_hoisted_7$38={class:`purchase-row`},_hoisted_8$31={class:`label`},_hoisted_9$28={class:`sub-info`},_hoisted_10$22={class:`price`},_hoisted_11$20={class:`offer-container`},_hoisted_12$15={class:`patience`},_hoisted_13$14={class:`label-row`},_hoisted_14$14={class:`offer-controls`},_hoisted_15$14={key:0,class:`offer-controls-row`},_hoisted_16$14={class:`step-buttons-group`},_hoisted_17$11={class:`resolved-negotiation-message`},_hoisted_18$9={class:`price-column`},_hoisted_19$7={key:0,class:`price`},_hoisted_20$6={key:1,class:`price`},_hoisted_21$6={class:`action-buttons wide`},_sfc_main$133={__name:`VehicleNegotiationMain`,setup(__props){useUINavScope(`vehicleNegotiation`);let{units}=useBridge(),events$3=useEvents(),router$1=useRouter(),state=ref({active:!1,startingPrice:0,patience:0,myOffer:null,theirOffer:0,thinking:!1,status:``,negotiationStatus:``,opponentName:``,vehicleNiceName:``,vehicleThumbnail:``,amISelling:!1}),opponent=computed(()=>state.value.amISelling?`Buyer`:`Seller`),biggerIsBetter=computed(()=>!!state.value.amISelling),increaseOfferDisabled=computed(()=>state.value.amISelling?state.value.myOffer!=null&&offerPreview.value>=state.value.myOffer:offerPreview.value>=state.value.theirOffer),decreaseOfferDisabled=computed(()=>state.value.amISelling?(console.log(`decreaseOfferDisabled`,offerPreview.value,state.value.theirOffer),offerPreview.value<=state.value.theirOffer):state.value.myOffer!=null&&offerPreview.value<=state.value.myOffer),offerPreview=ref(0);computed(()=>{let baseStep=state.value.startingPrice/500;return Math.round(baseStep/5)*5}),computed(()=>{let diff=(offerPreview.value-state.value.startingPrice)/state.value.startingPrice*100;return Math.round(diff)});let diffOfferPreviewToStarting=computed(()=>offerPreview.value-state.value.startingPrice),isDiffOfferPreviewToStartingGood=computed(()=>biggerIsBetter.value?diffOfferPreviewToStarting.value>=0:diffOfferPreviewToStarting.value<=0),diffPercentOfferPreviewToMarket=computed(()=>{if(!state.value.actualVehicleValue||state.value.actualVehicleValue===0)return null;let diff=(offerPreview.value-state.value.actualVehicleValue)/state.value.actualVehicleValue*100;return Math.round(diff)}),isDiffPercentOfferPreviewToMarketGood=computed(()=>diffPercentOfferPreviewToMarket.value===null?null:biggerIsBetter.value?diffPercentOfferPreviewToMarket.value>=0:diffPercentOfferPreviewToMarket.value<=0),diffTheirOfferToStarting=computed(()=>state.value.theirOffer-state.value.startingPrice);computed(()=>biggerIsBetter.value?diffTheirOfferToStarting.value>=0:diffTheirOfferToStarting.value<=0);let nudgeOffer=delta=>{let roundedOfferPreview=Math.max(0,Math.round((offerPreview.value+delta)/50)*50),min$1=0,max$1=1/0;state.value.amISelling?(min$1=state.value.theirOffer,state.value.myOffer!=null&&(max$1=state.value.myOffer)):(max$1=state.value.theirOffer,state.value.myOffer!=null&&(min$1=state.value.myOffer)),offerPreview.value=Math.min(max$1,Math.max(min$1,roundedOfferPreview))},offerDisabled=computed(()=>state.value.negotiationStatus===`thinking`||state.value.negotiationStatus===`typing`||state.value.negotiationStatus===`accepted`||state.value.negotiationStatus===`failed`),patienceClass=computed(()=>{let m=state.value.patience??0;return m>.66?`patience-good`:m>.33?`patience-mid`:`patience-bad`}),noDeal=computed(()=>state.value.negotiationStatus===`failed`&&state.value.amISelling);computed(()=>state.value.negotiationStatus===`failed`),computed(()=>{switch(String(state.value.negotiationStatus||``)){case`counterOffer`:return`Counter offer`;case`counterOfferLastChance`:return`Last chance counter offer`;case`accepted`:return`Accepted`;case`failed`:return`Negotiation failed`;case`refused`:return`Offer refused`;case`initial`:return`Initial offer`;case`thinking`:return`Thinking`;case`typing`:return`Typing...`;default:return``}});let resolvedStatusText=computed(()=>state.value.negotiationStatus===`failed`?state.value.amISelling?`The other party ran out of patience and does not want to buy this vehicle.`:`The other party ran out of patience. You can still buy the vehicle at the starting price: `:state.value.negotiationStatus===`accepted`?`Congratulations! You've successfully negotiatied a deal with `+state.value.opponentName+`.`:``),negotiationChat=ref(null),refresh$1=async()=>{state.value=await Lua_default.career_modules_marketplace.getNegotiationState()||state.value;let base=state.value.myOffer==null?state.value.startingPrice:state.value.myOffer;Number.isNaN(Number(base))||(offerPreview.value=Number(base)),state.value.negotiationStatus===`failed`&&(offerPreview.value=state.value.startingPrice)},submitOffer=async()=>{let price=Number(offerPreview.value);Number.isFinite(price)&&await Lua_default.career_modules_marketplace.makeNegotiationOffer(price)},takeOffer=async()=>{await Lua_default.career_modules_marketplace.takeTheirOffer(),state.value.negotiationStatus=`accepted`,state.value.status=`accepted`,offerPreview.value=state.value.theirOffer,state.value.iAccepted=!0,state.value.offerHistory.push({myOffer:state.value.theirOffer,negotiationStatus:`accepted`})},cancel=async()=>{state.value.negotiationStatus!==`accepted`&&await Lua_default.career_modules_marketplace.cancelNegotiation()},goBack=event=>{router$1.back(),state.value.negotiationStatus===`accepted`&&!state.value.iAccepted&&Lua_default.career_modules_marketplace.takeTheirOffer(),cancel(),event&&event.stopPropagation&&event.stopPropagation()};return events$3.on(`negotiationData`,data=>{refresh$1()}),onMounted(async()=>{await refresh$1(),nextTick(()=>{negotiationChat.value&&(negotiationChat.value.reset(),negotiationChat.value.scrollToBottom())})}),onUnmounted(async()=>{events$3.off(`negotiationData`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$120,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-ui-scope":`vehicleNegotiation`,class:`negotiation-screen`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_21$6,[state.value.negotiationStatus!==`accepted`&&state.value.negotiationStatus!==`failed`?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`submit-offer`,disabled:state.value.negotiationStatus===`counterOfferLastChance`||offerPreview.value==state.value.theirOffer||offerPreview.value==state.value.myOffer||offerDisabled.value,onClick:_cache[6]||=$event=>submitOffer(),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Submit This Offer `,-1)]]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),state.value.negotiationStatus!==`accepted`&&state.value.negotiationStatus!==`failed`?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`submit-offer`,disabled:state.value.negotiationStatus===`counterOfferLastChance`||offerDisabled.value,"show-hold":``},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` Agree to their Price `,-1)]]),_:1},8,[`disabled`])),[[unref(BngClick_default),{holdCallback:takeOffer,holdDelay:1e3,repeatInterval:0}]]):createCommentVNode(``,!0),state.value.negotiationStatus===`failed`||state.value.negotiationStatus===`accepted`?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:`go-back`,accent:unref(ACCENTS).primary,onClick:goBack},{default:withCtx(()=>[createTextVNode(toDisplayString(state.value.amISelling?`Continue`:`Go to Purchase Screen`),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$100,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(` Negotiation with `+toDisplayString(state.value.opponentName||opponent.value)+` `,1),state.value.opponentQuote?(openBlock(),createElementBlock(`div`,_hoisted_3$88,` "`+toDisplayString(state.value.opponentQuote)+`" `,1)):createCommentVNode(``,!0)]),_:1}),createVNode(unref(bngButton_default),{class:`close-button`,onClick:goBack,accent:unref(ACCENTS).attention,"bng-no-nav":`true`,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`menu`,controller:``}),createVNode(unref(bngIcon_default),{type:`xmarkBold`,color:`var(--bng-cool-gray-100)`})]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_4$68,[createBaseVNode(`div`,_hoisted_5$58,[state.value.vehicleNiceName||state.value.vehicleThumbnail?(openBlock(),createElementBlock(`div`,_hoisted_6$45,[createBaseVNode(`div`,_hoisted_7$38,[createBaseVNode(`div`,_hoisted_8$31,[createBaseVNode(`div`,null,toDisplayString(state.value.vehicleNiceName||`Vehicle`),1),createBaseVNode(`div`,_hoisted_9$28,toDisplayString(unref(units).buildString(`length`,state.value.vehicleMileage,0)),1)]),createBaseVNode(`div`,_hoisted_10$22,[_cache[7]||=createTextVNode(` Est. Market: `,-1),createBaseVNode(`div`,null,[createVNode(unref(bngUnit_default),{class:`money`,money:state.value.actualVehicleValue||0},null,8,[`money`])])])])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_11$20,[createVNode(NegotiationChat_default,{ref_key:`negotiationChat`,ref:negotiationChat,"offer-history":state.value.offerHistory||[],"negotiation-status":state.value.negotiationStatus,"starting-price":state.value.startingPrice||0,"am-i-selling":state.value.amISelling},null,8,[`offer-history`,`negotiation-status`,`starting-price`,`am-i-selling`]),createVNode(PriceFinder_default,{"offer-history":state.value.offerHistory||[],"negotiation-status":state.value.negotiationStatus,"starting-price":state.value.startingPrice||0,"offer-preview":offerPreview.value||0,"actual-vehicle-value":state.value.actualVehicleValue,"am-i-selling":state.value.amISelling},null,8,[`offer-history`,`negotiation-status`,`starting-price`,`offer-preview`,`actual-vehicle-value`,`am-i-selling`])]),createBaseVNode(`div`,_hoisted_12$15,[createBaseVNode(`div`,{class:normalizeClass([`bar`,patienceClass.value])},[_cache[8]||=createBaseVNode(`div`,{class:`separator`,style:{left:`33.0%`}},null,-1),_cache[9]||=createBaseVNode(`div`,{class:`separator`,style:{left:`66.0%`}},null,-1),createBaseVNode(`div`,{class:normalizeClass([`fill`,patienceClass.value]),style:normalizeStyle({width:Math.max(0,Math.min(1,state.value.patience||0))*100+`%`})},null,6)],2),createBaseVNode(`div`,_hoisted_13$14,[createBaseVNode(`span`,null,toDisplayString(opponent.value)+`'s Patience`,1)])]),createBaseVNode(`div`,_hoisted_14$14,[state.value.negotiationStatus!==`failed`&&state.value.negotiationStatus!==`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_15$14,[createBaseVNode(`div`,_hoisted_16$14,[createVNode(unref(bngButton_default),{class:`step step-large`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[0]||=$event=>nudgeOffer(-5e3)},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`-5000`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-medium`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[1]||=$event=>nudgeOffer(-500)},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`-500`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[2]||=$event=>nudgeOffer(-50)},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(`-50`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[3]||=$event=>nudgeOffer(50)},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`+50`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-medium`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[4]||=$event=>nudgeOffer(500)},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(`+500`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-large`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[5]||=$event=>nudgeOffer(5e3)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(`+5000`,-1)]]),_:1},8,[`disabled`])])])):createCommentVNode(``,!0),state.value.negotiationStatus===`failed`||state.value.negotiationStatus===`accepted`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`offer-controls-row`,{accepted:state.value.negotiationStatus===`accepted`,failed:state.value.negotiationStatus===`failed`}])},[createVNode(unref(bngIcon_default),{type:state.value.negotiationStatus===`accepted`?`checkmark`:`abandon`,class:`resolved-negotiation-icon`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_17$11,toDisplayString(resolvedStatusText.value),1)],2)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_18$9,[noDeal.value?(openBlock(),createElementBlock(`div`,_hoisted_19$7,` NO DEAL `)):(openBlock(),createElementBlock(`div`,_hoisted_20$6,toDisplayString(unref(units).beamBucks(offerPreview.value||0)),1)),diffOfferPreviewToStarting.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:2,class:normalizeClass([`diff-percent-offer-preview-to-starting`,{positive:isDiffOfferPreviewToStartingGood.value&&diffOfferPreviewToStarting.value!==0,negative:!isDiffOfferPreviewToStartingGood.value&&diffOfferPreviewToStarting.value!==0,zero:diffOfferPreviewToStarting.value===0,hidden:noDeal.value}])},[diffOfferPreviewToStarting.value===0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngUnit_default),{key:0,class:`money`,money:Math.abs(diffOfferPreviewToStarting.value)},null,8,[`money`])),createTextVNode(` `+toDisplayString(diffOfferPreviewToStarting.value<0?`under`:diffOfferPreviewToStarting.value>0?`over`:`Same as`)+` starting price `,1)],2)),diffPercentOfferPreviewToMarket.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:3,class:normalizeClass([`diff-percent-offer-preview-to-market`,{positive:isDiffPercentOfferPreviewToMarketGood.value,negative:!isDiffPercentOfferPreviewToMarketGood.value,hidden:noDeal.value}])},toDisplayString(Math.abs(diffPercentOfferPreviewToMarket.value))+`% `+toDisplayString(diffPercentOfferPreviewToMarket.value<0?`under`:`over`)+` Est. Market value `,3))])])])]),_:1})),[[unref(BngBlur_default),1]])]))}},VehicleNegotiationMain_default=__plugin_vue_export_helper_default(_sfc_main$133,[[`__scopeId`,`data-v-29ff8ba1`]]),routes_default$3=[{path:`/menu.careerPause`,name:`menu.careerPause`,component:Pause_default,props:!0,meta:{clickThrough:!0,infoBar:{withAngular:!0,visible:!0,showSysInfo:!0},uiApps:{shown:!1},topBar:{visible:!0}}},{path:`/career`,children:[{path:`chooseInsurance`,name:`chooseInsurance`,component:ChooseInsuranceMain_default},{path:`pauseBigMiddlePanel`,name:`pauseBigMiddlePanel`,component:PauseBigMiddlePanel_default,props:!0},{path:`logbook/:id(\\*?.*?)?`,name:`logbook`,component:Logbook_default,meta:{uiApps:{shown:!1}},props:!0},{path:`milestones/:id(\\*?.*?)?`,name:`milestones`,component:Milestones_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`computer`,name:`computer`,component:ComputerMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`vehicleInventory`,name:`vehicleInventory`,component:VehicleInventoryMain_default},{path:`vehiclePerformance/:inventoryId?`,name:`vehiclePerformance`,component:VehiclePerformanceMain_default,props:!0},{path:`tuning`,name:`tuning`,component:TuningMain_default},{path:`painting`,name:`painting`,component:PaintingMain_default},{path:`repair/:header?`,name:`repair`,component:RepairMain_default,props:!0},{path:`partShopping`,name:`partShopping`,component:PartShoppingMain_default,meta:{uiApps:{shown:!1}}},{path:`partInventory`,name:`partInventory`,component:PartInventoryMain_default},{path:`vehiclePurchase/:vehicleInfo?/:playerMoney?/:inventoryHasFreeSlot?/:lastVehicleInfo?`,name:`vehiclePurchase`,component:VehiclePurchaseMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`negotiation`,name:`negotiation`,component:VehicleNegotiationMain_default},{path:`vehicleShopping/:screenTag?/:buyingAvailable?/:marketplaceAvailable?/:selectedSellerId?`,name:`vehicleShopping`,component:VehicleShoppingMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`insurances`,name:`insurances`,component:InsurancesMain_default},{path:`playerAbstract`,name:`playerAbstract`,component:DriverAbstract_default},{path:`cargoDeliveryReward`,name:`cargoDeliveryReward`,component:CargoDeliveryReward_default,props:!0},{path:`cargoDropOff/:facilityId?/:parkingSpotPath(\\*?.*?)?`,name:`cargoDropOff`,component:CargoDropOff_default,props:!0},{path:`cargoOverview/:facilityId?/:parkingSpotPath(\\*?.*?)?`,name:`cargoOverview`,component:CargoOverviewMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`myCargo`,name:`myCargo`,component:MyCargo_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`progressLanding/:pathId?/:comesFromBigMap?`,name:`progressLanding`,component:ProgressLanding_default,props:route=>({pathId:route.params.pathId,comesFromBigMap:route.params.comesFromBigMap===`true`||route.params.comesFromBigMap===!0}),meta:{uiApps:{shown:!1},infoBar:{visible:!0}}},{path:`domainSelection`,name:`domainSelection`,component:ProgressLanding_default,props:!0,meta:{uiApps:{shown:!1},infoBar:{visible:!0}}},{path:`profiles`,name:`profiles`,component:Profiles_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}]}],data_default=[{translateId:`ui.credits.programmers`,members:[{first:`Thomas`,last:`Fischer`,aka:`tdev`,title:`CEO`},{first:`Lefteris`,last:`Stamatogiannakis`,aka:`estama`,title:`CTO / Physics / Sound / AI`},{first:`Luis`,last:`Anton Rebollo`,aka:`Souga`,title:`Lead Render Developer`},{first:`Alex`,last:`Spodheim`,aka:`CrankyCleric`,title:`Developer`},{first:`Ananda Neelam`,last:`Thathayya`,aka:`Nadeox1`,title:`Technical Artist`},{first:`Andrew`,last:`Kabakwu`,aka:``,title:`Developer`},{first:`Bruno`,last:`Gonzalez Campo`,aka:`stenyak`,title:`Lead Game Engine Developer`},{first:`Cosmin`,last:`Traian`,aka:``,title:`Developer`},{first:`Emre`,last:`Kut`,aka:``,title:`Developer`},{first:`Felix`,last:`Unger`,aka:``,title:`Developer`},{first:`George`,last:`Troulitakis`,aka:`AtmanB`,title:`Developer`},{first:`Guillem`,last:`Ortega`,aka:``,title:`Developer`},{first:`Logane`,last:`Ramez`,aka:`Gadoy`,title:`Developer`},{first:`Lorenzo`,last:`Bartali`,aka:``,title:`AI Developer`},{first:`Ludger`,last:`Meyer-Wülfing`,aka:`meywue`,title:`Developer`},{first:`Nicusor`,last:`Nedelcu`,aka:``,title:`Tools Developer`},{first:`Panos`,last:`Karabelas`,aka:``,title:`Developer`},{first:`Patrick `,last:`Schrangl`,aka:``,title:`Simulation Software Engineer`},{first:`Petros`,last:`Kondylis`,aka:``,title:`AI Developer`},{first:`Ronny`,last:`Nowak`,aka:``,title:`Developer`},{first:`Thomas`,last:`Portassau`,aka:`thomatoes50`,title:`Developer`},{first:`Thomas`,last:`Wilczynski`,aka:`Gamergull`,title:`Developer`},{first:`Timo`,last:`Stabbert`,aka:``,title:`Gameplay Dev Lead`},{first:`Valery`,last:`Dolotin`,aka:``,title:`AI Developer`},{first:`Daniel`,last:`Wakefield`,aka:``,title:`Developer`}]},{translateId:`ui.credits.vehiclePhysics`,members:[{first:`Fabian`,last:`Enkler`,aka:`Diamondback`,title:`Vehicle Systems Lead`},{first:`Angelo`,last:`Matteo`,aka:`angelo234`,title:`Tools Developer`},{first:`Aubrey`,last:`Percival`,aka:``,title:`Vehicle Physics Engineer`},{first:`Bobby`,last:`Villeneuve`,aka:`Binkey`,title:`Vehicle Physics Engineer`},{first:`Brian`,last:`Rickets`,aka:``,title:`Vehicle Systems Engineer`},{first:`Corey`,last:`Bergerud`,aka:`Goosah`,title:`Vehicle Physics Engineer`},{first:`Davide`,last:`Serpi`,aka:``,title:`Vehicle Dynamics Control Intern`},{first:`Efe Can`,last:`Kiraz`,aka:`RenAzuma66`,title:`Vehicle Physics Engineer`},{first:`Grzegorz`,last:`Węgrzyn`,aka:`AiTorror`,title:`Vehicle Physics Engineer / QA`},{first:`Jack`,last:`Jermany`,aka:``,title:`Vehicle Physics Engineer / QA`},{first:`Oliver`,last:`Čajka`,aka:`MRcrash`,title:`Vehicle Physics Engineer`},{first:`Piotr`,last:`Gajek`,aka:`Agent_Y`,title:`Vehicle Physics Engineer / QA`},{first:`Toma Ioan`,last:` Turcu`,aka:``,title:`Vehicle Physics Engineer`},{first:`Quinn`,last:`Howling`,aka:`SpeedHero`,title:`Vehicle Physics Designer`}]},{translateId:`ui.credits.vehicleArt`,members:[{first:`Gabriel`,last:`Fink`,aka:`gabester`,title:`Vehicle Art Director`},{first:`Jared`,last:`Samuelson`,aka:``,title:`Vehicle Team Lead / Subaru Expert`},{first:`Alexandr`,last:`Shesternin`,aka:``,title:`3D Vehicle Artist`},{first:`Andreas`,last:`Focht`,aka:``,title:`Vehicle Concept Artist`},{first:`Daniel`,last:`Russo`,aka:`A3DR`,title:`3D Vehicle Artist`},{first:`Dennis`,last:`Mateja`,aka:`NinetyNine`,title:`Vehicle Designer`},{first:`Manish`,last:`Rawat`,aka:``,title:`3D Vehicle Artist`}]},{translateId:`ui.credits.environmentArtists`,members:[{first:`Sam`,last:`Hutchinson`,aka:`LJFHutch`,title:`Environment Art Director`},{first:`Luca`,last:`Brighi`,aka:``,title:`Lead 3D Environment Artist`},{first:`Huiqin`,last:`Li`,aka:``,title:`3D Environment Artist`},{first:`Sebastien`,last:`Pelletier`,aka:`DoullPepper`,title:`3D Environment Artist`}]},{translateId:`ui.credits.conceptArtists`,members:[{first:`Mary Jane`,last:`Pajaron`,aka:``,title:`2D Concept Artist`}]},{translateId:`ui.credits.gameDesigners`,members:[{first:`James`,last:`Heslop`,aka:`Krallopian`,title:`Game Design Lead`},{first:`Alex`,last:`Bird`,aka:``,title:`Gameplay Developer`},{first:`Rob`,last:`Herridge`,aka:`HighDef`,title:`Gameplay Developer / QA`}]},{translateId:`ui.credits.ui`,members:[{first:`Pavel`,last:`Tiunov`,aka:`Dizboosta`,title:`UI Lead`},{first:`Destiny`,last:`Abellana`,aka:``,title:`Developer`},{first:`Stani`,last:`Tolmacheva`,aka:`Snowly`,title:`Developer`}]},{translateId:`ui.credits.sound`,members:[{first:`Mark`,last:`Knight`,aka:`TDK`,title:`Audio Designer`},{first:`Sebastian`,last:`Emling`,aka:``,title:`Audio Designer`},{first:`Jethro`,last:`Dunn`,aka:``,title:`Audio Outsourcer`},{first:`Max`,last:`Schumann`,aka:``,title:`Audio Outsourcer`}]},{translateId:`ui.credits.qa`,members:[{first:`Colin`,last:`Wenz`,aka:`synsol`,title:`QA Lead`},{first:`Przemysław`,last:`Wolny`,aka:`Car_Killer`,title:`QA / Mod Support`}]},{translateId:`ui.credits.production`,members:[{first:`Ryan`,last:`Dunne`,aka:``,title:`Producer`}]},{translateId:`ui.credits.sysops`,members:[{first:`Charalampos`,last:`Tsipizidis`,aka:``,title:`System Administrator`},{first:`Dimitrios`,last:`Folias`,aka:``,title:`System Administrator`}]},{translateId:`ui.credits.comms`,members:[{first:`Nataliia`,last:`Dmytriievska`,aka:`Leeloo`,title:`Communications & Marketing Lead`},{first:`Bernice`,last:`Mills`,aka:`Bee`,title:`Community Support & Marketing Specialist`},{first:`Mariia`,last:`Gumarova`,aka:`Fluffy Panda`,title:`Customer Support & Marketing Specialist`},{first:`Slawomir`,last:`Niemczyk`,aka:`Sedricoo`,title:`Community Coordinator`},{first:`Vincent`,last:`Liu`,aka:``,title:`Community & Marketing Specialist (APAC)`}]},{translateId:`ui.credits.research`,members:[{first:`Chrysanthi`,last:`Papamichail`,aka:``,title:`Lead Research Software Engineer`},{first:`Abdulrahman`,last:`Saeed`,aka:``,title:`Research Software Engineer`},{first:`Adam`,last:`Ivora`,aka:``,title:`Research Software Engineer`},{first:`David`,last:`Stark`,aka:``,title:`Research Software Engineer`},{first:`Florian`,last:`Faistauer`,aka:``,title:`Vehicle Simulation Expert`},{first:`Gabriel Puretas`,last:`Moral`,aka:``,title:`UX Intern`},{first:`Sayali`,last:`Rajhans`,aka:``,title:`Research Software Engineer`},{first:`Iskren`,last:`Rusimov`,aka:``,title:`Research Software Engineer Intern`}]},{translateId:`ui.credits.organization`,members:[{first:`Christoforos`,last:`Lambrianidis`,aka:``,title:`CFO`},{first:`Joseph`,last:`Inba Raj`,aka:``,title:`HR & Talent Acquisition Lead`},{first:`Cecilia`,last:`Sari`,aka:``,title:`Recruitment Specialist`},{first:`Dimitra`,last:`Litsardou`,aka:`Thamy`,title:`EU / Co-funding Advisory Specialist`},{first:`Eva`,last:`Pigova`,aka:``,title:`Senior Program Manager`},{first:`Maria`,last:`Kosmachevskaya`,aka:``,title:`Business Development Intern`},{first:`Özge`,last:`Altinkaya Erkok`,aka:``,title:`Communication Consultant`},{first:`Renars`,last:`Skesteris`,aka:``,title:`Business Development Intern`},{first:`Sabrina`,last:`Wee`,aka:``,title:`Business Development Manager`},{first:`Sandra`,last:`Campos`,aka:``,title:`Accounting Assistant`},{first:`Ulrike`,last:`Lentz`,aka:``,title:`Executive Assistant`}]},{translateId:`ui.credits.additionalVehiclePhysics`,members:[{first:`Will`,last:`Leader`,aka:``,title:`Off-road Suspension Development and Vehicle Dynamics`}]},{translateId:`ui.credits.additionalVehicleArt`,members:[{first:`Ashish`,last:`Singh`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`Juan Manuel`,last:`Orcellet`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`M. Yusuf`,last:`Bolukbasi`,aka:``,title:`Freelance Vehicle Artist`},{first:`Naman`,last:`Deep`,aka:``,title:`Freelance 3D Vehicle Artist`}]},{translateId:`ui.credits.externalContributors`,members:[{first:`Da`,last:`Li`,aka:``,title:``},{first:`Ruhmit`,last:`Sahu `,aka:``,title:``}]},{translateId:`ui.credits.formerEmployee`,members:[{first:`Aaron`,last:`Sutcliffe`,aka:``,title:`Developer / Vehicle Creation`},{first:`Alex`,last:`Raskin`,aka:``,title:`DevOps Engineer`},{first:`Artem`,last:`Arbatskii`,aka:``,title:`Developer`},{first:`Arturo`,last:`Campos`,aka:``,title:`Developer`},{first:`Ben`,last:`Payne`,aka:``,title:`Developer`},{first:`Boluwatife`,last:`Falaye`,aka:``,title:`Developer`},{first:`Clément`,last:`Roche`,aka:``,title:`Developer`},{first:`Edelmar`,last:`Schneider`,aka:``,title:`Developer`},{first:`Eike`,last:`Externest`,aka:``,title:`Developer`},{first:`Jali`,last:`Hautala`,aka:`Jalkku`,title:`Developer`},{first:`Jeremy`,last:`Lu`,aka:``,title:`Developer`},{first:`John`,last:`Beinecke`,aka:``,title:`Developer`},{first:`Juan`,last:`Mendez`,aka:``,title:`Developer`},{first:`Leander`,last:`Beernaert`,aka:``,title:`Game Engine Developer`},{first:`Marc`,last:`Müller`,aka:``,title:`Developer`},{first:`Mark`,last:`Vince`,aka:``,title:`Developer`},{first:`Matti`,last:`Yrjänheikki`,aka:`Masa`,title:`Developer`},{first:`Max`,last:`Razer`,aka:``,title:`Developer`},{first:`Mayowa David`,last:`Abogunrin`,aka:``,title:`Developer`},{first:`Moncef`,last:`Slimane`,aka:``,title:`Developer`},{first:`Nourelhoda`,last:`Mohamed`,aka:``,title:`Developer`},{first:`Pascale`,last:`Maul`,aka:``,title:`Developer`},{first:`Paul`,last:`De Almeida`,aka:``,title:`AI Developer`},{first:`Paul`,last:`Görs`,aka:``,title:`Developer`},{first:`Peter`,last:`Landwehr`,aka:``,title:`Developer`},{first:`Petteri`,last:`Koivumäki`,aka:``,title:`Developer`},{first:`Vasilis`,last:`Douvaras`,aka:``,title:`Developer`},{first:`Vatroslav `,last:`Bodrozic`,aka:``,title:`Developer`},{first:`Waldemar`,last:`Zeitler`,aka:``,title:`Developer`},{first:`Xiaoyi`,last:`Wang`,aka:``,title:`Developer`},{first:``,last:``,aka:``,title:``},{first:`Adrian`,last:`Baboi`,aka:``,title:`Vehicle Creation`},{first:`Brandon`,last:`Proulx`,aka:`Hondune`,title:`Vehicle Creation`},{first:`Carlos`,last:`Bergillos Varela`,aka:`CarlosAir`,title:`Content Creation`},{first:`David`,last:`Thurlbeck`,aka:``,title:`Vehicle Creation`},{first:`Janne`,last:`Nummela`,aka:``,title:`Vehicle Creation`},{first:`Jukka`,last:`Muikkula`,aka:`Miura`,title:`Vehicle Creation`},{first:`Karol`,last:`Miklas`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`Mardem`,last:`Pires das Dores`,aka:``,title:`Vehicle Creation`},{first:`Mikko`,last:`Lesonen`,aka:``,title:`Vehicle Creation`},{first:`Renju`,last:`Therakathu`,aka:``,title:`Vehicle Creation`},{first:`Sam`,last:`Millington`,aka:`DrowsySam`,title:`Vehicle Creation / Support`},{first:`Sebastian`,last:`Wessel`,aka:``,title:`Vehicle Creation`},{first:`Virtual Mechanix`,last:``,aka:``,title:`Vehicle Creation - Outsourcing Agency`},{first:`Winston`,last:`Broderick`,aka:``,title:`Vehicle Creation`},{first:`Mitchell`,last:`Sahl`,aka:`B25Mitch`,title:`3D Vehicle / Environment Artist`},{first:``,last:``,aka:``,title:``},{first:`Christin`,last:`Walther`,aka:``,title:`Lead 3D Artist`},{first:`Justin`,last:`Roczniak`,aka:`Donoteat`,title:`Environment Artist`},{first:`Lisa`,last:`Steinberg`,aka:``,title:`2D Artist`},{first:`Moses`,last:`Mulinge`,aka:``,title:`2D Artist`},{first:``,last:``,aka:``,title:``},{first:`Barend`,last:`van der Meulen`,aka:``,title:`Content Creator`},{first:`Matthias`,last:`Niebergall`,aka:``,title:`Game Designer`},{first:`SanityCheckMyGame`,last:``,aka:``,title:`Additional Design`},{first:``,last:``,aka:``,title:``},{first:`Georgios`,last:`Siantikos`,aka:`gntikos`,title:`User Interface`},{first:`Jonathan`,last:`Randy`,aka:``,title:`Lead Developer`},{first:`Mirco`,last:`Weigel`,aka:`theshark`,title:`User Interface`},{first:`Svetlozar`,last:`Valchev`,aka:``,title:`User Interface`},{first:`Theodoros`,last:`Manouilidis`,aka:``,title:`User Interface`},{first:`Yale`,last:`Hartmann`,aka:``,title:`User Interface`},{first:``,last:``,aka:``,title:``},{first:`Arend`,last:`Stührmann`,aka:``,title:`Producer`},{first:`Marie Cécile`,last:`Jacq`,aka:``,title:`Producer`},{first:`Nhung Van`,last:`Ho`,aka:``,title:`Project Management`},{first:``,last:``,aka:``,title:``},{first:`Bhavinkumar Babulal`,last:`Arya`,aka:``,title:`Research Software Engineer`},{first:`Carol`,last:`Halim`,aka:`Carotte`,title:`Research Software Engineer`},{first:`Elmar`,last:`Berghöfer`,aka:``,title:`Research`},{first:`Mattia`,last:`Vicari`,aka:``,title:`Research Software Engineer`},{first:``,last:``,aka:``,title:``},{first:`Camila`,last:`Navia`,aka:``,title:`Operations Assistant`},{first:`Danish`,last:`Abbasi`,aka:``,title:`Business Development Intern`},{first:`Lucien`,last:`Frei`,aka:``,title:`Business Development Intern`},{first:`Weiwei`,last:`Kong`,aka:``,title:`Business Development Intern`},{first:`Özgen`,last:`Saatçilar`,aka:``,title:`Communications Consultant`},{first:`Saskia`,last:`Opitz`,aka:``,title:`Administration`},{first:``,last:``,aka:``,title:``},{first:`Hala`,last:`Mahmoud`,aka:``,title:`Quality Assurance`},{first:`Jan Niklas`,last:`Hasse`,aka:``,title:`Quality Assurance`},{first:`Kamil`,last:`Kozak`,aka:``,title:`Quality Assurance`},{first:`Kemisola`,last:`Adeniyi`,aka:``,title:`Quality Assurance`},{first:`Kaja`,last:`Jambrek`,aka:``,title:`Quality Assurance`},{first:`Rajinder`,last:`Rajinder`,aka:``,title:`Quality Assurance`},{first:`Safdar`,last:`Mahmood`,aka:``,title:`Quality Assurance`},{first:`Uros`,last:`Sakic`,aka:`Uki`,title:`QA / Mod Support / Tools QA`},{first:``,last:``,aka:``,title:``},{first:`Konstantinos`,last:`Stamou`,aka:``,title:`System Administrator`},{first:``,last:``,aka:``,title:``},{first:`Erik`,last:`Heldt`,aka:``,title:`Documentation`},{first:`Maxime`,last:`Desharnais`,aka:``,title:`Documentation`},{first:`Harm`,last:`Schulz`,aka:``,title:`Student Assistant`},{first:`Annisa`,last:`Utami`,aka:``,title:`Student Assistant`},{first:`Brandon`,last:`Lynch`,aka:`Chuck_Norris_`,title:`Community Coordinator`},{first:`Monica`,last:`Huang`,aka:``,title:`Community Coordinator`}]},{translateId:`ui.credits.ourAwesomeCommunity`,members:[{first:`Daniel`,last:`Jones`,aka:`daniel_j`},{first:`Dennis`,last:`Wrekenhorst`,aka:`Dennis-W`},{first:`Dustin`,last:`Kutchara`,aka:`dkutch`},{first:`Kristian`,last:`Fagerland`,aka:``},{first:`Richard`,last:`Sixsmith`,aka:`Metalmuncher`},{first:`Sergy`,last:`Karpowicz`,aka:`0xsergy`},{first:`Sven`,last:`Nabeck`,aka:`sputnik_1`},{first:`Tom`,last:`Verhoeve`,aka:`Mythbuster`},{first:`Yannis`,last:`Vaiopoulos`,aka:`JohnV`},{first:``,last:``,aka:`Fufsgfen`}]},{translateId:`ui.credits.specialThanksTo`,members:[{first:`Luis`,last:`Placid`,aka:``,title:`VFX Developer`},{first:`Pierre-Michel`,last:`Ricordel`,aka:`pricorde`}]},{translateId:`ui.credits.soundtrack`,members:[{first:`Gabriel "gabester" Fink`,last:`Copyright 2014`,aka:`Lonle`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Element No. 10`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Getting Away`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Juno Rocks`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Neon Night Racer`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Night Driver`}]},{translateId:`ui.credits.madePossibleWith`,members:[{first:`FMOD Studio by Firelight Technologies Pty Ltd.`,last:``,aka:``},{first:`LuaJIT`,last:``,aka:``},{first:`lua-intf, LuaBridge`,last:``,aka:``},{first:`Chromium Embedded Framework`,last:``,aka:``},{first:`AngularJS`,last:``,aka:``},{first:`Vue.js`,last:``,aka:``},{first:`Material Design`,last:``,aka:``},{first:`LuaSocket`,last:``,aka:``},{first:`Dear ImGui`,last:``,aka:``},{first:`Blender ®`,last:`www.blender.org`,aka:``}]},{translateId:``,members:[{first:`“DUALSHOCK” and “DualSense” are registered trademarks or trademarks of Sony Interactive Entertainment Inc. Library programs for DUALSHOCK®4 and DualSense™ wireless controllers © 2022 Sony Interactive Entertainment Inc.`,last:``,aka:``}]}],_hoisted_1$119={class:`bng-credits-content`},_hoisted_2$99=[`src`],_hoisted_3$87={class:`category`},_hoisted_4$67={class:`credits-table`},_hoisted_5$57={class:`member-cell member-name`},_hoisted_6$44={key:0,class:`aka`},_hoisted_7$37={key:1},_hoisted_8$30={key:0,class:`member-cell member-dot`},_hoisted_9$27={key:1},_hoisted_10$21={key:2,class:`member-cell member-role`},_hoisted_11$19={key:3},_sfc_main$132={__name:`CreditsScroller`,setup(__props){useUINavScope(`credits`);let imageURL=getAssetURL(`images/logos.svg#bng-drive-white`),wrapper=ref(),running=!0,exit=()=>{running=!1,Lua_default.extensions.unload(`ui_credits`),Lua_default.scenetree[`maincef:setMaxFPSLimit`](30),window.bngVue.gotoAngularState(`menu.mainmenu`)};onMounted(()=>{Lua_default.extensions.load(`ui_credits`),Lua_default.scenetree[`maincef:setMaxFPSLimit`](60),wrapper.value.focus(),scrollContainer(wrapper.value,65,exit)}),onUnmounted(()=>{exit()});function scrollContainer(container,pxPerSecond){let scrollSpeed=pxPerSecond/1e3,currentPos=0,lastTime=0,smoother=0;window.requestAnimationFrame(function step(timestamp){let delta=Math.min(150,Math.max(0,timestamp-lastTime));smoother+=(delta-smoother)*.02;let moveDelta=smoother*scrollSpeed;lastTime=timestamp,currentPos+=moveDelta;let targetPos=container.scrollHeight-container.clientHeight;running&¤tPoswithDirectives((openBlock(),createElementBlock(`div`,{ref_key:`wrapper`,ref:wrapper,class:`bng-credits-wrapper`,tabindex:`0`,onKeypress:exit,"bng-ui-scope":`credits`},[createBaseVNode(`div`,_hoisted_1$119,[createBaseVNode(`img`,{class:`logo`,src:unref(imageURL),alt:``},null,8,_hoisted_2$99),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data_default),(category,cIndex)=>(openBlock(),createElementBlock(`div`,{key:cIndex},[createBaseVNode(`div`,_hoisted_3$87,[createBaseVNode(`span`,null,toDisplayString(_ctx.$t(category.translateId)),1)]),createBaseVNode(`div`,_hoisted_4$67,[(openBlock(!0),createElementBlock(Fragment,null,renderList(category.members,(member,mIndex)=>(openBlock(),createElementBlock(`div`,{class:`member-row`,key:mIndex},[createBaseVNode(`span`,_hoisted_5$57,[createTextVNode(toDisplayString(member.first)+` `,1),member.aka?(openBlock(),createElementBlock(`span`,_hoisted_6$44,toDisplayString(`<`+member.aka+`>`),1)):(openBlock(),createElementBlock(`span`,_hoisted_7$37,`\xA0`)),createTextVNode(` `+toDisplayString(member.last),1)]),member.title?(openBlock(),createElementBlock(`span`,_hoisted_8$30,` . `)):(openBlock(),createElementBlock(`span`,_hoisted_9$27,`\xA0`)),member.title?(openBlock(),createElementBlock(`span`,_hoisted_10$21,toDisplayString(_ctx.$t(member.title)),1)):(openBlock(),createElementBlock(`span`,_hoisted_11$19,`\xA0`))]))),128))])]))),128)),_cache[0]||=createBaseVNode(`div`,{style:{"padding-top":`70vh`}},null,-1)])],32)),[[unref(BngOnUiNav_default),exit,`menu,back`]])}},CreditsScroller_default=__plugin_vue_export_helper_default(_sfc_main$132,[[`__scopeId`,`data-v-9c2fdcd3`]]),routes_default$4=[{path:`/credits`,name:`credits`,component:CreditsScroller_default}],_hoisted_1$118={class:`details`,"bng-nav-scroll":``},_hoisted_2$98={key:0,class:`header-content`},_hoisted_3$86={key:1,class:`preview`},_hoisted_4$66={key:2,class:`tags-section`},_hoisted_5$56={class:`tags-container`},_hoisted_6$43=[`onClick`],_hoisted_7$36=[`src`],_hoisted_8$29={key:3,class:`description`},_hoisted_9$26={key:0,class:`specs-grid`},_hoisted_10$20={class:`specs-grid-container`},_hoisted_11$18={class:`spec-content`},_hoisted_12$14={class:`spec-label`},_hoisted_13$13={class:`spec-value`},_hoisted_14$13={key:0,class:`bottom-section`},_hoisted_15$13={class:`buttons-section`},_hoisted_16$13={key:1,class:`button-container`},_sfc_main$131={__name:`GameplayDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,default:()=>{}},toggleFavourite:{type:Function,default:()=>{}},exploreFolder:{type:Function,default:()=>{}},goToMod:{type:Function,default:()=>{}},showHeaderTitle:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},buttonOverride:{type:Object,default:null}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`gameplay-details`,{inline:__props.inline}])},[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$118,[__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_2$98,[__props.showHeaderTitle?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`none`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.activeItemDetails.headerTitle),1)]),_:1})):createCommentVNode(``,!0),__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_3$86,[createVNode(unref(aspectRatio_default),{class:normalizeClass([`preview-image`,{"has-header-title":__props.showHeaderTitle}]),ratio:`16:8`,"external-image":__props.activeItemDetails.preview},{default:withCtx(()=>[__props.inline?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`favourite-icon`,type:__props.activeItemDetails?.isFavourite?`star`:`starSecondary`,onClick:_cache[0]||=$event=>__props.toggleFavourite(__props.activeItem),color:__props.activeItemDetails?.isFavourite?`var(--bng-ter-yellow-50)`:`var(--bng-cool-gray-100)`},null,8,[`type`,`color`]))]),_:1},8,[`external-image`,`class`])])):createCommentVNode(``,!0),__props.activeItemDetails?.tags?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_4$66,[createBaseVNode(`div`,_hoisted_5$56,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.tags,tag=>(openBlock(),createElementBlock(`div`,{key:tag.key||tag.label,class:normalizeClass([`tag-item`,{clickable:tag.goToMod}]),onClick:$event=>tag.goToMod?__props.goToMod(tag.goToMod):null},[tag.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:tag.icon},null,8,[`type`])):createCommentVNode(``,!0),tag.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:tag.svg},null,8,_hoisted_7$36)):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(tag.label),1)],10,_hoisted_6$43))),128))])])):createCommentVNode(``,!0),__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_8$29,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.activeItemDetails?.buttonInfo?.length>0||__props.activeItemDetails?.bottomTags?.length>0?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_9$26,[createBaseVNode(`div`,_hoisted_10$20,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_11$18,[createBaseVNode(`div`,_hoisted_12$14,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_13$13,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]]),__props.activeItemDetails?.buttonInfo?.length>0||__props.buttonOverride?(openBlock(),createElementBlock(`div`,_hoisted_14$13,[createBaseVNode(`div`,_hoisted_15$13,[__props.buttonOverride?createCommentVNode(``,!0):(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createElementBlock(`div`,{key:button.buttonId,class:`button-container`},[createVNode(unref(bngButton_default),{"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`])]))),128)),__props.buttonOverride?(openBlock(),createElementBlock(`div`,_hoisted_16$13,[createVNode(unref(bngButton_default),{"bng-scoped-nav-autofocus":!0,accent:`main`,label:__props.buttonOverride.label,icon:__props.buttonOverride.icon,onClick:_cache[1]||=$event=>__props.buttonOverride.click(__props.activeItem)},null,8,[`label`,`icon`])])):createCommentVNode(``,!0)])])):createCommentVNode(``,!0)],2))}},GameplayDetails_default=__plugin_vue_export_helper_default(_sfc_main$131,[[`__scopeId`,`data-v-7baeb809`]]),_hoisted_1$117=[`bng-ui-scope`],_hoisted_2$97={class:`popup-content`},_hoisted_3$85={class:`modal-header`},_hoisted_4$65={class:`vehicle-selector-section`},_hoisted_5$55={class:`vehicle-tile-wrapper`},_hoisted_6$42={class:`modal-content`},_hoisted_7$35={class:`spawnpoint-section`},_hoisted_8$28={class:`spawnpoint-info`},_hoisted_9$25={key:0,class:`spawnpoint-preview`},_hoisted_10$19=[`src`],_hoisted_11$17={class:`spawnpoint-name`},_hoisted_12$13={key:0,class:`config-section`},_hoisted_13$12={class:`group-title`},_hoisted_14$12={key:0},_hoisted_15$12={class:`always-show-section`},_hoisted_16$12={key:0,class:`modal-footer`},_sfc_main$130={__name:`LevelConfigurationModal`,props:{levelData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){useUINavBlocker().allowNavigationOnly();let{lua,events:events$3}=useBridge(),props=__props,emit$1=__emit,scopeName=usePopupUINavScopeName(`_levelConfigPopup`,props);provide(`gridSelectionState`,ref(null));let spawningOptions=ref([]),config=reactive({}),alwaysShowDialogue=ref(!1),vehicleTile=ref({}),loadSpawningOptions=async()=>{try{let levelName=props.levelData?.levelName,backendName=props.levelData?.backendName,result=await lua.ui_gameplaySelector_tileGenerators_levelTiles.getSpawningOptions(levelName,backendName);if(result){let options=result.options||[];spawningOptions.value=options,alwaysShowDialogue.value=result.alwaysShowDialogue||!1,result.vehicleTile?vehicleTile.value={key:`vehicle-selector`,name:result.vehicleTile.name||`Select Vehicle`,preview:result.vehicleTile.preview||`/ui/modules/vehicleSelector/placeholder.png`,sourceIcons:result.vehicleTile.sourceIcons||[]}:vehicleTile.value={key:`vehicle-selector`,name:`Select Vehicle`,preview:`/ui/modules/vehicleSelector/placeholder.png`,sourceIcons:[]},options.forEach(group=>{group.options&&Array.isArray(group.options)&&group.options.forEach(option=>{option.key&&option.value!==void 0&&(config[option.key]=option.value)})})}}catch(error){console.error(`Failed to load spawning options:`,error)}},handleOptionChange=async(key,newValue)=>{try{await lua.ui_gameplaySelector_tileGenerators_levelTiles.changeSpawningOption(key,newValue),events$3.emit(`gridSelectorRefreshCurrentItemDetails`,`freeroamSelector`)}catch(error){console.error(`Failed to update ${key} option:`,error)}},handleAlwaysShowDialogueChange=async newValue=>{try{let backendName=props.levelData?.backendName;await lua.ui_gameplaySelector_tileGenerators_levelTiles.setAlwaysShowDialogue(backendName,newValue),events$3.emit(`gridSelectorRefreshCurrentItemDetails`,`freeroamSelector`)}catch(error){console.error(`Failed to save default action preference:`,error)}},openVehicleSelector=async()=>{try{await lua.ui_vehicleSelector_general.openVehicleSelectorForFreeroamModal(),emit$1(`return`,!0)}catch(e){console.error(`Failed to open vehicle selector:`,e)}};onMounted(()=>{loadSpawningOptions()});let closeModal=()=>{emit$1(`return`,!1)},handleButtonClick=buttonId=>{closeModal(),events$3.emit(`gridSelectorExecuteButton`,`freeroamSelector`,buttonId)},handleCancelWithBack=()=>{closeModal()};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`level-configuration-modal popup`,"bng-ui-scope":unref(scopeName)},[createBaseVNode(`div`,_hoisted_2$97,[createBaseVNode(`div`,_hoisted_3$85,[_cache[1]||=createBaseVNode(`h2`,null,`Freeroam Spawning Options`,-1),createVNode(unref(bngIcon_default),{type:`xmarkBold`,class:`close-button`,onClick:closeModal,color:`var(--bng-cool-gray-100)`})]),createBaseVNode(`div`,_hoisted_4$65,[_cache[2]||=createBaseVNode(`h3`,{class:`group-title`},`Vehicle`,-1),createBaseVNode(`div`,_hoisted_5$55,[createTextVNode(toDisplayString(vehicleTile.value)+` `,1),createVNode(Tile_default,{tile:vehicleTile.value,displaySize:`small`,isConfig:!0,onClick:openVehicleSelector},null,8,[`tile`])])]),createBaseVNode(`div`,_hoisted_6$42,[createBaseVNode(`div`,_hoisted_7$35,[_cache[3]||=createBaseVNode(`h3`,null,`Selected Spawnpoint`,-1),createBaseVNode(`div`,_hoisted_8$28,[__props.levelData?.spawnPoint?.previews?.[0]?(openBlock(),createElementBlock(`div`,_hoisted_9$25,[createBaseVNode(`img`,{src:__props.levelData.spawnPoint.previews[0],alt:`Spawnpoint preview`},null,8,_hoisted_10$19)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_11$17,toDisplayString(_ctx.$tt(__props.levelData?.spawnPoint?.translationId||`No Name?`)),1)])]),spawningOptions.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_12$13,[(openBlock(!0),createElementBlock(Fragment,null,renderList(spawningOptions.value,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[createBaseVNode(`h3`,_hoisted_13$12,toDisplayString(group.name),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.options,option=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key},[option.label?(openBlock(),createElementBlock(`label`,_hoisted_14$12,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label)+`: `,1)])):createCommentVNode(``,!0),createVNode(unref(bngSelect_default),{modelValue:config[option.key],"onUpdate:modelValue":[$event=>config[option.key]=$event,newValue=>handleOptionChange(option.key,newValue)],options:option.options,loop:``,config:{value:opt=>opt.value,label:opt=>opt.label}},null,8,[`modelValue`,`onUpdate:modelValue`,`options`,`config`])]))),128))]))),128))])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$12,[createVNode(unref(bngSwitch_default),{modelValue:alwaysShowDialogue.value,"onUpdate:modelValue":[_cache[0]||=$event=>alwaysShowDialogue.value=$event,handleAlwaysShowDialogueChange],label:`Always show this dialogue`,labelBefore:``},null,8,[`modelValue`])]),spawningOptions.value.length>0||__props.levelData?.buttonInfo&&__props.levelData.buttonInfo.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$12,[__props.levelData?.buttonInfo&&__props.levelData.buttonInfo.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.levelData.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,label:button.label,icon:button.icon,accent:button.primary?`main`:`secondary`,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`label`,`icon`,`accent`,`onClick`]))),128)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])],8,_hoisted_1$117)),[[unref(BngOnUiNav_default),handleCancelWithBack,`back,menu`]])}},LevelConfigurationModal_default=__plugin_vue_export_helper_default(_sfc_main$130,[[`__scopeId`,`data-v-ec35f32c`]]),_sfc_main$129={__name:`FreeroamSelector`,setup(__props){let{events:events$3}=useBridge(),handleOpenLevelConfigPopup=data=>{addPopup(LevelConfigurationModal_default,{levelData:data}).promise};return onMounted(()=>{events$3.on(`openLevelConfigurationPopup`,handleOpenLevelConfigPopup)}),onUnmounted(()=>{events$3.off(`openLevelConfigurationPopup`,handleOpenLevelConfigPopup)}),(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`freeroamSelector`,routePath:`/freeroam-selector`,defaultPath:{keys:[`allFreeroam`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[createVNode(GameplayDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`,`exploreFolder`,`goToMod`])]),_:1}))}},FreeroamSelector_default=_sfc_main$129,_hoisted_1$116={class:`preview`},_hoisted_2$96={key:0,class:`general-tags`},_hoisted_3$84={key:1,class:`icon-text-tag`},_hoisted_4$64={class:`vehicle-text-header`},_hoisted_5$54={key:0,class:`general-specs`},_hoisted_6$41={key:1,class:`divider`},_hoisted_7$34={class:`vehicle-tags`},_hoisted_8$27=[`onClick`],_hoisted_9$24=[`src`],_hoisted_10$18={key:0,class:`source-icon-container`},_hoisted_11$16={key:1,class:`source-icon-container`},_hoisted_12$12={key:2,class:`source-icon-container auxiliary-icon`},_hoisted_13$11={key:2,class:`vehicle-description`},_hoisted_14$11={class:`specs-grid-container`},_hoisted_15$11={key:0,class:`spec-label`},_hoisted_16$11={class:`spec-value`},_hoisted_17$10={key:1,class:`spec-value`},_hoisted_18$8={key:0,class:`bottom-section`},_hoisted_19$6={class:`paint-list expanded`},_sfc_main$128={__name:`VehicleDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,default:()=>{}},toggleFavourite:{type:Function,default:()=>{}},exploreFolder:{type:Function,default:()=>{}},goToMod:{type:Function,default:()=>{}},showHeaderTitle:{type:Boolean,default:!0},hideDetailsAndButtons:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},buttonOverride:{type:Object,default:null}},emits:[`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,handleButtonClick=buttonId=>{let additionalData={};selectedMultiPaint.value&&(additionalData.paint=selectedMultiPaint.value.paintNames[0],additionalData.paint2=selectedMultiPaint.value.paintNames[1],additionalData.paint3=selectedMultiPaint.value.paintNames[2]),selectedPaint.value&&(additionalData.paint=selectedPaint.value.name),props.executeButton(buttonId,additionalData),emit$1(`button-click`,buttonId)},toggleFavourite=()=>{props.activeItem&&props.toggleFavourite(props.activeItem)},openFolder=path=>{props.exploreFolder(path)},goToMod=modId=>{props.goToMod(modId)},sortedFactoryPaints=computed(()=>{let factoryPaints=props.activeItemDetails?.paints?.factoryPaints;return Array.isArray(factoryPaints)?sortColors(factoryPaints).filter(paint=>paint&&paint.name):[]}),multiPaints=computed(()=>{let res=[],multiPaintSetups=props.activeItemDetails?.paints?.multiPaintSetups,factoryPaints=props.activeItemDetails?.paints?.factoryPaints;if(!Array.isArray(multiPaintSetups)||!Array.isArray(factoryPaints))return res;for(let i=0;iname&&factoryPaints.find(paint=>paint.name===name)||null).filter(paint=>paint!==null);paints.length>0&&res.push({id:paintNames.join(`|`),name:setup$3.name,paintNames,paints,applyAll:()=>applyMultipaint(setup$3)})}return res}),hasPaintData=computed(()=>props.activeItemDetails?.additionalData?.paint&&props.activeItemDetails?.paints?.factoryPaints),paintData=computed(()=>{if(!hasPaintData.value)return null;let additionalData=props.activeItemDetails.additionalData,factoryPaints=props.activeItemDetails.paints.factoryPaints,paintNames=[additionalData.paint,additionalData.paint2,additionalData.paint3].filter(name=>name),paints=paintNames.map(name=>{let paint=factoryPaints.find(p$1=>p$1.name===name);return paint?convertPaintToTileFormat(paint):null}).filter(paint=>paint!==null);return paints.length===0?null:{paint:paintNames[0],paintNames,paints}});function applyMultipaint(setup$3){selectedMultiPaint.value=setup$3,selectedPaint.value=null}let selectedMultiPaint=ref(null),selectedPaint=ref(null);ref(!1);let handleMultiPaintClick=(multiPaint,focus$1=!0)=>{selectedMultiPaint.value=multiPaints.value.find(mp=>mp.name===multiPaint.name),selectedPaint.value=null,focus$1&&emit$1(`focus-item`,`multiPaints`)},handlePaintClick=paint=>{selectedPaint.value=paint,selectedMultiPaint.value=null,emit$1(`focus-item`,`paints`)},convertPaintToTileFormat=paint=>{if(!paint)return null;if(paint.baseColor&&paint.paintString)return paint;try{let paintObj=new Paint;return paintObj.paint=paint,paintObj.paintObject}catch(error){return console.warn(`Failed to convert paint:`,paint,error),null}},selectDefaultMultiPaint=()=>{if(!props.activeItemDetails?.paints)return;let multiPaintSetups=props.activeItemDetails?.paints.multiPaintSetups;if(Array.isArray(multiPaintSetups)&&multiPaintSetups.length>0){let defaultMultiPaintSetup=multiPaintSetups.find(setup$3=>setup$3.isDefault);if(defaultMultiPaintSetup){let multiPaintsObj=multiPaints.value.find(mp=>mp.name===defaultMultiPaintSetup.name);if(multiPaintsObj){handleMultiPaintClick(multiPaintsObj,!1);return}}}};watch(()=>props.activeItemDetails,()=>{selectDefaultMultiPaint()}),onMounted(()=>{selectDefaultMultiPaint()});function average(arr){return arr.reduce((a$1,b)=>a$1+b)/arr.length}function valComparable(col,thres=.05){let bool=!0,av=average(col);for(let i=0;i=col[i];return bool&&=av>.8||av<.2,bool}function colorHigherHelper(itm){if(!itm||!itm.orig||!itm.orig.baseColor||!Array.isArray(itm.orig.baseColor)||itm.orig.baseColor.length<4)return 0;let av=average(itm.orig.baseColor.slice(0,3)),al=itm.orig.baseColor[3]/2,res=Math.abs(av-1)*al;return res===0?(av+al)/2:res+1}function colorHigher(a$1,b){if(!a$1||!b||!a$1.orig||!b.orig||!a$1.orig.baseColor||!b.orig.baseColor)return 0;let aColor=valComparable(a$1.orig.baseColor.slice(0,3)),bColor=valComparable(b.orig.baseColor.slice(0,3));if(aColor&&bColor)return colorHigherHelper(b)-colorHigherHelper(a$1);if(aColor&&!bColor)return 1;if(!aColor&&bColor)return-1;for(let i=0;i<3;i++)if(a$1.val[i]!==b.val[i])return a$1.val[i]-b.val[i];return 0}function colorValue(arr){if(!Array.isArray(arr)||arr.length<4)return[0,0,0,0];let repitions=8,rgb=[];for(let i=0;i<3;i++)rgb[i]=(1-arr[3]/2)*arr[i]+arr[3]/2*arr[i];let lum=Math.sqrt(.241*rgb[0]+.691*rgb[1]+.068*rgb[2]),hsl=Paint.rgbToHsl(rgb),out=[hsl[0],lum,hsl[1]].map(elem=>elem*8);return out[0]%2==1&&(out[1]=8-out[1],out[2]=8-out[2]),out.push(arr[3]),out}function sortColors(list){return Array.isArray(list)?list.filter(elem=>elem&&elem.baseColor&&Array.isArray(elem.baseColor)&&elem.baseColor.length>=4).map(elem=>({val:colorValue(elem.baseColor),orig:elem})).sort(colorHigher).map(elem=>elem.orig):[]}return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details`,{inline:__props.inline}]),"bng-nav-scroll":``},[createBaseVNode(`div`,_hoisted_1$116,[__props.showHeaderTitle?(openBlock(),createBlock(bngCardHeading_default,{key:0,type:`none`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.activeItemDetails.headerTitle),1)]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`tags-and-preview`,{"has-header-title":__props.showHeaderTitle}])},[__props.activeItemDetails?.iconTags?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$96,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.iconTags,icon=>(openBlock(),createBlock(bngTooltip_default,{key:icon.icon,text:icon.label,position:`left`},{default:withCtx(()=>[icon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:icon.icon,label:icon.label,onClick:$event=>goToMod(icon.goToMod),class:normalizeClass({"favourite-icon":icon.goToMod})},null,8,[`type`,`label`,`onClick`,`class`])):createCommentVNode(``,!0),icon.iconText?(openBlock(),createElementBlock(`span`,_hoisted_3$84,toDisplayString(icon.iconText),1)):createCommentVNode(``,!0)]),_:2},1032,[`text`]))),128))])):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:normalizeClass([`preview-image`,{"has-header-title":__props.showHeaderTitle}]),ratio:`16:8`,"external-image":__props.activeItemDetails?.preview},{default:withCtx(()=>[__props.inline?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`favourite-icon`,type:__props.activeItemDetails?.isFavourite?`star`:`starSecondary`,onClick:toggleFavourite,color:__props.activeItemDetails?.isFavourite?`var(--bng-ter-yellow-50)`:`var(--bng-cool-gray-100)`},null,8,[`type`,`color`])),hasPaintData.value?(openBlock(),createBlock(unref(bngPaintTile_default),{key:1,"paint-id":`${__props.activeItem?.id||`vehicle`}:${paintData.value.paint}`,paint:paintData.value.paints,"paint-name":paintData.value.paintNames.join(`, `),width:56,height:24,class:`preview-paint-tile`,"bng-no-nav":`true`,tabindex:`-1`},null,8,[`paint-id`,`paint`,`paint-name`])):createCommentVNode(``,!0)]),_:1},8,[`class`,`external-image`])],2)]),createBaseVNode(`div`,_hoisted_4$64,[__props.activeItemDetails?.generalSpecs?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$54,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.generalSpecs,spec=>(openBlock(),createElementBlock(`div`,{class:`spec-value`,key:spec.key},[Array.isArray(spec.value)?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.$tt(spec.value[0].text)),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(spec.value),1)],64))]))),128))])):createCommentVNode(``,!0),__props.activeItemDetails?.generalSpecs.length>0?(openBlock(),createElementBlock(`div`,_hoisted_6$41)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$34,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.tags,tag=>(openBlock(),createElementBlock(`div`,{key:tag.key,class:normalizeClass([`source-icon-container`,{"auxiliary-icon":tag.auxiliary}]),onClick:$event=>_ctx.tagClicked(tag)},[tag.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:tag.icon},null,8,[`type`])):createCommentVNode(``,!0),tag.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:tag.svg},null,8,_hoisted_9$24)):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(tag.label),1)],10,_hoisted_8$27))),128)),__props.activeItemDetails?.sourceIcon?(openBlock(),createElementBlock(`div`,_hoisted_10$18,[createVNode(unref(bngIcon_default),{type:__props.activeItemDetails?.sourceIcon.icon,onClick:_cache[0]||=$event=>goToMod(__props.activeItemDetails?.sourceIcon.goToMod)},null,8,[`type`]),createTextVNode(` `+toDisplayString(__props.activeItemDetails?.sourceIcon.label),1)])):createCommentVNode(``,!0),__props.activeItemDetails?.isFavourite?(openBlock(),createElementBlock(`div`,_hoisted_11$16,[createVNode(unref(bngIcon_default),{type:`star`,onClick:toggleFavourite}),_cache[2]||=createTextVNode(` Favourite`,-1)])):createCommentVNode(``,!0),__props.activeItemDetails?.configDetails.isAuxiliary?(openBlock(),createElementBlock(`div`,_hoisted_12$12,[createVNode(unref(bngIcon_default),{type:`bug`}),_cache[3]||=createTextVNode(` Auxiliary`,-1)])):createCommentVNode(``,!0)]),__props.activeItemDetails?.configDetails?.Description?(openBlock(),createElementBlock(`div`,_hoisted_13$11,toDisplayString(__props.activeItemDetails?.configDetails?.Description),1)):createCommentVNode(``,!0)]),__props.activeItemDetails?.configDetails&&!__props.hideDetailsAndButtons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails?.specificationsList,(value,key)=>(openBlock(),createElementBlock(`div`,{key,class:`specs-grid`},[createBaseVNode(`div`,_hoisted_14$11,[(openBlock(!0),createElementBlock(Fragment,null,renderList(value.specifications,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:normalizeClass([`spec-cell`,{"full-width":!specification.key}])},[specification.key?(openBlock(),createElementBlock(`div`,_hoisted_15$11,toDisplayString(specification.key)+`:`,1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_16$11,[Array.isArray(specification.value)?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(specification.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`spec-value-item`,{italic:item.italic}])},[createBaseVNode(`span`,null,toDisplayString(item.text),1),specification.postIcon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`spec-post-icon`,type:specification.postIcon},null,8,[`type`])):createCommentVNode(``,!0),specification.openFolder?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`spec-post-icon`,type:`folder`,onClick:$event=>openFolder(specification.value)},null,8,[`onClick`])):createCommentVNode(``,!0)],2))),128)):(openBlock(),createElementBlock(`div`,_hoisted_17$10,[createBaseVNode(`span`,null,toDisplayString(specification.value),1),specification.postIcon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`spec-post-icon`,type:specification.postIcon},null,8,[`type`])):createCommentVNode(``,!0),specification.openFolder?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`spec-post-icon`,type:`folder`,onClick:$event=>openFolder(specification.value)},null,8,[`onClick`])):createCommentVNode(``,!0)]))])],2))),128))])]))),128)):createCommentVNode(``,!0)],2)),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]]),__props.hideDetailsAndButtons?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$8,[createBaseVNode(`div`,_hoisted_19$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(multiPaints.value,multiPaint=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:multiPaint.name,"paint-id":`${__props.activeItem?.id||`vehicle`}:${multiPaint.name}`,paint:multiPaint.paints,"paint-name":multiPaint.name,"paint-names":multiPaint.paintNames,width:56,height:24,class:normalizeClass([`multi-paint-item`,{selected:selectedMultiPaint.value?.name===multiPaint.name}]),onClick:$event=>handleMultiPaintClick(multiPaint)},null,8,[`paint-id`,`paint`,`paint-name`,`paint-names`,`class`,`onClick`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedFactoryPaints.value,paint=>(openBlock(),createElementBlock(Fragment,{key:paint.name},[paint&&paint.class===`factory`&&paint.name?(openBlock(),createBlock(unref(bngPaintTile_default),{key:0,"paint-id":`${__props.activeItem?.id||`vehicle`}:${paint.name}`,paint:convertPaintToTileFormat(paint),"vehicle-name":`factory`,"paint-name":paint.name,width:24,height:24,class:normalizeClass([`paint-item`,{selected:selectedPaint.value===paint}]),onClick:$event=>handlePaintClick(paint)},null,8,[`paint-id`,`paint`,`paint-name`,`class`,`onClick`])):createCommentVNode(``,!0)],64))),128))]),__props.activeItemDetails?.buttonInfo&&!__props.buttonOverride?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails?.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128)):createCommentVNode(``,!0),__props.buttonOverride?(openBlock(),createBlock(unref(bngButton_default),{key:1,"bng-scoped-nav-autofocus":!0,accent:`main`,label:__props.buttonOverride.label,icon:__props.buttonOverride.icon,onClick:_cache[1]||=$event=>__props.buttonOverride.click(__props.activeItem,selectedPaint.value,selectedMultiPaint.value)},null,8,[`label`,`icon`])):createCommentVNode(``,!0)]))],64))}},VehicleDetails_default=__plugin_vue_export_helper_default(_sfc_main$128,[[`__scopeId`,`data-v-58d013e3`]]);function useFreeroamConfigurator(){let{events:events$3}=useBridge(),configData=ref(null),button=ref(null),error=ref(null),isInitializing=ref(!1),refreshConfigHandler=()=>{logger_default.debug(`freeroamConfiguratorRefreshConfig`),loadConfiguration()},refreshButtonHandler=()=>{logger_default.debug(`freeroamConfiguratorRefreshButton`),loadButtons()};events$3.on(`freeroamConfiguratorRefreshConfig`,refreshConfigHandler),events$3.on(`freeroamConfiguratorRefreshButton`,refreshButtonHandler);let loadButtons=async()=>{try{let buttonData=await Lua_default.freeroam_freeroamConfigurator.getButtons();button.value=buttonData||null,logger_default.debug(`Loaded button:`,buttonData)}catch(err){logger_default.error(`Failed to load button:`,err),error.value=err}},loadConfiguration=async()=>{try{error.value=null;let data=await Lua_default.freeroam_freeroamConfigurator.getConfiguration();data?.options&&processOptionsTree(data.options),configData.value=data,logger_default.debug(`Loaded configuration:`,data),await loadButtons()}catch(err){logger_default.error(`Failed to load freeroam configuration:`,err),error.value=err}},processOptionsTree=options=>{!options||!Array.isArray(options)||options.forEach(group=>{group.key&&(group.onChange=val=>{group.value=val,handleOptionChange(group.key,val)}),Object.defineProperty(group,`enabled`,{get(){return!this.key||!!this.value},enumerable:!0,configurable:!0}),group.options&&Array.isArray(group.options)&&group.options.forEach(option=>{option.key&&(option.onChange=val=>{option.value=val,handleOptionChange(option.key,val)})})})},onSpawnPointTileClick=async()=>{try{await Lua_default.freeroam_freeroamConfigurator.onSpawnPointTileClick(),logger_default.debug(`Spawn point tile clicked`)}catch(err){logger_default.error(`Failed to handle spawnpoint tile click:`,err),error.value=err}},onVehicleTileClick=async()=>{try{await Lua_default.freeroam_freeroamConfigurator.onVehicleTileClick(),logger_default.debug(`Vehicle tile clicked`)}catch(err){logger_default.error(`Failed to handle vehicle tile click:`,err),error.value=err}},updateOption=async(key,value)=>{try{await Lua_default.freeroam_freeroamConfigurator.updateOption(key,value),logger_default.debug(`Updated option ${key}:`,value)}catch(err){logger_default.error(`Failed to update option ${key}:`,err),error.value=err}},handleOptionChange=async(key,newValue)=>{try{await Lua_default.freeroam_freeroamConfigurator.updateOption(key,newValue),await loadButtons(),logger_default.debug(`Handled option change ${key}:`,newValue)}catch(err){logger_default.error(`Failed to update ${key} option:`,err),error.value=err}},handleButtonClick=async buttonId=>{try{await Lua_default.freeroam_freeroamConfigurator.triggerButton(buttonId),logger_default.debug(`Button clicked:`,buttonId)}catch(err){logger_default.error(`Failed to trigger button:`,err),error.value=err}},selectSpawnPoint=async(levelName,spawnPointObjectName,key)=>{try{if(!levelName)throw logger_default.error(`selectSpawnPoint: levelName is required`),Error(`levelName is required`);return await Lua_default.freeroam_freeroamConfigurator.setSpawnPoint(levelName,spawnPointObjectName,key),configData.value.currentSpawnPoint=await Lua_default.freeroam_freeroamConfigurator.getCurrentSpawnPointTile(),logger_default.debug(`Selected spawn point:`,{levelName,spawnPointObjectName}),!0}catch(err){return logger_default.error(`Failed to select spawn point:`,err),error.value=err,!1}},selectVehicle=async(model,config,additionalData,key)=>{try{if(!model||!config)throw logger_default.error(`selectVehicle: model and config are required`),Error(`model and config are required`);return await Lua_default.freeroam_freeroamConfigurator.setVehicle(model,config,additionalData||{},key),configData.value.currentVehicle=await Lua_default.freeroam_freeroamConfigurator.getCurrentVehicleTile(),logger_default.debug(`Selected vehicle:`,{model,config,additionalData}),!0}catch(err){return logger_default.error(`Failed to select vehicle:`,err),error.value=err,!1}},gotoHeaderItem=item=>{item.gotoPath&&(window.bngVue.gotoGameState(item.gotoPath.path,{params:item.gotoPath.props}),logger_default.debug(`Navigated to path:`,item.gotoPath)),item.gotoAngularState&&(window.bngVue.gotoAngularState(item.gotoAngularState),logger_default.debug(`Navigated to angular state:`,item.gotoAngularState)),item.click&&(item.click(),logger_default.debug(`Navigated to click:`,item.click))},goBack=()=>{logger_default.debug(`goBack called`),gotoHeaderItem({gotoAngularState:`menu.mainmenu`})},hasOptions=computed(()=>configData.value?.options&&configData.value.options.length>0),hasSpawnPoint=computed(()=>!!configData.value?.currentSpawnPoint),hasVehicle=computed(()=>!!configData.value?.currentVehicle),canConfigureOptions=computed(()=>hasSpawnPoint.value&&hasVehicle.value),isGroupEnabled=group=>!group.key||!!group.value,initialize=async()=>{if(isInitializing.value){logger_default.debug(`Already initializing, skipping...`);return}try{isInitializing.value=!0,logger_default.debug(`Initializing FreeroamConfigurator composable...`),await loadConfiguration(),logger_default.debug(`FreeroamConfigurator composable initialized successfully`)}catch(err){logger_default.error(`Failed to initialize FreeroamConfigurator composable:`,err),error.value=err}finally{isInitializing.value=!1}},cleanup=()=>{logger_default.debug(`FreeroamConfigurator composable cleanup`),events$3.off(`freeroamConfiguratorRefreshConfig`,refreshConfigHandler),events$3.off(`freeroamConfiguratorRefreshButton`,refreshButtonHandler)};return onUnmounted(()=>{cleanup()}),{configData,config:configData,button,error,isInitializing,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,loadConfiguration,loadButtons,onSpawnPointTileClick,onVehicleTileClick,updateOption,handleOptionChange,handleButtonClick,selectSpawnPoint,selectVehicle,gotoHeaderItem,goBack,isGroupEnabled}}var _hoisted_1$115={class:`configurator-content`},_hoisted_2$95={key:0,class:`error-state`},_hoisted_3$83={class:`error-content`},_hoisted_4$63={key:1,class:`configurator-sections`,"bng-nav-item":``},_hoisted_5$53={class:`three-column-layout`},_hoisted_6$40={class:`config-section`,"bng-nav-item":``},_hoisted_7$33={class:`section-header`},_hoisted_8$26={class:`section-title-value`},_hoisted_9$23={class:`section-content`},_hoisted_10$17={key:0,class:`clickable`},_hoisted_11$15={key:1,class:`placeholder-content`},_hoisted_12$11={class:`config-section`,"bng-nav-item":``},_hoisted_13$10={class:`section-header`},_hoisted_14$10={class:`section-title-value`},_hoisted_15$10={class:`section-content`},_hoisted_16$10={key:0,class:`clickable`},_hoisted_17$9={key:1,class:`placeholder-content`},_hoisted_18$7={class:`config-section`,"bng-nav-item":``},_hoisted_19$5={class:`section-header`},_hoisted_20$5={key:0,class:`options-scope`},_hoisted_21$5={key:0,class:`section-header`},_hoisted_22$5=[`bng-scoped-nav-autofocus`],_hoisted_23$4={class:`option-label`},_hoisted_24$3={key:1,class:`placeholder-content`},_hoisted_25$2={class:`action-button-container`},_hoisted_26$1={class:`button-content`},_hoisted_27$1={key:1,class:`placeholder-content row`},_sfc_main$127={__name:`FreeroamConfigurator`,setup(__props){let{lua}=useBridge(),{configData,config,button,error,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,onSpawnPointTileClick,onVehicleTileClick,handleOptionChange,handleButtonClick,gotoHeaderItem,goBack,isGroupEnabled}=useFreeroamConfigurator();return onBeforeMount(()=>{lua.simTimeAuthority.pushPauseRequest(`freeroamConfigurator`)}),onMounted(()=>{initialize()}),onUnmounted(()=>{lua.simTimeAuthority.popPauseRequest(`freeroamConfigurator`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`freeroam-configurator`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$115,[createVNode(unref(bngScreenHeadingV2_default),{class:`configurator-heading`},{preheadings:withCtx(()=>[createVNode(unref(bngBreadcrumbs_default),{"show-back-button":!0,simple:``,"disable-last-item":``,class:`configurator-breadcrumbs`,onBack:unref(goBack),onClick:unref(gotoHeaderItem),items:[{label:`Menu`,gotoAngularState:`menu.mainmenu`},{label:`Freeroam Configurator`}]},null,8,[`onBack`,`onClick`])]),default:withCtx(()=>[_cache[3]||=createTextVNode(` Freeroam `,-1)]),_:1}),unref(error)?(openBlock(),createElementBlock(`div`,_hoisted_2$95,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_3$83,[createVNode(unref(bngIcon_default),{type:`warning`,class:`error-icon`}),_cache[5]||=createBaseVNode(`p`,null,`Failed to load configuration`,-1),createVNode(unref(bngButton_default),{onClick:unref(initialize),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Retry`,-1)]]),_:1},8,[`onClick`,`accent`])])])):withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$63,[createBaseVNode(`div`,_hoisted_5$53,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$40,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_7$33,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[6]||=createBaseVNode(`span`,{class:`section-title-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_8$26,toDisplayString(unref(configData)?.currentSpawnPoint?.headerTitle||`Select location...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_9$23,[createBaseVNode(`div`,{class:`selectable-component`,onClick:_cache[0]||=()=>unref(onSpawnPointTileClick)()},[unref(configData)?.currentSpawnPoint?(openBlock(),createElementBlock(`div`,_hoisted_10$17,[createVNode(GameplayDetails_default,{"active-item":{levelName:unref(configData).currentSpawnPoint.levelName,spawnPointObjectName:unref(configData).currentSpawnPoint.spawnPointObjectName},"active-item-details":unref(configData).currentSpawnPoint,inline:``},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_11$15,[createVNode(unref(bngIcon_default),{type:`road`,class:`placeholder-icon`}),_cache[7]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select location`,-1)]))])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(onSpawnPointTileClick)(),`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_12$11,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_13$10,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[8]||=createBaseVNode(`span`,{class:`section-title-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_14$10,toDisplayString(unref(configData)?.currentVehicle?.headerTitle||`Select vehicle...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_15$10,[createBaseVNode(`div`,{class:`selectable-component`,onClick:_cache[1]||=()=>unref(onVehicleTileClick)()},[unref(configData)?.currentVehicle?(openBlock(),createElementBlock(`div`,_hoisted_16$10,[createVNode(VehicleDetails_default,{"active-item":{model:unref(configData).currentVehicle.model,config:unref(configData).currentVehicle.config},"active-item-details":unref(configData).currentVehicle,"hide-details-and-buttons":``,inline:``},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_17$9,[createVNode(unref(bngIcon_default),{type:`car`,class:`placeholder-icon`}),_cache[9]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select vehicle`,-1)]))])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(onVehicleTileClick)(),`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_18$7,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_19$5,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Options`,-1)]]),_:1})]),createBaseVNode(`div`,{class:normalizeClass([`section-content`,{disabled:!unref(canConfigureOptions)}])},[unref(hasOptions)?(openBlock(),createElementBlock(`div`,_hoisted_20$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(configData).options,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[group.name?(openBlock(),createElementBlock(`div`,_hoisted_21$5,[createVNode(unref(bngCardHeading_default),{outline:!unref(isGroupEnabled)(group),type:`ribbon`,class:`section-title`},{default:withCtx(()=>[group.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,class:`group-switch`,modelValue:unref(config)[group.key],"onUpdate:modelValue":[$event=>unref(config)[group.key]=$event,newValue=>unref(handleOptionChange)(group.key,newValue)],label:group.name,labelBefore:``,inline:``,alwaysTransparent:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):createCommentVNode(``,!0)]),_:2},1032,[`outline`])])):createCommentVNode(``,!0),unref(isGroupEnabled)(group)?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(group.options,(option,optionIndex)=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key,"bng-scoped-nav-autofocus":optionIndex===0},[createBaseVNode(`div`,{class:normalizeClass([`option-row`,{disabled:option.disabled}])},[createBaseVNode(`label`,_hoisted_23$4,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label),1)]),option.type===`select`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:unref(config)[option.key],items:option.options||[],threshold:80,"onUpdate:modelValue":newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,modelValue:unref(config)[option.key],"onUpdate:modelValue":[$event=>unref(config)[option.key]=$event,newValue=>unref(handleOptionChange)(option.key,newValue)],label:option.label,labelBefore:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):option.type===`string`?(openBlock(),createBlock(unref(bngInput_default),{key:2,modelValue:unref(config)[option.key],"onUpdate:modelValue":$event=>unref(config)[option.key]=$event,placeholder:option.placeholder,"char-max":option.maxLength,onValueChanged:newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`,`char-max`,`onValueChanged`])):option.type===`number`?(openBlock(),createBlock(unref(bngInput_default),{key:3,modelValue:unref(config)[option.key],"onUpdate:modelValue":$event=>unref(config)[option.key]=$event,type:`number`,"num-min":option.min,"num-max":option.max,"num-step":option.step,onValueChanged:newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`onUpdate:modelValue`,`num-min`,`num-max`,`num-step`,`onValueChanged`])):createCommentVNode(``,!0)],2)],8,_hoisted_22$5))),128)):createCommentVNode(``,!0)]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_24$3,[createVNode(unref(bngIcon_default),{type:`adjust`,class:`placeholder-icon`}),_cache[11]||=createBaseVNode(`p`,{class:`placeholder-text`},`No options available`,-1)]))],2)])),[[unref(BngBlur_default)],[unref(BngScopedNav_default),{type:unref(SCOPED_NAV_TYPES).normal}]])]),createBaseVNode(`div`,_hoisted_25$2,[createVNode(BlurBackground_default),unref(button)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`action-button`,accent:unref(ACCENTS).custom,onClick:_cache[2]||=()=>unref(handleButtonClick)(unref(button).meta.buttonId),"bng-scoped-nav-autofocus":``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_26$1,[unref(button).meta.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(button).meta.icon,class:`button-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(unref(button).meta.label),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default)]]):(openBlock(),createElementBlock(`div`,_hoisted_27$1,[createVNode(unref(bngIcon_default),{type:`play`,class:`placeholder-icon`}),_cache[12]||=createBaseVNode(`p`,{class:`placeholder-text`},`Select location and vehicle to start`,-1)]))])])),[[unref(BngScopedNav_default),{canDeactivate:()=>!1,activateOnMount:!0}],[unref(BngOnUiNav_default),unref(goBack),`back,menu`]])])]),_:1})),[[unref(BngOnUiNav_default),unref(goBack),`back,menu`]])}},FreeroamConfigurator_default=__plugin_vue_export_helper_default(_sfc_main$127,[[`__scopeId`,`data-v-14f15b24`]]),_hoisted_1$114={class:`options-panel-content`},_hoisted_2$94={class:`header-row`},_hoisted_3$82={key:0,class:`options-scope`},_hoisted_4$62={key:0,class:`section-header`},_hoisted_5$52={class:`option-label`},_hoisted_6$39={key:1,class:`placeholder-content`},_sfc_main$126={__name:`OptionsPanel`,props:{options:{type:Array,default:()=>[]},hasOptions:{type:Boolean,default:!1},canConfigureOptions:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$114,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_2$94,[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Options `,-1)]]),_:1})]),createBaseVNode(`div`,{class:normalizeClass([`section-content`,{disabled:!__props.canConfigureOptions}])},[__props.hasOptions?(openBlock(),createElementBlock(`div`,_hoisted_3$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.options,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[group.name?(openBlock(),createElementBlock(`div`,_hoisted_4$62,[createVNode(unref(bngCardHeading_default),{outline:!group.enabled,type:`ribbon`,class:`section-title`},{default:withCtx(()=>[group.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,class:`group-switch`,modelValue:group.value,"onUpdate:modelValue":[$event=>group.value=$event,group.onChange],label:group.name,labelBefore:``,inline:``,alwaysTransparent:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):createCommentVNode(``,!0)]),_:2},1032,[`outline`])])):createCommentVNode(``,!0),group.enabled?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(group.options,(option,optionIndex)=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key},[createBaseVNode(`div`,{class:normalizeClass([`option-row`,{disabled:option.disabled}])},[createBaseVNode(`label`,_hoisted_5$52,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label),1)]),option.type===`select`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,"onUpdate:modelValue":[$event=>option.value=$event,option.onChange],items:option.options||[],threshold:80},null,8,[`modelValue`,`onUpdate:modelValue`,`items`])):option.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,modelValue:option.value,"onUpdate:modelValue":[$event=>option.value=$event,option.onChange],label:option.label,labelBefore:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):option.type===`string`?(openBlock(),createBlock(unref(bngInput_default),{key:2,modelValue:option.value,"onUpdate:modelValue":$event=>option.value=$event,placeholder:option.placeholder,"char-max":option.maxLength,onValueChanged:option.onChange},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`,`char-max`,`onValueChanged`])):option.type===`number`?(openBlock(),createBlock(unref(bngInput_default),{key:3,modelValue:option.value,"onUpdate:modelValue":$event=>option.value=$event,type:`number`,"num-min":option.min,"num-max":option.max,"num-step":option.step,onValueChanged:option.onChange},null,8,[`modelValue`,`onUpdate:modelValue`,`num-min`,`num-max`,`num-step`,`onValueChanged`])):createCommentVNode(``,!0)],2)]))),128)):createCommentVNode(``,!0)]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_6$39,[createVNode(unref(bngIcon_default),{type:`adjust`,class:`placeholder-icon`}),_cache[1]||=createBaseVNode(`p`,{class:`placeholder-text`},`No options available`,-1)]))],2),renderSlot(_ctx.$slots,`buttons`,{},void 0,!0)])),[[unref(BngBlur_default)]])}},OptionsPanel_default=__plugin_vue_export_helper_default(_sfc_main$126,[[`__scopeId`,`data-v-c933da42`]]),_hoisted_1$113={class:`icon-wrapper`},_sfc_main$125={__name:`wizardStepButton`,props:{first:{type:Boolean,default:!1},title:{type:String,required:!0},tooltip:{type:String},active:{type:Boolean,default:!1},completed:{type:Boolean,default:!1},preview:{type:String,default:``},icon:{type:String,default:``},ratio:{type:String,default:`2:1`},showPaintTile:{type:Boolean,default:!1},paintId:{type:String,default:``},paints:{type:Array,default:()=>[]},paintName:{type:String,default:``},paintWidth:{type:Number,default:45},paintHeight:{type:Number,default:20}},emits:[`activate`],setup(__props,{emit:__emit}){let emit$1=__emit;function handleActivate(){emit$1(`activate`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`step-tab`,{"first-tab":__props.first,"active-tab":__props.active,"completed-tab":__props.completed,"no-thumbnail":!__props.preview}]),onClick:handleActivate},[createBaseVNode(`div`,_hoisted_1$113,[createVNode(unref(bngIcon_default),{class:`step-icon`,type:__props.icon},null,8,[`type`])]),__props.preview?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`thumbnail-image`,ratio:__props.ratio,"external-image":__props.preview},{default:withCtx(()=>[renderSlot(_ctx.$slots,`overlay`,{},void 0,!0),__props.showPaintTile&&__props.paints&&__props.paints.length>0?(openBlock(),createBlock(unref(bngPaintTile_default),{key:0,"paint-id":__props.paintId,paint:__props.paints,"paint-name":__props.paintName,width:__props.paintWidth,height:__props.paintHeight,onClick:handleActivate,class:`preview-paint-tile`,"bng-no-nav":`true`,tabindex:`-1`},null,8,[`paint-id`,`paint`,`paint-name`,`width`,`height`])):createCommentVNode(``,!0)]),_:3},8,[`ratio`,`external-image`])):createCommentVNode(``,!0)],2)),[[unref(BngOnUiNav_default),handleActivate,`ok`,{focusRequired:!0}],[unref(BngTooltip_default),__props.tooltip,`bottom`]])}},wizardStepButton_default=__plugin_vue_export_helper_default(_sfc_main$125,[[`__scopeId`,`data-v-475a9f52`]]),_hoisted_1$112={class:`configurator-heading`},_hoisted_2$93={class:`configurator-body`},_hoisted_3$81={key:0,class:`grid-section`},_hoisted_4$61={key:1,class:`option-summary-panel`},_hoisted_5$51={class:`section-header`},_hoisted_6$38={class:`section-title-value`},_hoisted_7$32={class:`section-content`},_hoisted_8$25={key:0,class:`clickable`},_hoisted_9$22={key:1,class:`placeholder-content`},_hoisted_10$16={class:`section-header`},_hoisted_11$14={class:`section-title-value`},_hoisted_12$10={class:`section-content`},_hoisted_13$9={key:0,class:`clickable`},_hoisted_14$9={key:1,class:`placeholder-content`},_hoisted_15$9={class:`configurator-heading`},_hoisted_16$9={key:0,class:`error-state`},_hoisted_17$8={class:`error-content`},_hoisted_18$6={key:1,class:`configurator-sections`},_hoisted_19$4={class:`steps-container`},_hoisted_20$4={class:`background-bar`},_hoisted_21$4={class:`label`},_hoisted_22$4={class:`hold-binding`},WIZARD_SCOPE_ID=`freeroam-wizard`,_sfc_main$124={__name:`FreeroamWizard`,props:{step:{type:String,default:``},pathMatch:{type:[String,Array],default:``},itemDetails:{type:[String,Array],default:``}},setup(__props){let{lua,events:events$3}=useBridge(),router$1=useRouter(),scopedNav=useScopedNav(),steps={level:{title:`Location`,backendName:`freeroamSelector`,path:`/freeroam-wizard/level`,defaultPath:{keys:[`allFreeroam`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`,`advanced`]},vehicle:{title:`Vehicle`,backendName:`vehicleSelector`,path:`/freeroam-wizard/vehicle`,defaultPath:{keys:[`allModels`]},defaultDetailsMode:`detail`,hiddenTabs:[`advanced`]},options:{title:`Options`,path:`/freeroam-wizard/options`}},stepCompleted=computed(()=>({level:props.step===`vehicle`||props.step===`options`,vehicle:props.step===`options`,options:!1})),gridSelectorProps=computed(()=>{let stepConfig=steps[props.step];return stepConfig&&stepConfig.backendName&&stepConfig.path?{backendName:stepConfig.backendName,routePath:stepConfig.path,defaultPath:stepConfig.defaultPath||{keys:[]},defaultDetailsMode:stepConfig.defaultDetailsMode||`detail`,hiddenTabs:stepConfig.hiddenTabs||[]}:null}),props=__props,gridSelectorRef=ref(null),holdBindingRef=ref(null),isLoading=ref(!1),breadcrumbItems=computed(()=>{let items$2=[{label:`Menu`,gotoAngularState:`menu.mainmenu`},{label:`Freeroam Configurator`,dividerType:`arrowSmallRight`}];props.step===`level`?items$2.push({label:`Location`,click:()=>{onSpawnPointTileClick(!0)}}):props.step===`vehicle`?items$2.push({label:`Vehicle`,click:()=>{onVehicleTileClick(!0)}}):props.step===`options`&&items$2.push({label:`Options`,click:onOptionsTileClick});let screenHeaderPath=gridSelectorRef.value?.screenHeaderPath,pathValue=screenHeaderPath?.value||screenHeaderPath;return pathValue&&Array.isArray(pathValue)&&pathValue.length>2&&(pathValue.length>3?(items$2.push({label:pathValue[2].label,click:()=>{gridSelectorRef.value.setCurrentPath({keys:pathValue[2].gotoPath}),onSpawnPointTileClick()}}),items$2.push(pathValue[3])):items$2.push(pathValue[2])),items$2}),{configData,button,error,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,handleButtonClick,selectSpawnPoint,selectVehicle,gotoHeaderItem,loadConfiguration}=useFreeroamConfigurator();watch(()=>props.step,step=>{step===`options`&&(loadConfiguration(),scopedNav.resumeScope(WIZARD_SCOPE_ID))});let overrideSelectItem=async(step,...args)=>{if(props.step===`level`){let item=args[0];if(!item?.showDetails?.levelName)return logger_default.error(`overrideSelectItem: Invalid item data for level selection`),null;await selectSpawnPoint(item.showDetails.levelName,item.showDetails.spawnPointObjectName,item.key)&&router$1.push(steps.vehicle.path)}else if(props.step===`vehicle`){let item=args[0];if(!item?.showDetails?.model||!item?.showDetails?.config)return logger_default.error(`overrideSelectItem: Invalid item data for vehicle selection`),null;let selectedPaint=args[1],selectedMultiPaint=args[2],additionalData={};selectedMultiPaint?.paintNames?(additionalData.paint=selectedMultiPaint.paintNames[0],additionalData.paint2=selectedMultiPaint.paintNames[1],additionalData.paint3=selectedMultiPaint.paintNames[2]):selectedPaint?.name&&(additionalData.paint=selectedPaint.name),await selectVehicle(item.showDetails.model,item.showDetails.config,additionalData,item.key)&&router$1.push(steps.options.path)}return null},onSelectCallback=async(item,doNavigation)=>{if(doNavigation){if(props.step===`level`){if(!item?.doubleClickDetails?.levelName)return logger_default.error(`overrideSelectItem: Invalid item data for level selection`),null;await selectSpawnPoint(item.doubleClickDetails.levelName,item.doubleClickDetails.spawnPointObjectName,item.key)}else if(props.step===`vehicle`){if(!item?.doubleClickDetails?.model||!item?.doubleClickDetails?.config)return logger_default.error(`overrideSelectItem: Invalid item data for vehicle selection`),null;await selectVehicle(item.doubleClickDetails.model,item.doubleClickDetails.config,{},item.key)}}return null},doubleClickOverride=async item=>{if(!item?.doubleClickDetails){logger_default.error(`doubleClickOverride: Invalid item data`);return}let details=item.doubleClickDetails;details.levelName?await selectSpawnPoint(details.levelName,details.spawnPointObjectName,item.key)&&router$1.push(steps.vehicle.path):details.model&&details.config&&await selectVehicle(details.model,details.config,{},item.key)&&router$1.push(steps.options.path)},goBack=()=>{logger_default.debug(`goBack called`);let gridSelectorPath=gridSelectorRef.value?.screenHeaderPath;props.step===`level`?gridSelectorPath&&gridSelectorPath.length>2?onSpawnPointTileClick():window.bngVue.gotoAngularState(`menu.mainmenu`):props.step===`vehicle`?gridSelectorPath&&gridSelectorPath.length>2?onVehicleTileClick():onSpawnPointTileClick():props.step===`options`&&onVehicleTileClick()},onSpawnPointTileClick=async()=>{router$1.replace(steps.level.path)},onVehicleTileClick=async(clearSearch=!1)=>{clearSearch&&gridSelectorRef.value&&(gridSelectorRef.value.clearSearch(),gridSelectorRef.value.clearFilters()),router$1.replace(steps.vehicle.path)},onOptionsTileClick=async()=>{router$1.replace(steps.options.path)},onStartButtonClick=async buttonId=>{isLoading.value=!0,events$3.emit(`LoadingScreen`,{active:!0}),await startLoading$1(async()=>{await waitForLoadingScreenFadeIn$1(),await handleButtonClick(buttonId)})};function convertPaintToTileFormat(paint){if(!paint)return null;if(paint.baseColor&&paint.paintString)return paint;try{let paintObj=new Paint;return paintObj.paint=paint,paintObj.paintObject}catch(error$1){return console.warn(`Failed to convert paint:`,paint,error$1),null}}let vehiclePaintData=computed(()=>{let vehicle=configData.value?.currentVehicle;if(!vehicle?.additionalData?.paint||!vehicle?.paints?.factoryPaints)return null;let additionalData=vehicle.additionalData,factoryPaints=vehicle.paints.factoryPaints,paintNames=[additionalData.paint,additionalData.paint2,additionalData.paint3].filter(name=>name),paints=paintNames.map(name=>{let paint=factoryPaints.find(p$1=>p$1.name===name);return paint?convertPaintToTileFormat(paint):null}).filter(paint=>paint!==null);return paints.length===0?null:{paint:paintNames[0],paintNames,paints}});return onBeforeMount(()=>{lua.simTimeAuthority.pushPauseRequest(`freeroamConfigurator`)}),onMounted(()=>{initialize()}),onUnmounted(()=>{lua.simTimeAuthority.popPauseRequest(`freeroamConfigurator`)}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`freeroam-configurator`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`configurator-content`,{"options-step":__props.step===`options`}])},[createBaseVNode(`div`,_hoisted_1$112,[withDirectives(createVNode(unref(bngBreadcrumbs_default),{class:`configurator-breadcrumbs`,simple:``,"show-back-button":``,"disable-last-item":``,onBack:goBack,onClick:unref(gotoHeaderItem),limit:`15`,items:breadcrumbItems.value},null,8,[`onClick`,`items`]),[[unref(BngBlur_default)]])]),createBaseVNode(`div`,_hoisted_2$93,[__props.step!==`options`&&gridSelectorProps.value?(openBlock(),createElementBlock(`div`,_hoisted_3$81,[(openBlock(),createBlock(GridSelector_default,{ref_key:`gridSelectorRef`,ref:gridSelectorRef,key:`grid-selector-${__props.step}`,"backend-name":gridSelectorProps.value.backendName,"route-path":gridSelectorProps.value.routePath,"default-path":gridSelectorProps.value.defaultPath,"default-details-mode":gridSelectorProps.value.defaultDetailsMode,"hidden-tabs":gridSelectorProps.value.hiddenTabs,"no-breadcrumbs":``,"select-callback":onSelectCallback,"double-click-override":doubleClickOverride,"override-back-from-grid":goBack,"inline-header-container":``,"bubble-events":[`ok`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[__props.step===`level`?(openBlock(),createBlock(GameplayDetails_default,{key:0,activeItem,activeItemDetails,toggleFavourite,exploreFolder,goToMod,buttonOverride:{icon:`fastTravel`,label:`Next Step`,click:(...args)=>overrideSelectItem(`level`,...args)},showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`toggleFavourite`,`exploreFolder`,`goToMod`,`buttonOverride`])):createCommentVNode(``,!0),__props.step===`vehicle`?(openBlock(),createBlock(VehicleDetails_default,{key:1,activeItem,activeItemDetails,toggleFavourite,exploreFolder,goToMod,buttonOverride:{icon:`fastTravel`,label:`Next Step`,click:(...args)=>overrideSelectItem(`vehicle`,...args)},showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`toggleFavourite`,`exploreFolder`,`goToMod`,`buttonOverride`])):createCommentVNode(``,!0)]),_:1},8,[`backend-name`,`route-path`,`default-path`,`default-details-mode`,`hidden-tabs`]))])):createCommentVNode(``,!0),__props.step===`options`&&unref(configData)?(openBlock(),createElementBlock(`div`,_hoisted_4$61,[withDirectives((openBlock(),createElementBlock(`div`,{class:`config-section selectable-component`,onClick:onSpawnPointTileClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_5$51,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[1]||=createBaseVNode(`span`,{class:`section-title-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_6$38,toDisplayString(unref(configData)?.currentSpawnPoint?.headerTitle||`Select location...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_7$32,[createBaseVNode(`div`,null,[unref(configData)?.currentSpawnPoint?(openBlock(),createElementBlock(`div`,_hoisted_8$25,[createVNode(GameplayDetails_default,{"active-item":{levelName:unref(configData).currentSpawnPoint.levelName,spawnPointObjectName:unref(configData).currentSpawnPoint.spawnPointObjectName},"active-item-details":unref(configData).currentSpawnPoint,inline:``,"show-header-title":!1},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_9$22,[createVNode(unref(bngIcon_default),{type:`road`,class:`placeholder-icon`}),_cache[2]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select location`,-1)]))])])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`config-section selectable-component`,onClick:onVehicleTileClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_10$16,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[3]||=createBaseVNode(`span`,{class:`section-title-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_11$14,toDisplayString(unref(configData)?.currentVehicle?.headerTitle||`Select vehicle...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_12$10,[createBaseVNode(`div`,null,[unref(configData)?.currentVehicle?(openBlock(),createElementBlock(`div`,_hoisted_13$9,[createVNode(VehicleDetails_default,{"active-item":{model:unref(configData).currentVehicle.model,config:unref(configData).currentVehicle.config},"active-item-details":unref(configData).currentVehicle,"hide-details-and-buttons":``,inline:``,"show-header-title":!1},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_14$9,[createVNode(unref(bngIcon_default),{type:`car`,class:`placeholder-icon`}),_cache[4]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select vehicle`,-1)]))])])])),[[unref(BngBlur_default)]]),withDirectives(createVNode(OptionsPanel_default,{class:`config-section`,options:unref(configData)?.options||[],"has-options":unref(hasOptions),"can-configure-options":unref(canConfigureOptions)},null,8,[`options`,`has-options`,`can-configure-options`]),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),goBack,`menu`]])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$9,[unref(error)?(openBlock(),createElementBlock(`div`,_hoisted_16$9,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_17$8,[createVNode(unref(bngIcon_default),{type:`warning`,class:`error-icon`}),_cache[6]||=createBaseVNode(`p`,null,`Failed to load configuration`,-1),createVNode(unref(bngButton_default),{onClick:unref(initialize),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Retry`,-1)]]),_:1},8,[`onClick`,`accent`])])])):(openBlock(),createElementBlock(`div`,_hoisted_18$6,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_19$4,[createBaseVNode(`div`,_hoisted_20$4,[createVNode(BlurBackground_default)]),createVNode(wizardStepButton_default,{first:``,active:__props.step===`level`,completed:stepCompleted.value.level,title:`Location`,tooltip:unref(configData)?.currentSpawnPoint?.headerTitle,preview:unref(configData)?.currentSpawnPoint?.preview,icon:`road`,onActivate:onSpawnPointTileClick},null,8,[`active`,`completed`,`tooltip`,`preview`]),createVNode(wizardStepButton_default,{active:__props.step===`vehicle`,completed:stepCompleted.value.vehicle,title:`Vehicle`,tooltip:unref(configData)?.currentVehicle?.headerTitle,preview:unref(configData)?.currentVehicle?.preview,icon:`car`,"show-paint-tile":!!vehiclePaintData.value,"paint-id":`${unref(configData)?.currentVehicle?.key||`vehicle`}:${vehiclePaintData.value?.paint}`,paints:vehiclePaintData.value?.paints||[],"paint-name":vehiclePaintData.value?vehiclePaintData.value.paintNames.join(`, `):``,onActivate:onVehicleTileClick},null,8,[`active`,`completed`,`tooltip`,`preview`,`show-paint-tile`,`paint-id`,`paints`,`paint-name`]),createVNode(wizardStepButton_default,{active:__props.step===`options`,completed:stepCompleted.value.options,title:`Options`,tooltip:`Options`,icon:`adjust`,onActivate:onOptionsTileClick},null,8,[`active`,`completed`])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`play-button`,onClick:_cache[0]||=$event=>onStartButtonClick(unref(button)?.meta?.buttonId),"bng-nav-item":``,tabindex:`1`},[_cache[8]||=createBaseVNode(`div`,{class:`background`},null,-1),createBaseVNode(`div`,_hoisted_21$4,[withDirectives(createBaseVNode(`div`,_hoisted_22$4,[createVNode(unref(bngBinding_default),{ref_key:`holdBindingRef`,ref:holdBindingRef,class:`binding`,"ui-event":`ok`,controller:``},null,512),_cache[7]||=createBaseVNode(`svg`,{class:`hold-arrow`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 12`,preserveAspectRatio:`xMidYMid`},[createBaseVNode(`path`,{d:`M1,1 L8,2 L16,1 L8,11 z`})],-1)],512),[[vShow,holdBindingRef.value?.displayed]]),createTextVNode(` `+toDisplayString(unref(button)?.meta?.label||`Start`),1)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`]])]))])],2)),[[unref(BngScopedNav_default),{scopeId:WIZARD_SCOPE_ID,canDeactivate:()=>!1,activateOnMount:!0,bubbleBlacklistEvents:[`back`,`menu`]}],[unref(BngClick_default),{holdCallback:()=>onStartButtonClick(unref(button)?.meta?.buttonId),holdDelay:2e3,repeatInterval:0},void 0,{controller:!0}],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0}]])]),_:1}))}},FreeroamWizard_default=__plugin_vue_export_helper_default(_sfc_main$124,[[`__scopeId`,`data-v-6c942499`]]),routes_default$5=[{name:`menu.freeroamselector`,path:`/freeroam-selector/:pathMatch(.*)*/:itemDetails(.*)*`,component:FreeroamSelector_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.freeroamconfigurator`,path:`/freeroam-configurator`,component:FreeroamConfigurator_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!1}}},{name:`menu.freeroamWizard`,path:`/freeroam-wizard/:step/:pathMatch(.*)*/:itemDetails(.*)*`,component:FreeroamWizard_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!1}}}],_sfc_main$123={__name:`GameplaySelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`gameplaySelector`,routePath:`/gameplay-selector`,defaultPath:{keys:[`allGameplay`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[createVNode(GameplayDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod,showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`,`exploreFolder`,`goToMod`])]),_:1}))}},GameplaySelector_default=_sfc_main$123,routes_default$6=[{name:`menu.gameplayselector`,path:`/gameplay-selector/:pathMatch(.*)*`,component:GameplaySelector_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}}],_hoisted_1$111={key:0,class:`garage-button-content`},_sfc_main$122={__name:`GarageButton`,props:{icon:[Object,String],externalIcon:String,disabled:Boolean,active:Boolean,type:{type:String,validator:val=>[`drawer-toggle`,`drawer-button`,``].includes(val)||val===void 0}},setup(__props){let props=__props,slots=useSlots(),hasContent=computed(()=>slots.default),showContent=computed(()=>hasContent.value&&!(props.type===`drawer-toggle`&&!props.active)),btnRef=ref(null);return onUpdated(()=>ensureFocus(btnRef.value?.getElement?.())),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),mergeProps({ref_key:`btnRef`,ref:btnRef,accent:unref(ACCENTS).custom,disabled:__props.disabled,icon:__props.icon,externalIcon:__props.externalIcon,class:[`garage-button`,{[`garage-button-${__props.type}`]:!!__props.type,"garage-button-with-content":hasContent.value,"garage-button-active":__props.active}]},_ctx.$attrs),{default:withCtx(()=>[showContent.value?(openBlock(),createElementBlock(`div`,_hoisted_1$111,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0)]),_:3},16,[`accent`,`disabled`,`icon`,`externalIcon`,`class`]))}},GarageButton_default=__plugin_vue_export_helper_default(_sfc_main$122,[[`__scopeId`,`data-v-8b374028`]]),_hoisted_1$110={class:`paint-preview`},_hoisted_2$92=[`onClick`],_hoisted_3$80={key:0,class:`empty-slot-indicator`},refpad=25,_sfc_main$121={__name:`PaintPreview`,props:{paints:Array,paintNames:{type:Array,default:()=>[]}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,previews=computed(()=>{let res=[];if(!props.paints||!Array.isArray(props.paints))return res;let paints=props.paints,len=paints.length;for(let idx=0;idx1?refpad+(100-refpad*2)/(len-1)*idx:50}%`,"--paint-color":isEmpty?`rgba(128, 128, 128, 0.3)`:`rgb(${paint.rgb255.join(`, `)})`,"--paint-metallic":isEmpty?0:Math.max(0,paint.metallic-paint.roughness/.5),"--paint-roughness":isEmpty?1:paint.roughness,"--paint-clearcoat":isEmpty?0:paint.clearcoat,"--paint-clearcoat-roughness":isEmpty?0:paint.clearcoatRoughness,isEmpty,tooltipText};res.push(vars)}return res});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$110,[(openBlock(!0),createElementBlock(Fragment,null,renderList(previews.value,(preview,idx)=>withDirectives((openBlock(),createElementBlock(`div`,{key:idx,class:normalizeClass([`paint-preview-item`,{"empty-slot":preview.isEmpty}]),style:normalizeStyle(preview),onClick:$event=>preview.isEmpty?null:emit$1(`select`,idx)},[_cache[0]||=createStaticVNode(`
`,5),preview.isEmpty?(openBlock(),createElementBlock(`div`,_hoisted_3$80)):createCommentVNode(``,!0)],14,_hoisted_2$92)),[[unref(BngTooltip_default),preview.tooltipText,`bottom`]])),128))]))}},PaintPreview_default=__plugin_vue_export_helper_default(_sfc_main$121,[[`__scopeId`,`data-v-38e5e63f`]]),_hoisted_1$109={class:`paint-preview-container`},_hoisted_2$91={class:`multi-paint-setups-content`},_hoisted_3$79={key:0},colorDefault=`1 1 1 1 0 1 1 0`,previewAnimTime=400,_sfc_main$120={__name:`Paint`,props:{withBackground:Boolean,tabbed:{type:Boolean,default:!0},legacy:{type:Boolean,default:!0}},setup(__props){useUINavBlocker().blockOnly([`context`]);let paintPreviews=usePaintPreviews(),props=__props,events$3=useEvents(),configId=ref(`none`),vehiclePaintPresets=ref({}),multiPaintSetups=ref({}),tabsState=ref([!0,!1,!1]);function tabExpand(idx){for(let i=0;i{tabsState.value[idx]=!0})}let color=ref([colorDefault,colorDefault,colorDefault]),updateColor=(index,preview=!0)=>nextTick(()=>{Lua_default.core_vehicle_colors.setVehicleColor(index,color.value[index]),paints[index].paint=color.value[index],preview&&updatePaint(index)});function resetScroll(){let elm=document.activeElement.closest(`.bng-accitem-content`);elm&&(elm.scrollTop=0)}let paints=Array.from({length:color.value.length},()=>reactive(new Paint({legacy:props.legacy}))),paintImgs=ref(Array(color.value.length).fill(null)),previewStyles=ref(Array(color.value.length).fill(null).map(()=>({"--paint-url":`none`,"--paint-prev-url":`none`,"--paint-prev-transition":`none`,"--paint-prev-opacity":0}))),previewAnimating=Array(color.value.length).fill(0),updatePaintPreview=async(index,url)=>{if(previewAnimating[index]===1)for(previewAnimating[index]=-1;previewAnimating[index]===-1;)await sleep(50);if(previewAnimating[index]=1,previewStyles.value[index][`--paint-prev-transition`]=`none`,paintImgs.value[index]=url,previewAnimTime===0){if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-url`]=`url(${url})`,previewAnimating[index]=0;return}let currentUrl=previewStyles.value[index][`--paint-url`];if(currentUrl===`none`||!currentUrl){if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-url`]=`url(${url})`,previewAnimating[index]=0;return}previewStyles.value[index][`--paint-prev-url`]=currentUrl,previewStyles.value[index][`--paint-url`]=`url(${url})`,previewStyles.value[index][`--paint-prev-opacity`]=1,previewStyles.value[index][`--paint-prev-transition`]=`none`,requestAnimationFrame(()=>{if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-prev-transition`]=`opacity ${previewAnimTime}ms ease-in-out`,previewStyles.value[index][`--paint-prev-opacity`]=0,setTimeout(()=>{if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-prev-transition`]=`none`,previewAnimating[index]=0},previewAnimTime)})},updatePaint=debounce(async index=>{let paintData=color.value[index];paintPreviews.getBlobPreview(paintData,{paintId:`${configId.value}:single-${index}`,width:80,height:24}).then(url=>{url&&updatePaintPreview(index,url)}).catch(()=>{})},30),updateAllPaints=async()=>{let urls=await Promise.all(paints.map(async(paint,idx)=>await paintPreviews.getBlobPreview(paint.paint,{paintId:`${configId.value}:single-${idx}`,width:80,height:24})));for(let i=0;i{let res=[];for(let i=0;ivehiclePaintPresets.value[name]);res.push({id:paintNames.join(`|`),name:setup$3.name,paintNames,paints:paints$1,apply:idx=>applyMultipaint(setup$3,idx)})}return res});function applyMultipaint(setup$3,index=-1){console.log(`applyMultipaint`,index);let paintNames=[setup$3.paintName1,setup$3.paintName2,setup$3.paintName3];for(let i=0;i-1&&i!==index)continue;let paintName=paintNames[i];if(paintName&&paintName.trim()!==``&&vehiclePaintPresets.value[paintName]){let paintData=vehiclePaintPresets.value[paintName],paint=new Paint({legacy:props.legacy});paint.paint=paintData,color.value[i]=paint.paintString,updateColor(i,!1)}}nextTick(updateAllPaints)}async function fetchDefinedColors(){for(let i=0;i__props.tabbed?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`paint-acc-wrapper`,{"with-background":__props.withBackground}])},[createBaseVNode(`div`,_hoisted_1$109,[createVNode(PaintPreview_default,{paints:unref(paints),onSelect:tabExpand},null,8,[`paints`])]),withDirectives((openBlock(),createBlock(unref(accordion_default),{class:`paint-acc-container`,singular:``},{default:withCtx(()=>[createVNode(unref(accordionItem_default),{key:`multi-paint-setups`,class:`paint-acc-content`,navigable:``},{caption:withCtx(()=>[..._cache[0]||=[createTextVNode(` Multi Paint Setups `,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$91,[(openBlock(!0),createElementBlock(Fragment,null,renderList(multipaint.value,paint=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:paint.name,class:`multi-paint-setup-item`,"paint-id":`${configId.value}:${paint.id}`,paint:paint.paints,"paint-name":paint.name,"paint-names":paint.paintNames,width:72,height:24,"with-menu":``,onClick:paint.apply,onMenuClick:paint.apply},null,8,[`paint-id`,`paint`,`paint-name`,`paint-names`,`onClick`,`onMenuClick`]))),128))])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(color.value.length,idx=>(openBlock(),createBlock(unref(accordionItem_default),{key:idx,class:`paint-acc-content`,navigable:``,expanded:tabsState.value[idx-1],style:normalizeStyle(previewStyles.value[idx-1])},{caption:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.trackBuilder.matEditor.paint`)+` `+idx),1)]),default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:`paint-picker-wrapper`,onDeactivate:resetScroll},[createVNode(PaintPicker_default,{class:`paint-picker`,"picker-mode":`compact_luminosity`,modelValue:color.value[idx-1],"onUpdate:modelValue":$event=>color.value[idx-1]=$event,onChange:$event=>updateColor(idx-1),"show-preview":!1,"presets-editable":``,presets:vehiclePaintPresets.value,legacy:__props.legacy},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`,`presets`,`legacy`])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]])]),_:2},1032,[`expanded`,`style`]))),128))]),_:1})),[[unref(BngBlur_default),__props.withBackground]])],2)):withDirectives((openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`paint-container`,{"with-background":__props.withBackground}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(color.value.length,idx=>(openBlock(),createBlock(PaintPicker_default,{key:idx,modelValue:color.value[idx-1],"onUpdate:modelValue":$event=>color.value[idx-1]=$event,onChange:$event=>updateColor(idx-1),"show-preview":!1,"presets-editable":``,presets:vehiclePaintPresets.value,legacy:__props.legacy},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.trackBuilder.matEditor.paint`))+` `+toDisplayString(idx),1)]),_:2},1032,[`modelValue`,`onUpdate:modelValue`,`onChange`,`presets`,`legacy`]))),128)),color.value.length%2==1?(openBlock(),createElementBlock(`div`,_hoisted_3$79)):createCommentVNode(``,!0)],2)),[[unref(BngBlur_default),__props.withBackground]])}},Paint_default=__plugin_vue_export_helper_default(_sfc_main$120,[[`__scopeId`,`data-v-956741b3`]]),rgxWheel=/^(\d+(?:\.\d+)?)(x)(\d+(?:\.\d+)?)/i,rgxTire=/^(\d+(?:\.\d+)?)(\/)(\d+(?:\.\d+)?)(R)(\d+(?:\.\d+)?)/i,rgxNum=/(^| )(\d+)($| )/,zeroPad=num=>String(~~(num*1e3)).padStart(10,`0`);function partOptionSorter(...ab){let cmp=[``,``];for(let i=0;i<2;i++){let label=ab[i].label;if(typeof label!=`string`)return 0;rgxWheel.test(label)?cmp[i]=label.replace(rgxWheel,(_,a$1,s,b)=>[a$1,b].map(zeroPad).join(`x`)):rgxTire.test(label)?cmp[i]=label.replace(rgxTire,(_,a$1,s1,b,s2,c)=>[a$1,b,c].map(zeroPad).join(`x`)):rgxNum.test(label)?cmp[i]=label.replace(rgxNum,(_,a$1,num,b)=>a$1+zeroPad(num)+b):cmp[i]=label,label.startsWith(`40x4`)&&console.log(cmp[i])}return cmp[0].localeCompare(cmp[1])}function partOptionGrouper(list){let seq=[],groups={},grouping=!1;for(let itm of list){let group,match=itm.label.match(rgxWheel)||itm.label.match(rgxTire);group=match&&match.length>0?match.slice(1).map(s=>s===`R`?s:s+` `).join(``).trim():itm.label,groups[group]?grouping=!0:(groups[group]=[],seq.push(group)),groups[group].push(itm)}if(!grouping)return list;let res=[];for(let group of seq){let list$1=groups[group];list$1.length===1?res.push(...list$1):(res.push({label:group,group:!0}),res.push(...list$1.map(itm=>({...itm,grouped:!0}))))}return res}var _hoisted_1$108={key:1},_sfc_main$119={__name:`PartsBranch`,props:{rootSlot:Boolean,children:Object,child:Object,info:Object,treeState:Object,treeStateKey:String,flatEntry:Boolean,displayNames:Boolean,showAuxiliary:Boolean,separateSort:Boolean,alwaysSort:Boolean,showEmpty:Boolean,highlighter:[String,Array,RegExp]},emits:[`select`,`deselect`,`highlight`,`change`,`dropdown`],setup(__props,{emit:__emit}){let props=__props,accordionItem=ref(),partsDropdown=ref(),openPartsDropdown=()=>partsDropdown.value&&partsDropdown.value.open(),emit$1=__emit,select=(slot,mouse=!1)=>(!props.child||highlightable.value)&&emit$1(`select`,slot,mouse),deselect=(slot,mouse=!1)=>emit$1(`deselect`,slot,mouse),highlight=slot=>emit$1(`highlight`,slot),change=slot=>emit$1(`change`,slot),dropdown=val=>emit$1(`dropdown`,val),focusReturn=()=>nextTick(()=>accordionItem.value.focus()),accItemUnwatch=watch(accordionItem,()=>{let elm=accordionItem.value?.captionElement;elm&&(accItemUnwatch(),elm.partSelect=()=>props.child&&select(props.child))});function toggleHighlight(slot){slot.highlight=!slot.highlight,highlight(slot)}let toggleHighlightCurrent=()=>toggleHighlight(props.child),highlightable=computed(()=>typeof props.child?.highlight==`boolean`),expanded=ref(!1);if(!props.flatEntry){let unwatchTreeState;unwatchTreeState=watch(()=>props.treeState,()=>setTimeout(()=>{unwatchTreeState(),expanded.value=props.treeStateKey&&props.treeState[props.treeStateKey]&&props.treeState[props.treeStateKey]||!1,watch(()=>expanded.value,val=>{props.treeStateKey&&(val?props.treeState[props.treeStateKey]=val:props.treeStateKey in props.treeState&&delete props.treeState[props.treeStateKey])})},50),{immediate:!0})}let childrenSorter=(a$1,b)=>{if(props.separateSort){if(a$1.children&&!b.children)return 1;if(b.children&&!a$1.children)return-1}if(props.displayNames||!props.alwaysSort)return a$1.slotName.localeCompare(b.slotName);{let info=props.info[a$1.parentSlotName]?.slotInfoUi||{};return getSlotName(a$1,info).localeCompare(getSlotName(b,info))}},slotInfo=computed(()=>props.displayNames?{}:props.info[props.child?.parentSlotName]?.slotInfoUi||{}),isCoreSlot=computed(()=>!!props.info[props.child?.parentSlotName]?.slotInfoUi?.[props.child?.slotName]?.coreSlot),getSlotName=(slot,info={})=>props.displayNames?slot.slotName:info[slot.slotName]?.description||slot.slotName,displayName=computed(()=>getSlotName(props.child,slotInfo.value)),hasPartList=computed(()=>{let list=props.child?.suitablePartNames||[];return list.length===0&&(list=props.child?.chosenPartName?[props.child.chosenPartName]:(props.child?.unsuitablePartNames||[]).map(({partName})=>partName)),props.showAuxiliary||(list=list.filter(partName=>!props.info[partName]?.isAuxiliary)),list.length>0}),partsList=computed(()=>{if(!hasPartList.value)return[];let addEmpty=!0,list=props.child?.suitablePartNames||[];list.length===0&&props.child?.chosenPartName&&(list=[props.child.chosenPartName],addEmpty=!1);let unsuitable=(props.child?.unsuitablePartNames||[]).reduce((res,{partName,reason})=>({...res,[partName]:reason}),{});return list.push(...Object.keys(unsuitable)),list.length===0||(list=list.map(partName=>({value:partName,label:(props.info[partName]?.isAuxiliary?`[!] `:``)+(props.displayNames?partName:props.info[partName]?.description||partName),disabled:partName in unsuitable,tooltip:partName in unsuitable?{text:unsuitable[partName],position:`right`}:void 0,isAuxiliary:props.info[partName]?.isAuxiliary})).filter(opt=>!opt.isAuxiliary||props.showAuxiliary||props.child?.chosenPartName===opt.value),!props.showAuxiliary&&list.length===1&&list[0].isAuxiliary&&isCoreSlot.value)?[]:(list.sort(partOptionSorter),list=partOptionGrouper(list),addEmpty&&!isCoreSlot.value&&list.unshift({value:``,label:`Empty`}),list)}),parentAllChildren=computed(()=>props.children?Object.values(props.children||{}):[]),parentHasChildren=computed(()=>parentAllChildren.value.length>0),parentChildren=computed(()=>[...parentAllChildren.value].sort(childrenSorter)),childAllChildren=computed(()=>props.child?.children?Object.values(props.child.children||{}):[]),childHasChildren=computed(()=>childAllChildren.value.length>0),childChildren=computed(()=>[...childAllChildren.value].sort(childrenSorter)),shouldShow=computed(()=>childHasChildren.value||hasPartList.value||props.showEmpty);return(_ctx,_cache)=>__props.treeState&&parentHasChildren.value?(openBlock(),createBlock(unref(accordion_default),{key:0,class:`branch-category`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(parentChildren.value,child=>(openBlock(),createBlock(PartsBranch_default,{key:child.slotName,"root-slot":__props.rootSlot,child,info:__props.info,"tree-state":__props.treeState,"tree-state-key":child.slotName,"display-names":__props.displayNames,"show-auxiliary":__props.showAuxiliary,"separate-sort":__props.separateSort,"always-sort":__props.alwaysSort,"show-empty":__props.showEmpty,"flat-entry":__props.flatEntry,highlighter:__props.highlighter,onSelect:select,onDeselect:deselect,onHighlight:highlight,onChange:change,onDropdown:dropdown},null,8,[`root-slot`,`child`,`info`,`tree-state`,`tree-state-key`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`flat-entry`,`highlighter`]))),128))]),_:1})):__props.treeState&&shouldShow.value?(openBlock(),createBlock(unref(accordionItem_default),{key:1,ref_key:`accordionItem`,ref:accordionItem,static:__props.flatEntry||!childHasChildren.value,expanded:expanded.value,onExpanded:_cache[6]||=$event=>expanded.value=$event,class:normalizeClass({"item-changed":__props.child.changed}),"arrow-big":``,navigable:``,onMouseover:_cache[7]||=withModifiers($event=>select(__props.child,!0),[`stop`]),onMouseleave:_cache[8]||=withModifiers($event=>deselect(__props.child,!0),[`stop`]),onFocusin:_cache[9]||=withModifiers($event=>select(__props.child,!1),[`stop`]),onFocusout:_cache[10]||=withModifiers($event=>deselect(__props.child,!1),[`stop`]),"primary-action":partsList.value.length>0?openPartsDropdown:void 0,"secondary-action":highlightable.value?toggleHighlightCurrent:void 0,"primary-label":`ui.inputActions.menu.menu_item_select.title`,"secondary-label":`ui.vehicleconfig.highlight`,"expand-hint-inline":``,"secondary-hint-inline":``},{caption:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`span`,null,[createTextVNode(toDisplayString(displayName.value),1)])),[[unref(BngHighlighter_default),__props.highlighter]])]),controls:withCtx(()=>[createVNode(unref(bngDropdown_default),{ref_key:`partsDropdown`,ref:partsDropdown,modelValue:__props.child.chosenPartName,"onUpdate:modelValue":_cache[0]||=$event=>__props.child.chosenPartName=$event,items:partsList.value,disabled:!hasPartList.value,highlight:__props.highlighter,"show-search":partsList.value.length>5,"long-names":`cut`,onValueChanged:_cache[1]||=$event=>change(__props.child),onFocus:focusReturn,onOpen:_cache[2]||=$event=>dropdown(!0),onClose:_cache[3]||=$event=>dropdown(!1),"bng-no-nav":``},null,8,[`modelValue`,`items`,`disabled`,`highlight`,`show-search`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).text,class:normalizeClass({"visibility-toggle":!0,"visibility-toggle-on":__props.child.highlight}),icon:__props.child.highlight?unref(icons).eyeSolidOpened:unref(icons).eyeSolidClosed,disabled:!highlightable.value,onClick:_cache[4]||=$event=>toggleHighlight(__props.child),onFocus:_cache[5]||=$event=>accordionItem.value.focus(),"bng-no-nav":``},null,8,[`accent`,`class`,`icon`,`disabled`])]),default:withCtx(()=>[!__props.flatEntry&&__props.treeState&&childHasChildren.value?(openBlock(),createBlock(PartsBranch_default,{key:0,children:childChildren.value,info:__props.info,"tree-state":__props.treeState,"display-names":__props.displayNames,"show-auxiliary":__props.showAuxiliary,"separate-sort":__props.separateSort,"always-sort":__props.alwaysSort,"show-empty":__props.showEmpty,highlighter:__props.highlighter,onSelect:select,onDeselect:deselect,onHighlight:highlight,onChange:change,onDropdown:dropdown},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`highlighter`])):!__props.flatEntry&&__props.treeState?(openBlock(),createElementBlock(`div`,_hoisted_1$108,`—`)):createCommentVNode(``,!0)]),_:1},8,[`static`,`expanded`,`class`,`primary-action`,`secondary-action`])):createCommentVNode(``,!0)}},PartsBranch_default=__plugin_vue_export_helper_default(_sfc_main$119,[[`__scopeId`,`data-v-a5433800`]]),SearchHistory=class{list=[];index=-1;browsing=!1;saveKey=`partSearchHistory`;constructor(search$1){this.search=search$1,this.load()}load(){let res=localStorage.getItem(this.saveKey);res&&(this.list=JSON.parse(res)||[])}save(){localStorage.setItem(this.saveKey,JSON.stringify(this.list))}update(){if(this.search.query.length===0)return;let text=(isRef(this.search.text)?this.search.text.value:this.search.text).trim().replace(/ +/g,` `),textLC=text.toLowerCase(),idx=this.list.findIndex(txt=>textLC===txt.toLowerCase());if(idx>-1){this.index=idx;return}idx=this.list.findIndex(txt=>txt.toLowerCase().startsWith(textLC)),!(idx>-1)&&(idx=this.list.findIndex(txt=>textLC.startsWith(txt.toLowerCase())),idx>-1?(this.list[idx]=text,this.index=idx):(this.index=this.list.length,this.list.push(text)),this.save())}onKeyDown(event){if(this.list.length!==0){switch(event.key){case`ArrowUp`:this.browsing=!0,this.index--;break;case`ArrowDown`:this.browsing=!0,this.index++;break;case`k`:if(event.ctrlKey)console.log(`Search history cleaned`),localStorage.removeItem(`partSearchHistory`),this.list=[],this.index=0,event.preventDefault();else return;default:event.ctrlKey||(this.browsing=!1);return}this.browsing&&(this.index=Math.abs(this.index+this.list.length)%this.list.length,this.search.text=this.list[this.index]),event.preventDefault()}}},isOfficial=info=>info.authors!==`BeamNG`,PartsSearch=class{active=!1;text=ref(``);query={};message=ref(``);highlight=ref([]);minText=3;history=null;currentConfig=[];richPartInfo=[];opts={};constructor(currentConfig,richPartInfo,opts=null){if(!isRef(currentConfig))throw Error(`currentConfig must be ref`);if(!isRef(richPartInfo))throw Error(`richPartInfo must be ref`);this.currentConfig=currentConfig,this.richPartInfo=richPartInfo,opts&&(this.opts=opts),this.history=new SearchHistory(this),this.result=computed(()=>this.generateResult()),this.messages={noResults:$translate.instant(`ui.common.search.noResults`),tooShort:$translate.instant(`ui.common.search.queryTooShort`),invalidFormat:$translate.instant(`ui.common.search.invalidFormat`),unknownArgument:$translate.instant(`ui.common.search.unknownArgument`)}}generateResult(){let queryArgs=this.parseQuery(isRef(this.text)?this.text.value:this.text);if(this.query=queryArgs,this.highlight.value=queryArgs.highlight,!queryArgs.good)return this.message.value=queryArgs.reason,{};this.message.value=``;let res={},currentConfig=isRef(this.currentConfig)?this.currentConfig.value:this.currentConfig,cnt=0,dive=node=>{if(node.children)for(let child of Object.values(node.children)){let match=this.matchSlot(child);match.matched&&(child.search=match,res[child.slotName+`?`+ ++cnt]=child),dive(child)}};return dive(currentConfig),Object.keys(res).length>0?this.history.update():this.message.value=this.messages.noResults,res}parseQuery(text){let queryString=text.trim().toLowerCase().replace(/ +/g,` `),queryArgs={mode:`or`,reason:``,highlight:[]},ignoreKeys=Object.keys(queryArgs);if(queryString.length-1){let args2=arg.split(/:/);args2.length===2&&args2[1].trim()!==``?(queryArgs[args2[0]]=args2[1],parsedargs++):queryArgs.reason+=this.messages.invalidFormat+`: ${arg}\n`}else queryArgs.reason+=this.messages.unknownArgument+`: ${arg}\n`;parsedargs>1&&(queryArgs.mode=`and`)}return queryArgs.good=!queryArgs.reason,queryArgs.highlight=queryArgs.good?Object.entries(queryArgs).filter(([key])=>!ignoreKeys.includes(key)).map(([_,value])=>value):[],queryArgs}matchSlot(slot){let opts=this.opts,query=this.query,queryMode={or:(a$1,b)=>a$1||b,and:(a$1,b)=>a$1&&b}[query.mode],queryOr=query.mode===`or`,matched=!queryOr,matchDetails={slot:!1,part:!1,mod:!1},info=isRef(this.richPartInfo)?this.richPartInfo.value:this.richPartInfo,match=(string,query$1)=>matched=queryMode(matched,(string?string.toLowerCase():`empty`).indexOf(query$1)>-1);function*pairs(){query.name&&(yield[`slot`,slot.chosenPartName,query.name]),query.slot&&(yield[`slot`,slot.slotName,query.slot]),query.description&&(yield[`slot`,(slot.parentSlotName&&info[slot.parentSlotName]?.slotInfoUi?.[slot.slotName]||{}).description,query.description]);let part=slot.chosenPartName?info[slot.chosenPartName]:null;if(part?(query.description&&(yield[`slot`,part.description,query.description]),query.author&&(yield[`slot`,part.authors,query.author,!isOfficial(part)]),query.mod&&!isOfficial(part)&&(yield[`slot`,part.description,query.mod,!0])):query.description&&(yield[`slot`,null,query.description]),query.partname||query.description||query.mod||query.author)for(let partNames of[slot.suitablePartNames,slot.unsuitablePartNames.map(({partName})=>partName)])for(let partName of partNames){let part$1=info[partName];!part$1||!opts.showAux&&part$1.isAuxiliary||(query.partname&&(yield[`part`,partName,query.partname]),query.description&&(yield[`part`,part$1.description,query.description]),query.author&&(yield[`part`,part$1.authors,query.author,!isOfficial(part$1)]),query.mod&&part$1&&!isOfficial(part$1)&&(yield[`part`,part$1.description,query.mod,!0]))}}let lastType;for(let[type,string,query$1,isMod=!1]of pairs()){if(query$1&&match(string,query$1)&&(queryOr||lastType!==type)){matchDetails[type]=!0,isMod&&(matchDetails.mod=!0);break}lastType=type}return{matched,matchedSlot:matchDetails.slot,matchedOptions:matchDetails.part,matchedMod:matchDetails.mod}}onChange(){let text=isRef(this.text)?this.text.value:this.text;!this.active&&text&&this.start()}start(){this.active=!0}stop(){this.active=!1,isRef(this.text)?this.text.value=``:this.text=``,this.query={},this.history.index=-1}},_hoisted_1$107={class:`parts-browser-content`},_hoisted_2$90={key:1},_hoisted_3$78={style:{padding:`0.5em`,display:`inline-block`}},_hoisted_4$60={class:`search-help`},_hoisted_5$50={key:0},_hoisted_6$37={class:`parts-options-row parts-options-row-separator`},_hoisted_7$31={class:`parts-options-left`},_hoisted_8$24={class:`popover-contents-wrapper`},_hoisted_9$21={class:`parts-options-right`},_hoisted_10$15={class:`parts-options-row`},_hoisted_11$13={class:`license-plate`},_hoisted_12$9={class:`parts-options-right parts-options-buttons`},treeStateKey=`partsTreeState`,_sfc_main$118={__name:`Parts`,props:{withBackground:Boolean},setup(__props){let events$3=useEvents(),queue$2=new ExecQueue,currentVehID=-1,currentConfig=ref({}),richPartInfo=ref({}),partsHighlighted={},treeState=ref({}),isDev=window.beamng&&!window.beamng.shipping,savedOptions=[`applyPartChangesAutomatically`,`selectSubParts`,`showNames`,`showAux`,`separateSort`,`alwaysSort`],opts=reactive({stickyPartSelection:!1,selectSubParts:!0,applyPartChangesAutomatically:!0,simple:!1,showNames:!1,showAux:!beamng.shipping,separateSort:!1,alwaysSort:!1,showEmpty:!1}),waitingForData=ref(!0),waitForData=async()=>{for(;waitingForData.value;)await sleep(100)},search$1=reactive(new PartsSearch(currentConfig,richPartInfo,opts)),partsChanged=ref(!1),vehChange=()=>Lua_default.extensions.core_vehicle_partmgmt.sendDataToUI();events$3.on(`VehicleFocusChanged`,vehChange),events$3.on(`VehicleJbeamIoChanged`,vehChange);function iterateChildren(slot,func){func(slot),slot.children&&Object.values(slot.children).forEach(child=>iterateChildren(child,func))}async function highlightPart(part){waitingForData.value||(iterateChildren(part,child=>typeof child.highlight==`boolean`?partsHighlighted[child.partPath]=child.highlight=part.highlight:void 0),Lua_default.extensions.core_vehicle_partmgmt.highlightParts(partsHighlighted,currentVehID))}let mouseUsedLast=!0,tmrSelect,selectPart=queue$2.wrap(`selectPart`,async(slot,mouse=!1)=>{if(mouseUsedLast=mouse,tmrSelect&&clearTimeout(tmrSelect),waitingForData.value||opts.stickyPartSelection)return;let parts={};for(let part in opts.selectSubParts?iterateChildren(slot,child=>child.partPath&&(parts[child.partPath]=!0)):parts[slot.partPath]=!0,parts)part in partsHighlighted||delete parts[part];Object.keys(parts).length!==0&&await Lua_default.extensions.core_vehicle_partmgmt.selectParts(parts,currentVehID)},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.resolveOthers,write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis,restoreHighlight:queue$2.resolution.resolveThis}),deselectPart=queue$2.wrap(`deselectPart`,(slot,mouse=!1)=>{mouseUsedLast=mouse,tmrSelect&&clearTimeout(tmrSelect),!waitingForData.value&&(tmrSelect=setTimeout(async()=>{tmrSelect=null,!(opts.stickyPartSelection||Object.keys(currentConfig.value).length===0)&&await Lua_default.extensions.core_vehicle_partmgmt.showHighlightedParts(currentVehID)},100))},{deselectPart:queue$2.resolution.replaceWithResolve,write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis,restoreHighlight:queue$2.resolution.resolveThis,restoreSelection:queue$2.resolution.resolveThis}),restoreHighlight=queue$2.wrap(`restoreHighlight`,()=>{tmrSelect&&clearTimeout(tmrSelect),tmrSelect=setTimeout(async()=>{tmrSelect=null,await Lua_default.extensions.core_vehicle_partmgmt.highlightParts(partsHighlighted,currentVehID)},100)},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.replaceWithResolve,restoreHighlight:queue$2.resolution.replaceWithResolve}),restoreSelection=queue$2.wrap(`restoreSelection`,element=>{element?.partSelect?.()},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.replaceWithResolve,restoreSelection:queue$2.resolution.replaceWithResolve}),dropdownOpened=val=>opts.stickyPartSelection=val,skipLicGen=ref(!1),licensePlate=ref(``),licensePlateTextValid=ref(!0),settingsChanged=async()=>skipLicGen.value=await Lua_default.settings.getValue(`SkipGenerateLicencePlate`),getLicensePlate=()=>bngApi.engineLua(`core_vehicles.getVehicleLicenseText(getPlayerVehicle(0))`,str=>licensePlate.value=str),applyLicensePlateDebounced=debounce(()=>{opts.applyPartChangesAutomatically&&applyLicensePlate()},500);function applyLicensePlate(){applyLicensePlateDebounced.cancel(),licensePlateTextValid.value&&Lua_default.core_vehicles.setPlateText(licensePlate.value)}function applyRandomLicensePlate(){bngApi.engineLua(`core_vehicles.setPlateText(core_vehicles.regenerateVehicleLicenseText(getPlayerVehicle(0)),nil,nil,nil)`),getLicensePlate()}let isLicensePlateTextValid=text=>(Lua_default.core_vehicles.isLicensePlateValid(text).then(valid=>{licensePlateTextValid.value=valid}),licensePlateTextValid.value),changedPart=null;async function partConfigChanged(part){changedPart=part,opts.applyPartChangesAutomatically?await write():(part.changed=!0,partsChanged.value=!0)}let write=queue$2.wrap(`write`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.setPartsTreeConfig(currentConfig.value),await waitForData()},{write:queue$2.resolution.merge,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis});queue$2.wrap(`reset`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.resetPartsToLoadedConfig(),await waitForData()},{write:queue$2.resolution.resolveThis,reset:queue$2.resolution.merge,resetAllToLoadedConfig:queue$2.resolution.resolveThis});let resetAllToLoadedConfig=queue$2.wrap(`resetAllToLoadedConfig`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.resetAllToLoadedConfig(),await waitForData()},{write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.merge});function processConfig(config){treeStateSave(),waitingForData.value=!0,richPartInfo.value=Object.fromEntries(Object.entries(config.richPartInfo).map(([name,info])=>[name,info.information])),partsHighlighted=config.partsHighlighted;let processSlot=(slot,slotName,parentSlotName=void 0)=>{if(slot.slotName=slotName,slot.parentSlotName=parentSlotName,changedPart&&changedPart.chosenPartName===slot.chosenPartName&&(changedPart=slot),slot.highlight=config.partsHighlighted[slot.partPath],typeof slot.children==`object`)if(Object.keys(slot.children).length===0)delete slot.children;else for(let childSlotName in slot.children)slot.children[childSlotName]=processSlot(slot.children[childSlotName],childSlotName,slot.chosenPartName);return(typeof slot.suitablePartNames!=`object`||!Array.isArray(slot.suitablePartNames))&&(slot.suitablePartNames=[]),(typeof slot.unsuitablePartNames!=`object`||!Array.isArray(slot.unsuitablePartNames))&&(slot.unsuitablePartNames=[]),slot};currentVehID=config.vehID,currentConfig.value=processSlot(config.chosenPartsTree,config.chosenPartsTree.chosenPartName),partsChanged.value=!1,waitingForData.value=!1,nextTick(()=>{opts.stickyPartSelection=!1,deselectPart(),treeStateLoad(),changedPart=null,opts.applyPartChangesAutomatically&&!mouseUsedLast?restoreSelection(document.activeElement):restoreHighlight()})}events$3.on(`VehicleConfigChange`,processConfig);let readOption=(name,val=null)=>JSON.parse(localStorage.getItem(name)||JSON.stringify(val)),saveOption=(name,val)=>localStorage.setItem(name,JSON.stringify(val)),treeStateStorage=sessionStorage,treeStateSave=()=>currentConfig.value.chosenPartName&&treeStateStorage.setItem(`${treeStateKey}_${currentConfig.value.chosenPartName}`,JSON.stringify(treeState.value)),treeStateLoad=()=>{if(!currentConfig.value.chosenPartName)return;let state=treeStateStorage.getItem(`${treeStateKey}_${currentConfig.value.chosenPartName}`);if(state)try{treeState.value=JSON.parse(state)}catch{treeState.value={}}else treeState.value={}};return onMounted(()=>{settingsChanged(),getLicensePlate(),Lua_default.extensions.core_vehicle_partmgmt.sendDataToUI();for(let name of savedOptions)opts[name]=readOption(name,opts[name])}),onUnmounted(()=>{treeStateSave(),deselectPart(!1)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"parts-browser":!0,"with-background":__props.withBackground})},[withDirectives((openBlock(),createElementBlock(`div`,{class:`parts-browser-search`,onActivate:_cache[5]||=(...args)=>search$1.start&&search$1.start(...args),onDeactivate:_cache[6]||=()=>!search$1.text&&search$1.stop()},[createVNode(unref(bngInput_default),{modelValue:search$1.text,"onUpdate:modelValue":_cache[0]||=$event=>search$1.text=$event,modelModifiers:{trim:!0},"leading-icon":unref(icons).search,"floating-label":`Search`,onClick:_cache[1]||=$event=>search$1.start(),onValueChanged:_cache[2]||=$event=>search$1.onChange(),onKeydown:_cache[3]||=$event=>search$1.history.onKeyDown($event)},null,8,[`modelValue`,`leading-icon`]),withDirectives(createVNode(unref(bngButton_default),{icon:unref(icons).mathMultiply,style:`font-size: 0.75rem`,accent:unref(ACCENTS).text,onClick:_cache[4]||=$event=>search$1.stop()},null,8,[`icon`,`accent`]),[[unref(BngDisabled_default),!search$1.active]])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`parts-browser-content-wrapper`,onMouseleave:_cache[7]||=(...args)=>unref(deselectPart)&&unref(deselectPart)(...args),onDeactivate:_cache[8]||=(...args)=>unref(deselectPart)&&unref(deselectPart)(...args)},[createBaseVNode(`div`,_hoisted_1$107,[!search$1.active&¤tConfig.value?.children&&Object.keys(currentConfig.value.children).length>0?(openBlock(),createBlock(PartsBranch_default,{key:0,"root-slot":``,children:currentConfig.value.children,info:richPartInfo.value,"tree-state":treeState.value,"display-names":opts.showNames,"show-auxiliary":opts.showAux,"separate-sort":opts.separateSort,"always-sort":opts.alwaysSort,"show-empty":opts.showEmpty,onSelect:unref(selectPart),onDeselect:unref(deselectPart),onHighlight:highlightPart,onChange:partConfigChanged,onDropdown:dropdownOpened},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`onSelect`,`onDeselect`])):search$1.active?(openBlock(),createElementBlock(`div`,_hoisted_2$90,[createVNode(PartsBranch_default,{children:search$1.result,info:richPartInfo.value,"tree-state":treeState.value,"flat-entry":``,"display-names":opts.showNames,"show-auxiliary":opts.showAux,"separate-sort":opts.separateSort,"always-sort":opts.alwaysSort,"show-empty":opts.showEmpty,highlighter:search$1.highlight,onSelect:unref(selectPart),onDeselect:unref(deselectPart),onHighlight:highlightPart,onChange:partConfigChanged,onDropdown:dropdownOpened},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`highlighter`,`onSelect`,`onDeselect`]),withDirectives(createBaseVNode(`div`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).danger,color:`#d60`},null,8,[`type`]),createBaseVNode(`span`,_hoisted_3$78,toDisplayString(search$1.message),1)],512),[[vShow,search$1.message!==``]]),withDirectives(createBaseVNode(`div`,_hoisted_4$60,[_cache[37]||=createBaseVNode(`hr`,null,null,-1),_cache[38]||=createTextVNode(` Examples: `,-1),createBaseVNode(`ul`,null,[createBaseVNode(`li`,null,[_cache[23]||=createBaseVNode(`span`,{class:`search-example`},`left`,-1),_cache[24]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example1`)),1)]),createBaseVNode(`li`,null,[_cache[25]||=createBaseVNode(`span`,{class:`search-example`},`slot:_fr`,-1),_cache[26]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example2`)),1)]),createBaseVNode(`li`,null,[_cache[27]||=createBaseVNode(`span`,{class:`search-example`},`name:frame`,-1),_cache[28]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example3`)),1)]),createBaseVNode(`li`,null,[_cache[29]||=createBaseVNode(`span`,{class:`search-example`},`slot:_fr name:signal`,-1),_cache[30]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example4`)),1)]),createBaseVNode(`li`,null,[_cache[31]||=createBaseVNode(`span`,{class:`search-example`},`partname:pickup_fr`,-1),_cache[32]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example5`)),1)]),createBaseVNode(`li`,null,[_cache[33]||=createBaseVNode(`span`,{class:`search-example`},`author:bob`,-1),_cache[34]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example6`)),1)]),createBaseVNode(`li`,null,[_cache[35]||=createBaseVNode(`span`,{class:`search-example`},`mod:super`,-1),_cache[36]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example7`)),1)])]),_cache[39]||=createBaseVNode(`hr`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes`))+`: `,1),createBaseVNode(`ul`,null,[createBaseVNode(`li`,null,toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes1`)),1),createBaseVNode(`li`,null,toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes3`)),1)])],512),[[vShow,Object.keys(search$1.result).length===0]]),search$1.history.browsing&&search$1.history.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$50,[_cache[40]||=createBaseVNode(`hr`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.history`))+`: `,1),_cache[41]||=createBaseVNode(`br`,null,null,-1),_cache[42]||=createBaseVNode(`br`,null,null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(search$1.history.list,(historyEntry,idx)=>(openBlock(),createElementBlock(`span`,{class:normalizeClass({"history-entry":!0,"history-indicator":idx===search$1.history.index})},toDisplayString(historyEntry),3))),256)),_cache[43]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.historyClear`)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),createBaseVNode(`div`,_hoisted_6$37,[createBaseVNode(`div`,_hoisted_7$31,[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,icon:unref(icons).sortAsc,disabled:waitingForData.value},null,8,[`accent`,`icon`,`disabled`]),[[unref(BngPopover_default),`parts-options-menu`,`top-start`,{click:!0}],[unref(BngTooltip_default),_ctx.$t(`ui.garage.optionsSwitch`),`right`]]),createVNode(unref(bngPopoverMenu_default),{name:`parts-options-menu`,focus:``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$24,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.showAux?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[9]||=$event=>saveOption(`showAux`,opts.showAux=!opts.showAux)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.showAuxiliary`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.showNames?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[10]||=$event=>saveOption(`showNames`,opts.showNames=!opts.showNames)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.displayNames`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.selectSubParts?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[11]||=$event=>saveOption(`selectSubParts`,opts.selectSubParts=!opts.selectSubParts)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.subparts`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.separateSort?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[12]||=$event=>saveOption(`separateSort`,opts.separateSort=!opts.separateSort)},{default:withCtx(()=>[..._cache[44]||=[createTextVNode(`Sort sublists separately`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.alwaysSort?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[13]||=$event=>saveOption(`alwaysSort`,opts.alwaysSort=!opts.alwaysSort)},{default:withCtx(()=>[..._cache[45]||=[createTextVNode(`Always sort by name`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),unref(isDev)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,icon:opts.showEmpty?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[14]||=$event=>opts.showEmpty=!opts.showEmpty},{default:withCtx(()=>[..._cache[46]||=[createTextVNode(`Show empty slots 🐞`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)])]),_:1})]),createBaseVNode(`div`,_hoisted_9$21,[createVNode(unref(bngSwitch_default),{disabled:partsChanged.value||waitingForData.value,modelValue:opts.applyPartChangesAutomatically,"onUpdate:modelValue":_cache[15]||=$event=>opts.applyPartChangesAutomatically=$event,onValueChanged:_cache[16]||=$event=>saveOption(`applyPartChangesAutomatically`,opts.applyPartChangesAutomatically)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.liveUpdates`)),1)]),_:1},8,[`disabled`,`modelValue`])])]),createBaseVNode(`div`,_hoisted_10$15,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_11$13,[createVNode(unref(bngInput_default),{modelValue:licensePlate.value,"onUpdate:modelValue":_cache[17]||=$event=>licensePlate.value=$event,"floating-label":_ctx.$t(`ui.vehicleconfig.licensePlate`),maxlength:`50`,onValueChanged:_cache[18]||=$event=>unref(applyLicensePlateDebounced)(),onKeyup:_cache[19]||=withKeys($event=>applyLicensePlate(),[`enter`]),validate:isLicensePlateTextValid},null,8,[`modelValue`,`floating-label`]),withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).sync,onClick:_cache[20]||=$event=>applyRandomLicensePlate()},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.licensePlateGen`),`top`]]),opts.applyPartChangesAutomatically?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!licensePlateTextValid.value,icon:unref(icons).checkmark,onClick:_cache[21]||=$event=>applyLicensePlate()},null,8,[`disabled`,`icon`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.applyLicensePlate`),`top`]])])),[[unref(BngDisabled_default),skipLicGen.value||waitingForData.value],[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),createBaseVNode(`div`,_hoisted_12$9,[withDirectives(createVNode(unref(bngButton_default),{"show-hold":``,icon:unref(icons).undo,accent:unref(ACCENTS).custom,class:`reset-button`,disabled:waitingForData.value},null,8,[`icon`,`accent`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:unref(resetAllToLoadedConfig),holdDelay:1e3,repeatInterval:0}],[unref(BngTooltip_default),`Reset to original config`]]),createVNode(unref(bngButton_default),{class:`parts-apply-button`,icon:unref(icons).checkmark,onClick:_cache[22]||=$event=>unref(write)(),disabled:opts.applyPartChangesAutomatically||!partsChanged.value||waitingForData.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.common.apply`)),1)]),_:1},8,[`icon`,`disabled`])])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Parts_default=__plugin_vue_export_helper_default(_sfc_main$118,[[`__scopeId`,`data-v-13e05ae0`]]),_hoisted_1$106={key:0,class:`saveload-static`},_hoisted_2$89={class:`saveload-row saveload-filename`},_hoisted_3$77={class:`saveload-list`},_hoisted_4$59=[`onClick`],_hoisted_5$49={class:`saveload-list-item-label`},_hoisted_6$36={class:`saveload-static saveload-row saveload-controls`},_sfc_main$117={__name:`Save`,props:{withBackground:Boolean},setup(__props){useUINavBlocker().blockOnly([`context`]);let{api:api$1}=useBridge(),events$3=useEvents(),saveThumbnail=ref(!0),configList=ref([]),configFiltered=computed(()=>{let res=configList.value;return saveName.value&&(res=res.filter(itm=>itm.name.toLowerCase().includes(saveName.value.toLowerCase()))),res=res.slice().sort((a$1,b)=>a$1.player&&!b.player?-1:!a$1.player&&b.player?1:a$1.name.localeCompare(b.name)),res}),saveDisabled=computed(()=>!saveName.value||/^\.|[<>:"/\\|?*]/.test(saveName.value)),saveName=ref(``),configExists=computed(()=>!!configList.value.some(itm=>itm.name.toLowerCase()===saveName.value.toLowerCase()));async function openConfigFolderInExplorer(){await Lua_default.extensions.core_vehicle_partmgmt.openConfigFolderInExplorer()}async function save(configName){configExists.value&&!await openConfirmation(`Are you sure?`,$translate.instant(`ui.garage.save.overwrite`),[{label:`Overwrite`,value:!0},{label:`Cancel`,value:!1,extras:{accent:ACCENTS.secondary}}])||(await Lua_default.extensions.core_vehicle_partmgmt.saveLocal(configName+`.pc`),saveThumbnail.value&&api$1.engineLua(`extensions.load('util_screenshotCreator'); util_screenshotCreator.startWork({selection="${configName}"})`))}async function load(configName){await Lua_default.extensions.core_vehicle_partmgmt.loadLocal(configName+`.pc`)}async function remove$3(configName){await openConfirmation(`Are you sure?`,`This will permanently remove the configuration. You will not be able to recover it.`,[{label:`Delete permanently`,value:!0,extras:{accent:ACCENTS.attention}},{label:`Cancel`,value:!1,extras:{accent:ACCENTS.secondary}}])&&(await Lua_default.extensions.core_vehicle_partmgmt.removeLocal(configName),await getConfigList())}async function getConfigList(){let configs$1=await Lua_default.extensions.core_vehicle_partmgmt.getConfigList();configList.value=Array.isArray(configs$1)?configs$1:[]}return events$3.on(`VehicleChange`,getConfigList),events$3.on(`VehicleFocusChanged`,getConfigList),events$3.on(`VehicleconfigSaved`,getConfigList),getConfigList(),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({saveload:!0,"with-background":__props.withBackground})},[configList.value?(openBlock(),createElementBlock(`div`,_hoisted_1$106,[createBaseVNode(`div`,_hoisted_2$89,[createVNode(unref(bngInput_default),{modelValue:saveName.value,"onUpdate:modelValue":_cache[0]||=$event=>saveName.value=$event,modelModifiers:{trim:!0},"leading-icon":unref(icons).saveAs1,"floating-label":_ctx.$t(`ui.vehicleconfig.filename`)},null,8,[`modelValue`,`leading-icon`,`floating-label`]),withDirectives(createVNode(unref(bngButton_default),{icon:unref(icons).mathMultiply,style:`font-size: 0.75rem`,accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>saveName.value=``},null,8,[`icon`,`accent`]),[[unref(BngDisabled_default),!saveName.value]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:configExists.value?unref(ACCENTS).attention:unref(ACCENTS).main,onClick:_cache[2]||=$event=>save(saveName.value)},{default:withCtx(()=>[createTextVNode(toDisplayString(configExists.value?_ctx.$t(`ui.common.overwrite`):_ctx.$t(`ui.common.save`)),1)]),_:1},8,[`accent`])),[[unref(BngDisabled_default),saveDisabled.value]])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$77,[(openBlock(!0),createElementBlock(Fragment,null,renderList(configFiltered.value,config=>(openBlock(),createElementBlock(`div`,{class:`saveload-list-item`,onClick:$event=>saveName.value=config.name,tabindex:`1`},[config.official?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).beamNG},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceOfficial`),`top`]]):config.player?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).personSolid},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceUser`),`top`]]):withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).puzzleModule},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceMod`),`top`]]),createBaseVNode(`div`,_hoisted_5$49,toDisplayString(config.name),1),withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`saveload-list-item-load`,accent:unref(ACCENTS).outlined,icon:unref(icons).BNGFolder,onClick:withModifiers($event=>load(config.name),[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.load`)),1)]),_:1},8,[`accent`,`icon`,`onClick`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.loadTooltip`),`top`]]),config.player?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:`saveload-list-item-delete`,accent:unref(ACCENTS).outlined,icon:unref(icons).trashBin2,onClick:withModifiers($event=>remove$3(config.name),[`stop`])},null,8,[`accent`,`icon`,`onClick`])),[[unref(BngTooltip_default),`Remove configuration`,`top`]]):createCommentVNode(``,!0)],8,_hoisted_4$59))),256))]),createBaseVNode(`div`,_hoisted_6$36,[createVNode(unref(bngSwitch_default),{modelValue:saveThumbnail.value,"onUpdate:modelValue":_cache[3]||=$event=>saveThumbnail.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.saveThumbnail`)),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).main,onClick:_cache[4]||=$event=>openConfigFolderInExplorer()},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.openConfigFolder`)),1)]),_:1},8,[`accent`])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Save_default=__plugin_vue_export_helper_default(_sfc_main$117,[[`__scopeId`,`data-v-31dd4dbb`]]),_hoisted_1$105={class:`garage-row-title`},_hoisted_2$88={class:`headingContainer`},_hoisted_3$76={class:`garage-title-sup`},_hoisted_4$58={class:`garage-title-main`},_hoisted_5$48={class:`garage-row-main`},_hoisted_6$35={class:`garage-menu-container garage-menu-main`},_hoisted_7$30={key:0,class:`garage-menu garage-menu-primary`},_hoisted_8$23={key:1,class:`garage-menu garage-menu-secondary`},_hoisted_9$20={key:2,class:`garage-content`},_hoisted_10$14={class:`garage-sidemenu-title`},_hoisted_11$12={class:`garage-drawer-header`},_hoisted_12$8={class:`garage-drawer-content`},_hoisted_13$8={class:`garage-drawer-header`},_hoisted_14$8={class:`garage-drawer-content`},_hoisted_15$8={class:`garage-drawer-header`},_hoisted_16$8={class:`garage-drawer-content`},_hoisted_17$7={class:`garage-row-bottom`},ownerId=`garage`,_sfc_main$116={__name:`Garage`,props:{component:String},setup(__props){let components={paint:Paint_default,parts:Parts_default,tuning:Tuning_default,save:Save_default},uiNavTracker=useUINavTracker(),{showIfController}=storeToRefs(controls_default()),{lua,api:api$1}=useBridge(),events$3=useEvents(),bngVue$1=window.bngVue||{gotoGameState(){}},backBinding=ref(null),streamsList$1=[`electrics`];useStreams(streamsList$1,onStreamsUpdate);let drawerCamera=ref(!1),drawerVehicle=ref(!1),drawerGarage=ref(!1);watch(()=>showIfController,val=>val?uiNavTracker.addIgnore(`action_4`,ownerId):uiNavTracker.removeIgnore(`action_4`,ownerId),{immediate:!0});let launchLiveryEditor=async()=>{await runRaw(`extensions.core_vehicle_partmgmt.hasAvailablePart(be:getPlayerVehicle(0).JBeam .. "_skin_dynamicTextures")`)?await openExperimental(`Dynamic Decals`,`This is an early highly experimental preview of the Decal Editor. Please be aware that anything created with this feature may be lost in future hotfixes and updates. Do you wish to proceed?`,[{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}},{label:`Yes, I'm buckled up and ready to go!`,value:!0,extras:{default:!0}}])&&bngVue$1.gotoGameState(`livery-manager`):openMessage(``,$translate.instant(`ui.garage.decals.notAvailableForVehicle`))},props=__props,sidemenuActive=ref(!1);function activateSidemenu(){sidemenuActive.value=!0}function deactivateSidemenu(){sidemenuActive.value=!1,nextTick(()=>{drawerCamera.value=!1,drawerVehicle.value=!1,drawerGarage.value=!1})}function toggleSidemenu(){sidemenuActive.value=!sidemenuActive.value}let canSidemenuDeactivate=()=>!drawerCamera.value&&!drawerVehicle.value&&!drawerGarage.value,lightState=ref([!1,!1,!1]);async function lightToggle(idx){lightState.value[idx]=!lightState.value[idx],await lua.extensions.gameplay_garageMode.setLighting(lightState.value)}async function setCamera(view){await lua.extensions.gameplay_garageMode.setCamera(view)}let switches=reactive({lowbeam:{func:`setLightsState`,value:`lights_state`,on:1,off:0,state:!1},highbeam:{func:`setLightsState`,value:`lights_state`,on:2,off:0,state:!1},fog:{func:`set_fog_lights`,value:`fog`,on:1,off:0,state:!1},lightbar:{func:`set_lightbar_signal`,value:`lightbar`,on:1,off:0,state:!1},hazard:{func:`set_warn_signal`,value:`hazard_enabled`,on:1,off:0,state:!1}});function vehSwitch(key,on){if(!(key in switches))return;let svc=switches[key];if(on===void 0)on=!svc.state;else if(on===svc.state)return;api$1.activeObjectLua(`electrics.${svc.func}(${on?svc.on:svc.off})`)}let loaded=reactive({init:!1,vehicle:!1,status:!1}),vehicle=reactive({name:`Unknown`,vehicle:null,electrics:{},state:{}}),blackscreen=ref(!1),vehcomp=ref(``),vehcompview=ref(null),tmrInit;async function menuOpen(mode){vehcomp.value=vehcomp.value===mode?``:mode;let component=null;switch(mode){case`paint`:lua.extensions.gameplay_garageMode.setGarageMenuState(`paint`),component=components.paint;break;case`decals`:bngVue$1.gotoGameState(`decals-loader`);break;case`parts`:lua.extensions.gameplay_garageMode.setGarageMenuState(`parts`),component=components.parts;break;case`tuning`:lua.extensions.gameplay_garageMode.setGarageMenuState(`tuning`),component=components.tuning;break;case`vehicles`:lua.extensions.gameplay_garageMode.setGarageMenuState(`vehicles`),bngVue$1.gotoGameState(`menu.vehicles`,{params:{mode:`garageMode`,garage:`all`}});break;case`mycars`:lua.extensions.gameplay_garageMode.setGarageMenuState(`myCars`),bngVue$1.gotoGameState(`menu.vehicles`,{params:{mode:`garageMode`,garage:`own`}});break;case`photo`:bngVue$1.gotoGameState(`menu.photomode`);break;case`save`:component=components.save;break;case`savedefault`:console.log(`TODO: save as default`);break;case`test`:vehcomp.value=``,lua.extensions.gameplay_garageMode.testVehicle();break;default:vehcomp.value=``;break}component&&(vehcompview.value=markRaw(component))}function exit(event){event.detail.force||(vehcomp.value?menuOpen():window.bngVue.gotoAngularState(`menu.mainmenu`))}async function vehChange(){loaded.vehicle=!1,loaded.status=!1,vehicle.name=`Unknown`,vehicle.vehicle=null,vehicle.electrics={},await api$1.activeObjectLua(`electrics.setIgnitionLevel(1)`);let data=await lua.core_vehicles.getCurrentVehicleDetails();tmrInit&&=(loaded.init=!0,clearTimeout(tmrInit),null),data&&(loaded.vehicle=!0,vehicle.vehicle=data,data.model.Brand?vehicle.name=`${data.model.Brand} ${data.model.Name}`:vehicle.name=data.configs.Name,data.configs.Configuration&&(data.configs.Source===`BeamNG - Official`?vehicle.name+=` - ${data.configs.Configuration}`:vehicle.name+=` - Custom`))}function onStreamsUpdate(streams){if(typeof streams!=`object`||!streamsList$1.every(name=>name in streams))return;let data=streams.electrics;for(let key in loaded.status=data.ignitionLevel>0,switches){let svc=switches[key];svc.state=svc.value in data&&data[svc.value]===svc.on,vehicle.electrics[key]=svc.state}}let canScopeDeactivate=()=>!vehcomp.value;return onBeforeMount(async()=>{tmrInit=setTimeout(()=>{console.log(`Unable to get vehicle details in time. Forcing to init...`),loaded.init=!0,tmrInit=null},3e3),events$3.on(`VehicleChange`,vehChange),api$1.activeObjectLua(`electrics.setIgnitionLevel(1)`),events$3.on(`GarageModeBlackscreen`,data=>blackscreen.value=data.active),vehChange(),lightState.value=await lua.extensions.gameplay_garageMode.getLighting(),props.component&&menuOpen(props.component)}),onUnmounted(()=>{tmrInit&&clearTimeout(tmrInit)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives(createBaseVNode(`div`,{class:normalizeClass([`garage-blackscreen`,{"garage-blackscreen-active":blackscreen.value}])},null,2),[[unref(BngBlur_default),blackscreen.value]]),loaded.init?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:`garage-view`,onDeactivate:exit},[createBaseVNode(`div`,_hoisted_1$105,[createBaseVNode(`div`,_hoisted_2$88,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$76,[createBaseVNode(`h4`,null,[createTextVNode(toDisplayString(_ctx.$t(`ui.mainmenu.garage`))+` `,1),vehcomp.value?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(`/ `+toDisplayString(vehicle.name),1)],64)):createCommentVNode(``,!0)])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`h2`,_hoisted_4$58,[vehcomp.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`garage-back-button`,{"garage-back-binding-shown":backBinding.value?.displayed}]),accent:backBinding.value?.displayed?unref(ACCENTS).ghost:unref(ACCENTS).outlined,icon:unref(icons).arrowLargeLeft,"bng-no-nav":`true`,onClick:exit},{default:withCtx(()=>[withDirectives(createVNode(unref(bngBinding_default),{ref_key:`backBinding`,ref:backBinding,class:`back-binding`,"ui-event":`back`,controller:``,"track-ignore":``},null,512),[[vShow,!sidemenuActive.value]]),createTextVNode(` `+toDisplayString(backBinding.value?.displayed?``:_ctx.$t(`ui.common.back`)),1)]),_:1},8,[`class`,`accent`,`icon`])),[[unref(BngTooltip_default),!backBinding.value||backBinding.value?.displayed?_ctx.$t(`ui.common.back`):void 0,`top`]]):createCommentVNode(``,!0),createBaseVNode(`span`,null,toDisplayString(vehcomp.value?_ctx.$t(`ui.garage.tabs.`+(vehcomp.value===`tuning`?`tune`:vehcomp.value)):vehicle.name),1)])),[[unref(BngBlur_default)]])])]),createBaseVNode(`div`,_hoisted_5$48,[createBaseVNode(`div`,_hoisted_6$35,[vehcomp.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$30,[withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).engine,active:vehcomp.value===`parts`,onClick:_cache[0]||=$event=>menuOpen(`parts`),"bng-scoped-nav-autofocus":loaded.vehicle&&!sidemenuActive.value&&unref(showIfController)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.parts`)),1)]),_:1},8,[`icon`,`active`,`bng-scoped-nav-autofocus`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).wrench,active:vehcomp.value===`tuning`,onClick:_cache[1]||=$event=>menuOpen(`tuning`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.tune`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).sprayCan,active:vehcomp.value===`paint`,onClick:_cache[2]||=$event=>menuOpen(`paint`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.paint`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).star,active:vehcomp.value===`decals`,onClick:launchLiveryEditor},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.decals`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]])])),vehcomp.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_8$23,[withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).car,active:vehcomp.value===`vehicles`,onClick:_cache[3]||=$event=>menuOpen(`vehicles`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.vehicles`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).keys1,active:vehcomp.value===`mycars`,onClick:_cache[4]||=$event=>menuOpen(`mycars`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.load`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).photo,onClick:_cache[5]||=$event=>menuOpen(`photo`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.photo`)),1)]),_:1},8,[`icon`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]])])),vehcomp.value&&vehcompview.value?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_9$20,[(openBlock(),createBlock(resolveDynamicComponent(vehcompview.value),{"with-background":``,"with-padding":!1}))])),[[unref(BngOnUiNav_default),exit,`menu,back`],[unref(BngFrustumMover_default),!0,`left`]]):createCommentVNode(``,!0)]),withDirectives((openBlock(),createElementBlock(`div`,{class:`garage-sidemenu`,onActivate:activateSidemenu,onDeactivate:deactivateSidemenu},[withDirectives((openBlock(),createElementBlock(`h4`,_hoisted_10$14,[createVNode(unref(bngBinding_default),{class:`back-binding`,"ui-event":`action_4`,controller:``}),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.garage2.features`)),1)])),[[unref(BngBlur_default)]]),createVNode(unref(drawer_default),{modelValue:drawerCamera.value,"onUpdate:modelValue":_cache[12]||=$event=>drawerCamera.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_11$12,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).movieCamera,active:drawerCamera.value,"bng-scoped-nav-autofocus":sidemenuActive.value&&unref(showIfController),onClick:_cache[6]||=$event=>drawerCamera.value=!drawerCamera.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.photo.camera`)),1)]),_:1},8,[`icon`,`active`,`bng-scoped-nav-autofocus`])),[[unref(BngDisabled_default),!loaded.init]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_12$8,[createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).camera3Fourth1,onClick:_cache[7]||=$event=>setCamera(`default`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.standartCamera`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraFront1,onClick:_cache[8]||=$event=>setCamera(`front`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.front`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraBack1,onClick:_cache[9]||=$event=>setCamera(`back`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.back`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraSideRight,onClick:_cache[10]||=$event=>setCamera(`side`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.right`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraTop1,onClick:_cache[11]||=$event=>setCamera(`top`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.top`)),1)]),_:1},8,[`icon`])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`]),createVNode(unref(drawer_default),{modelValue:drawerVehicle.value,"onUpdate:modelValue":_cache[19]||=$event=>drawerVehicle.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_13$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).electronicSchemeOutline,active:drawerVehicle.value,onClick:_cache[13]||=$event=>drawerVehicle.value=!drawerVehicle.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle||!loaded.status]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_14$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lowBeam,active:vehicle.electrics.lowbeam,onClick:_cache[14]||=$event=>vehSwitch(`lowbeam`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.headlights.low`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).highBeam,active:vehicle.electrics.highbeam,onClick:_cache[15]||=$event=>vehSwitch(`highbeam`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.headlights.high`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).fogLight,active:vehicle.electrics.fog_lights,onClick:_cache[16]||=$event=>vehSwitch(`fog`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.fog_lights`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).hazardLights,active:vehicle.electrics.hazard,onClick:_cache[17]||=$event=>vehSwitch(`hazard`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.hazard_lights`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).wigwags,active:vehicle.electrics.lightbar,onClick:_cache[18]||=$event=>vehSwitch(`lightbar`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.lightbar`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`]),createVNode(unref(drawer_default),{modelValue:drawerGarage.value,"onUpdate:modelValue":_cache[24]||=$event=>drawerGarage.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_15$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).garage01,active:drawerGarage.value,onClick:_cache[20]||=$event=>drawerGarage.value=!drawerGarage.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.features`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.init]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_16$8,[createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG32,active:lightState.value[0],onClick:_cache[21]||=$event=>lightToggle(0)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.west`)),1)]),_:1},8,[`icon`,`active`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG22,active:lightState.value[1],onClick:_cache[22]||=$event=>lightToggle(1)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.middle`)),1)]),_:1},8,[`icon`,`active`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG12,active:lightState.value[2],onClick:_cache[23]||=$event=>lightToggle(2)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.east`)),1)]),_:1},8,[`icon`,`active`])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`])],32)),[[unref(BngScopedNav_default),{activated:sidemenuActive.value,type:`container`,bubbleWhitelistEvents:[`menu`],canDeactivate:canSidemenuDeactivate}],[unref(BngOnUiNav_default),toggleSidemenu,`action_4`]])]),createBaseVNode(`div`,_hoisted_17$7,[withDirectives(createVNode(GarageButton_default,{active:vehcomp.value===`save`,onClick:_cache[25]||=$event=>menuOpen(`save`),icon:unref(icons).saveAs1},null,8,[`active`,`icon`]),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)],[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.save`),`top`]]),withDirectives(createVNode(GarageButton_default,{onClick:_cache[26]||=$event=>menuOpen(`test`),icon:unref(icons).trafficCone},null,8,[`icon`]),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)],[unref(BngTooltip_default),_ctx.$t(`ui.common.test`),`top`]])])],32)),[[unref(BngScopedNav_default),{activateOnMount:!0,bubbleWhitelistEvents:[`menu`],canDeactivate:canScopeDeactivate}],[unref(BngOnUiNav_default),toggleSidemenu,`action_4`]]):createCommentVNode(``,!0)],64))}},Garage_default=__plugin_vue_export_helper_default(_sfc_main$116,[[`__scopeId`,`data-v-b5f03823`]]),routes_default$7=[{path:`/garagemode/:component?`,name:`garagemode`,component:Garage_default,props:!0,meta:{infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0}}},{path:`/garagemode/tuning`,name:`garagemode.tuning`,component:Garage_default,props:{component:`tuning`},meta:{infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0}}}],_hoisted_1$104={class:`edit-form`},_sfc_main$115={__name:`FileEditForm`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$104,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event,suffix:`.dyndecals.json`},null,8,[`modelValue`])]))}},FileEditForm_default=__plugin_vue_export_helper_default(_sfc_main$115,[[`__scopeId`,`data-v-c94cd7bf`]]),_sfc_main$114={__name:`RenameLayerForm`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event},null,8,[`modelValue`])]))}},RenameLayerForm_default=_sfc_main$114,_hoisted_1$103={class:`exit-editor-dialog`},_hoisted_2$87={class:`apply-skin-wrapper`},_sfc_main$113={__name:`ExitEditorDialog`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$103,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event,suffix:`.dyndecals.json`},null,8,[`modelValue`]),createBaseVNode(`div`,_hoisted_2$87,[createVNode(unref(bngPillCheckbox_default),{modelValue:formModel.value.applySkin,"onUpdate:modelValue":_cache[1]||=$event=>formModel.value.applySkin=$event,disabled:!formModel.value.name},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Apply Skin`,-1)]]),_:1},8,[`modelValue`,`disabled`])])]))}},ExitEditorDialog_default=__plugin_vue_export_helper_default(_sfc_main$113,[[`__scopeId`,`data-v-b4897c9e`]]);const openEditFileDialog=(title,description,formModel,formValidator)=>openFormDialog(FileEditForm_default,formModel,formValidator,title,description),openRenameLayerDialog=(title,description,formModel,formValidator)=>openFormDialog(RenameLayerForm_default,formModel,formValidator,title,description);var SELECTION_LUA$1=Lua_default.extensions.ui_liveryEditor_selection;const useLayerActionsStore=defineStore(`createLayer`,()=>{async function onActionItemSelected(action){if(!action.items)if(console.log(`[onActionItemSelected] do action`),action.value===`group`)await Lua_default.extensions.ui_liveryEditor_tools_group.groupLayers();else if(action.value===`ungroup`)await Lua_default.extensions.ui_liveryEditor_tools_group.ungroupLayer();else if(action.value===`delete`)await openConfirmation(`Delete Layer`,`Are you sure you want to delete ${singleSelectedLayer.value.name}?`)&&await Lua_default.extensions.ui_liveryEditor_tools_settings.deleteLayer();else if(action.value===`rename`){let res=await openRenameLayerDialog(`Rename Layer`,``,{name:singleSelectedLayer.value.name},model=>model.name!==null&&model.name!==void 0&&model.name!==``&&model.name!==singleSelectedLayer.value.name);res.value&&await Lua_default.extensions.ui_liveryEditor_tools_settings.rename(res.formData.name)}else action.value===`duplicate`?await SELECTION_LUA$1.duplicateSelectedLayer():await Lua_default.extensions.ui_liveryEditor_tools.useTool(action.value)}return{onActionItemSelected}});var EDIT_MODE=Lua_default.extensions.ui_liveryEditor_editMode,DECAL_LAYER=Lua_default.extensions.ui_liveryEditor_layers_decals,TRANSFORM_TOOL=Lua_default.extensions.ui_liveryEditor_tools_transform,MATERIAL_TOOL=Lua_default.extensions.ui_liveryEditor_tools_material,SETTINGS_TOOL=Lua_default.extensions.ui_liveryEditor_tools_settings;const useLayerSettingsStore=defineStore(`layerSettings`,()=>{let{events:events$3}=useBridge(),rootStore=useLiveryEditorStore(),active=ref(!1),targetLayer=ref({}),currentTool=ref(null),toolsData=ref(null),requestApplyActive=ref(!1),decalTexture=ref(null),isChangeDecal=ref(null),activeSettings=ref(null),editModeState=reactive({lockScaling:!1}),isStampMode=computed(()=>toolsData.value&&toolsData.value.mode===`stamp`),_reapplyActive=ref(!1),cursorData=ref(null),_appliedLayers=ref(null),activeLayerUid=ref(null),reapplyActive=computed({get:()=>_reapplyActive.value,set:async newValue=>{newValue?await Lua_default.extensions.ui_liveryEditor_editMode.requestReapply():await Lua_default.extensions.ui_liveryEditor_editMode.cancelReapply()}}),appliedLayers=computed(()=>!_appliedLayers.value||!Array.isArray(_appliedLayers.value)?null:_appliedLayers.value);events$3.on(`liveryEditor_EditMode_OnActiveStatusChanged`,async data=>{console.log(`liveryEditor_EditMode_OnActiveStatusChanged`,data),active.value=data}),events$3.on(`LiveryEditor_CursorUpdated`,async data=>{console.log(`LiveryEditor_CursorUpdated`,data),cursorData.value=data}),events$3.on(`LiveryEditor_SelectedLayersDataUpdated`,async data=>{console.log(`LiveryEditor_SelectedLayersDataUpdated`,data),data&&Array.isArray(data)&&data.length>0&&(targetLayer.value=data[0])}),events$3.on(`liveryEditor_OnSettingsChanged_UseMousePos`,data=>{console.log(`liveryEditor_OnSettingsChanged_UseMousePos`,data),cursorData.value&&(cursorData.value.isUseMousePos=data)}),events$3.on(`liveryEditor_OnEditMode_ReapplyChanged`,data=>{console.log(`liveryEditor_OnEditMode_ReapplyChanged`,data),_reapplyActive.value=data}),events$3.on(`LiveryEditorToolChanged`,data=>{console.log(`LiverEditorToolChanged`,data),currentTool.value=data}),events$3.on(`LiveryEditor_ToolDataUpdated`,async data=>{console.log(`LiveryEditor_ToolDataUpdated`,data),toolsData.value=data}),events$3.on(`liveryEditor_EditMode_OnRequestApplyChanged`,async data=>{console.log(`liveryEditor_EditMode_OnRequestApplyChanged`,data),requestApplyActive.value=data}),events$3.on(`liveryEditor_EditMode_OnAppliedLayersUpdated`,async data=>{console.log(`liveryEditor_EditMode_OnAppliedLayersUpdated`,data),_appliedLayers.value=data}),events$3.on(`liveryEditor_EditMode_OnActiveLayerChanged`,async data=>{console.log(`liveryEditor_EditMode_OnActiveLayerChanged`,data),activeLayerUid.value=data}),events$3.on(`liveryEditor_onDecalTextureChanged`,async data=>{console.log(`liveryEditor_onDecalTextureChanged`,data),console.log(`liveryEditor_onDecalTextureChanged active value`,active.value),active.value?!isChangeDecal.value&&!requestApplyActive.value&&await requestApply():await EDIT_MODE.activate(),await MATERIAL_TOOL.setDecal(data),rootStore.toggleShowDecalSelector(),isChangeDecal.value=null}),events$3.on(`liveryEditor_onDecalSelectorCancelled`,async data=>{console.log(`liveryEditor_onDecalSelectorCancelled`,data),active.value?rootStore.toggleShowDecalSelector():rootStore.toggleEditModeLayout(),isChangeDecal.value=null});function init$3(){active.value?EDIT_MODE.resetCursorProperties([]):rootStore.toggleShowDecalSelector()}let deactivate=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),rootStore.currentContext=EDITOR_CONTEXT.default,rootStore.editorView=EDITOR_VIEWS.default},toggleRequestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.toggleRequestApply(),requestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.requestApply(),cancelRequestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.cancelRequestApply(),getInitialData=async()=>await Lua_default.extensions.ui_liveryEditor_layers_cursor.requestData(),toggleStamp=async()=>{toolsData.value&&toolsData.value.mode===`stamp`?await Lua_default.extensions.ui_liveryEditor_tools_transform.cancelStamp():await Lua_default.extensions.ui_liveryEditor_tools_transform.useStamp()},setActiveLayer=async layerUid=>{await Lua_default.extensions.ui_liveryEditor_editMode.setActiveLayer(layerUid)},requestReapply=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.requestReapply()},cancelReapply=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.cancelReapply()},cancelChanges=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.cancelChanges(),await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),await Lua_default.extensions.ui_liveryEditor_tools.closeCurrentTool()},requestChangeDecal=async()=>{isChangeDecal.value=!0,rootStore.toggleShowDecalSelector()},toggleReapply=()=>reapplyActive.value=!reapplyActive.value,apply$1=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.apply(),saveChanges=async params=>{await Lua_default.extensions.ui_liveryEditor_editMode.saveChanges(params),await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),rootStore.currentContext=EDITOR_CONTEXT.default,rootStore.editorView=EDITOR_VIEWS.default},closeCurrentTool=async()=>{await Lua_default.extensions.ui_liveryEditor_tools.closeCurrentTool()};return{...EDIT_MODE,...TRANSFORM_TOOL,...MATERIAL_TOOL,...SETTINGS_TOOL,...DECAL_LAYER,active,cursorData,appliedLayers,activeLayerUid,requestApplyActive,reapplyActive,decalTexture,editModeState,activeSettings,init:init$3,deactivate,getInitialData,toolsData,targetLayer,isStampMode,toggleStamp,requestReapply,cancelReapply,cancelChanges,requestApply,cancelRequestApply,toggleRequestApply,toggleReapply,setActiveLayer,saveChanges,requestChangeDecal,apply:apply$1,closeCurrentTool}}),useLayersManagerStore=defineStore(`layersManager`,()=>{let{events:events$3}=useBridge(),multipleSelection=ref(!1),_selection=ref([]),selectedLayers=computed({get(){return _selection.value},set(newValue){sendUpdatedSelection(newValue)}});events$3.on(`LiveryEditor_SelectedLayersChanged`,data=>{console.log(`selected Layer Updated`,data),_selection.value=data&&Array.isArray(data)&&data.length>0?data:[]});let sendUpdatedSelection=async selection=>{console.log(`sendUpdatedSelection`,selection),selection.length===0?await Lua_default.extensions.ui_liveryEditor_selection.clearSelection():multipleSelection.value?await Lua_default.extensions.ui_liveryEditor_selection.setMultipleSelected(selection):await Lua_default.extensions.ui_liveryEditor_selection.setSelected(selection)},canSort=data=>{let item=getItemByPath(data.targetDataset.draggablePath);return!(data.intersectionType===INTERSECTION_TYPES.sub&&item.type!==3)};async function clearSelection(){multipleSelection.value=!1,selectedLayers.value=[]}function getItemByPath(path){let pathSegments=path?path.split(`/`):void 0;if(!pathSegments)throw Error(`Path not defined`);let index=parseInt(pathSegments[0]),currentItem=layers.value[index];for(let i=1;i{Lua_default.extensions.ui_liveryEditor_tools_group.changeOrder(oldIndex+1,oldParentUid||``,newIndex+1,newParentUid||``)},clearSelection}});var FIRST_LAYER_ACTIONS=[{value:`edit`,label:`Edit`,icon:icons.edit,validator:()=>!0},{value:`order`,label:`Change Order`,icon:icons.order},{value:`rename`,label:`Rename`,icon:icons.rename},{value:`highlight`,label:`Highlight On`,icon:icons.eyeSolidOpened,toggleAction:!0,inactiveLabel:`Highlight Off`,inactiveIcon:icons.eyeSolidClosed},{value:`visibility`,label:`Enabled`,icon:icons.eyeOutlineOpened,toggleAction:!0,inactiveLabel:`Hidden`,inactiveIcon:icons.eyeOutlineClosed},{value:`delete`,label:`Delete`,icon:icons.trashBin2}],SELECTION_LUA=Lua_default.extensions.ui_liveryEditor_selection,SETTINGS_LUA=Lua_default.extensions.ui_liveryEditor_tools_settings,CAMERA_LUA=Lua_default.extensions.ui_liveryEditor_camera,EDITOR_LUA=Lua_default.extensions.ui_liveryEditor_editor;const EDITOR_CONTEXT={default:`default`,editMode:`editMode`,newLayer:`newLayer`};var SELECT_MODE={single:`single`,multi:`multi`};const EDITOR_VIEWS={default:`default`,decalSelector:`decalSelector`,editMode:`editMode`},useLiveryEditorStore=defineStore(`liveryEditor`,()=>{let{events:events$3}=useBridge(),layers$1=ref(null),visibleLayersCount=ref(null),selectedTool=ref(null),currentFile=ref(null),currentContext=ref(null),history$1=ref(null),selectMode=ref(SELECT_MODE.single),selectedLayers=ref([]),layerActions=ref(null),categories=ref(null),textures=ref(null),editorView=ref(EDITOR_VIEWS.main),cameraView=ref(null),showLayersManager=computed(()=>!(selectedTool.value&¤tContext.value===EDITOR_CONTEXT.editMode)),showLayerActions=computed(()=>selectedLayers.value),selectedLayerUids=computed(()=>selectedLayers.value?selectedLayers.value.map(x=>x.uid):void 0);events$3.on(`liveryEditor_OnLayersUpdated`,data=>{console.log(`liveryEditor_OnLayersUpdated`,data),layers$1.value=data}),events$3.on(`liveryEditor_Layers_OnVisibleCountChanged`,data=>{console.log(`liveryEditor_Layers_OnVisibleCountChanged`,data),visibleLayersCount.value=data}),events$3.on(`LiveryEditor_onSaveFileLoaded`,data=>{console.log(`LiveryEditor_onSaveFileLoaded`,data),currentFile.value=data}),events$3.on(`LiveryEditorLayersUpdate`,data=>{console.log(`LiveryEditorLayersUpdated`,data),layers$1.value=data}),events$3.on(`LiveryEditor_SelectedLayersDataUpdated`,async data=>{console.log(`LiveryEditor_SelectedLayersDataUpdated`,data),selectedLayers.value=data&&Array.isArray(data)?data:void 0}),events$3.on(`LiverEditorLayerActionsUpdated`,async data=>{console.log(`LiverEditorLayerActionsUpdated`,data)}),events$3.on(`LiveryEditor_onHistoryUpdated`,data=>{console.log(`LiveryEditor_onHistoryUpdated`,data),history$1.value=data}),events$3.on(`LiveryEditor_SelectedLayersChanged`,data=>{console.log(`selected Layer Updated`,data),currentContext.value=data&&data.length>0?EDITOR_CONTEXT.selectedLayer:null}),events$3.on(`LiveryEditorToolChanged`,data=>{console.log(`LiverEditorToolChanged`,data),selectedTool.value=data}),events$3.on(`LiveryEditor_OnCameraChanged`,data=>{console.log(`LiverEditorToolChanged`,data),cameraView.value=data});let dismissLayerActions=async()=>{await Lua_default.extensions.ui_liveryEditor_selection.clearSelection()},toggleEditModeLayout=async enable=>{enable=typeof enable==`boolean`?enable:currentContext.value===EDITOR_CONTEXT.default,enable?(currentContext.value=EDITOR_CONTEXT.editMode,editorView.value=EDITOR_VIEWS.editMode):(currentContext.value=EDITOR_CONTEXT.default,editorView.value=EDITOR_VIEWS.default)};function toggleShowDecalSelector(){editorView.value===EDITOR_VIEWS.decalSelector?editorView.value=EDITOR_VIEWS.editMode:editorView.value=EDITOR_VIEWS.decalSelector}let requestDismissLayerActions=()=>{currentContext.value===EDITOR_CONTEXT.newLayer?currentContext.value=null:currentContext.value===EDITOR_CONTEXT.selectedLayer&&(selectedLayers.value=[])},selectSingle=async layerUid=>{await Lua_default.extensions.ui_liveryEditor_selection.setSelected(layerUid)},toggleVisibility=async layer=>await Lua_default.extensions.ui_liveryEditor_tools_settings.toggleVisibilityById(layer.id),toggleLock=async layer=>await Lua_default.extensions.ui_liveryEditor_tools_settings.toggleLockById(layer.id),changeOrder=async(layer,direction$1)=>{direction$1===-1?await Lua_default.extensions.ui_liveryEditor_tools_group.moveOrderUpById(layer.uid):direction$1===1&&await Lua_default.extensions.ui_liveryEditor_tools_group.moveOrderDownById(layer.uid)},startEditor=async()=>{if(await Lua_default.extensions.ui_liveryEditor_editor.startEditor(),await Lua_default.extensions.ui_liveryEditor_editor.startSession(),currentContext.value=EDITOR_CONTEXT.default,editorView.value=EDITOR_VIEWS.default,await CAMERA_LUA.setOrthographicView(`right`),categories.value=await Lua_default.extensions.ui_liveryEditor_resources.getTextureCategories(),categories.value&&categories.value.length>0){let firstCategory=categories.value[0];setTexturesByCategory(firstCategory.value)}};async function setTexturesByCategory(category){textures.value=(await Lua_default.extensions.ui_liveryEditor_resources.getTexturesByCategory(category)).items}let createSaveFile=async filename=>{await Lua_default.extensions.ui_liveryEditor_userData.createSaveFile(filename)},useTool=async(toolName,params)=>{await Lua_default.extensions.ui_liveryEditor_tools.useTool(toolName)};async function onActionItemSelected(action){if(!action.items){let firstSelected=selectedLayers.value&&selectedLayers.value.length>0?selectedLayers.value[0]:null;if(action.value===`delete`)await openConfirmation(`Delete Layer`,`Are you sure you want to delete ${firstSelected.name}?`)&&await Lua_default.extensions.ui_liveryEditor_tools_settings.deleteLayer();else if(action.value===`rename`){let res=await openRenameLayerDialog(`Rename Layer`,``,{name:firstSelected.name},model=>model.name!==null&&model.name!==void 0&&model.name!==``&&model.name!==firstSelected.name);res.value&&await Lua_default.extensions.ui_liveryEditor_tools_settings.rename(res.formData.name)}else action.value===`duplicate`?await SELECTION_LUA.duplicateSelectedLayer():action.value===`visibility`?await SETTINGS_LUA.toggleVisibility():action.value===`highlight`?await SELECTION_LUA.toggleHighlightSelectedLayer():await Lua_default.extensions.ui_liveryEditor_tools.useTool(action.value)}}let editorState=reactive({isOpenExitDialog:!1,exitDialogResult:null,saving:!1});async function openExitDialog(){let res=await openFormDialog(ExitEditorDialog_default,ref({name:currentFile.value?currentFile.value.name:void 0,applySkin:!!(currentFile.value&¤tFile.value.name)}),form=>!form||!form.name?{error:!0,message:`Invalid Save Name`}:{error:!1},`Exit Editor`,null,[{label:`Cancel`,value:-1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:`Save and Exit`,value:1,emitData:!0,disableIfInvalid:!0,extras:{icon:icons.saveAs1}},{label:`Exit`,value:0,emitData:!0,extras:{accent:ACCENTS.attention,icon:icons.exit}}]);return res.value===-1?!1:(res.value===1&&await EDITOR_LUA.save(res.formData.name),res.formData.applySkin&&await EDITOR_LUA.applySkin(),await exit(),!0)}async function save(forceOpenPopup=!1){if(!currentFile.value||!currentFile.value.name||forceOpenPopup){editorState.isOpenExitDialog=!0;let res=await openEditFileDialog(`Save file`,`Enter name of your new save file`,{name:currentFile.value?currentFile.value.name:createFilename()},model=>model.name!==null&&model.name!==void 0&&model.name!==``);return res.value&&(editorState.saving=!0,await Lua_default.extensions.ui_liveryEditor_editor.save(res.formData.name),editorState.saving=!1),editorState.isOpenExitDialog=!1,res.value}else await Lua_default.extensions.ui_liveryEditor_editor.save(currentFile.value.name)}async function exit(){router_default.replace({name:`garagemode`}),await Lua_default.extensions.ui_liveryEditor_editor.exitEditor()}function createFilename(){let currentDate=new Date;return`${currentDate.getFullYear()}-${String(currentDate.getMonth()+1).padStart(2,`0`)}-${String(currentDate.getDate()).padStart(2,`0`)}_${String(currentDate.getHours()).padStart(2,`0`)}-${String(currentDate.getMinutes()).padStart(2,`0`)}-${String(currentDate.getSeconds()).padStart(2,`0`)}`}return{...SELECTION_LUA,...CAMERA_LUA,...SETTINGS_LUA,layers:layers$1,visibleLayersCount,layerActions,selectedTool,currentFile,currentContext,textures,categories,editorView,showLayersManager,showLayerActions,cameraView,editorState,dismissLayerActions,setTexturesByCategory,toggleEditModeLayout,toggleShowDecalSelector,requestDismissLayerActions,onActionItemSelected,selectMode,selectedLayers,selectedLayerUids,createSaveFile,toggleVisibility,toggleLock,startEditor,save,useTool,selectSingle,changeOrder,openExitDialog}}),SORT_OPTIONS=Object.freeze({name:`name`,modified:`modified`}),useLiveryFileStore=defineStore(`liveryFile`,()=>{let{events:events$3}=useBridge(),dataFiles=ref(null),sortKey=ref(SORT_OPTIONS.modified),sortDesc=ref(!0),files=computed(()=>{if(!dataFiles.value)return[];let sortOrder=sortDesc.value?-1:1;return dataFiles.value.sort((a$1,b)=>a$1[sortKey.value]b[sortKey.value]?1*sortOrder:0)}),init$3=async()=>{await Lua_default.extensions.ui_liveryEditor_userData.requestUpdatedData()},loadFile=async file$1=>await Lua_default.extensions.ui_liveryEditor_editor.loadFile(file$1.location),renameFile=async(file$1,newFilename)=>{await Lua_default.extensions.ui_liveryEditor_userData.renameFile(file$1.name,newFilename)},deleteFile=async file$1=>{await Lua_default.extensions.ui_liveryEditor_userData.deleteSaveFile(file$1.name)};events$3.on(`LiverySaveFilesUpdated`,data=>{data&&Array.isArray(data)&&data.length>0?(data.forEach(x=>{x.modifiedFormatted=formatDateTime(x.modified),x.fileSizeFormatted=formatSize(x.fileSize)}),dataFiles.value=data):dataFiles.value=[]});function formatDateTime(unixTime){let datetime=new Date(unixTime*1e3);return`${datetime.toLocaleDateString()} ${datetime.toLocaleTimeString()}`}function formatSize(bytes){return`${(bytes/1024).toFixed(2)} KB`}return{files,sortKey,sortDesc,init:init$3,loadFile,renameFile,deleteFile}});var EDITOR_RESOURCES_LUA=Lua_default.extensions.ui_liveryEditor_resources;const useDecalSelectorStore=defineStore(`liveryEditorDecalSelector`,()=>{let{events:events$3}=useBridge(),categories=ref(null),currentCategory=ref(null),isShow=ref(!1),textures=computed(()=>{if(!categories.value)return;let category=categories.value.find(x=>x.value===currentCategory.value);return category?category.items:void 0});async function init$3(){if(categories.value=await EDITOR_RESOURCES_LUA.getTextureCategories(),categories.value&&Array.isArray(categories.value)&&categories.value.length>0){let first=categories.value[0].value;await setCategory(first)}}async function setCategory(category){await fetchTextures(category),currentCategory.value=category}async function fetchTextures(category){let index=categories.value.findIndex(x=>x.value===category);if(index===-1)return;let textures$1=categories.value[index].items;if(index>=0&&(!textures$1||!textures$1.length===0)){let categoryWithTextures=await EDITOR_RESOURCES_LUA.getTexturesByCategory(category);categories.value[index].items=categoryWithTextures.items}}async function toggle(){isShow.value=!isShow.value,events$3.emit(`liveryEditor_onDecalStateChanged`,{show:isShow.value})}async function selectDecalItem(texturePath){await Lua_default.extensions.ui_liveryEditor_layerEdit.setup(),await Lua_default.extensions.ui_liveryEditor_layerEdit.editNewDecal({texturePath})}async function cancelSelection(){events$3.emit(`liveryEditor_onDecalSelectorCancelled`)}return{categories,currentCategory,textures,isShow,init:init$3,toggle,setCategory,selectDecalItem,cancelSelection}});var DEFAULT_ACCELERATION_RATE=.75,DEFAULT_ACCELERATION_NATURE=1.75,DEFAULT_ACTION_INTERVAL_MS=150,FOCUS_LD_TRIGGER_VALUE$2=-.5,FOCUS_RU_TRIGGER_VALUE$2=.5;const ACTION_PARAMS_TYPE={xyPoints:`xyPoints`,xPoint:`xPoint`},useActionHoldService=defineStore(`actionHoldService`,()=>{let data=ref({}),start=id=>{if(!data.value[id])throw Error(`Error starting hold action ${id}. Id not found.`);data.value[id].holdFn=setInterval(createHoldFn(id),data.value[id].actionInterval)},reset$1=id=>{let action=data.value[id];action&&(action.holdFn&&clearInterval(action.holdFn),data.value[id].holdFn=null,data.value[id].holdTimeMs=0)},add$2=(id,actionFn,immediateStart=!1,options={actionInterval:DEFAULT_ACTION_INTERVAL_MS,accelerationRate:DEFAULT_ACCELERATION_RATE,accelerationNature:DEFAULT_ACCELERATION_NATURE})=>{if(data.value[id])throw Error(`Error adding hold action for ${id}. Id already exists.`);data.value[id]={actionFn,...options,holdTimeMs:0,holdFn:null},immediateStart&&start(id)},remove$3=id=>{data.value[id]&&(reset$1(id),delete data.value[id])},removeAll=id=>{remove$3(id),remove$3(getFocusScalarName(id)),remove$3(getFocusScalarXName(id)),remove$3(getFocusScalarYName(id))},clear=()=>{let keys=Object.keys(data.value);for(let i=0;i{data.value[id]&&remove$3(id),add$2(id,actionFn,immediateStart,options)},onFocus=(id,actionFn,element,actionParamsType=ACTION_PARAMS_TYPE.xyPoints)=>{if(remove$3(getFocusScalarXName(id)),remove$3(getFocusScalarYName(id)),element.detail.value===0){remove$3(id);return}let eventName=element.detail.name,xDirection=0,yDirection=0;switch(eventName){case`focus_l`:xDirection=-1;break;case`focus_r`:xDirection=1;break;case`focus_d`:yDirection=-1;break;case`focus_u`:yDirection=1;break}switch(actionParamsType){case ACTION_PARAMS_TYPE.xyPoints:actionFn(xDirection,yDirection),addOrUpdate(id,multiplier=>actionFn(xDirection*multiplier,yDirection*multiplier),!0);break;case ACTION_PARAMS_TYPE.xPoint:let xValue=xDirection===0?yDirection:xDirection;xValue!==0&&(actionFn(xValue),addOrUpdate(id,multiplier=>actionFn(xValue*multiplier),!0));break}},inputNavStates=reactive({xLatestValue:0,yLatestValue:0,latestEventName:null}),onFocusScalar=(id,actionFn,element,actionParamsType=ACTION_PARAMS_TYPE.xyPoints)=>{console.log(`onFocusScalar`,{id,name:element.detail.name,value:element.detail.value}),remove$3(id);let eventName=element.detail.name,eventValue=element.detail.value;if(inputNavStates.latestEventName===eventName&&((eventName===`focus_lr`||eventName===`rotate_h_cam`)&&eventValue===inputNavStates.xLatestValue||(eventName===`focus_ud`||eventName===`rotate_v_cam`)&&eventValue===inputNavStates.yLatestValue))return;let xDirection=0,yDirection=0;if(eventName===`focus_lr`||eventName===`rotate_h_cam`){if(eventValue>FOCUS_RU_TRIGGER_VALUE$2&&eventValue>inputNavStates.xLatestValue?xDirection=1:eventValueactionFn(xDirection*multiplier,0),!0);break;case ACTION_PARAMS_TYPE.xPoint:actionFn(xDirection),addOrUpdate(getFocusScalarXName(id),multiplier=>actionFn(xDirection*multiplier),!0);break}inputNavStates.latestEventName=eventName}else remove$3(getFocusScalarXName(id));inputNavStates.xLatestValue=eventValue}else (eventName===`focus_ud`||eventName===`rotate_v_cam`)&&actionParamsType!==ACTION_PARAMS_TYPE.xPoint&&(eventValue>FOCUS_RU_TRIGGER_VALUE$2&&eventValue>inputNavStates.yLatestValue?yDirection=1:eventValueactionFn(0,yDirection*multiplier),!0),inputNavStates.latestEventName=eventName),inputNavStates.yLatestValue=eventValue)};function createHoldFn(id){let action=data.value[id];return()=>{let multiplier=1+action.accelerationRate*(action.holdTimeMs/1e3)**action.accelerationNature;action.actionFn(multiplier),data.value[id].holdTimeMs=action.holdTimeMs+action.actionInterval}}function getFocusScalarName(id){return`${id}_scalar`}function getFocusScalarXName(id){return`${getFocusScalarName(id)}_x`}function getFocusScalarYName(id){return`${getFocusScalarName(id)}_y`}return{onFocus,onFocusScalar,add:add$2,addOrUpdate,remove:remove$3,removeAll,clear,start,reset:reset$1}}),HEADER_SECTION_TYPE={start:`start`,center:`center`,end:`end`},useEditorHeaderStore=defineStore(`editorHeader`,()=>{let header=reactive({heading:null,preheading:[],type:`line`}),headerItems=ref([]),startSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.start)),centerSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.center)),endSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.end)),headerHidden=ref(!1),itemsHidden=ref(!1),setHeader=(heading,headerType=`line`)=>{header.heading=heading,header.type=headerType},setPreheader=text=>{typeof text==`string`?header.preheading=[text]:header.preheading=text},addItems=(items$2,prepend=!1)=>{prepend?headerItems.value.unshift(...items$2):headerItems.value.push(...items$2)},addItem=(item,prepend=!1)=>{prepend?headerItems.value.unshift(item):headerItems.value.push(item)},addOrUpdateItem=(item,prepend=!1,prependIdOrIndex=0)=>{let existingIndex=-1;if(headerItems.value&&(existingIndex=headerItems.value.findIndex(x=>x.id===item.id)),existingIndex>-1)headerItems.value[existingIndex]={...item};else if(prepend){let preprendIdIndex=findIdOrIndex(prependIdOrIndex);headerItems.value.splice(preprendIdIndex,0,item)}else headerItems.value.push(item)},removeItem=itemOrId=>{let id=itemOrId.hasOwnProperty(`id`)?itemOrId.id:itemOrId,index=headerItems.value.findIndex(x=>x.id===id);index>-1&&headerItems.value.splice(index,1)},removeItems=itemsOrIds=>itemsOrIds.forEach(x=>removeItem(x)),removeItemsExcept=itemsOrIds=>{let ids=itemsOrIds.map(x=>x.hasOwnProperty(`id`)?x.id:x);removeItems(items.value.filter(x=>!ids.includes(x.id)))},showItem=itemOrId=>{let index=findIdOrIndex(itemOrId);index>-1&&(headerItems.value[index].hidden=!1)},hideItem=itemOrId=>{let index=findIdOrIndex(itemOrId);index>-1&&(headerItems.value[index].hidden=!0)},clearItems=()=>headerItems.value=[],getItem=id=>items.value.find(x=>x.id===id);function findIdOrIndex(idOrIndex){let prependIdIndex=headerItems.value.findIndex(x=>x.id===idOrIndex);return prependIdIndex===-1&&typeof idOrIndex==`number`&&idOrIndex>-1&&idOrIndex{let Controls=controls_default(),{events:events$3}=useBridge(),isSetupDone=ref(!1),{isControllerAvailable}=storeToRefs(Controls),currentSave=ref(initCurrentSave()),isLayerEditInitialized=ref(!1);watch(isControllerAvailable,async available=>{available&&await Lua_default.extensions.ui_liveryEditor.useMousePosition(!1)},{immediate:!0});async function onSetupDone(){isControllerAvailable.value&&await Lua_default.extensions.ui_liveryEditor.useMousePosition(!1)}function load(file$1){currentSave.value=file$1,isSetupDone.value=!1}function onChangeView(view){console.log(`onChangeView`,view),router_default.push({name:view})}async function setup$3(){isSetupDone.value||=(events$3.on(`liveryEditor_SetupSuccess`,onSetupDone),events$3.on(`liveryEditor_changeView`,onChangeView),await Lua_default.extensions.ui_liveryEditor.setup(currentSave.value.location),!0)}async function save(){await Lua_default.extensions.ui_liveryEditor.save(currentSave.value.name)}async function exit(){isSetupDone.value=!1,resetSave(),await Lua_default.extensions.ui_liveryEditor.deactivate()}async function setupLayerEdit(){isLayerEditInitialized.value||=(await Lua_default.extensions.ui_liveryEditor_camera.setOrthographicView(`right`),!0)}async function exitLayerEdit(){isLayerEditInitialized.value=!1}function resetSave(){currentSave.value=initCurrentSave()}function initCurrentSave(){return{name:createFilename(),location:null}}function dispose$2(){events$3.off(`liveryEditor_SetupSuccess`,onSetupDone)}function createFilename(){let currentDate=new Date;return`${currentDate.getFullYear()}-${String(currentDate.getMonth()+1).padStart(2,`0`)}-${String(currentDate.getDate()).padStart(2,`0`)}_${String(currentDate.getHours()).padStart(2,`0`)}-${String(currentDate.getMinutes()).padStart(2,`0`)}-${String(currentDate.getSeconds()).padStart(2,`0`)}`}return{currentSave,isSetupDone,load,setupLayerEdit,exitLayerEdit,save,exit,setup:setup$3,resetSave,dispose:dispose$2}});var _sfc_main$112=Object.assign({width:8,height:8,margin:.25},{__name:`DecalSelectorItem`,props:{externalImage:String},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngImageTile_default),normalizeProps(guardReactiveProps(props)),null,16))}}),DecalSelectorItem_default=_sfc_main$112,_hoisted_1$102={"bng-ui-scope":`liveryeditor-decal-selector`,class:`decal-selector`},_hoisted_2$86={class:`header-wrapper`},_hoisted_3$75={key:0,class:`filters-wrapper`},_sfc_main$111={__name:`DecalSelector`,setup(__props){useUINavScope(`liveryeditor-decal-selector`);let store$1=useDecalSelectorStore(),headerStore=useEditorHeaderStore(),selectedCategory=computed({get:()=>[store$1.currentCategory],async set(values){await store$1.setCategory(values[0])}}),switchCategory=direction$1=>{let index=store$1.categories.findIndex(x=>x.value===store$1.currentCategory);index!==-1&&(direction$1===-1?index>0?--index:index=store$1.categories.length-1:index{await store$1.init(),getUINavServiceInstance().useCrossfire=!0});let headerItemsHiddenValue=null;return onMounted(()=>{headerItemsHiddenValue=headerStore.itemsHidden,headerStore.itemsHidden||=!0}),onUnmounted(()=>{headerStore.itemsHidden=headerItemsHiddenValue}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$102,[createBaseVNode(`div`,_hoisted_2$86,[createVNode(unref(bngCardHeading_default),{class:`decal-selector-heading`,type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Select Decal`,-1)]]),_:1}),createVNode(unref(bngButton_default),{"bng-no-nav":!0,accent:`attention`,label:`Close`,onClick:unref(store$1).cancelSelection},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{action:`menu_item_back`})]),_:1},8,[`onClick`])]),unref(store$1).categories?(openBlock(),createElementBlock(`div`,_hoisted_3$75,[createBaseVNode(`div`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_tab_left`})]),createVNode(bngPillFilters_default,{modelValue:selectedCategory.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedCategory.value=$event,"bng-no-child-nav":!0,options:unref(store$1).categories,required:``},null,8,[`modelValue`,`options`]),createBaseVNode(`div`,null,[createVNode(unref(bngBinding_default),{action:`menu_tab_right`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallRight},null,8,[`type`])])])):createCommentVNode(``,!0),unref(store$1).textures&&unref(store$1).textures.length>0?(openBlock(),createBlock(unref(bngList_default),{key:1,noBackground:``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(store$1).textures,(item,index)=>withDirectives((openBlock(),createBlock(DecalSelectorItem_default,{"bng-nav-item":``,key:item.preview,externalImage:item.preview,"data-decal-item":index,onClick:()=>unref(store$1).selectDecalItem(item.preview)},null,8,[`externalImage`,`data-decal-item`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])),128))]),_:1})):createCommentVNode(``,!0)])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(store$1).cancelSelection(),`menu`],[unref(BngOnUiNav_default),()=>unref(store$1).cancelSelection(),`back`],[unref(BngOnUiNav_default),()=>switchCategory(-1),`tab_l`],[unref(BngOnUiNav_default),()=>switchCategory(1),`tab_r`]])}},DecalSelector_default=__plugin_vue_export_helper_default(_sfc_main$111,[[`__scopeId`,`data-v-e09a2ff1`]]),_hoisted_1$101={class:`decal-preview-tile`},_sfc_main$110={__name:`DecalPreviewTile`,props:{textureImage:{type:String,required:!0},textureColor:{type:Array,default:[255,255,255,1]},backgroundImage:String},setup(__props){useCssVars(_ctx=>({v036f09bc:alphaTextureBackground.value,v06c06c52:imgColor.value,v174dbaea:imageUrl.value}));let props=__props,alphaTextureBackground=computed(()=>`url(${props.backgroundImage?props.backgroundImage:getAssetURL(`images/alpha_texture.png`)}`),imageUrl=computed(()=>`url(${props.textureImage})`),imgColor=computed(()=>{let isDecimalFormat=props.textureColor.every(x=>x>=0&&x<=1),red=props.textureColor[0],green=props.textureColor[1],blue=props.textureColor[2],alpha=props.textureColor[3];return isDecimalFormat&&(red=Math.floor(red*255),green=Math.floor(green*255),blue=Math.floor(blue*255)),`rgba(${red}, ${green}, ${blue}, ${alpha})`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$101,[..._cache[0]||=[createBaseVNode(`div`,{class:`image`},null,-1)]]))}},DecalPreviewTile_default=__plugin_vue_export_helper_default(_sfc_main$110,[[`__scopeId`,`data-v-8377c081`]]),_hoisted_1$100=[`disabled`],_sfc_main$109={__name:`EditModeLayersPreview`,props:{contextMenuName:String},setup(__props){let store$1=useLayerSettingsStore(),scroller=ref(null),tiles=ref({}),disabled=computed(()=>store$1.requestApplyActive||store$1.reapplyActive),onLayerClicked=async layer=>{store$1.activeLayerUid===layer.uid&&store$1.appliedLayers.length>1||await store$1.setActiveLayer(layer.uid)};watch(()=>store$1.activeLayerUid,layerUid=>{layerUid&&scrollTo(layerUid)});function setTileRef(layerUid,el){tiles.value[layerUid]=el}function scrollTo(layerUid){let tileEl=tiles.value[layerUid];if(!tileEl)return;let scrollerOffsetBottom=scroller.value.offsetTop+scroller.value.offsetHeight,scrollerOffsetTop=scroller.value.offsetTop+scroller.value.scrollTop,tileElOffsetBottom=tileEl.offsetTop+tileEl.offsetHeight,overflowsTop=tileEl.offsetTopscrollerOffsetBottom;!overflowsTop&&!overflowsBottom||window.requestAnimationFrame(()=>{overflowsTop?scroller.value.scrollBy({top:-(scrollerOffsetTop-tileEl.offsetTop)}):overflowsBottom&&(scroller.value.scrollTop=tileElOffsetBottom-scrollerOffsetBottom)})}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`layers-preview`,disabled:disabled.value},[createBaseVNode(`div`,{class:`item-navigation navigation-up`,onClick:_cache[0]||=$event=>unref(store$1).setActiveLayerDirection(-1)},[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallUp},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`activate_previous_layer`,deviceMask:`xinput`,class:`navigation-icon`})]),createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`preview-scroller`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(store$1).appliedLayers,layer=>(openBlock(),createElementBlock(`div`,{ref_for:!0,ref:el=>setTileRef(layer.uid,el),key:layer.uid,class:normalizeClass([{active:unref(store$1).activeLayerUid===layer.uid},`layer-item`])},[unref(store$1).activeLayerUid===layer.uid?withDirectives((openBlock(),createBlock(DecalPreviewTile_default,{key:0,class:`preview-img`,textureImage:layer.preview,textureColor:layer.color},null,8,[`textureImage`,`textureColor`])),[[unref(BngPopover_default),`context-menu`,`right`,{click:!0}]]):(openBlock(),createBlock(DecalPreviewTile_default,{key:1,class:`preview-img`,textureImage:layer.preview,textureColor:layer.color,onClick:()=>onLayerClicked(layer)},null,8,[`textureImage`,`textureColor`,`onClick`])),unref(store$1).activeLayerUid===layer.uid?(openBlock(),createBlock(unref(bngIcon_default),{key:2,class:`contextmenu-icon`,type:unref(icons).edit},null,8,[`type`])):createCommentVNode(``,!0)],2))),128))],512),createBaseVNode(`div`,{class:`item-navigation navigation-down`,onClick:_cache[1]||=$event=>unref(store$1).setActiveLayerDirection(1)},[createVNode(unref(bngBinding_default),{action:`activate_next_layer`,deviceMask:`xinput`,class:`navigation-icon`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallDown},null,8,[`type`])])],8,_hoisted_1$100))}},EditModeLayersPreview_default=__plugin_vue_export_helper_default(_sfc_main$109,[[`__scopeId`,`data-v-9ede6133`]]),_hoisted_1$99={class:`material-settings`,"bng-ui-scope":`material-settings`},_hoisted_2$85={class:`subsettings-selector`},_hoisted_3$74=[`onClick`],_hoisted_4$57={class:`settings-content`},_hoisted_5$47={key:0,class:`setting-item color-setting`},_hoisted_6$34={key:1,class:`setting-item item-column`},_hoisted_7$29={class:`slider-text-container`},_hoisted_8$22={key:2,class:`setting-item item-column`},_hoisted_9$19={class:`slider-text-container`},_hoisted_10$13={key:3,class:`setting-item item-column`},_hoisted_11$11={class:`slider-text-container`},INPUT_CONTROL_STEPS$4=.01,INPUT_CONTROL_MIN$4=0,INPUT_CONTROL_MAX$4=1,CONTROLLER_SLIDER_BINDING=`focus_lr`,CONTROLLER_CHANGE_SUBSETTINGS_HINTS=[{id:`activate_previous_subsettings`,content:{type:`binding`,props:{uiEvent:`focus_u`},label:`Previous Setting`}},{id:`activate_next_subsettings`,content:{type:`binding`,props:{uiEvent:`focus_d`},label:`Next Setting`}}],subSettings=[{label:`Color`,icon:icons.colorCirclePalette,value:`color`},{label:`Saturation`,icon:icons.colorSaturation,value:`saturation`},{label:`Metalness`,icon:icons.materialMetal,value:`metallicIntensity`},{label:`Roughness`,icon:icons.materialRoughness,value:`roughnessIntensity`}],_sfc_main$108={__name:`LayerMaterialSettings`,emits:[`subSettingChanged`],setup(__props,{emit:__emit}){let emit$1=__emit,store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),activeSubSettingsIndex=ref(0),_color=reactive({hue:.5,saturation:1,luminosity:.5}),color=computed({get:()=>_color,set:async newValue=>{let paint=new Paint;paint.hsl=[newValue.hue,newValue.saturation,newValue.luminosity],await store$1.setColor([paint.red,paint.green,paint.blue,paint.alpha])}}),saturation=computed({get:()=>_color.saturation,set:async newValue=>{let sat=parseFloat(newValue.toFixed(2));color.value={hue:color.value.hue,saturation:sat,luminosity:color.value.luminosity},_color.saturation=sat}}),metallicIntensity=computed({get:()=>store$1.cursorData?store$1.cursorData.metallicIntensity:void 0,set:async newValue=>{await store$1.setMetallicIntensity(newValue)}}),roughnessIntensity=computed({get:()=>store$1.cursorData?store$1.cursorData.roughnessIntensity:void 0,set:async newValue=>{await store$1.setRoughnessIntensity(newValue)}}),activeSubSetting=computed(()=>subSettings[activeSubSettingsIndex.value]);watch(()=>store$1.activeLayerUid,(newValue,oldValue)=>{newValue&&oldValue&&initColorPicker(store$1.cursorData.color)},{deep:!0}),watch(activeSubSetting,(value,oldValue)=>{oldValue&&actionHoldService.remove(oldValue),setHints(),emit$1(`subSettingChanged`,value)},{immediate:!0}),onBeforeUnmount(()=>{actionHoldService.removeAll(`color`),actionHoldService.removeAll(`saturation`),actionHoldService.removeAll(`metallicIntensity`),actionHoldService.removeAll(`roughnessIntensity`),emit$1(`subSettingChanged`,void 0)}),onMounted(()=>{store$1.cursorData.color&&initColorPicker(store$1.cursorData.color)});let goPreviousSubSetting=()=>{activeSubSettingsIndex.value>0?--activeSubSettingsIndex.value:activeSubSettingsIndex.value=subSettings.length-1},goNextSubSetting=()=>{activeSubSettingsIndex.valuechangeColor(hue,luminosity,0);break;case`saturation`:actionFn=saturation$1=>changeColor(0,0,saturation$1);break;case`metallicIntensity`:actionFn=changeMetallicIntensity,actionParamsType=ACTION_PARAMS_TYPE.xPoint;break;case`roughnessIntensity`:actionFn=changeRoughnessIntensity,actionParamsType=ACTION_PARAMS_TYPE.xPoint;break}scalar?actionHoldService.onFocusScalar(subsettingValue,actionFn,element,actionParamsType):actionHoldService.onFocus(subsettingValue,actionFn,element,actionParamsType)}}async function changeColor(h$1,l,s){let newHue=color.value.hue+.01*h$1,newLuminosity=color.value.luminosity+.01*l,newSaturation=parseFloat((color.value.saturation+.1*s).toFixed(2));(newHue<0||newHue>1)&&(newHue=color.value.hue),(newLuminosity<0||newLuminosity>1)&&(newLuminosity=color.value.luminosity),(newSaturation<0||newSaturation>1)&&(newSaturation=color.value.saturation),_color.hue=newHue,_color.saturation=newSaturation,_color.luminosity=newLuminosity;let paint=new Paint;paint.hsl=[newHue,newSaturation,newLuminosity],store$1.setColor([paint.red,paint.green,paint.blue,paint.alpha])}let changeMetallicIntensity=direction$1=>{let newValue=metallicIntensity.value+.1*direction$1;newValue>=0&&newValue<=1&&(metallicIntensity.value=newValue)},changeRoughnessIntensity=direction$1=>{let newValue=roughnessIntensity.value+.1*direction$1;newValue>=0&&newValue<=1&&(roughnessIntensity.value=newValue)};function updateColorPickerModel(rgba){let paint=new Paint;paint.rgba=rgba,_color.hue=paint.hue,_color.saturation=paint.saturation,_color.luminosity=paint.luminosity}store$1.$onAction(({name,store:store$2,args,after,onError})=>{after(result=>{name===`resetCursorProperties`&&args[0].includes(`material`)&&initColorPicker(store$2.cursorData.color)})});function onReset(){let defaultColor=[1,1,1,1];switch(activeSubSetting.value.value){case`color`:store$1.setColor(defaultColor),updateColorPickerModel(defaultColor),saturation.value=1;break;case`saturation`:saturation.value=1;break;case`metallicIntensity`:metallicIntensity.value=0;break;case`roughnessIntensity`:roughnessIntensity.value=0;break}}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function initColorPicker(color$1){let isWhite=color$1.every(x=>x===1),paint=new Paint;paint.rgba=color$1,_color.hue=paint.hue,_color.saturation=isWhite?1:paint.saturation,_color.luminosity=paint.luminosity}useUINavScope(`material-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){removeHints(),showIfController.value&&infoBar.addHints(CONTROLLER_CHANGE_SUBSETTINGS_HINTS)}function removeHints(){infoBar.removeHints(...CONTROLLER_CHANGE_SUBSETTINGS_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$99,[createBaseVNode(`div`,_hoisted_2$85,[(openBlock(),createElementBlock(Fragment,null,renderList(subSettings,(subtab,index)=>withDirectives(createBaseVNode(`div`,{key:subtab.value,class:normalizeClass([{active:index===activeSubSettingsIndex.value},`subsettings-selector-item`]),onClick:()=>activeSubSettingsIndex.value=index},[createVNode(unref(bngIcon_default),{type:subtab.icon,class:`selector-item-icon`},null,8,[`type`])],10,_hoisted_3$74),[[unref(BngTooltip_default),index===activeSubSettingsIndex.value?void 0:subtab.label,`left`]])),64))]),createBaseVNode(`div`,_hoisted_4$57,[activeSubSetting.value.value===`color`?(openBlock(),createElementBlock(`div`,_hoisted_5$47,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,view:`luminosity`},null,8,[`modelValue`])])):createCommentVNode(``,!0),activeSubSetting.value.value===`saturation`?(openBlock(),createElementBlock(`div`,_hoisted_6$34,[createBaseVNode(`div`,_hoisted_7$29,[createVNode(unref(bngSlider_default),{modelValue:saturation.value,"onUpdate:modelValue":_cache[1]||=$event=>saturation.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:saturation.value,"onUpdate:modelValue":_cache[2]||=$event=>saturation.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):activeSubSetting.value.value===`metallicIntensity`?(openBlock(),createElementBlock(`div`,_hoisted_8$22,[createBaseVNode(`div`,_hoisted_9$19,[createVNode(unref(bngSlider_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[3]||=$event=>metallicIntensity.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[4]||=$event=>metallicIntensity.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):activeSubSetting.value.value===`roughnessIntensity`?(openBlock(),createElementBlock(`div`,_hoisted_10$13,[createBaseVNode(`div`,_hoisted_11$11,[createVNode(unref(bngSlider_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[5]||=$event=>roughnessIntensity.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[6]||=$event=>roughnessIntensity.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),goNextSubSetting,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onFocus,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_lr`],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_ud`]])}},LayerMaterialSettings_default=__plugin_vue_export_helper_default(_sfc_main$108,[[`__scopeId`,`data-v-ffe74e63`]]),_hoisted_1$98={class:`mirror-settings`,"bng-ui-scope":`mirror-settings`},_hoisted_2$84={class:`setting-item`},_hoisted_3$73={class:`setting-item offset-item`},_hoisted_4$56={class:`setting-item offset-item`},FOCUS_LD_TRIGGER_VALUE$1=-.999,FOCUS_RU_TRIGGER_VALUE$1=.999,FOCUS_HOLD_INTERVAL_MS=250,MIRROR_BINDING=`focus_l`,FLIP_BINDING=`focus_r`,CONTROLLER_OFFSET_BINDING=`focus_ud`,CONTROLLER_HINTS$4=[],KEYBOARD_HINTS$4=[],_sfc_main$107={__name:`LayerMirrorSettings`,setup(__props){let store$1=useLayerSettingsStore(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),inputNavStates=reactive({focusXLatestValue:0,focusYLatestValue:0,holdEventLatest:null,holdInterval:null}),mirror=computed({get:()=>store$1.cursorData?store$1.cursorData.mirrored:void 0,set:async newValue=>await store$1.setMirrored(newValue,store$1.cursorData.flipMirroredDecal)}),flip$2=computed({get:()=>store$1.cursorData?store$1.cursorData.flipMirroredDecal:void 0,set:async newValue=>await store$1.setMirrored(store$1.cursorData.mirrored,newValue)}),offset$2=computed({get:()=>store$1.cursorData?store$1.cursorData.mirrorOffset:void 0,set:async newValue=>await store$1.setMirrorOffset(newValue)}),toggleMirror=()=>mirror.value=!mirror.value,toggleFlipped=()=>{mirror.value&&(flip$2.value=!flip$2.value)},changeOffset=element=>{if(!mirror.value)return;let eventName=element.detail.name,direction$1=eventName===`focus_d`?-1:1,isPressed=element.detail.value;inputNavStates.holdEventLatest===eventName&&!isPressed&&inputNavStates.holdInterval&&(clearInterval(inputNavStates.holdInterval),inputNavStates.holdInterval=null),direction$1>0&&isPressed?doHoldAction(()=>store$1.setMirrorOffset(offset$2.value+1),eventName):direction$1<0&&isPressed&&doHoldAction(()=>store$1.setMirrorOffset(offset$2.value-1),eventName)},changeOffsetScalar=element=>{if(!mirror.value)return;let eventName=element.detail.name,direction$1=element.detail.value;inputNavStates.holdEventLatest===eventName&&inputNavStates.holdInterval&&clearInterval(inputNavStates.holdInterval),direction$1>FOCUS_RU_TRIGGER_VALUE$1&&direction$1>inputNavStates.focusXLatestValue?doHoldAction(()=>store$1.setMirrorOffset(offset$2.value+1),eventName):direction$1store$1.setMirrorOffset(offset$2.value-1),eventName),inputNavStates.focusXLatestValue=direction$1};function onReset(){store$1.setMirrored(!1,!1),store$1.setMirrorOffset(0)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function doHoldAction(callbackFn,eventName){inputNavStates.holdInterval&&=(clearInterval(inputNavStates.holdInterval),null),callbackFn(),inputNavStates.holdInterval=setInterval(callbackFn,FOCUS_HOLD_INTERVAL_MS),inputNavStates.holdEventLatest=eventName}useUINavScope(`mirror-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints;removeHints(),hints=showIfController.value?CONTROLLER_HINTS$4:KEYBOARD_HINTS$4;for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$4.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$4.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$98,[createBaseVNode(`div`,_hoisted_2$84,[createVNode(unref(bngSwitch_default),{modelValue:mirror.value,"onUpdate:modelValue":_cache[0]||=$event=>mirror.value=$event},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Mirror`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:MIRROR_BINDING,deviceMask:`xinput`})]),createBaseVNode(`div`,_hoisted_3$73,[createVNode(unref(bngSwitch_default),{modelValue:flip$2.value,"onUpdate:modelValue":_cache[1]||=$event=>flip$2.value=$event,disabled:!mirror.value},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Flip`,-1)]]),_:1},8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:FLIP_BINDING,deviceMask:`xinput`,class:normalizeClass({disabled:!mirror.value})},null,8,[`class`])]),createBaseVNode(`div`,_hoisted_4$56,[createVNode(unref(bngInput_default),{modelValue:offset$2.value,"onUpdate:modelValue":_cache[2]||=$event=>offset$2.value=$event,step:.1,disabled:!mirror.value,type:`number`,prefix:`Offset`,class:`setting-input`},null,8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_OFFSET_BINDING,deviceMask:`xinput`,class:normalizeClass({disabled:!mirror.value})},null,8,[`class`])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),toggleMirror,`focus_l`],[unref(BngOnUiNav_default),toggleFlipped,`focus_r`],[unref(BngOnUiNav_default),changeOffset,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),changeOffsetScalar,`focus_ud`]])}},LayerMirrorSettings_default=__plugin_vue_export_helper_default(_sfc_main$107,[[`__scopeId`,`data-v-5ae7bab5`]]),_hoisted_1$97={"bng-ui-scope":`rotate-settings`},_hoisted_2$83={class:`setting-item item-column`},_hoisted_3$72={class:`slider-text-container`},INPUT_CONTROL_STEPS$3=.1,INPUT_CONTROL_MIN$3=0,INPUT_CONTROL_MAX$3=359.9,INPUT_DEFAULT_VALUE$3=0,CONTROLLER_ROTATE_BINDING=`focus_lr`,CONTROLLER_HINTS$3=[],KEYBOARD_HINTS$3=[],_sfc_main$106={__name:`LayerRotateSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),rotation=computed({get:()=>store$1.cursorData?parseFloat(store$1.cursorData.rotation.toFixed(1)):void 0,set:async newValue=>{await store$1.setRotation(newValue)}});function onReset(){rotation.value=INPUT_DEFAULT_VALUE$3}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`rotate-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`rotate`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS$3:KEYBOARD_HINTS$3;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$3.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$3.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$97,[createBaseVNode(`div`,_hoisted_2$83,[createBaseVNode(`div`,_hoisted_3$72,[createVNode(unref(bngInput_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[0]||=$event=>rotation.value=$event,min:INPUT_CONTROL_MIN$3,max:INPUT_CONTROL_MAX$3,step:INPUT_CONTROL_STEPS$3,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[1]||=$event=>rotation.value=$event,min:INPUT_CONTROL_MIN$3,max:INPUT_CONTROL_MAX$3,step:INPUT_CONTROL_STEPS$3,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_ROTATE_BINDING,deviceMask:`xinput`})])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_ud`]])}},LayerRotateSettings_default=__plugin_vue_export_helper_default(_sfc_main$106,[[`__scopeId`,`data-v-d8deaac6`]]),_sfc_main$105={__name:`BindingButton`,props:{uiEvent:String,deviceMask:String,action:String,label:String,showBinding:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),{label:void 0},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(__props.label),1),__props.showBinding?(openBlock(),createBlock(unref(bngBinding_default),{key:0,uiEvent:__props.uiEvent,deviceMask:__props.deviceMask,class:`button-binding`},null,8,[`uiEvent`,`deviceMask`])):createCommentVNode(``,!0)]),_:1}))}},BindingButton_default=__plugin_vue_export_helper_default(_sfc_main$105,[[`__scopeId`,`data-v-e77d3865`]]),_hoisted_1$96={class:`camera-popovermenu`},CONTROLLER_CAMERA_BINDING=`rotate_h_cam`,CAMERA_BUTTONS$2=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$104={__name:`CameraViewButton`,setup(__props){let store$1=useLiveryEditorStore(),popover=usePopover(),expand=ref(!1),currentCamera=computed(()=>{if(store$1.cameraView){let curr=CAMERA_BUTTONS$2.find(x=>x.value===store$1.cameraView);if(curr)return curr}return{icon:icons.movieCamera,label:`View`}}),onCameraViewClicked=view=>{popover.hide(`camera-popovermenu`),store$1.setOrthographicView(view)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{icon:currentCamera.value.icon,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(currentCamera.value.label),1),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_CAMERA_BINDING,deviceMask:`xinput`})]),_:1},8,[`icon`,`accent`])),[[unref(BngPopover_default),`camera-popovermenu`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverContent_default),{name:`camera-popovermenu`,onShow:_cache[0]||=$event=>expand.value=!0,onHide:_cache[1]||=$event=>expand.value=!1},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$96,[(openBlock(),createElementBlock(Fragment,null,renderList(CAMERA_BUTTONS$2,cameraItem=>createVNode(unref(bngImageTile_default),{key:cameraItem.value,label:cameraItem.label,icon:cameraItem.icon,class:normalizeClass({active:cameraItem.value===currentCamera.value.value}),onClick:$event=>onCameraViewClicked(cameraItem.value)},null,8,[`label`,`icon`,`class`,`onClick`])),64))])]),_:1})]))}},CameraViewButton_default=__plugin_vue_export_helper_default(_sfc_main$104,[[`__scopeId`,`data-v-be949a44`]]),_hoisted_1$95={key:0,class:`liveryeditor-header`},_hoisted_2$82={key:0,class:`header-items`},_sfc_main$103={__name:`LiveryEditorHeader`,setup(__props){let store$1=useEditorHeaderStore(),{startSectionItems,centerSectionItems,endSectionItems}=storeToRefs(store$1),sections=ref({start:startSectionItems,center:centerSectionItems,end:endSectionItems});return(_ctx,_cache)=>unref(store$1).headerHidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$95,[createVNode(unref(bngScreenHeading_default),{type:unref(store$1).header.type,preheadings:unref(store$1).header.preheading},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(store$1).header.heading),1)]),_:1},8,[`type`,`preheadings`]),unref(store$1).itemsHidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sections.value,(items$2,section)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([[`section-${section}`],`header-section`])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(items$2,item=>(openBlock(),createElementBlock(`div`,{key:item.id},[withDirectives((openBlock(),createBlock(resolveDynamicComponent(item.component),mergeProps({ref_for:!0},item.props,toHandlers(item.events)),null,16)),[[vShow,!item.hidden]])]))),128))],2))),256))]))]))}},LiveryEditorHeader_default=__plugin_vue_export_helper_default(_sfc_main$103,[[`__scopeId`,`data-v-b0fff070`]]),_hoisted_1$94={class:`transform-settings`,"bng-ui-scope":`transform-settings`},_hoisted_2$81={class:`setting-item item-column`},_hoisted_3$71={class:`slider-text-container`},_hoisted_4$55={class:`setting-item item-column`},_hoisted_5$46={class:`slider-text-container`},_hoisted_6$33={key:0,class:`setting-item`},_hoisted_7$28={class:`setting-item actions-container`},INPUT_CONTROL_STEPS$2=.001,INPUT_CONTROL_MIN$2=0,INPUT_CONTROL_MAX$2=1,INPUT_DEFAULT_VALUE$2=.5,APPLIED_CONTROLLER_HINTS=[],CONTROLLER_MOVE_Y_BINDING=`focus_ud`,CONTROLLER_MOVE_X_BINDING=`focus_lr`,CONTROLLER_SURFACE_NORMAL_BINDING=`action_2`,CONTROLLER_APPLY_BINDING=`ok`,CONTROLLER_CANCEL_REAPPLY_BINDING=`back`,CONTROLLER_HINTS$2=[],KEYBOARD_HINTS$2=[],MOUSE_HINTS=[{id:`stamp_decal`,content:{type:`binding`,props:{action:`stamp_decal`},label:`Apply`}}],_sfc_main$102={__name:`LayerTransformSettingsOld`,setup(__props){let store$1=useLayerSettingsStore(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),actionHoldService=useActionHoldService(),positionX=computed({get:()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.x:void 0,set:async newValue=>await store$1.setPosition(newValue,store$1.cursorData.position.y)}),positionY=computed({get:()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.y:void 0,set:async newValue=>await store$1.setPosition(store$1.cursorData.position.x,newValue)}),positionMaxX=computed(()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.maxX:INPUT_CONTROL_MAX$2),positionMaxY=computed(()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.maxY:INPUT_CONTROL_MAX$2),surfaceNormal=computed({get:()=>store$1.cursorData?store$1.cursorData.isProjectSurfaceNormal:void 0,set:async newValue=>await store$1.setProjectSurfaceNormal(newValue)}),mouseMode=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0),applied=computed(()=>store$1.cursorData?store$1.cursorData.applied:void 0);computed(()=>store$1.active);let isShowControls=computed(()=>!store$1.cursorData.applied&&!mouseMode.value),toggleUseSurfaceNormal=()=>{if(console.log(`toggleUseSurfaceNormal`),!store$1.cursorData.applied)surfaceNormal.value=!surfaceNormal.value;else return console.log(`toggleUseSurfaceNormal returning true`),!0};function cancelApply(){store$1.requestApplyActive?store$1.cancelRequestApply():store$1.reapplyActive&&store$1.cancelReapply()}function onReset(){store$1.setPosition(INPUT_DEFAULT_VALUE$2,INPUT_DEFAULT_VALUE$2)}function onOk(){if(!store$1.requestApplyActive&&!store$1.reapplyActive)store$1.toggleReapply();else return!0}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`transform-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue}),watch(mouseMode,async()=>{await nextTick(()=>setHints())}),watch(applied,async()=>{await nextTick(()=>setHints())});function setHints(){let hints;removeHints(),hints=applied.value?showIfController.value?APPLIED_CONTROLLER_HINTS:KEYBOARD_HINTS$2:mouseMode.value?MOUSE_HINTS:showIfController.value?CONTROLLER_HINTS$2:KEYBOARD_HINTS$2;for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>{setHints()})},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`transform`),unwatchGamepad&&unwatchGamepad(),removeHints()});function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$2.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$2.map(x=>x.id)),infoBar.removeHints(...APPLIED_CONTROLLER_HINTS.map(x=>x.id)),infoBar.removeHints(...MOUSE_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$94,[createBaseVNode(`div`,_hoisted_2$81,[withDirectives(createBaseVNode(`div`,_hoisted_3$71,[createVNode(unref(bngInput_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[0]||=$event=>positionX.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxX.value,step:INPUT_CONTROL_STEPS$2,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngSlider_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[1]||=$event=>positionX.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxX.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-sliderinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_MOVE_X_BINDING,deviceMask:`xinput`})],512),[[vShow,isShowControls.value]])]),withDirectives(createBaseVNode(`div`,_hoisted_4$55,[createBaseVNode(`div`,_hoisted_5$46,[createVNode(unref(bngInput_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[2]||=$event=>positionY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN$2,max:positionMaxY.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-textinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngSlider_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[3]||=$event=>positionY.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxY.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-sliderinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_MOVE_Y_BINDING,deviceMask:`xinput`})])],512),[[vShow,isShowControls.value]]),unref(store$1).cursorData.applied?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$33,[createVNode(unref(bngSwitch_default),{modelValue:surfaceNormal.value,"onUpdate:modelValue":_cache[4]||=$event=>surfaceNormal.value=$event,disabled:!(unref(store$1).reapplyActive||!applied.value)},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Use Surface Normal`,-1)]]),_:1},8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SURFACE_NORMAL_BINDING,deviceMask:`xinput`})])),createBaseVNode(`div`,_hoisted_7$28,[unref(store$1).requestApplyActive||unref(store$1).reapplyActive?(openBlock(),createElementBlock(Fragment,{key:0},[unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0?(openBlock(),createBlock(unref(BindingButton_default),{key:0,icon:unref(store$1).reapplyActive?unref(icons).undo:``,uiEvent:CONTROLLER_CANCEL_REAPPLY_BINDING,label:unref(store$1).reapplyActive?`Undo`:`Cancel`,accent:`attention`,onClick:cancelApply},null,8,[`icon`,`label`])):createCommentVNode(``,!0),mouseMode.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(BindingButton_default),{key:1,uiEvent:CONTROLLER_APPLY_BINDING,label:`Apply`,accent:`primary`,onClick:unref(store$1).apply},null,8,[`onClick`]))],64)):(openBlock(),createBlock(unref(BindingButton_default),{key:1,uiEvent:CONTROLLER_APPLY_BINDING,label:`Reapply`,onClick:unref(store$1).requestReapply},null,8,[`onClick`]))])])),[[unref(BngOnUiNav_default),onOk,`ok`],[unref(BngOnUiNav_default),toggleUseSurfaceNormal,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`transform`,unref(store$1).translate,element),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`transform`,unref(store$1).translate,element),`focus_ud`]])}},LayerTransformSettingsOld_default=__plugin_vue_export_helper_default(_sfc_main$102,[[`__scopeId`,`data-v-79d0fe46`]]),_hoisted_1$93={class:`scale-settings`,"bng-ui-scope":`scale-settings`},_hoisted_2$80={class:`setting-item item-column`},_hoisted_3$70={class:`slider-text-container`},_hoisted_4$54={class:`setting-item item-column`},_hoisted_5$45={class:`slider-text-container`},_hoisted_6$32={class:`setting-item`},INPUT_CONTROL_STEPS$1=.01,INPUT_CONTROL_MIN$1=0,INPUT_CONTROL_MAX$1=6,INPUT_DEFAULT_VALUE$1=.5,CONTROLLER_SCALE_Y_BINDING=`focus_ud`,CONTROLLER_SCALE_X_BINDING=`focus_lr`,CONTROLLER_LOCK_BINDING=`action_2`,CONTROLLER_HINTS$1=[],KEYBOARD_HINTS$1=[],_sfc_main$101={__name:`LayerScaleSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),{editModeState}=storeToRefs(store$1),scaleX=computed({get:()=>store$1.cursorData&&store$1.cursorData.scale?store$1.cursorData.scale.x:void 0,set:async newValue=>{if(newValue===store$1.cursorData.scale.x)return;let scaleY$1=store$1.cursorData.scale.y;if(editModeState.value.lockScaling){let diff=newValue-store$1.cursorData.scale.x;scaleY$1+=diff}await store$1.setScale(newValue,scaleY$1)}}),scaleY=computed({get:()=>store$1.cursorData&&store$1.cursorData.scale?store$1.cursorData.scale.y:void 0,set:async newValue=>{if(newValue===store$1.cursorData.scale.y)return;let scaleX$1=store$1.cursorData.scale.x;if(editModeState.value.lockScaling){let diff=newValue-store$1.cursorData.scale.y;scaleX$1+=diff}await store$1.setScale(scaleX$1,newValue)}}),toggleLockScaling=()=>{editModeState.value.lockScaling=!editModeState.value.lockScaling};function onReset(){store$1.setScale(INPUT_DEFAULT_VALUE$1,INPUT_DEFAULT_VALUE$1)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function onFocus(element,scalar=!1){let actionFn=(xDirection,yDirection)=>{xDirection!==0&&(scaleX.value=xDirection*INPUT_CONTROL_STEPS$1+scaleX.value),yDirection!==0&&(scaleY.value=yDirection*INPUT_CONTROL_STEPS$1+scaleY.value)};scalar?actionHoldService.onFocusScalar(`scale`,actionFn,element):actionHoldService.onFocus(`scale`,actionFn,element)}useUINavScope(`scale-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`scale`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS$1:KEYBOARD_HINTS$1;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$1.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$1.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$93,[createBaseVNode(`div`,_hoisted_2$80,[createBaseVNode(`div`,_hoisted_3$70,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[0]||=$event=>scaleX.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[1]||=$event=>scaleX.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SCALE_X_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_4$54,[createBaseVNode(`div`,_hoisted_5$45,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[2]||=$event=>scaleY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[3]||=$event=>scaleY.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SCALE_Y_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_6$32,[createVNode(unref(bngSwitch_default),{modelValue:unref(editModeState).lockScaling,"onUpdate:modelValue":_cache[4]||=$event=>unref(editModeState).lockScaling=$event},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Lock Scaling`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_LOCK_BINDING,deviceMask:`xinput`})])])),[[unref(BngOnUiNav_default),toggleLockScaling,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onFocus,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_lr`],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_ud`]])}},LayerScaleSettings_default=__plugin_vue_export_helper_default(_sfc_main$101,[[`__scopeId`,`data-v-56a383d1`]]),_hoisted_1$92={class:`sort-settings`,"bng-ui-scope":`sort-settings`},_hoisted_2$79={class:`setting-item`},_hoisted_3$69={class:`icon-binding-wrapper`},_hoisted_4$53={class:`icon-binding-wrapper`},_hoisted_5$44={class:`icon-binding-wrapper`},_hoisted_6$31={class:`stacked-arrows`},_hoisted_7$27={class:`icon-binding-wrapper`},_hoisted_8$21={class:`stacked-arrows`},_hoisted_9$18={key:0},ORDER_TOOL=Lua_default.extensions.ui_liveryEditor_tools_group,_sfc_main$100={__name:`LayerSortSettings`,setup(__props){let store$1=useLiveryEditorStore();useUINavScope(`sort-settings`);let order=computed({get:()=>store$1.selectedLayers[0].order,set(newValue){ORDER_TOOL.setOrder(newValue)}}),orderMax=computed(()=>store$1.selectedLayers[0].siblingCount),multiSelected=computed(()=>store$1.selectedLayerUids.length>1),orderOptions=computed(()=>Array.from({length:store$1.layers.length-1},(_,i)=>({label:`${i+1}`,value:i+2})));return onMounted(()=>{getUINavServiceInstance().useCrossfire=!1}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$92,[createBaseVNode(`div`,_hoisted_2$79,[createVNode(unref(bngButton_default),{onClick:_cache[0]||=()=>unref(ORDER_TOOL).moveOrderUp(),disabled:order.value===orderMax.value},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$69,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_item_up`})])]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{onClick:_cache[1]||=()=>unref(ORDER_TOOL).moveOrderDown(),disabled:order.value===2},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$53,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_item_down`})])]),_:1},8,[`disabled`]),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:_cache[2]||=()=>unref(ORDER_TOOL).changeOrderToTop(),disabled:order.value===orderMax.value},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$44,[createBaseVNode(`div`,_hoisted_6$31,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])]),createVNode(unref(bngBinding_default),{action:`menu_item_right`})])]),_:1},8,[`disabled`])),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[3]||=()=>unref(ORDER_TOOL).changeOrderToBottom(),disabled:order.value===2},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$27,[createBaseVNode(`div`,_hoisted_8$21,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`])]),createVNode(unref(bngBinding_default),{action:`menu_item_left`})])]),_:1},8,[`disabled`]))]),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_9$18,[createVNode(unref(bngDropdown_default),{modelValue:order.value,"onUpdate:modelValue":_cache[4]||=$event=>order.value=$event,items:orderOptions.value},null,8,[`modelValue`,`items`])]))])),[[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).changeOrderToBottom(),`focus_l`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).changeOrderToTop(),`focus_r`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).moveOrderUp(),`focus_u`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).moveOrderDown(),`focus_d`]])}},LayerSortSettings_default=__plugin_vue_export_helper_default(_sfc_main$100,[[`__scopeId`,`data-v-1d4969be`]]),_hoisted_1$91={class:`skew-settings`,"bng-ui-scope":`skew-settings`},_hoisted_2$78={class:`setting-item item-column`},_hoisted_3$68={class:`slider-text-container`},_hoisted_4$52={class:`setting-item item-column`},_hoisted_5$43={class:`slider-text-container`},INPUT_CONTROL_STEPS=.01,INPUT_CONTROL_MIN=-2,INPUT_CONTROL_MAX=2,INPUT_DEFAULT_VALUE=0,CONTROLLER_SKEW_Y_BINDING=`focus_ud`,CONTROLLER_SKEW_X_BINDING=`focus_lr`,CONTROLLER_HINTS=[],KEYBOARD_HINTS=[],_sfc_main$99={__name:`LayerDeformSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),skewX=computed({get:()=>store$1.cursorData&&store$1.cursorData.skew?store$1.cursorData.skew.x:void 0,set:async newValue=>await store$1.setSkew(newValue,store$1.cursorData.skew.y)}),skewY=computed({get:()=>store$1.cursorData&&store$1.cursorData.skew?store$1.cursorData.skew.y:void 0,set:async newValue=>await store$1.setSkew(store$1.cursorData.skew.x,newValue)});function onReset(){store$1.setSkew(INPUT_DEFAULT_VALUE,INPUT_DEFAULT_VALUE)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`skew-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`skew`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS:KEYBOARD_HINTS;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$91,[createBaseVNode(`div`,_hoisted_2$78,[createBaseVNode(`div`,_hoisted_3$68,[createVNode(unref(bngInput_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[0]||=$event=>skewX.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[1]||=$event=>skewX.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SKEW_X_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_4$52,[createBaseVNode(`div`,_hoisted_5$43,[createVNode(unref(bngInput_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[2]||=$event=>skewY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[3]||=$event=>skewY.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SKEW_Y_BINDING,deviceMask:`xinput`})])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`skew`,unref(store$1).skew,element),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`skew`,unref(store$1).skew,element),`focus_ud`]])}},LayerDeformSettings_default=__plugin_vue_export_helper_default(_sfc_main$99,[[`__scopeId`,`data-v-b2c32ce6`]]),_hoisted_1$90={class:`layer-settings-base`},_hoisted_2$77={class:`settings-heading`},_hoisted_3$67={class:`settings-content`},_sfc_main$98={__name:`LayerSettingsBase`,props:{heading:{type:String}},emits:[`close`],setup(__props){let slots=useSlots();return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$90,[createBaseVNode(`div`,_hoisted_2$77,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[unref(slots).heading?renderSlot(_ctx.$slots,`heading`,{key:0},()=>[createBaseVNode(`span`,null,toDisplayString(__props.heading),1)],!0):createCommentVNode(``,!0)]),_:3})]),createBaseVNode(`div`,_hoisted_3$67,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},LayerSettingsBase_default=__plugin_vue_export_helper_default(_sfc_main$98,[[`__scopeId`,`data-v-c5fed92f`]]),_hoisted_1$89={class:`setting-item item-column`},_hoisted_2$76={class:`slider-text-container`},_hoisted_3$66={class:`setting-item item-column`},_hoisted_4$51={class:`slider-text-container`},_sfc_main$97={__name:`TransformSettings`,setup(__props){let scaleX=ref(.5),scaleY=ref(.5);return(_ctx,_cache)=>(openBlock(),createBlock(unref(LayerSettingsBase_default),null,{heading:withCtx(()=>[..._cache[2]||=[createTextVNode(`Transform`,-1)]]),default:withCtx(()=>[createBaseVNode(`template`,null,[createBaseVNode(`div`,_hoisted_1$89,[createBaseVNode(`div`,_hoisted_2$76,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[0]||=$event=>scaleX.value=$event,min:0,max:6,step:.01,type:`number`,prefix:`X`},null,8,[`modelValue`])])]),createBaseVNode(`div`,_hoisted_3$66,[createBaseVNode(`div`,_hoisted_4$51,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[1]||=$event=>scaleY.value=$event,type:`number`,prefix:`Y`,min:0,max:6,step:.01},null,8,[`modelValue`])])])])]),_:1}))}},TransformSettings_default=_sfc_main$97,_hoisted_1$88={class:`settings-container`},_hoisted_2$75={class:`setting-types-selector`},_hoisted_3$65={class:`setting-types`},_hoisted_4$50=[`onClick`],_hoisted_5$42={class:`heading-content-wrapper`},_hoisted_6$30={class:`heading-content-text`},_hoisted_7$26={key:0},_hoisted_8$20={key:0,class:`subheading`},CONTROLLER_RESET_BINDING=`advanced`,SETTING_TYPES=[{value:`transform`,label:`Transform`,icon:icons.transform,component:markRaw(TransformSettings_default)},{value:`transformold`,label:`Position`,icon:icons.transform,component:markRaw(LayerTransformSettingsOld_default)},{value:`scale`,label:`Scale`,icon:icons.scale,component:markRaw(LayerScaleSettings_default)},{value:`skew`,label:`Skew`,icon:icons.deform,component:markRaw(LayerDeformSettings_default)},{value:`rotate`,label:`Rotate`,icon:icons.rotationL,component:markRaw(LayerRotateSettings_default)},{value:`material`,label:`Material`,icon:icons.material,component:markRaw(LayerMaterialSettings_default)},{value:`mirror`,label:`Mirror`,icon:icons.reflect,component:markRaw(LayerMirrorSettings_default)}],_sfc_main$96={__name:`LayerSettings`,props:{settingTypes:Array,activeSetting:String,excludeSettingTypes:Array},setup(__props){let store$1=useLayerSettingsStore(),props=__props,currentIndex=ref(0),settingTypes=computed(()=>{let filtered=SETTING_TYPES;return props.settingTypes&&(filtered=filtered.filter(x=>props.settingTypes.includes(x.value))),props.excludeSettingTypes&&(filtered=filtered.filter(x=>!props.excludeSettingTypes.includes(x.value))),filtered}),activeSubSetting=ref(null),activeSettingType=computed(()=>settingTypes.value[currentIndex.value]),mouseMode=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0);watch(()=>props.activeSetting,()=>{let index=settingTypes.value.findIndex(x=>x.value===props.activeSetting);index>-1?currentIndex.value=index:console.warn(`Error finding setting ${props.activeSetting}`)},{immediate:!0}),watch(activeSettingType,value=>store$1.activeSetting=value.value,{immediate:!0}),watch(activeSettingType,(newValue,oldValue)=>{newValue.value&&oldValue.value}),onMounted(()=>{getUINavServiceInstance().useCrossfire=!1}),onUnmounted(async()=>{getUINavServiceInstance().useCrossfire=!0});let setTool=settingType=>{currentIndex.value=settingTypes.value.findIndex(x=>x.value===settingType.value)},goPreviousTab=()=>{currentIndex.value=currentIndex.value>0?currentIndex.value-1:settingTypes.value.length-1},goNextTab=()=>{currentIndex.value=currentIndex.value(openBlock(),createElementBlock(`div`,_hoisted_1$88,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$75,[createBaseVNode(`div`,{onClick:goPreviousTab},[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_tab_left`,deviceMask:`xinput`})]),createBaseVNode(`div`,_hoisted_3$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(settingTypes.value,settingType=>withDirectives((openBlock(),createElementBlock(`div`,{key:settingType.value,class:normalizeClass([{active:activeSettingType.value.value===settingType.value},`setting-type`]),onClick:$event=>setTool(settingType)},[createVNode(unref(bngIcon_default),{type:settingType.icon,class:`setting-type-icon`},null,8,[`type`])],10,_hoisted_4$50)),[[unref(BngTooltip_default),activeSettingType.value.value===settingType.value?void 0:settingType.label,`top`]])),128))]),createBaseVNode(`div`,{onClick:goNextTab},[createVNode(unref(bngBinding_default),{action:`menu_tab_right`,deviceMask:`xinput`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallRight},null,8,[`type`])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),goPreviousTab,`tab_l`],[unref(BngOnUiNav_default),goNextTab,`tab_r`]]),withDirectives((openBlock(),createBlock(LayerSettingsBase_default,null,{heading:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$42,[createBaseVNode(`span`,_hoisted_6$30,[createBaseVNode(`span`,null,[createTextVNode(toDisplayString(activeSettingType.value.label)+` `,1),activeSubSetting.value?(openBlock(),createElementBlock(`span`,_hoisted_7$26,`/`)):createCommentVNode(``,!0)]),activeSubSetting.value?(openBlock(),createElementBlock(`span`,_hoisted_8$20,toDisplayString(activeSubSetting.value.label),1)):createCommentVNode(``,!0)]),(unref(store$1).reapplyActive||unref(store$1).requestApplyActive)&&(activeSettingType.value.value!==`transform`||!mouseMode.value)?(openBlock(),createBlock(unref(BindingButton_default),{key:0,icon:unref(icons).restart,accent:`text`,label:`Reset`,uiEvent:CONTROLLER_RESET_BINDING,onClick:resetSettings},null,8,[`icon`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(activeSettingType.value.component),{onSubSettingChanged},null,32))]),_:1})),[[unref(BngOnUiNav_default),onAdvanced,`advanced`],[unref(BngBlur_default)]])]))}},LayerSettings_default=__plugin_vue_export_helper_default(_sfc_main$96,[[`__scopeId`,`data-v-ca9ed9d2`]]),_hoisted_1$87={key:0,"bng-ui-scope":`liveryeditor-editmode`,class:`liveryeditor-editmode-layout`},_hoisted_2$74={class:`layers-preview-container`},_hoisted_3$64={class:`layer-settings-wrapper`},SAVE_TYPES={default:1,asGroup:2},FOCUS_LD_TRIGGER_VALUE=-.999,FOCUS_RU_TRIGGER_VALUE=.999,HEADER_TEXT$1=`Edit Mode`,CONTEXT_MENU_NAME=`context-menu`,CONTROLLER_EXIT_BINDING=`back`,CONTROLLER_SAVE_BINDING=`menu`,APPLY_DEFAULT_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`ok`},label:`Apply`}},{id:`cancel`,content:{type:`binding`,props:{uiEvent:`back`},label:`Cancel`}}],APPLY_MOUSE_HINTS=[{id:`cancel`,content:{type:`binding`,props:{uiEvent:`back`},label:`Cancel`}}],FREECAM_CONTROLLER_HINTS=[{id:`toggle_freecam`,content:{type:`binding`,props:{uiEvent:`action_4`},label:`Toggle View Point`}}],VIEWPOINT_CONTROLLER_HINTS=[{id:`toggle_freecam`,content:{type:`binding`,props:{uiEvent:`action_4`},label:`Toggle Free Cam`}}],DELETE_LAYER_HINT={id:`delete`,content:{type:`binding`,props:{uiEvent:`advanced`},label:`Delete`}},_sfc_main$95={__name:`EditModeLayout`,setup(__props){useCssVars(_ctx=>({ff7f3326:alphaTextureBackground.value}));let infoBar=useInfoBar(),{showIfController}=storeToRefs(controls_default()),actionHoldService=useActionHoldService(),rootStore=useLiveryEditorStore(),store$1=useLayerSettingsStore(),popover=usePopover(),freecam=ref(!1),CONTEXT_MENU_STYLES=ref({display:`flex`,"flex-direction":`column`}),contextMenuName=ref(`context-menu`),alphaTextureBackground=computed(()=>`url(${getAssetURL(`images/alpha_texture.png`)}`);onBeforeMount(async()=>{await store$1.getInitialData(),watch(showIfController,()=>{actionHoldService.clear()})}),onMounted(()=>{store$1.init(),infoBar.clearHints()}),onUnmounted(()=>{infoBar.clearHints()});async function onAddOrChangeDecal(){await rootStore.toggleShowDecalSelector()}function onBack(){popover.isShown(CONTEXT_MENU_NAME)?popover.hide(CONTEXT_MENU_NAME):store$1.appliedLayers&&store$1.appliedLayers.length>0&&store$1.requestApplyActive?store$1.cancelRequestApply():store$1.appliedLayers&&store$1.reapplyActive?store$1.cancelReapply():confirmCancelChanges()}function onContextMenu(){store$1.reapplyActive?store$1.requestChangeDecal():store$1.requestApplyActive?rootStore.toggleShowDecalSelector():store$1.duplicateActiveLayer()}function onAdvanced(){!store$1.requestApplyActive&&!store$1.reapplyActive&&store$1.activeLayerUid&&store$1.appliedLayers.length>1&&(getUINavServiceInstance().useCrossfire=!0,openConfirmation(`Delete Decal`).then(res=>{res&&store$1.removeAppliedLayer(store$1.activeLayerUid),getUINavServiceInstance().useCrossfire=!0}))}function onOk(){(store$1.requestApplyActive||store$1.reapplyActive)&&store$1.apply()}function confirmSaveChanges(){!store$1.appliedLayers||store$1.appliedLayers.length===0||(getUINavServiceInstance().useCrossfire=!0,openConfirmation(`Save`,`Save changes and exit edit mode?`,[{label:$translate.instant(`ui.common.cancel`),value:void 0,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.save`),value:SAVE_TYPES.default,extras:{default:!0}}]).then(res=>{res?store$1.saveChanges():getUINavServiceInstance().useCrossfire=!1}))}async function confirmCancelChanges(){getUINavServiceInstance().useCrossfire=!0;let hasChanges=store$1.appliedLayers&&store$1.appliedLayers.length>0;await openConfirmation(`Exit`,hasChanges?`Exit edit mode and lose all changes?`:`Exit Edit Mode?`)?(hasChanges&&await store$1.cancelChanges(),await store$1.deactivate()):getUINavServiceInstance().useCrossfire=!1}let removeLayer=()=>{store$1.removeAppliedLayer(store$1.activeLayerUid),popover.hide(CONTEXT_MENU_NAME)};function onSecondaryAction(element){!store$1.reapplyActive&&!store$1.requestApplyActive&&store$1.requestApply()}function onTertiaryAction(element){store$1.cursorData.applied&&!store$1.reapplyActive&&store$1.toggleHighlightActive()}function onQuaternaryAction(element){freecam.value=!freecam.value}function onRotateHCam(element){if(freecam.value)return!0;let direction$1=element.detail.value;(direction$1>=FOCUS_RU_TRIGGER_VALUE||direction$1<=FOCUS_LD_TRIGGER_VALUE)&&rootStore.switchOrthographicViewByDirection(direction$1>0?-1:1,0)}function onRotateVCam(element){if(freecam.value)return!0;let direction$1=element.detail.value;(direction$1>=FOCUS_RU_TRIGGER_VALUE||direction$1<=FOCUS_LD_TRIGGER_VALUE)&&rootStore.switchOrthographicViewByDirection(0,direction$1>0?-1:1)}let APPLY_CONTROLLER_HINTS=[{id:`change_decal`,content:{type:`binding`,props:{uiEvent:`context`},label:`Change Decal`},action:store$1.requestChangeDecal}],DEFAULT_HINTS=[{id:`duplicate_decal`,content:{type:`binding`,props:{action:`duplicate_active_layer`},label:`Duplicate Decal`,action:store$1.duplicateActiveLayer}},{id:`activate_previous_decal`,content:{type:`binding`,props:{action:`activate_previous_layer`},label:`Edit Previous Decal`}},{id:`activate_next_decal`,content:{type:`binding`,props:{action:`activate_next_layer`},label:`Edit Next Decal`}},{id:`save`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Save`}},{id:`exit`,content:{type:`binding`,props:{uiEvent:`back`},label:`Exit`}}],DEFAULT_CONTROLLER_HINTS=[{id:`apply_or_new`,content:{type:`binding`,props:{uiEvent:`action_2`},label:`New Decal`}},{id:`delete_decal`,content:{type:`binding`,props:{uiEvent:`advanced`},label:`Delete Decal`,action:()=>store$1.removeAppliedLayer(store$1.activeLayerUid)}},{id:`duplicate_decal`,content:{type:`binding`,props:{uiEvent:`context`},label:`Duplicate Decal`},action:()=>store$1.duplicateActiveLayer()},{id:`highlight_decal`,content:{type:`binding`,props:{uiEvent:`action_3`},label:`Toggle Highlight`},action:()=>store$1.toggleHighlightActive()}];watchEffect(()=>{let isController$2=showIfController.value,defaultControllerHints=!1,hints;removeHints(),store$1.requestApplyActive||store$1.reapplyActive?hints=store$1.cursorData.isUseMousePos?APPLY_MOUSE_HINTS:isController$2?APPLY_CONTROLLER_HINTS:APPLY_DEFAULT_HINTS:isController$2?(hints=DEFAULT_CONTROLLER_HINTS,defaultControllerHints=!0):hints=DEFAULT_HINTS;for(let i=0;i1&&infoBar.addHints(DELETE_LAYER_HINT,`change_decal`,!0),(!store$1.appliedLayers||store$1.appliedLayers.length<=1)&&infoBar.removeHints(`delete_decal`)}),watch(()=>freecam.value,async()=>{freecam.value?rootStore.cameraView=`free`:await rootStore.setOrthographicView(`right`)});function removeHints(){APPLY_MOUSE_HINTS.forEach(x=>infoBar.removeHints(x.id)),APPLY_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),APPLY_DEFAULT_HINTS.forEach(x=>infoBar.removeHints(x.id)),DEFAULT_HINTS.forEach(x=>infoBar.removeHints(x.id)),DEFAULT_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),FREECAM_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),VIEWPOINT_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),infoBar.removeHints(DELETE_LAYER_HINT.id)}let headerStore=useEditorHeaderStore(),resetDisabled=ref(!1),saveDisabled=ref(!0),useMouse=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0),changeMouseMode=async newValue=>await store$1.setUseMousePos(newValue),HEADER_APPLY_ITEMS=[{id:`cancel_apply`,section:`end`,component:shallowRef(bngButton_default),props:{label:`Cancel Apply`,accent:ACCENTS.attention},events:{click:()=>{store$1.requestApplyActive&&store$1.cancelRequestApply()}},hidden:!0},{id:`undo_reapply`,section:`end`,component:shallowRef(bngButton_default),props:{label:`Undo Reapply`,accent:ACCENTS.attention},events:{click:()=>{store$1.reapplyActive&&store$1.cancelReapply()}},hidden:!0},{id:`use_mouse`,section:`end`,component:shallowRef(bngSwitch_default),props:{modelValue:useMouse,label:`Use Mouse`,uncheckedWithBackground:!0},events:{"update:modelValue":changeMouseMode}}],showBinding=computed(()=>!store$1.active||!store$1.appliedLayers||store$1.appliedLayers.length===0||!(store$1.reapplyActive||store$1.requestApplyActive)),HEADER_GLOBAL_ITEMS=[{id:`save_changes`,section:`start`,component:shallowRef(BindingButton_default),props:{icon:icons.saveAs1,accent:ACCENTS.main,label:`Save and Exit`,disabled:saveDisabled,uiEvent:CONTROLLER_SAVE_BINDING,deviceMask:`xinput`},events:{click:confirmSaveChanges}},{id:`exit_edit_mode`,section:`start`,component:shallowRef(BindingButton_default),props:{icon:icons.exit,accent:ACCENTS.attention,label:`Exit Edit Mode`,uiEvent:CONTROLLER_EXIT_BINDING,deviceMask:`xinput`,showBinding},events:{click:confirmCancelChanges}}];return watch(()=>store$1.active,active=>{active&&(headerStore.setHeader(HEADER_TEXT$1,`ribbon`),headerStore.setPreheader(void 0))},{immediate:!0}),watchEffect(()=>{store$1.appliedLayers&&store$1.appliedLayers.length>0&&store$1.requestApplyActive?headerStore.showItem(`cancel_apply`):headerStore.hideItem(`cancel_apply`)}),watch(()=>store$1.reapplyActive,value=>{value?headerStore.showItem(`undo_reapply`):headerStore.hideItem(`undo_reapply`)}),watchEffect(()=>{saveDisabled.value=!store$1.appliedLayers||store$1.appliedLayers.length===0,resetDisabled.value=!store$1.requestApplyActive&&!store$1.reapplyActive}),onMounted(()=>{headerStore.removeItems(HEADER_APPLY_ITEMS),headerStore.removeItem(HEADER_GLOBAL_ITEMS),store$1.active&&(headerStore.addItems(HEADER_APPLY_ITEMS,!0),headerStore.addItems(HEADER_GLOBAL_ITEMS))}),onUnmounted(()=>{headerStore.removeItems(HEADER_APPLY_ITEMS),headerStore.removeItems(HEADER_GLOBAL_ITEMS)}),(_ctx,_cache)=>unref(store$1).active?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$87,[createBaseVNode(`div`,_hoisted_2$74,[unref(store$1).appliedLayers&&!unref(store$1).requestApplyActive?withDirectives((openBlock(),createBlock(unref(bngImageTile_default),{key:0,icon:unref(icons).decal,class:normalizeClass([{cancel:unref(store$1).requestApplyActive},`add-item`]),disabled:unref(store$1).reapplyActive?`disabled`:``,ratio:`1:1`,onClick:onAddOrChangeDecal},{default:withCtx(()=>[..._cache[0]||=[createBaseVNode(`label`,null,`Add`,-1)]]),_:1},8,[`icon`,`class`,`disabled`])),[[unref(BngBlur_default)]]):withDirectives((openBlock(),createElementBlock(`div`,{key:1,class:`layer-ghost-wrapper`,onClick:onAddOrChangeDecal},[createVNode(DecalPreviewTile_default,{textureImage:unref(store$1).cursorData.decalTexturePath,textureColor:unref(store$1).cursorData.color},null,8,[`textureImage`,`textureColor`]),createVNode(unref(bngIcon_default),{class:`hover-icon`,type:unref(icons).edit},null,8,[`type`])])),[[unref(BngBlur_default)]]),unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0?withDirectives((openBlock(),createBlock(EditModeLayersPreview_default,{key:2,contextMenuName:contextMenuName.value},null,8,[`contextMenuName`])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$64,[createVNode(unref(LayerSettings_default))]),unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0&&unref(store$1).activeLayerUid!==null&&unref(store$1).activeLayerUid!==void 0?(openBlock(),createBlock(unref(bngPopoverContent_default),{key:0,name:contextMenuName.value},{default:withCtx(()=>[createBaseVNode(`div`,{class:`layer-context-menu`,style:normalizeStyle(CONTEXT_MENU_STYLES.value)},[createVNode(unref(bngButton_default),{onClick:withModifiers(unref(store$1).requestChangeDecal,[`stop`])},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Change Decal`,-1)]]),_:1},8,[`onClick`]),createVNode(unref(bngButton_default),{disabled:unref(store$1).appliedLayers.length<=1,accent:`attention`,onClick:withModifiers(removeLayer,[`stop`])},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Delete`,-1)]]),_:1},8,[`disabled`])],4)]),_:1},8,[`name`])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),onOk,`ok`],[unref(BngOnUiNav_default),onContextMenu,`context`],[unref(BngOnUiNav_default),onAdvanced,`advanced`],[unref(BngOnUiNav_default),onBack,`back`],[unref(BngOnUiNav_default),confirmSaveChanges,`menu`],[unref(BngOnUiNav_default),onSecondaryAction,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onQuaternaryAction,`action_4`],[unref(BngOnUiNav_default),onRotateHCam,`rotate_h_cam`],[unref(BngOnUiNav_default),onRotateVCam,`rotate_v_cam`]]):createCommentVNode(``,!0)}},EditModeLayout_default=__plugin_vue_export_helper_default(_sfc_main$95,[[`__scopeId`,`data-v-9b377f5e`]]),_hoisted_1$86={class:`layer-content`},_hoisted_2$73={class:`layer-name`},_hoisted_3$63={key:0,class:`layer-actions`},_hoisted_4$49={class:`layer-preview`},_hoisted_5$41={key:1,class:`group-preview`},_sfc_main$94={__name:`LayerTile`,props:{layer:Object,isTargeted:Boolean,forceShowActions:Boolean,disableMoveUp:Boolean,disableMoveDown:Boolean},emits:[`lockClicked`,`hideClicked`,`moveClicked`,`enableClicked`],setup(__props){let isHovered=ref(!1),toRgba255Styles=colors=>`rgba(${colors[0]*255}, ${colors[1]*255}, ${colors[2]*255}, ${colors[3]})`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`layer-tile`,onMouseover:_cache[1]||=$event=>isHovered.value=!0,onMouseleave:_cache[2]||=$event=>isHovered.value=!1},[createBaseVNode(`div`,_hoisted_1$86,[renderSlot(_ctx.$slots,`content`,{},()=>[createBaseVNode(`div`,_hoisted_2$73,toDisplayString(__props.layer.name),1),__props.forceShowActions||!__props.layer.enabled?(openBlock(),createElementBlock(`div`,_hoisted_3$63,[__props.forceShowActions?(openBlock(),createBlock(unref(bngBinding_default),{key:0,"track-ignore":!0,uiEvent:`action_2`,deviceMask:`xinput`})):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{accent:`outlined`,onClick:_cache[0]||=$event=>_ctx.$emit(`enableClicked`),icon:__props.layer.enabled?unref(icons).eyeSolidOpened:unref(icons).eyeSolidClosed},null,8,[`icon`])])):createCommentVNode(``,!0)],!0)]),createBaseVNode(`div`,_hoisted_4$49,[__props.layer.type===1?(openBlock(),createElementBlock(`div`,{key:0,class:`fill-preview`,style:normalizeStyle({"--layer-color":toRgba255Styles(__props.layer.color)})},null,4)):__props.layer.type===3?(openBlock(),createElementBlock(`div`,_hoisted_5$41,[createVNode(unref(bngIcon_default),{type:unref(icons).group},null,8,[`type`])])):__props.layer.type===0?(openBlock(),createBlock(DecalPreviewTile_default,{key:2,textureImage:__props.layer.preview,textureColor:__props.layer.color},null,8,[`textureImage`,`textureColor`])):createCommentVNode(``,!0)])],32))}},LayerTile_default=__plugin_vue_export_helper_default(_sfc_main$94,[[`__scopeId`,`data-v-87650a01`]]),_hoisted_1$85={class:`layers-manager`},_hoisted_2$72={class:`layers-manager-header`},_hoisted_3$62=[`onFocusin`];const VIEW_MODES={DEFAULT:`default`,COMPACT:`compact`};var _sfc_main$93={__name:`LayersManager`,props:mergeModels({layers:{type:Array,required:!0},view:{type:String,default:`default`,validator(value){return Object.values(VIEW_MODES).find(x=>x===value)}}},{selectedKeys:{},selectedKeysModifiers:{}}),emits:mergeModels([`focusedLayer`],[`update:selectedKeys`]),setup(__props,{emit:__emit}){let emit$1=__emit,rootStore=useLiveryEditorStore(),expandedKeys=ref([]),selectedKeys=useModel(__props,`selectedKeys`),focusLayer=ref(null),layersScrollable=ref(null);ref(!1);let isFocusFirstLayer=ref(!1);watch(()=>rootStore.selectedLayers,()=>{(!rootStore.selectedLayers||rootStore.selectedLayers.length===0)&&(rootStore.selectMode=`single`)}),watch(()=>selectedKeys.value,(newValue,oldValue)=>{(!newValue||newValue.length===0&&oldValue&&oldValue.length>0)&&(isFocusFirstLayer.value=!0)});let setMultiSelect=async node=>{rootStore.selectMode!==`multi`&&(rootStore.selectMode=`multi`,rootStore.toggleSelection(node.id,!1))},toggleEnabled=layer=>{Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`enabled`).then(luaRes=>{layer.enabled=luaRes})},onClickItem=node=>{Lua_default.extensions.ui_liveryEditor_selection.select(node.id,!0),setFocusLayer(null)},setFocusLayer=layer=>{isFocusFirstLayer.value&&=!1,focusLayer.value=layer,emit$1(`focusedLayer`,layer)},handleFocusOut=event=>{setFocusLayer(null)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$85,[createBaseVNode(`div`,_hoisted_2$72,[renderSlot(_ctx.$slots,`header`,{},void 0,!0)]),__props.layers?(openBlock(),createElementBlock(`div`,{key:0,ref_key:`layersScrollable`,ref:layersScrollable,class:`layers-scrollable`,onFocusout:handleFocusOut},[createVNode(unref(tree_default),{expandedKeys:expandedKeys.value,"onUpdate:expandedKeys":_cache[2]||=$event=>expandedKeys.value=$event,selectedKeys:selectedKeys.value,"onUpdate:selectedKeys":_cache[3]||=$event=>selectedKeys.value=$event,nodes:__props.layers,selectMode:unref(rootStore).selectMode,keyName:`id`,class:`layers-tree`},{node:withCtx(({node,parentNode,expanded,selected,expand})=>[node.hidden?createCommentVNode(``,!0):withDirectives((openBlock(),createElementBlock(`div`,{key:0,onFocusin:withModifiers($event=>setFocusLayer(node),[`self`]),"bng-nav-item":``,class:`layer-node`},[createVNode(LayerTile_default,{layer:node,forceShowActions:focusLayer.value&&focusLayer.value.uid===node.uid,onEnableClicked:()=>toggleEnabled(node)},null,8,[`layer`,`forceShowActions`,`onEnableClicked`]),node.children?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:expanded?unref(icons).arrowSmallUp:unref(icons).arrowSmallDown,class:`expand-icon`,onMousedown:_cache[0]||=withModifiers(()=>{},[`stop`]),onMouseup:_cache[1]||=withModifiers(()=>{},[`stop`]),onClick:withModifiers(expand,[`stop`])},null,8,[`type`,`onClick`])):createCommentVNode(``,!0)],40,_hoisted_3$62)),[[unref(BngClick_default),{clickCallback:()=>onClickItem(node),holdCallback:()=>setMultiSelect(node),repeatInterval:0}],[unref(BngUiNavFocus_default),isFocusFirstLayer.value&&__props.layers[0].uid===node.uid?0:void 0],[unref(BngFocusIf_default),isFocusFirstLayer.value&&__props.layers[0].uid===node.uid],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),_:1},8,[`expandedKeys`,`selectedKeys`,`nodes`,`selectMode`])],544)):createCommentVNode(``,!0)]))}},LayersManager_default=__plugin_vue_export_helper_default(_sfc_main$93,[[`__scopeId`,`data-v-1bc4f03d`]]),_hoisted_1$84={class:`paint-settings`},_sfc_main$92={__name:`PaintSettings`,setup(__props){let LUA_FILL_LAYER=Lua_default.extensions.ui_liveryEditor_layers_fill,paint=new Paint,color=ref({hue:.5,saturation:1,luminosity:.5});function setColor(){paint.hsl=[color.value.hue,color.value.saturation,color.value.luminosity],LUA_FILL_LAYER.updateLayer({color:paint.rgba})}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$84,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,view:`luminosity`},null,8,[`modelValue`]),createBaseVNode(`div`,null,[createVNode(unref(bngButton_default),{onClick:setColor},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Save`,-1)]]),_:1})])]))}},PaintSettings_default=__plugin_vue_export_helper_default(_sfc_main$92,[[`__scopeId`,`data-v-66a34a99`]]),_hoisted_1$83={class:`liveryeditor-default-layout`,"bng-ui-scope":`default-layout`},_hoisted_2$71={class:`layers-manager-wrapper`},_hoisted_3$61={key:0,class:`multiselect-header`},_hoisted_4$48={class:`message`},_hoisted_5$40={class:`add-content-wrapper`},_hoisted_6$29={class:`action-tile`},_hoisted_7$25={key:1,class:`layer-settings-wrapper`,"bng-ui-scope":`layer-settings`},SETTINGS_VIEWS={edit:{label:`Edit`,value:`edit`,hideActions:!0,propertySettings:!0,disableLayersManager:!0,props:{excludeSettingTypes:[`transform`]}},order:{label:`Change Order`,value:`order`,component:LayerSortSettings_default,hideActions:!0,disableLayersManager:!0},paint:{label:`Paint`,value:`paint`,component:PaintSettings_default,hideActions:!0,disableLayersManager:!0}},HEADER_TEXT=`Livery Editor`,_sfc_main$91={__name:`DefaultLayout`,setup(__props){useUINavScope(`default-layout`);let rootStore=useLiveryEditorStore(),infoBar=useInfoBar(),{layers:layers$1}=storeToRefs(rootStore),actionsDrawer=ref(null),settingType=shallowRef(null),layerActions=computed(()=>rootStore.layerActions?{label:rootStore.selectedLayers.length===1?`${rootStore.selectedLayers[0].name} Actions`:`${rootStore.selectedLayers.length} Layers Actions`,items:rootStore.layerActions,allowOpenDrawer:!1}:void 0),headerLabel=computed(()=>rootStore.visibleLayersCount===0?`No Layers`:rootStore.visibleLayersCount+` Layer`+rootStore.visibleLayersCount>1?`s`:``),multiSelectMessage=computed(()=>{if(rootStore.selectedLayers)return rootStore.selectedLayers.length+`Layer${rootStore.selectedLayers.length>1?`s`:``}`});onMounted(()=>{getUINavServiceInstance().useCrossfire=!0});function onBack(){settingType.value?(console.log(`onBack > closed settings`),closeSettings()):rootStore.selectedLayers&&rootStore.selectedLayers.length>0?(console.log(`onBack > closed actions`),rootStore.dismissLayerActions().then()):(console.log(`onBack > catch all`),openExitDialog().then())}function onMenu(){settingType.value?closeActions():rootStore.selectedLayers&&rootStore.selectedLayers.length>0||openSaveDialog()}function closeActions(){settingType.value&&closeSettings(),rootStore.dismissLayerActions().then()}function closeSettings(){settingType.value=null}function onActionTriggered(actionItem){let setting=SETTINGS_VIEWS[actionItem.value];setting?settingType.value=setting:rootStore.onActionItemSelected(actionItem).then()}let saving=ref(!1),dialogStates=reactive({isDialogOpen:!1});async function openExitDialog(){if(dialogStates.isDialogOpen)return!0;dialogStates.isDialogOpen=!0,await rootStore.openExitDialog(),dialogStates.isDialogOpen=!1}function openSaveDialog(){if(dialogStates.isDialogOpen)return!0;saving.value=!0,dialogStates.isDialogOpen=!0,rootStore.save().then(()=>{saving.value=!1,dialogStates.isDialogOpen=!1})}function openPaintSettings(){settingType.value=SETTINGS_VIEWS.paint}let saveLabel=computed(()=>saving.value?`Saving...`:`Save`),HEADER_ITEMS=[{id:`save_editor`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.saveAs1,accent:ACCENTS.main,label:saveLabel,disabled:saving},events:{click:openSaveDialog}},{id:`exit_editor`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.exit,accent:ACCENTS.attention,label:`Exit`},events:{click:openExitDialog}},{id:`paint_settings`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.exit,accent:ACCENTS.secondary,label:`Paint`},events:{click:openPaintSettings}}],headerStore=useEditorHeaderStore();watchEffect(()=>{rootStore.currentFile&&rootStore.currentFile.name&&headerStore.setPreheader(rootStore.currentFile.name)}),onMounted(()=>{headerStore.setHeader(HEADER_TEXT),headerStore.addItems(HEADER_ITEMS)}),onUnmounted(()=>{headerStore.removeItems(HEADER_ITEMS)});let NAV_HINTS=[{id:`save`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Save`},action:async()=>await rootStore.save(!1)},{id:`exit`,content:{type:`binding`,props:{uiEvent:`back`},label:`Exit`},action:async()=>rootStore.openExitDialog}],ACTIONS_DRAWER_HINTS=[{id:`actions_back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`}}],SETTINGS_NAV_HINTS=[{id:`selected_done`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`}},{id:`selected_back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Done (Return to Actions)`}}];return watchEffect(()=>{infoBar.clearHints(),settingType.value?infoBar.addHints(SETTINGS_NAV_HINTS):layerActions.value?infoBar.addHints(ACTIONS_DRAWER_HINTS):infoBar.addHints(NAV_HINTS)}),onMounted(()=>{infoBar.addHints(NAV_HINTS)}),onUnmounted(()=>{infoBar.removeHints(...NAV_HINTS.map(x=>x.id))}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$83,[createBaseVNode(`div`,_hoisted_2$71,[withDirectives((openBlock(),createBlock(unref(LayersManager_default),{selectedKeys:unref(rootStore).selectedLayerUids,"onUpdate:selectedKeys":_cache[0]||=$event=>unref(rootStore).selectedLayerUids=$event,layers:unref(layers$1),class:normalizeClass({inactive:settingType.value&&settingType.value.disableLayersManager})},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(headerLabel.value),1)]),_:1}),unref(rootStore).selectMode===`multi`?(openBlock(),createElementBlock(`div`,_hoisted_3$61,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).attention,onClick:closeActions,class:`cancel-btn`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Cancel`,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]),createBaseVNode(`span`,_hoisted_4$48,toDisplayString(multiSelectMessage.value),1)])):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).outlined,disabled:unref(rootStore).selectedLayers&&unref(rootStore).selectedLayers.length>0,onClick:unref(rootStore).toggleEditModeLayout},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_5$40,[createVNode(unref(bngIcon_default),{type:unref(icons).plus},null,8,[`type`]),_cache[2]||=createBaseVNode(`span`,{class:`add-label`},`Add Decal`,-1)])]),_:1},8,[`accent`,`disabled`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),_:1},8,[`selectedKeys`,`layers`,`class`])),[[unref(BngBlur_default)]])]),layerActions.value&&(!settingType.value||!settingType.value.hideActions)?(openBlock(),createBlock(unref(bngActionDrawer_default),{key:0,ref_key:`actionsDrawer`,ref:actionsDrawer,actions:layerActions.value,"item-width":10,"item-margin":1,class:`actions-drawer`,onSelect:onActionTriggered},{controls:withCtx(()=>[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).abandon,onClick:closeActions},null,8,[`accent`,`icon`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),action:withCtx(({item,isLoading,select})=>[createBaseVNode(`div`,_hoisted_6$29,[withDirectives(createVNode(unref(bngImageTile_default),{label:item.toggleAction&&!item.active?item.inactiveLabel:item.label,icon:item.toggleAction&&!item.active?item.inactiveIcon:item.icon,externalImage:item.preview,"bng-nav-item":``,class:`action-tile`,onClick:$event=>select(item)},null,8,[`label`,`icon`,`externalImage`,`onClick`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])]),_:1},8,[`actions`])):createCommentVNode(``,!0),settingType.value?(openBlock(),createElementBlock(`div`,_hoisted_7$25,[settingType.value.propertySettings?(openBlock(),createBlock(unref(LayerSettings_default),normalizeProps(mergeProps({key:0},settingType.value.props)),null,16)):withDirectives((openBlock(),createBlock(unref(LayerSettingsBase_default),{key:1,heading:settingType.value.label},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(settingType.value.component)))]),_:1},8,[`heading`])),[[unref(BngBlur_default)]])])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),onBack,`back`],[unref(BngOnUiNav_default),onMenu,`menu`]])}},DefaultLayout_default=__plugin_vue_export_helper_default(_sfc_main$91,[[`__scopeId`,`data-v-6dca75f9`]]),_hoisted_1$82={class:`editor`,"bng-ui-scope":`livery-editor`},_hoisted_2$70={class:`editor-header-wrapper`},EDITOR_VIEWS_COMPONENT={[EDITOR_VIEWS.decalSelector]:DecalSelector_default,[EDITOR_VIEWS.editMode]:EditModeLayout_default,[EDITOR_VIEWS.default]:DefaultLayout_default},_sfc_main$90={__name:`LiveryEditor`,setup(__props){let store$1=useLiveryEditorStore(),infobar=useInfoBar(),{showIfController}=storeToRefs(controls_default());infobar.visible=!0;let currentView=computed(()=>EDITOR_VIEWS_COMPONENT[store$1.editorView]),minimizedMode=ref(!1);watch(showIfController,value=>{store$1.setUseMousePos(!value)}),onBeforeMount(async()=>{await store$1.startEditor(),store$1.setUseMousePos(!showIfController.value)});let HEADER_ITEMS=[{id:`camera_view`,section:`end`,component:shallowRef(CameraViewButton_default)}],headerStore=useEditorHeaderStore();return onMounted(()=>{headerStore.setPreheader(store$1.currentFile?store$1.currentFile:`New Save`),headerStore.addItems(HEADER_ITEMS)}),onUnmounted(()=>{headerStore.removeItems(HEADER_ITEMS)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$82,[createBaseVNode(`div`,_hoisted_2$70,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,{class:normalizeClass([`editor-content`,{"layers-collapse":minimizedMode.value}])},[(openBlock(),createBlock(resolveDynamicComponent(currentView.value)))],2)])),[[unref(BngOnUiNav_default),()=>{},`menu,back,ok`]])}},LiveryEditor_default=__plugin_vue_export_helper_default(_sfc_main$90,[[`__scopeId`,`data-v-27ec64b0`]]),_hoisted_1$81={class:`livery-main-view`,"bng-ui-scope":`livery-main-scope`},_hoisted_2$69={key:0,class:`loading-overlay`},_hoisted_3$60={class:`header`},_hoisted_4$47={class:`main-view-content`},_hoisted_5$39={class:`menu-container`},MENU_ITEMS$2=[{label:`Paint`,value:`paint`,icon:icons.colorPalette},{label:`Decals`,value:`decals`,icon:icons.decal},{label:`Settings`,value:`settings`,icon:icons.gearTuningOutline}],blockedEvents=[`tab_l`,`tab_r`],_sfc_main$89={__name:`LiveryMainNew`,setup(__props){let infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),store$1=useLiveryMainStore(),headerStore=useEditorHeaderStore();useUINavScope(`livery-main-scope`);function onMenuItemClicked(item){switch(item){case`paint`:window.bngVue.gotoGameState(`LiveryPaint`);break;case`decals`:window.bngVue.gotoGameState(`LiveryDecals`);break;case`settings`:window.bngVue.gotoGameState(`LiverySettings`);break}}let openedDialog=ref(null);onBeforeMount(async()=>{await store$1.setup(),headerStore.setHeader(`Livery Editor`),headerStore.setPreheader(null)}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(blockedEvents)}),onUnmounted(()=>{uiNavBlocker.clear()});function exit(){store$1.exit().then(()=>{window.bngVue.gotoGameState(`garagemode`)})}function promptSave(){openedDialog.value||(openedDialog.value=`save`,openPrompt(`Enter save name`,`Save`,{buttons:[{label:`Save`,value:text=>({value:1,text}),extras:{default:!0}},{label:`Save and Exit`,value:text=>({value:-1,text}),extras:{accent:ACCENTS.secondary}},{label:`Cancel`,value:text=>({value:0,text}),extras:{cancel:!0,accent:ACCENTS.attention}}],defaultValue:store$1.currentSave.name}).then(res=>{let{value,text}=res;value!==0&&(store$1.currentSave.name=text,store$1.save().then(()=>{value===-1&&openProgress(`Saving and exporting skin...`,`Save`,{cancellable:!1,indeterminate:!0,timeout:1}).promise.then(()=>exit())}),openedDialog.value=null)}))}function promptBack(event){if(openedDialog.value){event.stopPropagation();return}openedDialog.value=`back`,openConfirmation(`Save`,`Save your changes`,[{label:`Save`,value:1,extras:{default:!0}},{label:`Exit (discard changes)`,value:-1,extras:{accent:ACCENTS.attention}},{label:`Cancel`,value:0,extras:{cancel:!0,accent:ACCENTS.secondary}}]).then(res=>{openedDialog.value=null,res===1?promptSave():res===-1&&exit()}),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$81,[unref(store$1).isSetupDone?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$69,[..._cache[0]||=[createBaseVNode(`h1`,{class:`text`},`Loading...`,-1)]])),createBaseVNode(`div`,_hoisted_3$60,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_4$47,[createBaseVNode(`div`,_hoisted_5$39,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$2,(item,index)=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,onClick:$event=>onMenuItemClicked(item.value)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)],[unref(BngUiNavFocus_default),MENU_ITEMS$2.length-index]])),64))])])])),[[unref(BngOnUiNav_default),promptBack,`menu`],[unref(BngOnUiNav_default),promptBack,`back`],[unref(BngUiNavLabel_default),`Save/Exit`,`menu,back`]])}},LiveryMainNew_default=__plugin_vue_export_helper_default(_sfc_main$89,[[`__scopeId`,`data-v-a9fbf094`]]),_hoisted_1$80={class:`save-info-container`},_hoisted_2$68={class:`file-name`},_hoisted_3$59={class:`file-modified`},_hoisted_4$46={class:`file-size`},_hoisted_5$38={key:0,class:`save-file-actions`},_sfc_main$88=Object.assign({width:14,height:6,margin:.25},{__name:`FileListItem`,props:{name:{type:String,required:!0},location:{type:String,required:!0},modifiedFormatted:String,fileSizeFormatted:String,selected:Boolean},setup(__props){let store$1=useLiveryFileStore(),mainStore=useLiveryMainStore(),props=__props,activated=ref(!1),openedDialog=ref(null);function load(){mainStore.load(props),window.bngVue.gotoGameState(`LiveryMain`)}function rename(){let model={name:props.name};nextTick(()=>{openedDialog.value=`rename`}),openFormDialog(FileEditForm_default,model,model$1=>model$1.name!==null&&model$1.name!==void 0&&model$1.name!==``,`Rename file`,`Enter new name`).then(res=>{res.value&&store$1.renameFile(props,res.formData.name),forceActivateScope()})}function deleteSave(){openConfirmation(`Delete`,`Are you sure you want to delete ${props.name}`).then(res=>{res?store$1.deleteFile(props):forceActivateScope()})}function onActivate$1(activate){activated.value=activate,nextTick(()=>{activate&&openedDialog.value&&(openedDialog.value=null)})}function forceActivateScope(){nextTick(()=>{activated.value=!0})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`file-list-item`,onActivate:_cache[0]||=$event=>onActivate$1(!0),onDeactivate:_cache[1]||=$event=>onActivate$1(!1)},[createBaseVNode(`div`,_hoisted_1$80,[createBaseVNode(`div`,_hoisted_2$68,toDisplayString(__props.name),1),createBaseVNode(`div`,_hoisted_3$59,toDisplayString(__props.modifiedFormatted),1),createBaseVNode(`div`,_hoisted_4$46,toDisplayString(__props.fileSizeFormatted),1)]),__props.selected?(openBlock(),createElementBlock(`div`,_hoisted_5$38,[createVNode(unref(bngButton_default),{icon:unref(icons).import,onClick:load},null,8,[`icon`]),createVNode(unref(bngButton_default),{icon:unref(icons).rename,accent:unref(ACCENTS).secondary,onClick:rename},null,8,[`icon`,`accent`]),createVNode(unref(bngButton_default),{icon:unref(icons).trashBin2,accent:unref(ACCENTS).attention,onClick:deleteSave},null,8,[`icon`,`accent`])])):createCommentVNode(``,!0)],32)),[[unref(BngScopedNav_default),{activated:activated.value}]])}}),FileListItem_default=__plugin_vue_export_helper_default(_sfc_main$88,[[`__scopeId`,`data-v-46a472ab`]]),_hoisted_1$79={class:`livery-manager-view`,"bng-ui-scope":`livery-manager-scope`},_hoisted_2$67={class:`header`},_hoisted_3$58={class:`main-view-content`},_hoisted_4$45={key:1,class:`empty-save-container`},_hoisted_5$37={class:`empty-save-message`},_hoisted_6$28={key:1,class:`menu-container`},_sfc_main$87={__name:`LiveryManager`,setup(__props){let store$1=useLiveryFileStore(),mainStore=useLiveryMainStore(),headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker();useUINavScope(`livery-manager-scope`);let{files}=storeToRefs(store$1),selectedSave=ref(null),screenState=reactive({isOpenLiveries:!1}),MENU_ITEMS$4=[{label:`New Livery`,value:`new`,icon:icons.plus,action:onCreateNew},{label:`Open Liveries`,value:`load`,icon:icons.decal,action:onOpenLiveries}];watch(()=>files.value,()=>selectedSave.value=null,{deep:!0}),onBeforeMount(()=>{store$1.init()}),onMounted(()=>{headerStore.setHeader(`Livery Editor`),headerStore.setPreheader(null),uiNavBlocker.blockOnly([`tab_l`,`tab_r`]),infobar.visible=!0}),onUnmounted(()=>{uiNavBlocker.clear()});function onCreateNew(){mainStore.isSetupDone=!1,window.bngVue.gotoGameState(`LiveryMain`)}function onOpenLiveries(){screenState.isOpenLiveries=!0,headerStore.setPreheader(`Liveries`)}function goBack(event){screenState.isOpenLiveries?(screenState.isOpenLiveries=!1,selectedSave.value=null):window.bngVue.gotoGameState(`garagemode`),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$79,[createBaseVNode(`div`,_hoisted_2$67,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$58,[screenState.isOpenLiveries?(openBlock(),createElementBlock(Fragment,{key:0},[unref(files)&&unref(files).length>0?withDirectives((openBlock(),createBlock(unref(bngList_default),{key:0,layout:unref(LIST_LAYOUTS).LIST,"target-width":14,"target-height":6,"target-margin":.25,big:!0,class:`files-list`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(files),(file$1,index)=>withDirectives((openBlock(),createBlock(FileListItem_default,mergeProps({ref_for:!0},file$1,{key:file$1.name,selected:selectedSave.value===index,onFocus:$event=>selectedSave.value=index,onClick:$event=>selectedSave.value=index}),null,16,[`selected`,`onFocus`,`onClick`])),[[unref(BngFocusIf_default),selectedSave.value===null&&index===0]])),128))]),_:1},8,[`layout`])),[[unref(BngBlur_default)]]):(openBlock(),createElementBlock(`div`,_hoisted_4$45,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_5$37,[..._cache[0]||=[createTextVNode(`No saved liveries`,-1)]])),[[unref(BngBlur_default)]])]))],64)):(openBlock(),createElementBlock(`div`,_hoisted_6$28,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$4,(item,index)=>withDirectives(createVNode(unref(bngImageTile_default),{key:item.value,label:item.label,icon:item.icon,onClick:item.action},null,8,[`label`,`icon`,`onClick`]),[[unref(BngUiNavFocus_default),MENU_ITEMS$4.length-index],[unref(BngBlur_default)]])),64))]))])])),[[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryManager_default=__plugin_vue_export_helper_default(_sfc_main$87,[[`__scopeId`,`data-v-8e7dbe60`]]),_hoisted_1$78={class:`material-settings-content`},_hoisted_2$66={class:`color-values-container`,"bng-no-child-nav":``},_sfc_main$86={__name:`MaterialSettings`,props:{initialColor:Array},emits:[`change`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,paint=new Paint,color=ref({hue:.5,saturation:1,luminosity:.5}),inputHue=computed({get:()=>color.value.hue.toFixed(3),set:newValue=>{color.value.hue=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),inputSat=computed({get:()=>color.value.saturation.toFixed(3),set:newValue=>{color.value.saturation=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),inputLum=computed({get:()=>color.value.luminosity.toFixed(3),set:newValue=>{color.value.luminosity=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),isPreciseActive=ref(!1),colorPickerStep=computed(()=>isPreciseActive.value?.001:.01);watch(()=>props.initialColor,()=>{props.initialColor&&(paint.rgba=props.initialColor,color.value.hue=paint.hsl[0],color.value.saturation=paint.hsl[1],color.value.luminosity=paint.hsl[2])},{deep:!0,immediate:!0});function notifyListeners(){let hsl=[color.value.hue,color.value.saturation,color.value.luminosity];paint.hsl=hsl,emit$1(`change`,{colorHsl:hsl,colorRgb:paint.rgb})}function handleAction2(element){isPreciseActive.value=element.detail.value===1}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(LayerSettingsBase_default),{class:`material-settings`},{heading:withCtx(()=>[..._cache[4]||=[createTextVNode(`Color`,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$78,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,step:colorPickerStep.value,onChange:notifyListeners},null,8,[`modelValue`,`step`]),createBaseVNode(`div`,_hoisted_2$66,[createVNode(unref(bngInput_default),{prefix:`h`,modelValue:inputHue.value,"onUpdate:modelValue":_cache[1]||=$event=>inputHue.value=$event},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`s`,modelValue:inputSat.value,"onUpdate:modelValue":_cache[2]||=$event=>inputSat.value=$event},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`b`,modelValue:inputLum.value,"onUpdate:modelValue":_cache[3]||=$event=>inputLum.value=$event},null,8,[`modelValue`])])])]),_:1})),[[unref(BngUiNavLabel_default),`[Hold] Precise`,`action_2`],[unref(BngOnUiNav_default),handleAction2,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handleAction2,`action_2`,{down:!0}]])}},MaterialSettings_default=__plugin_vue_export_helper_default(_sfc_main$86,[[`__scopeId`,`data-v-45b64f6e`]]),_hoisted_1$77={class:`paint-main-view`,"bng-ui-scope":`paint-main-scope`},_hoisted_2$65={class:`header`},_hoisted_3$57={class:`paint-content-container`},_hoisted_4$44={class:`paint-content`},_sfc_main$85={__name:`LiveryPaintMain`,setup(__props){let store$1=useLiveryMainStore(),headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`paint-main-scope`);let initialColor=ref(null),blockedEvents$1=[`tab_r`,`tab_l`];onMounted(()=>{headerStore.setPreheader([`Paint`]),store$1.setup(),infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(blockedEvents$1),events$3.on(`liveryEditor_fill_layerData`,onLayerData),Lua_default.extensions.ui_liveryEditor_layers_fill.requestLayerData()}),onUnmounted(()=>{uiNavBlocker.clear(),events$3.off(`liveryEditor_fill_layerData`)});function onLayerData(data){console.log(`layer data changed`,data),initialColor.value=data.color}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layers_fill.saveChanges().then(()=>{window.bngVue.gotoGameState(`LiveryMain`)})}function restoreDefault(){Lua_default.extensions.ui_liveryEditor_layers_fill.restoreDefault()}function cancelChanges(){openConfirmation(`Undo Changes`,`Lose unsaved changes?`).then(res=>{res&&(Lua_default.extensions.ui_liveryEditor_layers_fill.restoreLayer(),window.bngVue.gotoGameState(`LiveryMain`))})}function onMaterialValueChanged(data){Lua_default.extensions.ui_liveryEditor_layers_fill.updateLayer({color:data.colorRgb})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$77,[createBaseVNode(`div`,_hoisted_2$65,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$57,[createBaseVNode(`div`,_hoisted_4$44,[withDirectives(createVNode(MaterialSettings_default,{"initial-color":initialColor.value,onChange:onMaterialValueChanged},null,8,[`initial-color`]),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:saveChanges},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{controller:``,"ui-event":`context`}),_cache[0]||=createBaseVNode(`span`,null,`Apply`,-1)]),_:1})),[[unref(BngOnUiNav_default),void 0,`context`,{asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`secondary`,onClick:restoreDefault},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{controller:``,"ui-event":`action_3`}),_cache[1]||=createBaseVNode(`span`,null,`Restore Default`,-1)]),_:1})),[[unref(BngOnUiNav_default),void 0,`action_3`,{asMouse:!0}]])])])])),[[unref(BngOnUiNav_default),cancelChanges,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryPaintMain_default=__plugin_vue_export_helper_default(_sfc_main$85,[[`__scopeId`,`data-v-74e232cb`]]),_hoisted_1$76={class:`layer-inspector-base`},_hoisted_2$64={class:`inspector-heading`},_hoisted_3$56={class:`inspector-content`},_sfc_main$84={__name:`LayerInspectorBase`,props:{heading:{type:String}},setup(__props){return useSlots(),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$76,[createBaseVNode(`div`,_hoisted_2$64,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`heading`,{},()=>[createBaseVNode(`span`,null,toDisplayString(__props.heading),1)],!0)]),_:3})]),createBaseVNode(`div`,_hoisted_3$56,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},LayerInspectorBase_default=__plugin_vue_export_helper_default(_sfc_main$84,[[`__scopeId`,`data-v-c60f30a4`]]),_hoisted_1$75={class:`direction-buttons-row`},_hoisted_2$63={class:`icon-binding-wrapper`},_hoisted_3$55={class:`icon-binding-wrapper`},_hoisted_4$43={class:`direction-buttons-row`},_hoisted_5$36={class:`icon-binding-wrapper`},_hoisted_6$27={class:`stacked-arrows`},_hoisted_7$24={class:`icon-binding-wrapper`},_hoisted_8$19={class:`stacked-arrows`},_hoisted_9$17={class:`dropdown-container`},_sfc_main$83={__name:`LayerOrder`,setup(__props){let ORDER_TOOL$1=Lua_default.extensions.ui_liveryEditor_tools_group,store$1=useLiveryEditorStore(),_order=ref(2),order=computed({get:()=>_order.value,set(newValue){_order.value=newValue,ORDER_TOOL$1.setOrder(newValue)}});computed(()=>store$1.selectedLayers[0].siblingCount);let orderOptions=computed(()=>Array.from({length:store$1.layers.length-1},(_,i)=>({label:`${i+1}`,value:i+2})));onMounted(()=>{store$1.selectedLayers&&store$1.selectedLayers.length>0&&(_order.value=store$1.selectedLayers[0].order)});let moveUp=()=>{ORDER_TOOL$1.moveOrderUp().then(value=>_order.value=value)},moveDown=()=>{ORDER_TOOL$1.moveOrderDown().then(value=>_order.value=value)},moveToTop=()=>{ORDER_TOOL$1.changeOrderToTop().then(value=>_order.value=value)},moveToBottom=()=>{ORDER_TOOL$1.changeOrderToBottom().then(value=>_order.value=value)};return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Order`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$75,[withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move Up`,onClick:moveUp},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$63,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])])]),_:1})),[[unref(BngOnUiNav_default),moveUp,`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move Down`,onClick:moveDown},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$55,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown},null,8,[`type`])])]),_:1})),[[unref(BngOnUiNav_default),moveDown,`ok`,{focusRequired:!0}]])]),createBaseVNode(`div`,_hoisted_4$43,[withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move to Top`,onClick:moveToTop},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$36,[createBaseVNode(`div`,_hoisted_6$27,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])])])]),_:1})),[[unref(BngOnUiNav_default),moveToTop,`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move to Bottom`,onClick:moveToBottom},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$24,[createBaseVNode(`div`,_hoisted_8$19,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`])])])]),_:1})),[[unref(BngOnUiNav_default),moveToBottom,`ok`,{focusRequired:!0}]])]),createBaseVNode(`div`,_hoisted_9$17,[createVNode(unref(bngDropdown_default),{modelValue:order.value,"onUpdate:modelValue":_cache[0]||=$event=>order.value=$event,items:orderOptions.value},null,8,[`modelValue`,`items`])])]),_:1})),[[unref(BngBlur_default)]])}},LayerOrder_default=__plugin_vue_export_helper_default(_sfc_main$83,[[`__scopeId`,`data-v-d8fda3d9`]]),_hoisted_1$74={class:`decals-main-view`,"bng-ui-scope":`decals-main-scope`},_hoisted_2$62={class:`header`},_hoisted_3$54={class:`main-view-content`},_hoisted_4$42={class:`add-content-wrapper`},_hoisted_5$35={class:`action-tile`},_hoisted_6$26={key:1,class:`popup-settings`},CAMERA_BUTTONS$1=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],BLOCKED_UINAV_EVENTS$1=[`tab_l`,`tab_r`],SHOW_HIDE_DECAL_EVENT=`action_2`,_sfc_main$82={__name:`LiveryDecalsMain`,setup(__props){let ACTION_ITEM_ICON={requestReproject:icons.view,transform:icons.transform,materials:icons.colorPalette,highlight:icons.lightGarageG11,requestMirror:icons.reflect,order:icons.sortAscDown,enabled:icons.eyeOutlineOpened,"enabled-off":icons.eyeOutlineClosed,delete:icons.trashBin1,duplicate:icons.copy},layerActionsState=reactive({mirrored:!1,mirrorFlipped:!1,highlight:!0,enabled:!0}),MIRROR_ITEMS=[{label:`Mirror`,value:`mirror`,isSwitch:!0,switchValue:toRef(layerActionsState,`mirrored`)},{label:`Flip Mirrored`,value:`flipMirrored`,isSwitch:!0,switchValue:toRef(layerActionsState,`mirrorFlipped`),disabled:computed(()=>!layerActionsState.mirrored)}],headerStore=useEditorHeaderStore(),infobar=useInfoBar();useUINavScope(`decals-main-scope`);let uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge(),layers$1=ref([]),selectedLayers=ref([]),layerActions=ref([]),allowActionsDrawerShow=ref(!0),actionDrawer=ref(null),currentActionDrawerLevel=ref(null),popupSettings=ref(null),isReprojectActive=ref(!1),focusedLayer=ref(null),selectedLayerKeys=computed(()=>selectedLayers.value?selectedLayers.value.map(x=>x.uid):null),actionsDrawerData=computed(()=>{let layerName=selectedLayers.value&&selectedLayers.value.length>0?selectedLayers.value[0].name:null;return layerActions.value&&layerActions.value.length>0?{label:layerName,items:layerActions.value,allowOpenDrawer:!1}:void 0}),contextUIEventLabel=computed(()=>isReprojectActive.value?`Reproject`:`Add Decal`),action2UIEventLabel=computed(()=>focusedLayer.value||selectedLayers.value&&selectedLayers.value.length>0?`Enable/Disable Decal`:void 0);watchEffect(()=>{let eventsToBlock=[...BLOCKED_UINAV_EVENTS$1];uiNavBlocker.clear(),(isReprojectActive.value||!focusedLayer.value&&(!selectedLayers.value||selectedLayers.value.length===0))&&eventsToBlock.push(SHOW_HIDE_DECAL_EVENT),uiNavBlocker.blockOnly(eventsToBlock)}),onBeforeMount(()=>{headerStore.setPreheader([`Decals`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_OnLayersUpdated`,onLayersUpdated),events$3.on(`liveryEditor_selection_actionsUpdated`,onActionsUpdated),events$3.on(`liveryEditor_selection_selectedChanged`,onSelectedChanged),Lua_default.extensions.ui_liveryEditor_layers.requestInitialData(),Lua_default.extensions.ui_liveryEditor_selection.requestInitialData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_OnLayersUpdated`,onLayersUpdated),events$3.off(`liveryEditor_selection_actionsUpdated`,onActionsUpdated),events$3.off(`liveryEditor_selection_selectedChanged`,onSelectedChanged)});function onBack(event){popupSettings.value?(popupSettings.value=null,allowActionsDrawerShow.value=!0):actionsDrawerData.value?handleDrawerBack():window.bngVue.gotoGameState(`LiveryMain`),event.stopPropagation()}function addDecal(){window.bngVue.gotoGameState(`LiveryDecalSelector`)}let isReproject;async function onActionSwitchClicked(item){item.switchValue=await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(item.value)}async function onActionTriggered(item){if(!item.value){currentActionDrawerLevel.value===`requestReproject`&&!isReproject&&await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`cancelReproject`),isReprojectActive.value=!1,isReproject=!1,currentActionDrawerLevel.value=null;return}if((item.lazyLoadItems||item.items)&&(currentActionDrawerLevel.value=item.value),item.value===`requestReproject`){if(!item.items){let timeoutid=setTimeout(()=>{item.items=CAMERA_BUTTONS$1,clearTimeout(timeoutid)},500)}isReprojectActive.value=!0}else if(item.value===`requestMirror`){item.items=MIRROR_ITEMS;return}else if(item.value===`order`){allowActionsDrawerShow.value=!1,popupSettings.value=markRaw(LayerOrder_default);return}else if(CAMERA_BUTTONS$1.find(x=>x.value===item.value)){await Lua_default.extensions.ui_liveryEditor_camera.setOrthographicView(item.value);return}await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(item.value)}function onLayersUpdated(data){layers$1.value=data}function onActionsUpdated(data){if(layerActions.value=data,data&&Array.isArray(data)&&data.length>0){let highlightAction=layerActions.value.find(x=>x.value===`highlight`);highlightAction.switchValue=toRef(layerActionsState,`highlight`)}}function onSelectedChanged(data){if(selectedLayers.value=data,data&&Array.isArray(data)&&data.length>0){let first=data[0];layerActionsState.highlight=first.highlighted,layerActionsState.mirrored=first.mirrored,layerActionsState.mirrorFlipped=first.mirrorFlipped}}let closeActionDrawer=()=>{currentActionDrawerLevel.value&¤tActionDrawerLevel.value===`requestReproject`&&(Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`cancelReproject`).then(()=>{}),currentActionDrawerLevel.value=null),Lua_default.extensions.ui_liveryEditor_selection.clearSelection()};function handleDrawerBack(){currentActionDrawerLevel.value?actionDrawer.value.goBack():closeActionDrawer()}function onFocusedLayer(layer){focusedLayer.value=layer}let toggleEnabled=()=>{if(focusedLayer.value)Lua_default.extensions.ui_liveryEditor_layerAction.toggleEnabledByLayerUid(focusedLayer.value.uid);else if(selectedLayers.value&&selectedLayers.value.length>0){let layer=selectedLayers.value[0];Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`enabled`).then(luaRes=>{layer.enabled=luaRes})}},handleContext=()=>{isReprojectActive.value?Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`reproject`).then(()=>{isReproject=!0,isReprojectActive.value=!1,actionDrawer.value.goBack()}):popupSettings.value||addDecal()},handleAction2=()=>{if(isReprojectActive.value)return!1;toggleEnabled()};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$74,[createBaseVNode(`div`,_hoisted_2$62,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$54,[withDirectives((openBlock(),createBlock(unref(LayersManager_default),{selectedKeys:selectedLayerKeys.value,"onUpdate:selectedKeys":_cache[0]||=$event=>selectedLayerKeys.value=$event,layers:layers$1.value,class:`layers-manager`,onFocusedLayer},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Layers`,-1)]]),_:1}),withDirectives((openBlock(),createBlock(unref(bngButton_default),{"bng-no-nav":`true`,accent:unref(ACCENTS).outlined,onClick:addDecal},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$42,[createVNode(unref(bngBinding_default),{trackIgnore:!0,uiEvent:`context`,deviceMask:`xinput`}),_cache[2]||=createBaseVNode(`span`,{class:`add-label`},`Add Decal`,-1)])]),_:1},8,[`accent`])),[[unref(BngDisabled_default),isReprojectActive.value]])]),_:1},8,[`selectedKeys`,`layers`])),[[unref(BngBlur_default)]]),actionsDrawerData.value&&allowActionsDrawerShow.value?(openBlock(),createBlock(unref(bngActionDrawer_default),{key:0,ref_key:`actionDrawer`,ref:actionDrawer,blur:``,alwaysShowBack:!1,actions:actionsDrawerData.value,"item-width":10,"item-margin":1,class:`actions-drawer`,onSelect:onActionTriggered},{controls:withCtx(()=>[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).exit,onClick:closeActionDrawer},null,8,[`accent`,`icon`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),action:withCtx(({item,select,order})=>[createBaseVNode(`div`,_hoisted_5$35,[item.isSwitch?withDirectives((openBlock(),createBlock(unref(bngTile_default),{key:0,"bng-nav-item":``,label:item.label,onClick:$event=>onActionSwitchClicked(item)},{default:withCtx(()=>[createVNode(unref(bngSwitch_default),{modelValue:item.switchValue,"onUpdate:modelValue":$event=>item.switchValue=$event},null,8,[`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`label`,`onClick`])),[[unref(BngUiNavFocus_default),order===0?0:void 0],[unref(BngFocusIf_default),order===0],[unref(BngDisabled_default),item.disabled],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):withDirectives((openBlock(),createBlock(unref(bngImageTile_default),{key:1,"bng-nav-item":``,label:item.label,icon:item.icon?item.icon:ACTION_ITEM_ICON[item.value],class:`action-tile`,onClick:$event=>select(item)},null,8,[`label`,`icon`,`onClick`])),[[unref(BngUiNavFocus_default),order===0?0:void 0],[unref(BngFocusIf_default),order===0],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])]),_:1},8,[`actions`])):createCommentVNode(``,!0),popupSettings.value?(openBlock(),createElementBlock(`div`,_hoisted_6$26,[(openBlock(),createBlock(resolveDynamicComponent(popupSettings.value)))])):createCommentVNode(``,!0)])])),[[unref(BngUiNavLabel_default),contextUIEventLabel.value,`context`],[unref(BngUiNavLabel_default),action2UIEventLabel.value,`action_2`],[unref(BngUiNavLabel_default),`Back`,`menu,back`],[unref(BngOnUiNav_default),onBack,`menu,back`],[unref(BngOnUiNav_default),handleContext,`context`],[unref(BngOnUiNav_default),handleAction2,`action_2`]])}},LiveryDecalsMain_default=__plugin_vue_export_helper_default(_sfc_main$82,[[`__scopeId`,`data-v-b9d45c3c`]]),_hoisted_1$73={class:`decal-selector-view`,"bng-ui-scope":`decal-selector-scope`},_hoisted_2$61={class:`header`},_hoisted_3$53={class:`main-view-content`},_hoisted_4$41={key:0,class:`side-menu`},_hoisted_5$34={class:`list-container`},BLOCKED_UINAV_EVENTS=[`tab_l`,`tab_r`],_sfc_main$81={__name:`LiveryDecalSelector`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`decal-selector-scope`);let categorizedTextures=ref([]),selectedCategory=ref(null),textures=computed(()=>{if(categorizedTextures.value&&categorizedTextures.value.length>0&&selectedCategory.value){let cat=categorizedTextures.value.find(x=>x.value===selectedCategory.value);if(cat)return cat.items}return null});async function select(item){let layer=await Lua_default.extensions.ui_liveryEditor_layers_decal.addLayerCentered({texturePath:item.preview});await Lua_default.extensions.ui_liveryEditor_selection.select(layer.uid,!0),window.bngVue.gotoGameState(`LiveryDecals`)}function goBack(event){window.bngVue.gotoGameState(`LiveryDecals`),event.stopPropagation()}function onData(data){categorizedTextures.value=data,!data||data.length===0?selectedCategory.value=null:selectedCategory.value||=data[0].value}return onBeforeMount(()=>{headerStore.setPreheader([`Decals`,`Textures`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,Lua_default.extensions.ui_liveryEditor_resources.requestData(),events$3.on(`liveryEditor_resources_data`,onData),uiNavBlocker.blockOnly(BLOCKED_UINAV_EVENTS)}),onBeforeMount(()=>{events$3.off(`liveryEditor_resources_data`,onData),uiNavBlocker.clear()}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$73,[createBaseVNode(`div`,_hoisted_2$61,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$53,[categorizedTextures.value?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$41,[(openBlock(!0),createElementBlock(Fragment,null,renderList(categorizedTextures.value,category=>(openBlock(),createBlock(unref(bngButton_default),{key:category.value,label:category.label,accent:`text`,onClick:$event=>selectedCategory.value=category.value},null,8,[`label`,`onClick`]))),128))])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_5$34,[textures.value?withDirectives((openBlock(),createBlock(unref(bngList_default),{key:0,layout:unref(LIST_LAYOUTS).TILES,"target-width":8,"target-height":8,"target-margin":.25,big:!0,class:`textures-list`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(textures.value,(item,index)=>withDirectives((openBlock(),createBlock(DecalSelectorItem_default,{"bng-nav-item":``,key:item.preview,externalImage:item.preview,"data-decal-item":index,onClick:$event=>select(item)},null,8,[`externalImage`,`data-decal-item`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),index===0?0:void 0],[unref(BngFocusIf_default),index===0]])),128))]),_:1},8,[`layout`])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0)])])])),[[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryDecalSelector_default=__plugin_vue_export_helper_default(_sfc_main$81,[[`__scopeId`,`data-v-fc11228e`]]),_hoisted_1$72={class:`layer-edit-view`,"bng-ui-scope":`layer-edit-scope`},_hoisted_2$60={class:`header`},_hoisted_3$52={class:`main-view-content`},_hoisted_4$40={class:`menu-container`},MENU_ITEMS$1=[{label:`Projection`,value:`projection`,icon:icons.decal},{label:`Transform`,value:`transform`,icon:icons.colorPalette},{label:`Materials`,value:`materials`,icon:icons.decal}],noop=()=>{},_sfc_main$80={__name:`LiveryLayerEdit`,setup(__props){useEditorHeaderStore(),useDecalSelectorStore();let mainStore=useLiveryMainStore(),infobar=useInfoBar();useUINavScope(`layer-edit-scope`);function onMenuItemClicked(item){switch(item.value){case`transform`:router_default.push({name:`LayerTransform`});break;case`materials`:router_default.push({name:`LayerMaterials`});break;case`projection`:router_default.push({name:`LayerProjection`});break}}function goBack(){router_default.replace({name:`LiveryDecals`}),mainStore.exitLayerEdit()}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!0).then(()=>goBack())}onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS)}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,await mainStore.setupLayerEdit(),await Lua_default.extensions.ui_liveryEditor_layerEdit.showCursorOrLayer(!0)}),onBeforeUnmount(async()=>{await Lua_default.extensions.ui_liveryEditor_layerEdit.showCursorOrLayer(!1)});let NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`ok`},label:`Done`},action:saveChanges},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$72,[createBaseVNode(`div`,_hoisted_2$60,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$52,[createBaseVNode(`div`,_hoisted_4$40,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$1,item=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,class:`menu-item`,onClick:$event=>onMenuItemClicked(item)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)]])),64))])])])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),saveChanges,`menu`],[unref(BngOnUiNav_default),noop,`rotate_h_cam`],[unref(BngOnUiNav_default),noop,`rotate_v_cam`]])}},LiveryLayerEdit_default=__plugin_vue_export_helper_default(_sfc_main$80,[[`__scopeId`,`data-v-c339e1a6`]]),_hoisted_1$71={class:`camera-settings-view`,"bng-ui-scope":`camera-settings-scope`},_hoisted_2$59={class:`header`},_hoisted_3$51={class:`main-view-content`},_hoisted_4$39={class:`menu-container`},MENU_ITEMS=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$79={__name:`LiveryCameraSettings`,setup(__props){let CAMERA_LUA$1=Lua_default.extensions.ui_liveryEditor_camera,headerStore=useEditorHeaderStore();useDecalSelectorStore();let infobar=useInfoBar();useUINavScope(`camera-settings-scope`);function onMenuItemClicked(item){CAMERA_LUA$1.setOrthographicView(item.value)}function goBack(){router_default.replace({name:`LiveryDecals`})}function done(){router_default.replace({name:`LiveryDecalSelector`})}onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setPreheader([`Select Camera`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0});let NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`}},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$71,[createBaseVNode(`div`,_hoisted_2$59,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$51,[createBaseVNode(`div`,_hoisted_4$39,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS,item=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,onClick:$event=>onMenuItemClicked(item)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)]])),64))])])])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),done,`menu`]])}},LiveryCameraSettings_default=__plugin_vue_export_helper_default(_sfc_main$79,[[`__scopeId`,`data-v-376ce11c`]]),_hoisted_1$70={class:`layer-transform-view`,"bng-ui-scope":`layer-transform-scope`},_hoisted_2$58={class:`header`},_hoisted_3$50={class:`main-view-content`},_hoisted_4$38={class:`inspector-container`},_hoisted_5$33={class:`transform-setting-item`},_hoisted_6$25={key:0},_hoisted_7$23={key:1,class:`transform-setting-inputs`},_hoisted_8$18={class:`slider-text-container`},_hoisted_9$16={class:`slider-text-container`},_hoisted_10$12={key:2,class:`display-values-container`},_hoisted_11$10={key:1,class:`transform-setting-item`},_hoisted_12$7={key:0,class:`transform-setting-inputs`},_hoisted_13$7={class:`slider-text-container`},_hoisted_14$7={class:`slider-text-container`},_hoisted_15$7={key:1,class:`display-values-container`},_hoisted_16$7={key:3,class:`transform-setting-item`},_hoisted_17$6={key:0,class:`transform-setting-inputs`},_hoisted_18$5={class:`slider-text-container`},_hoisted_19$3={key:1,class:`display-values-container`},_hoisted_20$3={key:5,class:`transform-setting-item`},_hoisted_21$3={key:0,class:`transform-setting-inputs`},_hoisted_22$3={class:`slider-text-container`},_hoisted_23$3={class:`slider-text-container`},_hoisted_24$2={key:1,class:`display-values-container`},_hoisted_25$1={class:`edit-button-label`},INPUT_MIN=0,INPUT_MAX=1,_sfc_main$78={__name:`LayerTransform`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),navBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`layer-transform-scope`);let transformState=reactive({positionX:0,positionY:0,scaleX:0,scaleY:0,skewX:0,skewY:0,rotation:0}),isHoldModifier=ref(!1),isPreciseActive=ref(!1),isTabRightActive=ref(!1),stateData=ref(null),isEdit=ref(!1),isReapplying=ref(!1),isRepositionActive=ref(!1),isUseMouse=ref(!1),positionX=computed({get:()=>transformState.positionX,set:newValue=>{let value=assertInt(newValue);transformState.positionX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setPosition(value,transformState.positionY)}}),positionY=computed({get:()=>transformState.positionY,set:newValue=>{let value=assertInt(newValue);transformState.positionY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setPosition(transformState.positionX,value)}}),scaleX=computed({get:()=>transformState.scaleX,set:newValue=>{let value=assertInt(newValue);transformState.scaleX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setScale(value,transformState.scaleY)}}),scaleY=computed({get:()=>transformState.scaleY,set:newValue=>{let value=assertInt(newValue);transformState.scaleY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setScale(transformState.scaleX,value)}}),skewX=computed({get:()=>transformState.skewX,set:newValue=>{let value=assertInt(newValue);transformState.skewX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setSkew(value,transformState.skewY)}}),skewY=computed({get:()=>transformState.skewY,set:newValue=>{let value=assertInt(newValue);transformState.skewY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setSkew(transformState.skewX,value)}}),rotation=computed({get:()=>transformState.rotation,set:newValue=>{let value=assertInt(newValue);transformState.rotation=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setRotation(value)}}),hintLabels=computed(()=>{let labels={},focusLabel=`Move`,focusEvents=[`focus_l`,`focus_u`,`focus_r`,`focus_d`,`focus_lr`,`focus_ud`],rotateCamLabel=`Scale`;return isTabRightActive.value?rotateCamLabel=`Pan`:isHoldModifier.value&&(rotateCamLabel=`Skew`),!isTabRightActive.value&&!isHoldModifier.value&&focusEvents.forEach(uiEvent=>labels[uiEvent]=`Move`),[`rotate_h_cam`,`rotate_v_cam`].forEach(uiEvent=>labels[uiEvent]=rotateCamLabel),labels.tab_l=isTabRightActive.value?void 0:`[Hold] Skew`,labels.tab_r=isHoldModifier.value?void 0:`[Hold] Camera`,labels.action_2=isTabRightActive.value?void 0:`[Hold] Precise`,labels});watchEffect(()=>{navBlocker.clear(),isTabRightActive.value&&navBlocker.allowOnly([`rotate_h_cam`,`rotate_v_cam`,`tab_r`]),isHoldModifier.value&&navBlocker.allowOnly([`rotate_h_cam`,`rotate_v_cam`,`action_2`,`tab_l`])}),onBeforeMount(()=>{headerStore.setPreheader([`Transform`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),events$3.on(`liveryEditor_layerEdit_repositionSuccess`,onRepositionSuccess),events$3.on(`liveryEditor_layerEdit_rotationChanged`,onRotationChanged),events$3.on(`liveryEditor_layerEdit_positionChanged`,onPositionChanged),events$3.on(`liveryEditor_layerEdit_scaleChanged`,onScaleChanged),events$3.on(`liveryEditor_layerEdit_skewChanged`,onSkewChanged),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestInitialLayerData()}),onBeforeUnmount(async()=>{events$3.off(`liveryEditor_layerEdit_state`,onStateData),events$3.off(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),events$3.off(`liveryEditor_layerEdit_repositionSuccess`,onRepositionSuccess),events$3.off(`liveryEditor_layerEdit_rotationChanged`,onRotationChanged),events$3.off(`liveryEditor_layerEdit_positionChanged`,onPositionChanged),events$3.off(`liveryEditor_layerEdit_scaleChanged`,onScaleChanged),events$3.off(`liveryEditor_layerEdit_skewChanged`,onSkewChanged)});function onPositionChanged(position){positionX.value=position.x,positionY.value=position.y}function onRotationChanged(value){transformState.rotation=value}function onSkewChanged(skew){skewX.value=skew.x,skewY.value=skew.y}function onScaleChanged(scale){scaleX.value=scale.x,scaleY.value=scale.y}function onRepositionSuccess(){isRepositionActive.value=!isRepositionActive.value}function handleModifier(element){isHoldModifier.value=element.detail.value===1}function handlePrecise(element){let isPrecise=element.detail.value===1;isPreciseActive.value=isPrecise,Lua_default.extensions.ui_liveryEditor_layerEdit.holdPrecise(isPrecise)}function handleTabRight(element){isTabRightActive.value=element.detail.value===1}function handleAction3(element){isRepositionActive.value?toggleUseMouseOrCursor(element):toggleReposition(element)}function toggleReposition(element){let isReposition=isRepositionActive.value;isReposition?Lua_default.extensions.ui_liveryEditor_layerEdit.cancelReposition():Lua_default.extensions.ui_liveryEditor_layerEdit.requestReposition(),isRepositionActive.value=!isReposition}function toggleUseMouseOrCursor(element){if(!isRepositionActive.value)return!0;Lua_default.extensions.ui_liveryEditor_layerEdit.toggleUseMouseOrCursor().then(data=>{isUseMouse.value=data.isUseMouse})}function toggleEdit(element){if(isRepositionActive.value&&isUseMouse.value)return;let newValue=!isEdit.value;isEdit.value=newValue,Lua_default.extensions.ui_liveryEditor_layerEdit.setAllowRotationAction(!newValue).then(()=>{})}function handleFocusLinear(element){if(isEdit.value)return;let name=element.detail.name,value=element.detail.value,axis=name===`focus_d`||name===`focus_u`?`y`:`x`,direction$1=name===`focus_d`||name===`focus_l`?-1:1;Lua_default.extensions.ui_liveryEditor_layerEdit.holdTranslate(axis,direction$1*value)}function handleTranslateScalar(element){if(isEdit.value)return!0;let name=element.detail.name,value=element.detail.value,axis=name===`focus_lr`?`x`:`y`;Lua_default.extensions.ui_liveryEditor_layerEdit.holdTranslateScalar(axis,value)}function handleRotateCam(element){if(isRepositionActive.value||isTabRightActive.value)return!0;let name=element.detail.name,value=element.detail.value,axis=name===`rotate_h_cam`?`x`:`y`;isHoldModifier.value?Lua_default.extensions.ui_liveryEditor_layerEdit.holdSkew(axis,value):Lua_default.extensions.ui_liveryEditor_layerEdit.holdScale(axis,value)}function goBack(event){isRepositionActive.value?toggleReposition():isEdit.value?toggleEdit():openConfirmation(`Exit`,`Exit and lose unsaved changes?`).then(res=>{res&&(Lua_default.extensions.ui_liveryEditor_layerEdit.endTransform(),Lua_default.extensions.ui_liveryEditor_layerEdit.cancelChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}))}),event.stopPropagation()}function handleOk(){isRepositionActive.value?Lua_default.extensions.ui_liveryEditor_layerEdit.applyReposition():(Lua_default.extensions.ui_liveryEditor_layerEdit.endTransform(),Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!1).then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}))}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!1).then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)})}function onStateData(data){stateData.value=data,isReapplying.value=data.isStampReapplying}function onInitialLayerData(data){positionX.value=data.position.x,positionY.value=data.position.y,scaleX.value=data.scale.x,scaleY.value=data.scale.y,skewX.value=data.skew.x,skewY.value=data.skew.y,rotation.value=data.rotation}function assertInt(value){return typeof value==`string`?+value:value}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$70,[createBaseVNode(`div`,_hoisted_2$58,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$50,[createBaseVNode(`div`,_hoisted_4$38,[withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Transform`},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`transform-inspector`,{"inspector-editing":isEdit.value}])},[createBaseVNode(`div`,_hoisted_5$33,[_cache[17]||=createBaseVNode(`div`,{class:`setting-item-name`},`Position`,-1),isRepositionActive.value&&isUseMouse.value?(openBlock(),createElementBlock(`div`,_hoisted_6$25,[..._cache[15]||=[createBaseVNode(`span`,null,`Using mouse position`,-1)]])):isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_7$23,[createBaseVNode(`div`,_hoisted_8$18,[createVNode(unref(bngInput_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[0]||=$event=>positionX.value=$event,type:`number`,step:.001,min:INPUT_MIN,max:1,prefix:`X`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[1]||=$event=>positionX.value=$event,step:.001,min:INPUT_MIN,max:1},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_9$16,[createVNode(unref(bngInput_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[2]||=$event=>positionY.value=$event,type:`number`,step:.001,min:INPUT_MIN,max:1,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[3]||=$event=>positionY.value=$event,step:.001,min:INPUT_MIN,max:1},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_10$12,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:positionX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:positionY.value},null,8,[`valueLabel`])])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:3,accent:`outlined`,class:`reposition-button`,onClick:toggleReposition},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`action_3`}),_cache[16]||=createBaseVNode(`span`,{class:`reposition-button-label`},`Reproject and Position`,-1)]),_:1}))]),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:0})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_11$10,[_cache[18]||=createBaseVNode(`div`,{class:`setting-item-name`},`Scale`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_12$7,[createBaseVNode(`div`,_hoisted_13$7,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[4]||=$event=>scaleX.value=$event,type:`number`,prefix:`X`,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[5]||=$event=>scaleX.value=$event,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_14$7,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[6]||=$event=>scaleY.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:15,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[7]||=$event=>scaleY.value=$event,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_15$7,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:scaleX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:scaleY.value},null,8,[`valueLabel`])]))])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:2})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_16$7,[_cache[19]||=createBaseVNode(`div`,{class:`setting-item-name`},`Rotate`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_17$6,[createBaseVNode(`div`,_hoisted_18$5,[createVNode(unref(bngInput_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[8]||=$event=>rotation.value=$event,type:`number`,step:.1,min:INPUT_MIN,max:359.9,suffix:`deg`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[9]||=$event=>rotation.value=$event,step:.1,min:INPUT_MIN,max:359.9},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_19$3,[createVNode(unref(bngPropVal_default),{keyLabel:`deg`,valueLabel:rotation.value},null,8,[`valueLabel`])]))])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:4})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_20$3,[_cache[20]||=createBaseVNode(`div`,{class:`setting-item-name`},`Skew`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_21$3,[createBaseVNode(`div`,_hoisted_22$3,[createVNode(unref(bngInput_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[10]||=$event=>skewX.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:INPUT_MAX,prefix:`X`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[11]||=$event=>skewX.value=$event,step:.01,min:INPUT_MIN,max:INPUT_MAX},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_23$3,[createVNode(unref(bngInput_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[12]||=$event=>skewY.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:INPUT_MAX,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[13]||=$event=>skewY.value=$event,step:.01,min:INPUT_MIN,max:INPUT_MAX},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_24$2,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:skewX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:skewY.value},null,8,[`valueLabel`])]))])),!isRepositionActive.value||!isUseMouse.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:6,accent:`text`,class:`inspector-edit-button`,onClick:_cache[14]||=$event=>isEdit.value=!isEdit.value},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`context`}),createBaseVNode(`span`,_hoisted_25$1,` Toggle `+toDisplayString(isEdit.value?`Simple`:`Advance`),1)]),_:1})),[[unref(BngOnUiNav_default),()=>isEdit.value=!isEdit.value,`ok`,{focusRequired:!0}]]):createCommentVNode(``,!0)],2)]),_:1})),[[unref(BngBlur_default)]]),!isRepositionActive.value||!isUseMouse.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`apply-button`,onClick:handleOk},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`ok`}),_cache[21]||=createBaseVNode(`span`,null,`Apply`,-1)]),_:1})),[[unref(BngOnUiNav_default),handleOk,`ok`,{focusRequired:!0}]]):createCommentVNode(``,!0)])])])),[[unref(BngOnUiNav_default),handleOk,`ok`],[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),saveChanges,`menu`],[unref(BngOnUiNav_default),handleTranslateScalar,`focus_lr`],[unref(BngOnUiNav_default),handleTranslateScalar,`focus_ud`],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleRotateCam,`rotate_h_cam`],[unref(BngOnUiNav_default),handleRotateCam,`rotate_v_cam`],[unref(BngOnUiNav_default),handleRotateCam,`rotate_h_cam`,{modified:!0}],[unref(BngOnUiNav_default),handleRotateCam,`rotate_v_cam`,{modified:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{down:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleModifier,`tab_l`,{up:!0}],[unref(BngOnUiNav_default),handleModifier,`tab_l`,{down:!0}],[unref(BngOnUiNav_default),handleTabRight,`tab_r`,{up:!0}],[unref(BngOnUiNav_default),handleTabRight,`tab_r`,{down:!0}],[unref(BngOnUiNav_default),handleAction3,`action_3`],[unref(BngOnUiNav_default),toggleEdit,`context`],[unref(BngUiNavLabel_default),hintLabels.value.focus_lr,`focus_lr`],[unref(BngUiNavLabel_default),hintLabels.value.focus_ud,`focus_ud`],[unref(BngUiNavLabel_default),hintLabels.value.focus_l,`focus_l`],[unref(BngUiNavLabel_default),hintLabels.value.focus_r,`focus_r`],[unref(BngUiNavLabel_default),hintLabels.value.focus_u,`focus_u`],[unref(BngUiNavLabel_default),hintLabels.value.focus_d,`focus_d`],[unref(BngUiNavLabel_default),hintLabels.value.rotate_h_cam,`rotate_h_cam`],[unref(BngUiNavLabel_default),hintLabels.value.rotate_v_cam,`rotate_v_cam`],[unref(BngUiNavLabel_default),hintLabels.value.action_2,`action_2`],[unref(BngUiNavLabel_default),hintLabels.value.action_3,`action_3`],[unref(BngUiNavLabel_default),hintLabels.value.tab_r,`tab_r`],[unref(BngUiNavLabel_default),hintLabels.value.tab_l,`tab_l`],[unref(BngUiNavLabel_default),hintLabels.value.ok,`ok`],[unref(BngUiNavLabel_default),hintLabels.value.back,`back`]])}},LayerTransform_default=__plugin_vue_export_helper_default(_sfc_main$78,[[`__scopeId`,`data-v-a4399a23`]]),_hoisted_1$69={class:`layer-materials-view`,"bng-ui-scope":`layer-materials-scope`},_hoisted_2$57={class:`header`},_hoisted_3$49={class:`main-view-content`},_hoisted_4$37={class:`inspector-container`},_hoisted_5$32={class:`materials-inspector`},_hoisted_6$24={class:`materials-setting-item`},_hoisted_7$22={class:`color-values-container`,"bng-no-child-nav":``},_hoisted_8$17={class:`materials-setting-item`},_hoisted_9$15={class:`slider-text-container`},_hoisted_10$11={class:`materials-setting-item`},_hoisted_11$9={class:`slider-text-container`},BLOCKED_UI_EVENTS=[`tab_l`,`tab_r`,`action_2`,`rotate_h_cam`,`rotate_v_cam`,`focus_lr`,`focus_ud`],_sfc_main$77={__name:`LayerMaterials`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker();useUINavScope(`layer-materials-scope`);let{events:events$3}=useBridge(),screenState=reactive({openedDialog:null}),color=ref({hue:.5,saturation:1,luminosity:.5}),inputHue=computed({get:()=>color.value.hue.toFixed(3),set:newValue=>{color.value.hue=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),inputSat=computed({get:()=>color.value.saturation.toFixed(3),set:newValue=>{color.value.saturation=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),inputLum=computed({get:()=>color.value.luminosity.toFixed(3),set:newValue=>{color.value.luminosity=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),metallicIntensity=ref(0),roughnessIntensity=ref(0),stateData=ref(),colorInitialized=ref(!1),isPreciseActive=ref(!1),colorPickerStep=computed(()=>isPreciseActive.value?.001:.01),slidersStep=computed(()=>isPreciseActive.value?.1:1),updateMaterialProperties=properties=>Lua_default.extensions.ui_liveryEditor_layerEdit.setLayerMaterials(properties);function onColorChanged(){if(!colorInitialized.value)return;let paint=new Paint;paint.hsl=[color.value.hue,color.value.saturation,color.value.luminosity],updateMaterialProperties({color:paint.rgba})}watch(()=>metallicIntensity.value,value=>updateMaterialProperties({metallicIntensity:value})),watch(()=>roughnessIntensity.value,value=>updateMaterialProperties({roughnessIntensity:value})),onBeforeMount(()=>{headerStore.setPreheader([`Materials`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(BLOCKED_UI_EVENTS),events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_layerMaterialsData`,onMaterialPropertiesData),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestLayerMaterials()}),onBeforeUnmount(async()=>{events$3.off(`liveryEditor_layerEdit_layerMaterialsData`,onMaterialPropertiesData),events$3.off(`liveryEditor_layerEdit_state`,onStateData),uiNavBlocker.clear()});async function onStateData(data){stateData.value=data}function onMaterialPropertiesData(data){colorInitialized.value=!1;let paint=new Paint;data.color[3]=1;let isWhite=data.color.every(num=>num===1);paint.rgba=data.color,color.value.hue=paint.hue,color.value.saturation=isWhite?.5:paint.saturation,color.value.luminosity=paint.luminosity,colorInitialized.value=!0,metallicIntensity.value=data.metallicIntensity,roughnessIntensity.value=data.roughnessIntensity}function handleAction2(element){isPreciseActive.value=element.detail.value===1}function goBack(event){screenState.openedDialog||(screenState.openedDialog=`exit`,openConfirmation(`Exit`,`Exit and lose changes?`).then(res=>{res&&Lua_default.extensions.ui_liveryEditor_layerEdit.cancelChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}),screenState.openedDialog=null}),event.stopPropagation())}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$69,[createBaseVNode(`div`,_hoisted_2$57,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$49,[createBaseVNode(`div`,_hoisted_4$37,[withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Materials`,class:``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$32,[createBaseVNode(`div`,_hoisted_6$24,[_cache[8]||=createBaseVNode(`div`,{class:`setting-item-name`},`Color`,-1),withDirectives(createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,step:colorPickerStep.value,onChange:onColorChanged},null,8,[`modelValue`,`step`]),[[unref(BngUiNavFocus_default),0]]),createBaseVNode(`div`,_hoisted_7$22,[createVNode(unref(bngInput_default),{prefix:`h`,modelValue:inputHue.value,"onUpdate:modelValue":_cache[1]||=$event=>inputHue.value=$event,type:`number`},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`s`,modelValue:inputSat.value,"onUpdate:modelValue":_cache[2]||=$event=>inputSat.value=$event,type:`number`},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`b`,modelValue:inputLum.value,"onUpdate:modelValue":_cache[3]||=$event=>inputLum.value=$event,type:`number`},null,8,[`modelValue`])])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_8$17,[_cache[9]||=createBaseVNode(`div`,{class:`setting-item-name`},`Metallic Intensity`,-1),createBaseVNode(`div`,_hoisted_9$15,[createVNode(unref(bngInput_default),{"bng-no-nav":``,modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[4]||=$event=>metallicIntensity.value=$event,type:`number`,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`]),createVNode(unref(bngSlider_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[5]||=$event=>metallicIntensity.value=$event,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`])])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_10$11,[_cache[10]||=createBaseVNode(`div`,{class:`setting-item-name`},`Roughness Intensity`,-1),createBaseVNode(`div`,_hoisted_11$9,[createVNode(unref(bngInput_default),{"bng-no-nav":``,modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[6]||=$event=>roughnessIntensity.value=$event,type:`number`,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`]),createVNode(unref(bngSlider_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[7]||=$event=>roughnessIntensity.value=$event,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`])])])])]),_:1})),[[unref(BngBlur_default)]])])])])),[[unref(BngUiNavLabel_default),`Apply`,`context`],[unref(BngUiNavLabel_default),`[Hold]Precise`,`action_2`],[unref(BngUiNavLabel_default),`Back`,`back,menu`],[unref(BngOnUiNav_default),handleAction2,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handleAction2,`action_2`,{down:!0}],[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngOnUiNav_default),saveChanges,`context`]])}},LayerMaterials_default=__plugin_vue_export_helper_default(_sfc_main$77,[[`__scopeId`,`data-v-4b3730e9`]]),_hoisted_1$68={class:`layer-projection-view`,"bng-ui-scope":`layer-projection-scope`},_hoisted_2$56={class:`header`},_hoisted_3$48={class:`main-view-content`},_hoisted_4$36={class:`camera-views-container`},_hoisted_5$31={class:`mirror-settings-container`},CAMERA_BUTTONS=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$76={__name:`LayerProjection`,setup(__props){let{events:events$3}=useBridge(),headerStore=useEditorHeaderStore(),store$1=useLiveryEditorStore(),infobar=useInfoBar(),popover=usePopover(),uiNav=useUINavScope(`layer-projection-scope`),stateData=ref(null),mirrorState=reactive({mirrored:!1,mirrorFipped:!1,mirrorOffset:0}),mirrored=computed({get:()=>mirrorState.mirrored,set:async newValue=>{mirrorState.mirrored=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(newValue,mirrorState.mirrorFipped,mirrorState.mirrorOffset)}}),mirrorFipped=computed({get:()=>mirrorState.mirrorFipped,set:async newValue=>{mirrorState.mirrorFipped=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(mirrorState.mirrored,newValue,mirrorState.mirrorOffset)}}),mirrorOffset=computed({get:()=>mirrorState.mirrorOffset,set:async newValue=>{mirrorState.mirrorOffset=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(mirrorState.mirrored,mirrorState.mirrorFipped,newValue)}}),NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`},action:saveChanges},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setPreheader([`Projection`]),headerStore.setHeader(`Decals`)}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestInitialLayerData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_layerEdit_state`,onStateData),events$3.off(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData)});function changeCameraView(view){popover.hide(`camera-views-menu`),console.log(`changeCameraView`,view),store$1.setOrthographicView(view)}function onStateData(data){console.log(`onStateData`,data),stateData.value=data}function onInitialLayerData(data){mirrorState.mirrored=data.mirrored,mirrorState.mirrorFipped=data.mirrorFipped,mirrorState.mirrorOffset=data.mirrorOffset}function goBack(){window.bngVue.gotoGameState(`LiveryLayerEdit`)}function saveChanges(){window.bngVue.gotoGameState(`LiveryLayerEdit`)}function onPopoverMenuHide(){uiNav.set(`layer-projection-scope`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$68,[createBaseVNode(`div`,_hoisted_2$56,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$48,[withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,icon:unref(icons).movieCamera,label:`Side`},null,8,[`icon`]),[[unref(BngBlur_default)],[unref(BngPopover_default),`camera-views-menu`,`right-start`,{click:!0}]]),withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,icon:unref(icons).reflect,label:`Mirror`},null,8,[`icon`]),[[unref(BngBlur_default)],[unref(BngPopover_default),`mirror-settings-menu`,`right-start`,{click:!0}]])]),createVNode(unref(bngPopoverMenu_default),{name:`camera-views-menu`,onHide:onPopoverMenuHide},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$36,[createVNode(unref(bngList_default),{targetWidth:8,targetMargin:.5,noBackground:``},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(CAMERA_BUTTONS,view=>createVNode(unref(bngImageTile_default),{key:view.value,"bng-nav-item":``,label:view.label,icon:view.icon,onClick:$event=>changeCameraView(view.value)},null,8,[`label`,`icon`,`onClick`])),64))]),_:1})])]),_:1}),createVNode(unref(bngPopoverMenu_default),{name:`mirror-settings-menu`,onHide:onPopoverMenuHide},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$31,[createVNode(unref(bngPillCheckbox_default),{modelValue:mirrored.value,"onUpdate:modelValue":_cache[0]||=$event=>mirrored.value=$event},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Mirrored`,-1)]]),_:1},8,[`modelValue`]),withDirectives((openBlock(),createBlock(unref(bngPillCheckbox_default),{modelValue:mirrorFipped.value,"onUpdate:modelValue":_cache[1]||=$event=>mirrorFipped.value=$event},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Mirror Flipped`,-1)]]),_:1},8,[`modelValue`])),[[unref(BngDisabled_default),!mirrored.value]]),createVNode(unref(bngInput_default),{modelValue:mirrorOffset.value,"onUpdate:modelValue":_cache[2]||=$event=>mirrorOffset.value=$event,externalLabel:`Offset`,type:`number`,disabled:!mirrored.value},null,8,[`modelValue`,`disabled`])])]),_:1})])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),goBack,`menu`]])}},LayerProjection_default=__plugin_vue_export_helper_default(_sfc_main$76,[[`__scopeId`,`data-v-19e531c7`]]),_hoisted_1$67={class:`settings-main-view`,"bng-ui-scope":`settings-main-scope`},_hoisted_2$55={class:`header`},_hoisted_3$47={class:`main-view-content`},_hoisted_4$35={class:`settings-container`},_hoisted_5$30={class:`settings-item`},_sfc_main$75={__name:`LiverySettingsMain`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar();useUINavScope(`settings-main-scope`);let{events:events$3}=useBridge(),stateData=ref(null),useSurfaceNormal=ref(!1);watch(()=>useSurfaceNormal.value,async value=>{await Lua_default.extensions.ui_liveryEditor.useSurfaceNormal(value)});let NAV_HINTS=[{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setHeader(`Decals`),headerStore.setPreheader([`Settings`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_settingsData`,onSettingsData),await Lua_default.extensions.ui_liveryEditor.requestSettingsData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_settingsData`,onSettingsData)});function onSettingsData(data){console.log(`onSettingsData`,data),stateData.value=data,useSurfaceNormal.value=data.useSurfaceNormal}function goBack(event){window.bngVue.gotoGameState(`LiveryMain`),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$67,[createBaseVNode(`div`,_hoisted_2$55,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$47,[withDirectives((openBlock(),createBlock(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Settings`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_4$35,[createBaseVNode(`div`,_hoisted_5$30,[_cache[2]||=createBaseVNode(`div`,{class:`settings-item-name`},`Use Surface Normal`,-1),withDirectives(createVNode(unref(bngSwitch_default),{modelValue:useSurfaceNormal.value,"onUpdate:modelValue":_cache[0]||=$event=>useSurfaceNormal.value=$event,label:useSurfaceNormal.value?`Yes`:`No`},null,8,[`modelValue`,`label`]),[[unref(BngUiNavFocus_default),0],[unref(BngFocusIf_default),!0]])])])]),_:1})),[[unref(BngBlur_default)]])])])),[[unref(BngOnUiNav_default),goBack,`back,menu`]])}},LiverySettingsMain_default=__plugin_vue_export_helper_default(_sfc_main$75,[[`__scopeId`,`data-v-ad4291e2`]]),routes_default$8=[{path:`/livery-editor`,name:`LiveryEditor`,component:LiveryEditor_default},{path:`/livery-main`,name:`LiveryMain`,component:LiveryMainNew_default},{path:`/livery-paint`,name:`LiveryPaint`,component:LiveryPaintMain_default},{path:`/livery-decals`,name:`LiveryDecals`,component:LiveryDecalsMain_default},{path:`/livery-settings`,name:`LiverySettings`,component:LiverySettingsMain_default},{path:`/livery-camera-settings`,name:`LiveryCameraSettings`,component:LiveryCameraSettings_default},{path:`/livery-decal-selector`,name:`LiveryDecalSelector`,component:LiveryDecalSelector_default},{path:`/livery-layer-edit`,name:`LiveryLayerEdit`,component:LiveryLayerEdit_default},{path:`/layer-transform`,name:`LayerTransform`,component:LayerTransform_default},{path:`/layer-materials`,name:`LayerMaterials`,component:LayerMaterials_default},{path:`/layer-projection`,name:`LayerProjection`,component:LayerProjection_default},{path:`/livery-manager`,name:`LiveryManager`,component:LiveryManager_default}],_hoisted_1$66={class:`logo-wrapper`},_sfc_main$74={__name:`Logo`,setup(__props){let logos={beamng:getAssetURL(`images/logos.svg#bng-beamng`),tech:getAssetURL(`images/logos.svg#bng-tech`),drive:getAssetURL(`images/logos.svg#bng-drive`),research:getAssetURL(`images/logos.svg#bng-research`)},productLogo=ref(logos.drive);return onMounted(async()=>{if(await Lua_default.extensions.tech_license.isValid())productLogo.value=logos.tech;else if(window.beamng){let name=window.beamng.product.replace(`BeamNG.`,``);name in logos&&(productLogo.value=logos[name])}else productLogo.value=logos.drive}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$66,[createBaseVNode(`div`,{class:`logo`,style:normalizeStyle({"--logo":`url('${productLogo.value}')`})},null,4)]))}},Logo_default=__plugin_vue_export_helper_default(_sfc_main$74,[[`__scopeId`,`data-v-69adfd8c`]]),_hoisted_1$65={class:`main-view`},_hoisted_2$54={class:`dev-info-content`},_hoisted_3$46={class:`dev-info-text`},_hoisted_4$34={class:`mainmenu-title`},_hoisted_5$29={key:1,class:`bottom-buttons`},_hoisted_6$23={class:`btn-content`},_hoisted_7$21={class:`label`},_hoisted_8$16={key:0,class:`small`},_hoisted_9$14={class:`btn-content`},_hoisted_10$10={class:`label`},_hoisted_11$8={key:0,class:`small`},_hoisted_12$6={class:`btn-content`},_hoisted_13$6={class:`label`},_hoisted_14$6={class:`btn-content`},_hoisted_15$6={class:`label`},_hoisted_16$6={class:`btn-content`},_hoisted_17$5={class:`label`},_sfc_main$73={__name:`MainMenu`,setup(__props){let events$3=useEvents(),infoBar=useInfoBar();useUINavScope(`mainmenuUI`);let withAngular=computed(()=>!sysInfo_default.mainMenuBackgroundRequired.value),firstTime=ref(sysInfo_default.mainMenuFirstTime.value),bgRequired=sysInfo_default.mainMenuBackgroundRequired,parentImageCarousel=inject(`mainBackground`),modCounts$1=sysInfo_default.modCounts,devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1,simplemenu:window.beamng&&window.beamng.simplemenu,videoApi:null,UIEngine:null}),quickLoadLevel=()=>Lua_default.core_levels.startLevel(`/levels/smallgrid/main.level.json`),addons=ref({}),addButton=({translateid,icon,targetState,title,iconId,action})=>{let newButton;newButton=translateid||icon||targetState?{title:$translate.instant(translateid),icon,action:targetState}:{title,iconId,action},addons.value[newButton.title]=newButton},viewName=ref(),changeView=name=>{viewName.value=name,router_default.push(`/menu.mainmenu`+(name?`/`+name:``))};watch(()=>viewName.value,val=>{val&&infoBar.flashHints(`back`),parentImageCarousel.value&&nextTick(parentImageCarousel.value.carousel.showNext)});let route=useRoute();watch(()=>route.name,name=>{if(typeof name!=`string`){viewName.value=null;return}name.startsWith(`menu.mainmenu`)&&(viewName.value=name===`menu.mainmenu`?null:name.slice(14))},{immediate:!0});let navigate$1=(...state)=>window.bngVue.gotoGameState(...state);function quitGame(){Lua_default.quit(),runRaw(`TorqueScript.eval('quit();')`,!1)}let handleBack=event=>{event.detail.force||(viewName.value?(viewName.value=null,changeView(null)):(event.detail.name===`back`||event.detail.name===`menu`)&&window.globalAngularRootScope?.$broadcast(`MenuToggle`))},canDeactivateScope=()=>!viewName.value,canBubbleEvent=event=>{if(event.detail.value!==1)return!1;let eventName=event.detail.name;return eventName===`tab_l`||eventName===`tab_r`?!viewName.value:!1};function displayToast(type,title,titleContext,msg,messageContext){let msgTxt=$translate.contextTranslate({txt:msg,context:messageContext}),titleTxt=$translate.contextTranslate({txt:title,context:titleContext}),msgHtml=window.angularParseBBCode(msgTxt),titleHtml=window.angularParseBBCode(titleTxt);window.globalAngularRootScope.$broadcast(`toastrMsg`,{type,msg:msgHtml,title:titleHtml,config:{positionClass:`toast-top-right`,timeOut:0,extendedTimeOut:0,onTap(){window.bngVue.gotoGameState(`menu.options.performance`)}}})}async function checkHardware(){Lua_default.checkFSErrors();let info=await Lua_default.core_hardwareinfo.getInfo();if(info.globalState!==`ok`){for(let key in info)if(!(!info[key].warnings||!Array.isArray(info[key].warnings)))for(let warning of info[key].warnings)warning.ack||displayToast(info.globalState===`warn`?`warning`:`error`,`ui.performance.warnings.`+warning.msg,warning.context,`ui.mainmenu.warningdetails`,null)}}let repoEnabled=ref(!1),modsAfterUpdate=ref(!1),onSettingsChanged=data=>{modsAfterUpdate.value=data.values.disableModsAfterUpdate,repoEnabled.value=data.values.onlineFeatures===`enable`&&!data.values.disableModsAfterUpdate};return onMounted(async()=>{function advertMainMenu(){events$3.emit(`MainMenuButtons`,addButton),window.globalAngularRootScope.$broadcast(`MainMenuButtons`,addButton)}advertMainMenu(),events$3.on(`UiModsChanged`,advertMainMenu),events$3.on(`BroadcastMainMenuButtons`,advertMainMenu),events$3.on(`SettingsChanged`,onSettingsChanged),Lua_default.settings.notifyUI(),devEnv.env&&(devEnv.videoApi=await Lua_default.Engine.Render.getAdapterType(),devEnv.UIEngine=await Lua_default.Engine.UI.getUIEngine()),sysInfo_default.mainMenuFirstTime.value&&checkHardware();let settings$1=await useSettingsAsync();await Lua_default.extensions.tech_license.isValid()||(settings$1.values.onlineFeatures===`ask`||settings$1.values.telemetry===`ask`?window.bngVue.gotoGameState(`menu.onlineFeatures`):Lua_default.settings.getValue(`showedInputLayoutPopupV37`).then(value=>{value===!1&&window.bngVue.gotoGameState(`buttonLayout`)})),sysInfo_default.mainMenuFirstTime.value=!1}),onUnmounted(()=>{events$3.off(`SettingsChanged`,onSettingsChanged)}),(_ctx,_cache)=>{let _component_router_view=resolveComponent(`router-view`);return withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"mainmenu-container":!0,"mainmenu-with-angular":withAngular.value,"mainmenu-fadein":firstTime.value&&!withAngular.value}),onDeactivate:handleBack},[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$65,[devEnv.env?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`dev-info`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Developer Release`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$54,[withDirectives(createVNode(unref(bngIcon_default),{class:`dev-info-icon`,type:unref(icons).bug,"bng-all-clicks-no-nav":``},null,8,[`type`]),[[unref(BngDoubleClick_default),quickLoadLevel]]),createBaseVNode(`div`,_hoisted_3$46,[createBaseVNode(`div`,null,` Graphics API: `+toDisplayString(devEnv.videoApi||`requesting...`),1),createBaseVNode(`div`,null,` UI Engine: `+toDisplayString(devEnv.UIEngine||`requesting...`),1)])])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$34,[createVNode(Logo_default)]),createVNode(_component_router_view,{"first-time":firstTime.value&&!withAngular.value,addons:addons.value,onChangeView:changeView},null,8,[`first-time`,`addons`]),viewName.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$29,[repoEnabled.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`btn-mods`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>navigate$1(`menu.mods.repository`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$23,[createBaseVNode(`span`,_hoisted_7$21,toDisplayString(_ctx.$tt(`ui.mainmenu.repo`)),1),unref(modCounts$1).total>0?(openBlock(),createElementBlock(`span`,_hoisted_8$16,`\xA0(`+toDisplayString(unref(modCounts$1).active)+` / `+toDisplayString(unref(modCounts$1).total)+`)`,1)):createCommentVNode(``,!0)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`btn-mods`,{"mods-after-update":modsAfterUpdate.value}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>navigate$1(`menu.mods.local`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_9$14,[createBaseVNode(`span`,_hoisted_10$10,[modsAfterUpdate.value?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`danger`,style:{"font-size":`1.1em`},color:`#ff2d00`})):createCommentVNode(``,!0),createTextVNode(toDisplayString(_ctx.$tt(`ui.mainmenu.mods`)),1)]),unref(modCounts$1).total>0?(openBlock(),createElementBlock(`span`,_hoisted_11$8,`\xA0(`+toDisplayString(unref(modCounts$1).active)+` / `+toDisplayString(unref(modCounts$1).total)+`)`,1)):createCommentVNode(``,!0)])]),_:1},8,[`class`,`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>navigate$1(`credits`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_12$6,[createBaseVNode(`span`,_hoisted_13$6,toDisplayString(_ctx.$tt(`ui.mainmenu.credits`)),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>navigate$1(`menu.options.display`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$6,[createBaseVNode(`span`,_hoisted_15$6,toDisplayString(_ctx.$tt(`ui.mainmenu.options`)),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),devEnv.simplemenu?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:`btn-quit`,accent:unref(ACCENTS).attention,icon:unref(icons).exit,onClick:_cache[4]||=$event=>quitGame()},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_16$6,[createBaseVNode(`span`,_hoisted_17$5,toDisplayString(_ctx.$tt(`ui.inputActions.general.quit.title`)),1)])]),_:1},8,[`accent`,`icon`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]])]))])),[[unref(BngOnUiNav_default),handleBack,`back`]])],34)),[[unref(BngScopedNav_default),{activateOnMount:!0,canDeactivate:canDeactivateScope,canBubbleEvent}],[unref(BngOnUiNav_default),handleBack,`menu`]])}}},MainMenu_default=__plugin_vue_export_helper_default(_sfc_main$73,[[`__scopeId`,`data-v-1c7a0195`]]),_hoisted_1$64={key:1,class:`fancy-bg-wrap`},_hoisted_2$53={class:`mask-container`},_hoisted_3$45={key:0,class:`icon-text`},_hoisted_4$33={key:2,class:`tag`},_hoisted_5$28={key:3,class:`icon`},_hoisted_6$22={key:4,class:`icon`},_hoisted_7$20={key:5,class:`label-container`},_hoisted_8$15={class:`text`},_hoisted_9$13={key:6,class:`text`},_sfc_main$72={__name:`MenuButton`,props:{size:{type:String,default:`normal`},iconId:String,icon:String,highlighted:Boolean,disabled:Boolean,appearDisabled:Boolean,bgImg:String,bgImgAbs:String,tag:String,noBlur:Boolean},setup(__props,{expose:__expose}){let props=__props,btnRef=ref(null);__expose({getElement(){return btnRef.value}});let bgImgUrl=computed(()=>props.bgImgAbs?props.bgImgAbs:getAssetURL(props.bgImg)),hasBgImg=computed(()=>props.bgImgAbs||props.bgImg);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`btnRef`,ref:btnRef,class:normalizeClass({"mainmenu-button":!0,[`size-${__props.size}`]:!0,"fancy-bg":!!hasBgImg.value,"with-icon":!!__props.iconId,"semi-disabled":__props.appearDisabled}),style:normalizeStyle({"--fancy-bg-img":`url('${bgImgUrl.value}')`}),"bng-nav-item":``},[__props.noBlur?createCommentVNode(``,!0):(openBlock(),createBlock(BlurBackground_default,{key:0,class:normalizeClass(`corners-${__props.size}`)},null,8,[`class`])),createBaseVNode(`div`,{class:normalizeClass([`button-background`,{stack:__props.size===`big-stacked`,highlighted:__props.highlighted}])},null,2),hasBgImg.value?(openBlock(),createElementBlock(`div`,_hoisted_1$64,[createBaseVNode(`div`,{class:normalizeClass([`bg-container`,{"with-icon":!!__props.iconId}])},[_cache[0]||=createBaseVNode(`div`,{class:`bg-image`},null,-1),createBaseVNode(`div`,_hoisted_2$53,[__props.iconId?(openBlock(),createElementBlock(`div`,_hoisted_3$45,toDisplayString(unref(icons)[__props.iconId].glyph),1)):createCommentVNode(``,!0)])],2)])):createCommentVNode(``,!0),__props.tag?(openBlock(),createElementBlock(`div`,_hoisted_4$33,toDisplayString(__props.tag),1)):createCommentVNode(``,!0),__props.iconId&&!hasBgImg.value?(openBlock(),createElementBlock(`div`,_hoisted_5$28,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.iconId],color:hasBgImg.value?`transparent`:void 0},null,8,[`type`,`color`])])):__props.icon?(openBlock(),createElementBlock(`div`,_hoisted_6$22,[createVNode(unref(bngImageAsset_default),{externalSrc:__props.icon},null,8,[`externalSrc`])])):createCommentVNode(``,!0),__props.size==`big`||__props.size==`big-stacked`?(openBlock(),createElementBlock(`div`,_hoisted_7$20,[createBaseVNode(`span`,_hoisted_8$15,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])])):(openBlock(),createElementBlock(`span`,_hoisted_9$13,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]))],6)),[[unref(BngSoundClass_default),!(__props.disabled||__props.appearDisabled)&&`bng_click_hover_generic`],[unref(BngDisabled_default),__props.disabled],[unref(BngBlur_default),!__props.noBlur]])}},MenuButton_default=__plugin_vue_export_helper_default(_sfc_main$72,[[`__scopeId`,`data-v-932e6a9a`]]),_hoisted_1$63={class:`center-wrap`},_hoisted_2$52={class:`primary`},IMG_PATH=`images/mainmenu/`,_sfc_main$71={__name:`MainView`,props:{firstTime:Boolean},emits:[`changeView`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit;ref(null);let settings$1=useSettings(),defaultWizardStep=computed(()=>settings$1.getValue(`freeroamSetupDefaultStep`)||`level`),firstTime=ref(props.firstTime);onMounted(()=>{firstTime.value&&setTimeout(()=>firstTime.value=!1,1500)});let navigate$1=(state,params=void 0)=>nextTick(()=>window.bngVue.gotoGameState(state,{params}));async function careerPrompt(){await openExperimental($translate.instant(`ui.career.experimentalTitle`),$translate.instant(`ui.career.experimentalPrompt`),[{label:$translate.instant(`ui.common.no`),value:!1,isCancel:!0,extras:{accent:ACCENTS.secondary}},{label:$translate.instant(`ui.career.experimentalAgree`),value:!0,default:!0}])&&navigate$1(`profiles`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$63,[createBaseVNode(`div`,_hoisted_2$52,[createVNode(MenuButton_default,{"bng-scoped-nav-autofocus":``,size:`big`,"icon-id":`keys1`,"bg-img":IMG_PATH+`experiences.jpg`,onClick:_cache[0]||=$event=>emit$1(`changeView`,`discover`),tag:_ctx.$t(`ui.playmodes.new`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.quickStartExperiences`)),1)]),_:1},8,[`bg-img`,`tag`]),createVNode(MenuButton_default,{size:`big`,"icon-id":`road`,"bg-img":IMG_PATH+`freeroam.jpg`,onClick:_cache[1]||=$event=>navigate$1(`menu.freeroamWizard`,{step:defaultWizardStep.value})},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.freeroam`)),1)]),_:1},8,[`bg-img`]),_ctx.$simplemenu.value?createCommentVNode(``,!0):(openBlock(),createBlock(MenuButton_default,{key:0,"appear-disabled":``,size:`big`,"icon-id":`cup`,"bg-img":IMG_PATH+`career.jpg`,onClick:_cache[2]||=$event=>careerPrompt(),tag:_ctx.$t(`ui.playmodes.comingSoon`),"tag-orange":``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.career`)),1)]),_:1},8,[`bg-img`,`tag`])),createVNode(MenuButton_default,{size:`big-stacked`,"icon-id":`BNGFolder`,"bg-img":IMG_PATH+`others.jpg`,onClick:_cache[3]||=$event=>emit$1(`changeView`,`others`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.mainmenu.more`)),1)]),_:1},8,[`bg-img`])])]))}},MainView_default=__plugin_vue_export_helper_default(_sfc_main$71,[[`__scopeId`,`data-v-0baa6516`]]),_hoisted_1$62={class:`center-wrap`},_hoisted_2$51={class:`others`},_hoisted_3$44={class:`buttons`},htmlBody=`
      `,overlayDiv.textContent=count$1.toString(),overlayElement.appendChild(overlayDiv),overlayDivs.set(element,overlayDiv)}catch{}}function updateOverlayText(){if(!overlayActive||overlayDivs.size===0)return;let appsStats=getUIAppsStats(),counts=appsStats.sortedList.map(item=>item.count),maxCount=Math.max(...counts,1),minCount=Math.min(...counts,0);for(let{element,count:count$1}of appsStats.sortedList){let overlayDiv=overlayDivs.get(element);overlayDiv&&(overlayDiv.textContent=count$1.toString(),overlayDiv.style.opacity=getOverlayOpacity(count$1,minCount,maxCount))}}function destroyOverlay(){overlayUpdateTimer&&=(clearInterval(overlayUpdateTimer),null),overlayDivs.forEach(overlayDiv=>overlayDiv.remove()),overlayDivs.clear(),overlayElement&&=(overlayElement.remove(),null),overlayActive=!1}function toggleOverlay(){return overlayActive?(destroyOverlay(),!1):(overlayActive=!0,createOverlay(),updateOverlayDivs(),overlayUpdateTimer=setInterval(updateOverlayText,500),!0)}function refreshOverlay(){overlayActive&&updateOverlayDivs()}var isBrowser=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}var assign=Object.assign;function applyToParams(fn,params){let newParams={};for(let key in params){let value=params[key];newParams[key]=isArray(value)?value.map(fn):fn(value)}return newParams}var noop$1=()=>{},isArray=Array.isArray;function mergeOptions(defaults,partialOptions){let options={};for(let key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos,searchPos>=0&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos,hashPos>0?hashPos:location$1.length),query=parseQuery$1(searchString.slice(1))),hashPos>=0&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+searchString+hash,path,query,hash:decode(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b){let aLastIndex=a$1.matched.length-1,bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b.query)&&a$1.hash===b.hash}function isSameRouteRecord(a$1,b){return(a$1.aliasOf||a$1)===(b.aliasOf||b)}function isSameRouteLocationParams(a$1,b){if(Object.keys(a$1).length!==Object.keys(b).length)return!1;for(let key in a$1)if(!isSameRouteLocationParamsValue(a$1[key],b[key]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b){return isArray(a$1)?isEquivalentArray(a$1,b):isArray(b)?isEquivalentArray(b,a$1):a$1===b}function isEquivalentArray(a$1,b){return isArray(b)?a$1.length===b.length&&a$1.every((value,i)=>value===b[i]):a$1.length===1&&a$1[0]===b}function resolveRelativePath(to,from){if(to.startsWith(`/`))return to;if(!to)return from;let fromSegments=from.split(`/`),toSegments=to.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position--;else break;return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},NavigationType=function(NavigationType$1){return NavigationType$1.pop=`pop`,NavigationType$1.push=`push`,NavigationType$1}({}),NavigationDirection=function(NavigationDirection$1){return NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``,NavigationDirection$1}({});function normalizeBase(base){if(!base)if(isBrowser){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}var computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position){let scrollToOptions;if(`el`in position){let positionEl=position.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key,scrollPosition){scrollPositions.set(key,scrollPosition)}function getSavedScrollPosition(key){let scroll$1=scrollPositions.get(key);return scrollPositions.delete(key),scroll$1}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name){return typeof name==`string`||typeof name==`symbol`}var ErrorTypes=function(ErrorTypes$1){return ErrorTypes$1[ErrorTypes$1.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,ErrorTypes$1}({}),NavigationFailureSymbol=Symbol(``);ErrorTypes.MATCHER_NOT_FOUND,ErrorTypes.NAVIGATION_GUARD_REDIRECT,ErrorTypes.NAVIGATION_ABORTED,ErrorTypes.NAVIGATION_CANCELLED,ErrorTypes.NAVIGATION_DUPLICATED;function createRouterError(type,params){return assign(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let searchParams=(search$1[0]===`?`?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value$1=>{value$1!==void 0&&(search$1+=(search$1.length?`&`:``)+key,value$1!=null&&(search$1+=`=`+value$1))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key in query){let value=query[key];value!==void 0&&(normalizedQuery[key]=isArray(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value)}return normalizedQuery}var matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$1=[];function add$2(handler$1){return handlers$1.push(handler$1),()=>{let i=handlers$1.indexOf(handler$1);i>-1&&handlers$1.splice(i,1)}}function reset$1(){handlers$1=[]}return{add:add$2,list:()=>handlers$1.slice(),reset:reset$1}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){let enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid=>{valid===!1?reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED,{from,to})):valid instanceof Error?reject(valid):isRouteLocation(valid)?reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT,{from:to,to:valid})):(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid==`function`&&enterCallbackArray.push(valid),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){let guards=[];for(let record of matched)for(let name in record.components){let rawComponent=record.components[name];if(!(guardType!==`beforeRouteEnter`&&!record.instances[name]))if(isRouteComponent(rawComponent)){let guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved,record.components[name]=resolvedComponent;let guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function extractChangingRecords(to,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}return stripBase(pathname,base)+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index=listeners.indexOf(callback);index>-1&&listeners.splice(index,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){if(document.visibilityState===`hidden`){let{history:history$1}=window;if(!history$1.state)return;history$1.replaceState(assign({},history$1.state,{scroll:computeScrollPosition()}),``)}}function destroy$1(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`pagehide`,beforeUnloadListener),document.removeEventListener(`visibilitychange`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`pagehide`,beforeUnloadListener),document.addEventListener(`visibilitychange`,beforeUnloadListener),{pauseListeners,listen,destroy:destroy$1}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history$1.state,buildState(historyState.value.back,to,historyState.value.forward,!0),data,{position:historyState.value.position}),!0),currentLocation.value=to}function push(to,data){let currentState=assign({},historyState.value,history$1.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0),changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),!1),currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}var TokenType=function(TokenType$1){return TokenType$1[TokenType$1.Static=0]=`Static`,TokenType$1[TokenType$1.Param=1]=`Param`,TokenType$1[TokenType$1.Group=2]=`Group`,TokenType$1}({}),TokenizerState=function(TokenizerState$1){return TokenizerState$1[TokenizerState$1.Static=0]=`Static`,TokenizerState$1[TokenizerState$1.Param=1]=`Param`,TokenizerState$1[TokenizerState$1.ParamRegExp=2]=`ParamRegExp`,TokenizerState$1[TokenizerState$1.ParamRegExpEnd=3]=`ParamRegExpEnd`,TokenizerState$1[TokenizerState$1.EscapeNext=4]=`EscapeNext`,TokenizerState$1}(TokenizerState||{}),ROOT_TOKEN={type:TokenType.Static,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message){throw Error(`ERR (${state})/"${buffer$1}": ${message}`)}let state=TokenizerState.Static,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&=(state===TokenizerState.Static?segment.push({type:TokenType.Static,value:buffer$1}):state===TokenizerState.Param||state===TokenizerState.ParamRegExp||state===TokenizerState.ParamRegExpEnd?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:TokenType.Param,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),``)}function addCharToBuffer(){buffer$1+=char}for(;ib.length?b.length===1&&b[0]===PathScore.Static+PathScore.Segment?1:-1:0}function comparePathParserScore(a$1,b){let i=0,aScore=a$1.score,bScore=b.score;for(;i0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:!1,end:!0,sensitive:!1};function createRouteRecordMatcher(record,parent,options){let matcher=assign(tokensToParser(tokenizePath(record.path),options),{record,parent,children:[],alias:[]});return parent&&!matcher.record.aliasOf==!parent.record.aliasOf&&parent.children.push(matcher),matcher}function createRouterMatcher(routes,globalOptions){let matchers=[],matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){let isRootAdd=!originalRecord,mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;let options=mergeOptions(globalOptions,record),normalizedRecords=[mainNormalizedRecord];if(`alias`in record){let aliases=typeof record.alias==`string`?[record.alias]:record.alias;for(let alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher,originalMatcher;for(let normalizedRecord of normalizedRecords){let{path}=normalizedRecord;if(parent&&path[0]!==`/`){let parentPath=parent.record.path,connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}if(matcher=createRouteRecordMatcher(normalizedRecord,parent,options),originalRecord?originalRecord.alias.push(matcher):(originalMatcher||=matcher,originalMatcher!==matcher&&originalMatcher.alias.push(matcher),isRootAdd&&record.name&&!isAliasRecord(matcher)&&removeRoute(record.name)),isMatchable(matcher)&&insertMatcher(matcher),mainNormalizedRecord.children){let children=mainNormalizedRecord.children;for(let i=0;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index=matchers.indexOf(matcherRef);index>-1&&(matchers.splice(index,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1});name=matcher.record.name,params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location$1.params&&pickParams(location$1.params,matcher.keys.map(k=>k.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1,currentLocation});name=matcher.record.name,params=assign({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){let newParams={};for(let key of keys)key in params&&(newParams[key]=params[key]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name in record.components)propsObject[name]=typeof props==`object`?props[name]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1;comparePathParserScore(matcher,matchers[mid])<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to=unref(props.to);return router$1.resolve(to)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate$1(e={}){if(guardEvent(e)){let p$1=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$1),p$1}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate:navigate$1}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link=reactive(useLink(props)),{options}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}return e.preventDefault&&e.preventDefault(),!0}}function includesParams(outer,inner){for(let key in inner){let innerValue=inner[key],outerValue=outer[key];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance$1,to,name],[oldInstance,from,oldName])=>{to&&(to.instances[name]=instance$1,from&&from!==to&&instance$1&&instance$1===oldInstance&&(to.leaveGuards.size||(to.leaveGuards=from.leaveGuards),to.updateGuards.size||(to.updateGuards=from.updateGuards))),instance$1&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance)&&(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance$1))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],component=h(ViewComponent,assign({},routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,attrs,{onVnodeUnmounted:vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;let slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){let matcher=createRouterMatcher(options.routes,options),parseQuery$1=options.parseQuery||parseQuery,stringifyQuery$1=options.stringifyQuery||stringifyQuery,routerHistory=options.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser&&options.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name){let recordMatcher=matcher.getRecordMatcher(name);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign({},rawLocation.params);for(let key in targetParams)targetParams[key]??delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to==`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(ErrorTypes.NAVIGATION_CANCELLED,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:!0}))}function handleRedirectRecord(to,from){let lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to,from):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign({query:to.query,hash:to.hash,params:newTargetLocation.path==null?to.params:{}},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to),from=currentRoute.value,data=to.state,force=to.force,replace$1=to.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign({},data,shouldRedirect.state):data,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(ErrorTypes.NAVIGATION_DUPLICATED,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate$1(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,ErrorTypes.NAVIGATION_GUARD_REDIRECT))return pushWithRedirect(assign({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign({},data,failure$1.to.state):data,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to,from){let error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){let app$1=installedApps.values().next().value;return app$1&&typeof app$1.runWithContext==`function`?app$1.runWithContext(fn):fn()}function navigate$1(to,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,ErrorTypes.NAVIGATION_CANCELLED)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data)):routerHistory.push(toLocation.fullPath,data)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to),shouldRedirect=handleRedirectRecord(toLocation,router$1.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate$1(toLocation,from).catch(error=>isNavigationFailure(error,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_CANCELLED)?error:isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?(pushWithRedirect(assign(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,ErrorTypes.NAVIGATION_CANCELLED)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to,from){markAsReady(error);let list=errorListeners.list();return list.length?list.forEach(handler$1=>handler$1(error,to,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$1$1,reject)=>{readyHandlers.add([resolve$1$1,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$1$1,reject])=>err?reject(err):resolve$1$1()),readyHandlers.reset()),err}function handleScroll(to,from,isPush,isFirstNavigation){let{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>position&&scrollToPosition(position)).catch(err=>triggerError(err,to,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app$1){app$1.component(`RouterLink`,RouterLink),app$1.component(`RouterView`,RouterView),app$1.config.globalProperties.$router=router$1,Object.defineProperty(app$1.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:!0});app$1.provide(routerKey,router$1),app$1.provide(routeLocationKey,shallowReactive(reactiveRoute)),app$1.provide(routerViewLocationKey,currentRoute);let unmountApp=app$1.unmount;installedApps.add(app$1),app$1.unmount=function(){installedApps.delete(app$1),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}function spawnUiApp(appName,appId,params,apps){let props=params?params.props:null,appKey=`${appName}${appId}`;apps.push({name:appName,appId,appKey,comp:appName,props,teleport:`#${appName+appId}`})}function destroyUiApp(appName,apps){let index=apps.findIndex(x=>x.name===appName);index>-1&&apps.splice(index,1)}function registerApps(app$1,componentsMap){Object.keys(componentsMap).forEach(key=>app$1.component(key,componentsMap[key]))}var _sfc_main$325={};function _sfc_render$5(_ctx,_cache){return null}var layoutEmpty_default=__plugin_vue_export_helper_default(_sfc_main$325,[[`render`,_sfc_render$5]]);const LAYOUT_ALIGNMENTS={left:`flex-start`,right:`flex-end`,center:`center`};var _sfc_main$324={},_hoisted_1$287={class:`layout-wrapper layout-safezones`},_hoisted_2$235={class:`layout-content`};function _sfc_render$4(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock(`div`,_hoisted_1$287,[createBaseVNode(`div`,_hoisted_2$235,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createTextVNode(`Content here`,-1)])])])}var layoutSingle_default=__plugin_vue_export_helper_default(_sfc_main$324,[[`render`,_sfc_render$4]]);const useEvents=(onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),events$3={_on:{},_once:{},on(name,func){name in events$3._on||(events$3._on[name]=[]),events$3._on[name].indexOf(func)===-1&&(bridge$4.events.on(name,func),events$3._on[name].push(func))},once(name,func){name in events$3._once||(events$3._once[name]=[]),events$3._once[name].indexOf(func)===-1&&(bridge$4.events.once(name,()=>{let idx=events$3._once[name].indexOf(func);idx>-1&&events$3._once[name].splice(idx,1)}),bridge$4.events.once(name,func),events$3._once[name].push(func))},off(name=void 0,func=void 0){if(!name){for(let name$1 in events$3._on){for(let func$1 of events$3._on[name$1])bridge$4.events.off(name$1,func$1);delete events$3._on[name$1]}return}if(name in events$3._on)if(func){let idx=events$3._on[name].indexOf(func);idx>-1&&(bridge$4.events.off(name,func),events$3._on[name].splice(idx,1)),events$3._on[name].length===0&&delete events$3._on[name]}else{for(let func$1 of events$3._on[name])bridge$4.events.off(name,func$1);delete events$3._on[name]}},emit(name,...values){bridge$4.events.emit(name,...values)}};return onDispose(()=>{for(let type of[`_on`,`_once`])for(let name in events$3[type]){for(let func of events$3[type][name])bridge$4.events.off(name,func);delete events$3[type][name]}}),events$3},useStreams=(names,callback,onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),enabled=!1,streams={on(){enabled||(enabled=!0,bridge$4.streams.add(names),bridge$4.events.on(`onStreamsUpdate`,callback))},off(){enabled&&(enabled=!1,bridge$4.streams.remove(names),bridge$4.events.off(`onStreamsUpdate`,callback))}};return streams.on(),onDispose(streams.off),streams};var hints_default=`ui.hints.quickSteerResponse,ui.hints.raceBrakesEffectiveness,ui.hints.quickCameraMovement,ui.hints.grabVehicleParts,ui.hints.funStabilityControl,ui.hints.recoverVehicle,ui.hints.oldCarsBurn,ui.hints.smokingWheels,ui.hints.carsBurnFuel,ui.hints.delicateCars,ui.hints.stabilityControlPresent,ui.hints.absWasOptional,ui.hints.installRollCage,ui.hints.spatialNavigation,ui.hints.repairHood,ui.hints.slowMotionPhysics,ui.hints.removeRearSeats,ui.hints.tuning,ui.hints.customLicensePlate,ui.hints.driveAtNight,ui.hints.moonGravity,ui.hints.unlockExtraFunctionality,ui.hints.playMultiseat,ui.hints.increaseGroundClearance,ui.hints.tiresBurstOnBumps,ui.hints.blueSmokeIsPistonDamage,ui.hints.keepTheEngineUpright,ui.hints.thermalDebugApp,ui.hints.rollPitchApps,ui.hints.cruiseControlApp,ui.hints.driveTheCanon,ui.hints.vehicleSkins,ui.hints.toggleMods,ui.hints.importveFramerate,ui.hints.photoModeMenu,ui.hints.publishScreenshots,ui.hints.towTrailer,ui.hints.brakesAndSteeringVary,ui.hints.countersteerEarly,ui.hints.startSlow,ui.hints.parkingbrakeForTurning,ui.hints.carefulWithOldSportsCars,ui.hints.corneringWithKeyboard,ui.hints.adaptToBadRoads,ui.hints.notAllCarsCanRace,ui.hints.changeBrakePads,ui.hints.useTurnSignals,ui.hints.showStandalonePcs,ui.hints.tweakFOV,ui.hints.driveWithMouse,ui.hints.liftOffOversteer,ui.hints.snapOversteer,ui.hints.slideBackWithParkingBrake,ui.hints.customizeSpecializedBindings,ui.hints.toggleFogLights,ui.hints.toggleLightBars,ui.hints.TrackIRSupported,ui.hints.chooseShiftingMode,ui.hints.saveRestoreVehicleHome,ui.hints.switchVehicle,ui.hints.coolantVaporizes,ui.hints.dontRunIntoTheCar`.split(`,`),_hoisted_1$286={key:0,class:`progress-box`},_hoisted_2$234={class:`progress-icon-group`},_hoisted_3$208={class:`progress-bar-container`},_hoisted_4$178={class:`progress-status`},_hoisted_5$153={class:`progress-history`},_hoisted_6$132={class:`custom-left-container`},_hoisted_7$118={key:0,class:`custom-text-panel`},_hoisted_8$99={key:1,class:`text`},_hoisted_9$89={key:1,class:`custom-indeterminate-panel`},_hoisted_10$77={class:`custom-right-container`},_hoisted_11$69={key:2,class:`tips-bar`},_hoisted_12$57={class:`tips-bar-title`},_hoisted_13$49={class:`tips-bar-tip`},_hoisted_14$44={key:0,class:`loading-cache`},_hoisted_15$42=[`src`],imagesAmount=18,activeRepeatTime=1e4,fadeInDefault=1e3,fadeOutDefault=2e3,_sfc_main$323={__name:`LoadingScreen`,setup(__props){useCssVars(_ctx=>({v79c091d8:fadeInTimeVar.value,v07559aed:fadeOutTimeVar.value}));let events$3=useEvents(),{lua}=useBridge(),navBlocker=useUINavBlocker(),lastImageNum=-1,repeatTimer=null,customTimer=null,iconsList=[{id:`terrain`,icon:icons.terrain},{id:`environment`,icon:icons.water},{id:`forest`,icon:icons.trafficCone},{id:`meshes`,icon:icons.garage01},{id:`roads`,icon:icons.road},{id:`beamng`,icon:icons.beamNG}],state=reactive({active:!1,visible:!1,fading:!1,shown:!1,autoActivate:!0,highSeas:!1,mode:`progress`,image:null,iconState:{},currentEntries:[],historyEntriesDisplay:[],customContent:null,fadeInTime:fadeInDefault,fadeOutTime:fadeOutDefault,customPause:-1});function resetState(){state.mode=`progress`,state.customContent=null,state.iconState={},state.currentEntries=[],state.historyEntriesDisplay=[],state.fadeInTime=fadeInDefault,state.fadeOutTime=fadeOutDefault,state.customPause=-1}let tip=ref(``),setTip=(txt=void 0,_retrying=!1)=>{let idx=~~(Math.random()*hints_default.length);tip.value=txt||hints_default[idx],(!tip.value||tip.value===`undefined`)&&(logger_default.debug(`Loading Screen tip is undefined!\nARG: ${JSON.stringify(txt)} TIP: ${JSON.stringify(tip.value)} IDX: ${idx}/${hints_default.length}`),_retrying?tip.value=``:setTip(void 0,!0))},fadeInTimeVar=computed(()=>state.fadeInTime+`ms`),fadeOutTimeVar=computed(()=>state.fadeOutTime+`ms`),progressValue=computed(()=>state.currentEntries[0]?.progress||0),currentStatus=computed(()=>state.currentEntries[0]?.message||``);events$3.on(`LoadingScreen`,data=>{if(window.beamng?.ingame){if((!data||typeof data!=`object`)&&(data={}),state.autoActivate=!1,state.active=!!data.active,data.custom&&(state.mode=`custom`,state.fadeInTime=data.custom.fadeIn>0?data.custom.fadeIn*1e3:state.fadeInTime||0,state.fadeOutTime=data.custom.fadeOut>0?data.custom.fadeOut*1e3:state.fadeOutTime||0),state.active)data.custom?(state.customPause=data.custom.pause?data.custom.pause*1e3:-1,state.customContent=data.custom.data,state.customContent?.image&&(state.image=state.customContent.image)):(resetState(),window.bngVue.gotoAngularState(`blank`)),setTip(state.customContent?.tips);else if(state.mode===`progress`&&`gotoMainMenu`in data){let args=[];data.gotoMainMenu?args.push(`menu.mainmenu`):args.push(`menu`,[`loading`]),window.globalAngularRootScope?.$broadcast(`ChangeState`,...args),window.vueEventBus?.emit(`onChangeState`,...args)}}}),events$3.on(`UpdateLoadingProgressV2`,data=>{if(!window.beamng?.ingame||!state.autoActivate&&!state.active)return;let{currentEntries,historyEntries}=data;(!currentEntries||!Array.isArray(currentEntries))&&(currentEntries=[]),(!historyEntries||!Array.isArray(historyEntries))&&(historyEntries=[]),state.currentEntries=currentEntries,state.historyEntriesDisplay=historyEntries.slice(Math.max(historyEntries.length-3,1)),state.iconState={};for(let{name,progress}of currentEntries)state.iconState[name.toLowerCase()]=progress;for(let{name}of historyEntries)state.iconState[name.toLowerCase()]=100;state.autoActivate&&(state.active=currentEntries.length>0||historyEntries.length>0)});let onFadeIn=()=>{state.fading=!1,state.mode===`progress`?(lua.core_gamestate.loadingScreenActive(),repeatTimer=setTimeout(()=>{lua.core_gamestate.loadingScreenActive()},activeRepeatTime)):state.mode===`custom`&&(lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(1),state.customPause!==-1&&(customTimer=setTimeout(()=>{lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(2)},state.customPause*1e3)))},onFadeOut=()=>{state.fading=!1,state.shown=!1,state.mode===`custom`&&lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(3),resetState(),loadNextImage()};watch(()=>state.active,(newActive,oldActive)=>{window.beamng?.ingame&&(newActive&&!oldActive?activateLoading():!newActive&&oldActive&&deactivateLoading())});let activateLoading=()=>{state.active&&(deactivateLoading.cancel(),navBlocker.allowOnly([]),nextTick(()=>{state.visible=!0,state.fading=!0,state.shown=!0}))},deactivateLoading=debounce(()=>{state.active||(clearTimers(),navBlocker.clear(),nextTick(()=>{state.visible=!1,state.fading=!0}))},100),getRandomImageNum=()=>{let rnd=~~(Math.random()*imagesAmount)+1;return rnd===lastImageNum?getRandomImageNum():(lastImageNum=rnd,rnd)},getNextImageUrl=()=>{let url;return url=state.highSeas?`images/mainmenu/unofficial_version.jpg`:`images/loading/drive/${getRandomImageNum()}.jpg`,getAssetURL(url)},loadNextImage=async()=>{let url=getNextImageUrl();state.image!==url&&(await loadImage$1(url),state.image=url)},loadImage$1=url=>new Promise((resolve$1,reject)=>{let img=new Image;img.onload=()=>resolve$1(url),img.onerror=()=>reject(url),img.src=url}),clearTimers=()=>{repeatTimer&&=(clearTimeout(repeatTimer),null),customTimer&&=(clearTimeout(customTimer),null)},initLoadingScreen=()=>bngApi.engineLua(`sailingTheHighSeas`,async ahoy=>{state.highSeas=ahoy===!0,await loadNextImage(),setTip(),lua.core_gamestate.loadingScreenActive(),window.loadingTest=active=>{events$3.emit(`LoadingScreen`,{active})}});return onMounted(()=>{linkLoadingScreenState(state),initLoadingScreen()}),onUnmounted(()=>clearTimers()),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(Transition,{name:`loading-fade`,onAfterEnter:onFadeIn,onAfterLeave:onFadeOut},{default:withCtx(()=>[state.visible?(openBlock(),createElementBlock(`dialog`,{key:0,open:``,class:normalizeClass([`loading-screen`,`loading-screen-${state.mode}`])},[createBaseVNode(`div`,{class:`loading-background`,style:normalizeStyle({backgroundImage:state.image?`url('${state.image}')`:`none`})},null,4),state.mode===`progress`?(openBlock(),createElementBlock(`div`,_hoisted_1$286,[createBaseVNode(`div`,_hoisted_2$234,[(openBlock(),createElementBlock(Fragment,null,renderList(iconsList,iconInfo=>createBaseVNode(`div`,{key:iconInfo.id,class:`progress-icon-box`,style:normalizeStyle({backgroundPosition:`0 ${state.iconState[iconInfo.id]||0}%`})},[createVNode(unref(bngIcon_default),{type:iconInfo.icon,color:`#fff`,class:`progress-icon`},null,8,[`type`])],4)),64))]),createBaseVNode(`div`,_hoisted_3$208,[createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,value:progressValue.value},null,8,[`value`])]),createBaseVNode(`div`,_hoisted_4$178,toDisplayString(currentStatus.value||_ctx.$tt(`ui.common.loading`)),1),createBaseVNode(`div`,_hoisted_5$153,[(openBlock(!0),createElementBlock(Fragment,null,renderList(state.historyEntriesDisplay,(item,idx)=>(openBlock(),createElementBlock(`div`,{key:idx},toDisplayString(item.message),1))),128))])])):createCommentVNode(``,!0),state.mode===`custom`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`custom-box`,{"custom-with-tips":state.customContent?.tips}])},[createBaseVNode(`div`,_hoisted_6$132,[state.customContent&&(state.customContent.title||state.customContent.text)?(openBlock(),createElementBlock(`div`,_hoisted_7$118,[state.customContent.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:[_ctx.$tt(state.customContent.subtitle)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(state.customContent.title)),1)]),_:1},8,[`preheadings`])):createCommentVNode(``,!0),state.customContent.text?(openBlock(),createElementBlock(`p`,_hoisted_8$99,[createVNode(unref(dynamicComponent_default),{"translate-id":state.customContent.text,bbcode:``,"translate-context":``},null,8,[`translate-id`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_9$89,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.common.loading.short`)),1)]),_:1}),createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,indeterminate:``})]))]),createBaseVNode(`div`,_hoisted_10$77,[state.customContent&&state.customContent.image?(openBlock(),createElementBlock(`div`,{key:0,class:`custom-image-panel`,style:normalizeStyle({backgroundImage:`url('${state.customContent.image}')`})},null,4)):createCommentVNode(``,!0)])],2)):createCommentVNode(``,!0),state.mode===`progress`||state.customContent?.tips?(openBlock(),createElementBlock(`div`,_hoisted_11$69,[createBaseVNode(`div`,_hoisted_12$57,toDisplayString(_ctx.$tt(`ui.loadingScreen.tips`))+`:`,1),createBaseVNode(`div`,_hoisted_13$49,[createVNode(unref(dynamicComponent_default),{"translate-id":tip.value,bbcode:``},null,8,[`translate-id`])])])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)]),_:1}),state.image?(openBlock(),createElementBlock(`div`,_hoisted_14$44,[createBaseVNode(`img`,{src:state.image,alt:``},null,8,_hoisted_15$42)])):createCommentVNode(``,!0)],64))}},LoadingScreen_default=__plugin_vue_export_helper_default(_sfc_main$323,[[`__scopeId`,`data-v-2f135df0`]]),_hoisted_1$285={class:`pause-button-wrapper`},_sfc_main$322={__name:`pauseButton`,props:{teleportTo:[String,Object]},setup(__props){let route=useRoute(),events$3=useEvents(),gameContext=useGameContextStore(),isGamePaused=ref(!1),physicsMaybePaused=ref(!1),replayActive=ref(!1),replayPaused=ref(!1);events$3.on(`physicsStateChanged`,state=>{physicsMaybePaused.value=!state}),events$3.on(`replayStateChanged`,core_replay=>{replayActive.value=core_replay.state===`playback`,replayPaused.value=replayActive.value&&core_replay.paused}),events$3.on(`simTimeAuthority.pauseStateChanged`,data=>{isGamePaused.value=data.paused});let isInMenu=computed(()=>route.name?.startsWith(`menu`)&&!gameContext.activities?.length&&sysInfo_default.gameState.value!==void 0&&sysInfo_default.gameState.value!==`loading`),isPhysicsPaused=computed(()=>physicsMaybePaused.value),isReplayPaused=computed(()=>replayActive.value&&replayPaused.value),showPauseButton=computed(()=>isInMenu.value||isPhysicsPaused.value||isReplayPaused.value),isPaused=computed(()=>isGamePaused.value||isPhysicsPaused.value||isReplayPaused.value),buttonState=computed(()=>isInMenu.value&&isPaused.value?`menu-paused`:isInMenu.value?`menu`:isPaused.value?`paused`:`default`),togglePause=()=>{Lua_default.simTimeAuthority.togglePause()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$285,[(openBlock(),createBlock(Teleport,{disabled:!__props.teleportTo,to:__props.teleportTo},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:normalizeClass([`pause-button`,buttonState.value]),accent:unref(ACCENTS).custom,"no-sound":``,onClick:togglePause,"bng-no-nav":``},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{class:`pause-button-binding-bg`,action:`pause`}),createVNode(unref(bngIcon_default),{class:`pause-button-icon`,type:isPaused.value?unref(icons).pause:unref(icons).play},null,8,[`type`])]),_:1},8,[`class`,`accent`])),[[vShow,showPauseButton.value],[unref(BngTooltip_default),_ctx.$tt(`ui.inputActions.general.pause.title`),void 0,{bottom:!0}]])],8,[`disabled`,`to`]))]))}},pauseButton_default=__plugin_vue_export_helper_default(_sfc_main$322,[[`__scopeId`,`data-v-ea9a26b4`]]),UIAppStorage,setupDone;const useUIApps=()=>(setupDone||setup(),service);var setup=()=>{UIAppStorage||=window.UIAppStorage,setupDone=!!UIAppStorage},setLayout=layoutName=>{layoutName==`blank`?_broadcast(`appContainer:clear`):_broadcast(`appContainer:loadLayoutByType`,layoutName)},setVisible=state=>{_broadcast(`ShowApps`,!!state)},service={setLayout,setVisible,get currentLayout(){return UIAppStorage.currentLayout}},_broadcast=(...params)=>{window.globalAngularRootScope&&window.globalAngularRootScope.$broadcast(...params)},_sfc_main$321={};function _sfc_render$3(_ctx,_cache){return openBlock(),createElementBlock(`span`)}var NotFound_default=__plugin_vue_export_helper_default(_sfc_main$321,[[`render`,_sfc_render$3]]);function useGridSelector(backendName=`gridSelector`,defaultPath={keys:[`missions`]},defaultDetailsMode=`detail`){let currentPath=ref(defaultPath),previousPath=ref(null),groups=ref([]),filterList=ref([]),filterByProp=ref([]),commonFilters=ref([]),lockedFiltersByProp=ref([]),activeFilters=ref([]),onlyCommonFilters=ref(!0),detailsMode=ref(defaultDetailsMode),selectedItem=ref(null),selectedItemDetails=ref(null),prevSelectedItem=ref(null),previewItem=ref(null),previewItemDetails=ref(null),managementDetails=ref(null),autoFocusKey=ref(null),showScreenHeader=ref(!0),screenHeaderTitle=ref(`Grid Selector`),screenHeaderPath=ref([{text:`Menu`,gotoAngularState:`menu`}]),{events:events$3}=useBridge(),backFromDetailsCallback=null,refreshAllHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshAll`),loadTiles(),loadFilters(),loadManagementDetails())},refreshCurrentItemDetailsHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshCurrentItemDetails`),setSelectedItem(selectedItem.value))};events$3.on(`gridSelectorRefreshAll`,refreshAllHandler),events$3.on(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler);let log=(...args)=>{},displayData=ref([]),searchText$1=ref(``);async function getSearchText(){try{let data=await Lua_default.ui_gridSelector.getSearchText(backendName);return searchText$1.value=data||``,data||``}catch(error){return logger_default.error(`Failed to get search text:`,error),``}}async function setSearchText(value){try{await Lua_default.ui_gridSelector.setSearchText(backendName,value),searchText$1.value=value||``,await loadTiles(),await loadFilters(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to set search text:`,error)}}let isInitializing=ref(!1),safeArray=arr=>Array.isArray(arr)?arr:[];async function setCurrentPath(path){currentPath.value=path,await loadTiles()}async function loadTiles(){currentPath.value;try{let data=await Lua_default.ui_gridSelector.getTiles(backendName,currentPath.value,previousPath.value!==currentPath.value);if(Lua_default.ui_gridSelector.profilerFinish(backendName,`received lua data on UI`),groups.value=safeArray(data),groups.value,!selectedItem.value&&(detailsMode.value===`advanced`||detailsMode.value===`detail`)&&previousPath.value!==currentPath.value)for(let group of groups.value)for(let tile of group.tiles)tile.isDefaultSelected&&(autoFocusKey.value=tile.key,tile.name,tile.forceAutoFocus&&backFromDetailsCallback());previousPath.value=currentPath.value,Lua_default.ui_gridSelector.profilerFinish(backendName,`loaded tiles into reactive state`)}catch(error){logger_default.error(`Failed to load tiles:`,error)}}async function loadFilters(){try{let data=await Lua_default.ui_gridSelector.getFilters(backendName);filterList.value=safeArray(data.filterList),filterByProp.value=data.filterByProp,commonFilters.value=safeArray(data.commonFilters)||[],lockedFiltersByProp.value=data.lockedFiltersByProp||[],activeFilters.value=safeArray(data.activeFilters),onlyCommonFilters.value=data.onlyCommonFilters,filterList.value,filterByProp.value,activeFilters.value,onlyCommonFilters.value}catch(error){logger_default.error(`Failed to load filters:`,error)}}async function loadManagementDetails(){try{managementDetails.value=await Lua_default.ui_gridSelector.getManagementDetails(backendName),managementDetails.value}catch(error){logger_default.error(`Failed to load management details:`,error)}}async function toggleFilter(propName,option){try{await Lua_default.ui_gridSelector.toggleFilter(backendName,propName,option),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to toggle filter:`,error)}}async function updateRangeFilter(propName,min$1,max$1){try{await Lua_default.ui_gridSelector.updateRangeFilter(backendName,propName,min$1,max$1),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update range filter:`,error)}}async function resetRangeFilter(propName){console.log(`Resetting range filter:`,propName);try{await Lua_default.ui_gridSelector.resetRangeFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset range filter:`,error)}}async function resetSetFilter(propName){try{await Lua_default.ui_gridSelector.resetSetFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset set filter:`,error)}}async function loadDisplayData(){try{displayData.value=safeArray(await Lua_default.ui_gridSelector.getDisplayDataOptions(backendName));let searchOption=displayData.value.find(option=>option.key===`searchText`);searchOption&&(searchText$1.value=searchOption.value||``),displayData.value}catch(error){logger_default.error(`Failed to load display data:`,error)}}async function updateDisplayData(key,value){try{await Lua_default.ui_gridSelector.setDisplayDataOption(backendName,key,value),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update display data:`,error)}}async function resetDisplayDataToDefaults(){try{await Lua_default.ui_gridSelector.resetDisplayDataToDefaults(backendName),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset display data to defaults:`,error)}}function setDetailsMode(mode){detailsMode.value=mode}async function setSelectedItem(item){if(!item||!item.showDetails){autoFocusKey.value=null,selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails();return}try{item.showDetails;let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);autoFocusKey.value=item.key,selectedItem.value=item,selectedItemDetails.value=details,details?.paintData&&details?.paints&&selectedItemDetails.value?.paints&&(selectedItemDetails.value.paints.multiPaintSetups=safeArray(selectedItemDetails.value.paints.multiPaintSetups),selectedItemDetails.value.paints.factoryPaints=safeArray(selectedItemDetails.value.paints.factoryPaints)),setDetailsMode(`detail`)}catch(error){logger_default.error(`Failed to get item details:`,error),autoFocusKey.value=null,selectedItem.value=item,selectedItemDetails.value=null}}async function clearSelectedItem(){selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails()}async function setPreviewItem(item){if(!item||!item.showDetails){previewItem.value=null,previewItemDetails.value=null;return}try{let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);previewItem.value=item,previewItemDetails.value=details,setDetailsMode(`detail`)}catch{previewItem.value=item,previewItemDetails.value=null}}function clearPreviewItem(){previewItem.value=null,previewItemDetails.value=null}let activeItem=computed(()=>selectedItem.value||previewItem.value),activeItemDetails=computed(()=>selectedItem.value?selectedItemDetails.value:previewItemDetails.value);async function executeButton(buttonId,additionalData){try{if(additionalData?.waitForLoadingScreen)window.vueEventBus?.emit(`LoadingScreen`,{active:!0}),await startLoading(async()=>{await waitForLoadingScreenFadeIn();let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)});else{let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)}}catch(error){logger_default.error(`Failed to execute button:`,error)}}let executeButtonHandler=(backendName$1,buttonId,additionalData)=>{backendName$1===backendName$1&&executeButton(buttonId,additionalData)};events$3.on(`gridSelectorExecuteButton`,executeButtonHandler);async function toggleFavourite(item){await Lua_default.ui_gridSelector.toggleFavourite(backendName,item.showDetails);let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);selectedItem.value=item,selectedItemDetails.value=details,await loadTiles()}function clearSearch(){setSearchText(``)}function updateSearch(newSearchText){setSearchText(newSearchText||``)}function commitSearch(){setSearchText(searchText$1.value||``)}function isFilterLocked(propName,option=null){return lockedFiltersByProp.value[propName]?option?lockedFiltersByProp.value[propName][option]!==void 0:Object.keys(lockedFiltersByProp.value[propName]).length>0:!1}async function updateScreenHeaderData(){try{let headerData=await Lua_default.ui_gridSelector.getScreenHeaderTitleAndPath(backendName,currentPath.value);screenHeaderTitle.value=headerData.title||`Grid Selector`,screenHeaderPath.value=headerData.pathSegments}catch(error){logger_default.error(`Failed to update screen header title:`,error),screenHeaderTitle.value=`Grid Selector`,screenHeaderPath.value=[{text:`Menu`,gotoAngularState:`menu`}]}}function isFilterOptionLocked(propName,option){return isFilterLocked(propName,option)}function isRangeFilterLocked(propName){return isFilterLocked(propName)}watch(currentPath,()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch([filterByProp,activeFilters],()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch(displayData,()=>{updateScreenHeaderData()},{deep:!0});function notifyUIReady(tag){Lua_default.ui_gridSelector.profilerFinish(backendName,tag)}function setOnBackFromDetailsCallback(callback){backFromDetailsCallback=callback}async function initialize(){if(!isInitializing.value)try{isInitializing.value=!0,await Promise.all([loadFilters(),loadDisplayData(),loadManagementDetails(),getSearchText()])}catch(error){logger_default.error(`Failed to initialize GridSelector composable:`,error)}finally{isInitializing.value=!1}}return onUnmounted(()=>{logger_default.debug(`GridSelector composable unmounting`),events$3.off(`gridSelectorRefreshAll`,refreshAllHandler),events$3.off(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler),events$3.off(`gridSelectorExecuteButton`,executeButtonHandler)}),{groups,filterList,filterByProp,lockedFiltersByProp,commonFilters,activeFilters,onlyCommonFilters,displayData,currentPath,detailsMode,selectedItem,selectedItemDetails,prevSelectedItem,previewItem,previewItemDetails,activeItem,activeItemDetails,managementDetails,isInitializing,searchText:searchText$1,getSearchText,setSearchText,autoFocusKey,showScreenHeader,screenHeaderTitle,screenHeaderPath,initialize,setCurrentPath,loadTiles,loadFilters,loadManagementDetails,toggleFilter,updateRangeFilter,resetRangeFilter,resetSetFilter,loadDisplayData,updateDisplayData,resetDisplayDataToDefaults,setDetailsMode,setSelectedItem,clearSelectedItem,setPreviewItem,clearPreviewItem,executeButton,notifyUIReady,isFilterLocked,isFilterOptionLocked,isRangeFilterLocked,toggleFavourite,clearSearch,updateSearch,commitSearch,updateScreenHeaderData,exploreFolder:function(path){Lua_default.ui_gridSelector.exploreFolder(backendName,path)},goToMod:function(modId){Lua_default.ui_gridSelector.goToMod(backendName,modId)},setOnBackFromDetailsCallback}}var _hoisted_1$284=[`bng-scoped-nav-autofocus`],_hoisted_2$233={class:`image-container`},_hoisted_3$207={key:0,class:`sub-element-count-badge`},_hoisted_4$177={class:`item-label`},_hoisted_5$152={class:`item-name`},_hoisted_6$131={class:`icons-container`},_hoisted_7$117=[`src`],_hoisted_8$98={key:0,class:`sub-element-count-badge`},_hoisted_9$88={key:1},sizes={tiny:{width:7.5,margin:.5,fontSize:.8},small:{width:9.5,margin:.5,fontSize:1},medium:{width:12,margin:.5,fontSize:1},large:{width:16,margin:.5,fontSize:1},huge:{width:20,margin:.5,fontSize:1.5},list:{width:22,height:3,margin:.5,fontSize:.9}},thumbAspectRatio=16/9.5,captionHeightEm=2,getSizeCalc=displaySize=>ctx=>{let size$3=sizes[displaySize]||sizes.medium;if(displaySize===`list`)return{width:size$3.width,height:size$3.height,margin:size$3.margin};let height$1=size$3.width/thumbAspectRatio+size$3.fontSize*captionHeightEm-size$3.margin*2;return{width:size$3.width,height:height$1,margin:size$3.margin}},__default__$6={getSizeCalc},_sfc_main$320=Object.assign(__default__$6,{__name:`Tile`,props:{tile:{type:Object,required:!0},isFavourite:Boolean,isConfig:Boolean,displaySize:String,tileImagesTopAligned:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`click`,`dblclick`],setup(__props,{expose:__expose,emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,gridSelectionState=inject(`gridSelectionState`,null),state=computed(()=>{let res={selected:!1,dimmed:!1,isAutoFocused:!1};return gridSelectionState&&gridSelectionState.value&&(res.selected=gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey===props.tile.key,res.dimmed=showIfController.value&&gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey!==props.tile.key,res.isAutoFocused=gridSelectionState.value.autoFocusKey===props.tile.key),res}),emit$1=__emit,elTile=ref(null);__expose({getElement:()=>elTile.value});let isListItem=computed(()=>props.displaySize===`list`);function onClick(){emit$1(`click`)}function onFocus(){emit$1(`focus`)}function onBlur(){emit$1(`blur`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tile-wrapper`,`tile-size-${__props.displaySize}`]),style:normalizeStyle({"--tile-font-size":sizes[__props.displaySize].fontSize+`em`})},[_cache[0]||=createBaseVNode(`div`,{class:`tile-bg`},null,-1),withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`elTile`,ref:elTile,"bng-scoped-nav-autofocus":state.value.isAutoFocused,class:normalizeClass({tile:!0,selected:state.value.selected,dimmed:state.value.dimmed,auxiliary:__props.tile.isAuxiliary,"is-career-only":__props.tile.isCareerOnly}),onClick:withModifiers(onClick,[`stop`]),onFocus,onBlur,"bng-nav-item":``},[createBaseVNode(`div`,_hoisted_2$233,[createVNode(unref(bngImage_default),{class:normalizeClass([`item-image`,{"top-aligned":__props.tileImagesTopAligned}]),src:__props.tile.preview},null,8,[`class`,`src`]),isListItem.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`div`,_hoisted_3$207,toDisplayString(__props.tile.subElementCount),1)):createCommentVNode(``,!0),__props.isFavourite||__props.tile.showFavouriteIconPercent>=1?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:`star`})):createCommentVNode(``,!0)],64))]),createBaseVNode(`div`,_hoisted_4$177,[createBaseVNode(`span`,_hoisted_5$152,toDisplayString(__props.tile.name),1),createBaseVNode(`div`,_hoisted_6$131,[__props.tile.sourceIcons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.tile.sourceIcons,sourceIcon=>(openBlock(),createElementBlock(Fragment,{key:sourceIcon},[sourceIcon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:sourceIcon.icon,class:`source-icon`,color:`var(--bng-cool-gray-100)`},null,8,[`type`])):createCommentVNode(``,!0),sourceIcon.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:sourceIcon.svg,alt:``},null,8,_hoisted_7$117)):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0),isListItem.value&&__props.tile.showFavouriteIconPercent>0?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:__props.tile.showFavouriteIconPercent>=1?`star`:`starSecondary`},null,8,[`type`])):createCommentVNode(``,!0)]),isListItem.value&&!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`span`,_hoisted_8$98,toDisplayString(__props.tile.subElementCount),1)):isListItem.value?(openBlock(),createElementBlock(`span`,_hoisted_9$88)):createCommentVNode(``,!0)])],42,_hoisted_1$284)),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0,bubble:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`],[unref(BngDoubleClick_default),__props.tile.doubleClickDetails?()=>emit$1(`dblclick`):null,__props.tile.doubleClickMode]])],6))}}),Tile_default=__plugin_vue_export_helper_default(_sfc_main$320,[[`__scopeId`,`data-v-51fd3377`]]),_hoisted_1$283={class:`group-header`,"bng-list-title":``},_sfc_main$319={__name:`GroupHeader`,props:{label:{type:String,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$283,[createVNode(bngCardHeading_default,{class:`header-label`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.label),1)]),_:1}),_cache[0]||=createBaseVNode(`div`,{class:`header-line`},null,-1)]))}},GroupHeader_default=__plugin_vue_export_helper_default(_sfc_main$319,[[`__scopeId`,`data-v-28596ef8`]]),_sfc_main$318={__name:`Grid`,props:{autoFocusKey:{type:String,default:null},activeItem:{type:Object,default:null},groups:{type:Array,required:!0},isConfig:{type:Boolean,default:!1},displaySize:{type:String,default:`medium`,validator:value=>[`tiny`,`small`,`medium`,`large`,`huge`,`list`].includes(value)},inDetails:{type:Boolean,default:!1},backendName:{type:String,default:`gridSelector`},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null}},emits:[`select-item`,`deselect-item`,`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,gridListRef=ref(),containerWidth=ref(0),baseFontSize=ref(16),tileSizeCalc=ctx=>Tile_default.getSizeCalc(props.displaySize)(ctx),maxTilesPerRow=computed(()=>{if(!containerWidth.value)return 1/0;let size$3=Tile_default.getSizeCalc(props.displaySize)({}),tileWidthPx=(size$3.width+size$3.margin)*baseFontSize.value;return(Math.floor(containerWidth.value/tileWidthPx)||1)*(props.displaySize===`list`?2:1)}),limitedGroups=computed(()=>props.groups.map(group=>({...group,tiles:group.isRecentGroup?group.tiles.slice(0,maxTilesPerRow.value):group.tiles}))),updateContainerWidth=()=>{gridListRef.value?.$el&&(containerWidth.value=gridListRef.value.$el.clientWidth,baseFontSize.value=parseFloat(getComputedStyle(document.documentElement).fontSize)||16)},resizeObserver;onMounted(()=>{updateContainerWidth(),gridListRef.value?.$el&&(resizeObserver=new ResizeObserver(debounce(updateContainerWidth,100)),resizeObserver.observe(gridListRef.value.$el))}),onUnmounted(()=>{resizeObserver&&resizeObserver.disconnect()}),provide(`gridSelectionState`,computed(()=>({inDetails:props.inDetails,activeItemKey:props.activeItem?.key||null,autoFocusKey:props.autoFocusKey})));let focusItem=tile=>{props.inDetails||(showIfController.value&&preselectItem(tile),emit$1(`focus-item`,tile))},selectItem=tile=>{preselectItem.cancel(),emit$1(`select-item`,tile)},preselectItem=debounce(tile=>emit$1(`select-item`,tile,!1),200),handleDoubleClick=async item=>{if(console.log(`handleDoubleClick`,item),item.doubleClickDetails)try{props.doubleClickOverride?props.doubleClickOverride(item):await Lua_default.ui_gridSelector.executeDoubleClick(props.backendName,item.doubleClickDetails)}catch(error){console.error(`Failed to execute double click:`,error)}};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngList_default),{ref_key:`gridListRef`,ref:gridListRef,class:`grid-list`,layout:unref(LIST_LAYOUTS).TILES,"no-background":``,big:``,immediate:``,"keep-alive":500,"title-width":20,"title-height":1.5,"title-margin":.5,"tile-size-calc":tileSizeCalc},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(limitedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[group.label?(openBlock(),createBlock(GroupHeader_default,{key:0,label:group.label,"bng-list-title":``},null,8,[`label`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.tiles,tile=>(openBlock(),createBlock(Tile_default,{key:tile.key,tile,"is-config":__props.isConfig,"display-size":__props.displaySize,"is-favourite":group.label===`Favourites`,"tile-images-top-aligned":__props.tileImagesTopAligned,onFocus:$event=>focusItem(tile),onClick:$event=>selectItem(tile),onDblclick:$event=>handleDoubleClick(tile)},null,8,[`tile`,`is-config`,`display-size`,`is-favourite`,`tile-images-top-aligned`,`onFocus`,`onClick`,`onDblclick`]))),128))],64))),128))]),_:1},8,[`layout`]))}},Grid_default$1=__plugin_vue_export_helper_default(_sfc_main$318,[[`__scopeId`,`data-v-efa73a51`]]),_hoisted_1$282={class:`display-controls-container`},_hoisted_2$232={class:`control-group-label`},_hoisted_3$206={key:0,class:`reset-button-container`},_sfc_main$317={__name:`DisplayControls`,props:{displayData:{type:Array,required:!0},detailsMode:{type:String,required:!0},updateDisplayData:{type:Function,required:!0},resetDisplayDataToDefaults:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,booleanToStringByKey=computed(()=>{let valuesByKey={};for(let option of props.displayData)if(option.type===`checkbox`){valuesByKey[option.key]={};for(let checkboxOption of option.options)valuesByKey[option.key][checkboxOption.value]=checkboxOption.label||(checkboxOption.value?`Yes`:`No`)}return valuesByKey}),controls$1=computed(()=>props.displayData.filter(x=>x.showInModes?.[props.detailsMode]).map(x=>({...x,checkboxLabel:x.type===`checkbox`?booleanToStringByKey.value[x.key]?.[x.value]:void 0}))),onOptionChanged=(key,newValue)=>{props.updateDisplayData(key,newValue),emit$1(`focus-item`,key)},resetToDefaults=()=>{props.resetDisplayDataToDefaults()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$282,[createBaseVNode(`div`,{class:normalizeClass([`display-controls`,{"display-controls-list":__props.detailsMode===`displayControls`||__props.detailsMode===`default`}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(controls$1.value,option=>(openBlock(),createElementBlock(`div`,{key:option.key,class:normalizeClass([`control-group`,{"force-full-width":__props.detailsMode===`default`}])},[createBaseVNode(`div`,_hoisted_2$232,toDisplayString(option.label),1),createVNode(bngTooltip_default,{text:option.description||`No description available`,position:`top`},{default:withCtx(()=>[option.type===`dropdown`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,items:option.options||[],"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),threshold:8},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`checkbox`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,class:normalizeClass([`full-width-checkbox`,{active:option.value}]),modelValue:option.value,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),labelBefore:``,alwaysTransparent:``},{default:withCtx(()=>[createTextVNode(toDisplayString(option.checkboxLabel),1)]),_:2},1032,[`class`,`modelValue`,`onUpdate:modelValue`])):option.type===`number`?(openBlock(),createBlock(unref(bngInputNew_default),{key:2,modelValue:option.value,min:option.min,max:option.max,showExternalButton:!1,type:`number`,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue)},null,8,[`modelValue`,`min`,`max`,`onUpdate:modelValue`])):createCommentVNode(``,!0)]),_:2},1032,[`text`])],2))),128))],2),__props.detailsMode===`displayControls`?(openBlock(),createElementBlock(`div`,_hoisted_3$206,[createVNode(unref(bngButton_default),{onClick:resetToDefaults,accent:`attention`,iconLeft:`trashBin1`,class:`reset-button`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Reset to Defaults `,-1)]]),_:1})])):createCommentVNode(``,!0)]))}},DisplayControls_default=__plugin_vue_export_helper_default(_sfc_main$317,[[`__scopeId`,`data-v-863e411a`]]),_sfc_main$316={__name:`SearchBar`,props:{searchText:{type:String,required:!0},setSearchText:{type:Function,required:!0},placeholder:{type:String,default:`Search...`},fullWidth:{type:Boolean,default:!1},showClearAllButton:{type:Boolean,default:!1}},emits:[`focus-item`,`clear-all`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clearSearch=()=>{props.setSearchText(``),emit$1(`focus-item`,`search`)},commitSearch=()=>{},onSearchChanged=value=>{props.setSearchText(value),emit$1(`focus-item`,`search`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`search-container`,{"full-width":__props.fullWidth}])},[createVNode(unref(bngInput_default),{class:`search-input`,modelValue:__props.searchText,placeholder:__props.placeholder,onValueChanged:onSearchChanged,onKeydown:withKeys(commitSearch,[`enter`]),onBlur:commitSearch,onFocus:_cache[0]||=$event=>emit$1(`focus-item`,`search`)},null,8,[`modelValue`,`placeholder`]),createBaseVNode(`div`,{class:normalizeClass([`search-icon-container`,{active:__props.searchText}]),onClick:clearSearch},[createVNode(unref(bngIcon_default),{type:unref(icons).search,class:`search-icon show-unhovered`},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).trashBin2,class:`search-icon show-hovered`},null,8,[`type`])],2)],2))}},SearchBar_default=__plugin_vue_export_helper_default(_sfc_main$316,[[`__scopeId`,`data-v-67aff9c0`]]),_hoisted_1$281={class:`filters`},_hoisted_2$231={key:0,class:`search-section`},_hoisted_3$205={key:1,class:`filter-options-grid`},_hoisted_4$176={class:`option-label`},_hoisted_5$151={class:`option-icon`},_hoisted_6$130={key:2,class:`filters-container`},_hoisted_7$116={class:`filter-container`,navigable:``,tabindex:`0`},_hoisted_8$97={class:`filter-content`},_hoisted_9$87={key:0,class:`filter-options`},_hoisted_10$76={class:`filter-options-grid`},_hoisted_11$68={class:`option-label`},_hoisted_12$56={class:`option-icon`},_hoisted_13$48={key:1,class:`filter-options`},_hoisted_14$43={class:`range-bar-container`},_hoisted_15$41={class:`range-bar`},_hoisted_16$39={class:`range-inputs`},_hoisted_17$32={class:`range-input-group`},_hoisted_18$29={class:`range-input-group`},_sfc_main$315={__name:`DetailedFilters`,props:{filterList:{type:Array,required:!0},filterByProp:{type:Object,required:!0},searchText:{type:String,default:``},commonFilters:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},onlyCommonFilters:{type:Boolean,default:!0},isFilterLocked:{type:Function,required:!0},isFilterOptionLocked:{type:Function,required:!0},isRangeFilterLocked:{type:Function,required:!0},toggleFilter:{type:Function,required:!0},updateRangeFilter:{type:Function,required:!0},resetRangeFilter:{type:Function,required:!0},setSearchText:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,expandedAccordions=ref({}),pendingRangeUpdates=ref({}),debouncedUpdateFunctions=ref({}),getDebouncedUpdate=propName=>(debouncedUpdateFunctions.value[propName]||(debouncedUpdateFunctions.value[propName]=debounce(()=>{if(pendingRangeUpdates.value[propName]){let{min:min$1,max:max$1}=pendingRangeUpdates.value[propName];props.updateRangeFilter(propName,min$1,max$1),delete pendingRangeUpdates.value[propName]}},300)),debouncedUpdateFunctions.value[propName]);onUnmounted(()=>{Object.values(debouncedUpdateFunctions.value).forEach(debouncedFn=>{debouncedFn&&debouncedFn.cancel&&debouncedFn.cancel()}),debouncedUpdateFunctions.value={},pendingRangeUpdates.value={}});let formatFilterName=key=>key,getFilterOptionClass=(propName,option)=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||!filter.options)return``;let allEnabled=filter.options.every(opt=>props.filterByProp[propName]?.[opt]===!0),currentOptionEnabled=props.filterByProp[propName]?.[option]===!0;return allEnabled?`filter-neutral`:currentOptionEnabled?`filter-active`:`filter-inactive`},hasActiveFilters=propName=>{if(!props.filterList)return!1;let filter=props.filterList.find(f=>f.propName===propName);if(!filter)return!1;if(filter.type===`range`){let filterData=props.filterByProp[propName];if(!filterData)return!1;let currentMin=filterData.min,currentMax=filterData.max,defaultMin=filter.min,defaultMax=filter.max;return currentMin>defaultMin||currentMaxprops.filterByProp[propName]?.[option]===!1)},toggleFilter=(propName,option,event)=>{if(props.isFilterOptionLocked(propName,option)){console.log(`Cannot toggle locked filter:`,propName,option);return}event&&(event.preventDefault(),event.stopPropagation()),emit$1(`focus-item`,`filters`),props.toggleFilter(propName,option)},onRangeFilterChanged=(propName,newValue,field)=>{if(props.isRangeFilterLocked(propName)){console.log(`Cannot update locked range filter:`,propName);return}let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return;let filterData=props.filterByProp[propName];if(!filterData)return;let currentPending=pendingRangeUpdates.value[propName],min$1=currentPending?currentPending.min:filterData.min,max$1=currentPending?currentPending.max:filterData.max;field===`min`?min$1=newValue:field===`max`&&(max$1=newValue),min$1=Math.max(filter.min,Math.min(filter.max,min$1)),max$1=Math.max(filter.min,Math.min(filter.max,max$1)),min$1>max$1&&([min$1,max$1]=[max$1,min$1]),pendingRangeUpdates.value[propName]={min:min$1,max:max$1},getDebouncedUpdate(propName)(),emit$1(`focus-item`,propName)},isFilterActive=filter=>hasActiveFilters(filter.propName),getRangeBarStyle=propName=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return{};let filterData=props.filterByProp[propName];if(!filterData)return{};let currentMin=filterData.min,currentMax=filterData.max,totalRange=filter.max-filter.min,leftPosition=(currentMin-filter.min)/totalRange*100,width$1=(currentMax-currentMin)/totalRange*100;return{left:`${leftPosition}%`,width:`${width$1}%`,backgroundColor:`var(--bng-orange-500)`}};return onMounted(()=>{props.filterList&&props.filterList.forEach(filter=>{hasActiveFilters(filter.propName)&&(expandedAccordions.value[filter.propName]=!0)})}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$281,[__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_2$231,[createVNode(SearchBar_default,{searchText:__props.searchText,setSearchText:__props.setSearchText,placeholder:`Search items...`,"full-width":!0,onFocusItem:_cache[0]||=$event=>emit$1(`focus-item`,$event)},null,8,[`searchText`,`setSearchText`])])):createCommentVNode(``,!0),__props.detailsMode===`filter`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_3$205,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.commonFilters,(filter,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter[0],filter[1]),{"filter-locked":props.isFilterOptionLocked(filter[0],filter[1])}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter[0],filter[1])?`not-allowed`:`pointer`}),"bng-nav-item":``,onClick:$event=>toggleFilter(filter[0],filter[1])},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$176,toDisplayString(filter[1]),1),createBaseVNode(`span`,_hoisted_5$151,[__props.filterByProp&&__props.filterByProp[filter[0]]&&__props.filterByProp[filter[0]][filter[1]]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).xmark},null,8,[`type`])),props.isFilterOptionLocked(filter[0],filter[1])?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])),__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_6$130,[createVNode(unref(accordion_default),{class:`filters-accordion`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.filterList,filter=>(openBlock(),createElementBlock(`div`,{key:filter.propName,class:`filter-wrapper`},[createVNode(unref(accordionItem_default),{navigable:``,static:!filter.options||filter.options.length===0,"arrow-big":``,"expand-hint-inline":``,expanded:expandedAccordions.value[filter.propName],class:normalizeClass({"has-active-filters":isFilterActive(filter)}),onFocus:$event=>emit$1(`focus-item`,filter.propName)},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$116,[createBaseVNode(`div`,_hoisted_8$97,toDisplayString(formatFilterName(filter.propName)),1)])]),default:withCtx(()=>[filter.type===`set`&&filter.options?(openBlock(),createElementBlock(`div`,_hoisted_9$87,[createBaseVNode(`div`,_hoisted_10$76,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filter.options,(option,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter.propName,option),{"filter-locked":props.isFilterOptionLocked(filter.propName,option)}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter.propName,option)?`not-allowed`:`pointer`}),onClick:$event=>toggleFilter(filter.propName,option)},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_11$68,toDisplayString(option),1),createBaseVNode(`span`,_hoisted_12$56,[__props.filterByProp[filter.propName][option]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).abandon},null,8,[`type`])),props.isFilterOptionLocked(filter.propName,option)?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])])):createCommentVNode(``,!0),filter.type===`range`?(openBlock(),createElementBlock(`div`,_hoisted_13$48,[createBaseVNode(`div`,_hoisted_14$43,[createBaseVNode(`div`,_hoisted_15$41,[createBaseVNode(`div`,{class:`range-selection`,style:normalizeStyle(getRangeBarStyle(filter.propName))},null,4)])]),createBaseVNode(`div`,_hoisted_16$39,[createBaseVNode(`div`,_hoisted_17$32,[_cache[1]||=createBaseVNode(`label`,{class:`range-label`},`Min:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`min`,modelValue:__props.filterByProp[filter.propName].min,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`min`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))]),createBaseVNode(`div`,_hoisted_18$29,[_cache[2]||=createBaseVNode(`label`,{class:`range-label`},`Max:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`max`,modelValue:__props.filterByProp[filter.propName].max,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`max`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))])])])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`class`,`onFocus`])]))),128))]),_:1})])):createCommentVNode(``,!0)]))}},DetailedFilters_default=__plugin_vue_export_helper_default(_sfc_main$315,[[`__scopeId`,`data-v-a4758924`]]),_hoisted_1$280={key:1},_hoisted_2$230={key:1},_hoisted_3$204={key:1},_hoisted_4$175={key:1},_sfc_main$314={__name:`HeaderButtons`,props:{canSwitchDetails:{type:Boolean,default:!1},hiddenTabs:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},slim:{type:Boolean,default:!1}},emits:[`switch-details-mode`],setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`header-buttons`,{slim:__props.slim}])},[withDirectives(createVNode(unref(bngBinding_default),{class:`header-buttons-binding`,"ui-event":`context`,controller:``,"track-ignore":``},null,512),[[vShow,__props.canSwitchDetails]]),__props.hiddenTabs.includes(`detail`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`detail`}]),accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>_ctx.$emit(`switch-details-mode`,`detail`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).info},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_1$280,`Details`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Details`,`top`]]),__props.hiddenTabs.includes(`advanced`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`advanced`}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>_ctx.$emit(`switch-details-mode`,`advanced`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).laneProperties},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_2$230,`Advanced`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Advanced`,`top`]]),__props.hiddenTabs.includes(`filter`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`filter`}]),accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>_ctx.$emit(`switch-details-mode`,`filter`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).filter},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_3$204,`Filters`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Filters`,`top`]]),__props.hiddenTabs.includes(`displayControls`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`displayControls`}]),accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>_ctx.$emit(`switch-details-mode`,`displayControls`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).adjust},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_4$175,`Display`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Display`,`top`]])],2))}},HeaderButtons_default=__plugin_vue_export_helper_default(_sfc_main$314,[[`__scopeId`,`data-v-157cdc63`]]),_sfc_main$313={__name:`Slideshow`,props:{images:Array,transition:Boolean,delay:{type:Number,default:1e4},parent:Object,shuffle:Boolean},setup(__props,{expose:__expose}){useCssVars(_ctx=>({v095d52f4:imgPrev.value,v095f8174:imgNext.value}));let props=__props,anim=ref(!1),imgPrev=ref(``),imgNext=ref(``),imgIndex=ref(-1),sequence=[],sequenceIndex=-1,tmrMain,tmrAnim,wImages,wParent;__expose({imgIndex,nextImage,carousel:{showNext:nextImage}}),onUnmounted(stopTimers);function stopTimers(){tmrMain&&=(clearTimeout(tmrMain),null),tmrAnim&&=(clearTimeout(tmrAnim),null)}watch(()=>props.parent,parent=>{wImages&&=(wImages(),null),wParent&&=(wParent(),null),parent?wParent=watch([()=>props.images,()=>parent.imgIndex],([images,index])=>{images&&(imgIndex.value=index,images.length>0&&nextTick(nextImage))},{immediate:!0}):wImages=watch([()=>props.images,()=>props.shuffle],([images,shuffle])=>{images&&(imgIndex.value=-1,images.length>0&&(shuffle&&(sequenceIndex=-1,sequence=Array.from(images).map((_,i)=>i).sort(()=>Math.random()-.5)),nextTick(nextImage)))},{immediate:!0})},{immediate:!0});function nextImage(){stopTimers(),props.parent||(props.shuffle&&sequence.length>0?(sequenceIndex=++sequenceIndex%props.images.length,imgIndex.value=sequence[sequenceIndex]):imgIndex.value=++imgIndex.value%props.images.length);let img=`url("${getAssetURL(props.images[imgIndex.value])}")`;props.transition?(imgNext.value=img,anim.value=!0,tmrAnim=setTimeout(()=>{tmrAnim=null,anim.value=!1,imgPrev.value=imgNext.value,imgNext.value=``},1e3)):imgPrev.value=img,!props.parent&&props.images.length>1&&(tmrMain=setTimeout(nextImage,props.delay))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({anim:anim.value})},null,2))}},Slideshow_default=__plugin_vue_export_helper_default(_sfc_main$313,[[`__scopeId`,`data-v-f788946d`]]),_hoisted_1$279={key:0,class:`blur-wrap`},_sfc_main$312={__name:`BlurBackground`,setup(__props){let parentCarousel=inject(`mainBackground`),backgroundsBlur=inject(`mainBackgroundBlur`),bgRequired=sysInfo_default.mainMenuBackgroundRequired;return(_ctx,_cache)=>unref(bgRequired)?(openBlock(),createElementBlock(`div`,_hoisted_1$279,[createVNode(Slideshow_default,{class:`blur-carousel`,images:unref(backgroundsBlur),parent:unref(parentCarousel),transition:``},null,8,[`images`,`parent`])])):createCommentVNode(``,!0)}},BlurBackground_default=__plugin_vue_export_helper_default(_sfc_main$312,[[`__scopeId`,`data-v-cc1c4815`]]),_hoisted_1$278={class:`header-container`},_hoisted_2$229={key:1},_hoisted_3$203={class:`content-container`},_hoisted_4$174={class:`header-back-button`},_hoisted_5$150={key:0,class:`header-title-container`},_hoisted_6$129={class:`header-back-button`},_hoisted_7$115={class:`header-back-button`},_hoisted_8$96={key:0,class:`scrollable-content`},_hoisted_9$86={class:`details-mode-buttons`},_hoisted_10$75={key:1,class:`scrollable-content`},_hoisted_11$67={key:0,class:`details-content`},_hoisted_12$55={key:1,class:`scrollable-content`},_sfc_main$311={__name:`GridSelector`,props:{backendName:{type:String,default:`gridSelector`},routePath:{type:String,default:`/grid-selector`},defaultPath:{type:Object,default:()=>({keys:[`allModels`]})},defaultDetailsMode:{type:String,default:`detail`},hiddenTabs:{type:Array,default:()=>[]},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null},noBreadcrumbs:{type:Boolean,default:!1},overrideBackFromGrid:{type:Function,default:null},inlineHeaderContainer:{type:Boolean,default:!0},selectCallback:{type:Function,default:null},bubbleEvents:{type:Array,default:()=>[]}},setup(__props,{expose:__expose}){let props=__props,{showIfController}=storeToRefs(controls_default()),store$1=useGridSelector(props.backendName,props.defaultPath,props.defaultDetailsMode),{groups,displayData,detailsMode,selectedItem,showScreenHeader,screenHeaderTitle,screenHeaderPath,activeItemDetails,activeItem,activeFilters}=store$1,route=useRoute(),router$1=useRouter(),detailsModeTitles={detail:`Details`,advanced:`Advanced`,filter:`Filters`,displayControls:`Display`},detailsModeBackTo={filter:`advanced`,displayControls:`advanced`};watch(()=>[props.backendName,props.defaultPath,props.defaultDetailsMode],([newBackendName,newDefaultPath,newDefaultDetailsMode],[oldBackendName,oldDefaultPath,oldDefaultDetailsMode])=>{newBackendName!==oldBackendName&&newDefaultPath&&newDefaultPath.keys&&store$1.setCurrentPath(newDefaultPath),newDefaultDetailsMode!==oldDefaultDetailsMode&&store$1.setDetailsMode(newDefaultDetailsMode)},{deep:!0});let scopedNavState=reactive({isGridActive:!1,isDetailsActive:!1}),setBack=inject(`setBack`),showTopbarTabBindings=inject(`showTopbarTabBindings`),showTopbarBackBinding=inject(`showTopbarBackBinding`),showBreadcrumbsBack=ref(!1),canUseTopbar=ref(!0);watch(()=>scopedNavState.isDetailsActive,val=>{canUseTopbar.value=!val,showTopbarTabBindings(canUseTopbar.value)}),watch(screenHeaderPath,val=>{showBreadcrumbsBack.value=val&&val.length>2,showTopbarBackBinding(!showBreadcrumbsBack.value)});let switchSeq=computed(()=>[`detail`,`advanced`,`displayControls`].filter(tab=>!props.hiddenTabs.includes(tab))),getNextSwitchSeq=mode=>{mode||=detailsMode.value,mode===`filter`&&(mode=`advanced`);let seq=switchSeq.value;if(seq.length===0)return`detail`;let currentIndex=seq.indexOf(mode);return currentIndex===-1?seq[0]:seq[(currentIndex+1)%seq.length]},canSeeDetails=ref(!0),hasSelectedItem=computed(()=>!!store$1.selectedItem.value),canSwitchDetails=computed(()=>activeSectionScope.value!==`default`||detailsMode.value===`advanced`);function switchDetailsMode(mode){console.log(`switchDetailsMode`,mode),typeof mode!=`string`&&(mode=getNextSwitchSeq(mode)),mode===`detail`&&!canSeeDetails.value&&(mode=getNextSwitchSeq(mode)),console.log(`switchDetailsMode`,mode),store$1.setDetailsMode(mode),switchScope(`details`)}function onToggleSectionScope(){activeSectionScope.value===`grid`?switchScope(`details`):switchDetailsMode()}let activeSectionScope=ref(`grid`);function switchScope(name,force=!1){name||=activeSectionScope.value===`grid`?`details`:`grid`,name===`details`?(scopedNavState.isGridActive=!1,force&&(scopedNavState.isDetailsActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isDetailsActive=!0})):(scopedNavState.isDetailsActive=!1,force&&(scopedNavState.isGridActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isGridActive=!0}))}let onGridActivate=()=>{scopedNavState.isGridActive=!0},onGridDeactivate=event=>{scopedNavState.isGridActive=!1},onDetailsActivate=()=>{scopedNavState.isDetailsActive=!0},onDetailsDeactivate=event=>{scopedNavState.isDetailsActive=!1},setDetailsScope=info=>{switchScope(`details`)},canBubbleGridEvent=event=>!!(event.detail.name===`rotate_v_cam`||event.detail.name===`menu`||canUseTopbar.value&&(event.detail.name===`tab_l`||event.detail.name===`tab_r`)||props.bubbleEvents.includes(event.detail.name)),canBubbleDetailsEvent=event=>!!(event.detail.name===`rotate_v_cam`||props.bubbleEvents.includes(event.detail.name)),canDeactivateGrid=()=>screenHeaderPath.value.length<=1,onBackFromDetails=()=>{if(detailsMode.value===`displayControls`||detailsMode.value===`filter`){toggleDetailsMode(`advanced`);return}switchScope(`grid`)},onToggleFavorite=()=>{store$1.toggleFavourite(activeItem.value)},gridContentRef=ref(null),scrollPositions$1=ref(new Map),scrollTimeout=null,displaySize=computed(()=>{let option=displayData.value.find(option$1=>option$1.key===`displaySize`);return option?option.value:`medium`});store$1.initialize(),store$1.setOnBackFromDetailsCallback(()=>{onBackFromDetails()}),props.defaultPath.keys;let currentPathSegments=computed(()=>{let pathMatch=route.params.pathMatch;if(!pathMatch)return props.defaultPath?.keys||(Array.isArray(props.defaultPath)?props.defaultPath:[]);let segments=Array.isArray(pathMatch)?pathMatch.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(pathMatch)];if(route.params.itemDetails){let itemDetails=Array.isArray(route.params.itemDetails)?route.params.itemDetails.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(route.params.itemDetails)];segments.push(...itemDetails)}return segments}),saveScrollPosition$1=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),scrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(pathKey,scrollTop)},debouncedSaveScrollPosition=()=>{scrollTimeout&&clearTimeout(scrollTimeout),scrollTimeout=setTimeout(()=>{saveScrollPosition$1()},100)},restoreScrollPosition=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),savedPosition=scrollPositions$1.value.get(pathKey);savedPosition!==void 0&&nextTick(()=>{gridContentRef.value.scrollTop=savedPosition})};watch(groups,async newGroups=>{newGroups&&(await nextTick(),await nextTick(),store$1.notifyUIReady(),restoreScrollPosition())},{immediate:!0}),watch([currentPathSegments],async([segments],[oldSegments])=>{if(oldSegments&&gridContentRef.value){let oldPathKey=oldSegments.join(`/`),currentScrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(oldPathKey,currentScrollTop)}let path={keys:segments};await store$1.setCurrentPath(path)},{immediate:!0}),watch(gridContentRef,newElement=>{if(newElement){let handleScroll=()=>{debouncedSaveScrollPosition()};newElement.addEventListener(`scroll`,handleScroll),newElement._scrollHandler=handleScroll}},{immediate:!0}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`gridSelector`)}),onMounted(()=>{setBack(props.backendName,onBackFromGrid),nextTick(()=>{scopedNavState.isGridActive=!0})}),onUnmounted(()=>{setBack(props.backendName),gridContentRef.value&&gridContentRef.value._scrollHandler&&gridContentRef.value.removeEventListener(`scroll`,gridContentRef.value._scrollHandler),scrollTimeout&&clearTimeout(scrollTimeout),Lua_default.ui_gridSelector.closedFromUI(props.backendName),Lua_default.simTimeAuthority.popPauseRequest(`gridSelector`)});let onItemFocus=item=>{item&&item.showDetails&&store$1.setPreviewItem(item)},onItemSelect=async(item,doNavigation=!0)=>{if(item.gotoPath&&Array.isArray(item.gotoPath))store$1.prevSelectedItem.value=item.key,doNavigation&&routeNav(item),store$1.clearSelectedItem(),doNavigation&&switchScope(`grid`),props.selectCallback&&await props.selectCallback(item,doNavigation);else if(item.showDetails){item.key,selectedItem.value?.key;let consumed=!1;props.selectCallback&&(consumed=await props.selectCallback(item,doNavigation)),consumed||(await store$1.setSelectedItem(item),doNavigation&&switchScope(`details`))}},onGridWrapperClick=event=>{store$1.clearSelectedItem(),switchScope(`grid`,!0)},onDetailsWrapperClick=event=>{switchScope(`details`,!0)},onItemDeselect=()=>{store$1.clearSelectedItem()},toggleDetailsMode=mode=>{store$1.setDetailsMode(mode)};function routeNav(item){if(item.gotoAngularState)return;let encodedPath=item.gotoPath.map(segment=>encodeURIComponent(segment)).join(`/`);router$1.push(`${props.routePath}/${encodedPath}`)}let onBackFromGrid=()=>{if(console.log(`onBackFromGrid`,screenHeaderPath.value),props.overrideBackFromGrid&&screenHeaderPath.value.length<=2)return props.overrideBackFromGrid();if(screenHeaderPath.value.length>1){let item=screenHeaderPath.value[screenHeaderPath.value.length-2];return store$1.prevSelectedItem.value&&(store$1.autoFocusKey.value=store$1.prevSelectedItem.value),gotoHeaderItem(item),!1}return!0},onBreadBack=()=>nextTick(onBackFromGrid),clearSearch=()=>{store$1.setSearchText(``)},clearFilters=()=>{console.log(`clearFilters`,activeFilters.value);for(let filter of activeFilters.value)console.log(`clearFilter`,filter),filter&&filter.type===`range`?store$1.resetRangeFilter(filter.propName):store$1.resetSetFilter(filter.propName)},setCurrentPath=path=>{store$1.setCurrentPath(path)},gotoHeaderItem=item=>{console.log(`gotoHeaderItem`,item),item.gotoAngularState?window.bngVue.gotoAngularState(item.gotoAngularState):item.gotoPath&&(item.clearSearch&&clearSearch(),item.clearFilters&&clearFilters(),setCurrentPath({keys:item.gotoPath}),routeNav(item),switchScope(`grid`))};return __expose({screenHeaderPath,clearSearch,clearFilters,setCurrentPath}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`grid-selector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$278,[__props.noBreadcrumbs?(openBlock(),createElementBlock(`div`,_hoisted_2$229)):(openBlock(),createBlock(unref(bngBreadcrumbs_default),{key:0,class:`header-breadcrumbs`,items:unref(screenHeaderPath),limit:`5`,simple:``,"disable-last-item":``,"show-back-button":showBreadcrumbsBack.value,onClick:gotoHeaderItem,onBack:onBreadBack},null,8,[`items`,`show-back-button`])),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createBlock(HeaderButtons_default,{key:2,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]))]),createBaseVNode(`div`,_hoisted_3$203,[createBaseVNode(`div`,{class:normalizeClass([`grid-wrapper`,{active:activeSectionScope.value===`grid`}])},[createVNode(BlurBackground_default),unref(showScreenHeader)?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-row`,{active:activeSectionScope.value===`grid`&&unref(showIfController),"no-controller":!unref(showIfController)}])},[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(screenHeaderTitle)),1)]),_:1}),withDirectives(createBaseVNode(`div`,_hoisted_4$174,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`grid`&&unref(showIfController)&¤tPathSegments.value.length>1]])],2)):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,{class:`grid-content`,ref_key:`gridContentRef`,ref:gridContentRef,"bng-nav-scroll":``,"bng-no-nav":`true`,tabindex:`-1`,onActivate:onGridActivate,onDeactivate:onGridDeactivate,onClick:onGridWrapperClick},[createVNode(Grid_default$1,{"in-details":activeSectionScope.value===`details`&&unref(detailsMode)===`detail`,"display-size":displaySize.value,"backend-name":props.backendName,"auto-focus-key":unref(store$1).autoFocusKey.value,"active-item":unref(store$1).activeItem.value,groups:unref(groups),"tile-images-top-aligned":__props.tileImagesTopAligned,onFocusItem:onItemFocus,onSelectItem:onItemSelect,onDeselectItem:onItemDeselect,"double-click-override":__props.doubleClickOverride},null,8,[`in-details`,`display-size`,`backend-name`,`auto-focus-key`,`active-item`,`groups`,`tile-images-top-aligned`,`double-click-override`])],32)),[[unref(BngScopedNav_default),{activated:scopedNavState.isGridActive,canBubbleEvent:canBubbleGridEvent,canDeactivate:canDeactivateGrid,preferAutoFocus:!0,autoFocusDelay:400}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onBackFromGrid,`back`],[unref(BngUiNavScroll_default)]])],2),withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details-wrapper wide`,{active:activeSectionScope.value===`details`,"no-controller":!unref(showIfController)}]),tabindex:`-1`,"bng-no-nav":`true`,onActivate:onDetailsActivate,onDeactivate:onDetailsDeactivate,onClick:onDetailsWrapperClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,{class:normalizeClass([`header-row`,{active:activeSectionScope.value===`details`&&unref(showIfController),"no-controller":!unref(showIfController)}]),"bng-no-child-nav":`true`},[createVNode(HeaderButtons_default,{slim:``,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$150,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(detailsModeTitles[unref(detailsMode)]),1)]),_:1}),detailsModeBackTo[unref(detailsMode)]?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,onClick:_cache[0]||=$event=>toggleDetailsMode(detailsModeBackTo[unref(detailsMode)]),accent:unref(ACCENTS).outlined,iconRight:`undo`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``})]),_:1},8,[`accent`])):createCommentVNode(``,!0),withDirectives(createBaseVNode(`div`,_hoisted_6$129,[createVNode(unref(bngIcon_default),{type:unref(icons).adjust},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`context`,controller:``})],512),[[vShow,activeSectionScope.value===`grid`||!unref(showIfController)]]),withDirectives(createBaseVNode(`div`,_hoisted_7$115,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`details`&&unref(showIfController)]])]))],2),unref(detailsMode)===`advanced`?(openBlock(),createElementBlock(`div`,_hoisted_8$96,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createBaseVNode(`div`,_hoisted_9$86,[createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>toggleDetailsMode(`filter`),accent:unref(ACCENTS).secondary,iconLeft:`filter`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` More filters... `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:_cache[2]||=$event=>toggleDetailsMode(`displayControls`),accent:unref(ACCENTS).secondary,iconLeft:`adjust`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Display Options `,-1)]]),_:1},8,[`accent`])]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Management`,-1)]]),_:1}),renderSlot(_ctx.$slots,`management-details`,{managementDetails:unref(store$1).managementDetails.value,executeButton:unref(store$1).executeButton},void 0,!0)])):unref(detailsMode)===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_10$75,[createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`])])):unref(detailsMode)===`displayControls`?(openBlock(),createBlock(DisplayControls_default,{key:2,class:`scrollable-content`,displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`])):unref(detailsMode)===`detail`?(openBlock(),createElementBlock(Fragment,{key:3},[hasSelectedItem.value?(openBlock(),createElementBlock(`div`,_hoisted_11$67,[renderSlot(_ctx.$slots,`item-details`,{activeItem:unref(store$1).activeItem.value,activeItemDetails:unref(store$1).activeItemDetails.value,executeButton:unref(store$1).executeButton,toggleFavourite:unref(store$1).toggleFavourite,exploreFolder:unref(store$1).exploreFolder,goToMod:unref(store$1).goToMod,onFocusItem:setDetailsScope},void 0,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$55,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Info`,-1)]]),_:1}),_cache[7]||=createBaseVNode(`div`,{class:`scrollable-content`},` Please select an item to see details. `,-1)]))],64)):createCommentVNode(``,!0)],34)),[[unref(BngScopedNav_default),{activated:scopedNavState.isDetailsActive,canDeactivate:()=>!1,canBubbleEvent:canBubbleDetailsEvent,bubbleWhitelistEvents:[`menu`]}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onToggleFavorite,`action_2`],[unref(BngUiNavLabel_default),`Toggle favorite`,`action_2`],[unref(BngOnUiNav_default),onBackFromDetails,`back`,{focusRequired:!0}]])])]),_:3})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>{},`rotate_h_cam,rotate_v_cam`]])}},GridSelector_default=__plugin_vue_export_helper_default(_sfc_main$311,[[`__scopeId`,`data-v-d340d12f`]]),_hoisted_1$277={class:`details`,"bng-nav-scroll":``},_hoisted_2$228={key:0,class:`preview`},_hoisted_3$202={key:1,class:`content-header`},_hoisted_4$173={key:0,class:`description`},_hoisted_5$149={key:0,class:`specs-grid`},_hoisted_6$128={class:`specs-grid-container`},_hoisted_7$114={class:`spec-content`},_hoisted_8$95={class:`spec-label`},_hoisted_9$85={class:`spec-value`},_hoisted_10$74={key:2,class:`buttons-section`},_sfc_main$310={__name:`AppDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,required:!0},toggleFavourite:{type:Function,required:!0}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$277,[__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_2$228,[createVNode(unref(aspectRatio_default),{class:`preview-image`,ratio:`16:8`,"external-image":__props.activeItemDetails.preview},null,8,[`external-image`])])):createCommentVNode(``,!0),__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_3$202,[__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_4$173,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$149,[createBaseVNode(`div`,_hoisted_6$128,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$114,[createBaseVNode(`div`,_hoisted_8$95,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_9$85,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)),__props.activeItemDetails?.buttonInfo?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$74,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128))])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]])}},AppDetails_default=__plugin_vue_export_helper_default(_sfc_main$310,[[`__scopeId`,`data-v-c8fb13f2`]]),_sfc_main$309={__name:`AppSelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`appSelector`,routePath:`/app-selector`,defaultPath:{keys:[`allApps`]},defaultDetailsMode:`advanced`},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite})=>[createVNode(AppDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`])]),_:1}))}},AppSelector_default=_sfc_main$309,routes_default=[{name:`menu.appselector`,path:`/app-selector/:pathMatch(.*)*`,component:AppSelector_default,props:!0,meta:{clickThrough:!1,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.appedit`,path:`/app-edit/`,component:NotFound_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0},topBar:{visible:!0}}}],_hoisted_1$276={class:`main-info`},_hoisted_2$227={class:`heading`},_hoisted_3$201={key:0,class:`stars`},_hoisted_4$172={key:1,class:`aggregate-primary`},_hoisted_5$148={class:`label`},_hoisted_6$127={class:`value`},_hoisted_7$113={key:2,class:`empty-gap`},_sfc_main$308={__name:`PoiCard`,props:{poi:{type:Object,required:!0},shown:{type:Boolean,default:!0}},emits:[`select`,`hover`],setup(__props,{emit:__emit}){let debugLog$1=(message,data)=>{},props=__props,emit$1=__emit,onSelect=()=>{props.poi.id,props.poi.name,emit$1(`select`,props.poi.id)},thumbLoaded=props.shown&&!!props.poi?.thumbnail,thumbShown=ref(thumbLoaded),thumb=ref(thumbLoaded?`url("${props.poi?.thumbnail}")`:`none`),lastThumb=thumbLoaded?props.poi?.thumbnail:void 0;return watch([()=>props.shown,()=>props.poi],()=>{if(props.shown&&props.poi?.thumbnail){let url=props.poi.thumbnail;if(lastThumb!==url){lastThumb=url,thumbLoaded=!1;let img=new Image;img.src=url,img.onload=()=>{lastThumb===url&&(thumbLoaded=!0,thumb.value=`url("${url}")`,thumbShown.value=!0)}}}else props.poi?.thumbnail||(lastThumb=void 0,thumbLoaded=!1,thumb.value=`none`,thumbShown.value=!1)},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`poi-item`,{highlighted:__props.poi.isSelected}]),onClick:onSelect,"bng-nav-item":``},[createBaseVNode(`div`,{class:normalizeClass([`card-info`,{"content-shown":__props.shown,"thumb-show":thumbShown.value&&!!thumb.value}]),style:normalizeStyle({"--poi-image":thumb.value})},[__props.poi.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`mission-icon`,type:__props.poi.icon,color:`white`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_1$276,[createBaseVNode(`div`,_hoisted_2$227,toDisplayString(__props.poi.name),1),__props.poi.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_3$201,[__props.poi.formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"individual-stars":__props.poi.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6,reverse:``},null,8,[`individual-stars`])):createCommentVNode(``,!0),__props.poi.formattedProgress.unlockedStars&&__props.poi.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,"individual-stars":__props.poi.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individual-stars`])):createCommentVNode(``,!0)])):__props.poi.aggregatePrimary?(openBlock(),createElementBlock(`div`,_hoisted_4$172,[createBaseVNode(`span`,_hoisted_5$148,toDisplayString(__props.poi.aggregatePrimary.label)+`:`,1),createBaseVNode(`span`,_hoisted_6$127,toDisplayString(__props.poi.aggregatePrimary.value),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$113))]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``})],6)],2))}},PoiCard_default=__plugin_vue_export_helper_default(_sfc_main$308,[[`__scopeId`,`data-v-cd49bd11`]]),_hoisted_1$275={class:`poi-list`},_hoisted_2$226={class:`filter-header`},_hoisted_3$200={class:`poi-list-items`},_sfc_main$307={__name:`PoiList`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,poiListContainer=ref(null),shownCards=ref(new Set),{groupData,poiData,selectedPoi,selectPoi,onHover,debugLog:debugLog$1}=props.store,processedPoiData=computed(()=>{let processed={};if(!poiData.value)return processed;for(let[poiId,poi]of Object.entries(poiData.value))poi&&(processed[poiId]={id:poi.id||poiId,name:poi.name?$translate.instant(poi.name):``,icon:poi.icon?icons[poi.icon]:icons._empty,thumbnail:poi.thumbnailFile,formattedProgress:poi.formattedProgress,aggregatePrimary:poi.aggregatePrimary?.label&&poi.aggregatePrimary?.value?{label:$translate.instant(poi.aggregatePrimary.label),value:$translate.instant(poi.aggregatePrimary.value)}:null,isSelected:selectedPoi.value?.id===poi.id});return processed});debugLog$1(`PoiList`,`Component initialized`,{groupDataCount:groupData.value?.length||0,poiDataCount:Object.keys(poiData.value||{}).length,processedPoiCount:Object.keys(processedPoiData.value).length});let observer$2=new IntersectionObserver(entries=>{for(let entry of entries){let poiId=entry.target.getAttribute(`data-poi-id`);poiId&&entry.isIntersecting?shownCards.value.add(poiId):shownCards.value.delete(poiId)}},{threshold:.1,rootMargin:`10px`}),setupObserver=()=>{if(!poiListContainer.value)return;let elms$4=poiListContainer.value.querySelectorAll(`[data-poi-id]`),ids=[];for(let elm of elms$4){let poiId=elm.getAttribute(`data-poi-id`);poiId&&(ids.push(poiId),observer$2.observe(elm))}for(let id of shownCards.value)ids.includes(id)||shownCards.value.delete(id)};return watch(poiListContainer,cont=>cont&&nextTick(setupObserver),{immediate:!0}),watch([groupData,processedPoiData],()=>{nextTick(()=>{observer$2.disconnect(),setupObserver()})},{immediate:!1}),onUnmounted(()=>{shownCards.value.clear(),observer$2.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$275,[createBaseVNode(`div`,{class:`poi-list-content`,ref_key:`poiListContainer`,ref:poiListContainer},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(groupData),section=>(openBlock(),createElementBlock(`div`,{key:section.key,class:`filter-section`},[createBaseVNode(`div`,_hoisted_2$226,[createVNode(unref(bngIcon_default),{type:section.icon},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(section.title?_ctx.$tt(section.title):``),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(section.groups,group=>(openBlock(),createElementBlock(`div`,{key:group.key,class:`mission-group`},[createVNode(unref(bngCardHeading_default),{class:`mission-group-header`,type:`ribbon`,outline:``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(group.label)),1)]),_:2},1024),createBaseVNode(`div`,_hoisted_3$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.elementIds,poiId=>(openBlock(),createBlock(PoiCard_default,{key:poiId,"data-poi-id":poiId,shown:shownCards.value.has(poiId),poi:processedPoiData.value[poiId],onSelect:unref(selectPoi),onHover:unref(onHover)},null,8,[`data-poi-id`,`shown`,`poi`,`onSelect`,`onHover`]))),128))])]))),128))]))),128))],512)]))}},PoiList_default=__plugin_vue_export_helper_default(_sfc_main$307,[[`__scopeId`,`data-v-0ccba230`]]),_hoisted_1$274={class:`header`},_sfc_main$306={__name:`bngAdvCardHeading`,props:{blurDelay:Number,preheadings:Array,divider:Boolean,icon:String,type:{type:String,default:`line`,validator:v=>[`line`,`ribbon`].includes(v)||v===``}},setup(__props){let blurVal=ref(!1);onMounted(()=>window.setTimeout(()=>blurVal.value=!0,~~+props.blurDelay));let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-screen-header`,{[`heading-style-${__props.type}`]:!0,prehead:__props.preheadings}])},[_cache[0]||=createBaseVNode(`div`,{class:`decorator`},null,-1),__props.preheadings?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass([`pre-header`,{"with-divider":__props.divider}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.icon,class:`pre-header-icon`},null,8,[`type`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.preheadings,preheading=>(openBlock(),createElementBlock(`span`,{class:`location`,key:preheading},toDisplayString(preheading),1))),128))],2)):createCommentVNode(``,!0),createBaseVNode(`h1`,_hoisted_1$274,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])],2))}},bngAdvCardHeading_default=__plugin_vue_export_helper_default(_sfc_main$306,[[`__scopeId`,`data-v-16619e8d`]]),_hoisted_1$273={key:0,class:`poi-icons`},_hoisted_2$225=[`onClick`],_hoisted_3$199={key:1,class:`poi-details`},_hoisted_4$171={class:`poi-content`},_hoisted_5$147={class:`poi-scrollable`},_hoisted_6$126={key:0,class:`poi-aggregate-display`},_hoisted_7$112={key:0,class:`poi-stars`},_hoisted_8$94={class:`stars`},_hoisted_9$84={key:1,class:`aggregate-primary`},_hoisted_10$73={class:`label`},_hoisted_11$66={class:`value`},_hoisted_12$54={key:1,class:`poi-description`},_hoisted_13$47={class:`poi-actions`},_sfc_main$305={__name:`PoiDetails`,props:{store:{type:Object,required:!0}},emits:[`setRoute`,`teleport`],setup(__props,{emit:__emit}){let props=__props,{selectedPoi,selectedPoiIds,poiData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiDetails`,`Component initialized`,{selectedPoiId:selectedPoi.value?.id,selectedPoiIdsCount:selectedPoiIds.value?.length||0});let selectedPoisList=computed(()=>{if(!selectedPoiIds.value||selectedPoiIds.value.length===0)return selectedPoi.value?[selectedPoi.value]:[];let pois=[];for(let poiId of selectedPoiIds.value){let poi=poiData.value[poiId];poi&&pois.push(poi)}return debugLog$1(`PoiDetails`,`Final pois list`,pois),pois}),currentPoiIndex=computed(()=>{if(selectedPoisList.value.length<=1)return 0;let index=selectedPoisList.value.findIndex(poi=>poi.id===selectedPoi.value?.id);return index>=0?index:0}),selectPoi=index=>{index>=0&&index{let headings=[];return selectedPoi.value?.label&&headings.push($translate.instant(selectedPoi.value.label)),headings}),preview=computed(()=>selectedPoi.value?.previewFiles?.length>0?selectedPoi.value.previewFiles[0]:selectedPoi.value?.thumbnailFile||null),safeTranslate=key=>{if(!key)return``;try{return typeof key==`string`?$translate.instant(key):(typeof key==`object`&&key.txt,$translate.contextTranslate(key))}catch(e){return console.warn(`Translation failed for key:`,key,e),typeof key==`string`?key:key?.txt||``}},aggregatePrimary=computed(()=>{let poi=selectedPoi.value;return poi?.aggregatePrimary?.label&&poi?.aggregatePrimary?.value?poi.aggregatePrimary:null}),onAction=action=>{props.store.executePoiAction(action.actionId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[selectedPoisList.value.length>=1?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$273,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedPoisList.value,(poi,index)=>(openBlock(),createElementBlock(`div`,{key:poi.id||index,class:normalizeClass([`poi-icon`,{active:index===currentPoiIndex.value}]),onClick:$event=>selectPoi(index)},[createVNode(unref(bngSpriteIcon_default),{src:`map_`+poi.spriteIcon,style:{width:`100%`,height:`100%`}},null,8,[`src`])],10,_hoisted_2$225))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0),unref(selectedPoi)?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$199,[createBaseVNode(`div`,_hoisted_4$171,[createVNode(bngAdvCardHeading_default,{class:`poi-details-header`,type:`line`,preheadings:preheadings.value},{default:withCtx(()=>[createTextVNode(toDisplayString(safeTranslate(unref(selectedPoi).name)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_5$147,[preview.value?(openBlock(),createBlock(aspectRatio_default,{key:0,class:`poi-thumbnail`,ratio:`16:9`,externalImage:preview.value,imageMode:`cover`},{default:withCtx(()=>[aggregatePrimary.value||unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_6$126,[unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_7$112,[createBaseVNode(`div`,_hoisted_8$94,[unref(selectedPoi).formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.8,reverse:``},null,8,[`individualStars`])):createCommentVNode(``,!0),unref(selectedPoi).formattedProgress.unlockedStars&&unref(selectedPoi).formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.8},null,8,[`individualStars`])):createCommentVNode(``,!0)])])):aggregatePrimary.value?(openBlock(),createElementBlock(`div`,_hoisted_9$84,[createBaseVNode(`span`,_hoisted_10$73,toDisplayString(_ctx.$t(aggregatePrimary.value.label))+`:`,1),createBaseVNode(`span`,_hoisted_11$66,toDisplayString(_ctx.$t(aggregatePrimary.value.value)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1},8,[`externalImage`])):createCommentVNode(``,!0),unref(selectedPoi).description?(openBlock(),createElementBlock(`div`,_hoisted_12$54,toDisplayString(safeTranslate(unref(selectedPoi).description)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_13$47,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(selectedPoi).actions,action=>(openBlock(),createBlock(unref(bngButton_default),{key:action.id,accent:unref(ACCENTS).secondary,"icon-right":action.icon,label:action.label,onClick:$event=>onAction(action)},null,8,[`accent`,`icon-right`,`label`,`onClick`]))),128))])])])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))}},PoiDetails_default=__plugin_vue_export_helper_default(_sfc_main$305,[[`__scopeId`,`data-v-35e47e7e`]]),_hoisted_1$272={class:`poi-filters`},_hoisted_2$224={key:0,class:`filter-row`},_hoisted_3$198=[`onClick`],_hoisted_4$170=[`onClick`],_sfc_main$304={__name:`PoiFilters`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,{filterData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiFilters`,`Component initialized`,{filterDataCount:filterData.value?.length||0});let getGroupVisualState=(filter,group)=>{if(!filter||!group||!filter.groups||!Array.isArray(filter.groups))return`inactive`;let visibleGroups=0,totalGroups=0;for(let filterGroup of filter.groups)filterGroup&&filterGroup.elementCount>0&&(totalGroups++,filterGroup.visible&&visibleGroups++);let isAllGroupsActive=visibleGroups===totalGroups,isGroupActive=group.visible;return isAllGroupsActive?`neutral`:isGroupActive?`active`:`inactive`},getGroupColor=(filter,group)=>{switch(getGroupVisualState(filter,group)){case`neutral`:return`var(--bng-off-white)`;case`active`:return`var(--bng-add-green-100)`;case`inactive`:default:return`var(--bng-add-red-300)`}},hasActiveFilters=filter=>{if(!filter||!filter.groups||!Array.isArray(filter.groups))return!1;let visibleGroups=0,totalGroups=0;for(let group of filter.groups)group&&group.elementCount>0&&(totalGroups++,group.visible&&visibleGroups++);return visibleGroups{debugLog$1(`PoiFilters`,`Toggling group visibility`,groupKey),props.store.toggleGroupVisibility(groupKey)},toggleFilterSectionVisibility=filterKey=>{debugLog$1(`PoiFilters`,`Toggling filter section visibility`,filterKey),props.store.toggleFilterSectionVisibility(filterKey)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$272,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(filterData),filterSection=>(openBlock(),createElementBlock(Fragment,{key:filterSection.key},[filterSection&&filterSection.groups?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$224,[createBaseVNode(`div`,{class:normalizeClass([`filter-icon`,{"has-active-filters":hasActiveFilters(filterSection)}]),onClick:$event=>toggleFilterSectionVisibility(filterSection.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(filterSection.title)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:filterSection.icon},null,8,[`type`])]),_:2},1032,[`text`])],10,_hoisted_3$198),_cache[0]||=createBaseVNode(`div`,{class:`filter-separator`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(filterSection.groups,group=>(openBlock(),createElementBlock(Fragment,{key:group.key},[group&&group.elementCount>0?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`filter-group`,{inactive:!group.visible}]),onClick:$event=>toggleGroupVisibility(group.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(group.label)+` ×`+group.elementCount},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:group.icon||`info`,color:getGroupColor(filterSection,group)},null,8,[`type`,`color`])]),_:2},1032,[`text`])],10,_hoisted_4$170)):createCommentVNode(``,!0)],64))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))),128))]))}},PoiFilters_default=__plugin_vue_export_helper_default(_sfc_main$304,[[`__scopeId`,`data-v-43aa27ac`]]);const debugLog=(component,message,data)=>{};function useBigMap(){let selectedPoi=ref(null),selectedPoiIds=ref([]),filterData=ref([]),groupData=ref([]),poiData=ref({}),gameMode=ref(``),levelData=ref({title:``}),isPoiListVisible=ref(!1),isDetailsVisible=ref(!1),{events:events$3}=useBridge(),translatedPreheadings=computed(()=>{let preheadings=[];return gameMode.value&&preheadings.push($translate.instant(`ui.playmodes.${gameMode.value}`)),levelData.value?.title&&preheadings.push($translate.instant(levelData.value.title)),preheadings}),currentFilterTitle=computed(()=>$translate.instant(`bigMap.sideMenu.pois`)),getStaticDataFromLua=async()=>{try{poiData.value=await Lua_default.freeroam_vueBigMap.getPoiData()||{};let gameStateResult=await Lua_default.freeroam_vueBigMap.getGameStateInfo();gameStateResult&&(gameMode.value=gameStateResult.gameMode||``,levelData.value=gameStateResult.levelData||{title:``}),poiData.value,gameMode.value}catch(error){console.error(`Error getting static data from Lua:`,error)}},getDynamicDataFromLua=async()=>{try{filterData.value=await Lua_default.freeroam_vueBigMap.getFilters()||[],groupData.value=await Lua_default.freeroam_vueBigMap.getGroups()||[],filterData.value,groupData.value}catch(error){console.error(`Error getting dynamic data from Lua:`,error)}},handleShowPoiDetails=data=>{let poiIds=data?.poiIds||[];if(selectedPoiIds.value=poiIds,poiIds.length===0){selectedPoi.value=null,isDetailsVisible.value=!1;return}let selectedPoiId=poiIds[0];selectedPoiId&&poiData.value[selectedPoiId]?(selectedPoi.value=poiData.value[selectedPoiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1)},toggleGroupVisibility=async groupKey=>{try{let filterIds=[groupKey];await Lua_default.freeroam_vueBigMap.toggleFiltersByIds(filterIds),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling group visibility:`,error)}},toggleFilterSectionVisibility=async filterKey=>{try{await Lua_default.freeroam_vueBigMap.toggleFilterSectionById(filterKey),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling filter visibility:`,error)}},selectPoi=async poiId=>{try{let result=await Lua_default.freeroam_vueBigMap.selectPoiFromList(poiId);result===`success`?poiId?(selectedPoi.value=poiData.value[poiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1):console.error(`Failed to select POI:`,result)}catch(error){console.error(`Error selecting POI:`,error)}};return{selectedPoi,selectedPoiIds,filterData,groupData,poiData,gameMode,levelData,isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,initialize:async()=>{try{await Lua_default.freeroam_vueBigMap.enterBigMap(),await getStaticDataFromLua(),await getDynamicDataFromLua(),events$3.on(`showPoiDetails`,handleShowPoiDetails)}catch(error){console.error(`Error initializing bigmap:`,error)}},cleanup:async()=>{try{await Lua_default.freeroam_vueBigMap.exitBigMap(),events$3.off(`showPoiDetails`)}catch(error){console.error(`Error cleaning up bigmap:`,error)}},selectPoi,showPoiList:()=>{isPoiListVisible.value=!0},hidePoiList:()=>{isPoiListVisible.value=!1,selectedPoi.value&&selectPoi(null)},onHover:async(poiId,active)=>{try{await Lua_default.freeroam_vueBigMap.hoverPoiFromList(poiId,active)}catch(error){console.error(`Error hovering POI:`,error)}},executePoiAction:async actionId=>{try{await Lua_default.freeroam_vueBigMap.executePoiAction(actionId)}catch(error){console.error(`Error executing POI action:`,error)}},toggleGroupVisibility,toggleFilterSectionVisibility,debugLog}}var _hoisted_1$271={class:`bigmap-container`},_hoisted_2$223={class:`bigmap-content`},_hoisted_3$197={class:`bigmap-left-content`},_hoisted_4$169={class:`bigmap-poilist-outline`},_hoisted_5$146={key:0,class:`bigmap-details-outline`},_sfc_main$303={__name:`BigMap`,setup(__props){let store$1=useBigMap(),{isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,onSetRoute,onTeleport,toggleGroupVisibility,initialize,cleanup,debugLog:debugLog$1}=store$1,handleToggleGroupVisibility=groupKey=>{debugLog$1(`BigMap`,`Toggle group visibility`,groupKey),toggleGroupVisibility(groupKey)};return onMounted(()=>{debugLog$1(`BigMap`,`Component mounted, initializing bigmap`),initialize()}),onUnmounted(()=>{debugLog$1(`BigMap`,`Component unmounted, cleaning up bigmap`),cleanup()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$271,[createVNode(unref(bngScreenHeading_default),{class:`bigmap-heading`,preheadings:unref(translatedPreheadings),divider:!0,type:`line`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(currentFilterTitle)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_2$223,[createBaseVNode(`div`,_hoisted_3$197,[createVNode(PoiFilters_default,{store:unref(store$1),onToggleGroupVisibility:handleToggleGroupVisibility},null,8,[`store`]),createBaseVNode(`div`,_hoisted_4$169,[createVNode(unref(bngDrawer_default),{modelValue:unref(isPoiListVisible),"onUpdate:modelValue":_cache[0]||=$event=>isRef(isPoiListVisible)?isPoiListVisible.value=$event:null,position:`left`,blur:``,header:_ctx.$tt(`bigMap.sideMenu.pois`)},{default:withCtx(()=>[createVNode(PoiList_default,{class:`bigmap-poilist`,store:unref(store$1)},null,8,[`store`])]),_:1},8,[`modelValue`,`header`])])]),_cache[1]||=createBaseVNode(`div`,{class:`bigmap-center-outline`},null,-1),unref(isDetailsVisible)?(openBlock(),createElementBlock(`div`,_hoisted_5$146,[createVNode(PoiDetails_default,{store:unref(store$1),onSetRoute:unref(onSetRoute),onTeleport:unref(onTeleport)},null,8,[`store`,`onSetRoute`,`onTeleport`])])):createCommentVNode(``,!0)])]))}},BigMap_default=__plugin_vue_export_helper_default(_sfc_main$303,[[`__scopeId`,`data-v-e6716bb0`]]),_hoisted_1$270={class:`bigmap-view`},_sfc_main$302={__name:`BigMapView`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$270,[createVNode(BigMap_default)]))}},BigMapView_default=__plugin_vue_export_helper_default(_sfc_main$302,[[`__scopeId`,`data-v-044f4742`]]),routes_default$1=[{path:`/bigmap`,name:`bigmap`,component:BigMapView_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}],_hoisted_1$269={class:`progress-steps`},_hoisted_2$222={class:`step-container`},_hoisted_3$196={class:`step-header`},_hoisted_4$168={class:`step-number`},_hoisted_5$145={class:`step-icon`},_hoisted_6$125={class:`step-label`},_sfc_main$301={__name:`ProgressSteps`,props:{steps:{type:Array,required:!0,validator:steps=>steps.every(step=>step.label&&typeof step.label==`string`||step.title&&typeof step.title==`string`)},currentStep:{type:Number,required:!0,validator:step=>step>=0}},setup(__props){let props=__props,styles={answeredYes:{class:`answered-yes`,icon:`checkboxOn`},answeredNo:{class:`answered-no`,icon:`missionCheckboxCross`},current:{class:`not-answered current`,icon:`arrowLargeRight`},next:{class:`not-answered`,icon:`checkboxOff`}},steps=computed(()=>props.steps.map((step,idx)=>{let answer=step.isAnswered?step.answerType||`yes`:null,status=`next`;return idx(openBlock(),createElementBlock(`div`,_hoisted_1$269,[createBaseVNode(`div`,_hoisted_2$222,[(openBlock(!0),createElementBlock(Fragment,null,renderList(steps.value,(step,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`step`,step.class])},[createBaseVNode(`div`,_hoisted_3$196,[createBaseVNode(`div`,_hoisted_4$168,toDisplayString(index+1),1),step.isLastStep?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`step-connector`},null,-1),createBaseVNode(`div`,_hoisted_5$145,[createVNode(unref(bngIcon_default),{type:step.icon},null,8,[`type`])])],64))]),createBaseVNode(`div`,_hoisted_6$125,toDisplayString(_ctx.$tt(step.label)),1)],2))),128))])]))}},ProgressSteps_default=__plugin_vue_export_helper_default(_sfc_main$301,[[`__scopeId`,`data-v-d5d29cd2`]]);function useWizard(options={}){let{allowSkip=!1,validateSteps=!0}=options,stepRegistry=ref(new Map),currentStepIndex=ref(0),completedSteps=ref(new Set),isFinished=ref(!1),steps=computed(()=>{if(stepRegistry.value.size===0)return[];let res=Array.from(stepRegistry.value.values());for(let step of res)if(!(!step.enabledWhen||step.enabledWhen.length===0)){for(let condition of step.enabledWhen)if(condition.step){let dependencyStep=res.find(s=>s.id===condition.step);if(!dependencyStep)continue;dependencyStep.requiredFor||=[],dependencyStep.requiredFor.includes(step.id)||dependencyStep.requiredFor.push(step.id)}}return res}),registerStep=stepConfig=>stepRegistry.value.set(stepConfig.id,stepConfig),unregisterStep=stepId=>stepRegistry.value.delete(stepId);provide(`registerWizardStep`,registerStep),provide(`unregisterWizardStep`,unregisterStep);let currentStep=computed(()=>steps.value[currentStepIndex.value]||null),isFirstStep=computed(()=>currentStepIndex.value===0),isLastStep=computed(()=>currentStepIndex.value===steps.value.length-1),canGoNext=computed(()=>{if(!validateSteps)return!0;let step=currentStep.value;return!step||!isStepEnabled(step)||step.advanceDisabled?!1:typeof step.validate==`function`?step.validate(step.modelValue||{}):step.type===`choice`&&step.required!==!1?step.modelValue?.choice!==void 0:(step.type,!0)}),isStepEnabled=step=>!step.enabledWhen||step.enabledWhen.length===0?!0:step.enabledWhen.every(condition=>{if(condition.step){let dependencyStepData=steps.value.find(s=>s.id===condition.step)?.modelValue||{};if(condition.value!==void 0)return dependencyStepData?.choice===condition.value||dependencyStepData?.[Object.keys(dependencyStepData)[0]]===condition.value;if(typeof condition.condition==`function`)return condition.condition(dependencyStepData)}return typeof condition.condition==`function`?condition.condition():!0}),canGoBack=computed(()=>!isFirstStep.value),canFinish=computed(()=>validateSteps?isLastStep.value&&canGoNext.value:isLastStep.value),goToStep=index=>{index<=0&&(currentStepIndex.value=0),index>=steps.value.length&&(currentStepIndex.value=steps.value.length-1),currentStepIndex.value=index},nextStep=async()=>{if(await nextTick(),!canGoNext.value)return!1;if(currentStep.value&&completedSteps.value.add(currentStepIndex.value),isLastStep.value)return!0;for(currentStepIndex.value++;currentStepIndex.value=steps.value.length&&(currentStepIndex.value=steps.value.length-1),!0};return{currentStepIndex,currentStep,completedSteps,isFinished,steps,stepRegistry,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress:computed(()=>steps.value.length===0?0:Math.round((currentStepIndex.value+1)/steps.value.length*100)),stepProgress:computed(()=>steps.value.map((step,index)=>{let data=step.modelValue||{},choiceAnalysis=null;if(step.type===`choice`&&step.choices&&data.choice!==void 0){let selectedChoice=step.choices.find(c=>c.value===data.choice),yesChoice=step.choices.find(c=>c.isYes),noChoice=step.choices.find(c=>c.isNo),answerType=null;selectedChoice&&(answerType=selectedChoice.isYes||yesChoice&&selectedChoice.value===yesChoice.value?`yes`:selectedChoice.isNo||noChoice&&selectedChoice.value===noChoice.value?`no`:!yesChoice&&!noChoice?`yes`:step.choices.length===2&&!selectedChoice.isYes&&!selectedChoice.isNo?`no`:`yes`),choiceAnalysis={selectedValue:data.choice,selectedChoice,answerType,hasYesFlag:!!yesChoice,hasNoFlag:!!noChoice}}return{...step,index,isCompleted:completedSteps.value.has(index),isCurrent:index===currentStepIndex.value,isAccessible:index<=currentStepIndex.value,isEnabled:isStepEnabled(step),data,hasData:Object.keys(data).length>0,isAnswered:step.type===`choice`?data.choice!==void 0:Object.keys(data).length>0,answerType:choiceAnalysis?.answerType||null,choiceAnalysis}})),goToStep,nextStep,previousStep:async()=>{if(await nextTick(),!canGoBack.value)return!1;for(currentStepIndex.value--;currentStepIndex.value>=0;){let targetStep=steps.value[currentStepIndex.value];if(isStepEnabled(targetStep)||targetStep.autoSkip===!1)break;currentStepIndex.value--}return currentStepIndex.value<0&&(currentStepIndex.value=0),!0},finish:()=>canFinish.value?(isFinished.value=!0,{success:!0,completedSteps:Array.from(completedSteps.value)}):{success:!1},reset:()=>{currentStepIndex.value=0,completedSteps.value.clear(),isFinished.value=!1},skip:()=>allowSkip?nextStep():!1,isStepEnabled,registerStep,unregisterStep}}var _hoisted_1$268={class:`wizard-container`},_hoisted_2$221={class:`wizard-content`},_hoisted_3$195={class:`wizard-step-content`},_hoisted_4$167={key:0,class:`wizard-validation`},_hoisted_5$144={class:`validation-message`},_hoisted_6$124={class:`wizard-navigation`},_hoisted_7$111={key:2,class:`switch-buttons`};const wizardProps={wizardOptions:{type:Object,default:()=>({})},title:String,preheadings:Array,showDivider:{type:Boolean,default:!0},showProgress:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},allowSkip:{type:Boolean,default:!1},backButtonText:{type:String,default:`ui.common.back`},nextButtonText:{type:String,default:`ui.common.next`},finishButtonText:{type:String,default:`ui.common.finish`},skipButtonText:{type:String,default:`ui.common.skip`},validationMessage:String};var _sfc_main$300={__name:`Wizard`,props:mergeModels(wizardProps,{modelValue:{default:()=>({})},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose,emit:__emit}){let props=__props,modelValue=useModel(__props,`modelValue`),emit$1=__emit,{currentStepIndex,currentStep,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress,stepProgress,nextStep:wizardNextStep,previousStep:wizardPreviousStep,skip:wizardSkip,steps,registerStep:originalRegisterStep}=useWizard({...props.wizardOptions,allowSkip:props.allowSkip}),instance$1=getCurrentInstance(),hasCentralizedModel=computed(()=>!!(instance$1&&instance$1.attrs&&`onUpdate:modelValue`in instance$1.attrs));provide(`currentWizardStep`,currentStep),provide(`wizardNext`,()=>nextStep()),provide(`wizardSteps`,steps),provide(`registerWizardStep`,stepConfig=>hasCentralizedModel.value?originalRegisterStep({...stepConfig,get modelValue(){return modelValue.value?.[stepConfig.id]||{}},updateModelValue:newValue=>{modelValue.value={...modelValue.value,[stepConfig.id]:newValue}}}):originalRegisterStep(stepConfig)),provide(`unregisterWizardStep`,stepId=>{if(hasCentralizedModel.value&&props.modelValue[stepId]){let updatedData={...props.modelValue};delete updatedData[stepId],emit$1(`update:modelValue`,updatedData)}});let currentStepChoices=computed(()=>currentStep.value?.choices||[]),getChoiceButtonClass=(choiceValue,selectedChoice)=>selectedChoice?selectedChoice===choiceValue?`answered-selected`:`answered-not-selected`:`unanswered`,handleChoiceClick=choice=>{currentStep.value?.updateModelValue&&(currentStep.value.updateModelValue({...currentStep.value.modelValue,choice:choice.value}),nextTick(()=>!currentStep.value?.advanceDisabled&&nextStep()))},nextStep=()=>{let stepId=currentStep.value?.id,currentData=currentStep.value?.modelValue||{};emit$1(`step-complete`,{stepId,stepIndex:currentStepIndex.value,step:currentStep.value,data:currentData}),wizardNextStep()&&emit$1(`step-change`,{from:currentStepIndex.value-1,to:currentStepIndex.value,step:currentStep.value})},previousStep=()=>{let prevIndex=currentStepIndex.value;wizardPreviousStep()&&emit$1(`step-change`,{from:prevIndex,to:currentStepIndex.value,step:currentStep.value})},skip=()=>{wizardSkip()&&emit$1(`step-complete`,{stepId:currentStep.value?.id,stepIndex:currentStepIndex.value-1,skipped:!0,data:currentStep.value?.modelValue||{}})},handleFinish=()=>{let allStepData={};steps.value.forEach(step=>{step.modelValue&&Object.keys(step.modelValue).length>0&&(allStepData[step.id]=step.modelValue)}),canFinish.value?emit$1(`wizard-finish`,{success:!0,data:allStepData,completedSteps:Array.from({length:steps.value.length},(_,i)=>i)}):emit$1(`validation-error`,{step:currentStep.value,message:`Cannot finish wizard - validation failed`})};return __expose({currentStepIndex,currentStep,progress,stepProgress,nextStep,previousStep,finish:handleFinish,skip,steps}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$268,[createBaseVNode(`div`,_hoisted_2$221,[_ctx.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:_ctx.preheadings,"show-divider":_ctx.showDivider},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.title)),1)]),_:1},8,[`preheadings`,`show-divider`])):createCommentVNode(``,!0),_ctx.showProgress?(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`wizard-progress-card`},{default:withCtx(()=>[createVNode(ProgressSteps_default,{steps:unref(stepProgress),"current-step":unref(currentStepIndex)},null,8,[`steps`,`current-step`])]),_:1})):createCommentVNode(``,!0),createVNode(unref(bngCard_default),{class:`wizard-main-card`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$124,[_ctx.showBackButton&&!unref(isFirstStep)?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(canGoBack),accent:unref(ACCENTS).secondary,onClick:previousStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.backButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),_ctx.allowSkip&&!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).secondary,onClick:skip},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.skipButtonText)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0),_cache[0]||=createBaseVNode(`div`,{class:`spacer`},null,-1),unref(currentStep)?.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_7$111,[(openBlock(!0),createElementBlock(Fragment,null,renderList(currentStepChoices.value,choice=>(openBlock(),createBlock(unref(bngButton_default),{key:choice.value,class:normalizeClass(getChoiceButtonClass(choice.value,unref(currentStep)?.modelValue?.choice||null)),accent:unref(ACCENTS).custom,icon:unref(currentStep)?.modelValue?.choice===choice.value?unref(icons).checkmark:null,disabled:unref(currentStep)?.advanceDisabled,onClick:$event=>handleChoiceClick(choice)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(choice.label)),1)]),_:2},1032,[`class`,`accent`,`icon`,`disabled`,`onClick`]))),128))])):createCommentVNode(``,!0),!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:!unref(canGoNext),accent:unref(ACCENTS).primary,onClick:nextStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.nextButtonText)),1)]),_:1},8,[`disabled`,`accent`])):unref(isLastStep)?(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:!unref(canFinish),accent:unref(ACCENTS).primary,onClick:handleFinish},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.finishButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[unref(currentStep)?.title?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`step-title`,{step:unref(currentStep)},()=>[createTextVNode(toDisplayString(_ctx.$tt(unref(currentStep).title)),1)],!0)]),_:3})):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$195,[renderSlot(_ctx.$slots,`step`,{step:unref(currentStep),stepData:unref(currentStep)?.modelValue,updateStepData:unref(currentStep)?.updateModelValue,stepIndex:unref(currentStepIndex),isFirst:unref(isFirstStep),isLast:unref(isLastStep)},()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],!0),_ctx.validationMessage?(openBlock(),createElementBlock(`div`,_hoisted_4$167,[createBaseVNode(`div`,_hoisted_5$144,toDisplayString(_ctx.validationMessage),1)])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default)]])]),_:3})])]))}},Wizard_default=__plugin_vue_export_helper_default(_sfc_main$300,[[`__scopeId`,`data-v-69c7b9c4`]]),_sfc_main$299={__name:`WizardView`,props:mergeModels({...wizardProps},{modelValue:{},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose}){let props=__props,slots=useSlots(),wizardRef=ref(),wizardModel=useModel(__props,`modelValue`);return __expose({wizard:wizardRef,get currentStepIndex(){return wizardRef.value?.currentStepIndex},get currentStep(){return wizardRef.value?.currentStep},get progress(){return wizardRef.value?.progress},get stepProgress(){return wizardRef.value?.stepProgress},get steps(){return wizardRef.value?.steps},nextStep:()=>wizardRef.value?.nextStep(),previousStep:()=>wizardRef.value?.previousStep(),finish:()=>wizardRef.value?.finish(),skip:()=>wizardRef.value?.skip()}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`layout-content-full content-center layout-paddings wizard-view`},{default:withCtx(()=>[createVNode(Wizard_default,mergeProps({ref_key:`wizardRef`,ref:wizardRef},props,{modelValue:wizardModel.value,"onUpdate:modelValue":_cache[0]||=$event=>wizardModel.value=$event,onStepChange:_cache[1]||=$event=>_ctx.$emit(`step-change`,$event),onStepComplete:_cache[2]||=$event=>_ctx.$emit(`step-complete`,$event),onWizardFinish:_cache[3]||=$event=>_ctx.$emit(`wizard-finish`,$event),onValidationError:_cache[4]||=$event=>_ctx.$emit(`validation-error`,$event)}),createSlots({_:2},[renderList(unref(slots),(slot,name)=>({name,fn:withCtx(props$1=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(props$1)),void 0,!0)])}))]),1040,[`modelValue`])]),_:3})),[[unref(BngBlur_default)]])}},WizardView_default=__plugin_vue_export_helper_default(_sfc_main$299,[[`__scopeId`,`data-v-e47281c4`]]),_hoisted_1$267={key:0,class:`wizard-summary`},_sfc_main$298={__name:`WizardSummary`,props:{custom:{type:Array,default:()=>[],validator:items$2=>items$2.every(item=>item.label&&item.value!==void 0)},replace:{type:Boolean,default:!1}},setup(__props){let props=__props,steps=inject(`wizardSteps`,ref([])),summaryItems=computed(()=>{let customItems=props.custom.map(item=>({stepId:uniqueId(),title:item.label,selectedLabel:item.value,hasSelection:!item.disabled}));if(props.replace)return customItems;let stepsList=steps.value||[],automaticItems=[];return Array.isArray(stepsList)&&(automaticItems=stepsList.filter(step=>step.type===`choice`&&step.choices&&step.choices.length>0).map(step=>{let selectedChoice=step.modelValue?.choice,choiceOption=step.choices.find(choice=>choice.value===selectedChoice);return{stepId:step.id,title:step.title,selectedLabel:choiceOption?.label||null,hasSelection:!!selectedChoice}}).filter(item=>item.hasSelection)),[...automaticItems,...customItems]});return(_ctx,_cache)=>summaryItems.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$267,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summaryItems.value,item=>(openBlock(),createElementBlock(`div`,{key:item.stepId,class:`summary-item`},[createBaseVNode(`strong`,null,toDisplayString(_ctx.$tt(item.title))+`:`,1),createBaseVNode(`span`,{class:normalizeClass({enabled:item.hasSelection,disabled:!item.hasSelection})},toDisplayString(_ctx.$tt(item.selectedLabel||`ui.common.unknown`)),3)]))),128))])):createCommentVNode(``,!0)}},WizardSummary_default=__plugin_vue_export_helper_default(_sfc_main$298,[[`__scopeId`,`data-v-69c45791`]]),_hoisted_1$266={key:0,class:`wizard-step-container`},_hoisted_2$220={key:0,class:`step-description`},_hoisted_3$194=[`innerHTML`],_hoisted_4$166={class:`step-content`},_hoisted_5$143={key:0,class:`wizard-choice-step`},_hoisted_6$123={key:1,class:`wizard-form-step`},_hoisted_7$110={key:2,class:`wizard-confirmation-step`},_hoisted_8$93={key:3,class:`wizard-custom-step`},_hoisted_9$83={class:`custom-placeholder`},_sfc_main$297={__name:`WizardStep`,props:mergeModels({id:{type:String,required:!0},title:String,description:String,type:{type:String,default:`custom`,validator:value=>[`choice`,`form`,`confirmation`,`custom`].includes(value)},autoSkip:{type:Boolean,default:!0},advanceDisabled:{type:Boolean,default:!1},advanceDelay:{type:Number,default:300},required:{type:Boolean,default:!0},validator:{type:Function,default:null},enabledWhen:{type:Array,default:()=>[]},choices:{type:Array,default:()=>[]},component:{type:[String,Object],default:null},componentProps:{type:Object,default:()=>({})}},{modelValue:{default:()=>({})},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props,{expose:__expose}){let props=__props,modelValue=useModel(__props,`modelValue`),registerStep=inject(`registerWizardStep`,null),unregisterStep=inject(`unregisterWizardStep`,null),currentStep=inject(`currentWizardStep`,null),slots=useSlots(),stepContext={stepId:props.id,stepType:props.type};provide(`wizardStepContext`,stepContext),__expose({stepId:props.id,stepContext});let isCurrentStep=computed(()=>currentStep?.value?.id===props.id);return onMounted(()=>{registerStep?.({id:props.id,title:props.title,description:props.description,type:props.type,autoSkip:props.autoSkip,get advanceDisabled(){return props.advanceDisabled},advanceDelay:props.advanceDelay,required:props.required,enabledWhen:props.enabledWhen,validate:props.validator,component:props.component,componentProps:props.componentProps,choices:props.choices,get modelValue(){return modelValue.value},updateModelValue:value=>{modelValue.value=value},hasDefaultSlot:!!slots.default,hasDescriptionSlot:!!slots.description})}),onUnmounted(()=>{unregisterStep?.(props.id)}),(_ctx,_cache)=>isCurrentStep.value?(openBlock(),createElementBlock(`div`,_hoisted_1$266,[__props.description||_ctx.$slots.description?(openBlock(),createElementBlock(`div`,_hoisted_2$220,[renderSlot(_ctx.$slots,`description`,{},()=>[__props.description?(openBlock(),createElementBlock(`div`,{key:0,innerHTML:__props.description},null,8,_hoisted_3$194)):createCommentVNode(``,!0)],!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$166,[__props.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_5$143,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):__props.type===`form`?(openBlock(),createElementBlock(`div`,_hoisted_6$123,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createBaseVNode(`div`,{class:`form-placeholder`},[createBaseVNode(`p`,null,`Add your form content here using BngInput, BngDropdown, etc.`),createBaseVNode(`p`,{class:`form-note`},`Use v-model bindings to connect to step data.`)],-1)],!0)])):__props.type===`confirmation`?(openBlock(),createElementBlock(`div`,_hoisted_7$110,[renderSlot(_ctx.$slots,`default`,{},()=>[createVNode(WizardSummary_default)],!0)])):(openBlock(),createElementBlock(`div`,_hoisted_8$93,[renderSlot(_ctx.$slots,`default`,{},()=>[createBaseVNode(`div`,_hoisted_9$83,[createBaseVNode(`p`,null,`Custom step content for: `+toDisplayString(__props.title),1),_cache[1]||=createBaseVNode(`p`,{class:`custom-note`},`Add your custom content in the WizardStep default slot`,-1)])],!0)]))])])):createCommentVNode(``,!0)}},WizardStep_default=__plugin_vue_export_helper_default(_sfc_main$297,[[`__scopeId`,`data-v-ede4abc3`]]),_hoisted_1$265={class:`description`},_hoisted_2$219={class:`image-section`},_hoisted_3$193={class:`image-row`},_hoisted_4$165=[`src`],_hoisted_5$142=[`src`],_sfc_main$296={__name:`ButtonLayoutView`,setup(__props){let settings$1=useSettings(),handleFinish=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.mainmenu`)},goToControls=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.options.controls.bindings`)};return onMounted(async()=>{await settings$1.waitForData()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(WizardView_default),{title:`Input Changes`,class:`wizard-view`,"show-progress":!1,"finish-button-text":`ui.common.continue`,onWizardFinish:handleFinish},{default:withCtx(()=>[createVNode(unref(WizardStep_default),{id:`buttonLayout`,title:`Extended Modifier Buttons`,type:`confirmation`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$265,[_cache[1]||=createBaseVNode(`p`,null,` We updated the default button layout for Xbox and Playstation controllers using modifier buttons. Below you see the new default layout. `,-1),_cache[2]||=createBaseVNode(`p`,null,[createBaseVNode(`strong`,{class:`warning-text`},`If you made any changes to the default layout on Xbox or Playstation, we suggest you review your current layout and then either edit it or reset to the default if needed.`)],-1),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:goToControls},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Go to Controls `,-1)]]),_:1},8,[`accent`])])),[[unref(BngUiNavScroll_default)]]),createBaseVNode(`div`,_hoisted_2$219,[_cache[3]||=createBaseVNode(`h4`,null,`New Button Layout`,-1),createBaseVNode(`div`,_hoisted_3$193,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout1.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_4$165),createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout2.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_5$142)])])]),_:1})]),_:1}))}},ButtonLayoutView_default=__plugin_vue_export_helper_default(_sfc_main$296,[[`__scopeId`,`data-v-ff98d0e0`]]),routes_default$2=[{path:`/buttonLayout`,name:`buttonLayout`,component:ButtonLayoutView_default,meta:{infoBar:{visible:!0,showSysInfo:!0},uiApps:{shown:!1}}}],_hoisted_1$264={class:`left`},_hoisted_2$218={class:`branch-icon-assembly`},_hoisted_3$192=[`innerHTML`],_hoisted_4$164=[`innerHTML`],_sfc_main$295={__name:`BranchSkillProgressBar`,props:{skill:Object,mode:{type:String,default:`long`,validator:value=>[`long`,`short`,`simple`,`with-value-label`].includes(value)},showLevel:{type:Boolean,default:!1},showLockedIcon:{type:Boolean,default:!1},isMainProgress:{type:Boolean,default:!1}},setup(__props){let props=__props,headerLeft=computed(()=>props.skill.name),headerRightLevelOrStars=computed(()=>props.skill.isInDevelopment?``:props.skill.unlocked?(props.showLevel&&props.skill.unlocked,props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:props.skill.value,max:props.skill.max}}):props.skill.levelLabel?props.skill.levelLabel:props.skill.level?$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}}):`Level ${props.skill.level}`):$translate.contextTranslate(`ui.career.locked`)),value=computed(()=>props.skill.max===-1?1:props.skill.value-props.skill.min),max$1=computed(()=>props.skill.max===-1?1:props.skill.max-props.skill.min),valueLabelFormat=computed(()=>{if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(!props.skill.unlocked)return $translate.contextTranslate(`ui.career.locked`);if(props.mode===`simple`)return props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:value.value,max:max$1.value}}):$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}});let unit=props.skill.showProgressAsStars?`Stars`:`XP`;return props.skill.max===-1?$translate.contextTranslate({txt:`ui.career.just`+unit,context:{cur:value.value}}):$translate.contextTranslate({txt:`ui.career.slashXP`,context:{cur:value.value,max:max$1.value}})}),skillIcon=computed(()=>props.skill.isInDevelopment?icons.roadblockL:props.skill.unlocked?props.skill.icon||`info`:`lockClosed`),belowValueLabelFormat=computed(()=>{if(!props.skill.unlocked&&props.skill.lockedReason)return $translate.contextTranslate(props.skill.lockedReason?.label||`ui.career.locked`);if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(props.skill.isMaxLevel)return`​`;if(!props.skill.showProgressAsStars)return $translate.contextTranslate({txt:`ui.career.justXP`,context:{cur:props.skill.value}})}),branchBackgroundStyle=computed(()=>{let color=props.skill.accentColor;return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}});return(_ctx,_cache)=>__props.mode===`simple`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`simple-progress`,{"is-locked":!props.skill.unlocked}])},[createBaseVNode(`div`,_hoisted_1$264,[createBaseVNode(`div`,_hoisted_2$218,[!__props.skill.isSkill&&!__props.skill.isBranch?(openBlock(),createElementBlock(`div`,{key:0,class:`branch-background`,style:normalizeStyle(branchBackgroundStyle.value)},null,4)):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{type:skillIcon.value,class:`assembly-icon`},null,8,[`type`])]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(headerLeft.value)),1)]),createBaseVNode(`div`,{class:`right`,innerHTML:valueLabelFormat.value},null,8,_hoisted_3$192)],2)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`flex-column`,{"is-locked":!props.skill.unlocked}])},[createVNode(unref(bngProgressBar_default),{class:normalizeClass([`stat-progress-bar`,{short:__props.mode===`short`,isMainProgress:__props.isMainProgress}]),headerLeft:_ctx.$ctx_t(headerLeft.value),headerRight:_ctx.$ctx_t(headerRightLevelOrStars.value),value:value.value,max:max$1.value+.001,showValueLabel:!0,valueLabelFormat:``,valueColor:`#eeeeee`},null,8,[`class`,`headerLeft`,`headerRight`,`value`,`max`]),!props.skill.unlocked&&__props.mode===`with-value-label`&&props.showLockedIcon?(openBlock(),createElementBlock(Fragment,{key:0},[],64)):createCommentVNode(``,!0),__props.mode===`with-value-label`?(openBlock(),createElementBlock(`div`,{key:1,class:`below-progress-bar`,innerHTML:belowValueLabelFormat.value},null,8,_hoisted_4$164)):createCommentVNode(``,!0)],2))}},BranchSkillProgressBar_default=__plugin_vue_export_helper_default(_sfc_main$295,[[`__scopeId`,`data-v-2f641a65`]]);function hexToRgb(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}function getBranchColorStyle({color,accentColor}){let style={};color&&(color.startsWith(`#`)?style[`--branch-color`]=hexToRgb(color):color.startsWith(`var(--`)&&(style[`--branch-color`]=color));let accent=accentColor||color;return accent&&(accent.startsWith(`#`)?style[`--branch-accent-color`]=hexToRgb(accent):accent.startsWith(`var(--`)&&(style[`--branch-accent-color`]=accent)),style}function getIconBackgroundStyle(color){return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}}var _hoisted_1$263={class:`branch-details`},_hoisted_2$217={class:`backdrop`},_hoisted_3$191={class:`skill-levels-wrapper`},_hoisted_4$163={key:0,class:`branch-name-container`},_hoisted_5$141={key:2,class:`branch-footer`},_hoisted_6$122={key:0,class:`branch-description`},_hoisted_7$109={key:0,class:`branch-description`},_hoisted_8$92={class:`branch-footer-content`},_hoisted_9$82={class:`certification-text`},_hoisted_10$72={class:`status`},_hoisted_11$65={class:`unlock-info-row`},_hoisted_12$53={class:`icon-box`},_hoisted_13$46={class:`certification-text`},_sfc_main$294={__name:`BranchSkillCard`,props:{branchKey:String,displayMode:{type:String,default:`card`}},emits:[`openBranchPage`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,branchData=ref();computed(()=>branchData.value&&`url(${getAssetURL(branchData.value.icon)})`);let branchColor=computed(()=>{let color=branchData.value&&branchData.value.color;return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchAccentColor=computed(()=>{let color=branchData.value&&(branchData.value.accentColor||branchData.value.color);return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchIconType=computed(()=>branchData.value&&branchData.value.isInDevelopment?icons.roadblockL:branchData.value&&branchData.value.unlocked?icons[branchData.value.glyphIcon]:icons.lockClosed),isHalf=computed(()=>{if(!branchData.value)return!1;let hasSkills=branchData.value.skills&&branchData.value.skills.length>0,hasDescription=branchData.value.shortDescription;return!hasSkills&&!hasDescription}),safeArray=arr=>Array.isArray(arr)?arr:[],openBranchPage=branchKey=>emit$1(`openBranchPage`,branchKey);function setup$3(data){branchData.value=data,branchData.value.skills=safeArray(data.skills)}let formatColor=color=>color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`rgb(255, 255, 255)`:``;return onMounted(async()=>{setup$3(await Lua_default.career_modules_branches_landing.getBranchSkillCardData(props.branchKey))}),(_ctx,_cache)=>branchData.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:normalizeClass([`branch-skill-card`,{"row-mode":__props.displayMode===`row`,locked:!branchData.value.unlocked,half:isHalf.value}]),onClick:_cache[0]||=$event=>openBranchPage(__props.branchKey),style:normalizeStyle({"--branch-color":branchColor.value,"--branch-accent-color":branchAccentColor.value})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$263,[_cache[2]||=createBaseVNode(`div`,{class:`indicator left`},null,-1),_cache[3]||=createBaseVNode(`div`,{class:`indicator right`},null,-1),branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`branch-progress`,{"in-development":branchData.value.isInDevelopment}])},[branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`badge`,{"row-badge":__props.displayMode===`row`}])},[createBaseVNode(`div`,_hoisted_2$217,toDisplayString(branchData.value.value.color),1),createVNode(unref(bngIcon_default),{class:`icon-branch`,type:branchIconType.value},null,8,[`type`])],2))],2)),branchData.value.isDomain?(openBlock(),createBlock(unref(aspectRatio_default),{key:1,"external-image":branchData.value.cover,ratio:`16:9`,class:`image-container aspect-ratio`},null,8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$191,[__props.displayMode===`row`?(openBlock(),createElementBlock(`div`,_hoisted_4$163,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,class:`main-stat-progress-bar`,skill:branchData.value,showLevel:!0,mode:(branchData.value.isInDevelopment&&isHalf.value,``)},null,8,[`skill`,`mode`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),isHalf.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$141,[branchData.value.isInDevelopment?(openBlock(),createElementBlock(`div`,_hoisted_6$122,toDisplayString(_ctx.$ctx_t(`ui.career.inDevelopment`)),1)):(openBlock(),createElementBlock(Fragment,{key:1},[branchData.value.shortDescription?(openBlock(),createElementBlock(`div`,_hoisted_7$109,toDisplayString(_ctx.$ctx_t(branchData.value.shortDescription)),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_8$92,[branchData.value.skills?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(branchData.value.skills,skill=>(openBlock(),createElementBlock(`div`,null,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,skill,mode:`simple`},null,8,[`skill`])):createCommentVNode(``,!0)]))),256)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.certifications,certification=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`certification-container`,certification.status])},[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,style:normalizeStyle({color:certification.status===`completed`?`white`:certification.status===`available`?`rgba(255, 255, 255, 0.6)`:`rgba(255, 255, 255, 0.5)`})},null,8,[`type`,`style`]),createBaseVNode(`div`,_hoisted_9$82,[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.certification.name`))+` `,1),createBaseVNode(`span`,_hoisted_10$72,toDisplayString(_ctx.$ctx_t(certification.statusLabel)),1)])],2))),256)),branchData.value.unlockInfos?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[1]||=createBaseVNode(`div`,{class:`unlock-info-title`},`Required Certifications:`,-1),createBaseVNode(`div`,_hoisted_11$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.unlockInfos,unlockInfo=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`unlock-info-item`,unlockInfo.status]),style:normalizeStyle({"--unlock-color":formatColor(unlockInfo.color?unlockInfo.color:`var(--bng-cool-gray-500-rgb)`)})},[createBaseVNode(`div`,_hoisted_12$53,[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,class:`certification-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_13$46,toDisplayString(_ctx.$ctx_t(unlockInfo.label)),1)],6))),256))])],64)):createCommentVNode(``,!0)])],64))]))])]),_:1},8,[`class`,`style`])):createCommentVNode(``,!0)}},BranchSkillCard_default=__plugin_vue_export_helper_default(_sfc_main$294,[[`__scopeId`,`data-v-4321db2f`]]),_hoisted_1$262={class:`condensed`},_hoisted_2$216={key:3,class:`dev-icon-container`},_hoisted_3$190={class:`main-info`},_hoisted_4$162={key:1,class:`stars`},_sfc_main$293={__name:`MissionCard`,props:{mission:Object,isSkeleton:Boolean,showStartableIcons:Boolean},emits:[`clicked`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clicked=()=>emit$1(`clicked`,props.mission),backgroundImageStyle=computed(()=>({backgroundImage:`url(${props.mission.thumbnail})`,maskImage:`linear-gradient(to left, rgba(0, 0, 0, ${props.mission.startable?.75:.2}) 50%, rgba(0, 0, 0, 0.1) 100%)`,filter:props.mission.startable?`none`:`grayscale(100%)`})),iconType$1=computed(()=>props.isSkeleton?icons.medal:icons[props.mission.icon]||icons.medal),iconColor=computed(()=>props.isSkeleton||!props.mission.startable?`var(--bng-cool-gray-600)`:`#fff`),showStartableIcons=computed(()=>!props.isSkeleton&&props.showStartableIcons);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,onClick:clicked,class:normalizeClass({"card-wrapper":!0,"click-startable":__props.mission&&__props.mission.startable})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$262,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,style:normalizeStyle(backgroundImageStyle.value)},null,8,[`style`])),!__props.isSkeleton&&!__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).lockClosed,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.isSkeleton&&showStartableIcons.value?(openBlock(),createElementBlock(Fragment,{key:2},[__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`locked-icon`,type:unref(icons).play,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).mapPoint,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),!__props.isSkeleton&&__props.mission.devMission?(openBlock(),createElementBlock(`div`,_hoisted_2$216,[createVNode(unref(bngIcon_default),{class:`dev-icon`,type:unref(icons).bug,color:`white`},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`dev-text`},` DEV MISSION `,-1)])):createCommentVNode(``,!0),_cache[1]||=createBaseVNode(`div`,{class:`highlight-marker`},null,-1),createVNode(unref(bngIcon_default),{class:`mission-icon`,type:iconType$1.value,color:iconColor.value},null,8,[`type`,`color`]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``}),createBaseVNode(`div`,_hoisted_3$190,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`heading`,{locked:!__props.mission.startable}])},toDisplayString(_ctx.$tt(__props.mission.label)),3)),!__props.isSkeleton&&__props.mission.startable&&__props.mission.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_4$162,[__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalDefaultStarCount?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:__props.mission.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0),__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:__props.mission.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])]),_:1},8,[`class`]))}},MissionCard_default=__plugin_vue_export_helper_default(_sfc_main$293,[[`__scopeId`,`data-v-52ea67db`]]),_hoisted_1$261={class:`rewards-pills-container`},_sfc_main$292={__name:`RewardPill`,props:{icon:String,attributeKey:String,rewardAmount:Number,highlight:Boolean,hideNumbers:Boolean,backgroundColor:{type:String,default:`rgba(var(--bng-cool-gray-900-rgb), 0.5)`}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$261,[createBaseVNode(`div`,{class:`pill`,style:normalizeStyle({backgroundColor:__props.backgroundColor,filter:__props.highlight?`brightness(350%)`:``})},[createVNode(unref(bngUnit_default),mergeProps({[__props.icon?`beamXP`:__props.attributeKey]:__props.rewardAmount},{options:__props.hideNumbers?{formatter:x=>null}:null,iconType:__props.icon?unref(icons)[__props.icon]:null,formatter:__props.attributeKey}),null,16,[`options`,`iconType`,`formatter`])],4)]))}},RewardPill_default=__plugin_vue_export_helper_default(_sfc_main$292,[[`__scopeId`,`data-v-7719e2fc`]]),_hoisted_1$260={class:`rewards-pills-container`},_sfc_main$291={__name:`RewardsPills`,props:{rewards:Object,hideNumbers:Boolean,negativeBackground:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$260,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.rewards,reward=>(openBlock(),createBlock(RewardPill_default,{icon:reward.icon,hideNumbers:__props.hideNumbers,attributeKey:reward.attributeKey,rewardAmount:reward.rewardAmount,highlight:reward.highlight,backgroundColor:__props.negativeBackground&&reward.rewardAmount<0?`rgba(var(--bng-add-red-700-rgb), 0.5)`:void 0},null,8,[`icon`,`hideNumbers`,`attributeKey`,`rewardAmount`,`highlight`,`backgroundColor`]))),256))]))}},RewardsPills_default=__plugin_vue_export_helper_default(_sfc_main$291,[[`__scopeId`,`data-v-40e5103d`]]),_hoisted_1$259={key:0,class:`animated-border claimable`},_hoisted_2$215={key:1,class:`complete`},_hoisted_3$189={key:0,class:`complete`},_hoisted_4$161={key:1,class:`complete-badge`},_hoisted_5$140={key:2,class:`step`},_hoisted_6$121={key:3,class:`step`},_hoisted_7$108={class:`content`},_hoisted_8$91={class:`heading`},_hoisted_9$81={key:0,class:`middle-content`},_hoisted_10$71={key:1,class:`middle-content`},_hoisted_11$64={key:3,class:`progress`},_sfc_main$290={__name:`MilestoneCard`,props:{milestone:Object,isCondensed:Boolean},emits:[`claim`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,claimMilestone=()=>{console.log(`claimMilestone`,props.milestone),props.milestone.claimable&&(emit$1(`claim`,props.milestone),console.log(props.milestone))},milestoneColor=computed(()=>{let color=props.milestone.color;return color?color.startsWith(`#`)?hexToRgb$1(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``});function hexToRgb$1(hex){return`${parseInt(hex.slice(1,3),16)}, ${parseInt(hex.slice(3,5),16)}, ${parseInt(hex.slice(5,7),16)}`}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{"bng-nav-item":``,onClick:claimMilestone,class:`condensed`},[__props.milestone.claimable?(openBlock(),createElementBlock(`div`,_hoisted_1$259)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_2$215)):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,style:normalizeStyle({backgroundColor:`rgb(`+milestoneColor.value+`)`}),ratio:`21:9`},{default:withCtx(()=>[__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_3$189)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_4$161,[createVNode(unref(bngIcon_default),{class:`glyph small`,type:unref(icons).checkmark},null,8,[`type`])])):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.milestone.icon]},null,8,[`type`]),__props.milestone.step!==void 0&&__props.milestone.maxStep!==void 0?(openBlock(),createElementBlock(`div`,_hoisted_5$140,toDisplayString(__props.milestone.step)+`/`+toDisplayString(__props.milestone.maxStep),1)):createCommentVNode(``,!0),__props.milestone.step!==void 0&&__props.milestone.maxStep===void 0?(openBlock(),createElementBlock(`div`,_hoisted_6$121,toDisplayString(__props.milestone.step),1)):createCommentVNode(``,!0)]),_:1},8,[`style`]),createBaseVNode(`div`,_hoisted_7$108,[createBaseVNode(`div`,_hoisted_8$91,toDisplayString(_ctx.$ctx_t(__props.milestone.label)),1),__props.milestone.description?(openBlock(),createElementBlock(`div`,_hoisted_9$81,toDisplayString(_ctx.$ctx_t(__props.milestone.description)),1)):createCommentVNode(``,!0),__props.milestone.rewards?(openBlock(),createElementBlock(`div`,_hoisted_10$71,[createVNode(RewardsPills_default,{rewards:__props.milestone.rewards},null,8,[`rewards`])])):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,value:1,max:1,min:0,valueLabelFormat:`Complete!`,class:`progress`})):createCommentVNode(``,!0),__props.milestone.progress?(openBlock(),createElementBlock(`div`,_hoisted_11$64,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.milestone.progress,prog=>(openBlock(),createBlock(unref(bngProgressBar_default),{class:normalizeClass({claimProgressBar:__props.milestone.claimable}),value:prog.currValue,max:prog.maxValue,min:prog.minValue,valueLabelFormat:__props.milestone.claimable?`Click to claim!`:_ctx.$ctx_t(prog.label)},null,8,[`class`,`value`,`max`,`min`,`valueLabelFormat`]))),256))])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])}},MilestoneCard_default=__plugin_vue_export_helper_default(_sfc_main$290,[[`__scopeId`,`data-v-8fc3424a`]]),_hoisted_1$258={class:`progress-track`},_hoisted_2$214={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_3$188={class:`header`},_hoisted_4$160={class:`name`},_hoisted_5$139={key:0,class:`stars`},_hoisted_6$120={key:1,class:`stars`},_hoisted_7$107={class:`info`},_hoisted_8$90={class:`unlock-condition`},_hoisted_9$80={class:`info`},_hoisted_10$70={class:`label`},_hoisted_11$63={class:`description`},_hoisted_12$52={key:0,class:`cards-container`},_hoisted_13$45={class:`basic-card locked coming-soon`},_hoisted_14$42={class:`label`},_hoisted_15$40={key:1,class:`right`},_sfc_main$289={__name:`LeagueRow`,props:{league:Object,leagueMissionClicked:Function,condensed:Boolean,vertical:Boolean,nowUnlocked:Boolean},setup(__props){let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let leagueStyle=computed(()=>{if(!props.league.accentColor)return{};let style={};return props.league.accentColor.startsWith(`#`)?style[`--league-accent-color`]=hexToRgb$1(props.league.accentColor):props.league.accentColor.startsWith(`var(--`)&&(style[`--league-accent-color`]=props.league.accentColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`league-row`,{locked:!__props.league._unlocked,condensed:__props.condensed}]),style:normalizeStyle(leagueStyle.value)},[createBaseVNode(`div`,_hoisted_1$258,[__props.league._unlocked?(openBlock(),createElementBlock(`div`,_hoisted_2$214)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$188,[createBaseVNode(`div`,_hoisted_4$160,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.league.icon],class:`skill-icon`,color:__props.league._unlocked?`white`:`gray`},null,8,[`type`,`color`]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(__props.league.name)),1)]),__props.nowUnlocked?(openBlock(),createElementBlock(`div`,_hoisted_6$120,[createVNode(unref(bngIcon_default),{type:unref(icons).lockOpened},null,8,[`type`])])):(openBlock(),createElementBlock(`div`,_hoisted_5$139,[__props.league._unlocked?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"unlocked-stars":__props.league.totalStarsObtained,"total-stars":__props.league.totalStarsAvailable,class:`main-stars`,scale:.8,reverse:``,numerical:``},null,8,[`unlocked-stars`,`total-stars`])):createCommentVNode(``,!0)]))]),createBaseVNode(`div`,{class:normalizeClass([`content-row`,{vertical:__props.vertical}])},[createBaseVNode(`div`,_hoisted_7$107,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.unlock,cond=>(openBlock(),createElementBlock(Fragment,null,[cond.hidden?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCard_default),{key:0},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$90,[createBaseVNode(`div`,_hoisted_9$80,[createVNode(unref(bngIcon_default),{class:`icon`,type:cond.met?unref(icons).lockOpened:unref(icons).lockClosed,color:cond.met?`white`:`gray`},null,8,[`type`,`color`]),createBaseVNode(`div`,_hoisted_10$70,toDisplayString(cond.label),1)]),cond.progress?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:cond.progress.cur,min:cond.progress.min,max:cond.progress.max,valueLabelFormat:``,class:`progress`},null,8,[`value`,`min`,`max`])):createCommentVNode(``,!0)])]),_:2},1024))],64))),256)),createBaseVNode(`div`,_hoisted_11$63,toDisplayString(_ctx.$ctx_t(__props.league.description)),1)]),__props.condensed?(openBlock(),createElementBlock(`div`,_hoisted_15$40,toDisplayString(__props.league.missions.length)+` Challenges `,1)):(openBlock(),createElementBlock(`div`,_hoisted_12$52,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.missions,mission=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:mission.id,mission,onClicked:__props.leagueMissionClicked,showStartableIcons:!0},null,8,[`mission`,`onClicked`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.driftSpots,driftSpot=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:driftSpot.id,mission:driftSpot,onClicked:__props.leagueMissionClicked},null,8,[`mission`,`onClicked`]))),128)),__props.league.comingSoon?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.league.comingSoon,info=>(openBlock(),createBlock(unref(bngCard_default),{class:`card-height`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_13$45,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[info.icon],color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_14$42,toDisplayString(info.label),1)])]),_:2},1024))),256)):createCommentVNode(``,!0)]))],2)],6))}},LeagueRow_default=__plugin_vue_export_helper_default(_sfc_main$289,[[`__scopeId`,`data-v-f92a650f`]]),_hoisted_1$257={class:`label`},_hoisted_2$213={class:`text`},_hoisted_3$187={class:`description`},_sfc_main$288={__name:`TaskGoal`,props:{label:[String,Object],description:[String,Object],complete:Boolean,success:Boolean,settings:{type:Object,default:{animate:!1,animateOnMount:!1,successCallback:Function}}},setup(__props){let props=__props,slots=useSlots(),animationSettings=inject(`animationSettings`,props.settings),animate=ref(!1),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description,!0))),checkboxSvgs=computed(()=>({"--checkbox-empty":`url(${getAssetURL(`icons/general/checkbox-empty.svg`)})`,"--checkbox-ok":`url(${getAssetURL(`icons/general/checkbox-ok.svg`)})`,"--checkbox-nope":`url(${getAssetURL(`icons/general/checkbox-nope.svg`)})`}));return watch(()=>[props.complete,props.success],(newValues,oldValues)=>{let isComplete=newValues[0],isSuccess=newValues[1];animate.value=animationSettings.animate&&isComplete,isSuccess&&animationSettings.successCallback()}),onBeforeMount(()=>{animate.value=props.settings.animate&&props.settings.animateOnMount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`task-goal`,{success:__props.complete&&__props.success,fail:__props.complete&&!__props.success,animate:animate.value}])},[createBaseVNode(`div`,_hoisted_1$257,[createBaseVNode(`span`,{class:`checkbox`,style:normalizeStyle(checkboxSvgs.value)},null,4),createBaseVNode(`span`,_hoisted_2$213,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]),createBaseVNode(`span`,_hoisted_3$187,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])],2))}},TaskGoal_default=__plugin_vue_export_helper_default(_sfc_main$288,[[`__scopeId`,`data-v-5a381682`]]),_hoisted_1$256={key:0,class:`wrapper`},_hoisted_2$212={class:`heading`},_hoisted_3$186={class:`description`},_hoisted_4$159={key:1,class:`tasklist wrapper`},_hoisted_5$138={class:`task-content`},_hoisted_6$119={class:`heading`},_hoisted_7$106={class:`description`},_sfc_main$287={__name:`UnlockCard`,props:{data:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[__props.data.type==`tasklist`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$256,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[__props.data.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_2$212,toDisplayString(__props.data.heading),1),createBaseVNode(`div`,_hoisted_3$186,toDisplayString(__props.data.description),1)])),__props.data.type==`tasklist`?(openBlock(),createElementBlock(`div`,_hoisted_4$159,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.data.tasklistData.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_5$138,[createBaseVNode(`div`,_hoisted_6$119,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_7$106,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0)],64))}},UnlockCard_default=__plugin_vue_export_helper_default(_sfc_main$287,[[`__scopeId`,`data-v-c5fa6ca1`]]),_hoisted_1$255={class:`unlock-rows`},_hoisted_2$211={class:`rows-container`},_hoisted_3$185={class:`progress-track`},_hoisted_4$158={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_5$137={class:`header`},_hoisted_6$118={class:`level-name-and-heading`},_hoisted_7$105={class:`level-label`},_hoisted_8$89={key:0,class:`description-heading`},_hoisted_9$79={class:`content-row`},_hoisted_10$69={class:`description-column`},_hoisted_11$62={class:`unlock-condition`},_hoisted_12$51={class:`info`},_hoisted_13$44={class:`label`},_hoisted_14$41={key:1,class:`description-text`},_hoisted_15$39={class:`unlocks-column`},_hoisted_16$38={key:0,class:`unlocks-list`},_sfc_main$286={__name:`UnlockRows`,props:{value:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,required:!0},maxRequiredValue:{type:Number,required:!1},tiers:Array,currentTier:Number,unlocked:Boolean,progressFillColor:{type:String,default:`#ff6600`}},setup(__props){useCssVars(_ctx=>({v1b3c87f1:props.progressFillColor.startsWith(`var(--`)&&props.progressFillColor.endsWith(`-rgb)`)?`rgb(${props.progressFillColor})`:props.progressFillColor}));let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let progressStyle=computed(()=>{if(!props.progressFillColor)return{};let style={};return props.progressFillColor.startsWith(`#`)?style[`--progress-fill-color`]=hexToRgb$1(props.progressFillColor):props.progressFillColor.startsWith(`var(--`)&&(style[`--progress-fill-color`]=props.progressFillColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$255,[createBaseVNode(`div`,_hoisted_2$211,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.tiers,(tier,idx)=>(openBlock(),createElementBlock(`div`,{key:tier.index,class:normalizeClass({"tier-row":!0,"grayed-out":__props.currentTier<=tier.index-1,completed:__props.currentTier+1>tier.index,"in-development":tier.isInDevelopment,"first-tier":idx===0,"last-tier":idx===__props.tiers.length-1})},[createBaseVNode(`div`,_hoisted_3$185,[__props.currentTier+1>tier.index?(openBlock(),createElementBlock(`div`,_hoisted_4$158)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$137,[createBaseVNode(`div`,_hoisted_6$118,[createBaseVNode(`span`,_hoisted_7$105,`Level `+toDisplayString(tier.label?tier.label:tier.index),1),tier.description&&tier.description.heading?(openBlock(),createElementBlock(`span`,_hoisted_8$89,`: `+toDisplayString(tier.description.heading),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$79,[createBaseVNode(`div`,_hoisted_10$69,[tier.isInDevelopment||__props.currentTier+1<=tier.index||!__props.unlocked?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`unlock-condition-card`,style:normalizeStyle(progressStyle.value)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_11$62,[createBaseVNode(`div`,_hoisted_12$51,[createVNode(unref(bngIcon_default),{class:`icon`,type:tier.isInDevelopment?unref(icons).roadblockL:unref(icons).lockClosed,color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_13$44,[tier.isInDevelopment?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Coming Soon! `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(tier.xpCurrent)+` / `+toDisplayString(tier.xpRequired)+` XP `,1)],64))])]),!tier.isInDevelopment&&tier.currentValue&&tier.requiredValue?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:tier.xpCurrent,min:0,max:tier.xpRequired,valueLabelFormat:``,class:`progress`},null,8,[`value`,`max`])):createCommentVNode(``,!0)])]),_:2},1032,[`style`])):createCommentVNode(``,!0),tier.description&&tier.description.description?(openBlock(),createElementBlock(`div`,_hoisted_14$41,toDisplayString(tier.description.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$39,[tier.list&&tier.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$38,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tier.list,(item,idx$1)=>(openBlock(),createBlock(UnlockCard_default,{key:idx$1,class:`unlock-item`,data:item},null,8,[`data`]))),128))])):createCommentVNode(``,!0)])])],2))),128))])]))}},UnlockRows_default=__plugin_vue_export_helper_default(_sfc_main$286,[[`__scopeId`,`data-v-ec31f890`]]),_hoisted_1$254={class:`flex-row`},_hoisted_2$210={class:`player-content`},_hoisted_3$184={class:`stats-row`},_hoisted_4$157={class:`stat-content`},_sfc_main$285={__name:`careerSimpleStats`,setup(__props,{expose:__expose}){let careerStatsData=ref({}),handleCareerSimpleStats=data=>{data.branches.forEach(entry=>{entry.hasOwnProperty(`levelLabel`)&&(entry.name=$translate.contextTranslate(entry.name,!0),entry.levelLabel=$translate.contextTranslate(entry.levelLabel,!0))}),careerStatsData.value=data},updateDisplay=()=>{Lua_default.career_modules_uiUtils.getCareerSimpleStats().then(handleCareerSimpleStats)};return onMounted(()=>{updateDisplay()}),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$254,[createBaseVNode(`div`,_hoisted_2$210,toDisplayString(careerStatsData.value.saveSlotName),1),createBaseVNode(`div`,_hoisted_3$184,[(openBlock(!0),createElementBlock(Fragment,null,renderList(careerStatsData.value.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_4$157,[createVNode(unref(bngProgressBar_default),{class:`stat-progress-bar`,headerLeft:branch.name,headerRight:branch.levelLabel,min:branch.min,value:branch.value,max:branch.max},null,8,[`headerLeft`,`headerRight`,`min`,`value`,`max`])]))),256))])]))}},careerSimpleStats_default=__plugin_vue_export_helper_default(_sfc_main$285,[[`__scopeId`,`data-v-94a9390d`]]),_sfc_main$284={__name:`careerStatus`,props:{slim:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let careerStatusData=ref({}),handleCareerStatusData=data=>careerStatusData.value=data,updateDisplay=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(handleCareerStatusData);return onMounted(updateDisplay),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`career-status-progress`,{slim:__props.slim}])},[createVNode(unref(bngUnit_default),{class:`career-status-value`,insuranceScore:careerStatusData.value.insuranceScore},null,8,[`insuranceScore`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,vouchers:careerStatusData.value.vouchers},null,8,[`vouchers`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,money:careerStatusData.value.money},null,8,[`money`])],2)]))}},careerStatus_default=__plugin_vue_export_helper_default(_sfc_main$284,[[`__scopeId`,`data-v-0446c53b`]]),_hoisted_1$253={key:0},_sfc_main$283={__name:`TutorialButton`,props:{text:{type:String,default:``},icon:{type:Object,default:()=>icons.questionmark},pages:{type:Object,default:[]}},setup(__props){let props=__props,buttonRef=ref(null),seen$3=ref(!0);function clickHandler(){for(let key of props.pages)Lua_default.career_modules_linearTutorial.introPopup(key,!0);seen$3.value=!0}return onMounted(()=>{}),onUnmounted(()=>{}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`buttonRef`,ref:buttonRef,class:normalizeClass([`tut-btn`,{blink:!seen$3.value}]),icon:__props.icon,onClick:withModifiers(clickHandler,[`stop`])},{default:withCtx(()=>[__props.text?(openBlock(),createElementBlock(`span`,_hoisted_1$253,toDisplayString(__props.text),1)):createCommentVNode(``,!0)]),_:1},8,[`icon`,`class`])),[[unref(BngTooltip_default),__props.text?void 0:`View tutorial for this section`]])}},TutorialButton_default=__plugin_vue_export_helper_default(_sfc_main$283,[[`__scopeId`,`data-v-3e539b42`]]),_hoisted_1$252={class:`content`},_hoisted_2$209={class:`insurance-perks-div`},_hoisted_3$183={key:0,class:`leaving-insurance-wrapper`},_hoisted_4$156={class:`breakdown-items-wrapper`},_hoisted_5$136={class:`breakdown-item`},_hoisted_6$117={class:`orange-price`},_hoisted_7$104={class:`breakdown-item`},_hoisted_8$88={class:`red-price`},_hoisted_9$78={class:`breakdown-item total`},_hoisted_10$68={class:`breakdown-item-value-total green-price`},_hoisted_11$61={key:1,class:`no-insurance-wrapper`},_hoisted_12$50={key:2,class:`group-discount-wrapper`},_hoisted_13$43={class:`group-discount-icon-wrapper`},_hoisted_14$40={class:`group-discount-main-text`},_hoisted_15$38={class:`tier-text`},_hoisted_16$37={class:`tier-text`},_hoisted_17$31={class:`discount-text`},_hoisted_18$28={class:`grey-small-text`},_hoisted_19$24={key:3,class:`price-details-wrapper`},_hoisted_20$20={class:`price-tile`},_hoisted_21$18={key:0,class:`old-price-wrapper`},_hoisted_22$16={class:`old-price`},_hoisted_23$15={class:`price-tile-value-wrapper`},_hoisted_24$14={key:1,class:`deductible-discount`},_hoisted_25$13={class:`price-tile`},_hoisted_26$11={class:`price-tile-title`},_hoisted_27$11={class:`price-tile-value-wrapper`},_hoisted_28$10={class:`premium-extra-info`},_hoisted_29$10={class:`renewal-distance`},_sfc_main$282={__name:`insuranceCard`,props:{insuranceData:Object,isSelected:Boolean,isCurrentProvider:{type:Boolean,default:!1}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,{units}=useBridge(),emit$1=__emit,hasNoInsurance=computed(()=>props.insuranceData?.id===-1),pillText=computed(()=>{if(props.isCurrentProvider)return`CURRENT PROVIDER`;if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime)return`MULTI-VEHICLE DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.willBumpTheirDiscount)return`BIGGER DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.currentTierData&&props.insuranceData.groupDiscountData?.currentTierData.id>0)return`MULTI-VEHICLE DISCOUNT ACTIVE`}return null}),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingInsuranceRenewsInFormatted=computed(()=>props.insuranceData?.leavingInsuranceInfo?.renewsIn?units.buildString(`length`,props.insuranceData.leavingInsuranceInfo.renewsIn*1e3,0):``),selectCard=()=>{emit$1(`select`,props.insuranceData.id)},cardStyles=computed(()=>{let styles={};return!hasNoInsurance.value&&props.insuranceData.color&&(styles[`--insurance-card-rgb`]=hexToRgb(props.insuranceData.color)),styles});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-card-container`,{selected:__props.isSelected,"no-insurance-card":hasNoInsurance.value,"current-provider":__props.isCurrentProvider}]),style:normalizeStyle(cardStyles.value),onClick:selectCard,"bng-nav-item":``},[pillText.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`top-pill`,{"no-insurance":hasNoInsurance.value,"orange-pill":__props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime,"current-provider-pill":__props.isCurrentProvider}])},[createBaseVNode(`div`,null,toDisplayString(pillText.value),1)],2)),createBaseVNode(`div`,_hoisted_1$252,[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:__props.insuranceData},null,8,[`insuranceData`]),_cache[13]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_2$209,[hasNoInsurance.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`perks-header`,{"no-insurance":hasNoInsurance.value}])},toDisplayString(hasNoInsurance.value?`Consequences`:`Included Benefits`),3)):createCommentVNode(``,!0),createVNode(unref(insurancePerks_default),{insuranceData:__props.insuranceData},null,8,[`insuranceData`])]),_cache[14]||=createBaseVNode(`div`,{class:`separator`},null,-1),hasNoInsurance.value&&__props.insuranceData.leavingInsuranceInfo&&!__props.isCurrentProvider?(openBlock(),createElementBlock(`div`,_hoisted_3$183,[_cache[4]||=createBaseVNode(`div`,{class:`leaving-insurance-title`},`Cancellation Refund`,-1),createBaseVNode(`div`,_hoisted_4$156,[createBaseVNode(`div`,_hoisted_5$136,[createBaseVNode(`span`,null,` Unused coverage (`+toDisplayString(leavingInsuranceRenewsInFormatted.value)+`) `,1),createBaseVNode(`span`,_hoisted_6$117,[_cache[0]||=createTextVNode(` + `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_7$104,[_cache[2]||=createBaseVNode(`span`,null,` Early Cancellation Fee (25%) `,-1),createBaseVNode(`span`,_hoisted_8$88,[_cache[1]||=createTextVNode(` - `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$78,[_cache[3]||=createBaseVNode(`span`,{class:`breakdown-item-label-total`},` You'll receive `,-1),createBaseVNode(`span`,_hoisted_10$68,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.netRefundPrice},null,8,[`money`])])])])])):createCommentVNode(``,!0),hasNoInsurance.value?(openBlock(),createElementBlock(`div`,_hoisted_11$61,[..._cache[5]||=[createBaseVNode(`span`,{class:`no-insurance-warning`},` You will pay full repair costs `,-1),createBaseVNode(`span`,null,` No coverage or benefits included `,-1)]])):createCommentVNode(``,!0),!hasNoInsurance.value&&__props.insuranceData.groupDiscountData?.mainText?(openBlock(),createElementBlock(`div`,_hoisted_12$50,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_13$43,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_14$40,toDisplayString(__props.insuranceData.groupDiscountData?.mainText),1)]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`span`,{class:`grey-small-text`},` Currently Insured : `,-1),createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{class:`vehicles-icon`,type:unref(icons).car},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_15$38,toDisplayString(__props.insuranceData.carsInsuredCount),1),__props.insuranceData.groupDiscountData?.currentTierData?.id>0?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[6]||=createBaseVNode(`span`,{class:`vertical-separator`},` | `,-1),createBaseVNode(`span`,_hoisted_16$37,` Tier `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.id),1),createBaseVNode(`span`,_hoisted_17$31,` - `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.discount*100)+`% off `,1)],64)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_18$28,toDisplayString(__props.insuranceData.groupDiscountData?.secondaryText),1)])):createCommentVNode(``,!0),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$24,[createBaseVNode(`div`,_hoisted_20$20,[_cache[9]||=createBaseVNode(`span`,{class:`price-tile-title`},`Deductible`,-1),__props.insuranceData.baseDeductibledData?.oldPrice?(openBlock(),createElementBlock(`div`,_hoisted_21$18,[createBaseVNode(`div`,_hoisted_22$16,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.oldPrice},null,8,[`money`]),_cache[8]||=createBaseVNode(`div`,{class:`strike`},null,-1)])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_23$15,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.price,class:normalizeClass(__props.insuranceData.baseDeductibledData.oldPrice?`green-price`:`orange-price`)},null,8,[`money`,`class`])]),_cache[10]||=createBaseVNode(`div`,{class:`deductible-tips`},[createBaseVNode(`div`,null,` - You pay your deductible for each crash repair `),createBaseVNode(`div`,null,` - Customize this value after purchase `)],-1),__props.insuranceData.baseDeductibledData.perkData?(openBlock(),createElementBlock(`div`,_hoisted_24$14,toDisplayString(__props.insuranceData.baseDeductibledData.perkData.discount*100)+`% discount applied `,1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_25$13,[createBaseVNode(`span`,_hoisted_26$11,toDisplayString(__props.insuranceData.amountDue>0?`Amount Due`:`Credit Received`),1),createBaseVNode(`div`,_hoisted_27$11,[createVNode(unref(bngUnit_default),{money:Math.abs(__props.insuranceData.amountDue),class:`green-price`},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_28$10,[createBaseVNode(`div`,null,[_cache[11]||=createTextVNode(` Total policy : `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[12]||=createBaseVNode(`span`,null,`Renews in : `,-1),createBaseVNode(`span`,_hoisted_29$10,toDisplayString(renewsInFormatted.value),1)])])])]))]),createBaseVNode(`div`,{class:normalizeClass([`background`,{"no-insurance":hasNoInsurance.value}])},null,2)],6))}},insuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$282,[[`__scopeId`,`data-v-e481fbef`]]),_hoisted_1$251={class:`premium-wrapper`},_hoisted_2$208={class:`breakdown-item`},_hoisted_3$182={class:`breakdown-item-value`},_hoisted_4$155={class:`premium-value-wrapper`},_hoisted_5$135={class:`breakdown-item`},_hoisted_6$116={class:`breakdown-item-value`},_hoisted_7$103={class:`breakdown-item`},_hoisted_8$87={class:`breakdown-item-value`},_hoisted_9$77={class:`breakdown-item`},_hoisted_10$67={class:`breakdown-item-value orange-text`},_hoisted_11$60={class:`perks`},_hoisted_12$49={key:0,class:`grey-text`},_hoisted_13$42={key:1,class:`grey-text`},_hoisted_14$39={class:`group-discount-savings`},_hoisted_15$37={class:`breakdown-item`},_hoisted_16$36={key:0,class:`grey-text`},_hoisted_17$30={key:1,class:`grey-text`},_hoisted_18$27={class:`buttons`},_sfc_main$281={__name:`smallInsuranceCard`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},setup(__props){let{units}=useBridge(),props=__props,renewsEveryFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0)),renewsInFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsIn*1e3,0)),buttonsDisabled=computed(()=>props.insuranceData.carsInsuredCount===0),openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},tierToDisplay=computed(()=>props.insuranceData.groupDiscountData.currentTierData.id>0?props.insuranceData.groupDiscountData.currentTierData:props.insuranceData.groupDiscountData.groupDiscountTiers[0]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`small-insurance-card`,{"no-vehicles":buttonsDisabled.value}]),style:normalizeStyle({"border-top":`0.7rem solid ${props.insuranceData.color}`,background:`linear-gradient(180deg, ${props.insuranceData.color}80 0%, ${props.insuranceData.color}30 10%, ${props.insuranceData.color}10 35%, var(--bng-cool-gray-800) 50%, var(--blue-shade-100) 100%)`})},[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:props.insuranceData},null,8,[`insuranceData`]),createBaseVNode(`div`,_hoisted_1$251,[createBaseVNode(`div`,_hoisted_2$208,[createBaseVNode(`span`,null,`Premium / `+toDisplayString(renewsEveryFormatted.value),1),createBaseVNode(`span`,_hoisted_3$182,[createBaseVNode(`div`,_hoisted_4$155,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_5$135,[_cache[0]||=createBaseVNode(`span`,null,`Renews in `,-1),createBaseVNode(`span`,_hoisted_6$116,[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` - `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(renewsInFormatted.value),1)],64))])]),createBaseVNode(`div`,_hoisted_7$103,[_cache[1]||=createBaseVNode(`span`,null,`Vehicle Coverage`,-1),createBaseVNode(`span`,_hoisted_8$87,[createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$77,[_cache[2]||=createBaseVNode(`span`,null,`Vehicles`,-1),createBaseVNode(`span`,_hoisted_10$67,toDisplayString(props.insuranceData.carsInsuredCount),1)])]),createBaseVNode(`div`,_hoisted_11$60,[createVNode(unref(insurancePerks_default),{insuranceData:props.insuranceData,noDescription:!0},null,8,[`insuranceData`])]),createBaseVNode(`div`,{class:normalizeClass([`group-discount-wrapper`,{disabled:props.insuranceData.groupDiscountData.currentTierData.id===-1}])},[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(`div`,_hoisted_12$49,` No vehicles insured under this policy `)):props.insuranceData.carsInsuredCount===1?(openBlock(),createElementBlock(`div`,_hoisted_13$42,` Add a second vehicle to unlock Tier 1 (`+toDisplayString(props.insuranceData.groupDiscountData.groupDiscountTiers[0].discount*100)+`%) coverage savings. `,1)):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[4]||=createBaseVNode(`div`,{class:`group-discount`},` MULTI-VEHICLE DISCOUNT `,-1),createBaseVNode(`div`,_hoisted_14$39,[_cache[3]||=createTextVNode(` Savings :`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.groupDiscountSavings},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_15$37,[tierToDisplay.value.max?(openBlock(),createElementBlock(`span`,_hoisted_16$36,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k - `+toDisplayString(tierToDisplay.value.max/1e3)+`k range `,1)):(openBlock(),createElementBlock(`span`,_hoisted_17$30,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k+ range `,1))]),createBaseVNode(`div`,null,[createVNode(unref(insuranceTiers_default),{showTier:!0,tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])])],64))],2),createBaseVNode(`div`,_hoisted_18$27,[createVNode(unref(bngButton_default),{class:`edit-policy-button bigger-button`,accent:`custom`,onClick:openEditPolicy,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).adjust},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`Edit Policy`,2)]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`see-vehicles-button bigger-button`,accent:`custom`,onClick:openVehicleList,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).car},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`See Vehicles`,2)]),_:1},8,[`disabled`])])],6))}},smallInsuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$281,[[`__scopeId`,`data-v-38392c0c`]]),_hoisted_1$250={class:`insurance-details-wrapper`,"bng-ui-scope":`insuranceDetailsPopup`},_hoisted_2$207={class:`card-content`},_hoisted_3$181={class:`header`},_hoisted_4$154={class:`header-left`},_hoisted_5$134={class:`insurance-identity`},_hoisted_6$115={class:`insurance-name`},_hoisted_7$102={class:`insurance-slogan`},_hoisted_8$86={class:`covers-renew-info`},_hoisted_9$76={class:`header-right`},_hoisted_10$66={class:`vehicle-name`},_hoisted_11$59={class:`vehicle-value blue-price`},_hoisted_12$48={key:0,class:`group-discount-wrapper`},_hoisted_13$41={class:`group-discount-header`},_hoisted_14$38={class:`group-discount-icon-wrapper`},_hoisted_15$36={class:`group-discount-text-wrapper`},_hoisted_16$35={class:`group-discount-main-text`},_hoisted_17$29={class:`tiers-wrapper`},_hoisted_18$26={class:`textual-tiers-wrapper`},_hoisted_19$23={class:`tier-number`},_hoisted_20$19={class:`money-bracket`},_hoisted_21$17={key:0},_hoisted_22$15={key:1},_hoisted_23$14={class:`current-after-discount-price`},_hoisted_24$13={class:`tier-discount-price`},_hoisted_25$12={class:`policy-value`},_hoisted_26$10={class:`policy-tier`},_hoisted_27$10={class:`tier-discount-price isFutureTier`},_hoisted_28$9={class:`policy-value`},_hoisted_29$9={class:`policy-tier isFuture`},_hoisted_30$9={class:`price-breakdown-wrapper`},_hoisted_31$9={class:`prices-breakdown-header`},_hoisted_32$9={class:`breakdown-item`},_hoisted_33$9={class:`breakdown-details`},_hoisted_34$9={class:`breakdown-item-value`},_hoisted_35$8={class:`breakdown-value`},_hoisted_36$8={class:`breakdown-item-value orange`},_hoisted_37$7={class:`breakdown-value`},_hoisted_38$6={key:0,class:`breakdown-item-value orange`},_hoisted_39$6={class:`breakdown-label`},_hoisted_40$5={class:`breakdown-value`},_hoisted_41$5={class:`breakdown-item-value result`},_hoisted_42$4={class:`breakdown-value result`},_hoisted_43$4={class:`breakdown-item`},_hoisted_44$4={class:`breakdown-details`},_hoisted_45$4={key:0,class:`breakdown-item-value`},_hoisted_46$2={key:0,class:`strikethrough-line`},_hoisted_47$2={key:1,class:`breakdown-item-value`},_hoisted_48$2={class:`breakdown-label`},_hoisted_49$2={class:`tier-discount-badge`},_hoisted_50$2={class:`breakdown-value green-price`},_hoisted_51$2={key:0,class:`breakdown-item-value`},_hoisted_52$2={class:`breakdown-label`},_hoisted_53$2={class:`breakdown-value`},_hoisted_54$2={class:`breakdown-item-value subtotal`},_hoisted_55$2={class:`breakdown-value`},_hoisted_56$2={class:`breakdown-item-value`},_hoisted_57$1={class:`breakdown-item-value result`},_hoisted_58$1={class:`breakdown-value`},_hoisted_59$1={class:`sum-to-pay`},_hoisted_60$1={class:`sum-to-pay-value`},_hoisted_61$1={class:`closeButton`},__default__$5={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$280=Object.assign(__default__$5,{__name:`purchaseInsuranceDetails`,props:{insuranceData:Object,vehicleInfo:Object,driverScoreData:Object},emits:[`return`],setup(__props,{emit:__emit}){let{units}=useBridge();useUINavScope(`insuranceDetailsPopup`);let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},driverScoreAdjustmentText=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`↓${((1-multiplier)*100).toFixed(0)}%`:multiplier>1?`↑${((multiplier-1)*100).toFixed(0)}%`:`0%`}),driverScoreClass=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`driver-score-discount`:multiplier>1?`driver-score-penalty`:``}),groupDiscountText=computed(()=>{if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime)return`Multi-vehicle discount available`;if(props.insuranceData.groupDiscountData.willBumpTheirDiscount)return`Bigger discount available`;if(props.insuranceData.groupDiscountData.currentTierData&&props.insuranceData.groupDiscountData.currentTierData.id>0)return`Multi-vehicle discount active`}return null}),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$250,[createBaseVNode(`div`,_hoisted_2$207,[createBaseVNode(`div`,_hoisted_3$181,[createBaseVNode(`div`,_hoisted_4$154,[_cache[2]||=createBaseVNode(`div`,{class:`policy-details`},` Policy details `,-1),createBaseVNode(`div`,_hoisted_5$134,[createBaseVNode(`span`,_hoisted_6$115,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_7$102,toDisplayString(props.insuranceData.slogan),1)]),createBaseVNode(`div`,_hoisted_8$86,[createBaseVNode(`span`,null,`Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles`,1),_cache[1]||=createBaseVNode(`span`,{class:`covers-renew-seperator`},null,-1),createBaseVNode(`span`,null,`Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$76,[_cache[4]||=createBaseVNode(`div`,{class:`action-type`},`Adding vehicle`,-1),createBaseVNode(`div`,_hoisted_10$66,toDisplayString(props.vehicleInfo.Name),1),createBaseVNode(`div`,_hoisted_11$59,[_cache[3]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])])]),props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime||props.insuranceData.groupDiscountData.willBumpTheirDiscount||props.insuranceData.groupDiscountData.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_12$48,[createBaseVNode(`div`,_hoisted_13$41,[createBaseVNode(`div`,_hoisted_14$38,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_15$36,[createBaseVNode(`div`,_hoisted_16$35,toDisplayString(groupDiscountText.value),1),_cache[5]||=createBaseVNode(`div`,{class:`group-discount-secondary-text`},` Insurance discounts are based on the total value of your fleet. `,-1)])]),createBaseVNode(`div`,_hoisted_17$29,[createBaseVNode(`div`,_hoisted_18$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.groupDiscountData.groupDiscountTiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,_hoisted_19$23,` Tier `+toDisplayString(tier.id),1),createBaseVNode(`div`,_hoisted_20$19,[createBaseVNode(`span`,null,toDisplayString(tier.min/1e3)+`k`,1),tier.max?(openBlock(),createElementBlock(`span`,_hoisted_21$17,`-`+toDisplayString(tier.max/1e3)+`k`,1)):(openBlock(),createElementBlock(`span`,_hoisted_22$15,`+`))])]))),128))]),createVNode(unref(insuranceTiers_default),{tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])]),createBaseVNode(`div`,_hoisted_23$14,[createBaseVNode(`div`,_hoisted_24$13,[_cache[7]||=createBaseVNode(`div`,{class:`section-label deactivated`},` Current Tier `,-1),createBaseVNode(`div`,_hoisted_25$12,[_cache[6]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_26$10,` Tier `+toDisplayString(Math.max(props.insuranceData.groupDiscountData.currentTierData.id,0))+` - `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off `,1)]),createBaseVNode(`div`,_hoisted_27$10,[_cache[9]||=createBaseVNode(`div`,{class:`section-label`},` After Purchase `,-1),createBaseVNode(`div`,_hoisted_28$9,[_cache[8]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue+props.insuranceData.vehicleValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_29$9,` Tier `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.id)+` - `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.discount*100)+`% off `,1)])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_30$9,[createBaseVNode(`div`,_hoisted_31$9,[createBaseVNode(`div`,_hoisted_32$9,[_cache[13]||=createBaseVNode(`div`,{class:`section-label`},` Vehicle `,-1),createBaseVNode(`div`,_hoisted_33$9,[createBaseVNode(`div`,_hoisted_34$9,[_cache[10]||=createBaseVNode(`span`,{class:`breakdown-label`},` Coverage Cost `,-1),createBaseVNode(`span`,_hoisted_35$8,[createVNode(unref(bngUnit_default),{money:props.insuranceData.nonProRatedVehiclePremium},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_36$8,[_cache[11]||=createBaseVNode(`span`,{class:`breakdown-label`},` Pro-rated Renewal `,-1),createBaseVNode(`span`,_hoisted_37$7,` × `+toDisplayString(props.insuranceData.proRatedPercentage)+`% `,1)]),props.insuranceData.groupDiscountData?.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_38$6,[createBaseVNode(`span`,_hoisted_39$6,` Tier `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.id)+` discount `,1),createBaseVNode(`span`,_hoisted_40$5,` - `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.discount*100)+`% `,1)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_41$5,[_cache[12]||=createBaseVNode(`span`,{class:`breakdown-label`},` Policy Add-On Cost `,-1),createBaseVNode(`span`,_hoisted_42$4,[createVNode(unref(bngUnit_default),{money:props.insuranceData.proRatedVehiclePremium},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_43$4,[_cache[18]||=createBaseVNode(`div`,{class:`section-label`},` New Premium `,-1),createBaseVNode(`div`,_hoisted_44$4,[props.insuranceData.futurePremiumDetails.items.vehsCoverage?(openBlock(),createElementBlock(`div`,_hoisted_45$4,[_cache[14]||=createBaseVNode(`div`,{class:`breakdown-label`},` Vehicles Coverage `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value strikethrough-container`,{"strikethrough-grey":props.insuranceData.futurePremiumDetails.groupDiscountSavings>0}])},[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.priceWithoutGroupDiscount},null,8,[`money`]),props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_46$2)):createCommentVNode(``,!0)],2)])):createCommentVNode(``,!0),props.insuranceData.futurePremiumDetails.items.vehsCoverage&&props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_47$2,[createBaseVNode(`div`,_hoisted_48$2,[createTextVNode(toDisplayString(props.insuranceData.futurePremiumDetails.items.vehsCoverage.name)+` `,1),createBaseVNode(`span`,null,[createTextVNode(`: Tier `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.id)+` `,1),createBaseVNode(`span`,_hoisted_49$2,`(`+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off)`,1)])]),createBaseVNode(`div`,_hoisted_50$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.price},null,8,[`money`])])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.futurePremiumDetails.items,(item,key)=>(openBlock(),createElementBlock(Fragment,{key},[key===`vehsCoverage`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_51$2,[createBaseVNode(`div`,_hoisted_52$2,toDisplayString(item.name),1),createBaseVNode(`div`,_hoisted_53$2,[createVNode(unref(bngUnit_default),{money:item.price},null,8,[`money`])])]))],64))),128)),createBaseVNode(`div`,_hoisted_54$2,[_cache[15]||=createBaseVNode(`div`,{class:`breakdown-label`},` Subtotal `,-1),createBaseVNode(`div`,_hoisted_55$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_56$2,[_cache[16]||=createBaseVNode(`div`,{class:`breakdown-label`},` Driver Score Adjustment `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value`,driverScoreClass.value])},toDisplayString(driverScoreAdjustmentText.value),3)]),createBaseVNode(`div`,_hoisted_57$1,[_cache[17]||=createBaseVNode(`div`,{class:`breakdown-label`},` Total Premium `,-1),createBaseVNode(`div`,_hoisted_58$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])])]),createBaseVNode(`div`,_hoisted_59$1,[_cache[19]||=createBaseVNode(`span`,null,`Amount due today`,-1),createBaseVNode(`span`,_hoisted_60$1,[createVNode(unref(bngUnit_default),{class:`green-price`,money:props.insuranceData.addVehiclePrice},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_61$1,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:closePopup},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Close `,-1)]]),_:1},8,[`accent`])])])]))}}),purchaseInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$280,[[`__scopeId`,`data-v-9f20c127`]]),_hoisted_1$249={class:`content`},_hoisted_2$206={class:`top-banner`},_hoisted_3$180={class:`top-banner-left`},_hoisted_4$153={class:`insurance-details`},_hoisted_5$133={class:`insurance-name`},_hoisted_6$114={class:`insurance-slogan`},_hoisted_7$101={class:`small-grey-text`},_hoisted_8$85={class:`small-grey-text`},_hoisted_9$75={class:`top-banner-right`},_hoisted_10$65={class:`information-wrapper`},_hoisted_11$58={class:`information-value`},_hoisted_12$47={class:`driver-score-tier`},_hoisted_13$40={class:`premium-effect`},_hoisted_14$37={class:`switching-details-wrapper`},_hoisted_15$35={class:`three-columns-grid`},_hoisted_16$34={class:`switching-column column-leaving`},_hoisted_17$28={class:`column-header`},_hoisted_18$25={class:`column-details`},_hoisted_19$22={class:`detail-item`},_hoisted_20$18={class:`detail-value`},_hoisted_21$16={class:`detail-item`},_hoisted_22$14={class:`detail-item divider-above`},_hoisted_23$13={class:`detail-value-positive`},_hoisted_24$12={class:`detail-item`},_hoisted_25$11={class:`detail-value-negative`},_hoisted_26$9={class:`detail-item divider-above`},_hoisted_27$9={class:`detail-value-positive-bold`},_hoisted_28$8={class:`detail-note`},_hoisted_29$8={class:`switching-column column-vehicle`},_hoisted_30$8={class:`vehicle-display-box`},_hoisted_31$8=[`src`],_hoisted_32$8={class:`column-details`},_hoisted_33$8={class:`detail-item`},_hoisted_34$8={class:`detail-value-bold`},_hoisted_35$7={class:`detail-item`},_hoisted_36$7={class:`detail-value-bold`},_hoisted_37$6={class:`detail-item divider-above`},_hoisted_38$5={class:`detail-value-highlight`},_hoisted_39$5={class:`detail-note`},_hoisted_40$4={class:`switching-column column-joining`},_hoisted_41$4={class:`column-header`},_hoisted_42$3={class:`column-details`},_hoisted_43$3={class:`detail-item`},_hoisted_44$3={class:`detail-value`},_hoisted_45$3={class:`detail-item`},_hoisted_46$1={class:`detail-item divider-above`},_hoisted_47$1={class:`detail-value-negative`},_hoisted_48$1={class:`detail-item divider-above`},_hoisted_49$1={class:`detail-item divider-above`},_hoisted_50$1={class:`detail-value-bold`},_hoisted_51$1={class:`detail-note`},_hoisted_52$1={class:`final-amount-content-row`},_hoisted_53$1={class:`final-amount-label`},_hoisted_54$1={class:`final-amount-breakdown`},_hoisted_55$1={class:`buttons`},_hoisted_56$1={key:0},_sfc_main$279={__name:`changeInsuranceDetails`,props:{insuranceData:{type:Object,required:!0},vehicleInfo:{type:Object,default:()=>({})},driverScoreData:{type:Object,default:()=>({})}},emits:[`return`,`switch`],setup(__props,{emit:__emit}){let{units}=useBridge(),props=__props,emit$1=__emit,premiumSavingPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),leavingInfo=computed(()=>props.insuranceData.leavingInsuranceInfo||null),leavingInsuranceName=computed(()=>leavingInfo.value?.currentInsuranceName||`Current Insurance`),tierDropped=computed(()=>leavingInfo.value?leavingInfo.value.discountTierData?.id>leavingInfo.value.newDiscountTierData?.id:!1),tierIncreased=computed(()=>{let current=props.insuranceData.groupDiscountData?.currentTierData?.id||0;return(props.insuranceData.groupDiscountData?.futureTierData?.id||current)>current}),currentTierId=computed(()=>props.insuranceData.groupDiscountData?.currentTierData?.id||0),futureTierId=computed(()=>props.insuranceData.groupDiscountData?.futureTierData?.id||props.insuranceData.groupDiscountData?.currentTierData?.id||0),proRatedPercentage=computed(()=>Math.round(props.insuranceData.proRatedPercentage||100)),driverScoreImpactPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),driverScoreImpactClass=computed(()=>driverScoreImpactPercent.value>0?`saving`:driverScoreImpactPercent.value<0?`increase`:`neutral`),driverScoreImpactText=computed(()=>driverScoreImpactPercent.value>0?`↓${driverScoreImpactPercent.value.toFixed(0)}%`:driverScoreImpactPercent.value<0?`↑${Math.abs(driverScoreImpactPercent.value).toFixed(0)}%`:`0%`),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingRenewsInFormatted=computed(()=>leavingInfo.value?.renewsIn?units.buildString(`length`,leavingInfo.value.renewsIn*1e3,0):``),closePopup=()=>{emit$1(`return`,!0)},onSwitchClick=()=>{Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(props.vehicleInfo.invVehId,props.insuranceData.id),emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$249,[createBaseVNode(`div`,_hoisted_2$206,[createBaseVNode(`div`,_hoisted_3$180,[_cache[2]||=createBaseVNode(`div`,{class:`title`},` Change Insurance `,-1),createBaseVNode(`div`,_hoisted_4$153,[createBaseVNode(`span`,_hoisted_5$133,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_6$114,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1)]),createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$101,` Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles `,1),_cache[1]||=createBaseVNode(`span`,{class:`dot-seperator`},null,-1),createBaseVNode(`span`,_hoisted_8$85,` Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$75,[createBaseVNode(`div`,_hoisted_10$65,[_cache[4]||=createBaseVNode(`div`,{class:`small-grey-text`},` Driver Score `,-1),createBaseVNode(`div`,_hoisted_11$58,toDisplayString(props.driverScoreData.score)+`: `+toDisplayString(props.driverScoreData.tier.risk),1),createBaseVNode(`div`,_hoisted_12$47,toDisplayString(props.driverScoreData.tier.name),1),createBaseVNode(`div`,_hoisted_13$40,[_cache[3]||=createBaseVNode(`span`,{class:`small-grey-text`},` Premium Effect : `,-1),createBaseVNode(`span`,{class:normalizeClass([`premium-effect-value`,{saving:premiumSavingPercent.value>0,increase:premiumSavingPercent.value<0}])},toDisplayString(premiumSavingPercent.value>0?`${premiumSavingPercent.value.toFixed(0)}% saving`:premiumSavingPercent.value<0?`${Math.abs(premiumSavingPercent.value).toFixed(0)}% increase`:`No change`),3)])])])]),createBaseVNode(`div`,_hoisted_14$37,[createBaseVNode(`div`,_hoisted_15$35,[createBaseVNode(`div`,_hoisted_16$34,[createBaseVNode(`div`,_hoisted_17$28,[_cache[5]||=createBaseVNode(`span`,null,`←`,-1),createTextVNode(` Leaving `+toDisplayString(leavingInsuranceName.value),1)]),createBaseVNode(`div`,_hoisted_18$25,[createBaseVNode(`div`,_hoisted_19$22,[_cache[6]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_20$18,toDisplayString(leavingInfo.value.vehicleCount)+` → `+toDisplayString(leavingInfo.value.newVehicleCount),1)]),createBaseVNode(`div`,_hoisted_21$16,[_cache[7]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-down":tierDropped.value}])},toDisplayString(leavingInfo.value.discountTierData.id)+` → `+toDisplayString(leavingInfo.value.newDiscountTierData.id),3)]),createBaseVNode(`div`,_hoisted_22$14,[_cache[9]||=createBaseVNode(`span`,{class:`detail-label`},`Coverage refund:`,-1),createBaseVNode(`span`,_hoisted_23$13,[_cache[8]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_24$12,[_cache[11]||=createBaseVNode(`span`,{class:`detail-label`},`Cancellation fee (25%):`,-1),createBaseVNode(`span`,_hoisted_25$11,[_cache[10]||=createTextVNode(`-`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_26$9,[_cache[12]||=createBaseVNode(`span`,{class:`detail-label-bold`},`Net Refund:`,-1),createBaseVNode(`span`,_hoisted_27$9,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_28$8,toDisplayString(leavingRenewsInFormatted.value)+` unused `,1)])]),createBaseVNode(`div`,_hoisted_29$8,[_cache[16]||=createBaseVNode(`div`,{class:`column-header column-header-center`},`Moving Vehicle`,-1),createBaseVNode(`div`,_hoisted_30$8,[createBaseVNode(`img`,{src:props.vehicleInfo?.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_31$8)]),createBaseVNode(`div`,_hoisted_32$8,[createBaseVNode(`div`,_hoisted_33$8,[_cache[13]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_34$8,toDisplayString(props.vehicleInfo.Name),1)]),createBaseVNode(`div`,_hoisted_35$7,[_cache[14]||=createBaseVNode(`span`,{class:`detail-label`},`Value:`,-1),createBaseVNode(`span`,_hoisted_36$7,[createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_37$6,[_cache[15]||=createBaseVNode(`span`,{class:`detail-label`},`Joining mid-cycle:`,-1),createBaseVNode(`span`,_hoisted_38$5,`× `+toDisplayString(proRatedPercentage.value)+`%`,1)]),createBaseVNode(`div`,_hoisted_39$5,toDisplayString(renewsInFormatted.value)+` remaining in cycle `,1)])]),createBaseVNode(`div`,_hoisted_40$4,[createBaseVNode(`div`,_hoisted_41$4,[createTextVNode(` Joining `+toDisplayString(props.insuranceData.name)+` `,1),_cache[17]||=createBaseVNode(`span`,null,`→`,-1)]),createBaseVNode(`div`,_hoisted_42$3,[createBaseVNode(`div`,_hoisted_43$3,[_cache[18]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_44$3,toDisplayString(props.insuranceData.carsInsuredCount)+` → `+toDisplayString(props.insuranceData.carsInsuredCount+1),1)]),createBaseVNode(`div`,_hoisted_45$3,[_cache[19]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-up":tierIncreased.value}])},toDisplayString(currentTierId.value)+` → `+toDisplayString(futureTierId.value),3)]),createBaseVNode(`div`,_hoisted_46$1,[_cache[21]||=createBaseVNode(`span`,{class:`detail-label`},`Add vehicle cost:`,-1),createBaseVNode(`span`,_hoisted_47$1,[_cache[20]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_48$1,[_cache[22]||=createBaseVNode(`span`,{class:`detail-label`},`Driver Score Impact:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value-impact`,driverScoreImpactClass.value])},toDisplayString(driverScoreImpactText.value),3)]),createBaseVNode(`div`,_hoisted_49$1,[_cache[23]||=createBaseVNode(`span`,{class:`detail-label-bold`},`New Policy Premium:`,-1),createBaseVNode(`span`,_hoisted_50$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_51$1,toDisplayString(renewsInFormatted.value)+` until renewal `,1)])])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-box`,props.insuranceData.netSwitchingCost>0?`amount-credit`:`amount-payment`])},[createBaseVNode(`div`,_hoisted_52$1,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_53$1,toDisplayString(props.insuranceData.netSwitchingCost>0?`Credit Received Today`:`Amount Due Today`),1),createBaseVNode(`div`,_hoisted_54$1,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`]),_cache[24]||=createTextVNode(` refund - `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`]),_cache[25]||=createTextVNode(` new cost `,-1)])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-total`,props.insuranceData.netSwitchingCost<0?`negative`:`positive`])},[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])],2)])],2)]),createBaseVNode(`div`,_hoisted_55$1,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSwitchClick},{default:withCtx(()=>[_cache[27]||=createTextVNode(` Switch for `,-1),props.insuranceData.netSwitchingCost<0?(openBlock(),createElementBlock(`div`,_hoisted_56$1,[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])])):createCommentVNode(``,!0)]),_:1})])]))}},changeInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$279,[[`__scopeId`,`data-v-9624a106`]]),_hoisted_1$248={class:`insurance-tiers`},_hoisted_2$205={key:0},_sfc_main$278={__name:`insuranceTiers`,props:{tiers:{type:Array,required:!0},showTier:{type:Boolean,default:!1}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$248,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.tiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,{class:normalizeClass([`tier-discount`,{isCurrent:tier.isCurrent}])},[props.showTier?(openBlock(),createElementBlock(`div`,_hoisted_2$205,` Tier `+toDisplayString(tier.id),1)):createCommentVNode(``,!0),createBaseVNode(`div`,null,toDisplayString(tier.discount*100)+`% `,1)],2)]))),128))]))}},insuranceTiers_default=__plugin_vue_export_helper_default(_sfc_main$278,[[`__scopeId`,`data-v-ccd1e875`]]),_hoisted_1$247={class:`popup-content`},_hoisted_2$204={class:`top-banner`},_hoisted_3$179={class:`top-info`},_hoisted_4$152={class:`top-info-title`},_hoisted_5$132={class:`top-info-policy-name`},_hoisted_6$113={class:`customize-coverage section`},_hoisted_7$100={class:`premium-details section`},_hoisted_8$84={class:`premium-details-content`},_hoisted_9$74={class:`premium-details-left`},_hoisted_10$64={class:`premium-details-label`},_hoisted_11$57={class:`premium-details-right`},_hoisted_12$46={key:0,class:`price-diff-container`},_hoisted_13$39={class:`premium-details-total premium-details-item`},_hoisted_14$36={class:`premium-details-left`},_hoisted_15$34={class:`driver-score-details-wrapper`},_hoisted_16$33={class:`driver-score-details`},_hoisted_17$27={class:`premium-details-right`},_hoisted_18$24={key:0,class:`price-diff-container`},_hoisted_19$21={class:`buttons`},_sfc_main$277={__name:`editPolicy`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,changedCoverageOptions=ref({}),newPremiumDetails=ref({}),computedNewPremiumDiffs=computed(()=>{if(!newPremiumDetails.value?.items)return{};let diffs={};for(let key in newPremiumDetails.value.items){let newPrice=newPremiumDetails.value.items[key]?.price||0,oldPrice=props.insuranceData.currentPremiumDetails.items[key]?.price||0;diffs[key]={priceDiff:newPrice-oldPrice,newPrice,oldPrice}}return diffs}),computedTotalPriceDiff=computed(()=>newPremiumDetails.value?.totalPrice?newPremiumDetails.value.totalPrice-props.insuranceData.currentPremiumDetails.totalPrice:0),driverScoreColorClass=computed(()=>{let multiplier=props.driverScoreData?.tier?.multiplier;return multiplier?multiplier<1?`driver-score-good`:multiplier>1?`driver-score-bad`:``:``}),hasChangedCoverageOptions=computed(()=>props.insuranceData?.coverageOptionsData?props.insuranceData.coverageOptionsData.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1);onMounted(()=>{props.insuranceData?.coverageOptionsData&&props.insuranceData.coverageOptionsData.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId})});let emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewInsuranceCoverageOptions(props.insuranceData.id,changedCoverageOptions.value),emit$1(`return`,!0)},updatePremiumDetails=async()=>{newPremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,changedCoverageOptions.value,null)},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1,updatePremiumDetails())},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumDetails()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$247,[createBaseVNode(`div`,_hoisted_2$204,[createBaseVNode(`div`,_hoisted_3$179,[createBaseVNode(`div`,_hoisted_4$152,[_cache[0]||=createTextVNode(` Edit Policy: `,-1),createBaseVNode(`span`,_hoisted_5$132,toDisplayString(props.insuranceData.name),1)]),_cache[1]||=createBaseVNode(`div`,{class:`top-info-description`},` These settings apply to all vehicles under this policy. Set deductibles per vehicle by clicking "Edit Vehicles" `,-1)]),createVNode(unref(bngButton_default),{class:`edit-vehicles-button`,accent:`custom`,onClick:openVehicleList},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Edit Vehicles `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_6$113,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.coverageOptionsData,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{key:coverageOption.name,coverageOption,changedCoverageOptions:changedCoverageOptions.value,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))]),createBaseVNode(`div`,_hoisted_7$100,[_cache[5]||=createBaseVNode(`div`,{class:`premium-details-header`},` Premium Breakdown `,-1),createBaseVNode(`div`,_hoisted_8$84,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.currentPremiumDetails.items,(detail,key)=>(openBlock(),createElementBlock(`div`,{class:`premium-details-item`,key},[createBaseVNode(`div`,_hoisted_9$74,[createBaseVNode(`div`,_hoisted_10$64,toDisplayString(detail.name),1)]),createBaseVNode(`div`,_hoisted_11$57,[computedNewPremiumDiffs.value[key]&&computedNewPremiumDiffs.value[key].priceDiff!==0?(openBlock(),createElementBlock(`div`,_hoisted_12$46,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}])},toDisplayString(computedNewPremiumDiffs.value[key].priceDiff>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}]),money:computedNewPremiumDiffs.value[key].priceDiff},null,8,[`class`,`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.items?.[key]?.price||detail.price},null,8,[`money`])])]))),128)),createBaseVNode(`div`,_hoisted_13$39,[createBaseVNode(`div`,_hoisted_14$36,[_cache[4]||=createBaseVNode(`div`,null,` Final Premium `,-1),createBaseVNode(`div`,_hoisted_15$34,[createBaseVNode(`span`,_hoisted_16$33,[_cache[3]||=createTextVNode(` Base Premium : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPrice},null,8,[`money`]),createTextVNode(` × Driver Score `+toDisplayString(props.driverScoreData.score)+` @ `,1)]),createBaseVNode(`span`,{class:normalizeClass([`driver-score`,driverScoreColorClass.value])},toDisplayString(Math.round(props.driverScoreData.tier.multiplier*100))+`% `,3)])]),createBaseVNode(`div`,_hoisted_17$27,[computedTotalPriceDiff.value===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$24,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}])},toDisplayString(computedTotalPriceDiff.value>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}]),money:computedTotalPriceDiff.value},null,8,[`class`,`money`])])),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.totalPriceWithDriverScore||props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_19$21,[createVNode(unref(bngButton_default),{class:`cancel-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`])])]))}},editPolicy_default=__plugin_vue_export_helper_default(_sfc_main$277,[[`__scopeId`,`data-v-081fecf3`]]),_sfc_main$276={__name:`insurancePerkIcon`,props:{perkIconData:{type:Object,required:!0}},setup(__props){let props=__props,computedColor=computed(()=>props.perkIconData.isSignaturePerk===void 0?props.perkIconData.color:props.perkIconData.isSignaturePerk?`green`:`blue`);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"insurance-perk-icon":!__props.perkIconData.iconOnly,[computedColor.value]:computedColor.value})},[createVNode(unref(bngIcon_default),{type:unref(icons).shieldCheckmark,class:normalizeClass({"glowing-icon":!0,[computedColor.value]:computedColor.value})},null,8,[`type`,`class`]),__props.perkIconData.iconOnly?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass({"small-text":!0,[computedColor.value]:computedColor.value})},toDisplayString(__props.perkIconData.smallText),3))],2)),[[unref(BngTooltip_default),__props.perkIconData.iconOnly?null:__props.perkIconData.tooltipText,`top`]])}},insurancePerkIcon_default=__plugin_vue_export_helper_default(_sfc_main$276,[[`__scopeId`,`data-v-d2b025b6`]]),_hoisted_1$246={class:`insurance-perks-container`},_hoisted_2$203={class:`left`},_hoisted_3$178={class:`insurance-perk-icon-wrapper`},_hoisted_4$151={key:1},_hoisted_5$131={class:`insurance-perk-texts`},_hoisted_6$112={class:`insurance-perk-intro`},_hoisted_7$99={key:0,class:`insurance-perk-description`},_hoisted_8$83={key:0,class:`signature-perk-wrapper`},_sfc_main$275={__name:`insurancePerks`,props:{insuranceData:Object,noDescription:Boolean},setup(__props){let props=__props,sortedPerks=computed(()=>props.insuranceData.perks?[...Array.isArray(props.insuranceData.perks)?props.insuranceData.perks:Object.values(props.insuranceData.perks)].sort((a$1,b)=>Number(b.isSignaturePerk||!1)-Number(a$1.isSignaturePerk||!1)):[]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$246,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedPerks.value,perk=>(openBlock(),createElementBlock(`div`,{key:perk.id,class:normalizeClass([`insurance-perk`,{highlighted:perk.isSignaturePerk,"no-insurance":__props.insuranceData.id===-1}])},[createBaseVNode(`div`,_hoisted_2$203,[createBaseVNode(`div`,_hoisted_3$178,[__props.insuranceData.id===-1?(openBlock(),createElementBlock(`span`,_hoisted_4$151,`-`)):(openBlock(),createBlock(insurancePerkIcon_default,{key:0,perkIconData:{iconOnly:!0,isSignaturePerk:perk.isSignaturePerk&&perk.isSignaturePerk||!1}},null,8,[`perkIconData`]))]),createBaseVNode(`div`,_hoisted_5$131,[createBaseVNode(`div`,_hoisted_6$112,toDisplayString(perk.intro),1),__props.noDescription?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$99,toDisplayString(perk.description),1))])]),perk.isSignaturePerk?(openBlock(),createElementBlock(`div`,_hoisted_8$83,[..._cache[0]||=[createBaseVNode(`div`,{class:`signature-perk`},` SIGNATURE PERK `,-1)]])):createCommentVNode(``,!0)],2))),128))]))}},insurancePerks_default=__plugin_vue_export_helper_default(_sfc_main$275,[[`__scopeId`,`data-v-75e74910`]]),_hoisted_1$245={class:`insurance-perk-notice`},_sfc_main$274={__name:`insurancePerkNotice`,props:{perkText:{type:String,required:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$245,[createVNode(insurancePerkIcon_default,{perkIconData:{iconOnly:!0}}),createTextVNode(` `+toDisplayString(props.perkText),1)]))}},insurancePerkNotice_default=__plugin_vue_export_helper_default(_sfc_main$274,[[`__scopeId`,`data-v-a98b3238`]]),_hoisted_1$244={class:`popup-content`},_hoisted_2$202={class:`top-info`},_hoisted_3$177={class:`top-info-title`},_hoisted_4$150={class:`top-info-veh-name`},_hoisted_5$130={class:`top-info-value-and-insurance`},_hoisted_6$111={class:`section`},_hoisted_7$98={class:`section`},_hoisted_8$82={class:`contribution-wrapper`},_hoisted_9$73={class:`contribution-item-value`},_hoisted_10$63={key:0,class:`price-diff-container`},_hoisted_11$56={class:`contribution-item-value`},_hoisted_12$45={key:0,class:`price-diff-container`},_hoisted_13$38={class:`buttons`},_sfc_main$273={__name:`editVehicleCoverage`,props:{insuranceData:{type:Object,required:!0},vehicleData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,newPremiumPrice=ref(0),newInsurancePremiumDetails=ref({totalPriceWithDriverScore:0}),computedNewPremiumDiff=computed(()=>newPremiumPrice.value-props.vehicleData.insuranceData.currentPremiumPrice),computedNewInsurancePremiumDiff=computed(()=>newInsurancePremiumDetails.value.totalPriceWithDriverScore-props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore),hasChangedCoverageOptions=computed(()=>props.vehicleData?.insuranceData?.coverageOptionsData?.currentCoverageOptionsSanitized?props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1),emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},changedCoverageOptions=ref({}),updatePremiumPrice=async()=>{newPremiumPrice.value=(await Lua_default.career_modules_insurance_insurance.calculateVehiclePremium(props.vehicleData.id,null,changedCoverageOptions.value)).cost,newInsurancePremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,null,{[props.vehicleData.id]:changedCoverageOptions.value})},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumPrice()},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1),updatePremiumPrice()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewVehicleCoverageOptions(props.vehicleData.id,changedCoverageOptions.value),emit$1(`return`,!0)},openSwitchProvider=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:props.vehicleData.id}})};return onMounted(()=>{props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId}),updatePremiumPrice()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$244,[createBaseVNode(`div`,_hoisted_2$202,[createBaseVNode(`div`,_hoisted_3$177,[_cache[0]||=createTextVNode(` Select Deductible: `,-1),createBaseVNode(`span`,_hoisted_4$150,toDisplayString(props.vehicleData.name),1)]),createBaseVNode(`div`,_hoisted_5$130,[_cache[1]||=createTextVNode(` Value: `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleData.initialValue},null,8,[`money`]),createTextVNode(` • Policy: `+toDisplayString(props.insuranceData.name),1)]),_cache[2]||=createBaseVNode(`div`,{class:`top-info-description`},` Choose how much you'll pay out-of-pocket when repairing this vehicle. Lower deductibles cost more per km. `,-1)]),createBaseVNode(`div`,_hoisted_6$111,[_cache[3]||=createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:`header title`},` Choose Your Deductible `),createBaseVNode(`div`,{class:`under-title`},` You pay this amount per repair. `)],-1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{class:`coverage-option`,key:coverageOption.name,coverageOption,onlyShowMainText:!0,changedCoverageOptions:changedCoverageOptions.value,dontShowName:!0,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))])]),createBaseVNode(`div`,_hoisted_7$98,[_cache[6]||=createBaseVNode(`div`,{class:`title`},` Policy Impact `,-1),createBaseVNode(`div`,_hoisted_8$82,[createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[4]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Insurance Premium `,-1),createBaseVNode(`div`,_hoisted_9$73,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`]),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_10$63,` → `)):createCommentVNode(``,!0),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newInsurancePremiumDetails.value.totalPriceWithDriverScore},null,8,[`money`])):createCommentVNode(``,!0)])],2),createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[5]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Vehicle Contribution `,-1),createBaseVNode(`div`,_hoisted_11$56,[createVNode(unref(bngUnit_default),{money:props.vehicleData.insuranceData.currentPremiumPrice},null,8,[`money`]),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_12$45,` → `)):createCommentVNode(``,!0),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newPremiumPrice.value},null,8,[`money`])):createCommentVNode(``,!0)])],2)])]),createBaseVNode(`div`,_hoisted_13$38,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[8]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:openSwitchProvider},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(` Switch Provider `,-1)]]),_:1})])]))}},editVehicleCoverage_default=__plugin_vue_export_helper_default(_sfc_main$273,[[`__scopeId`,`data-v-9f014d2d`]]),_hoisted_1$243=[`innerHTML`],_hoisted_2$201={key:2,class:`insurance-icon`},_hoisted_3$176={class:`insurance-name`},_hoisted_4$149={key:3,class:`insurance-slogan`},_sfc_main$272={__name:`insuranceIdentity`,props:{insuranceData:{type:Object,required:!0}},setup(__props){let props=__props,hasInsurance=computed(()=>svgContent.value||props.insuranceData.image),hasNoInsurance=computed(()=>props.insuranceData?.id===-1),svgContent=ref(null);return watch(()=>props.insuranceData.image,async newPath=>{if(newPath&&newPath.endsWith(`.svg`))try{let rawSvg=await getFile(`/${newPath}`);rawSvg?svgContent.value=rawSvg.replace(/]*>([\s\S]*?)<\/script>/gim,``).replace(/ on\w+="[^"]*"/g,``):svgContent.value=null}catch(e){console.warn(`Failed to load SVG inline:`,newPath,e),svgContent.value=null}else svgContent.value=null},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-identity`,{"no-insurance":!hasInsurance.value}])},[svgContent.value?(openBlock(),createElementBlock(`div`,{key:0,class:`insurance-icon`,innerHTML:svgContent.value},null,8,_hoisted_1$243)):props.insuranceData.image?(openBlock(),createBlock(unref(bngImage_default),{key:1,class:`insurance-icon`,src:`/${props.insuranceData.image}`,alt:props.insuranceData.name},null,8,[`src`,`alt`])):(openBlock(),createElementBlock(`div`,_hoisted_2$201,[createBaseVNode(`div`,_hoisted_3$176,[createVNode(unref(bngIcon_default),{class:`insurance-no-icon`,type:unref(icons).danger},null,8,[`type`]),createTextVNode(` `+toDisplayString(hasNoInsurance.value?_ctx.$t(`ui.career.insurance.noInsurance`):props.insuranceData.name),1)])])),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$149,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1))],2))}},insuranceIdentity_default=__plugin_vue_export_helper_default(_sfc_main$272,[[`__scopeId`,`data-v-689b89ea`]]),_hoisted_1$242={key:1,class:`coverage-option-name`},_hoisted_2$200={key:2,class:`choices`},_hoisted_3$175=[`onClick`],_hoisted_4$148={class:`choice-label`},_hoisted_5$129={key:0},_hoisted_6$110={key:0,class:`choice-secondary-text`},_hoisted_7$97={key:1,class:`choice-price`},_hoisted_8$81={key:3,class:`toggle-container`},_hoisted_9$72={class:`toggle-price`},_sfc_main$271={__name:`coverageOption`,props:{coverageOption:{type:Object,required:!0},changedCoverageOptions:{type:Object,required:!1,default:()=>({})},onlyShowMainText:{type:Boolean,default:!1},simpleSelect:{type:Boolean},modelValue:{type:Number,required:!1},showPerkMode:{type:String,default:`deportedLabel`},dontShowName:{type:Boolean,default:!1}},emits:[`choiceClick`,`toggleChange`,`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit;watch(()=>props.coverageOption?.choices,newChoices=>{if(props.modelValue!==void 0&&props.modelValue!==null&&newChoices){let maxValidId=newChoices.length;props.modelValue>maxValidId&&emit$1(`update:modelValue`,1)}},{immediate:!0});let getSelectedValueId=()=>props.modelValue!==void 0&&props.modelValue!==null?Math.min(props.modelValue,props.coverageOption.choices.length):props.changedCoverageOptions[props.coverageOption.key],getToggleValue=coverageOption=>(props.changedCoverageOptions[coverageOption.key]??coverageOption.currentValueId)===coverageOption.choices.findIndex(choice=>choice.value===!0)+1,getTogglePrice=coverageOption=>{let selectedValueId=props.changedCoverageOptions[coverageOption.key]??coverageOption.currentValueId;return coverageOption.choices[selectedValueId-1]?.premiumInfluence||0},onToggleChange=(coverageOption,newValue)=>{emit$1(`toggleChange`,coverageOption,newValue)},onChoiceClick=(coverageOption,choice)=>{choice.disabled||(props.simpleSelect&&(coverageOption.currentValueId=choice.id),props.modelValue!==void 0&&props.modelValue!==null&&emit$1(`update:modelValue`,choice.id),emit$1(`choiceClick`,coverageOption,choice))};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`coverage-options`,{"in-row":__props.coverageOption.choiceType===`toggle`}])},[__props.coverageOption.perkText&&__props.showPerkMode===`deportedLabel`?(openBlock(),createBlock(unref(insurancePerkNotice_default),{key:0,perkText:__props.coverageOption.perkText},null,8,[`perkText`])):createCommentVNode(``,!0),__props.dontShowName?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$242,toDisplayString(__props.coverageOption.name),1)),__props.coverageOption.choiceType===`multiple`?(openBlock(),createElementBlock(`div`,_hoisted_2$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.coverageOption.choices,choice=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`choice`,{selected:choice.id===__props.changedCoverageOptions[__props.coverageOption.key],current:choice.id===getSelectedValueId(),disabled:choice.disabled}]),key:choice,onClick:()=>onChoiceClick(__props.coverageOption,choice)},[createBaseVNode(`div`,_hoisted_4$148,toDisplayString(choice.choiceText),1),__props.onlyShowMainText?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$129,[choice.secondaryText?(openBlock(),createElementBlock(`div`,_hoisted_6$110,toDisplayString(choice.secondaryText),1)):(openBlock(),createElementBlock(`div`,_hoisted_7$97,[createVNode(unref(bngUnit_default),{money:choice.premiumInfluence},null,8,[`money`])]))]))],10,_hoisted_3$175))),128))])):__props.coverageOption.choiceType===`toggle`?(openBlock(),createElementBlock(`div`,_hoisted_8$81,[createVNode(unref(bngSwitch_default),{class:`toggle-switch`,"model-value":getToggleValue(__props.coverageOption),onChange:_cache[0]||=newValue=>onToggleChange(__props.coverageOption,newValue)},null,8,[`model-value`]),createBaseVNode(`div`,_hoisted_9$72,[createVNode(unref(bngUnit_default),{money:getTogglePrice(__props.coverageOption)},null,8,[`money`])])])):createCommentVNode(``,!0)],2))}},coverageOption_default=__plugin_vue_export_helper_default(_sfc_main$271,[[`__scopeId`,`data-v-4921f4f0`]]),_hoisted_1$241={class:`popup-content`},_hoisted_2$199={class:`popup-header`},_hoisted_3$174={class:`top-info`},_hoisted_4$147={class:`top-info-title`},_hoisted_5$128={class:`top-info-policy-name`},_hoisted_6$109={class:`top-info-description`},_hoisted_7$96={class:`vehicle-list`},_hoisted_8$80={class:`closeButton`},_sfc_main$270={__name:`vehicleInsuranceList`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openEditVehicleCoverage=vehicle=>{addPopup(editVehicleCoverage_default,{insuranceData:props.insuranceData,vehicleData:vehicle})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$241,[createBaseVNode(`div`,_hoisted_2$199,[createBaseVNode(`div`,_hoisted_3$174,[createBaseVNode(`div`,_hoisted_4$147,[_cache[0]||=createTextVNode(` Vehicles Insured By `,-1),createBaseVNode(`span`,_hoisted_5$128,toDisplayString(props.insuranceData.name),1)]),createBaseVNode(`div`,_hoisted_6$109,[_cache[1]||=createTextVNode(` Click any vehicle to adjust its deductible • Total Value: `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createVNode(unref(bngButton_default),{class:`policy-coverage-button`,accent:`custom`,onClick:openEditPolicy},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Policy Coverage `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_7$96,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.carsInsured,(vehicle,index)=>(openBlock(),createBlock(unref(insuranceVehTile_default),{key:index,vehicle},{rightContent:withCtx(()=>[createVNode(unref(bngButton_default),{class:`edit-coverage-button bigger-button`,accent:`custom`,disabled:vehicle.needsRepair,onClick:$event=>!vehicle.needsRepair&&openEditVehicleCoverage(vehicle)},{default:withCtx(()=>[createTextVNode(toDisplayString(vehicle.needsRepair?`Edit Coverage (Needs repair)`:`Edit Coverage`),1)]),_:2},1032,[`disabled`,`onClick`])]),_:2},1032,[`vehicle`]))),128))]),createBaseVNode(`div`,_hoisted_8$80,[createVNode(unref(bngButton_default),{class:`close-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Cancel `,-1)]]),_:1})])]))}},vehicleInsuranceList_default=__plugin_vue_export_helper_default(_sfc_main$270,[[`__scopeId`,`data-v-2bd92225`]]),_hoisted_1$240={class:`vehicle-item`},_hoisted_2$198={class:`left`},_hoisted_3$173={class:`vehicle-thumbnail-wrapper`},_hoisted_4$146=[`src`],_hoisted_5$127={class:`name-value-wrapper`},_hoisted_6$108={class:`vehicle-name`},_hoisted_7$95={class:`vehicle-value`},_hoisted_8$79={class:`right`},_sfc_main$269={__name:`insuranceVehTile`,props:{vehicle:{type:Object,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$240,[createBaseVNode(`div`,_hoisted_2$198,[createBaseVNode(`div`,_hoisted_3$173,[createBaseVNode(`img`,{src:__props.vehicle.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_4$146)]),createBaseVNode(`div`,_hoisted_5$127,[createBaseVNode(`div`,_hoisted_6$108,toDisplayString(__props.vehicle.name),1),createBaseVNode(`div`,_hoisted_7$95,[_cache[0]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.initialValue},null,8,[`money`])]),renderSlot(_ctx.$slots,`extra-info`,{},void 0,!0)])]),createBaseVNode(`div`,_hoisted_8$79,[renderSlot(_ctx.$slots,`rightContent`,{},void 0,!0)])]))}},insuranceVehTile_default=__plugin_vue_export_helper_default(_sfc_main$269,[[`__scopeId`,`data-v-b4076016`]]),_hoisted_1$239={class:`popup-content`},_hoisted_2$197={key:0,class:`vehicle-list`},_hoisted_3$172={key:1,class:`no-vehicles-wrapper`},_hoisted_4$145={class:`closeButton`},_sfc_main$268={__name:`uninsuredVehicles`,props:{uninsuredData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openAddCoverage=vehicle=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:vehicle.id}})};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$239,[_cache[5]||=createBaseVNode(`div`,{class:`popup-header`},[createBaseVNode(`span`,{class:`header-title`},`Uninsured Vehicles`)],-1),_cache[6]||=createBaseVNode(`div`,{class:`warning-message`},` These vehicles have no insurance coverage. Add coverage to protect against repair costs. `,-1),props.uninsuredData.carsUninsured&&props.uninsuredData.carsUninsured.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$197,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.uninsuredData.carsUninsured,(vehicle,index)=>(openBlock(),createBlock(unref(insuranceVehTile_default),{key:index,vehicle,class:`uninsured-vehicle-item`},{"extra-info":withCtx(()=>[..._cache[0]||=[createBaseVNode(`div`,{class:`no-coverage-warning`},` No coverage - you pay full repair costs `,-1)]]),rightContent:withCtx(()=>[createVNode(unref(bngButton_default),{class:`add-coverage-button bigger-button`,accent:`custom`,onClick:$event=>openAddCoverage(vehicle)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`button-icon`,type:unref(icons).shieldCheckmark},null,8,[`type`]),_cache[1]||=createTextVNode(` Add Coverage `,-1)]),_:1},8,[`onClick`])]),_:2},1032,[`vehicle`]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_3$172,[createVNode(unref(bngIcon_default),{class:`success-icon`,type:unref(icons).checkmark},null,8,[`type`]),_cache[2]||=createBaseVNode(`div`,{class:`success-title`},`All Vehicles Insured`,-1),_cache[3]||=createBaseVNode(`div`,{class:`success-message`},`You don't have any uninsured vehicles.`,-1)])),createBaseVNode(`div`,_hoisted_4$145,[createVNode(unref(bngButton_default),{class:`close-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Back `,-1)]]),_:1})])]))}},uninsuredVehicles_default=__plugin_vue_export_helper_default(_sfc_main$268,[[`__scopeId`,`data-v-f51ead8e`]]),sharedMode=ref(null),sharedContext=ref(null);function useChooseInsurance(){let{events:events$3}=useBridge(),insurancesData=ref([]),purchaseData=ref({}),vehicleInfo=ref({}),defaultInsuranceId=ref(null),firstSelectedInsuranceId=ref(null),driverScoreData=ref({}),currentInsuranceId=ref(null),handleChooseInsuranceData=data=>{insurancesData.value=data.applicableInsurancesData,purchaseData.value=data.purchaseData,vehicleInfo.value=data.vehicleInfo,driverScoreData.value=data.driverScoreData,defaultInsuranceId.value=data.defaultInsuranceId,firstSelectedInsuranceId.value=data.defaultInsuranceId,currentInsuranceId.value=data.currentInsuranceId};function openChooseInsuranceMenu(menuMode,params){sharedMode.value=menuMode,sharedContext.value=params,Lua_default.career_modules_insurance_insurance.openChooseInsuranceScreen()}function requestDataForCurrentContext(){sharedMode.value===`purchase`&&sharedContext.value?Lua_default.career_modules_insurance_insurance.sendChooseInsuranceDataToTheUI(sharedContext.value.purchaseType,sharedContext.value.shopId,sharedContext.value.insuranceId):sharedMode.value===`change`&&sharedContext.value&&Lua_default.career_modules_insurance_insurance.sendChangeInsuranceDataToTheUI(sharedContext.value.vehicleId)}return events$3.on(`chooseInsuranceData`,handleChooseInsuranceData),onUnmounted(()=>{events$3.off(`chooseInsuranceData`,handleChooseInsuranceData)}),{openChooseInsuranceMenu,requestDataForCurrentContext,insurancesData,purchaseData,vehicleInfo,defaultInsuranceId,firstSelectedInsuranceId,driverScoreData,currentInsuranceId,mode:sharedMode,context:sharedContext}}var _hoisted_1$238={class:`popup-content`},_hoisted_2$196={class:`popup-header`},_hoisted_3$171={class:`content-wrapper`},_hoisted_4$144={class:`buttons-wrapper`},_hoisted_5$126={class:`button-container`},_sfc_main$267={__name:`ChooseInsuranceMain`,props:{menuMode:{type:String,required:!0},params:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){useUINavBlocker().ensureNoBlock([`tab_l`,`tab_r`]);let overflowRef=ref(null),onTabNav=evt=>{evt.detail.value===1&&(console.log(`onTabNav`,evt.detail),console.log(`overflowRef`,overflowRef.value),evt.detail.name===`tab_l`&&overflowRef.value?.activatePrev(),evt.detail.name===`tab_r`&&overflowRef.value?.activateNext())},props=__props,emit$1=__emit,{units}=useBridge(),selectedInsuranceId=ref(null),selectedShelfIndex=ref(0),{insurancesData,purchaseData,defaultInsuranceId,firstSelectedInsuranceId,vehicleInfo,requestDataForCurrentContext,mode,context,driverScoreData,currentInsuranceId}=useChooseInsurance();onMounted(()=>{window.addEventListener(DOM_UI_NAVIGATION_EVENT,onTabNav),mode.value=props.menuMode,context.value=props.params,props.menuMode===`purchase`&&props.params?Lua_default.career_modules_insurance_insurance.sendChooseInsuranceDataToTheUI(props.params.purchaseType,props.params.shopId,props.params.insuranceId):props.menuMode===`change`&&props.params&&Lua_default.career_modules_insurance_insurance.sendChangeInsuranceDataToTheUI(props.params.vehicleId)}),watch(selectedShelfIndex,newIndex=>{insurancesData.value[newIndex]&&(selectedInsuranceId.value=insurancesData.value[newIndex].id)}),watch(defaultInsuranceId,defaultId=>{if(defaultId!==null){selectedInsuranceId.value=defaultId;let index=insurancesData.value.findIndex(ins=>ins.id===defaultId);index!==-1&&(selectedShelfIndex.value=index)}},{immediate:!0});let onShelfClick=(insuranceId,index)=>{selectedInsuranceId.value=insuranceId,selectedShelfIndex.value=index},buttonText=computed(()=>mode.value===`change`?selectedInsuranceId.value===-1?`Remove Coverage`:selectedInsuranceId.value===currentInsuranceId.value?`Current Provider`:`Move vehicle here`:`Select this option`),viewCostBreakdown=()=>{mode.value===`purchase`?addPopup(purchaseInsuranceDetails_default,{insuranceData:insurancesData.value[selectedShelfIndex.value],vehicleInfo:vehicleInfo.value,driverScoreData:driverScoreData.value}):addPopup(changeInsuranceDetails_default,{insuranceData:insurancesData.value[selectedShelfIndex.value],vehicleInfo:vehicleInfo.value,driverScoreData:driverScoreData.value})},continueWithInsurance=()=>{mode.value===`purchase`?(selectedInsuranceId.value!==null&&selectedInsuranceId.value!==void 0&&Lua_default.career_modules_vehicleShopping.updateInsuranceSelection(selectedInsuranceId.value),emit$1(`return`,!0)):mode.value===`change`&&(selectedInsuranceId.value&&context.value?.vehicleId&&Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(context.value.vehicleId,selectedInsuranceId.value),closeLastPopups(3))},cancel=()=>{emit$1(`return`,!0)};return onUnmounted(()=>{window.removeEventListener(DOM_UI_NAVIGATION_EVENT,onTabNav),mode.value=null,context.value=null}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$238,[createBaseVNode(`div`,_hoisted_2$196,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(mode)===`purchase`?`Insure your `:`Switch insurance for your `)+` `+toDisplayString(unref(vehicleInfo).Name),1)]),_:1})]),createBaseVNode(`div`,_hoisted_3$171,[createVNode(unref(bngOverflowContainer_default),{ref_key:`overflowRef`,ref:overflowRef,class:`insurance-shelf`,"scroll-speed":10,"initial-index":selectedShelfIndex.value,"use-bindings-only":``,"show-arrows":``,"no-wheel":``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(insurancesData),(insurance,index)=>(openBlock(),createBlock(unref(insuranceCard_default),{key:insurance.id,insuranceData:insurance,isSelected:selectedInsuranceId.value===insurance.id,vehicleInfo:unref(vehicleInfo),isCurrentProvider:unref(mode)===`change`&&unref(currentInsuranceId)===insurance.id,class:`insurance-card`,onClick:$event=>onShelfClick(insurance.id,index)},null,8,[`insuranceData`,`isSelected`,`vehicleInfo`,`isCurrentProvider`,`onClick`]))),128))]),_:1},8,[`initial-index`])]),createBaseVNode(`div`,_hoisted_4$144,[createBaseVNode(`div`,_hoisted_5$126,[createVNode(unref(bngButton_default),{onClick:cancel,accent:unref(ACCENTS).attention},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(`Cancel`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:viewCostBreakdown,disabled:selectedShelfIndex.value===0||unref(mode)===`change`&&selectedInsuranceId.value===unref(currentInsuranceId),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`View Cost Breakdown`,-1)]]),_:1},8,[`disabled`,`accent`]),createVNode(unref(bngButton_default),{disabled:!selectedInsuranceId.value||unref(mode)===`change`&&selectedInsuranceId.value===unref(currentInsuranceId),onClick:continueWithInsurance},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonText.value),1)]),_:1},8,[`disabled`])])])]))}},ChooseInsuranceMain_default=__plugin_vue_export_helper_default(_sfc_main$267,[[`__scopeId`,`data-v-7bb3e442`]]),_hoisted_1$237={class:`progress-view-actions`},_hoisted_2$195={class:`progress-view-page`},_hoisted_3$170={class:`progress-view-header`},_hoisted_4$143={class:`branch-icon-assembly large`},_hoisted_5$125={key:0,class:`reward-multiplier`},_hoisted_6$107={class:`reward-multiplier-label`},_hoisted_7$94={class:`reward-multiplier-value`},_hoisted_8$78={class:`progress-view-contents`},_hoisted_9$71={class:`progress-view-description`},_hoisted_10$62={class:`progress-view-scrollable`},_sfc_main$266={__name:`ProgressView`,props:{skillInfo:{type:Object,default:null},headingText:{type:String,default:``},breadcrumbItems:{type:Array,required:!0},branchStyle:{type:Object,required:!0},showBackButton:{type:Boolean,default:!0}},emits:[`breadcrumb-click`,`breadcrumb-back`,`exit`,`skill-click`],setup(__props,{emit:__emit}){let emit$1=__emit,handleBreadcrumbClick=item=>{emit$1(`breadcrumb-click`,item)},handleBreadcrumbBack=()=>{emit$1(`breadcrumb-back`)},handleExit=()=>{emit$1(`exit`)};return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`progress-view-layout`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:`progress-view-wrapper`,style:normalizeStyle(__props.branchStyle),"bng-ui-scope":`progressView`},[createBaseVNode(`div`,_hoisted_1$237,[createVNode(unref(bngBreadcrumbs_default),{class:`progress-view-breadcrumbs`,items:__props.breadcrumbItems,limit:`5`,simple:``,"disable-last-item":``,"show-back-button":__props.showBackButton,onClick:handleBreadcrumbClick,onBack:handleBreadcrumbBack},null,8,[`items`,`show-back-button`]),createVNode(unref(careerStatus_default),{class:`progress-view-career-status`,slim:``})]),createBaseVNode(`div`,_hoisted_2$195,[createBaseVNode(`div`,_hoisted_3$170,[__props.skillInfo?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`div`,{class:normalizeClass([`header-skill`,{"is-locked":!__props.skillInfo.unlocked}]),onClick:_cache[0]||=$event=>_ctx.$emit(`skill-click`,__props.skillInfo.id)},[createBaseVNode(`div`,_hoisted_4$143,[createBaseVNode(`div`,{class:`branch-background`,style:normalizeStyle(unref(getIconBackgroundStyle)(__props.skillInfo.color))},null,4),createVNode(unref(bngIcon_default),{type:unref(icons)[__props.skillInfo.unlocked?__props.skillInfo.icon:`lockClosed`],class:`assembly-icon large`},null,8,[`type`])]),createVNode(BranchSkillProgressBar_default,{class:`main-stat-progress-bar skill-progress-bar`,skill:__props.skillInfo,showLevel:!1,mode:`with-value-label`,showLockedIcon:!0,isMainProgress:!0},null,8,[`skill`])],2),__props.skillInfo.rewardMultiplier?(openBlock(),createElementBlock(`div`,_hoisted_5$125,[createBaseVNode(`div`,_hoisted_6$107,[createVNode(unref(bngIcon_default),{type:__props.skillInfo.rewardMultiplierSourceIcon},null,8,[`type`]),_cache[1]||=createTextVNode(` Reward Multiplier: `,-1)]),createBaseVNode(`div`,_hoisted_7$94,[createVNode(unref(bngIcon_default),{type:unref(icons).beamCurrency},null,8,[`type`]),createTextVNode(` ×`+toDisplayString(__props.skillInfo.rewardMultiplier.toFixed(2)),1)])])):createCommentVNode(``,!0)],64)):(openBlock(),createBlock(unref(bngScreenHeadingV2_default),{key:1,type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.headingText),1)]),_:1}))]),createBaseVNode(`div`,_hoisted_8$78,[createBaseVNode(`div`,_hoisted_9$71,[renderSlot(_ctx.$slots,`description`,{},void 0,!0)]),_cache[2]||=createBaseVNode(`div`,{class:`progress-view-divider`},null,-1),createBaseVNode(`div`,_hoisted_10$62,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])])])],4)),[[unref(BngOnUiNav_default),handleExit,`back,menu`]])]),_:3})),[[unref(BngOnUiNav_default),handleExit,`back,menu`],[unref(BngBlur_default)]])}},ProgressView_default=__plugin_vue_export_helper_default(_sfc_main$266,[[`__scopeId`,`data-v-3fa921dc`]]),_hoisted_1$236={class:`description-text`},_hoisted_2$194={key:0,class:`cards-container grid-view`},_hoisted_3$169={key:1,class:`page-progress`},_hoisted_4$142={key:2,class:`facility-rows`},_hoisted_5$124={key:3,class:`buttons-container`},_hoisted_6$106={class:`content`},_hoisted_7$93={key:0,class:`indicator`},_sfc_main$265={__name:`ProgressLanding`,props:{pathId:String,comesFromBigMap:{type:Boolean,default:!1}},setup(__props){let props=__props,landingData=ref({heading:`ui.career.landingPage.name`,description:`ui.career.landingPage.description`,branches:[],showMilestones:!0,showOrganizations:!0}),leagues=ref([]),fetchLandingData=async()=>{landingData.value={heading:`ui.career.landingPage.name`,description:`ui.career.landingPage.description`,branches:[],showMilestones:!0,showOrganizations:!0};let data=await Lua_default.career_modules_branches_landing.getLandingPageData(props.pathId);landingData.value=data,leagues.value=data.leagues||[],console.log(`data`,data),data.breadcrumbs&&(screenHeaderPath.value=data.breadcrumbs,console.log(`screenHeaderPath`,screenHeaderPath.value))},hasUnclaimedMilestones=ref(!1);onMounted(async()=>{await fetchLandingData(),Lua_default.career_modules_milestones_milestones.unclaimedMilestonesCount().then(c=>hasUnclaimedMilestones.value=c)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`progressLanding`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`progressLanding`)}),watch(()=>props.pathId,async(newPathId,oldPathId)=>{newPathId!==oldPathId&&(await fetchLandingData(),Lua_default.career_modules_milestones_milestones.unclaimedMilestonesCount().then(c=>hasUnclaimedMilestones.value=c))});let leagueMissionClicked=mission=>{mission.canStartFromProgressScreen?(Lua_default.extensions.gameplay_missions_missionScreen.setPreselectedMissionId(mission.id),Lua_default.extensions.gameplay_missions_missionScreen.openAPMChallenges(props.pathId,mission.skill[0])):Lua_default.extensions.gameplay_missions_missionScreen.navigateToMission(mission.id)},branchStyle=computed(()=>landingData.value.skillInfo?getBranchColorStyle({color:landingData.value.skillInfo.color,accentColor:landingData.value.skillInfo.accentColor}):{"--branch-accent-color":`var(--bng-cool-gray-500-rgb)`,"--branch-color":`var(--bng-cool-gray-500-rgb)`}),pageHeading=computed(()=>landingData.value.branchHeading||landingData.value.heading),currentDescription=ref(null),pageDescription=computed(()=>currentDescription.value||landingData.value.description),BRANCHES=computed(()=>landingData.value.branches),openBranchPage=branchKey=>{let target=landingData.value.branches.find(b=>b.id===branchKey).target;console.log(`openBranchPage`,branchKey),window.bngVue.gotoGameState(`progressLanding`,{params:{pathId:branchKey}})},exit=()=>{props.pathId&&!props.comesFromBigMap?router_default.back():window.bngVue.gotoAngularState(`menu.careerPause`)},openMilestonesScreen=()=>window.bngVue.gotoGameState(`milestones`),onBranchFocus=branch=>{currentDescription.value=branch.description},onBranchBlur=()=>{currentDescription.value=null},isHalfBranch=branch=>{let hasSkills=branch.skills&&branch.skills.length>0,hasDescription=branch.shortDescription;return!hasSkills&&!hasDescription},currentSkillToShow=computed(()=>landingData.value.skillInfo||null),screenHeaderPath=ref([{label:`Career`,path:`/career`},{label:landingData.value.heading,path:`/career/${landingData.value.id}`}]),gotoHeaderItem=item=>{item.gotoPath&&(window.bngVue.gotoGameState(item.gotoPath.path,{params:item.gotoPath.props}),console.log(`gotoPath`,item.gotoPath)),item.gotoAngularState&&window.bngVue.gotoAngularState(item.gotoAngularState)},onBreadBack=()=>{gotoHeaderItem(screenHeaderPath.value[screenHeaderPath.value.length-2])};return(_ctx,_cache)=>(openBlock(),createBlock(ProgressView_default,{"skill-info":landingData.value.skillInfo,"heading-text":_ctx.$t(pageHeading.value),"breadcrumb-items":screenHeaderPath.value,"branch-style":branchStyle.value,"show-back-button":!0,onBreadcrumbClick:gotoHeaderItem,onBreadcrumbBack:onBreadBack,onExit:exit},{description:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$236,toDisplayString(_ctx.$t(pageDescription.value)),1)]),default:withCtx(()=>[BRANCHES.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$194,[(openBlock(!0),createElementBlock(Fragment,null,renderList(BRANCHES.value,branch=>withDirectives((openBlock(),createBlock(BranchSkillCard_default,{tabindex:`1`,branchKey:branch.id,onOpenBranchPage:openBranchPage,onMouseenter:$event=>onBranchFocus(branch),onMouseleave:onBranchBlur,onFocus:$event=>onBranchFocus(branch),onBlur:onBranchBlur,"bng-nav-item":``,"display-mode":`row`,class:normalizeClass({"full-width":!isHalfBranch(branch)})},null,8,[`branchKey`,`onMouseenter`,`onFocus`,`class`])),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])),256))])):createCommentVNode(``,!0),currentSkillToShow.value&¤tSkillToShow.value.hasLevels&¤tSkillToShow.value.unlockInfo&¤tSkillToShow.value.unlockInfo.length?(openBlock(),createElementBlock(`div`,_hoisted_3$169,[currentSkillToShow.value.hasUnlocks?(openBlock(),createBlock(UnlockRows_default,{key:0,class:`stat-progress-bar bng-progress-bar progress-bar`,headerLeft:_ctx.$ctx_t(currentSkillToShow.value.name),headerRight:_ctx.$ctx_t(currentSkillToShow.value.levelLabel),value:currentSkillToShow.value.value,max:currentSkillToShow.value.max,min:currentSkillToShow.value.min,maxRequiredValue:currentSkillToShow.value.maxRequiredValue,tiers:currentSkillToShow.value.unlockInfo,currentTier:currentSkillToShow.value.unlocked?currentSkillToShow.value.level:-1,unlocked:currentSkillToShow.value.unlocked,progressFillColor:currentSkillToShow.value.accentColor},null,8,[`headerLeft`,`headerRight`,`value`,`max`,`min`,`maxRequiredValue`,`tiers`,`currentTier`,`unlocked`,`progressFillColor`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),leagues.value&&leagues.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_4$142,[(openBlock(!0),createElementBlock(Fragment,null,renderList(leagues.value,league=>(openBlock(),createBlock(LeagueRow_default,{key:league.id,league,leagueMissionClicked},null,8,[`league`]))),128))])):createCommentVNode(``,!0),landingData.value.showMilestones?(openBlock(),createElementBlock(`div`,_hoisted_5$124,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,class:`button milestone-button`,onClick:openMilestonesScreen},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$106,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).checkboxOn},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`label`},` Milestones `,-1),hasUnclaimedMilestones.value>0?(openBlock(),createElementBlock(`div`,_hoisted_7$93)):createCommentVNode(``,!0)])]),_:1})),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])])):createCommentVNode(``,!0)]),_:1},8,[`skill-info`,`heading-text`,`breadcrumb-items`,`branch-style`]))}},ProgressLanding_default=__plugin_vue_export_helper_default(_sfc_main$265,[[`__scopeId`,`data-v-cbe0bb9d`]]),_hoisted_1$235={class:`reward-wrapper`},_hoisted_2$193={class:`card-content`},_hoisted_3$168={class:`rewards-breakdown-container padding-bottom`},_hoisted_4$141={class:`grid-wrapper`},_hoisted_5$123={class:`grid-row grid`},_hoisted_6$105={class:`label primary`},_hoisted_7$92={class:`rewards primary`},_hoisted_8$77={class:`grid-wrapper wide`},_hoisted_9$70={class:`grid`},_hoisted_10$61={class:`label secondary`},_hoisted_11$55={class:`rewards secondary`},_hoisted_12$44={class:`grid-row grid`},_hoisted_13$37={class:`rewards primary`},_hoisted_14$35={class:`padding-bottom`},_hoisted_15$33={key:0,class:`unlocks-wrapper`},__default__$4={wrapper:{fade:!0,blur:!0,style:popupContainer.transparent},position:[popupPosition.center,popupPosition.center]},_sfc_main$264=Object.assign(__default__$4,{__name:`CargoDeliveryReward`,emits:[`return`],setup(__props,{emit:__emit}){useCssVars(_ctx=>({v4c61e8a8:ANIM_DURATION_CSS})),useUINavScope(`deliveryReward`);let ANIMATION_START_DELAY=1e3,ANIMATION_DURATION=2e3,ANIM_DURATION_CSS=ANIMATION_DURATION+`ms`,showBarAnimations=ref(!1),data=storeToRefs(useGameContextStore()).deliveryRewardData,exit=()=>{window.bngVue.gotoGameState(`play`)};function stopAnimations(){showBarAnimations.value=!1}function startProgressBarAnimation(){if(data.value){showBarAnimations.value=!0;for(let[key,value]of Object.entries(data.value.summary.rewards))value.branchInfo&&(value.branchInfo.animValue=value.branchInfo.value);setTimeout(stopAnimations,ANIMATION_DURATION)}}return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`cargoDeliveryReward`)}),onMounted(()=>{getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),showBarAnimations.value=!1,setTimeout(startProgressBarAnimation,1e3)}),onUnmounted(()=>{Lua_default.career_modules_delivery_cargoScreen.unloadCargoPopupClosed(),Lua_default.simTimeAuthority.popPauseRequest(`cargoDeliveryReward`)}),(_ctx,_cache)=>unref(data)?withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{key:0,class:`layout-content-full flex-column layout-paddings layout-align-center`,"bng-ui-scope":`deliveryReward`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$235,[createVNode(unref(bngCard_default),null,{buttons:withCtx(()=>[createVNode(unref(bngButton_default),{onClick:exit},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[5]||=createBaseVNode(`span`,null,`Continue`,-1)]),_:1})]),default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`career-status`}),createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Delivery Complete! `,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$193,[createBaseVNode(`div`,_hoisted_3$168,[_cache[3]||=createBaseVNode(`span`,{class:`span2-heading`},` Reward Breakdown `,-1),createBaseVNode(`div`,_hoisted_4$141,[_cache[2]||=createBaseVNode(`div`,{class:`grid-row grid`},[createBaseVNode(`div`,{class:`label primary`},`Item`),createBaseVNode(`div`,{class:`rewards primary`},`Rewards`)],-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).sortedResults,result=>(openBlock(),createElementBlock(`div`,_hoisted_5$123,[createBaseVNode(`div`,_hoisted_6$105,toDisplayString(result.label),1),createBaseVNode(`div`,_hoisted_7$92,[createVNode(RewardsPills_default,{rewards:result.rewards},null,8,[`rewards`])]),createBaseVNode(`div`,_hoisted_8$77,[(openBlock(!0),createElementBlock(Fragment,null,renderList(result.breakdown,breakdown=>(openBlock(),createElementBlock(`div`,_hoisted_9$70,[createBaseVNode(`div`,_hoisted_10$61,toDisplayString(breakdown.label),1),createBaseVNode(`div`,_hoisted_11$55,[createVNode(RewardsPills_default,{rewards:breakdown.rewards},null,8,[`rewards`])])]))),256))])]))),256)),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_12$44,[_cache[1]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_13$37,[createVNode(RewardsPills_default,{rewards:unref(data).summary.rewards},null,8,[`rewards`])])])])]),createBaseVNode(`div`,_hoisted_14$35,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).summary.rewards,reward=>(openBlock(),createElementBlock(`div`,null,[reward.branchInfo?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,class:normalizeClass({"stat-progress-bar":!0,"animate-progress":showBarAnimations.value}),headerLeft:_ctx.$ctx_t(reward.branchInfo.name),headerRight:_ctx.$ctx_t(reward.branchInfo.level),min:reward.branchInfo.max==-1?0:reward.branchInfo.min,value:reward.branchInfo.max==-1?1:reward.branchInfo.animValue,max:reward.branchInfo.max==-1?1:reward.branchInfo.max,"value-label-format":reward.branchInfo.max==-1?`Max Level Reached`:void 0},null,8,[`class`,`headerLeft`,`headerRight`,`min`,`value`,`max`,`value-label-format`])):createCommentVNode(``,!0)]))),256))]),unref(data).summary.unlocks.length?(openBlock(),createElementBlock(`div`,_hoisted_15$33,[_cache[4]||=createBaseVNode(`span`,{class:`span2-heading`},` Unlocks`,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data).summary.unlocks,unlock=>(openBlock(),createBlock(UnlockCard_default,{class:`unlock-item`,data:unlock},null,8,[`data`]))),256))])):createCommentVNode(``,!0)])]),_:1})])]),_:1})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),exit,`back,menu,ok`]]):createCommentVNode(``,!0)}}),CargoDeliveryReward_default=__plugin_vue_export_helper_default(_sfc_main$264,[[`__scopeId`,`data-v-e964374f`]]),_hoisted_1$234={key:0,class:`context`},_hoisted_2$192={key:0,class:`card-label`},_hoisted_3$167={key:1,class:`card-label`},_hoisted_4$140={class:`simple-props-wrapper`},_hoisted_5$122={key:1,class:`to-load`},_hoisted_6$104={class:`chevron-arrow`},_hoisted_7$91={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_8$76={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_9$69={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_10$60={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-orange-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_11$54={key:2},_hoisted_12$43={key:0,class:`modifiers`},_hoisted_13$36={key:1,class:`timer-value`},_hoisted_14$34={key:0,class:`orange`},_sfc_main$263={__name:`CargoCard`,props:{card:{type:Object,required:!1},hideProps:Boolean,hideModsAndTimer:Boolean,focus:String,detailed:Boolean,showButtons:{type:Boolean,default:!0},alwaysShowLoadingWrapper:Boolean,ribbon:{type:Boolean,default:!0}},emits:[`cargoHovered`,`onAmountSelectorChanged`],setup(__props,{emit:__emit}){let emit$1=__emit;function onAmountSelectorChanged(value){emit$1(`onAmountSelectorChanged`,value)}let props=__props,cargoOverviewStore=useCargoOverviewStore(),{units}=useBridge(),getCargoCardClass=card=>({cardRow:!0,"bg-available":card.isFacilityCard&&card.enabled,"bg-available-selected":card.isFacilityCard&&card.enabled&&cargoOverviewStore.selectedCargo===card,"bg-assigned":card.transientMove,"bg-assigned-selected":card.transientMove&&cargoOverviewStore.selectedCargo===card,"bg-locked":card.isFacilityCard&&!card.enabled,"bg-locked-selected":card.isFacilityCard&&!card.enabled&&cargoOverviewStore.selectedCargo===card,"bg-loaded":card.isPlayerCard&&!card.transientMove,"bg-loaded-selected":card.isPlayerCard&&!card.transientMove&&cargoOverviewStore.selectedCargo===card,"highlight-poi-selected":!!(!props.detailed&&cargoOverviewStore.highlightedCards[card.cardId]),"card-disabled":!card.enabled,"with-thumbnail":card.thumbnail}),rewardMoney=computed(()=>props.card.rewardMoney||props.card.rewardMoneyPerLiter||(props.card.loanerCut?-(props.card.loanerCut.value*100-props.card.loanerCut.value*100%1)+`%`:void 0)),hasIds=computed(()=>props.card.rewardMoney&&props.card.ids&&props.card.ids.length>0&&!props.card.materialType),isPerLiter=computed(()=>props.card.rewardMoneyPerLiter),isLoadingFacilityCard=computed(()=>props.card.transientMoveCounts>0||props.card.spawnWhenCommitingCargo||props.card._transientMaterialMoveAmount>0),context=computed(()=>props.card.enabled?props.card.isFacilityCard?`Available`:props.card.transientMoveCounts>0||props.card.spawnWhenCommitingCargo||props.card._transientMaterialMoveAmount?`Assigned`:`Loaded`:`Locked`),isMoving=computed(()=>cargoOverviewStore.cargoData.player.isMoving),chevronProp=computed(()=>{let card=props.card;if(!card.isPlayerCard){if(card.cardType===`parcelGroup`)return card.materialType?card.transientMoveCounts>0||props.alwaysShowLoadingWrapper?{class:card.transientMoveCounts==0?`amount-load no-load`:`amount-load`,valueLabel:card.slots+`L`}:void 0:card.transientMoveCounts>0||props.alwaysShowLoadingWrapper?{class:card.transientMoveCounts==0?`amount-load no-load`:`amount-load`,valueLabel:card.transientMoveCounts+` / `+card.ids.length}:void 0;if(card.cardType===`vehicleOffer`)return card.spawnWhenCommitingCargo?{class:`amount-load`,valueLabel:`Accepted`,iconType:icons.fastTravel}:void 0;if(card.cardType===`storage`)return card._transientMaterialMoveAmount>0||props.alwaysShowLoadingWrapper?{class:card._transientMaterialMoveAmount==0?`amount-load no-load`:`amount-load`,valueLabel:card._transientMaterialMoveAmount+`L / `+card.storage.storedVolume+`L`}:void 0}}),propIcons=computed(()=>{let res=[],card=props.card;if(props.detailed)return res;if(card.enabled&&card.modifiers&&card.modifiers.length)for(let mod of card.modifiers)mod.important&&res.push({type:icons[mod.icon],color:`var(--bng-orange-300)`});return card.disableReason&&card.disableReason.type===`locked`&&res.push({type:icons.lockClosed,color:`var(--bng-add-red-300)`}),res}),cargoProps=computed(()=>{let res=[],card=props.card,detailed=props.detailed,focus$1=props.focus,$tt=$translate.instant,$ctx_t=$translate.contextTranslate,hideProps=props.hideProps;if(card.isFacilityCard&&!card.enabled&&(!card.transientMoveCounts||card.transientMoveCounts<=0)&&(card.disableReason?(card.disableReason.type===`noSpace`&&res.push({iconType:icons.info,keyLabel:detailed?`No Space`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`Not enough space to load this.`:`No Space`,class:`full-width red`,iconColor:`var(--bng-add-red-300)`}),card.disableReason.type===`expired`&&res.push({iconType:icons.info,keyLabel:detailed?`Expired`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`This offer is already expired.`:`Expired`,class:`full-width `}),card.disableReason.type===`limit`&&res.push({iconType:icons.info,keyLabel:detailed?`Limit reached`:``,valueLabel:detailed?card.disableReason.label?card.disableReason.label:`You cannot deliver more cars at the same time.`:`Limit reached`,class:`full-width red`,iconColor:`var(--bng-add-red-300)`})):res.push({iconType:icons.lockClosed,keyLabel:detailed?`Locked..?`:``,valueLabel:detailed?`Not enabled but no disablereason given!`:`Locked..?`,class:`full-width`,iconColor:`var(--bng-add-red-300)`})),card.unlockInfo){let locked=card.disableReason&&card.disableReason.type==`locked`;(detailed||locked)&&res.push({iconType:icons[card.unlockInfo.icon],valueLabel:detailed?$ctx_t(card.unlockInfo.longLabel):``,keyLabel:detailed?locked?`Locked`:``:$ctx_t(card.unlockInfo.shortLabel),class:`full-width `+(locked?`red`:``),iconColor:locked?`var(--bng-add-red-300)`:``})}if(hideProps)return res;if(card.nextTasks&&card.nextTasks.length>0&&(!focus$1||focus$1===`nextTasks`||detailed))for(let task of card.nextTasks)res.push({iconType:icons[task.checked?`checkboxOn`:`checkboxOff`],keyLabel:detailed?`Next Task`:``,valueLabel:task.label,class:`full-width`});if(card.locationName&&(!focus$1||focus$1===`location`||detailed)&&res.push({iconType:icons.locationSource,keyLabel:detailed?`Location`:``,valueLabel:detailed?card.locationNameLong:card.locationName,class:`full-width`}),card.destinationName&&(!focus$1||focus$1===`destination`||detailed)&&res.push({iconType:icons.locationDestination,keyLabel:detailed?`Destination`:``,valueLabel:detailed?card.destinationNameLong:card.destinationName,class:`full-width`}),card.locations&&(!focus$1||focus$1===`destination`)&&!detailed&&res.push({iconType:icons.mapPoint,valueLabel:card.locations.length+` possible Destinations`,class:`full-width`}),card.locations&&detailed)if(card.locations.length==1)res.push({iconType:icons.locationDestination,keyLabel:`Destination`,valueLabel:card.locations[0].name,class:`full-width`});else{res.push({iconType:icons.location2,keyLabel:`Multiple Destinations`,valueLabel:`Deliver this cargo to any of the possible destinations.`,class:`full-width`});let destinationsList=[];for(let location$1 of card.locations)destinationsList.push($tt(location$1.name));destinationsList=destinationsList.map(str=>str.replace(/ /g,` `)),res.push({iconType:icons.mapPoint,keyLabel:`Possible Destinations`,valueLabel:destinationsList.join(`, `),class:`full-width`})}if(card.distance&&(!focus$1||focus$1===`distance`||detailed)&&res.push({iconType:icons.routeSimple,keyLabel:detailed?`Distance`:``,valueLabel:units.buildString(`distance`,card.distance,1),class:``}),card.vehMileage&&(!focus$1||focus$1===`vehMileage`||detailed)&&res.push({iconType:icons.odometer,keyLabel:detailed?`Mileage`:``,valueLabel:units.buildString(`distance`,card.vehMileage,1),class:``}),card.weight&&(!focus$1||focus$1===`weight`||detailed)&&res.push({iconType:icons.weight,keyLabel:detailed?`Weight`:``,valueLabel:units.buildString(`weight`,card.weight,1),class:``}),card.density&&(!focus$1||focus$1===`density`||detailed)&&res.push({iconType:icons.weight,keyLabel:detailed?`Density`:``,valueLabel:units.buildString(`weight`,card.density,2),class:``}),card.storage&&(!focus$1||focus$1===`storage`||detailed)&&res.push({iconType:icons.boxDropOff01,keyLabel:detailed?`Available Volume`:``,valueLabel:(card.storage.storedVolume+(detailed?` / `+card.storage.capacity:``)).replace(/ /g,` `),class:``}),card.slots&&(!focus$1||focus$1===`slots`||detailed)&&res.push({iconType:icons.boxDropOff01,keyLabel:detailed?`Slots`:``,valueLabel:card.slots,class:``}),card.task&&(!focus$1||focus$1===`task`||detailed)&&res.push({iconType:icons.checkboxOff,keyLabel:detailed?`Task`:``,valueLabel:card.task,class:`full-width`}),card.cardType==`loaner`&&(!focus$1||detailed)&&res.push({iconType:icons.steeringWheelSporty,keyLabel:detailed?`Loaner`:``,valueLabel:detailed?card.isFacilityCard?`This vehicle can be loaned for delivery.`:`This vehicle can be used for delivery.`:`Loaner`,class:`full-width`}),card.cardType==`loaner`&&card.loanerCut&&!focus$1&&detailed&&res.push({iconType:icons.carCoins,keyLabel:detailed?`Loaner Cut`:``,valueLabel:detailed?`Organization takes `+(card.loanerCut.value*100-card.loanerCut.value*100%1)+`% of rewards earned with this loaner.`:card.loanerCut.value*100-card.loanerCut.value*100%1+`%`,class:`full-width`}),card.organizationName&&(!focus$1||detailed)&&res.push({iconType:icons.peopleOutline,keyLabel:detailed?`Organization`:``,valueLabel:$tt(card.organizationName),class:``}),card.capacity&&card.capacity.length)for(let cap of card.capacity)res.push({iconType:icons[cap.icon],keyLabel:detailed?`Capacity`:``,valueLabel:detailed?cap.labelLong:cap.labelShort,class:``});if(detailed&&card.modifiers&&card.modifiers.length>0)for(let mod of card.modifiers)res.push({iconType:icons[mod.icon],keyLabel:mod.label,valueLabel:mod.description,class:`full-width`+(mod.important?` orange`:``),iconColor:mod.important?`var(--bng-orange-300)`:``});return res});return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),mergeProps({class:[`card-item`,getCargoCardClass(__props.card)]},!__props.detailed&&{"bng-nav-item":!0,tabindex:1},{onClick:_cache[15]||=withModifiers(()=>{},[`stop`])}),{default:withCtx(()=>[!__props.detailed&&__props.card.thumbnail?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,ratio:`4:3`,"external-image":__props.card.thumbnail},{default:withCtx(()=>[!__props.card.enabled&&__props.card.disableReason.type==`locked`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).lockClosed,class:`icon`},null,8,[`type`])):createCommentVNode(``,!0)]),_:1},8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass({"card-content-flex":!0,"with-actions":!__props.detailed})},[createBaseVNode(`div`,{class:normalizeClass([`heading-wrapper`,{"heading-detailed":__props.detailed}])},[__props.detailed?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:__props.ribbon?`ribbon`:`none`,class:`card-heading`},{default:withCtx(()=>[context.value===``?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,_hoisted_1$234,toDisplayString(context.value),1)),createBaseVNode(`div`,null,[__props.card.vehName?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(__props.card.vehName),1)],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(__props.card.name),1)],64))])]),_:1},8,[`type`])):(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.vehName?(openBlock(),createElementBlock(`div`,_hoisted_3$167,toDisplayString(__props.card.vehName),1)):(openBlock(),createElementBlock(`div`,_hoisted_2$192,toDisplayString(__props.card.name),1))],64)),createBaseVNode(`div`,{class:normalizeClass([`pill pill-blue`,{"pill-orange":isLoadingFacilityCard.value}])},[typeof rewardMoney.value==`number`?(openBlock(),createBlock(unref(bngUnit_default),{key:0,class:`reward-money`,money:rewardMoney.value},null,8,[`money`])):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,class:`reward-money`,iconType:unref(icons).beamCurrency,valueLabel:rewardMoney.value},null,8,[`iconType`,`valueLabel`])),hasIds.value&&!__props.card.transientMove?(openBlock(),createBlock(unref(bngPropVal_default),{key:2,class:`amount-avail`,valueLabel:`×`+__props.card.ids.length},null,8,[`valueLabel`])):createCommentVNode(``,!0),hasIds.value&&__props.card.transientMove?(openBlock(),createBlock(unref(bngPropVal_default),{key:3,class:`amount-avail`,valueLabel:`×`+__props.card.transientMoveCounts},null,8,[`valueLabel`])):createCommentVNode(``,!0),isPerLiter.value?(openBlock(),createBlock(unref(bngPropVal_default),{key:4,class:`amount-avail`,valueLabel:`/L`})):createCommentVNode(``,!0),__props.card.materialType?(openBlock(),createBlock(unref(bngPropVal_default),{key:5,class:`amount-avail`,valueLabel:__props.card.slots+` L`},null,8,[`valueLabel`])):createCommentVNode(``,!0)],2)],2),!__props.card.showAmountSelector&&cargoProps.value.length>0&&__props.detailed?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass({"body-grid":__props.detailed,"body-list-wrapped":!__props.detailed,"content-detailed":__props.detailed})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(cargoProps.value,props$1=>(openBlock(),createBlock(unref(bngPropVal_default),mergeProps({ref_for:!0},props$1),null,16))),256))],2)):createCommentVNode(``,!0),__props.detailed&&isMoving.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`buttons-disabled-reason`,{"disabled-load-actions":!__props.card.enabled||!__props.showButtons,"footer-detailed":__props.detailed}])},[createVNode(unref(bngPropVal_default),{class:`prop`,iconType:unref(icons).info,keyLabel:``,valueLabel:`Cannot modify cargo while any vehicle is moving.`},null,8,[`iconType`])],2)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`load-actions-wrapper`,{"disabled-load-actions":!__props.card.enabled||!__props.showButtons,"footer-detailed":__props.detailed,"chevrons-bg":__props.card.transientMoveCounts>0||__props.card.spawnWhenCommitingCargo||__props.card._transientMaterialMoveAmount>0}])},[createBaseVNode(`div`,_hoisted_4$140,[__props.detailed?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[(openBlock(!0),createElementBlock(Fragment,null,renderList(propIcons.value,icon=>(openBlock(),createBlock(unref(bngIcon_default),mergeProps({class:`icon`},{ref_for:!0},icon),null,16))),256)),(openBlock(!0),createElementBlock(Fragment,null,renderList(cargoProps.value,props$1=>(openBlock(),createBlock(unref(bngPropVal_default),mergeProps({class:`prop`},{ref_for:!0},props$1),null,16))),256))],64))]),__props.card.enabled&&__props.showButtons?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`load-actions-buttons`,{undetailed:!__props.detailed}])},[__props.card.cardType==`parcelGroup`?(openBlock(),createElementBlock(Fragment,{key:0},[__props.card.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:0},[__props.card.transientMoveCounts==0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).secondary,"icon-right":unref(icons).undo,label:__props.detailed?`Clear load`:``,onClick:_cache[0]||=$event=>unref(cargoOverviewStore).clearLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.autoLoadLocations&&__props.card.autoLoadLocations.length==0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).secondary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[1]||=$event=>unref(cargoOverviewStore).loadCargoCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.transientMoveCounts==__props.card.ids.length||__props.card.autoLoadLocations.length==0||!__props.card.autoLoadLocations.length?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,"icon-right":unref(icons).arrowLargeRight,label:__props.detailed?`Load all`:``,onClick:_cache[2]||=$event=>unref(cargoOverviewStore).loadCargoAuto(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`]))],64)):(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.transientMoveCounts>0?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,"icon-right":unref(icons).undo,label:__props.detailed?`Clear Load`:``,onClick:_cache[3]||=$event=>unref(cargoOverviewStore).clearLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,"icon-right":unref(icons).trashBin1,label:__props.detailed?`Throw Away`:``,onClick:_cache[4]||=$event=>unref(cargoOverviewStore).throwAway(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])),__props.card.materialType===void 0?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).primary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[5]||=$event=>unref(cargoOverviewStore).loadCargoCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.materialType!==void 0&&__props.card.transientMove?(openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).primary,"icon-right":unref(icons).wrench,label:__props.detailed?`Custom Load`:``,onClick:_cache[6]||=$event=>unref(cargoOverviewStore).modifyMaterialLoad(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon-right`,`label`,`disabled`])):createCommentVNode(``,!0)],64))],64)):createCommentVNode(``,!0),__props.card.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:1},[__props.card.cardType==`storage`?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).wrench,label:__props.detailed?`Custom load`:``,onClick:_cache[7]||=$event=>unref(cargoOverviewStore).loadStorageCustom(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`vehicleOffer`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).keys1,label:__props.detailed?`Accept Job`:``,onClick:_cache[8]||=$event=>unref(cargoOverviewStore).loadOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`vehicleOffer`&&__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).undo,label:__props.detailed?`Decline Job`:``,onClick:_cache[9]||=$event=>unref(cargoOverviewStore).loadOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).main,icon:unref(icons).keys1,label:__props.detailed?`Accept Loaner`:``,onClick:_cache[10]||=$event=>unref(cargoOverviewStore).loadLoaner(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:4,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).undo,label:__props.detailed?`Decline Loaner`:``,onClick:_cache[11]||=$event=>unref(cargoOverviewStore).loadLoaner(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0)],64)):(openBlock(),createElementBlock(Fragment,{key:2},[__props.card.cardType==`vehicleOffer`&&!__props.card.spawnWhenCommitingCargo?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).trashBin1,label:__props.detailed?`Abandon Job`:``,onClick:_cache[12]||=$event=>unref(cargoOverviewStore).abandonOffer(__props.card),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0),__props.card.cardType==`loaner`&&__props.card.isSpawnedLoaner?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass(__props.detailed?``:`button-load`),accent:unref(ACCENTS).attention,icon:unref(icons).trashBin1,label:__props.detailed?`Return Loaner`:``,onClick:_cache[13]||=$event=>unref(cargoOverviewStore).returnLoaner(__props.card.id),disabled:isMoving.value,tabindex:`0`},null,8,[`class`,`accent`,`icon`,`label`,`disabled`])):createCommentVNode(``,!0)],64))],2)):createCommentVNode(``,!0),chevronProp.value?(openBlock(),createElementBlock(`div`,_hoisted_5$122,[createVNode(unref(bngPropVal_default),mergeProps({class:`amount-load`},chevronProp.value),null,16),createBaseVNode(`div`,_hoisted_6$104,[(openBlock(),createElementBlock(`svg`,_hoisted_7$91,[(openBlock(),createElementBlock(`svg`,_hoisted_8$76,[__props.card.transientMoveCounts===0?(openBlock(),createElementBlock(`path`,_hoisted_9$69)):(openBlock(),createElementBlock(`path`,_hoisted_10$60))]))]))])])):createCommentVNode(``,!0)],2),__props.card.showAmountSelector?(openBlock(),createElementBlock(`div`,_hoisted_11$54,[createTextVNode(` Selected Amount: `+toDisplayString(__props.card.amountSelector)+` `,1),createVNode(unref(bngSlider_default),{class:`slider`,min:0,max:__props.card.maxCount,step:1,modelValue:__props.card.amountSelector,"onUpdate:modelValue":_cache[14]||=$event=>__props.card.amountSelector=$event,onValueChanged:onAmountSelectorChanged},null,8,[`max`,`modelValue`])])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`footer-grid`,{"footer-detailed":__props.detailed}])},[__props.detailed?(openBlock(),createElementBlock(Fragment,{key:0},[(__props.focus===`none`||!__props.focus)&&!__props.hideModsAndTimer?(openBlock(),createElementBlock(`div`,_hoisted_12$43,[__props.detailed?createCommentVNode(``,!0):(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.card.modifiers,mod=>(openBlock(),createBlock(unref(bngIcon_default),{type:unref(icons)[mod.icon]},null,8,[`type`]))),256))])):createCommentVNode(``,!0),__props.card.remainingTime&&(__props.focus===`none`||!__props.focus)&&!__props.hideModsAndTimer?(openBlock(),createElementBlock(`div`,_hoisted_13$36,[__props.card.remainingTime.type===`preLoad`?(openBlock(),createElementBlock(`div`,_hoisted_14$34,`Time for delivery: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)):createCommentVNode(``,!0),__props.card.remainingTime.type===`untilDelayed`?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(` Time until delivery is Delayed: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)],64)):createCommentVNode(``,!0),__props.card.remainingTime.type===`untilLate`?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(` Time until delivery is Late: `+toDisplayString(unref(formatTime)(__props.card.remainingTime.time,2)),1)],64)):createCommentVNode(``,!0),__props.card.remainingTime.type===`late`?(openBlock(),createElementBlock(Fragment,{key:3},[createTextVNode(` Delivery is late `)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),__props.card.remainingTime&&__props.card.remainingTime.percent&&__props.card.isPlayerCard?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`timer-progress-bar`,{slim:!__props.detailed}])},[createBaseVNode(`div`,{class:`progress-bar-fill`,style:normalizeStyle({width:__props.card.remainingTime.percent*100+`%`})},null,4)],2)):createCommentVNode(``,!0)],2)],2)]),_:1},16,[`class`]))}},CargoCard_default=__plugin_vue_export_helper_default(_sfc_main$263,[[`__scopeId`,`data-v-bafe8e5e`]]),_hoisted_1$233={class:`info-container`},_hoisted_2$191={key:0,class:`header`},_hoisted_3$166={key:0,class:`label`},_hoisted_4$139={class:`props`},_hoisted_5$121={key:4,class:`prop pill`},_sfc_main$262={__name:`CargoInfo`,props:{label:String,fillInfo:Object,meta:Object},setup(__props){let{units}=useBridge(),props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$233,[__props.meta.type===`hidden`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$191,[__props.label?(openBlock(),createElementBlock(`div`,_hoisted_3$166,[__props.meta.type==`task`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`icon`,type:unref(icons).checkboxOff},null,8,[`type`])):createCommentVNode(``,!0),__props.label?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.$tt(__props.label)),1)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$139,[__props.meta.type==`container`||__props.meta.type==`totalStorage`?(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons)[__props.meta.icon],valueLabel:__props.meta.usedCargoSlots+` / `+__props.meta.totalCargoSlots},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0),__props.meta.type==`location`?(openBlock(),createBlock(unref(bngPropVal_default),{key:1,iconType:unref(icons).mapPoint,valueLabel:unref(units).buildString(`distance`,__props.meta.distance,1),style:{"--icon-size":`1.25em`}},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0),__props.meta.type==`trash`?(openBlock(),createBlock(unref(bngIcon_default),{key:2,class:`icon`,type:unref(icons).trashBin1},null,8,[`type`])):createCommentVNode(``,!0),props&&props.length?(openBlock(!0),createElementBlock(Fragment,{key:3},renderList(props,prop=>(openBlock(),createBlock(unref(bngPropVal_default),{iconType:unref(icons)[prop.icon],valueLabel:prop.label},null,8,[`iconType`,`valueLabel`]))),256)):createCommentVNode(``,!0),__props.fillInfo?(openBlock(),createElementBlock(`div`,_hoisted_5$121,[createVNode(unref(bngPropVal_default),{iconType:unref(icons)[__props.fillInfo.icon],valueLabel:__props.fillInfo.usedSlots+` / `+__props.fillInfo.availableSlots},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)]),__props.meta.fillPercent||__props.meta.fillPercent==0?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`progress-bar`,{trash:__props.meta.type==`trash`}])},[__props.meta.fillPercentHighlight>0?(openBlock(),createElementBlock(`div`,{key:0,class:`progress-bar-fill highlight`,style:normalizeStyle({width:`${__props.meta.fillPercentHighlight*100}%`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`progress-bar-fill`,style:normalizeStyle({width:`${__props.meta.fillPercent*100}%`})},null,4)],2)):createCommentVNode(``,!0)]))]))}},CargoInfo_default=__plugin_vue_export_helper_default(_sfc_main$262,[[`__scopeId`,`data-v-ba3be877`]]),_hoisted_1$232={class:`group`},_hoisted_2$190={class:`cards`},_sfc_main$261={__name:`CardGroup`,props:{label:String,fillInfo:Object,meta:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$232,[createVNode(CargoInfo_default,{label:__props.label,"fill-info":__props.fillInfo,meta:__props.meta},null,8,[`label`,`fill-info`,`meta`]),createBaseVNode(`div`,_hoisted_2$190,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},CardGroup_default=__plugin_vue_export_helper_default(_sfc_main$261,[[`__scopeId`,`data-v-f21d8701`]]),_hoisted_1$231={class:`customload-wrapper`,"bng-ui-scope":`cargoLoadPopup`},_hoisted_2$189={class:`card-container`},_hoisted_3$165={class:`content target-grid`},_hoisted_4$138={key:0,class:`target-tile`},_hoisted_5$120={class:`loading-controls amount-load`},_hoisted_6$103={class:`amount`},_hoisted_7$90={class:`chevron-arrow`},_hoisted_8$75={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_9$68={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_10$59={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_11$53={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-orange-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_12$42={key:1,class:`target-tile trash`},_hoisted_13$35={class:`loading-controls amount-load`},_hoisted_14$33={class:`amount`},_hoisted_15$32={class:`chevron-arrow`},_hoisted_16$32={class:`chevron-outer`,width:`100%`,height:`100%`,xmlns:`http://www.w3.org/2000/svg`},_hoisted_17$26={class:`chevron-inner`,viewBox:`4 2 12 60`,preserveAspectRatio:`xMaxYMid slice`},_hoisted_18$23={key:0,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`rgb(var(--chevron-color))`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_19$20={key:1,d:`M-11 -2H1L14 32L1 66H-11V-2Z`,fill:`rgb(var(--chevron-color))`,"fill-opacity":`var(--chevron-alpha)`,stroke:`var(--bng-add-red-500)`,"stroke-width":`3`,"vector-effect":`non-scaling-stroke`},_hoisted_20$17={class:`buttons content`},__default__$3={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$260=Object.assign(__default__$3,{__name:`CargoLoadPopup`,props:{cargo:Object,storageData:Object,throwAway:Boolean},emits:[`return`],setup(__props,{emit:__emit}){let cargoOverviewStore=useCargoOverviewStore(),{events:events$3}=useBridge(),{units}=useBridge();useUINavScope(`cargoLoadPopup`);let emit$1=__emit,props=__props,isFacilityCard=ref(!1),vehicleFilterModel=ref([]),vehicleFilterOptions=ref([]),vehicleFilterChanged=function(filter){for(let target of targetLocations.value)target.hidden=target.containerVehicleInfo&&!filter.includes(target.containerVehicleInfo.vehId)},originalTransientMoveCounts=0,original_transientMaterialMoveAmount=0,card=ref({});ref(0);let throwAwayValue=ref(0),trashMeta=ref({}),loadingName=ref(``),slotsPerItem=ref(0),weightPerItem=ref(0),moneyRewardPerItem=ref(0),targetLocations=ref({}),less=function(target){target?(target.loadSliderValue=Math.max(0,target.loadSliderValue-1),updateSliderAmounts(target)):(throwAwayValue.value=Math.max(0,throwAwayValue.value-1),updateThrowAwayAmount())},more=function(target){target?(target.loadSliderValue=Math.min(target.loadSliderMax,target.loadSliderValue+1),updateSliderAmounts(target)):(throwAwayValue.value=Math.min(totalAvailableAmount.value,throwAwayValue.value+1),updateThrowAwayAmount())},acceptClickHandler=()=>{let loadIdx=0;if(props.cargo)for(let id of props.cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);if(props.storageData&&Lua_default.career_modules_delivery_cargoScreen.clearTransientMovesForStorage(props.storageData.material.id),!props.throwAway)for(let target of targetLocations.value){if(props.cargo)for(let i=0;i{isFacilityCard.value&&(card.value.transientMoveCounts=originalTransientMoveCounts,card.value._transientMaterialMoveAmount=0),emit$1(`return`,!0)},totalAvailableAmount=ref(0),loadedAmount=ref(0),updateSliderAmounts=changedItem=>{loadedAmount.value=0;for(let target of targetLocations.value)target.maxAmount&&(loadedAmount.value+=target.loadSliderValue);let tooMuch=loadedAmount.value-totalAvailableAmount.value;if(tooMuch>0){for(let target of targetLocations.value)if(target.maxAmount&&target!==changedItem){let before=target.loadSliderValue;target.loadSliderValue=Math.max(0,target.loadSliderValue-tooMuch);let diff=target.loadSliderValue-before;tooMuch+=diff}loadedAmount.value=totalAvailableAmount.value}for(let target of targetLocations.value)target.meta.usedCargoSlots=target.usedCargoSlots+target.loadSliderValue*slotsPerItem.value,target.meta.fillPercentHighlight=target.meta.usedCargoSlots/target.meta.totalCargoSlots;isFacilityCard.value&&(throwAwayValue.value=totalAvailableAmount.value-loadedAmount.value,card.value.transientMoveCounts=loadedAmount.value,card.value._transientMaterialMoveAmount=loadedAmount.value,trashMeta.value.fillPercent=throwAwayValue.value/totalAvailableAmount.value)},updateThrowAwayAmount=()=>{loadedAmount.value=0;for(let target of targetLocations.value)target.maxAmount&&(loadedAmount.value+=target.loadSliderValue);let tooMuch=loadedAmount.value-totalAvailableAmount.value+throwAwayValue.value;for(let target of targetLocations.value){if(target.maxAmount){let before=target.loadSliderValue;target.loadSliderValue=Math.min(target.loadSliderMax,Math.max(0,target.loadSliderValue-tooMuch));let diff=target.loadSliderValue-before;tooMuch+=diff}loadedAmount.value=totalAvailableAmount.value}updateSliderAmounts()},splittable=ref(!1);return onMounted(()=>{if(getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),props.cargo){if(loadingName.value=props.cargo.name,slotsPerItem.value=props.cargo.slots,weightPerItem.value=props.cargo.weight,moneyRewardPerItem.value=props.cargo.rewardMoney,targetLocations.value=props.cargo.targetLocations,totalAvailableAmount.value=props.cargo.ids.length,props.cargo.splittable){splittable.value=!0,totalAvailableAmount.value=props.cargo.slots,slotsPerItem.value=1;for(let target of targetLocations.value)target.maxAmount=target.totalCargoSlots-target.usedCargoSlots}card.value=props.cargo,isFacilityCard.value=card.value.isFacilityCard,originalTransientMoveCounts=card.value.transientMoveCounts}props.storageData&&(console.log(props.storageData),loadingName.value=props.storageData.material.name,slotsPerItem.value=1,weightPerItem.value=props.storageData.material.density,moneyRewardPerItem.value=1,targetLocations.value=props.storageData.targetLocations,totalAvailableAmount.value=props.storageData.storage.storedVolume,card.value=props.storageData,isFacilityCard.value=card.value.isFacilityCard),targetLocations.value.length||(targetLocations.value=[]);for(let target of targetLocations.value)target.loadSliderValue=ref(target.selectedAmount),target.loadSliderMax=ref(Math.min(target.maxAmount,totalAvailableAmount.value)),target.meta={type:`container`,usedCargoSlots:target.usedCargoSlots,totalCargoSlots:target.totalCargoSlots,icon:`cardboardBox`,fillPercent:target.usedCargoSlots/target.totalCargoSlots};updateSliderAmounts();let vehicles={};for(let target of targetLocations.value)target.containerVehicleInfo&&(vehicles[target.containerVehicleInfo.vehId]=target.containerVehicleInfo);for(let vehId in vehicleFilterOptions.value=[],vehicles){let veh=vehicles[vehId];vehicleFilterOptions.value.push({value:veh.vehId,label:veh.vehName})}for(let vehId in vehicleFilterOptions.value.sort((a$1,b)=>a$1.name{window.bngVue.getCurrentRoute().name==`unknown`&&getUINavServiceInstance().setFilteredEventsAllExcept(UI_EVENTS.menu,UI_EVENTS.pause,UI_EVENTS.center_cam)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$231,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[__props.throwAway?(openBlock(),createBlock(unref(bngCardHeading_default),{key:1,type:`ribbon`},{default:withCtx(()=>[createTextVNode(` Throwing away `+toDisplayString(loadingName.value),1)]),_:1})):(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Custom Loading`,-1)]]),_:1})),createBaseVNode(`div`,_hoisted_2$189,[createVNode(CargoCard_default,{ribbon:!1,card:card.value,hideProps:!1,hideModsAndTimer:!0,showButtons:!1,detailed:!0,alwaysShowLoadingWrapper:isFacilityCard.value},null,8,[`card`,`alwaysShowLoadingWrapper`])]),_ctx.vehicles&&_ctx.vehicles.length>1?(openBlock(),createElementBlock(Fragment,{key:2},[_cache[5]||=createBaseVNode(`span`,null,`Vehicles`,-1),__props.throwAway?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPillFilters_default),{key:0,modelValue:vehicleFilterModel.value,"onUpdate:modelValue":_cache[0]||=$event=>vehicleFilterModel.value=$event,selectMany:``,options:vehicleFilterOptions.value,showCheckIcon:!1,onValueChanged:vehicleFilterChanged},null,8,[`modelValue`,`options`]))],64)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$165,[targetLocations.value&&!__props.throwAway?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(targetLocations.value,(target,targetIndex)=>(openBlock(),createElementBlock(Fragment,null,[target.hidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$138,[createVNode(CardGroup_default,{label:target.label,meta:target.meta},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`to-load`,{"none-assigned":target.loadSliderValue==0}])},[createBaseVNode(`div`,_hoisted_5$120,[createVNode(unref(bngButton_default),{class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:$event=>less(target)},null,8,[`iconLeft`,`onClick`]),createVNode(unref(bngSlider_default),{"bng-no-nav":``,class:`slider`,min:0,max:target.loadSliderMax,step:1,modelValue:target.loadSliderValue,"onUpdate:modelValue":$event=>target.loadSliderValue=$event,onValueChanged:$event=>updateSliderAmounts(target)},null,8,[`max`,`modelValue`,`onUpdate:modelValue`,`onValueChanged`]),createVNode(unref(bngButton_default),{class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:$event=>more(target)},null,8,[`iconLeft`,`onClick`]),createBaseVNode(`div`,_hoisted_6$103,`×`+toDisplayString(target.loadSliderValue),1)]),createBaseVNode(`div`,_hoisted_7$90,[(openBlock(),createElementBlock(`svg`,_hoisted_8$75,[(openBlock(),createElementBlock(`svg`,_hoisted_9$68,[target.loadSliderValue===0?(openBlock(),createElementBlock(`path`,_hoisted_10$59)):(openBlock(),createElementBlock(`path`,_hoisted_11$53))]))]))])],2)]),_:2},1032,[`label`,`meta`])]))],64))),256)):createCommentVNode(``,!0),__props.cargo&&__props.cargo.throwAwayInfo&&unref(totalAvailableAmount)?(openBlock(),createElementBlock(`div`,_hoisted_12$42,[createVNode(CardGroup_default,{label:`Trash`,meta:trashMeta.value},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`to-load`,{"none-assigned":throwAwayValue.value==0}])},[createBaseVNode(`div`,_hoisted_13$35,[createVNode(unref(bngButton_default),{class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:_cache[1]||=$event=>less()},null,8,[`iconLeft`]),createVNode(unref(bngSlider_default),{"bng-no-nav":``,class:`slider`,min:0,max:unref(totalAvailableAmount),step:1,modelValue:throwAwayValue.value,"onUpdate:modelValue":_cache[2]||=$event=>throwAwayValue.value=$event,onValueChanged:updateThrowAwayAmount},null,8,[`max`,`modelValue`]),createVNode(unref(bngButton_default),{class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:_cache[3]||=$event=>more()},null,8,[`iconLeft`]),createBaseVNode(`div`,_hoisted_14$33,`×`+toDisplayString(throwAwayValue.value),1)]),createBaseVNode(`div`,_hoisted_15$32,[(openBlock(),createElementBlock(`svg`,_hoisted_16$32,[(openBlock(),createElementBlock(`svg`,_hoisted_17$26,[throwAwayValue.value===0?(openBlock(),createElementBlock(`path`,_hoisted_18$23)):(openBlock(),createElementBlock(`path`,_hoisted_19$20))]))]))])],2)]),_:1},8,[`meta`])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_20$17,[withDirectives(createVNode(unref(bngButton_default),{class:`button`,label:`Cancel`,accent:`secondary`,onClick:cancelClickHandler},null,512),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]),__props.cargo&&__props.cargo.throwAwayInfo&&throwAwayValue.value>0?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`button`,accent:`attention`,onClick:acceptClickHandler},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.throwAway?`Throw Away`:`Accept`)+` (`,1),createVNode(unref(bngUnit_default),{money:-__props.cargo.throwAwayInfo.penalty*throwAwayValue.value},null,8,[`money`]),_cache[6]||=createTextVNode(`) `,-1)]),_:1})),[[unref(BngFocusIf_default),!0],[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`button`,label:`Accept`,accent:`main`,onClick:acceptClickHandler},null,512)),[[unref(BngFocusIf_default),!0],[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])]),_:1})]))}}),CargoLoadPopup_default=__plugin_vue_export_helper_default(_sfc_main$260,[[`__scopeId`,`data-v-0d30652e`]]),_hoisted_1$230={class:`settings-wrapper`,"bng-ui-scope":`cargoScreenSettings`},_hoisted_2$188={class:`cardContent`},_hoisted_3$164={class:`content`},_hoisted_4$137={class:`acceptButton`},__default__$2={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$259=Object.assign(__default__$2,{__name:`CargoScreenSettings`,emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`cargoScreenSettings`);let emit$1=__emit,cargoOverviewStore=useCargoOverviewStore();ref();let facilityGroupingItems=[{label:`Item one`,value:1},{label:`Item two`,value:2},{label:`Item three`,value:3},{label:`Item four`,value:4},{label:`Item five`,value:5},{label:`Item six`,value:6},{label:`Item seven`,value:7},{label:`Item eight`,value:8},{label:`Item nine`,value:9},{label:`Item ten`,value:10},{label:`Item eleven`,value:11},{label:`Item twelve`,value:12},{label:`Item thirteen`,value:13},{label:`Item fourteen`,value:14},{label:`Item fifteen`,value:15},{label:`Item sixteen`,value:16},{label:`Item seventeen`,value:17},{label:`Item eighteen`,value:18},{label:`Item nineteen`,value:19},{label:`Item twenty`,value:20}];ref(),ref(),ref();let setFacilityGroupKey=key=>{cargoOverviewStore.facilityGroupingKey=key},setFacilitySortKey=key=>{cargoOverviewStore.facilitySortingKey=key},setPlayerGroupKey=key=>{cargoOverviewStore.playerGroupingKey=key},setPlayerSortKey=key=>{cargoOverviewStore.playerSortingKey=key};onMounted(()=>{console.log(facilityGroupingItems)});let acceptClickHandler=()=>{emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$230,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Settings`,-1)]]),_:1}),createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Facility Display`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$188,[createBaseVNode(`div`,null,[_cache[3]||=createTextVNode(` Group By: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).selectedFilter.groupings,gKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setFacilityGroupKey(gKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[gKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,null,[_cache[4]||=createTextVNode(` Sorting: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].sortings,sKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setFacilitySortKey(sKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[sKey].label),1)]),_:2},1032,[`onClick`]))),256))])]),createBaseVNode(`div`,_hoisted_3$164,[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`My Cargo Display`,-1)]]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[0]||=$event=>unref(cargoOverviewStore).automaticRoute=$event},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`]),createBaseVNode(`div`,null,[_cache[7]||=createTextVNode(` Group By: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerGroupings,gKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setPlayerGroupKey(gKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[gKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,null,[_cache[8]||=createTextVNode(` Sorting: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].sortings,sKey=>(openBlock(),createBlock(unref(bngButton_default),{onClick:$event=>setPlayerSortKey(sKey)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[sKey].label),1)]),_:2},1032,[`onClick`]))),256))]),createBaseVNode(`div`,_hoisted_4$137,[withDirectives(createVNode(unref(bngButton_default),{label:`Continue`,accent:unref(ACCENTS).primary,onClick:acceptClickHandler},null,8,[`accent`]),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])])]),_:1})]))}}),CargoScreenSettings_default=__plugin_vue_export_helper_default(_sfc_main$259,[[`__scopeId`,`data-v-9dd4f12f`]]),_forEach=(arr,func)=>Array.isArray(arr)&&arr.length>0&&arr.forEach(func);const useCargoOverviewStore=defineStore(`cargoOverview`,()=>{let{events:events$3}=useBridge(),cargoData=ref(),dropDownData=ref({}),newCargoAvailable=ref(!1),cargoHighlighted=ref(!1),automaticRoute=ref(!1),detailedDropOff=ref(!1),tutorialInfo=ref(),facilityGroupingKey=ref(`destinations`),facilitySortingKey=ref(`rewardMoney`),playerGroupings=[`containers`,`tasklist`,`ungrouped`],playerGroupingKey=ref(`tasklist`),playerSortingKey=ref(`cardId`),facilityId,parkingSpotPath,facilityFilter={value:`facility-info`,label:`Facility Info`,showInFilterTabs:!0,isFacilityPage:!0},filterSets=ref({}),filterSetsByValue=ref({}),selectedFilterRef=ref(),selectedFilter=ref(facilityFilter),selectFilter=f=>{Lua_default.career_modules_delivery_general.setSetting(`selectedFilterKey`,f),Lua_default.career_modules_delivery_cargoScreen.setCargoScreenTab(f);for(let filter of filterSets.value)if(filter.value==f[0]){let prevGrouping=facilityGroupingKey.value,prevSorting=facilitySortingKey.value;if(selectedFilter.value=filter,!filter.isFacilityPage&&(filter.groupings.includes(prevGrouping)||(facilityGroupingKey.value=filter.groupings[0]),cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings.includes(prevSorting)||(facilitySortingKey.value=cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings[0]),selectedCargo.value&&selectedCargo.value.isFacilityCard)){let contained=selectedCargo.value.filterTags[filter.value];if(contained)for(let groupKey of filter.groupings)for(let group of cargoData.value.facilityCardGroupSets[groupKey].groups)contained||=group.cardIdsUnsorted.includes(selectedCargo.value.cardId);contained||(selectedCargo.value=void 0)}}},facilityGroupings=computed(()=>selectedFilter.value?selectedFilter.value.groupings:[]),nextFacilityGrouping=()=>{let groups=facilityGroupings.value;facilityGroupingKey.value=groups[(groups.indexOf(facilityGroupingKey.value)+1)%groups.length]},facilitySortings=computed(()=>cargoData.value&&facilityGroupingKey.value&&cargoData.value.facilityCardGroupSets&&cargoData.value.facilityCardGroupSets[facilityGroupingKey.value]?cargoData.value.facilityCardGroupSets[facilityGroupingKey.value].sortings:[]),nextFacilitySorting=()=>{let group=facilitySortings.value;facilitySortingKey.value=group[(group.indexOf(facilitySortingKey.value)+1)%group.length]},nextPlayerGrouping=()=>{let groups=playerGroupings;playerGroupingKey.value=groups[(groups.indexOf(playerGroupingKey.value)+1)%groups.length]},playerSortings=computed(()=>cargoData.value&&facilityGroupingKey.value&&cargoData.value.playerCardGroupSets&&cargoData.value.playerCardGroupSets[facilityGroupingKey.value]?cargoData.value.playerCardGroupSets[facilityGroupingKey.value].sortings:[]),nextPlayerSorting=()=>{let group=cargoData.value.playerCardGroupSets[facilityGroupingKey.value];playerSortingKey.value=group[(group.indexOf(playerSortingKey.value)+1)%group.length]},currentFilterTutorialInfo=computed(()=>{if(!tutorialInfo.value||!selectedFilter.value)return null;let info=tutorialInfo.value[selectedFilter.value.value];return!info||!info.unlocked||!info.isActive?null:info}),openCargoScreenSettings=()=>{addPopup(CargoScreenSettings_default)},sortedParcelOffersByCargoType=computed(()=>{if(!cargoData.value||!cargoData.value.facility||!cargoData.value.facility.outgoingCargo)return{};let sorted={};for(let cargoType in _forEach(cargoData.value.facility.outgoingCargo,cargo=>{sorted[cargo.type]||(sorted[cargo.type]=[]),sorted[cargo.type].push(cargo)}),sorted)sorted[cargoType]=sortByProperty(sorted[cargoType]);return sorted}),sortedVehicleOffers=computed(()=>!cargoData.value||!cargoData.value.facility?[]:sortByProperty(cargoData.value.facility.vehicleOffers)),sortedTrailerOffers=computed(()=>!cargoData.value||!cargoData.value.facility?[]:sortByProperty(cargoData.value.facility.trailerOffers)),sortedAcceptedOffers=computed(()=>cargoData.value?sortByProperty(cargoData.value.player.acceptedOffers):[]),loanerOffers=computed(()=>{if(!cargoData.value||!cargoData.value.facility||!cargoData.value.facility.loanableVehicles)return[];let result=[];return result=result.concat(cargoData.value.facility.loanableVehicles),result}),menuClosed=()=>{cargoData.value=void 0,dropDownData.value={},selectedFilter.value=facilityFilter,selectedCargo.value=void 0,Lua_default.career_modules_delivery_cargoScreen.showCargoRoutePreview(void 0),loadingPrompt&&loadingPrompt.close(null)},requestCargoData=(_facilityId,_parkingSpotPath,updateMaxTimeStamp)=>{facilityId=_facilityId,parkingSpotPath=_parkingSpotPath,Lua_default.career_modules_delivery_cargoScreen.requestCargoDataForUi(facilityId,parkingSpotPath,updateMaxTimeStamp),updateMaxTimeStamp!=0&&(newCargoAvailable.value=!1)},requestCargoDataSimple=()=>{requestCargoData(facilityId,parkingSpotPath,!1)},moveCargoToLocation=(cargoId,targetLocation,skipRequest)=>{Lua_default.career_modules_delivery_cargoScreen.moveCargoFromUi(cargoId,targetLocation),skipRequest||requestCargoData(facilityId,parkingSpotPath,!1)},requestMoveCargoToLocation=(cargoId,moveData,skipRequest)=>{moveData.extraData?openThrowAwayPopup(cargoId,moveData.location,`Throw this cargo away with a `+moveData.extraData.penalty.toFixed(2)+` penalty?`):moveCargoToLocation(cargoId,moveData.location,skipRequest)};async function openThrowAwayPopup(cargoId,targetLocation,message){await openConfirmation(null,message)?moveCargoToLocation(cargoId,targetLocation):setCargoData()}let setCargoData=data=>{let previousCardId;if(selectedCargo.value&&(previousCardId=selectedCargo.value.cardId),data&&(cargoData.value=data),dropDownData.value={},cargoData.value.player&&cargoData.value.player.vehicles){getAutomaticRoute(data.settings.automaticRoute),getDetailedDropOff(data.settings.detailedDropOff),automaticRoute.value&&setAutomaticRoute(automaticRoute.value),filterSets.value=data.filterSets,filterSets.value.unshift(facilityFilter);for(let filter of filterSets.value)filterSetsByValue.value[filter.value]=filter;selectedFilter.value||=filterSets.value[0],previousCardId&&onCargoSelected(cargoData.value.cardsById[previousCardId]),tutorialInfo.value=data.tutorialInfo}},highlightedCards=ref({}),highlightCardIds=highlightedIdMap=>{highlightedCards.value=highlightedIdMap},focusedCargo=ref();ref();let selectedCargo=ref(),onCargoHovered=cargo=>{focusedCargo.value=cargo,highlightRoute(focusedCargo.value)},onCargoSelected=cargo=>{selectedCargo.value=cargo},highlightRoute=card=>{card?Lua_default.career_modules_delivery_cargoScreen.showRoutePreview(card.route):Lua_default.career_modules_delivery_cargoScreen.showRoutePreview(void 0)},setAutomaticRoute=(newValue,oldValue)=>{newValue!=oldValue&&Lua_default.career_modules_delivery_general.setAutomaticRoute(newValue)};watch(()=>automaticRoute.value,setAutomaticRoute);let getAutomaticRoute=enabled=>{automaticRoute.value=enabled};watch(()=>detailedDropOff.value,(newValue,oldValue)=>{newValue!=oldValue&&Lua_default.career_modules_delivery_general.setDetailedDropOff(newValue)});let getDetailedDropOff=enabled=>{detailedDropOff.value=enabled},setGroupingAndSorting=()=>{},cardClicked=card=>{switch(card.cardType){case`parcelGroup`:loadCargoAuto(card);break;case`vehicleOffer`:loadOffer(card);break;case`storage`:loadStorageCustom(card);break}},cardDeselect=()=>onCargoSelected(),cardHovered=card=>{onCargoHovered(card)},clearLoad=cargo=>{for(let id of cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);requestCargoDataSimple()},throwAway=card=>{loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:card,throwAway:!0}).promise},changeDistribution=cargo=>{for(let[id,card]of Object.entries(cargoData.value.cardsById))if(card.isFacilityCard&&card.cardType==`parcelGroup`&&card.ids.includes(cargo.ids[0])){loadCargoCustom(card);return}},modifyMaterialLoad=cargo=>{for(let[id,card]of Object.entries(cargoData.value.cardsById))if(card.isFacilityCard&&card.cardType==`storage`&&card.storage.materialType==cargo.materialType){loadStorageCustom(card);return}},loadCargoAuto=cargo=>{for(let id of cargo.ids)Lua_default.career_modules_delivery_cargoScreen.clearTransientMoveForCargo(id);let idx=0;for(let loc of cargo.autoLoadLocations)Lua_default.career_modules_delivery_cargoScreen.moveCargoFromUi(cargo.ids[idx],loc),idx++;requestCargoDataSimple()},loadingPrompt=null,loadCargoCustom=card=>{if(card.transientMove){let cargoId=card.ids[0];for(let[id,otherCard]of Object.entries(cargoData.value.cardsById))if(otherCard.isFacilityCard&&otherCard.cardType==`parcelGroup`&&otherCard.ids.includes(cargoId)){loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:otherCard}).promise;return}}else loadingPrompt=addPopup(CargoLoadPopup_default,{cargo:card}).promise},loadStorageCustom=storageData=>{loadingPrompt=addPopup(CargoLoadPopup_default,{storageData}).promise},loadOffer=offer=>{Lua_default.career_modules_delivery_cargoScreen.toggleOfferForSpawning(offer.id),requestCargoDataSimple()},loadLoaner=offer=>{Lua_default.career_modules_loanerVehicles.markForSpawning(offer),requestCargoDataSimple()},returnLoaner=vehId=>{Lua_default.career_modules_loanerVehicles.returnVehicle(vehId).then(()=>{requestCargoDataSimple()})};async function abandonOffer(card){await openConfirmation(null,`Abandon `+card.name+`? There is a `+card.abandonInfo.penaltyMoney+`$ penalty.`)&&(Lua_default.career_modules_delivery_cargoScreen.abandonAcceptedOffer(card.abandonInfo.vehId),requestCargoDataSimple())}return events$3.on(`automaticRouteSet`,getAutomaticRoute),events$3.on(`cargoDataForUiReady`,setCargoData),events$3.on(`newCargoAvailable`,()=>newCargoAvailable.value=!0),events$3.on(`sendHighlightedCardIds`,highlightCardIds),events$3.on(`requestCargoDataSimple`,requestCargoDataSimple),{cargoData,tutorialInfo,sortedParcelOffersByCargoType,sortedVehicleOffers,sortedTrailerOffers,sortedAcceptedOffers,onCargoHovered,onCargoSelected,loanerOffers,dropDownData,newCargoAvailable,cargoHighlighted,automaticRoute,detailedDropOff,setGroupingAndSorting,requestCargoData,requestCargoDataSimple,requestMoveCargoToLocation,menuClosed,dispose:()=>{events$3.off(`cargoDataForUiReady`),events$3.off(`newCargoAvailable`),events$3.off(`sendHighlightedCardIds`),events$3.on(`requestCargoDataSimple`)},focusedCargo,selectedCargo,cardClicked,cardHovered,cardDeselect,clearLoad,changeDistribution,loadCargoAuto,loadCargoCustom,throwAway,loadStorageCustom,loadOffer,abandonOffer,loadLoaner,returnLoaner,modifyMaterialLoad,filterSets,filterSetsByValue,selectedFilterRef,selectedFilter,selectFilter,highlightedCards,openCargoScreenSettings,nextFacilityGrouping,nextFacilitySorting,nextPlayerGrouping,nextPlayerSorting,facilityGroupingKey,facilitySortingKey,playerGroupingKey,playerSortingKey,facilityGroupings,facilitySortings,playerGroupings,playerSortings,currentFilterTutorialInfo}});var _hoisted_1$229={class:`fill-panel`},_hoisted_2$187={key:1,class:`groupGrid`},_sfc_main$258={__name:`ProvidedOrdersPanel`,props:{groupSets:Object,groupIdx:[Number,String],sortingSets:Object,sortIdx:[Number,String],sortAsc:{type:Boolean,default:!0},ignoreFilter:Boolean},setup(__props){let cargoOverviewStore=useCargoOverviewStore(),props=__props;computed(()=>props.groupSets&&props.groupSets[props.groupIdx]&&props.groupSets[props.groupIdx].groups?props.groupSets[props.groupIdx].groups:[]);let sortedGroups=computed(()=>{let groupSet=props.groupSets[props.groupIdx];if(!cargoOverviewStore.cargoData||!cargoOverviewStore.cargoData.cardsById||!groupSet.groups||!groupSet.groups.length)return[];let groups=groupSet.groups,sortKey=props.sortingSets[props.sortIdx].key;function getHighestSortValue(group){let maxSortValue=-1/0;return group.cardIdsUnsorted&&group.cardIdsUnsorted.length&&group.cardIdsUnsorted.forEach(cardId=>{let card=cargoOverviewStore.cargoData.cardsById[cardId];if(card.filterTags[cargoOverviewStore.selectedFilter.value]||group.ignoreFilter||props.ignoreFilter){let sortValue=card.sortValues&&card.sortValues[sortKey]!==void 0?card.sortValues[sortKey]:1/0;sortValue>maxSortValue&&(maxSortValue=sortValue)}}),maxSortValue}return groups.sort((a$1,b)=>{let minValueA=getHighestSortValue(a$1),minValueB=getHighestSortValue(b);return props.sortAsc?minValueA-minValueB:minValueB-minValueA}),groups}),getSortedCardIds=group=>{if(!cargoOverviewStore.cargoData||!cargoOverviewStore.cargoData.cardsById||!group.cardIdsUnsorted)return[];let cardsById=cargoOverviewStore.cargoData.cardsById,sortKey=props.sortingSets[props.sortIdx].key;return group.cardIdsUnsorted&&group.cardIdsUnsorted.length?group.cardIdsUnsorted.slice().sort((a$1,b)=>{let cardA=cardsById[a$1],cardB=cardsById[b],valueA=cardA&&cardA.sortValues&&cardA.sortValues[sortKey]!==void 0?cardA.sortValues[sortKey]:0,valueB=cardB&&cardB.sortValues&&cardB.sortValues[sortKey]!==void 0?cardB.sortValues[sortKey]:0;return props.sortAsc?valueA-valueB:valueB-valueA}):[]};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$229,[unref(cargoOverviewStore).cargoData?unref(cargoOverviewStore).cargoData.cardsById?(openBlock(),createElementBlock(`div`,_hoisted_2$187,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[(group.cardIdsUnsorted.length>0||group.showEmpty)&&(group.filterTags[unref(cargoOverviewStore).selectedFilter.value]||group.ignoreFilter||__props.ignoreFilter)?(openBlock(),createBlock(CardGroup_default,{key:0,label:group.label,meta:group.meta},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(getSortedCardIds(group),cardId=>(openBlock(),createElementBlock(Fragment,{key:cardId},[unref(cargoOverviewStore).cargoData.cardsById[cardId].filterTags[unref(cargoOverviewStore).selectedFilter.value]||group.ignoreFilter||__props.ignoreFilter?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).cargoData.cardsById[cardId],onClick:withModifiers($event=>unref(cargoOverviewStore).onCargoSelected(unref(cargoOverviewStore).cargoData.cardsById[cardId]),[`stop`]),onMouseover:$event=>unref(cargoOverviewStore).onCargoHovered(unref(cargoOverviewStore).cargoData.cardsById[cardId]),onMouseleave:_cache[0]||=$event=>unref(cargoOverviewStore).onCargoHovered(),hideProps:__props.groupSets[__props.groupIdx].hideProps,hideModsAndTimer:__props.groupSets[__props.groupIdx].hideModsAndTimer},null,8,[`card`,`onClick`,`onMouseover`,`hideProps`,`hideModsAndTimer`])):createCommentVNode(``,!0)],64))),128))]),_:2},1032,[`label`,`meta`])):createCommentVNode(``,!0)],64))),128))])):createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` No data yet... `)],64))]))}},ProvidedOrdersPanel_default=__plugin_vue_export_helper_default(_sfc_main$258,[[`__scopeId`,`data-v-877d97e8`]]),_hoisted_1$228={class:`header-text`},_hoisted_2$186={key:0,class:`disabled-reason noOffers`},_sfc_main$257={__name:`FilterCard`,props:{filter:Object},setup(__props){let props=__props,cargoOverviewStore=useCargoOverviewStore(),disabled=computed(()=>{if(props.filter){if(!props.filter.hasAvailableOffers)return{disabled:!0};if(props.filter.unavailableAtThisFacility)return{disabled:!0,reason:`Unavailable`};if(props.filter.lockedInfo)return{disabled:!0,reason:props.filter.lockedInfo.shortLabel}}return{disabled:!1}});return onMounted(()=>{}),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass([`filterCard`,{disabled:disabled.value.disabled}]),onClick:_cache[0]||=withModifiers($event=>unref(cargoOverviewStore).selectFilter([__props.filter.value]),[`stop`])},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`card-heading`},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$228,toDisplayString(__props.filter.label),1)]),_:1}),createVNode(unref(aspectRatio_default),{class:`image`,ratio:`8:3`},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.filter.icon]},null,8,[`type`]),createBaseVNode(`div`,{class:normalizeClass([`step`,{none:__props.filter.facilityCards===0}])},[createVNode(unref(bngPropVal_default),{class:`amount-avail`,valueLabel:`× `+__props.filter.facilityCards},null,8,[`valueLabel`])],2)]),_:1}),disabled.value.reason?(openBlock(),createElementBlock(`div`,_hoisted_2$186,[createVNode(unref(bngPropVal_default),{class:`amount-avail`,iconType:unref(icons).lockClosed,valueLabel:disabled.value.reason},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)]),_:1},8,[`class`]))}},FilterCard_default=__plugin_vue_export_helper_default(_sfc_main$257,[[`__scopeId`,`data-v-85dcf2d5`]]),_hoisted_1$227={key:0,class:`heading-container`},_hoisted_2$185={class:`status-add`},_hoisted_3$163={class:`controls-row`},_hoisted_4$136={key:1,class:`content-container`},_hoisted_5$119={class:`header-container`},_hoisted_6$102={class:`info-line`},_hoisted_7$89={class:`header-flex padding`},_hoisted_8$74={class:`groupSortButtons`},_hoisted_9$67={class:`scroll-panel`},_hoisted_10$58={key:0,class:`tasklist`},_hoisted_11$52={class:`tasklist-header`},_hoisted_12$41={class:`task-content`},_hoisted_13$34={class:`heading`},_hoisted_14$32={class:`description`},_hoisted_15$31={key:1,class:`empty-cargo-card`},_hoisted_16$31={class:`header-container`},_hoisted_17$25={class:`header-flex`},_hoisted_18$22={key:0,class:`map-overlay`},_hoisted_19$19={key:1,class:`empty-cargo-card`},_hoisted_20$16={class:`header-container`},_hoisted_21$15={class:`info-line`},_hoisted_22$13={class:`header-flex wrap padding`},_hoisted_23$12={class:`groupSortButtons`},_hoisted_24$11={class:`cargohold-info`},_hoisted_25$10={class:`scroll-panel padding`},_hoisted_26$8={class:`content`},_hoisted_27$8={key:0,class:`buttons-wrapper`},_hoisted_28$7={class:`content flex-container`},_hoisted_29$7={key:1,class:`header-flex progress-bar-padding`},_hoisted_30$7={key:0,class:`progress-bar-wrapper wide`},_hoisted_31$7=[`innerHTML`],_hoisted_32$7={class:`info-right`},_hoisted_33$7={key:0},_hoisted_34$7={key:0,class:`header-flex progress-bar-padding`},_hoisted_35$6={class:`progress-bar-wrapper wide`},_hoisted_36$6={class:`content`},_hoisted_37$5={class:`filterSelectGrid`},_sfc_main$256={__name:`CargoOverviewMain`,props:{facilityId:String,parkingSpotPath:String},setup(__props){let tabPills=ref();useUINavScope(`delivery`);let props=__props,cargoOverviewStore=useCargoOverviewStore();async function openDiscardPopup(){await openConfirmation(null,`Discard Changes?`)&&(Lua_default.career_modules_delivery_cargoScreen.cancelDeliveryConfiguration(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))}let close=()=>{cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0&&props.facilityId?openDiscardPopup():(Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))},acceptLoad=()=>{Lua_default.career_modules_delivery_cargoScreen.commitDeliveryConfiguration(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`)};async function openExitModePopup(){await openConfirmation(null,`Throw away all cargo and exit delivery mode?`)&&(Lua_default.career_modules_delivery_cargoScreen.exitDeliveryMode(),Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),window.bngVue.gotoGameState(`play`))}let exitMode=()=>{openExitModePopup()};async function gotoSkillProgress(panel){cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0||window.bngVue.gotoGameState(`branchPage`,{params:{branchKey:panel.branchId,skillKey:panel.skillId}})}async function gotoOrganizations(id){cargoOverviewStore.cargoData.confirmButtonInfo.itemCount>0||window.bngVue.gotoGameState(`organizations`,{params:{orgId:id}})}let facilitySortAsc=ref(!1),playerSortAsc=ref(!0),activePopovers={},popShown=pop=>nextTick(()=>activePopovers[pop.name]=pop),popHidden=pop=>nextTick(()=>delete activePopovers[pop.name]);function popHideAll(){for(let pop of Object.values(activePopovers))pop.hide()}let screenCover=ref(),mapPanel=ref(null),observer$2,mapClipChanged;function resizer(){let elScreen=screenCover.value?.$el||screenCover.value;if(!mapPanel.value||!elScreen){mapClipChanged&&(mapClipChanged=!1,screenCover.value.style.setProperty(`--map-clip`,`unset`));return}let pad=3,{width:width$1,height:height$1}=elScreen.getBoundingClientRect(),rect=mapPanel.value.getBoundingClientRect(),percentile=[(rect.x+3)/width$1,(rect.y+3)/height$1,(rect.x+rect.width-3)/width$1,(rect.y+rect.height-3)/height$1].map(n=>`${n*100}%`);elScreen.style.setProperty(`--map-clip`,`polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, ${percentile[0]} ${percentile[1]}, ${percentile[0]} ${percentile[3]}, ${percentile[2]} ${percentile[3]}, ${percentile[2]} ${percentile[1]}, ${percentile[0]} ${percentile[1]})`),mapClipChanged=!0,Lua_default.freeroam_bigMapMode.setBigmapScreenBounds({width:width$1,height:height$1},rect)}watch(()=>mapPanel.value,(elm,prev)=>{prev&&observer$2.unobserve(prev),elm&&observer$2.observe(elm)},{immediate:!0}),watch(()=>cargoOverviewStore.selectedFilter?.isFacilityPage,()=>nextTick(resizer));let selectedFilters=ref([]);return watch(()=>cargoOverviewStore.selectedFilter,filter=>{selectedFilters.value=[filter.value],cargoOverviewStore.focusedCargo=null}),onMounted(()=>{observer$2=new ResizeObserver(resizer),resizer(),cargoOverviewStore.requestCargoData(props.facilityId,props.parkingSpotPath),selectedFilters.value=[cargoOverviewStore.selectedFilter.value]}),onBeforeUnmount(()=>{observer$2?.disconnect()}),onUnmounted(()=>{Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen(),cargoOverviewStore.menuClosed()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`cargo-overview-main-layout`,"bng-ui-scope":`delivery`,ref_key:`screenCover`,ref:screenCover},{default:withCtx(()=>[createBaseVNode(`div`,{class:`screen`,onClick:_cache[10]||=$event=>unref(cargoOverviewStore).cardDeselect(),onClickCapture:popHideAll},[unref(cargoOverviewStore).cargoData?(openBlock(),createElementBlock(`div`,_hoisted_1$227,[createVNode(unref(bngScreenHeading_default),{preheadings:[`Delivery Mode`],divider:``},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facility?unref(cargoOverviewStore).cargoData.facility.name:`My Cargo`),1)]),_:1}),createVNode(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default)),createBaseVNode(`div`,_hoisted_2$185,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.skillLevels,(skill,index)=>(openBlock(),createBlock(unref(bngPropVal_default),{key:index,iconType:unref(icons)[skill.icon],valueLabel:_ctx.$ctx_t(skill.levelLabel)},null,8,[`iconType`,`valueLabel`]))),128)),unref(cargoOverviewStore).cargoData.facility&&unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons).peopleOutline,valueLabel:_ctx.$ctx_t(unref(cargoOverviewStore).cargoData.facility.organization.reputation.label)},null,8,[`iconType`,`valueLabel`])):createCommentVNode(``,!0)])]),_:1})])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$163,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`back-button`,accent:unref(ACCENTS).attention,onClick:close},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.common.close`)),1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]]),unref(cargoOverviewStore).cargoData&&unref(cargoOverviewStore).filterSets&&__props.facilityId?(openBlock(),createBlock(unref(bngPillFilters_default),{key:0,ref_key:`tabPills`,ref:tabPills,required:``,modelValue:selectedFilters.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedFilters.value=$event,options:unref(cargoOverviewStore).filterSets,onValueChanged:unref(cargoOverviewStore).selectFilter},null,8,[`modelValue`,`options`,`onValueChanged`])):createCommentVNode(``,!0),!__props.facilityId&&unref(cargoOverviewStore).cargoData&&unref(cargoOverviewStore).cargoData.player.penaltyForAbandon.money<0?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:`attention`,iconLeft:unref(icons).trashBin1,onClick:exitMode,class:`right-button`},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(` Abandon all deliveries `,-1)]]),_:1},8,[`iconLeft`])):createCommentVNode(``,!0)]),unref(cargoOverviewStore).cargoData?(openBlock(),createElementBlock(`div`,_hoisted_4$136,[!unref(cargoOverviewStore).selectedFilter.isFacilityPage||!__props.facilityId?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`panel-flex`,{reverse:!__props.facilityId}])},[__props.facilityId?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`content-row provided-orders-panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$119,[unref(cargoOverviewStore).selectedFilter?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`,class:`cardHeadingFlex wide`},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).selectedFilter.label),1),unref(cargoOverviewStore).selectedFilter.howTo?(openBlock(),createBlock(TutorialButton_default,{key:0,class:`howto-button right`,accent:`secondary`,icon:unref(icons).help,pages:unref(cargoOverviewStore).selectedFilter.howTo.pages},null,8,[`icon`,`pages`])):createCommentVNode(``,!0)]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$102,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).selectedFilter.shortDescription),1)]),createBaseVNode(`div`,_hoisted_7$89,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).group,onClick:_cache[1]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Grouping: `+toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[unref(cargoOverviewStore).facilityGroupingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`facility-grouping`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverMenu_default),{name:`facility-grouping`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).facilityGroupings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).facilityGroupingKey===key}),onClick:withModifiers(()=>{unref(cargoOverviewStore).facilityGroupingKey=key,hide$2()},[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.facilityCardGroupSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_8$74,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).order,onClick:_cache[2]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Sorting: `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).facilitySortingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`facility-sorting`,`bottom`,{click:!0}]]),withDirectives(createVNode(unref(bngButton_default),{class:`groupSortButtonSmall`,accent:unref(ACCENTS).text,icon:facilitySortAsc.value?unref(icons).sortAsc:unref(icons).sortDesc,onClick:_cache[3]||=withModifiers($event=>facilitySortAsc.value=!facilitySortAsc.value,[`stop`])},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),facilitySortAsc.value?`Ascending order`:`Descending order`,`top`]])]),createVNode(unref(bngPopoverMenu_default),{name:`facility-sorting`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).facilitySortings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).facilitySortingKey===key}),onClick:()=>{unref(cargoOverviewStore).facilitySortingKey=key,hide$2()}},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1})])]),_cache[12]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_9$67,[unref(cargoOverviewStore).currentFilterTutorialInfo?.tasks?(openBlock(),createElementBlock(`div`,_hoisted_10$58,[createBaseVNode(`div`,_hoisted_11$52,toDisplayString(unref(cargoOverviewStore).selectedFilter.label)+` Tutorial `,1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).currentFilterTutorialInfo.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_12$41,[createBaseVNode(`div`,_hoisted_13$34,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_14$32,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0),createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.facilityCardGroupSets,groupIdx:unref(cargoOverviewStore).facilityGroupingKey,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).facilitySortingKey,sortAsc:facilitySortAsc.value,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`sortAsc`,`onCardHovered`,`onCardClicked`])])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`content-row selected-and-map-panel`,{wide:!__props.facilityId}])},[__props.facilityId?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`cargo-detail`},{default:withCtx(()=>[unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo,detailed:``,"show-buttons":!unref(cargoOverviewStore).focusedCargo&&unref(cargoOverviewStore).selectedCargo||unref(cargoOverviewStore).focusedCargo===unref(cargoOverviewStore).selectedCargo},null,8,[`card`,`show-buttons`])):(openBlock(),createElementBlock(`div`,_hoisted_15$31,`Select a card to view details.`))]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`map`,ref_key:`mapPanel`,ref:mapPanel},[createBaseVNode(`div`,_hoisted_16$31,[createBaseVNode(`div`,_hoisted_17$25,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading wide`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(unref(cargoOverviewStore).cargoData.levelInfo.name)),1)]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[4]||=$event=>unref(cargoOverviewStore).automaticRoute=$event,onClick:_cache[5]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`])])]),__props.facilityId?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$22,[createVNode(unref(bngCard_default),{class:`cargo-detail`},{default:withCtx(()=>[unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo?(openBlock(),createBlock(CargoCard_default,{key:0,card:unref(cargoOverviewStore).focusedCargo||unref(cargoOverviewStore).selectedCargo,detailed:``,"show-buttons":!unref(cargoOverviewStore).focusedCargo&&unref(cargoOverviewStore).selectedCargo||unref(cargoOverviewStore).focusedCargo===unref(cargoOverviewStore).selectedCargo},null,8,[`card`,`show-buttons`])):(openBlock(),createElementBlock(`div`,_hoisted_19$19,` Select a card to view details. `))]),_:1})]))],512)],2),createVNode(unref(bngCard_default),{class:`content-row my-cargo-panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_20$16,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeadingFlex wide`},{default:withCtx(()=>[_cache[14]||=createBaseVNode(`span`,null,`My Cargo`,-1),createVNode(TutorialButton_default,{class:`howto-button right`,accent:`secondary`,icon:unref(icons).help,pages:[`delivery/myCargo`,`delivery/parcelDelivery`]},null,8,[`icon`])]),_:1}),createBaseVNode(`div`,_hoisted_21$15,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),_cache[15]||=createBaseVNode(`span`,null,`Check your loaded cargo and other delivery-related tasks.`,-1)]),createBaseVNode(`div`,_hoisted_22$13,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).group,onClick:_cache[6]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Grouping: `+toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).playerGroupingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`player-grouping`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverMenu_default),{name:`player-grouping`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerGroupings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).playerGroupingKey===key}),onClick:()=>{unref(cargoOverviewStore).playerGroupingKey=key,hide$2()}},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_23$12,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`groupSortButton`,accent:unref(ACCENTS).text,icon:unref(icons).order,onClick:_cache[7]||=withModifiers(()=>{},[`stop`])},{default:withCtx(()=>[createTextVNode(` Sorting: `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).playerSortingKey].label),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngPopover_default),`player-sorting`,`bottom`,{click:!0}]]),withDirectives(createVNode(unref(bngButton_default),{class:`groupSortButtonSmall`,accent:unref(ACCENTS).text,icon:playerSortAsc.value?unref(icons).sortAsc:unref(icons).sortDesc,onClick:_cache[8]||=withModifiers($event=>playerSortAsc.value=!playerSortAsc.value,[`stop`])},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),playerSortAsc.value?`Ascending order`:`Descending order`,`top`]])]),createVNode(unref(bngPopoverMenu_default),{name:`player-sorting`,focus:``,onShow:popShown,onHide:popHidden},{default:withCtx(({hide:hide$2})=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).playerSortings,key=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key,accent:unref(ACCENTS).menu,class:normalizeClass({selected:unref(cargoOverviewStore).playerSortingKey===key}),onClick:withModifiers(()=>{unref(cargoOverviewStore).playerSortingKey=key,hide$2()},[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[key].label),1)]),_:2},1032,[`accent`,`class`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])),128))]),_:1}),createBaseVNode(`div`,_hoisted_24$11,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.playerCardGroupSets.totalStorages.groups,(group,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[group.meta.totalCargoSlots?(openBlock(),createBlock(CargoInfo_default,{key:0,class:`info-with-gradient`,meta:group.meta},null,8,[`meta`])):createCommentVNode(``,!0)],64))),128))])])]),_cache[17]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_25$10,[unref(cargoOverviewStore).selectedFilter.noContainers?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`no-container-card`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_26$8,[createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),_cache[16]||=createTextVNode(` You do not have any containers installed that can load this type of cargo. `,-1)]),createVNode(TutorialButton_default,{class:`button`,accent:`secondary`,icon:unref(icons).help,pages:[`delivery/cargoContainerHowTo`],text:`How do I install cargo containers?`},null,8,[`icon`])])]),_:1})):createCommentVNode(``,!0),createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.playerCardGroupSets,groupIdx:unref(cargoOverviewStore).playerGroupingKey,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).playerSortingKey,sortAsc:playerSortAsc.value,ignoreFilter:!0,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`sortAsc`,`onCardHovered`,`onCardClicked`])]),unref(cargoOverviewStore).cargoData&&__props.facilityId?(openBlock(),createElementBlock(`div`,_hoisted_27$8,[unref(cargoOverviewStore).cargoData.confirmButtonInfo.itemCount>0?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`accept-button`,icon:unref(icons).checkmark,onClick:withModifiers(acceptLoad,[`stop`])},{default:withCtx(()=>[createTextVNode(` Continue (`+toDisplayString(unref(cargoOverviewStore).cargoData.confirmButtonInfo.itemCount)+` items) `,1)]),_:1},8,[`icon`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1})],2)):(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`detailedFilterSelector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_28$7,[createVNode(unref(bngCard_default),{class:`info-left`},{default:withCtx(()=>[unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`,class:`cardHeadingFlex`},{default:withCtx(()=>[createBaseVNode(`span`,null,[_cache[18]||=createBaseVNode(`span`,null,`Reputation:\xA0`,-1),createBaseVNode(`span`,null,toDisplayString(unref(cargoOverviewStore).cargoData.facility.organization.reputation.label+` (lvl `+unref(cargoOverviewStore).cargoData.facility.organization.reputation.level+`)`),1)]),createVNode(unref(bngButton_default),{icon:unref(icons).signal05a,accent:`secondary`,onClick:_cache[9]||=$event=>gotoOrganizations(unref(cargoOverviewStore).cargoData.facility.organization.id)},{default:withCtx(()=>[..._cache[19]||=[createTextVNode(`Progress`,-1)]]),_:1},8,[`icon`])]),_:1})):createCommentVNode(``,!0),unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createElementBlock(`div`,_hoisted_29$7,[createVNode(unref(bngIcon_default),{class:`progress-icon`,type:unref(icons).peopleOutline},null,8,[`type`]),unref(cargoOverviewStore).cargoData.facility.organization?(openBlock(),createElementBlock(`div`,_hoisted_30$7,[createVNode(unref(bngProgressBar_default),{class:`bar`,gradient:``,value:unref(cargoOverviewStore).cargoData.facility.organization.reputation.value,max:unref(cargoOverviewStore).cargoData.facility.organization.reputation.nextThreshold,min:unref(cargoOverviewStore).cargoData.facility.organization.prevThreshold,showValueLabel:!1},null,8,[`value`,`max`,`min`])])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,ratio:`5:3`,"external-image":unref(cargoOverviewStore).cargoData.facility.preview},null,8,[`external-image`]),createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Facility Information `,-1)]]),_:1}),createBaseVNode(`div`,{class:`content text-justify`,innerHTML:unref(content_exports).bbcode.parse(unref(cargoOverviewStore).cargoData.facility.longDescription)},null,8,_hoisted_31$7)]),_:1}),createBaseVNode(`div`,_hoisted_32$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(cargoOverviewStore).cargoData.facilityPanels,(panel,index)=>(openBlock(),createBlock(unref(bngCard_default),{key:index,class:`panel`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeadingFlex`},{default:withCtx(()=>[createBaseVNode(`span`,null,[createBaseVNode(`span`,null,toDisplayString(panel.heading)+`:\xA0`,1),panel.skillInfo?(openBlock(),createElementBlock(`span`,_hoisted_33$7,toDisplayString(panel.skillInfo.unlocked?_ctx.$ctx_t(panel.skillInfo.levelLabel):``),1)):createCommentVNode(``,!0)]),panel.skillInfo?(openBlock(),createBlock(unref(bngButton_default),{key:0,icon:unref(icons).signal05a,accent:`secondary`,onClick:$event=>gotoSkillProgress(panel)},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(`Progress`,-1)]]),_:1},8,[`icon`,`onClick`])):createCommentVNode(``,!0)]),_:2},1024),panel.skillInfo?(openBlock(),createElementBlock(`div`,_hoisted_34$7,[createVNode(unref(bngIcon_default),{class:`progress-icon`,type:unref(icons)[panel.skillInfo.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_35$6,[createVNode(unref(bngProgressBar_default),{class:`bar`,gradient:``,value:panel.skillInfo.max==-1?1:panel.skillInfo.value-panel.skillInfo.min,max:panel.skillInfo.max==-1?1:panel.skillInfo.max-panel.skillInfo.min,showValueLabel:!0,valueLabelFormat:panel.skillInfo.max===-1?`Max`:panel.skillInfo.value+` XP`},null,8,[`value`,`max`,`valueLabelFormat`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_36$6,[createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).info},null,8,[`type`]),createTextVNode(` `+toDisplayString(panel.description),1)]),createBaseVNode(`div`,_hoisted_37$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(panel.filterValueButtons,filterKey=>(openBlock(),createBlock(FilterCard_default,{key:filterKey,filter:unref(cargoOverviewStore).filterSetsByValue[filterKey]},null,8,[`filter`]))),128))])])]),_:2},1024))),128))])])]),_:1}))])):createCommentVNode(``,!0)],32)]),_:1},512))}},CargoOverviewMain_default=__plugin_vue_export_helper_default(_sfc_main$256,[[`__scopeId`,`data-v-719883ab`]]),_hoisted_1$226={class:`unlock-wrapper`,"bng-ui-scope":`cargoUnlockPopup`},_hoisted_2$184={class:`cardContent`},_hoisted_3$162={class:`acceptButton`},__default__$1={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$255=Object.assign(__default__$1,{__name:`UnlockPopup`,props:{reward:Object},emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`cargoUnlockPopup`);let emit$1=__emit,acceptClickHandler=()=>{emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$226,[createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Level Up! `,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$184,[createBaseVNode(`h3`,null,toDisplayString(__props.reward.unlockPopupHeader),1),_cache[2]||=createTextVNode(` Unlocks: `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.reward.branchLevels[__props.reward.animationData.level-1].unlocks,item=>(openBlock(),createBlock(UnlockCard_default,{class:`tier-unlocks-item`,data:item},null,8,[`data`]))),256)),createBaseVNode(`div`,_hoisted_3$162,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:acceptClickHandler},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[1]||=createBaseVNode(`span`,null,`Continue`,-1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),acceptClickHandler,`ok`]])])])]),_:1})]))}}),UnlockPopup_default=__plugin_vue_export_helper_default(_sfc_main$255,[[`__scopeId`,`data-v-127ed650`]]),_hoisted_1$225={class:`reward-wrapper`},_hoisted_2$183={class:`card-content`},_hoisted_3$161={class:`scroll-wrapper`},_hoisted_4$135={key:0},_hoisted_5$118={class:`cargo-wrapper`},_hoisted_6$101={class:`header`},_hoisted_7$88={class:`amount-controls`},_hoisted_8$73={class:`amount`},_hoisted_9$66={class:`card-content`},_hoisted_10$57={style:{display:`flex`}},_hoisted_11$51={style:{float:`left`}},_hoisted_12$40={key:0,class:`rewards-breakdown-container padding-bottom`},_hoisted_13$33={class:`grid-wrapper`},_hoisted_14$31={class:`grid-row grid`},_hoisted_15$30={class:`label primary`},_hoisted_16$30={class:`rewards primary`},_hoisted_17$24={class:`grid-wrapper wide`},_hoisted_18$21={class:`grid`},_hoisted_19$18={class:`label secondary`},_hoisted_20$15={class:`rewards secondary`},_hoisted_21$14={class:`grid-row grid`},_hoisted_22$12={class:`rewards primary`},_hoisted_23$11={key:1,class:`rewards-breakdown-container padding-bottom`},_hoisted_24$10={class:`grid-wrapper`},_hoisted_25$9={key:0,class:`grid-row grid`},_hoisted_26$7={class:`rewards primary`},_hoisted_27$7={key:1,class:`grid-row grid`},_hoisted_28$6={class:`rewards primary`},_hoisted_29$6={key:2,class:`grid-row grid`},_hoisted_30$6={class:`rewards primary`},_hoisted_31$6={key:3,class:`grid-row grid`},_hoisted_32$6={class:`rewards primary`},_hoisted_33$6={class:`grid-row grid`},_hoisted_34$6={class:`rewards primary`},_hoisted_35$5={style:{float:`left`}},_hoisted_36$5={key:0,style:{float:`left`}},_hoisted_37$4={key:0,class:`numberReward`},_hoisted_38$4={key:1,class:`numberReward`},_hoisted_39$4={key:2},_hoisted_40$3={key:1,style:{float:`left`,width:`100%`,padding:`0.2em`}},_hoisted_41$3={key:2},__default__={wrapper:{fade:!0,blur:!0,style:popupContainer.transparent},position:[popupPosition.center,popupPosition.center]},_sfc_main$254=Object.assign(__default__,{__name:`CargoDropOff`,props:{facilityId:String,parkingSpotPath:String},setup(__props){let ANIMATION_START_DELAY=400,ANIMATION_DURATION=3e3,ANIMATION_UPDATE_RATE=30,BAR_COLOR_DEFAULT=`#ff6600`,BAR_COLOR_ADDITION=`#ff6600`,BAR_COLOR_SUBTRACTION=`#c00000`,MODES={wait:`wait`,cargoSelection:`cargoSelection`,results:`results`},cargoOverviewStore=useCargoOverviewStore();useUINavScope(`cargoDropOff`);let props=__props,{events:events$3}=useBridge(),mode=ref(MODES.wait),data=ref({}),summary=ref([]),showConfirmDelay=ref(!1),confirmButtonEnabled=ref(!1),confirmButtonTimer=ref(0),confirmButtonTimerId=0,rewardAnimationIndex=ref(-1),animationSkipped=!1,showUnloadingDelay=!0,getLevelFromValue=(value,reward)=>{let branchLevels=reward.branchLevels,levelIndex=-1;for(let i=0;i=levelData.requiredValue&&(levelIndex=i)}let maxLevel=!(branchLevels[levelIndex+1]&&branchLevels[levelIndex+1].requiredValue!=null),displayValue=value-branchLevels[levelIndex].requiredValue;return{min:0,max:maxLevel?displayValue:branchLevels[levelIndex+1].requiredValue-branchLevels[levelIndex].requiredValue,displayValue,levelLabel:reward.type==`reputation`?branchLevels[levelIndex].label+` (Level `+(levelIndex-1)+`)`:branchLevels[levelIndex].levelLabel,level:levelIndex+1,maxLevel}},confirm=()=>{rewardAnimationIndex.value<0?confirmButtonEnabled.value&&confirmDropOff():skipAnimations()},getDeliveryList=()=>summary.value.detailledList.map(delivery=>delivery.label).join(`, `),getNiceTime=()=>confirmButtonTimer.value>0?confirmButtonTimer.value.toFixed(1)+`s remaining...`:`Done!`,exit=()=>{window.bngVue.gotoGameState(`play`)};function updateDisplayValue(reward){if(reward.branchLevels&&reward.branchLevels.length){let displayData=getLevelFromValue(reward.animationData.smoothedValue,reward);reward.animationData.max=displayData.max,reward.animationData.displayValue=displayData.displayValue,reward.animationData.levelLabel=displayData.levelLabel,reward.animationData.level=displayData.level,reward.animationData.maxLevel=displayData.maxLevel;let displayDataBefore=getLevelFromValue(reward.animationData.value-reward.rewardAmount,reward);displayData.level==displayDataBefore.level?(reward.animationData.displayValueBefore=displayDataBefore.displayValue,displayData.displayValue>=displayDataBefore.displayValue?(reward.valueColor=BAR_COLOR_ADDITION,reward.valueBeforeColor=BAR_COLOR_DEFAULT):(reward.valueBeforeColor=BAR_COLOR_SUBTRACTION,reward.valueColor=BAR_COLOR_DEFAULT)):displayData.level>displayDataBefore.level?(reward.animationData.displayValueBefore=0,reward.valueColor=BAR_COLOR_ADDITION,reward.valueBeforeColor=BAR_COLOR_DEFAULT):(reward.animationData.displayValueBefore=displayData.max,reward.valueColor=BAR_COLOR_DEFAULT,reward.valueBeforeColor=BAR_COLOR_SUBTRACTION)}}let startSmoothingValue=(reward,duration)=>{reward.animationData.numStep=(reward.animationData.value-reward.animationData.smoothedValue)/duration*30,clearInterval(reward.animationData.numTimer),reward.animationData.numTimer=setInterval(()=>{reward.animationData.smoothedValue+=reward.animationData.numStep,(reward.animationData.numStep>0?reward.animationData.smoothedValue>=reward.animationData.value:reward.animationData.smoothedValue<=reward.animationData.value)&&(Lua_default.career_modules_delivery_progress.activateSound(``,!1),reward.animationData.smoothedValue=reward.animationData.value,reward.animationData.numStep=0,clearInterval(reward.animationData.numTimer)),reward.highlight=reward.animationData.numStep!=0,updateDisplayValue(reward)},30)};async function openNewLevelPopup(reward){Lua_default.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Progress_LevelUp`),await addPopup(UnlockPopup_default,{reward}).promise,startProgressBarAnimation()}function didPlayerLevelUp(reward){let levelBefore=0,levelAfter=0;return reward.branchLevels&&reward.branchLevels.length&&(levelBefore=getLevelFromValue(reward.animationData.value-reward.rewardAmount,reward).level,levelAfter=getLevelFromValue(reward.animationData.value,reward).level),levelBeforeopenNewLevelPopup(reward),duration):setTimeout(startProgressBarAnimation,duration+400);return}rewardAnimationIndex.value=-1}}let start=()=>{getUINavServiceInstance().activate(),getUINavServiceInstance().clearFilteredEvents(),Lua_default.career_modules_delivery_general.setDeliveryTimePaused(!0),Lua_default.career_modules_delivery_cargoScreen.requestDropOffData(props.facilityId,props.parkingSpotPath)},kill=()=>{Lua_default.career_modules_delivery_general.setDeliveryTimePaused(!1),events$3.off(`SetDeliveryDropOffCargoSelection`),events$3.off(`SetDeliveryDropOffRewardResult`),clearInterval(confirmButtonTimerId),Lua_default.career_modules_delivery_cargoScreen.dropOffPopupClosed(mode.value)},confirmSelection=()=>{let confirmedCargoIds=[];data.value.customAmountPerMaterialType.forEach(info=>{info.items.forEach(item=>{item.amountSelector>0&&confirmedCargoIds.push({id:item.ids[0],amount:item.amountSelector})})});let confirmedDropOffs={confirmedCargoIds,confirmedOfferIds:[]};console.log(confirmedDropOffs),Lua_default.career_modules_delivery_cargoScreen.confirmDropOffData(confirmedDropOffs,props.facilityId,props.parkingSpotPath)},confirmDropOff=()=>{exit()},branchInfo;function rewardMapToRewardList(rewards){let newRewards=[];for(let key in rewards){let rewardInfo={attributeKey:key,rewardAmount:rewards[key],order:branchInfo[key].order,animationData:branchInfo[key].animationData,branchLevels:branchInfo[key].branchLevels,showLevelUpPopup:branchInfo[key].showLevelUpPopup,unlockPopupHeader:branchInfo[key].unlockPopupHeader,type:branchInfo[key].type};branchInfo[key].icon&&(rewardInfo.icon=branchInfo[key].icon),newRewards.push(rewardInfo)}return newRewards.sort((a$1,b)=>a$1.order-b.order),newRewards}let cargoBySummaryId=[],calculateSummary=()=>{let simpleBreakdownRewardsByType={base:[],bonus:[],loaner:[],branch:[]};summary.value={detailledList:[],total:{label:`Total`,rewards:{}}};let totalRewards={};for(let id in cargoBySummaryId){let group=cargoBySummaryId[id],first=group.list[0],totalCount=0;for(let cargo of group.list)totalCount+=1;let sum={label:first.name,rewards:rewardMapToRewardList(first.originalRewards),breakdown:[]};for(let i=0;i0&&summary.value.detailledList.push(sum)}if(data.value.rewardOffers.length)for(let veh of data.value.rewardOffers){let sum={label:veh.offer.name,rewards:rewardMapToRewardList(veh.originalRewards),breakdown:[]};if(simpleBreakdownRewardsByType.base.push(veh.originalRewards),veh.breakdown.length)for(let bd of veh.breakdown)sum.breakdown.push({label:bd.label,rewards:rewardMapToRewardList(bd.rewards)}),bd.simpleBreakdownType&&(simpleBreakdownRewardsByType[bd.simpleBreakdownType]||(simpleBreakdownRewardsByType[bd.simpleBreakdownType]=[]),simpleBreakdownRewardsByType[bd.simpleBreakdownType].push(bd.rewards));summary.value.detailledList.push(sum)}for(let type in simpleBreakdownRewardsByType){let sum={};for(let elem of simpleBreakdownRewardsByType[type])for(let attKey in elem)sum[attKey]||(sum[attKey]=0),sum[attKey]+=elem[attKey];simpleBreakdownRewardsByType[type]=rewardMapToRewardList(sum)}summary.value.simpleBreakdown=simpleBreakdownRewardsByType;for(let row of summary.value.detailledList){for(let elem of row.rewards)totalRewards[elem.attributeKey]||(totalRewards[elem.attributeKey]=0),totalRewards[elem.attributeKey]+=elem.rewardAmount;for(let bd of row.breakdown)for(let elem of bd.rewards)totalRewards[elem.attributeKey]||(totalRewards[elem.attributeKey]=0),totalRewards[elem.attributeKey]+=elem.rewardAmount}summary.value.total.rewards=rewardMapToRewardList(totalRewards);let counter$1=0;for(let reward of summary.value.total.rewards)reward.animationData.id!=`missing`&&(reward.animationOrderIndex=counter$1,reward.animationData.smoothedValue=reward.animationData.value-reward.rewardAmount,reward.animationData.numStep=0,reward.highlight=!1,updateDisplayValue(reward),counter$1++);rewardAnimationIndex.value=-1,animationSkipped=!1};events$3.on(`SetDeliveryDropOffCargoSelection`,dd=>{data.value=dd,mode.value=MODES.cargoSelection,branchInfo=dd.branchInfo,showUnloadingDelay=dd.unloadingDelay>.1,data.value.playerVehicleData.length&&data.value.customAmountPerMaterialType.forEach(info=>{let remainingFreeAmount=info.storage.capacity-info.storage.storedVolume;info.items.sort((a$1,b)=>a$1.slots-b.slots),info.items.forEach(item=>{item.amountSelectorPerSlot=item.type===`fluid`||item.type===`dryBulk`,item.maxCount=item.ids.length,item.amountSelectorPerSlot&&(item.maxCount=item.slots),item.amountSelector=ref(Math.max(0,Math.min(item.maxCount,remainingFreeAmount))),remainingFreeAmount-=item.amountSelector,item.showAmountSelector=!0,item.loadSliderMax=Math.min(item.maxCount,info.storage.capacity-info.storage.storedVolume)}),info.meta={type:`container`,usedCargoSlots:info.storage.storedVolume,totalCargoSlots:info.storage.capacity,fillPercent:info.storage.storedVolume/info.storage.capacity,icon:info.material.icon},info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector}),info.meta.fillPercentHighlight=info.meta.usedCargoSlots/info.storage.capacity,info.storage.capacity<=info.storage.storedVolume&&(info.isFull=!0)})});let updateSliderAmounts=(info,changedItem)=>{info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector});let tooMuch=info.meta.usedCargoSlots-info.meta.totalCargoSlots;tooMuch>0&&(info.items.reverse(),info.items.forEach(item=>{if(item!==changedItem){let before=item.amountSelector;item.amountSelector=Math.max(0,item.amountSelector-tooMuch);let diff=item.amountSelector-before;tooMuch+=diff}}),info.items.reverse()),info.meta.usedCargoSlots=info.storage.storedVolume,info.items.forEach(item=>{info.meta.usedCargoSlots+=item.amountSelector}),info.meta.fillPercentHighlight=info.meta.usedCargoSlots/info.storage.capacity};return events$3.on(`SetDeliveryDropOffRewardResult`,dd=>{if(console.log(`setDropOffRewardResult`,dd),data.value=dd,branchInfo=dd.branchInfo,mode.value=MODES.results,confirmButtonEnabled.value=!0,showConfirmDelay.value=!1,dd.unloadingDelay>.1){confirmButtonEnabled.value=!1,confirmButtonTimer.value=dd.unloadingDelay,showConfirmDelay.value=!0;let endTime=Date.now()+confirmButtonTimer.value*1e3,countdown=()=>{let timeLeft=(endTime-Date.now())/1e3;timeLeft>0?(confirmButtonTimer.value=timeLeft,confirmButtonTimerId=requestAnimationFrame(countdown)):(confirmButtonTimer.value=0,confirmButtonEnabled.value=!0)};confirmButtonTimerId=requestAnimationFrame(countdown),showUnloadingDelay=!0}else showUnloadingDelay=!1;if(dd.rewardParcels.length)for(let cargo of dd.rewardParcels)cargoBySummaryId[cargo.summaryId]||(cargoBySummaryId[cargo.summaryId]={list:[],display:{}}),cargoBySummaryId[cargo.summaryId].list.push(cargo);calculateSummary(),setTimeout(startProgressBarAnimation,400)}),onMounted(start),onUnmounted(kill),(_ctx,_cache)=>mode.value===MODES.wait?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{key:0,class:`cargo-drop-off-wrapper`,"bng-ui-scope":`cargoDropOff`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$225,[mode.value===MODES.cargoSelection?(openBlock(),createBlock(unref(bngCard_default),{key:0},{buttons:withCtx(()=>[createVNode(unref(bngButton_default),{onClick:confirmSelection},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`ok`,deviceMask:`xinput`}),_cache[4]||=createBaseVNode(`span`,null,`Confirm Selection`,-1)]),_:1})]),default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`career-status`}),createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Dropping off...`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$183,[createVNode(unref(bngPropVal_default),{class:`limited-capacity-info`,valueLabel:`This facility has limited capacity for cargo.`,iconType:unref(icons).info},null,8,[`iconType`]),createBaseVNode(`div`,_hoisted_3$161,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value.customAmountPerMaterialType,info=>(openBlock(),createBlock(CardGroup_default,{class:`fullwidth-group`,label:info.material.name,meta:info.meta},{default:withCtx(()=>[info.isFull?(openBlock(),createElementBlock(`div`,_hoisted_4$135,[createVNode(unref(bngPropVal_default),{valueLabel:`The storage for this material is completely filled. Come back later.`,iconType:unref(icons).abandon},null,8,[`iconType`])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(info.items,item=>(openBlock(),createElementBlock(`div`,_hoisted_5$118,[createBaseVNode(`div`,_hoisted_6$101,[createVNode(unref(bngPropVal_default),{valueLabel:item.originName,keyLabel:`Origin`,iconType:unref(icons).locationSource},null,8,[`valueLabel`,`iconType`]),createVNode(unref(bngPropVal_default),{valueLabel:item.containerName,keyLabel:`Container`,iconType:unref(icons).cardboardBox},null,8,[`valueLabel`,`iconType`])]),createBaseVNode(`div`,_hoisted_7$88,[createVNode(unref(bngButton_default),{disabled:info.isFull,class:`less`,iconLeft:unref(icons).minus,accent:`text`,onClick:_cache[0]||=$event=>_ctx.less(_ctx.target)},null,8,[`disabled`,`iconLeft`]),createVNode(unref(bngSlider_default),{disabled:info.isFull,class:`slider`,min:0,max:item.loadSliderMax,modelValue:item.amountSelector,"onUpdate:modelValue":$event=>item.amountSelector=$event,step:1,onChange:$event=>updateSliderAmounts(info,item)},null,8,[`disabled`,`max`,`modelValue`,`onUpdate:modelValue`,`onChange`]),createVNode(unref(bngButton_default),{disabled:info.isFull,class:`more`,iconLeft:unref(icons).plus,accent:`text`,onClick:_cache[1]||=$event=>_ctx.more(_ctx.target)},null,8,[`disabled`,`iconLeft`]),createBaseVNode(`div`,_hoisted_8$73,toDisplayString(item.amountSelector)+` / `+toDisplayString(item.slots),1)])]))),256))]),_:2},1032,[`label`,`meta`]))),256))])])]),_:1})):createCommentVNode(``,!0),mode.value===MODES.results?(openBlock(),createBlock(unref(bngCard_default),{key:1},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:rewardAnimationIndex.value<0&&!confirmButtonEnabled.value,onClick:confirm},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{deviceMask:`xinput`}),createBaseVNode(`span`,null,toDisplayString(rewardAnimationIndex.value<0?`Continue`:`Skip`),1)]),_:1},8,[`disabled`])),[[unref(BngFocusIf_default),rewardAnimationIndex.value==0]])]),default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Delivery Complete!`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_9$66,[createBaseVNode(`div`,_hoisted_10$57,[createBaseVNode(`h3`,_hoisted_11$51,`Delivered: `+toDisplayString(getDeliveryList()),1),summary.value.detailledList.length>1?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,style:{float:`right`},modelValue:unref(cargoOverviewStore).detailedDropOff,"onUpdate:modelValue":_cache[2]||=$event=>unref(cargoOverviewStore).detailedDropOff=$event},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Detailed`,-1)]]),_:1},8,[`modelValue`])):createCommentVNode(``,!0)]),summary.value.detailledList.length<=1||unref(cargoOverviewStore).detailedDropOff?(openBlock(),createElementBlock(`div`,_hoisted_12$40,[createBaseVNode(`div`,_hoisted_13$33,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summary.value.detailledList,result=>(openBlock(),createElementBlock(`div`,_hoisted_14$31,[createBaseVNode(`div`,_hoisted_15$30,toDisplayString(result.label),1),createBaseVNode(`div`,_hoisted_16$30,[createVNode(RewardsPills_default,{rewards:result.rewards},null,8,[`rewards`])]),createBaseVNode(`div`,_hoisted_17$24,[(openBlock(!0),createElementBlock(Fragment,null,renderList(result.breakdown,breakdown=>(openBlock(),createElementBlock(`div`,_hoisted_18$21,[createBaseVNode(`div`,_hoisted_19$18,toDisplayString(breakdown.label),1),createBaseVNode(`div`,_hoisted_20$15,[createVNode(RewardsPills_default,{rewards:breakdown.rewards},null,8,[`rewards`])])]))),256))])]))),256)),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_21$14,[_cache[7]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_22$12,[createVNode(RewardsPills_default,{rewards:summary.value.total.rewards},null,8,[`rewards`])])])])])):(openBlock(),createElementBlock(`div`,_hoisted_23$11,[createBaseVNode(`div`,_hoisted_24$10,[summary.value.simpleBreakdown.base.length?(openBlock(),createElementBlock(`div`,_hoisted_25$9,[_cache[8]||=createBaseVNode(`div`,{class:`label primary`},`Base Rewards`,-1),createBaseVNode(`div`,_hoisted_26$7,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.base},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.bonus.length?(openBlock(),createElementBlock(`div`,_hoisted_27$7,[_cache[9]||=createBaseVNode(`div`,{class:`label primary`},`Bonuses`,-1),createBaseVNode(`div`,_hoisted_28$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.bonus},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.loaner.length?(openBlock(),createElementBlock(`div`,_hoisted_29$6,[_cache[10]||=createBaseVNode(`div`,{class:`label primary`},`Loaner Cuts`,-1),createBaseVNode(`div`,_hoisted_30$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.loaner},null,8,[`rewards`])])])):createCommentVNode(``,!0),summary.value.simpleBreakdown.branch.length?(openBlock(),createElementBlock(`div`,_hoisted_31$6,[_cache[11]||=createBaseVNode(`div`,{class:`label primary`},`Logistics Level Multiplier`,-1),createBaseVNode(`div`,_hoisted_32$6,[createVNode(RewardsPills_default,{rewards:summary.value.simpleBreakdown.branch},null,8,[`rewards`])])])):createCommentVNode(``,!0),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_33$6,[_cache[12]||=createBaseVNode(`div`,{class:`label primary`},`Summary`,-1),createBaseVNode(`div`,_hoisted_34$6,[createVNode(RewardsPills_default,{rewards:summary.value.total.rewards},null,8,[`rewards`])])])])])),(openBlock(!0),createElementBlock(Fragment,null,renderList(summary.value.total.rewards,reward=>(openBlock(),createElementBlock(`div`,null,[reward.animationData.id==`missing`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass(reward.animationData.numStep==0?``:`animate-progress-background`),style:{display:`flex`,"padding-bottom":`0.5em`,"padding-left":`0.2em`,"padding-right":`0.2em`}},[createBaseVNode(`div`,_hoisted_35$5,[reward.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,style:{"padding-top":`0.5em`,"padding-right":`0.3em`},type:unref(icons)[reward.icon]},null,8,[`type`])):createCommentVNode(``,!0)]),reward.animationData.type==`number`?(openBlock(),createElementBlock(`div`,_hoisted_36$5,[reward.attributeKey==`money`?(openBlock(),createElementBlock(`div`,_hoisted_37$4,[createVNode(unref(bngUnit_default),{money:reward.animationData.smoothedValue,"no-icon":``},null,8,[`money`])])):reward.attributeKey==`beamXP`?(openBlock(),createElementBlock(`div`,_hoisted_38$4,[createVNode(unref(bngUnit_default),{beamXP:reward.animationData.smoothedValue,"no-icon":``},null,8,[`beamXP`])])):(openBlock(),createElementBlock(`div`,_hoisted_39$4,toDisplayString(reward.animationData.smoothedValue.toFixed(2)),1))])):(openBlock(),createElementBlock(`div`,_hoisted_40$3,[createVNode(unref(bngProgressBar_default),{headerLeft:_ctx.$t(reward.animationData.name),headerRight:reward.animationData.levelLabel,value:~~reward.animationData.displayValue,"old-value":~~reward.animationData.displayValueBefore,max:reward.animationData.max,showValueLabel:!0,valueColor:reward.valueColor,oldValueColor:reward.valueBeforeColor,valueLabelFormat:reward.animationData.maxLevel?~~reward.animationData.displayValue+`\xA0XP`:`#value#\xA0XP`,"animate-difference":!0},null,8,[`headerLeft`,`headerRight`,`value`,`old-value`,`max`,`valueColor`,`oldValueColor`,`valueLabelFormat`])]))],2))]))),256)),unref(showUnloadingDelay)?(openBlock(),createElementBlock(`div`,_hoisted_41$3,[createVNode(unref(bngDivider_default)),_cache[13]||=createTextVNode(` Unloading Delay `,-1),createVNode(unref(bngProgressBar_default),{class:`timer`,value:data.value.unloadingDelay-confirmButtonTimer.value,max:data.value.unloadingDelay,min:0,valueLabelFormat:getNiceTime()},null,8,[`value`,`max`,`valueLabelFormat`])])):createCommentVNode(``,!0)])]),_:1})):createCommentVNode(``,!0)])]),_:1})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),confirm,`back,menu`]])}}),CargoDropOff_default=__plugin_vue_export_helper_default(_sfc_main$254,[[`__scopeId`,`data-v-698d9552`]]);const useComputerStore=defineStore(`computer`,()=>{let computerData=ref({}),activeVehicleIndex=ref(0),activeInventoryId=computed(()=>computerData.value.vehicles&&computerData.value.vehicles[activeVehicleIndex.value]?computerData.value.vehicles[activeVehicleIndex.value].inventoryId:`0`),generalComputerFunctions=computed(()=>{if(!computerData.value.computerFunctions)return[];let result=[];return result=Object.values(computerData.value.computerFunctions.general),result.sort((a$1,b)=>a$1.order!=null&&b.order!=null?a$1.order{if(!computerData.value.computerFunctions)return{};let result={};for(let[inventoryId,computerFunctions]of Object.entries(computerData.value.computerFunctions.vehicleSpecific)){let sortedFunctions=Object.values(computerFunctions);sortedFunctions.sort((a$1,b)=>a$1.order!=null&&b.order!=null?a$1.order{computerData.value=data,(computerData.value.vehicles&&computerData.value.vehicles.length<=activeVehicleIndex.value||computerData.value.resetActiveVehicleIndex)&&(activeVehicleIndex.value=0)};return{activeVehicleIndex,activeInventoryId,computerData,generalComputerFunctions,vehicleSpecificComputerFunctions,requestComputerData:()=>{Lua_default.career_modules_computer.getComputerUIData().then(setComputerData)},computerButtonCallback:async(computerFunctionId,inventoryId)=>{await Lua_default.career_modules_computer.computerButtonCallback(computerFunctionId,inventoryId?Number(inventoryId):void 0)},switchActiveVehicle:offset$2=>{activeVehicleIndex.value=(activeVehicleIndex.value+offset$2+computerData.value.vehicles.length)%computerData.value.vehicles.length},onMenuClosed:()=>{Lua_default.career_modules_computer.onMenuClosed()}}});var _hoisted_1$224={class:`task-header`},_hoisted_2$182={class:`description`},_sfc_main$253={__name:`TaskHeader`,props:{title:[String,Object],description:[String,Object]},setup(__props){let props=__props,slots=useSlots(),titleParsed=computed(()=>parse$1($translate.contextTranslate(props.title,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description)));return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$224,[createBaseVNode(`div`,null,[unref(slots).title?renderSlot(_ctx.$slots,`title`,{key:0},void 0,!0):__props.title?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:titleParsed.value},null,8,[`template`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_2$182,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]))}},TaskHeader_default=__plugin_vue_export_helper_default(_sfc_main$253,[[`__scopeId`,`data-v-ae9fa7fe`]]),_hoisted_1$223={class:`task-message`},_hoisted_2$181={class:`label`},_hoisted_3$160={class:`description`},_sfc_main$252={__name:`TaskMessage`,props:{label:String,description:String},setup(__props){let props=__props,slots=useSlots(),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description)));return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$223,[createBaseVNode(`div`,_hoisted_2$181,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$160,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]))}},TaskMessage_default=__plugin_vue_export_helper_default(_sfc_main$252,[[`__scopeId`,`data-v-657447b0`]]),_hoisted_1$222=[`data-id`],_sfc_main$251={__name:`TaskList`,props:{header:Object,tasks:Array,settings:{type:Object,default:{animate:!1,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmpty:!1,animateOnEmptyIntervalDelay:.2,animateNextTask:!1,taskCompleteCallback:{type:Function,required:!1}}}},setup(__props){let props=__props,animationSettings=inject(`animationSettings`,props.settings),previousTasks=ref(null),internalTasks=ref(null),tasksScroller=ref(null),canAnimate=computed(()=>!(!animationSettings.animate||previousTasks.value===null&&!animationSettings.animateOnMount)),nextTask=computed(()=>internalTasks.value.find(x=>x.type===`goal`&&!x.complete&&x.attention)),onBeforeHeaderLeave=el=>{el.style.animationDelay=`0s`},onBeforeLeave=(el,done)=>{el.style.animationDelay=`0s`},onBeforeEnterTask=el=>{let dataId=el.getAttribute(`data-id`),offset$2=props.header?1:0,delay=previousTasks.value===null||previousTasks.value.length===0?animationSettings.animateOnMountIntervalDelay*(Number(dataId)+offset$2):0;el.style.animationDelay=delay+`s`,requestAnimationFrame(()=>{tasksScroller.value&&(tasksScroller.value.scrollTop=tasksScroller.value.scrollHeight)})};onBeforeMount(()=>{(!internalTasks.value||internalTasks.value.length===0)&&(internalTasks.value=unwrapProxy(props.tasks))}),watch(()=>props.tasks,async(newValue,oldValue)=>{internalTasks.value!==null&&(previousTasks.value=internalTasks.value&&internalTasks.value.length>0?unwrapProxy([...internalTasks.value]):[]),internalTasks.value=unwrapProxy(props.tasks)},{deep:!0});function unwrapProxy(reactiveList){return reactiveList.map(x=>Object.assign({},x))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tasks-container`,{animate:unref(animationSettings).animate}])},[createVNode(Transition,{"enter-active-class":`show`,"leave-active-class":`remove`,css:unref(animationSettings).animate,onBeforeLeave:onBeforeHeaderLeave},{default:withCtx(()=>[__props.header?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-wrapper`,{"show-animate":canAnimate.value}])},[createVNode(TaskHeader_default,mergeProps(__props.header,{class:`header`}),null,16)],2)):createCommentVNode(``,!0)]),_:1},8,[`css`]),createBaseVNode(`div`,{class:`tasks-content`,ref_key:`tasksScroller`,ref:tasksScroller},[createVNode(TransitionGroup,{"enter-active-class":`show`,"leave-active-class":`remove`,css:unref(animationSettings).animate,onBeforeLeave,onBeforeEnter:onBeforeEnterTask},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(internalTasks.value,(task,index)=>(openBlock(),createElementBlock(`div`,{key:task.id,class:normalizeClass([`task-wrapper`,{"show-animate":canAnimate.value,"remove-animate":canAnimate.value}]),"data-id":index},[task.type===`message`?(openBlock(),createBlock(TaskMessage_default,mergeProps({key:0,ref_for:!0},task,{class:`task-card`}),null,16)):task.type===`goal`?(openBlock(),createBlock(TaskGoal_default,mergeProps({key:1,ref_for:!0},task,{class:[`task-card`,{glow:unref(animationSettings).animateNextTask&&nextTask.value&&nextTask.value.id===task.id}]}),null,16,[`class`])):createCommentVNode(``,!0)],10,_hoisted_1$222))),128))]),_:1},8,[`css`])],512)],2))}},TaskList_default=__plugin_vue_export_helper_default(_sfc_main$251,[[`__scopeId`,`data-v-5118e548`]]);const useTasksStore=defineStore(`tasks`,()=>{let header=ref(null),tasks=ref([]),{$game}=useLibStore();$game.events.on(`SetTasklistHeader`,setTasklistHeader),$game.events.on(`SetTasklistTask`,setTasklistTask),$game.events.on(`UpdateTasklistItem`,updateTasklistItem),$game.events.on(`SortTasklistItems`,sortTasklistItems),$game.events.on(`CompleteTasklistGoal`,id=>updateTasklistItem(id,{complete:!0,success:!0})),$game.events.on(`FailTasklistGoal`,id=>updateTasklistItem(id,{complete:!0,success:!1})),$game.events.on(`DiscardTasklistItem`,discardTasklistItem),$game.events.on(`HighlightTasklistItem`,highlightTasklistItem),$game.events.on(`HideCareerTasklist`,hideCareerTasklist),$game.events.on(`ClearTasklist`,clearTasklist);function setTasklistHeader(data){data==null||data==``?header.value=null:header.value={title:data.label,description:data.subtext}}function setTasklistTask(data){let id=data.id===null||data.id===void 0?`default`:data.id,index=tasks.value.findIndex(x=>x.id===id);if(index===-1&&data.clear)return;if(data.clear){tasks.value.splice(index,1);return}let isComplete=data.done!==void 0&&data.done||data.fail!==void 0&&data.fail,isSuccess=data.done!==void 0&&data.done||data.fail!==void 0&&!data.fail,description=data.subtext===0?``:data.subtext;index===-1?tasks.value.push({id:data.id,label:data.label,description,type:data.type,attention:data.attention,complete:isComplete,success:isSuccess}):(tasks.value[index].attention=data.attention,tasks.value[index].complete=isComplete,tasks.value[index].success=isSuccess,data.subtext!==void 0&&(tasks.value[index].description=description),data.label!==void 0&&(tasks.value[index].label=data.label),data.type!==void 0&&(tasks.value[index].type=data.type))}function updateTasklistItem(id,data){let index=tasks.value.findIndex(task=>task.id===id);index!==-1&&Object.keys(data).forEach(key=>{tasks.value[index][key]!==void 0&&(tasks.value[index][key]=data[key])})}function sortTasklistItems(order){let inOrderTasks=[],notInOrderTasks=[];tasks.value.forEach(task=>{order.includes(task.id)?inOrderTasks.push(task):notInOrderTasks.push(task)}),inOrderTasks.sort((a$1,b)=>order.indexOf(a$1.id)-order.indexOf(b.id)),tasks.value=[...inOrderTasks,...notInOrderTasks]}function discardTasklistItem(id,delay){delay!==void 0&&delay>0?setTimeout(()=>{setTasklistTask({id,clear:!0})},delay*1e3):setTasklistTask({id,clear:!0})}function highlightTasklistItem(id,duration){setTasklistTask({id,attention:!0}),duration!==void 0&&duration>0&&setTimeout(()=>{setTasklistTask({id,attention:!1})},duration*1e3)}function hideCareerTasklist(){}function clearTasklist(){header.value=null,tasks.value=[]}return{header,tasks,hasItems:computed(()=>tasks.value.length>0||header.value!==null)}});var _hoisted_1$221={class:`heading-container`},_hoisted_2$180={key:0,class:`status-add`},_hoisted_3$159={class:`content-container`},_hoisted_4$134={class:`main-content`},_hoisted_5$117={class:`main-content-slotted`},_hoisted_6$100={class:`side-content-slotted`},_sfc_main$250={__name:`ComputerWrapper`,props:{title:{type:String,default:`My Computer`},path:Array,wallpaperFull:Boolean,wallpaperHalf:Boolean,back:Boolean,close:Boolean},emits:[`back`,`close`],setup(__props,{expose:__expose,emit:__emit}){useUINavScope(`computer`);let{$game}=useLibStore(),computerStore=useComputerStore(),props=__props,breadcrumbItems=computed(()=>[{label:`Career`,closeAllMenus:!0},{label:computerStore.computerData.facilityName},...(props.path||[]).map(path=>({label:path}))]),elStatus=ref(),store$1=useTasksStore();provide(`animationSettings`,{animate:!0,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmptyIntervalDelay:.1,animateOnEmpty:!0,animateNextTask:!0,successCallback:playAudio});function playAudio(){$game.lua.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Checkbox`)}__expose({statusUpdate:()=>elStatus.value.updateDisplay()});function breadcrumbClick(item){item.closeAllMenus&&$game.lua.career_career.closeAllMenus()}let emit$1=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{"bng-ui-scope":`computer`,class:`computer-wrapper-layout`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$221,[createVNode(unref(bngScreenHeadingV2_default),{type:`2`},{preheadings:withCtx(()=>[createVNode(bngBreadcrumbs_default,{class:`breadcrumbs`,simple:``,"disable-last-item":``,"show-back-button":``,navigable:!1,onClick:breadcrumbClick,onBack:_cache[0]||=$event=>emit$1(`back`),items:breadcrumbItems.value},null,8,[`items`])]),default:withCtx(()=>[renderSlot(_ctx.$slots,`title`,{},()=>[createTextVNode(toDisplayString(__props.title),1)],!0)]),_:3}),withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default),{ref_key:`elStatus`,ref:elStatus},null,512),_ctx.$slots.status?(openBlock(),createElementBlock(`div`,_hoisted_2$180,[renderSlot(_ctx.$slots,`status`,{},void 0,!0)])):createCommentVNode(``,!0)]),_:3})),[[unref(BngBlur_default),!0]])]),createBaseVNode(`div`,_hoisted_3$159,[createBaseVNode(`div`,_hoisted_4$134,[createBaseVNode(`div`,_hoisted_5$117,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),createBaseVNode(`div`,_hoisted_6$100,[createVNode(unref(TaskList_default),{class:`task-list`,header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`]),renderSlot(_ctx.$slots,`side`,{},void 0,!0)])])])]),_:3})),[[unref(BngOnUiNav_default),()=>emit$1(`back`),`back`]])}},ComputerWrapper_default=__plugin_vue_export_helper_default(_sfc_main$250,[[`__scopeId`,`data-v-b7460ee1`]]),_hoisted_1$220={class:`indicators-overlay`},_hoisted_2$179={class:`performance-index`},_hoisted_3$158={key:0,class:`lock-reason`},_hoisted_4$133={key:1,class:`lock-time`},_hoisted_5$116={key:1,class:`valueReduced`},_hoisted_6$99={key:0,class:`content`},_hoisted_7$87={class:`header`},_hoisted_8$72={class:`title-section`},_hoisted_9$65={class:`name`},_hoisted_10$56={class:`details`},_hoisted_11$50={class:`location-section`},_hoisted_12$39={class:`location-value`},_hoisted_13$32={key:0,class:`value-section`},_hoisted_14$30={key:0,class:`value-label reduced`},_hoisted_15$29={key:1,class:`value-label`},_hoisted_16$29={key:2,class:`total-value`},_hoisted_17$23={class:`insurance-section`},_hoisted_18$20={class:`insurance-value`},_hoisted_19$17={key:0,class:`warn`},_sfc_main$249=Object.assign({width:100,margin:.25},{__name:`VehicleTileRow`,props:{data:Object,isTutorial:Boolean,selected:Boolean,enableHover:{type:Boolean,default:!0},small:Boolean},setup(__props){let{units}=useBridge(),props=__props,partConditionAvg=computed(()=>{if(!props.data)return 1;if(props.data.partConditions){let conds=Object.values(props.data.partConditions);return conds.reduce((i,c)=>i+c.integrityValue,0)/conds.length}return 1}),colour=computed(()=>props.data?.config?.paints?.[0]?.baseColor??`#ccc`),thumbUrl=computed(()=>props.data.thumbnail?`${props.data.thumbnail}?${props.data.dirtyDate}`:null),location$1=computed(()=>{let res;return res=locked.value&&!locked.value.location?locked.value.reason:props.data.inGarage?`In garage`:props.data.distance?`${units.buildString(`length`,props.data.distance,0)} away`:`Storage`,res}),locked=computed(()=>{let res;if(props.data._message)res={reason:props.data._message};else if(props.data.missingFile)res={reason:`Missing File!`};else if(props.data.timeToAccess){let eta=`${~~(props.data.timeToAccess/60)}:${String(~~props.data.timeToAccess%60).padStart(2,`0`)}`;res=props.data.delayReason===`bought`?{reason:`Out for delivery`,eta}:props.data.delayReason===`repair`?{reason:`Being repaired`,eta}:{reason:`Available in`,eta}}else props.data.needsRepair&&(res={reason:`Needs repair`,location:!0});return res});return(_ctx,_cache)=>__props.data?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass({"vehicle-tile-row":!0,selected:__props.selected,"hover-enabled":__props.enableHover}),role:`button`},[createBaseVNode(`div`,{class:normalizeClass({preview:!0,locked:locked.value,small:__props.small})},[thumbUrl.value?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,ratio:`16:9`,"external-image":thumbUrl.value,class:`preview-image`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$220,[__props.data.favorite?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).star,color:`#fd0`},null,8,[`type`])),[[unref(BngTooltip_default),`Favourite`]]):createCommentVNode(``,!0),__props.data.delayReason===`repair`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).wrench,color:`#fff`},null,8,[`type`])):(openBlock(),createBlock(unref(bngCondition_default),{key:2,integrity:partConditionAvg.value,"integrity-warning":__props.data.needsRepair,color:colour.value,"show-tooltip":``},null,8,[`integrity`,`integrity-warning`,`color`])),createBaseVNode(`div`,_hoisted_2$179,toDisplayString(__props.data.certificationData&&__props.data.certificationData.vehicleClass?__props.data.certificationData.vehicleClass.performanceIndex.toFixed(0):`N/A`),1)]),locked.value?(openBlock(),createElementBlock(`span`,_hoisted_3$158,toDisplayString(locked.value.reason),1)):createCommentVNode(``,!0),locked.value&&locked.value.eta?(openBlock(),createElementBlock(`span`,_hoisted_4$133,toDisplayString(locked.value.eta),1)):createCommentVNode(``,!0)]),_:1},8,[`external-image`])):createCommentVNode(``,!0),!(__props.data.returnLoanerPermission&&__props.data.returnLoanerPermission.allow)&&__props.data.partConditionAvg<1?(openBlock(),createElementBlock(`span`,_hoisted_5$116,`Value reduced!`)):createCommentVNode(``,!0),__props.data.isInsured?createCommentVNode(``,!0):(openBlock(),createBlock(insurancePerkIcon_default,{key:2,class:`not-insured-overlay`,perkIconData:{iconOnly:__props.data.isInsured,color:`red`,smallText:`Not insured`}},null,8,[`perkIconData`]))],2),__props.data._message?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$99,[createBaseVNode(`div`,_hoisted_7$87,[createBaseVNode(`div`,_hoisted_8$72,[createBaseVNode(`div`,_hoisted_9$65,toDisplayString(__props.data.niceName),1)])]),createBaseVNode(`div`,_hoisted_10$56,[createBaseVNode(`div`,_hoisted_11$50,[_cache[0]||=createBaseVNode(`span`,{class:`location-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_12$39,toDisplayString(location$1.value),1)]),__props.data.returnLoanerPermission?.allow?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_13$32,[partConditionAvg.value<1?(openBlock(),createElementBlock(`span`,_hoisted_14$30,`Current Value:`)):(openBlock(),createElementBlock(`span`,_hoisted_15$29,`Value:`)),createVNode(unref(bngUnit_default),{money:__props.data.value},null,8,[`money`]),partConditionAvg.value<1?(openBlock(),createElementBlock(`div`,_hoisted_16$29,[_cache[1]||=createTextVNode(` Total Value: `,-1),createVNode(unref(bngUnit_default),{money:__props.data.valueRepaired},null,8,[`money`])])):createCommentVNode(``,!0)])),createBaseVNode(`div`,_hoisted_17$23,[_cache[2]||=createBaseVNode(`span`,{class:`insurance-label`},`Insurance:`,-1),createBaseVNode(`span`,_hoisted_18$20,toDisplayString(__props.data.insuranceInfo?__props.data.insuranceInfo.name:`n/a`),1),__props.data.isInsured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$17,`Not Insured!`))])])]))],2)),[[unref(BngDisabled_default),__props.data.disabled]]):createCommentVNode(``,!0)}}),VehicleTileRow_default=__plugin_vue_export_helper_default(_sfc_main$249,[[`__scopeId`,`data-v-777a3003`]]),_hoisted_1$219={key:1,class:`computer-actions`},_hoisted_2$178={key:0,class:`vehicle-select-container`},_hoisted_3$157={class:`vehicle-select`},_hoisted_4$132={key:0,class:`actions-list`},_hoisted_5$115=[`onClick`,`onMouseover`,`onFocus`],_hoisted_6$98={class:`label`},_hoisted_7$86={key:1,class:`no-vehicle-container`},_hoisted_8$71={key:2,class:`action-header`},_hoisted_9$64={key:3,class:`general-functions-container`},_hoisted_10$55={class:`actions-list`},_hoisted_11$49=[`onClick`,`onMouseover`,`onFocus`],_hoisted_12$38={class:`label`},_hoisted_13$31={key:0,class:`disable-reason`},_hoisted_14$29=[`innerHTML`],_hoisted_15$28={key:1,class:`disable-reason`},_hoisted_16$28=[`innerHTML`],_sfc_main$248={__name:`ComputerMain`,setup(__props){let computerStore=useComputerStore(),currentVehicleData=ref(null);watch(()=>computerStore.activeInventoryId,newId=>{Number(newId)&&Lua_default.career_modules_inventory.getVehicleUiData(newId).then(data=>{currentVehicleData.value=data})});let showVehicleSelectorButtons=computed(()=>computerStore.computerData.vehicles&&computerStore.computerData.vehicles.length>1),hasVehicles=computed(()=>computerStore.computerData.vehicles&&computerStore.computerData.vehicles.length);computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].vehicleName:``),computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].thumbnail:``),computed(()=>hasVehicles.value?computerStore.computerData.vehicles[computerStore.activeVehicleIndex].needsRepair?`Assess Performance (Repair Required)`:`Assess Performance`:``);let slowFunctions=[`vehicleShop`,`partInventory`],computerLoading=ref(!1),computerButtonCallback=(computerFunction,inventoryId=void 0)=>{computerFunction.disabled||(slowFunctions.includes(computerFunction.id)?(computerLoading.value=!0,setTimeout(()=>computerStore.computerButtonCallback(computerFunction.id,inventoryId),100)):computerStore.computerButtonCallback(computerFunction.id,inventoryId))},switchActiveVehicle=computerStore.switchActiveVehicle,iconById={painting:icons.sprayCan,partShop:icons.doorFrontCoins,repair:icons.wrench,tuning:icons.cogs,insurances:icons.shieldHandCheckmark,playerAbstract:icons.personSolid,vehicleInventory:icons.keys1,partInventory:icons.engine,vehicleShop:icons.carCoins,performanceIndex:icons.raceFlag},infoById=computed(()=>[...computerStore.generalComputerFunctions,...(computerStore.activeInventoryId?computerStore.vehicleSpecificComputerFunctions[computerStore.activeInventoryId]:void 0)||[]].reduce((res,func)=>(res[func.id]={icon:iconById[func.id]||icons.bug,label:func.label,reason:void 0},func.reason&&(res[func.id].label+=` *`,res[func.id].reason=func.reason.label),res),{})),isTutorialActive=ref(!1),disableReason=ref([null,null]),setReason=(idx,reason=null)=>{disableReason.value[idx]=reason,disableReason.value[(idx+1)%2]=null},close=()=>{computerLoading.value||Lua_default.career_career.closeAllMenus()};return onMounted(async()=>{getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar),computerStore.requestComputerData(),Number(computerStore.activeInventoryId)&&Lua_default.career_modules_inventory.getVehicleUiData(computerStore.activeInventoryId).then(data=>{currentVehicleData.value=data}),Lua_default.career_modules_linearTutorial.isLinearTutorialActive().then(data=>{isTutorialActive.value=data})}),onUnmounted(()=>{computerStore.onMenuClosed(),getUINavServiceInstance().clearFilteredEvents(),computerStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{title:unref(computerStore).computerData.facilityName+` - Home screen`,close:``,onBack:close},{default:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`card-content`},{default:withCtx(()=>[computerLoading.value?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Loading... `,-1)]]),_:1})):createCommentVNode(``,!0),computerLoading.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$219,[_cache[9]||=createBaseVNode(`div`,{class:`action-header`},[createBaseVNode(`div`,{class:`line left`}),createBaseVNode(`div`,{class:`title`},`Vehicle Management`),createBaseVNode(`div`,{class:`line right`})],-1),hasVehicles.value?(openBlock(),createElementBlock(`div`,_hoisted_2$178,[createBaseVNode(`div`,_hoisted_3$157,[showVehicleSelectorButtons.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,style:{height:`3em`},accent:unref(ACCENTS).ghost,onClick:_cache[0]||=$event=>unref(switchActiveVehicle)(-1),icon:unref(icons).arrowLargeLeft},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`tab_l`,deviceMask:`xinput`})]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`tab_l`,{asMouse:!0}]]):createCommentVNode(``,!0),createVNode(VehicleTileRow_default,{class:normalizeClass([`vehicle-tile-row`,{hasButtons:showVehicleSelectorButtons.value}]),data:currentVehicleData.value,enableHover:!1,small:!0},null,8,[`class`,`data`]),showVehicleSelectorButtons.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,style:{height:`3em`},accent:unref(ACCENTS).ghost,onClick:_cache[1]||=$event=>unref(switchActiveVehicle)(1),icon:unref(icons).arrowLargeRight},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`tab_r`,deviceMask:`xinput`})]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`tab_r`,{asMouse:!0}]]):createCommentVNode(``,!0)]),unref(computerStore).activeInventoryId&&unref(computerStore).vehicleSpecificComputerFunctions[unref(computerStore).activeInventoryId]?(openBlock(),createElementBlock(`div`,_hoisted_4$132,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(computerStore).vehicleSpecificComputerFunctions[unref(computerStore).activeInventoryId],(computerFunction,index)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`computer-function-tile`,{"action-disabled":computerFunction.disabled}]),key:computerFunction.id,tabindex:`0`,"bng-nav-item":``,onClick:$event=>computerButtonCallback(computerFunction,unref(computerStore).activeInventoryId),onMouseover:$event=>setReason(0,infoById.value[computerFunction.id].reason),onFocus:$event=>setReason(0,infoById.value[computerFunction.id].reason),onMouseleave:_cache[2]||=$event=>setReason(0),onBlur:_cache[3]||=$event=>setReason(0)},[createVNode(unref(bngIcon_default),{class:`icon`,type:infoById.value[computerFunction.id].icon},null,8,[`type`]),createBaseVNode(`span`,_hoisted_6$98,toDisplayString(infoById.value[computerFunction.id].label),1)],42,_hoisted_5$115)),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),index==0?0:void 0]])),128))])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_7$86,[..._cache[7]||=[createBaseVNode(`span`,null,`No vehicles in garage.`,-1),createBaseVNode(`p`,null,` Place a vehicle in your garage to access modify and manage it.`,-1)]])),unref(computerStore).generalComputerFunctions?(openBlock(),createElementBlock(`div`,_hoisted_8$71,[..._cache[8]||=[createBaseVNode(`div`,{class:`line left`},null,-1),createBaseVNode(`div`,{class:`title`},`General Computer Functions`,-1),createBaseVNode(`div`,{class:`line right`},null,-1)]])):createCommentVNode(``,!0),unref(computerStore).generalComputerFunctions?(openBlock(),createElementBlock(`div`,_hoisted_9$64,[createBaseVNode(`div`,_hoisted_10$55,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(computerStore).generalComputerFunctions,(computerFunction,index)=>(openBlock(),createElementBlock(Fragment,{key:computerFunction.id},[computerFunction.type?createCommentVNode(``,!0):withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`computer-function-tile`,{"action-disabled":computerFunction.disabled}]),tabindex:`0`,"bng-nav-item":``,onClick:$event=>computerButtonCallback(computerFunction),onMouseover:$event=>setReason(1,infoById.value[computerFunction.id].reason),onFocus:$event=>setReason(1,infoById.value[computerFunction.id].reason),onMouseleave:_cache[4]||=$event=>setReason(1),onBlur:_cache[5]||=$event=>setReason(1)},[createVNode(unref(bngIcon_default),{class:`icon`,type:infoById.value[computerFunction.id].icon},null,8,[`type`]),createBaseVNode(`span`,_hoisted_12$38,toDisplayString(infoById.value[computerFunction.id].label),1)],42,_hoisted_11$49)),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),!hasVehicles.value&&index==0?0:void 0]])],64))),128))]),disableReason.value[0]?(openBlock(),createElementBlock(`div`,_hoisted_13$31,[withDirectives(createVNode(unref(bngIcon_default),{class:`disable-icon`,type:unref(icons).info},null,8,[`type`]),[[vShow,disableReason.value[0]]]),createBaseVNode(`span`,{innerHTML:disableReason.value[0]||`\xA0`},null,8,_hoisted_14$29)])):createCommentVNode(``,!0),disableReason.value[1]?(openBlock(),createElementBlock(`div`,_hoisted_15$28,[createVNode(unref(bngIcon_default),{class:`disable-icon`,type:unref(icons).info},null,8,[`type`]),createBaseVNode(`span`,{innerHTML:disableReason.value[1]||`\xA0`},null,8,_hoisted_16$28)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]))]),_:1})),[[unref(BngBlur_default),1]])]),_:1},8,[`title`]))}},ComputerMain_default=__plugin_vue_export_helper_default(_sfc_main$248,[[`__scopeId`,`data-v-10a4ce58`]]);const useInsurancesStore=defineStore(`insurances`,()=>{let{events:events$3}=useBridge(),invVehsInsurancesData=ref({}),plClassesData=ref({}),uninsuredVehsData=ref({}),driverScoreData=ref({});function requestInitialData(){Lua_default.career_modules_insurance_insurance.sendUIData()}return events$3.on(`insurancesData`,data=>{invVehsInsurancesData.value=data.invVehsInsurancesData,plClassesData.value=data.plClassesData,uninsuredVehsData.value=data.uninsuredVehsData,driverScoreData.value=data.driverScoreData}),{dispose:()=>{events$3.off(`insurancesData`)},requestInitialData,closeMenu:Lua_default.career_modules_insurance_insurance.closeMenu,invVehsInsurancesData,plClassesData,uninsuredVehsData,driverScoreData}});var _hoisted_1$218={key:0,class:`cards-wrapper blue-background`},_hoisted_2$177={class:`insurance-tiers-wrapper`},_hoisted_3$156=[`onClick`],_hoisted_4$131={class:`insurance-tier-card-name`},_hoisted_5$114={class:`insurance-tier-card-description`},_hoisted_6$97={class:`insurance-tier-card-cars-insured`},_hoisted_7$85={class:`left-no-insurance`},_hoisted_8$70={class:`no-insurance-text-wrapper`},_hoisted_9$63={class:`no-insurance-title`},_hoisted_10$54={class:`no-insurance-description`},_hoisted_11$48={class:`uninsured-count`},_hoisted_12$37={key:1,class:`small-insurance-cards-wrapper blue-background`},_sfc_main$247={__name:`InsurancesMain`,setup(__props){useComputerStore();let insurancesStore=useInsurancesStore(),selectedInsuranceClassId=ref(null),selectInsuranceClass=classId=>{selectedInsuranceClassId.value=classId},sortedInsuranceClasses=computed(()=>{let classes=insurancesStore.plClassesData;return classes?Object.entries(classes).map(([classId,classData])=>({classId,classData})).sort((a$1,b)=>a$1.classData.priority-b.classData.priority):[]});onBeforeMount(()=>{insurancesStore.requestInitialData()}),onUnmounted(()=>{Lua_default.extensions.hook(`onExitInsurancesComputerScreen`),insurancesStore.$dispose()});let close=()=>{selectedInsuranceClassId.value?selectedInsuranceClassId.value=null:insurancesStore.closeMenu()},openUninsuredVehicles=()=>{addPopup(uninsuredVehicles_default,{uninsuredData:insurancesStore.uninsuredVehsData})};return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,path:[`Insurance`],title:`Insurance`,back:``,onBack:close},{default:withCtx(()=>[createVNode(unref(bngCard_default),{class:`insurances-card blue-background`},{default:withCtx(()=>[selectedInsuranceClassId.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$218,[createBaseVNode(`div`,_hoisted_2$177,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedInsuranceClasses.value,({classId,classData})=>(openBlock(),createElementBlock(`div`,{class:`insurance-tier-card`,key:classId,onClick:$event=>selectInsuranceClass(classId)},[createVNode(unref(bngIcon_default),{class:`insurance-icon`,type:unref(icons)[classData.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_4$131,toDisplayString(classData.name),1),createBaseVNode(`div`,_hoisted_5$114,toDisplayString(classData.description),1),createBaseVNode(`div`,_hoisted_6$97,toDisplayString(classData.carsInsured)+` VEHICLES INSURED `,1)],8,_hoisted_3$156))),128))]),createBaseVNode(`div`,{class:`no-insurance-card`,onClick:openUninsuredVehicles},[createBaseVNode(`div`,_hoisted_7$85,[createVNode(unref(bngIcon_default),{class:`no-insurance-icon`,type:unref(icons).checkmark},null,8,[`type`]),createBaseVNode(`div`,_hoisted_8$70,[createBaseVNode(`div`,_hoisted_9$63,toDisplayString(unref(insurancesStore).uninsuredVehsData.title),1),createBaseVNode(`div`,_hoisted_10$54,toDisplayString(unref(insurancesStore).uninsuredVehsData.description),1)])]),createBaseVNode(`div`,_hoisted_11$48,toDisplayString(unref(insurancesStore).uninsuredVehsData.carsUninsuredCount)+` vehicles `,1)])])),selectedInsuranceClassId.value?(openBlock(),createElementBlock(`div`,_hoisted_12$37,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(insurancesStore).plClassesData[selectedInsuranceClassId.value].insurances,insurance=>(openBlock(),createBlock(unref(smallInsuranceCard_default),{key:insurance.id,insuranceData:insurance,driverScoreData:unref(insurancesStore).driverScoreData},null,8,[`insuranceData`,`driverScoreData`]))),128))])):createCommentVNode(``,!0)]),_:1})]),_:1},512))}},InsurancesMain_default=__plugin_vue_export_helper_default(_sfc_main$247,[[`__scopeId`,`data-v-a9e49ad5`]]),_hoisted_1$217={key:0,class:`content`},_hoisted_2$176={class:`stats-grid-3`},_hoisted_3$155={class:`score-header`},_hoisted_4$130={class:`score-content`},_hoisted_5$113={class:`score-info`},_hoisted_6$96={class:`score-description`},_hoisted_7$84={class:`stat-card`},_hoisted_8$69={class:`stat-value blue`},_hoisted_9$62={class:`stat-card`},_hoisted_10$53={class:`stats-grid-2`},_hoisted_11$47={class:`info-card`},_hoisted_12$36={class:`info-rows`},_hoisted_13$30={class:`info-row`},_hoisted_14$28={class:`info-value orange`},_hoisted_15$27={class:`info-row`},_hoisted_16$27={class:`info-value green`},_hoisted_17$22={class:`info-row total`},_hoisted_18$19={class:`info-value`},_hoisted_19$16={class:`info-card`},_hoisted_20$14={class:`info-rows`},_hoisted_21$13={class:`info-row bottom-border`},_hoisted_22$11={class:`info-value blue`},_hoisted_23$10={class:`info-row`},_hoisted_24$9={class:`info-value red`},_hoisted_25$8={class:`info-row`},_hoisted_26$6={class:`info-value orange`},_hoisted_27$6={class:`info-row`},_hoisted_28$5={class:`info-value yellow`},_hoisted_29$5={class:`info-row total`},_hoisted_30$5={class:`info-value`},_hoisted_31$5={class:`info-summary`},_hoisted_32$5={class:`info-row small`},_hoisted_33$5={class:`info-value green bold`},_hoisted_34$5={class:`reset-card`},_hoisted_35$4={class:`reset-content`},_hoisted_36$4={class:`reset-description`},_hoisted_37$3={class:`highlight`},_hoisted_38$3={class:`reset-details`},_hoisted_39$3={class:`reset-row`},_hoisted_40$2={class:`reset-row`},_hoisted_41$2={class:`reset-value green`},_hoisted_42$2={class:`reset-row cost`},_hoisted_43$2={class:`reset-value yellow large`},_hoisted_44$2={key:0,class:`reset-payback`},_hoisted_45$2=[`disabled`],_sfc_main$246={__name:`DriverAbstract`,setup(__props){let{units}=useBridge(),abstractData=ref(null),driverTier=computed(()=>abstractData.value?.driverScoreTier),totalDistanceFormatted=computed(()=>abstractData.value?units.buildString(`length`,abstractData.value.totalDistanceDriven,0):``),premiumEffectClass=computed(()=>{if(!driverTier.value)return``;let multiplier=driverTier.value.multiplier;return multiplier<1?`green`:multiplier>1?`red`:`neutral`}),premiumEffectText=computed(()=>{if(!driverTier.value)return`Standard Rate`;let multiplier=driverTier.value.multiplier;return multiplier<1?`${Math.round((1-multiplier)*100)}% Savings`:multiplier>1?`${Math.round((multiplier-1)*100)}% Penalty`:`Standard Rate`}),canResetScore=computed(()=>abstractData.value?abstractData.value.driverScore{if(!driverTier.value)return`green`;let multiplier=driverTier.value.multiplier;return multiplier<1?`blue`:multiplier<1.1?`green`:multiplier<1.3?`yellow`:multiplier<1.5?`orange`:`red`},getDriverColor=()=>({blue:`var(--blue-200)`,green:`var(--green-300)`,yellow:`var(--yellow-400)`,orange:`var(--orange-shade-10)`,red:`var(--red-400)`})[getDriverColorClass()]||`var(--green-300)`,loadData=async()=>{try{abstractData.value=await Lua_default.career_modules_playerAbstract.getPlayerAbstractData()}catch(error){console.error(`Failed to load driver abstract data:`,error)}},resetDriverScore=async()=>{try{await Lua_default.career_modules_insurance_insurance.resetDriverScore(),await loadData()}catch(error){console.error(`Failed to reset driver score:`,error)}},close=()=>{Lua_default.career_modules_playerAbstract.closePlayerAbstractMenu()};return onBeforeMount(loadData),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,path:[`Driver's Abstract`],title:`Driver's Abstract`,back:``,onBack:close},{default:withCtx(()=>[createVNode(unref(bngCard_default),{class:`driver-abstract-card`},{default:withCtx(()=>[abstractData.value?(openBlock(),createElementBlock(`div`,_hoisted_1$217,[createBaseVNode(`div`,_hoisted_2$176,[createBaseVNode(`div`,{class:`score-card`,style:normalizeStyle({borderColor:getDriverColor()})},[createBaseVNode(`div`,_hoisted_3$155,[_cache[0]||=createBaseVNode(`div`,{class:`section-title`},`Driver Score: Out of 100`,-1),createVNode(unref(TutorialButton_default),{icon:unref(icons).help,pages:[`driverScore`]},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_4$130,[createBaseVNode(`div`,{class:normalizeClass([`score-value`,getDriverColorClass()])},toDisplayString(abstractData.value.driverScore),3),createBaseVNode(`div`,_hoisted_5$113,[createBaseVNode(`div`,{class:normalizeClass([`score-risk`,getDriverColorClass()])},toDisplayString(abstractData.value.driverScoreTier.risk),3),createBaseVNode(`div`,_hoisted_6$96,toDisplayString(abstractData.value.driverScoreTier.description),1)])])],4),createBaseVNode(`div`,_hoisted_7$84,[_cache[1]||=createBaseVNode(`div`,{class:`section-title`},`Total Distance Driven`,-1),createBaseVNode(`div`,_hoisted_8$69,toDisplayString(totalDistanceFormatted.value),1)]),createBaseVNode(`div`,_hoisted_9$62,[_cache[2]||=createBaseVNode(`div`,{class:`section-title`},`Premium Effect`,-1),createBaseVNode(`div`,{class:normalizeClass([`stat-value`,premiumEffectClass.value])},toDisplayString(premiumEffectText.value),3),_cache[3]||=createBaseVNode(`div`,{class:`stat-note`},` Applies to every insurance provider when premiums renew `,-1)])]),createBaseVNode(`div`,_hoisted_10$53,[createBaseVNode(`div`,_hoisted_11$47,[_cache[7]||=createBaseVNode(`div`,{class:`section-title`},`Repair History`,-1),createBaseVNode(`div`,_hoisted_12$36,[createBaseVNode(`div`,_hoisted_13$30,[_cache[4]||=createBaseVNode(`span`,{class:`info-label`},`Insurance Claims:`,-1),createBaseVNode(`span`,_hoisted_14$28,toDisplayString(abstractData.value.repairHistory.insuranceRepairs),1)]),createBaseVNode(`div`,_hoisted_15$27,[_cache[5]||=createBaseVNode(`span`,{class:`info-label`},`Private Repairs:`,-1),createBaseVNode(`span`,_hoisted_16$27,toDisplayString(abstractData.value.repairHistory.privateRepairs),1)]),createBaseVNode(`div`,_hoisted_17$22,[_cache[6]||=createBaseVNode(`span`,{class:`info-label`},`Total Repairs:`,-1),createBaseVNode(`span`,_hoisted_18$19,toDisplayString(abstractData.value.repairHistory.insuranceRepairs+abstractData.value.repairHistory.privateRepairs),1)])]),_cache[8]||=createBaseVNode(`div`,{class:`info-tip`},` Private repairs don't affect your record `,-1)]),createBaseVNode(`div`,_hoisted_19$16,[_cache[16]||=createBaseVNode(`div`,{class:`section-title`},`Financial Summary`,-1),createBaseVNode(`div`,_hoisted_20$14,[createBaseVNode(`div`,_hoisted_21$13,[_cache[9]||=createBaseVNode(`span`,{class:`info-label`},`Vehicles Currently Insured:`,-1),createBaseVNode(`span`,_hoisted_22$11,toDisplayString(abstractData.value.financialSummary.vehiclesInsuredCount),1)]),createBaseVNode(`div`,_hoisted_23$10,[_cache[10]||=createBaseVNode(`span`,{class:`info-label`},`Premiums Paid:`,-1),createBaseVNode(`span`,_hoisted_24$9,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPremiumPaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_25$8,[_cache[11]||=createBaseVNode(`span`,{class:`info-label`},`Deductibles Paid:`,-1),createBaseVNode(`span`,_hoisted_26$6,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalDeductiblePaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_27$6,[_cache[12]||=createBaseVNode(`span`,{class:`info-label`},`Private Repairs:`,-1),createBaseVNode(`span`,_hoisted_28$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPrivateRepairsPaid},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_29$5,[_cache[13]||=createBaseVNode(`span`,{class:`info-label`},`Total Spent:`,-1),createBaseVNode(`span`,_hoisted_30$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.totalPaid},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_31$5,[createBaseVNode(`div`,_hoisted_32$5,[_cache[14]||=createBaseVNode(`span`,{class:`info-label`},`Damage Covered by Insurance:`,-1),createBaseVNode(`span`,_hoisted_33$5,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.financialSummary.damageCoveredByInsurance},null,8,[`money`])])]),_cache[15]||=createBaseVNode(`div`,{class:`info-tip blue italic`},` Insurance saved you from paying full repair costs `,-1)])])]),createBaseVNode(`div`,_hoisted_34$5,[_cache[22]||=createBaseVNode(`div`,{class:`section-title`},`Driver Score Reset`,-1),createBaseVNode(`div`,_hoisted_35$4,[createBaseVNode(`p`,_hoisted_36$4,[_cache[17]||=createTextVNode(` Reset your driver score to `,-1),createBaseVNode(`span`,_hoisted_37$3,toDisplayString(abstractData.value.driverScoreReset.resetTo),1),_cache[18]||=createTextVNode(` to remove premium penalties. `,-1)]),createBaseVNode(`div`,_hoisted_38$3,[createBaseVNode(`div`,_hoisted_39$3,[_cache[19]||=createBaseVNode(`span`,{class:`reset-label`},`Current Score:`,-1),createBaseVNode(`span`,{class:normalizeClass([`reset-value`,canResetScore.value?`red`:`green`])},toDisplayString(abstractData.value.driverScore),3)]),createBaseVNode(`div`,_hoisted_40$2,[_cache[20]||=createBaseVNode(`span`,{class:`reset-label`},`Reset To:`,-1),createBaseVNode(`span`,_hoisted_41$2,toDisplayString(abstractData.value.driverScoreReset.resetTo),1)]),createBaseVNode(`div`,_hoisted_42$2,[_cache[21]||=createBaseVNode(`span`,{class:`reset-label`},`Reset Cost:`,-1),createBaseVNode(`span`,_hoisted_43$2,[createVNode(unref(bngUnit_default),{class:`no-margin`,money:abstractData.value.driverScoreReset.resetCost},null,8,[`money`])])]),canResetScore.value&&_ctx.resetSavingsPer100km>0?(openBlock(),createElementBlock(`div`,_hoisted_44$2,` Pays for itself after xxx km `)):createCommentVNode(``,!0)]),createBaseVNode(`button`,{onClick:resetDriverScore,disabled:!canResetScore.value,class:normalizeClass([`reset-button`,{disabled:!canResetScore.value}])},toDisplayString(canResetScore.value?`Reset Score`:`Not Available (Score Already at or Higher than `+abstractData.value.driverScoreReset.resetTo+`)`),11,_hoisted_45$2)])])])):createCommentVNode(``,!0)]),_:1})]),_:1},512))}},DriverAbstract_default=__plugin_vue_export_helper_default(_sfc_main$246,[[`__scopeId`,`data-v-8041df87`]]),_hoisted_1$216={"bng-ui-scope":`logbook`,class:`career-logbook-wrapper`},_hoisted_2$175={class:`career-logbook-container`},_hoisted_3$154={class:`career-logbook-list`},_hoisted_4$129={class:`logbook-list-wrapper`},_hoisted_5$112=[`onClick`],_hoisted_6$95={class:`career-logbook-item-content`},_hoisted_7$83={class:`career-logbook-meta`},_hoisted_8$68={class:`career-logbook-newmark`},_hoisted_9$61={class:`career-logbook-item-label`},_hoisted_10$52={class:`career-logbook-details`},_hoisted_11$46={class:`career-logbook-title-newmark`},_hoisted_12$35={class:`career-logbook-meta`},_hoisted_13$29={key:0},_hoisted_14$27={class:`logbook-description`},_hoisted_15$26={key:1,class:`logbook-description logbook-table`},_hoisted_16$26={key:2},_hoisted_17$21={key:3,class:`logbook-description quest-status`},_hoisted_18$18={class:`quest-stats-wrapper`},_hoisted_19$15={class:`quest-labels`},_hoisted_20$13={class:`progress-label`},_hoisted_21$12={key:0,class:`progressbar-background`},_hoisted_22$10={class:`rewards-wrapper flex-row`},_hoisted_23$9={class:`label`},_hoisted_24$8={class:`rewards-section flex-row`},_hoisted_25$7={class:`flex-row`},_sfc_main$245={__name:`Logbook`,props:{id:String},setup(__props){useUINavScope(`logbook`);let rewardUnitTypes={money:`beambucks`,beamXP:`xp`},props=__props,sectionTabs=ref(),entryId=computed(()=>props.id===void 0?void 0:(``+props.id).replace(/%/g,`/`)),logbookTabs=ref([{id:`info`,name:`Info`,entries:[],filter:i=>i.type===`info`},{id:`history`,name:`History`,entries:[],filter:i=>i.type===`progress`}]),checkForNewLogEntries=()=>logbookTabs.value.forEach(tab=>tab.hasNew=!!tab.entries.some(i=>i.isNew));function setup$3(data){if(data.forEach(entry=>{Object.hasOwn(entry,`text`)&&(entry.text=parse$1($translate.contextTranslate(entry.text,!0)),entry._ready=!0)}),logbookTabs.value.forEach(tab=>tab.entries=data.filter(tab.filter)),checkForNewLogEntries(),entryId.value){for(let tab of logbookTabs.value)for(let entry of tab.entries)if(``+entry.entryId===entryId.value){toggleExpand(entry),tab.isPreselected=!0;return}}logbookTabs.value[0].entries.length&&toggleExpand(logbookTabs.value[0].entries[0])}ref({});let selectedEntry=ref({});ref({});let readTimer,toggleExpand=entry=>setTimeout(()=>{readTimer&&clearTimeout(readTimer),selectedEntry.value=entry,readTimer=window.setTimeout(()=>{selectedEntry.value.isNew=!1,checkForNewLogEntries(),entry.type===`quest`?Lua_default.career_modules_questManager.setQuestAsNotNew(entry.questId):Lua_default.career_modules_logbook.setLogbookEntryRead(entry.entryId,!0)},1e3)},0),tabChange=newTab=>{if(entryId.value){entryId.value=void 0;return}let tab=logbookTabs.value[newTab.id];!tab||!tab.entries||tab.entries.length===0||toggleExpand(tab.entries[0])},claimRewards=entry=>{Lua_default.career_modules_questManager.claimRewardsById(entry.questId),entry.claimable=!1,entry.claimed=!0},exit=()=>setTimeout(()=>window.bngVue.gotoAngularState(`menu.careerPause`),0);return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`logbook`)}),onMounted(()=>{Lua_default.career_modules_logbook.getLogbook().then(setup$3)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`logbook`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`logbook-layout`},{default:withCtx(()=>[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.subHeading`)),1)]),_:1}),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$216,[createBaseVNode(`div`,_hoisted_2$175,[createBaseVNode(`div`,_hoisted_3$154,[createVNode(unref(tabs_default),{ref_key:`sectionTabs`,ref:sectionTabs,onChange:tabChange,class:`bng-tabs`,"make-tab-header-classes":tabDetails=>({flagged:tabDetails.data.hasNew})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(logbookTabs.value,tabDetail=>(openBlock(),createBlock(unref(tab_default),{key:tabDetail.id,heading:_ctx.$t(tabDetail.name),active:tabDetail.isPreselected,data:tabDetail},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$129,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tabDetail.entries,(entry,index)=>withDirectives((openBlock(),createElementBlock(`div`,{key:entry.entryId,"bng-nav-item":``,class:normalizeClass([`career-logbook-item`,{selected:selectedEntry.value!==void 0&&selectedEntry.value.entryId==entry.entryId}]),onClick:$event=>toggleExpand(entry)},[createBaseVNode(`div`,_hoisted_6$95,[createBaseVNode(`div`,_hoisted_7$83,[createBaseVNode(`div`,null,toDisplayString(_ctx.$ctx_t(entry.cardTypeLabel)),1),createVNode(unref(bngDivider_default),{class:`vertical-divider`}),withDirectives(createBaseVNode(`div`,null,null,512),[[unref(BngRelativeTime_default),entry.time]]),withDirectives(createBaseVNode(`div`,_hoisted_8$68,null,512),[[vShow,entry.isNew]])]),createBaseVNode(`div`,_hoisted_9$61,toDisplayString(_ctx.$ctx_t(entry.title)),1)])],10,_hoisted_5$112)),[[unref(BngUiNavFocus_default),tabDetail.entries.length-index],[unref(BngSoundClass_default),`bng_click_generic_small`]])),128))])),[[unref(BngUiNavScroll_default)]])]),_:2},1032,[`heading`,`active`,`data`]))),128))]),_:1},8,[`make-tab-header-classes`])]),createBaseVNode(`div`,_hoisted_10$52,[withDirectives(createVNode(unref(bngCard_default),{class:`career-logbook-content-card`},createSlots({default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`logbook-entry-heading`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(selectedEntry.value&&_ctx.$ctx_t(selectedEntry.value.title))+` `,1),withDirectives(createBaseVNode(`div`,_hoisted_11$46,null,512),[[vShow,selectedEntry.value.isNew]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`exitButton`,onClick:exit,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),_cache[1]||=createTextVNode(`Back`,-1)]),_:1},8,[`accent`])),[[unref(BngSoundClass_default),`bng_back_generic`]])]),_:1}),createBaseVNode(`div`,_hoisted_12$35,[createBaseVNode(`div`,null,toDisplayString(_ctx.$ctx_t(selectedEntry.value.cardTypeLabel)),1),createVNode(unref(bngDivider_default),{class:`vertical-divider`}),withDirectives(createBaseVNode(`div`,null,null,512),[[unref(BngRelativeTime_default),selectedEntry.value.time]])]),createBaseVNode(`div`,{class:normalizeClass({"card-body":!0,"with-rewards":selectedEntry.value.type===`quest`&&selectedEntry.value.rewards.length})},[selectedEntry.value.cover?(openBlock(),createElementBlock(`div`,{key:0,class:`logbook-cover-image`,style:normalizeStyle({backgroundImage:`url(${selectedEntry.value.cover})`})},[selectedEntry.value.coverText?(openBlock(),createElementBlock(`h1`,_hoisted_13$29,toDisplayString(selectedEntry.value.coverText),1)):createCommentVNode(``,!0)],4)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$27,[selectedEntry.value._ready?(openBlock(),createBlock(unref(dynamicComponent_default),{key:0,template:_ctx.$ctx_t(selectedEntry.value.text)},null,8,[`template`])):createCommentVNode(``,!0)]),selectedEntry.value.tables?(openBlock(),createElementBlock(`div`,_hoisted_15$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.tables,(table,keyT)=>(openBlock(),createElementBlock(`table`,{key:keyT},[createBaseVNode(`tbody`,null,[createBaseVNode(`tr`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(table.headers,(header,keyH)=>(openBlock(),createElementBlock(`th`,{key:keyH},toDisplayString(header),1))),128))]),(openBlock(!0),createElementBlock(Fragment,null,renderList(table.rows,(row,keyR)=>(openBlock(),createElementBlock(`tr`,{key:keyR},[(openBlock(!0),createElementBlock(Fragment,null,renderList(row,(data,keyD)=>(openBlock(),createElementBlock(`td`,{key:keyD},[typeof data==`object`&&data&&data.hasOwnProperty(`type`)&&data.type===`rewards`?(openBlock(),createBlock(RewardsPills_default,{key:0,rewards:data.rewards,hideNumbers:!1},null,8,[`rewards`])):(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:_ctx.$ctx_t(data)},null,8,[`template`]))]))),128))]))),128))])]))),128))])):createCommentVNode(``,!0),selectedEntry.value.type===`quest`?(openBlock(),createElementBlock(`hr`,_hoisted_16$26)):createCommentVNode(``,!0),selectedEntry.value.type===`quest`?(openBlock(),createElementBlock(`div`,_hoisted_17$21,[_cache[2]||=createBaseVNode(`h4`,null,`Milestone Status`,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.progress,prog=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,_hoisted_18$18,[createBaseVNode(`div`,_hoisted_19$15,[prog.done?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`check-icon`,type:prog.failed?unref(icons).missionCheckboxCross:prog.done?unref(icons).checkboxOn:unref(icons).checkboxOff},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_20$13,toDisplayString(_ctx.$ctx_t(prog.label)),1)]),prog.type===`progressBar`?(openBlock(),createElementBlock(`div`,_hoisted_21$12,[createBaseVNode(`div`,{class:`progressbar-fill`,style:normalizeStyle({width:(prog.currValue>0?prog.currValue/(prog.maxValue-prog.minValue)*100:0)+`%`})},null,4)])):createCommentVNode(``,!0)])]))),256))])):createCommentVNode(``,!0)],2)]),_:2},[selectedEntry.value.type===`quest`&&selectedEntry.value.rewards.length?{name:`footer`,fn:withCtx(()=>[createBaseVNode(`div`,_hoisted_22$10,[createBaseVNode(`div`,_hoisted_23$9,toDisplayString(_ctx.$t(`ui.career.logbook.rewards`))+`:`,1),createBaseVNode(`div`,_hoisted_24$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedEntry.value.rewards,reward=>(openBlock(),createElementBlock(`div`,_hoisted_25$7,[createVNode(unref(bngUnit_default),mergeProps({class:`reward-icon`},{ref_for:!0},{[rewardUnitTypes[reward.attributeKey]]:reward.rewardAmount},{options:{formatter:x=>~~x}}),null,16,[`options`])]))),256))]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:_cache[0]||=$event=>claimRewards(selectedEntry.value),disabled:!selectedEntry.value.claimable},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.claimRewards`)),1)]),_:1},8,[`disabled`])),[[vShow,!selectedEntry.value.claimed],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{disabled:!0},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.career.logbook.rewardsClaimed`)),1)]),_:1},512),[[vShow,selectedEntry.value.claimed]])])]),key:`0`}:void 0]),1536),[[vShow,selectedEntry.value!==void 0]])])])])),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngOnUiNav_default),sectionTabs.value&§ionTabs.value.goPrev,`tab_l`],[unref(BngOnUiNav_default),sectionTabs.value&§ionTabs.value.goNext,`tab_r`]])]),_:1})),[[unref(BngBlur_default)]])}},Logbook_default=__plugin_vue_export_helper_default(_sfc_main$245,[[`__scopeId`,`data-v-e8139034`]]),_hoisted_1$215={class:`milestones-wrapper`},_hoisted_2$174={"bng-ui-scope":`milestones`,class:`career-milestones-card`},_hoisted_3$153={class:`career-milestones-container`},_hoisted_4$128={class:`actions`},_hoisted_5$111={class:`filters`},_hoisted_6$94={class:`scrollable-container`,"bng-nav-scroll-force":``},_hoisted_7$82={class:`cards-container`},_sfc_main$244={__name:`Milestones`,props:{id:String},setup(__props){useUINavScope(`milestones`);let careerStatusRef=ref(),allEntries=[],entries=ref([]),selectOneFilters=ref(),selectedFilters=ref([`general`]),FILTER_OPTIONS=[{value:`general`,label:`General`},{value:`all`,label:`All`},{value:`mission`,label:`Challenges`},{value:`branch`,label:`Branches`},{value:`delivery`,label:`Delivery`},{value:`money`,label:`Money`},{value:`speedTrap`,label:`Speed Traps`},{value:`insurance`,label:`Insurance`}];function sortMilestones(){entries.value.sort(function(a$1,b){return a$1.claimable&&!b.claimable?-1:b.claimable&&!a$1.claimable?1:!a$1.completed&&b.completed?-1:a$1.completed&&!b.completed?1:a$1.claimId!0):entries.value=allEntries.filter(e=>e.filter[currentFilter]),sortMilestones()}function filterChanged(filterList){filterList&&(currentFilter=filterList[0]),filterEntries()}function setup$3(data){allEntries=data.list;let hasClaimable=!1;data.list.forEach(x=>{x.claimable&&(hasClaimable=!0)}),hasClaimable&&(selectedFilters.value=[`all`],filterChanged(selectedFilters.value)),filterEntries()}Lua_default.career_modules_milestones_milestones.getMilestones().then(setup$3);let claimMilestone=entry=>{Lua_default.career_modules_milestones_milestones.claim(entry.claimId).then(replacementEntry=>{careerStatusRef.value.updateDisplay();let replacementId=allEntries.findIndex(item=>item.claimId===entry.claimId);if(replacementEntry!=null&&replacementId!==-1){allEntries[replacementId]=replacementEntry,filterEntries();return}allEntries[replacementId].claimable=!1,filterEntries()})},exit=()=>{window.bngVue.gotoGameState(`progressLanding`)};return onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`milestones`)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`milestones`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`milestones-layout`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$215,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Milestones`,-1)]]),_:1}),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$174,[createBaseVNode(`div`,_hoisted_3$153,[createBaseVNode(`div`,_hoisted_4$128,[createVNode(unref(bngButton_default),{class:`exitButton`,onClick:exit,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{tabindex:`1`,"ui-event":`back`,deviceMask:`xinput`}),_cache[2]||=createTextVNode(`Back`,-1)]),_:1},8,[`accent`]),createVNode(unref(careerStatus_default),{class:`career-page-status`,ref_key:`careerStatusRef`,ref:careerStatusRef},null,512)]),createBaseVNode(`div`,_hoisted_5$111,[createVNode(unref(bngIcon_default),{class:`career-filter-icon`,type:unref(icons).filter},null,8,[`type`]),createVNode(unref(bngPillFilters_default),{required:``,ref_key:`selectOneFilters`,ref:selectOneFilters,modelValue:selectedFilters.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedFilters.value=$event,options:FILTER_OPTIONS,onValueChanged:filterChanged},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_6$94,[createBaseVNode(`div`,_hoisted_7$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(entries.value,entry=>withDirectives((openBlock(),createBlock(MilestoneCard_default,{tabindex:`1`,milestone:entry,isCondensed:!1,onClaim:claimMilestone},null,8,[`milestone`])),[[unref(BngSoundClass_default),entry.claimable?`bng_click_hover_generic`:`bng_hover_generic`]])),256))])])])])),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngOnUiNav_default),selectOneFilters.value&&selectOneFilters.value.focusPrevious,`tab_l`],[unref(BngOnUiNav_default),selectOneFilters.value&&selectOneFilters.value.focusNext,`tab_r`]])])]),_:1})),[[unref(BngOnUiNav_default),exit,`back,menu`],[unref(BngBlur_default)]])}},Milestones_default=__plugin_vue_export_helper_default(_sfc_main$244,[[`__scopeId`,`data-v-798d8c2a`]]),_hoisted_1$214={class:`panel-flex`},_hoisted_2$173={style:{"overflow-y":`scroll`}},_hoisted_3$152={class:`content-row selected-and-map-panel`},_hoisted_4$127={key:0,class:`content`},TAB_HEADINGS={parcels:`Parcels`,smallFluids:`Fluid Orders`,largeFluids:`Fluid Custom`,smallDryBulk:`Dry Bulk Orders`,largeDryBulk:`Dry Bulk Custom`,vehicles:`Vehicles`,trailers:`Trailers`,loaners:`Loaners`},_sfc_main$243={__name:`MyCargo`,props:{facilityId:String,parkingSpotPath:String},setup(__props){ref(3),ref(1);let{events:events$3}=useBridge();useUINavScope(`myCargo`);let props=__props;ref(null),ref(),ref(TAB_HEADINGS.parcels),ref(),ref();let cargoOverviewStore=useCargoOverviewStore(),updateCargoDataAll=()=>{cargoOverviewStore.requestCargoData(props.facilityId,props.parkingSpotPath)},close=()=>{Lua_default.career_modules_delivery_cargoScreen.exitCargoOverviewScreen()};return events$3.on(`updateCargoData`,updateCargoDataAll),onMounted(()=>{Lua_default.career_modules_delivery_cargoScreen.setCargoScreenTab(`all`),updateCargoDataAll()}),onUnmounted(()=>{cargoOverviewStore.menuClosed(),events$3.off(`updateCargoData`,updateCargoDataAll)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[_cache[22]||=createBaseVNode(`div`,{style:{color:`white`}},`#Hello`,-1),unref(cargoOverviewStore).cargoData?(openBlock(),createBlock(ComputerWrapper_default,{key:0,path:[`My Cargo`],title:`My Cargo 2`,back:``,onBack:close},{status:withCtx(()=>[..._cache[10]||=[createTextVNode(` Delivery Lvl 2 | Car Jockey Lvl 3 | Facility Reputation: Good `,-1)]]),top:withCtx(()=>[..._cache[11]||=[createBaseVNode(`div`,{style:{width:`100%`,padding:`0.3em`,background:`#8888ff`}},` FILTERTABS `,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$214,[createVNode(unref(bngCard_default),{class:`content-row provided-orders-panel`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` My Cargo `,-1)]]),_:1}),createVNode(unref(bngSwitch_default),{modelValue:unref(cargoOverviewStore).automaticRoute,"onUpdate:modelValue":_cache[0]||=$event=>unref(cargoOverviewStore).automaticRoute=$event},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Automatic route `,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngSlider_default),{min:0,max:unref(cargoOverviewStore).cargoData.playerCardGroupSets.length-1,step:1,modelValue:unref(cargoOverviewStore).playerGroupingIdx,"onUpdate:modelValue":_cache[1]||=$event=>unref(cargoOverviewStore).playerGroupingIdx=$event,onChange:unref(cargoOverviewStore).setGroupingAndSorting},null,8,[`max`,`modelValue`,`onChange`]),createVNode(unref(bngSlider_default),{min:0,max:unref(cargoOverviewStore).cargoData.sortingSets.length-1,step:1,modelValue:unref(cargoOverviewStore).playerSortingIdx,"onUpdate:modelValue":_cache[2]||=$event=>unref(cargoOverviewStore).playerSortingIdx=$event,onChange:unref(cargoOverviewStore).setGroupingAndSorting},null,8,[`max`,`modelValue`,`onChange`]),createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[createTextVNode(` Grouped `+toDisplayString(unref(cargoOverviewStore).cargoData.playerCardGroupSets[unref(cargoOverviewStore).playerGroupingIdx].label)+`, Sorted `+toDisplayString(unref(cargoOverviewStore).cargoData.sortingSets[unref(cargoOverviewStore).playerSortingIdx].label),1)]),_:1}),createBaseVNode(`div`,_hoisted_2$173,[createVNode(ProvidedOrdersPanel_default,{groupSets:unref(cargoOverviewStore).cargoData.playerCardGroupSets,groupIdx:unref(cargoOverviewStore).playerGroupingIdx,sortingSets:unref(cargoOverviewStore).cargoData.sortingSets,sortIdx:unref(cargoOverviewStore).playerSortingIdx,onCardHovered:unref(cargoOverviewStore).cardHovered,onCardClicked:unref(cargoOverviewStore).cardClicked},null,8,[`groupSets`,`groupIdx`,`sortingSets`,`sortIdx`,`onCardHovered`,`onCardClicked`])])]),_:1}),createBaseVNode(`div`,_hoisted_3$152,[createVNode(unref(bngCard_default),{class:`cargo-detail`},createSlots({default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`cardHeading`},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(` Details View `,-1)]]),_:1}),unref(cargoOverviewStore).focusedCargo?(openBlock(),createElementBlock(`div`,_hoisted_4$127,[createVNode(CargoCard_default,{card:unref(cargoOverviewStore).focusedCargo,detailed:``},null,8,[`card`])])):createCommentVNode(``,!0)]),_:2},[unref(cargoOverviewStore).focusedCargo?{name:`buttons`,fn:withCtx(()=>[unref(cargoOverviewStore).focusedCargo.cardType==`parcelGroup`?(openBlock(),createElementBlock(Fragment,{key:0},[unref(cargoOverviewStore).focusedCargo.isFacilityCard?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.transientMoveCounts==0,accent:`text`,onClick:_cache[3]||=$event=>unref(cargoOverviewStore).clearLoad(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(` Clear Load `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.autoLoadLocations&&unref(cargoOverviewStore).focusedCargo.autoLoadLocations.length==0,accent:`text`,onClick:_cache[4]||=$event=>unref(cargoOverviewStore).loadCargoCustom(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Custom Load `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:!unref(cargoOverviewStore).focusedCargo.enabled||unref(cargoOverviewStore).focusedCargo.autoLoadLocations&&unref(cargoOverviewStore).focusedCargo.autoLoadLocations.length<=unref(cargoOverviewStore).focusedCargo.transientMoveCounts,onClick:_cache[5]||=$event=>unref(cargoOverviewStore).loadCargoAuto(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` Auto Load `,-1)]]),_:1},8,[`disabled`])],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.isPlayerCard?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(bngButton_default),{accent:`text`,disabled:unref(cargoOverviewStore).focusedCargo.transientCargo,onClick:_cache[6]||=$event=>unref(cargoOverviewStore).changeDistribution(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[18]||=[createTextVNode(` Change Distribution `,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{disabled:unref(cargoOverviewStore).focusedCargo.transientCargo,onClick:_cache[7]||=$event=>unref(cargoOverviewStore).clearLoad(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[19]||=[createTextVNode(` Clear Load `,-1)]]),_:1},8,[`disabled`])],64)):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.cardType==`storage`?(openBlock(),createElementBlock(Fragment,{key:1},[unref(cargoOverviewStore).focusedCargo.isFacilityCard?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(cargoOverviewStore).focusedCargo.enabled,onClick:_cache[8]||=$event=>unref(cargoOverviewStore).loadStorageCustom(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Load Custom `,-1)]]),_:1},8,[`disabled`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),unref(cargoOverviewStore).focusedCargo.cardType==`vehicleOffer`?(openBlock(),createBlock(unref(bngButton_default),{key:2,disabled:!unref(cargoOverviewStore).focusedCargo.enabled,onClick:_cache[9]||=$event=>unref(cargoOverviewStore).loadOffer(unref(cargoOverviewStore).focusedCargo)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(cargoOverviewStore).focusedCargo.spawnWhenCommitingCargo?`Don't bring out`:`Bring Out`),1)]),_:1},8,[`disabled`])):createCommentVNode(``,!0)]),key:`0`}:void 0]),1024),createVNode(unref(bngCard_default),{class:`map`},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(` Map Screen `,-1)]]),_:1})])])]),_:1})):createCommentVNode(``,!0)],64))}},MyCargo_default=__plugin_vue_export_helper_default(_sfc_main$243,[[`__scopeId`,`data-v-9a756c16`]]),_hoisted_1$213={class:`paint-presets`},_hoisted_2$172={class:`paint-presets-group`},_hoisted_3$151={class:`paint-presets-name`},_hoisted_4$126={class:`presets-items`},_sfc_main$242={__name:`PaintPresets`,props:{presets:{type:Object,required:!0},showText:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},current:{type:Object}},emits:[`apply`],setup(__props,{emit:__emit}){let settings$1=useSettings(),props=__props,emit$1=__emit,factoryPresets=computed(()=>{let presets=props.presets,factoryRes={},customRes={};if(typeof presets==`object`&&!Array.isArray(presets)){let paint=new Paint;for(let name in presets)try{paint.paint=presets[name];let paintObject=paint.paintObject;presets[name]&&typeof presets[name]==`object`&&presets[name].class===`custom`?customRes[name]=paintObject:factoryRes[name]=paintObject}catch{}}return{factory:factoryRes,custom:customRes}}),userPresets=ref({}),presetGroups=computed(()=>{let res=[];Object.keys(factoryPresets.value.factory).length&&res.push({name:`factory`,showTooltip:!0,editable:!1,presets:factoryPresets.value.factory}),Object.keys(factoryPresets.value.custom).length&&res.push({name:`custom`,showTooltip:!0,editable:!1,presets:factoryPresets.value.custom}),props.editable&&res.push({name:`user`,showTooltip:!1,editable:!0,presets:userPresets.value||{}});for(let group of res){let presets=Object.keys(group.presets).map(colname=>({name:colname,...group.presets[colname],css:`rgb(${group.presets[colname].baseColor.slice(0,3).map(val=>val*255)})`}));group.name!==`user`&&(presets=sortColors(presets)),group.presets=presets}return res});function average(arr){return arr.reduce((a$1,b)=>a$1+b)/arr.length}function valComparable(col,thres=.05){let bool=!0,av=average(col);for(let i=0;i=col[i];return bool&&=av>.8||av<.2,bool}function colorHigherHelper(itm){let av=average(itm.orig.baseColor.slice(0,3)),al=itm.orig.baseColor[3]/2,res=Math.abs(av-1)*al;return res===0?(av+al)/2:res+1}function colorHigher(a$1,b){let aColor=valComparable(a$1.orig.baseColor.slice(0,3)),bColor=valComparable(b.orig.baseColor.slice(0,3));if(aColor&&bColor)return colorHigherHelper(b)-colorHigherHelper(a$1);if(aColor&&!bColor)return 1;if(!aColor&&bColor)return-1;for(let i=0;i<3;i++)if(a$1.val[i]!==b.val[i])return a$1.val[i]-b.val[i];return 0}function colorValue(arr){let repitions=8,rgb=[];for(let i=0;i<3;i++)rgb[i]=(1-arr[3]/2)*arr[i]+arr[3]/2*arr[i];let lum=Math.sqrt(.241*rgb[0]+.691*rgb[1]+.068*rgb[2]),hsl=Paint.rgbToHsl(rgb),out=[hsl[0],lum,hsl[1]].map(elem=>elem*8);return out[0]%2==1&&(out[1]=8-out[1],out[2]=8-out[2]),out.push(arr[3]),out}function sortColors(list){return list.map(elem=>({val:colorValue(elem.baseColor),orig:elem})).sort(colorHigher).map(elem=>elem.orig)}function addPreset(){if(!props.current)return;let colour={...props.current,baseColor:toRaw(props.current.baseColor)},idx=1;for(;`Custom ${idx}`in userPresets.value;)idx++;let presetName=`Custom ${idx}`;userPresets.value[presetName]=colour,savePresets(),nextTick(()=>{let presetElements=document.querySelectorAll(`.paint-presets-item`),newPreset=Array.from(presetElements).find(el=>el.getAttribute(`data-preset-name`)===presetName);newPreset&&setFocusExternal(newPreset)})}function removePreset(name){let presetElements=document.querySelectorAll(`.paint-presets-item`),currentIndex=Array.from(presetElements).findIndex(el=>el.getAttribute(`data-preset-name`)===name);delete userPresets.value[name],savePresets(),nextTick(()=>{let group=presetGroups.value.find(g=>g.name===`user`);if(group)if(group.presets.length>0){let newPresetElements=document.querySelectorAll(`.paint-presets-item`);setFocusExternal(newPresetElements[Math.min(currentIndex,newPresetElements.length-1)])}else{let addButton=document.querySelector(`.presets-empty`);addButton&&setFocusExternal(addButton)}})}function savePresets(){settings$1.apply({userPaintPresets:JSON.stringify(Object.values(userPresets.value))})}return onMounted(async()=>{await settings$1.waitForData();let paints={};if(settings$1.values.userPaintPresets&&(paints=JSON.parse(settings$1.values.userPaintPresets.replace(/'/g,`"`)),typeof paints==`object`)){Array.isArray(paints)&&(paints=paints.reduce((res,paint,idx)=>({...res,[`Custom ${idx}`]:paint}),{}));let test=new Paint;for(let name in paints)try{test.paint=paints[name],paints[name]=test.paintObject}catch{delete paints[name]}}userPresets.value=paints}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$213,[(openBlock(!0),createElementBlock(Fragment,null,renderList(presetGroups.value,group=>(openBlock(),createElementBlock(`div`,_hoisted_2$172,[createBaseVNode(`span`,_hoisted_3$151,toDisplayString(_ctx.$t(`ui.color.${group.name}`))+`: `,1),createBaseVNode(`div`,_hoisted_4$126,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.presets,(preset,index)=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:`${index}#${preset.name}`,size:24,paint:preset,"vehicle-name":`factory`,"paint-name":preset.name,"tooltip-position":`top`,class:`paint-presets-item`,"data-preset-name":preset.name,"with-menu":__props.editable&&group.editable,"custom-menu":[{label:`ui.common.delete`,action:()=>removePreset(preset.name)}],onClick:$event=>emit$1(`apply`,preset)},null,8,[`paint`,`paint-name`,`data-preset-name`,`with-menu`,`custom-menu`,`onClick`]))),128)),!group.presets||Object.keys(group.presets).length===0?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`presets-empty`,accent:unref(ACCENTS).text,onClick:addPreset,"bng-nav-item":``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.colorpicker.noPresets`)),1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),group.presets&&Object.keys(group.presets).length>0&&__props.editable&&group.editable?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`paint-presets-button`,accent:unref(ACCENTS).text,onClick:addPreset,icon:unref(icons).mathPlus,"bng-nav-item":``},null,8,[`accent`,`icon`])),[[unref(BngTooltip_default),_ctx.$t(`ui.colorpicker.colToPre`),`top`],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0)])]))),256))]))}},PaintPresets_default=__plugin_vue_export_helper_default(_sfc_main$242,[[`__scopeId`,`data-v-469b2f89`]]),_hoisted_1$212={class:`paint-picker`},_hoisted_2$171={key:0,class:`paint-flex`},_hoisted_3$150={key:0,class:`paint-preview`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 1 1`,preserveAspectRatio:`xMidYMid meet`},_hoisted_4$125={id:`light`,cy:`0.28`,cx:`0.35`,r:`0.3`,spreadMethod:`pad`},_hoisted_5$110=[`offset`],_hoisted_6$93=[`offset`],_hoisted_7$81={id:`colPreview`,x:`0`,y:`0`,width:`1`,height:`1`,patternUnits:`userSpaceOnUse`},_hoisted_8$67=[`fill`],_hoisted_9$60={key:1},_hoisted_10$51={key:0},_hoisted_11$45={key:2},_hoisted_12$34={key:0},_sfc_main$241={__name:`PaintPicker`,props:{modelValue:{type:[String,Object]},legacy:{type:Boolean,default:!1},presets:{type:Object,default:{}},presetsEditable:{type:Boolean,default:!1},showPresets:{type:Boolean,default:!0},showMain:{type:Boolean,default:!0},pickerMode:{type:String,default:`full_luminosity`},showText:{type:Boolean,default:!0},showPreview:{type:Boolean,default:!1},advancedOpen:{type:Boolean,default:!1},showAdvancedSwitch:{type:Boolean,default:!0}},emits:[`update:modelValue`,`change`],setup(__props,{expose:__expose,emit:__emit}){let props=__props;__expose({paintUpdated,setAdvancedVisible}),watch(()=>props.modelValue,init$3);let emitter=__emit,advanced=ref(props.advancedOpen),paint=reactive(new Paint({legacy:props.legacy}));watch(()=>props.legacy,val=>paint.legacy=val);let paintPicker=ref(paint),isPaintObject=!1,factoryPresets=computed(()=>props.presets||{}),hslColour=computed(()=>Paint.hslCssStr(paint.hsl));function init$3(){let defPaint=[1,1,1,1,0,1,1,0];if(!props.modelValue){paint.paint=defPaint;return}if(isPaintObject=props.modelValue instanceof Paint,isPaintObject){paint.paint=props.modelValue.paintObject;return}let newpaint=new Paint({legacy:props.legacy});try{newpaint.paint=props.modelValue}catch{newpaint.paint=defPaint}newpaint.paintString!==paint.paintString&&(paint.paint=newpaint.paintObject)}function returnPaint(){let res;isPaintObject?(res=props.modelValue,res.paint=paint.paintObject):res=paint.paintString,emitter(`change`,res),emitter(`update:modelValue`,res)}function paintUpdated(){init$3(),returnPaint()}function setAdvancedVisible(visible){advanced.value=visible}function applyPreset(preset){paint.paint=preset,returnPaint()}return init$3(),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$212,[__props.showPreview||__props.showPresets?(openBlock(),createElementBlock(`div`,_hoisted_2$171,[__props.showPreview?(openBlock(),createElementBlock(`svg`,_hoisted_3$150,[createBaseVNode(`defs`,null,[createBaseVNode(`radialGradient`,_hoisted_4$125,[createBaseVNode(`stop`,mergeProps({offset:.1+.2*(1-paint.roughness)},{"stop-opacity":.4+.2*paint.roughness},{"stop-color":`#fff`}),null,16,_hoisted_5$110),createBaseVNode(`stop`,{offset:1-paint.roughness*.5,"stop-opacity":`0.0`,"stop-color":`#fff`},null,8,_hoisted_6$93)]),_cache[16]||=createBaseVNode(`radialGradient`,{id:`shadow`,cy:`0.43`,cx:`0.45`,r:`0.55`,spreadMethod:`pad`},[createBaseVNode(`stop`,{offset:`0.7`,"stop-opacity":`0.0`,"stop-color":`#000`}),createBaseVNode(`stop`,{offset:`0.85`,"stop-opacity":`0.2`,"stop-color":`#000`}),createBaseVNode(`stop`,{offset:`1.0`,"stop-opacity":`0.5`,"stop-color":`#000`})],-1),createBaseVNode(`pattern`,_hoisted_7$81,[_cache[13]||=createBaseVNode(`image`,{x:`0`,y:`0`,height:`1`,width:`1`,"xlink:href":`/ui/lib/int/colorpicker/color-chrome.png`},null,-1),createBaseVNode(`rect`,mergeProps({y:`0`,x:`0`,width:`1`,height:`1`,fill:`hsl(${hslColour.value})`},{"fill-opacity":paint.alpha/2},{stroke:`transparent`}),null,16,_hoisted_8$67),_cache[14]||=createBaseVNode(`rect`,{y:`0`,x:`0`,width:`1`,height:`1`,fill:`url(#light)`,stroke:`transparent`},null,-1),_cache[15]||=createBaseVNode(`rect`,{y:`0`,x:`0`,width:`1`,height:`1`,fill:`url(#shadow)`,stroke:`transparent`},null,-1)])]),_cache[17]||=createBaseVNode(`circle`,{cy:`0.5`,cx:`0.5`,r:`0.5`,fill:`url(#colPreview)`,stroke:`transparent`},null,-1)])):createCommentVNode(``,!0),__props.showPresets?(openBlock(),createBlock(PaintPresets_default,{key:1,presets:factoryPresets.value,"show-text":__props.showText,editable:__props.presetsEditable,current:paint.paintObject,onApply:applyPreset},null,8,[`presets`,`show-text`,`editable`,`current`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.showMain?(openBlock(),createElementBlock(`div`,_hoisted_9$60,[__props.showText&&_ctx.$slots.default?(openBlock(),createElementBlock(`span`,_hoisted_10$51,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0),createVNode(unref(bngColorPicker_default),{modelValue:paintPicker.value,"onUpdate:modelValue":_cache[0]||=$event=>paintPicker.value=$event,onChange:_cache[1]||=$event=>returnPaint(),view:__props.pickerMode,"show-text":__props.showText},null,8,[`modelValue`,`view`,`show-text`])])):createCommentVNode(``,!0),__props.showMain?(openBlock(),createElementBlock(`div`,_hoisted_11$45,[__props.showAdvancedSwitch?(openBlock(),createElementBlock(`h3`,_hoisted_12$34,[createVNode(unref(bngSwitch_default),{modelValue:advanced.value,"onUpdate:modelValue":_cache[2]||=$event=>advanced.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.color.configurations`)),1)]),_:1},8,[`modelValue`])])):createCommentVNode(``,!0),advanced.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`paint-slider-group`,{"paint-slider-group-fullrow":_ctx.$simplemenu.value}])},[__props.legacy?(openBlock(),createBlock(unref(bngColorSlider_default),{key:0,modelValue:paint.alpha,"onUpdate:modelValue":_cache[3]||=$event=>paint.alpha=$event,max:2,onChange:_cache[4]||=$event=>returnPaint(),fill:[`hsla(${hslColour.value}, 0)`,`hsla(${hslColour.value}, 2)`]},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.chrominess`)} (${paint.alphaPercent}%)`:null),1)]),_:1},8,[`modelValue`,`fill`])):createCommentVNode(``,!0),createVNode(unref(bngColorSlider_default),{modelValue:paint.metallic,"onUpdate:modelValue":_cache[5]||=$event=>paint.metallic=$event,onChange:_cache[6]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.metallic`)} (${paint.metallicPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.roughness,"onUpdate:modelValue":_cache[7]||=$event=>paint.roughness=$event,onChange:_cache[8]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.roughness`)} (${paint.roughnessPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.clearcoat,"onUpdate:modelValue":_cache[9]||=$event=>paint.clearcoat=$event,onChange:_cache[10]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.clearCoat`)} (${paint.clearcoatPercent}%)`:null),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngColorSlider_default),{modelValue:paint.clearcoatRoughness,"onUpdate:modelValue":_cache[11]||=$event=>paint.clearcoatRoughness=$event,onChange:_cache[12]||=$event=>returnPaint()},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.showText?`${_ctx.$t(`ui.color.clearCoatRoughness`)} (${paint.clearcoatRoughnessPercent}%)`:null),1)]),_:1},8,[`modelValue`])],2)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]))}},PaintPicker_default=__plugin_vue_export_helper_default(_sfc_main$241,[[`__scopeId`,`data-v-2d18c0ad`]]),_hoisted_1$211={class:`paintingWrapper`},_hoisted_2$170={style:{overflow:`auto`}},_hoisted_3$149=[`tab-heading`],_hoisted_4$124={class:`paintPicker`},_hoisted_5$109={key:0,class:`clearCoatSection`},_hoisted_6$92={key:0,class:`innerShoppingCart`},_hoisted_7$80={class:`shoppingCartTable`},_hoisted_8$66={class:`price`},_hoisted_9$59={class:`price--total`},_hoisted_10$50={class:`purchase-button-container`},_sfc_main$240={__name:`Painting`,props:{noHeader:Boolean},setup(__props,{expose:__expose}){let{units,events:events$3}=useBridge(),presets=ref({});Lua_default.career_modules_painting.getFactoryPaint().then(data=>presets.value=data);let colorClass=ref(`factory`),paintIndex=ref(0),chosenPackage=ref([{},{},{}]),changedPaint=ref(!1),totalPrice=ref(0),clearCoatActive=ref(!1),clearCoatPolish=ref(0),paints=ref([]),originalPaints=ref([]),prices=ref({}),colorClassData=ref({}),canPay=ref(!1),paintPicker=ref(null),paintClassTabInfo=[{title:`Factory`},{title:`Gloss`,paintClasses:[{id:`matte`,title:`Matte`},{id:`semiGloss`,title:`Semi Gloss`},{id:`gloss`,title:`Full Gloss`}]},{title:`Metallic`,paintClasses:[{id:`semiMetallic`,title:`Semi Metallic`},{id:`metallic`,title:`Metallic`},{id:`chrome`,title:`Chrome`}]},{title:`Custom`}],clearCoatUpdateCallback=newValue=>{clearCoatPolish.value=0,changeClearCoatPolish(0),enableClearCoat(newValue)},enableClearCoat=enabled=>{paints.value[paintIndex.value]._clearcoat=enabled?1:0,paintPicker.value.paintUpdated()},changeClearCoatPolish=value=>{paints.value[paintIndex.value]._clearcoatRoughness=-.13*value+.13,paintPicker.value.paintUpdated()},getShoppingCartTable=()=>{let res=[];for(let[index,paintOptions]of chosenPackage.value.entries())Object.keys(paintOptions).length&&(res.push({name:`Paint `+(index+1)+`: `+getNicePaintClassName(paintOptions.paintClass),price:prices.value.basePrices[paintOptions.paintClass].money.amount,topLevel:!0,index}),paintOptions.clearCoat&&(res.push({name:`Clearcoat`,price:prices.value.clearcoatBase.money.amount}),res.push({name:`Extra Clearcoat Polish`,price:prices.value.clearcoatPolishFactor.money.amount*paintOptions.clearCoatPolish})));return res};events$3.on(`sendPaintingShoppingCartData`,data=>{canPay.value=data.canPay,totalPrice.value=data.totalPrice.money.amount}),Lua_default.career_modules_painting.getPaintData().then(data=>{if(prices.value=data.prices,!data||!Array.isArray(data.colors)){paints.value=[];return}paints.value=data.colors.map(val=>new Paint({paint:val})),originalPaints.value=data.colors.map(val=>new Paint({paint:val})),colorClassData.value=data.colorClassData});let getPickerShowPresets=()=>colorClass.value==`factory`,getPickerPresetsEditable=()=>colorClass.value==`custom`,showPickerMain=()=>colorClass.value!=`factory`,showClearCoatOption=()=>colorClass.value!=`factory`&&colorClass.value!=`custom`,setCurrentColorClass=()=>{paintPicker.value.setAdvancedVisible(!1),paints.value[paintIndex.value]._metallic=colorClassData.value[colorClass.value].metallic,paints.value[paintIndex.value]._roughness=colorClassData.value[colorClass.value].roughness,clearCoatActive.value=!1,enableClearCoat(!1)},changedPaintIndexTab=tab=>{paintIndex.value=tab.index,colorClass.value=chosenPackage.value[paintIndex.value].paintClass||`factory`,paintPicker.value.setAdvancedVisible(colorClass.value==`custom`),clearCoatActive.value=chosenPackage.value[paintIndex.value].clearCoat,clearCoatPolish.value=chosenPackage.value[paintIndex.value].clearCoatPolish},changedTopLevelPaintClassTab=tab=>{let classTab={Factory:`factory`,Custom:`custom`,Gloss:`semiGloss`,Metallic:`metallic`}[tab.heading];classTab&&changedPaintClassTab(classTab)},changedPaintClassTab=paintClass=>{if(paintClass==`factory`){colorClass.value=`factory`;return}if(paintClass==`custom`){colorClass.value=`custom`,paintPicker.value.setAdvancedVisible(!0),clearCoatActive.value=!1;return}colorClass.value=paintClass,setCurrentColorClass()};function resetPaint(index){chosenPackage.value[index]={},Object.assign(paints.value[index],originalPaints.value[index]);let chosenPackageEmpty=!0;for(let[index$1,color]of Object.entries(chosenPackage.value))Object.keys(color).length!==0&&(chosenPackageEmpty=!1);chosenPackageEmpty&&(changedPaint.value=!1),Lua_default.career_modules_painting.setPaints(paints.value.map(paint=>paint.paintObject),chosenPackage.value)}function onChange(){colorClass.value==`factory`&&(clearCoatActive.value=!1),chosenPackage.value[paintIndex.value].paintClass=colorClass.value,chosenPackage.value[paintIndex.value].clearCoat=clearCoatActive.value,chosenPackage.value[paintIndex.value].clearCoatPolish=clearCoatPolish.value,changedPaint.value=!0,Lua_default.career_modules_painting.setPaints(paints.value.map(paint=>paint.paintObject),chosenPackage.value)}let NICE_PAINT_CLASS_NAMES={factory:`Factory`,semiGloss:`Semi Gloss`,gloss:`Gloss`,semiMetallic:`Semi Metallic`,metallic:`Metallic`,matte:`Matte`,chrome:`Chrome`,custom:`Custom`},getNicePaintClassName=paintClass=>NICE_PAINT_CLASS_NAMES[paintClass];function headerClass(tab){return{"painting-tab":!0,[`painting-tab-${tab.index}`]:!0}}let headerVars=computed(()=>paints.value.reduce((res,paint,idx)=>({...res,[`--painting-dot-${idx}`]:`hsl(${Paint.hslCssStr(paint.hsl)})`}),{})),apply$1=()=>Lua_default.career_modules_painting.apply(),close=()=>Lua_default.career_modules_painting.close();return onMounted(()=>{Lua_default.career_modules_painting.onUIOpened()}),onUnmounted(close),__expose({apply:apply$1,close}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$211,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`paintingPage`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$170,[__props.noHeader?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Painting `,-1)]]),_:1})),createVNode(unref(tabs_default),{class:`bng-tabs`,"selected-index":0,"make-tab-header-classes":headerClass,style:normalizeStyle(headerVars.value),onChange:changedPaintIndexTab},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(paints.value,(paint,idx)=>(openBlock(),createBlock(unref(tabs_default),{key:idx,"tab-heading":_ctx.$t(`ui.trackBuilder.matEditor.paint`)+` `+(idx+1),class:`bng-tabs`,"selected-index":0,onChange:changedTopLevelPaintClassTab},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(paintClassTabInfo,(paintClassTab,idx$1)=>createBaseVNode(`div`,{key:idx$1,"tab-heading":paintClassTab.title,style:{margin:`0.3em`,"background-color":`#00000000`}},[(openBlock(!0),createElementBlock(Fragment,null,renderList(paintClassTab.paintClasses,(paintClass,idx$2)=>(openBlock(),createBlock(unref(bngButton_default),{key:idx$2,onClick:$event=>changedPaintClassTab(paintClass.id),accent:colorClass.value==paintClass.id?void 0:unref(ACCENTS).secondary,class:`paint-class-button`},{default:withCtx(()=>[createTextVNode(toDisplayString(paintClass.title),1)]),_:2},1032,[`onClick`,`accent`]))),128))],8,_hoisted_3$149)),64))]),_:2},1032,[`tab-heading`]))),128))]),_:1},8,[`style`]),createVNode(unref(bngCard_default),null,{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$124,[createVNode(PaintPicker_default,{ref_key:`paintPicker`,ref:paintPicker,modelValue:paints.value[paintIndex.value],"onUpdate:modelValue":_cache[0]||=$event=>paints.value[paintIndex.value]=$event,"show-main":showPickerMain(),presets:getPickerShowPresets()?presets.value:void 0,"presets-editable":getPickerPresetsEditable(),"advanced-open":!1,"show-advanced-switch":!1,onChange},null,8,[`modelValue`,`show-main`,`presets`,`presets-editable`]),showClearCoatOption()?(openBlock(),createElementBlock(`div`,_hoisted_5$109,[createVNode(unref(bngSwitch_default),{modelValue:clearCoatActive.value,"onUpdate:modelValue":_cache[1]||=$event=>clearCoatActive.value=$event,onValueChanged:clearCoatUpdateCallback},{default:withCtx(()=>[createTextVNode(` Add Clear Coat (Baseprice: `+toDisplayString(unref(units).beamBucks(prices.value.clearcoatBase.money.amount))+`) `,1)]),_:1},8,[`modelValue`]),clearCoatActive.value?(openBlock(),createBlock(unref(bngColorSlider_default),{key:0,style:{"margin-top":`0.7em`},modelValue:clearCoatPolish.value,"onUpdate:modelValue":_cache[2]||=$event=>clearCoatPolish.value=$event,onChange:changeClearCoatPolish},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Clear Coat Polish `,-1)]]),_:1},8,[`modelValue`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),_:1})])]),_:1})),[[unref(BngBlur_default),1]]),createVNode(unref(bngCard_default),{class:`shoppingCart`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Shopping Cart`,-1)]]),_:1}),changedPaint.value?(openBlock(),createElementBlock(`div`,_hoisted_6$92,[createBaseVNode(`table`,_hoisted_7$80,[_cache[9]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`),createBaseVNode(`th`,{class:`article`},`Option`),createBaseVNode(`th`,{class:`price`},`Price`)])],-1),createBaseVNode(`tbody`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getShoppingCartTable(),(date,idx)=>(openBlock(),createElementBlock(`tr`,null,[createBaseVNode(`th`,null,[date.topLevel?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:$event=>resetPaint(date.index)},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`remove`,-1)]]),_:1},8,[`onClick`])):createCommentVNode(``,!0)]),createBaseVNode(`th`,{class:normalizeClass(date.topLevel?`article`:`article--subLevel`)},toDisplayString(date.name),3),createBaseVNode(`th`,_hoisted_8$66,toDisplayString(unref(units).beamBucks(date.price)),1)]))),256)),createBaseVNode(`tr`,null,[_cache[7]||=createBaseVNode(`th`,null,null,-1),_cache[8]||=createBaseVNode(`th`,{class:`article--total`},`Total`,-1),createBaseVNode(`th`,_hoisted_9$59,toDisplayString(unref(units).beamBucks(totalPrice.value)),1)])])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_10$50,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`purchase-button`,disabled:!canPay.value||!changedPaint.value,"show-hold":``},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Purchase and Apply `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:()=>apply$1(),holdDelay:1e3,repeatInterval:0}]])])]),_:1})]))}},Painting_default=__plugin_vue_export_helper_default(_sfc_main$240,[[`__scopeId`,`data-v-9dc00fbe`]]),_sfc_main$239={__name:`PaintingMain`,setup(__props){useComputerStore();let elPainting=ref(),close=()=>elPainting.value.close();return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Painting`],title:`Painting`,back:``,onBack:close},{default:withCtx(()=>[createVNode(Painting_default,{ref_key:`elPainting`,ref:elPainting,"no-header":``},null,512)]),_:1}))}},PaintingMain_default=_sfc_main$239;const usePartInventoryStore=defineStore(`partInventory`,()=>{let{events:events$3}=useBridge(),partInventoryData=ref({}),newPartsPopupOpen=ref(!1),newParts=ref([]),searchString=ref(``);function requestInitialData(){Lua_default.career_modules_partInventory.sendUIData()}function closeNewPartsPopup(){newPartsPopupOpen.value=!1}function closeMenu(){searchString.value=``,Lua_default.career_modules_partInventory.closeMenu()}function partInventoryClosed(){Lua_default.career_modules_partInventory.partInventoryClosed()}function dispose$2(){events$3.off(`partInventoryData`)}function openNewPartsPopup(newPartIds){newPartsPopupOpen.value=!0,newParts.value=[];for(let i=0;ipart.description.description.toLowerCase().includes(searchString.value.toLowerCase())||part.name.toLowerCase().includes(searchString.value.toLowerCase()),searchValueChanged=()=>{partInventoryData.value.partList.filter?partInventoryData.value.filteredPartList=partInventoryData.value.partList.filter(doesPartPassFilter):partInventoryData.value.filteredPartList={}};return watch(()=>searchString.value,searchValueChanged),events$3.on(`partInventoryData`,data=>{partInventoryData.value=data,searchValueChanged()}),{closeMenu,closeNewPartsPopup,dispose:dispose$2,newParts,newPartsPopupOpen,openNewPartsPopup,partInventoryClosed,partInventoryData,requestInitialData,searchString}});var _hoisted_1$210={style:{padding:`1em`}},_hoisted_2$169={class:`selectButtons`},_hoisted_3$148={class:`part-info-row`},_hoisted_4$123={class:`partList`},_hoisted_5$108=[`onClick`],_hoisted_6$91={class:`part-info-col`},_hoisted_7$79={class:`part-name`},_hoisted_8$65={class:`part-info-row`},_hoisted_9$58={class:`right`},_hoisted_10$49={class:`right`},_hoisted_11$44={class:`center`},_hoisted_12$33={class:`popup-buttons`},_sfc_main$238={__name:`PartSellingPopup`,props:{parts:{type:Array,default:[]}},emits:[`return`],setup(__props,{emit:__emit}){useUINavScope(`partSelling`);let{units}=useBridge(),partsChecked=ref([]),emit$1=__emit,props=__props,saleData=computed(()=>{let total=0,numberOfSelected=0;for(let[index,isChecked]of Object.entries(partsChecked.value))if(isChecked){let part=props.parts[index];total+=part.data.finalValue,numberOfSelected+=1}return{price:total,numberOfSelected}}),buildRefList=()=>{for(let i=0;i{for(let i=0;i{let partIds=[];for(let[index,isChecked]of Object.entries(partsChecked.value))if(isChecked){let part=props.parts[index];partIds.push(part.data.id)}Lua_default.career_modules_partInventory.sellParts(partIds),close()},close=()=>{emit$1(`return`,!0)};return onMounted(buildRefList),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-ui-scope":`partSelling`,class:`sellingCard`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Sell Parts`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_1$210,[createBaseVNode(`div`,_hoisted_2$169,[_cache[5]||=createTextVNode(` Select: `,-1),createBaseVNode(`div`,_hoisted_3$148,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,onClick:_cache[0]||=$event=>selectAll(!0)},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` All `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,onClick:_cache[1]||=$event=>selectAll(!1)},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` None `,-1)]]),_:1},8,[`accent`])])]),createBaseVNode(`div`,_hoisted_4$123,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.parts,(part,index)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`part-item`,partsChecked.value[index]?`partSelected`:``]),"bng-nav-item":``,onClick:$event=>partsChecked.value[index]=!partsChecked.value[index]},[createVNode(unref(bngIcon_default),{class:`selectionCheckbox`,type:partsChecked.value[index]?unref(icons).checkboxOn:unref(icons).checkboxOff},null,8,[`type`]),createBaseVNode(`div`,_hoisted_6$91,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$79,toDisplayString(part.name),1)]),createBaseVNode(`div`,_hoisted_8$65,[createBaseVNode(`span`,_hoisted_9$58,toDisplayString(part.mileage),1),createBaseVNode(`span`,_hoisted_10$49,[createVNode(unref(bngPropVal_default),{iconType:unref(icons).beamCurrency,valueLabel:part.valueFormatted},null,8,[`iconType`,`valueLabel`])]),createBaseVNode(`span`,_hoisted_11$44,toDisplayString(part.model),1)])])],10,_hoisted_5$108))),256))]),createBaseVNode(`div`,_hoisted_12$33,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:saleData.value.numberOfSelected<=0,"show-hold":``},{default:withCtx(()=>[createTextVNode(` Sell `+toDisplayString(saleData.value.numberOfSelected)+` parts for `,1),createVNode(unref(bngUnit_default),{money:saleData.value.price},null,8,[`money`])]),_:1},8,[`disabled`])),[[unref(BngClick_default),{holdCallback:sellSelectedParts,holdDelay:1e3,repeatInterval:0}]]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).attention,onClick:close},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1},8,[`accent`])])])]),_:1})),[[unref(BngOnUiNav_default),close,`back,menu`]])}},PartSellingPopup_default=__plugin_vue_export_helper_default(_sfc_main$238,[[`__scopeId`,`data-v-c325ab7a`]]),_hoisted_1$209={style:{height:`100%`,color:`white`}},_hoisted_2$168={key:0},_hoisted_3$147={class:`veh-part-caption`},_hoisted_4$122={class:`veh-name`},_hoisted_5$107={class:`veh-name-count`},_hoisted_6$90={class:`part-item`,"bng-ui-scope":`veh-part-inv`},_hoisted_7$78={key:0,class:`part-info-col`},_hoisted_8$64={class:`part-name`},_hoisted_9$57={class:`part-info-row`},_hoisted_10$48={class:`right`},_hoisted_11$43={class:`right`},_hoisted_12$32={key:0,class:`center`},_hoisted_13$28={key:1,class:`center`},_hoisted_14$26={class:`center`},_hoisted_15$25={key:0},_hoisted_16$25={class:`center`},_hoisted_17$20={key:0},immediateLimit=15,_sfc_main$237={__name:`PartList`,emits:[`partSold`],setup(__props,{emit:__emit}){let{units}=useBridge(),emit$1=__emit,partInventoryStore=usePartInventoryStore(),groupBy=ref(`location`),groups=ref([]),accordionItems=ref([]),disableInstallButtons=ref(!1),addExpandedFuncToGroup=group=>{group.onExpanded=state=>{let grp=groups.value.find(g=>g.id===group.id);if(grp.expanded=state,!state){delete grp.ready;let elm=document.querySelector(`[data-groupid="${group.id}"] > .bng-accitem-caption`);elm&&elm.focus();return}`ready`in grp||(grp.ready=!1,setTimeout(()=>{let grp$1=groups.value.find(g=>g.id===group.id);grp$1&&typeof grp$1.ready==`boolean`&&(grp$1.ready=!0)},100))}},openSellPopup=async()=>{await addPopup(PartSellingPopup_default,{parts:groups.value[0].parts}).promise&&emit$1(`partSold`)};watchEffect(()=>{if(disableInstallButtons.value=!1,!partInventoryStore||!Array.isArray(partInventoryStore.partInventoryData.partList)||partInventoryStore.partInventoryData.partList.length===0)return[];let res=[];if(groupBy.value==`location`){let group={id:0,name:` Inventory`,parts:[],expanded:!1,icon:icons.BNGFolder};addExpandedFuncToGroup(group),res.push(group);for(let[vehId,vehicle]of Object.entries(partInventoryStore.partInventoryData.vehicles)){let group$1={id:vehId,name:vehicle.niceName,parts:[],expanded:!1,thumbnail:partInventoryStore.partInventoryData.vehicles[vehId].thumbnail};addExpandedFuncToGroup(group$1),res.push(group$1)}}for(let part of partInventoryStore.partInventoryData.filteredPartList){let item={name:part.missingFile?`Missing File`:part.description.description,model:part.vehicleModel,mileage:units.buildString(`length`,part.partCondition.odometer,0),valueFormatted:units.beamBucks(part.finalValue),location:part.location,locationName:part.location===0?` Inventory`:partInventoryStore.partInventoryData.vehicles[part.location].niceName,functions:{install:!1,uninstall:!1,sell:!1},data:part};!part.missingFile&&part.accessible&&(item.functions.install=part.fitsCurrentVehicle&&part.location!==partInventoryStore.partInventoryData.currentVehicle&&(part.location===0||!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[part.location])&&!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[partInventoryStore.partInventoryData.currentVehicle],item.functions.uninstall=part.location!==0&&!part.isInCoreSlot&&!partInventoryStore.partInventoryData.brokenVehicleInventoryIds[part.location],item.functions.sell=part.location===0);let groupId=item[groupBy.value],group=res.find(g=>g.id==groupId);group||(group={id:groupId,name:item[`${groupBy.value}Name`]||item[groupBy.value],parts:[],expanded:!1},part.location>0?group.thumbnail=partInventoryStore.partInventoryData.vehicles[part.location].thumbnail:group.icon=icons.BNGFolder,addExpandedFuncToGroup(group),res.push(group)),group.parts.push(item)}if(res.length>0){let sorter=(a$1,b)=>a$1.name.localeCompare(b.name);res.sort(sorter);for(let group of res)group.parts.sort(sorter)}for(let group of groups.value)if(group.ready){let grp=res.find(g=>g.name===group.name);grp&&(grp.expanded=!0,grp.ready=!0)}groups.value=res});let confirmSellPart=async partToSell=>{await openConfirmation(partToSell.description.description,`Do you want to sell this part for ${units.beamBucks(partToSell.finalValue)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&sellPart(partToSell)},sellPart=part=>{Lua_default.career_modules_partInventory.sellParts([part.id]),emit$1(`partSold`)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$209,[createVNode(unref(bngInput_default),{class:`searchField`,"floating-label":`Search`,"leading-icon":unref(icons).search,modelValue:unref(partInventoryStore).searchString,"onUpdate:modelValue":_cache[0]||=$event=>unref(partInventoryStore).searchString=$event,modelModifiers:{trim:!0}},null,8,[`leading-icon`,`modelValue`]),withDirectives((openBlock(),createBlock(unref(bngCard_default),{style:{"max-height":`90%`}},{default:withCtx(()=>[unref(partInventoryStore)?(openBlock(),createBlock(unref(accordion_default),{key:1,class:`part-groups`,singular:``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(groups.value,(group,index)=>(openBlock(),createBlock(unref(accordionItem_default),{key:group.id,"data-groupid":group.id,ref_for:!0,ref_key:`accordionItems`,ref:accordionItems,navigable:``,onExpanded:group.onExpanded,onSelected:$event=>accordionItems.value[index]?accordionItems.value[index].captionClick():void 0},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$147,[group.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`veh-icon`,type:group.icon},null,8,[`type`])):createCommentVNode(``,!0),group.thumbnail?(openBlock(),createElementBlock(`div`,{key:1,class:`veh-preview`,style:normalizeStyle({backgroundImage:`url('${group.thumbnail}')`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`span`,_hoisted_4$122,[createTextVNode(toDisplayString(group.name)+` `,1),createBaseVNode(`span`,_hoisted_5$107,`(`+toDisplayString(group.parts.length)+`)`,1)])])]),default:withCtx(()=>[group.name==` Inventory`?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).outlined,onClick:_cache[1]||=$event=>openSellPopup()},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Sell Parts `,-1)]]),_:1},8,[`accent`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.parts,(part,index$1)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$90,[group.ready||index$1confirmSellPart(part.data)},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` Sell `,-1)]]),_:1},8,[`accent`,`onClick`])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),()=>group.onExpanded(!1),`back`]])),256))]),_:2},1032,[`data-groupid`,`onExpanded`,`onSelected`]))),128))]),_:1})):(openBlock(),createElementBlock(`div`,_hoisted_2$168,` Please wait... `))]),_:1})),[[unref(BngDisabled_default),!unref(partInventoryStore)]])])),[[unref(BngBlur_default)]])}},PartList_default=__plugin_vue_export_helper_default(_sfc_main$237,[[`__scopeId`,`data-v-7c222f4e`]]),_hoisted_1$208={style:{width:`100%`}},_sfc_main$236={__name:`PartInventoryAddedParts`,props:{parts:{type:Object,default:{}}},setup(__props){let{units}=useBridge(),getLocationName=part=>part.location?`Vehicle No. `+part.location+` (`+part.vehicleModel+`)`:`Inventory`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[_cache[1]||=createTextVNode(` The following additional parts have been added to the vehicle from your inventory to fill the core slots: `,-1),createBaseVNode(`table`,_hoisted_1$208,[_cache[0]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`,null,`id`),createBaseVNode(`th`,null,`Description`),createBaseVNode(`th`,null,`Location`),createBaseVNode(`th`,null,`Mileage`),createBaseVNode(`th`,null,`Part Value`)])],-1),createBaseVNode(`tbody`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.parts,(part,key)=>(openBlock(),createElementBlock(`tr`,{key},[createBaseVNode(`td`,null,toDisplayString(part.id),1),createBaseVNode(`td`,null,toDisplayString(part.description.description),1),createBaseVNode(`td`,null,toDisplayString(getLocationName(part)),1),createBaseVNode(`td`,null,toDisplayString(unref(units).buildString(`length`,part.partCondition.odometer,0)),1),createBaseVNode(`td`,null,toDisplayString(unref(units).beamBucks(part.finalValue)),1)]))),128))])])]))}},PartInventoryAddedParts_default=__plugin_vue_export_helper_default(_sfc_main$236,[[`__scopeId`,`data-v-8dbd3a82`]]),_sfc_main$235={__name:`PartInventoryMain`,setup(__props){useComputerStore();let wrapper=ref(),partInventoryStore=usePartInventoryStore();watch(()=>partInventoryStore.newPartsPopupOpen,(newVal,oldVal)=>newVal&&confirmAddedParts());let confirmAddedParts=async vehicle=>{await openMessage(``,{component:markRaw(PartInventoryAddedParts_default),props:{parts:partInventoryStore.newParts}}),closeNewPartsPopup()},updateCareerStatus=()=>{wrapper.value.statusUpdate()};onBeforeMount(()=>{partInventoryStore.requestInitialData()}),onUnmounted(()=>{partInventoryStore.partInventoryClosed(),partInventoryStore.$dispose()});let close=()=>{partInventoryStore.closeMenu()},closeNewPartsPopup=()=>{partInventoryStore.closeNewPartsPopup()};return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref_key:`wrapper`,ref:wrapper,path:[`Part Inventory`],title:`Part Inventory`,back:``,onBack:close},{default:withCtx(()=>[createVNode(PartList_default,{class:`part-inventory`,onPartSold:updateCareerStatus})]),_:1},512))}},PartInventoryMain_default=__plugin_vue_export_helper_default(_sfc_main$235,[[`__scopeId`,`data-v-54c60dea`]]);const usePartShoppingStore=defineStore(`partShopping`,()=>{let{events:events$3}=useBridge(),partShoppingData=ref({}),filteredSlots=ref([]),path=ref(``),filteredParts=ref([]),category=ref(``),expandedSlots=ref({}),searchString=``,slotToScrollTo=ref(),backAction=()=>{},slotsDict={},partFilter;function doesNameContainString(name,searchStrings){for(let searchString$1 of searchStrings)if(name.includes(searchString$1))return!0;return!1}function filterParts(){if(filteredParts.value=[],slotsDict={},partShoppingData.value.partsInShop){for(let[_,part]of Object.entries(partShoppingData.value.partsInShop)){if(!part.slot)continue;partFilter?doesNameContainString(part.name,partFilter)&&filteredParts.value.push(part):part.containingSlot===path.value&&filteredParts.value.push(part);let niceName=partShoppingData.value.slotsNiceName[part.slot];niceName==null?slotsDict[part.slot]=part.slot:slotsDict[part.slot]=niceName}filteredParts.value.sort((a$1,b)=>a$1.emptyPlaceholder?-1:b.emptyPlaceholder?1:a$1.partId&&!b.partId?-1:!a$1.partId&&b.partId?1:a$1.description.description0?(filteredSlotsDict=getSlotsFromSearchString(),filteredSlots.value=partShoppingData.value.searchSlotList.filter(doesSlotPassFilter)):filteredSlots.value=[]}function setSlotExpanded(path$1,expanded){expandedSlots.value[path$1]=expanded}function setSlot(_slot){_slot==``&&(slotToScrollTo.value=path.value),path.value=_slot,partFilter=void 0,filterParts()}function setCategory(_category){category.value=_category,filterSlots(),category.value==`everything`||category.value==``?setSlot(``):category.value==`cargo`&&(path.value=`Blablabla`,partFilter=[`cargo_load`],filterParts())}let requestInitialData=()=>{Lua_default.career_modules_partShopping.sendShoppingDataToUI()},cancelShopping=()=>{expandedSlots.value={},Lua_default.career_modules_partShopping.cancelShopping(),setCategory(``)};function fixSlots(slot){if(`children`in slot){Array.isArray(slot.children)||(slot.children=Object.values(slot.children).filter(Boolean)),slot.children.sort((a$1,b)=>(a$1.slotNiceName||a$1.slot)<(b.slotNiceName||b.slot)?-1:1);for(let childSlot of slot.children)fixSlots(childSlot)}}let handleShoppingData=data=>{data.partTree&&fixSlots(data.partTree),partShoppingData.value=data,filterParts(),filterSlots()},searchValueChanged=_searchString=>{searchString=_searchString,filterSlots()},listen=state=>{events$3[state?`on`:`off`](`partShoppingData`,handleShoppingData)};listen(!0);function dispose$2(){listen(!1)}return{partShoppingData,slot:path,filteredSlots,filteredParts,category,expandedSlots,slotToScrollTo,searchValueChanged,setSlot,setCategory,requestInitialData,cancelShopping,dispose:dispose$2,setSlotExpanded,set backAction(actionFunc){backAction=actionFunc},get backAction(){return backAction}}});var _hoisted_1$207={class:`cart-main`},_hoisted_2$167={class:`cart-list`,"bng-nav-scroll":``},_hoisted_3$146={key:0,class:`extra-info-text`},_hoisted_4$121={key:0},_hoisted_5$106={key:1},_hoisted_6$89={class:`cart-row cart-subtotal`},_hoisted_7$77={class:`cart-row cart-tax`},_hoisted_8$63={class:`cart-row cart-total`},_sfc_main$234={__name:`ShoppingCart`,props:{cartData:Object,playerMoney:Number,apply:Function,cancel:Function,confirmButtonText:String},setup(__props){let props=__props,{units}=useBridge(),expanded=ref(!1),subtotal=computed(()=>props.cartData&&props.cartData.total&&props.cartData.taxes?props.cartData.total-props.cartData.taxes:0),salesTax=computed(()=>props.cartData&&props.cartData.taxes?props.cartData.taxes:0);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass([`cart`,{expanded:expanded.value}])},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{"show-hold":``,disabled:!__props.apply||!__props.cartData||__props.cartData.items.length===0||__props.cartData.total>0&&__props.cartData.total>__props.playerMoney},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.confirmButtonText||`Purchase`),1)]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:__props.apply,holdDelay:1e3,repeatInterval:0}]]),createVNode(unref(bngButton_default),{disabled:!__props.cancel,onClick:_cache[1]||=$event=>props.cancel(),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Cancel `,-1)]]),_:1},8,[`disabled`,`accent`])]),default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Shopping Cart `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`cart-expand`,accent:unref(ACCENTS).outlined,icon:expanded.value?unref(icons).arrowLargeDown:unref(icons).arrowLargeUp,onClick:_cache[0]||=$event=>expanded.value=!expanded.value},null,8,[`accent`,`icon`]),createBaseVNode(`div`,_hoisted_1$207,[_cache[9]||=createBaseVNode(`div`,{class:`cart-row cart-header`},[createBaseVNode(`div`),createBaseVNode(`div`,null,`Part`),createBaseVNode(`div`,null,`Price`)],-1),createBaseVNode(`div`,_hoisted_2$167,[__props.cartData?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.cartData.items,item=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`cart-row`,item.type?[`type-${item.type}`]:null])},[createBaseVNode(`div`,null,[item.removeShow?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:`attention`,icon:unref(icons).abandon,disabled:item.removeDisabled,onClick:$event=>item.remove()},null,8,[`icon`,`disabled`,`onClick`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,{style:normalizeStyle({paddingLeft:item.level?`${item.level-1}em`:void 0})},[createTextVNode(toDisplayString(item.name)+` `,1),item.extraInfo?(openBlock(),createElementBlock(`div`,_hoisted_3$146,toDisplayString(item.extraInfo),1)):createCommentVNode(``,!0)],4),item.priceHide?(openBlock(),createElementBlock(`div`,_hoisted_5$106)):(openBlock(),createElementBlock(`div`,_hoisted_4$121,toDisplayString(unref(units).beamBucks(item.price)),1))],2))),256)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$89,[_cache[3]||=createBaseVNode(`div`,null,null,-1),_cache[4]||=createBaseVNode(`div`,null,`Subtotal`,-1),createBaseVNode(`div`,null,toDisplayString(unref(units).beamBucks(subtotal.value)),1)]),createBaseVNode(`div`,_hoisted_7$77,[_cache[5]||=createBaseVNode(`div`,null,null,-1),_cache[6]||=createBaseVNode(`div`,null,`Sales Tax (7%)`,-1),createBaseVNode(`div`,null,toDisplayString(unref(units).beamBucks(salesTax.value)),1)])]),createBaseVNode(`div`,_hoisted_8$63,[_cache[7]||=createBaseVNode(`div`,null,null,-1),_cache[8]||=createBaseVNode(`div`,null,`Total`,-1),createBaseVNode(`div`,null,[createVNode(unref(bngUnit_default),{money:__props.cartData?__props.cartData.total:0},null,8,[`money`])])])])]),_:1},8,[`class`]))}},ShoppingCart_default=__plugin_vue_export_helper_default(_sfc_main$234,[[`__scopeId`,`data-v-e9392f36`]]),_hoisted_1$206={class:`parts-wrapper`},_hoisted_2$166={key:2,class:`parts-list`},_hoisted_3$145={class:`part-info-col`},_hoisted_4$120={class:`part-name`},_hoisted_5$105={key:0},_hoisted_6$88={key:1},_hoisted_7$76={key:2},_hoisted_8$62={class:`part-info-row`},_hoisted_9$56={key:0,class:`mileage-text`},_hoisted_10$47={key:1},_hoisted_11$42={key:2,class:`disabled-reason`},_hoisted_12$31={key:3,class:`right`},_hoisted_13$27={key:0},_sfc_main$233={__name:`PartsList`,setup(__props){let partShoppingStore=usePartShoppingStore(),{units}=useBridge(),oldBack,isPartInShoppingCart=part=>{if(!partShoppingStore.partShoppingData||!partShoppingStore.partShoppingData.shoppingCart)return!1;let partList=partShoppingStore.partShoppingData.shoppingCart.partsInList;for(let i=0;i{oldBack=partShoppingStore.backAction,partShoppingStore.backAction=()=>partShoppingStore.setSlot(``)}),onUnmounted(()=>{partShoppingStore.backAction=oldBack}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$206,[unref(partShoppingStore).category===`cargo`?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Cargo `,-1)]]),_:1})):unref(partShoppingStore).filteredParts[0]?(openBlock(),createBlock(unref(bngCardHeading_default),{key:1},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(partShoppingStore).partShoppingData.slotsNiceName[unref(partShoppingStore).filteredParts[0].containingSlot]),1)]),_:1})):createCommentVNode(``,!0),unref(partShoppingStore).filteredParts?(openBlock(),createElementBlock(`div`,_hoisted_2$166,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(partShoppingStore).filteredParts,part=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`part-item`,{"part-installed":unref(partShoppingStore).partShoppingData.vehicleSlotToPartMap[part.containingSlot]&&unref(partShoppingStore).partShoppingData.vehicleSlotToPartMap[part.containingSlot].description.description===part.description.description,disabled:part.disabled}])},[createBaseVNode(`div`,_hoisted_3$145,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_4$120,[part.partId?(openBlock(),createElementBlock(`div`,_hoisted_5$105,toDisplayString(part.description.description)+` (Inventory) `,1)):part.emptyPlaceholder?(openBlock(),createElementBlock(`div`,_hoisted_6$88,` Remove current part `)):(openBlock(),createElementBlock(`div`,_hoisted_7$76,toDisplayString(part.description.description),1))])]),createBaseVNode(`div`,_hoisted_8$62,[part.partId?(openBlock(),createElementBlock(`span`,_hoisted_9$56,` Mileage: `+toDisplayString(unref(units).buildString(`length`,part.partCondition.odometer,0)),1)):createCommentVNode(``,!0),unref(partShoppingStore).category===`cargo`?(openBlock(),createElementBlock(`span`,_hoisted_10$47,toDisplayString(unref(partShoppingStore).partShoppingData.slotsNiceName[part.containingSlot]),1)):createCommentVNode(``,!0),part.disabled&&part.disabledReason?(openBlock(),createElementBlock(`span`,_hoisted_11$42,toDisplayString(part.disabledReason),1)):createCommentVNode(``,!0),!part.partId&&!part.emptyPlaceholder?(openBlock(),createElementBlock(`span`,_hoisted_12$31,[createVNode(unref(bngPropVal_default),{iconType:unref(icons).beamCurrency,valueLabel:unref(units).beamBucks(part.finalValue)},null,8,[`iconType`,`valueLabel`])])):createCommentVNode(``,!0)])]),createVNode(unref(bngButton_default),{accent:isPartInShoppingCart(part)?unref(ACCENTS).attention:unref(ACCENTS).outlined,class:`part-button`,disabled:part.disabled||unref(partShoppingStore).partShoppingData.tutorialPartNames!==void 0&&(!unref(partShoppingStore).partShoppingData.tutorialPartNames[part.name]||isPartInShoppingCart(part)),onClick:$event=>isPartInShoppingCart(part)?unref(Lua_default).career_modules_partShopping.removePartBySlot(part.containingSlot):unref(Lua_default).career_modules_partShopping.installPartByPartShopId(part.partShopId),icon:isPartInShoppingCart(part)?unref(icons).undo:``},{default:withCtx(()=>[isPartInShoppingCart(part)?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_13$27,toDisplayString(part.emptyPlaceholder?`Remove`:`Install`),1))]),_:2},1032,[`accent`,`disabled`,`onClick`,`icon`])],2))),256))])):createCommentVNode(``,!0)]))}},PartsList_default=__plugin_vue_export_helper_default(_sfc_main$233,[[`__scopeId`,`data-v-c224fcea`]]),_hoisted_1$205={key:0,class:`highlighted`},_hoisted_2$165={key:1,class:`slot-path`},_hoisted_3$144={class:`buy-button-label`},_sfc_main$232={__name:`SlotItem`,props:{static:Boolean,expanded:Boolean,path:String,nicePath:String,slotNiceName:String,partNiceName:String},setup(__props){let slotItem=ref(),focused$1=ref(!1),props=__props;onMounted(()=>{partShoppingStore.slotToScrollTo&&props.path===partShoppingStore.slotToScrollTo&&slotItem.value.scrollIntoView({block:`center`})});let partShoppingStore=usePartShoppingStore(),itemExpanded=val=>{partShoppingStore.setSlotExpanded(props.path,val)},onFocus=val=>{focused$1.value=!0},onUnfocus=val=>{focused$1.value=!1},selectSlot=val=>{partShoppingStore.setSlot(props.path)};return(_ctx,_cache)=>(openBlock(),createBlock(unref(accordionItem_default),{static:__props.static,expanded:__props.expanded,onExpanded:itemExpanded,onFocus,onUnfocus,onSelected:selectSlot,navigable:``,"primary-action":()=>unref(partShoppingStore).setSlot(__props.path),"expand-hint-inline":``,"primary-hint-inline":``},{caption:withCtx(()=>[unref(partShoppingStore).slotToScrollTo===__props.path?(openBlock(),createElementBlock(`div`,_hoisted_1$205)):createCommentVNode(``,!0),__props.nicePath?(openBlock(),createElementBlock(`span`,_hoisted_2$165,toDisplayString(__props.nicePath),1)):createCommentVNode(``,!0),createBaseVNode(`span`,{ref_key:`slotItem`,ref:slotItem,class:`slot-name`},toDisplayString(__props.slotNiceName),513)]),controls:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{"bng-no-nav":`true`,class:`buy-button`,accent:unref(ACCENTS).outlined,onClick:_cache[0]||=$event=>unref(partShoppingStore).setSlot(__props.path),style:normalizeStyle({backgroundColor:unref(partShoppingStore).slotToScrollTo&&unref(partShoppingStore).slotToScrollTo==__props.path?`rgba(75,75,75,0.8)`:``})},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_3$144,toDisplayString(__props.partNiceName?__props.partNiceName:`-`),1)]),_:1},8,[`accent`,`style`])),[[unref(BngTooltip_default),__props.partNiceName,`top`]])]),default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),_:3},8,[`static`,`expanded`,`primary-action`]))}},SlotItem_default=__plugin_vue_export_helper_default(_sfc_main$232,[[`__scopeId`,`data-v-3223c56d`]]),_sfc_main$231={__name:`PartSubTree`,props:{children:Object},setup(__props){let slotItemRefs=ref([]),partShoppingStore=usePartShoppingStore();return(_ctx,_cache)=>(openBlock(),createBlock(unref(accordion_default),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.children,childSlot=>(openBlock(),createBlock(SlotItem_default,{ref_for:!0,ref_key:`slotItemRefs`,ref:slotItemRefs,static:!childSlot.chosenPartName||!childSlot.children||Object.keys(childSlot.children).length===0,expanded:unref(partShoppingStore).expandedSlots[childSlot.path],path:childSlot.path,slotNiceName:childSlot.slotNiceName,partNiceName:childSlot.chosenPartNiceName},{default:withCtx(()=>[childSlot.children&&Object.keys(childSlot.children).length>0?(openBlock(),createBlock(PartSubTree_default,{key:0,children:childSlot.children},null,8,[`children`])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`path`,`slotNiceName`,`partNiceName`]))),256))]),_:1}))}},PartSubTree_default=_sfc_main$231,_hoisted_1$204={class:`innerList`},_sfc_main$230={__name:`SlotList`,props:{cancel:Function},setup(__props){let partShoppingStore=usePartShoppingStore(),props=__props,searchValue=ref(``),searchValueChanged=()=>{partShoppingStore.searchValueChanged(searchValue.value)};return onMounted(()=>{partShoppingStore.backAction,partShoppingStore.backAction=()=>partShoppingStore.setCategory(``)}),onUnmounted(()=>{partShoppingStore.backAction=()=>props.cancel()}),(_ctx,_cache)=>unref(partShoppingStore).slot===``?(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(bngInput_default),{"floating-label":`Search`,"leading-icon":unref(icons).search,modelValue:searchValue.value,"onUpdate:modelValue":_cache[0]||=$event=>searchValue.value=$event,modelModifiers:{trim:!0},onValueChanged:searchValueChanged},null,8,[`leading-icon`,`modelValue`]),createBaseVNode(`div`,_hoisted_1$204,[searchValue.value.length>0?(openBlock(),createBlock(unref(accordion_default),{key:0,class:`slot-flat-view`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(partShoppingStore).filteredSlots,slotInfo=>(openBlock(),createBlock(SlotItem_default,{static:!0,path:slotInfo.path,nicePath:slotInfo.nicePath,slotNiceName:slotInfo.slotNiceName,partNiceName:slotInfo.partNiceName?slotInfo.partNiceName:null},null,8,[`path`,`nicePath`,`slotNiceName`,`partNiceName`]))),256))]),_:1})):unref(partShoppingStore).partShoppingData.partTree.children?(openBlock(),createBlock(PartSubTree_default,{key:1,class:`slot-tree-view`,children:unref(partShoppingStore).partShoppingData.partTree.children},null,8,[`children`])):createCommentVNode(``,!0)])],64)):(openBlock(),createBlock(PartsList_default,{key:0}))}},SlotList_default=__plugin_vue_export_helper_default(_sfc_main$230,[[`__scopeId`,`data-v-f602b7c1`]]),_hoisted_1$203={key:0,class:`mainCategories`},_hoisted_2$164=[`disabled`],_sfc_main$229={__name:`Categories`,props:{cancel:Function},setup(__props){let partShoppingStore=usePartShoppingStore(),props=__props;return onMounted(()=>{partShoppingStore.backAction=()=>props.cancel()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:`categoryList`},{default:withCtx(()=>[unref(partShoppingStore).category===``?(openBlock(),createElementBlock(`div`,_hoisted_1$203,[withDirectives((openBlock(),createElementBlock(`div`,{class:`computer-function-tile`,"bng-nav-item":``,tabindex:`0`,disabled:unref(partShoppingStore).partShoppingData.tutorialPartNames===void 0?void 0:!0,onClick:_cache[0]||=$event=>unref(partShoppingStore).partShoppingData.tutorialPartNames===void 0?unref(partShoppingStore).setCategory(`everything`):void 0},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).doorFrontCoins},null,8,[`type`]),_cache[2]||=createBaseVNode(`span`,{class:`label`},`All Parts`,-1)],8,_hoisted_2$164)),[[unref(BngFocusIf_default),!0]]),createBaseVNode(`div`,{class:`computer-function-tile`,"bng-nav-item":``,tabindex:`0`,onClick:_cache[1]||=$event=>unref(partShoppingStore).setCategory(`cargo`)},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons).boxPickUp03},null,8,[`type`]),_cache[3]||=createBaseVNode(`span`,{class:`label`},`Cargo Parts`,-1)])])):(openBlock(),createBlock(SlotList_default,{key:1,cancel:props.cancel},null,8,[`cancel`]))]),_:1}))}},Categories_default=__plugin_vue_export_helper_default(_sfc_main$229,[[`__scopeId`,`data-v-70c591df`]]),CANCEL_MESSAGE$1=`Are you sure you want to cancel?
All changes to your vehicle will be reversed`,_sfc_main$228={__name:`PartShoppingMain`,setup(__props){let{$game}=useLibStore();useComputerStore();let partShoppingStore=usePartShoppingStore(),CONFIRM_BUTTONS=[{label:$translate.instant(`ui.common.yes`),value:!0},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}],confirmCancel=async()=>{(!partShoppingStore.partShoppingData.shoppingCart.partsInList.length||await openConfirmation(null,CANCEL_MESSAGE$1,CONFIRM_BUTTONS))&&cancelShopping()},getPartName=item=>item.description.description+(item.partId?` (Inventory)`:``),cartData=computed(()=>{let cart=partShoppingStore.partShoppingData?partShoppingStore.partShoppingData.shoppingCart:null,res={total:0,taxes:0,items:[]};return cart&&(res.total=cart.total,res.taxes=cart.taxes,Array.isArray(cart.partsInList)&&(res.items=cart.partsInList.map(item=>({name:getPartName(item),price:item.finalValue,extraInfo:item.partCondition?.odometer?`Mileage: `+$game.units.buildString(`length`,item.partCondition.odometer,0):void 0,removeShow:!!item.sourcePart,removeDisabled:!!partShoppingStore.partShoppingData.tutorialPartNames,remove:()=>Lua_default.career_modules_partShopping.removePartBySlot(item.containingSlot)})))),res}),applyShopping=()=>Lua_default.career_modules_partShopping.applyShopping(),cancelShopping=()=>Lua_default.career_modules_partShopping.cancelShopping(),start=()=>{partShoppingStore.setSlot(``),partShoppingStore.requestInitialData(),getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar)},kill=()=>{partShoppingStore.cancelShopping(),getUINavServiceInstance().clearFilteredEvents(),partShoppingStore.$dispose()},close=()=>{partShoppingStore.backAction()};return onBeforeMount(start),onUnmounted(kill),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Part Customization`],title:`Parts`,back:``,onBack:close},{side:withCtx(()=>[createVNode(ShoppingCart_default,{partShoppingData:unref(partShoppingStore).partShoppingData,"cart-data":cartData.value,"player-money":unref(partShoppingStore).partShoppingData.playerMoney,apply:applyShopping,cancel:confirmCancel,"confirm-button-text":`Confirm`},null,8,[`partShoppingData`,`cart-data`,`player-money`])]),default:withCtx(()=>[withDirectives(createVNode(Categories_default,{cancel:confirmCancel},null,512),[[unref(BngBlur_default),1]])]),_:1}))}},PartShoppingMain_default=__plugin_vue_export_helper_default(_sfc_main$228,[[`__scopeId`,`data-v-871a3a9f`]]),_hoisted_1$202={class:`profile-status`},_hoisted_2$163={class:`profile-status-progress`},_hoisted_3$143={class:`status-progress-item`},_hoisted_4$119={class:`status-progress-item`},_hoisted_5$104={class:`status-progress-item`},_hoisted_6$87={key:0,class:`profile-status-levels`},_hoisted_7$75={class:`profile-status-level`},_hoisted_8$61={class:`branch-icon-assembly`},_hoisted_9$55={class:`level-content-wrapper`},_sfc_main$227={__name:`ProfileStatus`,props:{beamXP:{type:Object,required:!0},vouchers:{type:Object,required:!0},money:{type:Object,required:!0},insuranceScore:{type:Object,required:!0},branches:{type:Array,required:!0},expanded:Boolean},setup(__props){let props=__props,formatterFn=num=>shrinkNum(num,1),moneyFormatter=computed(()=>props.money&&props.money>1e5?formatterFn:void 0);computed(()=>props.beamXP&&props.beamXP>1e5?formatterFn:void 0);let vouchersFormatter=computed(()=>props.vouchers&&props.vouchers>1e5?formatterFn:void 0);function getBranchStyle(color){return getIconBackgroundStyle(color)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$202,[createBaseVNode(`div`,_hoisted_2$163,[createBaseVNode(`div`,_hoisted_3$143,[createVNode(unref(bngUnit_default),{insuranceScore:__props.insuranceScore?.value||0},null,8,[`insuranceScore`])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_4$119,[createVNode(unref(bngUnit_default),{vouchers:__props.vouchers?.value||0,formatter:vouchersFormatter.value},null,8,[`vouchers`,`formatter`])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_5$104,[createVNode(unref(bngUnit_default),{money:__props.money?.value||0,formatter:moneyFormatter.value},null,8,[`money`,`formatter`])])]),createVNode(Transition,{name:`expand-height`},{default:withCtx(()=>[__props.branches?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$87,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_7$75,[createBaseVNode(`div`,_hoisted_8$61,[createBaseVNode(`div`,{class:`branch-background`,style:normalizeStyle(getBranchStyle(branch.color))},null,4),createVNode(unref(bngIcon_default),{type:branch.icon,class:`assembly-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_9$55,[createVNode(unref(bngProgressBar_default),{class:`slim`,value:branch.curLvlProgress,min:0,max:branch.neededForNext,headerLeft:_ctx.$ctx_t(branch.label),headerRight:`${_ctx.$ctx_t(branch.levelLabel)} `,valueColor:`white`,showValueLabel:!1},null,8,[`value`,`max`,`headerLeft`,`headerRight`])])]))),256))],512)),[[vShow,__props.expanded]]):createCommentVNode(``,!0)]),_:1})]))}},ProfileStatus_default=__plugin_vue_export_helper_default(_sfc_main$227,[[`__scopeId`,`data-v-26c35504`]]),_hoisted_1$201={style:{position:`absolute`,left:`0`,right:`0`,top:`0`,bottom:`0`,background:`rgba(0,0,0,0.5)`}},_sfc_main$226={__name:`PauseMapPreview`,setup(__props){let levelTitle=ref(``),levelImage=ref(``);function setup$3(data){levelTitle.value=$translate.contextTranslate(data.title,!0),levelImage.value=data.previews[0]}let start=()=>{Lua_default.career_modules_uiUtils.getCareerCurrentLevelName().then(setup$3)};function goToBigMap(){Lua_default.freeroam_bigMapMode.enterBigMap()}return onMounted(start),(_ctx,_cache)=>{let _directive_bng_sound_class=resolveDirective(`bng-sound-class`);return withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{"external-image":`/levels/west_coast_usa/spawns_quarry.jpg`,ratio:`4:3`,onClick:_cache[1]||=$event=>goToBigMap()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$201,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(levelTitle.value),1)]),_:1}),createVNode(unref(bngButton_default),{style:{position:`absolute`,bottom:`1em`,right:`1em`},tabindex:`1`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>goToBigMap()},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Open Map`,-1)]]),_:1},8,[`accent`])])]),_:1})),[[_directive_bng_sound_class,`bng_click_generic`]])}}},PauseMapPreview_default=__plugin_vue_export_helper_default(_sfc_main$226,[[`__scopeId`,`data-v-5a91faef`]]),_hoisted_1$200={class:`content-wrapper`},_hoisted_2$162={class:`cards-container`},_sfc_main$225={__name:`PauseMilestonesPreview`,setup(__props){let milestones=ref([]);function setup$3(data){milestones.value=data.list}let start=()=>{Lua_default.career_modules_milestones_milestones.getMilestones().then(setup$3)};function goToMilestones(){window.bngVue.gotoGameState(`milestones`)}return onMounted(start),(_ctx,_cache)=>{let _directive_bng_sound_class=resolveDirective(`bng-sound-class`);return withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{onClick:_cache[1]||=$event=>goToMilestones(),ratio:`4:3`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$200,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Recent Milestones`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$162,[(openBlock(!0),createElementBlock(Fragment,null,renderList(milestones.value.slice(0,5),entry=>(openBlock(),createBlock(MilestoneCard_default,{milestone:entry,isCondensed:!0},null,8,[`milestone`]))),256))]),createVNode(unref(bngButton_default),{style:{position:`absolute`,bottom:`1em`,right:`1em`},tabindex:`1`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>goToMilestones()},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Go to Milestones`,-1)]]),_:1},8,[`accent`])])]),_:1})),[[_directive_bng_sound_class,`bng_click_generic`]])}}},PauseMilestonesPreview_default=__plugin_vue_export_helper_default(_sfc_main$225,[[`__scopeId`,`data-v-7fcfd236`]]),_hoisted_1$199={class:`pause-body-wrapper`},_hoisted_2$161={class:`heading-container`},_hoisted_3$142={class:`buttons-and-status`},_hoisted_4$118={key:0,class:`indicator`},_hoisted_5$103={class:`save-load-row`},_hoisted_6$86={class:`status-container`},_hoisted_7$74={key:2,class:`vehicle-name`},_sfc_main$224={__name:`Pause`,setup(__props){useUINavScope(`pause`),ref({value:0,label:`Map`,type:`Map`}.type),ref(null),ref(.5);let contextButtons=ref({});function setupContextButtons(data){contextButtons.value=data.buttons}Lua_default.career_modules_uiUtils.getCareerPauseContextButtons().then(setupContextButtons);function onContextButtonClicked(btn){Lua_default.career_modules_uiUtils.callCareerPauseContextButtons(btn.functionId)}function onSaveButtonClicked(){Lua_default.career_saveSystem.saveCurrent(),exit()}async function onLoadButtonClicked(){await openConfirmation(`Load Profile`,`Are you sure you want to load a different profile? Any unsaved progress will be lost.`)&&window.bngVue.gotoGameState(`profiles`)}let exit=()=>window.bngVue.gotoGameState(`play`),saveSlotData=ref(null),currentVehicleName=ref(``);function makeVehicleName(data){return!data||data.key===`unicycle`?`Walking`:data.niceName}return onMounted(async()=>{let data=await Lua_default.career_career.sendCurrentSaveSlotData();saveSlotData.value=data,currentVehicleName.value=makeVehicleName(data.currentVehicle)}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`careerPause`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`careerPause`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`career-pause-layout`,"bng-ui-scope":`pause`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$199,[createBaseVNode(`div`,_hoisted_2$161,[createVNode(unref(bngCardHeading_default),{class:`pause-heading`,type:`ribbon`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(`Career: Paused`,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_3$142,[createVNode(unref(bngCard_default),{class:`system-buttons`},{default:withCtx(()=>[createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:exit},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Resume`,-1)]]),_:1},8,[`accent`]),contextButtons.value.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(contextButtons.value,btn=>(openBlock(),createBlock(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:$event=>onContextButtonClicked(btn)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(btn.label))+` `,1),btn.showIndicator?(openBlock(),createElementBlock(`div`,_hoisted_4$118)):createCommentVNode(``,!0)]),_:2},1032,[`accent`,`onClick`]))),256)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_5$103,[createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSaveButtonClicked},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Save`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`button`,tabindex:`1`,accent:unref(ACCENTS).text,onClick:onLoadButtonClicked},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Load`,-1)]]),_:1},8,[`accent`])])]),_:1}),createBaseVNode(`div`,_hoisted_6$86,[saveSlotData.value?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,class:`profile-name`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(saveSlotData.value.id),1)]),_:1})):createCommentVNode(``,!0),saveSlotData.value?(openBlock(),createBlock(ProfileStatus_default,{key:1,class:`pause-profile-status`,expanded:!0,beamXP:saveSlotData.value.beamXP,vouchers:saveSlotData.value.vouchers,money:saveSlotData.value.money,insuranceScore:saveSlotData.value.insuranceScore,branches:saveSlotData.value.branches},null,8,[`beamXP`,`vouchers`,`money`,`insuranceScore`,`branches`])):createCommentVNode(``,!0),saveSlotData.value?(openBlock(),createElementBlock(`div`,_hoisted_7$74,[createVNode(unref(bngIcon_default),{type:unref(icons).car},null,8,[`type`]),createTextVNode(` `+toDisplayString(currentVehicleName.value),1)])):createCommentVNode(``,!0)])])])]),_:1})),[[unref(BngOnUiNav_default),exit,`menu,back`],[unref(BngBlur_default),!0]])}},Pause_default=__plugin_vue_export_helper_default(_sfc_main$224,[[`__scopeId`,`data-v-c6f22d14`]]),_hoisted_1$198={class:`career-pause-wrapper`},_hoisted_2$160={class:`layout-center-wrapper`},_hoisted_3$141={class:`pause-body-wrapper`},_hoisted_4$117={class:`left-content`},_hoisted_5$102={class:`tabs-group`},_hoisted_6$85={class:`tab-content`},_hoisted_7$73={style:{position:`absolute`,left:`0`,right:`0`,top:`0`,bottom:`0`,background:`rgba(0, 0, 0, 0.5)`}},_hoisted_8$60={class:`right-content`},_hoisted_9$54={class:`bottom-content`},ICON_RATIO=`2.25:1`,_sfc_main$223={__name:`PauseBigMiddlePanel`,setup(__props){useUINavScope(`pause`);let MIDDLE_PILL_OPTIONS=[{value:0,label:`Map`,type:`Map`},{value:1,label:`Milestones`,type:`Milestones`},{value:2,label:`Engine`},{value:3,label:`Transmission`},{value:4,label:`Suspension`},{value:5,label:`Electrics`},{value:6,label:`Electrics1`},{value:7,label:`Electrics2`},{value:8,label:`Electrics3`}],currentPillTypeSelected=ref(MIDDLE_PILL_OPTIONS[0].type),middlePillsContainerRef=ref(null);function onMiddlePillsSelectPrevious(){middlePillsContainerRef.value.selectPrevious()}function onMiddlePillsSelectNext(){middlePillsContainerRef.value.selectNext()}function middlePillsValueChanged(selectedValues){let pillId=selectedValues[0],selectedPill=MIDDLE_PILL_OPTIONS.find(pill=>pill.value===pillId);console.log(selectedPill),currentPillTypeSelected.value=selectedPill.type}let todSliderValue=ref(.5),onTODChanged=v=>{console.log(v)},contextButtons=ref({});function setupContextButtons(data){console.log(data),contextButtons.value=data.buttons}Lua_default.career_modules_uiUtils.getCareerPauseContextButtons().then(setupContextButtons);function onContextButtonClicked(btn){console.log(btn),Lua_default.career_modules_uiUtils.callCareerPauseContextButtons(btn.functionId)}function onExitCareerButtonClicked(){console.log(`onExitCareerButtonClicked`)}function onSaveButtonClicked(){career_saveSystem.saveCurrent()}function onLoadButtonClicked(){console.log(`onLoadButtonClicked`)}function onSettingsButtonClicked(){console.log(`onSettingsButtonClicked`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$198,[createVNode(unref(careerSimpleStats_default)),createBaseVNode(`div`,_hoisted_2$160,[createBaseVNode(`div`,_hoisted_3$141,[createVNode(unref(careerStatus_default),{class:`pause-profile-status`}),createBaseVNode(`div`,_hoisted_4$117,[createVNode(unref(bngImageTile_default),{label:`Exit Career`,icon:unref(icons).abandon,onClick:onExitCareerButtonClicked,ratio:ICON_RATIO},null,8,[`icon`]),createVNode(unref(bngCard_default),{class:`system-buttons`},{default:withCtx(()=>[createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSaveButtonClicked},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Save`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onLoadButtonClicked},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Load`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{tabindex:`1`,accent:unref(ACCENTS).text,onClick:onSettingsButtonClicked},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Settings`,-1)]]),_:1},8,[`accent`])]),_:1})]),createVNode(unref(bngCard_default),{class:`main-content grid`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$102,[createVNode(unref(bngButton_default),{class:`button prev-button`,onClick:onMiddlePillsSelectPrevious,tabindex:`0`,accent:unref(ACCENTS).text},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Previous`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngPillFiltersContainer_default),{class:`tabs-track`,ref_key:`middlePillsContainerRef`,ref:middlePillsContainerRef,"html-id":`middle-pills-container-ref`,options:MIDDLE_PILL_OPTIONS,"select-on-navigation":!1,onValueChanged:middlePillsValueChanged,required:!0,"has-checked-icon":!1},null,512),createVNode(unref(bngButton_default),{class:`button next-button`,onClick:onMiddlePillsSelectNext,tabindex:`0`,accent:unref(ACCENTS).text},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Next`,-1)]]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_6$85,[currentPillTypeSelected.value==`Map`?(openBlock(),createBlock(PauseMapPreview_default,{key:0})):createCommentVNode(``,!0),currentPillTypeSelected.value==`Milestones`?(openBlock(),createBlock(PauseMilestonesPreview_default,{key:1})):createCommentVNode(``,!0),currentPillTypeSelected.value===void 0?withDirectives((openBlock(),createBlock(unref(aspectRatio_default),{key:2,style:{background:`red`},ratio:`4:3`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$73,[createVNode(unref(bngCardHeading_default),{style:{color:`white`},type:`ribbon`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Undefined Pill Type!`,-1)]]),_:1})])]),_:1})),[[unref(BngSoundClass_default),`bng_click_generic`]]):createCommentVNode(``,!0)])]),_:1}),createBaseVNode(`div`,_hoisted_8$60,[(openBlock(!0),createElementBlock(Fragment,null,renderList(contextButtons.value,btn=>(openBlock(),createBlock(unref(bngImageTile_default),{label:btn.label,icon:unref(icons)[btn.icon],onClick:$event=>onContextButtonClicked(btn),ratio:ICON_RATIO},null,8,[`label`,`icon`,`onClick`]))),256))]),createBaseVNode(`div`,_hoisted_9$54,[createVNode(unref(bngImageTile_default),{class:`photo-mode`,label:`Photo Mode`,icon:unref(icons).photo,ratio:ICON_RATIO},null,8,[`icon`]),createVNode(unref(bngCard_default),{class:`tod`},{default:withCtx(()=>[_cache[7]||=createBaseVNode(`div`,{class:`icon-box`},`I'm an icon box!`,-1),createVNode(unref(bngSlider_default),{ref:`iptChanged`,min:0,max:1,step:.1,modelValue:todSliderValue.value,"onUpdate:modelValue":_cache[0]||=$event=>todSliderValue.value=$event,onValueChanged:onTODChanged},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{class:`tod-value`})]),_:1})])])]),_cache[8]||=createBaseVNode(`div`,{style:{background:`green`,height:`5em`}},`FOOTER`,-1)])),[[unref(BngBlur_default)]])}},PauseBigMiddlePanel_default=__plugin_vue_export_helper_default(_sfc_main$223,[[`__scopeId`,`data-v-7b3f120b`]]),_hoisted_1$197={class:`back-text`},_sfc_main$222={__name:`BackAside`,emits:[`click`],setup(__props,{emit:__emit}){let emit$1=__emit;return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`back-aside`,onClick:_cache[0]||=$event=>emit$1(`click`)},[createVNode(unref(bngIcon_default),{class:`back-arrow`,type:unref(icons).arrowLargeLeft},null,8,[`type`]),createBaseVNode(`span`,_hoisted_1$197,[createVNode(unref(bngBinding_default),{class:`back-binding`,"ui-event":`back`,controller:``,"track-ignore":``}),createTextVNode(` `+toDisplayString(_ctx.$tt(`ui.common.back`)),1)])])),[[unref(BngSoundClass_default),`bng_click_hover_generic`]])}},BackAside_default=__plugin_vue_export_helper_default(_sfc_main$222,[[`__scopeId`,`data-v-2fa47f3c`]]);const PROFILE_NAME_MAX_LENGTH=100,useProfilesStore=defineStore(`profiles`,()=>{async function loadProfile(profileName,tutorialEnabled,isAdd=!1){if(console.log(`profileStore.loadProfile`,profileName,tutorialEnabled,isAdd),!profileName)return console.warn(`profileStore.loadProfile: profileName is required. Not loading profile.`),!1;if(profileName.length>100&&isAdd)return console.warn(`profileStore.loadProfile: profileName is too long. Not loading profile.`),!1;console.log(`profileStore.loadProfile: creating or loading career and starting`,profileName),/^ +| +$/.test(profileName)&&(profileName=profileName.replace(/^ +| +$/g,``));let createOrLoadCareerAndStartResult=await Lua_default.career_career.createOrLoadCareerAndStart(profileName,null,tutorialEnabled);console.log(`profileStore.loadProfile: createOrLoadCareerAndStartResult`,createOrLoadCareerAndStartResult);let toastrMessage=isAdd?`added`:`loaded`;window.globalAngularRootScope.$broadcast(`toastrMsg`,{type:`info`,msg:$translate.contextTranslate(`ui.career.notification.${toastrMessage}`),config:{positionClass:`toast-top-right`,toastClass:`beamng-message-toast`,timeOut:5e3,extendedTimeOut:1e3}})}return{loadProfile}});var _hoisted_1$196={class:`profile-card-cover`},_hoisted_2$159={class:`profile-card-container`},_hoisted_3$140={class:`profile-card-title`},_hoisted_4$116={key:0,class:`profile-card-date`},_hoisted_5$101={key:0},_hoisted_6$84={key:1},_hoisted_7$72={class:`profile-card-content`},_hoisted_8$59={key:0,class:`profile-manage`},_hoisted_9$53={key:0,class:`profile-manage-rename`},_hoisted_10$46={key:1,class:`profile-manage-delete`},_hoisted_11$41={key:2,class:`profile-manage-main`},MENU_ITEMS$3={RENAME:`rename`,DELETE:`delete`},_sfc_main$221={__name:`ProfileCard`,props:{id:{type:String,required:!0},date:{type:String,required:!0},creationDate:{type:String,required:!0},incompatibleVersion:Boolean,outdatedVersion:{type:Boolean,required:!0},preview:{type:String,default:`/ui/modules/career/profilePreview_WCUSA.jpg`},beamXP:Object,vouchers:Object,vehicleCount:Number,money:Object,insuranceScore:Object,active:Boolean,branches:Array,disabled:Boolean},emits:[`card:activate`,`load`,`rename`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,isActivated=ref(!1),isManage=ref(!1),currentMenu=ref(null),expanded=ref(!1),internalDisabled=ref(!1),cardStates=reactive({focused:!1,hovered:!1}),validateName=inject(`validateName`),nameError=ref(null),lastPlayedDescription=computed(()=>timeSpan(props.date));watch(()=>props.disabled,value=>{nextTick(()=>{internalDisabled.value=value,value&&(expanded.value=!1)})});let onScopeChanged=value=>{isActivated.value=value},cardFooterStyles$1={"background-color":`hsla(217, 22%, 12%, 1)`},validateFn=name=>{let res=validateName(name);return name===props.id&&(res=null),res?nameError.value=res:nameError.value=null,!res},canDeactivate=()=>!isManage.value,canBubbleEvent=e=>e.detail.name===`menu`&&!isManage.value;function onFocused(focused$1){cardStates.focused=focused$1,updatedExpanded()}function onHover(hover){cardStates.hovered=hover,updatedExpanded()}function updatedExpanded(){let enable=cardStates.focused||cardStates.hovered;!enable&&(isActivated.value||isManage.value)||(expanded.value=enable)}function enableManage(enable=!0){nextTick(()=>isManage.value=enable),enable&&!isActivated.value&&(isActivated.value=!0),emit$1(`card:activate`,enable)}function goBack(){if(saveName.value=props.id,currentMenu.value)currentMenu.value=null;else if(isManage.value)enableManage(!1);else return!0}let saveName=ref(props.id),deleteProfile=()=>{Lua_default.career_saveSystem.removeSaveSlot(props.id),Lua_default.career_career.sendAllCareerSaveSlotsData()},updateProfileName=()=>emit$1(`rename`,saveName.value);return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{backgroundImage:__props.preview,footerStyles:cardFooterStyles$1,hideFooter:!expanded.value&&!isManage.value,class:normalizeClass([{"profile-card-active":__props.active,"manage-active":isManage.value,"profile-outdated":__props.incompatibleVersion},`profile-card`]),animateFooterDelay:expanded.value?`0s`:`0.1s`,animateFooterType:`slide`,onActivate:_cache[5]||=$event=>onScopeChanged(!0),onDeactivate:_cache[6]||=$event=>onScopeChanged(!1),onFocusin:_cache[7]||=withModifiers($event=>onFocused(!0),[`self`]),onFocusout:_cache[8]||=withModifiers($event=>onFocused(!1),[`self`]),onMouseover:_cache[9]||=$event=>onHover(!0),onMouseleave:_cache[10]||=$event=>onHover(!1)},{buttons:withCtx(()=>[isManage.value?(openBlock(),createElementBlock(Fragment,{key:0},[currentMenu.value===MENU_ITEMS$3.RENAME?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:nameError.value!==null||saveName.value===props.id,onClick:updateProfileName},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(` Save `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]):createCommentVNode(``,!0),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`outlined`,onClick:goBack},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` Back `,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_cancel_generic`]])],64)):(openBlock(),createElementBlock(Fragment,{key:1},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`outlined`,onClick:enableManage},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`Manage `,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:_cache[4]||=$event=>_ctx.$emit(`load`,__props.id),disabled:__props.active||__props.incompatibleVersion},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(`Load `,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]])],64))]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$196,[createBaseVNode(`div`,_hoisted_2$159,[createBaseVNode(`div`,_hoisted_3$140,toDisplayString(_ctx.$ctx_t(__props.id)),1),isManage.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_4$116,[__props.active?(openBlock(),createElementBlock(`span`,_hoisted_5$101,toDisplayString(_ctx.$ctx_t(`ui.career.nowplaying`)),1)):(openBlock(),createElementBlock(`span`,_hoisted_6$84,toDisplayString(_ctx.$ctx_t(`ui.career.lastplayed`))+` `+toDisplayString(lastPlayedDescription.value),1))]))])]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_7$72,[isManage.value?(openBlock(),createElementBlock(`div`,_hoisted_8$59,[currentMenu.value===MENU_ITEMS$3.RENAME?(openBlock(),createElementBlock(`div`,_hoisted_9$53,[createVNode(unref(bngInput_default),{modelValue:saveName.value,"onUpdate:modelValue":_cache[0]||=$event=>saveName.value=$event,maxlength:unref(100),validate:validateFn,errorMessage:nameError.value,externalLabel:`Save Name`,onKeydown:_cache[1]||=withKeys(withModifiers(()=>{},[`prevent`]),[`enter`])},null,8,[`modelValue`,`maxlength`,`errorMessage`])])):currentMenu.value===MENU_ITEMS$3.DELETE?(openBlock(),createElementBlock(`div`,_hoisted_10$46,[createBaseVNode(`span`,null,toDisplayString(_ctx.$ctx_t(`ui.career.deletePrompt`)),1),withDirectives(createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.common.yes`),accent:`attention`,onClick:deleteProfile},null,8,[`label`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.common.no`),accent:`secondary`,onClick:goBack},null,8,[`label`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_cancel_generic`]])])):(openBlock(),createElementBlock(`div`,_hoisted_11$41,[withDirectives(createVNode(unref(bngButton_default),{accent:`secondary`,label:_ctx.$ctx_t(`ui.career.rename`),disabled:__props.active,onClick:_cache[2]||=()=>currentMenu.value=MENU_ITEMS$3.RENAME},null,8,[`label`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),withDirectives(createVNode(unref(bngButton_default),{accent:`secondary`,label:_ctx.$ctx_t(`ui.career.delete`),disabled:__props.active,onClick:_cache[3]||=()=>currentMenu.value=MENU_ITEMS$3.DELETE},null,8,[`label`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_click_generic`]]),createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.career.mods`),accent:`secondary`,disabled:``},null,8,[`label`]),createVNode(unref(bngButton_default),{label:_ctx.$ctx_t(`ui.career.backup`),accent:`secondary`,disabled:``},null,8,[`label`])]))])):(openBlock(),createBlock(ProfileStatus_default,{key:1,branches:__props.branches,beamXP:__props.beamXP,vouchers:__props.vouchers,vehicleCount:__props.vehicleCount,money:__props.money,insuranceScore:__props.insuranceScore},null,8,[`branches`,`beamXP`,`vouchers`,`vehicleCount`,`money`,`insuranceScore`]))])),[[unref(BngOnUiNav_default),goBack,`menu,back`]])]),_:1},8,[`backgroundImage`,`hideFooter`,`class`,`animateFooterDelay`])),[[unref(BngScopedNav_default),{canDeactivate,canBubbleEvent}],[unref(BngSoundClass_default),`bng_hover_generic`],[unref(BngDisabled_default),internalDisabled.value]])}},ProfileCard_default=__plugin_vue_export_helper_default(_sfc_main$221,[[`__scopeId`,`data-v-16215408`]]),cardFooterStyles={"background-color":`hsla(217, 22%, 12%, 1)`},_sfc_main$220={__name:`ProfileCreateCard`,props:{profileName:{required:!0},profileNameModifiers:{}},emits:mergeModels([`card:activate`,`load`],[`update:profileName`]),setup(__props,{emit:__emit}){let emit$1=__emit,profileName=useModel(__props,`profileName`),tutorialChecked=ref(!0),isActive=ref(!1),validateName=inject(`validateName`),nameError=ref(null),startButton=ref(null),cancelButton=ref(null),validateFn=name=>{let res=validateName(name);return res?nameError.value=res:nameError.value=null,!res},load=()=>emit$1(`load`,profileName.value,tutorialChecked.value);function setActive(value){isActive.value=value,emit$1(`card:activate`,value)}function onCancel(event){setTimeout(()=>{isActive.value=!1,emit$1(`card:activate`,!1)},200)}function onEnter(event){event.preventDefault();let focusButton=nameError.value?cancelButton:startButton;focusButton.value&&nextTick(()=>setFocusExternal(focusButton.value.$el))}function onMenu(){setActive(!1)}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{hideFooter:!isActive.value,footerStyles:cardFooterStyles,class:`profile-create-card`,onActivate:_cache[3]||=()=>setActive(!0),onDeactivate:_cache[4]||=()=>setActive(!1)},{buttons:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`startButton`,ref:startButton,disabled:nameError.value!==null,onClick:withModifiers(load,[`stop`])},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Start`,-1)]]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`cancelButton`,ref:cancelButton,accent:`outlined`,onClick:withModifiers(onCancel,[`stop`])},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(`Cancel`,-1)]]),_:1})),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([{"create-active":isActive.value},`create-content-container`])},[isActive.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngInput_default),{modelValue:profileName.value,"onUpdate:modelValue":_cache[0]||=$event=>profileName.value=$event,maxlength:unref(100),validate:validateFn,errorMessage:nameError.value,externalLabel:`Save Name`,onKeydown:withKeys(onEnter,[`enter`])},null,8,[`modelValue`,`maxlength`,`errorMessage`]),createVNode(unref(bngSwitch_default),{modelValue:tutorialChecked.value,"onUpdate:modelValue":_cache[1]||=$event=>tutorialChecked.value=$event,"label-before":``,inline:!1,"label-alignment":unref(LABEL_ALIGNMENTS).START},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.tutorialCheckDesc`)),1)]),_:1},8,[`modelValue`,`label-alignment`]),createBaseVNode(`span`,{class:normalizeClass([`tutorial-desc`,{checked:tutorialChecked.value}])},toDisplayString(_ctx.$ctx_t(`ui.career.tutorialOnDesc`)),3)],64)):(openBlock(),createElementBlock(`div`,{key:1,"bng-nav-item":``,class:`create-content-cover`,onClick:_cache[2]||=withModifiers($event=>setActive(!0),[`stop`])},[..._cache[5]||=[createBaseVNode(`div`,{class:`cover-plus-container`},[createBaseVNode(`div`,{class:`cover-plus-button`},`+`)],-1)]]))],2)),[[unref(BngOnUiNav_default),onMenu,`menu`]])]),_:1},8,[`hideFooter`])),[[unref(BngScopedNav_default),{activated:isActive.value}],[unref(BngBlur_default)],[unref(BngSoundClass_default),`bng_hover_generic`]])}},ProfileCreateCard_default=__plugin_vue_export_helper_default(_sfc_main$220,[[`__scopeId`,`data-v-1524a2bb`]]),_sfc_main$219={__name:`Profiles`,setup(__props){let store$1=useProfilesStore(),{events:events$3}=useBridge(),profiles=ref([]),activeProfileId=ref(null),selectedCard=ref(null),newProfileName=ref(null),onLoad=async id=>{await store$1.loadProfile(id)},onRename=async(profile,newName)=>{await Lua_default.career_saveSystem.renameSaveSlot(profile.id,newName)&&(profile.id=newName)},onCreateSave=async(profileName,tutorialChecked)=>{await store$1.loadProfile(profileName,tutorialChecked,!0)};function onCardActivated(active,index){active?(selectedCard.value=index,index===-1&&(newProfileName.value=getNewName())):selectedCard.value=null}onMounted(()=>{events$3.on(`allCareerSaveSlots`,onProfilesReceived),Lua_default.career_career.sendAllCareerSaveSlotsData()}),onBeforeUnmount(()=>{events$3.off(`allCareerSaveSlots`,onProfilesReceived)}),provide(`validateName`,validateName);let navigateToMainMenu=e=>{activeProfileId.value?window.bngVue.gotoAngularState(`menu.careerPause`):window.bngVue.gotoGameState(`menu.mainmenu`)};function onDeactivate$1(event){event.detail.force||navigateToMainMenu()}async function onProfilesReceived(data){selectedCard.value=null,activeProfileId.value=null,profiles.value=[],!(!data||!Array.isArray(data)||data.length===0)&&(profiles.value=(await updateActiveProfile(data)).map(p$1=>({id:p$1.id,date:p$1.date,creationDate:p$1.creationDate,incompatibleVersion:p$1.incompatibleVersion,outdatedVersion:p$1.outdatedVersion,preview:p$1.preview,beamXP:p$1.beamXP,vouchers:p$1.vouchers,vehicleCount:p$1.vehicleCount,money:p$1.money,insuranceScore:p$1.insuranceScore,branches:p$1.branches})))}async function updateActiveProfile(data){let currentSave=await Lua_default.career_career.sendCurrentSaveSlotData();if(data.sort((a$1,b)=>new Date(b.date)-new Date(a$1.date)),currentSave){activeProfileId.value=currentSave.id;let current=data.find(x=>x.id===currentSave.id);current||=currentSave,data=data.filter(x=>x.id!==currentSave.id),data.splice(0,0,current)}return data}function validateName(newName){return newName?newName.length>100?`Save name cannot be longer than 100 characters`:/[<>:"/\\|?*]/.test(newName)?`Save name cannot contain invalid characters`:profiles.value&&profiles.value.find(profile=>profile.id.toLowerCase()===newName.toLowerCase())?`Save name already exists`:null:`Save name cannot be empty`}function getNewName(){let prefix$1=$translate.contextTranslate(`ui.career.profile`),id;for(let i=1;i<1e3&&(id=`${prefix$1} ${i}`,!(!profiles.value||!profiles.value.find(profile=>profile.id===id)));i++);return id}return onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`profiles`)}),onUnmounted(()=>{Lua_default.simTimeAuthority.popPauseRequest(`profiles`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives((openBlock(),createElementBlock(`div`,{class:`profiles-container`,onDeactivate:onDeactivate$1},[createVNode(unref(bngScreenHeading_default),{class:`profiles-title`,preheadings:[_ctx.$ctx_t(`ui.playmodes.career`)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.savedProgress`)),1)]),_:1},8,[`preheadings`]),withDirectives(createVNode(BackAside_default,{class:`profiles-back`,onClick:navigateToMainMenu},null,512),[[unref(BngOnUiNav_default),navigateToMainMenu,`back,menu`]]),createVNode(unref(bngList_default),{layout:unref(LIST_LAYOUTS).RIBBON,"target-width":22,"target-height":28,"target-margin":1,"no-background":``},{default:withCtx(()=>[createVNode(ProfileCreateCard_default,{profileName:newProfileName.value,"onUpdate:profileName":_cache[0]||=$event=>newProfileName.value=$event,class:`profile-card`,"onCard:activate":_cache[1]||=value=>onCardActivated(value,-1),onLoad:onCreateSave},null,8,[`profileName`]),(openBlock(!0),createElementBlock(Fragment,null,renderList(profiles.value,(profile,index)=>withDirectives((openBlock(),createBlock(ProfileCard_default,{key:index,id:profile.id,date:profile.date,creationDate:profile.creationDate,incompatibleVersion:profile.incompatibleVersion,outdatedVersion:profile.outdatedVersion,preview:profile.preview,beamXP:profile.beamXP,vouchers:profile.vouchers,vehicleCount:profile.vehicleCount,money:profile.money,insuranceScore:profile.insuranceScore,branches:profile.branches,active:activeProfileId.value===profile.id,disabled:selectedCard.value!==null&&selectedCard.value!==index,class:`profile-card`,"onCard:activate":value=>onCardActivated(value,index),onLoad,onRename:newName=>onRename(profile,newName)},null,8,[`id`,`date`,`creationDate`,`incompatibleVersion`,`outdatedVersion`,`preview`,`beamXP`,`vouchers`,`vehicleCount`,`money`,`insuranceScore`,`branches`,`active`,`disabled`,`onCard:activate`,`onRename`])),[[unref(BngPopover_default),profile.incompatibleVersion?`tooltip-outdated-message`:null,`top`]])),128))]),_:1},8,[`layout`])],32)),[[unref(BngScopedNav_default),{activateOnMount:!0}]]),createVNode(unref(bngPopoverContent_default),{name:`tooltip-outdated-message`},{default:withCtx(()=>[..._cache[2]||=[createBaseVNode(`div`,{class:`tooltip-outdated-message`},`This profile was saved with an old version of the game. It can no longer be loaded.`,-1)]]),_:1})],64))}},Profiles_default=__plugin_vue_export_helper_default(_sfc_main$219,[[`__scopeId`,`data-v-6aef0f62`]]);const useRepairStore=defineStore(`repair`,()=>{let repairOptions=ref({}),vehicleData=ref({}),playerAttributes=ref({}),driverScoreTierData=ref({}),futureDriverScore=ref(0),driverScore=ref(0),resetStore=()=>{repairOptions.value={},vehicleData.value={},playerAttributes.value={},driverScoreTierData.value={},futureDriverScore.value=0,driverScore.value=0};return{repairOptions,vehicleData,playerAttributes,getRepairData:()=>{resetStore(),Lua_default.career_modules_insurance_repairScreen.getRepairData().then(data=>{repairOptions.value=data.repairOptions,vehicleData.value=data.vehicleData,playerAttributes.value=data.playerAttributes,driverScoreTierData.value=data.driverScoreTierData,futureDriverScore.value=data.futureDriverScore,driverScore.value=data.driverScore})},driverScoreTierData,futureDriverScore,driverScore,resetStore}});var _hoisted_1$195={class:`content blue-background`},_hoisted_2$158={class:`vehicle-info`},_hoisted_3$139={class:`right-info-wrapper`},_hoisted_4$115={class:`damage-estimate-wrapper`},_hoisted_5$100={class:`damage-estimate-value`},_hoisted_6$83={key:0},_hoisted_7$71={class:`repair-options`},_hoisted_8$58=[`onClick`],_hoisted_9$52={class:`icon-wrapper`},_hoisted_10$45={key:0,class:`option-text-wrapper`},_hoisted_11$40={class:`smaller-text`},_hoisted_12$30={class:`bigger-text`,style:{"margin-top":`-5px`}},_hoisted_13$26={key:1,class:`option-text-wrapper`},_hoisted_14$25={key:0},_hoisted_15$24={class:`details-wrapper`},_hoisted_16$24={class:`detail-wrapper`},_hoisted_17$19={class:`item`},_hoisted_18$17={key:0,class:`accident-forgivenesses-text`},_hoisted_19$14={key:0,class:`item`},_hoisted_20$12={class:`item-value`},_hoisted_21$11={key:1,class:`renews-in-wrapper`},_hoisted_22$9={class:`renews-in-name`},_hoisted_23$8={class:`renews-in-value`},_hoisted_24$7={class:`detail-wrapper`},_hoisted_25$6={class:`item`},_hoisted_26$5={class:`item-value`},_hoisted_27$5={class:`item`},_hoisted_28$4={class:`item-value`},_hoisted_29$4={key:0,class:`item`},_hoisted_30$4={class:`item-value`},_hoisted_31$4={key:1,class:`item`},_hoisted_32$4={class:`item-value`},_hoisted_33$4={class:`item total-cost`},_hoisted_34$4={class:`item-value`},_hoisted_35$3={key:0},_hoisted_36$3={key:1},_hoisted_37$2={class:`confirm-repair-money-wrapper`},_hoisted_38$2={key:2},_hoisted_39$2={class:`confirm-repair-money-wrapper`},_sfc_main$218={__name:`RepairMain`,setup(__props){let{units}=useBridge();useComputerStore();let repairStore=useRepairStore(),selectedRepairOptionKey=ref(null),selectedRepairTimeOptionIndex=ref(1),currentRepairOption=computed(()=>!selectedRepairOptionKey.value||!repairStore.repairOptions?null:repairStore.repairOptions[selectedRepairOptionKey.value]),accidentForgivenessesText=computed(()=>!repairStore.repairOptions.insuranceRepairData.accidentForgivenesses>0?`(No Accident Forgivenesses left)`:`(`+repairStore.repairOptions.insuranceRepairData.accidentForgivenesses+` Accident Forgivenesses left)`),selectedRepairTimeOption=computed(()=>currentRepairOption.value?.repairTimeOptions?.choices?currentRepairOption.value.repairTimeOptions.choices.find(choice=>choice.id===selectedRepairTimeOptionIndex.value):null),renewsInFormatted=computed(()=>currentRepairOption.value?.renewsIn?units.buildString(`length`,currentRepairOption.value.renewsIn*1e3,0):``);watch(()=>repairStore.repairOptions,newOptions=>{if(newOptions&&Object.keys(newOptions).length>0&&!selectedRepairOptionKey.value){let selectedKey=Object.keys(newOptions).find(key=>newOptions[key].useInsurance)||Object.keys(newOptions)[0];selectedRepairOptionKey.value=selectedKey,newOptions[selectedKey]?.repairTimeOptions?.currentValueId&&(selectedRepairTimeOptionIndex.value=newOptions[selectedKey].repairTimeOptions.currentValueId)}},{immediate:!0}),watch(()=>selectedRepairOptionKey.value,newKey=>{newKey&&repairStore.repairOptions[newKey]?.repairTimeOptions?.currentValueId?selectedRepairTimeOptionIndex.value=repairStore.repairOptions[newKey].repairTimeOptions.currentValueId:selectedRepairTimeOptionIndex.value=1});let onRepairOptionClick=key=>{selectedRepairOptionKey.value=key},close=()=>{Lua_default.career_modules_insurance_repairScreen.closeMenu()},startRepair=(repairOptionKey,repairTimeOptionIndex)=>{selectedRepairTimeOption.value&&Lua_default.career_modules_insurance_repairScreen.startRepairInGarage(repairStore.vehicleData.invVehId,{repairTime:selectedRepairTimeOption.value.value,isInsuranceRepair:currentRepairOption.value.useInsurance,cost:{repairTimeCost:selectedRepairTimeOption.value.premiumInfluence,deductible:currentRepairOption.value.useInsurance?repairStore.repairOptions.insuranceRepairData.deductible:repairStore.vehicleData.damageCost}})};return onMounted(()=>{repairStore.getRepairData()}),onUnmounted(()=>{repairStore.resetStore()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Repair`],title:`Repair ${unref(repairStore).vehicleData.name}`,back:``,onBack:close},{default:withCtx(()=>[unref(repairStore).vehicleData.name?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`repairMain blue-background`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$195,[_cache[23]||=createBaseVNode(`div`,{class:`title`},`Vehicle Repair`,-1),createBaseVNode(`div`,_hoisted_2$158,[createVNode(unref(insuranceVehTile_default),{class:`vehicle-tile`,vehicle:unref(repairStore).vehicleData},{rightContent:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$139,[createBaseVNode(`div`,_hoisted_4$115,[_cache[2]||=createBaseVNode(`span`,{class:`damage-estimate-text`},` Damage Estimate: `,-1),createBaseVNode(`span`,_hoisted_5$100,[createVNode(unref(bngUnit_default),{class:`red-price`,money:unref(repairStore).vehicleData.damageCost},null,8,[`money`])])]),unref(repairStore).vehicleData.isInsured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$83,[..._cache[3]||=[createBaseVNode(`span`,{class:`not-insured-text`},` Not Insured! `,-1)]]))])]),_:1},8,[`vehicle`])]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`div`,{class:`repair-options-title`},`Repair Options`,-1),createBaseVNode(`div`,_hoisted_7$71,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(repairStore).repairOptions,(repairOption,key)=>(openBlock(),createElementBlock(`div`,{key,class:normalizeClass([`repair-option`,{selected:selectedRepairOptionKey.value===key}]),onClick:$event=>onRepairOptionClick(key)},[createBaseVNode(`div`,_hoisted_9$52,[createVNode(unref(bngIcon_default),{type:repairOption.useInsurance?unref(icons).shieldCheckmark:unref(icons).wrench},null,8,[`type`])]),createBaseVNode(`div`,null,[repairOption.useInsurance?(openBlock(),createElementBlock(`div`,_hoisted_10$45,[_cache[5]||=createBaseVNode(`div`,{class:`bigger-text`},` Insurance Claim `,-1),createBaseVNode(`div`,_hoisted_11$40,toDisplayString(repairOption.insuranceName),1),createBaseVNode(`div`,_hoisted_12$30,[_cache[4]||=createTextVNode(` Deductible : `,-1),createVNode(unref(bngUnit_default),{class:`unit-no-padding`,money:unref(repairStore).repairOptions.insuranceRepairData.deductible},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_13$26,[..._cache[6]||=[createBaseVNode(`div`,{class:`bigger-text`},` Private Repair `,-1),createBaseVNode(`div`,{class:`smaller-text`},` No Policy Impact `,-1),createBaseVNode(`div`,{class:`bigger-text`},` Full Damage Cost `,-1)]]))])],10,_hoisted_8$58))),128))])]),currentRepairOption.value?(openBlock(),createElementBlock(`div`,_hoisted_14$25,[(openBlock(),createBlock(unref(coverageOption_default),{coverageOption:currentRepairOption.value.repairTimeOptions,key:`repairTime-${selectedRepairOptionKey.value}`,modelValue:selectedRepairTimeOptionIndex.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedRepairTimeOptionIndex.value=$event,simpleSelect:!0,showPerkMode:`none`},null,8,[`coverageOption`,`modelValue`]))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_15$24,[createBaseVNode(`div`,_hoisted_16$24,[_cache[13]||=createBaseVNode(`h3`,null,`Insurance Impact`,-1),createBaseVNode(`div`,_hoisted_17$19,[createBaseVNode(`span`,null,[_cache[8]||=createBaseVNode(`div`,{class:`item-label`},`Driver Score Change`,-1),currentRepairOption.value.useInsurance?(openBlock(),createElementBlock(`div`,_hoisted_18$17,toDisplayString(accidentForgivenessesText.value),1)):createCommentVNode(``,!0)]),createBaseVNode(`span`,{class:normalizeClass([`item-value`,{"red-text":currentRepairOption.value.useInsurance&&unref(repairStore).futureDriverScorestartRepair(selectedRepairOptionKey.value,selectedRepairTimeOptionIndex.value)},{default:withCtx(()=>[unref(repairStore).vehicleData.needsRepair?selectedRepairTimeOption.value?.canPay?(openBlock(),createElementBlock(`div`,_hoisted_38$2,[_cache[22]||=createTextVNode(` Confirm Repair `,-1),createBaseVNode(`div`,_hoisted_39$2,[createVNode(unref(bngUnit_default),{money:selectedRepairTimeOption.value?.totalPrice},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_36$3,[_cache[21]||=createTextVNode(` Insufficient funds `,-1),createBaseVNode(`div`,_hoisted_37$2,[createVNode(unref(bngUnit_default),{money:selectedRepairTimeOption.value?.totalPrice},null,8,[`money`])])])):(openBlock(),createElementBlock(`div`,_hoisted_35$3,` Vehicle doesn't need repair `))]),_:1},8,[`disabled`])])]),_:1})):createCommentVNode(``,!0)]),_:1},8,[`title`]))}},RepairMain_default=__plugin_vue_export_helper_default(_sfc_main$218,[[`__scopeId`,`data-v-19ad91be`]]),_hoisted_1$194={class:`awd-container bng-app`},_hoisted_2$157={key:0,class:`awd-table`},_hoisted_3$138={class:`data-name`},_sfc_main$217={__name:`app`,setup(__props,{expose:__expose}){let{$game}=useLibStore(),streamList=[`advancedWheelDebugData`],data=ref([]),hasData=computed(()=>Array.isArray(data.value)&&data.value.length>0),orderedData=computed(()=>Array.isArray(data.value)?data.value.sort((a$1,b)=>a$1.name.toLowerCase().localeCompare(b.name.toLowerCase())):[]);__expose({hasData}),onMounted(()=>{$game.streams.add(streamList),register()}),onUnmounted(()=>{$game.streams.remove(streamList),$game.api.activeObjectLua(`extensions.advancedwheeldebug.registerDebugUser("advancedWheelDebugApp", false)`)});let register=()=>$game.api.activeObjectLua(`extensions.advancedwheeldebug.registerDebugUser("advancedWheelDebugApp", true)`),format$2=value=>value?parseFloat(value).toFixed(3):``;return $game.events.on(`onStreamsUpdate`,streams=>data.value=streams.advancedWheelDebugData),$game.events.on(`VehicleReset`,register),$game.events.on(`VehicleChange`,register),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$194,[orderedData.value&&orderedData.value.length>0?(openBlock(),createElementBlock(`table`,_hoisted_2$157,[_cache[0]||=createBaseVNode(`thead`,null,[createBaseVNode(`tr`,null,[createBaseVNode(`th`,null,`Name`),createBaseVNode(`th`,null,`Camber`),createBaseVNode(`th`,null,`Toe`),createBaseVNode(`th`,null,`Caster`),createBaseVNode(`th`,null,`SAI`)])],-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(orderedData.value,w=>(openBlock(),createElementBlock(`tr`,null,[createBaseVNode(`td`,_hoisted_3$138,toDisplayString(w.name),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.camber)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.toe)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.caster)),1),createBaseVNode(`td`,null,toDisplayString(format$2(w.sai)),1)]))),256))])):createCommentVNode(``,!0)]))}},app_default$2=__plugin_vue_export_helper_default(_sfc_main$217,[[`__scopeId`,`data-v-5eb5aaaa`]]),_hoisted_1$193={class:`legends-container`},TAG=`[beamng.apps:brakeTorqueGraph]`,_sfc_main$216={__name:`app`,setup(__props){let{$game}=useLibStore(),app$1=ref(null),canvas=ref(null),graphList=ref([]),streamsList$1=[`wheelInfo`,`electrics`],colors=[],chart=new SmoothieChart({minValue:0,millisPerPixel:20,interpolation:`linear`,grid:{fillStyle:`rgba(250, 250, 250, 0.8)`,strokeStyle:`rgba(0,0,0,0.3)`,verticalSections:6,millisPerLine:1e3,sharpLines:!0},labels:{fillStyle:`black`}}),speedGraph=new TimeSeries,appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight}),graphs={},globalMax=2e3;onMounted(()=>{initColors(),initChart(),appResizeObserver.observe(app$1.value),graphList.value=[{title:`ui.apps.brake_torque_graph.speed`,color:colors[0]}],$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleReset`,onVehicleReset),$game.events.on(`VehicleChange`,onVehicleChange)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleReset`,onVehicleReset),$game.events.off(`VehicleChange`,onVehicleChange),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;globalMax=Math.max(globalMax,streams.electrics.airspeed*15);let xPoint=new Date;for(let w in speedGraph.append(xPoint,streams.electrics.airspeed*15),streams.wheelInfo){let wheelName=streams.wheelInfo[w][0];if(!graphs.hasOwnProperty(wheelName)){graphs[wheelName]=new TimeSeries,logger_default.debug(`${TAG} adding graph for ${wheelName}`);let wheelColor=colors[graphList.value.length%colors.length];graphList.value.push({title:wheelName,color:wheelColor}),chart.addTimeSeries(graphs[wheelName],{strokeStyle:wheelColor,lineWidth:2});return}graphs[wheelName].append(xPoint,streams.wheelInfo[w][8]),globalMax=Math.max(globalMax,streams.wheelInfo[w][8])}chart.options.maxValue=globalMax}function onVehicleReset(data){graphs={},graphList.value=[{title:`Speed`,color:colors[0]}]}function onVehicleChange(data){graphs={},graphList.value=[{title:`Speed`,color:colors[0]}]}function initChart(){chart.addTimeSeries(speedGraph,{strokeStyle:colors[0],lineWidth:2}),chart.streamTo(canvas.value,40)}function initColors(){for(let i=15;i>0;i--){let c=rainbow(15,i);colors.push(`rgb(${Math.round(255*c[0])}, ${Math.round(255*c[1])}, ${Math.round(255*c[2])})`)}}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`btg-app`,ref_key:`app`,ref:app$1},[createBaseVNode(`div`,_hoisted_1$193,[(openBlock(!0),createElementBlock(Fragment,null,renderList(graphList.value,graph=>(openBlock(),createElementBlock(`small`,{class:`legend`,style:normalizeStyle({color:graph.color})},toDisplayString(_ctx.$t(graph.title)),5))),256))]),createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas},null,512)],512))}},app_default$3=__plugin_vue_export_helper_default(_sfc_main$216,[[`__scopeId`,`data-v-642d2338`]]),_hoisted_1$192={class:`bus-line bng-app`},_hoisted_2$156={class:`header`},_hoisted_3$137={class:`time`},_hoisted_4$114={class:`logo`},_hoisted_5$99=[`src`],_hoisted_6$82={class:`route-id`},_hoisted_7$70={class:`text`},_hoisted_8$57={class:`destination`},_hoisted_9$51={key:0,class:`display-stops`},_hoisted_10$44={class:`title`},_hoisted_11$39={key:1,class:`next-stop`},_hoisted_12$29={class:`title`},defaultRouteId=`00`,defaultDestination=`Not in service`,defaultRouteColor=`#FFA200`,totalRoutesDisplayed=4,_sfc_main$215={__name:`app`,setup(__props){let{$game}=useLibStore(),timerInterval,navDisplay=reactive({time:``,stopRequested:!1}),localBusRoute=ref(null),routeId=computed(()=>localBusRoute.value&&localBusRoute.value.routeId?localBusRoute.value.routeId.substring(0,3):defaultRouteId),destination=computed(()=>localBusRoute.value&&localBusRoute.value.destination?localBusRoute.value.destination.substring(0,20):defaultDestination),routeColor=computed(()=>localBusRoute.value&&localBusRoute.value.routeColor?localBusRoute.value.routeColor:defaultRouteColor),stops=computed(()=>{if(!localBusRoute.value||!localBusRoute.value.stops)return null;let data=localBusRoute.value.stops.slice(0,-1);return data.length>totalRoutesDisplayed&&(data=data.slice(1).slice(0,totalRoutesDisplayed)),data.reverse()}),nextStop=computed(()=>localBusRoute.value&&localBusRoute.value.stops&&localBusRoute.value.stops.length-1>totalRoutesDisplayed?localBusRoute.value.stops[0]:null);onBeforeMount(()=>{updateTime(),timerInterval=setInterval(()=>{updateTime()},1e3)}),onMounted(()=>{$game.events.on(`BusDisplayUpdate`,onBusDisplayUpdate),$game.events.on(`SetStopRequest`,onSetStopRequest),$game.api.engineLua(`if scenario_busdriver then scenario_busdriver.requestState() end`)}),onUnmounted(()=>{clearInterval(timerInterval),$game.events.off(`BusDisplayUpdate`,onBusDisplayUpdate),$game.events.off(`SetStopRequest`,onSetStopRequest)});function onBusDisplayUpdate(data){console.log(`onBusDisplayUpdate`,data),localBusRoute.value?(localBusRoute.value.routeId=data.routeId,localBusRoute.value.stops=localBusRoute.value.stops.filter(x=>data.tasklist.find(y=>y[0]===x.id))):localBusRoute.value=parseBusData(data)}function onSetStopRequest(data){console.log(`onSetStopRequest`,data),data&&data.stopRequested!==null&&(navDisplay.stopRequested=data.stopRequested)}function updateTime(){let date=new Date;navDisplay.time=`${date.getHours()}:${date.getMinutes()<10?`0`+date.getMinutes():date.getMinutes()}`}function parseBusData(data){return{destination:data.direction,routeId:data.routeId,routeColor:data.routeColor,stops:data.tasklist.map(x=>({id:x[0],name:x[1]}))}}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$192,[createBaseVNode(`div`,{class:`content`,style:normalizeStyle({"--routeColor":routeColor.value})},[createBaseVNode(`div`,_hoisted_2$156,[createBaseVNode(`div`,_hoisted_3$137,toDisplayString(navDisplay.time),1),createBaseVNode(`div`,_hoisted_4$114,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/beamng_logo_50x50.png`)},null,8,_hoisted_5$99)])]),createBaseVNode(`div`,{class:normalizeClass([`route`,{highlight:!stops.value||stops.value.length===0}])},[createBaseVNode(`div`,_hoisted_6$82,[createBaseVNode(`span`,_hoisted_7$70,toDisplayString(routeId.value),1),_cache[0]||=createBaseVNode(`span`,{class:`chevron`},null,-1)]),createBaseVNode(`div`,_hoisted_8$57,toDisplayString(destination.value),1)],2),stops.value?(openBlock(),createElementBlock(`div`,_hoisted_9$51,[(openBlock(!0),createElementBlock(Fragment,null,renderList(stops.value,stop$1=>(openBlock(),createElementBlock(`div`,{class:`stop`,key:stop$1.id},[_cache[1]||=createBaseVNode(`div`,{class:`chevron`},null,-1),createBaseVNode(`div`,_hoisted_10$44,toDisplayString(stop$1.name),1)]))),128))])):createCommentVNode(``,!0),nextStop.value?(openBlock(),createElementBlock(`div`,_hoisted_11$39,[_cache[2]||=createBaseVNode(`div`,{class:`chevron`},null,-1),createBaseVNode(`div`,_hoisted_12$29,toDisplayString(nextStop.value.name),1)])):createCommentVNode(``,!0)],4),createBaseVNode(`div`,{class:normalizeClass([`stop-request`,{requested:navDisplay.stopRequested}])},[createBaseVNode(`div`,{class:normalizeClass([`text`,{glow:navDisplay.stopRequested}])},toDisplayString(_ctx.$t(`ui.busRoute.stopRequested`)),3)],2)]))}},app_default$4=__plugin_vue_export_helper_default(_sfc_main$215,[[`__scopeId`,`data-v-7731db49`]]),_hoisted_1$191={class:`bng-app cd-container`,layout:`column`,"layout-align":`center center`},_sfc_main$214={__name:`app`,setup(__props){let{$game}=useLibStore(),cameraDistance=ref(null);return onMounted(()=>{$game.api.engineLua(`extensions.load("ui_cameraDistanceApp")`)}),onUnmounted(()=>{$game.api.engineLua(`extensions.unload("ui_cameraDistanceApp")`)}),$game.events.on(`cameraDistance`,function(distance,errMsg){distance<0?cameraDistance.value=errMsg:cameraDistance.value=$game.units.buildString(`length`,distance,2)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$191,[createBaseVNode(`span`,null,toDisplayString(cameraDistance.value),1)]))}},app_default$5=__plugin_vue_export_helper_default(_sfc_main$214,[[`__scopeId`,`data-v-d72a4879`]]),_hoisted_1$190={key:0,class:`bng-app thermal-clutch-debug`},_hoisted_2$155={class:`set-name`},_sfc_main$213={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`clutchThermalData`],data=ref([]);onMounted(()=>{$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.streams.remove(streamsList$1)}),$game.events.on(`onStreamsUpdate`,streams=>{streams.clutchThermalData?data.value=parseData(streams.clutchThermalData):data.value=null});function parseData(data$1){return[{str:$game.units.buildString(`temperature`,data$1.clutchTemperature,0),name:`Clutch temperature`,warn:data$1.clutchTemperature>data$1.maxSafeTemp&&data$1.clutchTemperature<=data$1.efficiencyScaleEnd,error:data$1.clutchTemperature>data$1.efficiencyScaleEnd},{str:$game.units.buildString(`temperature`,data$1.maxSafeTemp,0),name:`Max safe temperature`},{str:$game.units.buildString(`temperature`,data$1.efficiencyScaleEnd,0),name:`Efficiency scale end`},{str:data$1.thermalEfficiency.toFixed(3),name:`Clutch efficiency`,warn:data$1.thermalEfficiency<1&&data$1.thermalEfficiency>=.5,error:data$1.thermalEfficiency<.5},{str:$game.units.buildString(`energy`,data$1.energyToClutch,0),name:`Q to clutch`},{str:$game.units.buildString(`energy`,data$1.energyClutchToBellHousing,0),name:`Q clutch to bell housing`}]}return(_ctx,_cache)=>data.value?(openBlock(),createElementBlock(`div`,_hoisted_1$190,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value,(set,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`set`},[createBaseVNode(`div`,_hoisted_2$155,toDisplayString(set.name),1),createBaseVNode(`div`,{class:normalizeClass([`set-value`,{"thermal-warning":set.warn,"thermal-error":set.error}])},toDisplayString(set.str),3)]))),128))])):createCommentVNode(``,!0)}},app_default$6=__plugin_vue_export_helper_default(_sfc_main$213,[[`__scopeId`,`data-v-c0f00383`]]),_hoisted_1$189={width:`100%`,height:`100%`,viewBox:`0 0 244 244`},_hoisted_2$154=[`transform`],_sfc_main$212={__name:`app`,setup(__props){let streamsList$1=[`sensors`],{$game}=useLibStore(),arrow$3=ref(null),circle=ref(null),yawDegrees=ref(0),bbox=computed(()=>arrow$3.value?arrow$3.value.getBBox():null),rotateOrigin=computed(()=>bbox.value?`${yawDegrees.value} ${bbox.value.x+bbox.value.width/2} ${bbox.value.y+bbox.value.height/2}`:0);onMounted(()=>{$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;yawDegrees.value=streams.sensors.yaw*180/Math.PI+180}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$189,[createBaseVNode(`g`,{ref_key:`circle`,ref:circle,transform:`rotate(${rotateOrigin.value})`},[..._cache[0]||=[createStaticVNode(`NESW`,5)]],8,_hoisted_2$154),createBaseVNode(`path`,{d:`M122 90 L105 154 L139 154 Z`,ref_key:`arrow`,ref:arrow$3,class:`arrow`},null,512)]))}},app_default$7=__plugin_vue_export_helper_default(_sfc_main$212,[[`__scopeId`,`data-v-4a5918e7`]]),compassWidth=2e3,_sfc_main$211={__name:`app`,setup(__props){let streamsList$1=[`sensors`],{$game}=useLibStore(),app$1=ref(null),canvas=ref(null),osCanvas=ref(null),widthLess=computed(()=>(compassWidth-canvas.value.width)/2),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight});onMounted(()=>{initOsCanvas(),appResizeObserver.observe(app$1.value),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;let canvasCtx=canvas.value.getContext(`2d`);canvasCtx.clearRect(0,0,canvas.value.width,canvas.value.height),canvasCtx.fillStyle=`rgba(255,255,255,0.8)`,canvasCtx.strokeStyle=`rgba(255,255,255,0.6)`;let heading=streams.sensors.yaw,posX=heading*compassWidth/(2*Math.PI)-widthLess.value;canvasCtx.drawImage(osCanvas.value,posX,0),heading*compassWidth/(2*Math.PI)-widthLess.value>0?canvasCtx.drawImage(osCanvas.value,posX-compassWidth,0):posX+compassWidth(openBlock(),createElementBlock(`div`,{class:`container`,ref_key:`app`,ref:app$1},[createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas,width:`280`,height:`56`},null,512),createBaseVNode(`canvas`,{ref_key:`osCanvas`,ref:osCanvas,class:`os-canvas`},null,512)],512))}},app_default$8=__plugin_vue_export_helper_default(_sfc_main$211,[[`__scopeId`,`data-v-e608df6a`]]),_hoisted_1$188={transform:`translate(-13.701535,-283.48656)`,style:{display:`inline`},id:`carGroup`},_hoisted_2$153={y:`255.49614`,x:`142.73175`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`18.66665649px`,"line-height":`1.25`,"font-family":`roboto`,"-inkscape-font-specification":`roboto`,"letter-spacing":`0px`,"word-spacing":`0px`,fill:`#ffffff`},"xml:space":`preserve`},componentDamageMap={body:{FL:{svgId:`bodyFL`,priority:2,tempDamage:!1},FR:{svgId:`bodyFR`,priority:2,tempDamage:!1},ML:{svgId:`bodyML`,priority:2,tempDamage:!1},MR:{svgId:`bodyMR`,priority:2,tempDamage:!1},RL:{svgId:`bodyRL`,priority:2,tempDamage:!1},RR:{svgId:`bodyRR`,priority:2,tempDamage:!1}},engine:{oilStarvation:{svgId:`engine`,priority:0,damageText:`Oil Starvation`,tempDamage:!0},coolantHot:{svgId:`engine`,priority:0,damageText:`Coolant Overheating`,tempDamage:!1},oilHot:{svgId:`engine`,priority:0,damageText:`Oil Overheating`,tempDamage:!1},pistonRingsDamaged:{svgId:`engine`,priority:0,damageText:`Piston Rings Damaged`,tempDamage:!1},rodBearingsDamaged:{svgId:`engine`,priority:0,damageText:`Rod Bearings Damaged`,tempDamage:!1},headGasketDamaged:{svgId:`engine`,priority:0,damageText:`Head Gasket Damaged`,tempDamage:!1},turbochargerHot:{svgId:`engine`,priority:0,damageText:`Turbocharger Overheating`,tempDamage:!1},engineIsHydrolocking:{svgId:`engine`,priority:0,damageText:`Engine is Hydrolocking`,tempDamage:!1},engineReducedTorque:{svgId:`engine`,priority:0,damageText:`Engine Torque Reduced`,tempDamage:!1},mildOverrevDamage:{svgId:`engine`,priority:0,damageText:`Mild Over Rev Damage`,tempDamage:!1},overRevDanger:{svgId:`engine`,priority:0,damageText:`Over Rev Risk`,tempDamage:!1},overTorqueDanger:{svgId:`engine`,priority:0,damageText:`Over Torque Risk`,tempDamage:!1},engineHydrolocked:{svgId:`engine`,priority:1,damageText:`Engine is Hydrolocked`,tempDamage:!1},engineDisabled:{svgId:`engine`,priority:1,damageText:`Engine Disabled`,tempDamage:!1},blockMelted:{svgId:`engine`,priority:1,damageText:`Block Melted`,tempDamage:!1},engineLockedUp:{svgId:`engine`,priority:1,damageText:`Engine Locked Up`,tempDamage:!1},radiatorLeak:{svgId:`radiator`,priority:1,damageText:`Radiator Leaking`,tempDamage:!1}},powertrain:{wheelaxleFL:{svgId:`wheelaxleFL`,priority:1,damageText:`Front Left Axle Broken`,tempDamage:!1},wheelaxleFR:{svgId:`wheelaxleFR`,priority:1,damageText:`Front Right Axle Broken`,tempDamage:!1},wheelaxleRL:{svgId:`wheelaxleRL`,priority:1,damageText:`Rear Left Axle Broken`,tempDamage:!1},wheelaxleRR:{svgId:`wheelaxleRR`,priority:1,damageText:`Rear Right Axle Broken`,tempDamage:!1},driveshaft:{svgId:`driveshaft`,priority:1,damageText:`Driveshaft Broken`,tempDamage:!1},driveshaft_F:{svgId:`driveshaft`,priority:1,damageText:`Front Driveshaft Broken`,tempDamage:!1},mainEngine:{svgId:`engine`,priority:1,damageText:`Engine Broken`,tempDamage:!1}},energyStorage:{mainTank:{svgId:`fueltank`,priority:1,damageText:`Fuel Tank Damaged`,tempDamage:!1}},wheels:{tireFL:{svgId:`tireFL`,priority:0,damageText:`Front Left Tire Burst`,tempDamage:!1},tireFR:{svgId:`tireFR`,priority:0,damageText:`Front Right Tire Burst`,tempDamage:!1},tireRL:{svgId:`tireRL`,priority:0,damageText:`Rear Left Tire Burst`,tempDamage:!1},tireRR:{svgId:`tireRR`,priority:0,damageText:`Rear Right Tire Burst`,tempDamage:!1},brakeFL:{svgId:`brakeFL`,priority:1,damageText:`FL Brake Damaged`,tempDamage:!1},brakeFR:{svgId:`brakeFR`,priority:1,damageText:`FR Brake Damaged`,tempDamage:!1},brakeRL:{svgId:`brakeRL`,priority:1,damageText:`RL Brake Damaged`,tempDamage:!1},brakeRR:{svgId:`brakeRR`,priority:1,damageText:`RR Brake Damaged`,tempDamage:!1},brakeOverHeatFL:{svgId:`brakeFL`,priority:0,damageText:`FL Brake Fading`,tempDamage:!0},brakeOverHeatFR:{svgId:`brakeFR`,priority:0,damageText:`FR Brake Fading`,tempDamage:!0},brakeOverHeatRL:{svgId:`brakeRL`,priority:0,damageText:`RL Brake Fading`,tempDamage:!0},brakeOverHeatRR:{svgId:`brakeRR`,priority:0,damageText:`RR Brake Fading`,tempDamage:!0},FL:{svgId:`tireFL`,priority:1,damageText:`Front Left Tire Broken`,tempDamage:!1},FR:{svgId:`tireFR`,priority:1,damageText:`Front Right Tire Broken`,tempDamage:!1},RL:{svgId:`tireRL`,priority:1,damageText:`Rear Left Tire Broken`,tempDamage:!1},RR:{svgId:`tireRR`,priority:1,damageText:`Rear Right Tire Broken`,tempDamage:!1}}},textDisplayTime=2e3,orangeColor=`rgba(255, 132, 0, 0.6)`,redColor=`rgba(255, 0, 0, 0.6)`,noDataColor=`rgba(0, 0, 0, 0 )`,streamsList=[`wheelThermalData`,`engineInfo`],_sfc_main$210={__name:`app`,setup(__props){let{$game}=useLibStore(),svg=ref(null),tireFL=ref(null),tireFR=ref(null),tireRL=ref(null),tireRR=ref(null),bodyFL=ref(null),bodyML=ref(null),bodyMR=ref(null),driveShaft=ref(null),engine=ref(null),fueltank=ref(null),radiator=ref(null),wheelaxleFL=ref(null),wheelaxleFR=ref(null),brakeFL=ref(null),brakeFR=ref(null),bodyFR=ref(null),bodyRL=ref(null),bodyRR=ref(null),brakeRL=ref(null),brakeRR=ref(null),wheelaxleRL=ref(null),wheelaxleRR=ref(null),damageContainer=ref(null),damageBox=ref(null),damageText=ref(null),appState=reactive({isAppDisplayed:!1,hasDamage:!1,permanentDamagedParts:0,isProcessingMessages:!1}),damageTextQueue=ref([]),componentDamage=ref({body:{FL:{damageDisplayed:!1,reference:bodyFL},FR:{damageDisplayed:!1,reference:bodyFR},ML:{damageDisplayed:!1,reference:bodyML},MR:{damageDisplayed:!1,reference:bodyMR},RL:{damageDisplayed:!1,reference:bodyRL},RR:{damageDisplayed:!1,reference:bodyRR}},engine:{oilStarvation:{damageDisplayed:!1,reference:engine},coolantHot:{damageDisplayed:!1,reference:engine},oilHot:{damageDisplayed:!1,reference:engine},pistonRingsDamaged:{damageDisplayed:!1,reference:engine},rodBearingsDamaged:{damageDisplayed:!1,reference:engine},headGasketDamaged:{damageDisplayed:!1,reference:engine},turbochargerHot:{damageDisplayed:!1,reference:engine},engineIsHydrolocking:{damageDisplayed:!1,reference:engine},engineReducedTorque:{damageDisplayed:!1,reference:engine},mildOverrevDamage:{damageDisplayed:!1,reference:engine},overRevDanger:{damageDisplayed:!1,reference:engine},overTorqueDanger:{damageDisplayed:!1,reference:engine},engineHydrolocked:{damageDisplayed:!1,reference:engine},engineDisabled:{damageDisplayed:!1,reference:engine},blockMelted:{damageDisplayed:!1,reference:engine},engineLockedUp:{damageDisplayed:!1,reference:engine},radiatorLeak:{damageDisplayed:!1,reference:radiator}},powertrain:{wheelaxleFL:{damageDisplayed:!1,reference:wheelaxleFL},wheelaxleFR:{damageDisplayed:!1,reference:wheelaxleFR},wheelaxleRL:{damageDisplayed:!1,reference:wheelaxleRL},wheelaxleRR:{damageDisplayed:!1,reference:wheelaxleRR},driveshaft:{damageDisplayed:!1,reference:driveShaft},driveshaft_F:{damageDisplayed:!1,reference:driveShaft},mainEngine:{damageDisplayed:!1,reference:engine}},energyStorage:{mainTank:{damageDisplayed:!1,reference:fueltank}},wheels:{tireFL:{damageDisplayed:!1,reference:tireFL},tireFR:{damageDisplayed:!1,reference:tireFR},tireRL:{damageDisplayed:!1,reference:tireRL},tireRR:{damageDisplayed:!1,reference:tireRR},brakeFL:{damageDisplayed:!1,reference:brakeFL},brakeFR:{damageDisplayed:!1,reference:brakeFR},brakeRL:{damageDisplayed:!1,reference:brakeRL},brakeRR:{damageDisplayed:!1,reference:brakeRR},brakeOverHeatFL:{damageDisplayed:!1,reference:brakeFL},brakeOverHeatFR:{damageDisplayed:!1,reference:brakeFR},brakeOverHeatRL:{damageDisplayed:!1,reference:brakeRL},brakeOverHeatRR:{damageDisplayed:!1,reference:brakeRR},FL:{damageDisplayed:!1,reference:tireFL},FR:{damageDisplayed:!1,reference:tireFR},RL:{damageDisplayed:!1,reference:tireRL},RR:{damageDisplayed:!1,reference:tireRR}}}),damageTimeout=ref(null),animTimeout=ref(null);onMounted(()=>{$game.events.on(`DamageData`,onDamageData),$game.events.on(`VehicleReset`,onReset),$game.events.on(`VehicleChange`,onReset),$game.events.on(`VehicleFocusChanged`,onVehicleFocusChanged),$game.streams.add(streamsList)}),onUnmounted(()=>{$game.events.off(`DamageData`,onDamageData),$game.events.off(`VehicleReset`,onReset),$game.events.off(`VehicleChange`,onReset),$game.events.off(`VehicleFocusChanged`,onVehicleFocusChanged),$game.streams.remove(streamsList)});function onDamageData(data){for(let type in data)for(let component in data[type]){if(componentDamageMap[type]===void 0||componentDamageMap[type][component]===void 0)continue;let damagedComponent=componentDamage.value[type][component],damageComponentProps=componentDamageMap[type][component];if(!damagedComponent.damageDisplayed&&(data[type][component]===!0||data[type][component]>0)){if(damageComponentProps.priority===1)appState.permanentDamagedParts+=1,clearTimeout(damageTimeout.value),setComponentDamageStyles(damagedComponent.reference,redColor,`flashAnim`);else if(damageComponentProps.priority===0)appState.permanentDamagedParts+=1,clearTimeout(damageTimeout.value),setComponentDamageStyles(damagedComponent.reference,orangeColor,`flashAnim`);else if(damageComponentProps.priority===2){let damageAmount=Math.round(data[type][component]*1e3),bodyColor=`rgba(${150+damageAmount}, ${150-damageAmount}, 0, 0.6)`;setComponentDamageStyles(damagedComponent.reference,bodyColor,``)}appState.hasDamage=!0,damageComponentProps.damageText!==void 0&&(damageTextQueue.value.push(damageComponentProps.damageText),damagedComponent.damageDisplayed=!0)}else damageComponentProps.tempDamage&&(data[type][component]===!0||data[type][component]>0?setComponentDamageStyles(damagedComponent.reference,orangeColor,`flashAnim`):(damagedComponent.damageDisplayed=!1,appState.permanentDamagedParts=-1,setComponentDamageStyles(damagedComponent.reference,noDataColor,``)))}!appState.isAppDisplayed&&appState.hasDamage&&(appState.isAppDisplayed=!0,processDamageText(),appState.permanentDamagedParts===0?showAppTimed():clearTimeout(damageTimeout.value))}function processDamageText(){damageTextQueue.value&&damageTextQueue.value.length>0?(damageContainer.value.style.opacity=1,damageText.value.textContent=damageTextQueue.value[0],damageTextQueue.value.splice(0,1),animTimeout.value=setTimeout(processDamageText,textDisplayTime)):(damageContainer.value.style.opacity=0,damageText.value.textContent=``,clearTimeout(animTimeout.value))}function onReset(){for(let type in componentDamage.value)for(let component in componentDamage.value[type])componentDamage.value[type][component].reference.style.fill=noDataColor;appState.isAppDisplayed=!1,appState.hasDamage=!1,appState.permanentDamagedParts=0,damageTextQueue.value=[],showAppTimed()}function onVehicleFocusChanged(data){data.mode===!0&&onReset()}function showAppTimed(){damageTimeout.value&&clearTimeout(damageTimeout.value),appState.isAppDisplayed=!0,damageTimeout.value=setTimeout(function(){appState.isAppDisplayed=!1},2700)}function setComponentDamageStyles(componentRef,color,anim){componentRef.style.fill=color,anim===``?componentRef.classList=[]:componentRef.classList.add(anim)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,{ref_key:`svg`,ref:svg,class:`svg-app`,viewBox:`-20 -50 300 527`,style:normalizeStyle({opacity:appState.isAppDisplayed?1:0})},[createBaseVNode(`g`,_hoisted_1$188,[createBaseVNode(`path`,{ref_key:`tireFL`,ref:tireFL,d:`m 40.219516,385.93366 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 212.19799,385.43366 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,ref_key:`tireFR`,ref:tireFR},null,512),createBaseVNode(`path`,{ref_key:`tireRR`,ref:tireRR,d:`m 212.19799,654.14795 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 40.219516,654.14795 0.0893,-35.49107 c 0,0 0.44642,-5.22322 5.08928,-5.22322 4.64286,0 22.41072,-0.13394 22.41072,-0.13394 0,0 5.44643,-10e-6 5.49107,5.22321 0.0534,6.25041 -0.0447,34.64286 -0.0447,34.64286 l 0.0893,36.25 c 0,0 -0.0446,5.35714 -5.53571,5.44643 -3.12586,0.0508 -21.47322,-10e-6 -21.47322,-10e-6 0,0 -5.98214,10e-6 -6.02678,-5.3125 -0.0375,-4.46412 -0.0893,-35.40178 -0.0893,-35.40178 z`,ref_key:`tireRL`,ref:tireRL},null,512),createBaseVNode(`path`,{ref_key:`bodyFL`,ref:bodyFL,d:`m 139.30351,268.73244 c 0,0 -20.06962,-0.0115 -32.7295,1.35397 -11.849388,1.27802 -23.33457,5.11217 -35.698872,11.89174 -11.963689,6.55991 -22.259598,16.59274 -27.506842,31.58729 -3.060137,8.74465 -3.902495,25.39725 -3.902495,25.39725 l 9.609942,-0.14814 c 0,0 1.636978,-16.52695 5.208997,-24.93149 3.978738,-9.3615 11.635356,-19.52025 21.213285,-24.53523 10.627835,-5.56471 18.689453,-8.01564 32.759185,-10.2291 11.61143,-1.82671 31.13813,-1.14019 31.13813,-1.14019 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`bodyML`,ref:bodyML,d:`m 46.365238,434.85859 c 0,0 -4.37766,0.0905 -6.56641,0.125 -0.0234,2.215 -0.08,17.90873 -0.125,26.86328 0,0 -20.45068,7.80958 -22.22461,10.85938 -1.79329,3.0831 -4.63644,8.09161 -2.46289,8.46094 0,0 25.14091,-3.55661 25.60352,-3.40821 0.0618,2.25563 -0.62153,126.52252 -0.59375,127.77539 1.21285,-0.002 9.6289,0.0312 9.6289,0.0312 l -0.01,-170.70703 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`bodyMR`,ref:bodyMR,d:`m 236.6054,434.90159 -0.0117,170.70899 c 0,0 7.91605,-0.0352 9.1289,-0.0332 0.0278,-1.25287 -0.65555,-125.51976 -0.59375,-127.77539 0.46261,-0.1484 25.60352,3.40821 25.60352,3.40821 2.17355,-0.36933 -0.6696,-5.37589 -2.46289,-8.45899 -1.77393,-3.0498 -22.22266,-10.85937 -22.22266,-10.85937 -0.045,-8.95456 -0.10355,-24.64828 -0.12695,-26.86328 -2.18875,-0.0345 -9.31447,-0.12697 -9.31447,-0.12697 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`driveShaft`,ref:driveShaft,d:`m 146.88019,519.13977 0.34682,-126.1992 c 0,0 14.81582,-18.06715 -4.26439,-17.94569 -19.92,0.12681 -4.95719,17.95354 -4.95719,17.95354 l 0.0408,126.25385 c -0.48292,33.8145 0.52349,126.53492 0.52349,126.53492 -3.70809,6.93305 -6.96405,16.59296 4.6368,16.4848 11.45601,-0.10682 8.66714,-8.10662 4.65438,-16.55312 -1.97544,-4.15814 -0.98066,-126.5291 -0.98066,-126.5291 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`0.99999976`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`engine`,ref:engine,d:`m 122.07373,314.95322 h 33.63152 v 5.9272 h -13.25677 v 5.34505 h 12.93926 l 6.08594,9.31416 h 5.37155 v 4.97461 h 6.00656 v -5.05399 h 8.22927 c 0,0 2.66605,2.98563 3.2282,4.8423 1.71505,5.66443 1.56492,12.04739 0,17.75512 -0.61276,2.23494 -3.54572,5.98011 -3.54572,5.98011 h -7.93821 v -5.39797 h -6.29763 v 11.32517 h -34.98103 l -6.50934,-7.93822 H 113.0771 v -16.51145 h -5.98011 v 15.87643 h -5.1863 v -28.89508 h 4.97462 v 7.62066 h 6.29764 v -7.72651 h 8.99664 v -5.98013 h 14.12999 v -6.19179 h -14.23585 z`,style:{display:`inline`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{d:`m 117.17264,721.33809 -7.7414,-9.05075 c 0,0 -1.6874,1.50785 -2.481,2.29715 -0.685,0.6814 -1.3051,1.5911 0.2757,3.6525 0.5444,0.7098 3.2227,3.9338 3.7903,4.5024 1.6325,1.6355 2.5754,1.6201 3.3309,1.0108 0.9517,-0.7675 2.8255,-2.4121 2.8255,-2.4121 z m -5.4902,-9.02777 c -0.2639,-0.33031 -0.3782,-0.42184 0.023,-0.78103 0.2875,-0.31046 1.9506,-1.87788 2.2512,-2.13637 0.2218,-0.19078 0.3561,-0.42492 0.1149,-0.7236 -0.2412,-0.33308 -2.1908,-2.68012 -2.4982,-3.06097 -0.2198,-0.27232 -0.2732,-0.32108 -0.2732,-0.50554 0,-0.75917 0.011,-34.43177 0.015,-35.00437 0,-0.2149 0.056,-0.3086 0.5162,-0.3086 h 51.67845 c 2.0683,0 3.0251,0.3486 4.3679,1.4435 1.1871,0.9678 2.1659,2.0917 2.17,4.6095 0,0 0.065,37.07605 0.065,38.41705 0,1.2398 -0.1967,4.1364 -1.6325,5.5294 -1.0614,1.0299 -3.8532,1.8924 -4.9438,1.8924 -1.5414,0 -37.80368,-0.016 -38.25553,-0.016 -0.32906,0 -0.70707,-0.079 -0.93514,-0.3163 -0.27185,-0.2826 -2.9151,-3.0777 -3.22317,-3.371 -0.15862,-0.151 -0.25989,-0.4548 -0.64972,-0.097 -0.3899,0.3574 -1.73649,1.4573 -2.04669,1.7218 -0.1403,0.1197 -0.2841,0.2357 -0.5523,-0.032 -0.4136,-0.4769 -5.8261,-6.80285 -6.191,-7.25968 z m 20.26835,-10.96158 c -0.003,-4.55255 -0.0326,-8.19817 0,-12.74562 0,-0.7695 -0.32724,-0.97794 -1.30987,-1.85445 -0.76302,-0.68063 -1.41614,-1.23286 -1.90915,-1.69336 -0.36587,-0.34178 -0.85706,-0.80537 -0.84008,-1.1791 0.0258,-0.56967 0.59396,-1.0422 0.93428,-1.21472 0.54578,-0.27667 0.94727,-0.0528 1.23375,0.23366 0.30382,0.30381 1.84818,1.77993 2.58906,2.39496 0.44759,0.37156 0.58562,0.67733 1.67741,0.67733 5.46749,-0.0217 12.23023,-0.18415 18.32732,0 1.09189,0 1.22992,-0.30577 1.67737,-0.67733 0.74089,-0.61503 2.28521,-2.09115 2.58911,-2.39496 0.2865,-0.28643 0.688,-0.51033 1.2338,-0.23366 0.3404,0.17252 0.9085,0.64505 0.9344,1.21472 0.017,0.37373 -0.4743,0.83732 -0.8402,1.1791 -0.493,0.4605 -1.1461,1.01273 -1.909,1.69336 -0.98279,0.87651 -1.30997,1.08495 -1.30997,1.85445 0,4.55255 0.0323,8.19817 0,12.74562 0,0.76951 0.32718,0.97793 1.30997,1.85447 0.7629,0.68062 1.416,1.23285 1.909,1.69335 0.3659,0.34177 0.857,0.80537 0.8402,1.1791 -0.026,0.56967 -0.594,1.04219 -0.9344,1.21472 -0.5458,0.27667 -0.9473,0.0528 -1.2338,-0.23366 -0.3039,-0.30382 -1.84822,-1.77992 -2.58911,-2.39497 -0.44745,-0.37154 -0.58548,-0.67731 -1.67737,-0.67731 -6.55155,0.019 -11.82218,0.18501 -18.32732,0 -1.09179,0 -1.22982,0.30577 -1.67741,0.67731 -0.74088,0.61505 -2.28524,2.09115 -2.58906,2.39497 -0.28648,0.28644 -0.68797,0.51033 -1.23375,0.23366 -0.34032,-0.17253 -0.90842,-0.64505 -0.93428,-1.21472 -0.017,-0.37373 0.47421,-0.83733 0.84008,-1.1791 0.49301,-0.4605 1.14613,-1.01273 1.90915,-1.69335 0.98263,-0.87654 1.30987,-1.08496 1.30987,-1.85447 z m 2.56799,-10.35082 c 0,2.40538 0,5.36454 0,8.01339 0,0.63296 -0.0236,1.4238 0.45482,1.90048 0.45132,0.44967 1.08277,0.42233 1.81926,0.42233 h 13.2426 c 0.7365,0 1.36798,0.0273 1.81926,-0.42233 0.47837,-0.47668 0.45477,-1.26752 0.45477,-1.90048 v -3.94714 c 0,-1.35542 0,-2.71084 0,-4.06625 0,-0.63296 0.0233,-1.42381 -0.45477,-1.90047 -0.45128,-0.44969 -1.08276,-0.42234 -1.81926,-0.42234 h -13.2426 c -0.73649,0 -1.36794,-0.0273 -1.81926,0.42234 -0.47842,0.47666 -0.45482,1.26751 -0.45482,1.90047 z`,style:{fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},ref_key:`fueltank`,ref:fueltank},null,512),createBaseVNode(`path`,{d:`m 162.19586,303.74311 v 1.62868 c 0,0 -0.0239,0.60243 0.40384,0.86252 0.36641,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -4.32093 c 0,0 -0.004,-0.63642 -0.53018,-0.91858 -0.27049,-0.14492 -2.81926,2.15048 -3.22871,2.49847 -0.49791,0.42318 -0.5886,0.94557 -0.5886,0.94557 z m -8.74296,-2.37979 v 4.00847 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36641,0.22282 3.17759,0.31545 3.59708,-0.042 0.34846,-0.29691 0.34657,-0.78069 0.34657,-0.78069 v -3.43014 c 0,0 -0.004,-0.63642 -0.53018,-0.91857 -0.27049,-0.14493 -2.94617,-0.75348 -3.2287,-0.64521 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.57375,1.15667 v 2.8518 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36641,0.22282 3.17759,0.31545 3.59708,-0.042 0.34846,-0.29691 0.34657,-0.78069 0.34657,-0.78069 v -3.78911 c 0,0 -0.002,-0.37799 -0.24416,-0.68051 -0.072,-0.09 -0.16527,-0.17335 -0.28602,-0.23806 -0.27049,-0.14492 -2.94617,0.76217 -3.2287,0.87043 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.63016,2.23357 v 0.61823 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36642,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -1.35611 c 0,0 -0.004,-0.63641 -0.53017,-0.91857 -0.2705,-0.14492 -2.94617,0.56274 -3.22871,0.671 -0.61019,0.23381 -0.5886,0.94557 -0.5886,0.94557 z m -8.50835,1.48075 c 0.36641,0.22282 3.17758,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.50066 0.34658,-0.50066 0,0 -0.004,-1.03528 -0.53018,-1.31744 -0.27049,-0.14492 -2.94617,-0.0851 -3.22871,0.0232 -0.61018,0.23381 -0.5886,1.10014 -0.5886,1.10014 0,0 -0.0239,0.47668 0.40384,0.73676 z m -9.0904,-2.1588 v 1.29628 c 0,0 -0.0239,0.60243 0.40383,0.86252 0.36642,0.22282 3.17759,0.31545 3.59707,-0.042 0.34847,-0.29691 0.34658,-0.78069 0.34658,-0.78069 v -0.5584 c 0,0 -0.004,-0.63642 -0.53017,-0.91858 -0.2705,-0.14492 -2.94617,-0.91301 -3.22871,-0.80474 -0.61019,0.23381 -0.5886,0.94556 -0.5886,0.94556 z m 52.345,1.37742 v -16.61221 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 16.63216 c 0,0 -0.004,0.63642 -0.53017,0.91857 -0.2705,0.14493 -2.94617,0.1552 -3.22871,0.0469 -0.61019,-0.23381 -0.5886,-0.94556 -0.5886,-0.94556 z m -8.79938,-16.61221 c 0,0 -0.0239,-0.60242 0.40384,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 3.32029 c 0,0 -0.004,0.63641 -0.53018,0.91857 -0.27049,0.14492 -2.60773,-2.10106 -3.22871,-2.63237 -0.4965,-0.42482 -0.5886,-0.97378 -0.5886,-0.97378 z m -8.74296,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59708,0.042 0.34846,0.29692 0.34657,0.78069 0.34657,0.78069 v 1.74529 c 0,0 -0.004,0.63642 -0.53018,0.91857 -0.27049,0.14493 -2.94617,-0.12683 -3.2287,-0.2351 -0.61019,-0.23381 -0.5886,-0.77636 -0.5886,-0.77636 z m -8.57375,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.17759,-0.31544 3.59708,0.042 0.34846,0.29692 0.34657,0.78069 0.34657,0.78069 v 1.80688 c 0,0 -0.002,0.378 -0.24416,0.68052 -0.072,0.09 -0.16527,0.17335 -0.28602,0.23805 -0.27049,0.14493 -2.94617,1.1141 -3.2287,1.00584 -0.61019,-0.23381 -0.5886,-0.81866 -0.5886,-0.81866 z m -8.63016,0 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 4.46516 c 0,0 -0.004,0.63641 -0.53017,0.91857 -0.2705,0.14493 -2.94617,0.97309 -3.22871,0.86482 -0.61019,-0.23381 -0.6027,-0.81866 -0.6027,-0.81866 z m -8.91219,0 c 0,0 -0.0239,-0.60242 0.40384,-0.86252 0.36641,-0.22281 3.17758,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 6.04004 c 0,0 -0.004,0.63641 -0.53018,0.91857 -0.27049,0.14493 -2.94617,-0.0986 -3.22871,-0.2069 -0.61018,-0.23381 -0.5886,-0.90327 -0.5886,-0.90327 z m -8.68656,4.20791 v -4.20791 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36642,-0.22281 3.17759,-0.31544 3.59707,0.042 0.34847,0.29692 0.34658,0.78069 0.34658,0.78069 v 4.90473 c 0,0 -0.004,0.63641 -0.53017,0.91857 -0.2705,0.14492 -2.94617,-0.52168 -3.22871,-0.62994 -0.61019,-0.23382 -0.5886,-0.94557 -0.5886,-0.94557 z m 0.0383,3.38266 0.0424,3.80682 c 4.76147,1.58463 12.44208,1.37115 18.62715,0.76876 4.9084,-0.47805 9.46499,-3.13968 14.38678,-3.45098 2.56844,-0.16246 7.67481,0.84058 7.67481,0.84058 l 0.018,4.52569 c 0,0 4.30181,-3.85868 6.85434,-6.08209 0.23182,-0.21672 0.26026,-0.28202 -0.0588,-0.61036 -2.4793,-2.37833 -6.8878,-6.08125 -6.8878,-6.08125 l 0.0141,4.90206 c 0,0 -5.19129,-1.89571 -12.24908,-0.16859 -3.96245,1.32729 -6.76872,2.21825 -10.27188,2.769 -2.7191,0.42749 -5.4997,0.55723 -8.24775,0.4009 -3.33921,-0.18995 -6.69491,-0.50286 -9.90211,-1.62054 z m -15.25121,10.1713 c 0,0.39543 -0.18036,1.62226 1.45209,3.25472 1.40638,1.19302 2.9727,1.1712 3.41028,1.1712 23.19944,0.0992 44.97243,0.0226 68.7019,0 0.43758,0 2.0039,0.0218 3.41029,-1.1712 1.63245,-1.63246 1.45208,-2.85929 1.45208,-3.25472 0.12422,-16.06162 0.0264,-3.05893 0,-19.25937 0,-0.39543 0.18037,-1.62225 -1.45208,-3.25471 -1.40639,-1.19302 -2.97271,-1.1712 -3.41029,-1.1712 -23.19944,-0.0992 -44.97243,-0.0226 -68.7019,0 -0.43758,0 -2.0039,-0.0218 -3.41028,1.1712 -1.63245,1.63246 -1.45209,2.85928 -1.45209,3.25471 -0.11802,17.21566 -0.0338,3.97954 0,19.25937 z m 1.90997,-17.51991 c 0,-0.36657 -0.12323,-2.09175 1.14118,-3.35617 1.05214,-0.89259 3.06543,-0.74668 3.48144,-0.74668 22.55947,-0.021 43.30609,-0.0919 65.36168,0 1.3185,0 2.52269,-0.19776 3.66518,0.74727 1.05732,1.05732 0.95743,2.19932 0.95743,3.35558 0.0252,15.01782 0.11812,0.8913 0,15.78046 0,1.5229 -0.0428,2.46913 -0.90102,3.32738 -1.06456,0.88061 -2.31847,0.77547 -3.72159,0.77547 -22.55947,0.021 -43.30609,0.0919 -65.36168,0 -1.7721,0 -2.45712,0.11664 -3.44156,-0.68686 -1.36393,-1.36393 -1.18106,-1.95258 -1.18106,-3.41599 0.12429,-15.20955 -0.092,-2.68107 0,-15.78046 z m 4.56001,16.37025 v -16.61221 c 0,0 -0.0239,-0.60242 0.40383,-0.86252 0.36641,-0.22281 3.1776,-0.31544 3.59708,0.042 0.34846,0.29692 0.34658,0.78069 0.34658,0.78069 v 16.63216 c 0,0 -0.004,0.63642 -0.53019,0.91857 -0.27048,0.14493 -2.94617,0.1552 -3.2287,0.0469 -0.61019,-0.23381 -0.5886,-0.94556 -0.5886,-0.94556 z`,style:{display:`inline`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`0.75000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},ref_key:`radiator`,ref:radiator},null,512),createBaseVNode(`path`,{ref_key:`wheelaxleFL`,ref:wheelaxleFL,d:`m 91.691145,389.0121 c 0,0 -2.43068,0.29676 -2.43068,-4.28053 0,-4.0406 2.22866,-4.30576 2.22866,-4.30576 9.222155,-0.11908 21.694875,-0.0585 30.917405,-0.0594 3.70837,-9.1e-4 6.85841,-0.28274 8.24298,0.90893 0.51207,0.44072 0.75871,1.92799 1.01166,3.17533 0.35371,1.74427 0.74974,2.96105 0.32477,3.71154 -0.50969,0.90009 -2.57006,0.96141 -2.57006,0.96141 -11.49186,0.003 -26.23329,-0.0229 -37.724735,-0.11152 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 193.49174,389.0121 c 0,0 2.43068,0.29676 2.43068,-4.28053 0,-4.0406 -2.22865,-4.30576 -2.22865,-4.30576 -9.22216,-0.11908 -21.44488,-0.0585 -30.66742,-0.0594 -3.70837,-9.1e-4 -6.85841,-0.28274 -8.24298,0.90893 -0.51207,0.44072 -0.75871,1.92799 -1.01166,3.17533 -0.35371,1.74427 -0.74974,2.96105 -0.32477,3.71154 0.50969,0.90009 2.57006,0.96141 2.57006,0.96141 11.49186,0.003 25.98329,-0.0229 37.47474,-0.11152 z`,ref_key:`wheelaxleFR`,ref:wheelaxleFR},null,512),createBaseVNode(`path`,{ref_key:`brakeFR`,ref:brakeFR,d:`m 210.35279,373.43366 h -5.22322 l -0.0446,-11.25 c 0,0 -0.0446,-1.02679 -1.51786,-1.16071 -0.91518,-0.15626 -3.83928,-0.067 -3.83928,-0.067 0,0 -2.04238,-0.11866 -2.0759,1.22768 -0.0626,2.51339 -0.0446,47.43304 -0.0446,47.43304 0,0 -0.0431,1.36663 1.7634,1.40625 1.21935,0.0262 3.83928,0.005 3.83928,0.005 0,0 1.86958,0.12132 1.96428,-1.61256 0.073,-1.33729 -0.0207,-10.46221 -0.0207,-10.46221 l 5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{ref_key:`brakeFL`,ref:brakeFL,d:`m 74.826658,373.43366 h 5.22322 l 0.0446,-11.25 c 0,0 0.0446,-1.02679 1.51786,-1.16071 0.91518,-0.15626 3.83928,-0.067 3.83928,-0.067 0,0 2.04238,-0.11866 2.0759,1.22768 0.0626,2.51339 0.0446,47.43304 0.0446,47.43304 0,0 0.0431,1.36663 -1.7634,1.40625 -1.21935,0.0262 -3.83928,0.005 -3.83928,0.005 0,0 -1.86958,0.12132 -1.96428,-1.61256 -0.073,-1.33729 0.0207,-10.46221 0.0207,-10.46221 l -5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},d:`m 145.98404,268.73244 c 0,0 19.06962,-0.0115 31.7295,1.35397 11.84939,1.27802 23.33457,5.11217 35.69887,11.89174 11.96369,6.55991 22.2596,16.59274 27.50684,31.58729 3.06014,8.74465 3.9025,25.39725 3.9025,25.39725 l -9.60995,-0.14814 c 0,0 -1.63697,-16.52695 -5.20899,-24.93149 -3.97874,-9.3615 -11.63536,-19.52025 -21.21329,-24.53523 -10.62783,-5.56471 -18.68945,-8.01564 -32.75918,-10.2291 -11.61143,-1.82671 -30.13813,-1.14019 -30.13813,-1.14019 z`,ref_key:`bodyFR`,ref:bodyFR},null,512),createBaseVNode(`path`,{style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 139.36946,758.05809 c 0,0 -20.14699,0.01 -32.81319,-1.1024 -11.855294,-1.0405 -23.346203,-4.162 -35.716671,-9.6818 -11.969654,-5.3407 -20.679708,-11.5646 -25.929569,-23.7724 -3.061663,-7.1197 -5.495432,-24.34913 -5.495432,-24.34913 l 9.614735,0.12066 c 0,0 1.637794,15.18257 5.211595,22.02527 3.980722,7.6218 11.817934,15.0086 21.40064,19.0916 10.633134,4.5306 18.345219,5.9957 32.421962,7.798 11.61723,1.487 31.39781,0.9282 31.39781,0.9282 z`,ref_key:`bodyRL`,ref:bodyRL},null,512),createBaseVNode(`path`,{ref_key:`bodyRR`,ref:bodyRR,d:`m 145.99795,758.05809 c 0,0 19.59077,0.01 32.25697,-1.1024 11.8553,-1.0405 23.34621,-4.162 35.71668,-9.6818 11.96965,-5.3407 20.67971,-11.5646 25.92957,-23.7724 3.06166,-7.1197 5.49543,-24.34913 5.49543,-24.34913 l -9.61473,0.12066 c 0,0 -1.6378,15.18257 -5.2116,22.02527 -3.98072,7.6218 -11.81793,15.0086 -21.40064,19.0916 -10.63314,4.5306 -18.34522,5.9957 -32.42197,7.798 -11.61723,1.487 -30.84159,0.9282 -30.84159,0.9282 z`,style:{fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 75.326658,641.12409 h 5.22322 l 0.0446,-11.25 c 0,0 0.0446,-1.02679 1.51786,-1.16071 0.91518,-0.15626 3.83928,-0.067 3.83928,-0.067 0,0 2.04238,-0.11866 2.0759,1.22768 0.0626,2.51339 0.0446,47.43304 0.0446,47.43304 0,0 0.0431,1.36663 -1.7634,1.40625 -1.21935,0.0262 -3.83928,0.005 -3.83928,0.005 0,0 -1.86958,0.12132 -1.96428,-1.61256 -0.073,-1.33729 0.0207,-10.46221 0.0207,-10.46221 l -5.24395,-0.12581 z`,ref_key:`brakeRL`,ref:brakeRL},null,512),createBaseVNode(`path`,{ref_key:`brakeRR`,ref:brakeRR,d:`m 209.87792,642.37917 h -5.22322 l -0.0446,-11.25 c 0,0 -0.0446,-1.02679 -1.51786,-1.16071 -0.91518,-0.15626 -3.83928,-0.067 -3.83928,-0.067 0,0 -2.04238,-0.11866 -2.0759,1.22768 -0.0626,2.51339 -0.0446,47.43304 -0.0446,47.43304 0,0 -0.0431,1.36663 1.7634,1.40625 1.21935,0.0262 3.83928,0.005 3.83928,0.005 0,0 1.86958,0.12132 1.96428,-1.61256 0.073,-1.33729 -0.0207,-10.46221 -0.0207,-10.46221 l 5.24395,-0.12581 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`path`,{style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 92.206308,649.46453 c 0,0 -2.43068,-0.29676 -2.43068,4.28053 0,4.0406 2.22866,4.30576 2.22866,4.30576 9.222162,0.11908 21.444882,0.0585 30.667412,0.0594 3.70837,9.1e-4 8.80295,0.28274 10.18752,-0.90893 0.51207,-0.44072 0.6941,-2.38196 0.90117,-3.66147 0.26289,-1.62435 0.42635,-2.41047 0.26953,-3.25855 -0.21138,-1.14316 -2.40433,-0.92826 -2.40433,-0.92826 -12.14004,-6.2e-4 -27.27967,0.0179 -39.419282,0.11152 z`,ref_key:`wheelaxleRL`,ref:wheelaxleRL},null,512),createBaseVNode(`path`,{ref_key:`wheelaxleRR`,ref:wheelaxleRR,d:`m 192.84519,649.46453 c 0,0 2.43068,-0.29676 2.43068,4.28053 0,4.0406 -2.22866,4.30576 -2.22866,4.30576 -9.22216,0.11908 -20.31988,0.0585 -29.54242,0.0594 -3.70837,9.1e-4 -8.80295,0.28274 -10.18752,-0.90893 -0.51207,-0.44072 -0.6941,-2.38196 -0.90117,-3.66147 -0.26289,-1.62435 -0.42635,-2.41047 -0.26953,-3.25855 0.21138,-1.14316 2.40433,-0.92826 2.40433,-0.92826 12.14004,-6.2e-4 26.15468,0.0179 38.29429,0.11152 z`,style:{display:`inline`,opacity:`1`,fill:`none`,"fill-rule":`evenodd`,stroke:`#000000`,"stroke-width":`1.00000012`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`}},null,512),createBaseVNode(`g`,{style:{opacity:`0`},ref_key:`damageContainer`,ref:damageContainer},[createBaseVNode(`rect`,{style:{opacity:`0.77399998`,fill:`#3e3e3e`,"stroke-width":`1.99999893`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`},ref_key:`damageBox`,ref:damageBox,width:`206.75557`,height:`28.991379`,x:`39.481575`,y:`234.25491`},null,512),_cache[0]||=createBaseVNode(`path`,{style:{opacity:`1`,fill:`none`,stroke:`#ffffff`,"stroke-width":`1.99999893`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 39.48159,263.2463 206.75556,-2e-5`},null,-1),createBaseVNode(`text`,_hoisted_2$153,[createBaseVNode(`tspan`,{ref_key:`damageText`,ref:damageText,style:{"text-align":`center`,"text-anchor":`middle`,fill:`#ffffff`},y:`255.49614`,x:`142.73175`},` Driveshaft Broken `,512)])],512)])],4))}},app_default$9=__plugin_vue_export_helper_default(_sfc_main$210,[[`__scopeId`,`data-v-f6aa177d`]]),_hoisted_1$187={class:`timeslip`,id:`slip`},_hoisted_2$152={class:`paper`},_hoisted_3$136={class:`header`},_hoisted_4$113={class:`table-wrapper`},_hoisted_5$98={class:`custom-table`},_hoisted_6$81={class:`left-align`},_hoisted_7$69={class:`right-align`},_hoisted_8$56={class:`right-align`},_hoisted_9$50={key:0},_hoisted_10$43={class:`right-align`},_hoisted_11$38={class:`right-align`},_hoisted_12$28={class:`header`},_hoisted_13$25={class:`left`},_hoisted_14$24={class:`right`},_hoisted_15$23={class:`name`},_hoisted_16$23={key:0,class:`rewards`},_hoisted_17$18={class:`reward`},_hoisted_18$16={class:`header`},_hoisted_19$13={key:0},_sfc_main$209={__name:`Timeslip`,props:{slip:Object},setup(__props){let{units}=useBridge(),props=__props,TIMER_ROWS_INFO=[{key:`laneName`,label:`Lane`},{key:null,label:``},{key:`dial`,label:`DIAL`},{key:`reactionTime`,label:`R/T`},{key:`time_60`,label:`60'`},{key:`time_330`,label:`330'`},{key:`time_1_8`,label:`1/8`},{key:`velAt_1_8_kmh`,label:`KM/H`},{key:`velAt_1_8_mph`,label:`MPH`},{key:`time_1000`,label:`1000'`},{key:`time_1_4`,label:`1/4`},{key:`velAt_1_4_kmh`,label:`KM/H`},{key:`velAt_1_4_mph`,label:`MPH`},{key:`dialDiff`,label:`DIFF`}],getRacerByLane=laneNum=>props.slip.racerInfos.find(racer=>racer.laneNum===laneNum),getTimerValue=(laneNum,timerKey)=>{let racer=getRacerByLane(laneNum);if(!racer)return`-`;if(timerKey===null)return``;if(timerKey===`laneName`)return racer.lane||`-`;if(timerKey===`dial`){if(props.slip.dragType!==`bracketRace`)return`-`;let racer$1=getRacerByLane(laneNum);if(!racer$1)return`-`;let value=racer$1.timers.dial;if(value==null)return`-`;let num=parseFloat(value);return isNaN(num)?`-`:num.toFixed(3)}if(timerKey===`dialDiff`){if(props.slip.dragType!==`bracketRace`)return`-`;let racer$1=getRacerByLane(laneNum);if(!racer$1)return`-`;let value=racer$1.dialDiff;return value==null?`-`:formatDialDiff(value)}if(timerKey.includes(`velAt_`)){if(timerKey.includes(`_kmh`)){let baseKey=timerKey.replace(`_kmh`,``);return racer.velocities[baseKey+`_km/h`]||`-`}else if(timerKey.includes(`_mph`)){let baseKey=timerKey.replace(`_mph`,``);return racer.velocities[baseKey+`_mph`]||`-`}}return racer.timers[timerKey]||`-`},formatDialDiff=value=>{if(value===`-`)return`-`;let num=parseFloat(value);return isNaN(num)?`-`:(num>0?`+`:``)+num.toFixed(3)},getWinnerResult=laneNum=>{let racer=getRacerByLane(laneNum);if(!racer)return`-`;if(racer.disqualification)return`DQ`;if(props.slip.racerInfos.length===1)return`-`;let otherRacer=getRacerByLane(laneNum===1?2:1);if(!otherRacer)return`-`;if(otherRacer.disqualification)return`WINNER`;if(props.slip.dragType===`bracketRace`){let thisDiff=parseFloat(racer.dialDiff),otherDiff=parseFloat(otherRacer.dialDiff);return thisDiff===otherDiff?`TIE`:thisDiff>0&&otherDiff>0?thisDiffotherDiff?`WINNER`:`Break Out`}else{let thisTime=parseFloat(racer.finalTime),otherTime=parseFloat(otherRacer.finalTime);return thisTime>otherTime?`+${(thisTime-otherTime).toFixed(3)}`:`WINNER`}};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$187,[_cache[3]||=createBaseVNode(`div`,{class:`rip reverse top`},null,-1),createBaseVNode(`div`,_hoisted_2$152,[createBaseVNode(`div`,_hoisted_3$136,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slip.stripInfo,info=>(openBlock(),createElementBlock(`div`,{key:info},toDisplayString(_ctx.$tt(info)),1))),128))]),createBaseVNode(`div`,_hoisted_4$113,[createBaseVNode(`table`,_hoisted_5$98,[createBaseVNode(`tbody`,null,[(openBlock(),createElementBlock(Fragment,null,renderList(TIMER_ROWS_INFO,(rowInfo,rowIndex)=>createBaseVNode(`tr`,{key:`timer-`+rowIndex,class:normalizeClass({"quarter-mile-row":rowInfo.key===`time_1_4`})},[createBaseVNode(`td`,_hoisted_6$81,toDisplayString(rowInfo.label),1),createBaseVNode(`td`,_hoisted_7$69,toDisplayString(getTimerValue(2,rowInfo.key)),1),createBaseVNode(`td`,_hoisted_8$56,toDisplayString(getTimerValue(1,rowInfo.key)),1)],2)),64)),__props.slip.racerInfos.length>1?(openBlock(),createElementBlock(`tr`,_hoisted_9$50,[_cache[0]||=createBaseVNode(`td`,{class:`left-align`},null,-1),createBaseVNode(`td`,_hoisted_10$43,toDisplayString(getWinnerResult(2)),1),createBaseVNode(`td`,_hoisted_11$38,toDisplayString(getWinnerResult(1)),1)])):createCommentVNode(``,!0)])])]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slip.racerInfos,racer=>(openBlock(),createElementBlock(`div`,{key:racer.name,class:`racer`},[createBaseVNode(`div`,_hoisted_12$28,[createBaseVNode(`div`,_hoisted_13$25,toDisplayString(racer.lane),1),createBaseVNode(`div`,_hoisted_14$24,toDisplayString(racer.licenseText),1)]),createBaseVNode(`div`,_hoisted_15$23,toDisplayString(racer.name),1),Object.keys(racer.rewards).length===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_16$23,[_cache[1]||=createTextVNode(` Rewards... `,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(racer.rewards,reward=>(openBlock(),createElementBlock(`div`,_hoisted_17$18,[createTextVNode(toDisplayString(reward)+` BMRA-XP `,1),createVNode(unref(bngIcon_default),{class:`reward-icon`,type:unref(icons).wheelOutline,color:`black`},null,8,[`type`])]))),256)),_cache[2]||=createBaseVNode(`template`,null,[createTextVNode(` ... `)],-1)]))]))),128)),createBaseVNode(`div`,_hoisted_18$16,[createBaseVNode(`div`,null,toDisplayString(unref(units).buildString(`temperature`,__props.slip.env.tempC,1,`c`))+` / `+toDisplayString(unref(units).buildString(`temperature`,__props.slip.env.tempC,1,`f`)),1),__props.slip.env.customGrav?(openBlock(),createElementBlock(`div`,_hoisted_19$13,toDisplayString(_ctx.$tt(`ui.environment.gravity`))+`: `+toDisplayString(__props.slip.env.gravity),1)):createCommentVNode(``,!0)])]),_cache[4]||=createBaseVNode(`div`,{class:`rip bottom`},null,-1)]))}},Timeslip_default=__plugin_vue_export_helper_default(_sfc_main$209,[[`__scopeId`,`data-v-4b627404`]]),_hoisted_1$186={key:0,class:`bng-app`,id:`container`},_hoisted_2$151={class:`slide`},_sfc_main$208={__name:`app`,setup(__props){let{$game}=useLibStore(),slip=ref({});onMounted(()=>{$game.events.on(`onDragRaceTimeslipData`,onDragRaceTimeslipData)}),onUnmounted(()=>{$game.events.off(`onDragRaceTimeslipData`,onDragRaceTimeslipData)});function onDragRaceTimeslipData(rawData){slip.value=rawData,rawData&&(console.log(rawData),Lua_default.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Missions>Timeslip`))}let screenshot=function(){Lua_default.gameplay_drag_dragBridge.screenshotTimeslip()},clear=function(){slip.value=null};return(_ctx,_cache)=>slip.value&&slip.value.stripInfo?(openBlock(),createElementBlock(`div`,_hoisted_1$186,[createBaseVNode(`div`,_hoisted_2$151,[createVNode(Timeslip_default,{slip:slip.value,save:``,clear:``},null,8,[`slip`]),createVNode(unref(bngIcon_default),{class:`clear`,type:unref(icons).trashBin1,onClick:clear},null,8,[`type`]),createVNode(unref(bngIcon_default),{class:`save`,type:unref(icons).floppyDisk,onClick:screenshot},null,8,[`type`])])])):createCommentVNode(``,!0)}},app_default$10=__plugin_vue_export_helper_default(_sfc_main$208,[[`__scopeId`,`data-v-84d60911`]]),_hoisted_1$185={key:0},_hoisted_2$150={class:`lights-container`},_hoisted_3$135={class:`circles-wrapper`},_hoisted_4$112={class:`stage-circle`},_hoisted_5$97={class:`stage-top`},_hoisted_6$80={class:`stage-middle`},_hoisted_7$68={class:`stage-bottom`},_hoisted_8$55={class:`circles-wrapper`},_hoisted_9$49={class:`circles-wrapper`},_hoisted_10$42={class:`circles-wrapper`},_hoisted_11$37={class:`circles-wrapper`},_sfc_main$207={__name:`Treelights`,setup(__props){let events$3=useEvents(),isStaging=ref(!1),stageLights=ref([{stageLights:{prestageLight:!1,stageLight:!1},countDownLights:{amberLight1:!1,amberLight2:!1,amberLight3:!1,greenLight:!1,redLight:!1},globalLights:{blueLight:!1}}]),updateLights=changes=>{changes.stageLights&&(stageLights.value[0].stageLights={...stageLights.value[0].stageLights,...changes.stageLights}),changes.countDownLights&&(stageLights.value[0].countDownLights={...stageLights.value[0].countDownLights,...changes.countDownLights},(changes.countDownLights.greenLight||changes.countDownLights.redLight)&&setTimeout(()=>{isStaging.value=!1},2e3))},updateStaging=isNearby=>{isStaging.value=isNearby};return onMounted(()=>{events$3.on(`updateTreeLightApp`,updateLights),events$3.on(`updateTreeLightStaging`,updateStaging)}),onUnmounted(()=>{events$3.off(`updateTreeLightApp`,updateLights),events$3.off(`updateTreeLightStaging`,updateStaging)}),(_ctx,_cache)=>isStaging.value.valueOf==0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$185,[createBaseVNode(`div`,_hoisted_2$150,[createBaseVNode(`div`,_hoisted_3$135,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{blue:stageLights.value[0].globalLights.blueLight,red:stageLights.value[0].countDownLights.redLight}])},[withDirectives(createBaseVNode(`div`,_hoisted_4$112,[withDirectives(createBaseVNode(`div`,_hoisted_5$97,[..._cache[0]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.prestageLight]]),withDirectives(createBaseVNode(`div`,_hoisted_6$80,[..._cache[1]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.prestageLight&&stageLights.value[0].stageLights.stageLight]]),withDirectives(createBaseVNode(`div`,_hoisted_7$68,[..._cache[2]||=[createStaticVNode(``,1)]],512),[[vShow,stageLights.value[0].stageLights.stageLight]])],512),[[vShow,!stageLights.value[0].countDownLights.redLight]])],2)]),createBaseVNode(`div`,_hoisted_8$55,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight1,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_9$49,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight2,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_10$42,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black`,{amber:stageLights.value[0].countDownLights.amberLight3,red:stageLights.value[0].countDownLights.redLight}])},null,2)]),createBaseVNode(`div`,_hoisted_11$37,[createBaseVNode(`div`,{class:normalizeClass([`light-circle black go`,{green:stageLights.value[0].countDownLights.greenLight,red:stageLights.value[0].countDownLights.redLight}])},null,2)])])]))}},Treelights_default=__plugin_vue_export_helper_default(_sfc_main$207,[[`__scopeId`,`data-v-c2ff1007`]]),_sfc_main$206={__name:`bngModifierTiles`,props:{modifierActionInfos:{type:Object,required:!0}},setup(__props){let{isControllerUsed}=storeToRefs(controls_default()),props=__props,controllerActions=computed(()=>{let mod1Active=props.modifierActionInfos.customModifier1?.active,mod2Active=props.modifierActionInfos.customModifier2?.active,mod1Disabled=props.modifierActionInfos.customModifier1?.disabled,mod2Disabled=props.modifierActionInfos.customModifier2?.disabled,mod1modifier2Disabled=props.modifierActionInfos.modifier1modifier2?.disabled;return[{actions:[{actionName:`customModifier2`}],active:!mod2Disabled&&mod2Active&&!mod1Active,disabled:mod2Disabled},{actions:[{actionName:`customModifier2`},{actionName:`customModifier1`}],active:!mod1modifier2Disabled&&mod1Active&&mod2Active,disabled:mod1modifier2Disabled},{actions:[{actionName:`customModifier1`}],active:!mod1Disabled&&mod1Active&&!mod2Active,disabled:mod1Disabled}]}),kbmActions=computed(()=>{props.modifierActionInfos.shift?.active;let ctrlActive=props.modifierActionInfos.ctrl?.active!==void 0,altActive=props.modifierActionInfos.alt?.active!==void 0;return[{active:ctrlActive,actions:[{actionName:`kbmModifier1`,device:`keyboard0`,deviceKey:`ctrl`}]},{active:altActive,actions:[{actionName:`kbmModifier3`,device:`keyboard0`,deviceKey:`alt`}]}]}),entries=computed(()=>isControllerUsed.value?controllerActions.value:kbmActions.value),getModifierClass=entry=>{let cls=`modifier-tile`;return entry.active&&(cls+=` active`),entry.disabled&&(cls+=` disabled`),cls};return(_ctx,_cache)=>(openBlock(!0),createElementBlock(Fragment,null,renderList(entries.value,entry=>(openBlock(),createElementBlock(`div`,{class:normalizeClass(getModifierClass(entry))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(entry.actions,(action,actionIdx)=>(openBlock(),createElementBlock(`div`,{key:actionIdx},[actionIdx>0?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`mathPlus`})):createCommentVNode(``,!0),createVNode(unref(bngBinding_default),{action:action.actionName,device:action.device,"device-key":action.deviceKey,"show-unassigned":!1},null,8,[`action`,`device`,`device-key`])]))),128))],2))),256))}},bngModifierTiles_default=__plugin_vue_export_helper_default(_sfc_main$206,[[`__scopeId`,`data-v-ea01b9d8`]]),_hoisted_1$184={key:0,class:`bng-app-binding-display`},_hoisted_2$149={key:0,class:`modifier-bindings`},_hoisted_3$134={class:`label-column`},_hoisted_4$111={key:0,class:`label-text`},_hoisted_5$96={class:`binding-column`},_hoisted_6$79={class:`flexible-area`},_hoisted_7$67={class:`label-column`},_hoisted_8$54={key:0,class:`label-text`},_hoisted_9$48={class:`binding-column`},_hoisted_10$41={key:0,class:`tile-flex`},_hoisted_11$36={key:1,class:`bottom-left-group`},_sfc_main$205={__name:`bngAppBindingDisplay`,setup(__props){let events$3=useEvents(),actions=shallowRef([]),tileActions=shallowRef([]),constantActions=shallowRef([]),modifierActionInfos=shallowRef([]),additionalData=shallowRef({}),isFaded=ref(!1),isHovered=ref(!1),mouseDownAction=ref(``),actionOpacity=ref(1),fadeOutTimeout=null,isFadingOut=ref(!1),showApp=ref(!0),tileRefs=ref([]),isWide=ref([]),narrowSpan=ref(4),setActions=data=>{let newActions=Array.isArray(data.actions)?data.actions:[];showApp.value=data.showApp,constantActions.value=Array.isArray(data.constantActions)?data.constantActions:[],modifierActionInfos.value=data.modifierActionInfos?{...data.modifierActionInfos}:{},additionalData.value=data.additionalData?{...data.additionalData}:{},fadeOutTimeout&&(clearTimeout(fadeOutTimeout),fadeOutTimeout=null,isFadingOut.value=!1),actions.value.length>0&&newActions.length===0?(isFadingOut.value=!0,actionOpacity.value=0,fadeOutTimeout=setTimeout(()=>{actions.value=newActions,actionOpacity.value=1,isFadingOut.value=!1,fadeOutTimeout=null},0)):newActions.length>0&&actions.value.length===0?(actions.value=newActions,actionOpacity.value=0,nextTick(()=>{actionOpacity.value=1})):(actions.value=newActions,actionOpacity.value=1),tileActions.value=actions.value.filter(action=>action.icon),actions.value=actions.value.filter(action=>!action.icon)},getActionClass=(action,isConstant)=>{let cls=`binding-row`;return isConstant?cls+=` is-constant`:isFadingOut.value&&(cls+=` is-fading-out`),!action.onClick&&!action.inputActionOnClick&&(cls+=` no-hover`),action.highlighted&&(cls+=` highlighted`),cls},onActionClickDown=action=>{action.onClick?runRaw(action.onClick):action.inputActionOnClick&&(mouseDownAction.value=action.action,Lua_default.ui_bindingsLegend.triggerInputAction(action.action,1))},onMouseEnter=()=>{isHovered.value=!0},onMouseLeave=()=>{isHovered.value=!1},onGlobalMouseUp=event=>{mouseDownAction.value&&=(Lua_default.ui_bindingsLegend.triggerInputAction(mouseDownAction.value,0),``)};onMounted(()=>{events$3.on(`setActionsForLegend`,setActions),events$3.on(`setBindingsLegendFade`,value=>{isFaded.value=!!value}),Lua_default.ui_bindingsLegend.sendDataToUI(!0),listenFilteredInputEvents(!0),document.addEventListener(`mouseup`,onGlobalMouseUp)}),onBeforeUnmount(()=>{document.removeEventListener(`mouseup`,onGlobalMouseUp),fadeOutTimeout&&=(clearTimeout(fadeOutTimeout),null),actionOpacity.value=1,listenFilteredInputEvents(!1)});function listenFilteredInputEvents(listen){events$3[listen?`on`:`off`](`FilteredInputChanged`,onFilteredInputChanged),Lua_default.WinInput.setForwardFilteredEvents(listen)}function onFilteredInputChanged(data){let updated$2=!1;for(let action of tileActions.value)action.action===data.bindingAction&&(action.value=data.value,updated$2=!0);updated$2&&triggerRef(tileActions)}function setTileRef(i,compOrEl){tileRefs.value[i]=compOrEl&&compOrEl.$el?compOrEl.$el:compOrEl}function classifyTiles(){isWide.value=tileRefs.value.map(el=>!!el?.querySelector?.(`.combo-binding`))}function pickNarrowSpanByCount(n){let options=[{cols:4,span:3},{cols:3,span:4},{cols:2,span:6}],best=options[0],bestR=n%best.cols;for(let opt of options){let r=n%opt.cols;r{await nextTick(),tileRefs.value.length=tileActions.value.length,classifyTiles(),recomputeLayout()}),onMounted(async()=>{await nextTick(),classifyTiles(),recomputeLayout()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-app-binding-display-wrapper`,{"is-faded":isFaded.value&&!isHovered.value}]),onMouseenter:onMouseEnter,onMouseleave:onMouseLeave},[showApp.value?(openBlock(),createElementBlock(`div`,_hoisted_1$184,[modifierActionInfos.value&&additionalData.value.vehicleSpecificStatus!==`enabled`?(openBlock(),createElementBlock(`div`,_hoisted_2$149,[createVNode(bngModifierTiles_default,{"modifier-action-infos":modifierActionInfos.value},null,8,[`modifier-action-infos`])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(constantActions.value,action=>(openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).custom,onMousedown:$event=>onActionClickDown(action),tabindex:`-1`,class:normalizeClass(getActionClass(action,!0))},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$134,[action.label?(openBlock(),createElementBlock(`span`,_hoisted_4$111,toDisplayString(_ctx.$t(action.label)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$96,[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))])]),_:2},1032,[`accent`,`onMousedown`,`class`]))),256)),createBaseVNode(`div`,_hoisted_6$79,[(openBlock(!0),createElementBlock(Fragment,null,renderList(actions.value,(action,index)=>(openBlock(),createBlock(unref(bngButton_default),{key:action.action||action.label,accent:unref(ACCENTS).custom,onMousedown:$event=>onActionClickDown(action),tabindex:`-1`,ref_for:!0,ref:index===0?`actionButton`:void 0,class:normalizeClass(getActionClass(action,!1))},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$67,[action.label?(openBlock(),createElementBlock(`span`,_hoisted_8$54,toDisplayString(_ctx.$t(action.label)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$48,[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))])]),_:2},1032,[`accent`,`onMousedown`,`class`]))),128)),tileActions.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$41,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tileActions.value,(action,i)=>(openBlock(),createBlock(unref(bngBindingTileButton_default),{class:normalizeClass([`tile-grid-item`,{highlighted:action.highlighted}]),action,icon:action.icon,label:_ctx.$t(action.label),layout:action.direction,showValueBar:action.direction!==void 0,isBidirectional:action.isCentered,value:action.value,style:{"--tile-span":4},ref_for:!0,ref:el=>setTileRef(i,el),"show-unassigned":``,"action-variants":``,"bng-no-nav":``,tabindex:`-1`},{default:withCtx(()=>[action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:action.action,device:binding.device,"device-key":binding.control,"show-unassigned":``,"action-variants":``},null,8,[`action`,`device`,`device-key`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:action.action,"show-unassigned":``,"action-variants":``},null,8,[`action`]))]),_:2},1032,[`class`,`action`,`icon`,`label`,`layout`,`showValueBar`,`isBidirectional`,`value`]))),256))])):createCommentVNode(``,!0)])])):createCommentVNode(``,!0),showApp.value?(openBlock(),createElementBlock(`div`,_hoisted_11$36,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`bottom-left-button`,disabled:additionalData.value.vehicleSpecificStatus===`inactive`,accent:additionalData.value.vehicleSpecificStatus===`enabled`||additionalData.value.vehicleSpecificStatus===`fleeting`?unref(ACCENTS).main:unref(ACCENTS).text,onClick:_cache[0]||=$event=>unref(Lua_default).ui_bindingsLegend.toggleShowVehicleSpecificActions(),"bng-no-nav":``,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:unref(icons).car},null,8,[`type`]),additionalData.value.vehicleSpecificStatus===`enabled`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`bottom-left-lock`,type:unref(icons).lockClosed},null,8,[`type`])):createCommentVNode(``,!0)]),_:1},8,[`disabled`,`accent`])),[[unref(BngTooltip_default),`Press to show/hide vehicle specific actions`,`right`]])])):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{class:`bottom-left-button`,accent:unref(ACCENTS).text,icon:unref(icons).eyeSolidOpened,onClick:_cache[1]||=$event=>unref(Lua_default).ui_bindingsLegend.toggleShowApp(),"bng-no-nav":``,tabindex:`-1`},null,8,[`accent`,`icon`])],34))}},bngAppBindingDisplay_default=__plugin_vue_export_helper_default(_sfc_main$205,[[`__scopeId`,`data-v-cf4052e5`]]),_hoisted_1$183={class:`action`},_hoisted_2$148={key:0,class:`indicators`},_hoisted_3$133={class:`icon-wrapper`},_hoisted_4$110={key:2,class:`tile-fallback-label`},_hoisted_5$95={key:0,class:`value-bar`},_hoisted_6$78={class:`bindings-wrapper`},_sfc_main$204={__name:`bngBindingTileButton`,props:{label:String,icon:[Object,String],showIndicators:{type:Boolean,default:!1},layout:{type:String,default:`horizontal`,validator:v=>[`horizontal`,`vertical`].includes(v)},dark:Boolean,disabled:Boolean,action:{type:Object,required:!0},bindings:{type:Array,default:()=>void 0},actionVariants:Boolean,showValueBar:{type:Boolean,default:!0},value:{type:Number,default:0},targetValue:{type:Number,default:0},isBidirectional:{type:Boolean,default:!1}},emits:[`click`],setup(__props,{expose:__expose}){let props=__props,layoutClass=computed(()=>props.layout===`vertical`?`layout-vertical`:`layout-horizontal`);__expose({icons});let isLikelyImagePath=val=>typeof val==`string`&&(val.includes(`/`)||val.startsWith(`.`)||val.includes(`\\`)),candidateIcon=computed(()=>props.icon??null),useGlyphIcon=computed(()=>{let c=candidateIcon.value;return c?typeof c==`object`?!!c.glyph:typeof c==`string`?!isLikelyImagePath(c)&&c in icons:!1:!1}),resolvedGlyphType=computed(()=>useGlyphIcon.value?candidateIcon.value:null),resolvedImagePath=computed(()=>{let c=candidateIcon.value;return typeof c==`string`&&isLikelyImagePath(c)?c:null});return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),{class:`bng-binding-tile-button`,accent:unref(ACCENTS).custom,disabled:__props.disabled,onClick:_cache[0]||=$event=>_ctx.$emit(`click`)},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`content`,layoutClass.value])},[createBaseVNode(`div`,_hoisted_1$183,[__props.showIndicators?(openBlock(),createElementBlock(`div`,_hoisted_2$148,[(openBlock(),createElementBlock(Fragment,null,renderList(5,i=>createBaseVNode(`div`,{class:normalizeClass([`indicator`,{active:i===2}]),key:i},null,2)),64))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$133,[useGlyphIcon.value?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`icon-glyph`,type:resolvedGlyphType.value},null,8,[`type`])):resolvedImagePath.value?(openBlock(),createBlock(unref(bngImageAsset_default),{key:1,externalSrc:resolvedImagePath.value,class:`icon-img`,mask:``},null,8,[`externalSrc`])):__props.label?(openBlock(),createElementBlock(`div`,_hoisted_4$110,toDisplayString(__props.label),1)):createCommentVNode(``,!0)])]),__props.showValueBar?(openBlock(),createElementBlock(`div`,_hoisted_5$95,[createVNode(unref(bngInputBar_default),{value:__props.value,"target-value":__props.targetValue,"is-bidirectional":__props.isBidirectional,vertical:__props.layout==`vertical`},null,8,[`value`,`target-value`,`is-bidirectional`,`vertical`])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$78,[renderSlot(_ctx.$slots,`binding`,{},()=>[__props.action&&__props.action.bindings?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.action.bindings,binding=>(openBlock(),createBlock(unref(bngBinding_default),{key:binding.device+`:`+binding.control,action:__props.action.action,device:binding.device,"device-key":binding.control,dark:__props.dark,"show-unassigned":``,"action-variants":__props.actionVariants,vertical:__props.layout===`vertical`},null,8,[`action`,`device`,`device-key`,`dark`,`action-variants`,`vertical`]))),128)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,vertical:__props.layout===`vertical`,action:__props.action&&__props.action.action,dark:__props.dark,"show-unassigned":``,"action-variants":__props.actionVariants},null,8,[`vertical`,`action`,`dark`,`action-variants`]))],!0)])],2)]),_:3},8,[`accent`,`disabled`]))}},bngBindingTileButton_default=__plugin_vue_export_helper_default(_sfc_main$204,[[`__scopeId`,`data-v-db243a30`]]),_hoisted_1$182={class:`message-container`},_sfc_main$203={__name:`bngFlashMessage`,props:{messageSource:{type:String,default:`ScenarioFlashMessage`}},setup(__props){let props=__props,events$3=useEvents(),{api:api$1}=useBridge(),txt=ref(``),messageQueue=ref([]),stepTimeout=ref(null),animationClass=ref(``),fontSizeClass=ref(`font-small`),paused=ref(!1);onMounted(()=>{events$3.on(props.messageSource,data=>{if(Array.isArray(data))data.forEach(item=>{let messageObject={msg:item[0],ttl:item[1],luaCall:item[2]&&typeof item[2]==`string`?item[2]:void 0,jsCallback:item[2]&&typeof item[2]==`function`?item[2]:void 0,big:item[3]===void 0?!1:item[3]};messageQueue.value.push(messageObject)}),messageQueue.value.length>0&&!stepTimeout.value&&playMessagesAnimation();else if(typeof data==`object`){let messageObject={msg:data.msg,ttl:data.ttl,luaCall:data.luaCall||void 0,jsCallback:data.jsCallback||void 0,big:data.big===void 0?!1:data.big};messageQueue.value.push(messageObject),stepTimeout.value||playMessagesAnimation()}else console.warn(`Unexpected data format received for FlashMessage`)}),events$3.on(`physicsStateChanged`,state=>{paused.value=!state,paused.value?stepTimeout.value&&=(clearTimeout(stepTimeout.value),null):state&&playMessagesAnimation()})}),onUnmounted(()=>{stepTimeout.value&&=(clearTimeout(stepTimeout.value),null)});function playMessagesAnimation(){if(messageQueue.value.length===0){resetCountdown();return}animationClass.value=`fade-in`,setTimeout(()=>{animationClass.value=``},200);let msg=messageQueue.value[0];txt.value=msg.msg,fontSizeClass.value=msg.big?`font-large`:`font-small`,msg.luaCall&&typeof msg.luaCall==`string`&&api$1.engineLua(msg.luaCall),msg.jsCallback&&typeof msg.jsCallback==`function`&&msg.jsCallback(),messageQueue.value.shift(),setTimeout(()=>{animationClass.value=`fade-out`},msg.ttl*1e3-200),stepTimeout.value=setTimeout(()=>{playMessagesAnimation()},msg.ttl*1e3)}function resetCountdown(){stepTimeout.value&&clearTimeout(stepTimeout.value),messageQueue.value=[],txt.value=``,stepTimeout.value=null}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$182,[createBaseVNode(`div`,{class:normalizeClass([`message`,[`message`,animationClass.value,fontSizeClass.value]])},toDisplayString(txt.value),3)]))}},bngFlashMessage_default=__plugin_vue_export_helper_default(_sfc_main$203,[[`__scopeId`,`data-v-02941c3f`]]),_hoisted_1$181={class:`track`},_sfc_main$202={__name:`bngInputBar`,props:{value:{type:Number,default:0},targetValue:{type:Number,default:0},isBidirectional:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1}},setup(__props){let props=__props,isVertical=computed(()=>props.vertical),clamp$2=(v,min$1,max$1)=>Math.min(max$1,Math.max(min$1,v)),toUnits=(v,bidir)=>{let vv=clamp$2(v,bidir?-1:0,1);return bidir?(vv+1)/2:vv},zeroUnits=computed(()=>props.isBidirectional?.5:0),actualUnits=computed(()=>toUnits(props.value,props.isBidirectional)),targetUnits=computed(()=>toUnits(props.targetValue,props.isBidirectional)),makeFillStyle=units=>{if(!isVertical.value){if(props.isBidirectional){let start=Math.min(units,zeroUnits.value),end=Math.max(units,zeroUnits.value);return{left:`${start*100}%`,right:`${(1-end)*100}%`}}return{left:`0%`,right:`${(1-units)*100}%`}}if(props.isBidirectional){let start=Math.min(units,zeroUnits.value),end=Math.max(units,zeroUnits.value);return{bottom:`${start*100}%`,top:`${(1-end)*100}%`}}return{bottom:`0%`,top:`${(1-units)*100}%`}},actualStyle=computed(()=>makeFillStyle(actualUnits.value)),targetStyle=computed(()=>makeFillStyle(targetUnits.value)),showTarget=computed(()=>props.targetValue!==void 0&&props.targetValue!==null),knobStyle=computed(()=>isVertical.value?{bottom:`calc(${actualUnits.value*100}% - 2px)`}:{left:`calc(${actualUnits.value*100}% - 2px)`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-input-bar`,{bidirectional:__props.isBidirectional,vertical:isVertical.value}])},[createBaseVNode(`div`,_hoisted_1$181,[showTarget.value?(openBlock(),createElementBlock(`div`,{key:0,class:`fill target`,style:normalizeStyle(targetStyle.value)},null,4)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`fill actual`,style:normalizeStyle(actualStyle.value)},null,4)]),createBaseVNode(`div`,{class:`knob`,style:normalizeStyle(knobStyle.value)},null,4)],2))}},bngInputBar_default=__plugin_vue_export_helper_default(_sfc_main$202,[[`__scopeId`,`data-v-30b04794`]]),_hoisted_1$180={key:1,class:`data-label`},_hoisted_2$147={key:2,class:`data-value`},_hoisted_3$132={key:3,class:`time-container`},_hoisted_4$109={class:`time-seconds`},_hoisted_5$94={class:`time-milliseconds`},_hoisted_6$77={key:4,class:`data-value-extra`},_sfc_main$201={__name:`bngSimpleDataDisplay`,props:{label:{type:String,default:``},value:{type:[String,Number,Object,Array],default:``},icon:{type:String,default:``},minutes:{type:String},seconds:{type:String},milliseconds:{type:String}},setup(__props){let props=__props,iconType$1=computed(()=>props.icon);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`simple-data-display`,{"with-icon":__props.icon}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:iconType$1.value,class:`icon`},null,8,[`type`])):createCommentVNode(``,!0),__props.label&&!__props.icon?(openBlock(),createElementBlock(`div`,_hoisted_1$180,toDisplayString(__props.label),1)):createCommentVNode(``,!0),_ctx.$slots.default?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$147,toDisplayString(__props.value),1)),props.minutes||props.seconds?(openBlock(),createElementBlock(`div`,_hoisted_3$132,[createBaseVNode(`span`,{class:normalizeClass({"time-minutes":!0,zero:__props.minutes===`00`})},toDisplayString(props.minutes),3),_cache[1]||=createTextVNode(` :`,-1),createBaseVNode(`span`,_hoisted_4$109,toDisplayString(props.seconds),1),props.milliseconds?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createTextVNode(` .`,-1),createBaseVNode(`span`,_hoisted_5$94,toDisplayString(props.milliseconds),1)],64)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),_ctx.$slots.default?(openBlock(),createElementBlock(`div`,_hoisted_6$77,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0)],2))}},bngSimpleDataDisplay_default=__plugin_vue_export_helper_default(_sfc_main$201,[[`__scopeId`,`data-v-f2b79846`]]),_sfc_main$200={__name:`app`,props:{showFlash:{type:Boolean,default:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createVNode(Treelights_default),props.showFlash?(openBlock(),createBlock(unref(bngFlashMessage_default),{key:0,"message-source":`DragRaceTreeFlashMessage`})):createCommentVNode(``,!0)]))}},app_default$11=_sfc_main$200,_hoisted_1$179={class:`stage-indicator-container`},_hoisted_2$146={class:`stage-bar`},_hoisted_3$131={key:0,class:`segment grey-segment top`},_hoisted_4$108={key:1,class:`segment grey-segment bottom`},_hoisted_5$93={class:`indicator-line`},THROTTLE_MS=1,HIDE_DELAY_MS=5e3,_sfc_main$199={__name:`app`,setup(__props){let events$3=useEvents(),stageDistance=ref(-100),isVisible$1=ref(!0),hideTimeout,isDetailedView=computed(()=>stageDistance.value>-1&&stageDistance.value<1),indicatorPosition=computed(()=>isDetailedView?70-(stageDistance.value+1)*20:stageDistance.value<-1?10-stageDistance.value:30-(stageDistance.value-1)*(30/3)),lastUpdate=0;function updateStageApp(distance){let now$1=performance.now();now$1-lastUpdate{isVisible$1.value=!1},HIDE_DELAY_MS))}return onMounted(()=>{events$3.on(`updateStageApp`,updateStageApp)}),onUnmounted(()=>{lastUpdate=0,clearTimeout(hideTimeout),events$3.off(`updateStageApp`,updateStageApp)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,null,toDisplayString(stageDistance.value),1),withDirectives(createBaseVNode(`div`,_hoisted_1$179,[createBaseVNode(`div`,_hoisted_2$146,[isDetailedView.value?(openBlock(),createElementBlock(`div`,_hoisted_3$131)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`middle-section`,{"align-top":!isDetailedView.value&&stageDistance.value<-1,"align-bottom":!isDetailedView.value&&stageDistance.value>1}])},[isDetailedView.value?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`segment deep-stage`,style:{height:`20px`}},null,-1),_cache[1]||=createBaseVNode(`div`,{class:`segment stage`,style:{height:`40px`}},null,-1),_cache[2]||=createBaseVNode(`div`,{class:`segment pre-stage`,style:{height:`40px`}},null,-1)],64)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`segment green-segment`,{top:stageDistance.value<-1,bottom:stageDistance.value>1}])},null,2))],2),stageDistance.value<=1?(openBlock(),createElementBlock(`div`,_hoisted_4$108)):createCommentVNode(``,!0)]),createBaseVNode(`div`,{class:`distance-indicator`,style:normalizeStyle({top:indicatorPosition.value+`%`})},[createBaseVNode(`div`,_hoisted_5$93,[createBaseVNode(`div`,{class:normalizeClass([`car-icon`,{"car-icon-detailed":isDetailedView.value}])},null,2)])],4)],512),[[vShow,isVisible$1.value&&stageDistance.value>=-4&&stageDistance.value<=4]])],64))}},app_default$12=__plugin_vue_export_helper_default(_sfc_main$199,[[`__scopeId`,`data-v-5245723d`]]),_hoisted_1$178={class:`main-container drift-app`},_hoisted_2$145={class:`cached-score-wrapper`},_hoisted_3$130={class:`added-score`},_hoisted_4$107={class:`cached-score`},_hoisted_5$92={class:`score-container`},_hoisted_6$76={class:`score`},_hoisted_7$66={class:`combo-wrapper`},_hoisted_8$53=[`id`],_hoisted_9$47=[`id`],_hoisted_10$40=[`stop-color`],_hoisted_11$35=[`stop-color`],_hoisted_12$27=[`id`],_hoisted_13$24={class:`multiplier`,x:`0`,y:`15.5`,fill:`#fff`,"dominant-baseline":`hanging`,"text-anchor":`start`,style:{fontSize:`1.9rem`}},_hoisted_14$23=[`mask`],_hoisted_15$22=[`fill`],_hoisted_16$22={class:`remaining-time`},_hoisted_17$17={class:`wrapper`},_hoisted_18$15={class:`drift-bar`},_hoisted_19$12={class:`drift-scale`},_hoisted_20$11={class:`drift-progress-bar`},FAIL_ANIMATION_DURATION=900,_sfc_main$198={__name:`app`,props:{showFlash:{type:Boolean,default:!0}},setup(__props){let props=__props,{lua}=useBridge(),bgId=uniqueId(``,`_`),events$3=useEvents(),realtimeScorePoints=ref(0),realtimeScoreCombo=ref(0),creep=ref(0),remainingComboTime=ref(0),centerIcon=ref(null),centerMessage=ref(null),centerFailMessage=ref(null),scoreToAdd=ref(0),countdownTimer=null,countdownStartTime=null,delayTimer=null,startTimer=null,centerMessageTimer=null,bonusDisplayAdd=null,bonusDisplayDispose=null,bonusQueue=ref([]),bonusDisplay=ref([]),realtimeAngle=ref(0),steppedPerformanceFactor=ref(1),isCenterMessageFading=ref(!1),isFailActive=ref(!1),isFailAnimating=ref(!1),failAnimationStartTime=null,failAnimationTimer=null,currentModifier=ref(null),isModifierFading=ref(!1),modifierTimer=null;onMounted(()=>{let rafScheduled=!1,buffered={points:0,combo:0,remaining:0,creep:0,angle:0},flushBuffered=()=>{realtimeScorePoints.value=buffered.points,realtimeScoreCombo.value=buffered.combo,remainingComboTime.value=buffered.remaining,creep.value=buffered.creep,realtimeAngle.value=buffered.angle,rafScheduled=!1},scheduleFlush=()=>{rafScheduled||(rafScheduled=!0,requestAnimationFrame(flushBuffered))},streamsList$1=[`drift`];useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;buffered.points=streams.drift.realtimeCachedScoreFloored,buffered.combo=streams.drift.realtimeCombo,buffered.points>0&&(centerMessage.value=null),buffered.remaining=streams.drift.realtimeRemainingComboTime,buffered.creep=streams.drift.realtimeCreep,buffered.angle=-streams.drift.realtimeAngle,steppedPerformanceFactor.value=streams.drift.realtimePerformanceFactor,scheduleFlush()}),events$3.on(`setDriftRealtimeFail`,(reason,icon)=>{cancelTimers(),isFailActive.value=!0,isFailAnimating.value=!0,isCenterMessageFading.value=!1,centerFailMessage.value=reason,centerIcon.value=icon||``,bonusDisplay.value=[],creep.value=0;let initialComboTime=remainingComboTime.value;failAnimationStartTime=performance.now();let animateFailBar=timestamp=>{let elapsed=timestamp-failAnimationStartTime,progress=Math.max(0,1-elapsed/FAIL_ANIMATION_DURATION);remainingComboTime.value=initialComboTime*progress,progress>0&&(failAnimationTimer=requestAnimationFrame(animateFailBar))};failAnimationTimer=requestAnimationFrame(animateFailBar),centerMessageTimer&&clearTimeout(centerMessageTimer),setTimeout(()=>{isFailActive.value=!1,isFailAnimating.value=!1,remainingComboTime.value=0,failAnimationTimer&&=(cancelAnimationFrame(failAnimationTimer),null)},FAIL_ANIMATION_DURATION),centerMessageTimer=setTimeout(()=>{isCenterMessageFading.value=!0},1e3),setTimeout(()=>{centerFailMessage.value=null,centerIcon.value=null,isCenterMessageFading.value=!1},1500)}),events$3.on(`setDriftPersistentDriftScored`,(final,score,combo)=>{centerMessage.value=`+ `,scoreToAdd.value=final,bonusDisplay.value=[],startCountdown()}),events$3.on(`displayDriftScoreModifier`,msg=>{modifierTimer&&clearTimeout(modifierTimer),isModifierFading.value=!1,currentModifier.value=msg,modifierTimer=setTimeout(()=>{isModifierFading.value=!0},1500)})}),onUnmounted(()=>{cancelTimers(),centerMessageTimer&&clearTimeout(centerMessageTimer),clearInterval(bonusDisplayAdd),clearInterval(bonusDisplayDispose),failAnimationTimer&&cancelAnimationFrame(failAnimationTimer),modifierTimer&&clearTimeout(modifierTimer),window.removeEventListener(`resize`,onResize)});let barClass=computed(()=>({"bar-good":!isFailAnimating.value&&steppedPerformanceFactor.value>=3,"bar-warn":!isFailAnimating.value&&steppedPerformanceFactor.value<3,"bar-fail":isFailAnimating.value})),barVarsStyle=computed(()=>({"--bar-scale":String(Math.max(0,Math.min(1,remainingComboTime.value))),"--bar-visible":remainingComboTime.value<=.01?`hidden`:`visible`})),driftProgressStyle=computed(()=>{let pos=Math.abs(calculatePosition(realtimeAngle.value,thresholds,positions))/100;return{left:`50%`,width:`50%`,transform:`scaleX(${((realtimeAngle.value>0?1:-1)>0?1:-1)*(pos/2)})`,opacity:Math.abs(realtimeAngle.value)<7?`0.65`:`1`}}),formattedCombo=computed(()=>parseFloat(realtimeScoreCombo.value).toFixed(1)),formattedRealtimeAngle=computed(()=>Math.abs(Math.round(realtimeAngle.value))),layoutVersion=ref(0),tickLefts=computed(()=>positions.map(p$1=>`${(p$1+100)/2}%`)),onResize=()=>{layoutVersion.value++};window.addEventListener(`resize`,onResize);function cancelTimers(){countdownTimer&&=(cancelAnimationFrame(countdownTimer),null),delayTimer&&=(clearTimeout(delayTimer),null),startTimer&&=(clearTimeout(startTimer),null),failAnimationTimer&&=(cancelAnimationFrame(failAnimationTimer),null)}function startCountdown(){cancelTimers(),startTimer=setTimeout(()=>{let initialScore=scoreToAdd.value,scoreDwindleAnimDuration=1e3;function countdown(timestamp){countdownStartTime||=timestamp;let elapsedTime=timestamp-countdownStartTime;elapsedTime>=scoreDwindleAnimDuration?(scoreToAdd.value=0,countdownStartTime=null,delayTimer=setTimeout(()=>{scoreToAdd.value=-1,centerMessage.value=null,realtimeScorePoints.value=0,realtimeScoreCombo.value=0,creep.value=0,delayTimer=null},1e3)):(scoreToAdd.value=Math.floor(initialScore*(1-elapsedTime/scoreDwindleAnimDuration)),countdownTimer=requestAnimationFrame(countdown))}countdownTimer=requestAnimationFrame(countdown)},1250)}let thresholds=[-110,-60,-20,0,20,60,110],positions=[-100,-70,-35,0,35,70,100],calculatePosition=(y,thresholds$1,positions$1)=>{let clampedY=Math.max(thresholds$1[0],Math.min(thresholds$1[thresholds$1.length-1],y));for(let i=0;i=thresholds$1[i]&&clampedY<=thresholds$1[i+1]){let t=(clampedY-thresholds$1[i])/(thresholds$1[i+1]-thresholds$1[i]);return positions$1[i]+t*(positions$1[i+1]-positions$1[i])}return 0},performanceBgClass=computed(()=>({"perf-good":steppedPerformanceFactor.value>=3,"perf-warn":steppedPerformanceFactor.value<3})),performanceTransformStyle=computed(()=>{let sRaw=Math.min(steppedPerformanceFactor.value/3,1);return{transform:`scale(${sRaw===0?.001:sRaw})`,transformOrigin:`center bottom`,opacity:sRaw===0?0:1}});function onModifierTransitionEnd(e){e.propertyName===`opacity`&&(isModifierFading.value&&=(currentModifier.value=null,!1))}let comboVarsStyle=computed(()=>({"--combo-glow-color":realtimeScoreCombo.value>=25?`210, 110, 0`:`255, 255, 0`,"--combo-glow-alpha":String(creep.value),"--combo-rect-translate":`${-creep.value*2}rem`}));function ensureBonusTimers(){!bonusDisplayAdd&&bonusQueue.value.length>0&&(bonusDisplayAdd=setInterval(()=>{if(bonusQueue.value.length===0)return;let item=bonusQueue.value.pop();bonusDisplay.value.unshift(item)},500)),!bonusDisplayDispose&&bonusDisplay.value.length>0&&(bonusDisplayDispose=setInterval(()=>{bonusDisplay.value.length>0&&bonusDisplay.value.pop()},1e4)),bonusQueue.value.length===0&&bonusDisplay.value.length===0&&(bonusDisplayAdd&&=(clearInterval(bonusDisplayAdd),null),bonusDisplayDispose&&=(clearInterval(bonusDisplayDispose),null))}return watch(bonusQueue,ensureBonusTimers,{deep:!0}),watch(bonusDisplay,ensureBonusTimers,{deep:!0}),onMounted(()=>{lua.extensions.gameplay_drift_general.onDriftAppMounted()}),onUnmounted(()=>{lua.extensions.gameplay_drift_general.onDriftAppUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$178,[createBaseVNode(`div`,_hoisted_2$145,[createBaseVNode(`div`,{class:normalizeClass([`fail-overlay`,{active:isFailActive.value}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`performance-background`,performanceBgClass.value]),style:normalizeStyle(performanceTransformStyle.value)},null,6),centerFailMessage.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`center`,{"fade-out":isCenterMessageFading.value}])},toDisplayString(centerFailMessage.value),3)):centerMessage.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`center`,{"fade-out":isCenterMessageFading.value}])},[createTextVNode(toDisplayString(centerMessage.value)+` `,1),centerMessage.value&&scoreToAdd.value>=0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(scoreToAdd.value),1)],64)):createCommentVNode(``,!0)],2)):(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`div`,_hoisted_3$130,[(openBlock(!0),createElementBlock(Fragment,null,renderList(bonusDisplay.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`score-item`},` +`+toDisplayString(~~item.score),1))),128))]),createBaseVNode(`div`,_hoisted_4$107,[createBaseVNode(`div`,_hoisted_5$92,[(openBlock(),createElementBlock(`div`,{class:normalizeClass([`score-modifier`,{"fade-out":isModifierFading.value}]),key:currentModifier.value,onTransitionend:onModifierTransitionEnd},toDisplayString(currentModifier.value),35)),createBaseVNode(`div`,_hoisted_6$76,toDisplayString(realtimeScorePoints.value),1)]),createBaseVNode(`div`,_hoisted_7$66,[(openBlock(),createElementBlock(`svg`,{id:`svg_${unref(bgId)}`,class:`combo`,viewBox:`0 0 100 30`,style:normalizeStyle([{width:`100%`,height:`3rem`},comboVarsStyle.value]),preserveAspectRatio:`xMinYMid meet`},[createBaseVNode(`defs`,null,[createBaseVNode(`linearGradient`,{id:`grad_${unref(bgId)}`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[_cache[0]||=createBaseVNode(`stop`,{offset:`50%`,"stop-color":`var(--bng-ter-yellow-100)`},null,-1),createBaseVNode(`stop`,{offset:`51%`,"stop-color":realtimeScoreCombo.value>=25?`#ff8400`:`#fff`},null,8,_hoisted_10$40),createBaseVNode(`stop`,{offset:`75%`,"stop-color":realtimeScoreCombo.value>=25?`#ff8400`:`#fff`},null,8,_hoisted_11$35)],8,_hoisted_9$47),createBaseVNode(`mask`,{id:`mask_${unref(bgId)}`},[createBaseVNode(`text`,_hoisted_13$24,` ×`+toDisplayString(formattedCombo.value),1)],8,_hoisted_12$27)]),createBaseVNode(`g`,{mask:`url(#mask_${unref(bgId)})`},[createBaseVNode(`rect`,{width:`100%`,height:`4.2rem`,x:`0`,y:`15.5`,fill:`url(#grad_${unref(bgId)})`,class:`animated-rect`},null,8,_hoisted_15$22)],8,_hoisted_14$23)],12,_hoisted_8$53))])])],64))]),createBaseVNode(`div`,_hoisted_16$22,[createBaseVNode(`div`,_hoisted_17$17,[createBaseVNode(`div`,{class:normalizeClass([`bar`,barClass.value]),style:normalizeStyle(barVarsStyle.value)},null,6)])]),createBaseVNode(`div`,_hoisted_18$15,[createBaseVNode(`div`,_hoisted_19$12,[createBaseVNode(`div`,_hoisted_20$11,[createBaseVNode(`div`,{class:`progress-fill`,style:normalizeStyle(driftProgressStyle.value)},null,4)]),(openBlock(),createElementBlock(`div`,{class:`value-marks`,key:layoutVersion.value},[(openBlock(),createElementBlock(Fragment,null,renderList(thresholds,(threshold,index)=>createBaseVNode(`div`,{class:`line`,key:threshold,style:normalizeStyle({position:`absolute`,left:tickLefts.value[index],width:`0.125rem`,height:`0.24rem`,transform:threshold===0?`translateX(-50%)`:threshold>0?`translateX(-100%)`:`translateX(0%)`,backgroundColor:`white`})},null,4)),64))]))]),(openBlock(),createElementBlock(`div`,{class:`drift-labels`,key:layoutVersion.value},[(openBlock(),createElementBlock(Fragment,null,renderList(thresholds,(threshold,index)=>createBaseVNode(`span`,{key:threshold,style:normalizeStyle({position:`absolute`,left:tickLefts.value[index],transform:`translateX(-50%)`,textAlign:`center`})},toDisplayString(threshold===0?`${formattedRealtimeAngle.value}°`:`${Math.abs(threshold)}°`),5)),64))])),props.showFlash?(openBlock(),createBlock(unref(bngFlashMessage_default),{key:0,"message-source":`DriftFlashMessage`})):createCommentVNode(``,!0)])]))}},app_default$13=__plugin_vue_export_helper_default(_sfc_main$198,[[`__scopeId`,`data-v-aa80ede0`]]),_hoisted_1$177={class:`main-container-grid`},_hoisted_2$144={class:`scores-container`},_hoisted_3$129={class:`permanent`},_hoisted_4$106={class:`points-label`},_sfc_main$197={__name:`app`,setup(__props){let events$3=useEvents(),permanentScore=ref(0),potentialScore=ref(0),isAnimatingPotentialScore=ref(!1),dontUpdateScores=ref(!1),lastPotentialScore=ref(0);onMounted(()=>{events$3.on(`setDriftPersistentDriftScored`,(score,combo)=>{isAnimatingPotentialScore.value=!0,dontUpdateScores.value=!0,potentialScore.value=score,lastPotentialScore.value=potentialScore.value,setTimeout(()=>{isAnimatingPotentialScore.value=!1},1e3),setTimeout(()=>{dontUpdateScores.value=!1},900)})}),onUnmounted(()=>{events$3.off(`setDriftPersistentDriftScored`)});let streamsList$1=[`drift`];return useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;dontUpdateScores.value||(permanentScore.value=streams.drift.permanentScore,potentialScore.value=streams.drift.potentialScore)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$177,[createBaseVNode(`div`,_hoisted_2$144,[createBaseVNode(`div`,_hoisted_3$129,[createBaseVNode(`span`,_hoisted_4$106,toDisplayString(unref($translate).instant(`missions.drift.general.pointsShort`))+`: `,1),createTextVNode(toDisplayString(permanentScore.value),1)]),createBaseVNode(`div`,{class:normalizeClass([`potential`,{"animate-potential-score":isAnimatingPotentialScore.value}])},` + `+toDisplayString(potentialScore.value),3)])]))}},app_default$14=__plugin_vue_export_helper_default(_sfc_main$197,[[`__scopeId`,`data-v-29f9fe6b`]]),_hoisted_1$176={class:`main-container-grid`},_sfc_main$196={__name:`app`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),showButton=ref(!1),handleNextStep=()=>{lua.gameplay_crashTest_scenarioManager.nextStepFromUI(),showButton.value=!1};return onMounted(()=>{events$3.on(`onCrashTestStepFinished`,()=>{console.log(`onCrashTestStepFinished`),showButton.value=!0})}),onUnmounted(()=>{events$3.off(`onCrashTestStepFinished`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$176,[showButton.value?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:handleNextStep,accent:unref(ACCENTS).text,icon:unref(icons).arrowSolidRight,class:normalizeClass({"next-step-button":!0})},{default:withCtx(()=>[createTextVNode(toDisplayString(unref($translate).instant(`missions.crashTest.general.nextStep`)),1)]),_:1},8,[`accent`,`icon`])):createCommentVNode(``,!0)]))}},app_default$15=__plugin_vue_export_helper_default(_sfc_main$196,[[`__scopeId`,`data-v-6d935866`]]),_hoisted_1$175={class:`bng-app`},_sfc_main$195={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`],data=reactive({engineT:0,wheelT:0,rpm:0,gearText:``});onMounted(()=>$game.streams.add(streamsList$1)),onUnmounted(()=>$game.streams.remove(streamsList$1)),$game.events.on(`onStreamsUpdate`,streams=>{streams.engineInfo!==null&&(data.engineT=$game.units.buildString(`torque`,streams.engineInfo[8],0),data.wheelT=$game.units.buildString(`torque`,streams.engineInfo[19],0),data.rpm=streams.engineInfo[4].toFixed(),data.gearText=getGearText(streams.engineInfo[16],streams.engineInfo[6],streams.engineInfo[7]))});let getGearText=(gear,fGear,rGear)=>gear>0?`F `+gear+` / `+fGear:gear<0?`R `+Math.abs(gear)+` / `+rGear:`N`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$175,[createTextVNode(toDisplayString(_ctx.$t(`ui.apps.engineinfo.rpm`))+`: `+toDisplayString(data.rpm),1),_cache[0]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.gear`))+`: `+toDisplayString(data.gearText),1),_cache[1]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.flywheelTorque`))+`: `+toDisplayString(data.engineT)+` `,1),_cache[2]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.apps.engineinfo.wheelTorque`))+`: `+toDisplayString(data.wheelT),1)]))}},app_default$16=_sfc_main$195,_hoisted_1$174={class:`legends`},_hoisted_2$143={class:`torque-flywheel`},_hoisted_3$128={class:`power-flywheel`},_hoisted_4$105={class:`power-wheels`},_hoisted_5$91={class:`rpm`},_hoisted_6$75={class:`content`},_hoisted_7$65={class:`power-label`},_hoisted_8$52={class:`label`},_hoisted_9$46={class:`canvas-container`},_hoisted_10$39={class:`torque-label`},_hoisted_11$34={class:`label`},tickLabels=21,torqueGraphColor=`#000000`,powerGraphColor=`#FF0000`,powerWheelGraphColor=`#FF4400`,rpmGraphColor=`#0000FF`,_sfc_main$194={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`],app$1=ref(null),canvas=ref(null),globalMax=ref(0),torqueUnit=ref(null),powerUnit=ref(null),tickSpacing=ref(0),tickInterval=computed(()=>globalMax.value/10),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth-130,canvas.value.height=entry.target.offsetHeight-20,tickSpacing.value=canvas.value.height/10,console.log(`width`,entry.target.offsetWidth),console.log(`height`,entry.target.offsetHeight),console.log(`tickspacing`,tickSpacing.value),console.log(`canvas`,canvas.value.width,canvas.value.height)}),chart=new SmoothieChart({minValue:0,maxValue:1e3,millisPerPixel:20,interpolation:`bezier`,grid:{fillStyle:`rgba(250,250,250,0.2)`,strokeStyle:`grey`,verticalSections:20,millisPerLine:1e3,sharpLines:!0},labels:{disabled:!0}}),torqueGraph=new TimeSeries,powerGraph=new TimeSeries,powerWheelGraph=new TimeSeries,rpmGraph=new TimeSeries;onMounted(()=>{initChart(),appResizeObserver.observe(app$1.value),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;let xPoint=new Date,torque=$game.units.torque(streams.engineInfo[8]).val,power$1=$game.units.power(streams.engineInfo[4]*.104719755*streams.engineInfo[8]/1e3*1.34102).val,wheelPower=$game.units.power(streams.engineInfo[20]/1e3*1.34102).val,rpm=streams.engineInfo[4]/10;torqueUnit.value=$game.units.torque().unit,powerUnit.value=$game.units.power().unit,globalMax.value=Math.ceil(Math.max.apply(null,[globalMax.value,torque,power$1])/100)*100,chart.options.maxValue=globalMax.value,torqueGraph.append(xPoint,torque),powerGraph.append(xPoint,power$1),powerWheelGraph.append(xPoint,wheelPower),rpmGraph.append(xPoint,rpm)}function initChart(){chart.addTimeSeries(torqueGraph,{strokeStyle:torqueGraphColor,lineWidth:1.5}),chart.addTimeSeries(powerGraph,{strokeStyle:powerGraphColor,lineWidth:1.5}),chart.addTimeSeries(powerWheelGraph,{strokeStyle:powerWheelGraphColor,lineWidth:1.5}),chart.addTimeSeries(rpmGraph,{strokeStyle:rpmGraphColor,lineWidth:1.5}),chart.streamTo(canvas.value,40)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`app`,ref:app$1,class:`engine-dynamometer`},[createBaseVNode(`div`,_hoisted_1$174,[createBaseVNode(`small`,_hoisted_2$143,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.torqueFlywheel`)),1),createBaseVNode(`small`,_hoisted_3$128,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.powerFlywheel`)),1),createBaseVNode(`small`,_hoisted_4$105,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.powerWheels`)),1),createBaseVNode(`small`,_hoisted_5$91,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.rpm`)),1)]),createBaseVNode(`div`,_hoisted_6$75,[createBaseVNode(`div`,_hoisted_7$65,[createBaseVNode(`div`,_hoisted_8$52,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.power`))+` (`+toDisplayString(powerUnit.value)+`) `,1),(openBlock(),createElementBlock(Fragment,null,renderList(tickLabels,(n,index)=>createBaseVNode(`div`,{class:`ruler`,style:normalizeStyle({top:index*tickSpacing.value+`px`})},toDisplayString((globalMax.value-index*tickInterval.value).toFixed(0)),5)),64))]),createBaseVNode(`div`,_hoisted_9$46,[createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas,class:`canvas`},null,512)]),createBaseVNode(`div`,_hoisted_10$39,[createBaseVNode(`div`,_hoisted_11$34,toDisplayString(_ctx.$t(`ui.apps.engine_dynamometer.torque`))+` (`+toDisplayString(torqueUnit.value)+`) `,1),(openBlock(),createElementBlock(Fragment,null,renderList(tickLabels,(n,index)=>createBaseVNode(`div`,{class:`ruler`,style:normalizeStyle({top:index*tickSpacing.value+`px`})},toDisplayString((globalMax.value-index*tickInterval.value).toFixed(0)),5)),64))])])],512))}},app_default$17=__plugin_vue_export_helper_default(_sfc_main$194,[[`__scopeId`,`data-v-e025129d`]]),_hoisted_1$173={class:`legends`},_hoisted_2$142={class:`water`},_hoisted_3$127={class:`oil`},_hoisted_4$104={class:`block`},_hoisted_5$90={class:`exhaust`},coolantGraphColor=`#333676`,oilGraphColor=`#AA8C39`,blockGraphColor=`#378B2E`,exhaustGraphColor=`#A7383E`,_sfc_main$193={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineThermalData`],app$1=ref(null),canvas=ref(null),isRunning=ref(!1),appResizeObserver=new ResizeObserver(entries=>{let entry=entries[0];canvas.value.width=entry.target.offsetWidth,canvas.value.height=entry.target.offsetHeight}),chart=new SmoothieChart({minValue:50,maxValue:150,millisPerPixel:40,interpolation:`bezier`,grid:{fillStyle:`rgba(250,250,250,0.8)`,strokeStyle:`black`,verticalSections:0,millisPerLine:0},labels:{fillStyle:`black`}}),coolantGraph=new TimeSeries,oilGraph=new TimeSeries,blockGraph=new TimeSeries,exhaustGraph=new TimeSeries;onMounted(()=>{initChart(),appResizeObserver.observe(app$1.value),$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate)}),onBeforeUnmount(()=>{appResizeObserver.unobserve(app$1.value)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){if(streams.engineThermalData){isRunning.value||(isRunning.value=!0,chart.start());let xPoint=new Date;coolantGraph.append(xPoint,streams.engineThermalData.coolantTemperature),oilGraph.append(xPoint,streams.engineThermalData.oilTemperature),blockGraph.append(xPoint,streams.engineThermalData.engineBlockTemperature),exhaustGraph.append(xPoint,streams.engineThermalData.exhaustTemperature)}else isRunning.value&&(isRunning.value=!1,chart.stop())}function initChart(){chart.addTimeSeries(coolantGraph,{strokeStyle:coolantGraphColor,lineWidth:1}),chart.addTimeSeries(oilGraph,{strokeStyle:oilGraphColor,lineWidth:1}),chart.addTimeSeries(blockGraph,{strokeStyle:blockGraphColor,lineWidth:1}),chart.addTimeSeries(exhaustGraph,{strokeStyle:exhaustGraphColor,lineWidth:1}),chart.streamTo(canvas.value,40)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`app`,ref:app$1,class:`engine-hdg`},[createBaseVNode(`div`,_hoisted_1$173,[createBaseVNode(`small`,_hoisted_2$142,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.water`)),1),createBaseVNode(`small`,_hoisted_3$127,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.oil`)),1),createBaseVNode(`small`,_hoisted_4$104,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.block`)),1),createBaseVNode(`small`,_hoisted_5$90,toDisplayString(_ctx.$t(`ui.apps.engine_heat_debug_graph.exhaust`)),1)]),createBaseVNode(`canvas`,{ref_key:`canvas`,ref:canvas},null,512)],512))}},app_default$18=__plugin_vue_export_helper_default(_sfc_main$193,[[`__scopeId`,`data-v-ac69837e`]]),_hoisted_1$172={class:`bng-app thermal-clutch-debug`},_hoisted_2$141={class:`set-name`},_sfc_main$192={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineThermalData`],data=ref(null);onMounted(()=>{$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.streams.remove(streamsList$1)}),$game.events.on(`onStreamsUpdate`,streams=>data.value=streams.engineThermalData?parseData(streams.engineThermalData):null);function parseData(data$1){return[{str:$game.units.buildString(`temperature`,data$1.coolantTemperature,0),name:`ui.apps.engine_thermal_debug.coolant`,warn:data$1.coolantTemperature>data$1.thermostatTemperature&&data$1.coolantTemperature<120&&data$1.thermostatStatus==1,error:data$1.coolantTemperature>120},{str:$game.units.buildString(`temperature`,data$1.oilTemperature,0),name:`ui.apps.engine_thermal_debug.oil`,warn:data$1.oilTemperature>140,error:data$1.oilTemperature>150},{str:$game.units.buildString(`temperature`,data$1.engineBlockTemperature,0),name:`ui.apps.engine_thermal_debug.block`},{str:$game.units.buildString(`temperature`,data$1.cylinderWallTemperature,0),name:`ui.apps.engine_thermal_debug.cylinderlWall`},{str:$game.units.buildString(`temperature`,data$1.exhaustTemperature,0),name:`ui.apps.engine_thermal_debug.exhaustManifold`},{str:data$1.thermostatStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantThermostat`,warn:data$1.thermostatStatus>.9},{str:data$1.airRegulatorStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.airRegulator`,warn:data$1.airRegulatorStatus>.9},{str:$game.units.buildString(`speed`,data$1.radiatorAirSpeed,0),name:`ui.apps.engine_thermal_debug.radiatorAirSpeed`},{str:data$1.radiatorAirSpeedEfficiency.toFixed(4),name:`ui.apps.engine_thermal_debug.radiatorAirSpeedEfficiency`},{str:data$1.fanActive,name:`ui.apps.engine_thermal_debug.radiatorFanActive`},{str:data$1.coolantMass.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantMass`},{str:data$1.coolantLeakRateOverpressure.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateOverpressure`,warn:data$1.coolantLeakRateOverpressure>0},{str:data$1.coolantLeakRateHeadGasket.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateHeadGasket`,warn:data$1.coolantLeakRateHeadGasket>0},{str:data$1.coolantLeakRateRadiator.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateRadiator`,warn:data$1.coolantLeakRateRadiator>0},{str:data$1.coolantLeakRateOverall.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantLeakRateOverall`,warn:data$1.coolantLeakRateOverall>0},{str:data$1.coolantEfficiency.toFixed(3),name:`ui.apps.engine_thermal_debug.coolantEfficiency`,warn:data$1.coolantEfficiency<1,error:data$1.coolantEfficiency===0},{str:data$1.oilThermostatStatus.toFixed(3),name:`ui.apps.engine_thermal_debug.oilThermostat`,warn:data$1.oilThermostatStatus>.9},{str:data$1.oilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.oilMass`,warn:data$1.oilMassdata$1.maximumSafeOilMass},{str:data$1.miniumSafeOilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.miniumSafeOilMass`},{str:data$1.maximumSafeOilMass.toFixed(3),name:`ui.apps.engine_thermal_debug.maximumSafeOilMass`},{str:data$1.oilLeakRateOilpan.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateOilpan`,warn:data$1.oilLeakRateOilpan>0},{str:data$1.oilLeakRateRadiator.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateRadiator`,warn:data$1.oilLeakRateRadiator>0},{str:data$1.oilLeakRateGravity.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateGravity`,warn:data$1.oilLeakRateGravity>0},{str:data$1.oilLeakRatePistonRingDamage.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRatePistonRingDamage`,warn:data$1.oilLeakRatePistonRingDamage>0},{str:data$1.oilLeakRateOverall.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLeakRateOverall`,warn:data$1.oilLeakRateOverall>0},{str:data$1.oilStarvingSevernessXY.toFixed(3),name:`ui.apps.engine_thermal_debug.oilStarvingSevernessXY`,warn:data$1.oilStarvingSevernessXY>0},{str:data$1.oilStarvingSevernessZ.toFixed(3),name:`ui.apps.engine_thermal_debug.oilStarvingSevernessZ`,warn:data$1.oilStarvingSevernessZ>0},{str:data$1.maximumSafeG.toFixed(3),name:`ui.apps.engine_thermal_debug.maximumSafeG`},{str:data$1.oilLubricationCoef.toFixed(3),name:`ui.apps.engine_thermal_debug.oilLubricationCoef`,warn:data$1.oilLubricationCoef<1},{str:data$1.missingOilDamage.toFixed(3),name:`ui.apps.engine_thermal_debug.missingOilDamage`,warn:data$1.missingOilDamage>0},{str:data$1.engineEfficiency.toFixed(2),name:`ui.apps.engine_thermal_debug.engineEfficiency`},{str:$game.units.buildString(`energy`,data$1.energyToCylinderWall,0),name:`ui.apps.engine_thermal_debug.qtocylinderwall`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToCoolant,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltocoolant`},{str:$game.units.buildString(`energy`,data$1.energyCoolantToAir,0),name:`ui.apps.engine_thermal_debug.qcoolanttoair`},{str:$game.units.buildString(`energy`,data$1.energyCoolantToBlock,0),name:`ui.apps.engine_thermal_debug.qcoolanttoblock`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToBlock,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltoblock`},{str:$game.units.buildString(`energy`,data$1.energyBlockToAir,0),name:`ui.apps.engine_thermal_debug.qblocktoair`},{str:$game.units.buildString(`energy`,data$1.energyToOil,0),name:`ui.apps.engine_thermal_debug.qtooil`},{str:$game.units.buildString(`energy`,data$1.energyCylinderWallToOil,0),name:`ui.apps.engine_thermal_debug.qcylinderwalltooil`},{str:$game.units.buildString(`energy`,data$1.energyOilToAir,0),name:`ui.apps.engine_thermal_debug.qoilradiatortoair`},{str:$game.units.buildString(`energy`,data$1.energyOilSumpToAir,0),name:`ui.apps.engine_thermal_debug.qoilsumptoair`},{str:$game.units.buildString(`energy`,data$1.energyToExhaust,0),name:`ui.apps.engine_thermal_debug.qtoexhaust`},{str:$game.units.buildString(`energy`,data$1.energyExhaustToAir,0),name:`ui.apps.engine_thermal_debug.qexhausttoair`},{str:data$1.engineBlockOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.blockDamage`,warn:data$1.engineBlockOverheatDamage>0},{str:data$1.oilOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.oilDamage`,warn:data$1.oilOverheatDamage>0},{str:data$1.cylinderWallOverheatDamage.toFixed(),name:`ui.apps.engine_thermal_debug.cylinderwallDamage`,warn:data$1.cylinderWallOverheatDamage>0},{str:data$1.headGasketBlown,name:`ui.apps.engine_thermal_debug.headGasketBlown`,error:data$1.headGasketBlown},{str:data$1.pistonRingsDamaged,name:`ui.apps.engine_thermal_debug.pistonRingsDamaged`,error:data$1.pistonRingsDamaged},{str:data$1.connectingRodBearingsDamaged,name:`ui.apps.engine_thermal_debug.connectingRodBearingsDamaged`,error:data$1.connectingRodBearingsDamaged}]}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$172,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value,(set,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:`set`},[createBaseVNode(`div`,_hoisted_2$141,toDisplayString(_ctx.$t(set.name)),1),createBaseVNode(`div`,{class:normalizeClass([`set-value`,{"thermal-warning":set.warn,"thermal-error":set.error}])},toDisplayString(set.str),3)]))),128))]))}},app_default$19=__plugin_vue_export_helper_default(_sfc_main$192,[[`__scopeId`,`data-v-6de0b81a`]]),_hoisted_1$171={"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:cc":`http://creativecommons.org/ns#`,"xmlns:rdf":`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,"xmlns:svg":`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"xmlns:sodipodi":`http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd`,"xmlns:inkscape":`http://www.inkscape.org/namespaces/inkscape`,version:`1.1`,width:`100%`,height:`100%`,viewBox:`0 0 660 660`},_hoisted_2$140={"inkscape:groupmode":`layer`,id:`layer6`,class:`layer6`,"inkscape:label":`new`,style:{display:`inline`}},_hoisted_3$126={"xml:space":`preserve`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`159.64709473px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"letter-spacing":`0px`,"word-spacing":`0px`,"writing-mode":`lr-tb`,"text-anchor":`middle`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},x:`329.85437`,y:`328.48807`,id:`tspan4449-43`,"sodipodi:linespacing":`125%`,"inkscape:label":`#pressureText`},_hoisted_4$103={"xml:space":`preserve`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`65px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"letter-spacing":`0px`,"word-spacing":`0px`,"writing-mode":`lr-tb`,"text-anchor":`middle`,display:`inline`,fill:`#ffffff`,"fill-opacity":`0.78835976`,stroke:`none`},x:`329.03198`,y:`413.62915`,id:`speed_units`,"sodipodi:linespacing":`125%`,"inkscape:label":`#speed_units`,"inkscape:transform-center-y":`-4.486084`},_hoisted_5$89=[`id`,`x`,`y`],_hoisted_6$74=[`id`,`x`,`y`],_hoisted_7$64={"inkscape:groupmode":`layer`,id:`layer3`,"inkscape:label":`FIX`,style:{display:`inline`}},_hoisted_8$51={id:`revcurvemask`,style:{display:`inline`}},_hoisted_9$45={"inkscape:groupmode":`layer`,id:`layer11`,"inkscape:label":`revs`,style:{display:`inline`}},_hoisted_10$38={"inkscape:groupmode":`layer`,id:`layer7`,"inkscape:label":`new2`,style:{display:`inline`}},width=660,height=660,dashSize=5,pressureTextSize=50,dashCount=5,PRESURE_MAX_CONST=150,PRESURE_MIN_CONST=-100,_sfc_main$191={__name:`forcedInduction`,setup(__props,{expose:__expose}){let initialized=ref(!1),pressureTextRef=ref(null),pressureCurveRef=ref(null),pressureCurveLen=computed(()=>pressureCurveRef.value.getTotalLength()),pressureCurveDashesRef=ref(null),pressureCurveDashesLen=computed(()=>pressureCurveDashesRef.value.getTotalLength()),redLineRef=ref(null),redLineLen=computed(()=>redLineRef.value.getTotalLength()),pressureTextGuideLineRef=ref(null),pressureTextGuideLineLen=computed(()=>pressureTextGuideLineRef.value.getTotalLength()),pressureTextRefs=ref([]),pressureTextAttrs=ref([{id:`pressuretext1`,x:197.49423,y:531.5639,text:1},{id:`pressuretext2`,x:124.71793,y:434.92328,text:2},{id:`pressuretext3`,x:110.04411,y:303.35791,text:3},{id:`pressuretext4`,x:165.89227,y:187.39682,text:4},{id:`pressuretext5`,x:284.48657,y:123.71478,text:5},{id:`pressuretext6`,x:419.43579,y:137.55835,text:6},{id:`pressuretext7`,x:520.0791,y:228.94992,text:7},{id:`pressuretext8`,x:520.0791,y:228.94992,text:8},{id:`pressuretext9`,x:520.0791,y:228.94992,text:9},{id:`pressuretext10`,x:520.0791,y:228.94992,text:10}]),pressureTSpanRefs=ref([]),pressureMax=ref(null),pressureMin=ref(null),pressureNeedleRef=ref(null),pressureUnitRef=ref(null),UiUnitscallback=ref(()=>null),roundDecCallback=ref(()=>0);onMounted(()=>{pressureTextRef.value.textContent=``,pressureCurveRef.value.style.strokeDasharray=pressureCurveLen.value+` `+pressureCurveLen.value,pressureTextGuideLineRef.value.style.display=`none`;for(let k=0;k10?0:1),rpSpan.style.visibility=`visible`}initialized.value=!0}applyData(streamData)}function reset$1(){initialized.value=!1;for(let k=0;k1&&(percPos=1),pressureNeedleRef.value.setAttribute(`transform`,`rotate(`+(percPos*270-135)+`,`+width/2+`,`+height/2+`)`),pressureCurveRef.value.style.strokeDashoffset=pressureCurveLen.value-pressureCurveLen.value*percPos}function UnitPressure(val){let convertedVal=UiUnitscallback.value(val,`pressure`);return pressureNeedleRef.value.textContent!==convertedVal.unit&&(pressureUnitRef.value.textContent=convertedVal.unit,initialized.value=!1),convertedVal.val}return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$171,[_cache[4]||=createBaseVNode(`defs`,{id:`defs4`},[createBaseVNode(`linearGradient`,{id:`linearGradient3938`},[createBaseVNode(`stop`,{style:{"stop-color":`#ff0000`,"stop-opacity":`1`},offset:`0`,id:`stop3940`}),createBaseVNode(`stop`,{style:{"stop-color":`#00ff4b`,"stop-opacity":`1`},offset:`1`,id:`stop3942`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4607`},[createBaseVNode(`stop`,{id:`stop4609`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.89960396`,id:`stop4611`}),createBaseVNode(`stop`,{id:`stop4613`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4615`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4597`},[createBaseVNode(`stop`,{id:`stop4599`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.99812102`,id:`stop4601`}),createBaseVNode(`stop`,{id:`stop4603`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4605`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4545`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547`}),createBaseVNode(`stop`,{id:`stop4553`,offset:`0.9861111`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4555`}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4549`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,id:`linearGradient4256`},[createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`1`},offset:`0`,id:`stop4258`}),createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`0`},offset:`1`,id:`stop4260`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4365`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367`}),createBaseVNode(`stop`,{id:`stop4373`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4357`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`1`},offset:`0`,id:`stop4359`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.19642857`},offset:`1`,id:`stop4361`})]),createBaseVNode(`marker`,{style:{overflow:`visible`},id:`DistanceStart`,refX:`0`,refY:`0`,orient:`auto`,"inkscape:stockid":`DistanceStart`},[createBaseVNode(`g`,{id:`g2300`},[createBaseVNode(`path`,{style:{fill:`none`,stroke:`#ffffff`,"stroke-width":`1.14999998`,"stroke-linecap":`square`},d:`M 0,0 2,0`,id:`path2306`,"inkscape:connector-curvature":`0`}),createBaseVNode(`path`,{style:{fill:`#000000`,"fill-rule":`evenodd`,stroke:`none`},d:`M 0,0 13,4 9,0 13,-4 0,0 z`,id:`path2302`,"inkscape:connector-curvature":`0`}),createBaseVNode(`path`,{style:{fill:`none`,stroke:`#000000`,"stroke-width":`1`,"stroke-linecap":`square`},d:`M 0,-4 0,40`,id:`path2304`,"inkscape:connector-curvature":`0`})])]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-9`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-8`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-3`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.37015162,0,0,0.37015162,685.90181,-270.76027)`,"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4256`,id:`linearGradient4433`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-4`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357`,id:`radialGradient4363-5`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-6`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-1`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.36968813,0,0,0.36968813,1026.9451,-270.68256)`,"inkscape:collect":`always`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-49`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4256`,id:`linearGradient4746`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3921`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3923`,d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3925-1`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3927-7`,d:`m 330,10 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 296.74495,71.61583 313.18224,70 330,70 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 417.49749,19.23259 374.82925,10 330,10 z m -67.13867,7.07812 C 202.16219,30.03925 147.84399,60.20471 105.25195,102.23633 l 42.54297,42.3125 C 182.22028,110.72238 226.01669,86.41327 274.9375,75.86328 L 262.86133,17.07812 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 565.93577,105.29347 518.20331,63.82636 461.72461,38.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 575.92383,233.46544 590,280.08649 590,330 l 60,0 C 650,268.39079 632.57195,210.85952 602.40234,162.03516 z M 15.06055,273.02148 C 11.7373,291.51211 10,310.55271 10,330 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 76.98058,398.61583 70,365.12541 70,330 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 L 15.06055,273.02148 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 141.73258,515.3212 111.08736,478.12046 91.96094,434.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 202.04051,629.81227 263.66249,650 330,650 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545`,id:`linearGradient4551`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545-2`,id:`linearGradient4551-8`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4545-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547-4`}),createBaseVNode(`stop`,{id:`stop4553-5`,offset:`0.99000001`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4555-5`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4549-1`})]),createBaseVNode(`linearGradient`,{y2:`282.59341`,x2:`474.60886`,y1:`211.1199`,x1:`480`,gradientUnits:`userSpaceOnUse`,id:`linearGradient4574`,"xlink:href":`#linearGradient4607`,"inkscape:collect":`always`,gradientTransform:`matrix(1,0,0,0.9882541,0,10.359887)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036-1`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0`,id:`radialGradient4363-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4365-4`,id:`radialGradient4371-2`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5`}),createBaseVNode(`stop`,{id:`stop4373-5`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997`,"xlink:href":`#linearGradient4365-4`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4363-4-1`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4001`,"xlink:href":`#linearGradient4357-0-7`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4040`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4045`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7-2`,id:`radialGradient4045-8`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-758.53125,-231)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4063`,"xlink:href":`#linearGradient4357-0-7-2`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4082`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-8`,id:`radialGradient4363-4-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4031-1`,"xlink:href":`#linearGradient4357-0-8-5`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8-5`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7-2`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-3`,id:`radialGradient4363-4-0`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-3`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9-8`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4-01`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8-2`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-8-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4401`,"xlink:href":`#linearGradient4357-0-3`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997-4`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5-8`}),createBaseVNode(`stop`,{id:`stop4373-5-3`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4458`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3653`},[createBaseVNode(`path`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},d:`M 480,84 C 225.94901,84 20,289.94901 20,544 20,798.05099 225.94901,1004 480,1004 734.05099,1004 940,798.05099 940,544 940,289.94901 734.05099,84 480,84 Z m 0,322 c 76.21531,0 138,61.78469 138,138 0,76.21531 -61.78469,138 -138,138 -76.21531,0 -138,-61.78469 -138,-138 0,-76.21531 61.78469,-138 138,-138 z`,id:`path3655`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4490`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 330,10 c -176.15718,3e-6 -319.999997,143.84282 -320,320 0,88.07859 35.961054,168.07824 93.94141,226.05859 l 68.0957,-68.0957 C 131.73748,447.66326 106.91016,391.89131 106.91016,330 c 0,-123.78262 99.30722,-223.08984 223.08984,-223.08984 123.78262,0 223.08984,99.30722 223.08984,223.08984 0,61.89131 -24.82732,117.66326 -65.12695,157.96289 l 68.0957,68.0957 C 614.03895,498.07824 650,418.07859 650,330 650,153.84282 506.15718,10 330,10 Z`,id:`path4492`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4494`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 330,10 c -176.15718,3e-6 -319.999997,143.84282 -320,320 0,88.07859 35.961054,168.07824 93.94141,226.05859 l 68.0957,-68.0957 C 131.73748,447.66326 106.91016,391.89131 106.91016,330 c 0,-123.78262 99.30722,-223.08984 223.08984,-223.08984 123.78262,0 223.08984,99.30722 223.08984,223.08984 0,61.89131 -24.82732,117.66326 -65.12695,157.96289 l 68.0957,68.0957 C 614.03895,498.07824 650,418.07859 650,330 650,153.84282 506.15718,10 330,10 Z`,id:`path4496`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4498`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`evenodd`,stroke:`none`,"stroke-width":`96.91093445`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 240.41631,-226.27417 c -124.56194,124.56194 -124.56194,327.9864 0,452.54834 62.28096,62.28097 144.27756,93.42096 226.27417,93.42095 l 0,-96.30186 c -56.99229,0 -113.98458,-21.88116 -157.74834,-65.64492 -87.52753,-87.527531 -87.52753,-227.969149 0,-315.49668 87.52753,-87.52753 227.96915,-87.52753 315.49668,0 C 668.20258,-113.98457 690.08374,-56.992283 690.08374,0 l 96.30186,0 c 1e-5,-81.996605 -31.13998,-163.9932 -93.42095,-226.27417 -124.56194,-124.56194 -327.98641,-124.56194 -452.54834,0 z`,id:`path4500`,"inkscape:connector-curvature":`0`})])],-1),_cache[5]||=createBaseVNode(`g`,{"inkscape:label":`background`,"inkscape:groupmode":`layer`,id:`layer1`,transform:`translate(-150,-242.36218)`,style:{display:`none`,opacity:`1`}},[createBaseVNode(`rect`,{style:{fill:`#505050`,"fill-opacity":`1`,stroke:`none`},id:`rect4616`,width:`2175.3789`,height:`1458.4727`,x:`-727.47485`,y:`-115.47279`})],-1),createBaseVNode(`g`,_hoisted_2$140,[_cache[0]||=createBaseVNode(`circle`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`url(#radialGradient3997)`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},id:`path4281-5`,cx:`480`,cy:`544`,r:`320`,transform:`translate(-150,-214)`},null,-1),_cache[1]||=createBaseVNode(`path`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`url(#radialGradient4363-4)`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`6`,marker:`none`,"enable-background":`accumulate`},d:`M 480,214 C 297.74603,214 150,361.74603 150,544 150,726.25397 297.74603,874 480,874 662.25397,874 810,726.25397 810,544 810,361.74603 662.25397,214 480,214 Z`,id:`path4281`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`sssss`,"clip-path":`url(#clipPath3653)`,transform:`translate(-150,-214)`},null,-1),createBaseVNode(`text`,_hoisted_3$126,[createBaseVNode(`tspan`,{ref_key:`pressureTextRef`,ref:pressureTextRef,"sodipodi:role":`line`,id:`pressureText`,x:`329.85437`,y:`328.48807`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`159.64709473px`,"line-height":`125%`,"font-family":`'Squada One'`,"-inkscape-font-specification":`'Squada One'`,"text-align":`center`,"writing-mode":`lr-tb`,"text-anchor":`middle`,fill:`#ffffff`,"fill-opacity":`1`}},` 0`,512)]),createBaseVNode(`text`,_hoisted_4$103,[createBaseVNode(`tspan`,{ref_key:`pressureUnitRef`,ref:pressureUnitRef,"sodipodi:role":`line`,id:`pressureunit`,x:`329.03198`,y:`413.62915`},`PSI`,512)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(pressureTextAttrs.value,attrs=>(openBlock(),createElementBlock(`text`,{ref_for:!0,ref:el=>pressureTextRefs.value.push(el),"xml:space":`preserve`,class:`pressure-text`,id:attrs.id+`p`,x:attrs.x,y:attrs.y},[createBaseVNode(`tspan`,{ref_for:!0,ref:el2=>pressureTSpanRefs.value.push(el2),id:attrs.id,x:attrs.x,y:attrs.y},toDisplayString(attrs.text),9,_hoisted_6$74)],8,_hoisted_5$89))),256))]),createBaseVNode(`g`,_hoisted_7$64,[createBaseVNode(`g`,_hoisted_8$51,[_cache[2]||=createBaseVNode(`rect`,{style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#000000`,"fill-opacity":`0.37037036`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,"enable-background":`accumulate`},id:`rect4001`,width:`683.79401`,height:`683.79401`,x:`127.97179`,y:`-340.09323`,transform:`matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)`,"clip-path":`url(#clipPath4498)`},null,-1),createBaseVNode(`path`,{ref_key:`pressureCurveRef`,ref:pressureCurveRef,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`none`,stroke:`#ffffff`,"stroke-width":`99.31034088`,"stroke-miterlimit":`4`,"stroke-dasharray":`2374.27468498, 2374.27468498`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,marker:`none`,"enable-background":`accumulate`},d:`M 147.9957,528.59996 C 50,420 27.118653,298.1594 119.95323,156.00847 150,110 350,-30 532.60856,149.71493 c 74.5117,73.33098 97.08931,264.86379 -10.87668,369.15745`,id:`pressureCurve`,"clip-path":`url(#clipPath4494)`},null,512),createBaseVNode(`path`,{ref_key:`redLineRef`,ref:redLineRef,style:{color:`#000000`,overflow:`visible`,visibility:`visible`,fill:`none`,stroke:`#9c0000`,"stroke-width":`117.91827393`,"stroke-linecap":`butt`,"stroke-linejoin":`bevel`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-dashoffset":`604.6484375`,"stroke-opacity":`0.66137564`,marker:`none`,"enable-background":`accumulate`},d:`M 147.99571,510.41274 C 33.434043,395.42128 59.279735,242.76116 138.14044,153.71911 230,50 387.77546,50.913502 485.67663,112.95746 c 165.77018,105.05531 132.03401,312.46382 37.32761,407.0596`,id:`pressure_redline`,"clip-path":`url(#clipPath4490)`},null,512)])]),createBaseVNode(`g`,_hoisted_9$45,[createBaseVNode(`path`,{ref_key:`pressureCurveDashesRef`,ref:pressureCurveDashesRef,style:{display:`inline`,fill:`none`,stroke:`#000000`,"stroke-width":`96.91100311`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`48.4555, 48.4555`,"stroke-dashoffset":`0`,"stroke-opacity":`0.37566139`},d:`m 137.9887,522.0113 c -106.044908,-106.04491 -106.044903,-277.97769 1e-5,-384.0226 106.04491,-106.044917 277.97767,-106.044914 384.02259,0 106.04491,106.04491 106.04492,277.97769 10e-6,384.0226`,id:`pressureCurve_dashes`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`cssc`,"inkscape:label":`#path4531-4`},null,512),createBaseVNode(`path`,{ref_key:`pressureTextGuideLineRef`,ref:pressureTextGuideLineRef,style:{display:`inline`,fill:`none`,stroke:`#e90000`,"stroke-width":`2.86352348`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`0.24404764`},d:`m 202.03513,457.96488 c -70.12576,-70.12575 -70.12576,-183.82209 0,-253.94784 70.12575,-70.12576 183.82208,-70.12576 253.94784,0 70.12575,70.12575 70.12575,183.82209 0,253.94784`,id:`pressuretextline`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`cssc`,"inkscape:label":`#path4531-4`},null,512)]),createBaseVNode(`g`,_hoisted_10$38,[createBaseVNode(`g`,{ref_key:`pressureNeedleRef`,ref:pressureNeedleRef,id:`pressure_needle_d`,"inkscape:label":`#g4147`,transform:`translate(-1.2852971e-6,1.993565e-6)`},[..._cache[3]||=[createBaseVNode(`rect`,{y:`7.0002151`,x:`322.0993`,height:`103.00317`,width:`12.038266`,id:`rect4625`,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#d70000`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`67.38899994`,marker:`none`,"enable-background":`accumulate`},transform:`matrix(1,0,0.00784004,0.99996927,0,0)`},null,-1),createBaseVNode(`rect`,{transform:`scale(1,-1)`,y:`-660`,x:`322.44037`,height:`660`,width:`15.11928`,id:`rect4625-1`,style:{color:`#000000`,display:`inline`,overflow:`visible`,visibility:`visible`,fill:`#008000`,"fill-opacity":`0`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`67.38899994`,marker:`none`,"enable-background":`accumulate`}},null,-1)]],512)])]))}},forcedInduction_default=__plugin_vue_export_helper_default(_sfc_main$191,[[`__scopeId`,`data-v-a0f39cc4`]]),_sfc_main$190={__name:`app`,setup(__props){let{$game}=useLibStore(),forcedInductionRef=ref(null),fiContainerRef=ref(null),enabled=ref(!1);return onMounted(()=>{forcedInductionRef.value.wireThroughRoundDec(roundDec),forcedInductionRef.value.wireThroughUnitSystem((val,func)=>UiUnits[func](val)),$game.streams.add([`forcedInductionInfo`])}),onUnmounted(()=>{$game.streams.remove([`forcedInductionInfo`])}),$game.events.on(`VechicleChange`,()=>forcedInductionRef.value.reset()),$game.events.on(`VehicleFocusChanged`,data=>{data.mode==1&&forcedInductionRef.value!==null&&forcedInductionRef.value.reset()}),$game.events.on(`onStreamsUpdate`,streams=>{if(forcedInductionRef.value===null)return;let newEnabled=forcedInductionRef.value.isStreamValid(streams);newEnabled?(newEnabled&&!enabled.value&&(fiContainerRef.value.style.opacity=1),forcedInductionRef.value.update(streams)):!newEnabled&&enabled&&(fiContainerRef.value.style.opacity=0),enabled.value=newEnabled}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`fiContainerRef`,ref:fiContainerRef,class:`fi-container`},[createVNode(forcedInduction_default,{ref_key:`forcedInductionRef`,ref:forcedInductionRef},null,512)],512))}},app_default$20=__plugin_vue_export_helper_default(_sfc_main$190,[[`__scopeId`,`data-v-3ea976f6`]]),_hoisted_1$170={class:`fi-debug`},_hoisted_2$139={class:`name`},_hoisted_3$125={class:`value`},_sfc_main$189={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`forcedInductionInfo`],defaultMeasures=[{name:`RPM`,key:`rpm`},{name:`Boost`,key:`boost`,type:`pressure`},{name:`Power Coef`,key:`coef`},{name:`Pressure Pulses`,key:`pulses`},{name:`SC Loss`,key:`loss`},{name:`Exhaust Power`,key:`exhaustPower`},{name:`Friction`,key:`friction`},{name:`Backpressure`,key:`backpressure`},{name:`Wastegate Factor`,key:`wastegateFactor`},{name:`Turbo Temp`,key:`turboTemp`,type:`temperature`}],measures=ref([]),filteredMeasures=computed(()=>measures.value.filter(m=>m.val!==void 0));onMounted(()=>{$game.streams.add(streamsList$1),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleReset`,init$3),$game.events.on(`VehicleFocusChanged`,init$3),init$3()}),onUnmounted(()=>{$game.streams.remove(streamsList$1),$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleReset`,init$3),$game.events.off(`VehicleFocusChanged`,init$3)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;measures.value.forEach(x=>{let val=streams.forcedInductionInfo[x.key];val!==void 0&&(x.val=x.type===void 0?val.toFixed(2):$game.units.buildString(x.type,val,2))})}function init$3(){measures.value=defaultMeasures}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$170,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filteredMeasures.value,m=>(openBlock(),createElementBlock(`div`,{class:`measure`,key:m.key},[createBaseVNode(`div`,_hoisted_2$139,toDisplayString(m.name),1),createBaseVNode(`div`,_hoisted_3$125,toDisplayString(m.val),1)]))),128))]))}},app_default$21=__plugin_vue_export_helper_default(_sfc_main$189,[[`__scopeId`,`data-v-8094d28b`]]),_sfc_main$188={},_hoisted_1$169={xmlns:`http://www.w3.org/2000/svg`,width:`60`,height:`100`,viewBox:`0 0 60 100`};function _sfc_render$2(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$169,[..._cache[0]||=[createBaseVNode(`rect`,{x:`4`,y:`4`,width:`52`,height:`92`,rx:`25`,ry:`25`,stroke:`black`,"stroke-width":`4`,fill:`none`},null,-1)]])}var accumulator_default=__plugin_vue_export_helper_default(_sfc_main$188,[[`render`,_sfc_render$2]]),_sfc_main$187={},_hoisted_1$168={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`125`,viewBox:`0 0 100 125`,"stroke-width":`4`,stroke:`black`};function _sfc_render$1(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$168,[..._cache[0]||=[createBaseVNode(`circle`,{cx:`50`,cy:`32`,r:`30`,fill:`none`},null,-1),createBaseVNode(`path`,{d:`M50 6 L57 15 L43 15 Z`,fill:`black`},null,-1),createBaseVNode(`line`,{x1:`50`,y1:`61`,x2:`50`,y2:`90`,stroke:`black`},null,-1),createBaseVNode(`path`,{d:`M15 59 L15 115 L85 115 L85 59`,fill:`none`},null,-1)]])}var pump_default=__plugin_vue_export_helper_default(_sfc_main$187,[[`render`,_sfc_render$1]]),_sfc_main$186={},_hoisted_1$167={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`130`,viewBox:`0 0 100 130`,"stroke-width":`4`,stroke:`black`};function _sfc_render(_ctx,_cache){return openBlock(),createElementBlock(`svg`,_hoisted_1$167,[..._cache[0]||=[createStaticVNode(``,6)]])}var reliefValve_default=__plugin_vue_export_helper_default(_sfc_main$186,[[`render`,_sfc_render]]),_hoisted_1$166={xmlns:`http://www.w3.org/2000/svg`,width:`100`,height:`210`,viewBox:`0 0 200 310`},_hoisted_2$138={transform:`translate(100, 0)`},_hoisted_3$124={transform:`translate(0, 110)`},_hoisted_4$102={transform:`translate(110, 190)`},_sfc_main$185={__name:`pumpAssembly`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$166,[createBaseVNode(`g`,_hoisted_2$138,[createVNode(accumulator_default)]),createBaseVNode(`g`,_hoisted_3$124,[createVNode(reliefValve_default)]),createBaseVNode(`g`,_hoisted_4$102,[createVNode(pump_default)]),_cache[0]||=createBaseVNode(`path`,{d:`M56 122 L56 138 M54 120 L128 120 M130 122 L130 98 M130 120 L158 120 M160 118 L160 190`,stroke:`black`,"stroke-width":`4`},null,-1)]))}},pumpAssembly_default=_sfc_main$185,_hoisted_1$165={class:`hydraulics-debug`},_hoisted_2$137={width:`100%`,height:`100%`},_hoisted_3$123={id:`myGradient`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`},_hoisted_4$101=[`offset`],_hoisted_5$88={transform:`translate(0, 150)`,id:`pumpAssembly`},_hoisted_6$73=[`transform`],_hoisted_7$63=[`width`],_sfc_main$184={__name:`app`,setup(__props){let streamsList$1=[],{$game}=useLibStore(),offset$2=ref(0),offsetLeft=computed(()=>`${offset$2.value}%`),increase=()=>{offset$2.value<=100&&(offset$2.value+=10)},decrease=()=>{offset$2.value>0&&(offset$2.value-=10)},consumers=ref([{type:`hydraulicMotor`},{type:`cylinder`}]),addCylinder=function(){consumers.value.push({type:`cylinder`})},addhydraulicMotor=function(){consumers.value.push({type:`hydraulicMotor`})},removeConsumer=function(index=null){index===null?consumers.value.pop():consumers.value.splice(index,1)};onMounted(()=>{$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.streams.add(streamsList$1)}),onUnmounted(()=>{$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.streams.remove(streamsList$1)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return}return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[_cache[1]||=createBaseVNode(`h1`,null,`Hydraulics Debug`,-1),createBaseVNode(`button`,{onClick:decrease},`dec`),createBaseVNode(`button`,{onClick:increase},`inc`),createBaseVNode(`button`,{onClick:addhydraulicMotor},`motor`),createBaseVNode(`button`,{onClick:addCylinder},`cylinder`),createBaseVNode(`button`,{onClick:removeConsumer},`Remove Consumer`),createBaseVNode(`div`,null,` offset: `+toDisplayString(offset$2.value)+` left: `+toDisplayString(offsetLeft.value),1),createBaseVNode(`div`,_hoisted_1$165,[(openBlock(),createElementBlock(`svg`,_hoisted_2$137,[createBaseVNode(`defs`,null,[createBaseVNode(`linearGradient`,_hoisted_3$123,[createBaseVNode(`stop`,{offset:offsetLeft.value,"stop-color":`green`},null,8,_hoisted_4$101),_cache[0]||=createBaseVNode(`stop`,{offset:`0`,"stop-color":`black`},null,-1)])]),createBaseVNode(`g`,_hoisted_5$88,[createVNode(pumpAssembly_default)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(consumers.value,(consumer,index)=>(openBlock(),createElementBlock(`g`,{transform:`translate(${(index+1)*100}, 95)`},[createVNode(consumer,{consumerType:consumer.type},null,8,[`consumerType`])],8,_hoisted_6$73))),256)),createBaseVNode(`rect`,{x:`80`,y:`236.5`,width:100*(consumers.value.length-1)+66,height:`2`,fill:`url(#myGradient)`},null,8,_hoisted_7$63)]))])],64))}},app_default$22=__plugin_vue_export_helper_default(_sfc_main$184,[[`__scopeId`,`data-v-a5aea534`]]),_hoisted_1$164={key:0,class:`bindings-app`},_hoisted_2$136={key:0,class:`toggle-icon`},_hoisted_3$122={key:1,class:`toggle-icon`},_hoisted_4$100={key:0,class:`players-binding`},_hoisted_5$87={key:0},_hoisted_6$72={key:1,class:`bindings-container`},_hoisted_7$62={class:`binding-item`},_sfc_main$183={__name:`app`,setup(__props){let{$game}=useLibStore(),bindings=ref([]),small=ref(!0),timeout=ref(null),show=ref(0),players=ref([]),forward=()=>{show.value=(show.value+1)%bindings.value.length},backward=()=>{show.value=show.value===0?bindings.value.length-1:show.value-1},toggleSmall=()=>{small.value=!small.value,clearTimeout(timeout)},goToBindings=(action,control)=>{$game.events.emit(`MenuHide`,!1),bngVue.gotoGameState(`menu.options.controls.bindings.edit`,{params:{action:action.actionName,oldBinding:{control:control.c,device:control.n}}})};onMounted(()=>{$game.events.on(`InputBindingsChanged`,onInputBindingsChanged),$game.events.on(`VehicleChange`,showBriefly),$game.events.on(`VehicleFocusChanged`,showBriefly),$game.api.engineLua(`extensions.core_input_bindings.notifyUI("keys app: link init")`),setTimeout(function(){$game.api.engineLua(`settings.notifyUI()`)},200)}),onUnmounted(()=>{$game.events.off(`InputBindingsChanged`,onInputBindingsChanged),$game.events.off(`VehicleChange`,showBriefly),$game.events.off(`VehicleFocusChanged`,showBriefly)});function showBriefly(){small.value&&(timeout.value=setTimeout(()=>small.value=!0,1e4)),small.value=!1}function onInputBindingsChanged(data){let specialKeys=[];players.value=[];for(let i=0;i=bindings.value.length&&(show.value=0)}function existsAt(arr,ac){return arr.map(function(elem,i){return elem.actionName===ac?i:-1}).filter(function(elem){return elem!==-1})}return(_ctx,_cache)=>players.value.length>1||bindings.value[show.value]&&bindings.value[show.value].length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$164,[createBaseVNode(`div`,{onClick:_cache[0]||=$event=>toggleSmall(),class:`binding-show`},[small.value?(openBlock(),createElementBlock(`span`,_hoisted_2$136,[createVNode(unref(bngIcon_default),{class:`key-icon`,type:unref(icons).arrowSmallLeft},null,8,[`type`])])):(openBlock(),createElementBlock(`span`,_hoisted_3$122,[createVNode(unref(bngIcon_default),{class:`key-icon`,type:unref(icons).arrowSmallRight},null,8,[`type`])]))]),!small.value&&(players.value.length>1||bindings.value[show.value]&&bindings.value[show.value].length>0)?(openBlock(),createElementBlock(`div`,_hoisted_4$100,[!small.value&&players.value.length>1?(openBlock(),createElementBlock(`div`,_hoisted_5$87,[bindings.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:_cache[1]||=$event=>backward()})):createCommentVNode(``,!0),createBaseVNode(`span`,null,`Player `+toDisplayString(show.value),1),bindings.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[2]||=$event=>forward()})):createCommentVNode(``,!0)])):createCommentVNode(``,!0),bindings.value[show.value].length>0&&!small.value?(openBlock(),createElementBlock(`div`,_hoisted_6$72,[(openBlock(!0),createElementBlock(Fragment,null,renderList(bindings.value[show.value],entry=>(openBlock(),createElementBlock(`div`,_hoisted_7$62,[createBaseVNode(`div`,null,toDisplayString(_ctx.$t(entry.action)),1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(entry.control,b=>(openBlock(),createBlock(unref(bngBinding_default),{deviceKey:b.c,device:b.d,"show-unassigned":!0,onClick:$event=>goToBindings(entry,b)},null,8,[`deviceKey`,`device`,`onClick`]))),256))])]))),256))])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)}},app_default$23=__plugin_vue_export_helper_default(_sfc_main$183,[[`__scopeId`,`data-v-b0d8eae9`]]),_hoisted_1$163={class:`bng-app log-vehicle-stats`},_hoisted_2$135={class:`update-period`},_hoisted_3$121={class:`settings-row`},_hoisted_4$99={class:`settings-row`},_hoisted_5$86={class:`settings-row`},_hoisted_6$71={class:`settings-row`},_hoisted_7$61={class:`log-btns`},_sfc_main$182={__name:`app`,setup(__props){const{$game}=useLibStore(),config=reactive({updateTime:5,moduleGeneral:!0,moduleWheels:!0,moduleEngine:!0,moduleInputs:!0,modulePowertrain:!0,outputFileName:`settings.json`,inputFileName:`settings.json`,outputDir:`VSL`}),configChanged=(configName,value)=>{switch(configName){case`moduleGeneral`:config.moduleGeneral=value;break;case`moduleWheels`:config.moduleWheels=value;break;case`moduleEngine`:config.moduleEngine=value;break;case`moduleInputs`:config.moduleInputs=value;break;case`modulePowertrain`:config.modulePowertrain=value;break}},applySettings=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.updateTime = ${config.updateTime}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["General"] = ${config.moduleGeneral}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Wheels"] = ${config.moduleWheels}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Inputs"] = ${config.moduleInputs}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Engine"] = ${config.moduleEngine}`),$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.useModule["Powertrain"] = ${config.modulePowertrain}`)},useAsOutputDir=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.settings.outputDir = "${config.outputDir}"`)},getNewOutputFilename=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.suggestOutputFilename()`,function(data){config.outputFileName=data})},saveSettingsToJson=()=>{config.outputFileName!==``&&$game.api.activeObjectLua(`extensions.vehicleStatsLogger.writeSettingsToJSON("${config.outputFileName}")`)},importSettingsFromFile=()=>{scope.inputFileName!==``&&($game.api.activeObjectLua(`extensions.vehicleStatsLogger.applySettingsFromJSON("${config.inputFileName}")`),config.moduleGeneral=eval(`${extensions.vehicleStatsLogger.settings.useModule.General}`),config.moduleWheels=eval(`${extensions.vehicleStatsLogger.settings.useModule.Wheels}`),config.moduleInputs=eval(`${extensions.vehicleStatsLogger.settings.useModule.Inputs}`),config.moduleEngine=eval(`${extensions.vehicleStatsLogger.settings.useModule.Engine}`),config.modulePowertrain=eval(`${extensions.vehicleStatsLogger.settings.useModule.Powertrain}`))},startLogging=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.startLogging()`)},stopLogging=()=>{$game.api.activeObjectLua(`extensions.vehicleStatsLogger.stopLogging()`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$163,[createBaseVNode(`div`,_hoisted_2$135,[_cache[20]||=createBaseVNode(`span`,{class:`label`},`Update Period:`,-1),createVNode(unref(bngInput_default),{type:`number`,min:1,max:360,step:1,modelValue:config.updateTime,"onUpdate:modelValue":_cache[0]||=$event=>config.updateTime=$event,suffix:`seconds`},null,8,[`modelValue`])]),createBaseVNode(`div`,null,[createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleGeneral,"onUpdate:modelValue":_cache[1]||=$event=>config.moduleGeneral=$event,onValueChanged:_cache[2]||=val=>configChanged(`moduleGeneral`,val)},{default:withCtx(()=>[..._cache[21]||=[createTextVNode(` General`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleWheels,"onUpdate:modelValue":_cache[3]||=$event=>config.moduleWheels=$event,onValueChanged:_cache[4]||=val=>configChanged(`moduleWheels`,val)},{default:withCtx(()=>[..._cache[22]||=[createTextVNode(` Wheels`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleEngine,"onUpdate:modelValue":_cache[5]||=$event=>config.moduleEngine=$event,onValueChanged:_cache[6]||=val=>configChanged(`moduleEngine`,val)},{default:withCtx(()=>[..._cache[23]||=[createTextVNode(` Engine`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.moduleInputs,"onUpdate:modelValue":_cache[7]||=$event=>config.moduleInputs=$event,onValueChanged:_cache[8]||=val=>configChanged(`moduleInputs`,val)},{default:withCtx(()=>[..._cache[24]||=[createTextVNode(` Inputs`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngPillCheckbox_default),{modelValue:config.modulePowertrain,"onUpdate:modelValue":_cache[9]||=$event=>config.modulePowertrain=$event,onValueChanged:_cache[10]||=val=>configChanged(`modulePowertrain`,val)},{default:withCtx(()=>[..._cache[25]||=[createTextVNode(`Powertrain`,-1)]]),_:1},8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_3$121,[_cache[27]||=createBaseVNode(`label`,null,`Apply Settings:`,-1),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[11]||=$event=>applySettings()},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(`Apply`,-1)]]),_:1})]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$99,[_cache[29]||=createBaseVNode(`label`,null,`Set Custom Output Directory:`,-1),createVNode(unref(bngInput_default),{modelValue:config.outputDir,"onUpdate:modelValue":_cache[12]||=$event=>config.outputDir=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[13]||=$event=>useAsOutputDir()},{default:withCtx(()=>[..._cache[28]||=[createTextVNode(`Use`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Subdirectory of the BeamNG.drive/BeamNG.tech directory.`]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_5$86,[_cache[31]||=createBaseVNode(`label`,null,`Settings Output Filename:`,-1),createVNode(unref(bngInput_default),{modelValue:config.outputFileName,"onUpdate:modelValue":_cache[14]||=$event=>config.outputFileName=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[15]||=$event=>saveSettingsToJson()},{default:withCtx(()=>[..._cache[30]||=[createTextVNode(`Write`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Settings files are written to the BeamNG.drive/BeamNG.tech directory.`]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$71,[_cache[33]||=createBaseVNode(`label`,null,`Settings Input Filename:`,-1),createVNode(unref(bngInput_default),{modelValue:config.inputFileName,"onUpdate:modelValue":_cache[16]||=$event=>config.inputFileName=$event},null,8,[`modelValue`]),createVNode(unref(bngButton_default),{class:`settings-btn`,onClick:_cache[17]||=$event=>importSettingsFromFile()},{default:withCtx(()=>[..._cache[32]||=[createTextVNode(`Load`,-1)]]),_:1})])),[[unref(BngTooltip_default),`Settings files are assumed to be in the BeamNG.drive/BeamNG.tech directory.`]]),createBaseVNode(`div`,_hoisted_7$61,[createVNode(unref(bngButton_default),{class:`start-btn`,onClick:_cache[18]||=$event=>startLogging()},{default:withCtx(()=>[..._cache[34]||=[createTextVNode(`Start Log`,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`stop-btn`,onClick:_cache[19]||=$event=>stopLogging()},{default:withCtx(()=>[..._cache[35]||=[createTextVNode(`Stop Log`,-1)]]),_:1})])]))}},app_default$24=__plugin_vue_export_helper_default(_sfc_main$182,[[`__scopeId`,`data-v-686c3ac5`]]),_hoisted_1$162={class:`replay-app-container`,ref:`appContainerRef`},_hoisted_2$134={class:`left-controls`},_hoisted_3$120={class:`filename-container`},_hoisted_4$98={key:1,class:`filename`},_hoisted_5$85={key:1,class:`filename`},_hoisted_6$70={class:`right-controls`},_hoisted_7$60={class:`replay-controls-container`},_hoisted_8$50={class:`play-controls`},_hoisted_9$44={key:0,class:`speed-controls`},_hoisted_10$37={class:`svg-time-container`},_hoisted_11$33={width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},_hoisted_12$26={viewBox:`0 0 200 50`,width:`100%`,height:`100%`,overflow:`visible`},_hoisted_13$23={transform:`translate(100, 25)`},_hoisted_14$22={"text-anchor":`middle`,"dominant-baseline":`middle`,class:`time-text`,"font-size":`40`,"line-height":`1`},_hoisted_15$21={class:`time-display-total`},_hoisted_16$21={class:`position-slider`},replayFolder=`replays/`,replayFileExtension=`.rpl`,_sfc_main$181={__name:`app`,props:{hideFileControls:{type:Boolean,default:!1}},setup(__props){let state=ref(`inactive`),speed=ref(1),paused=ref(!1),renaming=ref(!1),isSeeking=ref(!1),loadedFile=ref(``),positionSeconds=ref(0),totalSeconds=ref(0),positionPercent=ref(0),fpsRec=ref(0),fpsPlay=ref(0),originalFilename=``,lastSeek=0,events$3=useEvents(),resizeObserver=ref(null),replayControlsRef=ref(null),containerWidth=shallowRef(0),layoutState=computed(()=>{let width$1=containerWidth.value;return{isReplayControlsNarrow:width$1<301,isFileControlsNarrow:width$1<361}}),props=__props,formatTime$1=seconds=>new Date(seconds*1e3).toISOString().substr(14,8),debounce$1=(fn,delay)=>{let timer=null;return(...args)=>{timer&&clearTimeout(timer),timer=setTimeout(()=>{fn(...args),timer=null},delay)}},listRecordings=()=>{window.bngVue.gotoGameState(`menu.replay`)},startRenaming=()=>{renaming.value=!0,originalFilename=loadedFile.value},cancelRename=()=>{renaming.value=!1,loadedFile.value=originalFilename},acceptRename=()=>{if(loadedFile.value===originalFilename){cancelRename();return}renaming.value=!1,Lua_default.core_replay.acceptRename(replayFolder+originalFilename+replayFileExtension,replayFolder+loadedFile.value+replayFileExtension)},toggleSpeed=val=>{Lua_default.core_replay.toggleSpeed(val)},togglePlay=()=>{Lua_default.core_replay.togglePlay()},toggleRecording=()=>{Lua_default.core_replay.toggleRecording(!0)},cancelRecording=()=>{Lua_default.core_replay.cancelRecording()},stop$1=()=>{Lua_default.core_replay.stop()},seek=()=>{state.value===`playback`&&(lastSeek=Date.now(),Lua_default.core_replay.pause(!0),Lua_default.core_replay.seek(positionPercent.value))};watch(positionSeconds,(newVal,oldVal)=>{Date.now()-lastSeek>500&&totalSeconds.value>0&&(positionPercent.value=newVal/totalSeconds.value)});let setupResizeObserver=()=>{if(!replayControlsRef.value)return;let rafId=null,updateWidth=debounce$1(width$1=>{containerWidth.value=width$1},100);resizeObserver.value=new ResizeObserver(entries=>{rafId!==null&&cancelAnimationFrame(rafId),rafId=requestAnimationFrame(()=>{for(let entry of entries)updateWidth(entry.contentRect.width);rafId=null})}),resizeObserver.value.observe(replayControlsRef.value)};return onMounted(async()=>{try{Lua_default.core_replay.onInit()}catch(e){console.error(`Error initializing replay state:`,e)}events$3.on(`replayStateChanged`,val=>{renaming.value||(loadedFile.value=val.loadedFile.replace(replayFolder,``).replace(replayFileExtension,``)),positionSeconds.value=val.positionSeconds,totalSeconds.value=val.totalSeconds,speed.value=val.speed,paused.value=val.paused,fpsRec.value=val.fpsRec,fpsPlay.value=val.fpsPlay,state.value=val.state,isSeeking.value=val.jumpOffset!==0,Date.now()-lastSeek>500&&totalSeconds.value>0?positionPercent.value=positionSeconds.value/totalSeconds.value:isSeeking.value=!0}),await nextTick(),setupResizeObserver()}),onUnmounted(()=>{resizeObserver.value&&=(resizeObserver.value.disconnect(),null),events$3.off(`replayStateChanged`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$162,[props.hideFileControls?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`file-controls`,{narrow:layoutState.value.isFileControlsNarrow}])},[createBaseVNode(`div`,_hoisted_2$134,[createVNode(unref(bngButton_default),{class:`recordings-button`,onClick:listRecordings,icon:`folder`,tooltip:`Open recordings`,accent:unref(ACCENTS).text},null,8,[`accent`]),loadedFile.value&&state.value!==`recording`&&!renaming.value?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`recordings-button`,onClick:stop$1,icon:`xmark`,disabled:state.value!==`playback`,tooltip:`Close replay`,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`])):createCommentVNode(``,!0),state.value===`recording`?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:`recordings-button`,onClick:cancelRecording,icon:`undo`,accent:unref(ACCENTS).attention,tooltip:`Cancel recording`},null,8,[`accent`])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$120,[loadedFile.value&&state.value!==`recording`?(openBlock(),createElementBlock(Fragment,{key:0},[renaming.value?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(bngButton_default),{onClick:cancelRename,icon:`xmark`,accent:unref(ACCENTS).ghost,class:`cancel-rename-button`},null,8,[`accent`]),createVNode(unref(bngInput_default),{id:`replay-filename-input`,class:`filename-input`,prefix:replayFolder,suffix:replayFileExtension,modelValue:loadedFile.value,"onUpdate:modelValue":_cache[0]||=$event=>loadedFile.value=$event,placeholder:`(no file)`,disabled:state.value===`recording`||!loadedFile.value,onKeyup:withKeys(acceptRename,[`enter`])},null,8,[`modelValue`,`disabled`])],64)):(openBlock(),createElementBlock(`div`,_hoisted_4$98,toDisplayString(replayFolder)+toDisplayString(loadedFile.value)+toDisplayString(replayFileExtension),1)),createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>renaming.value?acceptRename():startRenaming(),icon:renaming.value?`checkmark`:`edit`,accent:renaming.value?unref(ACCENTS).main:unref(ACCENTS).ghost},null,8,[`icon`,`accent`])],64)):(openBlock(),createElementBlock(`div`,_hoisted_5$85,` No File loaded `))]),createBaseVNode(`div`,_hoisted_6$70,[createVNode(unref(bngButton_default),{onClick:toggleRecording,icon:state.value===`recording`?`square`:`bigDot`,accent:unref(ACCENTS).text,disabled:state.value===`playback`,tooltip:state.value===`recording`?`Save recording`:`Record new replay`,class:`recordings-button record-button`},null,8,[`icon`,`accent`,`disabled`,`tooltip`])])],2)),createBaseVNode(`div`,_hoisted_7$60,[createBaseVNode(`div`,{class:normalizeClass([`replay-controls`,{narrow:layoutState.value.isReplayControlsNarrow}]),ref_key:`replayControlsRef`,ref:replayControlsRef},[createBaseVNode(`div`,_hoisted_8$50,[createVNode(unref(bngButton_default),{onClick:togglePlay,class:`play-button`,icon:state.value===`playback`&&!paused.value?`pause`:`play`,disabled:state.value===`recording`||!loadedFile.value,accent:unref(ACCENTS).ghost},null,8,[`icon`,`disabled`,`accent`]),state.value===`inactive`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_9$44,[createVNode(unref(bngButton_default),{class:`speed-button small`,onClick:_cache[2]||=$event=>toggleSpeed(-1),icon:`mathMinus`,disabled:!loadedFile.value,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`]),createBaseVNode(`div`,{class:normalizeClass([`playback-speed-display`,{disabled:!loadedFile.value}])},toDisplayString(speed.value.toFixed(2))+`x`,3),createVNode(unref(bngButton_default),{class:`speed-button small`,onClick:_cache[3]||=$event=>toggleSpeed(1),icon:`mathPlus`,disabled:!loadedFile.value,accent:unref(ACCENTS).text},null,8,[`disabled`,`accent`])]))]),createBaseVNode(`div`,{class:normalizeClass([`time-display`,{active:loadedFile.value,seeking:isSeeking.value}])},[createBaseVNode(`div`,_hoisted_10$37,[(openBlock(),createElementBlock(`svg`,_hoisted_11$33,[(openBlock(),createElementBlock(`svg`,_hoisted_12$26,[createBaseVNode(`g`,_hoisted_13$23,[createBaseVNode(`text`,_hoisted_14$22,toDisplayString(formatTime$1(positionSeconds.value)),1)])]))]))]),createBaseVNode(`span`,_hoisted_15$21,`(`+toDisplayString(formatTime$1(totalSeconds.value))+`)`,1)],2)],2),createBaseVNode(`div`,_hoisted_16$21,[createVNode(unref(bngSlider_default),{modelValue:positionPercent.value,"onUpdate:modelValue":_cache[4]||=$event=>positionPercent.value=$event,min:0,max:1,step:.001,onInput:seek,disabled:state.value!==`playback`||!loadedFile.value},null,8,[`modelValue`,`disabled`])])])],512))}},app_default$1=__plugin_vue_export_helper_default(_sfc_main$181,[[`__scopeId`,`data-v-bf84291a`]]),_hoisted_1$161={style:{width:`100%`,height:`100%`},class:`bng-app`,layout:`column`},_hoisted_2$133={style:{display:`flex`,"justify-content":`center`,"align-items":`baseline`}},_hoisted_3$119={style:{"font-size":`1.3em`,"font-weight":`bold`}},_hoisted_4$97={style:{color:`rgba(255, 255, 255, 0.8)`}},_hoisted_5$84={style:{"text-align":`center`,color:`rgba(255, 255, 255, 0.8)`,"font-size":`0.75em`}},_sfc_main$180={__name:`app`,setup(__props){let{$game}=useLibStore(),streamsList$1=[`engineInfo`];$game.streams.add(streamsList$1);let numToBig=ref(`1`);ref(NaN);let rpm=ref(0),leadingZeros=ref(null);onMounted(()=>{console.log(`simpleDigTacho mounted`),$game.events.on(`onStreamsUpdate`,onStreamsUpdate)}),onUnmounted(()=>{console.log(`simpleDigTacho unmounted`),$game.streams.remove(streamsList$1),$game.events.off(`onStreamsUpdate`,onStreamsUpdate)});function onStreamsUpdate(streams){for(let stream of streamsList$1)if(!streams[stream])return;if(rpm.value=Math.round(streams.engineInfo[4]),rpm.value.toString().length>4){let help=10**(rpm.value.toString().length-4);numToBig.value=help.toString(),rpm.value=Math.round(rpm.value/help)}else numToBig.value=`1`;rpm.value=rpm.value.toString().slice(-4),isNaN(rpm.value)||(leadingZeros.value=`0000`.slice(rpm.value.length))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$161,[createBaseVNode(`div`,_hoisted_2$133,[createBaseVNode(`span`,_hoisted_3$119,[createBaseVNode(`span`,_hoisted_4$97,toDisplayString(leadingZeros.value),1),createBaseVNode(`span`,null,toDisplayString(rpm.value),1)]),_cache[0]||=createBaseVNode(`span`,{style:{"font-size":`0.9em`,"font-weight":`bold`,"margin-left":`2px`}},`RPM`,-1)]),createBaseVNode(`small`,_hoisted_5$84,[createTextVNode(toDisplayString(_ctx.$t(`ui.apps.digTacho.engine`))+` `,1),createBaseVNode(`span`,null,`(x`+toDisplayString(numToBig.value)+`)`,1)])]))}},app_default$25=_sfc_main$180,_hoisted_1$160={"xmlns:svg":`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,version:`1.1`,width:`100%`,height:`100%`,viewBox:`0 0 660 660`},_hoisted_2$132={"xml:space":`preserve`,class:`text1`,x:`329.88641`,y:`289.30463`,id:`tspan4449-43`},_hoisted_3$118={"xml:space":`preserve`,id:`speed_units`,class:`speed-units`,x:`330`,y:`348`},_hoisted_4$96={"xml:space":`preserve`,id:`tspan4449-4-3`,class:`tacho2-gear`,x:`386.67343`,y:`457.94861`,transform:`matrix(1,0,-0.13142611,1,0,0)`},_hoisted_5$83={"xml:space":`preserve`,x:`330.09229`,y:`498.18045`,id:`text4447-2-4`,class:`rpm-text-legend`},_hoisted_6$69={transform:`translate(-150,-214)`,id:`revcurvemask`,class:`revcurvemask`,"clip-path":`url(#clipPath4710)`},rpmTextSize=50,maxRpmTexts=13,tickMarkLength=64,tickInnerOffset=42,_sfc_main$179={__name:`tacho`,setup(__props,{expose:__expose}){let width$1=660,height$1=660,initialized=ref(!1),dashSize$1=5,computeGaugeFullRange=maxrpm=>Math.ceil((maxrpm||0)/1e3)*1e3+1e3,computeGaugeStep=maxrpm=>maxrpm<4e3?500:maxrpm>15e3?2e3:1e3,computeGaugeMarks=maxrpm=>{let fullRange=computeGaugeFullRange(maxrpm),step=computeGaugeStep(maxrpm);return Math.ceil(fullRange/step)+1},rpmTextRefs=ref([]),setRpmRef=(el,i)=>{el&&(rpmTextRefs.value[i]=el)},oilTempBarRef=ref(null),oilTempBarLen=computed(()=>oilTempBarRef.value.getTotalLength()),oilTempIcoOffRef=ref(null),oilTempIcoOnRef=ref(null),speedTextRef=ref(null),gearTextRef=ref(null),revcurveRef=ref(null),revCurveLen=computed(()=>revcurveRef.value.getTotalLength()),revcurveDashesRef=ref(null),revCurveDashesLen=computed(()=>revcurveDashesRef.value.getTotalLength()),fuelBarRef=ref(null),fuelBarLen=computed(()=>fuelBarRef.value.getTotalLength()),fuelWarnIcoOffRef=ref(null),fuelWarnIcoOnRef=ref(null),lastFuelLevel=0,shouldPlayFuelLowSound=!1,lowFuelSoundPlayed=!1,isCareer=!1,redLineRef=ref(null),redLineLen=computed(()=>redLineRef.value.getTotalLength()),rpmTextGuideLineRef=ref(null),rpmTextGuideLineLen=computed(()=>rpmTextGuideLineRef.value.getTotalLength()),tickMarkRefs=ref([]),setTickRef=(el,i)=>{el&&(tickMarkRefs.value[i]=el)},icoHandBrakeOffRef=ref(null),icoHandBrakeOnRef=ref(null),icoABSOffRef=ref(null),icoABSOnRef=ref(null),icoIndicatorLeftOffRef=ref(null),icoIndicatorLeftOnRef=ref(null),icoIndicatorRightOffRef=ref(null),icoIndicatorRightOnRef=ref(null),icoLightsOffRef=ref(null),icoLightsOnRef=ref(null),icoLightsHighRef=ref(null),layer3Ref=ref(null),layer4Ref=ref(null),layer6Ref=ref(null),layer7Ref=ref(null),layer10Ref=ref(null),layer11Ref=ref(null),layer12Ref=ref(null),tickLayerRef=ref(null),speedUnitTextRef=ref(null),rpm_max=ref(8e3),rpmLegendTextRef=ref(null),revNeedleRef=ref(null),displayMode=ref(2);onMounted(()=>{rpmLegendTextRef?.value&&(rpmLegendTextRef.value.textContent=`x1000 RPM`),oilTempBarRef.value.style.strokeDasharray=oilTempBarLen.value+` `+oilTempBarLen.value,speedTextRef.value.textContent=``,revcurveRef.value.style.strokeDasharray=revCurveLen.value+` `+revCurveLen.value,fuelBarRef.value.style.strokeDasharray=fuelBarLen.value+` `+fuelBarLen.value,rpmTextGuideLineRef.value.style.display=`none`;for(let k=0;kisCareer=isActive)});function applyData(data$1){speedTextRef.value.textContent=data$1.speedtext,(speedTextRef.value.textContent==`-Infinity`||speedTextRef.value.textContent==`Infinity`)&&(speedTextRef.value.textContent=`-`),gearTextRef.value.textContent=data$1.geartext,fuelBarRef.value.style[`stroke-dashoffset`]=(1-data$1.fuel)*fuelBarLen.value;let fuelLow=data$1.fuel<.1,fuelGoneLow=lastFuelLevel>=.1&&fuelLow;lastFuelLevel=data$1.fuel,fuelWarnIcoOffRef.value.style.visibility=fuelLow?`hidden`:`visible`,fuelWarnIcoOnRef.value.style.visibility=fuelLow?`visible`:`hidden`,data$1.ignition&&isCareer&&fuelGoneLow&&!shouldPlayFuelLowSound&&setTimeout(()=>shouldPlayFuelLowSound=!0,0),shouldPlayFuelLowSound&&!lowFuelSoundPlayed&&(lowFuelSoundPlayed=!0,Lua_default.ui_audio.playEventSound(`bng_career_fuel`,`low_fuel`)),icoHandBrakeOffRef.value.style.visibility=data$1.parkingBrake?`hidden`:`visible`,icoHandBrakeOnRef.value.style.visibility=data$1.parkingBrake?`visible`:`hidden`,icoABSOffRef.value.style.visibility=data$1.absWorking?`hidden`:`visible`,icoABSOnRef.value.style.visibility=data$1.absWorking?`visible`:`hidden`,icoIndicatorLeftOffRef.value.style.visibility=data$1.signalL?`hidden`:`visible`,icoIndicatorLeftOnRef.value.style.visibility=data$1.signalL?`visible`:`hidden`,icoIndicatorRightOffRef.value.style.visibility=data$1.signalR?`hidden`:`visible`,icoIndicatorRightOnRef.value.style.visibility=data$1.signalR?`visible`:`hidden`;let tempNormalized=Math.max(Math.min((data$1.waterTemp-50)/80,1),0);oilTempBarRef.value.style.strokeDashoffset=(1+tempNormalized)*oilTempBarLen.value;let oilTemp_warn=tempNormalized>.8125;if(oilTempIcoOffRef.value.style.visibility=oilTemp_warn?`hidden`:`visible`,oilTempIcoOnRef.value.style.visibility=oilTemp_warn?`visible`:`hidden`,data$1.lowBeam!==void 0&&data$1.highBeam!==void 0){let nb=!0,lb=data$1.lowBeam>.9,hb=data$1.highBeam>.9;lb&&(nb=!1),hb&&(nb=!1),icoLightsOffRef.value.style.visibility=nb?`visible`:`hidden`,icoLightsOnRef.value.style.visibility=lb?`visible`:`hidden`,icoLightsHighRef.value.style.visibility=hb?`visible`:`hidden`}else icoLightsOffRef.value.style.visibility=`hidden`,icoLightsOnRef.value.style.visibility=`hidden`,icoLightsHighRef.value.style.visibility=`hidden`;let rpm_rotation=data$1.rpm*270-180;rpm_rotation<-180&&(rpm_rotation=-180),rpm_rotation>90&&(rpm_rotation=90),revNeedleRef.value.setAttribute(`transform`,`rotate(`+rpm_rotation+`,330,330)`);let revCurveOffset=(1-data$1.rpm)*revCurveLen.value;revCurveOffset<0&&(revCurveOffset=0),revCurveOffset>revCurveLen.value&&(revCurveOffset=revCurveLen.value),revcurveRef.value.style.strokeDashoffset=revCurveOffset}let data=ref({}),layersVisible=!1;function setlayersVisible(v){if(layersVisible!=v){let val=v?`inline`:`none`;layer3Ref.value.style.display=val,layer4Ref.value.style.display=val,layer6Ref.value.style.display=val,layer7Ref.value.style.display=val,layer10Ref.value.style.display=val,layer11Ref.value.style.display=val,layer12Ref.value.style.display=val,tickLayerRef.value.style.display=val,layersVisible=v}}function reset$1(){setlayersVisible(!1),initialized.value=!1;for(let k=0;k=0?1:-1,inx=nx*sign,iny=ny*sign,x1=pt.x+inx*tickInnerOffset,y1=pt.y+iny*tickInnerOffset,x2=x1+inx*tickMarkLength,y2=y1+iny*tickMarkLength;line.setAttribute(`x1`,x1),line.setAttribute(`y1`,y1),line.setAttribute(`x2`,x2),line.setAttribute(`y2`,y2),line.style.visibility=`visible`}}for(let k=dashCount$1+1;k<=maxRpmTexts;k++){let rp=rpmTextRefs.value[k];rp&&(rp.style.visibility=`hidden`);let line=tickMarkRefs.value[k];line&&(line.style.visibility=`hidden`)}initialized.value=!0}if(!isStreamValid)return!1;if(setlayersVisible(!0),displayMode.value==2)streams.electrics.wheelspeed?(data.speedtext=UnitSpeed(streams.electrics.wheelspeed),streams.electrics.wheelspeed>9e3&&(speedUnitTextRef.value.textContent=`brrrr`)):streams.electrics.airspeed&&(data.speedtext=UnitSpeed(streams.electrics.airspeed)),(function(){if(streams.engineInfo[13]==`manual`){let gear=streams.engineInfo[5],gearStr=gear.toString();gear==0?gearStr=`N`:gear==-1?gearStr=`R`:-gear>1&&(gearStr=`R`+-gear),data.geartext=gearStr}else data.geartext=[`P`,`R`,`N`,`D`,`2`,`1`][Math.round(streams.electrics.gear_A*5)]})(),data.fuel=streams.engineInfo[11]/streams.engineInfo[12],data.parkingBrake=streams.electrics.parkingbrake,data.absWorking=streams.electrics.abs,data.signalL=streams.electrics.signal_L,data.signalR=streams.electrics.signal_R,data.waterTemp=streams.electrics.watertemp,data.lowBeam=streams.electrics.lowbeam,data.highBeam=streams.electrics.highbeam,data.rpm=(streams.electrics.rpmTacho||0)/rpm_max.value;else if(displayMode.value==0){testVar+=.04,testVar>1&&(testVar=1),data.speedtext=Math.round(testVar*100),data.geartext=Math.round(testVar*5),data.fuel=testVar;let boolTest=!0;data.parkingBrake=!0,data.absWorking=!0,data.signalL=!0,data.signalR=!0,data.oilTemp=testVar,data.lowBeam=!0,data.highBeam=!1,data.rpm=testVar,testVar>=1&&(testVar=0,displayMode.value=1)}else if(displayMode.value==1){streams.electrics.wheelspeed?data.speedtext=UnitSpeed(streams.electrics.wheelspeed):(data.speedtext=``,speedUnitTextRef.value.textContent=``),(function(){let gear=streams.engineInfo[5],gearStr=gear.toString();gear==0?gearStr=`N`:gear==-1&&(gearStr=`R`),data.geartext=gearStr})(),data.parkingBrake=streams.electrics.parkingbrake,data.absWorking=streams.electrics.abs,data.signalL=streams.electrics.signal_L,data.signalR=streams.electrics.signal_R,data.lowBeam=streams.electrics.lowbeam,data.highBeam=streams.electrics.highbeam;let oilok=Math.abs(data.oilTemp-streams.electrics.oiltemp)<.005;oilok||(data.oilTemp+=(streams.electrics.oiltemp-data.oilTemp)*.2);let rpmperc=streams.electrics.rpm/rpm_max.value,rpmok=Math.abs(data.rpm-rpmperc)<.005;rpmok||(data.rpm+=(rpmperc-data.rpm)*.2);let fuelperc=streams.engineInfo[11]/streams.engineInfo[12],fuelok=Math.abs(data.fuel-fuelperc)<.005;fuelok||(data.fuel+=(fuelperc-data.fuel)*.2),oilok&&rpmok&&fuelok&&(displayMode.value=2)}return data.engineRunning=streams.electrics.engineRunning,data.ignition=streams.electrics.ignition,applyData(data),!0}function vehicleChanged(){initialized.value=!1}let UiUnitscallback=ref(()=>null);function UnitSpeed(val){let convertedVal=UiUnitscallback.value(val,`speed`);return speedUnitTextRef.value.textContent=convertedVal.unit,Math.round(convertedVal.val)}function wireThroughUnitSystem(callback){UiUnitscallback.value=callback}return __expose({wireThroughUnitSystem,update:update$6,vehicleChanged}),(_ctx,_cache)=>(openBlock(),createElementBlock(`svg`,_hoisted_1$160,[_cache[17]||=createBaseVNode(`defs`,{id:`defs4`},[createBaseVNode(`linearGradient`,{id:`linearGradient3938`},[createBaseVNode(`stop`,{style:{"stop-color":`#ff0000`,"stop-opacity":`1`},offset:`0`,id:`stop3940`}),createBaseVNode(`stop`,{style:{"stop-color":`#00ff4b`,"stop-opacity":`1`},offset:`1`,id:`stop3942`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4607`},[createBaseVNode(`stop`,{id:`stop4609`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.89960396`,id:`stop4611`}),createBaseVNode(`stop`,{id:`stop4613`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4615`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4597`},[createBaseVNode(`stop`,{id:`stop4599`,offset:`0`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0.99812102`,id:`stop4601`}),createBaseVNode(`stop`,{id:`stop4603`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{id:`stop4605`,offset:`1`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}})]),createBaseVNode(`linearGradient`,{id:`linearGradient4545`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547`}),createBaseVNode(`stop`,{id:`stop4553`,offset:`0.9861111`,style:{"stop-color":`#e40000`,"stop-opacity":`1`}}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4555`}),createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`0`},offset:`1`,id:`stop4549`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4256`},[createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`1`},offset:`0`,id:`stop4258`}),createBaseVNode(`stop`,{style:{"stop-color":`#6d0000`,"stop-opacity":`0`},offset:`1`,id:`stop4260`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4365`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367`}),createBaseVNode(`stop`,{id:`stop4373`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369`})]),createBaseVNode(`linearGradient`,{id:`linearGradient4357`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`1`},offset:`0`,id:`stop4359`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.19642857`},offset:`1`,id:`stop4361`})]),createBaseVNode(`marker`,{style:{overflow:`visible`},id:`DistanceStart`,refX:`0`,refY:`0`,orient:`auto`},[createBaseVNode(`g`,{id:`g2300`},[createBaseVNode(`path`,{style:{fill:`none`,stroke:`#ffffff`,"stroke-width":`1.14999998`,"stroke-linecap":`square`},d:`M 0,0 2,0`,id:`path2306`}),createBaseVNode(`path`,{style:{fill:`#000000`,"fill-rule":`evenodd`,stroke:`none`},d:`M 0,0 13,4 9,0 13,-4 0,0 z`,id:`path2302`}),createBaseVNode(`path`,{style:{fill:`none`,stroke:`#000000`,"stroke-width":`1`,"stroke-linecap":`square`},d:`M 0,-4 0,40`,id:`path2304`})])]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4365`,id:`radialGradient4371`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407`},[createBaseVNode(`path`,{id:`path4409`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-9`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-8`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-3`},[createBaseVNode(`path`,{id:`path4409-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.37015162,0,0,0.37015162,685.90181,-270.76027)`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"xlink:href":`#linearGradient4256`,id:`linearGradient4433`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4321-4`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.28024,0 -40.11069,1.89279 -59.34375,5.5 l 12.0625,58.8125 C 448.05208,285.49499 463.85489,284 480,284 c 35.52728,0 69.40254,7.13112 100.25,20.03125 l 24.1875,-54.9375 C 566.18747,232.93508 524.13347,224 480,224 z m -69.0625,7.5 c -59.26533,13.0371 -112.35258,42.49901 -154.28125,83.375 l 42.53125,42.3125 c 24.37935,-23.60266 53.35266,-42.49216 85.46875,-55.15625 1.96795,-0.77601 3.94641,-1.52096 5.9375,-2.25 10.51172,-3.84886 21.33856,-7.01901 32.4375,-9.5 L 410.9375,231.5 z M 613.5,253.125 589.3125,308.03125 c 44.07702,20.45389 81.43119,52.91567 107.9375,93.15625 l 50.875,-31.875 C 715.25578,318.96815 668.59379,278.45303 613.5,253.125 z m -363.8125,68.75 c -41.23795,42.75016 -70.70543,96.92973 -83.125,157.34375 l 59.03125,11.0625 c 10.15322,-48.33557 33.70357,-91.7229 66.625,-126.09375 L 249.6875,321.875 z m 503.78125,55.8125 -50.90625,31.84375 C 726.31882,448.76688 740,494.78478 740,544 l 60,0 c 0,-60.90677 -16.99384,-117.84887 -46.53125,-166.3125 z m -588.75,111.25 C 161.61652,506.82573 160,525.2248 160,544 c 0,42.78463 8.42108,83.60181 23.65625,120.90625 L 238.84375,641.375 C 226.69144,611.30216 220,578.42944 220,544 c 0,-2.24366 0.0373,-4.48871 0.0937,-6.71875 0.3211,-12.67426 1.55282,-25.12039 3.625,-37.28125 l -59,-11.0625 z M 242.75,650.5 187.53125,674 c 23.4008,52.56805 60.5346,97.67196 106.875,130.71875 l 34.0625,-49.4375 C 291.42063,728.66516 261.6562,692.55546 242.75,650.5 z m 93.875,110.40625 -34.03125,49.40625 C 353.37348,844.20872 414.36502,864 480,864 l 0,-60 c -33.65485,0 -65.82451,-6.39115 -95.34375,-18.03125 -1.96795,-0.77601 -3.93088,-1.58396 -5.875,-2.40625 -14.80462,-6.26183 -28.90394,-13.88046 -42.15625,-22.65625 z`,id:`path4323-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357`,id:`radialGradient4363-5`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-6`},[createBaseVNode(`path`,{id:`path4409-1`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{gradientTransform:`matrix(0.36968813,0,0,0.36968813,1026.9451,-270.68256)`,"xlink:href":`#linearGradient4365`,id:`radialGradient4371-49`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"xlink:href":`#linearGradient4256`,id:`linearGradient4746`,gradientUnits:`userSpaceOnUse`,x1:`569.20557`,y1:`424.29861`,x2:`890.55139`,y2:`424.29861`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3921`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3923`,d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath3925-1`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3927-7`,d:`m 330,10 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 296.74495,71.61583 313.18224,70 330,70 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 417.49749,19.23259 374.82925,10 330,10 z m -67.13867,7.07812 C 202.16219,30.03925 147.84399,60.20471 105.25195,102.23633 l 42.54297,42.3125 C 182.22028,110.72238 226.01669,86.41327 274.9375,75.86328 L 262.86133,17.07812 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 565.93577,105.29347 518.20331,63.82636 461.72461,38.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 575.92383,233.46544 590,280.08649 590,330 l 60,0 C 650,268.39079 632.57195,210.85952 602.40234,162.03516 z M 15.06055,273.02148 C 11.7373,291.51211 10,310.55271 10,330 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 76.98058,398.61583 70,365.12541 70,330 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 L 15.06055,273.02148 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 141.73258,515.3212 111.08736,478.12046 91.96094,434.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 202.04051,629.81227 263.66249,650 330,650 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545`,id:`linearGradient4551`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4545-2`,id:`linearGradient4551-8`,x1:`480`,y1:`214`,x2:`480`,y2:`474`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4545-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#e40000`,"stop-opacity":`1`},offset:`0`,id:`stop4547-4`}),createBaseVNode(`stop`,{id:`stop4553-5`,offset:`0.99000001`,style:{"stop-color":`#e40000`,"stop-opacity":`0`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4555-5`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4549-1`})]),createBaseVNode(`linearGradient`,{y2:`282.59341`,x2:`474.60886`,y1:`211.1199`,x1:`480`,gradientUnits:`userSpaceOnUse`,id:`linearGradient4574`,"xlink:href":`#linearGradient4607`,"inkscape:collect":`always`,gradientTransform:`matrix(1,0,0,0.9882541,0,10.359887)`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4036-1`},[createBaseVNode(`path`,{style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`5`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`},d:`m 480,224 c -20.95323,0 -41.43416,2.01857 -61.26367,5.86328 l 12.08008,58.80274 C 446.74495,285.61583 463.18224,284 480,284 c 36.22419,0 70.7135,7.41519 102.04492,20.79883 l 24.1836,-54.92188 C 567.49749,233.23259 524.82925,224 480,224 z m -67.13867,7.07812 c -60.69914,12.96113 -115.01734,43.12659 -157.60938,85.15821 l 42.54297,42.3125 c 34.42536,-33.82645 78.22177,-58.13556 127.14258,-68.68555 l -12.07617,-58.78516 z m 198.86328,21.20508 -24.1875,54.9336 c 45.44422,20.67199 83.88358,54.04459 110.80078,95.58008 l 50.87305,-31.84376 C 715.93577,319.29347 668.20331,277.82636 611.72461,252.2832 z m -360.70117,68.21094 c -42.37565,43.40627 -72.5223,98.80082 -84.8418,160.63281 l 58.99024,11.05664 c 10.06229,-49.7524 34.33605,-94.34359 68.39257,-129.3789 l -42.54101,-42.31055 z m 501.3789,55.54102 -50.86132,31.83398 C 725.92383,447.46544 740,494.08649 740,544 l 60,0 C 800,482.39079 782.57195,424.85952 752.40234,376.03516 z M 165.06055,487.02148 C 161.7373,505.51211 160,524.55271 160,544 c 0,43.47625 8.68492,84.91949 24.39062,122.71094 l 55.21485,-23.5293 C 226.98058,612.61583 220,579.12541 220,544 c 0,-15.6701 1.38639,-31.01527 4.04297,-45.92188 l -58.98242,-11.05664 z m 76.90039,161.67774 -55.20899,23.52734 c 23.61428,53.92719 61.65397,100.09134 109.25586,133.60352 l 34.03516,-49.41406 C 291.73258,729.3212 261.08736,692.12046 241.96094,648.69922 z m 93.01953,111.12695 -34.04102,49.42188 C 352.04051,843.81227 413.66249,864 480,864 l 0,-60 c -53.69777,0 -103.59151,-16.28243 -145.01953,-44.17383 z`,id:`path4038-7`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0`,id:`radialGradient4363-4`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8`},[createBaseVNode(`path`,{id:`path4409-8`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4365-4`,id:`radialGradient4371-2`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5`}),createBaseVNode(`stop`,{id:`stop4373-5`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997`,"xlink:href":`#linearGradient4365-4`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4363-4-1`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4001`,"xlink:href":`#linearGradient4357-0-7`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4040`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4045`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7-2`,id:`radialGradient4045-8`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-7-2`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-4-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-0-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-758.53125,-231)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4063`,"xlink:href":`#linearGradient4357-0-7-2`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-7`,id:`radialGradient4082`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-885,-231)`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`}),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-8`,id:`radialGradient4363-4-9`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4031-1`,"xlink:href":`#linearGradient4357-0-8-5`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-8-5`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.51785713`},offset:`0`,id:`stop4359-9-40-4`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.11607143`},offset:`1`,id:`stop4361-4-7-2`})]),createBaseVNode(`radialGradient`,{"inkscape:collect":`always`,"xlink:href":`#linearGradient4357-0-3`,id:`radialGradient4363-4-0`,cx:`480`,cy:`544`,fx:`480`,fy:`544`,r:`320`,gradientUnits:`userSpaceOnUse`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`}),createBaseVNode(`linearGradient`,{id:`linearGradient4357-0-3`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.65178573`},offset:`0`,id:`stop4359-9-8`}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.24107143`},offset:`1`,id:`stop4361-4-01`})]),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4407-8-2`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4409-8-5`,d:`m 480,-103.33 c -357.5105,0 -647.33,289.8195 -647.33,647.33 0,357.5105 289.8195,647.33 647.33,647.33 357.5105,0 647.33,-289.8195 647.33,-647.33 0,-357.5105 -289.8195,-647.33 -647.33,-647.33 z m 0,453.131 c 107.25316,0 194.199,86.94584 194.199,194.199 0,107.25316 -86.94584,194.199 -194.199,194.199 -107.25316,0 -194.199,-86.94584 -194.199,-194.199 0,-107.25316 86.94584,-194.199 194.199,-194.199 z`,style:{color:`#000000`,fill:`#ffffff`,"fill-opacity":`0.61375661`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`16`,marker:`none`,visibility:`visible`,display:`inline`,overflow:`visible`,"enable-background":`accumulate`}})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientTransform:`matrix(1.03125,0,0,1.03125,-15,-17)`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4401`,"xlink:href":`#linearGradient4357-0-3`,"inkscape:collect":`always`}),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient3997-4`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`linearGradient`,{id:`linearGradient4365-4-7`},[createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0.42857143`},offset:`0`,id:`stop4367-5-8`}),createBaseVNode(`stop`,{id:`stop4373-5-3`,offset:`0.5`,style:{"stop-color":`#000000`,"stop-opacity":`0.33035713`}}),createBaseVNode(`stop`,{style:{"stop-color":`#000000`,"stop-opacity":`0`},offset:`1`,id:`stop4369-1-5`})]),createBaseVNode(`radialGradient`,{r:`320`,fy:`544`,fx:`480`,cy:`544`,cx:`480`,gradientUnits:`userSpaceOnUse`,id:`radialGradient4458`,"xlink:href":`#linearGradient4365-4-7`,"inkscape:collect":`always`}),createBaseVNode(`clipPath`,{clipPathUnits:`userSpaceOnUse`,id:`clipPath4710`},[createBaseVNode(`path`,{style:{color:`#000000`,"font-style":`normal`,"font-variant":`normal`,"font-weight":`normal`,"font-stretch":`normal`,"font-size":`medium`,"line-height":`normal`,"font-family":`sans-serif`,"text-indent":`0`,"text-align":`start`,"text-decoration":`none`,"text-decoration-line":`none`,"text-decoration-style":`solid`,"text-decoration-color":`#000000`,"letter-spacing":`normal`,"word-spacing":`normal`,"text-transform":`none`,direction:`ltr`,"block-progression":`tb`,"writing-mode":`lr-tb`,"baseline-shift":`baseline`,"text-anchor":`start`,"white-space":`normal`,"clip-rule":`nonzero`,display:`inline`,overflow:`visible`,visibility:`visible`,opacity:`1`,isolation:`auto`,"mix-blend-mode":`normal`,"color-interpolation":`sRGB`,"color-interpolation-filters":`linearRGB`,"solid-color":`#000000`,"solid-opacity":`1`,fill:`#000000`,"fill-opacity":`1`,"fill-rule":`nonzero`,stroke:`none`,"stroke-width":`66.66205597`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-miterlimit":`0.40000001`,"stroke-dasharray":`none`,"stroke-dashoffset":`0`,"stroke-opacity":`1`,"color-rendering":`auto`,"image-rendering":`auto`,"shape-rendering":`auto`,"text-rendering":`auto`,"enable-background":`accumulate`},d:`m 480,224 c -176.33633,0 -320,143.66367 -320,320 0,176.33633 143.66368,320 320,320 l 0,-66.66211 C 339.69052,797.33789 226.66211,684.30947 226.66211,544 226.66211,403.69051 339.69051,290.66211 480,290.66211 620.30948,290.66211 733.33789,403.69052 733.33789,544 L 800,544 C 800,367.66368 656.33632,224 480,224 Z`,id:`path4712`,"inkscape:connector-curvature":`0`})])],-1),createBaseVNode(`g`,{ref_key:`layer6Ref`,ref:layer6Ref,id:`layer6`,class:`layer6`},[_cache[1]||=createBaseVNode(`circle`,{transform:`translate(-150,-214)`,id:`path4281-5`,class:`circle1`,cx:`480`,cy:`544`,r:`320`,d:`M 800,544 C 800,720.73112 656.73112,864 480,864 303.26888,864 160,720.73112 160,544 160,367.26888 303.26888,224 480,224 c 176.73112,0 320,143.26888 320,320 z`},null,-1),_cache[2]||=createBaseVNode(`path`,{transform:`translate(-150,-214)`,id:`path4281`,class:`path1`,d:`M 480,214 C 297.74603,214 150,361.74603 150,544 150,726.25397 297.74603,874 480,874 662.25397,874 810,726.25397 810,544 810,361.74603 662.25397,214 480,214 z`,"clip-path":`url(#clipPath4407-8)`},null,-1),createBaseVNode(`text`,_hoisted_2$132,[createBaseVNode(`tspan`,{ref_key:`speedTextRef`,ref:speedTextRef,id:`tacho2speed`,class:`tacho2-speed`,x:`329.88641`,y:`289.30463`},`0`,512)]),createBaseVNode(`text`,_hoisted_3$118,[createBaseVNode(`tspan`,{ref_key:`speedUnitTextRef`,ref:speedUnitTextRef,id:`speedunit`,x:`330`,y:`348`},`mph`,512)]),createBaseVNode(`text`,_hoisted_4$96,[createBaseVNode(`tspan`,{ref_key:`gearTextRef`,ref:gearTextRef,id:`tacho2gear`,class:`text`,x:`386.67343`,y:`457.94861`},`4`,512)]),(openBlock(),createElementBlock(Fragment,null,renderList(maxRpmTexts,k=>createBaseVNode(`text`,{ref_for:!0,ref:el=>setRpmRef(el,k),"xml:space":`preserve`,x:`0`,y:`0`,class:`rpm-text`},[..._cache[0]||=[createBaseVNode(`tspan`,{x:`0`,y:`0`},null,-1)]],512)),64)),createBaseVNode(`text`,_hoisted_5$83,[createBaseVNode(`tspan`,{ref_key:`rpmLegendTextRef`,ref:rpmLegendTextRef,id:`tspan4449-3-1`,x:`330.09229`,y:`498.18045`},`x1000 RPM`,512)]),_cache[3]||=createBaseVNode(`path`,{"clip-path":`none`,id:`path4258`,class:`path-oil-fuel`,d:`M 462.44226,446.99523 C 489.99031,415.832 506.71155,374.86426 506.71155,330 c 0,-44.86426 -16.72124,-85.832 -44.26929,-116.99523 m -264.88452,0 C 170.00969,244.168 153.28845,285.13574 153.28845,330 c 0,44.86426 16.72124,85.832 44.26929,116.99523`},null,-1),createBaseVNode(`path`,{ref_key:`fuelBarRef`,ref:fuelBarRef,id:`fuel`,class:`fuel-bar`,d:`M 462.44226,446.99523 C 489.99031,415.832 506.71155,374.86426 506.71155,330 c 0,-44.86426 -16.72124,-85.832 -44.26929,-116.99523`},null,512),createBaseVNode(`path`,{ref_key:`oilTempBarRef`,ref:oilTempBarRef,id:`temp`,class:`oil-temp-bar`,d:`M 197.55774,213.00477 C 170.00969,244.168 153.28845,285.13574 153.28845,330 c 0,44.86426 16.72124,85.832 44.26929,116.99523`},null,512)],512),createBaseVNode(`g`,{ref_key:`layer3Ref`,ref:layer3Ref,id:`layer3`,class:`layer3`},[createBaseVNode(`g`,_hoisted_6$69,[_cache[4]||=createBaseVNode(`rect`,{y:`203.90677`,x:`141.28131`,height:`683.79401`,width:`683.79401`,id:`rect4001`,class:`layer3-rect`},null,-1),createBaseVNode(`path`,{ref_key:`revcurveRef`,ref:revcurveRef,class:`revcurve`,id:`revcurve`,"clip-path":`none`,d:`M 330,690 C 131.17749,690 -30,528.82251 -30,330 -30,131.17749 131.17749,-30 330,-30 c 198.82251,0 360,161.17749 360,360`,transform:`matrix(0.80555556,0,0,0.80555556,214.16667,278.16667)`},null,512),createBaseVNode(`path`,{ref_key:`redLineRef`,ref:redLineRef,class:`redline`,id:`rpm_redline`,d:`M 330,610 C 175.36027,610 50,484.63973 50,330 50,175.36027 175.36027,50 330,50 484.63973,50 610,175.36027 610,330`,transform:`matrix(1.038252,0,0,1.038252,137.37687,201.37687)`},null,512)])],512),createBaseVNode(`g`,{ref_key:`layer11Ref`,ref:layer11Ref,id:`layer11`,class:`layer11`},[createBaseVNode(`path`,{ref_key:`revcurveDashesRef`,ref:revcurveDashesRef,id:`revcurve_dashes`,class:`revcurve-dashes`,d:`M 330,616.66897 C 171.6771,616.66897 43.331027,488.3229 43.331027,330 43.331026,171.67709 171.67709,43.33103 330,43.331031 488.3229,43.331031 616.66897,171.6771 616.66897,330`},null,512),createBaseVNode(`path`,{ref_key:`rpmTextGuideLineRef`,ref:rpmTextGuideLineRef,id:`rpmtextline`,class:`rpm-textline`,d:`M 329,550 C 204.73594,550 104,449.26406 104,325 104,200.73593 204.73593,100 329,100 c 124.26406,0 225,100.73594 225,225`},null,512)],512),_cache[18]||=createBaseVNode(`g`,{id:`layer2`,style:{display:`none`}},[createBaseVNode(`g`,{style:{display:`inline`},id:`ico_handbrake_12343525ron`,transform:`translate(-4.2182737e-6,-2.0000051)`},[createBaseVNode(`path`,{transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,style:{display:`inline`,fill:`#ff7900`,"fill-opacity":`1`,stroke:`#ffffff`,"stroke-width":`12`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 631.44636,979.59082 a 65.760933,65.760933 0 0 1 -65.76094,65.76098 65.760933,65.760933 0 0 1 -65.76093,-65.76098 65.760933,65.760933 0 0 1 65.76093,-65.76093 65.760933,65.760933 0 0 1 65.76094,65.76093 z`,id:`path4551-2-7`}),createBaseVNode(`path`,{"sodipodi:nodetypes":`csc`,id:`path4551-7-7-3`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`,style:{display:`inline`,fill:`none`,stroke:`#ffffff`,"stroke-width":`5.26201868`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":`4`,"stroke-opacity":`1`}}),createBaseVNode(`path`,{"sodipodi:nodetypes":`csc`,id:`path4551-7-4-7-72`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`,style:{display:`inline`,fill:`none`,stroke:`#ffffff`,"stroke-width":`5.26201868`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":`4`,"stroke-opacity":`1`}}),createBaseVNode(`g`,{id:`flowRoot5902-7-4`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`55px`,"line-height":`125%`,"font-family":`'Open Sans'`,"-inkscape-font-specification":`'Open Sans Bold'`,"letter-spacing":`-3.45999861px`,"word-spacing":`0px`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,259.17408,95.334998)`},[createBaseVNode(`path`,{id:`path3978-3-5`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 548.35205,1001.1788 -2.84668,-9.34567 -14.31396,0 -2.84668,9.34567 -8.96973,0 13.85742,-39.4238 10.17822,0 13.91114,39.4238 z m -4.83398,-16.32809 c -2.63186,-8.4684 -4.11339,-13.25762 -4.44458,-14.36768 -0.33124,-1.10999 -0.56846,-1.98727 -0.71167,-2.63183 -0.59084,2.29169 -2.28274,7.95819 -5.07569,16.99951 z`}),createBaseVNode(`path`,{id:`path3980-3-4`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 558.77633,961.91614 12.21924,0 c 5.56801,4e-5 9.60975,0.79227 12.12524,2.37671 2.51543,1.5845 3.77316,4.10444 3.77319,7.55981 -3e-5,2.3454 -0.55056,4.27004 -1.65161,5.77393 -1.1011,1.50392 -2.56472,2.40806 -4.39087,2.7124 l 0,0.26855 c 2.48858,0.55504 4.28342,1.59345 5.38453,3.11524 1.10104,1.52182 1.65157,3.54493 1.65161,6.06933 -4e-5,3.58074 -1.29357,6.37371 -3.88062,8.37891 -2.5871,2.00518 -6.10069,3.00778 -10.54077,3.00778 l -14.68994,0 z m 8.32519,15.54931 4.83399,0 c 2.25584,3e-5 3.88954,-0.34909 4.90112,-1.04736 1.01153,-0.69822 1.51731,-1.853 1.51734,-3.46436 -3e-5,-1.50387 -0.55057,-2.58257 -1.65162,-3.23608 -1.10109,-0.65345 -2.84222,-0.98019 -5.22338,-0.98022 l -4.37745,0 z m 0,6.60645 0,10.23193 5.42481,0 c 2.29164,1e-5 3.98354,-0.43863 5.07568,-1.31592 1.0921,-0.87727 1.63816,-2.22004 1.63819,-4.02832 -3e-5,-3.25844 -2.3275,-4.88767 -6.98243,-4.88769 z`}),createBaseVNode(`path`,{id:`path3982-5-4`,style:{"-inkscape-font-specification":`'Open Sans Bold'`},d:`m 615.44572,990.27551 c -2e-5,3.54493 -1.27566,6.3379 -3.8269,8.37891 -2.55129,2.04098 -6.10069,3.06148 -10.64819,3.06148 -4.18947,0 -7.89552,-0.7877 -11.11817,-2.36324 l 0,-7.73437 c 2.64974,1.18164 4.89217,2.01416 6.7273,2.49755 1.83511,0.48341 3.51358,0.72511 5.0354,0.7251 1.82615,10e-6 3.22711,-0.34911 4.20288,-1.04736 0.97573,-0.69824 1.4636,-1.73665 1.46362,-3.11524 -2e-5,-0.76984 -0.21486,-1.45466 -0.64453,-2.05444 -0.42971,-0.59976 -1.06081,-1.17715 -1.89331,-1.73218 -0.83254,-0.555 -2.5289,-1.44123 -5.08911,-2.65869 -2.3991,-1.12791 -4.19841,-2.21108 -5.39795,-3.24951 -1.19955,-1.03839 -2.15739,-2.24689 -2.87354,-3.62549 -0.71614,-1.37855 -1.07422,-2.98988 -1.07421,-4.83398 -10e-6,-3.47328 1.17716,-6.20358 3.53149,-8.19092 2.35432,-1.98727 5.6083,-2.98092 9.76196,-2.98096 2.041,4e-5 3.98802,0.24174 5.84107,0.7251 1.853,0.48344 3.79107,1.16377 5.81421,2.04102 l -2.68555,6.47216 c -2.09475,-0.85934 -3.82693,-1.45911 -5.19653,-1.79931 -1.36965,-0.34014 -2.7169,-0.51022 -4.04175,-0.51026 -1.57554,4e-5 -2.78403,0.36706 -3.62549,1.10108 -0.84148,0.73408 -1.26222,1.69192 -1.26221,2.87353 -10e-6,0.73408 0.17008,1.37413 0.51026,1.92017 0.34015,0.54609 0.88174,1.07424 1.62475,1.58447 0.74299,0.51028 2.50202,1.42784 5.2771,2.75269 3.67023,1.75457 6.18569,3.51361 7.54639,5.2771 1.36065,1.76352 2.04099,3.92538 2.04101,6.48559 z`})]),createBaseVNode(`g`,{id:`flowRoot5902-7-5`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`55px`,"line-height":`125%`,"font-family":`'Open Sans'`,"-inkscape-font-specification":`'Open Sans Bold'`,"letter-spacing":`-3.45999861px`,"word-spacing":`0px`,display:`inline`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`},transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,317.47869,20.439182)`},[createBaseVNode(`g`,{transform:`matrix(0.99999322,0.00368229,-0.00368229,0.99999322,0,0)`,style:{"font-style":`normal`,"font-weight":`normal`,"font-size":`94.63018036px`,"line-height":`125%`,"font-family":`sans-serif`,"letter-spacing":`0px`,"word-spacing":`0px`,fill:`#ffffff`,"fill-opacity":`1`,stroke:`none`,"stroke-width":`1px`,"stroke-linecap":`butt`,"stroke-linejoin":`miter`,"stroke-opacity":`1`},id:`text4455`},[createBaseVNode(`path`,{d:`m 607.02483,962.46092 q 0,4.62062 -1.61722,9.05641 -1.61721,4.38958 -4.62061,7.39298 -4.11235,4.06614 -9.19502,6.14542 -5.03647,2.07927 -12.56807,2.07927 l -11.04327,0 0,22.41 -17.74316,0 0,-68.80096 29.20228,0 q 6.56127,0 11.04327,1.15515 4.5282,1.10895 7.99366,3.37305 4.15856,2.72616 6.33024,6.97713 2.2179,4.25096 2.2179,10.21155 z m -18.34384,0.41586 q 0,-2.91099 -1.57101,-4.99026 -1.57101,-2.12549 -3.65028,-2.9572 -2.77237,-1.10895 -5.40612,-1.20136 -2.63375,-0.13862 -7.02334,-0.13862 l -3.0496,0 0,20.60794 5.08267,0 q 4.52821,0 7.43919,-0.55447 2.9572,-0.55447 4.94406,-2.21789 1.70963,-1.4786 2.44893,-3.51167 0.7855,-2.07928 0.7855,-5.03647 z`,style:{"font-style":`normal`,"font-variant":`normal`,"font-weight":`bold`,"font-stretch":`normal`,"font-size":`94.63018036px`,"line-height":`125%`,"font-family":`'Open Sans Extrabold'`,"-inkscape-font-specification":`'Open Sans Extrabold, Bold'`,"text-align":`start`,"writing-mode":`lr-tb`,"text-anchor":`start`,fill:`#ffffff`,"fill-opacity":`1`},id:`path4527`,"inkscape:connector-curvature":`0`})]),createBaseVNode(`path`,{transform:`matrix(0.99999322,0.00368229,-0.00368229,0.99999322,0,0)`,style:{fill:`none`,"fill-opacity":`1`,stroke:`#000000`,"stroke-width":`5.69782162`,"stroke-miterlimit":`4`,"stroke-dasharray":`none`,"stroke-opacity":`1`},d:`m 28.554777,1230.2663 c -137.847287,0 -270.048717,-54.7596 -367.521467,-152.2324 -97.47276,-97.47273 -152.23238,-229.67416 -152.23238,-367.52145 0,-137.84729 54.75963,-270.04871 152.23238,-367.52146 97.47275,-97.47276 229.67418,-152.23238 367.521467,-152.23238 137.847293,0 270.048713,54.75962 367.521463,152.23238 97.47275,97.47275 152.23238,229.67417 152.23238,367.52146 0,137.84729 -54.75962,270.04871 -152.23238,367.52145 -97.47275,97.4728 -229.67417,152.2324 -367.521463,152.2324`,id:`text_path`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`csssssssc`,"inkscape:label":`#path4459`})])])],-1),createBaseVNode(`g`,{ref_key:`layer7Ref`,ref:layer7Ref,"inkscape:groupmode":`layer`,id:`layer7`,class:`layer7`,"inkscape:label":`new2`},[createBaseVNode(`g`,{ref_key:`revNeedleRef`,ref:revNeedleRef,id:`revneedle`,"inkscape:label":`#g4147`},[..._cache[5]||=[createBaseVNode(`rect`,{y:`7`,x:`322.44037`,height:`72`,width:`12`,id:`rect4625`,class:`rev-needle-rect`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer4Ref`,ref:layer4Ref,"inkscape:groupmode":`layer`,id:`layer4`,class:`layer4`,"inkscape:label":`Icons bottom right`},[createBaseVNode(`path`,{ref_key:`icoIndicatorLeftOffRef`,ref:icoIndicatorLeftOffRef,id:`ico_indicatorl`,class:`ico-indicator-l`,d:`m 386.4512,577.16251 0.0556,17.08797 15.45962,0.24613 0,10.03868 0,10.03869 -15.45962,0.24608 -0.0556,17.08797 -35.33627,-27.37274 z`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`ccccccccc`,"inkscape:label":`#rect4655-9`},null,512),createBaseVNode(`path`,{ref_key:`icoIndicatorRightOffRef`,ref:icoIndicatorRightOffRef,id:`ico_indicatorr`,class:`ico-indicator-r`,d:`m 442.9256,554.57416 -0.0557,17.08798 -15.45965,0.24611 0,10.03869 0,10.03869 15.45965,0.24608 0.0557,17.08796 35.33627,-27.37273 z`,"inkscape:connector-curvature":`0`,"sodipodi:nodetypes":`ccccccccc`,"inkscape:label":`#rect4655-9-3`},null,512),createBaseVNode(`g`,{ref_key:`icoLightsOffRef`,ref:icoLightsOffRef,id:`ico_lights`,class:`ico-lights`,"inkscape:label":`#g4122`,transform:`translate(-12,-2)`},[..._cache[6]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824`,class:`light-source`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{class:`light-dash`,"inkscape:connector-curvature":`0`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoABSOffRef`,ref:icoABSOffRef,id:`ico_abs`,class:`ico-abs-off`,"inkscape:label":`#g4111`},[..._cache[7]||=[createBaseVNode(`path`,{transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,260.26675,95.346428)`,id:`path4551dd`,class:`main`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7`,class:`curve-l`,d:`m 488.18221,555.99526 c -10.19731,-6.9315 -16.91369,-18.60946 -16.96251,-31.87062 -0.0478,-13.00297 6.32573,-24.53106 16.1388,-31.5801`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4`,class:`curve-r`,d:`m 531.48996,555.83579 c 10.14597,-7.00643 16.77617,-18.73351 16.72734,-31.99467 -0.0478,-13.00299 -6.50623,-24.48382 -16.37094,-31.4604`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3978`,class:`text-a`,d:`m 501.24227,531.46506 -1.26336,-4.09346 -6.27665,0.0231 -1.23317,4.10266 -3.93322,0.0145 6.01281,-17.30965 4.46313,-0.0164 6.16367,17.26482 z m -2.14606,-7.15204 c -1.16774,-3.70913 -1.82512,-5.8068 -1.97214,-6.29303 -0.14704,-0.48619 -0.25248,-0.87049 -0.31632,-1.1529 -0.25538,1.00586 -0.98812,3.49334 -2.19823,7.46246 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3980`,class:`text-b`,d:`m 505.7499,514.23161 5.35812,-0.0197 c 2.44157,-0.009 4.21514,0.33189 5.32074,1.02261 1.10557,0.69074 1.66115,1.79369 1.66675,3.30887 0.004,1.02845 -0.23453,1.87329 -0.71491,2.53453 -0.4804,0.66124 -1.12074,1.06007 -1.92101,1.19647 l 4.3e-4,0.11776 c 1.09214,0.23936 1.88085,0.69181 2.36614,1.35733 0.48526,0.66554 0.72994,1.55178 0.73403,2.65873 0.006,1.57015 -0.55694,2.79695 -1.68812,3.6804 -1.1312,0.88345 -2.67028,1.32876 -4.61725,1.33593 l -6.44152,0.0237 z m 3.67569,6.80491 2.1197,-0.008 c 0.98919,-0.004 1.705,-0.15935 2.14745,-0.46718 0.44242,-0.3078 0.66234,-0.81498 0.65975,-1.52156 -0.002,-0.65945 -0.24559,-1.13157 -0.72946,-1.41635 -0.48388,-0.28476 -1.24789,-0.42523 -2.29202,-0.42139 l -1.91951,0.007 z m 0.0107,2.89692 0.0165,4.48668 2.37878,-0.009 c 1.00488,-0.004 1.74606,-0.19878 2.22355,-0.58523 0.47747,-0.38644 0.71474,-0.97613 0.71184,-1.76906 -0.005,-1.42882 -1.0285,-2.13948 -3.06968,-2.13197 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3982`,class:`text-s`,d:`m 530.64514,526.57565 c 0.006,1.55445 -0.54914,2.78122 -1.66456,3.68032 -1.11544,0.89909 -2.6702,1.35231 -4.66427,1.35965 -1.83708,0.007 -3.46345,-0.33266 -4.87912,-1.01833 l -0.0125,-3.39151 c 1.16382,0.51387 2.14846,0.87531 2.95395,1.08431 0.80547,0.20901 1.54187,0.31229 2.20918,0.30983 0.80077,-0.003 1.41452,-0.1583 1.84127,-0.46605 0.42673,-0.30776 0.63898,-0.76389 0.63676,-1.3684 -10e-4,-0.33757 -0.0966,-0.63752 -0.28594,-0.89982 -0.18939,-0.2623 -0.46706,-0.51447 -0.83301,-0.75651 -0.36596,-0.24202 -1.11125,-0.62789 -2.23586,-1.15761 -1.05382,-0.49071 -1.84457,-0.96278 -2.37224,-1.41619 -0.52768,-0.4534 -0.94964,-0.98177 -1.2659,-1.58513 -0.31625,-0.60334 -0.47587,-1.30933 -0.47884,-2.11796 -0.006,-1.52303 0.50616,-2.72216 1.53533,-3.59741 1.02915,-0.87522 2.45441,-1.31619 4.27579,-1.32291 0.89497,-0.003 1.74913,0.0996 2.56247,0.30852 0.81332,0.209 1.66426,0.50419 2.55282,0.8856 l -1.16716,2.84237 c -0.91993,-0.37344 -1.68046,-0.63364 -2.28158,-0.7806 -0.60114,-0.14694 -1.19218,-0.21935 -1.77312,-0.21723 -0.69088,0.003 -1.2202,0.16545 -1.588,0.48868 -0.3678,0.32325 -0.55075,0.74394 -0.54884,1.26208 10e-4,0.32189 0.0768,0.60228 0.22685,0.84116 0.15004,0.23892 0.38838,0.46963 0.71501,0.69217 0.32663,0.22256 1.09944,0.62206 2.31845,1.19853 1.61222,0.76345 2.71809,1.53072 3.3176,2.30181 0.59949,0.77111 0.90131,1.71798 0.90545,2.84063 z`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoHandBrakeOffRef`,ref:icoHandBrakeOffRef,class:`ico-handbrake-off`,id:`ico_handbrake`,"inkscape:label":`#g4115`,transform:`translate(-3.5925881e-6,-2.0000007)`},[..._cache[8]||=[createBaseVNode(`path`,{transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,id:`path4551-2-74-7`,class:`main`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{class:`curve-l`,id:`path4551-7-7-0-4`,"inkscape:connector-curvature":`0`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-7-9-0`,class:`curve-r`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`},null,-1),createBaseVNode(`g`,{class:`text-p`,id:`text4055-4-9`},[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path3269-4`,d:`m 566.88168,447.27286 2.26429,0 c 2.11628,2e-5 3.6998,-0.41806 4.75057,-1.25424 1.05073,-0.83614 1.57611,-2.05338 1.57612,-3.65172 -10e-6,-1.6131 -0.44029,-2.80444 -1.32083,-3.57403 -0.88058,-0.76954 -2.26061,-1.15432 -4.1401,-1.15435 l -3.13005,0 z m 15.53925,-5.15015 c -3e-5,3.49265 -1.09147,6.16392 -3.27434,8.01381 -2.18292,1.84993 -5.28707,2.77488 -9.31245,2.77487 l -2.95246,0 0,11.54344 -6.88167,0 0,-32.45483 10.3669,0 c 3.93659,3e-5 6.92975,0.84729 8.97947,2.54177 2.04967,1.69455 3.07452,4.22153 3.07455,7.58094 z`})],-1)]],512),createBaseVNode(`g`,{ref_key:`oilTempIcoOffRef`,ref:oilTempIcoOffRef,style:{display:`inline`},id:`ico_temp`,class:`ico-temp`,transform:`matrix(0.82879177,0,0,0.82879177,40.706638,69.281349)`,"inkscape:label":`#g4374`},[..._cache[9]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347`,class:`path1`,d:`m 199.61025,285.93078 2e-5,37.83129`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5`,class:`path2`,d:`m 208.85791,292.09588 -7.00577,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-4`,class:`path3`,d:`m 208.8579,301.06329 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-3`,class:`path4`,d:`m 208.85793,309.75049 -7.00583,-1e-5`},null,-1),createBaseVNode(`circle`,{transform:`matrix(0.72059621,0,0,0.72059621,-1146.435,-0.73321691)`,id:`path4392`,class:`path5`,cx:`1867.8225`,cy:`454.9176`,r:`14.849242`,d:`m 1882.6718,454.9176 c 0,8.20101 -6.6483,14.84924 -14.8493,14.84924 -8.201,0 -14.8492,-6.64823 -14.8492,-14.84924 0,-8.20101 6.6482,-14.84924 14.8492,-14.84924 8.201,0 14.8493,6.64823 14.8493,14.84924 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2`,class:`path6`,d:`m 183.69241,332.71741 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3`,class:`path7`,d:`m 223.32319,343.08941 -46.63658,-10e-6`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-34`,class:`path8`,d:`m 222.33239,332.7174 -7.00578,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`fuelWarnIcoOffRef`,ref:fuelWarnIcoOffRef,id:`ico_fuel`,class:`ico-fuel`,transform:`matrix(0.88747678,0,0,0.88747678,64.601263,56.302973)`,"inkscape:label":`#g4368`},[..._cache[10]||=[createBaseVNode(`rect`,{id:`rect4466`,class:`rect1`,y:`284.07593`,x:`420.99237`,height:`38.905876`,width:`22.650679`},null,-1),createBaseVNode(`rect`,{id:`rect4466-1`,class:`rect2`,y:`298.80991`,x:`420.99237`,height:`24.171896`,width:`22.650679`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3`,class:`path1`,d:`m 448.00445,330.93084 -30.96928,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-8`,class:`path2`,d:`m 460.25266,299.90863 0.0166,18.02062 c 0,0 -0.41583,2.18743 -4.92393,2.16693 -4.50811,-0.0205 -4.80496,-2.16693 -4.80496,-2.16693 l 0.0579,-17.71243 -7.25174,-0.0941`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer10Ref`,ref:layer10Ref,"inkscape:groupmode":`layer`,id:`layer10`,class:`layer10`,"inkscape:label":`icons bottom right activated`},[createBaseVNode(`path`,{ref_key:`icoIndicatorLeftOnRef`,ref:icoIndicatorLeftOnRef,class:`ico-indicator-l-on`,d:`m 386.4512,577.16251 0.0556,17.08797 15.45962,0.24613 0,10.03868 0,10.03869 -15.45962,0.24608 -0.0556,17.08797 -35.33627,-27.37274 z`,id:`ico_indicatorl_on`,"inkscape:connector-curvature":`0`,"inkscape:label":`#rect4655-9`},null,512),createBaseVNode(`path`,{ref_key:`icoIndicatorRightOnRef`,ref:icoIndicatorRightOnRef,id:`ico_indicatorr_on`,class:`ico-indicator-r-on`,d:`m 442.9256,554.57416 -0.0557,17.08798 -15.45965,0.24611 0,10.03869 0,10.03869 15.45965,0.24608 0.0557,17.08796 35.33627,-27.37273 z`,"inkscape:connector-curvature":`0`,"inkscape:label":`#rect4655-9-3`},null,512),createBaseVNode(`g`,{ref_key:`icoLightsOnRef`,ref:icoLightsOnRef,id:`ico_lights_on`,class:`ico-lights-on`,"inkscape:label":`#g4122`,transform:`translate(-12,-2.0000028)`},[..._cache[11]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824-4`,class:`path1`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-1`,class:`path2`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-20`,class:`path3`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-8-0`,class:`path4`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-1`,class:`path5`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-5-4`,class:`path6`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`icoABSOnRef`,ref:icoABSOnRef,transform:`translate(0,-2.8038025e-6)`,id:`ico_abs_on`,class:`ico-abs-on`,"inkscape:label":`#g4106`},[..._cache[12]||=[createBaseVNode(`path`,{id:`path4551-0`,class:`path1`,"inkscape:connector-curvature":`0`,transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,260.26675,95.34643)`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-717`,class:`path2`,d:`m 488.18221,555.99526 c -10.19731,-6.9315 -16.91369,-18.60946 -16.96251,-31.87062 -0.0478,-13.00297 6.32573,-24.53106 16.1388,-31.5801`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-77`,class:`path3`,d:`m 531.48996,555.83579 c 10.14597,-7.00643 16.77617,-18.73351 16.72734,-31.99467 -0.0478,-13.00299 -6.50623,-24.48382 -16.37094,-31.4604`},null,-1),createBaseVNode(`g`,{id:`flowRoot5902-7`,class:`text-path`,transform:`matrix(0.43849858,-0.00161469,0.00161469,0.43849858,259.17408,93.335)`},[createBaseVNode(`path`,{id:`path3978-3`,class:`text-path1`,"inkscape:connector-curvature":`0`,d:`m 548.35205,1001.1788 -2.84668,-9.34567 -14.31396,0 -2.84668,9.34567 -8.96973,0 13.85742,-39.4238 10.17822,0 13.91114,39.4238 z m -4.83398,-16.32809 c -2.63186,-8.4684 -4.11339,-13.25762 -4.44458,-14.36768 -0.33124,-1.10999 -0.56846,-1.98727 -0.71167,-2.63183 -0.59084,2.29169 -2.28274,7.95819 -5.07569,16.99951 z`}),createBaseVNode(`path`,{id:`path3980-3`,class:`text-path2`,"inkscape:connector-curvature":`0`,d:`m 558.77633,961.91614 12.21924,0 c 5.56801,4e-5 9.60975,0.79227 12.12524,2.37671 2.51543,1.5845 3.77316,4.10444 3.77319,7.55981 -3e-5,2.3454 -0.55056,4.27004 -1.65161,5.77393 -1.1011,1.50392 -2.56472,2.40806 -4.39087,2.7124 l 0,0.26855 c 2.48858,0.55504 4.28342,1.59345 5.38453,3.11524 1.10104,1.52182 1.65157,3.54493 1.65161,6.06933 -4e-5,3.58074 -1.29357,6.37371 -3.88062,8.37891 -2.5871,2.00518 -6.10069,3.00778 -10.54077,3.00778 l -14.68994,0 z m 8.32519,15.54931 4.83399,0 c 2.25584,3e-5 3.88954,-0.34909 4.90112,-1.04736 1.01153,-0.69822 1.51731,-1.853 1.51734,-3.46436 -3e-5,-1.50387 -0.55057,-2.58257 -1.65162,-3.23608 -1.10109,-0.65345 -2.84222,-0.98019 -5.22338,-0.98022 l -4.37745,0 z m 0,6.60645 0,10.23193 5.42481,0 c 2.29164,1e-5 3.98354,-0.43863 5.07568,-1.31592 1.0921,-0.87727 1.63816,-2.22004 1.63819,-4.02832 -3e-5,-3.25844 -2.3275,-4.88767 -6.98243,-4.88769 z`}),createBaseVNode(`path`,{id:`path3982-5`,class:`text-path3`,"inkscape:connector-curvature":`0`,d:`m 615.44572,990.27551 c -2e-5,3.54493 -1.27566,6.3379 -3.8269,8.37891 -2.55129,2.04098 -6.10069,3.06148 -10.64819,3.06148 -4.18947,0 -7.89552,-0.7877 -11.11817,-2.36324 l 0,-7.73437 c 2.64974,1.18164 4.89217,2.01416 6.7273,2.49755 1.83511,0.48341 3.51358,0.72511 5.0354,0.7251 1.82615,10e-6 3.22711,-0.34911 4.20288,-1.04736 0.97573,-0.69824 1.4636,-1.73665 1.46362,-3.11524 -2e-5,-0.76984 -0.21486,-1.45466 -0.64453,-2.05444 -0.42971,-0.59976 -1.06081,-1.17715 -1.89331,-1.73218 -0.83254,-0.555 -2.5289,-1.44123 -5.08911,-2.65869 -2.3991,-1.12791 -4.19841,-2.21108 -5.39795,-3.24951 -1.19955,-1.03839 -2.15739,-2.24689 -2.87354,-3.62549 -0.71614,-1.37855 -1.07422,-2.98988 -1.07421,-4.83398 -10e-6,-3.47328 1.17716,-6.20358 3.53149,-8.19092 2.35432,-1.98727 5.6083,-2.98092 9.76196,-2.98096 2.041,4e-5 3.98802,0.24174 5.84107,0.7251 1.853,0.48344 3.79107,1.16377 5.81421,2.04102 l -2.68555,6.47216 c -2.09475,-0.85934 -3.82693,-1.45911 -5.19653,-1.79931 -1.36965,-0.34014 -2.7169,-0.51022 -4.04175,-0.51026 -1.57554,4e-5 -2.78403,0.36706 -3.62549,1.10108 -0.84148,0.73408 -1.26222,1.69192 -1.26221,2.87353 -10e-6,0.73408 0.17008,1.37413 0.51026,1.92017 0.34015,0.54609 0.88174,1.07424 1.62475,1.58447 0.74299,0.51028 2.50202,1.42784 5.2771,2.75269 3.67023,1.75457 6.18569,3.51361 7.54639,5.2771 1.36065,1.76352 2.04099,3.92538 2.04101,6.48559 z`})],-1)]],512),createBaseVNode(`g`,{ref_key:`icoHandBrakeOnRef`,ref:icoHandBrakeOnRef,id:`ico_handbrake_on`,class:`ico-handbrake-on`,"inkscape:label":`#g4115`,transform:`translate(-3.5925881e-6,-2.0000007)`},[..._cache[13]||=[createBaseVNode(`path`,{id:`path4551-2-74`,class:`path1`,transform:`matrix(0.43850147,2.6141077e-4,-2.6141077e-4,0.43850147,320.9902,18.916914)`,d:`m 631.44636,979.59082 c 0,36.31878 -29.44217,65.76098 -65.76094,65.76098 -36.31876,0 -65.76093,-29.4422 -65.76093,-65.76098 0,-36.31876 29.44217,-65.76093 65.76093,-65.76093 36.31877,0 65.76094,29.44217 65.76094,65.76093 z`,"inkscape:connector-curvature":`0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-7-0`,class:`path2`,d:`m 546.9327,480.53664 c -10.16748,-6.97507 -16.83385,-18.68164 -16.82592,-31.94291 0.008,-13.00305 6.43054,-24.50375 16.27369,-31.51076`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4551-7-4-7-9`,class:`path3`,d:`m 590.24076,480.56245 c 10.17587,-6.96293 16.8562,-18.66157 16.86414,-31.92282 0.008,-13.00303 -6.40141,-24.51142 -16.23624,-31.5301`},null,-1),createBaseVNode(`g`,{class:`text-p`,id:`text4055-4`},[createBaseVNode(`path`,{d:`m 566.88168,447.27286 2.26429,0 c 2.11628,2e-5 3.6998,-0.41806 4.75057,-1.25424 1.05073,-0.83614 1.57611,-2.05338 1.57612,-3.65172 -10e-6,-1.6131 -0.44029,-2.80444 -1.32083,-3.57403 -0.88058,-0.76954 -2.26061,-1.15432 -4.1401,-1.15435 l -3.13005,0 z m 15.53925,-5.15015 c -3e-5,3.49265 -1.09147,6.16392 -3.27434,8.01381 -2.18292,1.84993 -5.28707,2.77488 -9.31245,2.77487 l -2.95246,0 0,11.54344 -6.88167,0 0,-32.45483 10.3669,0 c 3.93659,3e-5 6.92975,0.84729 8.97947,2.54177 2.04967,1.69455 3.07452,4.22153 3.07455,7.58094 z`,id:`path3269`,"inkscape:connector-curvature":`0`})],-1)]],512),createBaseVNode(`g`,{ref_key:`oilTempIcoOnRef`,ref:oilTempIcoOnRef,id:`ico_temp_on`,class:`ico-temp-on`,transform:`matrix(0.82879177,0,0,0.82879177,40.706638,69.281349)`,"inkscape:label":`#g4374`},[..._cache[14]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-7`,class:`path1`,d:`m 199.61025,285.93078 2e-5,37.83129`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-40`,class:`path2`,d:`m 208.85791,292.09588 -7.00577,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-4-9`,class:`path3`,d:`m 208.8579,301.06329 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-3-4`,class:`path4`,d:`m 208.85793,309.75049 -7.00583,-1e-5`},null,-1),createBaseVNode(`circle`,{id:`path4392-8`,class:`circle1`,transform:`matrix(0.72059621,0,0,0.72059621,-1146.435,-0.73321691)`,cx:`1867.8225`,cy:`454.9176`,r:`14.849242`,d:`m 1882.6718,454.9176 c 0,8.20101 -6.6483,14.84924 -14.8493,14.84924 -8.201,0 -14.8492,-6.64823 -14.8492,-14.84924 0,-8.20101 6.6482,-14.84924 14.8492,-14.84924 8.201,0 14.8493,6.64823 14.8493,14.84924 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-8`,class:`path5`,d:`m 183.69241,332.71741 -7.00578,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-2`,class:`path6`,d:`m 223.32319,343.08941 -46.63658,-10e-6`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-34-4`,class:`path7`,d:`m 222.33239,332.7174 -7.00578,0`},null,-1)]],512),createBaseVNode(`g`,{ref_key:`fuelWarnIcoOnRef`,ref:fuelWarnIcoOnRef,id:`ico_fuel_on`,class:`ico-fuel-on`,transform:`matrix(0.88747678,0,0,0.88747678,64.601263,56.302973)`,"inkscape:label":`#g4368-5`},[..._cache[15]||=[createBaseVNode(`rect`,{id:`rect4466-5`,class:`rect1`,y:`284.07593`,x:`420.99237`,height:`38.905876`,width:`22.650679`},null,-1),createBaseVNode(`rect`,{id:`rect4466-1-1`,class:`rect2`,y:`298.80991`,x:`420.99237`,height:`24.171896`,width:`22.650679`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-7`,class:`path1`,d:`m 448.00445,330.93084 -30.96928,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-3-8-1`,class:`path2`,d:`m 460.25266,299.90863 0.0166,18.02062 c 0,0 -0.41583,2.18743 -4.92393,2.16693 -4.50811,-0.0205 -4.80496,-2.16693 -4.80496,-2.16693 l 0.0579,-17.71243 -7.25174,-0.0941`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`layer12Ref`,ref:layer12Ref,"inkscape:groupmode":`layer`,id:`layer12`,class:`layer12`,"inkscape:label":`icons bottom right 2`},[createBaseVNode(`g`,{ref_key:`icoLightsHighRef`,ref:icoLightsHighRef,id:`ico_lights_high`,class:`ico-lights-high`,"inkscape:label":`#g4122`,transform:`translate(-12.000003,-2.0000028)`},[..._cache[16]||=[createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`rect5824-4-9`,class:`path1`,d:`m 611.67051,352.21188 19.61837,0 c 0,0 13.56687,7.61647 13.56687,22.35122 0,14.73475 -13.56687,21.08238 -13.56687,21.08238 l -19.61837,0 c 0,0 -1.90879,-4.49141 -1.95206,-21.08238 -0.0435,-16.59097 1.95206,-22.35122 1.95206,-22.35122 z`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-1-8`,class:`path2`,d:`m 600.68152,355.88611 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-20-1`,class:`path3`,d:`m 600.68152,365.4103 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-8-0-8`,class:`path4`,d:`m 600.68152,374.58946 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-1-2`,class:`path5`,d:`m 600.68152,384.11369 -13.21963,0`},null,-1),createBaseVNode(`path`,{"inkscape:connector-curvature":`0`,id:`path4347-5-1-2-3-1-9-6-5-4-6`,class:`path6`,d:`m 600.68152,393.43089 -13.21963,0`},null,-1)]],512)],512),createBaseVNode(`g`,{ref_key:`tickLayerRef`,ref:tickLayerRef,id:`tickLayer`,class:`tick-layer`},[(openBlock(),createElementBlock(Fragment,null,renderList(maxRpmTexts,k=>createBaseVNode(`line`,{ref_for:!0,ref:el=>setTickRef(el,k),x1:`0`,y1:`0`,x2:`0`,y2:`0`,class:`tick-line`},null,512)),64))],512)]))}},tacho_default=__plugin_vue_export_helper_default(_sfc_main$179,[[`__scopeId`,`data-v-310c7a2d`]]),_hoisted_1$159={class:`tacho-container`},_sfc_main$178={__name:`app`,setup(__props){let{$game}=useLibStore(),tachoRef=ref(null),visible=ref(!1);ref(!1),onMounted(()=>{tachoRef.value.wireThroughUnitSystem((val,func)=>UiUnits[func](val)),$game.streams.add([`electrics`,`engineInfo`]),$game.events.on(`onStreamsUpdate`,onStreamsUpdate),$game.events.on(`VehicleChange`,onVehicleChange),$game.events.on(`VehicleFocusChanged`,onVehicleFocusChanged)}),onUnmounted(()=>{$game.streams.remove([`electrics`,`engineInfo`]),$game.events.off(`onStreamsUpdate`,onStreamsUpdate),$game.events.off(`VehicleChange`,onVehicleChange),$game.events.off(`VehicleFocusChanged`,onVehicleFocusChanged)});let _done=!1;function onStreamsUpdate(streams){tachoRef.value!==null&&(_done||=!0,tachoRef.value.update(streams)?visible.value||=!0:visible&&(visible.value=!1))}function onVehicleChange(){tachoRef.value!==null&&tachoRef.value.vehicleChanged()}function onVehicleFocusChanged(data){tachoRef.value!==null&&data.mode===!0&&tachoRef.value.vehicleChanged()}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$159,[createVNode(tacho_default,{ref_key:`tachoRef`,ref:tachoRef},null,512)]))}},app_default$26=__plugin_vue_export_helper_default(_sfc_main$178,[[`__scopeId`,`data-v-57c978c8`]]),_sfc_main$177={__name:`app`,setup(__props){let{$game}=useLibStore(),store$1=useTasksStore();provide(`animationSettings`,{animate:!0,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmptyIntervalDelay:.1,animateOnEmpty:!0,animateNextTask:!0,successCallback:playAudio});function playAudio(){$game.lua.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Checkbox`)}return(_ctx,_cache)=>(openBlock(),createBlock(unref(TaskList_default),{header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`]))}},app_default$27=_sfc_main$177,_hoisted_1$158={class:`pacenote`},_hoisted_2$131=[`id`],_hoisted_3$117=[`fill`,`stroke`],_hoisted_4$95=[`id`],_hoisted_5$82=[`fill`,`stroke`],_hoisted_6$68=[`fill`],_hoisted_7$59={class:`content`},_hoisted_8$49={class:`instruction`},_hoisted_9$43={key:0,class:`modifier`},_hoisted_10$36={key:1,class:`add-note`},_hoisted_11$32={key:0,class:`distance`},_sfc_main$176={__name:`PaceNote`,props:{note:{type:Object,required:!0,validator(value){return value.type===`empty`?!0:typeof value.type==`string`},default:()=>({type:`empty`,typeExt:null,turnModifier:null,background:{color:`var(--bng-cool-gray-600)`,strokeColor:`var(--bng-cool-gray-500)`,opacity:.6},isInto:!1,isLeft:!1,size:5,turnTypeValue:null,distance:null,additionalNote:{color:`#fff`,icon:null,text:null}})}},setup(__props){useCssVars(_ctx=>({v5d4f1806:props.note.size,v654d2548:backgroundColor.value,v7d5e0455:colorNoteIcon.value,v7d630d09:colorNoteText.value,v305678bf:colorDistance.value}));let bgId=uniqueId(``,`_`),props=__props,noteUrl=computed(()=>{if(props.note.typeExt)return props.note.typeExt;let assetPath=noteTypes[props.note.type];return assetPath?getAssetURL(assetPath):null}),backgroundColor=computed(()=>props.note.background&&props.note.background.color?props.note.background.color:`var(--bng-cool-gray-600)`),strokeColor=computed(()=>props.note.background&&props.note.background.strokeColor?props.note.background.strokeColor:`var(--bng-cool-gray-500)`),backgroundOpacity=computed(()=>props.note.background&&props.note.background.opacity?props.note.background.opacity:.6),colorNoteIcon=computed(()=>props.note.colorNoteIcon?props.note.colorNoteIcon:`#fff`),colorNoteText=computed(()=>props.note.colorNoteText?props.note.colorNoteText:`#fff`),intoColor=computed(()=>props.note.intoColor?props.note.intoColor:`#fff`),colorDistance=computed(()=>props.note.colorDistance?props.note.colorDistance:`#ececec`);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$158,[createBaseVNode(`div`,{class:`background`,style:normalizeStyle({opacity:backgroundOpacity.value})},[__props.note.isInto?(openBlock(),createElementBlock(`svg`,{key:1,id:`note_${unref(bgId)}`,style:{width:`var(--note-size)`,height:`var(--note-size)`},viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[createBaseVNode(`path`,{d:`M5 47.75H5.54967L5.71519 47.2258L11.3348 29.4304C11.6288 28.4994 11.6288 27.5006 11.3348 26.5696L5.95963 9.54823C5.82856 9.13317 5.7822 8.69601 5.8233 8.26269L6.25669 3.69314C6.41494 2.02457 7.81612 0.75 9.49217 0.75H51.4137C53.3423 0.75 54.8466 2.41974 54.6461 4.33788L49.631 52.3157C49.4572 53.9784 48.0504 55.238 46.3787 55.2278L4.46341 54.9706C2.52935 54.9587 1.03362 53.2707 1.25464 51.3493L1.66867 47.75H5Z`,fill:backgroundColor.value,stroke:strokeColor.value,"stroke-width":`1.5`},null,8,_hoisted_5$82),createBaseVNode(`path`,{d:`M4 11H1L6 28L1 45H4L9.5 28L4 11Z`,fill:intoColor.value},null,8,_hoisted_6$68)],8,_hoisted_4$95)):(openBlock(),createElementBlock(`svg`,{key:0,id:`note_${unref(bgId)}`,style:{width:`var(--note-size)`,height:`var(--note-size)`},viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[createBaseVNode(`path`,{d:`M9.45521 0.75H51.4137C53.3423 0.75 54.8466 2.41974 54.6461 4.33788L49.631 52.3157C49.4572 53.9784 48.0504 55.238 46.3787 55.2278L4.41965 54.9703C2.49833 54.9585 1.00656 53.2915 1.2074 51.3807L6.22301 3.66028C6.39689 2.00598 7.7918 0.75 9.45521 0.75Z`,fill:backgroundColor.value,stroke:strokeColor.value,"stroke-width":`1.5`},null,8,_hoisted_3$117)],8,_hoisted_2$131))],4),createBaseVNode(`div`,_hoisted_7$59,[createBaseVNode(`div`,_hoisted_8$49,[unref(icons)[__props.note.type]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:normalizeClass([`note-icon`,{left:__props.note.isLeft}]),type:__props.note.type},null,8,[`type`,`class`])):__props.note.typeExt&¬eUrl.value?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`note-icon svg-used`,[__props.note.type,{left:__props.note.isLeft}]]),style:normalizeStyle(noteUrl.value?{maskImage:`url(${noteUrl.value})`,WebkitMaskImage:`url(${noteUrl.value})`}:null)},null,6)):createCommentVNode(``,!0),__props.note.turnTypeValue?(openBlock(),createElementBlock(`div`,{key:2,class:normalizeClass([`turn-value`,{left:__props.note.isLeft,"is-into":__props.note.isInto,"text-2-chars":__props.note.turnTypeValue.length===2}])},toDisplayString(__props.note.turnTypeValue),3)):createCommentVNode(``,!0)]),__props.note.turnModifier?(openBlock(),createElementBlock(`div`,_hoisted_9$43,[createVNode(unref(bngIcon_default),{type:__props.note.turnModifier,class:`icon-small`,color:colorNoteIcon.value},null,8,[`type`,`color`])])):createCommentVNode(``,!0),__props.note.additionalNote&&(__props.note.additionalNote.icon||__props.note.additionalNote.text)?(openBlock(),createElementBlock(`div`,_hoisted_10$36,[__props.note.additionalNote.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.note.additionalNote.icon,color:__props.note.additionalNote.color,class:`icon-small`},null,8,[`type`,`color`])):__props.note.additionalNote.text?(openBlock(),createElementBlock(`span`,{key:1,class:`add-text`,style:normalizeStyle(__props.note.additionalNote.color?{color:__props.note.additionalNote.color}:null)},toDisplayString(__props.note.additionalNote.text),5)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),__props.note.distance?(openBlock(),createElementBlock(`div`,_hoisted_11$32,toDisplayString(__props.note.distance),1)):createCommentVNode(``,!0)]))}},PaceNote_default=__plugin_vue_export_helper_default(_sfc_main$176,[[`__scopeId`,`data-v-8c4cf384`]]),_hoisted_1$157={class:`pacenotes-app`},_hoisted_2$130={class:`notes-container`},FADE_DURATION=250,TOTAL_SLOTS=4,DEFAULT_NOTE_SIZE=1.8,_sfc_main$175={__name:`app`,setup(__props){useCssVars(_ctx=>({v492216b0:noteSize.value}));let incomingQueue=ref([]),noteSize=ref(DEFAULT_NOTE_SIZE),events$3=useEvents(),{lua}=useBridge(),devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),debugSlots=computed(()=>incomingQueue.value.map(slot=>slot?`id=${slot.note.id} pnId=${slot.pacenoteId} ts=${slot.serialNo} type=${slot.note.type} isFading=${slot.isFading} isCurrent=${slot.isCurrent}`:null)),firstFourFromQueue=computed(()=>{let result=[...incomingQueue.value.slice(0,TOTAL_SLOTS)];for(;result.length<4;)result.push({id:-1,type:`empty`});return result});function getNoteKey(slot,index){return!slot||!slot.note?`empty-${index}`:`${slot.note.id}-${index}`}function getNoteWithSize(slot){return!slot||!slot.note?{type:`empty`,size:noteSize.value}:{...slot.note,size:noteSize.value}}let mockNotes=[{id:`q1`,pnId:`1`,type:`turn3`,isLeft:!1,turnTypeValue:`3`,distance:`140`,background:{color:`var(--bng-ter-yellow-300)`,strokeColor:`var(--bng-ter-yellow-200)`,opacity:.8}},{id:`q2`,pnId:`2`,type:`turnHp`,isLeft:!0,isInto:!0,background:{color:`var(--bng-add-red-500)`,strokeColor:`var(--bng-add-red-400)`,opacity:.8},additionalNote:{icon:`scissorsSlashed`,color:`var(--bng-add-red-400)`}},{id:`q3`,pnId:`2`,type:`jumpOverBump`,isLeft:!1,turnModifier:`mathLessThan`,additionalNote:{icon:`circleSlashed`,color:`var(--bng-ter-yellow-100)`}},{id:`q4`,pnId:`3`,type:`turn6`,isLeft:!0,turnTypeValue:`6`,distance:`140`,background:{color:`var(--bng-ter-yellow-300)`,strokeColor:`var(--bng-ter-yellow-200)`,opacity:.8}},{id:`q5`,pnId:`3`,type:`rocks`,isLeft:!0,distance:`50`}];function updateCurrent(){if(incomingQueue.value.length===0||(incomingQueue.value=incomingQueue.value.filter(item=>item!==null),incomingQueue.value.length===0))return;let firstPacenoteId=incomingQueue.value[0].pacenoteId;incomingQueue.value.forEach(slot=>{slot&&!slot.isFading&&(slot.isCurrent=slot.pacenoteId===firstPacenoteId)})}function addToQueue(newItems,serialNo){try{(Array.isArray(newItems)?newItems:[newItems]).forEach(note=>{if(!note.id||!note.type){console.warn(`Invalid note format:`,JSON.stringify(note,null,2));return}let val={note,isVisible:!0,isFading:!1,isCurrent:!1,pacenoteId:note.pnId,serialNo};incomingQueue.value.push(val)}),updateCurrent()}catch(error){console.error(`Error adding to queue:`,error)}}onMounted(()=>{lua.pacenotes&&lua.pacenotes.onPaceNotesAppMounted&&lua.pacenotes.onPaceNotesAppMounted(),events$3.on(`showVisualPacenote2`,pacenoteEvent=>{let serialNo=pacenoteEvent.serialNo,notes=pacenoteEvent.visualPacenotes;addToQueue(notes,serialNo)}),events$3.on(`clearOneVisualPacenote`,serialNo=>{clearOne(serialNo)}),events$3.on(`clearAllVisualPacenotes`,()=>{clearAll()})}),onUnmounted(()=>{lua.pacenotes&&lua.pacenotes.onPaceNotesAppUnmounted&&lua.pacenotes.onPaceNotesAppUnmounted()});let testAddSequence=()=>{console.log(`Adding sequence...`);let fakeSerialNo=666,lastPnid=0;mockNotes.forEach(note=>{note.pnId!==lastPnid&&(fakeSerialNo++,lastPnid=note.pnId),addToQueue(note,fakeSerialNo)}),console.log(`Current queue:`,incomingQueue.value)},clearAll=()=>{incomingQueue.value=[]},clearOne=serialNo=>{let fadeCount=0,fadeExpected=0;incomingQueue.value.forEach((item,index)=>{item.serialNo<=serialNo&&(item.isFading=!0,item.isVisible=!1,item.isCurrent=!1,fadeExpected++),setTimeout(()=>{item&&item.isFading&&(incomingQueue.value[index]=null,fadeCount++,fadeCount===fadeExpected&&updateCurrent())},FADE_DURATION)})},testClearAll=()=>{clearAll()},testClearOne=()=>{let serialNo=incomingQueue.value[0].serialNo;clearOne(serialNo)};(devEnv.env||devEnv.vue)&&(window.testPaceNotes={addSequence:testAddSequence,clearAll:testClearAll,clearOne:testClearOne,getState:()=>({queue:incomingQueue.value,slots:debugSlots.value})});function onAnimationEnd(index){let slot=incomingQueue.value[index];slot&&slot.isVisible&&!slot.isFading&&(slot.hasAnimated=!0)}return ref(null),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$157,[createBaseVNode(`div`,_hoisted_2$130,[_cache[1]||=createBaseVNode(`div`,{class:`spacer`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(firstFourFromQueue.value,(slot,index)=>(openBlock(),createBlock(PaceNote_default,{key:getNoteKey(slot,index),class:normalizeClass({"pacenote-initial":!slot?.hasAnimated,[`position-${index}`]:!0,"fade-out":slot&&slot.isFading,"fade-in":slot&&slot.isVisible&&!slot.isFading&&!slot.hasAnimated,hidden:!slot||!slot.isVisible&&!slot.isFading,current:slot&&slot.isCurrent}),note:getNoteWithSize(slot),onAnimationend:$event=>onAnimationEnd(index)},null,8,[`class`,`note`,`onAnimationend`]))),128))]),createCommentVNode(``,!0)]))}},app_default$28=__plugin_vue_export_helper_default(_sfc_main$175,[[`__scopeId`,`data-v-13adc0e2`]]),_hoisted_1$156={class:`countdown-top`},_hoisted_2$129={key:0,class:`countdown-go`},_hoisted_3$116={class:`countdown-bottom`},_hoisted_4$94={class:`rally-loop-manager-text`},_hoisted_5$81={class:`time-main`},_hoisted_6$67={key:0,class:`time-period`},_sfc_main$174={__name:`CountdownWidget`,props:{rallyLoopManager:{type:String,default:`--:--:--`},period:{type:String,default:null},countdown:{type:Number,default:10}},setup(__props){let props=__props,stage=computed(()=>props.countdown<=0?6:props.countdown>5?0:6-props.countdown);return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,_hoisted_1$156,[stage.value===6?(openBlock(),createElementBlock(`div`,_hoisted_2$129)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=1}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=2}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=3}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=4}])},null,2),createBaseVNode(`div`,{class:normalizeClass([`countdown-square`,{visible:stage.value>=5}])},null,2)],64))]),createBaseVNode(`div`,_hoisted_3$116,[createBaseVNode(`div`,_hoisted_4$94,[createBaseVNode(`span`,_hoisted_5$81,toDisplayString(__props.rallyLoopManager),1),__props.period?(openBlock(),createElementBlock(`span`,_hoisted_6$67,toDisplayString(__props.period),1)):createCommentVNode(``,!0)])])],64))}},CountdownWidget_default=__plugin_vue_export_helper_default(_sfc_main$174,[[`__scopeId`,`data-v-a0ececba`]]),_hoisted_1$155={class:`vehicle-proximity`},_hoisted_2$128={class:`top-row`},_hoisted_3$115={class:`proximity-status`},_hoisted_4$93={key:2},_sfc_main$173={__name:`VehicleProximity`,props:{vehicleProximity:{type:Object,required:!0},stage:{type:String,required:!0},precision:{type:Number,default:0,validator:value=>value>=0&&value<=2},badgeText:{type:String,default:``},instruction:{type:Object,required:!1,default:()=>({text:``,type:`notice`}),validator:value=>value?typeof value.text==`string`&&[`alert`,`alert-sm`,`notice`].includes(value.type):!0},instruction2:{type:Object,required:!1,default:()=>({structuredText:null})}},setup(__props){let props=__props,distanceDimmed=computed(()=>props.stage===`stop`||props.stage===`staged`),hasLabel=computed(()=>props.stage===`approaching`&&props.badgeText),formattedDistance=computed(()=>{let dist=props.vehicleProximity.distance;if(Math.abs(dist)>200)return`${(dist/1e3).toFixed(2)}km`;if(dist<0){let multiplier=10**props.precision,flooredDist=Math.floor(dist*multiplier)/multiplier;return`${(flooredDist===0?0:flooredDist).toFixed(props.precision)}m`}return`${dist.toFixed(props.precision)}m`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$155,[createBaseVNode(`div`,_hoisted_2$128,[createBaseVNode(`div`,_hoisted_3$115,[createBaseVNode(`div`,{class:normalizeClass([`proximity-status-badge`,[__props.stage,{"has-label":hasLabel.value}]])},[__props.stage===`stop`?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(`STOP`)],64)):__props.stage===`goback`?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(`BACK`)],64)):__props.stage===`slow`?(openBlock(),createElementBlock(Fragment,{key:2},[createTextVNode(`SLOW`)],64)):__props.stage===`staged`?(openBlock(),createElementBlock(Fragment,{key:3},[createTextVNode(`STAGED`)],64)):__props.stage===`approaching`?(openBlock(),createElementBlock(Fragment,{key:4},[createTextVNode(toDisplayString(__props.badgeText),1)],64)):createCommentVNode(``,!0)],2)]),createBaseVNode(`div`,{class:normalizeClass([`proximity-distance`,{dimmed:distanceDimmed.value}])},toDisplayString(formattedDistance.value),3)]),__props.instruction?.text?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`instruction-row`,__props.instruction?.type||`notice`])},toDisplayString(__props.instruction?.text),3)):createCommentVNode(``,!0),__props.instruction2?.structuredText?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`instruction-row`,[__props.instruction2?.type||`notice`,{flash:__props.instruction2?.flash}]])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.instruction2?.structuredText,item=>(openBlock(),createElementBlock(Fragment,{key:item.id},[item.type===`clock`?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(item.class)},toDisplayString(item.val),3)):item.type===`penalty`?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(item.class)},toDisplayString(item.val),3)):(openBlock(),createElementBlock(`span`,_hoisted_4$93,toDisplayString(item),1))],64))),128))],2)):createCommentVNode(``,!0)]))}},VehicleProximity_default=__plugin_vue_export_helper_default(_sfc_main$173,[[`__scopeId`,`data-v-871af6e6`]]),_hoisted_1$154={class:`rally-countdown-app-container`},_hoisted_2$127={class:`panel-countdown`},_hoisted_3$114={key:2,class:`section-interact-hint`},_sfc_main$172={__name:`appCountdown`,setup(__props){useCssVars(_ctx=>({v730cc8f6:themeColor.value}));let{lua}=useBridge(),devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),showDebugInfo=ref(!1),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockTime:null,day:null,totalTime:0,canSkipTimeControls:!1,isTimeControlSkipAvailable:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1,speedLimit:null,speedLimitDisplay:null,speedUnit:`km/h`,isSpeeding:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distM:0,distPct:0}}),countdownData=reactive({countdown:null,state:null}),themeColor=computed(()=>`#07ff00`),canInteract=computed(()=>rallyClockData.canSkipTimeControls||rallyClockData.canSkipCountdown),interactLabel=computed(()=>rallyClockData.canSkipCountdown||rallyClockData.canSkipTimeControls?`[action=gameplay_interact]Skip Clock`:``),proximityStage=computed(()=>{scheduleData.eventType;let distance=vehicleProximityData.distance;return scheduleData.eventType===`ss_start`?vehicleProximityData.isNear&&vehicleProximityData.isStopped?`staged`:distance<0?`goback`:vehicleProximityData.isNear&&!vehicleProximityData.isStopped?`stop`:!vehicleProximityData.isNear&&distance>=0&&distance<=25?`slow`:`approaching`:distance<0?`goback`:vehicleProximityData.isNear?`stop`:!vehicleProximityData.isNear&&distance>=0&&distance<=25||scheduleData.eventType===`ss_stop`?`slow`:`approaching`}),distancePrecision=computed(()=>{let distAbs=Math.abs(vehicleProximityData.distance),closenessThreshold=5;if(scheduleData.eventType===`ss_start`){if(distAbs<5)return proximityStage.value===`stop`||proximityStage.value===`goback`||proximityStage.value===`staged`||proximityStage.value===`slow`?2:0}else if((scheduleData.eventType===`tc`||scheduleData.eventType===`ss_stop`)&&distAbs<5)return proximityStage.value===`stop`||proximityStage.value===`goback`?1:0;return 0}),badgeText=computed(()=>scheduleData.eventType===`ss_start`?`SS${scheduleData.ssLabel}`:scheduleData.eventType===`tc`?scheduleData.label:scheduleData.eventType===`ss_stop`?`SLOW`:scheduleData.eventType===`service_in`?`SERVICE`:``),proximityInstruction2=computed(()=>{let stage=proximityStage.value;if(scheduleData.eventType===`ss_start`)return{structuredText:[`Start in `,{type:`clock`,val:scheduleData.timeDiff,class:`clock-badge`}],flash:!1};if(stage===`approaching`){if(rallyClockData.isTimeControlSkipAvailable&&scheduleData.eventType===`tc`)return{structuredText:[`Slow Down for `,{type:`clock`,val:`Clock Skip`,class:`clock-badge`}],flash:!1};if(scheduleData.eventType===`service_in`||scheduleData.label===`TC0`||scheduleData.eventType===`tc`)return{structuredText:[`Limit `,{type:`penalty`,val:`${scheduleData.speedLimitDisplay}${scheduleData.speedUnit}`,class:`penalty-badge`}],flash:scheduleData.isSpeeding}}else return null}),proximityInstruction=computed(()=>{let stage=proximityStage.value,text=``,type=`notice`;return stage===`slow`?scheduleData.eventType===`ss_start`?text=`Stage vehicle at start line.`:scheduleData.eventType===`tc`||scheduleData.eventType:stage===`stop`?scheduleData.eventType:stage===`goback`||(stage===`staged`?vehicleProximityData.isFrozen:stage===`approaching`&&(scheduleData.eventType===`ss_start`?text=`Stage vehicle at start line.`:scheduleData.eventType===`tc`||scheduleData.eventType===`service_in`||scheduleData.eventType)),{text,type:`notice`}}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),data.showDebugInfo!==void 0&&(showDebugInfo.value=data.showDebugInfo),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function isStageActive(){return activeState.value===ActiveState.STAGE_ACTIVE}return(devEnv.env||devEnv.vue)&&(window.rallyLoopApp={activeState,vehicleProximityData,rallyClockData,scheduleData,stageData,countdownData,proximityStage,distancePrecision,badgeText}),(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$154,[isStageActive()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`rally-countdown-app`,{"show-active-stage":isStageActive()}])},[activeState.value===ActiveState.VEHICLE_PROXIMITY?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`section-vehicle-positioning`,{"has-interact-hint":canInteract.value}])},[createVNode(VehicleProximity_default,{"vehicle-proximity":vehicleProximityData,stage:proximityStage.value,precision:distancePrecision.value,"badge-text":badgeText.value,instruction:proximityInstruction.value,instruction2:proximityInstruction2.value},null,8,[`vehicle-proximity`,`stage`,`precision`,`badge-text`,`instruction`,`instruction2`])],2)):createCommentVNode(``,!0),activeState.value===ActiveState.COUNTDOWN?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`section-vehicle-positioning`,{"has-interact-hint":canInteract.value}])},[createBaseVNode(`div`,_hoisted_2$127,[createVNode(CountdownWidget_default,{"rally-loop-manager":rallyClockData.wallClockTime?.time||`--:--:--`,period:rallyClockData.wallClockTime?.ampm||``,countdown:countdownData.countdown},null,8,[`rally-loop-manager`,`period`,`countdown`])])],2)):createCommentVNode(``,!0),canInteract.value?(openBlock(),createElementBlock(`div`,_hoisted_3$114,[createVNode(unref(dynamicComponent_default),{template:interactLabel.value,bbcode:``},null,8,[`template`])])):createCommentVNode(``,!0)],2))])]),_:1}))}},appCountdown_default=__plugin_vue_export_helper_default(_sfc_main$172,[[`__scopeId`,`data-v-bde5d1a7`]]),_hoisted_1$153={class:`rally-timecard-app-container`},_hoisted_2$126={key:0,class:`rally-timecard-app`},_hoisted_3$113={class:`interact-label-on-timecard`},_hoisted_4$92={class:`time-card`},_hoisted_5$80={class:`rally-card-header`},_hoisted_6$66={class:`header-top`},_hoisted_7$58=[`src`],_hoisted_8$48={key:0,class:`mission-name`},_hoisted_9$42={class:`rally-card-content`},_hoisted_10$35={key:0,class:`group-divider`},_hoisted_11$31={class:`col-label`},_hoisted_12$25={class:`event-label`},_hoisted_13$22={class:`event-data-container`},_hoisted_14$21={key:0,class:`time-widget`},_hoisted_15$20={class:`col-recorded-time time-widget-value time-taken-value`},_hoisted_16$20={key:0,class:`stage-time`},_hoisted_17$16={key:0,class:`ampm`},_hoisted_18$14={class:`time-widget time-widget-due`},_hoisted_19$11={class:`col-due-time time-widget-value`},_hoisted_20$10={key:0,class:`scheduled-time`},_hoisted_21$10={key:0,class:`ampm`},_hoisted_22$8={class:`time-widget-combined`},_hoisted_23$7={class:`time-widget`},_hoisted_24$6={class:`col-recorded-time time-widget-value actual-value`},_hoisted_25$5={key:0,class:`recorded-time`},_hoisted_26$4={key:0,class:`ampm`},_hoisted_27$4={class:`time-widget`},_hoisted_28$3={class:`col-status time-widget-value status-value`},_hoisted_29$3={key:0,class:`status-text early`},_hoisted_30$3={key:1,class:`status-text late`},_hoisted_31$3={key:2,class:`status-text ok`},_hoisted_32$3={key:0,class:`penalty-card`},_hoisted_33$3={class:`rally-card-header penalty-card-header`},_hoisted_34$3={class:`header-top`},_hoisted_35$2={class:`penalty-total-header`},_hoisted_36$2={class:`total-value`},_hoisted_37$1={class:`penalty-card-content`},_hoisted_38$1={class:`penalty-group-header`},_hoisted_39$1={class:`group-name`},_hoisted_40$1={class:`group-total`},_hoisted_41$1={class:`penalty-list`},_hoisted_42$1={class:`penalty-type`},_hoisted_43$1={class:`penalty-amount`},_hoisted_44$1={key:1,class:`interact-label`},_hoisted_45$1={class:`interact-label-text`},_sfc_main$171={__name:`appTimecard`,setup(__props){useCssVars(_ctx=>({a6aff4e0:themeColor.value}));let{lua}=useBridge(),events$3=useEvents(),penaltyData=ref({totalPenalty:0,groups:[]}),displayMode=ref(1);reactive({env:window.beamng&&!window.beamng.shipping,vue:!1}),events$3.on(`RallyGameplayInteract`,data=>{data&&data.forceShowTimecard?displayMode.value=1:displayMode.value===1?displayMode.value=0:displayMode.value=1});let toggleLabel=computed(()=>displayMode.value===1?`Hide`:`Show`),interactLabel=computed(()=>`[action=gameplay_interact]`),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},showDebugInfo=ref(!1),missionName=ref(``),activeState=ref(ActiveState.INACTIVE),timecardData=ref([]),rallyClockData=reactive({}),vehicleProximityData=reactive({}),scheduleData=reactive({}),stageData=reactive({}),countdownData=reactive({}),themeColor=computed(()=>`#07ff00`);function shouldShowApp(){return displayMode.value===1}function formatPenaltyType(type){return type?type.replace(/_/g,` `):``}let streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.timecardData&&(timecardData.value=data.timecardData),data.penaltyData&&(penaltyData.value=data.penaltyData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),data.showDebugInfo!==void 0&&(showDebugInfo.value=data.showDebugInfo),data.missionName!==void 0&&(missionName.value=data.missionName||``),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}return rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$153,[createVNode(Transition,{name:`slide`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_2$126,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_3$113,[createVNode(unref(dynamicComponent_default),{template:`[action=gameplay_interact]${toggleLabel.value} Time Card`,bbcode:``},null,8,[`template`])]),createBaseVNode(`div`,_hoisted_4$92,[createBaseVNode(`div`,_hoisted_5$80,[createBaseVNode(`div`,_hoisted_6$66,[_cache[0]||=createBaseVNode(`span`,{class:`rally-card-title`},`TIME CARD`,-1),createBaseVNode(`img`,{class:`header-beamng-logo`,src:unref(getAssetURL)(`images/beamng-logo-mono_189x174.png`)},null,8,_hoisted_7$58)]),missionName.value?(openBlock(),createElementBlock(`div`,_hoisted_8$48,`Event: `+toDisplayString(missionName.value),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$42,[(openBlock(!0),createElementBlock(Fragment,null,renderList(timecardData.value,(entry,idx)=>(openBlock(),createElementBlock(Fragment,{key:idx},[idx>0&&entry.group!==timecardData.value[idx-1].group?(openBlock(),createElementBlock(`div`,_hoisted_10$35)):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`checklist-row`,{completed:entry.recordedTime||entry.stageTime,"stage-entry":entry.isStageEntry,early:entry.status===`early`,late:entry.status===`late`,"on-time":entry.status===`on-time`,pending:!entry.recordedTime&&!entry.stageTime}])},[createBaseVNode(`div`,_hoisted_11$31,[_cache[1]||=createBaseVNode(`div`,{class:`event-label-top`},`\xA0`,-1),createBaseVNode(`div`,_hoisted_12$25,toDisplayString(entry.label),1)]),createBaseVNode(`div`,_hoisted_13$22,[entry.isStageEntry?(openBlock(),createElementBlock(`div`,_hoisted_14$21,[_cache[2]||=createBaseVNode(`div`,{class:`time-widget-label`},`Time Taken`,-1),createBaseVNode(`div`,_hoisted_15$20,[entry.stageTime?(openBlock(),createElementBlock(`div`,_hoisted_16$20,[createTextVNode(toDisplayString(entry.stageTime),1),entry.stageTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_17$16,toDisplayString(entry.stageTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_18$14,[_cache[3]||=createBaseVNode(`div`,{class:`time-widget-label`},`Due`,-1),createBaseVNode(`div`,_hoisted_19$11,[entry.scheduledTime?(openBlock(),createElementBlock(`div`,_hoisted_20$10,[createTextVNode(toDisplayString(entry.scheduledTime.time),1),entry.scheduledTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_21$10,toDisplayString(entry.scheduledTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_22$8,[createBaseVNode(`div`,_hoisted_23$7,[_cache[4]||=createBaseVNode(`div`,{class:`time-widget-label`},`Actual`,-1),createBaseVNode(`div`,_hoisted_24$6,[entry.recordedTime?(openBlock(),createElementBlock(`div`,_hoisted_25$5,[createTextVNode(toDisplayString(entry.recordedTime.time),1),entry.recordedTime.ampm?(openBlock(),createElementBlock(`span`,_hoisted_26$4,toDisplayString(entry.recordedTime.ampm),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_27$4,[_cache[5]||=createBaseVNode(`div`,{class:`time-widget-label`},`Status`,-1),createBaseVNode(`div`,_hoisted_28$3,[entry.status===`early`?(openBlock(),createElementBlock(`span`,_hoisted_29$3,`EARLY`)):entry.status===`late`?(openBlock(),createElementBlock(`span`,_hoisted_30$3,`LATE`)):entry.recordedTime||entry.status===`on-time`?(openBlock(),createElementBlock(`span`,_hoisted_31$3,`OK`)):createCommentVNode(``,!0)])])])],64))])],2)],64))),128))])]),penaltyData.value&&penaltyData.value.totalPenalty>0?(openBlock(),createElementBlock(`div`,_hoisted_32$3,[createBaseVNode(`div`,_hoisted_33$3,[createBaseVNode(`div`,_hoisted_34$3,[_cache[7]||=createBaseVNode(`span`,{class:`rally-card-title`},`PENALTIES`,-1),createBaseVNode(`div`,_hoisted_35$2,[_cache[6]||=createBaseVNode(`span`,{class:`total-label`},`Total`,-1),createBaseVNode(`span`,_hoisted_36$2,toDisplayString(penaltyData.value.totalPenalty)+`s`,1)])])]),createBaseVNode(`div`,_hoisted_37$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(penaltyData.value.groups,(group,idx)=>withDirectives((openBlock(),createElementBlock(`div`,{key:idx,class:`penalty-group`},[createBaseVNode(`div`,_hoisted_38$1,[createBaseVNode(`span`,_hoisted_39$1,toDisplayString(group.eventGroup),1),_cache[8]||=createBaseVNode(`span`,{class:`group-mid`},null,-1),createBaseVNode(`span`,_hoisted_40$1,toDisplayString(group.totalPenalty)+`s`,1)]),createBaseVNode(`div`,_hoisted_41$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.penalties,(penalty,pidx)=>(openBlock(),createElementBlock(`div`,{key:pidx,class:`penalty-item`},[createBaseVNode(`span`,_hoisted_42$1,toDisplayString(formatPenaltyType(penalty.type)),1),createBaseVNode(`span`,_hoisted_43$1,toDisplayString(penalty.amount)+`s (x`+toDisplayString(penalty.count)+`)`,1)]))),128))])])),[[vShow,group.totalPenalty>0]])),128))])])):createCommentVNode(``,!0)])])):(openBlock(),createElementBlock(`div`,_hoisted_44$1,[createBaseVNode(`div`,null,[createVNode(unref(dynamicComponent_default),{template:interactLabel.value,bbcode:``},null,8,[`template`]),createBaseVNode(`div`,_hoisted_45$1,[createBaseVNode(`div`,null,toDisplayString(toggleLabel.value),1),_cache[9]||=createBaseVNode(`div`,null,`Time Card`,-1)])])]))]),_:1})]))}},appTimecard_default=__plugin_vue_export_helper_default(_sfc_main$171,[[`__scopeId`,`data-v-216504fd`]]),_hoisted_1$152={class:`rally-dashboard-app-container`},_hoisted_2$125={class:`dashboard-widget widget-rally-clock`},_hoisted_3$112={key:0,class:`period`},_hoisted_4$91={class:`dashboard-widget widget-rally-sstime`},_hoisted_5$79={class:`widget-value`},_hoisted_6$65={class:`dashboard-widget widget-rally-objective`},_hoisted_7$57={class:`widget-value`},_hoisted_8$47={key:2},_sfc_main$170={__name:`appDashboard`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),recoverVehicleTemplate=computed(()=>` Press [action=reset_physics] to recover vehicle.`),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockTime:null,day:null,totalTime:0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),clockFlash=ref(!1);events$3.on(`RallyClockSkipped`,()=>{clockFlash.value=!1,setTimeout(()=>{clockFlash.value=!0},0),setTimeout(()=>{clockFlash.value=!1},1e3)});let scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1,speedLimit:null,speedLimitDisplay:null,speedUnit:`km/h`}),formattedWallClock=computed(()=>rallyClockData.wallClockTime?{time:rallyClockData.wallClockTime.time||`--:--:--`,period:rallyClockData.wallClockTime.ampm||``}:{time:`--:--:--`,period:``}),objectiveText=computed(()=>{let obj=scheduleData;return!obj||!obj.eventType?[]:obj.eventType===`service_in`?[`Drive to your `,{type:`badge`,val:`service bay`,class:`tc-badge`},`.`]:obj.eventType===`tc`&&obj.label===`TC0`?[`Reverse out and reach `,{type:`badge`,val:obj.label,class:`tc-badge`},` between `,{type:`clock`,val:obj.eventWallClockStart,class:`clock-badge`},` - `,{type:`clock`,val:obj.eventWallClockEnd,class:`clock-badge`},`. Penalty for each minute early or late: `,{type:`badge`,val:`+10s`,class:`penalty-badge`},`.`]:obj.eventType===`tc`?[`Reach `,{type:`badge`,val:obj.label,class:`tc-badge`},` between `,{type:`clock`,val:obj.eventWallClockStart,class:`clock-badge`},` - `,{type:`clock`,val:obj.eventWallClockEnd,class:`clock-badge`},`. Penalty for each minute early or late: `,{type:`badge`,val:`10sec`,class:`penalty-badge`},`.`]:[]}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function isStageActive(){return activeState.value===ActiveState.STAGE_ACTIVE}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$152,[isStageActive()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`rally-dashboard-app`,{"show-active-stage":isStageActive()}])},[createBaseVNode(`div`,_hoisted_2$125,[_cache[0]||=createBaseVNode(`div`,{class:`widget-label`},`Event Clock`,-1),createBaseVNode(`div`,{class:normalizeClass([`widget-value clock-value`,{"flash-pink":clockFlash.value}])},[createTextVNode(toDisplayString(formattedWallClock.value.time),1),formattedWallClock.value.period?(openBlock(),createElementBlock(`span`,_hoisted_3$112,toDisplayString(formattedWallClock.value.period),1)):createCommentVNode(``,!0)],2)]),createBaseVNode(`div`,_hoisted_4$91,[_cache[1]||=createBaseVNode(`div`,{class:`widget-label`},`Your Time`,-1),createBaseVNode(`div`,_hoisted_5$79,toDisplayString(rallyClockData.totalTime),1)]),createBaseVNode(`div`,_hoisted_6$65,[_cache[2]||=createBaseVNode(`div`,{class:`widget-label`},`Instructions`,-1),createBaseVNode(`div`,_hoisted_7$57,[(openBlock(!0),createElementBlock(Fragment,null,renderList(objectiveText.value,item=>(openBlock(),createElementBlock(`span`,{key:item},[item.type===`badge`?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(item.class)},toDisplayString(item.val),3)):item.type===`clock`?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(item.class)},toDisplayString(item.val.time)+toDisplayString(item.val.period),3)):(openBlock(),createElementBlock(`span`,_hoisted_8$47,toDisplayString(item),1))]))),128)),createVNode(unref(dynamicComponent_default),{template:recoverVehicleTemplate.value,bbcode:``},null,8,[`template`])])])],2))])]),_:1}))}},appDashboard_default=__plugin_vue_export_helper_default(_sfc_main$170,[[`__scopeId`,`data-v-a3bb6c18`]]),_hoisted_1$151={class:`rally-debug-app-container`},_hoisted_2$124={key:0,class:`debug-info`},_sfc_main$169={__name:`appDebug`,setup(__props){let{lua}=useBridge(),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},showDebugInfo=ref(!0),activeState=ref(ActiveState.INACTIVE),timecardData=ref([]),penaltyData=ref({totalPenalty:0,groups:[]}),rallyClockData=reactive({}),vehicleProximityData=reactive({}),scheduleData=reactive({}),stageData=reactive({}),countdownData=reactive({}),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.timecardData&&(timecardData.value=data.timecardData),data.penaltyData&&(penaltyData.value=data.penaltyData),data.stageData&&Object.assign(stageData,data.stageData),data.countdownData&&Object.assign(countdownData,data.countdownData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}return rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$151,[showDebugInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_2$124,[createBaseVNode(`div`,null,`activeState: "`+toDisplayString(activeState.value)+`"`,1),createBaseVNode(`div`,null,`rallyClock: `+toDisplayString(rallyClockData),1),createBaseVNode(`div`,null,`countdownData: `+toDisplayString(countdownData),1),createBaseVNode(`div`,null,`vehicleProximityData: `+toDisplayString(vehicleProximityData),1),createBaseVNode(`div`,null,`scheduleData: `+toDisplayString(scheduleData),1),createBaseVNode(`div`,null,`timecardData: `+toDisplayString(timecardData.value),1),createBaseVNode(`div`,null,`penaltyData: `+toDisplayString(penaltyData.value),1),createBaseVNode(`div`,null,`stageData: `+toDisplayString(stageData),1)])):createCommentVNode(``,!0)]))}},appDebug_default=__plugin_vue_export_helper_default(_sfc_main$169,[[`__scopeId`,`data-v-c2c6bfeb`]]),_hoisted_1$150={class:`distance-widget-svg`},_hoisted_2$123=[`x`,`y`,`height`],_hoisted_3$111=[`x`,`y`,`width`,`height`],_hoisted_4$90=[`x`,`y`,`width`,`height`],_hoisted_5$78=[`x`,`y`,`width`,`height`],_hoisted_6$64={x:0,y:`90%`,"text-anchor":`middle`},_hoisted_7$56={class:`tick-label`},_hoisted_8$46={class:`tick-label-unit`,dx:`2`},_hoisted_9$41=[`x`,`y`,`width`,`height`],_hoisted_10$34={x:0,y:`90%`,dx:`20`,"text-anchor":`end`},_hoisted_11$30={key:0,class:`tick-label-bold`},_hoisted_12$24={class:`tick-label-unit`,dx:`2`},_hoisted_13$21=[`x`,`y`,`width`,`height`],PAD_PX=20,PADRIGHT_PX=26,barHeightPct=8,barCenterY=50,tickStrokeWidth=2,tickSize=12,trackingRectSize=14,_sfc_main$168={__name:`DistanceWidgetSVGRect`,props:{distPct:{type:Number,required:!0},totalDistM:{type:Number,required:!0},splits:{type:Array,default:()=>[]},splitPrecision:{type:Number,default:1},themeColor:{type:String,required:!0},unit:{type:String,default:`km`}},setup(__props){useCssVars(_ctx=>({v94238812:__props.themeColor}));let props=__props,barStartX=PAD_PX,barY=barCenterY-barHeightPct/2;100-PADRIGHT_PX,computed(()=>PAD_PX+(100-PAD_PX-PADRIGHT_PX)*props.distPct);let currentX=computed(()=>`calc(${PAD_PX}px + (100% - ${PAD_PX+PADRIGHT_PX}px) * ${props.distPct})`),barWidth=`calc(100% - ${PAD_PX+PADRIGHT_PX}px)`,progressWidth=computed(()=>`calc((100% - ${PAD_PX+PADRIGHT_PX}px) * ${props.distPct})`),barEndX=`calc(100% - ${PADRIGHT_PX}px)`,splitMarkers=computed(()=>props.splits?props.splits.filter(s=>typeof s?.pathnodeType==`string`&&s.pathnodeType.startsWith(`split_`)).map((s,idx)=>{let pct=s.distPct||0,x=`calc(${PAD_PX}px + (100% - ${PAD_PX+PADRIGHT_PX}px) * ${pct})`;return{key:s.pathnodeId??idx,x,label:{val:s.splitLabel,unit:props.unit}}}):[]),finalSplitLabel=computed(()=>!props.splits||props.splits.length===0?{val:null,unit:null}:{val:props.splits[props.splits.length-1]?.splitLabel,unit:props.unit});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$150,[(openBlock(),createElementBlock(`svg`,null,[createBaseVNode(`rect`,{x:unref(barStartX)+`px`,y:barY+`%`,width:barWidth,height:barHeightPct+`%`,fill:`white`},null,8,_hoisted_2$123),createBaseVNode(`rect`,{x:unref(barStartX)+`px`,y:barY-1+`%`,width:progressWidth.value,height:barHeightPct+2+`%`,fill:`var(--theme-color)`},null,8,_hoisted_3$111),createBaseVNode(`rect`,{x:unref(barStartX)-tickSize/2+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,fill:`var(--theme-color)`},null,8,_hoisted_4$90),(openBlock(!0),createElementBlock(Fragment,null,renderList(splitMarkers.value,split=>(openBlock(),createElementBlock(`g`,{key:split.key,style:normalizeStyle(`transform: translateX(${split.x})`)},[createBaseVNode(`rect`,{x:-(tickSize/2)+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,"stroke-width":tickStrokeWidth,fill:`#202020`,stroke:`#ffffff`},null,8,_hoisted_5$78),createBaseVNode(`text`,_hoisted_6$64,[createBaseVNode(`tspan`,_hoisted_7$56,toDisplayString(split.label.val),1),createBaseVNode(`tspan`,_hoisted_8$46,toDisplayString(split.label.unit),1)])],4))),128)),createBaseVNode(`g`,{style:normalizeStyle(`transform: translateX(${barEndX})`)},[createBaseVNode(`rect`,{x:-(tickSize/2)+`px`,y:`calc(`+barCenterY+`% - `+tickSize/2+`px)`,width:tickSize+`px`,height:tickSize+`px`,"stroke-width":tickStrokeWidth,fill:`#202020`,stroke:`#ffffff`},null,8,_hoisted_9$41),createBaseVNode(`text`,_hoisted_10$34,[finalSplitLabel.value?(openBlock(),createElementBlock(`tspan`,_hoisted_11$30,toDisplayString(finalSplitLabel.value.val),1)):createCommentVNode(``,!0),createBaseVNode(`tspan`,_hoisted_12$24,toDisplayString(finalSplitLabel.value.unit),1)])],4),createBaseVNode(`g`,{style:normalizeStyle(`transform: translateX(${currentX.value})`)},[createBaseVNode(`rect`,{x:-(trackingRectSize/2)+`px`,y:`calc(`+barCenterY+`% - `+trackingRectSize/2+`px)`,width:trackingRectSize+`px`,height:trackingRectSize+`px`,fill:`var(--theme-color)`},null,8,_hoisted_13$21)],4)]))]))}},DistanceWidgetSVGRect_default=__plugin_vue_export_helper_default(_sfc_main$168,[[`__scopeId`,`data-v-9c6ef477`]]);function rallyStageThemeColor(withAlpha=null){return`#009a1a${withAlpha===!0?`a0`:``}`}var _hoisted_1$149={key:0,class:`rally-stage-timing-app`},_sfc_main$167={__name:`appStageProgress`,setup(__props){useCssVars(_ctx=>({v708a5eb2:themeColor.value}));let{lua}=useBridge();reactive({env:window.beamng&&!window.beamng.shipping,vue:!1});let ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockSecs:null,epochTime:null,day:null,totalPenalty:0,totalTime:0,use24hFormat:!0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distPct:0},unit:`km`}),themeColor=computed(()=>rallyStageThemeColor()),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function shouldShowApp(){return!0}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_1$149,[createVNode(DistanceWidgetSVGRect_default,{"dist-pct":stageData.completion.distPct,"total-dist-m":stageData.completion.totalDistM,splits:stageData.splits,"theme-color":themeColor.value,unit:stageData.unit},null,8,[`dist-pct`,`total-dist-m`,`splits`,`theme-color`,`unit`])])):createCommentVNode(``,!0)]),_:1}))}},appStageProgress_default=__plugin_vue_export_helper_default(_sfc_main$167,[[`__scopeId`,`data-v-a8eba296`]]);function formatSSTime(seconds,activeState){if(activeState===`inactive`)return`--:--:--`;let roundedSeconds=Math.round(seconds*10)/10,hours=Math.floor(roundedSeconds/3600),minutes=Math.floor(roundedSeconds%3600/60),secs=Math.floor(roundedSeconds%60),tenths=Math.round(roundedSeconds%1*10)%10;return hours>0?`${hours}:${String(minutes).padStart(2,`0`)}:${String(secs).padStart(2,`0`)}.${tenths}`:minutes>0?`${minutes}:${String(secs).padStart(2,`0`)}.${tenths}`:`${secs}.${tenths}`}var _hoisted_1$148={key:0,class:`rally-stage-timing-app`},_hoisted_2$122={class:`section-active-stage`},_hoisted_3$110={class:`stage-header`},_hoisted_4$89={class:`stage-time`},_hoisted_5$77={key:0,class:`splits-header`},_hoisted_6$63={key:1,class:`stage-splits`},_hoisted_7$55={class:`stage-split-label`},_hoisted_8$45={class:`stage-split-label-unit`},_hoisted_9$40={class:`stage-split-time`},_hoisted_10$33=[`src`],_sfc_main$166={__name:`appStageTiming`,setup(__props){let{lua}=useBridge(),ActiveState={INACTIVE:`inactive`,VEHICLE_PROXIMITY:`vehicleProximity`,STAGE_ACTIVE:`stageActive`,COUNTDOWN:`countdown`},rallyClockData=reactive({wallClockSecs:null,epochTime:null,day:null,totalPenalty:0,totalTime:0,use24hFormat:!0,canSkipTimeControls:!1,canSkipCountdown:!1,isNgrcMode:!1}),activeState=ref(ActiveState.INACTIVE),vehicleProximityData=reactive({isNear:!1,distance:0,distanceToPlane:0,isStopped:!1,isFrozen:!1,usingGroundMarkerDistance:!1}),scheduleData=reactive({label:null,eventType:null,ssLabel:null,eventWallClockStart:null,eventWallClockEnd:null,timeDiff:null,timeDiffWithEnd:null,lateness:null,penalty:0,hasPenalty:!1,canIncurLatePenalty:!1}),stageData=reactive({currentSSTime:null,isActive:!1,isComplete:!1,splits:[],label:null,completion:{distM:0,distPct:0}});computed(()=>rallyStageThemeColor(!0));let completedSplits=computed(()=>stageData.splits?.filter(split=>split.time!=null)||[]),splitUnit=computed(()=>`km`),streamsList$1=[`rallyLoop`],streamBuffer={rallyLoop:null},rafId=null;function processStreamUpdates(){if(streamBuffer.rallyLoop){let data=streamBuffer.rallyLoop;activeState.value=data.activeState||ActiveState.INACTIVE,data.rallyClock&&Object.assign(rallyClockData,data.rallyClock),data.scheduleData&&Object.assign(scheduleData,data.scheduleData),data.stageData&&Object.assign(stageData,data.stageData),data.vehicleProximity&&Object.assign(vehicleProximityData,data.vehicleProximity),streamBuffer.rallyLoop=null}rafId=requestAnimationFrame(processStreamUpdates)}rafId=requestAnimationFrame(processStreamUpdates),useStreams(streamsList$1,streams=>{streams.rallyLoop&&(streamBuffer.rallyLoop=streams.rallyLoop)}),onMounted(()=>{}),onUnmounted(()=>{rafId&&cancelAnimationFrame(rafId)});function shouldShowApp(){return!0}return(_ctx,_cache)=>(openBlock(),createBlock(Transition,{name:`fade`},{default:withCtx(()=>[shouldShowApp()?(openBlock(),createElementBlock(`div`,_hoisted_1$148,[createBaseVNode(`div`,_hoisted_2$122,[createBaseVNode(`div`,_hoisted_3$110,`STAGE `+toDisplayString(stageData.label)+` / `+toDisplayString(scheduleData.totalSSCount),1),createBaseVNode(`div`,_hoisted_4$89,toDisplayString(unref(formatSSTime)(stageData.currentSSTime,activeState.value)),1),completedSplits.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$77,`SPLITS`)):createCommentVNode(``,!0),completedSplits.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_6$63,[(openBlock(!0),createElementBlock(Fragment,null,renderList(completedSplits.value,split=>(openBlock(),createElementBlock(`div`,{class:`stage-split`,key:split.pathnodeId},[createBaseVNode(`div`,_hoisted_7$55,[createBaseVNode(`span`,null,toDisplayString(split.splitLabel),1),createBaseVNode(`span`,_hoisted_8$45,toDisplayString(splitUnit.value),1)]),createBaseVNode(`div`,_hoisted_9$40,toDisplayString(unref(formatSSTime)(split.time,activeState.value)),1)]))),128))])):createCommentVNode(``,!0),rallyClockData.isNgrcMode?(openBlock(),createElementBlock(`img`,{key:2,class:`stage-ngrc-badge`,src:unref(getAssetURL)(`images/ngrc_logo_dark_128x40.png`),alt:`NGRC`},null,8,_hoisted_10$33)):createCommentVNode(``,!0)])])):createCommentVNode(``,!0)]),_:1}))}},appStageTiming_default=__plugin_vue_export_helper_default(_sfc_main$166,[[`__scopeId`,`data-v-cea09957`]]),_hoisted_1$147={class:`gameplay-apps`},gameplayAppsFlashMessage=`GameplayAppsFlashMessage`,_sfc_main$165={__name:`gameplayApps`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),isDrift=ref(!1),isDragStaging=ref(!1),isRally=ref(!1),isPointsBar=ref(!1),isFlashMessage=ref(!1),isCountdown=ref(!1),appStates={drift:isDrift,drag:isDragStaging,rally:isRally,pointsBar:isPointsBar,flashMessage:isFlashMessage,countdown:isCountdown},setAppVisibility=data=>{data.appId&&appStates[data.appId]&&(appStates[data.appId].value=data.visible),data.hideAll&&Object.values(appStates).forEach(state=>state.value=!1)},loadInitialVisibility=async()=>{try{let visibleApps=await lua.ui_gameplayAppContainers.getVisibleApps(`gameplayApps`);Object.values(appStates).forEach(state=>state.value=!1),Array.isArray(visibleApps)&&visibleApps.forEach(appId=>{appStates[appId]&&(appStates[appId].value=!0)})}catch{}};return onMounted(()=>{events$3.on(`setGameplayAppVisibility`,setAppVisibility),lua.ui_gameplayAppContainers.onGameplayAppContainerMounted(),loadInitialVisibility()}),onUnmounted(()=>{events$3.off(`setGameplayAppVisibility`,setAppVisibility),lua.ui_gameplayAppContainers.onGameplayAppContainerUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$147,[withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isPointsBar.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$28)),mergeProps({class:`app rally`},_ctx.$attrs),null,16)),[[vShow,isRally.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$13)),mergeProps({class:`app`,showFlash:!1},_ctx.$attrs),null,16)),[[vShow,isDrift.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$11)),mergeProps({class:`app`,showFlash:!1},_ctx.$attrs),null,16)),[[vShow,isDragStaging.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(flashMessageApp_default)),mergeProps({class:`app flash-message`,"message-source":gameplayAppsFlashMessage},_ctx.$attrs),null,16)),[[vShow,isFlashMessage.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(countdownApp_default)),mergeProps({class:`countdown`},_ctx.$attrs),null,16)),[[vShow,isCountdown.value]])]))}},gameplayApps_default=__plugin_vue_export_helper_default(_sfc_main$165,[[`__scopeId`,`data-v-8ac28a96`]]),_hoisted_1$146={class:`messages-tasks-apps`},_sfc_main$164={__name:`messagesTasksApps`,setup(__props){let{lua}=useBridge(),events$3=useEvents(),isMessages=ref(!1),isTasks=ref(!1),appStates={messages:isMessages,tasks:isTasks},setAppVisibility=data=>{data.appId&&appStates[data.appId]&&(appStates[data.appId].value=data.visible),data.hideAll&&Object.values(appStates).forEach(state=>{state.value=!1})},loadInitialVisibility=async()=>{try{let visibleApps=await lua.ui_messagesTasksAppContainers.getVisibleApps(`messagesTasksApps`);Object.values(appStates).forEach(state=>{state.value=!1}),Array.isArray(visibleApps)&&visibleApps.forEach(appId=>{appStates[appId]&&(appStates[appId].value=!0)})}catch{}};return onMounted(()=>{events$3.on(`setMessagesTasksAppVisibility`,setAppVisibility),lua.ui_messagesTasksAppContainers.onMessagesTasksAppContainerMounted(),loadInitialVisibility()}),onUnmounted(()=>{events$3.off(`setMessagesTasksAppVisibility`,setAppVisibility),lua.ui_messagesTasksAppContainers.onMessagesTasksAppContainerUnmounted()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$146,[withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$27)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isTasks.value]]),withDirectives((openBlock(),createBlock(resolveDynamicComponent(unref(app_default$32)),mergeProps({class:`app`},_ctx.$attrs),null,16)),[[vShow,isMessages.value]])]))}},messagesTasksApps_default=__plugin_vue_export_helper_default(_sfc_main$164,[[`__scopeId`,`data-v-0ac32403`]]),_sfc_main$163={__name:`countdownApp`,setup(__props){let events$3=useEvents();function convertLegacyMessage(data){return Array.isArray(data)?data.map(item=>({msg:typeof item[0]==`object`?item[0].txt:item[0],ttl:item[1],luaCall:typeof item[2]==`string`?item[2]:void 0,jsCallback:typeof item[2]==`function`?item[2]:void 0,big:item[3]??!1})):data}return onMounted(()=>{events$3.on(`ScenarioFlashMessage`,data=>{let convertedData=convertLegacyMessage(data);if(Array.isArray(convertedData)&&convertedData.length>0){let lastMessage=convertedData[convertedData.length-1];lastMessage.msg===`GO!`&&(lastMessage.jsCallback=()=>{events$3.emit(`CountdownEnded`)})}events$3.emit(`CountdownMessage`,convertedData)}),events$3.on(`ScenarioNotRunning`,()=>{events$3.emit(`CountdownMessage`,{msg:``,ttl:0})})}),(_ctx,_cache)=>(openBlock(),createBlock(bngFlashMessage_default,{"message-source":`CountdownMessage`}))}},countdownApp_default=__plugin_vue_export_helper_default(_sfc_main$163,[[`__scopeId`,`data-v-8ddc025c`]]),_sfc_main$162={__name:`flashMessageApp`,setup(__props){let events$3=useEvents();return onMounted(()=>{events$3.on(`ScenarioFlashMessage`,data=>{let convertedData=Array.isArray(data)?data.map(item=>({msg:typeof item[0]==`object`?item[0].txt:item[0],ttl:item[1],luaCall:typeof item[2]==`string`?item[2]:void 0,jsCallback:typeof item[2]==`function`?item[2]:void 0,big:item[3]??!1})):data;events$3.emit(`SimpleFlashMessage`,convertedData)}),events$3.on(`ScenarioNotRunning`,()=>{events$3.emit(`SimpleFlashMessage`,{msg:``,ttl:0})})}),(_ctx,_cache)=>(openBlock(),createBlock(bngFlashMessage_default,{"message-source":`SimpleFlashMessage`}))}},flashMessageApp_default=__plugin_vue_export_helper_default(_sfc_main$162,[[`__scopeId`,`data-v-48db34d3`]]),_hoisted_1$145={class:`generic-mission-data`},_sfc_main$161={__name:`bngGenericMissionData`,setup(__props){let events$3=useEvents(),{lua}=useBridge(),displayElements=ref([]),getElementValue=element=>element.minutes||element.seconds?``:typeof element.txt==`number`?element.txt:element.style===`text`||element.style===void 0?$translate.instant(element.txt):`Error: Unsupported style`,handleMissionDataChanged=data=>{if(data){for(;displayElements.value.length<=data.index;)displayElements.value.push(null);displayElements.value[data.index]=data.element}},handleMissionDataReset=()=>{displayElements.value=[]};return onMounted(()=>{events$3.on(`SetGenericMissionData`,handleMissionDataChanged),events$3.on(`SetGenericMissionDataResetAll`,handleMissionDataReset),lua.extensions.load(`ui_apps_genericMissionData`),lua.ui_apps_genericMissionData.sendAllData()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$145,[(openBlock(!0),createElementBlock(Fragment,null,renderList(displayElements.value,(element,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[element?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:0,label:_ctx.$tt(element.title),value:getElementValue(element),icon:element.icon,minutes:element.minutes,seconds:element.seconds,milliseconds:element.milliseconds,class:`mission-data-item`},null,8,[`label`,`value`,`icon`,`minutes`,`seconds`,`milliseconds`])):createCommentVNode(``,!0)],64))),128))]))}},bngGenericMissionData_default=__plugin_vue_export_helper_default(_sfc_main$161,[[`__scopeId`,`data-v-1cdb0dd5`]]),_hoisted_1$144={class:`controls-container`},_sfc_main$160={__name:`app`,setup(__props){let{$game}=useLibStore();return ref(!0),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$144,[createVNode(unref(bngAppBindingDisplay_default))]))}},app_default$29=__plugin_vue_export_helper_default(_sfc_main$160,[[`__scopeId`,`data-v-66fafb5f`]]),_hoisted_1$143={class:`main-container-grid`},_hoisted_2$121={class:`points-display`},_hoisted_3$109={class:`star-wrapper`},_sfc_main$159={__name:`app`,setup(__props){let{lua}=useBridge(),fillPercent=ref(0),pointsLabel=ref(`0`),thresholdPercentages=ref([]),thresholdsReached=ref([]),thresholdCount=ref(0),thresholdIndices=computed(()=>Array.from({length:thresholdCount.value},(_,index)=>index));onMounted(()=>{lua.extensions.load(`ui_apps_pointsBar`),lua.ui_apps_pointsBar.requestAllData()}),onUnmounted(()=>{});let streamsList$1=[`pointsBar`];return useStreams(streamsList$1,streams=>{for(let stream of streamsList$1)if(!streams[stream])return;fillPercent.value=streams.pointsBar.fillPercent,pointsLabel.value=streams.pointsBar.pointsLabel,streams.pointsBar.thresholdPercentages&&Array.isArray(streams.pointsBar.thresholdPercentages)&&(thresholdPercentages.value=streams.pointsBar.thresholdPercentages),streams.pointsBar.thresholdsReached&&Array.isArray(streams.pointsBar.thresholdsReached)&&(thresholdsReached.value=streams.pointsBar.thresholdsReached),thresholdCount.value=streams.pointsBar.thresholdCount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$143,[createBaseVNode(`div`,{class:`progress-bar-container`,style:normalizeStyle({"--threshold-percentage":thresholdPercentages.value[0]||0})},[createBaseVNode(`div`,_hoisted_2$121,toDisplayString(_ctx.$t(pointsLabel.value)),1),createBaseVNode(`div`,{class:`progress-bar`,style:normalizeStyle({width:`${fillPercent.value*100}%`})},null,4),(openBlock(!0),createElementBlock(Fragment,null,renderList(thresholdIndices.value,i=>(openBlock(),createElementBlock(`div`,{key:i,class:normalizeClass([`limit-marker`,{passed:thresholdsReached.value[i]}]),style:normalizeStyle({left:`${thresholdPercentages.value[i]}%`})},[createBaseVNode(`div`,_hoisted_3$109,[createVNode(unref(bngIcon_default),{type:thresholdsReached.value[i]?unref(icons).star:unref(icons).starSecondary,class:normalizeClass([`star-icon`,{passed:thresholdsReached.value[i]}])},null,8,[`type`,`class`])])],6))),128))],4)]))}},app_default=__plugin_vue_export_helper_default(_sfc_main$159,[[`__scopeId`,`data-v-4e2c4ac3`]]),_hoisted_1$142={key:0,class:`minimap-container-additional-info top`},_hoisted_2$120={key:0},_hoisted_3$108={key:1,class:`minimap-container-additional-info bottom`},_hoisted_4$88={key:2},_hoisted_5$76={key:0,class:`minimap-container-additional-info top round`},_hoisted_6$62={key:0},_hoisted_7$54={key:1,class:`minimap-container-additional-info bottom round`},_hoisted_8$44={key:2},transformUpdateAttempts=15,_sfc_main$158={__name:`app`,setup(__props){useCssVars(_ctx=>({v01db66c6:squareSize.value,v32146572:minimapSize.value}));let{lua}=useBridge(),events$3=useEvents(),route=useRoute(),$globalStore=inject(`$globalStore`),uiVisible=ref(!0),initialising=ref(!1),initialised=ref(!1),minimapMode=ref(`circle`),minimapContainerRef=ref(null),containerRef=ref(null);ref(null),ref(null);let resizeObserver=ref(null),mapMetrics=reactive({x:0,y:0,width:0,height:0,xRel:0,yRel:0,widthRel:0,heightRel:0}),allowedRoutes=[`/play`,``],showMinimap=computed(()=>uiVisible.value&&!loadingScreen.shown&&$globalStore.__uiAppsShown&&!$globalStore.__introPopupShown&&!popupsView.popups&&!popupsView.activities&&allowedRoutes.includes(route.path)),additionalInfo=reactive({distToTarget:null,locationName:null,policeMode:`disabled`}),hasTopInfo=computed(()=>!!additionalInfo.locationName),hasBottomInfo=computed(()=>!!(additionalInfo.distToTarget||additionalInfo.policeMode===`visibleToPolice`||additionalInfo.policeMode===`hiddenFromPolice`));watch(hasTopInfo,val=>{showMinimap.value&&requestAnimationFrame(updateDrawTransform)}),watch(hasBottomInfo,val=>{showMinimap.value&&requestAnimationFrame(updateDrawTransform)});let transformUpdateAttempt=0,minimapSize=ref(`100%`),minimapShift=ref(`0px`),squareSize=ref(`100%`);async function updateDrawTransform(){if(minimapMode.value===`circle`&&minimapContainerRef.value){let rect$1=minimapContainerRef.value.getBoundingClientRect(),size$3=Math.min(rect$1.width,rect$1.height),sizepx=size$3+`px`;minimapSize.value!==sizepx&&(minimapSize.value=sizepx,rect$1.width>rect$1.height?minimapShift.value=-(rect$1.width-size$3)/2+`px`:minimapShift.value=`0px`,await nextTick())}if(!initialised.value||!showMinimap.value||!containerRef.value)return;let screen$1={width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY},rect=containerRef.value.getBoundingClientRect();mapMetrics.x=rect.left+screen$1.scrollX,mapMetrics.y=rect.top+screen$1.scrollY,mapMetrics.width=rect.width,mapMetrics.height=rect.height,mapMetrics.xRel=mapMetrics.x/screen$1.width,mapMetrics.yRel=mapMetrics.y/screen$1.height,mapMetrics.widthRel=mapMetrics.width/screen$1.width,mapMetrics.heightRel=mapMetrics.height/screen$1.height;let keys=[`xRel`,`yRel`,`widthRel`,`heightRel`];if(keys.some(key=>mapMetrics[key]<0||mapMetrics[key]>1)||keys.every(key=>mapMetrics[key]===0)){transformUpdateAttempt++,transformUpdateAttempt{val?updateDrawTransform():initialised.value&&sendTransformToLua(!1)}),watch([initialised,containerRef],()=>{updateDrawTransform(),containerRef.value&&!resizeObserver.value&&(resizeObserver.value=new ResizeObserver(()=>{updateDrawTransform()}),resizeObserver.value.observe(containerRef.value))},{immediate:!0}),onMounted(()=>{window.addEventListener(`scroll`,updateDrawTransform),window.addEventListener(`resize`,updateDrawTransform),events$3.on(`onCefVisibilityChanged`,visible=>{uiVisible.value=visible,nextTick(updateDrawTransform)}),initMinimap()}),onUnmounted(()=>{let wasInitialised=initialised.value;initialised.value=!1,window.removeEventListener(`scroll`,updateDrawTransform),window.removeEventListener(`resize`,updateDrawTransform),resizeObserver.value&&=(resizeObserver.value.disconnect(),null),wasInitialised&&sendTransformToLua(!1)}),useStreams([`minimap`],streams=>{streams.minimap&&(additionalInfo.distToTarget=streams.minimap.distToTarget,additionalInfo.locationName=streams.minimap.locationName,additionalInfo.policeMode=streams.minimap.policeMode)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{ref_key:`minimapContainerRef`,ref:minimapContainerRef,class:normalizeClass([`minimap-container-wrapper`,{[`police-`+additionalInfo.policeMode]:minimapMode.value===`rect`,round:minimapMode.value===`circle`}]),onClick:updateDrawTransform},[minimapMode.value===`rect`?(openBlock(),createElementBlock(Fragment,{key:0},[hasTopInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_1$142,[additionalInfo.locationName?(openBlock(),createElementBlock(`span`,_hoisted_2$120,toDisplayString(additionalInfo.locationName),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`minimap-container`,{"round-bottom":!hasBottomInfo.value,"round-top":!hasTopInfo.value}]),ref_key:`containerRef`,ref:containerRef},null,2),hasBottomInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_3$108,[additionalInfo.policeMode===`visibleToPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`eyeSolidOpened`})):createCommentVNode(``,!0),additionalInfo.policeMode===`hiddenFromPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:`eyeSolidClosed`})):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createElementBlock(`span`,_hoisted_4$88,toDisplayString(additionalInfo.distToTarget),1)):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createBlock(unref(bngIcon_default),{key:3,class:``,type:`mapPoint`})):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):minimapMode.value===`circle`?(openBlock(),createElementBlock(Fragment,{key:1},[hasTopInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_5$76,[additionalInfo.locationName?(openBlock(),createElementBlock(`span`,_hoisted_6$62,toDisplayString(additionalInfo.locationName),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`minimap-container round`,{[`police-`+additionalInfo.policeMode]:!0}]),ref_key:`containerRef`,ref:containerRef},null,2),hasBottomInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_7$54,[additionalInfo.policeMode===`visibleToPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`eyeSolidOpened`})):createCommentVNode(``,!0),additionalInfo.policeMode===`hiddenFromPolice`?(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:`eyeSolidClosed`})):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createElementBlock(`span`,_hoisted_8$44,toDisplayString(additionalInfo.distToTarget),1)):createCommentVNode(``,!0),additionalInfo.distToTarget?(openBlock(),createBlock(unref(bngIcon_default),{key:3,class:``,type:`mapPoint`})):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0)],2))}},app_default$30=__plugin_vue_export_helper_default(_sfc_main$158,[[`__scopeId`,`data-v-4d3d3a71`]]),_hoisted_1$141={class:`hotlapping-app`},_hoisted_2$119={class:`hotlapping-header`},_hoisted_3$107={class:`header-flex`},_hoisted_4$87={class:`hotlapping-content`},_hoisted_5$75={key:0,class:`grid-header`},_hoisted_6$61={class:`grid-item current-item`},_hoisted_7$53={class:`grid-item current-item`},_hoisted_8$43={class:`grid-item current-item`},_sfc_main$157={__name:`app`,setup(__props){useEvents();let fastData=ref({}),slowData=ref({}),staticData=ref({}),placementData=ref({}),displayMode=ref(`combined`);onMounted(()=>{useStreams([`lapTimes_fast`,`lapTimes_slow`,`lapTimes_static`,`lapTimes_placement`],streams=>{streams.lapTimes_fast&&(fastData.value=streams.lapTimes_fast),streams.lapTimes_slow&&(slowData.value=streams.lapTimes_slow),streams.lapTimes_static&&(staticData.value=streams.lapTimes_static),streams.lapTimes_placement&&(placementData.value=streams.lapTimes_placement)})}),onUnmounted(()=>{});let getLapValue=()=>`${slowData.value?.currentLap||0}/${staticData.value?.totalLaps||0}`,getSegmentValue=()=>`${slowData.value?.currentSegment||0}/${staticData.value?.totalSegments||0}`,getTotalRaceTime=()=>fastData.value?.currentTimeFormatted||`00:00.000`,parseTimeString=timeStr=>{if(!timeStr)return{minutes:`00`,seconds:`00`,milliseconds:`000`};let parts=timeStr.split(`:`);if(parts.length===2){let minutes=parts[0].padStart(2,`0`),secondsParts=parts[1].split(`.`);return{minutes,seconds:secondsParts[0].padStart(2,`0`),milliseconds:secondsParts[1]?secondsParts[1].padEnd(3,`0`):`000`}}else{let secondsParts=parts[0].split(`.`);return{minutes:`00`,seconds:secondsParts[0].padStart(2,`0`),milliseconds:secondsParts[1]?secondsParts[1].padEnd(3,`0`):`000`}}},getTotalRaceTimeMinutes=()=>parseTimeString(getTotalRaceTime()).minutes,getTotalRaceTimeSeconds=()=>parseTimeString(getTotalRaceTime()).seconds,getTotalRaceTimeMilliseconds=()=>parseTimeString(getTotalRaceTime()).milliseconds,isRacing=()=>slowData.value?.status===`started`||slowData.value?.status===`paused`,getCurrentLapDiffClass=()=>{let flavor=fastData.value?.currentLapDiffToBestFlavor;return flavor===`better`?`diff-better`:flavor===`worse`?`diff-worse`:`diff-neutral`},getDiffClass=(flavor,value)=>!value||value===``||value===`N/A`?`diff-neutral`:flavor===`better`?`diff-better`:flavor===`worse`?`diff-worse`:`diff-neutral`,shouldShowToggleIcon=()=>(staticData.value?.totalLaps||0)>1,shouldShowSegmentsByDefault=()=>(staticData.value?.totalLaps||0)<=1,cycleDisplayMode=()=>{if(shouldShowToggleIcon()){let modes=[`combined`,`laps`,`segments`];displayMode.value=modes[(modes.indexOf(displayMode.value)+1)%modes.length]}},getTableHeaderLabel=()=>displayMode.value===`combined`?`Combined`:displayMode.value===`segments`?`Split`:`Lap`,shouldHideVsPrevBest=()=>(staticData.value?.totalLaps||0)<=1,getCurrentTimeFormatted=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?fastData.value?.currentSegmentTimeFormatted:fastData.value?.currentLapTimeFormatted,getCurrentItemNumber=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?`${slowData.value?.currentLap||1}-${slowData.value?.currentSegment||1}`:slowData.value?.currentLap||1,getCurrentDiff=()=>displayMode.value===`segments`||shouldShowSegmentsByDefault()&&displayMode.value===`combined`?fastData.value?.currentSegmentDiffToBestFormatted||``:fastData.value?.currentLapDiffToBestFormatted||``,getCurrentTotalTime=()=>fastData.value?.currentTimeFormatted||``,getFilteredCombinedItems=()=>{if(!slowData.value||!slowData.value.combinedTimes||!Array.isArray(slowData.value.combinedTimes))return[];let filtered=[];return displayMode.value===`combined`?filtered=[...slowData.value.combinedTimes]:displayMode.value===`laps`?filtered=slowData.value.combinedTimes.filter(item=>item.type===`lap`):displayMode.value===`segments`&&(filtered=slowData.value.combinedTimes.filter(item=>item.type===`segment`)),filtered.reverse()},getItemKey=item=>`${item.type}-${item.identifier}`,getItemNumber=item=>item.identifier;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$141,[createBaseVNode(`div`,_hoisted_2$119,[createBaseVNode(`div`,_hoisted_3$107,[staticData.value.totalLaps>1?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:0,class:`header-cell`,label:`Lap`,value:getLapValue()},null,8,[`value`])):createCommentVNode(``,!0),staticData.value.totalSegments>1?(openBlock(),createBlock(bngSimpleDataDisplay_default,{key:1,class:`header-cell`,label:`Split`,value:getSegmentValue()},null,8,[`value`])):createCommentVNode(``,!0),createVNode(bngSimpleDataDisplay_default,{class:`header-cell`,label:`Race Clock`,minutes:getTotalRaceTimeMinutes(),seconds:getTotalRaceTimeSeconds(),milliseconds:getTotalRaceTimeMilliseconds()},null,8,[`minutes`,`seconds`,`milliseconds`])])]),createBaseVNode(`div`,_hoisted_4$87,[createBaseVNode(`div`,{class:normalizeClass([`times-grid`,{"single-lap":shouldHideVsPrevBest()}])},[createBaseVNode(`div`,{class:normalizeClass([`grid-header clickable-header`,{"has-toggle":shouldShowToggleIcon()}]),onClick:_cache[0]||=$event=>shouldShowToggleIcon()?cycleDisplayMode():null},toDisplayString(getTableHeaderLabel()),3),_cache[1]||=createBaseVNode(`div`,{class:`grid-header`},`Duration`,-1),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$75,`Vs prev`)),_cache[2]||=createBaseVNode(`div`,{class:`grid-header`},`Total`,-1),isRacing()&&getCurrentTimeFormatted()?(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_6$61,toDisplayString(getCurrentItemNumber()),1),createBaseVNode(`div`,_hoisted_7$53,toDisplayString(getCurrentTimeFormatted()),1),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`grid-item current-item`,getCurrentLapDiffClass()])},toDisplayString(getCurrentDiff()),3)),createBaseVNode(`div`,_hoisted_8$43,toDisplayString(getCurrentTotalTime()),1)],64)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(getFilteredCombinedItems(),item=>(openBlock(),createElementBlock(Fragment,{key:getItemKey(item)},[createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item left-indicator":item.flavor===`best`,"is-lap":item.type===`lap`}])},toDisplayString(getItemNumber(item)),3),createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item":item.flavor===`best`}])},toDisplayString(item.durationFormatted),3),shouldHideVsPrevBest()?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`grid-item`,[{"best-item":item.flavor===`best`},getDiffClass(item.diffToPreviousFlavor,item.diffToPreviousFormatted)]])},toDisplayString(item.diffToPreviousFormatted||``),3)),createBaseVNode(`div`,{class:normalizeClass([`grid-item`,{"best-item":item.flavor===`best`}])},toDisplayString(item.endTimeFormatted||``),3)],64))),128))],2)])]))}},app_default$31=__plugin_vue_export_helper_default(_sfc_main$157,[[`__scopeId`,`data-v-a9e5d83a`]]),_hoisted_1$140={class:`laptimes-section`},_hoisted_2$118={class:`collapse-icon`},_hoisted_3$106={class:`collapsible-content`},_hoisted_4$86={class:`laptimes-data-grid`},_hoisted_5$74={key:0,class:`data-item`},_hoisted_6$60={class:`value`},_hoisted_7$52={key:1,class:`data-item`},_hoisted_8$42={class:`data-item`},_hoisted_9$39={class:`value`},_hoisted_10$32={class:`data-item`},_hoisted_11$29={class:`value`},_hoisted_12$23={class:`data-item`},_hoisted_13$20={class:`value`},_hoisted_14$20={class:`data-item`},_hoisted_15$19={class:`value`},_hoisted_16$19={key:0,class:`laptimes-data-grid`,style:{"margin-top":`1rem`}},_hoisted_17$15={key:0,class:`data-item`},_hoisted_18$13={key:1,class:`data-item`},_hoisted_19$10={key:1,class:`laptimes-data-grid`,style:{"margin-top":`1rem`}},_hoisted_20$9={key:0,class:`data-item`},_hoisted_21$9={key:1,class:`data-item`},_sfc_main$156={__name:`BasicInfo`,props:{fastData:{type:Object,required:!0},staticData:{type:Object,required:!0},slowData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$140,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$118,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Race Info `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$106,[createBaseVNode(`div`,_hoisted_4$86,[__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,_hoisted_5$74,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Current Time:`,-1),createBaseVNode(`span`,_hoisted_6$60,toDisplayString(__props.fastData.currentTimeFormatted||`00:00.000`),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$52,[_cache[2]||=createBaseVNode(`span`,{class:`label`},`Status:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,{active:__props.slowData.status===`started`,paused:__props.slowData.status===`paused`}])},toDisplayString(__props.slowData.status?.toUpperCase()||`STOPPED`),3)])),createBaseVNode(`div`,_hoisted_8$42,[_cache[3]||=createBaseVNode(`span`,{class:`label`},`Lap:`,-1),createBaseVNode(`span`,_hoisted_9$39,toDisplayString(__props.slowData.currentLap||0)+`/`+toDisplayString(__props.staticData.totalLaps||0),1)]),createBaseVNode(`div`,_hoisted_10$32,[_cache[4]||=createBaseVNode(`span`,{class:`label`},`Segment:`,-1),createBaseVNode(`span`,_hoisted_11$29,toDisplayString(__props.slowData.currentSegment||0)+`/`+toDisplayString(__props.staticData.totalSegments||0),1)]),createBaseVNode(`div`,_hoisted_12$23,[_cache[5]||=createBaseVNode(`span`,{class:`label`},`Current Lap Time:`,-1),createBaseVNode(`span`,_hoisted_13$20,toDisplayString(__props.fastData.currentLapTimeFormatted||`00:00.000`),1)]),createBaseVNode(`div`,_hoisted_14$20,[_cache[6]||=createBaseVNode(`span`,{class:`label`},`Current Segment Time:`,-1),createBaseVNode(`span`,_hoisted_15$19,toDisplayString(__props.fastData.currentSegmentTimeFormatted||`00:00.000`),1)])]),__props.fastData.currentLapDiffToBestFormatted||__props.fastData.currentLapDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_16$19,[__props.fastData.currentLapDiffToBestFormatted?(openBlock(),createElementBlock(`div`,_hoisted_17$15,[_cache[7]||=createBaseVNode(`span`,{class:`label`},`Lap Diff to Best:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentLapDiffToBestFlavor||`default`)])},toDisplayString(__props.fastData.currentLapDiffToBestFormatted),3)])):createCommentVNode(``,!0),__props.fastData.currentLapDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_18$13,[_cache[8]||=createBaseVNode(`span`,{class:`label`},`Lap Diff to Previous:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentLapDiffToPreviousFlavor||`default`)])},toDisplayString(__props.fastData.currentLapDiffToPreviousFormatted),3)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.fastData.currentSegmentDiffToBestFormatted||__props.fastData.currentSegmentDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_19$10,[__props.fastData.currentSegmentDiffToBestFormatted?(openBlock(),createElementBlock(`div`,_hoisted_20$9,[_cache[9]||=createBaseVNode(`span`,{class:`label`},`Segment Diff to Best:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentSegmentDiffToBestFlavor||`default`)])},toDisplayString(__props.fastData.currentSegmentDiffToBestFormatted),3)])):createCommentVNode(``,!0),__props.fastData.currentSegmentDiffToPreviousFormatted?(openBlock(),createElementBlock(`div`,_hoisted_21$9,[_cache[10]||=createBaseVNode(`span`,{class:`label`},`Segment Diff to Previous:`,-1),createBaseVNode(`span`,{class:normalizeClass([`value`,`diff-`+(__props.fastData.currentSegmentDiffToPreviousFlavor||`default`)])},toDisplayString(__props.fastData.currentSegmentDiffToPreviousFormatted),3)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},BasicInfo_default=__plugin_vue_export_helper_default(_sfc_main$156,[[`__scopeId`,`data-v-4329fa2c`]]),_hoisted_1$139={class:`laptimes-section`},_hoisted_2$117={class:`collapse-icon`},_hoisted_3$105={class:`collapsible-content`},_hoisted_4$85={class:`laptimes-data-grid`,style:{"margin-bottom":`1rem`}},_hoisted_5$73={class:`data-item`},_hoisted_6$59={class:`value`},_hoisted_7$51={key:0,class:`laptimes-data-grid`},_hoisted_8$41={class:`label`},_hoisted_9$38={class:`value`},_sfc_main$155={__name:`BestTimes`,props:{slowData:{type:Object,required:!0}},setup(__props){let props=__props,isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getBestLapDisplay=()=>{let bestTime=props.slowData.bestLapTimeFormatted||`N/A`,bestIndex=props.slowData.bestLapIndex===-1?null:props.slowData.bestLapIndex;return bestTime===`N/A`||bestIndex===null?`N/A`:`${bestTime} in Lap ${bestIndex}`},getBestSegmentDisplayFromData=segmentData=>{if(!segmentData||typeof segmentData!=`object`)return`N/A`;let time=segmentData.time||`N/A`,lap=segmentData.lap;return lap?`${time} in Lap ${lap}`:time};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$139,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$117,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Best Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$105,[createBaseVNode(`div`,_hoisted_4$85,[createBaseVNode(`div`,_hoisted_5$73,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Best Lap:`,-1),createBaseVNode(`span`,_hoisted_6$59,toDisplayString(getBestLapDisplay()),1)])]),__props.slowData.bestSegmentTimesFormatted&&Object.keys(__props.slowData.bestSegmentTimesFormatted).length>0?(openBlock(),createElementBlock(`div`,_hoisted_7$51,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.bestSegmentTimesFormatted,(segmentData,segment)=>(openBlock(),createElementBlock(`div`,{class:`data-item`,key:segment},[createBaseVNode(`span`,_hoisted_8$41,`Best Segment `+toDisplayString(parseInt(segment)+1)+`:`,1),createBaseVNode(`span`,_hoisted_9$38,toDisplayString(getBestSegmentDisplayFromData(segmentData)),1)]))),128))])):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},BestTimes_default=__plugin_vue_export_helper_default(_sfc_main$155,[[`__scopeId`,`data-v-3cd1750d`]]),_hoisted_1$138={class:`laptimes-section`},_hoisted_2$116={class:`collapse-icon`},_hoisted_3$104={class:`collapsible-content`},_hoisted_4$84={class:`table-header`},_hoisted_5$72={key:0},_hoisted_6$58={key:1},_hoisted_7$50={key:0,class:`table-row current-lap-row`},_sfc_main$154={__name:`LapTimes`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getDiffFlavorClass=flavor=>flavor?{"diff-better":flavor===`better`,"diff-worse":flavor===`worse`,"diff-same":flavor===`same`}:``;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$138,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$116,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Lap Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$104,[__props.slowData.lapTimes&&__props.slowData.lapTimes.length>0||__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`laptimes-table`,{"single-lap":__props.staticData.totalLaps<=1}])},[createBaseVNode(`div`,_hoisted_4$84,[_cache[1]||=createBaseVNode(`span`,null,`Lap`,-1),_cache[2]||=createBaseVNode(`span`,null,`Time`,-1),_cache[3]||=createBaseVNode(`span`,null,`Duration`,-1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_5$72,`Diff to Best`)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_6$58,`Diff to Prev`)):createCommentVNode(``,!0)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.lapTimes,lap=>(openBlock(),createElementBlock(`div`,{key:lap.lap,class:normalizeClass([`table-row`,{"best-lap":lap.lapFlavor===`best`,"current-lap":lap.isCurrent}])},[createBaseVNode(`span`,null,toDisplayString(lap.lap),1),createBaseVNode(`span`,null,toDisplayString(lap.timeFormatted||lap.endTimeFormatted||`N/A`),1),createBaseVNode(`span`,null,toDisplayString(lap.durationFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(lap.diffToBestFlavor))},toDisplayString(lap.diffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(lap.diffToPreviousFlavor))},toDisplayString(lap.diffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)],2))),128)),(__props.slowData.status===`started`||__props.slowData.status===`paused`)&&__props.fastData.currentLapTimeFormatted?(openBlock(),createElementBlock(`div`,_hoisted_7$50,[createBaseVNode(`span`,null,toDisplayString(__props.slowData.currentLap||1),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentTimeFormatted),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentLapTimeFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentLapDiffToBestFlavor))},toDisplayString(__props.fastData.currentLapDiffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentLapDiffToPreviousFlavor))},toDisplayString(__props.fastData.currentLapDiffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},LapTimes_default=__plugin_vue_export_helper_default(_sfc_main$154,[[`__scopeId`,`data-v-ed892fc5`]]),_hoisted_1$137={class:`laptimes-section`},_hoisted_2$115={class:`collapse-icon`},_hoisted_3$103={class:`collapsible-content`},_hoisted_4$83={class:`table-header`},_hoisted_5$71={key:0},_hoisted_6$57={key:1},_hoisted_7$49={key:0,class:`table-row current-segment-row`},_sfc_main$153={__name:`SegmentTimes`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},getDiffFlavorClass=flavor=>flavor?{"diff-better":flavor===`better`,"diff-worse":flavor===`worse`,"diff-same":flavor===`same`}:``;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$137,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$115,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Segment Times `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$103,[__props.slowData.segmentTimes&&__props.slowData.segmentTimes.length>0||__props.slowData.status===`started`||__props.slowData.status===`paused`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`laptimes-table`,{"single-lap":__props.staticData.totalLaps<=1}])},[createBaseVNode(`div`,_hoisted_4$83,[_cache[1]||=createBaseVNode(`span`,null,`Segment`,-1),_cache[2]||=createBaseVNode(`span`,null,`Time`,-1),_cache[3]||=createBaseVNode(`span`,null,`Duration`,-1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_5$71,`Diff to Best`)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,_hoisted_6$57,`Diff to Prev`)):createCommentVNode(``,!0)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.slowData.segmentTimes,segment=>(openBlock(),createElementBlock(`div`,{key:segment.segment,class:normalizeClass([`table-row`,{"best-segment":segment.segmentFlavor===`best`,"current-segment":segment.isCurrent}])},[createBaseVNode(`span`,null,toDisplayString(segment.segment),1),createBaseVNode(`span`,null,toDisplayString(segment.timeFormatted||segment.endTimeFormatted||`N/A`),1),createBaseVNode(`span`,null,toDisplayString(segment.durationFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(segment.diffToBestFlavor))},toDisplayString(segment.diffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(segment.diffToPreviousFlavor))},toDisplayString(segment.diffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)],2))),128)),(__props.slowData.status===`started`||__props.slowData.status===`paused`)&&__props.fastData.currentSegmentTimeFormatted?(openBlock(),createElementBlock(`div`,_hoisted_7$49,[createBaseVNode(`span`,null,toDisplayString(__props.slowData.currentLap||1)+`-`+toDisplayString(__props.slowData.currentSegment||1),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentTimeFormatted),1),createBaseVNode(`span`,null,toDisplayString(__props.fastData.currentSegmentTimeFormatted),1),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentSegmentDiffToBestFlavor))},toDisplayString(__props.fastData.currentSegmentDiffToBestFormatted||`N/A`),3)):createCommentVNode(``,!0),__props.staticData.totalLaps>1?(openBlock(),createElementBlock(`span`,{key:1,class:normalizeClass(getDiffFlavorClass(__props.fastData.currentSegmentDiffToPreviousFlavor))},toDisplayString(__props.fastData.currentSegmentDiffToPreviousFormatted||`N/A`),3)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)],512),[[vShow,!isCollapsed.value]])]))}},SegmentTimes_default=__plugin_vue_export_helper_default(_sfc_main$153,[[`__scopeId`,`data-v-3801fbed`]]),_hoisted_1$136={key:0,class:`laptimes-section`},_hoisted_2$114={class:`collapse-icon`},_hoisted_3$102={class:`collapsible-content`},_hoisted_4$82={class:`laptimes-data-grid`,style:{"margin-bottom":`1rem`}},_hoisted_5$70={class:`data-item`},_hoisted_6$56={class:`value`},_hoisted_7$48={class:`data-item`},_hoisted_8$40={class:`value`},_hoisted_9$37={class:`laptimes-table`},_hoisted_10$31={class:`table-header`},_hoisted_11$28={key:0},_hoisted_12$22={key:1},_hoisted_13$19={key:0},_hoisted_14$19={key:1},_sfc_main$152={__name:`Placement`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0},placementData:{type:Object,required:!0}},setup(__props){let props=__props,isCollapsed=ref(!1),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value},playerVehicleId=computed(()=>{if(props.placementData.vehicleStates){let vehicleIds=Object.keys(props.placementData.vehicleStates);return vehicleIds.length>0?parseInt(vehicleIds[0]):null}return null}),playerPlacement=computed(()=>!playerVehicleId.value||!props.placementData.placements?null:props.placementData.placements[playerVehicleId.value]),totalRacers=computed(()=>props.placementData.placements?Object.keys(props.placementData.placements).length:0),shouldShowLapColumn=computed(()=>{if(!props.staticData.pathConfig)return!1;let pathConfig=props.staticData.pathConfig;return pathConfig.isClosed&&pathConfig.lapCount>1}),shouldShowSegmentColumn=computed(()=>{if(!props.staticData.pathConfig)return!1;let pathConfig=props.staticData.pathConfig;return!pathConfig.isClosed||pathConfig.isClosed&&pathConfig.lapCount>1}),sortedRacers=computed(()=>{if(!props.placementData.placements||!props.placementData.vehicleStates)return[];let racers=[];return Object.entries(props.placementData.placements).forEach(([vehicleId,placement])=>{let vehicleIdNum=parseInt(vehicleId),vehicleState=props.placementData.vehicleStates[vehicleId],timeDiffData=props.placementData.timeDifferencesToFirst?.[vehicleId],timeDiff=timeDiffData?.timeDifference||0;racers.push({vehicleId:vehicleIdNum,placement,currentLap:vehicleState?.currentLap||0,currentSegment:vehicleState?.currentSegment||0,isPlayer:vehicleIdNum===playerVehicleId.value,timeDiff,timeDiffFormatted:timeDiffData?.timeDifferenceFormatted||`0.000`})}),racers.sort((a$1,b)=>a$1.placement-b.placement)}),getTimeDiffClass=timeDiff=>timeDiff==null?``:{"diff-red":timeDiff>0,"diff-green":timeDiff<0,"diff-neutral":timeDiff===0};return(_ctx,_cache)=>__props.placementData.placements&&Object.keys(__props.placementData.placements).length>1?(openBlock(),createElementBlock(`div`,_hoisted_1$136,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$114,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Race Positions `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$102,[createBaseVNode(`div`,_hoisted_4$82,[createBaseVNode(`div`,_hoisted_5$70,[_cache[1]||=createBaseVNode(`span`,{class:`label`},`Your Position:`,-1),createBaseVNode(`span`,_hoisted_6$56,toDisplayString(playerPlacement.value||`N/A`),1)]),createBaseVNode(`div`,_hoisted_7$48,[_cache[2]||=createBaseVNode(`span`,{class:`label`},`Total Racers:`,-1),createBaseVNode(`span`,_hoisted_8$40,toDisplayString(totalRacers.value),1)])]),createBaseVNode(`div`,_hoisted_9$37,[createBaseVNode(`div`,_hoisted_10$31,[_cache[3]||=createBaseVNode(`span`,null,`Pos`,-1),_cache[4]||=createBaseVNode(`span`,null,`Vehicle`,-1),shouldShowLapColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_11$28,`Lap`)):createCommentVNode(``,!0),shouldShowSegmentColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_12$22,`Segment`)):createCommentVNode(``,!0),_cache[5]||=createBaseVNode(`span`,null,`Time Diff`,-1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedRacers.value,(racer,index)=>(openBlock(),createElementBlock(`div`,{key:racer.vehicleId,class:normalizeClass([`table-row`,{"player-row":racer.isPlayer,"leader-row":index===0}])},[createBaseVNode(`span`,null,toDisplayString(racer.placement),1),createBaseVNode(`span`,null,toDisplayString(racer.vehicleId===playerVehicleId.value?`You`:`Vehicle ${racer.vehicleId}`),1),shouldShowLapColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_13$19,toDisplayString(racer.currentLap||0),1)):createCommentVNode(``,!0),shouldShowSegmentColumn.value?(openBlock(),createElementBlock(`span`,_hoisted_14$19,toDisplayString(racer.currentSegment||0),1)):createCommentVNode(``,!0),createBaseVNode(`span`,{class:normalizeClass(getTimeDiffClass(racer.timeDiff))},toDisplayString(racer.timeDiffFormatted),3)],2))),128))])],512),[[vShow,!isCollapsed.value]])])):createCommentVNode(``,!0)}},Placement_default=__plugin_vue_export_helper_default(_sfc_main$152,[[`__scopeId`,`data-v-c2373a09`]]),_hoisted_1$135={class:`laptimes-section`},_hoisted_2$113={class:`collapse-icon`},_hoisted_3$101={class:`collapsible-content`},_hoisted_4$81={class:`raw-data-container`},_hoisted_5$69={key:0,class:`data-stream`},_hoisted_6$55={class:`data-content`},_hoisted_7$47={key:1,class:`data-stream`},_hoisted_8$39={class:`data-content`},_hoisted_9$36={key:2,class:`data-stream`},_hoisted_10$30={class:`data-content`},_hoisted_11$27={key:3,class:`data-stream`},_hoisted_12$21={class:`data-content`},_sfc_main$151={__name:`RawData`,props:{fastData:{type:Object,required:!0},slowData:{type:Object,required:!0},staticData:{type:Object,required:!0},placementData:{type:Object,required:!0}},setup(__props){let isCollapsed=ref(!0),toggleCollapse=()=>{isCollapsed.value=!isCollapsed.value};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$135,[createBaseVNode(`h3`,{onClick:toggleCollapse,class:`collapsible-header`},[createBaseVNode(`span`,_hoisted_2$113,toDisplayString(isCollapsed.value?`▶`:`▼`),1),_cache[0]||=createTextVNode(` Raw Stream Data `,-1)]),withDirectives(createBaseVNode(`div`,_hoisted_3$101,[createBaseVNode(`div`,_hoisted_4$81,[__props.fastData?(openBlock(),createElementBlock(`div`,_hoisted_5$69,[createBaseVNode(`h4`,null,`Fast Stream Data `+toDisplayString(__props.fastData.timestamp),1),createBaseVNode(`pre`,_hoisted_6$55,toDisplayString(JSON.stringify(__props.fastData,null,1)),1)])):createCommentVNode(``,!0),__props.slowData?(openBlock(),createElementBlock(`div`,_hoisted_7$47,[createBaseVNode(`h4`,null,`Slow Stream Data `+toDisplayString(__props.slowData.timestamp),1),createBaseVNode(`pre`,_hoisted_8$39,toDisplayString(JSON.stringify(__props.slowData,null,1)),1)])):createCommentVNode(``,!0),__props.staticData?(openBlock(),createElementBlock(`div`,_hoisted_9$36,[createBaseVNode(`h4`,null,`Static Stream Data `+toDisplayString(__props.staticData.timestamp),1),createBaseVNode(`pre`,_hoisted_10$30,toDisplayString(JSON.stringify(__props.staticData,null,1)),1)])):createCommentVNode(``,!0),__props.placementData?(openBlock(),createElementBlock(`div`,_hoisted_11$27,[createBaseVNode(`h4`,null,`Placement Stream Data `+toDisplayString(__props.placementData.timestamp),1),createBaseVNode(`pre`,_hoisted_12$21,toDisplayString(JSON.stringify(__props.placementData,null,1)),1)])):createCommentVNode(``,!0)])],512),[[vShow,!isCollapsed.value]])]))}},RawData_default=__plugin_vue_export_helper_default(_sfc_main$151,[[`__scopeId`,`data-v-7bc3ab60`]]),_hoisted_1$134={class:`laptimes-app`,style:{"overflow-y":`scroll`}},_sfc_main$150={__name:`appDebug`,setup(__props){useEvents();let fastData=ref({}),slowData=ref({}),staticData=ref({}),placementData=ref({});return onMounted(()=>{useStreams([`lapTimes_fast`,`lapTimes_slow`,`lapTimes_static`,`lapTimes_placement`],streams=>{streams.lapTimes_fast&&(fastData.value=streams.lapTimes_fast),streams.lapTimes_slow&&(slowData.value=streams.lapTimes_slow),streams.lapTimes_static&&(staticData.value=streams.lapTimes_static),streams.lapTimes_placement&&(placementData.value=streams.lapTimes_placement)})}),onUnmounted(()=>{}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$134,[_cache[0]||=createBaseVNode(`div`,{class:`laptimes-header`},[createBaseVNode(`h2`,null,`Lap Times Debug`)],-1),createVNode(BasicInfo_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(BestTimes_default,{slowData:slowData.value},null,8,[`slowData`]),createVNode(LapTimes_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(SegmentTimes_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value},null,8,[`fastData`,`slowData`,`staticData`]),createVNode(Placement_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value,placementData:placementData.value},null,8,[`fastData`,`slowData`,`staticData`,`placementData`]),createVNode(RawData_default,{fastData:fastData.value,slowData:slowData.value,staticData:staticData.value,placementData:placementData.value},null,8,[`fastData`,`slowData`,`staticData`,`placementData`])]))}},appDebug_default$1=__plugin_vue_export_helper_default(_sfc_main$150,[[`__scopeId`,`data-v-49102eaf`]]),_hoisted_1$133={class:`messages-app`},_hoisted_2$112={key:0,class:`icon-cell`},_hoisted_3$100={class:`text-cell`},_hoisted_4$80={key:0},timerIntervalMs=300,_sfc_main$149={__name:`app`,props:{maxMessages:{type:Number,default:void 0},dense:{type:Boolean,default:!1},wrap:{type:Boolean,default:!0},showIcons:{type:Boolean,default:!0}},setup(__props){let props=__props,events$3=useEvents(),messagesByCategory=reactive({}),bypassTtl=ref(!1),getIconProps=item=>{let icon=resolvedType(item.icon);if(icon)return{type:icon};let externalImage=resolvedExternalImage(item.icon);return externalImage?{externalImage}:{type:`info`}},timerId,isAssetPath=icon=>typeof icon==`string`&&icon.startsWith(`/`),resolvedType=icon=>typeof icon==`string`&&!isAssetPath(icon)?icon:void 0,resolvedExternalImage=icon=>typeof icon==`string`&&isAssetPath(icon)?icon:void 0,messagesList=computed(()=>{let list=Object.values(messagesByCategory);return typeof props.maxMessages==`number`&&props.maxMessages>0?list.slice(0,props.maxMessages):list});function resolveTranslation(val){return val==null?``:typeof val==`string`?$translate.instant(val):Array.isArray(val)?$translate.multiContextTranslate(val):typeof val==`object`?$translate.contextTranslate(val):String(val)}function htmlToPlainText(html){if(typeof html!=`string`)return String(html??``);let h$1=html.replace(//gi,` `),el=document.createElement(`div`);el.innerHTML=h$1;let text=el.textContent??el.innerText??h$1;return text=text.replace(/<[^>]*>/g,``),text}function sanitizeTextSegment(text){return text?htmlToPlainText(parse$1?parse$1(text):text):``}function getParts(item){let raw=resolveTranslation(item.text);if(typeof raw!=`string`)return[{t:`text`,v:sanitizeTextSegment(String(raw))}];let parts=[],rgx=/\[action=([^\]]+)\]/gi,lastIndex=0,match;for(;(match=rgx.exec(raw))!==null;){let head=raw.slice(lastIndex,match.index);head&&parts.push({t:`text`,v:sanitizeTextSegment(head)});let actionName=match[1].trim();parts.push({t:`binding`,action:actionName}),lastIndex=match.index+match[0].length}let tail=raw.slice(lastIndex);return tail&&parts.push({t:`text`,v:sanitizeTextSegment(tail)}),parts.length?parts:[{t:`text`,v:sanitizeTextSegment(raw)}]}function normalizePayload(args){let category=args?.category??`default`,clear=!!args?.clear,text=args&&`text`in args?args.text:args&&`msg`in args?args.msg:``,icon=typeof args?.icon==`string`?args.icon:void 0,ttlMs=typeof args?.ttlMs==`number`?args.ttlMs:typeof args?.ttl==`number`?args.ttl*1e3:void 0;return ttlMs??=5e3,{category,clear,text,icon,ttlMs}}let CATEGORY_ICONS=[{match:`vehicle.absBehavior`,icon:`ABSIndicator`},{match:`vehicle.brakingdistance`,icon:`carsFollow`},{prefix:`vehicle.compressionBrake.`,icon:`engine`},{prefix:`vehicle.damage.exhaust`,icon:`exhaustMuffler`},{prefix:`vehicle.damage.deflated.`,icon:`tireDeflated`},{prefix:`vehicle.beamstate.tireDeflated`,icon:`tireDeflated`},{match:`vehicle.damage.mildOverrev`,icon:`powerGauge05`},{match:`vehicle.damage.catastrophicOverrev`,icon:`powerGauge05`},{match:`vehicle.damage.catastrophicOverTorque`,icon:`cogDamaged`},{match:`vehicle.damage.flood`,icon:`water`},{match:`vehicle.engine.isStalling`,icon:`powerGauge01`},{match:`vehicle.ignition.ignitionLevel`,icon:`keys1`},{match:`vehicle.lightbar.mode`,icon:`wigwags`},{match:`vehicle.linelock.status`,icon:`wheelDisc`},{match:`vehicle.postCrashBrake.impact`,icon:`hazardLights`},{prefix:`vehicle.powertrain.diffmode.`,icon:`drivetrainGeneric`},{match:`vehicle.powertrain.nitrousOxideInjection`,icon:`N2OHoriz`},{match:`vehicle.shiftLogic.cannotShift`,icon:`cogsDamaged`},{match:`vehicle.shiftermode`,icon:`transmissionM`},{match:`vehicle.transbrake.status`,icon:`cogs`},{match:`vehicle.twoStep.status`,icon:`signal04a`},{match:`vehicle.tirePressureControl.inflateDeflate`,icon:`tirePressureGaugeOutlined03`},{prefix:`vehicle.wheels.tirePunctured.`,icon:`tireAirPuff`},{prefix:`vehicle.damage.device.`,icon:`cogDamaged`},{match:`vehicle.driveModes`,icon:`ESC`},{prefix:`vehicle.driveModes.`,icon:`ESC`},{match:`vehicle.engine.oilOverheating.true`,icon:`coolantTemp`},{match:`vehicle.engine.blockMelted.true`,icon:`coolantTemp`},{match:`vehicle.engine.headGasketDamaged.true`,icon:`coolantTemp`},{match:`vehicle.engine.coolantOverheating.true`,icon:`coolantTemp`},{match:`vehicle.engine.radiatorLeak.true`,icon:`coolantTemp`},{prefix:`vehicle.engine.`,icon:`engine`},{prefix:`vehicle.recovery.`,icon:`tow`},{match:`rally`,icon:`rallyHelmet`},{match:`fill`,icon:`import`},{match:`align`,icon:`flag`},{match:`delivery`,icon:`boxTruckFast`},{match:`refueling`,icon:`fuelPumpFilling`},{prefix:`refueling-`,icon:`fuelPumpFilling`},{prefix:`ui.camera.`,icon:`movieCamera`},{match:`input`,icon:`gamepad`},{prefix:`ui.apps.damage_app_vehicle_simple.component.`,icon:`cogsDamaged`},{match:`AI debug`,icon:`AIMicrochip`},{match:`debug`,icon:`code`},{match:`hydros`,icon:`steeringWheelCommon`},{match:`GLTFexport`,icon:`loadMesh`},{match:`bigmap.info.reachedTarget`,icon:`raceFlag`}];function deriveIconForCategory(category){if(!category)return`info`;console.debug(`[messages] deriveIconForCategory`,category);for(let{match,prefix:prefix$1,icon}of CATEGORY_ICONS){if(match&&category===match)return console.debug(` -> match:`,match,icon),icon;if(prefix$1&&category.startsWith(prefix$1))return console.debug(` -> prefix:`,prefix$1,icon),icon}return console.debug(` -> no match, fallback to info`),`info`}function onMessage(args){let{category,clear,text,icon,ttlMs}=normalizePayload(args),matched=[];try{let re=new RegExp(category);matched=Object.keys(messagesByCategory).filter(k=>re.test(k))}catch{}matched.length===0&&(matched=[category]);for(let cat of matched){if(clear||typeof text==`string`&&text===``){delete messagesByCategory[cat];continue}let offset$2=Object.keys(messagesByCategory).length*timerIntervalMs*2;messagesByCategory[cat]={_key:cat,text,icon:icon||deriveIconForCategory(cat),ttl:ttlMs+offset$2}}}function onClearAll(){for(let k in messagesByCategory)delete messagesByCategory[k]}function tick(){for(let k in messagesByCategory){let m=messagesByCategory[k];bypassTtl.value||(m.ttl-=timerIntervalMs),m.ttl<=0&&delete messagesByCategory[k]}}return onMounted(()=>{events$3.on(`Message`,onMessage),events$3.on(`ClearAllMessages`,onClearAll),events$3.on(`MessagesDebug`,data=>{data&&typeof data.bypassTtl==`boolean`&&(bypassTtl.value=!!data.bypassTtl)}),timerId=window.setInterval(tick,timerIntervalMs)}),onUnmounted(()=>{timerId&&window.clearInterval(timerId)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$133,[(openBlock(!0),createElementBlock(Fragment,null,renderList(messagesList.value,item=>(openBlock(),createElementBlock(`div`,{key:item._key,class:`message-row`},[__props.showIcons&&item.icon?(openBlock(),createElementBlock(`div`,_hoisted_2$112,[createVNode(unref(bngIcon_default),mergeProps({class:`msg-icon`,fallbackType:`info`},{ref_for:!0},getIconProps(item)),null,16)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$100,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getParts(item),(part,i)=>(openBlock(),createElementBlock(Fragment,{key:i},[part.t===`text`?(openBlock(),createElementBlock(`span`,_hoisted_4$80,toDisplayString(part.v),1)):(openBlock(),createBlock(unref(bngBinding_default),{key:1,action:part.action,"show-unassigned":``},null,8,[`action`]))],64))),128))])]))),128))]))}},app_default$32=__plugin_vue_export_helper_default(_sfc_main$149,[[`__scopeId`,`data-v-ddfd9832`]]),apps_exports=__export({advancedWheelsDebug:()=>app_default$2,brakeTorqueGraph:()=>app_default$3,busLine:()=>app_default$4,cameraDistance:()=>app_default$5,clutchThermalDebug:()=>app_default$6,compass:()=>app_default$7,compassPrecise:()=>app_default$8,countdown:()=>countdownApp_default,crashTestNextStep:()=>app_default$15,damageApp:()=>app_default$9,dragRace:()=>app_default$10,dragRaceStage:()=>app_default$12,dragRaceTree:()=>app_default$11,driftCurrentDrift:()=>app_default$13,driftScores:()=>app_default$14,engineDebug:()=>app_default$16,engineDynamometer:()=>app_default$17,engineHeatDebugGraph:()=>app_default$18,engineThermalDebug:()=>app_default$19,forcedInduction:()=>app_default$20,forcedInductionDebug:()=>app_default$21,gameplayApps:()=>gameplayApps_default,genericMissionData:()=>bngGenericMissionData_default,hydraulicsDebug:()=>app_default$22,inputHints:()=>app_default$29,keyList:()=>app_default$23,lapTimes:()=>app_default$31,lapTimesDebug:()=>appDebug_default$1,logvehiclestats:()=>app_default$24,messages:()=>app_default$32,messagesTasksApps:()=>messagesTasksApps_default,navigation:()=>app_default$30,pointsBar:()=>app_default,rallyCountdown:()=>appCountdown_default,rallyDashboard:()=>appDashboard_default,rallyDebug:()=>appDebug_default,rallyStageProgress:()=>appStageProgress_default,rallyStageTiming:()=>appStageTiming_default,rallyTimecard:()=>appTimecard_default,rallyVisualPacenotes:()=>app_default$28,replayAppV2:()=>app_default$1,simpleDigTacho:()=>app_default$25,simpleFlashMessage:()=>flashMessageApp_default,tacho2:()=>app_default$26,tasklist:()=>app_default$27});const useTuningStore=defineStore(`tuning`,()=>{let{lua,events:events$3}=useBridge(),buckets=ref({}),tuningVariables=ref({}),editedTuningVars={},isCareer=!1,shoppingData=ref({}),noapi=()=>{throw Error(`Tuning store must be initialised first`)},api$1={request:noapi,apply:noapi,reset:noapi,close:()=>{},menuClose:()=>{}};async function init$3(){for(let name in editedTuningVars={},isCareer=await lua.career_career.isActive(),isCareer?(api$1.request=async()=>processTuningData(await lua.career_modules_tuning.getTuningData()),api$1.apply=(values,edited)=>{let res={};for(let[varName,_]of Object.entries(edited))res[varName]=valDisToVal(values[varName]);lua.career_modules_tuning.apply(res)},api$1.reset=()=>{},api$1.close=()=>{events$3.off(`sendTuningShoppingData`,setShoppingData),events$3.off(`updateTuningVariable`,updateTuningVariable),shoppingData.value={}},events$3.on(`sendTuningShoppingData`,setShoppingData),events$3.on(`updateTuningVariable`,updateTuningVariable)):(api$1.request=async()=>await lua.extensions.core_vehicle_partmgmt.sendDataToUI(),api$1.apply=(values,edited)=>{let res={};for(let varName in values)res[varName]=valDisToVal(values[varName]);lua.extensions.core_vehicle_partmgmt.setConfigVars(res)},api$1.reset=async()=>await lua.extensions.core_vehicle_partmgmt.resetVarsToLoadedConfig(),api$1.close=()=>{events$3.off(`VehicleFocusChanged`,api$1.request),events$3.off(`VehicleConfigChange`,processTuningData)},api$1.menuClose=api$1.close,events$3.on(`VehicleFocusChanged`,api$1.request),events$3.on(`VehicleConfigChange`,processTuningData)),api$1)api$1[name]===noapi&&(api$1[name]=()=>{})}function apply$1(){api$1.apply(tuningVariables.value,editedTuningVars),editedTuningVars={}}function setShoppingData(data){shoppingData.value=data}function updateTuningVariable(tuningVar){tuningVariables.value[tuningVar.name].valDis=Number(valToValDis(tuningVar))}let processTuningData=data=>{data.variables&&(data=data.variables),isCareer&&(delete data.$fuel,delete data.$fuel_R,delete data.$fuel_L),buckets.value=[],tuningVariables.value={};for(let varData of Object.values(data)){if(isCareer&&varData.category===`Cargo`||varData.hideInUI)continue;varData.category||=`Other`,varData.subCategory||=`Other`;let cat=(buckets.value.find(cat$1=>cat$1.name===varData.category)||buckets.value[buckets.value.push({name:varData.category,items:[]})-1]).items;(cat.find(sub=>sub.name===varData.subCategory)||cat[cat.push({name:varData.subCategory,items:[]})-1]).items.push(varData),tuningVariables.value[varData.name]={valDis:Number(valToValDis(varData)),minDis:varData.minDis,maxDis:varData.maxDis,min:varData.min,max:varData.max,default:Number(valToValDis(varData,!0))}}let sorter=(a$1,b)=>a$1.name.localeCompare(b.name);buckets.value.sort(sorter);for(let cat of buckets.value){cat.items.sort(sorter);for(let sub of cat.items)sub.items.sort(sorter)}};function countDecimals(num){return typeof num!=`number`||~~num===num?0:num.toString().split(`.`)[1].length||0}function valToValDis(varData,useDef=!1){return roundDec(round(((useDef?varData.default:varData.val)-varData.min)/(varData.max-varData.min)*(varData.maxDis-varData.minDis),varData.stepDis)+varData.minDis,countDecimals(varData.stepDis))}function valDisToVal(varData){return(varData.valDis-varData.minDis)/(varData.maxDis-varData.minDis)*(varData.max-varData.min)+varData.min}function tuningVarChanged(varName){editedTuningVars[varName]=!0}return{init:init$3,buckets,tuningVariables,shoppingData,apply:apply$1,requestInitialData:()=>api$1.request(),close:()=>api$1.close(),notifyOnMenuClosed:()=>api$1.menuClose(),tuningVarChanged,resetTuningData:()=>api$1.reset()}});var _hoisted_1$132={key:0,class:`tuning-form`},_hoisted_2$111={key:0,class:`extra-features`},_hoisted_3$99={class:`category-heading`},_hoisted_4$79={class:`category-name`},_hoisted_5$68={key:0,class:`subcategory-heading`},_hoisted_6$54={class:`subcategory-name`},_hoisted_7$46={class:`variable-title`},_hoisted_8$38={class:`variable-box`},_hoisted_9$35={class:`tuning-static`},_hoisted_10$29={class:`buttons`},_sfc_main$148={__name:`Tuning`,props:{withBackground:Boolean,buttonTarget:{type:Object},closeButton:Boolean},setup(__props,{expose:__expose}){useUINavBlocker().blockOnly([`context`]);let{lua}=useBridge(),tuningStore=useTuningStore(),awdApp=ref(),awdShow=ref(!1),apply$1=()=>{tuningStore.apply()},close=()=>{tuningStore.close()},mirrorsShown=ref(!0),mirrorsEnabled=ref(!1),mirrorsRoute=`menu.vehicleconfig.tuning.mirrors`,toMirrors=()=>{window.bngVue.gotoGameState(mirrorsRoute)},inputs=ref([]),isChanged=computed(()=>inputs.value.some(ipt=>ipt.dirty));__expose({apply:apply$1,close});let autoApply=ref(!1),applyDebounce=debounce(apply$1,1e3);function onChange(varName){tuningStore.tuningVarChanged(varName),autoApply.value&&applyDebounce()}let applySettingChanged=val=>localStorage.setItem(`applyTuningChangesAutomatically`,JSON.stringify(val));watch(()=>tuningStore.buckets,()=>nextTick(()=>{for(let ipt of inputs.value)ipt.markClean()}));async function resetVarsToLoadedConfig(){tuningStore.resetTuningData(),await tuningStore.requestInitialData(),await nextTick();for(let ipt of inputs.value)ipt.markClean()}onBeforeMount(async()=>{let optAutoApply=localStorage.getItem(`applyTuningChangesAutomatically`);if(optAutoApply)try{autoApply.value=!!JSON.parse(optAutoApply)}catch{}await lua.extensions.gameplay_garageMode.isActive()&&(mirrorsRoute=`menu.vehicleconfig.tuning.mirrors.in-garage`),await lua.career_career.isActive()?mirrorsShown.value=!1:mirrorsEnabled.value=(await useSettingsAsync()).values.GraphicDynMirrorsEnabled,await tuningStore.init(),await tuningStore.requestInitialData(),getUINavServiceInstance().setFilteredEvents(UI_EVENT_GROUPS.focusMoveScalar)});let extraFeatures=computed(()=>{let features=[];return mirrorsEnabled.value&&features.push({mirrorsEnabled:!0}),features});return onUnmounted(async()=>{await tuningStore.notifyOnMenuClosed(),tuningStore.close(),tuningStore.$dispose(),getUINavServiceInstance().clearFilteredEvents()}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({innerTuningCard:!0,"with-background":__props.withBackground})},[unref(tuningStore).buckets?(openBlock(),createElementBlock(`div`,_hoisted_1$132,[extraFeatures.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$111,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:toMirrors,accent:`secondary`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.mirrors.name`)),1)]),_:1})),[[unref(BngDisabled_default),!extraFeatures.value.find(f=>f.mirrorsEnabled)]])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(tuningStore).buckets,category=>(openBlock(),createElementBlock(`div`,{class:`tuning-category`,key:category.name},[createBaseVNode(`h2`,_hoisted_3$99,[createBaseVNode(`span`,_hoisted_4$79,toDisplayString(category.name),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(category.items,subCategory=>(openBlock(),createElementBlock(`div`,{class:`tuning-subcategory`,key:subCategory.name},[subCategory.name===`Other`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`h3`,_hoisted_5$68,[createBaseVNode(`span`,_hoisted_6$54,toDisplayString(subCategory.name),1)])),(openBlock(!0),createElementBlock(Fragment,null,renderList(subCategory.items,varData=>withDirectives((openBlock(),createElementBlock(`div`,{key:category.name+subCategory.name+varData.name,class:normalizeClass({"input-container":!0,"variable-box":varData.type===`slider`})},[createBaseVNode(`div`,_hoisted_7$46,toDisplayString(varData.title),1),createBaseVNode(`div`,_hoisted_8$38,[createVNode(unref(bngSlider_default),{ref_for:!0,ref_key:`inputs`,ref:inputs,min:varData.minDis,max:varData.maxDis,step:varData.stepDis,unit:varData.unit,class:normalizeClass({"property-slider":!0}),"with-input":``,"with-reset":``,"orig-value":unref(tuningStore).tuningVariables[varData.name].default,modelValue:unref(tuningStore).tuningVariables[varData.name].valDis,"onUpdate:modelValue":$event=>unref(tuningStore).tuningVariables[varData.name].valDis=$event,onValueChanged:$event=>onChange(varData.name)},null,8,[`min`,`max`,`step`,`unit`,`orig-value`,`modelValue`,`onUpdate:modelValue`,`onValueChanged`])])],2)),[[unref(BngTooltip_default),varData.description,`top`]])),128))]))),128))]))),128))])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_9$35,[withDirectives(createVNode(unref(app_default$2),{class:normalizeClass({"awd-app":awdApp.value}),ref_key:`awdApp`,ref:awdApp},null,8,[`class`]),[[vShow,awdShow.value]]),awdApp.value&&awdApp.value.hasData?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,modelValue:awdShow.value,"onUpdate:modelValue":_cache[0]||=$event=>awdShow.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tune.advWheel`)),1)]),_:1},8,[`modelValue`])):createCommentVNode(``,!0),createVNode(unref(bngSwitch_default),{modelValue:autoApply.value,"onUpdate:modelValue":_cache[1]||=$event=>autoApply.value=$event,onValueChanged:applySettingChanged},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.liveUpdates`)),1)]),_:1},8,[`modelValue`]),createBaseVNode(`div`,_hoisted_10$29,[withDirectives(createVNode(unref(bngButton_default),{"show-hold":``,icon:unref(icons).undo,accent:unref(ACCENTS).custom,class:`reset-button`},null,8,[`icon`,`accent`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:resetVarsToLoadedConfig,holdDelay:1e3,repeatInterval:0}],[unref(BngTooltip_default),`Reset to original config`]]),createVNode(unref(bngButton_default),{disabled:autoApply.value||!isChanged.value,onClick:apply$1},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.common.apply`)),1)]),_:1},8,[`disabled`]),__props.closeButton?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:close,accent:unref(ACCENTS).attention},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),createTextVNode(toDisplayString(_ctx.$t(`ui.common.close`)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0)])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Tuning_default=__plugin_vue_export_helper_default(_sfc_main$148,[[`__scopeId`,`data-v-907bf291`]]),CANCEL_MESSAGE=`Are you sure you want to cancel?
All changes to your vehicle will be reversed`,_sfc_main$147={__name:`TuningMain`,setup(__props){useComputerStore();let tuningStore=useTuningStore(),CONFIRM_BUTTONS=[{label:$translate.instant(`ui.common.yes`),value:!0},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}],confirmCancel=async()=>{(!(tuningStore.shoppingData.shoppingCart&&tuningStore.shoppingData.shoppingCart.items.length)||await openConfirmation(null,CANCEL_MESSAGE,CONFIRM_BUTTONS))&&cancelShopping()},cartData=computed(()=>{let cart=tuningStore.shoppingData?tuningStore.shoppingData.shoppingCart:null,res={total:0,taxes:0,items:[]};return cart&&(res.total=cart.total,res.taxes=cart.taxes,Array.isArray(cart.items)&&(res.items=cart.items.map(item=>({type:item.type||item.level===1&&`item`,level:item.level,name:item.title,price:item.price,priceHide:!item.price,removeShow:!!item.varName,remove:()=>Lua_default.career_modules_tuning.removeVarFromShoppingCart(item.varName)})))),res}),elCard=ref(),applyShopping=()=>Lua_default.career_modules_tuning.applyShopping(),cancelShopping=()=>Lua_default.career_modules_tuning.cancelShopping();return(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{path:[`Tuning`],title:`Tuning`,back:``,onBack:confirmCancel},{side:withCtx(()=>[createVNode(ShoppingCart_default,{"cart-data":cartData.value,"player-money":unref(tuningStore).shoppingData.playerMoney,"confirm-button-text":`Confirm`,apply:applyShopping,cancel:confirmCancel},null,8,[`cart-data`,`player-money`])]),default:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`tuningCard`,ref_key:`elCard`,ref:elCard},{buttons:withCtx(()=>[..._cache[0]||=[]]),default:withCtx(()=>[createVNode(Tuning_default,{"button-target":elCard.value&&elCard.value.buttonsContainer,"close-button":!1},null,8,[`button-target`])]),_:1})),[[unref(BngBlur_default),1]])]),_:1}))}},TuningMain_default=__plugin_vue_export_helper_default(_sfc_main$147,[[`__scopeId`,`data-v-60311783`]]);const useVehicleInventoryStore=defineStore(`vehicleInventory`,()=>{let{events:events$3}=useBridge(),vehicleInventoryData=ref({}),vehIdToChooseAfterRepairPopup=ref(0),filteredVehicles=computed(()=>{let data=vehicleInventoryData.value;return data.vehicles?Object.values(data.vehicles):[]}),menuOpen=!1;function requestInitialData(){Lua_default.career_modules_inventory.sendDataToUi()}function closeMenu(){Lua_default.career_modules_inventory.closeMenu()}let getExpediteRepairCost=vehicle=>Math.max(vehicle.quickRepairExtraPrice*(vehicle.timeToAccess/vehicle.initialRepairTime),50);function countDownVehicleDelays(){if(menuOpen){for(let vehicle of filteredVehicles.value)vehicle.timeToAccess&&(--vehicle.timeToAccess,vehicle.delayReason==`repair`&&(vehicle.expediteRepairCost=getExpediteRepairCost(vehicle)),vehicle.timeToAccess<=0&&Lua_default.career_modules_inventory.sendDataToUi());setTimeout(countDownVehicleDelays,1e3)}}events$3.on(`vehicleInventoryData`,data=>{Object.values(data.vehicles).forEach(vehicle=>{data.currentVehicleId===vehicle.id&&(vehicle.niceName+=` (Current Vehicle)`),vehicle.owned||(vehicle.niceName+=` (Not owned)`)}),vehicleInventoryData.value=data,vehIdToChooseAfterRepairPopup.value=0,menuOpen||(menuOpen=!0,countDownVehicleDelays())});function menuClosed(){menuOpen=!1}function repairPopupAccept(){Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehIdToChooseAfterRepairPopup.value,1,!0),vehIdToChooseAfterRepairPopup.value=0}function repairPopupDecline(){Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehIdToChooseAfterRepairPopup.value,1,!1),vehIdToChooseAfterRepairPopup.value=0}function chooseVehicle(vehId,buttonIndex){let showRepairPopup=!1,data=vehicleInventoryData.value;if(data.currentVehicleId!==void 0&&vehId!==data.currentVehicleId&&(showRepairPopup=data.vehicles[data.currentVehicleId].needsRepair),showRepairPopup){vehIdToChooseAfterRepairPopup.value=vehId;return}Lua_default.career_modules_inventory.chooseVehicleFromMenu(vehId,buttonIndex+1,!1)}function dispose$2(){events$3.off(`vehicleInventoryData`)}return{filteredVehicles,vehIdToChooseAfterRepairPopup,vehicleInventoryData,requestInitialData,chooseVehicle,repairPopupAccept,repairPopupDecline,menuClosed,closeMenu,dispose:dispose$2}});var _hoisted_1$131={class:`list-vehicle-dialog`},_hoisted_2$110={class:`vehicle-info`},_hoisted_3$98={class:`name`},_hoisted_4$78={key:0,class:`meta`},_hoisted_5$67={key:1,class:`meta`},_hoisted_6$53={class:`price-box`},_hoisted_7$45={class:`price-content`},_hoisted_8$37={class:`price-row`},_hoisted_9$34={class:`step-buttons-group`},_hoisted_10$28={class:`price`},_hoisted_11$26={class:`step-buttons-group`},_sfc_main$146={__name:`ListVehicleDialog`,props:{modelValue:{type:Object,required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,{units}=useBridge(),formModel=computed({get:()=>props.modelValue,set:newValue=>emit$1(`update:modelValue`,newValue)});function adjustPrice(amount){let price=Math.max(0,Math.round(((formModel.value.price||0)+amount)/50)*50);emit$1(`update:modelValue`,{...formModel.value,price})}let priceHint=computed(()=>{let mv=Number(formModel.value.marketValue||0),p$1=Number(formModel.value.price||0);if(!mv||!p$1)return{text:``,class:``};let diff=(p$1-mv)/mv,percent=Math.round(Math.abs(diff)*100);return percent<1?{text:`Fair market value`,class:`ok`}:diff>0?{text:`${percent}% above market value`,class:`high`}:{text:`${percent}% below market value`,class:`low`}}),offerHint=computed(()=>{let mv=Number(formModel.value.marketValue||0),p$1=Number(formModel.value.price||0);if(!mv||!p$1)return{text:`Regular offers expected`,class:`regular`};let ratio=p$1/mv;return ratio<=.9?{text:`More offers expected`,class:`more`}:ratio>=1.2?{text:`Fewer offers expected`,class:`fewer`}:{text:`Regular offers expected`,class:`regular`}}),formModelText=computed(()=>formModel.value.odometerKm?new Intl.NumberFormat().format(Math.round(formModel.value.odometerKm))+` km`:``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$131,[createBaseVNode(`div`,_hoisted_2$110,[createBaseVNode(`div`,_hoisted_3$98,toDisplayString(formModel.value.vehicleName),1),formModelText.value?(openBlock(),createElementBlock(`div`,_hoisted_4$78,toDisplayString(formModelText.value)+` — Market Value: `+toDisplayString(unref(units).beamBucks(formModel.value.marketValue||0)),1)):(openBlock(),createElementBlock(`div`,_hoisted_5$67,` Market Value: `+toDisplayString(unref(units).beamBucks(formModel.value.marketValue||0)),1))]),createBaseVNode(`div`,_hoisted_6$53,[createBaseVNode(`div`,_hoisted_7$45,[_cache[12]||=createBaseVNode(`div`,{class:`label`},`Your Asking Price`,-1),createBaseVNode(`div`,_hoisted_8$37,[createBaseVNode(`div`,_hoisted_9$34,[createVNode(unref(bngButton_default),{class:`step step-large`,accent:unref(ACCENTS).secondary,onClick:_cache[0]||=$event=>adjustPrice(-5e3)},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`-5000`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-medium`,accent:unref(ACCENTS).secondary,onClick:_cache[1]||=$event=>adjustPrice(-500)},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(`-500`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step`,accent:unref(ACCENTS).secondary,onClick:_cache[2]||=$event=>adjustPrice(-50)},{default:withCtx(()=>[..._cache[8]||=[createTextVNode(`-50`,-1)]]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_10$28,toDisplayString(unref(units).beamBucks(formModel.value.price||0)),1),createBaseVNode(`div`,_hoisted_11$26,[createVNode(unref(bngButton_default),{class:`step`,accent:unref(ACCENTS).secondary,onClick:_cache[3]||=$event=>adjustPrice(50)},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(`+50`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-medium`,accent:unref(ACCENTS).secondary,onClick:_cache[4]||=$event=>adjustPrice(500)},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`+500`,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{class:`step step-large`,accent:unref(ACCENTS).secondary,onClick:_cache[5]||=$event=>adjustPrice(5e3)},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`+5000`,-1)]]),_:1},8,[`accent`])])]),createBaseVNode(`div`,{class:normalizeClass([`hint`,[priceHint.value.class]])},toDisplayString(priceHint.value.text),3),createBaseVNode(`div`,{class:normalizeClass([`offer-hint`,[offerHint.value.class]])},toDisplayString(offerHint.value.text),3)])])]))}},ListVehicleDialog_default=__plugin_vue_export_helper_default(_sfc_main$146,[[`__scopeId`,`data-v-87a25af5`]]),_hoisted_1$130={class:`vehicle-list-container`},_sfc_main$145={__name:`VehicleList`,setup(__props){let{units}=useBridge(),{$game}=useLibStore(),popover=usePopover(),popId=uniqueId(`veh_options`),popHide=()=>popover.hide(popId),licensePlateTextValid=ref(!0),vehicleNameValid=ref(!0),vehicleInventoryStore=useVehicleInventoryStore(),selectedVehId=ref(),vehSelected=computed(()=>{if(typeof selectedVehId.value==`number`)return listView.value.find(v=>v.id===selectedVehId.value)}),careerStatusData=ref({}),updateCareerStatusData=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(data=>careerStatusData.value=data),cantPayLicensePlate=computed(()=>!careerStatusData.value.money||300>careerStatusData.value.money),listStatus=computed(()=>vehicleInventoryStore?!Array.isArray(vehicleInventoryStore.filteredVehicles)||vehicleInventoryStore.filteredVehicles.length===0?`You don't currently own any vehicles`:null:`Please wait...`),listView=computed(()=>{if(!vehicleInventoryStore||!Array.isArray(vehicleInventoryStore.filteredVehicles)||vehicleInventoryStore.filteredVehicles.length===0)return[];let res=vehicleInventoryStore.filteredVehicles;if(singleFunction.value)for(let veh of res)veh.disabled=!isFunctionAvailable(veh,singleFunction.value);return res.sort((a$1,b)=>a$1.favorite?-1:b.favorite?1:a$1.niceName.localeCompare(b.niceName)),res}),itemLayout=ref({TILE:`tile`,LIST:`row`}.TILE),singleFunction=computed(()=>{if(!vehicleInventoryStore||!vehicleInventoryStore.vehicleInventoryData)return null;let data=vehicleInventoryStore.vehicleInventoryData;return Object.values(data.buttonsActive).includes(!0)||!Array.isArray(data.chooseButtonsData)||data.chooseButtonsData.length!==1?null:data.chooseButtonsData[0]});function select(vehicle,evt){let show=vehicleInventoryStore&&vehicleInventoryStore.vehicleInventoryData&&(Object.values(vehicleInventoryStore.vehicleInventoryData.buttonsActive).includes(!0)||vehicleInventoryStore.vehicleInventoryData.chooseButtonsData.length>0)&&vehicle&&(!vehSelected.value||vehSelected.value.id!==vehicle.id),popover$1;if(evt&&evt.target){let cur=evt.target;for(;popover$1=cur.__popover,!(popover$1||(cur=cur.parentNode,cur===document.body)););}if(vehicle&&singleFunction.value){selectedVehId.value=null,popover$1&&popover$1.hide(),vehicleInventoryStore.chooseVehicle(vehicle.id,0);return}show&&popover$1&&popover$1.hide(),nextTick(()=>{show?(selectedVehId.value=vehicle.id,popover$1&&popover$1.show()):(popover$1&&popover$1.hide(),selectedVehId.value=null)})}let isFunctionAvailable=(vehicle,buttonData)=>!(vehicle.timeToAccess||vehicle.missingFile||buttonData.requiredVehicleNotInGarage&&vehicle.inGarage||buttonData.requiredOtherVehicleInGarage&&!vehicle.otherVehicleInGarage||buttonData.ownedRequired&&!vehicle.owned||buttonData.repairRequired&&vehicle.needsRepair||buttonData.notForSaleRequired&&vehicle.listedForSale),lookAtVehicleListing=()=>{Lua_default.career_modules_marketplace.openMenu(vehicleInventoryStore.vehicleInventoryData.originComputerId)},confirmReturnVehicle=async()=>{let vehicle=vehSelected.value;popHide(),await openConfirmation(``,`Do you want to return this loaned vehicle to the owner?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&Lua_default.career_modules_inventory.returnLoanedVehicleFromInventory(vehicle.id)},personalizeLicensePlate=async()=>{let vehicle=vehSelected.value;popHide(),updateCareerStatusData();let res=await openPrompt(`Enter your new license plate text:`,`Personalize License Plate`,{maxLength:10,defaultValue:vehicle.config.licenseName,buttons:[{label:$translate.instant(`ui.common.cancel`),value:!1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.okay`)+` (Cost: ${units.beamBucks(300)})`,value:text=>text,extras:{disabled:cantPayLicensePlate,accent:ACCENTS.primary}}],validate:text=>(Lua_default.career_modules_inventory.isLicensePlateValid(text).then(valid=>{licensePlateTextValid.value=valid}),licensePlateTextValid.value),errorMessage:`Invalid character in license plate text`,disableWhenInvalid:!0});res!=0&&(Lua_default.career_modules_inventory.purchaseLicensePlateText(vehicle.id,res,300),vehicle.config.licenseName=res)},confirmExpediteRepair=async()=>{let vehicle=vehSelected.value;popHide();let price=vehicle.expediteRepairCost;await openConfirmation(``,`Do you want to expedite the repair for ${units.beamBucks(price)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&Lua_default.career_modules_inventory.expediteRepairFromInventory(vehicle.id,price)},openRepairMenu=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_insurance_repairScreen.openRepairMenu(vehicle,vehicleInventoryStore.vehicleInventoryData.originComputerId)},setFavoriteVehicle=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_inventory.setFavoriteVehicle(vehicle.id),Lua_default.career_modules_inventory.sendDataToUi()},storeVehicle=()=>{let vehicle=vehSelected.value;popHide(),Lua_default.career_modules_inventory.removeVehicleObject(vehicle.id),Lua_default.career_modules_inventory.sendDataToUi()},renameVehicle=async()=>{let vehicle=vehSelected.value;popHide();let res=await openPrompt(`Enter new vehicle name:`,`Rename Vehicle`,{maxLength:30,defaultValue:vehicle.niceName,buttons:[{label:$translate.instant(`ui.common.cancel`),value:!1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.okay`),value:text=>text,extras:{accent:ACCENTS.primary}}],validate:text=>(Lua_default.career_modules_inventory.isVehicleNameValid(text).then(valid=>{vehicleNameValid.value=valid}),vehicleNameValid.value),errorMessage:`Invalid characters in vehicle name`,disableWhenInvalid:!0});res!=0&&(Lua_default.career_modules_inventory.renameVehicle(vehicle.id,res),vehicle.niceName=res)},listVehicleForSale=async vehicle=>{popHide();let res=await openFormDialog(ListVehicleDialog_default,{vehicleName:vehicle.niceName,odometer:vehicle.odometer,marketValue:vehicle.value,price:Math.max(50,Math.round((vehicle.value||0)/50)*50)},model=>!Number.isFinite(model.price)||model.price<=0?{error:!0,message:`Enter a valid positive price`}:{error:!1},`List a Vehicle for Sale`,void 0,void 0,`90rem`);!res||!res.value||await Lua_default.career_modules_marketplace.listVehicles([{inventoryId:vehicle.id,value:res.formData.price}])},listVehicleForSaleFromContextMenu=async()=>{let vehicle=vehSelected.value;await listVehicleForSale(vehicle),Lua_default.career_modules_marketplace.openMenu(vehicleInventoryStore.vehicleInventoryData.originComputerId)},listVehicleForSaleFromMarketplaceMenu=async vehicle=>{await listVehicleForSale(vehicle),router_default.back()};return $game.events.on(`addListing`,data=>{listVehicleForSaleFromMarketplaceMenu(listView.value.find(v=>v.id===data.inventoryId))}),onUnmounted(()=>{$game.events.off(`addListing`)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$130,[listStatus.value?withDirectives((openBlock(),createBlock(VehicleTileRow_default,{key:0,class:`vehicle-list-item`,data:{_message:listStatus.value},layout:itemLayout.value},null,8,[`data`,`layout`])),[[unref(BngDisabled_default)]]):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(listView.value,vehicle=>withDirectives((openBlock(),createBlock(VehicleTileRow_default,{class:`vehicle-list-item`,key:vehicle.id,data:vehicle,layout:itemLayout.value,selected:vehSelected.value&&vehSelected.value.id===vehicle.id,"is-tutorial":unref(vehicleInventoryStore)&&unref(vehicleInventoryStore).vehicleInventoryData.tutorialActive,money:unref(vehicleInventoryStore)?unref(vehicleInventoryStore).vehicleInventoryData.playerMoney:0,tabindex:`0`,"bng-nav-item":``,onClick:$event=>!vehicle.disabled&&select(vehicle,$event)},null,8,[`data`,`layout`,`selected`,`is-tutorial`,`money`,`onClick`])),[[unref(BngDisabled_default),vehicle.disabled],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngPopover_default),unref(popId),`right-start`,{click:!0}]])),128)),createVNode(unref(bngPopoverMenu_default),{name:unref(popId),focus:``,onHide:_cache[9]||=$event=>selectedVehId.value=null},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleInventoryStore).vehicleInventoryData.chooseButtonsData,(buttonData,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[buttonData.repairRequired&&vehSelected.value&&vehSelected.value.needsRepair&&!unref(vehicleInventoryStore).vehicleInventoryData.tutorialActive?(openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,disabled:``},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonData.buttonText)+` (Needs repair) `,1)]),_:2},1032,[`accent`])):vehSelected.value&&isFunctionAvailable(vehSelected.value,buttonData)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).menu,onClick:$event=>unref(vehicleInventoryStore).chooseVehicle(vehSelected.value.id,index)},{default:withCtx(()=>[createTextVNode(toDisplayString(buttonData.buttonText),1)]),_:2},1032,[`accent`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)],64))),128)),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.returnLoanerEnabled&&vehSelected.value.returnLoanerPermission.allow?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,onClick:_cache[0]||=$event=>confirmReturnVehicle()},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(` Return loaned vehicle `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&vehSelected.value.delayReason===`repair`?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).menu,disabled:vehSelected.value.expediteRepairCost>unref(vehicleInventoryStore).vehicleInventoryData.playerMoney,onClick:_cache[1]||=$event=>confirmExpediteRepair(vehSelected.value)},{default:withCtx(()=>[_cache[11]||=createTextVNode(` Expedite Repair `,-1),createVNode(unref(bngUnit_default),{money:vehSelected.value.expediteRepairCost},null,8,[`money`])]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&vehSelected.value.delayReason!==`repair`&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.repairEnabled?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.repairPermission.allow,onClick:_cache[2]||=$event=>openRepairMenu()},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(` Repair `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.storingEnabled&&!vehSelected.value.inStorage?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.storePermission.allow,onClick:_cache[3]||=$event=>storeVehicle()},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(` Put in storage `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.favoriteEnabled?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:4,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.favoritePermission.allow||vehSelected.value.favorite,onClick:_cache[4]||=$event=>setFavoriteVehicle()},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(` Set as Favorite `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:5,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.licensePlateChangePermission.allow,onClick:_cache[5]||=$event=>personalizeLicensePlate(vehSelected.value)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(` Personalize license plate `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:6,accent:unref(ACCENTS).menu,onClick:_cache[6]||=$event=>renameVehicle()},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Rename vehicle `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.sellEnabled&&!vehSelected.value.listedForSale?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:7,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.sellPermission.allow,onClick:_cache[7]||=$event=>listVehicleForSaleFromContextMenu()},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` List vehicle for sale `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0),vehSelected.value&&unref(vehicleInventoryStore).vehicleInventoryData.buttonsActive.sellEnabled&&vehSelected.value.listedForSale?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:8,accent:unref(ACCENTS).menu,disabled:!vehSelected.value.sellPermission.allow,onClick:_cache[8]||=$event=>lookAtVehicleListing()},{default:withCtx(()=>[..._cache[18]||=[createTextVNode(` Go to vehicle listing `,-1)]]),_:1},8,[`accent`,`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)]),_:1},8,[`name`])])),[[unref(BngDisabled_default),!unref(vehicleInventoryStore)]])}},VehicleList_default$1=__plugin_vue_export_helper_default(_sfc_main$145,[[`__scopeId`,`data-v-5a84a046`]]),_sfc_main$144=Object.assign({inheritAttrs:!1},{__name:`VehicleInventory`,setup(__props,{expose:__expose}){let vehicleInventoryStore=useVehicleInventoryStore(),attrs=useAttrs();return __expose({closeMenu:vehicleInventoryStore.closeMenu}),onBeforeMount(()=>{vehicleInventoryStore.requestInitialData()}),onUnmounted(()=>{Lua_default.extensions.hook(`onExitVehicleInventory`),vehicleInventoryStore.menuClosed(),vehicleInventoryStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(VehicleList_default$1,normalizeProps(guardReactiveProps(unref(attrs))),null,16))}}),VehicleInventory_default=_sfc_main$144,_sfc_main$143={__name:`VehicleInventoryMain`,setup(__props){let vehicleInventoryStore=useVehicleInventoryStore(),router$1=useRouter(),title=computed(()=>vehicleInventoryStore.vehicleInventoryData.header||`My vehicles`);watch(()=>vehicleInventoryStore.vehIdToChooseAfterRepairPopup,(newId,oldId)=>{!oldId&&newId&&confirmRepair()});let confirmRepair=async vehicle=>{await openConfirmation(``,`Do you want to repair your previous vehicle?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])?vehicleInventoryStore.repairPopupAccept():vehicleInventoryStore.repairPopupDecline()},elInventory=ref(),close=()=>router$1.back();return onUnmounted(()=>{vehicleInventoryStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(ComputerWrapper_default,{ref:`wrapper`,title:title.value,back:``,onBack:close},{default:withCtx(()=>[createVNode(VehicleInventory_default,{ref_key:`elInventory`,ref:elInventory,class:`vehicle-inventory`},null,512)]),_:1},8,[`title`]))}},VehicleInventoryMain_default=__plugin_vue_export_helper_default(_sfc_main$143,[[`__scopeId`,`data-v-88176408`]]);const useVehiclePurchaseStore=defineStore(`vehiclePurchase`,()=>{let{events:events$3}=useBridge(),purchaseType=ref(``),vehicleInfo=ref({}),playerMoney=ref(0),alreadyDidTestDrive=ref(!1),inventoryHasFreeSlot=ref(!1),tradeInVehicleInfo=ref({}),tradeInEnabled=ref(!1),forceTradeIn=ref(!1),locationSelectionEnabled=ref(!1),forceNoDelivery=ref(!1),makeDelivery=ref(!1),buyCustomLicensePlate=ref(!1),customLicensePlateText=ref(``),prices=ref({}),insuranceOptions=ref({}),finalPackagePrice=computed(()=>{let price=prices.value.finalPrice;return buyCustomLicensePlate.value&&(price+=prices.value.customLicensePlate),insuranceOptions.value.insuranceId>0&&(price+=insuranceOptions.value.priceMoney),price}),handlePurchaseData=data=>{vehicleInfo.value=data.vehicleInfo,playerMoney.value=data.playerMoney,inventoryHasFreeSlot.value=data.inventoryHasFreeSlot,purchaseType.value=data.purchaseType,tradeInEnabled.value=data.tradeInEnabled,locationSelectionEnabled.value=data.locationSelectionEnabled,forceNoDelivery.value=data.forceNoDelivery,prices.value=data.prices,makeDelivery.value=!1,buyCustomLicensePlate.value=!1,customLicensePlateText.value=``,alreadyDidTestDrive.value=data.alreadyDidTestDrive,forceTradeIn.value=data.forceTradeIn,insuranceOptions.value=data.insuranceOptions,data.tradeInVehicleInfo===void 0?tradeInVehicleInfo.value={}:tradeInVehicleInfo.value=data.tradeInVehicleInfo};function requestPurchaseData(){Lua_default.career_modules_vehicleShopping.sendPurchaseDataToUi()}function buyVehicle(makeDelivery$1){let options={makeDelivery:makeDelivery$1,insuranceId:insuranceOptions.value.insuranceId};buyCustomLicensePlate.value&&(options.licensePlateText=customLicensePlateText.value),Lua_default.career_modules_vehicleShopping.buyFromPurchaseMenu(purchaseType.value,options)}function inventoryIsEmpty(){return Lua_default.career_modules_inventory.isEmpty()}function chooseTradeInVehicle(){Lua_default.career_modules_vehicleShopping.openInventoryMenuForTradeIn()}function removeTradeInVehicle(){Lua_default.career_modules_vehicleShopping.removeTradeInVehicle()}function cancel(){Lua_default.career_modules_vehicleShopping.cancelPurchase(purchaseType.value)}function startTestDrive(){Lua_default.career_modules_inspectVehicle.startTestDrive()}function dispose$2(){listen(!1)}let listen=state=>{events$3[state?`on`:`off`](`vehiclePurchaseData`,handlePurchaseData)};return listen(!0),{buyVehicle,cancel,chooseTradeInVehicle,purchaseType,startTestDrive,dispose:dispose$2,forceNoDelivery,forceTradeIn,inventoryIsEmpty,inventoryHasFreeSlot,locationSelectionEnabled,makeDelivery,playerMoney,prices,finalPackagePrice,removeTradeInVehicle,requestPurchaseData,tradeInEnabled,tradeInVehicleInfo,vehicleInfo,buyCustomLicensePlate,customLicensePlateText,alreadyDidTestDrive,insuranceOptions}});var _hoisted_1$129={class:`header-row`},_hoisted_2$109={class:`header-seller-info`},_hoisted_3$97={class:`purchase-list`},_hoisted_4$77={class:`purchase-row`},_hoisted_5$66={class:`label`},_hoisted_6$52={class:`sub-info`},_hoisted_7$44={class:`price`},_hoisted_8$36={class:`current-price-line`},_hoisted_9$33={key:0,class:`old-price`},_hoisted_10$27={class:`sub-info`},_hoisted_11$25={key:0,class:`purchase-row thin light-blue`},_hoisted_12$20={class:`label category`},_hoisted_13$18={class:`price category`},_hoisted_14$18={class:`purchase-row thin light-blue`},_hoisted_15$18={class:`price`},_hoisted_16$18={key:1,class:`purchase-divider`},_hoisted_17$14={key:2,class:`purchase-row thin green`},_hoisted_18$12={class:`label`},_hoisted_19$9={class:`price`},_hoisted_20$8={class:`purchase-row`},_hoisted_21$8={class:`price`},_hoisted_22$7={class:`purchase-row thin yellow`},_hoisted_23$6={class:`price`},_hoisted_24$5={key:3,class:`purchase-row thin`},_hoisted_25$4={class:`price`},_hoisted_26$3={class:`purchase-row`},_hoisted_27$3={class:`price highlight-category`},_hoisted_28$2={key:4,class:`purchase-row money-warning red`},_hoisted_29$2={class:`label`},_hoisted_30$2={class:`price`},_hoisted_31$2={class:`purchase-customization-group`},_hoisted_32$2={class:`button-group`},_hoisted_33$2={key:0},_hoisted_34$2={key:1},_hoisted_35$1={key:2},_hoisted_36$1={class:`right-side`},_sfc_main$142={__name:`VehiclePurchaseMain`,setup(__props){useUINavScope(`vehiclePurchase`);let{showIfController}=storeToRefs(controls_default()),{units}=useBridge(),router$1=useRouter(),hasVehicle=ref(!1),licensePlateTextValid=ref(!0),vehiclePurchaseStore=useVehiclePurchaseStore(),store$1=useTasksStore(),tradeInButtonMessage=computed(()=>vehiclePurchaseStore.tradeInEnabled?hasVehicle.value?void 0:`You don't own any vehicles`:`Trade in only possible in person at a dealership`),testDriveButtonMessage=computed(()=>{if(vehiclePurchaseStore.purchaseType!==`inspect`)return`Test drive only available for inspect purchases`;if(vehiclePurchaseStore.alreadyDidTestDrive)return`You have already done a test drive`}),vehicleFitsInventory=computed(()=>vehiclePurchaseStore.vehicleInfo.takesNoInventorySpace?!0:vehiclePurchaseStore.inventoryHasFreeSlot||vehiclePurchaseStore.tradeInVehicleInfo.niceName&&!vehiclePurchaseStore.tradeInVehicleInfo.takesNoInventorySpace);vehiclePurchaseStore.inventoryIsEmpty().then(empty=>{hasVehicle.value=!empty});let buy=()=>buyVehicle(!vehiclePurchaseStore.locationSelectionEnabled||vehiclePurchaseStore.makeDelivery),cancel=()=>{router$1.back()},startTestDrive=()=>{vehiclePurchaseStore.startTestDrive()},chooseTradeInVehicle=()=>{vehiclePurchaseStore.chooseTradeInVehicle()},chooseInsurance=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`purchase`,params:{purchaseType:vehiclePurchaseStore.purchaseType,shopId:vehiclePurchaseStore.vehicleInfo.shopId,insuranceId:vehiclePurchaseStore.insuranceOptions.insuranceId}})},negotiatePrice=()=>{Lua_default.career_modules_marketplace.startNegotiateSellingOffer(vehiclePurchaseStore.vehicleInfo.shopId)},removeTradeInVehicle=()=>{vehiclePurchaseStore.removeTradeInVehicle()},buyVehicle=_makeDelivery=>{vehiclePurchaseStore.buyVehicle(_makeDelivery)};return onMounted(()=>{vehiclePurchaseStore.requestPurchaseData()}),onUnmounted(async()=>{await Lua_default.career_modules_inspectVehicle.onPurchaseMenuClosed(),vehiclePurchaseStore.$dispose()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`purchase-layout`},{default:withCtx(()=>[unref(vehiclePurchaseStore).vehicleInfo.niceName?withDirectives((openBlock(),createBlock(unref(bngCard_default),{key:0,"bng-ui-scope":`vehiclePurchase`,class:`purchase-screen`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_32$2,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:unref(vehiclePurchaseStore).purchaseType!==`inspect`||unref(vehiclePurchaseStore).alreadyDidTestDrive,onClick:startTestDrive,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(`Test Drive`,-1)]]),_:1},8,[`disabled`,`accent`])),[[unref(BngTooltip_default),testDriveButtonMessage.value,`top`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney||!vehicleFitsInventory.value||unref(vehiclePurchaseStore).forceTradeIn&&!unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName||unref(vehiclePurchaseStore).buyCustomLicensePlate&&!licensePlateTextValid.value,"show-hold":``},{default:withCtx(()=>[unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney?(openBlock(),createElementBlock(`div`,_hoisted_33$2,`Insufficient Funds`)):vehicleFitsInventory.value?(openBlock(),createElementBlock(`div`,_hoisted_35$1,`Purchase`)):(openBlock(),createElementBlock(`div`,_hoisted_34$2,`No free inventory slots`))]),_:1},8,[`disabled`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:buy,holdDelay:1e3,repeatInterval:0}]])])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$129,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[_cache[0]||=createTextVNode(` Purchase Information `,-1),createBaseVNode(`div`,_hoisted_2$109,` Purchasing from: `+toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.sellerName),1)]),_:1}),createVNode(unref(bngButton_default),{class:`close-button`,onClick:cancel,accent:unref(ACCENTS).attention,"bng-no-nav":`true`,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`menu`,controller:``}),createVNode(unref(bngIcon_default),{type:`xmarkBold`,color:`var(--bng-cool-gray-100)`})]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_3$97,[createBaseVNode(`div`,_hoisted_4$77,[createBaseVNode(`div`,_hoisted_5$66,[createBaseVNode(`div`,null,toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.year)+` `+toDisplayString(unref(vehiclePurchaseStore).vehicleInfo.niceName),1),createBaseVNode(`div`,_hoisted_6$52,`(`+toDisplayString(unref(units).buildString(`length`,unref(vehiclePurchaseStore).vehicleInfo.Mileage,0))+`)`,1)]),createBaseVNode(`div`,_hoisted_7$44,[createBaseVNode(`div`,_hoisted_8$36,[unref(vehiclePurchaseStore).vehicleInfo.originalSellValue?(openBlock(),createElementBlock(`span`,_hoisted_9$33,[createVNode(unref(bngUnit_default),{money:unref(vehiclePurchaseStore).vehicleInfo.originalSellValue},null,8,[`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.Value},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_10$27,[createBaseVNode(`div`,null,[_cache[1]||=createTextVNode(` Est. Market: `,-1),createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.marketValue},null,8,[`money`])])])])]),_cache[13]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),unref(vehiclePurchaseStore).insuranceOptions.insuranceId>0?(openBlock(),createElementBlock(`div`,_hoisted_11$25,[createBaseVNode(`div`,_hoisted_12$20,toDisplayString(unref(vehiclePurchaseStore).insuranceOptions.spendingReason),1),createBaseVNode(`div`,_hoisted_13$18,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).insuranceOptions.priceMoney},null,8,[`money`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$18,[_cache[2]||=createBaseVNode(`div`,{class:`label`},`Dealership Fees`,-1),createBaseVNode(`div`,_hoisted_15$18,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).vehicleInfo.fees},null,8,[`money`])])]),unref(vehiclePurchaseStore).tradeInVehicleInfo?.niceName?(openBlock(),createElementBlock(`div`,_hoisted_16$18)):createCommentVNode(``,!0),unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName?(openBlock(),createElementBlock(`div`,_hoisted_17$14,[createBaseVNode(`div`,_hoisted_18$12,`Trade-in: `+toDisplayString(unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName),1),createBaseVNode(`div`,_hoisted_19$9,[createVNode(unref(bngUnit_default),{class:`money`,money:-unref(vehiclePurchaseStore).tradeInVehicleInfo.Value},null,8,[`money`])])])):createCommentVNode(``,!0),_cache[14]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),createBaseVNode(`div`,_hoisted_20$8,[_cache[3]||=createBaseVNode(`div`,{class:`label`},`Subtotal`,-1),createBaseVNode(`div`,_hoisted_21$8,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice-unref(vehiclePurchaseStore).prices.taxes-(unref(vehiclePurchaseStore).buyCustomLicensePlate?unref(vehiclePurchaseStore).prices.customLicensePlate:0)},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_22$7,[_cache[4]||=createBaseVNode(`div`,{class:`label`},`Sales Tax (7%)`,-1),createBaseVNode(`div`,_hoisted_23$6,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).prices.taxes},null,8,[`money`])])]),unref(vehiclePurchaseStore).buyCustomLicensePlate?(openBlock(),createElementBlock(`div`,_hoisted_24$5,[_cache[5]||=createBaseVNode(`div`,{class:`label`},`Custom License Plate`,-1),createBaseVNode(`div`,_hoisted_25$4,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).prices.customLicensePlate},null,8,[`money`])])])):createCommentVNode(``,!0),_cache[15]||=createBaseVNode(`div`,{class:`purchase-divider`},null,-1),createBaseVNode(`div`,_hoisted_26$3,[_cache[6]||=createBaseVNode(`div`,{class:`label highlight-category`},`Total`,-1),createBaseVNode(`div`,_hoisted_27$3,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice},null,8,[`money`])])]),unref(vehiclePurchaseStore).finalPackagePrice>unref(vehiclePurchaseStore).playerMoney?(openBlock(),createElementBlock(`div`,_hoisted_28$2,[createBaseVNode(`div`,_hoisted_29$2,[createVNode(unref(bngIcon_default),{type:`danger`}),_cache[7]||=createTextVNode(` Additional funds required`,-1)]),createBaseVNode(`div`,_hoisted_30$2,[createVNode(unref(bngUnit_default),{class:`money`,money:unref(vehiclePurchaseStore).finalPackagePrice-unref(vehiclePurchaseStore).playerMoney},null,8,[`money`])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_31$2,[_cache[12]||=createBaseVNode(`h4`,null,`Purchase Options`,-1),createVNode(unref(bngButton_default),{disabled:!unref(vehiclePurchaseStore).vehicleInfo.negotiationPossible,accent:`secondary`,onClick:negotiatePrice},{default:withCtx(()=>[..._cache[8]||=[createTextVNode(` Negotiate Price `,-1)]]),_:1},8,[`disabled`]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{disabled:!unref(vehiclePurchaseStore).tradeInEnabled||!hasVehicle.value,accent:`secondary`,onClick:chooseTradeInVehicle},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(`Choose Trade-In`,-1)]]),_:1},8,[`disabled`])),[[unref(BngTooltip_default),tradeInButtonMessage.value,`top`]]),unref(vehiclePurchaseStore).tradeInEnabled&&unref(vehiclePurchaseStore).tradeInVehicleInfo.niceName?(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:removeTradeInVehicle,accent:unref(ACCENTS).attention},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Remove Trade-In`,-1)]]),_:1},8,[`accent`])):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{onClick:chooseInsurance,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`Choose Insurance`,-1)]]),_:1},8,[`accent`])])])]),_:1})),[[unref(BngBlur_default),1]]):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_36$1,[createVNode(unref(bngCard_default),{class:`status-container`},{default:withCtx(()=>[createVNode(unref(careerStatus_default),{class:`profile-status`})]),_:1}),createVNode(TaskList_default,{class:`task-list`,header:unref(store$1).header,tasks:unref(store$1).tasks},null,8,[`header`,`tasks`])])]),_:1}))}},VehiclePurchaseMain_default=__plugin_vue_export_helper_default(_sfc_main$142,[[`__scopeId`,`data-v-b2028538`]]);const useVehicleShoppingStore=defineStore(`vehicleShopping`,()=>{let selectedSellerId=ref(``),currentSeller=ref({}),vehicleShoppingData=ref({}),filteredVehicles=ref([]),filteredSoldVehicles=ref([]),buildFilteredListByKey=(data,key)=>{if(!data||!data[key])return[];let filteredList=Object.keys(data[key]).reduce((result,itemKey)=>{let item=data[key][itemKey];return selectedSellerId.value?item.sellerId===selectedSellerId.value&&result.push(item):result.push(item),result},[]);return filteredList.length&&filteredList.sort((a$1,b)=>a$1.Value-b.Value),filteredList},updateListsFromData=()=>{filteredVehicles.value=buildFilteredListByKey(vehicleShoppingData.value,`vehiclesInShop`),filteredSoldVehicles.value=buildFilteredListByKey(vehicleShoppingData.value,`soldVehicles`)};return{vehicleShoppingData,filteredVehicles,filteredSoldVehicles,currentSeller,requestVehicleShoppingData:async()=>{vehicleShoppingData.value=await Lua_default.career_modules_vehicleShopping.getShoppingData(),updateListsFromData()},setSelectedSellerId:sellerId=>{selectedSellerId.value=sellerId,updateListsFromData(),currentSeller.value=vehicleShoppingData.value.uiDealershipsData.find(dealership=>dealership.id===sellerId)}}});var _hoisted_1$128={class:`cover-container`},_hoisted_2$108={key:0,class:`sold-overlay`},_hoisted_3$96={class:`car-details`},_hoisted_4$76={class:`car-value`},_hoisted_5$65={class:`name`},_hoisted_6$51={class:`brand`},_hoisted_7$43={class:`main-data`},_hoisted_8$35={key:0,class:`price`},_hoisted_9$32={class:`was`},_hoisted_10$26={class:`sold`},_hoisted_11$24={key:0,class:`market`},_hoisted_12$19={key:1,class:`price`},_hoisted_13$17={key:0},_hoisted_14$17={key:1,style:{color:`rgb(245, 29, 29)`}},_hoisted_15$17={key:2,class:`market`},_hoisted_16$17={class:`car-data`},_hoisted_17$13={style:{width:`100%`}},_hoisted_18$11={key:0,style:{flex:`1 0 auto`,"justify-content":`flex-end`,padding:`0.5em 0.75em`,"font-weight":`400`,"font-family":`var(--fnt-defs)`}},DRIVE_TRAIN_ICONS={AWD:icons.AWD,"4WD":icons[`4WD`],FWD:icons.FWD,RWD:icons.RWD,drivetrain_special:icons.drivetrainSpecial,drivetrain_generic:icons.drivetrainGeneric,defaultMissing:icons.drivetrainGeneric,defaultUnknown:icons.drivetrainGeneric},FUEL_TYPE_ICONS={Battery:icons.charge,Gasoline:icons.fuelPump,Diesel:icons.fuelPump,defaultMissing:icons.fuelPump,defaultUnknown:icons.fuelPump},TRANSMISSION_ICONS={Automatic:icons.transmissionA,Manual:icons.transmissionM,defaultMissing:icons.transmissionM,defaultUnknown:icons.transmissionM},_sfc_main$141={__name:`VehicleCard`,props:{vehicleShoppingData:Object,vehicle:Object},setup(__props){let{units}=useBridge(),props=__props,soldPercent=computed(()=>{let asking=props.vehicle?.Value,sold=props.vehicle?.soldFor;return!asking||!sold?0:(sold-asking)/asking*100}),soldDeltaPrefix=computed(()=>soldPercent.value>=0?`+`:``),soldDeltaClass=computed(()=>soldPercent.value>0?`up`:soldPercent.value<0?`down`:`flat`),confirmTaxi=async vehicle=>{await openConfirmation(``,`Do you want to taxi to this vehicle for ${units.beamBucks(vehicle.quickTravelPrice)}?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&quickTravelToVehicle(vehicle)},showVehicle=shopId=>{Lua_default.career_modules_vehicleShopping.showVehicle(shopId)},quickTravelToVehicle=vehicle=>{Lua_default.career_modules_vehicleShopping.quickTravelToVehicle(vehicle.shopId)},openPurchaseMenu=(purchaseType,shopId)=>{Lua_default.career_modules_vehicleShopping.openPurchaseMenu(purchaseType,shopId)},getAttributeIcon=(vehicle,attribute)=>{let iconDict;return attribute==`Drivetrain`?iconDict=DRIVE_TRAIN_ICONS:attribute==`Fuel Type`?iconDict=FUEL_TYPE_ICONS:attribute==`Transmission`&&(iconDict=TRANSMISSION_ICONS),vehicle[attribute]?iconDict[vehicle[attribute]]||iconDict.defaultUnknown:iconDict.defaultMissing};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{class:normalizeClass(`vehicle-card row`)},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_17$13,[__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:0,style:{float:`left`},keyLabel:`Seller:`,valueLabel:__props.vehicle.sellerName},null,8,[`valueLabel`])),__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,style:{float:`left`},keyLabel:`Distance:`,valueLabel:unref(units).buildString(`length`,__props.vehicle.distance,1)},null,8,[`valueLabel`])),createVNode(unref(bngPropVal_default),{style:{float:`left`},keyLabel:`Insurance Class:`,valueLabel:__props.vehicle.insuranceClass?.name??`Unknown`},null,8,[`valueLabel`])]),__props.vehicleShoppingData.disableShopping?(openBlock(),createElementBlock(`span`,_hoisted_18$11,toDisplayString(__props.vehicleShoppingData.disableShoppingReason),1)):createCommentVNode(``,!0),__props.vehicle.sellerId===__props.vehicleShoppingData.currentSeller?(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[0]||=$event=>showVehicle(__props.vehicle.shopId),accent:unref(ACCENTS).secondary,disabled:__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Inspect Vehicle`,-1)]]),_:1},8,[`accent`,`disabled`])):(openBlock(),createBlock(unref(bngButton_default),{key:2,onClick:_cache[1]||=$event=>showVehicle(__props.vehicle.shopId),accent:unref(ACCENTS).secondary,disabled:__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`Set Route`,-1)]]),_:1},8,[`accent`,`disabled`])),__props.vehicleShoppingData.currentSeller?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:__props.vehicleShoppingData.playerAttributes.money.value<__props.vehicle.quickTravelPrice||__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter,onClick:_cache[2]||=$event=>confirmTaxi(__props.vehicle),accent:__props.vehicle.sellerId===`private`?unref(ACCENTS).main:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[12]||=[createBaseVNode(`span`,{style:{flex:`1 0 auto`}},`Take Taxi`,-1)]]),_:1},8,[`disabled`,`accent`])),__props.vehicle.sellerId===`private`?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:__props.vehicleShoppingData.tutorialPurchase||__props.vehicleShoppingData.disableShopping||!!__props.vehicle.soldViewCounter,onClick:_cache[3]||=$event=>openPurchaseMenu(`instant`,__props.vehicle.shopId)},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`Purchase`,-1)]]),_:1},8,[`disabled`]))]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$128,[createVNode(unref(aspectRatio_default),{class:`cover`,ratio:`16:9`,"external-image":__props.vehicle.preview},null,8,[`external-image`]),__props.vehicle.soldViewCounter>0?(openBlock(),createElementBlock(`div`,_hoisted_2$108,`SOLD`)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$96,[createBaseVNode(`div`,_hoisted_4$76,[createBaseVNode(`div`,{class:normalizeClass([`car-name`,{sold:__props.vehicle.soldViewCounter>0}])},[createBaseVNode(`h3`,_hoisted_5$65,toDisplayString(__props.vehicle.year)+` `+toDisplayString(__props.vehicle.Name)+` `+toDisplayString(__props.vehicle.soldViewCounter>0?` (Sold)`:``),1),createBaseVNode(`div`,_hoisted_6$51,toDisplayString(__props.vehicle.Brand),1)],2),createBaseVNode(`div`,_hoisted_7$43,[createVNode(unref(bngPropVal_default),{class:`prop-small`,iconColor:`var(--bng-cool-gray-300)`,iconType:unref(icons).bus,valueLabel:unref(units).buildString(`length`,__props.vehicle.Mileage,0)},null,8,[`iconType`,`valueLabel`]),createVNode(unref(bngPropVal_default),{class:`prop-small`,style:{flex:`1 0 auto`},iconColor:`var(--bng-cool-gray-300)`,iconType:unref(icons).bus,valueLabel:__props.vehicle.Drivetrain},null,8,[`iconType`,`valueLabel`]),__props.vehicle.soldFor?(openBlock(),createElementBlock(`div`,_hoisted_8$35,[createBaseVNode(`div`,_hoisted_9$32,[_cache[4]||=createTextVNode(`Was: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.Value},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_10$26,[_cache[5]||=createTextVNode(`Sold for: `,-1),createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.soldFor},null,8,[`money`])]),createBaseVNode(`div`,{class:normalizeClass([`delta`,soldDeltaClass.value])},toDisplayString(soldDeltaPrefix.value)+toDisplayString(soldPercent.value.toFixed(1))+`% from asking`,3),__props.vehicle.marketValue?(openBlock(),createElementBlock(`div`,_hoisted_11$24,[_cache[6]||=createTextVNode(`Market: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.marketValue},null,8,[`money`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$19,[__props.vehicle.Value<=__props.vehicleShoppingData.playerAttributes.money.value?(openBlock(),createElementBlock(`div`,_hoisted_13$17,[createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.Value},null,8,[`money`]),_cache[7]||=createTextVNode(`*`,-1)])):(openBlock(),createElementBlock(`div`,_hoisted_14$17,[createVNode(unref(bngUnit_default),{class:`car-price`,money:__props.vehicle.Value},null,8,[`money`]),_cache[8]||=createTextVNode(`* Insufficient Funds`,-1)])),__props.vehicle.marketValue?(openBlock(),createElementBlock(`div`,_hoisted_15$17,[_cache[9]||=createTextVNode(`Market: `,-1),createVNode(unref(bngUnit_default),{money:__props.vehicle.marketValue},null,8,[`money`])])):createCommentVNode(``,!0)]))])]),createBaseVNode(`div`,_hoisted_16$17,[__props.vehicle.Power==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:0,iconType:unref(icons).powerGauge04,keyLabel:`Power:`,valueLabel:unref(units).buildString(`power`,__props.vehicle.Power,0)},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Mileage==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:1,iconType:unref(icons).odometer,keyLabel:`Mileage:`,valueLabel:unref(units).buildString(`length`,__props.vehicle.Mileage,0)},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Transmission==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:2,iconType:getAttributeIcon(__props.vehicle,`Transmission`),keyLabel:`Transmission:`,valueLabel:__props.vehicle.Transmission},null,8,[`iconType`,`valueLabel`])),__props.vehicle[`Fuel Type`]==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:3,iconType:getAttributeIcon(__props.vehicle,`Fuel Type`),keyLabel:`Fuel type:`,valueLabel:__props.vehicle[`Fuel Type`]},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Drivetrain==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:4,iconType:getAttributeIcon(__props.vehicle,`Drivetrain`),keyLabel:`Drivetrain:`,valueLabel:__props.vehicle.Drivetrain},null,8,[`iconType`,`valueLabel`])),__props.vehicle.Weight==null?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngPropVal_default),{key:5,iconType:unref(icons).weight,keyLabel:`Weight:`,valueLabel:unref(units).buildString(`weight`,__props.vehicle.Weight,0)},null,8,[`iconType`,`valueLabel`]))])])]),_:1}))}},VehicleCard_default=__plugin_vue_export_helper_default(_sfc_main$141,[[`__scopeId`,`data-v-dea06661`]]),_hoisted_1$127={class:`site-body`,"bng-nav-scroll":``,"bng-nav-scroll-force":``},_hoisted_2$107={class:`heading`},_hoisted_3$95={class:`header-text`},_hoisted_4$75={key:0,class:`vehicle-list`},_hoisted_5$64={key:1,class:`vehicle-list sold-list`},_hoisted_6$50={class:`list-section-title`},_sfc_main$140={__name:`VehicleList`,setup(__props){useUINavScope(`vehicleList`);let vehicleShoppingStore=useVehicleShoppingStore(),getHeaderText=()=>vehicleShoppingStore?.currentSeller?.name||`BeamCar24`;return reactive([{name:`switch`,selected:!0,class:``},{name:`me`,selected:!1,class:``},{name:`please`,selected:!1,class:``}]),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`vehicle-shop-wrapper`,"bng-ui-scope":`vehicleList`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$127,[createBaseVNode(`div`,_hoisted_2$107,[createBaseVNode(`span`,_hoisted_3$95,toDisplayString(getHeaderText()),1),_cache[0]||=createBaseVNode(`span`,{class:`price-notice`},[createBaseVNode(`span`,null,`*\xA0`),createBaseVNode(`span`,null,`Additional taxes and fees are applicable`)],-1)]),unref(vehicleShoppingStore)?(openBlock(),createElementBlock(`div`,_hoisted_4$75,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).filteredVehicles,(vehicle,key)=>(openBlock(),createBlock(VehicleCard_default,{key,vehicleShoppingData:unref(vehicleShoppingStore).vehicleShoppingData,vehicle},null,8,[`vehicleShoppingData`,`vehicle`]))),128))])):createCommentVNode(``,!0),unref(vehicleShoppingStore)&&unref(vehicleShoppingStore).filteredSoldVehicles&&unref(vehicleShoppingStore).filteredSoldVehicles.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$64,[createBaseVNode(`div`,_hoisted_6$50,`Recently Sold Vehicles You Viewed (`+toDisplayString(unref(vehicleShoppingStore).filteredSoldVehicles.length)+`)`,1),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).filteredSoldVehicles,(vehicle,key)=>(openBlock(),createBlock(VehicleCard_default,{key,vehicleShoppingData:unref(vehicleShoppingStore).vehicleShoppingData,vehicle},null,8,[`vehicleShoppingData`,`vehicle`]))),128))])):createCommentVNode(``,!0)])]),_:1})),[[unref(BngBlur_default)]])}},VehicleList_default=__plugin_vue_export_helper_default(_sfc_main$140,[[`__scopeId`,`data-v-5045aa89`]]),_hoisted_1$126={class:`veh-part-caption`},_hoisted_2$106={class:`veh-name`},_hoisted_3$94={class:`veh-name-count`},_hoisted_4$74={class:`veh-price`},_hoisted_5$63={class:`veh-remove`},_hoisted_6$49={key:0,class:`offer-card red`},_hoisted_7$42=[`onMouseover`,`onMouseleave`,`onActivate`,`onDeactivate`],_hoisted_8$34={class:`offer-info`},_hoisted_9$31={class:`offer-header`},_hoisted_10$25={class:`buyer-name`},_hoisted_11$23={key:0,class:`expired-badge`},_hoisted_12$18={class:`offer-details`},_hoisted_13$16={class:`detail-row`},_hoisted_14$16={class:`detail-row`},_hoisted_15$16={class:`spec-actions`},_hoisted_16$16={key:1,class:`offer-card`},_sfc_main$139={__name:`VehicleMarketplace`,setup(__props){useComputerStore();let listings=ref([]),confirmRemoveListingScreen=async listingId=>{await openConfirmation(``,`Do you want to remove this listing?`,[{label:$translate.instant(`ui.common.yes`),value:!0,extras:{default:!0}},{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}}])&&removeVehicleListing(listingId)},onActivated$1=offer=>{offer.active=!0},onDeactivated$1=offer=>{offer.active=!1},onOfferHovered=offer=>{offer.hovered=!0},onOfferUnhovered=offer=>{offer.hovered=!1},handleListings=data=>{listings.value=data},getNewData=()=>{Lua_default.career_modules_marketplace.getListings().then(handleListings)},acceptOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.acceptOffer(inventoryId,offerIndex+1).then(getNewData)},declineOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.declineOffer(inventoryId,offerIndex+1).then(getNewData)},startNegotiateBuyingOffer=(inventoryId,offerIndex)=>{Lua_default.career_modules_marketplace.startNegotiateBuyingOffer(inventoryId,offerIndex+1).then(getNewData)},removeVehicleListing=inventoryId=>{Lua_default.career_modules_marketplace.removeVehicleListing(inventoryId).then(getNewData)},listVehicle=()=>{Lua_default.career_modules_inventory.openInventoryMenuForChoosingListing()};return onMounted(()=>{Lua_default.career_modules_marketplace.menuOpened(!0),getNewData()}),onUnmounted(()=>{Lua_default.career_modules_marketplace.menuOpened(!1)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(accordion_default),{class:`part-groups`,items:listings.value},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(listings.value,listing=>(openBlock(),createBlock(unref(accordionItem_default),{key:listing.id,expanded:!0,class:normalizeClass([`marketplace-listing`,{disabled:listing.disabled}])},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$126,[listing.thumbnail?(openBlock(),createElementBlock(`div`,{key:0,class:`veh-preview`,style:normalizeStyle({backgroundImage:`url('${listing.thumbnail}')`})},null,4)):createCommentVNode(``,!0),createBaseVNode(`span`,_hoisted_2$106,[createTextVNode(toDisplayString(listing.niceName)+` `,1),createBaseVNode(`span`,_hoisted_3$94,`(`+toDisplayString(listing.offers.length||0)+`)`,1)]),createBaseVNode(`span`,_hoisted_4$74,[createBaseVNode(`div`,null,[_cache[0]||=createTextVNode(` Asking Price: `,-1),createVNode(unref(bngUnit_default),{money:listing.value},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[1]||=createTextVNode(` Estimated Market Value: `,-1),createVNode(unref(bngUnit_default),{money:listing.marketValue},null,8,[`money`])])]),createBaseVNode(`span`,_hoisted_5$63,[createVNode(unref(bngButton_default),{onClick:withModifiers($event=>confirmRemoveListingScreen(listing.id),[`stop`]),icon:unref(icons).trashBin1,accent:unref(ACCENTS).attentionghost},null,8,[`onClick`,`icon`,`accent`])])])]),default:withCtx(()=>[listing.disabled?(openBlock(),createElementBlock(`div`,_hoisted_6$49,toDisplayString(listing.disableReason),1)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(listing.offers,(offer,index)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`offer-card`,{expired:offer.expiredViewCounter==1}]),onMouseover:$event=>onOfferHovered(offer),onMouseleave:$event=>onOfferUnhovered(offer),onActivate:$event=>onActivated$1(offer),onDeactivate:$event=>onDeactivated$1(offer)},[createBaseVNode(`div`,_hoisted_8$34,[createBaseVNode(`div`,_hoisted_9$31,[createBaseVNode(`span`,_hoisted_10$25,toDisplayString(offer.buyerPersonality.name),1),offer.expiredViewCounter?(openBlock(),createElementBlock(`span`,_hoisted_11$23,`EXPIRED`)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_12$18,[createBaseVNode(`div`,_hoisted_13$16,[_cache[3]||=createBaseVNode(`span`,{class:`detail-label`},`Offer:`,-1),createVNode(unref(bngUnit_default),{money:offer.value},null,8,[`money`]),createBaseVNode(`span`,{class:normalizeClass([`delta`,{up:offer.value>listing.value,down:offer.valuelisting.value?`+`:`-`),1),createVNode(unref(bngUnit_default),{money:Math.abs(offer.value-listing.value)},null,8,[`money`]),_cache[2]||=createTextVNode(`) `,-1)],2)]),createBaseVNode(`div`,_hoisted_14$16,[_cache[4]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,null,toDisplayString(listing.niceName),1)])])]),createBaseVNode(`div`,_hoisted_15$16,[createVNode(unref(bngButton_default),{class:`part-button`,onClick:$event=>declineOffer(listing.id,index),accent:unref(ACCENTS).attention},{default:withCtx(()=>[createTextVNode(toDisplayString(offer.expiredViewCounter?`Discard`:`Deny`),1)]),_:2},1032,[`onClick`,`accent`]),offer.expiredViewCounter?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`part-button negotiate-button`,onClick:$event=>startNegotiateBuyingOffer(listing.id,index),accent:unref(ACCENTS).secondary,disabled:!offer.negotiationPossible||offer.value>=listing.value||listing.disabled},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(` Negotiate `,-1)]]),_:1},8,[`onClick`,`accent`,`disabled`])),offer.expiredViewCounter?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,class:`part-button`,onClick:$event=>acceptOffer(listing.id,index),disabled:listing.disabled||offer.disabled,accent:unref(ACCENTS).main},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Accept Offer `,-1)]]),_:1},8,[`onClick`,`disabled`,`accent`]))])],42,_hoisted_7$42)),[[unref(BngScopedNav_default)]])),256)),Object.keys(listing.offers||{}).length===0?(openBlock(),createElementBlock(`div`,_hoisted_16$16,toDisplayString(unref($translate).instant(`ui.career.vehicleMarketplace.noOffers`)),1)):createCommentVNode(``,!0)]),_:2},1032,[`class`]))),128))]),_:1},8,[`items`]),createVNode(unref(bngButton_default),{class:`add-listing-button`,onClick:listVehicle,accent:unref(ACCENTS).custom},{default:withCtx(()=>[..._cache[7]||=[createBaseVNode(`span`,{class:`add-listing-button-icon`},`+`,-1),createTextVNode(` Add Listing `,-1)]]),_:1},8,[`accent`])],64))}},VehicleMarketplace_default=__plugin_vue_export_helper_default(_sfc_main$139,[[`__scopeId`,`data-v-468e550d`]]),_hoisted_1$125={class:`flex-container`},_hoisted_2$105={class:`content`},_hoisted_3$93={key:0},_hoisted_4$73={class:`seller-grid`},_hoisted_5$62={class:`seller-card__label`},_hoisted_6$48={class:`seller-card__header`},_hoisted_7$41={class:`seller-card__title`},_hoisted_8$33={key:0,class:`seller-card__subtitle`},_hoisted_9$30={class:`seller-card__vehicle-thumbnails`},_hoisted_10$24={class:`seller-card__vehicle-thumbnail`},_hoisted_11$22={key:0,class:`more-label`},_hoisted_12$17={key:1},buyVehicleTitle=`Buy Vehicles`,sellVehicleTitle=`Sell Vehicles`,_sfc_main$138={__name:`VehicleShoppingMain`,props:{screenTag:{type:String,default:``},buyingAvailable:{type:String,default:`true`},marketplaceAvailable:{type:String,default:`true`},selectedSellerId:{type:String,default:``}},setup(__props){useUINavScope(`vehicleShopping`),useComputerStore();let vehicleShoppingStore=useVehicleShoppingStore(),selectedTab=ref(0),selectedSellerId=ref(``),router$1=useRouter(),loaded=ref(!1),selectSeller=sellerId=>{setSelectedSellerId(sellerId),updateRouteScreenTag()},tabs=computed(()=>{let tabs$1=[];return props.buyingAvailable===`true`&&tabs$1.push(buyVehicleTitle),props.marketplaceAvailable===`true`&&tabs$1.push(sellVehicleTitle),tabs$1}),props=__props,processTabInput=event=>{event.detail.name===`tab_l`?selectedTab.value=(selectedTab.value-1+tabs.value.length)%tabs.value.length:event.detail.name===`tab_r`&&(selectedTab.value=(selectedTab.value+1)%tabs.value.length)},onTabsChange=(tab,old)=>{let idx=tabs.value.indexOf(tab&&tab.heading?tab.heading:``);idx!==-1&&(selectedTab.value=idx),selectedTab.value===tabs.value.indexOf(buyVehicleTitle)&&(selectedSellerId.value=``)},headerTitle=computed(()=>{switch(tabs.value[selectedTab.value]){case buyVehicleTitle:return`Buy Vehicles`;case sellVehicleTitle:return`Sell Vehicles`;default:return`Available Vehicles`}}),updateRouteScreenTag=()=>{let screenTag=selectedTab.value===tabs.value.indexOf(sellVehicleTitle)?`marketplace`:`buying`;router$1.replace({name:`vehicleShopping`,params:{screenTag,buyingAvailable:props.buyingAvailable,marketplaceAvailable:props.marketplaceAvailable,selectedSellerId:selectedSellerId.value}})};watch(selectedTab,()=>{updateRouteScreenTag()});let setSelectedSellerId=sellerId=>{selectedSellerId.value=sellerId,vehicleShoppingStore.setSelectedSellerId(selectedSellerId.value)},dealershipVehiclesMap=computed(()=>{let map=new Map;return vehicleShoppingStore.vehicleShoppingData.vehiclesInShop&&vehicleShoppingStore.vehicleShoppingData.vehiclesInShop.filter(vehicle=>vehicle.preview).forEach(vehicle=>{map.has(vehicle.sellerId)||map.set(vehicle.sellerId,[]),map.get(vehicle.sellerId).push(vehicle)}),map}),getDealershipVehicles=dealershipId=>dealershipVehiclesMap.value.get(dealershipId)||[],start=()=>{nextTick(async()=>{await vehicleShoppingStore.requestVehicleShoppingData(),loaded.value=!0,vehicleShoppingStore.vehicleShoppingData.currentSeller?setSelectedSellerId(vehicleShoppingStore.vehicleShoppingData.currentSeller):setSelectedSellerId(props.selectedSellerId),props.screenTag==`buying`?selectedTab.value=tabs.value.indexOf(buyVehicleTitle):props.screenTag==`marketplace`?selectedTab.value=tabs.value.indexOf(sellVehicleTitle):selectedTab.value=0,updateRouteScreenTag()})},kill=async()=>{await Lua_default.career_modules_vehicleShopping.onShoppingMenuClosed(),vehicleShoppingStore.$dispose()},close=()=>{!vehicleShoppingStore.vehicleShoppingData.currentSeller&&selectedTab.value===tabs.value.indexOf(buyVehicleTitle)&&selectedSellerId.value?selectedSellerId.value=``:router$1.back()};return onMounted(start),onUnmounted(kill),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(ComputerWrapper_default,{path:[unref(vehicleShoppingStore).vehicleShoppingData.currentSellerNiceName||`Vehicle Marketplace`],title:headerTitle.value,"bng-ui-scope":`vehicleShopping`,back:``,onBack:close},{status:withCtx(()=>[createTextVNode(` Free Inventory Slots: `+toDisplayString(unref(vehicleShoppingStore)?unref(vehicleShoppingStore).vehicleShoppingData.numberOfFreeSlots:0),1)]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$125,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$105,[createVNode(unref(tabs_default),{class:normalizeClass([`bng-tabs`,{"single-tab":tabs.value.length===1}]),selectedIndex:selectedTab.value,onChange:onTabsChange},{default:withCtx(()=>[createVNode(unref(tabList_default)),props.buyingAvailable===`true`?(openBlock(),createElementBlock(`div`,{key:0,"tab-heading":buyVehicleTitle,class:`buying-tab-content`},[loaded.value&&!selectedSellerId.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`buying-card`},{default:withCtx(()=>[unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData&&Object.keys(unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData).length?(openBlock(),createElementBlock(`div`,_hoisted_3$93,[createBaseVNode(`div`,_hoisted_4$73,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(vehicleShoppingStore).vehicleShoppingData.uiDealershipsData,dealership=>(openBlock(),createBlock(unref(bngTile_default),{key:dealership.id,class:`seller-card`,style:normalizeStyle({backgroundImage:`linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0)), url(`+(dealership.preview&&dealership.preview[0]===`/`?dealership.preview:`/`+dealership.preview)+`)`}),onClick:$event=>dealership.vehicleCount&&selectSeller(dealership.id)},{label:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$62,[createBaseVNode(`div`,_hoisted_6$48,[createBaseVNode(`div`,_hoisted_7$41,[createVNode(unref(bngIcon_default),{type:dealership.icon},null,8,[`type`]),createTextVNode(toDisplayString(dealership.name),1)]),dealership.description?(openBlock(),createElementBlock(`div`,_hoisted_8$33,toDisplayString(dealership.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_9$30,[(openBlock(!0),createElementBlock(Fragment,null,renderList(getDealershipVehicles(dealership.id).slice(0,5),(vehicle,index)=>(openBlock(),createElementBlock(`div`,_hoisted_10$24,[createVNode(unref(aspectRatio_default),{ratio:`16:9`,class:`seller-card__vehicle-thumbnail-image`,"external-image":vehicle.preview},{default:withCtx(()=>[index==0&&getDealershipVehicles(dealership.id).length>5?(openBlock(),createElementBlock(`div`,_hoisted_11$22,` +`+toDisplayString(getDealershipVehicles(dealership.id).length-4),1)):createCommentVNode(``,!0)]),_:2},1032,[`external-image`])]))),256))])])]),_:2},1032,[`style`,`onClick`]))),128))])])):(openBlock(),createElementBlock(`div`,_hoisted_12$17,[..._cache[0]||=[createBaseVNode(`span`,null,`No sellers available.`,-1)]]))]),_:1})):loaded.value?(openBlock(),createBlock(VehicleList_default,{key:1})):(openBlock(),createBlock(unref(bngCard_default),{key:2},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{style:{color:`#fff`}},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Please wait...`,-1)]]),_:1})]),_:1}))])):createCommentVNode(``,!0),props.marketplaceAvailable===`true`?(openBlock(),createElementBlock(`div`,{key:1,"tab-heading":sellVehicleTitle,class:`marketplace-tab-content`},[createVNode(VehicleMarketplace_default)])):createCommentVNode(``,!0)]),_:1},8,[`class`,`selectedIndex`])])),[[unref(BngBlur_default),1]])])]),_:1},8,[`path`,`title`])),[[unref(BngOnUiNav_default),processTabInput,`tab_l,tab_r`]])}},VehicleShoppingMain_default=__plugin_vue_export_helper_default(_sfc_main$138,[[`__scopeId`,`data-v-83009aa9`]]),_hoisted_1$124={style:{padding:`1em`,overflow:`auto`}},_hoisted_2$104={class:`performance-class-container`},_hoisted_3$92={key:0,class:`performance-class-wrapper`},_hoisted_4$72={class:`class-badge`},_hoisted_5$61={class:`certification-container`},_hoisted_6$47={class:`specs-section`},_hoisted_7$40={key:0},_hoisted_8$32={key:1,class:`specs-grid`},_hoisted_9$29={class:`spec-row`},_hoisted_10$23={class:`spec-label`},_hoisted_11$21={class:`spec-value`},_hoisted_12$16={class:`spec-row`},_hoisted_13$15={class:`spec-value`},_hoisted_14$15={class:`spec-row`},_hoisted_15$15={class:`spec-label`},_hoisted_16$15={class:`spec-value`},_hoisted_17$12={class:`spec-row`},_hoisted_18$10={class:`spec-label`},_hoisted_19$8={class:`spec-value`},_hoisted_20$7={class:`spec-row`},_hoisted_21$7={class:`spec-label`},_hoisted_22$6={class:`spec-value`},_hoisted_23$5={class:`spec-row`},_hoisted_24$4={class:`spec-value`},_hoisted_25$3={class:`spec-row`},_hoisted_26$2={class:`spec-value`},_hoisted_27$2={class:`specs-section`},_hoisted_28$1={key:0,class:`metrics-grid`},_hoisted_29$1={key:3,class:`performance-index-container`},_hoisted_30$1={class:`progress-wrapper`},_hoisted_31$1={class:`class-markers`},_hoisted_32$1={class:`marker-label`},_hoisted_33$1={class:`history-dropdown-container`},_hoisted_34$1={class:`dropdown`},_sfc_main$137={__name:`VehiclePerformanceTile`,props:{vehicleData:Object},setup(__props){let{units}=useBridge(),props=__props;computed(()=>props.vehicleData.niceName||`No Name`);let startTestTitle=computed(()=>props.vehicleData.needsRepair?`Assess Performance (Repair Required)`:`Assess Performance Now`),startTest=function(){Lua_default.career_modules_vehiclePerformance.startDragTest(props.vehicleData.id)},getColorForValue=(value,min$1=0,max$1=1)=>{let normalizedValue=(value-min$1)/(max$1-min$1),adjustedValue=Math.max(0,normalizedValue-.1)*(1/.9),red,green;return adjustedValue<.5?(red=200,green=Math.round(200*(adjustedValue*2))):(red=Math.round(200*(2-adjustedValue*2)),green=200),`rgb(${red}, ${green}, 0)`},selectedHistoryIndex=ref(0),allCertificationData=computed(()=>[props.vehicleData.certificationData||{noPerformanceData:!0},...props.vehicleData.performanceHistory||[]]),historyOptions=computed(()=>allCertificationData.value.length?allCertificationData.value.map((item,index)=>({value:index,label:index===0?item.noPerformanceData?`Current Test Results: No data`:`Current Test Results - `+new Date(item.timeStamp).toLocaleString():`Previous Test Results - ${new Date(item.timeStamp).toLocaleString()}`})):[]),selectedCertificationData=computed(()=>allCertificationData.value[selectedHistoryIndex.value]);return watch(()=>props.vehicleData,newVal=>{},{immediate:!0}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngCard_default),{class:`card`},{footer:withCtx(()=>[createBaseVNode(`div`,_hoisted_33$1,[createBaseVNode(`div`,_hoisted_34$1,[_cache[8]||=createBaseVNode(`div`,{class:`dropdown-label`},`Previous Assessments`,-1),createVNode(unref(bngDropdown_default),{modelValue:selectedHistoryIndex.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedHistoryIndex.value=$event,items:historyOptions.value,class:`history-select`},{default:withCtx(()=>[createTextVNode(toDisplayString(historyOptions.value[selectedHistoryIndex.value].text),1)]),_:1},8,[`modelValue`,`items`])]),createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>startTest(),disabled:__props.vehicleData.needsRepair||!__props.vehicleData.owned},{default:withCtx(()=>[createTextVNode(toDisplayString(startTestTitle.value),1)]),_:1},8,[`disabled`])])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$124,[createBaseVNode(`div`,null,[createVNode(VehicleTileRow_default,{class:`vehicle-tile-row`,data:__props.vehicleData,enableHover:!1,small:!0},null,8,[`data`]),createBaseVNode(`div`,_hoisted_2$104,[selectedCertificationData.value&&selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_3$92,[createBaseVNode(`span`,_hoisted_4$72,` Class `+toDisplayString(selectedCertificationData.value.vehicleClass.class.name)+` | PI `+toDisplayString(selectedCertificationData.value.vehicleClass.performanceIndex.toFixed(0)),1)])):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_5$61,[createBaseVNode(`div`,_hoisted_6$47,[_cache[5]||=createBaseVNode(`div`,{class:`section-header`},[createBaseVNode(`h2`,null,`Technical Specifications`)],-1),selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_8$32,[createBaseVNode(`div`,_hoisted_9$29,[createBaseVNode(`div`,_hoisted_10$23,toDisplayString(_ctx.$t(`ui.options.units.weight`)),1),createBaseVNode(`div`,_hoisted_11$21,toDisplayString(_ctx.$game.units.buildString(`weight`,selectedCertificationData.value.weight,0)),1)]),createBaseVNode(`div`,_hoisted_12$16,[_cache[2]||=createBaseVNode(`div`,{class:`spec-label`},`Power/Weight`,-1),createBaseVNode(`div`,_hoisted_13$15,toDisplayString(selectedCertificationData.value.powerPerTon.toFixed(0))+`hp/1000kg`,1)]),createBaseVNode(`div`,_hoisted_14$15,[createBaseVNode(`div`,_hoisted_15$15,toDisplayString(_ctx.$t(`vehicle.info.Drivetrain`)),1),createBaseVNode(`div`,_hoisted_16$15,toDisplayString(selectedCertificationData.value.drivetrain),1)]),createBaseVNode(`div`,_hoisted_17$12,[createBaseVNode(`div`,_hoisted_18$10,toDisplayString(_ctx.$t(`vehicle.info.Fuel Type`)),1),createBaseVNode(`div`,_hoisted_19$8,toDisplayString(selectedCertificationData.value.fuelType),1)]),createBaseVNode(`div`,_hoisted_20$7,[createBaseVNode(`div`,_hoisted_21$7,toDisplayString(_ctx.$t(`vehicle.info.Induction Type`)),1),createBaseVNode(`div`,_hoisted_22$6,toDisplayString(selectedCertificationData.value.inductionType),1)]),createBaseVNode(`div`,_hoisted_23$5,[_cache[3]||=createBaseVNode(`div`,{class:`spec-label`},`Mileage`,-1),createBaseVNode(`div`,_hoisted_24$4,toDisplayString(unref(units).buildString(`length`,selectedCertificationData.value.mileage,0)),1)]),createBaseVNode(`div`,_hoisted_25$3,[_cache[4]||=createBaseVNode(`div`,{class:`spec-label`},`Lateral G-Force`,-1),createBaseVNode(`div`,_hoisted_26$2,toDisplayString(selectedCertificationData.value.lateralGForce.toFixed(2))+` G`,1)])])):(openBlock(),createElementBlock(`div`,_hoisted_7$40,` Vehicle has not been assessed yet. `))]),createBaseVNode(`div`,_hoisted_27$2,[_cache[7]||=createBaseVNode(`div`,{class:`section-header`},[createBaseVNode(`h2`,null,`Metrics`)],-1),selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_28$1,[selectedCertificationData.value.power?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,headerLeft:`Power Output`,headerRight:_ctx.$game.units.buildString(`power`,selectedCertificationData.value.power,0),value:selectedCertificationData.value.power,min:0,max:1e3,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.power,0,1e3),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),createVNode(unref(bngProgressBar_default),{headerLeft:`0-60 mph time (prepped surface)`,headerRight:selectedCertificationData.value.time_0_60?selectedCertificationData.value.time_0_60.toFixed(2)+` s`:`N/A`,value:selectedCertificationData.value.time_0_60?-selectedCertificationData.value.time_0_60:-25,min:-25,max:-2,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.time_0_60?-selectedCertificationData.value.time_0_60:-25,-25,-2),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`]),selectedCertificationData.value.time_1_4?(openBlock(),createBlock(unref(bngProgressBar_default),{key:1,headerLeft:`Quarter Mile`,headerRight:selectedCertificationData.value.time_1_4.toFixed(2)+` s @ `+_ctx.$game.units.buildString(`speed`,selectedCertificationData.value.velAt_1_4,0),value:selectedCertificationData.value.time_1_4?-selectedCertificationData.value.time_1_4:-35,min:-35,max:-8.1,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.time_1_4?-selectedCertificationData.value.time_1_4:-35,-35,-8.1),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),selectedCertificationData.value.performanceAggregateScores.brakingGForceScore?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,headerLeft:`Braking Force`,headerRight:selectedCertificationData.value.brakingG?selectedCertificationData.value.brakingG.toFixed(2)+` G`:`N/A`,value:selectedCertificationData.value.brakingG||0,min:.5,max:1.9,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.brakingG||0,.5,1.9),class:`score-progress`},null,8,[`headerRight`,`value`,`valueColor`])):createCommentVNode(``,!0),selectedCertificationData.value&&selectedCertificationData.value.vehicleClass?(openBlock(),createElementBlock(`div`,_hoisted_29$1,[createBaseVNode(`div`,_hoisted_30$1,[createVNode(unref(bngProgressBar_default),{headerLeft:`Performance Index`,headerRight:`Class: `+selectedCertificationData.value.vehicleClass.class.name,value:selectedCertificationData.value.vehicleClass.performanceIndex,min:0,max:110,showValueLabel:!1,valueColor:getColorForValue(selectedCertificationData.value.vehicleClass.performanceIndex/110),class:`score-progress performance-index`},null,8,[`headerRight`,`value`,`valueColor`]),createBaseVNode(`div`,_hoisted_31$1,[(openBlock(),createElementBlock(Fragment,null,renderList([{pi:101,name:`X`},{pi:86,name:`S`},{pi:66,name:`A`},{pi:41,name:`B`},{pi:21,name:`C`}],(classInfo,index)=>createBaseVNode(`div`,{key:index,class:`class-marker`,style:normalizeStyle({left:`${classInfo.pi/110*100}%`})},[_cache[6]||=createBaseVNode(`div`,{class:`marker-line`},null,-1),createBaseVNode(`div`,_hoisted_32$1,toDisplayString(classInfo.name),1)],4)),64))])])])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])])]),_:1})),[[unref(BngBlur_default),!0]])}},VehiclePerformanceTile_default=__plugin_vue_export_helper_default(_sfc_main$137,[[`__scopeId`,`data-v-ca2efe1a`]]),_hoisted_1$123={key:0,class:`certification-test-in-progress`},_hoisted_2$103={class:`certification-content`},_hoisted_3$91={class:`certification-icon`},_hoisted_4$71={class:`cancelButton`},_hoisted_5$60={key:1},_sfc_main$136={__name:`VehiclePerformanceMain`,props:{inventoryId:String},setup(__props){let router$1=useRouter(),vehicleData=ref({}),assessmentProgressMessage=ref(`Performance Assessment in progress...`),cancellingTest=ref(!1),testInProgress=ref(!1),{$game}=useLibStore(),title=computed(()=>vehicleData.value.niceName?`Performance Index: `+vehicleData.value.niceName:`Performance Index`),props=__props;$game.events.on(`PerformanceTestMessage`,data=>{assessmentProgressMessage.value=data.message,cancellingTest.value=!0}),$game.events.on(`PerformanceTestStarted`,data=>{testInProgress.value=data.testInProgress,getVehicleData()});let close=()=>{router$1.back()},kill=()=>{$game.events.off(`PerformanceTestMessage`),$game.events.off(`PerformanceTestStarted`)},getVehicleData=()=>{Lua_default.career_modules_inventory.getVehicleUiData(Number(props.inventoryId)).then(data=>{vehicleData.value=data})},start=()=>{getVehicleData()},cancelTest=()=>{Lua_default.career_modules_vehiclePerformance.cancelTest()};return onUnmounted(kill),onMounted(start),(_ctx,_cache)=>testInProgress.value?(openBlock(),createElementBlock(`div`,_hoisted_1$123,[createVNode(unref(bngCard_default),{class:`certification-card`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$103,[createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`certificationTestText`,{cancelling:cancellingTest.value}])},toDisplayString(assessmentProgressMessage.value),3)]),createBaseVNode(`div`,_hoisted_3$91,[createVNode(unref(bngIcon_default),{type:unref(icons).timeUnlockOutline},null,8,[`type`])])]),createBaseVNode(`div`,_hoisted_4$71,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).RED,onClick:cancelTest,tabindex:`0`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Cancel Test `,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`back,menu`,{asMouse:!0}]])])]),_:1})])):(openBlock(),createElementBlock(`div`,_hoisted_5$60,[createVNode(ComputerWrapper_default,{ref:`wrapper`,path:[`Performance Index`],title:title.value,back:``,onBack:close},{default:withCtx(()=>[createVNode(VehiclePerformanceTile_default,{"vehicle-data":vehicleData.value},null,8,[`vehicle-data`])]),_:1},8,[`title`])]))}},VehiclePerformanceMain_default=__plugin_vue_export_helper_default(_sfc_main$136,[[`__scopeId`,`data-v-ea737c56`]]),_hoisted_1$122={class:`offer-chat-container-wrapper`},_hoisted_2$102={key:0,class:`above`},_hoisted_3$90={key:1,class:`red`},_hoisted_4$70={key:2,class:`green`},_hoisted_5$59={key:3,class:`above`},_hoisted_6$46={key:4,class:`above`},_hoisted_7$39={key:5,class:`price`},_sfc_main$135={__name:`NegotiationChat`,props:{offerHistory:{type:Array,default:()=>[]},negotiationStatus:{type:String,default:``},startingPrice:{type:Number,default:0},amISelling:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let props=__props,offerChatContainer=ref(null),statusTextFromStatus=status=>{switch(String(status||``)){case`counterOffer`:return`Counter offer`;case`counterOfferLastChance`:return`Last chance counter offer`;case`accepted`:return`Accepted`;case`failed`:return`Negotiation failed`;case`refused`:return`Offer refused`;case`initial`:return props.amISelling?`Initial offer`:`Asking Price`;case`thinking`:return`Thinking`;default:return``}},fillInOfferHistory=history$1=>{if(!history$1||!Array.isArray(history$1))return[];let hasSeenMyOffer=!1,isFirstInitialOffer=!0;return history$1.map(item=>{let isMyOffer=item.myOffer!=null,isTheirOffer=item.theirOffer!=null,currentOffer=isMyOffer?item.myOffer:item.theirOffer,difference=null;isTheirOffer&&isFirstInitialOffer?isFirstInitialOffer=!1:difference=currentOffer-props.startingPrice;let offerStatus=null;return isMyOffer&&(hasSeenMyOffer?offerStatus=`counterOffer`:(offerStatus=`initial`,hasSeenMyOffer=!0)),isMyOffer?item.myOffer:isTheirOffer&&item.theirOffer,{theirOffer:item.theirOffer,myOffer:item.myOffer,negotiationStatus:item.negotiationStatus,messageClass:isMyOffer?`sent-message`:`received-message`,difference,offerStatus}})},typingMessageId=ref(null),previousOfferHistoryLength=ref(0);watch(()=>props.negotiationStatus,newStatus=>{newStatus===`typing`&&typingMessageId.value===null&&(typingMessageId.value=`typing-${Date.now()}`)});let processedOfferHistory=computed(()=>{let history$1=fillInOfferHistory(props.offerHistory),currentHistoryLength=(props.offerHistory||[]).length;if(currentHistoryLength>previousOfferHistoryLength.value&&typingMessageId.value!==null){let responseId=typingMessageId.value,responseData=history$1[history$1.length-1],result=[...history$1];return result[result.length-1]={...responseData,typingId:responseId,isTyping:!1},typingMessageId.value=null,previousOfferHistoryLength.value=currentHistoryLength,result}return currentHistoryLength!==previousOfferHistoryLength.value&&(previousOfferHistoryLength.value=currentHistoryLength),props.negotiationStatus===`typing`&&typingMessageId.value!==null?[...history$1,{theirOffer:null,myOffer:null,negotiationStatus:`typing`,messageClass:`received-message`,difference:null,isTyping:!0,typingId:typingMessageId.value}]:history$1});watch(processedOfferHistory,()=>{nextTick(()=>{if(offerChatContainer.value){let container=offerChatContainer.value;container.scrollHeight-container.scrollTop-container.clientHeight<100&&(container.scrollTop=container.scrollHeight)}})},{deep:!0});let scrollToBottom=()=>{nextTick(()=>{offerChatContainer.value&&(offerChatContainer.value.scrollTop=offerChatContainer.value.scrollHeight)})},reset$1=()=>{typingMessageId.value=null,previousOfferHistoryLength.value=(props.offerHistory||[]).length};return onMounted(()=>{reset$1(),scrollToBottom()}),__expose({scrollToBottom,reset:reset$1}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$122,[createBaseVNode(`div`,{ref_key:`offerChatContainer`,ref:offerChatContainer,class:`offer-chat-container`},[createVNode(TransitionGroup,{name:`message`,tag:`div`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(processedOfferHistory.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:item.typingId||`${item.myOffer||item.theirOffer||`message`}-${index}`,class:normalizeClass([`message`,item.messageClass])},[item.isTyping?(openBlock(),createElementBlock(`div`,_hoisted_2$102,[..._cache[0]||=[createBaseVNode(`span`,{class:`spinner`,"aria-label":`Typing`},null,-1),createTextVNode(` Typing... `,-1)]])):item.negotiationStatus===`failed`?(openBlock(),createElementBlock(`div`,_hoisted_3$90,[createVNode(unref(bngIcon_default),{type:`abandon`}),_cache[1]||=createTextVNode(` Negotiation failed! `,-1)])):item.negotiationStatus===`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_4$70,[createVNode(unref(bngIcon_default),{type:`checkmark`,color:`var(--bng-add-green-400)`}),_cache[2]||=createTextVNode(` Accepted! `,-1)])):item.offerStatus?(openBlock(),createElementBlock(`div`,_hoisted_5$59,[item.offerStatus===`initial`?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(props.amISelling?`Asking Price`:`Initial offer`),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(` Counter offer `)],64))])):item.negotiationStatus?(openBlock(),createElementBlock(`div`,_hoisted_6$46,toDisplayString(statusTextFromStatus(item.negotiationStatus)),1)):createCommentVNode(``,!0),!item.isTyping&&item.negotiationStatus!==`failed`&&item.negotiationStatus!==`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_7$39,[createVNode(unref(bngUnit_default),{class:`money`,money:item.myOffer||item.theirOffer||0},null,8,[`money`])])):createCommentVNode(``,!0)],2))),128))]),_:1})],512)]))}},NegotiationChat_default=__plugin_vue_export_helper_default(_sfc_main$135,[[`__scopeId`,`data-v-c4558f29`]]),_hoisted_1$121={class:`price-finder-label right`},_hoisted_2$101={class:`price-finder-track`},_hoisted_3$89={key:0,class:`tick-label`},_hoisted_4$69={class:`price-finder-label left`},_sfc_main$134={__name:`PriceFinder`,props:{offerHistory:{type:Array,default:()=>[]},negotiationStatus:{type:String,default:``},startingPrice:{type:Number,default:0},offerPreview:{type:Number,default:0},actualVehicleValue:{type:Number,default:null},amISelling:{type:Boolean,default:!1}},setup(__props){let{units}=useBridge(),props=__props,priceFinderData=computed(()=>{let history$1=props.offerHistory||[];if(history$1.length===0)return null;let initialTheirOffer=null,initialMyOffer=null;for(let item of history$1)if(initialTheirOffer===null&&item.theirOffer!=null&&(initialTheirOffer=item.theirOffer),initialMyOffer===null&&item.myOffer!=null&&(initialMyOffer=item.myOffer),initialTheirOffer!==null&&initialMyOffer!==null)break;let hasBothInitialOffers=initialTheirOffer!==null&&initialMyOffer!==null;initialTheirOffer===null&&(initialTheirOffer=props.startingPrice),initialMyOffer===null&&(initialMyOffer=props.offerPreview||props.startingPrice);let offers=[],offerIndex=0,lastMyOfferIndex=-1,lastTheirOfferIndex=-1;for(let item of history$1)item.myOffer==null?item.theirOffer!=null&&(offers.push({price:item.theirOffer,isMyOffer:!1,index:offerIndex++,isUnsent:!1}),lastTheirOfferIndex=offers.length-1):(offers.push({price:item.myOffer,isMyOffer:!0,index:offerIndex++,isUnsent:!1}),lastMyOfferIndex=offers.length-1);props.negotiationStatus!==`failed`&&props.negotiationStatus!==`accepted`&&props.offerPreview>0&&(offers.push({price:props.offerPreview,isMyOffer:!0,index:offerIndex++,isUnsent:!0}),lastMyOfferIndex=offers.length-1);let leftPrice=Math.min(initialTheirOffer,initialMyOffer),rightPrice=Math.max(initialTheirOffer,initialMyOffer),topIsTheir=props.amISelling,range=rightPrice-leftPrice||1,{majorTicks,minorTicks}=((min$1,max$1,priceRange)=>{let niceNumbers=[1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4],tickRange=max$1-min$1;if(tickRange===0)return{majorTicks:[],minorTicks:[]};let roughStep=tickRange/4,magnitude=10**Math.floor(Math.log10(roughStep)),normalizedStep=roughStep/magnitude,closestNice=niceNumbers[0],minDiff=Math.abs(normalizedStep-closestNice);for(let nice of niceNumbers){let diff=Math.abs(normalizedStep-nice);diff=min$1&&price<=max$1){let position=(price-leftPrice)/priceRange*100;majorTicks$1.push({price,position:Math.max(0,Math.min(100,position))})}let minorStep=step/5,minorTicks$1=[];for(let price=niceMin;price<=niceMax;price+=minorStep)if(price>=min$1&&price<=max$1&&Math.abs(price%step)>.01){let position=(price-leftPrice)/priceRange*100;minorTicks$1.push({price,position:Math.max(0,Math.min(100,position))})}return{majorTicks:majorTicks$1,minorTicks:minorTicks$1}})(leftPrice,rightPrice,range),hasVisibleTicks=range>0&&majorTicks.length>0,offerPositions=offers.map((offer,index)=>{let position=(offer.price-leftPrice)/range*100,isMostRecent=offer.isMyOffer&&index===lastMyOfferIndex||!offer.isMyOffer&&index===lastTheirOfferIndex;return{...offer,position:Math.max(0,Math.min(100,position)),isMostRecent}}),marketValuePosition=null;if(hasVisibleTicks&&props.actualVehicleValue!=null&&props.actualVehicleValue>0&&props.actualVehicleValue>=leftPrice&&props.actualVehicleValue<=rightPrice){let position=(props.actualVehicleValue-leftPrice)/range*100;marketValuePosition=Math.max(0,Math.min(100,position))}let initialMarkers=[];if(hasVisibleTicks){let theirPosition=initialTheirOffer===leftPrice?0:100;initialMarkers.push({price:initialTheirOffer,isMyOffer:!1,position:theirPosition,isInitial:!0});let myPosition=initialMyOffer===leftPrice?0:100;initialMarkers.push({price:initialMyOffer,isMyOffer:!0,position:myPosition,isInitial:!0})}return{initialTheirOffer,initialMyOffer,leftPrice,rightPrice,topIsTheir,hasBothInitialOffers,majorTicks,minorTicks,offers:offerPositions,marketValuePosition,initialMarkers}});return(_ctx,_cache)=>priceFinderData.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`price-finder-container`,{selling:__props.amISelling,buying:!__props.amISelling}])},[createBaseVNode(`div`,_hoisted_1$121,[createTextVNode(toDisplayString(priceFinderData.value.topIsTheir?`Your`:`Their`)+` Asking Price: `,1),createVNode(unref(bngUnit_default),{class:`money`,money:priceFinderData.value.rightPrice},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_2$101,[(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.minorTicks,(tick,index)=>(openBlock(),createElementBlock(`div`,{key:`minor-`+index,class:`price-finder-tick minor`,style:normalizeStyle({top:100-tick.position+`%`})},null,4))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.majorTicks,(tick,index)=>(openBlock(),createElementBlock(`div`,{key:`major-`+index,class:`price-finder-tick major`,style:normalizeStyle({top:100-tick.position+`%`})},[tick.position>5&&tick.position<95?(openBlock(),createElementBlock(`div`,_hoisted_3$89,toDisplayString(unref(units).beamBucks(tick.price)),1)):createCommentVNode(``,!0)],4))),128)),priceFinderData.value.hasBothInitialOffers?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(priceFinderData.value.offers,(offer,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`price-finder-marker`,{"my-offer":offer.isMyOffer,"their-offer":!offer.isMyOffer,"most-recent":offer.isMostRecent,unsent:offer.isUnsent}]),style:normalizeStyle({top:100-offer.position+`%`})},[..._cache[0]||=[createBaseVNode(`div`,{class:`marker-triangle`},null,-1)]],6))),128)):createCommentVNode(``,!0),priceFinderData.value.marketValuePosition===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:1,class:`price-finder-marker market-value`,style:normalizeStyle({top:100-priceFinderData.value.marketValuePosition+`%`,bottom:`0`})},[..._cache[1]||=[createBaseVNode(`div`,{class:`marker-dot`},null,-1)]],4)),(openBlock(!0),createElementBlock(Fragment,null,renderList(priceFinderData.value.initialMarkers,(marker$1,index)=>(openBlock(),createElementBlock(`div`,{key:`initial-`+index,class:normalizeClass([`price-finder-marker`,{"my-offer":marker$1.isMyOffer,"their-offer":!marker$1.isMyOffer,initial:!0}]),style:normalizeStyle({top:100-marker$1.position+`%`})},[..._cache[2]||=[createBaseVNode(`div`,{class:`marker-triangle`},null,-1)]],6))),128))]),createBaseVNode(`div`,_hoisted_4$69,[createTextVNode(toDisplayString(priceFinderData.value.topIsTheir?`Their`:`Your`)+` initial offer: `,1),createVNode(unref(bngUnit_default),{class:`money`,money:priceFinderData.value.leftPrice},null,8,[`money`])])],2)):createCommentVNode(``,!0)}},PriceFinder_default=__plugin_vue_export_helper_default(_sfc_main$134,[[`__scopeId`,`data-v-ba044f86`]]),_hoisted_1$120={class:`center-wrap`},_hoisted_2$100={class:`header-row`},_hoisted_3$88={key:0,class:`header-seller-info`},_hoisted_4$68={class:`main-content`},_hoisted_5$58={class:`summary`},_hoisted_6$45={key:0,class:`vehicle-info`},_hoisted_7$38={class:`purchase-row`},_hoisted_8$31={class:`label`},_hoisted_9$28={class:`sub-info`},_hoisted_10$22={class:`price`},_hoisted_11$20={class:`offer-container`},_hoisted_12$15={class:`patience`},_hoisted_13$14={class:`label-row`},_hoisted_14$14={class:`offer-controls`},_hoisted_15$14={key:0,class:`offer-controls-row`},_hoisted_16$14={class:`step-buttons-group`},_hoisted_17$11={class:`resolved-negotiation-message`},_hoisted_18$9={class:`price-column`},_hoisted_19$7={key:0,class:`price`},_hoisted_20$6={key:1,class:`price`},_hoisted_21$6={class:`action-buttons wide`},_sfc_main$133={__name:`VehicleNegotiationMain`,setup(__props){useUINavScope(`vehicleNegotiation`);let{units}=useBridge(),events$3=useEvents(),router$1=useRouter(),state=ref({active:!1,startingPrice:0,patience:0,myOffer:null,theirOffer:0,thinking:!1,status:``,negotiationStatus:``,opponentName:``,vehicleNiceName:``,vehicleThumbnail:``,amISelling:!1}),opponent=computed(()=>state.value.amISelling?`Buyer`:`Seller`),biggerIsBetter=computed(()=>!!state.value.amISelling),increaseOfferDisabled=computed(()=>state.value.amISelling?state.value.myOffer!=null&&offerPreview.value>=state.value.myOffer:offerPreview.value>=state.value.theirOffer),decreaseOfferDisabled=computed(()=>state.value.amISelling?(console.log(`decreaseOfferDisabled`,offerPreview.value,state.value.theirOffer),offerPreview.value<=state.value.theirOffer):state.value.myOffer!=null&&offerPreview.value<=state.value.myOffer),offerPreview=ref(0);computed(()=>{let baseStep=state.value.startingPrice/500;return Math.round(baseStep/5)*5}),computed(()=>{let diff=(offerPreview.value-state.value.startingPrice)/state.value.startingPrice*100;return Math.round(diff)});let diffOfferPreviewToStarting=computed(()=>offerPreview.value-state.value.startingPrice),isDiffOfferPreviewToStartingGood=computed(()=>biggerIsBetter.value?diffOfferPreviewToStarting.value>=0:diffOfferPreviewToStarting.value<=0),diffPercentOfferPreviewToMarket=computed(()=>{if(!state.value.actualVehicleValue||state.value.actualVehicleValue===0)return null;let diff=(offerPreview.value-state.value.actualVehicleValue)/state.value.actualVehicleValue*100;return Math.round(diff)}),isDiffPercentOfferPreviewToMarketGood=computed(()=>diffPercentOfferPreviewToMarket.value===null?null:biggerIsBetter.value?diffPercentOfferPreviewToMarket.value>=0:diffPercentOfferPreviewToMarket.value<=0),diffTheirOfferToStarting=computed(()=>state.value.theirOffer-state.value.startingPrice);computed(()=>biggerIsBetter.value?diffTheirOfferToStarting.value>=0:diffTheirOfferToStarting.value<=0);let nudgeOffer=delta=>{let roundedOfferPreview=Math.max(0,Math.round((offerPreview.value+delta)/50)*50),min$1=0,max$1=1/0;state.value.amISelling?(min$1=state.value.theirOffer,state.value.myOffer!=null&&(max$1=state.value.myOffer)):(max$1=state.value.theirOffer,state.value.myOffer!=null&&(min$1=state.value.myOffer)),offerPreview.value=Math.min(max$1,Math.max(min$1,roundedOfferPreview))},offerDisabled=computed(()=>state.value.negotiationStatus===`thinking`||state.value.negotiationStatus===`typing`||state.value.negotiationStatus===`accepted`||state.value.negotiationStatus===`failed`),patienceClass=computed(()=>{let m=state.value.patience??0;return m>.66?`patience-good`:m>.33?`patience-mid`:`patience-bad`}),noDeal=computed(()=>state.value.negotiationStatus===`failed`&&state.value.amISelling);computed(()=>state.value.negotiationStatus===`failed`),computed(()=>{switch(String(state.value.negotiationStatus||``)){case`counterOffer`:return`Counter offer`;case`counterOfferLastChance`:return`Last chance counter offer`;case`accepted`:return`Accepted`;case`failed`:return`Negotiation failed`;case`refused`:return`Offer refused`;case`initial`:return`Initial offer`;case`thinking`:return`Thinking`;case`typing`:return`Typing...`;default:return``}});let resolvedStatusText=computed(()=>state.value.negotiationStatus===`failed`?state.value.amISelling?`The other party ran out of patience and does not want to buy this vehicle.`:`The other party ran out of patience. You can still buy the vehicle at the starting price: `:state.value.negotiationStatus===`accepted`?`Congratulations! You've successfully negotiatied a deal with `+state.value.opponentName+`.`:``),negotiationChat=ref(null),refresh$1=async()=>{state.value=await Lua_default.career_modules_marketplace.getNegotiationState()||state.value;let base=state.value.myOffer==null?state.value.startingPrice:state.value.myOffer;Number.isNaN(Number(base))||(offerPreview.value=Number(base)),state.value.negotiationStatus===`failed`&&(offerPreview.value=state.value.startingPrice)},submitOffer=async()=>{let price=Number(offerPreview.value);Number.isFinite(price)&&await Lua_default.career_modules_marketplace.makeNegotiationOffer(price)},takeOffer=async()=>{await Lua_default.career_modules_marketplace.takeTheirOffer(),state.value.negotiationStatus=`accepted`,state.value.status=`accepted`,offerPreview.value=state.value.theirOffer,state.value.iAccepted=!0,state.value.offerHistory.push({myOffer:state.value.theirOffer,negotiationStatus:`accepted`})},cancel=async()=>{state.value.negotiationStatus!==`accepted`&&await Lua_default.career_modules_marketplace.cancelNegotiation()},goBack=event=>{router$1.back(),state.value.negotiationStatus===`accepted`&&!state.value.iAccepted&&Lua_default.career_modules_marketplace.takeTheirOffer(),cancel(),event&&event.stopPropagation&&event.stopPropagation()};return events$3.on(`negotiationData`,data=>{refresh$1()}),onMounted(async()=>{await refresh$1(),nextTick(()=>{negotiationChat.value&&(negotiationChat.value.reset(),negotiationChat.value.scrollToBottom())})}),onUnmounted(async()=>{events$3.off(`negotiationData`)}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$120,[withDirectives((openBlock(),createBlock(unref(bngCard_default),{"bng-ui-scope":`vehicleNegotiation`,class:`negotiation-screen`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_21$6,[state.value.negotiationStatus!==`accepted`&&state.value.negotiationStatus!==`failed`?(openBlock(),createBlock(unref(bngButton_default),{key:0,class:`submit-offer`,disabled:state.value.negotiationStatus===`counterOfferLastChance`||offerPreview.value==state.value.theirOffer||offerPreview.value==state.value.myOffer||offerDisabled.value,onClick:_cache[6]||=$event=>submitOffer(),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[16]||=[createTextVNode(` Submit This Offer `,-1)]]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),state.value.negotiationStatus!==`accepted`&&state.value.negotiationStatus!==`failed`?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:`submit-offer`,disabled:state.value.negotiationStatus===`counterOfferLastChance`||offerDisabled.value,"show-hold":``},{default:withCtx(()=>[..._cache[17]||=[createTextVNode(` Agree to their Price `,-1)]]),_:1},8,[`disabled`])),[[unref(BngClick_default),{holdCallback:takeOffer,holdDelay:1e3,repeatInterval:0}]]):createCommentVNode(``,!0),state.value.negotiationStatus===`failed`||state.value.negotiationStatus===`accepted`?(openBlock(),createBlock(unref(bngButton_default),{key:2,class:`go-back`,accent:unref(ACCENTS).primary,onClick:goBack},{default:withCtx(()=>[createTextVNode(toDisplayString(state.value.amISelling?`Continue`:`Go to Purchase Screen`),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$100,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(` Negotiation with `+toDisplayString(state.value.opponentName||opponent.value)+` `,1),state.value.opponentQuote?(openBlock(),createElementBlock(`div`,_hoisted_3$88,` "`+toDisplayString(state.value.opponentQuote)+`" `,1)):createCommentVNode(``,!0)]),_:1}),createVNode(unref(bngButton_default),{class:`close-button`,onClick:goBack,accent:unref(ACCENTS).attention,"bng-no-nav":`true`,tabindex:`-1`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`menu`,controller:``}),createVNode(unref(bngIcon_default),{type:`xmarkBold`,color:`var(--bng-cool-gray-100)`})]),_:1},8,[`accent`])]),createBaseVNode(`div`,_hoisted_4$68,[createBaseVNode(`div`,_hoisted_5$58,[state.value.vehicleNiceName||state.value.vehicleThumbnail?(openBlock(),createElementBlock(`div`,_hoisted_6$45,[createBaseVNode(`div`,_hoisted_7$38,[createBaseVNode(`div`,_hoisted_8$31,[createBaseVNode(`div`,null,toDisplayString(state.value.vehicleNiceName||`Vehicle`),1),createBaseVNode(`div`,_hoisted_9$28,toDisplayString(unref(units).buildString(`length`,state.value.vehicleMileage,0)),1)]),createBaseVNode(`div`,_hoisted_10$22,[_cache[7]||=createTextVNode(` Est. Market: `,-1),createBaseVNode(`div`,null,[createVNode(unref(bngUnit_default),{class:`money`,money:state.value.actualVehicleValue||0},null,8,[`money`])])])])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_11$20,[createVNode(NegotiationChat_default,{ref_key:`negotiationChat`,ref:negotiationChat,"offer-history":state.value.offerHistory||[],"negotiation-status":state.value.negotiationStatus,"starting-price":state.value.startingPrice||0,"am-i-selling":state.value.amISelling},null,8,[`offer-history`,`negotiation-status`,`starting-price`,`am-i-selling`]),createVNode(PriceFinder_default,{"offer-history":state.value.offerHistory||[],"negotiation-status":state.value.negotiationStatus,"starting-price":state.value.startingPrice||0,"offer-preview":offerPreview.value||0,"actual-vehicle-value":state.value.actualVehicleValue,"am-i-selling":state.value.amISelling},null,8,[`offer-history`,`negotiation-status`,`starting-price`,`offer-preview`,`actual-vehicle-value`,`am-i-selling`])]),createBaseVNode(`div`,_hoisted_12$15,[createBaseVNode(`div`,{class:normalizeClass([`bar`,patienceClass.value])},[_cache[8]||=createBaseVNode(`div`,{class:`separator`,style:{left:`33.0%`}},null,-1),_cache[9]||=createBaseVNode(`div`,{class:`separator`,style:{left:`66.0%`}},null,-1),createBaseVNode(`div`,{class:normalizeClass([`fill`,patienceClass.value]),style:normalizeStyle({width:Math.max(0,Math.min(1,state.value.patience||0))*100+`%`})},null,6)],2),createBaseVNode(`div`,_hoisted_13$14,[createBaseVNode(`span`,null,toDisplayString(opponent.value)+`'s Patience`,1)])]),createBaseVNode(`div`,_hoisted_14$14,[state.value.negotiationStatus!==`failed`&&state.value.negotiationStatus!==`accepted`?(openBlock(),createElementBlock(`div`,_hoisted_15$14,[createBaseVNode(`div`,_hoisted_16$14,[createVNode(unref(bngButton_default),{class:`step step-large`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[0]||=$event=>nudgeOffer(-5e3)},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`-5000`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-medium`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[1]||=$event=>nudgeOffer(-500)},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(`-500`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step`,disabled:offerDisabled.value||decreaseOfferDisabled.value,onClick:_cache[2]||=$event=>nudgeOffer(-50)},{default:withCtx(()=>[..._cache[12]||=[createTextVNode(`-50`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[3]||=$event=>nudgeOffer(50)},{default:withCtx(()=>[..._cache[13]||=[createTextVNode(`+50`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-medium`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[4]||=$event=>nudgeOffer(500)},{default:withCtx(()=>[..._cache[14]||=[createTextVNode(`+500`,-1)]]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`step step-large`,disabled:offerDisabled.value||increaseOfferDisabled.value,onClick:_cache[5]||=$event=>nudgeOffer(5e3)},{default:withCtx(()=>[..._cache[15]||=[createTextVNode(`+5000`,-1)]]),_:1},8,[`disabled`])])])):createCommentVNode(``,!0),state.value.negotiationStatus===`failed`||state.value.negotiationStatus===`accepted`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`offer-controls-row`,{accepted:state.value.negotiationStatus===`accepted`,failed:state.value.negotiationStatus===`failed`}])},[createVNode(unref(bngIcon_default),{type:state.value.negotiationStatus===`accepted`?`checkmark`:`abandon`,class:`resolved-negotiation-icon`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_17$11,toDisplayString(resolvedStatusText.value),1)],2)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_18$9,[noDeal.value?(openBlock(),createElementBlock(`div`,_hoisted_19$7,` NO DEAL `)):(openBlock(),createElementBlock(`div`,_hoisted_20$6,toDisplayString(unref(units).beamBucks(offerPreview.value||0)),1)),diffOfferPreviewToStarting.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:2,class:normalizeClass([`diff-percent-offer-preview-to-starting`,{positive:isDiffOfferPreviewToStartingGood.value&&diffOfferPreviewToStarting.value!==0,negative:!isDiffOfferPreviewToStartingGood.value&&diffOfferPreviewToStarting.value!==0,zero:diffOfferPreviewToStarting.value===0,hidden:noDeal.value}])},[diffOfferPreviewToStarting.value===0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngUnit_default),{key:0,class:`money`,money:Math.abs(diffOfferPreviewToStarting.value)},null,8,[`money`])),createTextVNode(` `+toDisplayString(diffOfferPreviewToStarting.value<0?`under`:diffOfferPreviewToStarting.value>0?`over`:`Same as`)+` starting price `,1)],2)),diffPercentOfferPreviewToMarket.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:3,class:normalizeClass([`diff-percent-offer-preview-to-market`,{positive:isDiffPercentOfferPreviewToMarketGood.value,negative:!isDiffPercentOfferPreviewToMarketGood.value,hidden:noDeal.value}])},toDisplayString(Math.abs(diffPercentOfferPreviewToMarket.value))+`% `+toDisplayString(diffPercentOfferPreviewToMarket.value<0?`under`:`over`)+` Est. Market value `,3))])])])]),_:1})),[[unref(BngBlur_default),1]])]))}},VehicleNegotiationMain_default=__plugin_vue_export_helper_default(_sfc_main$133,[[`__scopeId`,`data-v-29ff8ba1`]]),routes_default$3=[{path:`/menu.careerPause`,name:`menu.careerPause`,component:Pause_default,props:!0,meta:{clickThrough:!0,infoBar:{withAngular:!0,visible:!0,showSysInfo:!0},uiApps:{shown:!1},topBar:{visible:!0}}},{path:`/career`,children:[{path:`chooseInsurance`,name:`chooseInsurance`,component:ChooseInsuranceMain_default},{path:`pauseBigMiddlePanel`,name:`pauseBigMiddlePanel`,component:PauseBigMiddlePanel_default,props:!0},{path:`logbook/:id(\\*?.*?)?`,name:`logbook`,component:Logbook_default,meta:{uiApps:{shown:!1}},props:!0},{path:`milestones/:id(\\*?.*?)?`,name:`milestones`,component:Milestones_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`computer`,name:`computer`,component:ComputerMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`vehicleInventory`,name:`vehicleInventory`,component:VehicleInventoryMain_default},{path:`vehiclePerformance/:inventoryId?`,name:`vehiclePerformance`,component:VehiclePerformanceMain_default,props:!0},{path:`tuning`,name:`tuning`,component:TuningMain_default},{path:`painting`,name:`painting`,component:PaintingMain_default},{path:`repair/:header?`,name:`repair`,component:RepairMain_default,props:!0},{path:`partShopping`,name:`partShopping`,component:PartShoppingMain_default,meta:{uiApps:{shown:!1}}},{path:`partInventory`,name:`partInventory`,component:PartInventoryMain_default},{path:`vehiclePurchase/:vehicleInfo?/:playerMoney?/:inventoryHasFreeSlot?/:lastVehicleInfo?`,name:`vehiclePurchase`,component:VehiclePurchaseMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`negotiation`,name:`negotiation`,component:VehicleNegotiationMain_default},{path:`vehicleShopping/:screenTag?/:buyingAvailable?/:marketplaceAvailable?/:selectedSellerId?`,name:`vehicleShopping`,component:VehicleShoppingMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`insurances`,name:`insurances`,component:InsurancesMain_default},{path:`playerAbstract`,name:`playerAbstract`,component:DriverAbstract_default},{path:`cargoDeliveryReward`,name:`cargoDeliveryReward`,component:CargoDeliveryReward_default,props:!0},{path:`cargoDropOff/:facilityId?/:parkingSpotPath(\\*?.*?)?`,name:`cargoDropOff`,component:CargoDropOff_default,props:!0},{path:`cargoOverview/:facilityId?/:parkingSpotPath(\\*?.*?)?`,name:`cargoOverview`,component:CargoOverviewMain_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`myCargo`,name:`myCargo`,component:MyCargo_default,props:!0,meta:{uiApps:{shown:!1}}},{path:`progressLanding/:pathId?/:comesFromBigMap?`,name:`progressLanding`,component:ProgressLanding_default,props:route=>({pathId:route.params.pathId,comesFromBigMap:route.params.comesFromBigMap===`true`||route.params.comesFromBigMap===!0}),meta:{uiApps:{shown:!1},infoBar:{visible:!0}}},{path:`domainSelection`,name:`domainSelection`,component:ProgressLanding_default,props:!0,meta:{uiApps:{shown:!1},infoBar:{visible:!0}}},{path:`profiles`,name:`profiles`,component:Profiles_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}]}],data_default=[{translateId:`ui.credits.programmers`,members:[{first:`Thomas`,last:`Fischer`,aka:`tdev`,title:`CEO`},{first:`Lefteris`,last:`Stamatogiannakis`,aka:`estama`,title:`CTO / Physics / Sound / AI`},{first:`Luis`,last:`Anton Rebollo`,aka:`Souga`,title:`Lead Render Developer`},{first:`Alex`,last:`Spodheim`,aka:`CrankyCleric`,title:`Developer`},{first:`Ananda Neelam`,last:`Thathayya`,aka:`Nadeox1`,title:`Technical Artist`},{first:`Andrew`,last:`Kabakwu`,aka:``,title:`Developer`},{first:`Bruno`,last:`Gonzalez Campo`,aka:`stenyak`,title:`Lead Game Engine Developer`},{first:`Cosmin`,last:`Traian`,aka:``,title:`Developer`},{first:`Emre`,last:`Kut`,aka:``,title:`Developer`},{first:`Felix`,last:`Unger`,aka:``,title:`Developer`},{first:`George`,last:`Troulitakis`,aka:`AtmanB`,title:`Developer`},{first:`Guillem`,last:`Ortega`,aka:``,title:`Developer`},{first:`Logane`,last:`Ramez`,aka:`Gadoy`,title:`Developer`},{first:`Lorenzo`,last:`Bartali`,aka:``,title:`AI Developer`},{first:`Ludger`,last:`Meyer-Wülfing`,aka:`meywue`,title:`Developer`},{first:`Nicusor`,last:`Nedelcu`,aka:``,title:`Tools Developer`},{first:`Panos`,last:`Karabelas`,aka:``,title:`Developer`},{first:`Patrick `,last:`Schrangl`,aka:``,title:`Simulation Software Engineer`},{first:`Petros`,last:`Kondylis`,aka:``,title:`AI Developer`},{first:`Ronny`,last:`Nowak`,aka:``,title:`Developer`},{first:`Thomas`,last:`Portassau`,aka:`thomatoes50`,title:`Developer`},{first:`Thomas`,last:`Wilczynski`,aka:`Gamergull`,title:`Developer`},{first:`Timo`,last:`Stabbert`,aka:``,title:`Gameplay Dev Lead`},{first:`Valery`,last:`Dolotin`,aka:``,title:`AI Developer`},{first:`Daniel`,last:`Wakefield`,aka:``,title:`Developer`}]},{translateId:`ui.credits.vehiclePhysics`,members:[{first:`Fabian`,last:`Enkler`,aka:`Diamondback`,title:`Vehicle Systems Lead`},{first:`Angelo`,last:`Matteo`,aka:`angelo234`,title:`Tools Developer`},{first:`Aubrey`,last:`Percival`,aka:``,title:`Vehicle Physics Engineer`},{first:`Bobby`,last:`Villeneuve`,aka:`Binkey`,title:`Vehicle Physics Engineer`},{first:`Brian`,last:`Rickets`,aka:``,title:`Vehicle Systems Engineer`},{first:`Corey`,last:`Bergerud`,aka:`Goosah`,title:`Vehicle Physics Engineer`},{first:`Davide`,last:`Serpi`,aka:``,title:`Vehicle Dynamics Control Intern`},{first:`Efe Can`,last:`Kiraz`,aka:`RenAzuma66`,title:`Vehicle Physics Engineer`},{first:`Grzegorz`,last:`Węgrzyn`,aka:`AiTorror`,title:`Vehicle Physics Engineer / QA`},{first:`Jack`,last:`Jermany`,aka:``,title:`Vehicle Physics Engineer / QA`},{first:`Oliver`,last:`Čajka`,aka:`MRcrash`,title:`Vehicle Physics Engineer`},{first:`Piotr`,last:`Gajek`,aka:`Agent_Y`,title:`Vehicle Physics Engineer / QA`},{first:`Toma Ioan`,last:` Turcu`,aka:``,title:`Vehicle Physics Engineer`},{first:`Quinn`,last:`Howling`,aka:`SpeedHero`,title:`Vehicle Physics Designer`}]},{translateId:`ui.credits.vehicleArt`,members:[{first:`Gabriel`,last:`Fink`,aka:`gabester`,title:`Vehicle Art Director`},{first:`Jared`,last:`Samuelson`,aka:``,title:`Vehicle Team Lead / Subaru Expert`},{first:`Alexandr`,last:`Shesternin`,aka:``,title:`3D Vehicle Artist`},{first:`Andreas`,last:`Focht`,aka:``,title:`Vehicle Concept Artist`},{first:`Daniel`,last:`Russo`,aka:`A3DR`,title:`3D Vehicle Artist`},{first:`Dennis`,last:`Mateja`,aka:`NinetyNine`,title:`Vehicle Designer`},{first:`Manish`,last:`Rawat`,aka:``,title:`3D Vehicle Artist`}]},{translateId:`ui.credits.environmentArtists`,members:[{first:`Sam`,last:`Hutchinson`,aka:`LJFHutch`,title:`Environment Art Director`},{first:`Luca`,last:`Brighi`,aka:``,title:`Lead 3D Environment Artist`},{first:`Huiqin`,last:`Li`,aka:``,title:`3D Environment Artist`},{first:`Sebastien`,last:`Pelletier`,aka:`DoullPepper`,title:`3D Environment Artist`}]},{translateId:`ui.credits.conceptArtists`,members:[{first:`Mary Jane`,last:`Pajaron`,aka:``,title:`2D Concept Artist`}]},{translateId:`ui.credits.gameDesigners`,members:[{first:`James`,last:`Heslop`,aka:`Krallopian`,title:`Game Design Lead`},{first:`Alex`,last:`Bird`,aka:``,title:`Gameplay Developer`},{first:`Rob`,last:`Herridge`,aka:`HighDef`,title:`Gameplay Developer / QA`}]},{translateId:`ui.credits.ui`,members:[{first:`Pavel`,last:`Tiunov`,aka:`Dizboosta`,title:`UI Lead`},{first:`Destiny`,last:`Abellana`,aka:``,title:`Developer`},{first:`Stani`,last:`Tolmacheva`,aka:`Snowly`,title:`Developer`}]},{translateId:`ui.credits.sound`,members:[{first:`Mark`,last:`Knight`,aka:`TDK`,title:`Audio Designer`},{first:`Sebastian`,last:`Emling`,aka:``,title:`Audio Designer`},{first:`Jethro`,last:`Dunn`,aka:``,title:`Audio Outsourcer`},{first:`Max`,last:`Schumann`,aka:``,title:`Audio Outsourcer`}]},{translateId:`ui.credits.qa`,members:[{first:`Colin`,last:`Wenz`,aka:`synsol`,title:`QA Lead`},{first:`Przemysław`,last:`Wolny`,aka:`Car_Killer`,title:`QA / Mod Support`}]},{translateId:`ui.credits.production`,members:[{first:`Ryan`,last:`Dunne`,aka:``,title:`Producer`}]},{translateId:`ui.credits.sysops`,members:[{first:`Charalampos`,last:`Tsipizidis`,aka:``,title:`System Administrator`},{first:`Dimitrios`,last:`Folias`,aka:``,title:`System Administrator`}]},{translateId:`ui.credits.comms`,members:[{first:`Nataliia`,last:`Dmytriievska`,aka:`Leeloo`,title:`Communications & Marketing Lead`},{first:`Bernice`,last:`Mills`,aka:`Bee`,title:`Community Support & Marketing Specialist`},{first:`Mariia`,last:`Gumarova`,aka:`Fluffy Panda`,title:`Customer Support & Marketing Specialist`},{first:`Slawomir`,last:`Niemczyk`,aka:`Sedricoo`,title:`Community Coordinator`},{first:`Vincent`,last:`Liu`,aka:``,title:`Community & Marketing Specialist (APAC)`}]},{translateId:`ui.credits.research`,members:[{first:`Chrysanthi`,last:`Papamichail`,aka:``,title:`Lead Research Software Engineer`},{first:`Abdulrahman`,last:`Saeed`,aka:``,title:`Research Software Engineer`},{first:`Adam`,last:`Ivora`,aka:``,title:`Research Software Engineer`},{first:`David`,last:`Stark`,aka:``,title:`Research Software Engineer`},{first:`Florian`,last:`Faistauer`,aka:``,title:`Vehicle Simulation Expert`},{first:`Gabriel Puretas`,last:`Moral`,aka:``,title:`UX Intern`},{first:`Sayali`,last:`Rajhans`,aka:``,title:`Research Software Engineer`},{first:`Iskren`,last:`Rusimov`,aka:``,title:`Research Software Engineer Intern`}]},{translateId:`ui.credits.organization`,members:[{first:`Christoforos`,last:`Lambrianidis`,aka:``,title:`CFO`},{first:`Joseph`,last:`Inba Raj`,aka:``,title:`HR & Talent Acquisition Lead`},{first:`Cecilia`,last:`Sari`,aka:``,title:`Recruitment Specialist`},{first:`Dimitra`,last:`Litsardou`,aka:`Thamy`,title:`EU / Co-funding Advisory Specialist`},{first:`Eva`,last:`Pigova`,aka:``,title:`Senior Program Manager`},{first:`Maria`,last:`Kosmachevskaya`,aka:``,title:`Business Development Intern`},{first:`Özge`,last:`Altinkaya Erkok`,aka:``,title:`Communication Consultant`},{first:`Renars`,last:`Skesteris`,aka:``,title:`Business Development Intern`},{first:`Sabrina`,last:`Wee`,aka:``,title:`Business Development Manager`},{first:`Sandra`,last:`Campos`,aka:``,title:`Accounting Assistant`},{first:`Ulrike`,last:`Lentz`,aka:``,title:`Executive Assistant`}]},{translateId:`ui.credits.additionalVehiclePhysics`,members:[{first:`Will`,last:`Leader`,aka:``,title:`Off-road Suspension Development and Vehicle Dynamics`}]},{translateId:`ui.credits.additionalVehicleArt`,members:[{first:`Ashish`,last:`Singh`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`Juan Manuel`,last:`Orcellet`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`M. Yusuf`,last:`Bolukbasi`,aka:``,title:`Freelance Vehicle Artist`},{first:`Naman`,last:`Deep`,aka:``,title:`Freelance 3D Vehicle Artist`}]},{translateId:`ui.credits.externalContributors`,members:[{first:`Da`,last:`Li`,aka:``,title:``},{first:`Ruhmit`,last:`Sahu `,aka:``,title:``}]},{translateId:`ui.credits.formerEmployee`,members:[{first:`Aaron`,last:`Sutcliffe`,aka:``,title:`Developer / Vehicle Creation`},{first:`Alex`,last:`Raskin`,aka:``,title:`DevOps Engineer`},{first:`Artem`,last:`Arbatskii`,aka:``,title:`Developer`},{first:`Arturo`,last:`Campos`,aka:``,title:`Developer`},{first:`Ben`,last:`Payne`,aka:``,title:`Developer`},{first:`Boluwatife`,last:`Falaye`,aka:``,title:`Developer`},{first:`Clément`,last:`Roche`,aka:``,title:`Developer`},{first:`Edelmar`,last:`Schneider`,aka:``,title:`Developer`},{first:`Eike`,last:`Externest`,aka:``,title:`Developer`},{first:`Jali`,last:`Hautala`,aka:`Jalkku`,title:`Developer`},{first:`Jeremy`,last:`Lu`,aka:``,title:`Developer`},{first:`John`,last:`Beinecke`,aka:``,title:`Developer`},{first:`Juan`,last:`Mendez`,aka:``,title:`Developer`},{first:`Leander`,last:`Beernaert`,aka:``,title:`Game Engine Developer`},{first:`Marc`,last:`Müller`,aka:``,title:`Developer`},{first:`Mark`,last:`Vince`,aka:``,title:`Developer`},{first:`Matti`,last:`Yrjänheikki`,aka:`Masa`,title:`Developer`},{first:`Max`,last:`Razer`,aka:``,title:`Developer`},{first:`Mayowa David`,last:`Abogunrin`,aka:``,title:`Developer`},{first:`Moncef`,last:`Slimane`,aka:``,title:`Developer`},{first:`Nourelhoda`,last:`Mohamed`,aka:``,title:`Developer`},{first:`Pascale`,last:`Maul`,aka:``,title:`Developer`},{first:`Paul`,last:`De Almeida`,aka:``,title:`AI Developer`},{first:`Paul`,last:`Görs`,aka:``,title:`Developer`},{first:`Peter`,last:`Landwehr`,aka:``,title:`Developer`},{first:`Petteri`,last:`Koivumäki`,aka:``,title:`Developer`},{first:`Vasilis`,last:`Douvaras`,aka:``,title:`Developer`},{first:`Vatroslav `,last:`Bodrozic`,aka:``,title:`Developer`},{first:`Waldemar`,last:`Zeitler`,aka:``,title:`Developer`},{first:`Xiaoyi`,last:`Wang`,aka:``,title:`Developer`},{first:``,last:``,aka:``,title:``},{first:`Adrian`,last:`Baboi`,aka:``,title:`Vehicle Creation`},{first:`Brandon`,last:`Proulx`,aka:`Hondune`,title:`Vehicle Creation`},{first:`Carlos`,last:`Bergillos Varela`,aka:`CarlosAir`,title:`Content Creation`},{first:`David`,last:`Thurlbeck`,aka:``,title:`Vehicle Creation`},{first:`Janne`,last:`Nummela`,aka:``,title:`Vehicle Creation`},{first:`Jukka`,last:`Muikkula`,aka:`Miura`,title:`Vehicle Creation`},{first:`Karol`,last:`Miklas`,aka:``,title:`Freelance 3D Vehicle Artist`},{first:`Mardem`,last:`Pires das Dores`,aka:``,title:`Vehicle Creation`},{first:`Mikko`,last:`Lesonen`,aka:``,title:`Vehicle Creation`},{first:`Renju`,last:`Therakathu`,aka:``,title:`Vehicle Creation`},{first:`Sam`,last:`Millington`,aka:`DrowsySam`,title:`Vehicle Creation / Support`},{first:`Sebastian`,last:`Wessel`,aka:``,title:`Vehicle Creation`},{first:`Virtual Mechanix`,last:``,aka:``,title:`Vehicle Creation - Outsourcing Agency`},{first:`Winston`,last:`Broderick`,aka:``,title:`Vehicle Creation`},{first:`Mitchell`,last:`Sahl`,aka:`B25Mitch`,title:`3D Vehicle / Environment Artist`},{first:``,last:``,aka:``,title:``},{first:`Christin`,last:`Walther`,aka:``,title:`Lead 3D Artist`},{first:`Justin`,last:`Roczniak`,aka:`Donoteat`,title:`Environment Artist`},{first:`Lisa`,last:`Steinberg`,aka:``,title:`2D Artist`},{first:`Moses`,last:`Mulinge`,aka:``,title:`2D Artist`},{first:``,last:``,aka:``,title:``},{first:`Barend`,last:`van der Meulen`,aka:``,title:`Content Creator`},{first:`Matthias`,last:`Niebergall`,aka:``,title:`Game Designer`},{first:`SanityCheckMyGame`,last:``,aka:``,title:`Additional Design`},{first:``,last:``,aka:``,title:``},{first:`Georgios`,last:`Siantikos`,aka:`gntikos`,title:`User Interface`},{first:`Jonathan`,last:`Randy`,aka:``,title:`Lead Developer`},{first:`Mirco`,last:`Weigel`,aka:`theshark`,title:`User Interface`},{first:`Svetlozar`,last:`Valchev`,aka:``,title:`User Interface`},{first:`Theodoros`,last:`Manouilidis`,aka:``,title:`User Interface`},{first:`Yale`,last:`Hartmann`,aka:``,title:`User Interface`},{first:``,last:``,aka:``,title:``},{first:`Arend`,last:`Stührmann`,aka:``,title:`Producer`},{first:`Marie Cécile`,last:`Jacq`,aka:``,title:`Producer`},{first:`Nhung Van`,last:`Ho`,aka:``,title:`Project Management`},{first:``,last:``,aka:``,title:``},{first:`Bhavinkumar Babulal`,last:`Arya`,aka:``,title:`Research Software Engineer`},{first:`Carol`,last:`Halim`,aka:`Carotte`,title:`Research Software Engineer`},{first:`Elmar`,last:`Berghöfer`,aka:``,title:`Research`},{first:`Mattia`,last:`Vicari`,aka:``,title:`Research Software Engineer`},{first:``,last:``,aka:``,title:``},{first:`Camila`,last:`Navia`,aka:``,title:`Operations Assistant`},{first:`Danish`,last:`Abbasi`,aka:``,title:`Business Development Intern`},{first:`Lucien`,last:`Frei`,aka:``,title:`Business Development Intern`},{first:`Weiwei`,last:`Kong`,aka:``,title:`Business Development Intern`},{first:`Özgen`,last:`Saatçilar`,aka:``,title:`Communications Consultant`},{first:`Saskia`,last:`Opitz`,aka:``,title:`Administration`},{first:``,last:``,aka:``,title:``},{first:`Hala`,last:`Mahmoud`,aka:``,title:`Quality Assurance`},{first:`Jan Niklas`,last:`Hasse`,aka:``,title:`Quality Assurance`},{first:`Kamil`,last:`Kozak`,aka:``,title:`Quality Assurance`},{first:`Kemisola`,last:`Adeniyi`,aka:``,title:`Quality Assurance`},{first:`Kaja`,last:`Jambrek`,aka:``,title:`Quality Assurance`},{first:`Rajinder`,last:`Rajinder`,aka:``,title:`Quality Assurance`},{first:`Safdar`,last:`Mahmood`,aka:``,title:`Quality Assurance`},{first:`Uros`,last:`Sakic`,aka:`Uki`,title:`QA / Mod Support / Tools QA`},{first:``,last:``,aka:``,title:``},{first:`Konstantinos`,last:`Stamou`,aka:``,title:`System Administrator`},{first:``,last:``,aka:``,title:``},{first:`Erik`,last:`Heldt`,aka:``,title:`Documentation`},{first:`Maxime`,last:`Desharnais`,aka:``,title:`Documentation`},{first:`Harm`,last:`Schulz`,aka:``,title:`Student Assistant`},{first:`Annisa`,last:`Utami`,aka:``,title:`Student Assistant`},{first:`Brandon`,last:`Lynch`,aka:`Chuck_Norris_`,title:`Community Coordinator`},{first:`Monica`,last:`Huang`,aka:``,title:`Community Coordinator`}]},{translateId:`ui.credits.ourAwesomeCommunity`,members:[{first:`Daniel`,last:`Jones`,aka:`daniel_j`},{first:`Dennis`,last:`Wrekenhorst`,aka:`Dennis-W`},{first:`Dustin`,last:`Kutchara`,aka:`dkutch`},{first:`Kristian`,last:`Fagerland`,aka:``},{first:`Richard`,last:`Sixsmith`,aka:`Metalmuncher`},{first:`Sergy`,last:`Karpowicz`,aka:`0xsergy`},{first:`Sven`,last:`Nabeck`,aka:`sputnik_1`},{first:`Tom`,last:`Verhoeve`,aka:`Mythbuster`},{first:`Yannis`,last:`Vaiopoulos`,aka:`JohnV`},{first:``,last:``,aka:`Fufsgfen`}]},{translateId:`ui.credits.specialThanksTo`,members:[{first:`Luis`,last:`Placid`,aka:``,title:`VFX Developer`},{first:`Pierre-Michel`,last:`Ricordel`,aka:`pricorde`}]},{translateId:`ui.credits.soundtrack`,members:[{first:`Gabriel "gabester" Fink`,last:`Copyright 2014`,aka:`Lonle`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Element No. 10`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Getting Away`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Juno Rocks`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Neon Night Racer`},{first:`Mark "TDK" Knight`,last:`Copyright 2018`,aka:`Night Driver`}]},{translateId:`ui.credits.madePossibleWith`,members:[{first:`FMOD Studio by Firelight Technologies Pty Ltd.`,last:``,aka:``},{first:`LuaJIT`,last:``,aka:``},{first:`lua-intf, LuaBridge`,last:``,aka:``},{first:`Chromium Embedded Framework`,last:``,aka:``},{first:`AngularJS`,last:``,aka:``},{first:`Vue.js`,last:``,aka:``},{first:`Material Design`,last:``,aka:``},{first:`LuaSocket`,last:``,aka:``},{first:`Dear ImGui`,last:``,aka:``},{first:`Blender ®`,last:`www.blender.org`,aka:``}]},{translateId:``,members:[{first:`“DUALSHOCK” and “DualSense” are registered trademarks or trademarks of Sony Interactive Entertainment Inc. Library programs for DUALSHOCK®4 and DualSense™ wireless controllers © 2022 Sony Interactive Entertainment Inc.`,last:``,aka:``}]}],_hoisted_1$119={class:`bng-credits-content`},_hoisted_2$99=[`src`],_hoisted_3$87={class:`category`},_hoisted_4$67={class:`credits-table`},_hoisted_5$57={class:`member-cell member-name`},_hoisted_6$44={key:0,class:`aka`},_hoisted_7$37={key:1},_hoisted_8$30={key:0,class:`member-cell member-dot`},_hoisted_9$27={key:1},_hoisted_10$21={key:2,class:`member-cell member-role`},_hoisted_11$19={key:3},_sfc_main$132={__name:`CreditsScroller`,setup(__props){useUINavScope(`credits`);let imageURL=getAssetURL(`images/logos.svg#bng-drive-white`),wrapper=ref(),running=!0,exit=()=>{running=!1,Lua_default.extensions.unload(`ui_credits`),Lua_default.scenetree[`maincef:setMaxFPSLimit`](30),window.bngVue.gotoAngularState(`menu.mainmenu`)};onMounted(()=>{Lua_default.extensions.load(`ui_credits`),Lua_default.scenetree[`maincef:setMaxFPSLimit`](60),wrapper.value.focus(),scrollContainer(wrapper.value,65,exit)}),onUnmounted(()=>{exit()});function scrollContainer(container,pxPerSecond){let scrollSpeed=pxPerSecond/1e3,currentPos=0,lastTime=0,smoother=0;window.requestAnimationFrame(function step(timestamp){let delta=Math.min(150,Math.max(0,timestamp-lastTime));smoother+=(delta-smoother)*.02;let moveDelta=smoother*scrollSpeed;lastTime=timestamp,currentPos+=moveDelta;let targetPos=container.scrollHeight-container.clientHeight;running&¤tPoswithDirectives((openBlock(),createElementBlock(`div`,{ref_key:`wrapper`,ref:wrapper,class:`bng-credits-wrapper`,tabindex:`0`,onKeypress:exit,"bng-ui-scope":`credits`},[createBaseVNode(`div`,_hoisted_1$119,[createBaseVNode(`img`,{class:`logo`,src:unref(imageURL),alt:``},null,8,_hoisted_2$99),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(data_default),(category,cIndex)=>(openBlock(),createElementBlock(`div`,{key:cIndex},[createBaseVNode(`div`,_hoisted_3$87,[createBaseVNode(`span`,null,toDisplayString(_ctx.$t(category.translateId)),1)]),createBaseVNode(`div`,_hoisted_4$67,[(openBlock(!0),createElementBlock(Fragment,null,renderList(category.members,(member,mIndex)=>(openBlock(),createElementBlock(`div`,{class:`member-row`,key:mIndex},[createBaseVNode(`span`,_hoisted_5$57,[createTextVNode(toDisplayString(member.first)+` `,1),member.aka?(openBlock(),createElementBlock(`span`,_hoisted_6$44,toDisplayString(`<`+member.aka+`>`),1)):(openBlock(),createElementBlock(`span`,_hoisted_7$37,`\xA0`)),createTextVNode(` `+toDisplayString(member.last),1)]),member.title?(openBlock(),createElementBlock(`span`,_hoisted_8$30,` . `)):(openBlock(),createElementBlock(`span`,_hoisted_9$27,`\xA0`)),member.title?(openBlock(),createElementBlock(`span`,_hoisted_10$21,toDisplayString(_ctx.$t(member.title)),1)):(openBlock(),createElementBlock(`span`,_hoisted_11$19,`\xA0`))]))),128))])]))),128)),_cache[0]||=createBaseVNode(`div`,{style:{"padding-top":`70vh`}},null,-1)])],32)),[[unref(BngOnUiNav_default),exit,`menu,back`]])}},CreditsScroller_default=__plugin_vue_export_helper_default(_sfc_main$132,[[`__scopeId`,`data-v-9c2fdcd3`]]),routes_default$4=[{path:`/credits`,name:`credits`,component:CreditsScroller_default}],_hoisted_1$118={class:`details`,"bng-nav-scroll":``},_hoisted_2$98={key:0,class:`header-content`},_hoisted_3$86={key:1,class:`preview`},_hoisted_4$66={key:2,class:`tags-section`},_hoisted_5$56={class:`tags-container`},_hoisted_6$43=[`onClick`],_hoisted_7$36=[`src`],_hoisted_8$29={key:3,class:`description`},_hoisted_9$26={key:0,class:`specs-grid`},_hoisted_10$20={class:`specs-grid-container`},_hoisted_11$18={class:`spec-content`},_hoisted_12$14={class:`spec-label`},_hoisted_13$13={class:`spec-value`},_hoisted_14$13={key:0,class:`bottom-section`},_hoisted_15$13={class:`buttons-section`},_hoisted_16$13={key:1,class:`button-container`},_sfc_main$131={__name:`GameplayDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,default:()=>{}},toggleFavourite:{type:Function,default:()=>{}},exploreFolder:{type:Function,default:()=>{}},goToMod:{type:Function,default:()=>{}},showHeaderTitle:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},buttonOverride:{type:Object,default:null}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`gameplay-details`,{inline:__props.inline}])},[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$118,[__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_2$98,[__props.showHeaderTitle?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`none`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.activeItemDetails.headerTitle),1)]),_:1})):createCommentVNode(``,!0),__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_3$86,[createVNode(unref(aspectRatio_default),{class:normalizeClass([`preview-image`,{"has-header-title":__props.showHeaderTitle}]),ratio:`16:8`,"external-image":__props.activeItemDetails.preview},{default:withCtx(()=>[__props.inline?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`favourite-icon`,type:__props.activeItemDetails?.isFavourite?`star`:`starSecondary`,onClick:_cache[0]||=$event=>__props.toggleFavourite(__props.activeItem),color:__props.activeItemDetails?.isFavourite?`var(--bng-ter-yellow-50)`:`var(--bng-cool-gray-100)`},null,8,[`type`,`color`]))]),_:1},8,[`external-image`,`class`])])):createCommentVNode(``,!0),__props.activeItemDetails?.tags?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_4$66,[createBaseVNode(`div`,_hoisted_5$56,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.tags,tag=>(openBlock(),createElementBlock(`div`,{key:tag.key||tag.label,class:normalizeClass([`tag-item`,{clickable:tag.goToMod}]),onClick:$event=>tag.goToMod?__props.goToMod(tag.goToMod):null},[tag.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:tag.icon},null,8,[`type`])):createCommentVNode(``,!0),tag.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:tag.svg},null,8,_hoisted_7$36)):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(tag.label),1)],10,_hoisted_6$43))),128))])])):createCommentVNode(``,!0),__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_8$29,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),__props.activeItemDetails?.buttonInfo?.length>0||__props.activeItemDetails?.bottomTags?.length>0?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_9$26,[createBaseVNode(`div`,_hoisted_10$20,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_11$18,[createBaseVNode(`div`,_hoisted_12$14,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_13$13,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]]),__props.activeItemDetails?.buttonInfo?.length>0||__props.buttonOverride?(openBlock(),createElementBlock(`div`,_hoisted_14$13,[createBaseVNode(`div`,_hoisted_15$13,[__props.buttonOverride?createCommentVNode(``,!0):(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createElementBlock(`div`,{key:button.buttonId,class:`button-container`},[createVNode(unref(bngButton_default),{"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`])]))),128)),__props.buttonOverride?(openBlock(),createElementBlock(`div`,_hoisted_16$13,[createVNode(unref(bngButton_default),{"bng-scoped-nav-autofocus":!0,accent:`main`,label:__props.buttonOverride.label,icon:__props.buttonOverride.icon,onClick:_cache[1]||=$event=>__props.buttonOverride.click(__props.activeItem)},null,8,[`label`,`icon`])])):createCommentVNode(``,!0)])])):createCommentVNode(``,!0)],2))}},GameplayDetails_default=__plugin_vue_export_helper_default(_sfc_main$131,[[`__scopeId`,`data-v-7baeb809`]]),_hoisted_1$117=[`bng-ui-scope`],_hoisted_2$97={class:`popup-content`},_hoisted_3$85={class:`modal-header`},_hoisted_4$65={class:`vehicle-selector-section`},_hoisted_5$55={class:`vehicle-tile-wrapper`},_hoisted_6$42={class:`modal-content`},_hoisted_7$35={class:`spawnpoint-section`},_hoisted_8$28={class:`spawnpoint-info`},_hoisted_9$25={key:0,class:`spawnpoint-preview`},_hoisted_10$19=[`src`],_hoisted_11$17={class:`spawnpoint-name`},_hoisted_12$13={key:0,class:`config-section`},_hoisted_13$12={class:`group-title`},_hoisted_14$12={key:0},_hoisted_15$12={class:`always-show-section`},_hoisted_16$12={key:0,class:`modal-footer`},_sfc_main$130={__name:`LevelConfigurationModal`,props:{levelData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){useUINavBlocker().allowNavigationOnly();let{lua,events:events$3}=useBridge(),props=__props,emit$1=__emit,scopeName=usePopupUINavScopeName(`_levelConfigPopup`,props);provide(`gridSelectionState`,ref(null));let spawningOptions=ref([]),config=reactive({}),alwaysShowDialogue=ref(!1),vehicleTile=ref({}),loadSpawningOptions=async()=>{try{let levelName=props.levelData?.levelName,backendName=props.levelData?.backendName,result=await lua.ui_gameplaySelector_tileGenerators_levelTiles.getSpawningOptions(levelName,backendName);if(result){let options=result.options||[];spawningOptions.value=options,alwaysShowDialogue.value=result.alwaysShowDialogue||!1,result.vehicleTile?vehicleTile.value={key:`vehicle-selector`,name:result.vehicleTile.name||`Select Vehicle`,preview:result.vehicleTile.preview||`/ui/modules/vehicleSelector/placeholder.png`,sourceIcons:result.vehicleTile.sourceIcons||[]}:vehicleTile.value={key:`vehicle-selector`,name:`Select Vehicle`,preview:`/ui/modules/vehicleSelector/placeholder.png`,sourceIcons:[]},options.forEach(group=>{group.options&&Array.isArray(group.options)&&group.options.forEach(option=>{option.key&&option.value!==void 0&&(config[option.key]=option.value)})})}}catch(error){console.error(`Failed to load spawning options:`,error)}},handleOptionChange=async(key,newValue)=>{try{await lua.ui_gameplaySelector_tileGenerators_levelTiles.changeSpawningOption(key,newValue),events$3.emit(`gridSelectorRefreshCurrentItemDetails`,`freeroamSelector`)}catch(error){console.error(`Failed to update ${key} option:`,error)}},handleAlwaysShowDialogueChange=async newValue=>{try{let backendName=props.levelData?.backendName;await lua.ui_gameplaySelector_tileGenerators_levelTiles.setAlwaysShowDialogue(backendName,newValue),events$3.emit(`gridSelectorRefreshCurrentItemDetails`,`freeroamSelector`)}catch(error){console.error(`Failed to save default action preference:`,error)}},openVehicleSelector=async()=>{try{await lua.ui_vehicleSelector_general.openVehicleSelectorForFreeroamModal(),emit$1(`return`,!0)}catch(e){console.error(`Failed to open vehicle selector:`,e)}};onMounted(()=>{loadSpawningOptions()});let closeModal=()=>{emit$1(`return`,!1)},handleButtonClick=buttonId=>{closeModal(),events$3.emit(`gridSelectorExecuteButton`,`freeroamSelector`,buttonId)},handleCancelWithBack=()=>{closeModal()};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`level-configuration-modal popup`,"bng-ui-scope":unref(scopeName)},[createBaseVNode(`div`,_hoisted_2$97,[createBaseVNode(`div`,_hoisted_3$85,[_cache[1]||=createBaseVNode(`h2`,null,`Freeroam Spawning Options`,-1),createVNode(unref(bngIcon_default),{type:`xmarkBold`,class:`close-button`,onClick:closeModal,color:`var(--bng-cool-gray-100)`})]),createBaseVNode(`div`,_hoisted_4$65,[_cache[2]||=createBaseVNode(`h3`,{class:`group-title`},`Vehicle`,-1),createBaseVNode(`div`,_hoisted_5$55,[createTextVNode(toDisplayString(vehicleTile.value)+` `,1),createVNode(Tile_default,{tile:vehicleTile.value,displaySize:`small`,isConfig:!0,onClick:openVehicleSelector},null,8,[`tile`])])]),createBaseVNode(`div`,_hoisted_6$42,[createBaseVNode(`div`,_hoisted_7$35,[_cache[3]||=createBaseVNode(`h3`,null,`Selected Spawnpoint`,-1),createBaseVNode(`div`,_hoisted_8$28,[__props.levelData?.spawnPoint?.previews?.[0]?(openBlock(),createElementBlock(`div`,_hoisted_9$25,[createBaseVNode(`img`,{src:__props.levelData.spawnPoint.previews[0],alt:`Spawnpoint preview`},null,8,_hoisted_10$19)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_11$17,toDisplayString(_ctx.$tt(__props.levelData?.spawnPoint?.translationId||`No Name?`)),1)])]),spawningOptions.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_12$13,[(openBlock(!0),createElementBlock(Fragment,null,renderList(spawningOptions.value,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[createBaseVNode(`h3`,_hoisted_13$12,toDisplayString(group.name),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.options,option=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key},[option.label?(openBlock(),createElementBlock(`label`,_hoisted_14$12,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label)+`: `,1)])):createCommentVNode(``,!0),createVNode(unref(bngSelect_default),{modelValue:config[option.key],"onUpdate:modelValue":[$event=>config[option.key]=$event,newValue=>handleOptionChange(option.key,newValue)],options:option.options,loop:``,config:{value:opt=>opt.value,label:opt=>opt.label}},null,8,[`modelValue`,`onUpdate:modelValue`,`options`,`config`])]))),128))]))),128))])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$12,[createVNode(unref(bngSwitch_default),{modelValue:alwaysShowDialogue.value,"onUpdate:modelValue":[_cache[0]||=$event=>alwaysShowDialogue.value=$event,handleAlwaysShowDialogueChange],label:`Always show this dialogue`,labelBefore:``},null,8,[`modelValue`])]),spawningOptions.value.length>0||__props.levelData?.buttonInfo&&__props.levelData.buttonInfo.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$12,[__props.levelData?.buttonInfo&&__props.levelData.buttonInfo.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.levelData.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,label:button.label,icon:button.icon,accent:button.primary?`main`:`secondary`,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`label`,`icon`,`accent`,`onClick`]))),128)):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])],8,_hoisted_1$117)),[[unref(BngOnUiNav_default),handleCancelWithBack,`back,menu`]])}},LevelConfigurationModal_default=__plugin_vue_export_helper_default(_sfc_main$130,[[`__scopeId`,`data-v-ec35f32c`]]),_sfc_main$129={__name:`FreeroamSelector`,setup(__props){let{events:events$3}=useBridge(),handleOpenLevelConfigPopup=data=>{addPopup(LevelConfigurationModal_default,{levelData:data}).promise};return onMounted(()=>{events$3.on(`openLevelConfigurationPopup`,handleOpenLevelConfigPopup)}),onUnmounted(()=>{events$3.off(`openLevelConfigurationPopup`,handleOpenLevelConfigPopup)}),(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`freeroamSelector`,routePath:`/freeroam-selector`,defaultPath:{keys:[`allFreeroam`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[createVNode(GameplayDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`,`exploreFolder`,`goToMod`])]),_:1}))}},FreeroamSelector_default=_sfc_main$129,_hoisted_1$116={class:`preview`},_hoisted_2$96={key:0,class:`general-tags`},_hoisted_3$84={key:1,class:`icon-text-tag`},_hoisted_4$64={class:`vehicle-text-header`},_hoisted_5$54={key:0,class:`general-specs`},_hoisted_6$41={key:1,class:`divider`},_hoisted_7$34={class:`vehicle-tags`},_hoisted_8$27=[`onClick`],_hoisted_9$24=[`src`],_hoisted_10$18={key:0,class:`source-icon-container`},_hoisted_11$16={key:1,class:`source-icon-container`},_hoisted_12$12={key:2,class:`source-icon-container auxiliary-icon`},_hoisted_13$11={key:2,class:`vehicle-description`},_hoisted_14$11={class:`specs-grid-container`},_hoisted_15$11={key:0,class:`spec-label`},_hoisted_16$11={class:`spec-value`},_hoisted_17$10={key:1,class:`spec-value`},_hoisted_18$8={key:0,class:`bottom-section`},_hoisted_19$6={class:`paint-list expanded`},_sfc_main$128={__name:`VehicleDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,default:()=>{}},toggleFavourite:{type:Function,default:()=>{}},exploreFolder:{type:Function,default:()=>{}},goToMod:{type:Function,default:()=>{}},showHeaderTitle:{type:Boolean,default:!0},hideDetailsAndButtons:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},buttonOverride:{type:Object,default:null}},emits:[`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,handleButtonClick=buttonId=>{let additionalData={};selectedMultiPaint.value&&(additionalData.paint=selectedMultiPaint.value.paintNames[0],additionalData.paint2=selectedMultiPaint.value.paintNames[1],additionalData.paint3=selectedMultiPaint.value.paintNames[2]),selectedPaint.value&&(additionalData.paint=selectedPaint.value.name),props.executeButton(buttonId,additionalData),emit$1(`button-click`,buttonId)},toggleFavourite=()=>{props.activeItem&&props.toggleFavourite(props.activeItem)},openFolder=path=>{props.exploreFolder(path)},goToMod=modId=>{props.goToMod(modId)},sortedFactoryPaints=computed(()=>{let factoryPaints=props.activeItemDetails?.paints?.factoryPaints;return Array.isArray(factoryPaints)?sortColors(factoryPaints).filter(paint=>paint&&paint.name):[]}),multiPaints=computed(()=>{let res=[],multiPaintSetups=props.activeItemDetails?.paints?.multiPaintSetups,factoryPaints=props.activeItemDetails?.paints?.factoryPaints;if(!Array.isArray(multiPaintSetups)||!Array.isArray(factoryPaints))return res;for(let i=0;iname&&factoryPaints.find(paint=>paint.name===name)||null).filter(paint=>paint!==null);paints.length>0&&res.push({id:paintNames.join(`|`),name:setup$3.name,paintNames,paints,applyAll:()=>applyMultipaint(setup$3)})}return res}),hasPaintData=computed(()=>props.activeItemDetails?.additionalData?.paint&&props.activeItemDetails?.paints?.factoryPaints),paintData=computed(()=>{if(!hasPaintData.value)return null;let additionalData=props.activeItemDetails.additionalData,factoryPaints=props.activeItemDetails.paints.factoryPaints,paintNames=[additionalData.paint,additionalData.paint2,additionalData.paint3].filter(name=>name),paints=paintNames.map(name=>{let paint=factoryPaints.find(p$1=>p$1.name===name);return paint?convertPaintToTileFormat(paint):null}).filter(paint=>paint!==null);return paints.length===0?null:{paint:paintNames[0],paintNames,paints}});function applyMultipaint(setup$3){selectedMultiPaint.value=setup$3,selectedPaint.value=null}let selectedMultiPaint=ref(null),selectedPaint=ref(null);ref(!1);let handleMultiPaintClick=(multiPaint,focus$1=!0)=>{selectedMultiPaint.value=multiPaints.value.find(mp=>mp.name===multiPaint.name),selectedPaint.value=null,focus$1&&emit$1(`focus-item`,`multiPaints`)},handlePaintClick=paint=>{selectedPaint.value=paint,selectedMultiPaint.value=null,emit$1(`focus-item`,`paints`)},convertPaintToTileFormat=paint=>{if(!paint)return null;if(paint.baseColor&&paint.paintString)return paint;try{let paintObj=new Paint;return paintObj.paint=paint,paintObj.paintObject}catch(error){return console.warn(`Failed to convert paint:`,paint,error),null}},selectDefaultMultiPaint=()=>{if(!props.activeItemDetails?.paints)return;let multiPaintSetups=props.activeItemDetails?.paints.multiPaintSetups;if(Array.isArray(multiPaintSetups)&&multiPaintSetups.length>0){let defaultMultiPaintSetup=multiPaintSetups.find(setup$3=>setup$3.isDefault);if(defaultMultiPaintSetup){let multiPaintsObj=multiPaints.value.find(mp=>mp.name===defaultMultiPaintSetup.name);if(multiPaintsObj){handleMultiPaintClick(multiPaintsObj,!1);return}}}};watch(()=>props.activeItemDetails,()=>{selectDefaultMultiPaint()}),onMounted(()=>{selectDefaultMultiPaint()});function average(arr){return arr.reduce((a$1,b)=>a$1+b)/arr.length}function valComparable(col,thres=.05){let bool=!0,av=average(col);for(let i=0;i=col[i];return bool&&=av>.8||av<.2,bool}function colorHigherHelper(itm){if(!itm||!itm.orig||!itm.orig.baseColor||!Array.isArray(itm.orig.baseColor)||itm.orig.baseColor.length<4)return 0;let av=average(itm.orig.baseColor.slice(0,3)),al=itm.orig.baseColor[3]/2,res=Math.abs(av-1)*al;return res===0?(av+al)/2:res+1}function colorHigher(a$1,b){if(!a$1||!b||!a$1.orig||!b.orig||!a$1.orig.baseColor||!b.orig.baseColor)return 0;let aColor=valComparable(a$1.orig.baseColor.slice(0,3)),bColor=valComparable(b.orig.baseColor.slice(0,3));if(aColor&&bColor)return colorHigherHelper(b)-colorHigherHelper(a$1);if(aColor&&!bColor)return 1;if(!aColor&&bColor)return-1;for(let i=0;i<3;i++)if(a$1.val[i]!==b.val[i])return a$1.val[i]-b.val[i];return 0}function colorValue(arr){if(!Array.isArray(arr)||arr.length<4)return[0,0,0,0];let repitions=8,rgb=[];for(let i=0;i<3;i++)rgb[i]=(1-arr[3]/2)*arr[i]+arr[3]/2*arr[i];let lum=Math.sqrt(.241*rgb[0]+.691*rgb[1]+.068*rgb[2]),hsl=Paint.rgbToHsl(rgb),out=[hsl[0],lum,hsl[1]].map(elem=>elem*8);return out[0]%2==1&&(out[1]=8-out[1],out[2]=8-out[2]),out.push(arr[3]),out}function sortColors(list){return Array.isArray(list)?list.filter(elem=>elem&&elem.baseColor&&Array.isArray(elem.baseColor)&&elem.baseColor.length>=4).map(elem=>({val:colorValue(elem.baseColor),orig:elem})).sort(colorHigher).map(elem=>elem.orig):[]}return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details`,{inline:__props.inline}]),"bng-nav-scroll":``},[createBaseVNode(`div`,_hoisted_1$116,[__props.showHeaderTitle?(openBlock(),createBlock(bngCardHeading_default,{key:0,type:`none`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.activeItemDetails.headerTitle),1)]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,{class:normalizeClass([`tags-and-preview`,{"has-header-title":__props.showHeaderTitle}])},[__props.activeItemDetails?.iconTags?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$96,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.iconTags,icon=>(openBlock(),createBlock(bngTooltip_default,{key:icon.icon,text:icon.label,position:`left`},{default:withCtx(()=>[icon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:icon.icon,label:icon.label,onClick:$event=>goToMod(icon.goToMod),class:normalizeClass({"favourite-icon":icon.goToMod})},null,8,[`type`,`label`,`onClick`,`class`])):createCommentVNode(``,!0),icon.iconText?(openBlock(),createElementBlock(`span`,_hoisted_3$84,toDisplayString(icon.iconText),1)):createCommentVNode(``,!0)]),_:2},1032,[`text`]))),128))])):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:normalizeClass([`preview-image`,{"has-header-title":__props.showHeaderTitle}]),ratio:`16:8`,"external-image":__props.activeItemDetails?.preview},{default:withCtx(()=>[__props.inline?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`favourite-icon`,type:__props.activeItemDetails?.isFavourite?`star`:`starSecondary`,onClick:toggleFavourite,color:__props.activeItemDetails?.isFavourite?`var(--bng-ter-yellow-50)`:`var(--bng-cool-gray-100)`},null,8,[`type`,`color`])),hasPaintData.value?(openBlock(),createBlock(unref(bngPaintTile_default),{key:1,"paint-id":`${__props.activeItem?.id||`vehicle`}:${paintData.value.paint}`,paint:paintData.value.paints,"paint-name":paintData.value.paintNames.join(`, `),width:56,height:24,class:`preview-paint-tile`,"bng-no-nav":`true`,tabindex:`-1`},null,8,[`paint-id`,`paint`,`paint-name`])):createCommentVNode(``,!0)]),_:1},8,[`class`,`external-image`])],2)]),createBaseVNode(`div`,_hoisted_4$64,[__props.activeItemDetails?.generalSpecs?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$54,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.generalSpecs,spec=>(openBlock(),createElementBlock(`div`,{class:`spec-value`,key:spec.key},[Array.isArray(spec.value)?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.$tt(spec.value[0].text)),1)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(spec.value),1)],64))]))),128))])):createCommentVNode(``,!0),__props.activeItemDetails?.generalSpecs.length>0?(openBlock(),createElementBlock(`div`,_hoisted_6$41)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$34,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.tags,tag=>(openBlock(),createElementBlock(`div`,{key:tag.key,class:normalizeClass([`source-icon-container`,{"auxiliary-icon":tag.auxiliary}]),onClick:$event=>_ctx.tagClicked(tag)},[tag.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:tag.icon},null,8,[`type`])):createCommentVNode(``,!0),tag.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:tag.svg},null,8,_hoisted_9$24)):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(tag.label),1)],10,_hoisted_8$27))),128)),__props.activeItemDetails?.sourceIcon?(openBlock(),createElementBlock(`div`,_hoisted_10$18,[createVNode(unref(bngIcon_default),{type:__props.activeItemDetails?.sourceIcon.icon,onClick:_cache[0]||=$event=>goToMod(__props.activeItemDetails?.sourceIcon.goToMod)},null,8,[`type`]),createTextVNode(` `+toDisplayString(__props.activeItemDetails?.sourceIcon.label),1)])):createCommentVNode(``,!0),__props.activeItemDetails?.isFavourite?(openBlock(),createElementBlock(`div`,_hoisted_11$16,[createVNode(unref(bngIcon_default),{type:`star`,onClick:toggleFavourite}),_cache[2]||=createTextVNode(` Favourite`,-1)])):createCommentVNode(``,!0),__props.activeItemDetails?.configDetails.isAuxiliary?(openBlock(),createElementBlock(`div`,_hoisted_12$12,[createVNode(unref(bngIcon_default),{type:`bug`}),_cache[3]||=createTextVNode(` Auxiliary`,-1)])):createCommentVNode(``,!0)]),__props.activeItemDetails?.configDetails?.Description?(openBlock(),createElementBlock(`div`,_hoisted_13$11,toDisplayString(__props.activeItemDetails?.configDetails?.Description),1)):createCommentVNode(``,!0)]),__props.activeItemDetails?.configDetails&&!__props.hideDetailsAndButtons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails?.specificationsList,(value,key)=>(openBlock(),createElementBlock(`div`,{key,class:`specs-grid`},[createBaseVNode(`div`,_hoisted_14$11,[(openBlock(!0),createElementBlock(Fragment,null,renderList(value.specifications,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:normalizeClass([`spec-cell`,{"full-width":!specification.key}])},[specification.key?(openBlock(),createElementBlock(`div`,_hoisted_15$11,toDisplayString(specification.key)+`:`,1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_16$11,[Array.isArray(specification.value)?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(specification.value,(item,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`spec-value-item`,{italic:item.italic}])},[createBaseVNode(`span`,null,toDisplayString(item.text),1),specification.postIcon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`spec-post-icon`,type:specification.postIcon},null,8,[`type`])):createCommentVNode(``,!0),specification.openFolder?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`spec-post-icon`,type:`folder`,onClick:$event=>openFolder(specification.value)},null,8,[`onClick`])):createCommentVNode(``,!0)],2))),128)):(openBlock(),createElementBlock(`div`,_hoisted_17$10,[createBaseVNode(`span`,null,toDisplayString(specification.value),1),specification.postIcon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`spec-post-icon`,type:specification.postIcon},null,8,[`type`])):createCommentVNode(``,!0),specification.openFolder?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`spec-post-icon`,type:`folder`,onClick:$event=>openFolder(specification.value)},null,8,[`onClick`])):createCommentVNode(``,!0)]))])],2))),128))])]))),128)):createCommentVNode(``,!0)],2)),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]]),__props.hideDetailsAndButtons?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$8,[createBaseVNode(`div`,_hoisted_19$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(multiPaints.value,multiPaint=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:multiPaint.name,"paint-id":`${__props.activeItem?.id||`vehicle`}:${multiPaint.name}`,paint:multiPaint.paints,"paint-name":multiPaint.name,"paint-names":multiPaint.paintNames,width:56,height:24,class:normalizeClass([`multi-paint-item`,{selected:selectedMultiPaint.value?.name===multiPaint.name}]),onClick:$event=>handleMultiPaintClick(multiPaint)},null,8,[`paint-id`,`paint`,`paint-name`,`paint-names`,`class`,`onClick`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedFactoryPaints.value,paint=>(openBlock(),createElementBlock(Fragment,{key:paint.name},[paint&&paint.class===`factory`&&paint.name?(openBlock(),createBlock(unref(bngPaintTile_default),{key:0,"paint-id":`${__props.activeItem?.id||`vehicle`}:${paint.name}`,paint:convertPaintToTileFormat(paint),"vehicle-name":`factory`,"paint-name":paint.name,width:24,height:24,class:normalizeClass([`paint-item`,{selected:selectedPaint.value===paint}]),onClick:$event=>handlePaintClick(paint)},null,8,[`paint-id`,`paint`,`paint-name`,`class`,`onClick`])):createCommentVNode(``,!0)],64))),128))]),__props.activeItemDetails?.buttonInfo&&!__props.buttonOverride?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.activeItemDetails?.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128)):createCommentVNode(``,!0),__props.buttonOverride?(openBlock(),createBlock(unref(bngButton_default),{key:1,"bng-scoped-nav-autofocus":!0,accent:`main`,label:__props.buttonOverride.label,icon:__props.buttonOverride.icon,onClick:_cache[1]||=$event=>__props.buttonOverride.click(__props.activeItem,selectedPaint.value,selectedMultiPaint.value)},null,8,[`label`,`icon`])):createCommentVNode(``,!0)]))],64))}},VehicleDetails_default=__plugin_vue_export_helper_default(_sfc_main$128,[[`__scopeId`,`data-v-58d013e3`]]);function useFreeroamConfigurator(){let{events:events$3}=useBridge(),configData=ref(null),button=ref(null),error=ref(null),isInitializing=ref(!1),refreshConfigHandler=()=>{logger_default.debug(`freeroamConfiguratorRefreshConfig`),loadConfiguration()},refreshButtonHandler=()=>{logger_default.debug(`freeroamConfiguratorRefreshButton`),loadButtons()};events$3.on(`freeroamConfiguratorRefreshConfig`,refreshConfigHandler),events$3.on(`freeroamConfiguratorRefreshButton`,refreshButtonHandler);let loadButtons=async()=>{try{let buttonData=await Lua_default.freeroam_freeroamConfigurator.getButtons();button.value=buttonData||null,logger_default.debug(`Loaded button:`,buttonData)}catch(err){logger_default.error(`Failed to load button:`,err),error.value=err}},loadConfiguration=async()=>{try{error.value=null;let data=await Lua_default.freeroam_freeroamConfigurator.getConfiguration();data?.options&&processOptionsTree(data.options),configData.value=data,logger_default.debug(`Loaded configuration:`,data),await loadButtons()}catch(err){logger_default.error(`Failed to load freeroam configuration:`,err),error.value=err}},processOptionsTree=options=>{!options||!Array.isArray(options)||options.forEach(group=>{group.key&&(group.onChange=val=>{group.value=val,handleOptionChange(group.key,val)}),Object.defineProperty(group,`enabled`,{get(){return!this.key||!!this.value},enumerable:!0,configurable:!0}),group.options&&Array.isArray(group.options)&&group.options.forEach(option=>{option.key&&(option.onChange=val=>{option.value=val,handleOptionChange(option.key,val)})})})},onSpawnPointTileClick=async()=>{try{await Lua_default.freeroam_freeroamConfigurator.onSpawnPointTileClick(),logger_default.debug(`Spawn point tile clicked`)}catch(err){logger_default.error(`Failed to handle spawnpoint tile click:`,err),error.value=err}},onVehicleTileClick=async()=>{try{await Lua_default.freeroam_freeroamConfigurator.onVehicleTileClick(),logger_default.debug(`Vehicle tile clicked`)}catch(err){logger_default.error(`Failed to handle vehicle tile click:`,err),error.value=err}},updateOption=async(key,value)=>{try{await Lua_default.freeroam_freeroamConfigurator.updateOption(key,value),logger_default.debug(`Updated option ${key}:`,value)}catch(err){logger_default.error(`Failed to update option ${key}:`,err),error.value=err}},handleOptionChange=async(key,newValue)=>{try{await Lua_default.freeroam_freeroamConfigurator.updateOption(key,newValue),await loadButtons(),logger_default.debug(`Handled option change ${key}:`,newValue)}catch(err){logger_default.error(`Failed to update ${key} option:`,err),error.value=err}},handleButtonClick=async buttonId=>{try{await Lua_default.freeroam_freeroamConfigurator.triggerButton(buttonId),logger_default.debug(`Button clicked:`,buttonId)}catch(err){logger_default.error(`Failed to trigger button:`,err),error.value=err}},selectSpawnPoint=async(levelName,spawnPointObjectName,key)=>{try{if(!levelName)throw logger_default.error(`selectSpawnPoint: levelName is required`),Error(`levelName is required`);return await Lua_default.freeroam_freeroamConfigurator.setSpawnPoint(levelName,spawnPointObjectName,key),configData.value.currentSpawnPoint=await Lua_default.freeroam_freeroamConfigurator.getCurrentSpawnPointTile(),logger_default.debug(`Selected spawn point:`,{levelName,spawnPointObjectName}),!0}catch(err){return logger_default.error(`Failed to select spawn point:`,err),error.value=err,!1}},selectVehicle=async(model,config,additionalData,key)=>{try{if(!model||!config)throw logger_default.error(`selectVehicle: model and config are required`),Error(`model and config are required`);return await Lua_default.freeroam_freeroamConfigurator.setVehicle(model,config,additionalData||{},key),configData.value.currentVehicle=await Lua_default.freeroam_freeroamConfigurator.getCurrentVehicleTile(),logger_default.debug(`Selected vehicle:`,{model,config,additionalData}),!0}catch(err){return logger_default.error(`Failed to select vehicle:`,err),error.value=err,!1}},gotoHeaderItem=item=>{item.gotoPath&&(window.bngVue.gotoGameState(item.gotoPath.path,{params:item.gotoPath.props}),logger_default.debug(`Navigated to path:`,item.gotoPath)),item.gotoAngularState&&(window.bngVue.gotoAngularState(item.gotoAngularState),logger_default.debug(`Navigated to angular state:`,item.gotoAngularState)),item.click&&(item.click(),logger_default.debug(`Navigated to click:`,item.click))},goBack=()=>{logger_default.debug(`goBack called`),gotoHeaderItem({gotoAngularState:`menu.mainmenu`})},hasOptions=computed(()=>configData.value?.options&&configData.value.options.length>0),hasSpawnPoint=computed(()=>!!configData.value?.currentSpawnPoint),hasVehicle=computed(()=>!!configData.value?.currentVehicle),canConfigureOptions=computed(()=>hasSpawnPoint.value&&hasVehicle.value),isGroupEnabled=group=>!group.key||!!group.value,initialize=async()=>{if(isInitializing.value){logger_default.debug(`Already initializing, skipping...`);return}try{isInitializing.value=!0,logger_default.debug(`Initializing FreeroamConfigurator composable...`),await loadConfiguration(),logger_default.debug(`FreeroamConfigurator composable initialized successfully`)}catch(err){logger_default.error(`Failed to initialize FreeroamConfigurator composable:`,err),error.value=err}finally{isInitializing.value=!1}},cleanup=()=>{logger_default.debug(`FreeroamConfigurator composable cleanup`),events$3.off(`freeroamConfiguratorRefreshConfig`,refreshConfigHandler),events$3.off(`freeroamConfiguratorRefreshButton`,refreshButtonHandler)};return onUnmounted(()=>{cleanup()}),{configData,config:configData,button,error,isInitializing,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,loadConfiguration,loadButtons,onSpawnPointTileClick,onVehicleTileClick,updateOption,handleOptionChange,handleButtonClick,selectSpawnPoint,selectVehicle,gotoHeaderItem,goBack,isGroupEnabled}}var _hoisted_1$115={class:`configurator-content`},_hoisted_2$95={key:0,class:`error-state`},_hoisted_3$83={class:`error-content`},_hoisted_4$63={key:1,class:`configurator-sections`,"bng-nav-item":``},_hoisted_5$53={class:`three-column-layout`},_hoisted_6$40={class:`config-section`,"bng-nav-item":``},_hoisted_7$33={class:`section-header`},_hoisted_8$26={class:`section-title-value`},_hoisted_9$23={class:`section-content`},_hoisted_10$17={key:0,class:`clickable`},_hoisted_11$15={key:1,class:`placeholder-content`},_hoisted_12$11={class:`config-section`,"bng-nav-item":``},_hoisted_13$10={class:`section-header`},_hoisted_14$10={class:`section-title-value`},_hoisted_15$10={class:`section-content`},_hoisted_16$10={key:0,class:`clickable`},_hoisted_17$9={key:1,class:`placeholder-content`},_hoisted_18$7={class:`config-section`,"bng-nav-item":``},_hoisted_19$5={class:`section-header`},_hoisted_20$5={key:0,class:`options-scope`},_hoisted_21$5={key:0,class:`section-header`},_hoisted_22$5=[`bng-scoped-nav-autofocus`],_hoisted_23$4={class:`option-label`},_hoisted_24$3={key:1,class:`placeholder-content`},_hoisted_25$2={class:`action-button-container`},_hoisted_26$1={class:`button-content`},_hoisted_27$1={key:1,class:`placeholder-content row`},_sfc_main$127={__name:`FreeroamConfigurator`,setup(__props){let{lua}=useBridge(),{configData,config,button,error,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,onSpawnPointTileClick,onVehicleTileClick,handleOptionChange,handleButtonClick,gotoHeaderItem,goBack,isGroupEnabled}=useFreeroamConfigurator();return onBeforeMount(()=>{lua.simTimeAuthority.pushPauseRequest(`freeroamConfigurator`)}),onMounted(()=>{initialize()}),onUnmounted(()=>{lua.simTimeAuthority.popPauseRequest(`freeroamConfigurator`)}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`freeroam-configurator`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$115,[createVNode(unref(bngScreenHeadingV2_default),{class:`configurator-heading`},{preheadings:withCtx(()=>[createVNode(unref(bngBreadcrumbs_default),{"show-back-button":!0,simple:``,"disable-last-item":``,class:`configurator-breadcrumbs`,onBack:unref(goBack),onClick:unref(gotoHeaderItem),items:[{label:`Menu`,gotoAngularState:`menu.mainmenu`},{label:`Freeroam Configurator`}]},null,8,[`onBack`,`onClick`])]),default:withCtx(()=>[_cache[3]||=createTextVNode(` Freeroam `,-1)]),_:1}),unref(error)?(openBlock(),createElementBlock(`div`,_hoisted_2$95,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_3$83,[createVNode(unref(bngIcon_default),{type:`warning`,class:`error-icon`}),_cache[5]||=createBaseVNode(`p`,null,`Failed to load configuration`,-1),createVNode(unref(bngButton_default),{onClick:unref(initialize),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Retry`,-1)]]),_:1},8,[`onClick`,`accent`])])])):withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$63,[createBaseVNode(`div`,_hoisted_5$53,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$40,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_7$33,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[6]||=createBaseVNode(`span`,{class:`section-title-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_8$26,toDisplayString(unref(configData)?.currentSpawnPoint?.headerTitle||`Select location...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_9$23,[createBaseVNode(`div`,{class:`selectable-component`,onClick:_cache[0]||=()=>unref(onSpawnPointTileClick)()},[unref(configData)?.currentSpawnPoint?(openBlock(),createElementBlock(`div`,_hoisted_10$17,[createVNode(GameplayDetails_default,{"active-item":{levelName:unref(configData).currentSpawnPoint.levelName,spawnPointObjectName:unref(configData).currentSpawnPoint.spawnPointObjectName},"active-item-details":unref(configData).currentSpawnPoint,inline:``},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_11$15,[createVNode(unref(bngIcon_default),{type:`road`,class:`placeholder-icon`}),_cache[7]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select location`,-1)]))])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(onSpawnPointTileClick)(),`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_12$11,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_13$10,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[8]||=createBaseVNode(`span`,{class:`section-title-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_14$10,toDisplayString(unref(configData)?.currentVehicle?.headerTitle||`Select vehicle...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_15$10,[createBaseVNode(`div`,{class:`selectable-component`,onClick:_cache[1]||=()=>unref(onVehicleTileClick)()},[unref(configData)?.currentVehicle?(openBlock(),createElementBlock(`div`,_hoisted_16$10,[createVNode(VehicleDetails_default,{"active-item":{model:unref(configData).currentVehicle.model,config:unref(configData).currentVehicle.config},"active-item-details":unref(configData).currentVehicle,"hide-details-and-buttons":``,inline:``},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_17$9,[createVNode(unref(bngIcon_default),{type:`car`,class:`placeholder-icon`}),_cache[9]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select vehicle`,-1)]))])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(onVehicleTileClick)(),`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_18$7,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_19$5,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[..._cache[10]||=[createTextVNode(`Options`,-1)]]),_:1})]),createBaseVNode(`div`,{class:normalizeClass([`section-content`,{disabled:!unref(canConfigureOptions)}])},[unref(hasOptions)?(openBlock(),createElementBlock(`div`,_hoisted_20$5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(configData).options,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[group.name?(openBlock(),createElementBlock(`div`,_hoisted_21$5,[createVNode(unref(bngCardHeading_default),{outline:!unref(isGroupEnabled)(group),type:`ribbon`,class:`section-title`},{default:withCtx(()=>[group.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,class:`group-switch`,modelValue:unref(config)[group.key],"onUpdate:modelValue":[$event=>unref(config)[group.key]=$event,newValue=>unref(handleOptionChange)(group.key,newValue)],label:group.name,labelBefore:``,inline:``,alwaysTransparent:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):createCommentVNode(``,!0)]),_:2},1032,[`outline`])])):createCommentVNode(``,!0),unref(isGroupEnabled)(group)?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(group.options,(option,optionIndex)=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key,"bng-scoped-nav-autofocus":optionIndex===0},[createBaseVNode(`div`,{class:normalizeClass([`option-row`,{disabled:option.disabled}])},[createBaseVNode(`label`,_hoisted_23$4,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label),1)]),option.type===`select`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:unref(config)[option.key],items:option.options||[],threshold:80,"onUpdate:modelValue":newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,modelValue:unref(config)[option.key],"onUpdate:modelValue":[$event=>unref(config)[option.key]=$event,newValue=>unref(handleOptionChange)(option.key,newValue)],label:option.label,labelBefore:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):option.type===`string`?(openBlock(),createBlock(unref(bngInput_default),{key:2,modelValue:unref(config)[option.key],"onUpdate:modelValue":$event=>unref(config)[option.key]=$event,placeholder:option.placeholder,"char-max":option.maxLength,onValueChanged:newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`,`char-max`,`onValueChanged`])):option.type===`number`?(openBlock(),createBlock(unref(bngInput_default),{key:3,modelValue:unref(config)[option.key],"onUpdate:modelValue":$event=>unref(config)[option.key]=$event,type:`number`,"num-min":option.min,"num-max":option.max,"num-step":option.step,onValueChanged:newValue=>unref(handleOptionChange)(option.key,newValue)},null,8,[`modelValue`,`onUpdate:modelValue`,`num-min`,`num-max`,`num-step`,`onValueChanged`])):createCommentVNode(``,!0)],2)],8,_hoisted_22$5))),128)):createCommentVNode(``,!0)]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_24$3,[createVNode(unref(bngIcon_default),{type:`adjust`,class:`placeholder-icon`}),_cache[11]||=createBaseVNode(`p`,{class:`placeholder-text`},`No options available`,-1)]))],2)])),[[unref(BngBlur_default)],[unref(BngScopedNav_default),{type:unref(SCOPED_NAV_TYPES).normal}]])]),createBaseVNode(`div`,_hoisted_25$2,[createVNode(BlurBackground_default),unref(button)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`action-button`,accent:unref(ACCENTS).custom,onClick:_cache[2]||=()=>unref(handleButtonClick)(unref(button).meta.buttonId),"bng-scoped-nav-autofocus":``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_26$1,[unref(button).meta.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(button).meta.icon,class:`button-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(unref(button).meta.label),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default)]]):(openBlock(),createElementBlock(`div`,_hoisted_27$1,[createVNode(unref(bngIcon_default),{type:`play`,class:`placeholder-icon`}),_cache[12]||=createBaseVNode(`p`,{class:`placeholder-text`},`Select location and vehicle to start`,-1)]))])])),[[unref(BngScopedNav_default),{canDeactivate:()=>!1,activateOnMount:!0}],[unref(BngOnUiNav_default),unref(goBack),`back,menu`]])])]),_:1})),[[unref(BngOnUiNav_default),unref(goBack),`back,menu`]])}},FreeroamConfigurator_default=__plugin_vue_export_helper_default(_sfc_main$127,[[`__scopeId`,`data-v-14f15b24`]]),_hoisted_1$114={class:`options-panel-content`},_hoisted_2$94={class:`header-row`},_hoisted_3$82={key:0,class:`options-scope`},_hoisted_4$62={key:0,class:`section-header`},_hoisted_5$52={class:`option-label`},_hoisted_6$39={key:1,class:`placeholder-content`},_sfc_main$126={__name:`OptionsPanel`,props:{options:{type:Array,default:()=>[]},hasOptions:{type:Boolean,default:!1},canConfigureOptions:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$114,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_2$94,[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Options `,-1)]]),_:1})]),createBaseVNode(`div`,{class:normalizeClass([`section-content`,{disabled:!__props.canConfigureOptions}])},[__props.hasOptions?(openBlock(),createElementBlock(`div`,_hoisted_3$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.options,group=>(openBlock(),createElementBlock(`div`,{class:`config-group`,key:group.name},[group.name?(openBlock(),createElementBlock(`div`,_hoisted_4$62,[createVNode(unref(bngCardHeading_default),{outline:!group.enabled,type:`ribbon`,class:`section-title`},{default:withCtx(()=>[group.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:0,class:`group-switch`,modelValue:group.value,"onUpdate:modelValue":[$event=>group.value=$event,group.onChange],label:group.name,labelBefore:``,inline:``,alwaysTransparent:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):createCommentVNode(``,!0)]),_:2},1032,[`outline`])])):createCommentVNode(``,!0),group.enabled?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(group.options,(option,optionIndex)=>(openBlock(),createElementBlock(`div`,{class:`config-item`,key:option.key},[createBaseVNode(`div`,{class:normalizeClass([`option-row`,{disabled:option.disabled}])},[createBaseVNode(`label`,_hoisted_5$52,[option.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:option.icon,class:`option-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(option.label),1)]),option.type===`select`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,"onUpdate:modelValue":[$event=>option.value=$event,option.onChange],items:option.options||[],threshold:80},null,8,[`modelValue`,`onUpdate:modelValue`,`items`])):option.type===`switch`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,modelValue:option.value,"onUpdate:modelValue":[$event=>option.value=$event,option.onChange],label:option.label,labelBefore:``},null,8,[`modelValue`,`onUpdate:modelValue`,`label`])):option.type===`string`?(openBlock(),createBlock(unref(bngInput_default),{key:2,modelValue:option.value,"onUpdate:modelValue":$event=>option.value=$event,placeholder:option.placeholder,"char-max":option.maxLength,onValueChanged:option.onChange},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`,`char-max`,`onValueChanged`])):option.type===`number`?(openBlock(),createBlock(unref(bngInput_default),{key:3,modelValue:option.value,"onUpdate:modelValue":$event=>option.value=$event,type:`number`,"num-min":option.min,"num-max":option.max,"num-step":option.step,onValueChanged:option.onChange},null,8,[`modelValue`,`onUpdate:modelValue`,`num-min`,`num-max`,`num-step`,`onValueChanged`])):createCommentVNode(``,!0)],2)]))),128)):createCommentVNode(``,!0)]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_6$39,[createVNode(unref(bngIcon_default),{type:`adjust`,class:`placeholder-icon`}),_cache[1]||=createBaseVNode(`p`,{class:`placeholder-text`},`No options available`,-1)]))],2),renderSlot(_ctx.$slots,`buttons`,{},void 0,!0)])),[[unref(BngBlur_default)]])}},OptionsPanel_default=__plugin_vue_export_helper_default(_sfc_main$126,[[`__scopeId`,`data-v-c933da42`]]),_hoisted_1$113={class:`icon-wrapper`},_sfc_main$125={__name:`wizardStepButton`,props:{first:{type:Boolean,default:!1},title:{type:String,required:!0},tooltip:{type:String},active:{type:Boolean,default:!1},completed:{type:Boolean,default:!1},preview:{type:String,default:``},icon:{type:String,default:``},ratio:{type:String,default:`2:1`},showPaintTile:{type:Boolean,default:!1},paintId:{type:String,default:``},paints:{type:Array,default:()=>[]},paintName:{type:String,default:``},paintWidth:{type:Number,default:45},paintHeight:{type:Number,default:20}},emits:[`activate`],setup(__props,{emit:__emit}){let emit$1=__emit;function handleActivate(){emit$1(`activate`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`step-tab`,{"first-tab":__props.first,"active-tab":__props.active,"completed-tab":__props.completed,"no-thumbnail":!__props.preview}]),onClick:handleActivate},[createBaseVNode(`div`,_hoisted_1$113,[createVNode(unref(bngIcon_default),{class:`step-icon`,type:__props.icon},null,8,[`type`])]),__props.preview?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`thumbnail-image`,ratio:__props.ratio,"external-image":__props.preview},{default:withCtx(()=>[renderSlot(_ctx.$slots,`overlay`,{},void 0,!0),__props.showPaintTile&&__props.paints&&__props.paints.length>0?(openBlock(),createBlock(unref(bngPaintTile_default),{key:0,"paint-id":__props.paintId,paint:__props.paints,"paint-name":__props.paintName,width:__props.paintWidth,height:__props.paintHeight,onClick:handleActivate,class:`preview-paint-tile`,"bng-no-nav":`true`,tabindex:`-1`},null,8,[`paint-id`,`paint`,`paint-name`,`width`,`height`])):createCommentVNode(``,!0)]),_:3},8,[`ratio`,`external-image`])):createCommentVNode(``,!0)],2)),[[unref(BngOnUiNav_default),handleActivate,`ok`,{focusRequired:!0}],[unref(BngTooltip_default),__props.tooltip,`bottom`]])}},wizardStepButton_default=__plugin_vue_export_helper_default(_sfc_main$125,[[`__scopeId`,`data-v-475a9f52`]]),_hoisted_1$112={class:`configurator-heading`},_hoisted_2$93={class:`configurator-body`},_hoisted_3$81={key:0,class:`grid-section`},_hoisted_4$61={key:1,class:`option-summary-panel`},_hoisted_5$51={class:`section-header`},_hoisted_6$38={class:`section-title-value`},_hoisted_7$32={class:`section-content`},_hoisted_8$25={key:0,class:`clickable`},_hoisted_9$22={key:1,class:`placeholder-content`},_hoisted_10$16={class:`section-header`},_hoisted_11$14={class:`section-title-value`},_hoisted_12$10={class:`section-content`},_hoisted_13$9={key:0,class:`clickable`},_hoisted_14$9={key:1,class:`placeholder-content`},_hoisted_15$9={class:`configurator-heading`},_hoisted_16$9={key:0,class:`error-state`},_hoisted_17$8={class:`error-content`},_hoisted_18$6={key:1,class:`configurator-sections`},_hoisted_19$4={class:`steps-container`},_hoisted_20$4={class:`background-bar`},_hoisted_21$4={class:`label`},_hoisted_22$4={class:`hold-binding`},WIZARD_SCOPE_ID=`freeroam-wizard`,_sfc_main$124={__name:`FreeroamWizard`,props:{step:{type:String,default:``},pathMatch:{type:[String,Array],default:``},itemDetails:{type:[String,Array],default:``}},setup(__props){let{lua,events:events$3}=useBridge(),router$1=useRouter(),scopedNav=useScopedNav(),steps={level:{title:`Location`,backendName:`freeroamSelector`,path:`/freeroam-wizard/level`,defaultPath:{keys:[`allFreeroam`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`,`advanced`]},vehicle:{title:`Vehicle`,backendName:`vehicleSelector`,path:`/freeroam-wizard/vehicle`,defaultPath:{keys:[`allModels`]},defaultDetailsMode:`detail`,hiddenTabs:[`advanced`]},options:{title:`Options`,path:`/freeroam-wizard/options`}},stepCompleted=computed(()=>({level:props.step===`vehicle`||props.step===`options`,vehicle:props.step===`options`,options:!1})),gridSelectorProps=computed(()=>{let stepConfig=steps[props.step];return stepConfig&&stepConfig.backendName&&stepConfig.path?{backendName:stepConfig.backendName,routePath:stepConfig.path,defaultPath:stepConfig.defaultPath||{keys:[]},defaultDetailsMode:stepConfig.defaultDetailsMode||`detail`,hiddenTabs:stepConfig.hiddenTabs||[]}:null}),props=__props,gridSelectorRef=ref(null),holdBindingRef=ref(null),isLoading=ref(!1),breadcrumbItems=computed(()=>{let items$2=[{label:`Menu`,gotoAngularState:`menu.mainmenu`},{label:`Freeroam Configurator`,dividerType:`arrowSmallRight`}];props.step===`level`?items$2.push({label:`Location`,click:()=>{onSpawnPointTileClick(!0)}}):props.step===`vehicle`?items$2.push({label:`Vehicle`,click:()=>{onVehicleTileClick(!0)}}):props.step===`options`&&items$2.push({label:`Options`,click:onOptionsTileClick});let screenHeaderPath=gridSelectorRef.value?.screenHeaderPath,pathValue=screenHeaderPath?.value||screenHeaderPath;return pathValue&&Array.isArray(pathValue)&&pathValue.length>2&&(pathValue.length>3?(items$2.push({label:pathValue[2].label,click:()=>{gridSelectorRef.value.setCurrentPath({keys:pathValue[2].gotoPath}),onSpawnPointTileClick()}}),items$2.push(pathValue[3])):items$2.push(pathValue[2])),items$2}),{configData,button,error,hasOptions,hasSpawnPoint,hasVehicle,canConfigureOptions,initialize,handleButtonClick,selectSpawnPoint,selectVehicle,gotoHeaderItem,loadConfiguration}=useFreeroamConfigurator();watch(()=>props.step,step=>{step===`options`&&(loadConfiguration(),scopedNav.resumeScope(WIZARD_SCOPE_ID))});let overrideSelectItem=async(step,...args)=>{if(props.step===`level`){let item=args[0];if(!item?.showDetails?.levelName)return logger_default.error(`overrideSelectItem: Invalid item data for level selection`),null;await selectSpawnPoint(item.showDetails.levelName,item.showDetails.spawnPointObjectName,item.key)&&router$1.push(steps.vehicle.path)}else if(props.step===`vehicle`){let item=args[0];if(!item?.showDetails?.model||!item?.showDetails?.config)return logger_default.error(`overrideSelectItem: Invalid item data for vehicle selection`),null;let selectedPaint=args[1],selectedMultiPaint=args[2],additionalData={};selectedMultiPaint?.paintNames?(additionalData.paint=selectedMultiPaint.paintNames[0],additionalData.paint2=selectedMultiPaint.paintNames[1],additionalData.paint3=selectedMultiPaint.paintNames[2]):selectedPaint?.name&&(additionalData.paint=selectedPaint.name),await selectVehicle(item.showDetails.model,item.showDetails.config,additionalData,item.key)&&router$1.push(steps.options.path)}return null},onSelectCallback=async(item,doNavigation)=>{if(doNavigation){if(props.step===`level`){if(!item?.doubleClickDetails?.levelName)return logger_default.error(`overrideSelectItem: Invalid item data for level selection`),null;await selectSpawnPoint(item.doubleClickDetails.levelName,item.doubleClickDetails.spawnPointObjectName,item.key)}else if(props.step===`vehicle`){if(!item?.doubleClickDetails?.model||!item?.doubleClickDetails?.config)return logger_default.error(`overrideSelectItem: Invalid item data for vehicle selection`),null;await selectVehicle(item.doubleClickDetails.model,item.doubleClickDetails.config,{},item.key)}}return null},doubleClickOverride=async item=>{if(!item?.doubleClickDetails){logger_default.error(`doubleClickOverride: Invalid item data`);return}let details=item.doubleClickDetails;details.levelName?await selectSpawnPoint(details.levelName,details.spawnPointObjectName,item.key)&&router$1.push(steps.vehicle.path):details.model&&details.config&&await selectVehicle(details.model,details.config,{},item.key)&&router$1.push(steps.options.path)},goBack=()=>{logger_default.debug(`goBack called`);let gridSelectorPath=gridSelectorRef.value?.screenHeaderPath;props.step===`level`?gridSelectorPath&&gridSelectorPath.length>2?onSpawnPointTileClick():window.bngVue.gotoAngularState(`menu.mainmenu`):props.step===`vehicle`?gridSelectorPath&&gridSelectorPath.length>2?onVehicleTileClick():onSpawnPointTileClick():props.step===`options`&&onVehicleTileClick()},onSpawnPointTileClick=async()=>{router$1.replace(steps.level.path)},onVehicleTileClick=async(clearSearch=!1)=>{clearSearch&&gridSelectorRef.value&&(gridSelectorRef.value.clearSearch(),gridSelectorRef.value.clearFilters()),router$1.replace(steps.vehicle.path)},onOptionsTileClick=async()=>{router$1.replace(steps.options.path)},onStartButtonClick=async buttonId=>{isLoading.value=!0,events$3.emit(`LoadingScreen`,{active:!0}),await startLoading$1(async()=>{await waitForLoadingScreenFadeIn$1(),await handleButtonClick(buttonId)})};function convertPaintToTileFormat(paint){if(!paint)return null;if(paint.baseColor&&paint.paintString)return paint;try{let paintObj=new Paint;return paintObj.paint=paint,paintObj.paintObject}catch(error$1){return console.warn(`Failed to convert paint:`,paint,error$1),null}}let vehiclePaintData=computed(()=>{let vehicle=configData.value?.currentVehicle;if(!vehicle?.additionalData?.paint||!vehicle?.paints?.factoryPaints)return null;let additionalData=vehicle.additionalData,factoryPaints=vehicle.paints.factoryPaints,paintNames=[additionalData.paint,additionalData.paint2,additionalData.paint3].filter(name=>name),paints=paintNames.map(name=>{let paint=factoryPaints.find(p$1=>p$1.name===name);return paint?convertPaintToTileFormat(paint):null}).filter(paint=>paint!==null);return paints.length===0?null:{paint:paintNames[0],paintNames,paints}});return onBeforeMount(()=>{lua.simTimeAuthority.pushPauseRequest(`freeroamConfigurator`)}),onMounted(()=>{initialize()}),onUnmounted(()=>{lua.simTimeAuthority.popPauseRequest(`freeroamConfigurator`)}),(_ctx,_cache)=>(openBlock(),createBlock(unref(layoutSingle_default),{class:`freeroam-configurator`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`configurator-content`,{"options-step":__props.step===`options`}])},[createBaseVNode(`div`,_hoisted_1$112,[withDirectives(createVNode(unref(bngBreadcrumbs_default),{class:`configurator-breadcrumbs`,simple:``,"show-back-button":``,"disable-last-item":``,onBack:goBack,onClick:unref(gotoHeaderItem),limit:`15`,items:breadcrumbItems.value},null,8,[`onClick`,`items`]),[[unref(BngBlur_default)]])]),createBaseVNode(`div`,_hoisted_2$93,[__props.step!==`options`&&gridSelectorProps.value?(openBlock(),createElementBlock(`div`,_hoisted_3$81,[(openBlock(),createBlock(GridSelector_default,{ref_key:`gridSelectorRef`,ref:gridSelectorRef,key:`grid-selector-${__props.step}`,"backend-name":gridSelectorProps.value.backendName,"route-path":gridSelectorProps.value.routePath,"default-path":gridSelectorProps.value.defaultPath,"default-details-mode":gridSelectorProps.value.defaultDetailsMode,"hidden-tabs":gridSelectorProps.value.hiddenTabs,"no-breadcrumbs":``,"select-callback":onSelectCallback,"double-click-override":doubleClickOverride,"override-back-from-grid":goBack,"inline-header-container":``,"bubble-events":[`ok`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[__props.step===`level`?(openBlock(),createBlock(GameplayDetails_default,{key:0,activeItem,activeItemDetails,toggleFavourite,exploreFolder,goToMod,buttonOverride:{icon:`fastTravel`,label:`Next Step`,click:(...args)=>overrideSelectItem(`level`,...args)},showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`toggleFavourite`,`exploreFolder`,`goToMod`,`buttonOverride`])):createCommentVNode(``,!0),__props.step===`vehicle`?(openBlock(),createBlock(VehicleDetails_default,{key:1,activeItem,activeItemDetails,toggleFavourite,exploreFolder,goToMod,buttonOverride:{icon:`fastTravel`,label:`Next Step`,click:(...args)=>overrideSelectItem(`vehicle`,...args)},showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`toggleFavourite`,`exploreFolder`,`goToMod`,`buttonOverride`])):createCommentVNode(``,!0)]),_:1},8,[`backend-name`,`route-path`,`default-path`,`default-details-mode`,`hidden-tabs`]))])):createCommentVNode(``,!0),__props.step===`options`&&unref(configData)?(openBlock(),createElementBlock(`div`,_hoisted_4$61,[withDirectives((openBlock(),createElementBlock(`div`,{class:`config-section selectable-component`,onClick:onSpawnPointTileClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_5$51,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[1]||=createBaseVNode(`span`,{class:`section-title-label`},`Location:`,-1),createBaseVNode(`span`,_hoisted_6$38,toDisplayString(unref(configData)?.currentSpawnPoint?.headerTitle||`Select location...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_7$32,[createBaseVNode(`div`,null,[unref(configData)?.currentSpawnPoint?(openBlock(),createElementBlock(`div`,_hoisted_8$25,[createVNode(GameplayDetails_default,{"active-item":{levelName:unref(configData).currentSpawnPoint.levelName,spawnPointObjectName:unref(configData).currentSpawnPoint.spawnPointObjectName},"active-item-details":unref(configData).currentSpawnPoint,inline:``,"show-header-title":!1},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_9$22,[createVNode(unref(bngIcon_default),{type:`road`,class:`placeholder-icon`}),_cache[2]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select location`,-1)]))])])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`config-section selectable-component`,onClick:onVehicleTileClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_10$16,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`section-title`},{default:withCtx(()=>[_cache[3]||=createBaseVNode(`span`,{class:`section-title-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_11$14,toDisplayString(unref(configData)?.currentVehicle?.headerTitle||`Select vehicle...`),1)]),_:1})]),createBaseVNode(`div`,_hoisted_12$10,[createBaseVNode(`div`,null,[unref(configData)?.currentVehicle?(openBlock(),createElementBlock(`div`,_hoisted_13$9,[createVNode(VehicleDetails_default,{"active-item":{model:unref(configData).currentVehicle.model,config:unref(configData).currentVehicle.config},"active-item-details":unref(configData).currentVehicle,"hide-details-and-buttons":``,inline:``,"show-header-title":!1},null,8,[`active-item`,`active-item-details`])])):(openBlock(),createElementBlock(`div`,_hoisted_14$9,[createVNode(unref(bngIcon_default),{type:`car`,class:`placeholder-icon`}),_cache[4]||=createBaseVNode(`p`,{class:`placeholder-text`},`Click to select vehicle`,-1)]))])])])),[[unref(BngBlur_default)]]),withDirectives(createVNode(OptionsPanel_default,{class:`config-section`,options:unref(configData)?.options||[],"has-options":unref(hasOptions),"can-configure-options":unref(canConfigureOptions)},null,8,[`options`,`has-options`,`can-configure-options`]),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),goBack,`menu`]])])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$9,[unref(error)?(openBlock(),createElementBlock(`div`,_hoisted_16$9,[createVNode(BlurBackground_default),createBaseVNode(`div`,_hoisted_17$8,[createVNode(unref(bngIcon_default),{type:`warning`,class:`error-icon`}),_cache[6]||=createBaseVNode(`p`,null,`Failed to load configuration`,-1),createVNode(unref(bngButton_default),{onClick:unref(initialize),accent:unref(ACCENTS).secondary},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Retry`,-1)]]),_:1},8,[`onClick`,`accent`])])])):(openBlock(),createElementBlock(`div`,_hoisted_18$6,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_19$4,[createBaseVNode(`div`,_hoisted_20$4,[createVNode(BlurBackground_default)]),createVNode(wizardStepButton_default,{first:``,active:__props.step===`level`,completed:stepCompleted.value.level,title:`Location`,tooltip:unref(configData)?.currentSpawnPoint?.headerTitle,preview:unref(configData)?.currentSpawnPoint?.preview,icon:`road`,onActivate:onSpawnPointTileClick},null,8,[`active`,`completed`,`tooltip`,`preview`]),createVNode(wizardStepButton_default,{active:__props.step===`vehicle`,completed:stepCompleted.value.vehicle,title:`Vehicle`,tooltip:unref(configData)?.currentVehicle?.headerTitle,preview:unref(configData)?.currentVehicle?.preview,icon:`car`,"show-paint-tile":!!vehiclePaintData.value,"paint-id":`${unref(configData)?.currentVehicle?.key||`vehicle`}:${vehiclePaintData.value?.paint}`,paints:vehiclePaintData.value?.paints||[],"paint-name":vehiclePaintData.value?vehiclePaintData.value.paintNames.join(`, `):``,onActivate:onVehicleTileClick},null,8,[`active`,`completed`,`tooltip`,`preview`,`show-paint-tile`,`paint-id`,`paints`,`paint-name`]),createVNode(wizardStepButton_default,{active:__props.step===`options`,completed:stepCompleted.value.options,title:`Options`,tooltip:`Options`,icon:`adjust`,onActivate:onOptionsTileClick},null,8,[`active`,`completed`])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`play-button`,onClick:_cache[0]||=$event=>onStartButtonClick(unref(button)?.meta?.buttonId),"bng-nav-item":``,tabindex:`1`},[_cache[8]||=createBaseVNode(`div`,{class:`background`},null,-1),createBaseVNode(`div`,_hoisted_21$4,[withDirectives(createBaseVNode(`div`,_hoisted_22$4,[createVNode(unref(bngBinding_default),{ref_key:`holdBindingRef`,ref:holdBindingRef,class:`binding`,"ui-event":`ok`,controller:``},null,512),_cache[7]||=createBaseVNode(`svg`,{class:`hold-arrow`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 12`,preserveAspectRatio:`xMidYMid`},[createBaseVNode(`path`,{d:`M1,1 L8,2 L16,1 L8,11 z`})],-1)],512),[[vShow,holdBindingRef.value?.displayed]]),createTextVNode(` `+toDisplayString(unref(button)?.meta?.label||`Start`),1)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`]])]))])],2)),[[unref(BngScopedNav_default),{scopeId:WIZARD_SCOPE_ID,canDeactivate:()=>!1,activateOnMount:!0,bubbleBlacklistEvents:[`back`,`menu`]}],[unref(BngClick_default),{holdCallback:()=>onStartButtonClick(unref(button)?.meta?.buttonId),holdDelay:2e3,repeatInterval:0},void 0,{controller:!0}],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0}]])]),_:1}))}},FreeroamWizard_default=__plugin_vue_export_helper_default(_sfc_main$124,[[`__scopeId`,`data-v-6c942499`]]),routes_default$5=[{name:`menu.freeroamselector`,path:`/freeroam-selector/:pathMatch(.*)*/:itemDetails(.*)*`,component:FreeroamSelector_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.freeroamconfigurator`,path:`/freeroam-configurator`,component:FreeroamConfigurator_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!1}}},{name:`menu.freeroamWizard`,path:`/freeroam-wizard/:step/:pathMatch(.*)*/:itemDetails(.*)*`,component:FreeroamWizard_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!1}}}],_sfc_main$123={__name:`GameplaySelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`gameplaySelector`,routePath:`/gameplay-selector`,defaultPath:{keys:[`allGameplay`]},defaultDetailsMode:`detail`,hiddenTabs:[`filter`]},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod})=>[createVNode(GameplayDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite,exploreFolder,goToMod,showHeaderTitle:!0},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`,`exploreFolder`,`goToMod`])]),_:1}))}},GameplaySelector_default=_sfc_main$123,routes_default$6=[{name:`menu.gameplayselector`,path:`/gameplay-selector/:pathMatch(.*)*`,component:GameplaySelector_default,props:!0,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}}],_hoisted_1$111={key:0,class:`garage-button-content`},_sfc_main$122={__name:`GarageButton`,props:{icon:[Object,String],externalIcon:String,disabled:Boolean,active:Boolean,type:{type:String,validator:val=>[`drawer-toggle`,`drawer-button`,``].includes(val)||val===void 0}},setup(__props){let props=__props,slots=useSlots(),hasContent=computed(()=>slots.default),showContent=computed(()=>hasContent.value&&!(props.type===`drawer-toggle`&&!props.active)),btnRef=ref(null);return onUpdated(()=>ensureFocus(btnRef.value?.getElement?.())),(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),mergeProps({ref_key:`btnRef`,ref:btnRef,accent:unref(ACCENTS).custom,disabled:__props.disabled,icon:__props.icon,externalIcon:__props.externalIcon,class:[`garage-button`,{[`garage-button-${__props.type}`]:!!__props.type,"garage-button-with-content":hasContent.value,"garage-button-active":__props.active}]},_ctx.$attrs),{default:withCtx(()=>[showContent.value?(openBlock(),createElementBlock(`div`,_hoisted_1$111,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):createCommentVNode(``,!0)]),_:3},16,[`accent`,`disabled`,`icon`,`externalIcon`,`class`]))}},GarageButton_default=__plugin_vue_export_helper_default(_sfc_main$122,[[`__scopeId`,`data-v-8b374028`]]),_hoisted_1$110={class:`paint-preview`},_hoisted_2$92=[`onClick`],_hoisted_3$80={key:0,class:`empty-slot-indicator`},refpad=25,_sfc_main$121={__name:`PaintPreview`,props:{paints:Array,paintNames:{type:Array,default:()=>[]}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,previews=computed(()=>{let res=[];if(!props.paints||!Array.isArray(props.paints))return res;let paints=props.paints,len=paints.length;for(let idx=0;idx1?refpad+(100-refpad*2)/(len-1)*idx:50}%`,"--paint-color":isEmpty?`rgba(128, 128, 128, 0.3)`:`rgb(${paint.rgb255.join(`, `)})`,"--paint-metallic":isEmpty?0:Math.max(0,paint.metallic-paint.roughness/.5),"--paint-roughness":isEmpty?1:paint.roughness,"--paint-clearcoat":isEmpty?0:paint.clearcoat,"--paint-clearcoat-roughness":isEmpty?0:paint.clearcoatRoughness,isEmpty,tooltipText};res.push(vars)}return res});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$110,[(openBlock(!0),createElementBlock(Fragment,null,renderList(previews.value,(preview,idx)=>withDirectives((openBlock(),createElementBlock(`div`,{key:idx,class:normalizeClass([`paint-preview-item`,{"empty-slot":preview.isEmpty}]),style:normalizeStyle(preview),onClick:$event=>preview.isEmpty?null:emit$1(`select`,idx)},[_cache[0]||=createStaticVNode(`
`,5),preview.isEmpty?(openBlock(),createElementBlock(`div`,_hoisted_3$80)):createCommentVNode(``,!0)],14,_hoisted_2$92)),[[unref(BngTooltip_default),preview.tooltipText,`bottom`]])),128))]))}},PaintPreview_default=__plugin_vue_export_helper_default(_sfc_main$121,[[`__scopeId`,`data-v-38e5e63f`]]),_hoisted_1$109={class:`paint-preview-container`},_hoisted_2$91={class:`multi-paint-setups-content`},_hoisted_3$79={key:0},colorDefault=`1 1 1 1 0 1 1 0`,previewAnimTime=400,_sfc_main$120={__name:`Paint`,props:{withBackground:Boolean,tabbed:{type:Boolean,default:!0},legacy:{type:Boolean,default:!0}},setup(__props){useUINavBlocker().blockOnly([`context`]);let paintPreviews=usePaintPreviews(),props=__props,events$3=useEvents(),configId=ref(`none`),vehiclePaintPresets=ref({}),multiPaintSetups=ref({}),tabsState=ref([!0,!1,!1]);function tabExpand(idx){for(let i=0;i{tabsState.value[idx]=!0})}let color=ref([colorDefault,colorDefault,colorDefault]),updateColor=(index,preview=!0)=>nextTick(()=>{Lua_default.core_vehicle_colors.setVehicleColor(index,color.value[index]),paints[index].paint=color.value[index],preview&&updatePaint(index)});function resetScroll(){let elm=document.activeElement.closest(`.bng-accitem-content`);elm&&(elm.scrollTop=0)}let paints=Array.from({length:color.value.length},()=>reactive(new Paint({legacy:props.legacy}))),paintImgs=ref(Array(color.value.length).fill(null)),previewStyles=ref(Array(color.value.length).fill(null).map(()=>({"--paint-url":`none`,"--paint-prev-url":`none`,"--paint-prev-transition":`none`,"--paint-prev-opacity":0}))),previewAnimating=Array(color.value.length).fill(0),updatePaintPreview=async(index,url)=>{if(previewAnimating[index]===1)for(previewAnimating[index]=-1;previewAnimating[index]===-1;)await sleep(50);if(previewAnimating[index]=1,previewStyles.value[index][`--paint-prev-transition`]=`none`,paintImgs.value[index]=url,previewAnimTime===0){if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-url`]=`url(${url})`,previewAnimating[index]=0;return}let currentUrl=previewStyles.value[index][`--paint-url`];if(currentUrl===`none`||!currentUrl){if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-url`]=`url(${url})`,previewAnimating[index]=0;return}previewStyles.value[index][`--paint-prev-url`]=currentUrl,previewStyles.value[index][`--paint-url`]=`url(${url})`,previewStyles.value[index][`--paint-prev-opacity`]=1,previewStyles.value[index][`--paint-prev-transition`]=`none`,requestAnimationFrame(()=>{if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-prev-transition`]=`opacity ${previewAnimTime}ms ease-in-out`,previewStyles.value[index][`--paint-prev-opacity`]=0,setTimeout(()=>{if(previewAnimating[index]===-1)return previewAnimating[index]=0;previewStyles.value[index][`--paint-prev-transition`]=`none`,previewAnimating[index]=0},previewAnimTime)})},updatePaint=debounce(async index=>{let paintData=color.value[index];paintPreviews.getBlobPreview(paintData,{paintId:`${configId.value}:single-${index}`,width:80,height:24}).then(url=>{url&&updatePaintPreview(index,url)}).catch(()=>{})},30),updateAllPaints=async()=>{let urls=await Promise.all(paints.map(async(paint,idx)=>await paintPreviews.getBlobPreview(paint.paint,{paintId:`${configId.value}:single-${idx}`,width:80,height:24})));for(let i=0;i{let res=[];for(let i=0;ivehiclePaintPresets.value[name]);res.push({id:paintNames.join(`|`),name:setup$3.name,paintNames,paints:paints$1,apply:idx=>applyMultipaint(setup$3,idx)})}return res});function applyMultipaint(setup$3,index=-1){console.log(`applyMultipaint`,index);let paintNames=[setup$3.paintName1,setup$3.paintName2,setup$3.paintName3];for(let i=0;i-1&&i!==index)continue;let paintName=paintNames[i];if(paintName&&paintName.trim()!==``&&vehiclePaintPresets.value[paintName]){let paintData=vehiclePaintPresets.value[paintName],paint=new Paint({legacy:props.legacy});paint.paint=paintData,color.value[i]=paint.paintString,updateColor(i,!1)}}nextTick(updateAllPaints)}async function fetchDefinedColors(){for(let i=0;i__props.tabbed?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`paint-acc-wrapper`,{"with-background":__props.withBackground}])},[createBaseVNode(`div`,_hoisted_1$109,[createVNode(PaintPreview_default,{paints:unref(paints),onSelect:tabExpand},null,8,[`paints`])]),withDirectives((openBlock(),createBlock(unref(accordion_default),{class:`paint-acc-container`,singular:``},{default:withCtx(()=>[createVNode(unref(accordionItem_default),{key:`multi-paint-setups`,class:`paint-acc-content`,navigable:``},{caption:withCtx(()=>[..._cache[0]||=[createTextVNode(` Multi Paint Setups `,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$91,[(openBlock(!0),createElementBlock(Fragment,null,renderList(multipaint.value,paint=>(openBlock(),createBlock(unref(bngPaintTile_default),{key:paint.name,class:`multi-paint-setup-item`,"paint-id":`${configId.value}:${paint.id}`,paint:paint.paints,"paint-name":paint.name,"paint-names":paint.paintNames,width:72,height:24,"with-menu":``,onClick:paint.apply,onMenuClick:paint.apply},null,8,[`paint-id`,`paint`,`paint-name`,`paint-names`,`onClick`,`onMenuClick`]))),128))])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(color.value.length,idx=>(openBlock(),createBlock(unref(accordionItem_default),{key:idx,class:`paint-acc-content`,navigable:``,expanded:tabsState.value[idx-1],style:normalizeStyle(previewStyles.value[idx-1])},{caption:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.trackBuilder.matEditor.paint`)+` `+idx),1)]),default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,{class:`paint-picker-wrapper`,onDeactivate:resetScroll},[createVNode(PaintPicker_default,{class:`paint-picker`,"picker-mode":`compact_luminosity`,modelValue:color.value[idx-1],"onUpdate:modelValue":$event=>color.value[idx-1]=$event,onChange:$event=>updateColor(idx-1),"show-preview":!1,"presets-editable":``,presets:vehiclePaintPresets.value,legacy:__props.legacy},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`,`presets`,`legacy`])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]])]),_:2},1032,[`expanded`,`style`]))),128))]),_:1})),[[unref(BngBlur_default),__props.withBackground]])],2)):withDirectives((openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`paint-container`,{"with-background":__props.withBackground}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(color.value.length,idx=>(openBlock(),createBlock(PaintPicker_default,{key:idx,modelValue:color.value[idx-1],"onUpdate:modelValue":$event=>color.value[idx-1]=$event,onChange:$event=>updateColor(idx-1),"show-preview":!1,"presets-editable":``,presets:vehiclePaintPresets.value,legacy:__props.legacy},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.trackBuilder.matEditor.paint`))+` `+toDisplayString(idx),1)]),_:2},1032,[`modelValue`,`onUpdate:modelValue`,`onChange`,`presets`,`legacy`]))),128)),color.value.length%2==1?(openBlock(),createElementBlock(`div`,_hoisted_3$79)):createCommentVNode(``,!0)],2)),[[unref(BngBlur_default),__props.withBackground]])}},Paint_default=__plugin_vue_export_helper_default(_sfc_main$120,[[`__scopeId`,`data-v-956741b3`]]),rgxWheel=/^(\d+(?:\.\d+)?)(x)(\d+(?:\.\d+)?)/i,rgxTire=/^(\d+(?:\.\d+)?)(\/)(\d+(?:\.\d+)?)(R)(\d+(?:\.\d+)?)/i,rgxNum=/(^| )(\d+)($| )/,zeroPad=num=>String(~~(num*1e3)).padStart(10,`0`);function partOptionSorter(...ab){let cmp=[``,``];for(let i=0;i<2;i++){let label=ab[i].label;if(typeof label!=`string`)return 0;rgxWheel.test(label)?cmp[i]=label.replace(rgxWheel,(_,a$1,s,b)=>[a$1,b].map(zeroPad).join(`x`)):rgxTire.test(label)?cmp[i]=label.replace(rgxTire,(_,a$1,s1,b,s2,c)=>[a$1,b,c].map(zeroPad).join(`x`)):rgxNum.test(label)?cmp[i]=label.replace(rgxNum,(_,a$1,num,b)=>a$1+zeroPad(num)+b):cmp[i]=label,label.startsWith(`40x4`)&&console.log(cmp[i])}return cmp[0].localeCompare(cmp[1])}function partOptionGrouper(list){let seq=[],groups={},grouping=!1;for(let itm of list){let group,match=itm.label.match(rgxWheel)||itm.label.match(rgxTire);group=match&&match.length>0?match.slice(1).map(s=>s===`R`?s:s+` `).join(``).trim():itm.label,groups[group]?grouping=!0:(groups[group]=[],seq.push(group)),groups[group].push(itm)}if(!grouping)return list;let res=[];for(let group of seq){let list$1=groups[group];list$1.length===1?res.push(...list$1):(res.push({label:group,group:!0}),res.push(...list$1.map(itm=>({...itm,grouped:!0}))))}return res}var _hoisted_1$108={key:1},_sfc_main$119={__name:`PartsBranch`,props:{rootSlot:Boolean,children:Object,child:Object,info:Object,treeState:Object,treeStateKey:String,flatEntry:Boolean,displayNames:Boolean,showAuxiliary:Boolean,separateSort:Boolean,alwaysSort:Boolean,showEmpty:Boolean,highlighter:[String,Array,RegExp]},emits:[`select`,`deselect`,`highlight`,`change`,`dropdown`],setup(__props,{emit:__emit}){let props=__props,accordionItem=ref(),partsDropdown=ref(),openPartsDropdown=()=>partsDropdown.value&&partsDropdown.value.open(),emit$1=__emit,select=(slot,mouse=!1)=>(!props.child||highlightable.value)&&emit$1(`select`,slot,mouse),deselect=(slot,mouse=!1)=>emit$1(`deselect`,slot,mouse),highlight=slot=>emit$1(`highlight`,slot),change=slot=>emit$1(`change`,slot),dropdown=val=>emit$1(`dropdown`,val),focusReturn=()=>nextTick(()=>accordionItem.value.focus()),accItemUnwatch=watch(accordionItem,()=>{let elm=accordionItem.value?.captionElement;elm&&(accItemUnwatch(),elm.partSelect=()=>props.child&&select(props.child))});function toggleHighlight(slot){slot.highlight=!slot.highlight,highlight(slot)}let toggleHighlightCurrent=()=>toggleHighlight(props.child),highlightable=computed(()=>typeof props.child?.highlight==`boolean`),expanded=ref(!1);if(!props.flatEntry){let unwatchTreeState;unwatchTreeState=watch(()=>props.treeState,()=>setTimeout(()=>{unwatchTreeState(),expanded.value=props.treeStateKey&&props.treeState[props.treeStateKey]&&props.treeState[props.treeStateKey]||!1,watch(()=>expanded.value,val=>{props.treeStateKey&&(val?props.treeState[props.treeStateKey]=val:props.treeStateKey in props.treeState&&delete props.treeState[props.treeStateKey])})},50),{immediate:!0})}let childrenSorter=(a$1,b)=>{if(props.separateSort){if(a$1.children&&!b.children)return 1;if(b.children&&!a$1.children)return-1}if(props.displayNames||!props.alwaysSort)return a$1.slotName.localeCompare(b.slotName);{let info=props.info[a$1.parentSlotName]?.slotInfoUi||{};return getSlotName(a$1,info).localeCompare(getSlotName(b,info))}},slotInfo=computed(()=>props.displayNames?{}:props.info[props.child?.parentSlotName]?.slotInfoUi||{}),isCoreSlot=computed(()=>!!props.info[props.child?.parentSlotName]?.slotInfoUi?.[props.child?.slotName]?.coreSlot),getSlotName=(slot,info={})=>props.displayNames?slot.slotName:info[slot.slotName]?.description||slot.slotName,displayName=computed(()=>getSlotName(props.child,slotInfo.value)),hasPartList=computed(()=>{let list=props.child?.suitablePartNames||[];return list.length===0&&(list=props.child?.chosenPartName?[props.child.chosenPartName]:(props.child?.unsuitablePartNames||[]).map(({partName})=>partName)),props.showAuxiliary||(list=list.filter(partName=>!props.info[partName]?.isAuxiliary)),list.length>0}),partsList=computed(()=>{if(!hasPartList.value)return[];let addEmpty=!0,list=props.child?.suitablePartNames||[];list.length===0&&props.child?.chosenPartName&&(list=[props.child.chosenPartName],addEmpty=!1);let unsuitable=(props.child?.unsuitablePartNames||[]).reduce((res,{partName,reason})=>({...res,[partName]:reason}),{});return list.push(...Object.keys(unsuitable)),list.length===0||(list=list.map(partName=>({value:partName,label:(props.info[partName]?.isAuxiliary?`[!] `:``)+(props.displayNames?partName:props.info[partName]?.description||partName),disabled:partName in unsuitable,tooltip:partName in unsuitable?{text:unsuitable[partName],position:`right`}:void 0,isAuxiliary:props.info[partName]?.isAuxiliary})).filter(opt=>!opt.isAuxiliary||props.showAuxiliary||props.child?.chosenPartName===opt.value),!props.showAuxiliary&&list.length===1&&list[0].isAuxiliary&&isCoreSlot.value)?[]:(list.sort(partOptionSorter),list=partOptionGrouper(list),addEmpty&&!isCoreSlot.value&&list.unshift({value:``,label:`Empty`}),list)}),parentAllChildren=computed(()=>props.children?Object.values(props.children||{}):[]),parentHasChildren=computed(()=>parentAllChildren.value.length>0),parentChildren=computed(()=>[...parentAllChildren.value].sort(childrenSorter)),childAllChildren=computed(()=>props.child?.children?Object.values(props.child.children||{}):[]),childHasChildren=computed(()=>childAllChildren.value.length>0),childChildren=computed(()=>[...childAllChildren.value].sort(childrenSorter)),shouldShow=computed(()=>childHasChildren.value||hasPartList.value||props.showEmpty);return(_ctx,_cache)=>__props.treeState&&parentHasChildren.value?(openBlock(),createBlock(unref(accordion_default),{key:0,class:`branch-category`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(parentChildren.value,child=>(openBlock(),createBlock(PartsBranch_default,{key:child.slotName,"root-slot":__props.rootSlot,child,info:__props.info,"tree-state":__props.treeState,"tree-state-key":child.slotName,"display-names":__props.displayNames,"show-auxiliary":__props.showAuxiliary,"separate-sort":__props.separateSort,"always-sort":__props.alwaysSort,"show-empty":__props.showEmpty,"flat-entry":__props.flatEntry,highlighter:__props.highlighter,onSelect:select,onDeselect:deselect,onHighlight:highlight,onChange:change,onDropdown:dropdown},null,8,[`root-slot`,`child`,`info`,`tree-state`,`tree-state-key`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`flat-entry`,`highlighter`]))),128))]),_:1})):__props.treeState&&shouldShow.value?(openBlock(),createBlock(unref(accordionItem_default),{key:1,ref_key:`accordionItem`,ref:accordionItem,static:__props.flatEntry||!childHasChildren.value,expanded:expanded.value,onExpanded:_cache[6]||=$event=>expanded.value=$event,class:normalizeClass({"item-changed":__props.child.changed}),"arrow-big":``,navigable:``,onMouseover:_cache[7]||=withModifiers($event=>select(__props.child,!0),[`stop`]),onMouseleave:_cache[8]||=withModifiers($event=>deselect(__props.child,!0),[`stop`]),onFocusin:_cache[9]||=withModifiers($event=>select(__props.child,!1),[`stop`]),onFocusout:_cache[10]||=withModifiers($event=>deselect(__props.child,!1),[`stop`]),"primary-action":partsList.value.length>0?openPartsDropdown:void 0,"secondary-action":highlightable.value?toggleHighlightCurrent:void 0,"primary-label":`ui.inputActions.menu.menu_item_select.title`,"secondary-label":`ui.vehicleconfig.highlight`,"expand-hint-inline":``,"secondary-hint-inline":``},{caption:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`span`,null,[createTextVNode(toDisplayString(displayName.value),1)])),[[unref(BngHighlighter_default),__props.highlighter]])]),controls:withCtx(()=>[createVNode(unref(bngDropdown_default),{ref_key:`partsDropdown`,ref:partsDropdown,modelValue:__props.child.chosenPartName,"onUpdate:modelValue":_cache[0]||=$event=>__props.child.chosenPartName=$event,items:partsList.value,disabled:!hasPartList.value,highlight:__props.highlighter,"show-search":partsList.value.length>5,"long-names":`cut`,onValueChanged:_cache[1]||=$event=>change(__props.child),onFocus:focusReturn,onOpen:_cache[2]||=$event=>dropdown(!0),onClose:_cache[3]||=$event=>dropdown(!1),"bng-no-nav":``},null,8,[`modelValue`,`items`,`disabled`,`highlight`,`show-search`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).text,class:normalizeClass({"visibility-toggle":!0,"visibility-toggle-on":__props.child.highlight}),icon:__props.child.highlight?unref(icons).eyeSolidOpened:unref(icons).eyeSolidClosed,disabled:!highlightable.value,onClick:_cache[4]||=$event=>toggleHighlight(__props.child),onFocus:_cache[5]||=$event=>accordionItem.value.focus(),"bng-no-nav":``},null,8,[`accent`,`class`,`icon`,`disabled`])]),default:withCtx(()=>[!__props.flatEntry&&__props.treeState&&childHasChildren.value?(openBlock(),createBlock(PartsBranch_default,{key:0,children:childChildren.value,info:__props.info,"tree-state":__props.treeState,"display-names":__props.displayNames,"show-auxiliary":__props.showAuxiliary,"separate-sort":__props.separateSort,"always-sort":__props.alwaysSort,"show-empty":__props.showEmpty,highlighter:__props.highlighter,onSelect:select,onDeselect:deselect,onHighlight:highlight,onChange:change,onDropdown:dropdown},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`highlighter`])):!__props.flatEntry&&__props.treeState?(openBlock(),createElementBlock(`div`,_hoisted_1$108,`—`)):createCommentVNode(``,!0)]),_:1},8,[`static`,`expanded`,`class`,`primary-action`,`secondary-action`])):createCommentVNode(``,!0)}},PartsBranch_default=__plugin_vue_export_helper_default(_sfc_main$119,[[`__scopeId`,`data-v-a5433800`]]),SearchHistory=class{list=[];index=-1;browsing=!1;saveKey=`partSearchHistory`;constructor(search$1){this.search=search$1,this.load()}load(){let res=localStorage.getItem(this.saveKey);res&&(this.list=JSON.parse(res)||[])}save(){localStorage.setItem(this.saveKey,JSON.stringify(this.list))}update(){if(this.search.query.length===0)return;let text=(isRef(this.search.text)?this.search.text.value:this.search.text).trim().replace(/ +/g,` `),textLC=text.toLowerCase(),idx=this.list.findIndex(txt=>textLC===txt.toLowerCase());if(idx>-1){this.index=idx;return}idx=this.list.findIndex(txt=>txt.toLowerCase().startsWith(textLC)),!(idx>-1)&&(idx=this.list.findIndex(txt=>textLC.startsWith(txt.toLowerCase())),idx>-1?(this.list[idx]=text,this.index=idx):(this.index=this.list.length,this.list.push(text)),this.save())}onKeyDown(event){if(this.list.length!==0){switch(event.key){case`ArrowUp`:this.browsing=!0,this.index--;break;case`ArrowDown`:this.browsing=!0,this.index++;break;case`k`:if(event.ctrlKey)console.log(`Search history cleaned`),localStorage.removeItem(`partSearchHistory`),this.list=[],this.index=0,event.preventDefault();else return;default:event.ctrlKey||(this.browsing=!1);return}this.browsing&&(this.index=Math.abs(this.index+this.list.length)%this.list.length,this.search.text=this.list[this.index]),event.preventDefault()}}},isOfficial=info=>info.authors!==`BeamNG`,PartsSearch=class{active=!1;text=ref(``);query={};message=ref(``);highlight=ref([]);minText=3;history=null;currentConfig=[];richPartInfo=[];opts={};constructor(currentConfig,richPartInfo,opts=null){if(!isRef(currentConfig))throw Error(`currentConfig must be ref`);if(!isRef(richPartInfo))throw Error(`richPartInfo must be ref`);this.currentConfig=currentConfig,this.richPartInfo=richPartInfo,opts&&(this.opts=opts),this.history=new SearchHistory(this),this.result=computed(()=>this.generateResult()),this.messages={noResults:$translate.instant(`ui.common.search.noResults`),tooShort:$translate.instant(`ui.common.search.queryTooShort`),invalidFormat:$translate.instant(`ui.common.search.invalidFormat`),unknownArgument:$translate.instant(`ui.common.search.unknownArgument`)}}generateResult(){let queryArgs=this.parseQuery(isRef(this.text)?this.text.value:this.text);if(this.query=queryArgs,this.highlight.value=queryArgs.highlight,!queryArgs.good)return this.message.value=queryArgs.reason,{};this.message.value=``;let res={},currentConfig=isRef(this.currentConfig)?this.currentConfig.value:this.currentConfig,cnt=0,dive=node=>{if(node.children)for(let child of Object.values(node.children)){let match=this.matchSlot(child);match.matched&&(child.search=match,res[child.slotName+`?`+ ++cnt]=child),dive(child)}};return dive(currentConfig),Object.keys(res).length>0?this.history.update():this.message.value=this.messages.noResults,res}parseQuery(text){let queryString=text.trim().toLowerCase().replace(/ +/g,` `),queryArgs={mode:`or`,reason:``,highlight:[]},ignoreKeys=Object.keys(queryArgs);if(queryString.length-1){let args2=arg.split(/:/);args2.length===2&&args2[1].trim()!==``?(queryArgs[args2[0]]=args2[1],parsedargs++):queryArgs.reason+=this.messages.invalidFormat+`: ${arg}\n`}else queryArgs.reason+=this.messages.unknownArgument+`: ${arg}\n`;parsedargs>1&&(queryArgs.mode=`and`)}return queryArgs.good=!queryArgs.reason,queryArgs.highlight=queryArgs.good?Object.entries(queryArgs).filter(([key])=>!ignoreKeys.includes(key)).map(([_,value])=>value):[],queryArgs}matchSlot(slot){let opts=this.opts,query=this.query,queryMode={or:(a$1,b)=>a$1||b,and:(a$1,b)=>a$1&&b}[query.mode],queryOr=query.mode===`or`,matched=!queryOr,matchDetails={slot:!1,part:!1,mod:!1},info=isRef(this.richPartInfo)?this.richPartInfo.value:this.richPartInfo,match=(string,query$1)=>matched=queryMode(matched,(string?string.toLowerCase():`empty`).indexOf(query$1)>-1);function*pairs(){query.name&&(yield[`slot`,slot.chosenPartName,query.name]),query.slot&&(yield[`slot`,slot.slotName,query.slot]),query.description&&(yield[`slot`,(slot.parentSlotName&&info[slot.parentSlotName]?.slotInfoUi?.[slot.slotName]||{}).description,query.description]);let part=slot.chosenPartName?info[slot.chosenPartName]:null;if(part?(query.description&&(yield[`slot`,part.description,query.description]),query.author&&(yield[`slot`,part.authors,query.author,!isOfficial(part)]),query.mod&&!isOfficial(part)&&(yield[`slot`,part.description,query.mod,!0])):query.description&&(yield[`slot`,null,query.description]),query.partname||query.description||query.mod||query.author)for(let partNames of[slot.suitablePartNames,slot.unsuitablePartNames.map(({partName})=>partName)])for(let partName of partNames){let part$1=info[partName];!part$1||!opts.showAux&&part$1.isAuxiliary||(query.partname&&(yield[`part`,partName,query.partname]),query.description&&(yield[`part`,part$1.description,query.description]),query.author&&(yield[`part`,part$1.authors,query.author,!isOfficial(part$1)]),query.mod&&part$1&&!isOfficial(part$1)&&(yield[`part`,part$1.description,query.mod,!0]))}}let lastType;for(let[type,string,query$1,isMod=!1]of pairs()){if(query$1&&match(string,query$1)&&(queryOr||lastType!==type)){matchDetails[type]=!0,isMod&&(matchDetails.mod=!0);break}lastType=type}return{matched,matchedSlot:matchDetails.slot,matchedOptions:matchDetails.part,matchedMod:matchDetails.mod}}onChange(){let text=isRef(this.text)?this.text.value:this.text;!this.active&&text&&this.start()}start(){this.active=!0}stop(){this.active=!1,isRef(this.text)?this.text.value=``:this.text=``,this.query={},this.history.index=-1}},_hoisted_1$107={class:`parts-browser-content`},_hoisted_2$90={key:1},_hoisted_3$78={style:{padding:`0.5em`,display:`inline-block`}},_hoisted_4$60={class:`search-help`},_hoisted_5$50={key:0},_hoisted_6$37={class:`parts-options-row parts-options-row-separator`},_hoisted_7$31={class:`parts-options-left`},_hoisted_8$24={class:`popover-contents-wrapper`},_hoisted_9$21={class:`parts-options-right`},_hoisted_10$15={class:`parts-options-row`},_hoisted_11$13={class:`license-plate`},_hoisted_12$9={class:`parts-options-right parts-options-buttons`},treeStateKey=`partsTreeState`,_sfc_main$118={__name:`Parts`,props:{withBackground:Boolean},setup(__props){let events$3=useEvents(),queue$2=new ExecQueue,currentVehID=-1,currentConfig=ref({}),richPartInfo=ref({}),partsHighlighted={},treeState=ref({}),isDev=window.beamng&&!window.beamng.shipping,savedOptions=[`applyPartChangesAutomatically`,`selectSubParts`,`showNames`,`showAux`,`separateSort`,`alwaysSort`],opts=reactive({stickyPartSelection:!1,selectSubParts:!0,applyPartChangesAutomatically:!0,simple:!1,showNames:!1,showAux:!beamng.shipping,separateSort:!1,alwaysSort:!1,showEmpty:!1}),waitingForData=ref(!0),waitForData=async()=>{for(;waitingForData.value;)await sleep(100)},search$1=reactive(new PartsSearch(currentConfig,richPartInfo,opts)),partsChanged=ref(!1),vehChange=()=>Lua_default.extensions.core_vehicle_partmgmt.sendDataToUI();events$3.on(`VehicleFocusChanged`,vehChange),events$3.on(`VehicleJbeamIoChanged`,vehChange);function iterateChildren(slot,func){func(slot),slot.children&&Object.values(slot.children).forEach(child=>iterateChildren(child,func))}async function highlightPart(part){waitingForData.value||(iterateChildren(part,child=>typeof child.highlight==`boolean`?partsHighlighted[child.partPath]=child.highlight=part.highlight:void 0),Lua_default.extensions.core_vehicle_partmgmt.highlightParts(partsHighlighted,currentVehID))}let mouseUsedLast=!0,tmrSelect,selectPart=queue$2.wrap(`selectPart`,async(slot,mouse=!1)=>{if(mouseUsedLast=mouse,tmrSelect&&clearTimeout(tmrSelect),waitingForData.value||opts.stickyPartSelection)return;let parts={};for(let part in opts.selectSubParts?iterateChildren(slot,child=>child.partPath&&(parts[child.partPath]=!0)):parts[slot.partPath]=!0,parts)part in partsHighlighted||delete parts[part];Object.keys(parts).length!==0&&await Lua_default.extensions.core_vehicle_partmgmt.selectParts(parts,currentVehID)},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.resolveOthers,write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis,restoreHighlight:queue$2.resolution.resolveThis}),deselectPart=queue$2.wrap(`deselectPart`,(slot,mouse=!1)=>{mouseUsedLast=mouse,tmrSelect&&clearTimeout(tmrSelect),!waitingForData.value&&(tmrSelect=setTimeout(async()=>{tmrSelect=null,!(opts.stickyPartSelection||Object.keys(currentConfig.value).length===0)&&await Lua_default.extensions.core_vehicle_partmgmt.showHighlightedParts(currentVehID)},100))},{deselectPart:queue$2.resolution.replaceWithResolve,write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis,restoreHighlight:queue$2.resolution.resolveThis,restoreSelection:queue$2.resolution.resolveThis}),restoreHighlight=queue$2.wrap(`restoreHighlight`,()=>{tmrSelect&&clearTimeout(tmrSelect),tmrSelect=setTimeout(async()=>{tmrSelect=null,await Lua_default.extensions.core_vehicle_partmgmt.highlightParts(partsHighlighted,currentVehID)},100)},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.replaceWithResolve,restoreHighlight:queue$2.resolution.replaceWithResolve}),restoreSelection=queue$2.wrap(`restoreSelection`,element=>{element?.partSelect?.()},{selectPart:queue$2.resolution.replaceWithResolve,deselectPart:queue$2.resolution.replaceWithResolve,restoreSelection:queue$2.resolution.replaceWithResolve}),dropdownOpened=val=>opts.stickyPartSelection=val,skipLicGen=ref(!1),licensePlate=ref(``),licensePlateTextValid=ref(!0),settingsChanged=async()=>skipLicGen.value=await Lua_default.settings.getValue(`SkipGenerateLicencePlate`),getLicensePlate=()=>bngApi.engineLua(`core_vehicles.getVehicleLicenseText(getPlayerVehicle(0))`,str=>licensePlate.value=str),applyLicensePlateDebounced=debounce(()=>{opts.applyPartChangesAutomatically&&applyLicensePlate()},500);function applyLicensePlate(){applyLicensePlateDebounced.cancel(),licensePlateTextValid.value&&Lua_default.core_vehicles.setPlateText(licensePlate.value)}function applyRandomLicensePlate(){bngApi.engineLua(`core_vehicles.setPlateText(core_vehicles.regenerateVehicleLicenseText(getPlayerVehicle(0)),nil,nil,nil)`),getLicensePlate()}let isLicensePlateTextValid=text=>(Lua_default.core_vehicles.isLicensePlateValid(text).then(valid=>{licensePlateTextValid.value=valid}),licensePlateTextValid.value),changedPart=null;async function partConfigChanged(part){changedPart=part,opts.applyPartChangesAutomatically?await write():(part.changed=!0,partsChanged.value=!0)}let write=queue$2.wrap(`write`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.setPartsTreeConfig(currentConfig.value),await waitForData()},{write:queue$2.resolution.merge,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.resolveThis});queue$2.wrap(`reset`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.resetPartsToLoadedConfig(),await waitForData()},{write:queue$2.resolution.resolveThis,reset:queue$2.resolution.merge,resetAllToLoadedConfig:queue$2.resolution.resolveThis});let resetAllToLoadedConfig=queue$2.wrap(`resetAllToLoadedConfig`,async()=>{waitingForData.value=!0,await Lua_default.extensions.core_vehicle_partmgmt.resetAllToLoadedConfig(),await waitForData()},{write:queue$2.resolution.resolveThis,reset:queue$2.resolution.resolveThis,resetAllToLoadedConfig:queue$2.resolution.merge});function processConfig(config){treeStateSave(),waitingForData.value=!0,richPartInfo.value=Object.fromEntries(Object.entries(config.richPartInfo).map(([name,info])=>[name,info.information])),partsHighlighted=config.partsHighlighted;let processSlot=(slot,slotName,parentSlotName=void 0)=>{if(slot.slotName=slotName,slot.parentSlotName=parentSlotName,changedPart&&changedPart.chosenPartName===slot.chosenPartName&&(changedPart=slot),slot.highlight=config.partsHighlighted[slot.partPath],typeof slot.children==`object`)if(Object.keys(slot.children).length===0)delete slot.children;else for(let childSlotName in slot.children)slot.children[childSlotName]=processSlot(slot.children[childSlotName],childSlotName,slot.chosenPartName);return(typeof slot.suitablePartNames!=`object`||!Array.isArray(slot.suitablePartNames))&&(slot.suitablePartNames=[]),(typeof slot.unsuitablePartNames!=`object`||!Array.isArray(slot.unsuitablePartNames))&&(slot.unsuitablePartNames=[]),slot};currentVehID=config.vehID,currentConfig.value=processSlot(config.chosenPartsTree,config.chosenPartsTree.chosenPartName),partsChanged.value=!1,waitingForData.value=!1,nextTick(()=>{opts.stickyPartSelection=!1,deselectPart(),treeStateLoad(),changedPart=null,opts.applyPartChangesAutomatically&&!mouseUsedLast?restoreSelection(document.activeElement):restoreHighlight()})}events$3.on(`VehicleConfigChange`,processConfig);let readOption=(name,val=null)=>JSON.parse(localStorage.getItem(name)||JSON.stringify(val)),saveOption=(name,val)=>localStorage.setItem(name,JSON.stringify(val)),treeStateStorage=sessionStorage,treeStateSave=()=>currentConfig.value.chosenPartName&&treeStateStorage.setItem(`${treeStateKey}_${currentConfig.value.chosenPartName}`,JSON.stringify(treeState.value)),treeStateLoad=()=>{if(!currentConfig.value.chosenPartName)return;let state=treeStateStorage.getItem(`${treeStateKey}_${currentConfig.value.chosenPartName}`);if(state)try{treeState.value=JSON.parse(state)}catch{treeState.value={}}else treeState.value={}};return onMounted(()=>{settingsChanged(),getLicensePlate(),Lua_default.extensions.core_vehicle_partmgmt.sendDataToUI();for(let name of savedOptions)opts[name]=readOption(name,opts[name])}),onUnmounted(()=>{treeStateSave(),deselectPart(!1)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"parts-browser":!0,"with-background":__props.withBackground})},[withDirectives((openBlock(),createElementBlock(`div`,{class:`parts-browser-search`,onActivate:_cache[5]||=(...args)=>search$1.start&&search$1.start(...args),onDeactivate:_cache[6]||=()=>!search$1.text&&search$1.stop()},[createVNode(unref(bngInput_default),{modelValue:search$1.text,"onUpdate:modelValue":_cache[0]||=$event=>search$1.text=$event,modelModifiers:{trim:!0},"leading-icon":unref(icons).search,"floating-label":`Search`,onClick:_cache[1]||=$event=>search$1.start(),onValueChanged:_cache[2]||=$event=>search$1.onChange(),onKeydown:_cache[3]||=$event=>search$1.history.onKeyDown($event)},null,8,[`modelValue`,`leading-icon`]),withDirectives(createVNode(unref(bngButton_default),{icon:unref(icons).mathMultiply,style:`font-size: 0.75rem`,accent:unref(ACCENTS).text,onClick:_cache[4]||=$event=>search$1.stop()},null,8,[`icon`,`accent`]),[[unref(BngDisabled_default),!search$1.active]])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),withDirectives((openBlock(),createElementBlock(`div`,{class:`parts-browser-content-wrapper`,onMouseleave:_cache[7]||=(...args)=>unref(deselectPart)&&unref(deselectPart)(...args),onDeactivate:_cache[8]||=(...args)=>unref(deselectPart)&&unref(deselectPart)(...args)},[createBaseVNode(`div`,_hoisted_1$107,[!search$1.active&¤tConfig.value?.children&&Object.keys(currentConfig.value.children).length>0?(openBlock(),createBlock(PartsBranch_default,{key:0,"root-slot":``,children:currentConfig.value.children,info:richPartInfo.value,"tree-state":treeState.value,"display-names":opts.showNames,"show-auxiliary":opts.showAux,"separate-sort":opts.separateSort,"always-sort":opts.alwaysSort,"show-empty":opts.showEmpty,onSelect:unref(selectPart),onDeselect:unref(deselectPart),onHighlight:highlightPart,onChange:partConfigChanged,onDropdown:dropdownOpened},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`onSelect`,`onDeselect`])):search$1.active?(openBlock(),createElementBlock(`div`,_hoisted_2$90,[createVNode(PartsBranch_default,{children:search$1.result,info:richPartInfo.value,"tree-state":treeState.value,"flat-entry":``,"display-names":opts.showNames,"show-auxiliary":opts.showAux,"separate-sort":opts.separateSort,"always-sort":opts.alwaysSort,"show-empty":opts.showEmpty,highlighter:search$1.highlight,onSelect:unref(selectPart),onDeselect:unref(deselectPart),onHighlight:highlightPart,onChange:partConfigChanged,onDropdown:dropdownOpened},null,8,[`children`,`info`,`tree-state`,`display-names`,`show-auxiliary`,`separate-sort`,`always-sort`,`show-empty`,`highlighter`,`onSelect`,`onDeselect`]),withDirectives(createBaseVNode(`div`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).danger,color:`#d60`},null,8,[`type`]),createBaseVNode(`span`,_hoisted_3$78,toDisplayString(search$1.message),1)],512),[[vShow,search$1.message!==``]]),withDirectives(createBaseVNode(`div`,_hoisted_4$60,[_cache[37]||=createBaseVNode(`hr`,null,null,-1),_cache[38]||=createTextVNode(` Examples: `,-1),createBaseVNode(`ul`,null,[createBaseVNode(`li`,null,[_cache[23]||=createBaseVNode(`span`,{class:`search-example`},`left`,-1),_cache[24]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example1`)),1)]),createBaseVNode(`li`,null,[_cache[25]||=createBaseVNode(`span`,{class:`search-example`},`slot:_fr`,-1),_cache[26]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example2`)),1)]),createBaseVNode(`li`,null,[_cache[27]||=createBaseVNode(`span`,{class:`search-example`},`name:frame`,-1),_cache[28]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example3`)),1)]),createBaseVNode(`li`,null,[_cache[29]||=createBaseVNode(`span`,{class:`search-example`},`slot:_fr name:signal`,-1),_cache[30]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example4`)),1)]),createBaseVNode(`li`,null,[_cache[31]||=createBaseVNode(`span`,{class:`search-example`},`partname:pickup_fr`,-1),_cache[32]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example5`)),1)]),createBaseVNode(`li`,null,[_cache[33]||=createBaseVNode(`span`,{class:`search-example`},`author:bob`,-1),_cache[34]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example6`)),1)]),createBaseVNode(`li`,null,[_cache[35]||=createBaseVNode(`span`,{class:`search-example`},`mod:super`,-1),_cache[36]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.example7`)),1)])]),_cache[39]||=createBaseVNode(`hr`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes`))+`: `,1),createBaseVNode(`ul`,null,[createBaseVNode(`li`,null,toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes1`)),1),createBaseVNode(`li`,null,toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.notes3`)),1)])],512),[[vShow,Object.keys(search$1.result).length===0]]),search$1.history.browsing&&search$1.history.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$50,[_cache[40]||=createBaseVNode(`hr`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.history`))+`: `,1),_cache[41]||=createBaseVNode(`br`,null,null,-1),_cache[42]||=createBaseVNode(`br`,null,null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(search$1.history.list,(historyEntry,idx)=>(openBlock(),createElementBlock(`span`,{class:normalizeClass({"history-entry":!0,"history-indicator":idx===search$1.history.index})},toDisplayString(historyEntry),3))),256)),_cache[43]||=createBaseVNode(`br`,null,null,-1),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.vehicleconfig.searchHelp.historyClear`)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])],32)),[[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),createBaseVNode(`div`,_hoisted_6$37,[createBaseVNode(`div`,_hoisted_7$31,[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,icon:unref(icons).sortAsc,disabled:waitingForData.value},null,8,[`accent`,`icon`,`disabled`]),[[unref(BngPopover_default),`parts-options-menu`,`top-start`,{click:!0}],[unref(BngTooltip_default),_ctx.$t(`ui.garage.optionsSwitch`),`right`]]),createVNode(unref(bngPopoverMenu_default),{name:`parts-options-menu`,focus:``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$24,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.showAux?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[9]||=$event=>saveOption(`showAux`,opts.showAux=!opts.showAux)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.showAuxiliary`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.showNames?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[10]||=$event=>saveOption(`showNames`,opts.showNames=!opts.showNames)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.displayNames`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.selectSubParts?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[11]||=$event=>saveOption(`selectSubParts`,opts.selectSubParts=!opts.selectSubParts)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.subparts`)),1)]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.separateSort?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[12]||=$event=>saveOption(`separateSort`,opts.separateSort=!opts.separateSort)},{default:withCtx(()=>[..._cache[44]||=[createTextVNode(`Sort sublists separately`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).menu,icon:opts.alwaysSort?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[13]||=$event=>saveOption(`alwaysSort`,opts.alwaysSort=!opts.alwaysSort)},{default:withCtx(()=>[..._cache[45]||=[createTextVNode(`Always sort by name`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]),unref(isDev)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).menu,icon:opts.showEmpty?unref(icons).checkmark:unref(icons)._empty,onClick:_cache[14]||=$event=>opts.showEmpty=!opts.showEmpty},{default:withCtx(()=>[..._cache[46]||=[createTextVNode(`Show empty slots 🐞`,-1)]]),_:1},8,[`accent`,`icon`])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]]):createCommentVNode(``,!0)])]),_:1})]),createBaseVNode(`div`,_hoisted_9$21,[createVNode(unref(bngSwitch_default),{disabled:partsChanged.value||waitingForData.value,modelValue:opts.applyPartChangesAutomatically,"onUpdate:modelValue":_cache[15]||=$event=>opts.applyPartChangesAutomatically=$event,onValueChanged:_cache[16]||=$event=>saveOption(`applyPartChangesAutomatically`,opts.applyPartChangesAutomatically)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.liveUpdates`)),1)]),_:1},8,[`disabled`,`modelValue`])])]),createBaseVNode(`div`,_hoisted_10$15,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_11$13,[createVNode(unref(bngInput_default),{modelValue:licensePlate.value,"onUpdate:modelValue":_cache[17]||=$event=>licensePlate.value=$event,"floating-label":_ctx.$t(`ui.vehicleconfig.licensePlate`),maxlength:`50`,onValueChanged:_cache[18]||=$event=>unref(applyLicensePlateDebounced)(),onKeyup:_cache[19]||=withKeys($event=>applyLicensePlate(),[`enter`]),validate:isLicensePlateTextValid},null,8,[`modelValue`,`floating-label`]),withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).sync,onClick:_cache[20]||=$event=>applyRandomLicensePlate()},null,8,[`accent`,`icon`]),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.licensePlateGen`),`top`]]),opts.applyPartChangesAutomatically?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!licensePlateTextValid.value,icon:unref(icons).checkmark,onClick:_cache[21]||=$event=>applyLicensePlate()},null,8,[`disabled`,`icon`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.applyLicensePlate`),`top`]])])),[[unref(BngDisabled_default),skipLicGen.value||waitingForData.value],[unref(BngScopedNav_default),{bubbleWhitelistEvents:[`menu`]}]]),createBaseVNode(`div`,_hoisted_12$9,[withDirectives(createVNode(unref(bngButton_default),{"show-hold":``,icon:unref(icons).undo,accent:unref(ACCENTS).custom,class:`reset-button`,disabled:waitingForData.value},null,8,[`icon`,`accent`,`disabled`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngClick_default),{holdCallback:unref(resetAllToLoadedConfig),holdDelay:1e3,repeatInterval:0}],[unref(BngTooltip_default),`Reset to original config`]]),createVNode(unref(bngButton_default),{class:`parts-apply-button`,icon:unref(icons).checkmark,onClick:_cache[22]||=$event=>unref(write)(),disabled:opts.applyPartChangesAutomatically||!partsChanged.value||waitingForData.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.common.apply`)),1)]),_:1},8,[`icon`,`disabled`])])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Parts_default=__plugin_vue_export_helper_default(_sfc_main$118,[[`__scopeId`,`data-v-13e05ae0`]]),_hoisted_1$106={key:0,class:`saveload-static`},_hoisted_2$89={class:`saveload-row saveload-filename`},_hoisted_3$77={class:`saveload-list`},_hoisted_4$59=[`onClick`],_hoisted_5$49={class:`saveload-list-item-label`},_hoisted_6$36={class:`saveload-static saveload-row saveload-controls`},_sfc_main$117={__name:`Save`,props:{withBackground:Boolean},setup(__props){useUINavBlocker().blockOnly([`context`]);let{api:api$1}=useBridge(),events$3=useEvents(),saveThumbnail=ref(!0),configList=ref([]),configFiltered=computed(()=>{let res=configList.value;return saveName.value&&(res=res.filter(itm=>itm.name.toLowerCase().includes(saveName.value.toLowerCase()))),res=res.slice().sort((a$1,b)=>a$1.player&&!b.player?-1:!a$1.player&&b.player?1:a$1.name.localeCompare(b.name)),res}),saveDisabled=computed(()=>!saveName.value||/^\.|[<>:"/\\|?*]/.test(saveName.value)),saveName=ref(``),configExists=computed(()=>!!configList.value.some(itm=>itm.name.toLowerCase()===saveName.value.toLowerCase()));async function openConfigFolderInExplorer(){await Lua_default.extensions.core_vehicle_partmgmt.openConfigFolderInExplorer()}async function save(configName){configExists.value&&!await openConfirmation(`Are you sure?`,$translate.instant(`ui.garage.save.overwrite`),[{label:`Overwrite`,value:!0},{label:`Cancel`,value:!1,extras:{accent:ACCENTS.secondary}}])||(await Lua_default.extensions.core_vehicle_partmgmt.saveLocal(configName+`.pc`),saveThumbnail.value&&api$1.engineLua(`extensions.load('util_screenshotCreator'); util_screenshotCreator.startWork({selection="${configName}"})`))}async function load(configName){await Lua_default.extensions.core_vehicle_partmgmt.loadLocal(configName+`.pc`)}async function remove$3(configName){await openConfirmation(`Are you sure?`,`This will permanently remove the configuration. You will not be able to recover it.`,[{label:`Delete permanently`,value:!0,extras:{accent:ACCENTS.attention}},{label:`Cancel`,value:!1,extras:{accent:ACCENTS.secondary}}])&&(await Lua_default.extensions.core_vehicle_partmgmt.removeLocal(configName),await getConfigList())}async function getConfigList(){let configs$1=await Lua_default.extensions.core_vehicle_partmgmt.getConfigList();configList.value=Array.isArray(configs$1)?configs$1:[]}return events$3.on(`VehicleChange`,getConfigList),events$3.on(`VehicleFocusChanged`,getConfigList),events$3.on(`VehicleconfigSaved`,getConfigList),getConfigList(),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({saveload:!0,"with-background":__props.withBackground})},[configList.value?(openBlock(),createElementBlock(`div`,_hoisted_1$106,[createBaseVNode(`div`,_hoisted_2$89,[createVNode(unref(bngInput_default),{modelValue:saveName.value,"onUpdate:modelValue":_cache[0]||=$event=>saveName.value=$event,modelModifiers:{trim:!0},"leading-icon":unref(icons).saveAs1,"floating-label":_ctx.$t(`ui.vehicleconfig.filename`)},null,8,[`modelValue`,`leading-icon`,`floating-label`]),withDirectives(createVNode(unref(bngButton_default),{icon:unref(icons).mathMultiply,style:`font-size: 0.75rem`,accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>saveName.value=``},null,8,[`icon`,`accent`]),[[unref(BngDisabled_default),!saveName.value]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:configExists.value?unref(ACCENTS).attention:unref(ACCENTS).main,onClick:_cache[2]||=$event=>save(saveName.value)},{default:withCtx(()=>[createTextVNode(toDisplayString(configExists.value?_ctx.$t(`ui.common.overwrite`):_ctx.$t(`ui.common.save`)),1)]),_:1},8,[`accent`])),[[unref(BngDisabled_default),saveDisabled.value]])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$77,[(openBlock(!0),createElementBlock(Fragment,null,renderList(configFiltered.value,config=>(openBlock(),createElementBlock(`div`,{class:`saveload-list-item`,onClick:$event=>saveName.value=config.name,tabindex:`1`},[config.official?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).beamNG},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceOfficial`),`top`]]):config.player?withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).personSolid},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceUser`),`top`]]):withDirectives((openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).puzzleModule},null,8,[`type`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.sourceMod`),`top`]]),createBaseVNode(`div`,_hoisted_5$49,toDisplayString(config.name),1),withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`saveload-list-item-load`,accent:unref(ACCENTS).outlined,icon:unref(icons).BNGFolder,onClick:withModifiers($event=>load(config.name),[`stop`])},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.load`)),1)]),_:1},8,[`accent`,`icon`,`onClick`])),[[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.loadTooltip`),`top`]]),config.player?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:`saveload-list-item-delete`,accent:unref(ACCENTS).outlined,icon:unref(icons).trashBin2,onClick:withModifiers($event=>remove$3(config.name),[`stop`])},null,8,[`accent`,`icon`,`onClick`])),[[unref(BngTooltip_default),`Remove configuration`,`top`]]):createCommentVNode(``,!0)],8,_hoisted_4$59))),256))]),createBaseVNode(`div`,_hoisted_6$36,[createVNode(unref(bngSwitch_default),{modelValue:saveThumbnail.value,"onUpdate:modelValue":_cache[3]||=$event=>saveThumbnail.value=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.saveThumbnail`)),1)]),_:1},8,[`modelValue`]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).main,onClick:_cache[4]||=$event=>openConfigFolderInExplorer()},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.vehicleconfig.openConfigFolder`)),1)]),_:1},8,[`accent`])])],2)),[[unref(BngBlur_default),__props.withBackground]])}},Save_default=__plugin_vue_export_helper_default(_sfc_main$117,[[`__scopeId`,`data-v-31dd4dbb`]]),_hoisted_1$105={class:`garage-row-title`},_hoisted_2$88={class:`headingContainer`},_hoisted_3$76={class:`garage-title-sup`},_hoisted_4$58={class:`garage-title-main`},_hoisted_5$48={class:`garage-row-main`},_hoisted_6$35={class:`garage-menu-container garage-menu-main`},_hoisted_7$30={key:0,class:`garage-menu garage-menu-primary`},_hoisted_8$23={key:1,class:`garage-menu garage-menu-secondary`},_hoisted_9$20={key:2,class:`garage-content`},_hoisted_10$14={class:`garage-sidemenu-title`},_hoisted_11$12={class:`garage-drawer-header`},_hoisted_12$8={class:`garage-drawer-content`},_hoisted_13$8={class:`garage-drawer-header`},_hoisted_14$8={class:`garage-drawer-content`},_hoisted_15$8={class:`garage-drawer-header`},_hoisted_16$8={class:`garage-drawer-content`},_hoisted_17$7={class:`garage-row-bottom`},ownerId=`garage`,_sfc_main$116={__name:`Garage`,props:{component:String},setup(__props){let components={paint:Paint_default,parts:Parts_default,tuning:Tuning_default,save:Save_default},uiNavTracker=useUINavTracker(),{showIfController}=storeToRefs(controls_default()),{lua,api:api$1}=useBridge(),events$3=useEvents(),bngVue$1=window.bngVue||{gotoGameState(){}},backBinding=ref(null),streamsList$1=[`electrics`];useStreams(streamsList$1,onStreamsUpdate);let drawerCamera=ref(!1),drawerVehicle=ref(!1),drawerGarage=ref(!1);watch(()=>showIfController,val=>val?uiNavTracker.addIgnore(`action_4`,ownerId):uiNavTracker.removeIgnore(`action_4`,ownerId),{immediate:!0});let launchLiveryEditor=async()=>{await runRaw(`extensions.core_vehicle_partmgmt.hasAvailablePart(be:getPlayerVehicle(0).JBeam .. "_skin_dynamicTextures")`)?await openExperimental(`Dynamic Decals`,`This is an early highly experimental preview of the Decal Editor. Please be aware that anything created with this feature may be lost in future hotfixes and updates. Do you wish to proceed?`,[{label:$translate.instant(`ui.common.no`),value:!1,extras:{accent:ACCENTS.secondary}},{label:`Yes, I'm buckled up and ready to go!`,value:!0,extras:{default:!0}}])&&bngVue$1.gotoGameState(`livery-manager`):openMessage(``,$translate.instant(`ui.garage.decals.notAvailableForVehicle`))},props=__props,sidemenuActive=ref(!1);function activateSidemenu(){sidemenuActive.value=!0}function deactivateSidemenu(){sidemenuActive.value=!1,nextTick(()=>{drawerCamera.value=!1,drawerVehicle.value=!1,drawerGarage.value=!1})}function toggleSidemenu(){sidemenuActive.value=!sidemenuActive.value}let canSidemenuDeactivate=()=>!drawerCamera.value&&!drawerVehicle.value&&!drawerGarage.value,lightState=ref([!1,!1,!1]);async function lightToggle(idx){lightState.value[idx]=!lightState.value[idx],await lua.extensions.gameplay_garageMode.setLighting(lightState.value)}async function setCamera(view){await lua.extensions.gameplay_garageMode.setCamera(view)}let switches=reactive({lowbeam:{func:`setLightsState`,value:`lights_state`,on:1,off:0,state:!1},highbeam:{func:`setLightsState`,value:`lights_state`,on:2,off:0,state:!1},fog:{func:`set_fog_lights`,value:`fog`,on:1,off:0,state:!1},lightbar:{func:`set_lightbar_signal`,value:`lightbar`,on:1,off:0,state:!1},hazard:{func:`set_warn_signal`,value:`hazard_enabled`,on:1,off:0,state:!1}});function vehSwitch(key,on){if(!(key in switches))return;let svc=switches[key];if(on===void 0)on=!svc.state;else if(on===svc.state)return;api$1.activeObjectLua(`electrics.${svc.func}(${on?svc.on:svc.off})`)}let loaded=reactive({init:!1,vehicle:!1,status:!1}),vehicle=reactive({name:`Unknown`,vehicle:null,electrics:{},state:{}}),blackscreen=ref(!1),vehcomp=ref(``),vehcompview=ref(null),tmrInit;async function menuOpen(mode){vehcomp.value=vehcomp.value===mode?``:mode;let component=null;switch(mode){case`paint`:lua.extensions.gameplay_garageMode.setGarageMenuState(`paint`),component=components.paint;break;case`decals`:bngVue$1.gotoGameState(`decals-loader`);break;case`parts`:lua.extensions.gameplay_garageMode.setGarageMenuState(`parts`),component=components.parts;break;case`tuning`:lua.extensions.gameplay_garageMode.setGarageMenuState(`tuning`),component=components.tuning;break;case`vehicles`:lua.extensions.gameplay_garageMode.setGarageMenuState(`vehicles`),bngVue$1.gotoGameState(`menu.vehicles`,{params:{mode:`garageMode`,garage:`all`}});break;case`mycars`:lua.extensions.gameplay_garageMode.setGarageMenuState(`myCars`),bngVue$1.gotoGameState(`menu.vehicles`,{params:{mode:`garageMode`,garage:`own`}});break;case`photo`:bngVue$1.gotoGameState(`menu.photomode`);break;case`save`:component=components.save;break;case`savedefault`:console.log(`TODO: save as default`);break;case`test`:vehcomp.value=``,lua.extensions.gameplay_garageMode.testVehicle();break;default:vehcomp.value=``;break}component&&(vehcompview.value=markRaw(component))}function exit(event){event.detail.force||(vehcomp.value?menuOpen():window.bngVue.gotoAngularState(`menu.mainmenu`))}async function vehChange(){loaded.vehicle=!1,loaded.status=!1,vehicle.name=`Unknown`,vehicle.vehicle=null,vehicle.electrics={},await api$1.activeObjectLua(`electrics.setIgnitionLevel(1)`);let data=await lua.core_vehicles.getCurrentVehicleDetails();tmrInit&&=(loaded.init=!0,clearTimeout(tmrInit),null),data&&(loaded.vehicle=!0,vehicle.vehicle=data,data.model.Brand?vehicle.name=`${data.model.Brand} ${data.model.Name}`:vehicle.name=data.configs.Name,data.configs.Configuration&&(data.configs.Source===`BeamNG - Official`?vehicle.name+=` - ${data.configs.Configuration}`:vehicle.name+=` - Custom`))}function onStreamsUpdate(streams){if(typeof streams!=`object`||!streamsList$1.every(name=>name in streams))return;let data=streams.electrics;for(let key in loaded.status=data.ignitionLevel>0,switches){let svc=switches[key];svc.state=svc.value in data&&data[svc.value]===svc.on,vehicle.electrics[key]=svc.state}}let canScopeDeactivate=()=>!vehcomp.value;return onBeforeMount(async()=>{tmrInit=setTimeout(()=>{console.log(`Unable to get vehicle details in time. Forcing to init...`),loaded.init=!0,tmrInit=null},3e3),events$3.on(`VehicleChange`,vehChange),api$1.activeObjectLua(`electrics.setIgnitionLevel(1)`),events$3.on(`GarageModeBlackscreen`,data=>blackscreen.value=data.active),vehChange(),lightState.value=await lua.extensions.gameplay_garageMode.getLighting(),props.component&&menuOpen(props.component)}),onUnmounted(()=>{tmrInit&&clearTimeout(tmrInit)}),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[withDirectives(createBaseVNode(`div`,{class:normalizeClass([`garage-blackscreen`,{"garage-blackscreen-active":blackscreen.value}])},null,2),[[unref(BngBlur_default),blackscreen.value]]),loaded.init?withDirectives((openBlock(),createElementBlock(`div`,{key:0,class:`garage-view`,onDeactivate:exit},[createBaseVNode(`div`,_hoisted_1$105,[createBaseVNode(`div`,_hoisted_2$88,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$76,[createBaseVNode(`h4`,null,[createTextVNode(toDisplayString(_ctx.$t(`ui.mainmenu.garage`))+` `,1),vehcomp.value?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(`/ `+toDisplayString(vehicle.name),1)],64)):createCommentVNode(``,!0)])])),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createElementBlock(`h2`,_hoisted_4$58,[vehcomp.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`garage-back-button`,{"garage-back-binding-shown":backBinding.value?.displayed}]),accent:backBinding.value?.displayed?unref(ACCENTS).ghost:unref(ACCENTS).outlined,icon:unref(icons).arrowLargeLeft,"bng-no-nav":`true`,onClick:exit},{default:withCtx(()=>[withDirectives(createVNode(unref(bngBinding_default),{ref_key:`backBinding`,ref:backBinding,class:`back-binding`,"ui-event":`back`,controller:``,"track-ignore":``},null,512),[[vShow,!sidemenuActive.value]]),createTextVNode(` `+toDisplayString(backBinding.value?.displayed?``:_ctx.$t(`ui.common.back`)),1)]),_:1},8,[`class`,`accent`,`icon`])),[[unref(BngTooltip_default),!backBinding.value||backBinding.value?.displayed?_ctx.$t(`ui.common.back`):void 0,`top`]]):createCommentVNode(``,!0),createBaseVNode(`span`,null,toDisplayString(vehcomp.value?_ctx.$t(`ui.garage.tabs.`+(vehcomp.value===`tuning`?`tune`:vehcomp.value)):vehicle.name),1)])),[[unref(BngBlur_default)]])])]),createBaseVNode(`div`,_hoisted_5$48,[createBaseVNode(`div`,_hoisted_6$35,[vehcomp.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$30,[withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).engine,active:vehcomp.value===`parts`,onClick:_cache[0]||=$event=>menuOpen(`parts`),"bng-scoped-nav-autofocus":loaded.vehicle&&!sidemenuActive.value&&unref(showIfController)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.parts`)),1)]),_:1},8,[`icon`,`active`,`bng-scoped-nav-autofocus`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).wrench,active:vehcomp.value===`tuning`,onClick:_cache[1]||=$event=>menuOpen(`tuning`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.tune`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).sprayCan,active:vehcomp.value===`paint`,onClick:_cache[2]||=$event=>menuOpen(`paint`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.paint`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).star,active:vehcomp.value===`decals`,onClick:launchLiveryEditor},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.decals`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]])])),vehcomp.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_8$23,[withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).car,active:vehcomp.value===`vehicles`,onClick:_cache[3]||=$event=>menuOpen(`vehicles`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.vehicles`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).keys1,active:vehcomp.value===`mycars`,onClick:_cache[4]||=$event=>menuOpen(`mycars`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.load`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(GarageButton_default,{icon:unref(icons).photo,onClick:_cache[5]||=$event=>menuOpen(`photo`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.tabs.photo`)),1)]),_:1},8,[`icon`])),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)]])])),vehcomp.value&&vehcompview.value?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_9$20,[(openBlock(),createBlock(resolveDynamicComponent(vehcompview.value),{"with-background":``,"with-padding":!1}))])),[[unref(BngOnUiNav_default),exit,`menu,back`],[unref(BngFrustumMover_default),!0,`left`]]):createCommentVNode(``,!0)]),withDirectives((openBlock(),createElementBlock(`div`,{class:`garage-sidemenu`,onActivate:activateSidemenu,onDeactivate:deactivateSidemenu},[withDirectives((openBlock(),createElementBlock(`h4`,_hoisted_10$14,[createVNode(unref(bngBinding_default),{class:`back-binding`,"ui-event":`action_4`,controller:``}),createTextVNode(` `+toDisplayString(_ctx.$t(`ui.garage2.features`)),1)])),[[unref(BngBlur_default)]]),createVNode(unref(drawer_default),{modelValue:drawerCamera.value,"onUpdate:modelValue":_cache[12]||=$event=>drawerCamera.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_11$12,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).movieCamera,active:drawerCamera.value,"bng-scoped-nav-autofocus":sidemenuActive.value&&unref(showIfController),onClick:_cache[6]||=$event=>drawerCamera.value=!drawerCamera.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage.photo.camera`)),1)]),_:1},8,[`icon`,`active`,`bng-scoped-nav-autofocus`])),[[unref(BngDisabled_default),!loaded.init]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_12$8,[createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).camera3Fourth1,onClick:_cache[7]||=$event=>setCamera(`default`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.standartCamera`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraFront1,onClick:_cache[8]||=$event=>setCamera(`front`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.front`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraBack1,onClick:_cache[9]||=$event=>setCamera(`back`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.back`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraSideRight,onClick:_cache[10]||=$event=>setCamera(`side`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.right`)),1)]),_:1},8,[`icon`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).cameraTop1,onClick:_cache[11]||=$event=>setCamera(`top`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`engine.editor.menu.camera.top`)),1)]),_:1},8,[`icon`])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`]),createVNode(unref(drawer_default),{modelValue:drawerVehicle.value,"onUpdate:modelValue":_cache[19]||=$event=>drawerVehicle.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_13$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).electronicSchemeOutline,active:drawerVehicle.value,onClick:_cache[13]||=$event=>drawerVehicle.value=!drawerVehicle.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle||!loaded.status]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_14$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lowBeam,active:vehicle.electrics.lowbeam,onClick:_cache[14]||=$event=>vehSwitch(`lowbeam`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.headlights.low`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).highBeam,active:vehicle.electrics.highbeam,onClick:_cache[15]||=$event=>vehSwitch(`highbeam`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.headlights.high`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).fogLight,active:vehicle.electrics.fog_lights,onClick:_cache[16]||=$event=>vehSwitch(`fog`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.fog_lights`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).hazardLights,active:vehicle.electrics.hazard,onClick:_cache[17]||=$event=>vehSwitch(`hazard`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.hazard_lights`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]]),withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-button`,icon:unref(icons).wigwags,active:vehicle.electrics.lightbar,onClick:_cache[18]||=$event=>vehSwitch(`lightbar`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.radialmenu2.electrics.lightbar`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.vehicle]])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`]),createVNode(unref(drawer_default),{modelValue:drawerGarage.value,"onUpdate:modelValue":_cache[24]||=$event=>drawerGarage.value=$event,position:`left`,class:`garage-menugroup`},{header:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_15$8,[withDirectives((openBlock(),createBlock(GarageButton_default,{type:`drawer-toggle`,icon:unref(icons).garage01,active:drawerGarage.value,onClick:_cache[20]||=$event=>drawerGarage.value=!drawerGarage.value},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.features`)),1)]),_:1},8,[`icon`,`active`])),[[unref(BngDisabled_default),!loaded.init]])])),[[unref(BngBlur_default)]])]),"expanded-content":withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_16$8,[createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG32,active:lightState.value[0],onClick:_cache[21]||=$event=>lightToggle(0)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.west`)),1)]),_:1},8,[`icon`,`active`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG22,active:lightState.value[1],onClick:_cache[22]||=$event=>lightToggle(1)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.middle`)),1)]),_:1},8,[`icon`,`active`]),createVNode(GarageButton_default,{type:`drawer-button`,icon:unref(icons).lightGarageG12,active:lightState.value[2],onClick:_cache[23]||=$event=>lightToggle(2)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(`ui.garage2.lights.east`)),1)]),_:1},8,[`icon`,`active`])])),[[unref(BngOnUiNav_default),toggleSidemenu,`menu,back`],[unref(BngBlur_default)]])]),_:1},8,[`modelValue`])],32)),[[unref(BngScopedNav_default),{activated:sidemenuActive.value,type:`container`,bubbleWhitelistEvents:[`menu`],canDeactivate:canSidemenuDeactivate}],[unref(BngOnUiNav_default),toggleSidemenu,`action_4`]])]),createBaseVNode(`div`,_hoisted_17$7,[withDirectives(createVNode(GarageButton_default,{active:vehcomp.value===`save`,onClick:_cache[25]||=$event=>menuOpen(`save`),icon:unref(icons).saveAs1},null,8,[`active`,`icon`]),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)],[unref(BngTooltip_default),_ctx.$t(`ui.vehicleconfig.save`),`top`]]),withDirectives(createVNode(GarageButton_default,{onClick:_cache[26]||=$event=>menuOpen(`test`),icon:unref(icons).trafficCone},null,8,[`icon`]),[[unref(BngDisabled_default),!loaded.vehicle],[unref(BngBlur_default)],[unref(BngTooltip_default),_ctx.$t(`ui.common.test`),`top`]])])],32)),[[unref(BngScopedNav_default),{activateOnMount:!0,bubbleWhitelistEvents:[`menu`],canDeactivate:canScopeDeactivate}],[unref(BngOnUiNav_default),toggleSidemenu,`action_4`]]):createCommentVNode(``,!0)],64))}},Garage_default=__plugin_vue_export_helper_default(_sfc_main$116,[[`__scopeId`,`data-v-b5f03823`]]),routes_default$7=[{path:`/garagemode/:component?`,name:`garagemode`,component:Garage_default,props:!0,meta:{infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0}}},{path:`/garagemode/tuning`,name:`garagemode.tuning`,component:Garage_default,props:{component:`tuning`},meta:{infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0}}}],_hoisted_1$104={class:`edit-form`},_sfc_main$115={__name:`FileEditForm`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$104,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event,suffix:`.dyndecals.json`},null,8,[`modelValue`])]))}},FileEditForm_default=__plugin_vue_export_helper_default(_sfc_main$115,[[`__scopeId`,`data-v-c94cd7bf`]]),_sfc_main$114={__name:`RenameLayerForm`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event},null,8,[`modelValue`])]))}},RenameLayerForm_default=_sfc_main$114,_hoisted_1$103={class:`exit-editor-dialog`},_hoisted_2$87={class:`apply-skin-wrapper`},_sfc_main$113={__name:`ExitEditorDialog`,props:{modelValue:{type:[Object,String,Number,Boolean],required:!0}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,formModel=computed({get:()=>props.modelValue,set:newValue=>{emit$1(`update:modelValue`,newValue)}});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$103,[createVNode(unref(bngInput_default),{modelValue:formModel.value.name,"onUpdate:modelValue":_cache[0]||=$event=>formModel.value.name=$event,suffix:`.dyndecals.json`},null,8,[`modelValue`]),createBaseVNode(`div`,_hoisted_2$87,[createVNode(unref(bngPillCheckbox_default),{modelValue:formModel.value.applySkin,"onUpdate:modelValue":_cache[1]||=$event=>formModel.value.applySkin=$event,disabled:!formModel.value.name},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Apply Skin`,-1)]]),_:1},8,[`modelValue`,`disabled`])])]))}},ExitEditorDialog_default=__plugin_vue_export_helper_default(_sfc_main$113,[[`__scopeId`,`data-v-b4897c9e`]]);const openEditFileDialog=(title,description,formModel,formValidator)=>openFormDialog(FileEditForm_default,formModel,formValidator,title,description),openRenameLayerDialog=(title,description,formModel,formValidator)=>openFormDialog(RenameLayerForm_default,formModel,formValidator,title,description);var SELECTION_LUA$1=Lua_default.extensions.ui_liveryEditor_selection;const useLayerActionsStore=defineStore(`createLayer`,()=>{async function onActionItemSelected(action){if(!action.items)if(console.log(`[onActionItemSelected] do action`),action.value===`group`)await Lua_default.extensions.ui_liveryEditor_tools_group.groupLayers();else if(action.value===`ungroup`)await Lua_default.extensions.ui_liveryEditor_tools_group.ungroupLayer();else if(action.value===`delete`)await openConfirmation(`Delete Layer`,`Are you sure you want to delete ${singleSelectedLayer.value.name}?`)&&await Lua_default.extensions.ui_liveryEditor_tools_settings.deleteLayer();else if(action.value===`rename`){let res=await openRenameLayerDialog(`Rename Layer`,``,{name:singleSelectedLayer.value.name},model=>model.name!==null&&model.name!==void 0&&model.name!==``&&model.name!==singleSelectedLayer.value.name);res.value&&await Lua_default.extensions.ui_liveryEditor_tools_settings.rename(res.formData.name)}else action.value===`duplicate`?await SELECTION_LUA$1.duplicateSelectedLayer():await Lua_default.extensions.ui_liveryEditor_tools.useTool(action.value)}return{onActionItemSelected}});var EDIT_MODE=Lua_default.extensions.ui_liveryEditor_editMode,DECAL_LAYER=Lua_default.extensions.ui_liveryEditor_layers_decals,TRANSFORM_TOOL=Lua_default.extensions.ui_liveryEditor_tools_transform,MATERIAL_TOOL=Lua_default.extensions.ui_liveryEditor_tools_material,SETTINGS_TOOL=Lua_default.extensions.ui_liveryEditor_tools_settings;const useLayerSettingsStore=defineStore(`layerSettings`,()=>{let{events:events$3}=useBridge(),rootStore=useLiveryEditorStore(),active=ref(!1),targetLayer=ref({}),currentTool=ref(null),toolsData=ref(null),requestApplyActive=ref(!1),decalTexture=ref(null),isChangeDecal=ref(null),activeSettings=ref(null),editModeState=reactive({lockScaling:!1}),isStampMode=computed(()=>toolsData.value&&toolsData.value.mode===`stamp`),_reapplyActive=ref(!1),cursorData=ref(null),_appliedLayers=ref(null),activeLayerUid=ref(null),reapplyActive=computed({get:()=>_reapplyActive.value,set:async newValue=>{newValue?await Lua_default.extensions.ui_liveryEditor_editMode.requestReapply():await Lua_default.extensions.ui_liveryEditor_editMode.cancelReapply()}}),appliedLayers=computed(()=>!_appliedLayers.value||!Array.isArray(_appliedLayers.value)?null:_appliedLayers.value);events$3.on(`liveryEditor_EditMode_OnActiveStatusChanged`,async data=>{console.log(`liveryEditor_EditMode_OnActiveStatusChanged`,data),active.value=data}),events$3.on(`LiveryEditor_CursorUpdated`,async data=>{console.log(`LiveryEditor_CursorUpdated`,data),cursorData.value=data}),events$3.on(`LiveryEditor_SelectedLayersDataUpdated`,async data=>{console.log(`LiveryEditor_SelectedLayersDataUpdated`,data),data&&Array.isArray(data)&&data.length>0&&(targetLayer.value=data[0])}),events$3.on(`liveryEditor_OnSettingsChanged_UseMousePos`,data=>{console.log(`liveryEditor_OnSettingsChanged_UseMousePos`,data),cursorData.value&&(cursorData.value.isUseMousePos=data)}),events$3.on(`liveryEditor_OnEditMode_ReapplyChanged`,data=>{console.log(`liveryEditor_OnEditMode_ReapplyChanged`,data),_reapplyActive.value=data}),events$3.on(`LiveryEditorToolChanged`,data=>{console.log(`LiverEditorToolChanged`,data),currentTool.value=data}),events$3.on(`LiveryEditor_ToolDataUpdated`,async data=>{console.log(`LiveryEditor_ToolDataUpdated`,data),toolsData.value=data}),events$3.on(`liveryEditor_EditMode_OnRequestApplyChanged`,async data=>{console.log(`liveryEditor_EditMode_OnRequestApplyChanged`,data),requestApplyActive.value=data}),events$3.on(`liveryEditor_EditMode_OnAppliedLayersUpdated`,async data=>{console.log(`liveryEditor_EditMode_OnAppliedLayersUpdated`,data),_appliedLayers.value=data}),events$3.on(`liveryEditor_EditMode_OnActiveLayerChanged`,async data=>{console.log(`liveryEditor_EditMode_OnActiveLayerChanged`,data),activeLayerUid.value=data}),events$3.on(`liveryEditor_onDecalTextureChanged`,async data=>{console.log(`liveryEditor_onDecalTextureChanged`,data),console.log(`liveryEditor_onDecalTextureChanged active value`,active.value),active.value?!isChangeDecal.value&&!requestApplyActive.value&&await requestApply():await EDIT_MODE.activate(),await MATERIAL_TOOL.setDecal(data),rootStore.toggleShowDecalSelector(),isChangeDecal.value=null}),events$3.on(`liveryEditor_onDecalSelectorCancelled`,async data=>{console.log(`liveryEditor_onDecalSelectorCancelled`,data),active.value?rootStore.toggleShowDecalSelector():rootStore.toggleEditModeLayout(),isChangeDecal.value=null});function init$3(){active.value?EDIT_MODE.resetCursorProperties([]):rootStore.toggleShowDecalSelector()}let deactivate=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),rootStore.currentContext=EDITOR_CONTEXT.default,rootStore.editorView=EDITOR_VIEWS.default},toggleRequestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.toggleRequestApply(),requestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.requestApply(),cancelRequestApply=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.cancelRequestApply(),getInitialData=async()=>await Lua_default.extensions.ui_liveryEditor_layers_cursor.requestData(),toggleStamp=async()=>{toolsData.value&&toolsData.value.mode===`stamp`?await Lua_default.extensions.ui_liveryEditor_tools_transform.cancelStamp():await Lua_default.extensions.ui_liveryEditor_tools_transform.useStamp()},setActiveLayer=async layerUid=>{await Lua_default.extensions.ui_liveryEditor_editMode.setActiveLayer(layerUid)},requestReapply=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.requestReapply()},cancelReapply=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.cancelReapply()},cancelChanges=async()=>{await Lua_default.extensions.ui_liveryEditor_editMode.cancelChanges(),await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),await Lua_default.extensions.ui_liveryEditor_tools.closeCurrentTool()},requestChangeDecal=async()=>{isChangeDecal.value=!0,rootStore.toggleShowDecalSelector()},toggleReapply=()=>reapplyActive.value=!reapplyActive.value,apply$1=async()=>await Lua_default.extensions.ui_liveryEditor_editMode.apply(),saveChanges=async params=>{await Lua_default.extensions.ui_liveryEditor_editMode.saveChanges(params),await Lua_default.extensions.ui_liveryEditor_editMode.deactivate(),rootStore.currentContext=EDITOR_CONTEXT.default,rootStore.editorView=EDITOR_VIEWS.default},closeCurrentTool=async()=>{await Lua_default.extensions.ui_liveryEditor_tools.closeCurrentTool()};return{...EDIT_MODE,...TRANSFORM_TOOL,...MATERIAL_TOOL,...SETTINGS_TOOL,...DECAL_LAYER,active,cursorData,appliedLayers,activeLayerUid,requestApplyActive,reapplyActive,decalTexture,editModeState,activeSettings,init:init$3,deactivate,getInitialData,toolsData,targetLayer,isStampMode,toggleStamp,requestReapply,cancelReapply,cancelChanges,requestApply,cancelRequestApply,toggleRequestApply,toggleReapply,setActiveLayer,saveChanges,requestChangeDecal,apply:apply$1,closeCurrentTool}}),useLayersManagerStore=defineStore(`layersManager`,()=>{let{events:events$3}=useBridge(),multipleSelection=ref(!1),_selection=ref([]),selectedLayers=computed({get(){return _selection.value},set(newValue){sendUpdatedSelection(newValue)}});events$3.on(`LiveryEditor_SelectedLayersChanged`,data=>{console.log(`selected Layer Updated`,data),_selection.value=data&&Array.isArray(data)&&data.length>0?data:[]});let sendUpdatedSelection=async selection=>{console.log(`sendUpdatedSelection`,selection),selection.length===0?await Lua_default.extensions.ui_liveryEditor_selection.clearSelection():multipleSelection.value?await Lua_default.extensions.ui_liveryEditor_selection.setMultipleSelected(selection):await Lua_default.extensions.ui_liveryEditor_selection.setSelected(selection)},canSort=data=>{let item=getItemByPath(data.targetDataset.draggablePath);return!(data.intersectionType===INTERSECTION_TYPES.sub&&item.type!==3)};async function clearSelection(){multipleSelection.value=!1,selectedLayers.value=[]}function getItemByPath(path){let pathSegments=path?path.split(`/`):void 0;if(!pathSegments)throw Error(`Path not defined`);let index=parseInt(pathSegments[0]),currentItem=layers.value[index];for(let i=1;i{Lua_default.extensions.ui_liveryEditor_tools_group.changeOrder(oldIndex+1,oldParentUid||``,newIndex+1,newParentUid||``)},clearSelection}});var FIRST_LAYER_ACTIONS=[{value:`edit`,label:`Edit`,icon:icons.edit,validator:()=>!0},{value:`order`,label:`Change Order`,icon:icons.order},{value:`rename`,label:`Rename`,icon:icons.rename},{value:`highlight`,label:`Highlight On`,icon:icons.eyeSolidOpened,toggleAction:!0,inactiveLabel:`Highlight Off`,inactiveIcon:icons.eyeSolidClosed},{value:`visibility`,label:`Enabled`,icon:icons.eyeOutlineOpened,toggleAction:!0,inactiveLabel:`Hidden`,inactiveIcon:icons.eyeOutlineClosed},{value:`delete`,label:`Delete`,icon:icons.trashBin2}],SELECTION_LUA=Lua_default.extensions.ui_liveryEditor_selection,SETTINGS_LUA=Lua_default.extensions.ui_liveryEditor_tools_settings,CAMERA_LUA=Lua_default.extensions.ui_liveryEditor_camera,EDITOR_LUA=Lua_default.extensions.ui_liveryEditor_editor;const EDITOR_CONTEXT={default:`default`,editMode:`editMode`,newLayer:`newLayer`};var SELECT_MODE={single:`single`,multi:`multi`};const EDITOR_VIEWS={default:`default`,decalSelector:`decalSelector`,editMode:`editMode`},useLiveryEditorStore=defineStore(`liveryEditor`,()=>{let{events:events$3}=useBridge(),layers$1=ref(null),visibleLayersCount=ref(null),selectedTool=ref(null),currentFile=ref(null),currentContext=ref(null),history$1=ref(null),selectMode=ref(SELECT_MODE.single),selectedLayers=ref([]),layerActions=ref(null),categories=ref(null),textures=ref(null),editorView=ref(EDITOR_VIEWS.main),cameraView=ref(null),showLayersManager=computed(()=>!(selectedTool.value&¤tContext.value===EDITOR_CONTEXT.editMode)),showLayerActions=computed(()=>selectedLayers.value),selectedLayerUids=computed(()=>selectedLayers.value?selectedLayers.value.map(x=>x.uid):void 0);events$3.on(`liveryEditor_OnLayersUpdated`,data=>{console.log(`liveryEditor_OnLayersUpdated`,data),layers$1.value=data}),events$3.on(`liveryEditor_Layers_OnVisibleCountChanged`,data=>{console.log(`liveryEditor_Layers_OnVisibleCountChanged`,data),visibleLayersCount.value=data}),events$3.on(`LiveryEditor_onSaveFileLoaded`,data=>{console.log(`LiveryEditor_onSaveFileLoaded`,data),currentFile.value=data}),events$3.on(`LiveryEditorLayersUpdate`,data=>{console.log(`LiveryEditorLayersUpdated`,data),layers$1.value=data}),events$3.on(`LiveryEditor_SelectedLayersDataUpdated`,async data=>{console.log(`LiveryEditor_SelectedLayersDataUpdated`,data),selectedLayers.value=data&&Array.isArray(data)?data:void 0}),events$3.on(`LiverEditorLayerActionsUpdated`,async data=>{console.log(`LiverEditorLayerActionsUpdated`,data)}),events$3.on(`LiveryEditor_onHistoryUpdated`,data=>{console.log(`LiveryEditor_onHistoryUpdated`,data),history$1.value=data}),events$3.on(`LiveryEditor_SelectedLayersChanged`,data=>{console.log(`selected Layer Updated`,data),currentContext.value=data&&data.length>0?EDITOR_CONTEXT.selectedLayer:null}),events$3.on(`LiveryEditorToolChanged`,data=>{console.log(`LiverEditorToolChanged`,data),selectedTool.value=data}),events$3.on(`LiveryEditor_OnCameraChanged`,data=>{console.log(`LiverEditorToolChanged`,data),cameraView.value=data});let dismissLayerActions=async()=>{await Lua_default.extensions.ui_liveryEditor_selection.clearSelection()},toggleEditModeLayout=async enable=>{enable=typeof enable==`boolean`?enable:currentContext.value===EDITOR_CONTEXT.default,enable?(currentContext.value=EDITOR_CONTEXT.editMode,editorView.value=EDITOR_VIEWS.editMode):(currentContext.value=EDITOR_CONTEXT.default,editorView.value=EDITOR_VIEWS.default)};function toggleShowDecalSelector(){editorView.value===EDITOR_VIEWS.decalSelector?editorView.value=EDITOR_VIEWS.editMode:editorView.value=EDITOR_VIEWS.decalSelector}let requestDismissLayerActions=()=>{currentContext.value===EDITOR_CONTEXT.newLayer?currentContext.value=null:currentContext.value===EDITOR_CONTEXT.selectedLayer&&(selectedLayers.value=[])},selectSingle=async layerUid=>{await Lua_default.extensions.ui_liveryEditor_selection.setSelected(layerUid)},toggleVisibility=async layer=>await Lua_default.extensions.ui_liveryEditor_tools_settings.toggleVisibilityById(layer.id),toggleLock=async layer=>await Lua_default.extensions.ui_liveryEditor_tools_settings.toggleLockById(layer.id),changeOrder=async(layer,direction$1)=>{direction$1===-1?await Lua_default.extensions.ui_liveryEditor_tools_group.moveOrderUpById(layer.uid):direction$1===1&&await Lua_default.extensions.ui_liveryEditor_tools_group.moveOrderDownById(layer.uid)},startEditor=async()=>{if(await Lua_default.extensions.ui_liveryEditor_editor.startEditor(),await Lua_default.extensions.ui_liveryEditor_editor.startSession(),currentContext.value=EDITOR_CONTEXT.default,editorView.value=EDITOR_VIEWS.default,await CAMERA_LUA.setOrthographicView(`right`),categories.value=await Lua_default.extensions.ui_liveryEditor_resources.getTextureCategories(),categories.value&&categories.value.length>0){let firstCategory=categories.value[0];setTexturesByCategory(firstCategory.value)}};async function setTexturesByCategory(category){textures.value=(await Lua_default.extensions.ui_liveryEditor_resources.getTexturesByCategory(category)).items}let createSaveFile=async filename=>{await Lua_default.extensions.ui_liveryEditor_userData.createSaveFile(filename)},useTool=async(toolName,params)=>{await Lua_default.extensions.ui_liveryEditor_tools.useTool(toolName)};async function onActionItemSelected(action){if(!action.items){let firstSelected=selectedLayers.value&&selectedLayers.value.length>0?selectedLayers.value[0]:null;if(action.value===`delete`)await openConfirmation(`Delete Layer`,`Are you sure you want to delete ${firstSelected.name}?`)&&await Lua_default.extensions.ui_liveryEditor_tools_settings.deleteLayer();else if(action.value===`rename`){let res=await openRenameLayerDialog(`Rename Layer`,``,{name:firstSelected.name},model=>model.name!==null&&model.name!==void 0&&model.name!==``&&model.name!==firstSelected.name);res.value&&await Lua_default.extensions.ui_liveryEditor_tools_settings.rename(res.formData.name)}else action.value===`duplicate`?await SELECTION_LUA.duplicateSelectedLayer():action.value===`visibility`?await SETTINGS_LUA.toggleVisibility():action.value===`highlight`?await SELECTION_LUA.toggleHighlightSelectedLayer():await Lua_default.extensions.ui_liveryEditor_tools.useTool(action.value)}}let editorState=reactive({isOpenExitDialog:!1,exitDialogResult:null,saving:!1});async function openExitDialog(){let res=await openFormDialog(ExitEditorDialog_default,ref({name:currentFile.value?currentFile.value.name:void 0,applySkin:!!(currentFile.value&¤tFile.value.name)}),form=>!form||!form.name?{error:!0,message:`Invalid Save Name`}:{error:!1},`Exit Editor`,null,[{label:`Cancel`,value:-1,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:`Save and Exit`,value:1,emitData:!0,disableIfInvalid:!0,extras:{icon:icons.saveAs1}},{label:`Exit`,value:0,emitData:!0,extras:{accent:ACCENTS.attention,icon:icons.exit}}]);return res.value===-1?!1:(res.value===1&&await EDITOR_LUA.save(res.formData.name),res.formData.applySkin&&await EDITOR_LUA.applySkin(),await exit(),!0)}async function save(forceOpenPopup=!1){if(!currentFile.value||!currentFile.value.name||forceOpenPopup){editorState.isOpenExitDialog=!0;let res=await openEditFileDialog(`Save file`,`Enter name of your new save file`,{name:currentFile.value?currentFile.value.name:createFilename()},model=>model.name!==null&&model.name!==void 0&&model.name!==``);return res.value&&(editorState.saving=!0,await Lua_default.extensions.ui_liveryEditor_editor.save(res.formData.name),editorState.saving=!1),editorState.isOpenExitDialog=!1,res.value}else await Lua_default.extensions.ui_liveryEditor_editor.save(currentFile.value.name)}async function exit(){router_default.replace({name:`garagemode`}),await Lua_default.extensions.ui_liveryEditor_editor.exitEditor()}function createFilename(){let currentDate=new Date;return`${currentDate.getFullYear()}-${String(currentDate.getMonth()+1).padStart(2,`0`)}-${String(currentDate.getDate()).padStart(2,`0`)}_${String(currentDate.getHours()).padStart(2,`0`)}-${String(currentDate.getMinutes()).padStart(2,`0`)}-${String(currentDate.getSeconds()).padStart(2,`0`)}`}return{...SELECTION_LUA,...CAMERA_LUA,...SETTINGS_LUA,layers:layers$1,visibleLayersCount,layerActions,selectedTool,currentFile,currentContext,textures,categories,editorView,showLayersManager,showLayerActions,cameraView,editorState,dismissLayerActions,setTexturesByCategory,toggleEditModeLayout,toggleShowDecalSelector,requestDismissLayerActions,onActionItemSelected,selectMode,selectedLayers,selectedLayerUids,createSaveFile,toggleVisibility,toggleLock,startEditor,save,useTool,selectSingle,changeOrder,openExitDialog}}),SORT_OPTIONS=Object.freeze({name:`name`,modified:`modified`}),useLiveryFileStore=defineStore(`liveryFile`,()=>{let{events:events$3}=useBridge(),dataFiles=ref(null),sortKey=ref(SORT_OPTIONS.modified),sortDesc=ref(!0),files=computed(()=>{if(!dataFiles.value)return[];let sortOrder=sortDesc.value?-1:1;return dataFiles.value.sort((a$1,b)=>a$1[sortKey.value]b[sortKey.value]?1*sortOrder:0)}),init$3=async()=>{await Lua_default.extensions.ui_liveryEditor_userData.requestUpdatedData()},loadFile=async file$1=>await Lua_default.extensions.ui_liveryEditor_editor.loadFile(file$1.location),renameFile=async(file$1,newFilename)=>{await Lua_default.extensions.ui_liveryEditor_userData.renameFile(file$1.name,newFilename)},deleteFile=async file$1=>{await Lua_default.extensions.ui_liveryEditor_userData.deleteSaveFile(file$1.name)};events$3.on(`LiverySaveFilesUpdated`,data=>{data&&Array.isArray(data)&&data.length>0?(data.forEach(x=>{x.modifiedFormatted=formatDateTime(x.modified),x.fileSizeFormatted=formatSize(x.fileSize)}),dataFiles.value=data):dataFiles.value=[]});function formatDateTime(unixTime){let datetime=new Date(unixTime*1e3);return`${datetime.toLocaleDateString()} ${datetime.toLocaleTimeString()}`}function formatSize(bytes){return`${(bytes/1024).toFixed(2)} KB`}return{files,sortKey,sortDesc,init:init$3,loadFile,renameFile,deleteFile}});var EDITOR_RESOURCES_LUA=Lua_default.extensions.ui_liveryEditor_resources;const useDecalSelectorStore=defineStore(`liveryEditorDecalSelector`,()=>{let{events:events$3}=useBridge(),categories=ref(null),currentCategory=ref(null),isShow=ref(!1),textures=computed(()=>{if(!categories.value)return;let category=categories.value.find(x=>x.value===currentCategory.value);return category?category.items:void 0});async function init$3(){if(categories.value=await EDITOR_RESOURCES_LUA.getTextureCategories(),categories.value&&Array.isArray(categories.value)&&categories.value.length>0){let first=categories.value[0].value;await setCategory(first)}}async function setCategory(category){await fetchTextures(category),currentCategory.value=category}async function fetchTextures(category){let index=categories.value.findIndex(x=>x.value===category);if(index===-1)return;let textures$1=categories.value[index].items;if(index>=0&&(!textures$1||!textures$1.length===0)){let categoryWithTextures=await EDITOR_RESOURCES_LUA.getTexturesByCategory(category);categories.value[index].items=categoryWithTextures.items}}async function toggle(){isShow.value=!isShow.value,events$3.emit(`liveryEditor_onDecalStateChanged`,{show:isShow.value})}async function selectDecalItem(texturePath){await Lua_default.extensions.ui_liveryEditor_layerEdit.setup(),await Lua_default.extensions.ui_liveryEditor_layerEdit.editNewDecal({texturePath})}async function cancelSelection(){events$3.emit(`liveryEditor_onDecalSelectorCancelled`)}return{categories,currentCategory,textures,isShow,init:init$3,toggle,setCategory,selectDecalItem,cancelSelection}});var DEFAULT_ACCELERATION_RATE=.75,DEFAULT_ACCELERATION_NATURE=1.75,DEFAULT_ACTION_INTERVAL_MS=150,FOCUS_LD_TRIGGER_VALUE$2=-.5,FOCUS_RU_TRIGGER_VALUE$2=.5;const ACTION_PARAMS_TYPE={xyPoints:`xyPoints`,xPoint:`xPoint`},useActionHoldService=defineStore(`actionHoldService`,()=>{let data=ref({}),start=id=>{if(!data.value[id])throw Error(`Error starting hold action ${id}. Id not found.`);data.value[id].holdFn=setInterval(createHoldFn(id),data.value[id].actionInterval)},reset$1=id=>{let action=data.value[id];action&&(action.holdFn&&clearInterval(action.holdFn),data.value[id].holdFn=null,data.value[id].holdTimeMs=0)},add$2=(id,actionFn,immediateStart=!1,options={actionInterval:DEFAULT_ACTION_INTERVAL_MS,accelerationRate:DEFAULT_ACCELERATION_RATE,accelerationNature:DEFAULT_ACCELERATION_NATURE})=>{if(data.value[id])throw Error(`Error adding hold action for ${id}. Id already exists.`);data.value[id]={actionFn,...options,holdTimeMs:0,holdFn:null},immediateStart&&start(id)},remove$3=id=>{data.value[id]&&(reset$1(id),delete data.value[id])},removeAll=id=>{remove$3(id),remove$3(getFocusScalarName(id)),remove$3(getFocusScalarXName(id)),remove$3(getFocusScalarYName(id))},clear=()=>{let keys=Object.keys(data.value);for(let i=0;i{data.value[id]&&remove$3(id),add$2(id,actionFn,immediateStart,options)},onFocus=(id,actionFn,element,actionParamsType=ACTION_PARAMS_TYPE.xyPoints)=>{if(remove$3(getFocusScalarXName(id)),remove$3(getFocusScalarYName(id)),element.detail.value===0){remove$3(id);return}let eventName=element.detail.name,xDirection=0,yDirection=0;switch(eventName){case`focus_l`:xDirection=-1;break;case`focus_r`:xDirection=1;break;case`focus_d`:yDirection=-1;break;case`focus_u`:yDirection=1;break}switch(actionParamsType){case ACTION_PARAMS_TYPE.xyPoints:actionFn(xDirection,yDirection),addOrUpdate(id,multiplier=>actionFn(xDirection*multiplier,yDirection*multiplier),!0);break;case ACTION_PARAMS_TYPE.xPoint:let xValue=xDirection===0?yDirection:xDirection;xValue!==0&&(actionFn(xValue),addOrUpdate(id,multiplier=>actionFn(xValue*multiplier),!0));break}},inputNavStates=reactive({xLatestValue:0,yLatestValue:0,latestEventName:null}),onFocusScalar=(id,actionFn,element,actionParamsType=ACTION_PARAMS_TYPE.xyPoints)=>{console.log(`onFocusScalar`,{id,name:element.detail.name,value:element.detail.value}),remove$3(id);let eventName=element.detail.name,eventValue=element.detail.value;if(inputNavStates.latestEventName===eventName&&((eventName===`focus_lr`||eventName===`rotate_h_cam`)&&eventValue===inputNavStates.xLatestValue||(eventName===`focus_ud`||eventName===`rotate_v_cam`)&&eventValue===inputNavStates.yLatestValue))return;let xDirection=0,yDirection=0;if(eventName===`focus_lr`||eventName===`rotate_h_cam`){if(eventValue>FOCUS_RU_TRIGGER_VALUE$2&&eventValue>inputNavStates.xLatestValue?xDirection=1:eventValueactionFn(xDirection*multiplier,0),!0);break;case ACTION_PARAMS_TYPE.xPoint:actionFn(xDirection),addOrUpdate(getFocusScalarXName(id),multiplier=>actionFn(xDirection*multiplier),!0);break}inputNavStates.latestEventName=eventName}else remove$3(getFocusScalarXName(id));inputNavStates.xLatestValue=eventValue}else (eventName===`focus_ud`||eventName===`rotate_v_cam`)&&actionParamsType!==ACTION_PARAMS_TYPE.xPoint&&(eventValue>FOCUS_RU_TRIGGER_VALUE$2&&eventValue>inputNavStates.yLatestValue?yDirection=1:eventValueactionFn(0,yDirection*multiplier),!0),inputNavStates.latestEventName=eventName),inputNavStates.yLatestValue=eventValue)};function createHoldFn(id){let action=data.value[id];return()=>{let multiplier=1+action.accelerationRate*(action.holdTimeMs/1e3)**action.accelerationNature;action.actionFn(multiplier),data.value[id].holdTimeMs=action.holdTimeMs+action.actionInterval}}function getFocusScalarName(id){return`${id}_scalar`}function getFocusScalarXName(id){return`${getFocusScalarName(id)}_x`}function getFocusScalarYName(id){return`${getFocusScalarName(id)}_y`}return{onFocus,onFocusScalar,add:add$2,addOrUpdate,remove:remove$3,removeAll,clear,start,reset:reset$1}}),HEADER_SECTION_TYPE={start:`start`,center:`center`,end:`end`},useEditorHeaderStore=defineStore(`editorHeader`,()=>{let header=reactive({heading:null,preheading:[],type:`line`}),headerItems=ref([]),startSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.start)),centerSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.center)),endSectionItems=computed(()=>headerItems.value.filter(x=>x.section===HEADER_SECTION_TYPE.end)),headerHidden=ref(!1),itemsHidden=ref(!1),setHeader=(heading,headerType=`line`)=>{header.heading=heading,header.type=headerType},setPreheader=text=>{typeof text==`string`?header.preheading=[text]:header.preheading=text},addItems=(items$2,prepend=!1)=>{prepend?headerItems.value.unshift(...items$2):headerItems.value.push(...items$2)},addItem=(item,prepend=!1)=>{prepend?headerItems.value.unshift(item):headerItems.value.push(item)},addOrUpdateItem=(item,prepend=!1,prependIdOrIndex=0)=>{let existingIndex=-1;if(headerItems.value&&(existingIndex=headerItems.value.findIndex(x=>x.id===item.id)),existingIndex>-1)headerItems.value[existingIndex]={...item};else if(prepend){let preprendIdIndex=findIdOrIndex(prependIdOrIndex);headerItems.value.splice(preprendIdIndex,0,item)}else headerItems.value.push(item)},removeItem=itemOrId=>{let id=itemOrId.hasOwnProperty(`id`)?itemOrId.id:itemOrId,index=headerItems.value.findIndex(x=>x.id===id);index>-1&&headerItems.value.splice(index,1)},removeItems=itemsOrIds=>itemsOrIds.forEach(x=>removeItem(x)),removeItemsExcept=itemsOrIds=>{let ids=itemsOrIds.map(x=>x.hasOwnProperty(`id`)?x.id:x);removeItems(items.value.filter(x=>!ids.includes(x.id)))},showItem=itemOrId=>{let index=findIdOrIndex(itemOrId);index>-1&&(headerItems.value[index].hidden=!1)},hideItem=itemOrId=>{let index=findIdOrIndex(itemOrId);index>-1&&(headerItems.value[index].hidden=!0)},clearItems=()=>headerItems.value=[],getItem=id=>items.value.find(x=>x.id===id);function findIdOrIndex(idOrIndex){let prependIdIndex=headerItems.value.findIndex(x=>x.id===idOrIndex);return prependIdIndex===-1&&typeof idOrIndex==`number`&&idOrIndex>-1&&idOrIndex{let Controls=controls_default(),{events:events$3}=useBridge(),isSetupDone=ref(!1),{isControllerAvailable}=storeToRefs(Controls),currentSave=ref(initCurrentSave()),isLayerEditInitialized=ref(!1);watch(isControllerAvailable,async available=>{available&&await Lua_default.extensions.ui_liveryEditor.useMousePosition(!1)},{immediate:!0});async function onSetupDone(){isControllerAvailable.value&&await Lua_default.extensions.ui_liveryEditor.useMousePosition(!1)}function load(file$1){currentSave.value=file$1,isSetupDone.value=!1}function onChangeView(view){console.log(`onChangeView`,view),router_default.push({name:view})}async function setup$3(){isSetupDone.value||=(events$3.on(`liveryEditor_SetupSuccess`,onSetupDone),events$3.on(`liveryEditor_changeView`,onChangeView),await Lua_default.extensions.ui_liveryEditor.setup(currentSave.value.location),!0)}async function save(){await Lua_default.extensions.ui_liveryEditor.save(currentSave.value.name)}async function exit(){isSetupDone.value=!1,resetSave(),await Lua_default.extensions.ui_liveryEditor.deactivate()}async function setupLayerEdit(){isLayerEditInitialized.value||=(await Lua_default.extensions.ui_liveryEditor_camera.setOrthographicView(`right`),!0)}async function exitLayerEdit(){isLayerEditInitialized.value=!1}function resetSave(){currentSave.value=initCurrentSave()}function initCurrentSave(){return{name:createFilename(),location:null}}function dispose$2(){events$3.off(`liveryEditor_SetupSuccess`,onSetupDone)}function createFilename(){let currentDate=new Date;return`${currentDate.getFullYear()}-${String(currentDate.getMonth()+1).padStart(2,`0`)}-${String(currentDate.getDate()).padStart(2,`0`)}_${String(currentDate.getHours()).padStart(2,`0`)}-${String(currentDate.getMinutes()).padStart(2,`0`)}-${String(currentDate.getSeconds()).padStart(2,`0`)}`}return{currentSave,isSetupDone,load,setupLayerEdit,exitLayerEdit,save,exit,setup:setup$3,resetSave,dispose:dispose$2}});var _sfc_main$112=Object.assign({width:8,height:8,margin:.25},{__name:`DecalSelectorItem`,props:{externalImage:String},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngImageTile_default),normalizeProps(guardReactiveProps(props)),null,16))}}),DecalSelectorItem_default=_sfc_main$112,_hoisted_1$102={"bng-ui-scope":`liveryeditor-decal-selector`,class:`decal-selector`},_hoisted_2$86={class:`header-wrapper`},_hoisted_3$75={key:0,class:`filters-wrapper`},_sfc_main$111={__name:`DecalSelector`,setup(__props){useUINavScope(`liveryeditor-decal-selector`);let store$1=useDecalSelectorStore(),headerStore=useEditorHeaderStore(),selectedCategory=computed({get:()=>[store$1.currentCategory],async set(values){await store$1.setCategory(values[0])}}),switchCategory=direction$1=>{let index=store$1.categories.findIndex(x=>x.value===store$1.currentCategory);index!==-1&&(direction$1===-1?index>0?--index:index=store$1.categories.length-1:index{await store$1.init(),getUINavServiceInstance().useCrossfire=!0});let headerItemsHiddenValue=null;return onMounted(()=>{headerItemsHiddenValue=headerStore.itemsHidden,headerStore.itemsHidden||=!0}),onUnmounted(()=>{headerStore.itemsHidden=headerItemsHiddenValue}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$102,[createBaseVNode(`div`,_hoisted_2$86,[createVNode(unref(bngCardHeading_default),{class:`decal-selector-heading`,type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Select Decal`,-1)]]),_:1}),createVNode(unref(bngButton_default),{"bng-no-nav":!0,accent:`attention`,label:`Close`,onClick:unref(store$1).cancelSelection},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{action:`menu_item_back`})]),_:1},8,[`onClick`])]),unref(store$1).categories?(openBlock(),createElementBlock(`div`,_hoisted_3$75,[createBaseVNode(`div`,null,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_tab_left`})]),createVNode(bngPillFilters_default,{modelValue:selectedCategory.value,"onUpdate:modelValue":_cache[0]||=$event=>selectedCategory.value=$event,"bng-no-child-nav":!0,options:unref(store$1).categories,required:``},null,8,[`modelValue`,`options`]),createBaseVNode(`div`,null,[createVNode(unref(bngBinding_default),{action:`menu_tab_right`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallRight},null,8,[`type`])])])):createCommentVNode(``,!0),unref(store$1).textures&&unref(store$1).textures.length>0?(openBlock(),createBlock(unref(bngList_default),{key:1,noBackground:``},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(store$1).textures,(item,index)=>withDirectives((openBlock(),createBlock(DecalSelectorItem_default,{"bng-nav-item":``,key:item.preview,externalImage:item.preview,"data-decal-item":index,onClick:()=>unref(store$1).selectDecalItem(item.preview)},null,8,[`externalImage`,`data-decal-item`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])),128))]),_:1})):createCommentVNode(``,!0)])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>unref(store$1).cancelSelection(),`menu`],[unref(BngOnUiNav_default),()=>unref(store$1).cancelSelection(),`back`],[unref(BngOnUiNav_default),()=>switchCategory(-1),`tab_l`],[unref(BngOnUiNav_default),()=>switchCategory(1),`tab_r`]])}},DecalSelector_default=__plugin_vue_export_helper_default(_sfc_main$111,[[`__scopeId`,`data-v-e09a2ff1`]]),_hoisted_1$101={class:`decal-preview-tile`},_sfc_main$110={__name:`DecalPreviewTile`,props:{textureImage:{type:String,required:!0},textureColor:{type:Array,default:[255,255,255,1]},backgroundImage:String},setup(__props){useCssVars(_ctx=>({v036f09bc:alphaTextureBackground.value,v06c06c52:imgColor.value,v174dbaea:imageUrl.value}));let props=__props,alphaTextureBackground=computed(()=>`url(${props.backgroundImage?props.backgroundImage:getAssetURL(`images/alpha_texture.png`)}`),imageUrl=computed(()=>`url(${props.textureImage})`),imgColor=computed(()=>{let isDecimalFormat=props.textureColor.every(x=>x>=0&&x<=1),red=props.textureColor[0],green=props.textureColor[1],blue=props.textureColor[2],alpha=props.textureColor[3];return isDecimalFormat&&(red=Math.floor(red*255),green=Math.floor(green*255),blue=Math.floor(blue*255)),`rgba(${red}, ${green}, ${blue}, ${alpha})`});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$101,[..._cache[0]||=[createBaseVNode(`div`,{class:`image`},null,-1)]]))}},DecalPreviewTile_default=__plugin_vue_export_helper_default(_sfc_main$110,[[`__scopeId`,`data-v-8377c081`]]),_hoisted_1$100=[`disabled`],_sfc_main$109={__name:`EditModeLayersPreview`,props:{contextMenuName:String},setup(__props){let store$1=useLayerSettingsStore(),scroller=ref(null),tiles=ref({}),disabled=computed(()=>store$1.requestApplyActive||store$1.reapplyActive),onLayerClicked=async layer=>{store$1.activeLayerUid===layer.uid&&store$1.appliedLayers.length>1||await store$1.setActiveLayer(layer.uid)};watch(()=>store$1.activeLayerUid,layerUid=>{layerUid&&scrollTo(layerUid)});function setTileRef(layerUid,el){tiles.value[layerUid]=el}function scrollTo(layerUid){let tileEl=tiles.value[layerUid];if(!tileEl)return;let scrollerOffsetBottom=scroller.value.offsetTop+scroller.value.offsetHeight,scrollerOffsetTop=scroller.value.offsetTop+scroller.value.scrollTop,tileElOffsetBottom=tileEl.offsetTop+tileEl.offsetHeight,overflowsTop=tileEl.offsetTopscrollerOffsetBottom;!overflowsTop&&!overflowsBottom||window.requestAnimationFrame(()=>{overflowsTop?scroller.value.scrollBy({top:-(scrollerOffsetTop-tileEl.offsetTop)}):overflowsBottom&&(scroller.value.scrollTop=tileElOffsetBottom-scrollerOffsetBottom)})}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`layers-preview`,disabled:disabled.value},[createBaseVNode(`div`,{class:`item-navigation navigation-up`,onClick:_cache[0]||=$event=>unref(store$1).setActiveLayerDirection(-1)},[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallUp},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`activate_previous_layer`,deviceMask:`xinput`,class:`navigation-icon`})]),createBaseVNode(`div`,{ref_key:`scroller`,ref:scroller,class:`preview-scroller`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(store$1).appliedLayers,layer=>(openBlock(),createElementBlock(`div`,{ref_for:!0,ref:el=>setTileRef(layer.uid,el),key:layer.uid,class:normalizeClass([{active:unref(store$1).activeLayerUid===layer.uid},`layer-item`])},[unref(store$1).activeLayerUid===layer.uid?withDirectives((openBlock(),createBlock(DecalPreviewTile_default,{key:0,class:`preview-img`,textureImage:layer.preview,textureColor:layer.color},null,8,[`textureImage`,`textureColor`])),[[unref(BngPopover_default),`context-menu`,`right`,{click:!0}]]):(openBlock(),createBlock(DecalPreviewTile_default,{key:1,class:`preview-img`,textureImage:layer.preview,textureColor:layer.color,onClick:()=>onLayerClicked(layer)},null,8,[`textureImage`,`textureColor`,`onClick`])),unref(store$1).activeLayerUid===layer.uid?(openBlock(),createBlock(unref(bngIcon_default),{key:2,class:`contextmenu-icon`,type:unref(icons).edit},null,8,[`type`])):createCommentVNode(``,!0)],2))),128))],512),createBaseVNode(`div`,{class:`item-navigation navigation-down`,onClick:_cache[1]||=$event=>unref(store$1).setActiveLayerDirection(1)},[createVNode(unref(bngBinding_default),{action:`activate_next_layer`,deviceMask:`xinput`,class:`navigation-icon`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallDown},null,8,[`type`])])],8,_hoisted_1$100))}},EditModeLayersPreview_default=__plugin_vue_export_helper_default(_sfc_main$109,[[`__scopeId`,`data-v-9ede6133`]]),_hoisted_1$99={class:`material-settings`,"bng-ui-scope":`material-settings`},_hoisted_2$85={class:`subsettings-selector`},_hoisted_3$74=[`onClick`],_hoisted_4$57={class:`settings-content`},_hoisted_5$47={key:0,class:`setting-item color-setting`},_hoisted_6$34={key:1,class:`setting-item item-column`},_hoisted_7$29={class:`slider-text-container`},_hoisted_8$22={key:2,class:`setting-item item-column`},_hoisted_9$19={class:`slider-text-container`},_hoisted_10$13={key:3,class:`setting-item item-column`},_hoisted_11$11={class:`slider-text-container`},INPUT_CONTROL_STEPS$4=.01,INPUT_CONTROL_MIN$4=0,INPUT_CONTROL_MAX$4=1,CONTROLLER_SLIDER_BINDING=`focus_lr`,CONTROLLER_CHANGE_SUBSETTINGS_HINTS=[{id:`activate_previous_subsettings`,content:{type:`binding`,props:{uiEvent:`focus_u`},label:`Previous Setting`}},{id:`activate_next_subsettings`,content:{type:`binding`,props:{uiEvent:`focus_d`},label:`Next Setting`}}],subSettings=[{label:`Color`,icon:icons.colorCirclePalette,value:`color`},{label:`Saturation`,icon:icons.colorSaturation,value:`saturation`},{label:`Metalness`,icon:icons.materialMetal,value:`metallicIntensity`},{label:`Roughness`,icon:icons.materialRoughness,value:`roughnessIntensity`}],_sfc_main$108={__name:`LayerMaterialSettings`,emits:[`subSettingChanged`],setup(__props,{emit:__emit}){let emit$1=__emit,store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),activeSubSettingsIndex=ref(0),_color=reactive({hue:.5,saturation:1,luminosity:.5}),color=computed({get:()=>_color,set:async newValue=>{let paint=new Paint;paint.hsl=[newValue.hue,newValue.saturation,newValue.luminosity],await store$1.setColor([paint.red,paint.green,paint.blue,paint.alpha])}}),saturation=computed({get:()=>_color.saturation,set:async newValue=>{let sat=parseFloat(newValue.toFixed(2));color.value={hue:color.value.hue,saturation:sat,luminosity:color.value.luminosity},_color.saturation=sat}}),metallicIntensity=computed({get:()=>store$1.cursorData?store$1.cursorData.metallicIntensity:void 0,set:async newValue=>{await store$1.setMetallicIntensity(newValue)}}),roughnessIntensity=computed({get:()=>store$1.cursorData?store$1.cursorData.roughnessIntensity:void 0,set:async newValue=>{await store$1.setRoughnessIntensity(newValue)}}),activeSubSetting=computed(()=>subSettings[activeSubSettingsIndex.value]);watch(()=>store$1.activeLayerUid,(newValue,oldValue)=>{newValue&&oldValue&&initColorPicker(store$1.cursorData.color)},{deep:!0}),watch(activeSubSetting,(value,oldValue)=>{oldValue&&actionHoldService.remove(oldValue),setHints(),emit$1(`subSettingChanged`,value)},{immediate:!0}),onBeforeUnmount(()=>{actionHoldService.removeAll(`color`),actionHoldService.removeAll(`saturation`),actionHoldService.removeAll(`metallicIntensity`),actionHoldService.removeAll(`roughnessIntensity`),emit$1(`subSettingChanged`,void 0)}),onMounted(()=>{store$1.cursorData.color&&initColorPicker(store$1.cursorData.color)});let goPreviousSubSetting=()=>{activeSubSettingsIndex.value>0?--activeSubSettingsIndex.value:activeSubSettingsIndex.value=subSettings.length-1},goNextSubSetting=()=>{activeSubSettingsIndex.valuechangeColor(hue,luminosity,0);break;case`saturation`:actionFn=saturation$1=>changeColor(0,0,saturation$1);break;case`metallicIntensity`:actionFn=changeMetallicIntensity,actionParamsType=ACTION_PARAMS_TYPE.xPoint;break;case`roughnessIntensity`:actionFn=changeRoughnessIntensity,actionParamsType=ACTION_PARAMS_TYPE.xPoint;break}scalar?actionHoldService.onFocusScalar(subsettingValue,actionFn,element,actionParamsType):actionHoldService.onFocus(subsettingValue,actionFn,element,actionParamsType)}}async function changeColor(h$1,l,s){let newHue=color.value.hue+.01*h$1,newLuminosity=color.value.luminosity+.01*l,newSaturation=parseFloat((color.value.saturation+.1*s).toFixed(2));(newHue<0||newHue>1)&&(newHue=color.value.hue),(newLuminosity<0||newLuminosity>1)&&(newLuminosity=color.value.luminosity),(newSaturation<0||newSaturation>1)&&(newSaturation=color.value.saturation),_color.hue=newHue,_color.saturation=newSaturation,_color.luminosity=newLuminosity;let paint=new Paint;paint.hsl=[newHue,newSaturation,newLuminosity],store$1.setColor([paint.red,paint.green,paint.blue,paint.alpha])}let changeMetallicIntensity=direction$1=>{let newValue=metallicIntensity.value+.1*direction$1;newValue>=0&&newValue<=1&&(metallicIntensity.value=newValue)},changeRoughnessIntensity=direction$1=>{let newValue=roughnessIntensity.value+.1*direction$1;newValue>=0&&newValue<=1&&(roughnessIntensity.value=newValue)};function updateColorPickerModel(rgba){let paint=new Paint;paint.rgba=rgba,_color.hue=paint.hue,_color.saturation=paint.saturation,_color.luminosity=paint.luminosity}store$1.$onAction(({name,store:store$2,args,after,onError})=>{after(result=>{name===`resetCursorProperties`&&args[0].includes(`material`)&&initColorPicker(store$2.cursorData.color)})});function onReset(){let defaultColor=[1,1,1,1];switch(activeSubSetting.value.value){case`color`:store$1.setColor(defaultColor),updateColorPickerModel(defaultColor),saturation.value=1;break;case`saturation`:saturation.value=1;break;case`metallicIntensity`:metallicIntensity.value=0;break;case`roughnessIntensity`:roughnessIntensity.value=0;break}}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function initColorPicker(color$1){let isWhite=color$1.every(x=>x===1),paint=new Paint;paint.rgba=color$1,_color.hue=paint.hue,_color.saturation=isWhite?1:paint.saturation,_color.luminosity=paint.luminosity}useUINavScope(`material-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){removeHints(),showIfController.value&&infoBar.addHints(CONTROLLER_CHANGE_SUBSETTINGS_HINTS)}function removeHints(){infoBar.removeHints(...CONTROLLER_CHANGE_SUBSETTINGS_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$99,[createBaseVNode(`div`,_hoisted_2$85,[(openBlock(),createElementBlock(Fragment,null,renderList(subSettings,(subtab,index)=>withDirectives(createBaseVNode(`div`,{key:subtab.value,class:normalizeClass([{active:index===activeSubSettingsIndex.value},`subsettings-selector-item`]),onClick:()=>activeSubSettingsIndex.value=index},[createVNode(unref(bngIcon_default),{type:subtab.icon,class:`selector-item-icon`},null,8,[`type`])],10,_hoisted_3$74),[[unref(BngTooltip_default),index===activeSubSettingsIndex.value?void 0:subtab.label,`left`]])),64))]),createBaseVNode(`div`,_hoisted_4$57,[activeSubSetting.value.value===`color`?(openBlock(),createElementBlock(`div`,_hoisted_5$47,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,view:`luminosity`},null,8,[`modelValue`])])):createCommentVNode(``,!0),activeSubSetting.value.value===`saturation`?(openBlock(),createElementBlock(`div`,_hoisted_6$34,[createBaseVNode(`div`,_hoisted_7$29,[createVNode(unref(bngSlider_default),{modelValue:saturation.value,"onUpdate:modelValue":_cache[1]||=$event=>saturation.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:saturation.value,"onUpdate:modelValue":_cache[2]||=$event=>saturation.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):activeSubSetting.value.value===`metallicIntensity`?(openBlock(),createElementBlock(`div`,_hoisted_8$22,[createBaseVNode(`div`,_hoisted_9$19,[createVNode(unref(bngSlider_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[3]||=$event=>metallicIntensity.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[4]||=$event=>metallicIntensity.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):activeSubSetting.value.value===`roughnessIntensity`?(openBlock(),createElementBlock(`div`,_hoisted_10$13,[createBaseVNode(`div`,_hoisted_11$11,[createVNode(unref(bngSlider_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[5]||=$event=>roughnessIntensity.value=$event,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[6]||=$event=>roughnessIntensity.value=$event,type:`number`,min:INPUT_CONTROL_MIN$4,max:INPUT_CONTROL_MAX$4,step:INPUT_CONTROL_STEPS$4},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SLIDER_BINDING,deviceMask:`xinput`})])])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),goNextSubSetting,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onFocus,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_lr`],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_ud`]])}},LayerMaterialSettings_default=__plugin_vue_export_helper_default(_sfc_main$108,[[`__scopeId`,`data-v-ffe74e63`]]),_hoisted_1$98={class:`mirror-settings`,"bng-ui-scope":`mirror-settings`},_hoisted_2$84={class:`setting-item`},_hoisted_3$73={class:`setting-item offset-item`},_hoisted_4$56={class:`setting-item offset-item`},FOCUS_LD_TRIGGER_VALUE$1=-.999,FOCUS_RU_TRIGGER_VALUE$1=.999,FOCUS_HOLD_INTERVAL_MS=250,MIRROR_BINDING=`focus_l`,FLIP_BINDING=`focus_r`,CONTROLLER_OFFSET_BINDING=`focus_ud`,CONTROLLER_HINTS$4=[],KEYBOARD_HINTS$4=[],_sfc_main$107={__name:`LayerMirrorSettings`,setup(__props){let store$1=useLayerSettingsStore(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),inputNavStates=reactive({focusXLatestValue:0,focusYLatestValue:0,holdEventLatest:null,holdInterval:null}),mirror=computed({get:()=>store$1.cursorData?store$1.cursorData.mirrored:void 0,set:async newValue=>await store$1.setMirrored(newValue,store$1.cursorData.flipMirroredDecal)}),flip$2=computed({get:()=>store$1.cursorData?store$1.cursorData.flipMirroredDecal:void 0,set:async newValue=>await store$1.setMirrored(store$1.cursorData.mirrored,newValue)}),offset$2=computed({get:()=>store$1.cursorData?store$1.cursorData.mirrorOffset:void 0,set:async newValue=>await store$1.setMirrorOffset(newValue)}),toggleMirror=()=>mirror.value=!mirror.value,toggleFlipped=()=>{mirror.value&&(flip$2.value=!flip$2.value)},changeOffset=element=>{if(!mirror.value)return;let eventName=element.detail.name,direction$1=eventName===`focus_d`?-1:1,isPressed=element.detail.value;inputNavStates.holdEventLatest===eventName&&!isPressed&&inputNavStates.holdInterval&&(clearInterval(inputNavStates.holdInterval),inputNavStates.holdInterval=null),direction$1>0&&isPressed?doHoldAction(()=>store$1.setMirrorOffset(offset$2.value+1),eventName):direction$1<0&&isPressed&&doHoldAction(()=>store$1.setMirrorOffset(offset$2.value-1),eventName)},changeOffsetScalar=element=>{if(!mirror.value)return;let eventName=element.detail.name,direction$1=element.detail.value;inputNavStates.holdEventLatest===eventName&&inputNavStates.holdInterval&&clearInterval(inputNavStates.holdInterval),direction$1>FOCUS_RU_TRIGGER_VALUE$1&&direction$1>inputNavStates.focusXLatestValue?doHoldAction(()=>store$1.setMirrorOffset(offset$2.value+1),eventName):direction$1store$1.setMirrorOffset(offset$2.value-1),eventName),inputNavStates.focusXLatestValue=direction$1};function onReset(){store$1.setMirrored(!1,!1),store$1.setMirrorOffset(0)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function doHoldAction(callbackFn,eventName){inputNavStates.holdInterval&&=(clearInterval(inputNavStates.holdInterval),null),callbackFn(),inputNavStates.holdInterval=setInterval(callbackFn,FOCUS_HOLD_INTERVAL_MS),inputNavStates.holdEventLatest=eventName}useUINavScope(`mirror-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints;removeHints(),hints=showIfController.value?CONTROLLER_HINTS$4:KEYBOARD_HINTS$4;for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$4.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$4.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$98,[createBaseVNode(`div`,_hoisted_2$84,[createVNode(unref(bngSwitch_default),{modelValue:mirror.value,"onUpdate:modelValue":_cache[0]||=$event=>mirror.value=$event},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Mirror`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:MIRROR_BINDING,deviceMask:`xinput`})]),createBaseVNode(`div`,_hoisted_3$73,[createVNode(unref(bngSwitch_default),{modelValue:flip$2.value,"onUpdate:modelValue":_cache[1]||=$event=>flip$2.value=$event,disabled:!mirror.value},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Flip`,-1)]]),_:1},8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:FLIP_BINDING,deviceMask:`xinput`,class:normalizeClass({disabled:!mirror.value})},null,8,[`class`])]),createBaseVNode(`div`,_hoisted_4$56,[createVNode(unref(bngInput_default),{modelValue:offset$2.value,"onUpdate:modelValue":_cache[2]||=$event=>offset$2.value=$event,step:.1,disabled:!mirror.value,type:`number`,prefix:`Offset`,class:`setting-input`},null,8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_OFFSET_BINDING,deviceMask:`xinput`,class:normalizeClass({disabled:!mirror.value})},null,8,[`class`])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),toggleMirror,`focus_l`],[unref(BngOnUiNav_default),toggleFlipped,`focus_r`],[unref(BngOnUiNav_default),changeOffset,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),changeOffset,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),changeOffsetScalar,`focus_ud`]])}},LayerMirrorSettings_default=__plugin_vue_export_helper_default(_sfc_main$107,[[`__scopeId`,`data-v-5ae7bab5`]]),_hoisted_1$97={"bng-ui-scope":`rotate-settings`},_hoisted_2$83={class:`setting-item item-column`},_hoisted_3$72={class:`slider-text-container`},INPUT_CONTROL_STEPS$3=.1,INPUT_CONTROL_MIN$3=0,INPUT_CONTROL_MAX$3=359.9,INPUT_DEFAULT_VALUE$3=0,CONTROLLER_ROTATE_BINDING=`focus_lr`,CONTROLLER_HINTS$3=[],KEYBOARD_HINTS$3=[],_sfc_main$106={__name:`LayerRotateSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),rotation=computed({get:()=>store$1.cursorData?parseFloat(store$1.cursorData.rotation.toFixed(1)):void 0,set:async newValue=>{await store$1.setRotation(newValue)}});function onReset(){rotation.value=INPUT_DEFAULT_VALUE$3}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`rotate-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`rotate`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS$3:KEYBOARD_HINTS$3;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$3.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$3.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$97,[createBaseVNode(`div`,_hoisted_2$83,[createBaseVNode(`div`,_hoisted_3$72,[createVNode(unref(bngInput_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[0]||=$event=>rotation.value=$event,min:INPUT_CONTROL_MIN$3,max:INPUT_CONTROL_MAX$3,step:INPUT_CONTROL_STEPS$3,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[1]||=$event=>rotation.value=$event,min:INPUT_CONTROL_MIN$3,max:INPUT_CONTROL_MAX$3,step:INPUT_CONTROL_STEPS$3,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_ROTATE_BINDING,deviceMask:`xinput`})])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`rotate`,unref(store$1).rotate,element,unref(ACTION_PARAMS_TYPE).xPoint),`focus_ud`]])}},LayerRotateSettings_default=__plugin_vue_export_helper_default(_sfc_main$106,[[`__scopeId`,`data-v-d8deaac6`]]),_sfc_main$105={__name:`BindingButton`,props:{uiEvent:String,deviceMask:String,action:String,label:String,showBinding:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngButton_default),{label:void 0},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(__props.label),1),__props.showBinding?(openBlock(),createBlock(unref(bngBinding_default),{key:0,uiEvent:__props.uiEvent,deviceMask:__props.deviceMask,class:`button-binding`},null,8,[`uiEvent`,`deviceMask`])):createCommentVNode(``,!0)]),_:1}))}},BindingButton_default=__plugin_vue_export_helper_default(_sfc_main$105,[[`__scopeId`,`data-v-e77d3865`]]),_hoisted_1$96={class:`camera-popovermenu`},CONTROLLER_CAMERA_BINDING=`rotate_h_cam`,CAMERA_BUTTONS$2=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$104={__name:`CameraViewButton`,setup(__props){let store$1=useLiveryEditorStore(),popover=usePopover(),expand=ref(!1),currentCamera=computed(()=>{if(store$1.cameraView){let curr=CAMERA_BUTTONS$2.find(x=>x.value===store$1.cameraView);if(curr)return curr}return{icon:icons.movieCamera,label:`View`}}),onCameraViewClicked=view=>{popover.hide(`camera-popovermenu`),store$1.setOrthographicView(view)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{icon:currentCamera.value.icon,accent:unref(ACCENTS).secondary},{default:withCtx(()=>[createBaseVNode(`span`,null,toDisplayString(currentCamera.value.label),1),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_CAMERA_BINDING,deviceMask:`xinput`})]),_:1},8,[`icon`,`accent`])),[[unref(BngPopover_default),`camera-popovermenu`,`bottom`,{click:!0}]]),createVNode(unref(bngPopoverContent_default),{name:`camera-popovermenu`,onShow:_cache[0]||=$event=>expand.value=!0,onHide:_cache[1]||=$event=>expand.value=!1},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$96,[(openBlock(),createElementBlock(Fragment,null,renderList(CAMERA_BUTTONS$2,cameraItem=>createVNode(unref(bngImageTile_default),{key:cameraItem.value,label:cameraItem.label,icon:cameraItem.icon,class:normalizeClass({active:cameraItem.value===currentCamera.value.value}),onClick:$event=>onCameraViewClicked(cameraItem.value)},null,8,[`label`,`icon`,`class`,`onClick`])),64))])]),_:1})]))}},CameraViewButton_default=__plugin_vue_export_helper_default(_sfc_main$104,[[`__scopeId`,`data-v-be949a44`]]),_hoisted_1$95={key:0,class:`liveryeditor-header`},_hoisted_2$82={key:0,class:`header-items`},_sfc_main$103={__name:`LiveryEditorHeader`,setup(__props){let store$1=useEditorHeaderStore(),{startSectionItems,centerSectionItems,endSectionItems}=storeToRefs(store$1),sections=ref({start:startSectionItems,center:centerSectionItems,end:endSectionItems});return(_ctx,_cache)=>unref(store$1).headerHidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$95,[createVNode(unref(bngScreenHeading_default),{type:unref(store$1).header.type,preheadings:unref(store$1).header.preheading},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(store$1).header.heading),1)]),_:1},8,[`type`,`preheadings`]),unref(store$1).itemsHidden?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sections.value,(items$2,section)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([[`section-${section}`],`header-section`])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(items$2,item=>(openBlock(),createElementBlock(`div`,{key:item.id},[withDirectives((openBlock(),createBlock(resolveDynamicComponent(item.component),mergeProps({ref_for:!0},item.props,toHandlers(item.events)),null,16)),[[vShow,!item.hidden]])]))),128))],2))),256))]))]))}},LiveryEditorHeader_default=__plugin_vue_export_helper_default(_sfc_main$103,[[`__scopeId`,`data-v-b0fff070`]]),_hoisted_1$94={class:`transform-settings`,"bng-ui-scope":`transform-settings`},_hoisted_2$81={class:`setting-item item-column`},_hoisted_3$71={class:`slider-text-container`},_hoisted_4$55={class:`setting-item item-column`},_hoisted_5$46={class:`slider-text-container`},_hoisted_6$33={key:0,class:`setting-item`},_hoisted_7$28={class:`setting-item actions-container`},INPUT_CONTROL_STEPS$2=.001,INPUT_CONTROL_MIN$2=0,INPUT_CONTROL_MAX$2=1,INPUT_DEFAULT_VALUE$2=.5,APPLIED_CONTROLLER_HINTS=[],CONTROLLER_MOVE_Y_BINDING=`focus_ud`,CONTROLLER_MOVE_X_BINDING=`focus_lr`,CONTROLLER_SURFACE_NORMAL_BINDING=`action_2`,CONTROLLER_APPLY_BINDING=`ok`,CONTROLLER_CANCEL_REAPPLY_BINDING=`back`,CONTROLLER_HINTS$2=[],KEYBOARD_HINTS$2=[],MOUSE_HINTS=[{id:`stamp_decal`,content:{type:`binding`,props:{action:`stamp_decal`},label:`Apply`}}],_sfc_main$102={__name:`LayerTransformSettingsOld`,setup(__props){let store$1=useLayerSettingsStore(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),actionHoldService=useActionHoldService(),positionX=computed({get:()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.x:void 0,set:async newValue=>await store$1.setPosition(newValue,store$1.cursorData.position.y)}),positionY=computed({get:()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.y:void 0,set:async newValue=>await store$1.setPosition(store$1.cursorData.position.x,newValue)}),positionMaxX=computed(()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.maxX:INPUT_CONTROL_MAX$2),positionMaxY=computed(()=>store$1.cursorData&&store$1.cursorData.position?store$1.cursorData.position.maxY:INPUT_CONTROL_MAX$2),surfaceNormal=computed({get:()=>store$1.cursorData?store$1.cursorData.isProjectSurfaceNormal:void 0,set:async newValue=>await store$1.setProjectSurfaceNormal(newValue)}),mouseMode=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0),applied=computed(()=>store$1.cursorData?store$1.cursorData.applied:void 0);computed(()=>store$1.active);let isShowControls=computed(()=>!store$1.cursorData.applied&&!mouseMode.value),toggleUseSurfaceNormal=()=>{if(console.log(`toggleUseSurfaceNormal`),!store$1.cursorData.applied)surfaceNormal.value=!surfaceNormal.value;else return console.log(`toggleUseSurfaceNormal returning true`),!0};function cancelApply(){store$1.requestApplyActive?store$1.cancelRequestApply():store$1.reapplyActive&&store$1.cancelReapply()}function onReset(){store$1.setPosition(INPUT_DEFAULT_VALUE$2,INPUT_DEFAULT_VALUE$2)}function onOk(){if(!store$1.requestApplyActive&&!store$1.reapplyActive)store$1.toggleReapply();else return!0}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`transform-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue}),watch(mouseMode,async()=>{await nextTick(()=>setHints())}),watch(applied,async()=>{await nextTick(()=>setHints())});function setHints(){let hints;removeHints(),hints=applied.value?showIfController.value?APPLIED_CONTROLLER_HINTS:KEYBOARD_HINTS$2:mouseMode.value?MOUSE_HINTS:showIfController.value?CONTROLLER_HINTS$2:KEYBOARD_HINTS$2;for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>{setHints()})},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`transform`),unwatchGamepad&&unwatchGamepad(),removeHints()});function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$2.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$2.map(x=>x.id)),infoBar.removeHints(...APPLIED_CONTROLLER_HINTS.map(x=>x.id)),infoBar.removeHints(...MOUSE_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$94,[createBaseVNode(`div`,_hoisted_2$81,[withDirectives(createBaseVNode(`div`,_hoisted_3$71,[createVNode(unref(bngInput_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[0]||=$event=>positionX.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxX.value,step:INPUT_CONTROL_STEPS$2,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngSlider_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[1]||=$event=>positionX.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxX.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-sliderinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_MOVE_X_BINDING,deviceMask:`xinput`})],512),[[vShow,isShowControls.value]])]),withDirectives(createBaseVNode(`div`,_hoisted_4$55,[createBaseVNode(`div`,_hoisted_5$46,[createVNode(unref(bngInput_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[2]||=$event=>positionY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN$2,max:positionMaxY.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-textinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngSlider_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[3]||=$event=>positionY.value=$event,min:INPUT_CONTROL_MIN$2,max:positionMaxY.value,step:INPUT_CONTROL_STEPS$2,class:`slider-text-sliderinput`},null,8,[`modelValue`,`max`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_MOVE_Y_BINDING,deviceMask:`xinput`})])],512),[[vShow,isShowControls.value]]),unref(store$1).cursorData.applied?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_6$33,[createVNode(unref(bngSwitch_default),{modelValue:surfaceNormal.value,"onUpdate:modelValue":_cache[4]||=$event=>surfaceNormal.value=$event,disabled:!(unref(store$1).reapplyActive||!applied.value)},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Use Surface Normal`,-1)]]),_:1},8,[`modelValue`,`disabled`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SURFACE_NORMAL_BINDING,deviceMask:`xinput`})])),createBaseVNode(`div`,_hoisted_7$28,[unref(store$1).requestApplyActive||unref(store$1).reapplyActive?(openBlock(),createElementBlock(Fragment,{key:0},[unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0?(openBlock(),createBlock(unref(BindingButton_default),{key:0,icon:unref(store$1).reapplyActive?unref(icons).undo:``,uiEvent:CONTROLLER_CANCEL_REAPPLY_BINDING,label:unref(store$1).reapplyActive?`Undo`:`Cancel`,accent:`attention`,onClick:cancelApply},null,8,[`icon`,`label`])):createCommentVNode(``,!0),mouseMode.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(BindingButton_default),{key:1,uiEvent:CONTROLLER_APPLY_BINDING,label:`Apply`,accent:`primary`,onClick:unref(store$1).apply},null,8,[`onClick`]))],64)):(openBlock(),createBlock(unref(BindingButton_default),{key:1,uiEvent:CONTROLLER_APPLY_BINDING,label:`Reapply`,onClick:unref(store$1).requestReapply},null,8,[`onClick`]))])])),[[unref(BngOnUiNav_default),onOk,`ok`],[unref(BngOnUiNav_default),toggleUseSurfaceNormal,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`transform`,unref(store$1).translate,element),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`transform`,unref(store$1).translate,element),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`transform`,unref(store$1).translate,element),`focus_ud`]])}},LayerTransformSettingsOld_default=__plugin_vue_export_helper_default(_sfc_main$102,[[`__scopeId`,`data-v-79d0fe46`]]),_hoisted_1$93={class:`scale-settings`,"bng-ui-scope":`scale-settings`},_hoisted_2$80={class:`setting-item item-column`},_hoisted_3$70={class:`slider-text-container`},_hoisted_4$54={class:`setting-item item-column`},_hoisted_5$45={class:`slider-text-container`},_hoisted_6$32={class:`setting-item`},INPUT_CONTROL_STEPS$1=.01,INPUT_CONTROL_MIN$1=0,INPUT_CONTROL_MAX$1=6,INPUT_DEFAULT_VALUE$1=.5,CONTROLLER_SCALE_Y_BINDING=`focus_ud`,CONTROLLER_SCALE_X_BINDING=`focus_lr`,CONTROLLER_LOCK_BINDING=`action_2`,CONTROLLER_HINTS$1=[],KEYBOARD_HINTS$1=[],_sfc_main$101={__name:`LayerScaleSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),{editModeState}=storeToRefs(store$1),scaleX=computed({get:()=>store$1.cursorData&&store$1.cursorData.scale?store$1.cursorData.scale.x:void 0,set:async newValue=>{if(newValue===store$1.cursorData.scale.x)return;let scaleY$1=store$1.cursorData.scale.y;if(editModeState.value.lockScaling){let diff=newValue-store$1.cursorData.scale.x;scaleY$1+=diff}await store$1.setScale(newValue,scaleY$1)}}),scaleY=computed({get:()=>store$1.cursorData&&store$1.cursorData.scale?store$1.cursorData.scale.y:void 0,set:async newValue=>{if(newValue===store$1.cursorData.scale.y)return;let scaleX$1=store$1.cursorData.scale.x;if(editModeState.value.lockScaling){let diff=newValue-store$1.cursorData.scale.y;scaleX$1+=diff}await store$1.setScale(scaleX$1,newValue)}}),toggleLockScaling=()=>{editModeState.value.lockScaling=!editModeState.value.lockScaling};function onReset(){store$1.setScale(INPUT_DEFAULT_VALUE$1,INPUT_DEFAULT_VALUE$1)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}function onFocus(element,scalar=!1){let actionFn=(xDirection,yDirection)=>{xDirection!==0&&(scaleX.value=xDirection*INPUT_CONTROL_STEPS$1+scaleX.value),yDirection!==0&&(scaleY.value=yDirection*INPUT_CONTROL_STEPS$1+scaleY.value)};scalar?actionHoldService.onFocusScalar(`scale`,actionFn,element):actionHoldService.onFocus(`scale`,actionFn,element)}useUINavScope(`scale-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`scale`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS$1:KEYBOARD_HINTS$1;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS$1.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS$1.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$93,[createBaseVNode(`div`,_hoisted_2$80,[createBaseVNode(`div`,_hoisted_3$70,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[0]||=$event=>scaleX.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[1]||=$event=>scaleX.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SCALE_X_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_4$54,[createBaseVNode(`div`,_hoisted_5$45,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[2]||=$event=>scaleY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[3]||=$event=>scaleY.value=$event,min:INPUT_CONTROL_MIN$1,max:INPUT_CONTROL_MAX$1,step:INPUT_CONTROL_STEPS$1,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SCALE_Y_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_6$32,[createVNode(unref(bngSwitch_default),{modelValue:unref(editModeState).lockScaling,"onUpdate:modelValue":_cache[4]||=$event=>unref(editModeState).lockScaling=$event},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Lock Scaling`,-1)]]),_:1},8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_LOCK_BINDING,deviceMask:`xinput`})])])),[[unref(BngOnUiNav_default),toggleLockScaling,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onFocus,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),onFocus,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),onFocus,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_lr`],[unref(BngOnUiNav_default),el=>onFocus(el,!0),`focus_ud`]])}},LayerScaleSettings_default=__plugin_vue_export_helper_default(_sfc_main$101,[[`__scopeId`,`data-v-56a383d1`]]),_hoisted_1$92={class:`sort-settings`,"bng-ui-scope":`sort-settings`},_hoisted_2$79={class:`setting-item`},_hoisted_3$69={class:`icon-binding-wrapper`},_hoisted_4$53={class:`icon-binding-wrapper`},_hoisted_5$44={class:`icon-binding-wrapper`},_hoisted_6$31={class:`stacked-arrows`},_hoisted_7$27={class:`icon-binding-wrapper`},_hoisted_8$21={class:`stacked-arrows`},_hoisted_9$18={key:0},ORDER_TOOL=Lua_default.extensions.ui_liveryEditor_tools_group,_sfc_main$100={__name:`LayerSortSettings`,setup(__props){let store$1=useLiveryEditorStore();useUINavScope(`sort-settings`);let order=computed({get:()=>store$1.selectedLayers[0].order,set(newValue){ORDER_TOOL.setOrder(newValue)}}),orderMax=computed(()=>store$1.selectedLayers[0].siblingCount),multiSelected=computed(()=>store$1.selectedLayerUids.length>1),orderOptions=computed(()=>Array.from({length:store$1.layers.length-1},(_,i)=>({label:`${i+1}`,value:i+2})));return onMounted(()=>{getUINavServiceInstance().useCrossfire=!1}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$92,[createBaseVNode(`div`,_hoisted_2$79,[createVNode(unref(bngButton_default),{onClick:_cache[0]||=()=>unref(ORDER_TOOL).moveOrderUp(),disabled:order.value===orderMax.value},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$69,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_item_up`})])]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{onClick:_cache[1]||=()=>unref(ORDER_TOOL).moveOrderDown(),disabled:order.value===2},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$53,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_item_down`})])]),_:1},8,[`disabled`]),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:0,onClick:_cache[2]||=()=>unref(ORDER_TOOL).changeOrderToTop(),disabled:order.value===orderMax.value},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$44,[createBaseVNode(`div`,_hoisted_6$31,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])]),createVNode(unref(bngBinding_default),{action:`menu_item_right`})])]),_:1},8,[`disabled`])),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:1,onClick:_cache[3]||=()=>unref(ORDER_TOOL).changeOrderToBottom(),disabled:order.value===2},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$27,[createBaseVNode(`div`,_hoisted_8$21,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`])]),createVNode(unref(bngBinding_default),{action:`menu_item_left`})])]),_:1},8,[`disabled`]))]),multiSelected.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_9$18,[createVNode(unref(bngDropdown_default),{modelValue:order.value,"onUpdate:modelValue":_cache[4]||=$event=>order.value=$event,items:orderOptions.value},null,8,[`modelValue`,`items`])]))])),[[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).changeOrderToBottom(),`focus_l`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).changeOrderToTop(),`focus_r`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).moveOrderUp(),`focus_u`],[unref(BngOnUiNav_default),()=>unref(ORDER_TOOL).moveOrderDown(),`focus_d`]])}},LayerSortSettings_default=__plugin_vue_export_helper_default(_sfc_main$100,[[`__scopeId`,`data-v-1d4969be`]]),_hoisted_1$91={class:`skew-settings`,"bng-ui-scope":`skew-settings`},_hoisted_2$78={class:`setting-item item-column`},_hoisted_3$68={class:`slider-text-container`},_hoisted_4$52={class:`setting-item item-column`},_hoisted_5$43={class:`slider-text-container`},INPUT_CONTROL_STEPS=.01,INPUT_CONTROL_MIN=-2,INPUT_CONTROL_MAX=2,INPUT_DEFAULT_VALUE=0,CONTROLLER_SKEW_Y_BINDING=`focus_ud`,CONTROLLER_SKEW_X_BINDING=`focus_lr`,CONTROLLER_HINTS=[],KEYBOARD_HINTS=[],_sfc_main$99={__name:`LayerDeformSettings`,setup(__props){let store$1=useLayerSettingsStore(),actionHoldService=useActionHoldService(),{showIfController}=storeToRefs(controls_default()),infoBar=useInfoBar(),skewX=computed({get:()=>store$1.cursorData&&store$1.cursorData.skew?store$1.cursorData.skew.x:void 0,set:async newValue=>await store$1.setSkew(newValue,store$1.cursorData.skew.y)}),skewY=computed({get:()=>store$1.cursorData&&store$1.cursorData.skew?store$1.cursorData.skew.y:void 0,set:async newValue=>await store$1.setSkew(store$1.cursorData.skew.x,newValue)});function onReset(){store$1.setSkew(INPUT_DEFAULT_VALUE,INPUT_DEFAULT_VALUE)}function onTertiaryAction(){if(store$1.reapplyActive||store$1.requestApplyActive)onReset();else return!0}useUINavScope(`skew-settings`);let useCrossfireValue;onBeforeMount(()=>{useCrossfireValue=getUINavServiceInstance().useCrossfire,getUINavServiceInstance().useCrossfire=!1}),onBeforeUnmount(()=>{getUINavServiceInstance().useCrossfire=useCrossfireValue});let unwatchGamepad;onBeforeMount(()=>{unwatchGamepad=watch(showIfController,async()=>{await nextTick(()=>setHints())},{immediate:!0})}),onUnmounted(()=>{actionHoldService.removeAll(`skew`),unwatchGamepad&&unwatchGamepad(),removeHints()});function setHints(){let hints=showIfController.value?CONTROLLER_HINTS:KEYBOARD_HINTS;removeHints();for(let i=hints.length-1;i>=0;i--)infoBar.addHints(hints[i],0,!0)}function removeHints(){infoBar.removeHints(...KEYBOARD_HINTS.map(x=>x.id)),infoBar.removeHints(...CONTROLLER_HINTS.map(x=>x.id))}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$91,[createBaseVNode(`div`,_hoisted_2$78,[createBaseVNode(`div`,_hoisted_3$68,[createVNode(unref(bngInput_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[0]||=$event=>skewX.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,type:`number`,prefix:`X`,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[1]||=$event=>skewX.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SKEW_X_BINDING,deviceMask:`xinput`})])]),createBaseVNode(`div`,_hoisted_4$52,[createBaseVNode(`div`,_hoisted_5$43,[createVNode(unref(bngInput_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[2]||=$event=>skewY.value=$event,type:`number`,prefix:`Y`,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-textinput`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[3]||=$event=>skewY.value=$event,min:INPUT_CONTROL_MIN,max:INPUT_CONTROL_MAX,step:INPUT_CONTROL_STEPS,class:`slider-text-sliderinput`},null,8,[`modelValue`]),createVNode(unref(bngBinding_default),{uiEvent:CONTROLLER_SKEW_Y_BINDING,deviceMask:`xinput`})])])])),[[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_l`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_l`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_r`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_r`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_u`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_u`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_d`,{down:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocus(`skew`,unref(store$1).skew,element),`focus_d`,{up:!0}],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`skew`,unref(store$1).skew,element),`focus_lr`],[unref(BngOnUiNav_default),element=>unref(actionHoldService).onFocusScalar(`skew`,unref(store$1).skew,element),`focus_ud`]])}},LayerDeformSettings_default=__plugin_vue_export_helper_default(_sfc_main$99,[[`__scopeId`,`data-v-b2c32ce6`]]),_hoisted_1$90={class:`layer-settings-base`},_hoisted_2$77={class:`settings-heading`},_hoisted_3$67={class:`settings-content`},_sfc_main$98={__name:`LayerSettingsBase`,props:{heading:{type:String}},emits:[`close`],setup(__props){let slots=useSlots();return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$90,[createBaseVNode(`div`,_hoisted_2$77,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[unref(slots).heading?renderSlot(_ctx.$slots,`heading`,{key:0},()=>[createBaseVNode(`span`,null,toDisplayString(__props.heading),1)],!0):createCommentVNode(``,!0)]),_:3})]),createBaseVNode(`div`,_hoisted_3$67,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},LayerSettingsBase_default=__plugin_vue_export_helper_default(_sfc_main$98,[[`__scopeId`,`data-v-c5fed92f`]]),_hoisted_1$89={class:`setting-item item-column`},_hoisted_2$76={class:`slider-text-container`},_hoisted_3$66={class:`setting-item item-column`},_hoisted_4$51={class:`slider-text-container`},_sfc_main$97={__name:`TransformSettings`,setup(__props){let scaleX=ref(.5),scaleY=ref(.5);return(_ctx,_cache)=>(openBlock(),createBlock(unref(LayerSettingsBase_default),null,{heading:withCtx(()=>[..._cache[2]||=[createTextVNode(`Transform`,-1)]]),default:withCtx(()=>[createBaseVNode(`template`,null,[createBaseVNode(`div`,_hoisted_1$89,[createBaseVNode(`div`,_hoisted_2$76,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[0]||=$event=>scaleX.value=$event,min:0,max:6,step:.01,type:`number`,prefix:`X`},null,8,[`modelValue`])])]),createBaseVNode(`div`,_hoisted_3$66,[createBaseVNode(`div`,_hoisted_4$51,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[1]||=$event=>scaleY.value=$event,type:`number`,prefix:`Y`,min:0,max:6,step:.01},null,8,[`modelValue`])])])])]),_:1}))}},TransformSettings_default=_sfc_main$97,_hoisted_1$88={class:`settings-container`},_hoisted_2$75={class:`setting-types-selector`},_hoisted_3$65={class:`setting-types`},_hoisted_4$50=[`onClick`],_hoisted_5$42={class:`heading-content-wrapper`},_hoisted_6$30={class:`heading-content-text`},_hoisted_7$26={key:0},_hoisted_8$20={key:0,class:`subheading`},CONTROLLER_RESET_BINDING=`advanced`,SETTING_TYPES=[{value:`transform`,label:`Transform`,icon:icons.transform,component:markRaw(TransformSettings_default)},{value:`transformold`,label:`Position`,icon:icons.transform,component:markRaw(LayerTransformSettingsOld_default)},{value:`scale`,label:`Scale`,icon:icons.scale,component:markRaw(LayerScaleSettings_default)},{value:`skew`,label:`Skew`,icon:icons.deform,component:markRaw(LayerDeformSettings_default)},{value:`rotate`,label:`Rotate`,icon:icons.rotationL,component:markRaw(LayerRotateSettings_default)},{value:`material`,label:`Material`,icon:icons.material,component:markRaw(LayerMaterialSettings_default)},{value:`mirror`,label:`Mirror`,icon:icons.reflect,component:markRaw(LayerMirrorSettings_default)}],_sfc_main$96={__name:`LayerSettings`,props:{settingTypes:Array,activeSetting:String,excludeSettingTypes:Array},setup(__props){let store$1=useLayerSettingsStore(),props=__props,currentIndex=ref(0),settingTypes=computed(()=>{let filtered=SETTING_TYPES;return props.settingTypes&&(filtered=filtered.filter(x=>props.settingTypes.includes(x.value))),props.excludeSettingTypes&&(filtered=filtered.filter(x=>!props.excludeSettingTypes.includes(x.value))),filtered}),activeSubSetting=ref(null),activeSettingType=computed(()=>settingTypes.value[currentIndex.value]),mouseMode=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0);watch(()=>props.activeSetting,()=>{let index=settingTypes.value.findIndex(x=>x.value===props.activeSetting);index>-1?currentIndex.value=index:console.warn(`Error finding setting ${props.activeSetting}`)},{immediate:!0}),watch(activeSettingType,value=>store$1.activeSetting=value.value,{immediate:!0}),watch(activeSettingType,(newValue,oldValue)=>{newValue.value&&oldValue.value}),onMounted(()=>{getUINavServiceInstance().useCrossfire=!1}),onUnmounted(async()=>{getUINavServiceInstance().useCrossfire=!0});let setTool=settingType=>{currentIndex.value=settingTypes.value.findIndex(x=>x.value===settingType.value)},goPreviousTab=()=>{currentIndex.value=currentIndex.value>0?currentIndex.value-1:settingTypes.value.length-1},goNextTab=()=>{currentIndex.value=currentIndex.value(openBlock(),createElementBlock(`div`,_hoisted_1$88,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$75,[createBaseVNode(`div`,{onClick:goPreviousTab},[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{action:`menu_tab_left`,deviceMask:`xinput`})]),createBaseVNode(`div`,_hoisted_3$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(settingTypes.value,settingType=>withDirectives((openBlock(),createElementBlock(`div`,{key:settingType.value,class:normalizeClass([{active:activeSettingType.value.value===settingType.value},`setting-type`]),onClick:$event=>setTool(settingType)},[createVNode(unref(bngIcon_default),{type:settingType.icon,class:`setting-type-icon`},null,8,[`type`])],10,_hoisted_4$50)),[[unref(BngTooltip_default),activeSettingType.value.value===settingType.value?void 0:settingType.label,`top`]])),128))]),createBaseVNode(`div`,{onClick:goNextTab},[createVNode(unref(bngBinding_default),{action:`menu_tab_right`,deviceMask:`xinput`}),createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallRight},null,8,[`type`])])])),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),goPreviousTab,`tab_l`],[unref(BngOnUiNav_default),goNextTab,`tab_r`]]),withDirectives((openBlock(),createBlock(LayerSettingsBase_default,null,{heading:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$42,[createBaseVNode(`span`,_hoisted_6$30,[createBaseVNode(`span`,null,[createTextVNode(toDisplayString(activeSettingType.value.label)+` `,1),activeSubSetting.value?(openBlock(),createElementBlock(`span`,_hoisted_7$26,`/`)):createCommentVNode(``,!0)]),activeSubSetting.value?(openBlock(),createElementBlock(`span`,_hoisted_8$20,toDisplayString(activeSubSetting.value.label),1)):createCommentVNode(``,!0)]),(unref(store$1).reapplyActive||unref(store$1).requestApplyActive)&&(activeSettingType.value.value!==`transform`||!mouseMode.value)?(openBlock(),createBlock(unref(BindingButton_default),{key:0,icon:unref(icons).restart,accent:`text`,label:`Reset`,uiEvent:CONTROLLER_RESET_BINDING,onClick:resetSettings},null,8,[`icon`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(activeSettingType.value.component),{onSubSettingChanged},null,32))]),_:1})),[[unref(BngOnUiNav_default),onAdvanced,`advanced`],[unref(BngBlur_default)]])]))}},LayerSettings_default=__plugin_vue_export_helper_default(_sfc_main$96,[[`__scopeId`,`data-v-ca9ed9d2`]]),_hoisted_1$87={key:0,"bng-ui-scope":`liveryeditor-editmode`,class:`liveryeditor-editmode-layout`},_hoisted_2$74={class:`layers-preview-container`},_hoisted_3$64={class:`layer-settings-wrapper`},SAVE_TYPES={default:1,asGroup:2},FOCUS_LD_TRIGGER_VALUE=-.999,FOCUS_RU_TRIGGER_VALUE=.999,HEADER_TEXT$1=`Edit Mode`,CONTEXT_MENU_NAME=`context-menu`,CONTROLLER_EXIT_BINDING=`back`,CONTROLLER_SAVE_BINDING=`menu`,APPLY_DEFAULT_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`ok`},label:`Apply`}},{id:`cancel`,content:{type:`binding`,props:{uiEvent:`back`},label:`Cancel`}}],APPLY_MOUSE_HINTS=[{id:`cancel`,content:{type:`binding`,props:{uiEvent:`back`},label:`Cancel`}}],FREECAM_CONTROLLER_HINTS=[{id:`toggle_freecam`,content:{type:`binding`,props:{uiEvent:`action_4`},label:`Toggle View Point`}}],VIEWPOINT_CONTROLLER_HINTS=[{id:`toggle_freecam`,content:{type:`binding`,props:{uiEvent:`action_4`},label:`Toggle Free Cam`}}],DELETE_LAYER_HINT={id:`delete`,content:{type:`binding`,props:{uiEvent:`advanced`},label:`Delete`}},_sfc_main$95={__name:`EditModeLayout`,setup(__props){useCssVars(_ctx=>({ff7f3326:alphaTextureBackground.value}));let infoBar=useInfoBar(),{showIfController}=storeToRefs(controls_default()),actionHoldService=useActionHoldService(),rootStore=useLiveryEditorStore(),store$1=useLayerSettingsStore(),popover=usePopover(),freecam=ref(!1),CONTEXT_MENU_STYLES=ref({display:`flex`,"flex-direction":`column`}),contextMenuName=ref(`context-menu`),alphaTextureBackground=computed(()=>`url(${getAssetURL(`images/alpha_texture.png`)}`);onBeforeMount(async()=>{await store$1.getInitialData(),watch(showIfController,()=>{actionHoldService.clear()})}),onMounted(()=>{store$1.init(),infoBar.clearHints()}),onUnmounted(()=>{infoBar.clearHints()});async function onAddOrChangeDecal(){await rootStore.toggleShowDecalSelector()}function onBack(){popover.isShown(CONTEXT_MENU_NAME)?popover.hide(CONTEXT_MENU_NAME):store$1.appliedLayers&&store$1.appliedLayers.length>0&&store$1.requestApplyActive?store$1.cancelRequestApply():store$1.appliedLayers&&store$1.reapplyActive?store$1.cancelReapply():confirmCancelChanges()}function onContextMenu(){store$1.reapplyActive?store$1.requestChangeDecal():store$1.requestApplyActive?rootStore.toggleShowDecalSelector():store$1.duplicateActiveLayer()}function onAdvanced(){!store$1.requestApplyActive&&!store$1.reapplyActive&&store$1.activeLayerUid&&store$1.appliedLayers.length>1&&(getUINavServiceInstance().useCrossfire=!0,openConfirmation(`Delete Decal`).then(res=>{res&&store$1.removeAppliedLayer(store$1.activeLayerUid),getUINavServiceInstance().useCrossfire=!0}))}function onOk(){(store$1.requestApplyActive||store$1.reapplyActive)&&store$1.apply()}function confirmSaveChanges(){!store$1.appliedLayers||store$1.appliedLayers.length===0||(getUINavServiceInstance().useCrossfire=!0,openConfirmation(`Save`,`Save changes and exit edit mode?`,[{label:$translate.instant(`ui.common.cancel`),value:void 0,extras:{cancel:!0,accent:ACCENTS.secondary}},{label:$translate.instant(`ui.common.save`),value:SAVE_TYPES.default,extras:{default:!0}}]).then(res=>{res?store$1.saveChanges():getUINavServiceInstance().useCrossfire=!1}))}async function confirmCancelChanges(){getUINavServiceInstance().useCrossfire=!0;let hasChanges=store$1.appliedLayers&&store$1.appliedLayers.length>0;await openConfirmation(`Exit`,hasChanges?`Exit edit mode and lose all changes?`:`Exit Edit Mode?`)?(hasChanges&&await store$1.cancelChanges(),await store$1.deactivate()):getUINavServiceInstance().useCrossfire=!1}let removeLayer=()=>{store$1.removeAppliedLayer(store$1.activeLayerUid),popover.hide(CONTEXT_MENU_NAME)};function onSecondaryAction(element){!store$1.reapplyActive&&!store$1.requestApplyActive&&store$1.requestApply()}function onTertiaryAction(element){store$1.cursorData.applied&&!store$1.reapplyActive&&store$1.toggleHighlightActive()}function onQuaternaryAction(element){freecam.value=!freecam.value}function onRotateHCam(element){if(freecam.value)return!0;let direction$1=element.detail.value;(direction$1>=FOCUS_RU_TRIGGER_VALUE||direction$1<=FOCUS_LD_TRIGGER_VALUE)&&rootStore.switchOrthographicViewByDirection(direction$1>0?-1:1,0)}function onRotateVCam(element){if(freecam.value)return!0;let direction$1=element.detail.value;(direction$1>=FOCUS_RU_TRIGGER_VALUE||direction$1<=FOCUS_LD_TRIGGER_VALUE)&&rootStore.switchOrthographicViewByDirection(0,direction$1>0?-1:1)}let APPLY_CONTROLLER_HINTS=[{id:`change_decal`,content:{type:`binding`,props:{uiEvent:`context`},label:`Change Decal`},action:store$1.requestChangeDecal}],DEFAULT_HINTS=[{id:`duplicate_decal`,content:{type:`binding`,props:{action:`duplicate_active_layer`},label:`Duplicate Decal`,action:store$1.duplicateActiveLayer}},{id:`activate_previous_decal`,content:{type:`binding`,props:{action:`activate_previous_layer`},label:`Edit Previous Decal`}},{id:`activate_next_decal`,content:{type:`binding`,props:{action:`activate_next_layer`},label:`Edit Next Decal`}},{id:`save`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Save`}},{id:`exit`,content:{type:`binding`,props:{uiEvent:`back`},label:`Exit`}}],DEFAULT_CONTROLLER_HINTS=[{id:`apply_or_new`,content:{type:`binding`,props:{uiEvent:`action_2`},label:`New Decal`}},{id:`delete_decal`,content:{type:`binding`,props:{uiEvent:`advanced`},label:`Delete Decal`,action:()=>store$1.removeAppliedLayer(store$1.activeLayerUid)}},{id:`duplicate_decal`,content:{type:`binding`,props:{uiEvent:`context`},label:`Duplicate Decal`},action:()=>store$1.duplicateActiveLayer()},{id:`highlight_decal`,content:{type:`binding`,props:{uiEvent:`action_3`},label:`Toggle Highlight`},action:()=>store$1.toggleHighlightActive()}];watchEffect(()=>{let isController$2=showIfController.value,defaultControllerHints=!1,hints;removeHints(),store$1.requestApplyActive||store$1.reapplyActive?hints=store$1.cursorData.isUseMousePos?APPLY_MOUSE_HINTS:isController$2?APPLY_CONTROLLER_HINTS:APPLY_DEFAULT_HINTS:isController$2?(hints=DEFAULT_CONTROLLER_HINTS,defaultControllerHints=!0):hints=DEFAULT_HINTS;for(let i=0;i1&&infoBar.addHints(DELETE_LAYER_HINT,`change_decal`,!0),(!store$1.appliedLayers||store$1.appliedLayers.length<=1)&&infoBar.removeHints(`delete_decal`)}),watch(()=>freecam.value,async()=>{freecam.value?rootStore.cameraView=`free`:await rootStore.setOrthographicView(`right`)});function removeHints(){APPLY_MOUSE_HINTS.forEach(x=>infoBar.removeHints(x.id)),APPLY_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),APPLY_DEFAULT_HINTS.forEach(x=>infoBar.removeHints(x.id)),DEFAULT_HINTS.forEach(x=>infoBar.removeHints(x.id)),DEFAULT_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),FREECAM_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),VIEWPOINT_CONTROLLER_HINTS.forEach(x=>infoBar.removeHints(x.id)),infoBar.removeHints(DELETE_LAYER_HINT.id)}let headerStore=useEditorHeaderStore(),resetDisabled=ref(!1),saveDisabled=ref(!0),useMouse=computed(()=>store$1.cursorData?store$1.cursorData.isUseMousePos:void 0),changeMouseMode=async newValue=>await store$1.setUseMousePos(newValue),HEADER_APPLY_ITEMS=[{id:`cancel_apply`,section:`end`,component:shallowRef(bngButton_default),props:{label:`Cancel Apply`,accent:ACCENTS.attention},events:{click:()=>{store$1.requestApplyActive&&store$1.cancelRequestApply()}},hidden:!0},{id:`undo_reapply`,section:`end`,component:shallowRef(bngButton_default),props:{label:`Undo Reapply`,accent:ACCENTS.attention},events:{click:()=>{store$1.reapplyActive&&store$1.cancelReapply()}},hidden:!0},{id:`use_mouse`,section:`end`,component:shallowRef(bngSwitch_default),props:{modelValue:useMouse,label:`Use Mouse`,uncheckedWithBackground:!0},events:{"update:modelValue":changeMouseMode}}],showBinding=computed(()=>!store$1.active||!store$1.appliedLayers||store$1.appliedLayers.length===0||!(store$1.reapplyActive||store$1.requestApplyActive)),HEADER_GLOBAL_ITEMS=[{id:`save_changes`,section:`start`,component:shallowRef(BindingButton_default),props:{icon:icons.saveAs1,accent:ACCENTS.main,label:`Save and Exit`,disabled:saveDisabled,uiEvent:CONTROLLER_SAVE_BINDING,deviceMask:`xinput`},events:{click:confirmSaveChanges}},{id:`exit_edit_mode`,section:`start`,component:shallowRef(BindingButton_default),props:{icon:icons.exit,accent:ACCENTS.attention,label:`Exit Edit Mode`,uiEvent:CONTROLLER_EXIT_BINDING,deviceMask:`xinput`,showBinding},events:{click:confirmCancelChanges}}];return watch(()=>store$1.active,active=>{active&&(headerStore.setHeader(HEADER_TEXT$1,`ribbon`),headerStore.setPreheader(void 0))},{immediate:!0}),watchEffect(()=>{store$1.appliedLayers&&store$1.appliedLayers.length>0&&store$1.requestApplyActive?headerStore.showItem(`cancel_apply`):headerStore.hideItem(`cancel_apply`)}),watch(()=>store$1.reapplyActive,value=>{value?headerStore.showItem(`undo_reapply`):headerStore.hideItem(`undo_reapply`)}),watchEffect(()=>{saveDisabled.value=!store$1.appliedLayers||store$1.appliedLayers.length===0,resetDisabled.value=!store$1.requestApplyActive&&!store$1.reapplyActive}),onMounted(()=>{headerStore.removeItems(HEADER_APPLY_ITEMS),headerStore.removeItem(HEADER_GLOBAL_ITEMS),store$1.active&&(headerStore.addItems(HEADER_APPLY_ITEMS,!0),headerStore.addItems(HEADER_GLOBAL_ITEMS))}),onUnmounted(()=>{headerStore.removeItems(HEADER_APPLY_ITEMS),headerStore.removeItems(HEADER_GLOBAL_ITEMS)}),(_ctx,_cache)=>unref(store$1).active?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$87,[createBaseVNode(`div`,_hoisted_2$74,[unref(store$1).appliedLayers&&!unref(store$1).requestApplyActive?withDirectives((openBlock(),createBlock(unref(bngImageTile_default),{key:0,icon:unref(icons).decal,class:normalizeClass([{cancel:unref(store$1).requestApplyActive},`add-item`]),disabled:unref(store$1).reapplyActive?`disabled`:``,ratio:`1:1`,onClick:onAddOrChangeDecal},{default:withCtx(()=>[..._cache[0]||=[createBaseVNode(`label`,null,`Add`,-1)]]),_:1},8,[`icon`,`class`,`disabled`])),[[unref(BngBlur_default)]]):withDirectives((openBlock(),createElementBlock(`div`,{key:1,class:`layer-ghost-wrapper`,onClick:onAddOrChangeDecal},[createVNode(DecalPreviewTile_default,{textureImage:unref(store$1).cursorData.decalTexturePath,textureColor:unref(store$1).cursorData.color},null,8,[`textureImage`,`textureColor`]),createVNode(unref(bngIcon_default),{class:`hover-icon`,type:unref(icons).edit},null,8,[`type`])])),[[unref(BngBlur_default)]]),unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0?withDirectives((openBlock(),createBlock(EditModeLayersPreview_default,{key:2,contextMenuName:contextMenuName.value},null,8,[`contextMenuName`])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$64,[createVNode(unref(LayerSettings_default))]),unref(store$1).appliedLayers&&unref(store$1).appliedLayers.length>0&&unref(store$1).activeLayerUid!==null&&unref(store$1).activeLayerUid!==void 0?(openBlock(),createBlock(unref(bngPopoverContent_default),{key:0,name:contextMenuName.value},{default:withCtx(()=>[createBaseVNode(`div`,{class:`layer-context-menu`,style:normalizeStyle(CONTEXT_MENU_STYLES.value)},[createVNode(unref(bngButton_default),{onClick:withModifiers(unref(store$1).requestChangeDecal,[`stop`])},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Change Decal`,-1)]]),_:1},8,[`onClick`]),createVNode(unref(bngButton_default),{disabled:unref(store$1).appliedLayers.length<=1,accent:`attention`,onClick:withModifiers(removeLayer,[`stop`])},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(`Delete`,-1)]]),_:1},8,[`disabled`])],4)]),_:1},8,[`name`])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),onOk,`ok`],[unref(BngOnUiNav_default),onContextMenu,`context`],[unref(BngOnUiNav_default),onAdvanced,`advanced`],[unref(BngOnUiNav_default),onBack,`back`],[unref(BngOnUiNav_default),confirmSaveChanges,`menu`],[unref(BngOnUiNav_default),onSecondaryAction,`action_2`],[unref(BngOnUiNav_default),onTertiaryAction,`action_3`],[unref(BngOnUiNav_default),onQuaternaryAction,`action_4`],[unref(BngOnUiNav_default),onRotateHCam,`rotate_h_cam`],[unref(BngOnUiNav_default),onRotateVCam,`rotate_v_cam`]]):createCommentVNode(``,!0)}},EditModeLayout_default=__plugin_vue_export_helper_default(_sfc_main$95,[[`__scopeId`,`data-v-9b377f5e`]]),_hoisted_1$86={class:`layer-content`},_hoisted_2$73={class:`layer-name`},_hoisted_3$63={key:0,class:`layer-actions`},_hoisted_4$49={class:`layer-preview`},_hoisted_5$41={key:1,class:`group-preview`},_sfc_main$94={__name:`LayerTile`,props:{layer:Object,isTargeted:Boolean,forceShowActions:Boolean,disableMoveUp:Boolean,disableMoveDown:Boolean},emits:[`lockClicked`,`hideClicked`,`moveClicked`,`enableClicked`],setup(__props){let isHovered=ref(!1),toRgba255Styles=colors=>`rgba(${colors[0]*255}, ${colors[1]*255}, ${colors[2]*255}, ${colors[3]})`;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:`layer-tile`,onMouseover:_cache[1]||=$event=>isHovered.value=!0,onMouseleave:_cache[2]||=$event=>isHovered.value=!1},[createBaseVNode(`div`,_hoisted_1$86,[renderSlot(_ctx.$slots,`content`,{},()=>[createBaseVNode(`div`,_hoisted_2$73,toDisplayString(__props.layer.name),1),__props.forceShowActions||!__props.layer.enabled?(openBlock(),createElementBlock(`div`,_hoisted_3$63,[__props.forceShowActions?(openBlock(),createBlock(unref(bngBinding_default),{key:0,"track-ignore":!0,uiEvent:`action_2`,deviceMask:`xinput`})):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{accent:`outlined`,onClick:_cache[0]||=$event=>_ctx.$emit(`enableClicked`),icon:__props.layer.enabled?unref(icons).eyeSolidOpened:unref(icons).eyeSolidClosed},null,8,[`icon`])])):createCommentVNode(``,!0)],!0)]),createBaseVNode(`div`,_hoisted_4$49,[__props.layer.type===1?(openBlock(),createElementBlock(`div`,{key:0,class:`fill-preview`,style:normalizeStyle({"--layer-color":toRgba255Styles(__props.layer.color)})},null,4)):__props.layer.type===3?(openBlock(),createElementBlock(`div`,_hoisted_5$41,[createVNode(unref(bngIcon_default),{type:unref(icons).group},null,8,[`type`])])):__props.layer.type===0?(openBlock(),createBlock(DecalPreviewTile_default,{key:2,textureImage:__props.layer.preview,textureColor:__props.layer.color},null,8,[`textureImage`,`textureColor`])):createCommentVNode(``,!0)])],32))}},LayerTile_default=__plugin_vue_export_helper_default(_sfc_main$94,[[`__scopeId`,`data-v-87650a01`]]),_hoisted_1$85={class:`layers-manager`},_hoisted_2$72={class:`layers-manager-header`},_hoisted_3$62=[`onFocusin`];const VIEW_MODES={DEFAULT:`default`,COMPACT:`compact`};var _sfc_main$93={__name:`LayersManager`,props:mergeModels({layers:{type:Array,required:!0},view:{type:String,default:`default`,validator(value){return Object.values(VIEW_MODES).find(x=>x===value)}}},{selectedKeys:{},selectedKeysModifiers:{}}),emits:mergeModels([`focusedLayer`],[`update:selectedKeys`]),setup(__props,{emit:__emit}){let emit$1=__emit,rootStore=useLiveryEditorStore(),expandedKeys=ref([]),selectedKeys=useModel(__props,`selectedKeys`),focusLayer=ref(null),layersScrollable=ref(null);ref(!1);let isFocusFirstLayer=ref(!1);watch(()=>rootStore.selectedLayers,()=>{(!rootStore.selectedLayers||rootStore.selectedLayers.length===0)&&(rootStore.selectMode=`single`)}),watch(()=>selectedKeys.value,(newValue,oldValue)=>{(!newValue||newValue.length===0&&oldValue&&oldValue.length>0)&&(isFocusFirstLayer.value=!0)});let setMultiSelect=async node=>{rootStore.selectMode!==`multi`&&(rootStore.selectMode=`multi`,rootStore.toggleSelection(node.id,!1))},toggleEnabled=layer=>{Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`enabled`).then(luaRes=>{layer.enabled=luaRes})},onClickItem=node=>{Lua_default.extensions.ui_liveryEditor_selection.select(node.id,!0),setFocusLayer(null)},setFocusLayer=layer=>{isFocusFirstLayer.value&&=!1,focusLayer.value=layer,emit$1(`focusedLayer`,layer)},handleFocusOut=event=>{setFocusLayer(null)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$85,[createBaseVNode(`div`,_hoisted_2$72,[renderSlot(_ctx.$slots,`header`,{},void 0,!0)]),__props.layers?(openBlock(),createElementBlock(`div`,{key:0,ref_key:`layersScrollable`,ref:layersScrollable,class:`layers-scrollable`,onFocusout:handleFocusOut},[createVNode(unref(tree_default),{expandedKeys:expandedKeys.value,"onUpdate:expandedKeys":_cache[2]||=$event=>expandedKeys.value=$event,selectedKeys:selectedKeys.value,"onUpdate:selectedKeys":_cache[3]||=$event=>selectedKeys.value=$event,nodes:__props.layers,selectMode:unref(rootStore).selectMode,keyName:`id`,class:`layers-tree`},{node:withCtx(({node,parentNode,expanded,selected,expand})=>[node.hidden?createCommentVNode(``,!0):withDirectives((openBlock(),createElementBlock(`div`,{key:0,onFocusin:withModifiers($event=>setFocusLayer(node),[`self`]),"bng-nav-item":``,class:`layer-node`},[createVNode(LayerTile_default,{layer:node,forceShowActions:focusLayer.value&&focusLayer.value.uid===node.uid,onEnableClicked:()=>toggleEnabled(node)},null,8,[`layer`,`forceShowActions`,`onEnableClicked`]),node.children?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:expanded?unref(icons).arrowSmallUp:unref(icons).arrowSmallDown,class:`expand-icon`,onMousedown:_cache[0]||=withModifiers(()=>{},[`stop`]),onMouseup:_cache[1]||=withModifiers(()=>{},[`stop`]),onClick:withModifiers(expand,[`stop`])},null,8,[`type`,`onClick`])):createCommentVNode(``,!0)],40,_hoisted_3$62)),[[unref(BngClick_default),{clickCallback:()=>onClickItem(node),holdCallback:()=>setMultiSelect(node),repeatInterval:0}],[unref(BngUiNavFocus_default),isFocusFirstLayer.value&&__props.layers[0].uid===node.uid?0:void 0],[unref(BngFocusIf_default),isFocusFirstLayer.value&&__props.layers[0].uid===node.uid],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),_:1},8,[`expandedKeys`,`selectedKeys`,`nodes`,`selectMode`])],544)):createCommentVNode(``,!0)]))}},LayersManager_default=__plugin_vue_export_helper_default(_sfc_main$93,[[`__scopeId`,`data-v-1bc4f03d`]]),_hoisted_1$84={class:`paint-settings`},_sfc_main$92={__name:`PaintSettings`,setup(__props){let LUA_FILL_LAYER=Lua_default.extensions.ui_liveryEditor_layers_fill,paint=new Paint,color=ref({hue:.5,saturation:1,luminosity:.5});function setColor(){paint.hsl=[color.value.hue,color.value.saturation,color.value.luminosity],LUA_FILL_LAYER.updateLayer({color:paint.rgba})}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$84,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,view:`luminosity`},null,8,[`modelValue`]),createBaseVNode(`div`,null,[createVNode(unref(bngButton_default),{onClick:setColor},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Save`,-1)]]),_:1})])]))}},PaintSettings_default=__plugin_vue_export_helper_default(_sfc_main$92,[[`__scopeId`,`data-v-66a34a99`]]),_hoisted_1$83={class:`liveryeditor-default-layout`,"bng-ui-scope":`default-layout`},_hoisted_2$71={class:`layers-manager-wrapper`},_hoisted_3$61={key:0,class:`multiselect-header`},_hoisted_4$48={class:`message`},_hoisted_5$40={class:`add-content-wrapper`},_hoisted_6$29={class:`action-tile`},_hoisted_7$25={key:1,class:`layer-settings-wrapper`,"bng-ui-scope":`layer-settings`},SETTINGS_VIEWS={edit:{label:`Edit`,value:`edit`,hideActions:!0,propertySettings:!0,disableLayersManager:!0,props:{excludeSettingTypes:[`transform`]}},order:{label:`Change Order`,value:`order`,component:LayerSortSettings_default,hideActions:!0,disableLayersManager:!0},paint:{label:`Paint`,value:`paint`,component:PaintSettings_default,hideActions:!0,disableLayersManager:!0}},HEADER_TEXT=`Livery Editor`,_sfc_main$91={__name:`DefaultLayout`,setup(__props){useUINavScope(`default-layout`);let rootStore=useLiveryEditorStore(),infoBar=useInfoBar(),{layers:layers$1}=storeToRefs(rootStore),actionsDrawer=ref(null),settingType=shallowRef(null),layerActions=computed(()=>rootStore.layerActions?{label:rootStore.selectedLayers.length===1?`${rootStore.selectedLayers[0].name} Actions`:`${rootStore.selectedLayers.length} Layers Actions`,items:rootStore.layerActions,allowOpenDrawer:!1}:void 0),headerLabel=computed(()=>rootStore.visibleLayersCount===0?`No Layers`:rootStore.visibleLayersCount+` Layer`+rootStore.visibleLayersCount>1?`s`:``),multiSelectMessage=computed(()=>{if(rootStore.selectedLayers)return rootStore.selectedLayers.length+`Layer${rootStore.selectedLayers.length>1?`s`:``}`});onMounted(()=>{getUINavServiceInstance().useCrossfire=!0});function onBack(){settingType.value?(console.log(`onBack > closed settings`),closeSettings()):rootStore.selectedLayers&&rootStore.selectedLayers.length>0?(console.log(`onBack > closed actions`),rootStore.dismissLayerActions().then()):(console.log(`onBack > catch all`),openExitDialog().then())}function onMenu(){settingType.value?closeActions():rootStore.selectedLayers&&rootStore.selectedLayers.length>0||openSaveDialog()}function closeActions(){settingType.value&&closeSettings(),rootStore.dismissLayerActions().then()}function closeSettings(){settingType.value=null}function onActionTriggered(actionItem){let setting=SETTINGS_VIEWS[actionItem.value];setting?settingType.value=setting:rootStore.onActionItemSelected(actionItem).then()}let saving=ref(!1),dialogStates=reactive({isDialogOpen:!1});async function openExitDialog(){if(dialogStates.isDialogOpen)return!0;dialogStates.isDialogOpen=!0,await rootStore.openExitDialog(),dialogStates.isDialogOpen=!1}function openSaveDialog(){if(dialogStates.isDialogOpen)return!0;saving.value=!0,dialogStates.isDialogOpen=!0,rootStore.save().then(()=>{saving.value=!1,dialogStates.isDialogOpen=!1})}function openPaintSettings(){settingType.value=SETTINGS_VIEWS.paint}let saveLabel=computed(()=>saving.value?`Saving...`:`Save`),HEADER_ITEMS=[{id:`save_editor`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.saveAs1,accent:ACCENTS.main,label:saveLabel,disabled:saving},events:{click:openSaveDialog}},{id:`exit_editor`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.exit,accent:ACCENTS.attention,label:`Exit`},events:{click:openExitDialog}},{id:`paint_settings`,section:`start`,component:shallowRef(bngButton_default),props:{icon:icons.exit,accent:ACCENTS.secondary,label:`Paint`},events:{click:openPaintSettings}}],headerStore=useEditorHeaderStore();watchEffect(()=>{rootStore.currentFile&&rootStore.currentFile.name&&headerStore.setPreheader(rootStore.currentFile.name)}),onMounted(()=>{headerStore.setHeader(HEADER_TEXT),headerStore.addItems(HEADER_ITEMS)}),onUnmounted(()=>{headerStore.removeItems(HEADER_ITEMS)});let NAV_HINTS=[{id:`save`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Save`},action:async()=>await rootStore.save(!1)},{id:`exit`,content:{type:`binding`,props:{uiEvent:`back`},label:`Exit`},action:async()=>rootStore.openExitDialog}],ACTIONS_DRAWER_HINTS=[{id:`actions_back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`}}],SETTINGS_NAV_HINTS=[{id:`selected_done`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`}},{id:`selected_back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Done (Return to Actions)`}}];return watchEffect(()=>{infoBar.clearHints(),settingType.value?infoBar.addHints(SETTINGS_NAV_HINTS):layerActions.value?infoBar.addHints(ACTIONS_DRAWER_HINTS):infoBar.addHints(NAV_HINTS)}),onMounted(()=>{infoBar.addHints(NAV_HINTS)}),onUnmounted(()=>{infoBar.removeHints(...NAV_HINTS.map(x=>x.id))}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$83,[createBaseVNode(`div`,_hoisted_2$71,[withDirectives((openBlock(),createBlock(unref(LayersManager_default),{selectedKeys:unref(rootStore).selectedLayerUids,"onUpdate:selectedKeys":_cache[0]||=$event=>unref(rootStore).selectedLayerUids=$event,layers:unref(layers$1),class:normalizeClass({inactive:settingType.value&&settingType.value.disableLayersManager})},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(headerLabel.value),1)]),_:1}),unref(rootStore).selectMode===`multi`?(openBlock(),createElementBlock(`div`,_hoisted_3$61,[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).attention,onClick:closeActions,class:`cancel-btn`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Cancel`,-1)]]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]),createBaseVNode(`span`,_hoisted_4$48,toDisplayString(multiSelectMessage.value),1)])):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).outlined,disabled:unref(rootStore).selectedLayers&&unref(rootStore).selectedLayers.length>0,onClick:unref(rootStore).toggleEditModeLayout},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_5$40,[createVNode(unref(bngIcon_default),{type:unref(icons).plus},null,8,[`type`]),_cache[2]||=createBaseVNode(`span`,{class:`add-label`},`Add Decal`,-1)])]),_:1},8,[`accent`,`disabled`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),_:1},8,[`selectedKeys`,`layers`,`class`])),[[unref(BngBlur_default)]])]),layerActions.value&&(!settingType.value||!settingType.value.hideActions)?(openBlock(),createBlock(unref(bngActionDrawer_default),{key:0,ref_key:`actionsDrawer`,ref:actionsDrawer,actions:layerActions.value,"item-width":10,"item-margin":1,class:`actions-drawer`,onSelect:onActionTriggered},{controls:withCtx(()=>[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).abandon,onClick:closeActions},null,8,[`accent`,`icon`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),action:withCtx(({item,isLoading,select})=>[createBaseVNode(`div`,_hoisted_6$29,[withDirectives(createVNode(unref(bngImageTile_default),{label:item.toggleAction&&!item.active?item.inactiveLabel:item.label,icon:item.toggleAction&&!item.active?item.inactiveIcon:item.icon,externalImage:item.preview,"bng-nav-item":``,class:`action-tile`,onClick:$event=>select(item)},null,8,[`label`,`icon`,`externalImage`,`onClick`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])]),_:1},8,[`actions`])):createCommentVNode(``,!0),settingType.value?(openBlock(),createElementBlock(`div`,_hoisted_7$25,[settingType.value.propertySettings?(openBlock(),createBlock(unref(LayerSettings_default),normalizeProps(mergeProps({key:0},settingType.value.props)),null,16)):withDirectives((openBlock(),createBlock(unref(LayerSettingsBase_default),{key:1,heading:settingType.value.label},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(settingType.value.component)))]),_:1},8,[`heading`])),[[unref(BngBlur_default)]])])):createCommentVNode(``,!0)])),[[unref(BngOnUiNav_default),onBack,`back`],[unref(BngOnUiNav_default),onMenu,`menu`]])}},DefaultLayout_default=__plugin_vue_export_helper_default(_sfc_main$91,[[`__scopeId`,`data-v-6dca75f9`]]),_hoisted_1$82={class:`editor`,"bng-ui-scope":`livery-editor`},_hoisted_2$70={class:`editor-header-wrapper`},EDITOR_VIEWS_COMPONENT={[EDITOR_VIEWS.decalSelector]:DecalSelector_default,[EDITOR_VIEWS.editMode]:EditModeLayout_default,[EDITOR_VIEWS.default]:DefaultLayout_default},_sfc_main$90={__name:`LiveryEditor`,setup(__props){let store$1=useLiveryEditorStore(),infobar=useInfoBar(),{showIfController}=storeToRefs(controls_default());infobar.visible=!0;let currentView=computed(()=>EDITOR_VIEWS_COMPONENT[store$1.editorView]),minimizedMode=ref(!1);watch(showIfController,value=>{store$1.setUseMousePos(!value)}),onBeforeMount(async()=>{await store$1.startEditor(),store$1.setUseMousePos(!showIfController.value)});let HEADER_ITEMS=[{id:`camera_view`,section:`end`,component:shallowRef(CameraViewButton_default)}],headerStore=useEditorHeaderStore();return onMounted(()=>{headerStore.setPreheader(store$1.currentFile?store$1.currentFile:`New Save`),headerStore.addItems(HEADER_ITEMS)}),onUnmounted(()=>{headerStore.removeItems(HEADER_ITEMS)}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$82,[createBaseVNode(`div`,_hoisted_2$70,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,{class:normalizeClass([`editor-content`,{"layers-collapse":minimizedMode.value}])},[(openBlock(),createBlock(resolveDynamicComponent(currentView.value)))],2)])),[[unref(BngOnUiNav_default),()=>{},`menu,back,ok`]])}},LiveryEditor_default=__plugin_vue_export_helper_default(_sfc_main$90,[[`__scopeId`,`data-v-27ec64b0`]]),_hoisted_1$81={class:`livery-main-view`,"bng-ui-scope":`livery-main-scope`},_hoisted_2$69={key:0,class:`loading-overlay`},_hoisted_3$60={class:`header`},_hoisted_4$47={class:`main-view-content`},_hoisted_5$39={class:`menu-container`},MENU_ITEMS$2=[{label:`Paint`,value:`paint`,icon:icons.colorPalette},{label:`Decals`,value:`decals`,icon:icons.decal},{label:`Settings`,value:`settings`,icon:icons.gearTuningOutline}],blockedEvents=[`tab_l`,`tab_r`],_sfc_main$89={__name:`LiveryMainNew`,setup(__props){let infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),store$1=useLiveryMainStore(),headerStore=useEditorHeaderStore();useUINavScope(`livery-main-scope`);function onMenuItemClicked(item){switch(item){case`paint`:window.bngVue.gotoGameState(`LiveryPaint`);break;case`decals`:window.bngVue.gotoGameState(`LiveryDecals`);break;case`settings`:window.bngVue.gotoGameState(`LiverySettings`);break}}let openedDialog=ref(null);onBeforeMount(async()=>{await store$1.setup(),headerStore.setHeader(`Livery Editor`),headerStore.setPreheader(null)}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(blockedEvents)}),onUnmounted(()=>{uiNavBlocker.clear()});function exit(){store$1.exit().then(()=>{window.bngVue.gotoGameState(`garagemode`)})}function promptSave(){openedDialog.value||(openedDialog.value=`save`,openPrompt(`Enter save name`,`Save`,{buttons:[{label:`Save`,value:text=>({value:1,text}),extras:{default:!0}},{label:`Save and Exit`,value:text=>({value:-1,text}),extras:{accent:ACCENTS.secondary}},{label:`Cancel`,value:text=>({value:0,text}),extras:{cancel:!0,accent:ACCENTS.attention}}],defaultValue:store$1.currentSave.name}).then(res=>{let{value,text}=res;value!==0&&(store$1.currentSave.name=text,store$1.save().then(()=>{value===-1&&openProgress(`Saving and exporting skin...`,`Save`,{cancellable:!1,indeterminate:!0,timeout:1}).promise.then(()=>exit())}),openedDialog.value=null)}))}function promptBack(event){if(openedDialog.value){event.stopPropagation();return}openedDialog.value=`back`,openConfirmation(`Save`,`Save your changes`,[{label:`Save`,value:1,extras:{default:!0}},{label:`Exit (discard changes)`,value:-1,extras:{accent:ACCENTS.attention}},{label:`Cancel`,value:0,extras:{cancel:!0,accent:ACCENTS.secondary}}]).then(res=>{openedDialog.value=null,res===1?promptSave():res===-1&&exit()}),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$81,[unref(store$1).isSetupDone?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_2$69,[..._cache[0]||=[createBaseVNode(`h1`,{class:`text`},`Loading...`,-1)]])),createBaseVNode(`div`,_hoisted_3$60,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_4$47,[createBaseVNode(`div`,_hoisted_5$39,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$2,(item,index)=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,onClick:$event=>onMenuItemClicked(item.value)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)],[unref(BngUiNavFocus_default),MENU_ITEMS$2.length-index]])),64))])])])),[[unref(BngOnUiNav_default),promptBack,`menu`],[unref(BngOnUiNav_default),promptBack,`back`],[unref(BngUiNavLabel_default),`Save/Exit`,`menu,back`]])}},LiveryMainNew_default=__plugin_vue_export_helper_default(_sfc_main$89,[[`__scopeId`,`data-v-a9fbf094`]]),_hoisted_1$80={class:`save-info-container`},_hoisted_2$68={class:`file-name`},_hoisted_3$59={class:`file-modified`},_hoisted_4$46={class:`file-size`},_hoisted_5$38={key:0,class:`save-file-actions`},_sfc_main$88=Object.assign({width:14,height:6,margin:.25},{__name:`FileListItem`,props:{name:{type:String,required:!0},location:{type:String,required:!0},modifiedFormatted:String,fileSizeFormatted:String,selected:Boolean},setup(__props){let store$1=useLiveryFileStore(),mainStore=useLiveryMainStore(),props=__props,activated=ref(!1),openedDialog=ref(null);function load(){mainStore.load(props),window.bngVue.gotoGameState(`LiveryMain`)}function rename(){let model={name:props.name};nextTick(()=>{openedDialog.value=`rename`}),openFormDialog(FileEditForm_default,model,model$1=>model$1.name!==null&&model$1.name!==void 0&&model$1.name!==``,`Rename file`,`Enter new name`).then(res=>{res.value&&store$1.renameFile(props,res.formData.name),forceActivateScope()})}function deleteSave(){openConfirmation(`Delete`,`Are you sure you want to delete ${props.name}`).then(res=>{res?store$1.deleteFile(props):forceActivateScope()})}function onActivate$1(activate){activated.value=activate,nextTick(()=>{activate&&openedDialog.value&&(openedDialog.value=null)})}function forceActivateScope(){nextTick(()=>{activated.value=!0})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:`file-list-item`,onActivate:_cache[0]||=$event=>onActivate$1(!0),onDeactivate:_cache[1]||=$event=>onActivate$1(!1)},[createBaseVNode(`div`,_hoisted_1$80,[createBaseVNode(`div`,_hoisted_2$68,toDisplayString(__props.name),1),createBaseVNode(`div`,_hoisted_3$59,toDisplayString(__props.modifiedFormatted),1),createBaseVNode(`div`,_hoisted_4$46,toDisplayString(__props.fileSizeFormatted),1)]),__props.selected?(openBlock(),createElementBlock(`div`,_hoisted_5$38,[createVNode(unref(bngButton_default),{icon:unref(icons).import,onClick:load},null,8,[`icon`]),createVNode(unref(bngButton_default),{icon:unref(icons).rename,accent:unref(ACCENTS).secondary,onClick:rename},null,8,[`icon`,`accent`]),createVNode(unref(bngButton_default),{icon:unref(icons).trashBin2,accent:unref(ACCENTS).attention,onClick:deleteSave},null,8,[`icon`,`accent`])])):createCommentVNode(``,!0)],32)),[[unref(BngScopedNav_default),{activated:activated.value}]])}}),FileListItem_default=__plugin_vue_export_helper_default(_sfc_main$88,[[`__scopeId`,`data-v-46a472ab`]]),_hoisted_1$79={class:`livery-manager-view`,"bng-ui-scope":`livery-manager-scope`},_hoisted_2$67={class:`header`},_hoisted_3$58={class:`main-view-content`},_hoisted_4$45={key:1,class:`empty-save-container`},_hoisted_5$37={class:`empty-save-message`},_hoisted_6$28={key:1,class:`menu-container`},_sfc_main$87={__name:`LiveryManager`,setup(__props){let store$1=useLiveryFileStore(),mainStore=useLiveryMainStore(),headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker();useUINavScope(`livery-manager-scope`);let{files}=storeToRefs(store$1),selectedSave=ref(null),screenState=reactive({isOpenLiveries:!1}),MENU_ITEMS$4=[{label:`New Livery`,value:`new`,icon:icons.plus,action:onCreateNew},{label:`Open Liveries`,value:`load`,icon:icons.decal,action:onOpenLiveries}];watch(()=>files.value,()=>selectedSave.value=null,{deep:!0}),onBeforeMount(()=>{store$1.init()}),onMounted(()=>{headerStore.setHeader(`Livery Editor`),headerStore.setPreheader(null),uiNavBlocker.blockOnly([`tab_l`,`tab_r`]),infobar.visible=!0}),onUnmounted(()=>{uiNavBlocker.clear()});function onCreateNew(){mainStore.isSetupDone=!1,window.bngVue.gotoGameState(`LiveryMain`)}function onOpenLiveries(){screenState.isOpenLiveries=!0,headerStore.setPreheader(`Liveries`)}function goBack(event){screenState.isOpenLiveries?(screenState.isOpenLiveries=!1,selectedSave.value=null):window.bngVue.gotoGameState(`garagemode`),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$79,[createBaseVNode(`div`,_hoisted_2$67,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$58,[screenState.isOpenLiveries?(openBlock(),createElementBlock(Fragment,{key:0},[unref(files)&&unref(files).length>0?withDirectives((openBlock(),createBlock(unref(bngList_default),{key:0,layout:unref(LIST_LAYOUTS).LIST,"target-width":14,"target-height":6,"target-margin":.25,big:!0,class:`files-list`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(files),(file$1,index)=>withDirectives((openBlock(),createBlock(FileListItem_default,mergeProps({ref_for:!0},file$1,{key:file$1.name,selected:selectedSave.value===index,onFocus:$event=>selectedSave.value=index,onClick:$event=>selectedSave.value=index}),null,16,[`selected`,`onFocus`,`onClick`])),[[unref(BngFocusIf_default),selectedSave.value===null&&index===0]])),128))]),_:1},8,[`layout`])),[[unref(BngBlur_default)]]):(openBlock(),createElementBlock(`div`,_hoisted_4$45,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_5$37,[..._cache[0]||=[createTextVNode(`No saved liveries`,-1)]])),[[unref(BngBlur_default)]])]))],64)):(openBlock(),createElementBlock(`div`,_hoisted_6$28,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$4,(item,index)=>withDirectives(createVNode(unref(bngImageTile_default),{key:item.value,label:item.label,icon:item.icon,onClick:item.action},null,8,[`label`,`icon`,`onClick`]),[[unref(BngUiNavFocus_default),MENU_ITEMS$4.length-index],[unref(BngBlur_default)]])),64))]))])])),[[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryManager_default=__plugin_vue_export_helper_default(_sfc_main$87,[[`__scopeId`,`data-v-8e7dbe60`]]),_hoisted_1$78={class:`material-settings-content`},_hoisted_2$66={class:`color-values-container`,"bng-no-child-nav":``},_sfc_main$86={__name:`MaterialSettings`,props:{initialColor:Array},emits:[`change`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,paint=new Paint,color=ref({hue:.5,saturation:1,luminosity:.5}),inputHue=computed({get:()=>color.value.hue.toFixed(3),set:newValue=>{color.value.hue=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),inputSat=computed({get:()=>color.value.saturation.toFixed(3),set:newValue=>{color.value.saturation=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),inputLum=computed({get:()=>color.value.luminosity.toFixed(3),set:newValue=>{color.value.luminosity=typeof newValue==`string`?+newValue:newValue,notifyListeners()}}),isPreciseActive=ref(!1),colorPickerStep=computed(()=>isPreciseActive.value?.001:.01);watch(()=>props.initialColor,()=>{props.initialColor&&(paint.rgba=props.initialColor,color.value.hue=paint.hsl[0],color.value.saturation=paint.hsl[1],color.value.luminosity=paint.hsl[2])},{deep:!0,immediate:!0});function notifyListeners(){let hsl=[color.value.hue,color.value.saturation,color.value.luminosity];paint.hsl=hsl,emit$1(`change`,{colorHsl:hsl,colorRgb:paint.rgb})}function handleAction2(element){isPreciseActive.value=element.detail.value===1}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(LayerSettingsBase_default),{class:`material-settings`},{heading:withCtx(()=>[..._cache[4]||=[createTextVNode(`Color`,-1)]]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$78,[createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,step:colorPickerStep.value,onChange:notifyListeners},null,8,[`modelValue`,`step`]),createBaseVNode(`div`,_hoisted_2$66,[createVNode(unref(bngInput_default),{prefix:`h`,modelValue:inputHue.value,"onUpdate:modelValue":_cache[1]||=$event=>inputHue.value=$event},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`s`,modelValue:inputSat.value,"onUpdate:modelValue":_cache[2]||=$event=>inputSat.value=$event},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`b`,modelValue:inputLum.value,"onUpdate:modelValue":_cache[3]||=$event=>inputLum.value=$event},null,8,[`modelValue`])])])]),_:1})),[[unref(BngUiNavLabel_default),`[Hold] Precise`,`action_2`],[unref(BngOnUiNav_default),handleAction2,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handleAction2,`action_2`,{down:!0}]])}},MaterialSettings_default=__plugin_vue_export_helper_default(_sfc_main$86,[[`__scopeId`,`data-v-45b64f6e`]]),_hoisted_1$77={class:`paint-main-view`,"bng-ui-scope":`paint-main-scope`},_hoisted_2$65={class:`header`},_hoisted_3$57={class:`paint-content-container`},_hoisted_4$44={class:`paint-content`},_sfc_main$85={__name:`LiveryPaintMain`,setup(__props){let store$1=useLiveryMainStore(),headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`paint-main-scope`);let initialColor=ref(null),blockedEvents$1=[`tab_r`,`tab_l`];onMounted(()=>{headerStore.setPreheader([`Paint`]),store$1.setup(),infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(blockedEvents$1),events$3.on(`liveryEditor_fill_layerData`,onLayerData),Lua_default.extensions.ui_liveryEditor_layers_fill.requestLayerData()}),onUnmounted(()=>{uiNavBlocker.clear(),events$3.off(`liveryEditor_fill_layerData`)});function onLayerData(data){console.log(`layer data changed`,data),initialColor.value=data.color}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layers_fill.saveChanges().then(()=>{window.bngVue.gotoGameState(`LiveryMain`)})}function restoreDefault(){Lua_default.extensions.ui_liveryEditor_layers_fill.restoreDefault()}function cancelChanges(){openConfirmation(`Undo Changes`,`Lose unsaved changes?`).then(res=>{res&&(Lua_default.extensions.ui_liveryEditor_layers_fill.restoreLayer(),window.bngVue.gotoGameState(`LiveryMain`))})}function onMaterialValueChanged(data){Lua_default.extensions.ui_liveryEditor_layers_fill.updateLayer({color:data.colorRgb})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$77,[createBaseVNode(`div`,_hoisted_2$65,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$57,[createBaseVNode(`div`,_hoisted_4$44,[withDirectives(createVNode(MaterialSettings_default,{"initial-color":initialColor.value,onChange:onMaterialValueChanged},null,8,[`initial-color`]),[[unref(BngBlur_default)]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{onClick:saveChanges},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{controller:``,"ui-event":`context`}),_cache[0]||=createBaseVNode(`span`,null,`Apply`,-1)]),_:1})),[[unref(BngOnUiNav_default),void 0,`context`,{asMouse:!0}]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:`secondary`,onClick:restoreDefault},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{controller:``,"ui-event":`action_3`}),_cache[1]||=createBaseVNode(`span`,null,`Restore Default`,-1)]),_:1})),[[unref(BngOnUiNav_default),void 0,`action_3`,{asMouse:!0}]])])])])),[[unref(BngOnUiNav_default),cancelChanges,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryPaintMain_default=__plugin_vue_export_helper_default(_sfc_main$85,[[`__scopeId`,`data-v-74e232cb`]]),_hoisted_1$76={class:`layer-inspector-base`},_hoisted_2$64={class:`inspector-heading`},_hoisted_3$56={class:`inspector-content`},_sfc_main$84={__name:`LayerInspectorBase`,props:{heading:{type:String}},setup(__props){return useSlots(),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$76,[createBaseVNode(`div`,_hoisted_2$64,[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`heading`,{},()=>[createBaseVNode(`span`,null,toDisplayString(__props.heading),1)],!0)]),_:3})]),createBaseVNode(`div`,_hoisted_3$56,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])]))}},LayerInspectorBase_default=__plugin_vue_export_helper_default(_sfc_main$84,[[`__scopeId`,`data-v-c60f30a4`]]),_hoisted_1$75={class:`direction-buttons-row`},_hoisted_2$63={class:`icon-binding-wrapper`},_hoisted_3$55={class:`icon-binding-wrapper`},_hoisted_4$43={class:`direction-buttons-row`},_hoisted_5$36={class:`icon-binding-wrapper`},_hoisted_6$27={class:`stacked-arrows`},_hoisted_7$24={class:`icon-binding-wrapper`},_hoisted_8$19={class:`stacked-arrows`},_hoisted_9$17={class:`dropdown-container`},_sfc_main$83={__name:`LayerOrder`,setup(__props){let ORDER_TOOL$1=Lua_default.extensions.ui_liveryEditor_tools_group,store$1=useLiveryEditorStore(),_order=ref(2),order=computed({get:()=>_order.value,set(newValue){_order.value=newValue,ORDER_TOOL$1.setOrder(newValue)}});computed(()=>store$1.selectedLayers[0].siblingCount);let orderOptions=computed(()=>Array.from({length:store$1.layers.length-1},(_,i)=>({label:`${i+1}`,value:i+2})));onMounted(()=>{store$1.selectedLayers&&store$1.selectedLayers.length>0&&(_order.value=store$1.selectedLayers[0].order)});let moveUp=()=>{ORDER_TOOL$1.moveOrderUp().then(value=>_order.value=value)},moveDown=()=>{ORDER_TOOL$1.moveOrderDown().then(value=>_order.value=value)},moveToTop=()=>{ORDER_TOOL$1.changeOrderToTop().then(value=>_order.value=value)},moveToBottom=()=>{ORDER_TOOL$1.changeOrderToBottom().then(value=>_order.value=value)};return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Order`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$75,[withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move Up`,onClick:moveUp},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_2$63,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])])]),_:1})),[[unref(BngOnUiNav_default),moveUp,`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move Down`,onClick:moveDown},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$55,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown},null,8,[`type`])])]),_:1})),[[unref(BngOnUiNav_default),moveDown,`ok`,{focusRequired:!0}]])]),createBaseVNode(`div`,_hoisted_4$43,[withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move to Top`,onClick:moveToTop},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$36,[createBaseVNode(`div`,_hoisted_6$27,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeUp},null,8,[`type`])])])]),_:1})),[[unref(BngOnUiNav_default),moveToTop,`ok`,{focusRequired:!0}]]),withDirectives((openBlock(),createBlock(unref(bngTile_default),{"bng-nav-item":``,label:`Move to Bottom`,onClick:moveToBottom},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$24,[createBaseVNode(`div`,_hoisted_8$19,[createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`]),createVNode(unref(bngIcon_default),{type:unref(icons).arrowLargeDown,disabled:unref(store$1).selectedLayers.length>1},null,8,[`type`,`disabled`])])])]),_:1})),[[unref(BngOnUiNav_default),moveToBottom,`ok`,{focusRequired:!0}]])]),createBaseVNode(`div`,_hoisted_9$17,[createVNode(unref(bngDropdown_default),{modelValue:order.value,"onUpdate:modelValue":_cache[0]||=$event=>order.value=$event,items:orderOptions.value},null,8,[`modelValue`,`items`])])]),_:1})),[[unref(BngBlur_default)]])}},LayerOrder_default=__plugin_vue_export_helper_default(_sfc_main$83,[[`__scopeId`,`data-v-d8fda3d9`]]),_hoisted_1$74={class:`decals-main-view`,"bng-ui-scope":`decals-main-scope`},_hoisted_2$62={class:`header`},_hoisted_3$54={class:`main-view-content`},_hoisted_4$42={class:`add-content-wrapper`},_hoisted_5$35={class:`action-tile`},_hoisted_6$26={key:1,class:`popup-settings`},CAMERA_BUTTONS$1=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],BLOCKED_UINAV_EVENTS$1=[`tab_l`,`tab_r`],SHOW_HIDE_DECAL_EVENT=`action_2`,_sfc_main$82={__name:`LiveryDecalsMain`,setup(__props){let ACTION_ITEM_ICON={requestReproject:icons.view,transform:icons.transform,materials:icons.colorPalette,highlight:icons.lightGarageG11,requestMirror:icons.reflect,order:icons.sortAscDown,enabled:icons.eyeOutlineOpened,"enabled-off":icons.eyeOutlineClosed,delete:icons.trashBin1,duplicate:icons.copy},layerActionsState=reactive({mirrored:!1,mirrorFlipped:!1,highlight:!0,enabled:!0}),MIRROR_ITEMS=[{label:`Mirror`,value:`mirror`,isSwitch:!0,switchValue:toRef(layerActionsState,`mirrored`)},{label:`Flip Mirrored`,value:`flipMirrored`,isSwitch:!0,switchValue:toRef(layerActionsState,`mirrorFlipped`),disabled:computed(()=>!layerActionsState.mirrored)}],headerStore=useEditorHeaderStore(),infobar=useInfoBar();useUINavScope(`decals-main-scope`);let uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge(),layers$1=ref([]),selectedLayers=ref([]),layerActions=ref([]),allowActionsDrawerShow=ref(!0),actionDrawer=ref(null),currentActionDrawerLevel=ref(null),popupSettings=ref(null),isReprojectActive=ref(!1),focusedLayer=ref(null),selectedLayerKeys=computed(()=>selectedLayers.value?selectedLayers.value.map(x=>x.uid):null),actionsDrawerData=computed(()=>{let layerName=selectedLayers.value&&selectedLayers.value.length>0?selectedLayers.value[0].name:null;return layerActions.value&&layerActions.value.length>0?{label:layerName,items:layerActions.value,allowOpenDrawer:!1}:void 0}),contextUIEventLabel=computed(()=>isReprojectActive.value?`Reproject`:`Add Decal`),action2UIEventLabel=computed(()=>focusedLayer.value||selectedLayers.value&&selectedLayers.value.length>0?`Enable/Disable Decal`:void 0);watchEffect(()=>{let eventsToBlock=[...BLOCKED_UINAV_EVENTS$1];uiNavBlocker.clear(),(isReprojectActive.value||!focusedLayer.value&&(!selectedLayers.value||selectedLayers.value.length===0))&&eventsToBlock.push(SHOW_HIDE_DECAL_EVENT),uiNavBlocker.blockOnly(eventsToBlock)}),onBeforeMount(()=>{headerStore.setPreheader([`Decals`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_OnLayersUpdated`,onLayersUpdated),events$3.on(`liveryEditor_selection_actionsUpdated`,onActionsUpdated),events$3.on(`liveryEditor_selection_selectedChanged`,onSelectedChanged),Lua_default.extensions.ui_liveryEditor_layers.requestInitialData(),Lua_default.extensions.ui_liveryEditor_selection.requestInitialData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_OnLayersUpdated`,onLayersUpdated),events$3.off(`liveryEditor_selection_actionsUpdated`,onActionsUpdated),events$3.off(`liveryEditor_selection_selectedChanged`,onSelectedChanged)});function onBack(event){popupSettings.value?(popupSettings.value=null,allowActionsDrawerShow.value=!0):actionsDrawerData.value?handleDrawerBack():window.bngVue.gotoGameState(`LiveryMain`),event.stopPropagation()}function addDecal(){window.bngVue.gotoGameState(`LiveryDecalSelector`)}let isReproject;async function onActionSwitchClicked(item){item.switchValue=await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(item.value)}async function onActionTriggered(item){if(!item.value){currentActionDrawerLevel.value===`requestReproject`&&!isReproject&&await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`cancelReproject`),isReprojectActive.value=!1,isReproject=!1,currentActionDrawerLevel.value=null;return}if((item.lazyLoadItems||item.items)&&(currentActionDrawerLevel.value=item.value),item.value===`requestReproject`){if(!item.items){let timeoutid=setTimeout(()=>{item.items=CAMERA_BUTTONS$1,clearTimeout(timeoutid)},500)}isReprojectActive.value=!0}else if(item.value===`requestMirror`){item.items=MIRROR_ITEMS;return}else if(item.value===`order`){allowActionsDrawerShow.value=!1,popupSettings.value=markRaw(LayerOrder_default);return}else if(CAMERA_BUTTONS$1.find(x=>x.value===item.value)){await Lua_default.extensions.ui_liveryEditor_camera.setOrthographicView(item.value);return}await Lua_default.extensions.ui_liveryEditor_layerAction.performAction(item.value)}function onLayersUpdated(data){layers$1.value=data}function onActionsUpdated(data){if(layerActions.value=data,data&&Array.isArray(data)&&data.length>0){let highlightAction=layerActions.value.find(x=>x.value===`highlight`);highlightAction.switchValue=toRef(layerActionsState,`highlight`)}}function onSelectedChanged(data){if(selectedLayers.value=data,data&&Array.isArray(data)&&data.length>0){let first=data[0];layerActionsState.highlight=first.highlighted,layerActionsState.mirrored=first.mirrored,layerActionsState.mirrorFlipped=first.mirrorFlipped}}let closeActionDrawer=()=>{currentActionDrawerLevel.value&¤tActionDrawerLevel.value===`requestReproject`&&(Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`cancelReproject`).then(()=>{}),currentActionDrawerLevel.value=null),Lua_default.extensions.ui_liveryEditor_selection.clearSelection()};function handleDrawerBack(){currentActionDrawerLevel.value?actionDrawer.value.goBack():closeActionDrawer()}function onFocusedLayer(layer){focusedLayer.value=layer}let toggleEnabled=()=>{if(focusedLayer.value)Lua_default.extensions.ui_liveryEditor_layerAction.toggleEnabledByLayerUid(focusedLayer.value.uid);else if(selectedLayers.value&&selectedLayers.value.length>0){let layer=selectedLayers.value[0];Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`enabled`).then(luaRes=>{layer.enabled=luaRes})}},handleContext=()=>{isReprojectActive.value?Lua_default.extensions.ui_liveryEditor_layerAction.performAction(`reproject`).then(()=>{isReproject=!0,isReprojectActive.value=!1,actionDrawer.value.goBack()}):popupSettings.value||addDecal()},handleAction2=()=>{if(isReprojectActive.value)return!1;toggleEnabled()};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$74,[createBaseVNode(`div`,_hoisted_2$62,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$54,[withDirectives((openBlock(),createBlock(unref(LayersManager_default),{selectedKeys:selectedLayerKeys.value,"onUpdate:selectedKeys":_cache[0]||=$event=>selectedLayerKeys.value=$event,layers:layers$1.value,class:`layers-manager`,onFocusedLayer},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Layers`,-1)]]),_:1}),withDirectives((openBlock(),createBlock(unref(bngButton_default),{"bng-no-nav":`true`,accent:unref(ACCENTS).outlined,onClick:addDecal},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$42,[createVNode(unref(bngBinding_default),{trackIgnore:!0,uiEvent:`context`,deviceMask:`xinput`}),_cache[2]||=createBaseVNode(`span`,{class:`add-label`},`Add Decal`,-1)])]),_:1},8,[`accent`])),[[unref(BngDisabled_default),isReprojectActive.value]])]),_:1},8,[`selectedKeys`,`layers`])),[[unref(BngBlur_default)]]),actionsDrawerData.value&&allowActionsDrawerShow.value?(openBlock(),createBlock(unref(bngActionDrawer_default),{key:0,ref_key:`actionDrawer`,ref:actionDrawer,blur:``,alwaysShowBack:!1,actions:actionsDrawerData.value,"item-width":10,"item-margin":1,class:`actions-drawer`,onSelect:onActionTriggered},{controls:withCtx(()=>[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).outlined,icon:unref(icons).exit,onClick:closeActionDrawer},null,8,[`accent`,`icon`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])]),action:withCtx(({item,select,order})=>[createBaseVNode(`div`,_hoisted_5$35,[item.isSwitch?withDirectives((openBlock(),createBlock(unref(bngTile_default),{key:0,"bng-nav-item":``,label:item.label,onClick:$event=>onActionSwitchClicked(item)},{default:withCtx(()=>[createVNode(unref(bngSwitch_default),{modelValue:item.switchValue,"onUpdate:modelValue":$event=>item.switchValue=$event},null,8,[`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`label`,`onClick`])),[[unref(BngUiNavFocus_default),order===0?0:void 0],[unref(BngFocusIf_default),order===0],[unref(BngDisabled_default),item.disabled],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):withDirectives((openBlock(),createBlock(unref(bngImageTile_default),{key:1,"bng-nav-item":``,label:item.label,icon:item.icon?item.icon:ACTION_ITEM_ICON[item.value],class:`action-tile`,onClick:$event=>select(item)},null,8,[`label`,`icon`,`onClick`])),[[unref(BngUiNavFocus_default),order===0?0:void 0],[unref(BngFocusIf_default),order===0],[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])]),_:1},8,[`actions`])):createCommentVNode(``,!0),popupSettings.value?(openBlock(),createElementBlock(`div`,_hoisted_6$26,[(openBlock(),createBlock(resolveDynamicComponent(popupSettings.value)))])):createCommentVNode(``,!0)])])),[[unref(BngUiNavLabel_default),contextUIEventLabel.value,`context`],[unref(BngUiNavLabel_default),action2UIEventLabel.value,`action_2`],[unref(BngUiNavLabel_default),`Back`,`menu,back`],[unref(BngOnUiNav_default),onBack,`menu,back`],[unref(BngOnUiNav_default),handleContext,`context`],[unref(BngOnUiNav_default),handleAction2,`action_2`]])}},LiveryDecalsMain_default=__plugin_vue_export_helper_default(_sfc_main$82,[[`__scopeId`,`data-v-b9d45c3c`]]),_hoisted_1$73={class:`decal-selector-view`,"bng-ui-scope":`decal-selector-scope`},_hoisted_2$61={class:`header`},_hoisted_3$53={class:`main-view-content`},_hoisted_4$41={key:0,class:`side-menu`},_hoisted_5$34={class:`list-container`},BLOCKED_UINAV_EVENTS=[`tab_l`,`tab_r`],_sfc_main$81={__name:`LiveryDecalSelector`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`decal-selector-scope`);let categorizedTextures=ref([]),selectedCategory=ref(null),textures=computed(()=>{if(categorizedTextures.value&&categorizedTextures.value.length>0&&selectedCategory.value){let cat=categorizedTextures.value.find(x=>x.value===selectedCategory.value);if(cat)return cat.items}return null});async function select(item){let layer=await Lua_default.extensions.ui_liveryEditor_layers_decal.addLayerCentered({texturePath:item.preview});await Lua_default.extensions.ui_liveryEditor_selection.select(layer.uid,!0),window.bngVue.gotoGameState(`LiveryDecals`)}function goBack(event){window.bngVue.gotoGameState(`LiveryDecals`),event.stopPropagation()}function onData(data){categorizedTextures.value=data,!data||data.length===0?selectedCategory.value=null:selectedCategory.value||=data[0].value}return onBeforeMount(()=>{headerStore.setPreheader([`Decals`,`Textures`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0,Lua_default.extensions.ui_liveryEditor_resources.requestData(),events$3.on(`liveryEditor_resources_data`,onData),uiNavBlocker.blockOnly(BLOCKED_UINAV_EVENTS)}),onBeforeMount(()=>{events$3.off(`liveryEditor_resources_data`,onData),uiNavBlocker.clear()}),(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$73,[createBaseVNode(`div`,_hoisted_2$61,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$53,[categorizedTextures.value?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4$41,[(openBlock(!0),createElementBlock(Fragment,null,renderList(categorizedTextures.value,category=>(openBlock(),createBlock(unref(bngButton_default),{key:category.value,label:category.label,accent:`text`,onClick:$event=>selectedCategory.value=category.value},null,8,[`label`,`onClick`]))),128))])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_5$34,[textures.value?withDirectives((openBlock(),createBlock(unref(bngList_default),{key:0,layout:unref(LIST_LAYOUTS).TILES,"target-width":8,"target-height":8,"target-margin":.25,big:!0,class:`textures-list`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(textures.value,(item,index)=>withDirectives((openBlock(),createBlock(DecalSelectorItem_default,{"bng-nav-item":``,key:item.preview,externalImage:item.preview,"data-decal-item":index,onClick:$event=>select(item)},null,8,[`externalImage`,`data-decal-item`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngUiNavFocus_default),index===0?0:void 0],[unref(BngFocusIf_default),index===0]])),128))]),_:1},8,[`layout`])),[[unref(BngBlur_default)]]):createCommentVNode(``,!0)])])])),[[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngUiNavLabel_default),`Back`,`back,menu`]])}},LiveryDecalSelector_default=__plugin_vue_export_helper_default(_sfc_main$81,[[`__scopeId`,`data-v-fc11228e`]]),_hoisted_1$72={class:`layer-edit-view`,"bng-ui-scope":`layer-edit-scope`},_hoisted_2$60={class:`header`},_hoisted_3$52={class:`main-view-content`},_hoisted_4$40={class:`menu-container`},MENU_ITEMS$1=[{label:`Projection`,value:`projection`,icon:icons.decal},{label:`Transform`,value:`transform`,icon:icons.colorPalette},{label:`Materials`,value:`materials`,icon:icons.decal}],noop=()=>{},_sfc_main$80={__name:`LiveryLayerEdit`,setup(__props){useEditorHeaderStore(),useDecalSelectorStore();let mainStore=useLiveryMainStore(),infobar=useInfoBar();useUINavScope(`layer-edit-scope`);function onMenuItemClicked(item){switch(item.value){case`transform`:router_default.push({name:`LayerTransform`});break;case`materials`:router_default.push({name:`LayerMaterials`});break;case`projection`:router_default.push({name:`LayerProjection`});break}}function goBack(){router_default.replace({name:`LiveryDecals`}),mainStore.exitLayerEdit()}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!0).then(()=>goBack())}onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS)}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,await mainStore.setupLayerEdit(),await Lua_default.extensions.ui_liveryEditor_layerEdit.showCursorOrLayer(!0)}),onBeforeUnmount(async()=>{await Lua_default.extensions.ui_liveryEditor_layerEdit.showCursorOrLayer(!1)});let NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`ok`},label:`Done`},action:saveChanges},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$72,[createBaseVNode(`div`,_hoisted_2$60,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$52,[createBaseVNode(`div`,_hoisted_4$40,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS$1,item=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,class:`menu-item`,onClick:$event=>onMenuItemClicked(item)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)]])),64))])])])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),saveChanges,`menu`],[unref(BngOnUiNav_default),noop,`rotate_h_cam`],[unref(BngOnUiNav_default),noop,`rotate_v_cam`]])}},LiveryLayerEdit_default=__plugin_vue_export_helper_default(_sfc_main$80,[[`__scopeId`,`data-v-c339e1a6`]]),_hoisted_1$71={class:`camera-settings-view`,"bng-ui-scope":`camera-settings-scope`},_hoisted_2$59={class:`header`},_hoisted_3$51={class:`main-view-content`},_hoisted_4$39={class:`menu-container`},MENU_ITEMS=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$79={__name:`LiveryCameraSettings`,setup(__props){let CAMERA_LUA$1=Lua_default.extensions.ui_liveryEditor_camera,headerStore=useEditorHeaderStore();useDecalSelectorStore();let infobar=useInfoBar();useUINavScope(`camera-settings-scope`);function onMenuItemClicked(item){CAMERA_LUA$1.setOrthographicView(item.value)}function goBack(){router_default.replace({name:`LiveryDecals`})}function done(){router_default.replace({name:`LiveryDecalSelector`})}onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setPreheader([`Select Camera`])}),onMounted(()=>{infobar.visible=!0,infobar.showSysInfo=!0});let NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`}},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$71,[createBaseVNode(`div`,_hoisted_2$59,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$51,[createBaseVNode(`div`,_hoisted_4$39,[(openBlock(),createElementBlock(Fragment,null,renderList(MENU_ITEMS,item=>withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,key:item.value,label:item.label,icon:item.icon,onClick:$event=>onMenuItemClicked(item)},null,8,[`label`,`icon`,`onClick`]),[[unref(BngBlur_default)]])),64))])])])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),done,`menu`]])}},LiveryCameraSettings_default=__plugin_vue_export_helper_default(_sfc_main$79,[[`__scopeId`,`data-v-376ce11c`]]),_hoisted_1$70={class:`layer-transform-view`,"bng-ui-scope":`layer-transform-scope`},_hoisted_2$58={class:`header`},_hoisted_3$50={class:`main-view-content`},_hoisted_4$38={class:`inspector-container`},_hoisted_5$33={class:`transform-setting-item`},_hoisted_6$25={key:0},_hoisted_7$23={key:1,class:`transform-setting-inputs`},_hoisted_8$18={class:`slider-text-container`},_hoisted_9$16={class:`slider-text-container`},_hoisted_10$12={key:2,class:`display-values-container`},_hoisted_11$10={key:1,class:`transform-setting-item`},_hoisted_12$7={key:0,class:`transform-setting-inputs`},_hoisted_13$7={class:`slider-text-container`},_hoisted_14$7={class:`slider-text-container`},_hoisted_15$7={key:1,class:`display-values-container`},_hoisted_16$7={key:3,class:`transform-setting-item`},_hoisted_17$6={key:0,class:`transform-setting-inputs`},_hoisted_18$5={class:`slider-text-container`},_hoisted_19$3={key:1,class:`display-values-container`},_hoisted_20$3={key:5,class:`transform-setting-item`},_hoisted_21$3={key:0,class:`transform-setting-inputs`},_hoisted_22$3={class:`slider-text-container`},_hoisted_23$3={class:`slider-text-container`},_hoisted_24$2={key:1,class:`display-values-container`},_hoisted_25$1={class:`edit-button-label`},INPUT_MIN=0,INPUT_MAX=1,_sfc_main$78={__name:`LayerTransform`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),navBlocker=useUINavBlocker(),{events:events$3}=useBridge();useUINavScope(`layer-transform-scope`);let transformState=reactive({positionX:0,positionY:0,scaleX:0,scaleY:0,skewX:0,skewY:0,rotation:0}),isHoldModifier=ref(!1),isPreciseActive=ref(!1),isTabRightActive=ref(!1),stateData=ref(null),isEdit=ref(!1),isReapplying=ref(!1),isRepositionActive=ref(!1),isUseMouse=ref(!1),positionX=computed({get:()=>transformState.positionX,set:newValue=>{let value=assertInt(newValue);transformState.positionX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setPosition(value,transformState.positionY)}}),positionY=computed({get:()=>transformState.positionY,set:newValue=>{let value=assertInt(newValue);transformState.positionY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setPosition(transformState.positionX,value)}}),scaleX=computed({get:()=>transformState.scaleX,set:newValue=>{let value=assertInt(newValue);transformState.scaleX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setScale(value,transformState.scaleY)}}),scaleY=computed({get:()=>transformState.scaleY,set:newValue=>{let value=assertInt(newValue);transformState.scaleY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setScale(transformState.scaleX,value)}}),skewX=computed({get:()=>transformState.skewX,set:newValue=>{let value=assertInt(newValue);transformState.skewX=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setSkew(value,transformState.skewY)}}),skewY=computed({get:()=>transformState.skewY,set:newValue=>{let value=assertInt(newValue);transformState.skewY=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setSkew(transformState.skewX,value)}}),rotation=computed({get:()=>transformState.rotation,set:newValue=>{let value=assertInt(newValue);transformState.rotation=value,isEdit.value&&Lua_default.extensions.ui_liveryEditor_layerEdit.setRotation(value)}}),hintLabels=computed(()=>{let labels={},focusLabel=`Move`,focusEvents=[`focus_l`,`focus_u`,`focus_r`,`focus_d`,`focus_lr`,`focus_ud`],rotateCamLabel=`Scale`;return isTabRightActive.value?rotateCamLabel=`Pan`:isHoldModifier.value&&(rotateCamLabel=`Skew`),!isTabRightActive.value&&!isHoldModifier.value&&focusEvents.forEach(uiEvent=>labels[uiEvent]=`Move`),[`rotate_h_cam`,`rotate_v_cam`].forEach(uiEvent=>labels[uiEvent]=rotateCamLabel),labels.tab_l=isTabRightActive.value?void 0:`[Hold] Skew`,labels.tab_r=isHoldModifier.value?void 0:`[Hold] Camera`,labels.action_2=isTabRightActive.value?void 0:`[Hold] Precise`,labels});watchEffect(()=>{navBlocker.clear(),isTabRightActive.value&&navBlocker.allowOnly([`rotate_h_cam`,`rotate_v_cam`,`tab_r`]),isHoldModifier.value&&navBlocker.allowOnly([`rotate_h_cam`,`rotate_v_cam`,`action_2`,`tab_l`])}),onBeforeMount(()=>{headerStore.setPreheader([`Transform`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),events$3.on(`liveryEditor_layerEdit_repositionSuccess`,onRepositionSuccess),events$3.on(`liveryEditor_layerEdit_rotationChanged`,onRotationChanged),events$3.on(`liveryEditor_layerEdit_positionChanged`,onPositionChanged),events$3.on(`liveryEditor_layerEdit_scaleChanged`,onScaleChanged),events$3.on(`liveryEditor_layerEdit_skewChanged`,onSkewChanged),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestInitialLayerData()}),onBeforeUnmount(async()=>{events$3.off(`liveryEditor_layerEdit_state`,onStateData),events$3.off(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),events$3.off(`liveryEditor_layerEdit_repositionSuccess`,onRepositionSuccess),events$3.off(`liveryEditor_layerEdit_rotationChanged`,onRotationChanged),events$3.off(`liveryEditor_layerEdit_positionChanged`,onPositionChanged),events$3.off(`liveryEditor_layerEdit_scaleChanged`,onScaleChanged),events$3.off(`liveryEditor_layerEdit_skewChanged`,onSkewChanged)});function onPositionChanged(position){positionX.value=position.x,positionY.value=position.y}function onRotationChanged(value){transformState.rotation=value}function onSkewChanged(skew){skewX.value=skew.x,skewY.value=skew.y}function onScaleChanged(scale){scaleX.value=scale.x,scaleY.value=scale.y}function onRepositionSuccess(){isRepositionActive.value=!isRepositionActive.value}function handleModifier(element){isHoldModifier.value=element.detail.value===1}function handlePrecise(element){let isPrecise=element.detail.value===1;isPreciseActive.value=isPrecise,Lua_default.extensions.ui_liveryEditor_layerEdit.holdPrecise(isPrecise)}function handleTabRight(element){isTabRightActive.value=element.detail.value===1}function handleAction3(element){isRepositionActive.value?toggleUseMouseOrCursor(element):toggleReposition(element)}function toggleReposition(element){let isReposition=isRepositionActive.value;isReposition?Lua_default.extensions.ui_liveryEditor_layerEdit.cancelReposition():Lua_default.extensions.ui_liveryEditor_layerEdit.requestReposition(),isRepositionActive.value=!isReposition}function toggleUseMouseOrCursor(element){if(!isRepositionActive.value)return!0;Lua_default.extensions.ui_liveryEditor_layerEdit.toggleUseMouseOrCursor().then(data=>{isUseMouse.value=data.isUseMouse})}function toggleEdit(element){if(isRepositionActive.value&&isUseMouse.value)return;let newValue=!isEdit.value;isEdit.value=newValue,Lua_default.extensions.ui_liveryEditor_layerEdit.setAllowRotationAction(!newValue).then(()=>{})}function handleFocusLinear(element){if(isEdit.value)return;let name=element.detail.name,value=element.detail.value,axis=name===`focus_d`||name===`focus_u`?`y`:`x`,direction$1=name===`focus_d`||name===`focus_l`?-1:1;Lua_default.extensions.ui_liveryEditor_layerEdit.holdTranslate(axis,direction$1*value)}function handleTranslateScalar(element){if(isEdit.value)return!0;let name=element.detail.name,value=element.detail.value,axis=name===`focus_lr`?`x`:`y`;Lua_default.extensions.ui_liveryEditor_layerEdit.holdTranslateScalar(axis,value)}function handleRotateCam(element){if(isRepositionActive.value||isTabRightActive.value)return!0;let name=element.detail.name,value=element.detail.value,axis=name===`rotate_h_cam`?`x`:`y`;isHoldModifier.value?Lua_default.extensions.ui_liveryEditor_layerEdit.holdSkew(axis,value):Lua_default.extensions.ui_liveryEditor_layerEdit.holdScale(axis,value)}function goBack(event){isRepositionActive.value?toggleReposition():isEdit.value?toggleEdit():openConfirmation(`Exit`,`Exit and lose unsaved changes?`).then(res=>{res&&(Lua_default.extensions.ui_liveryEditor_layerEdit.endTransform(),Lua_default.extensions.ui_liveryEditor_layerEdit.cancelChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}))}),event.stopPropagation()}function handleOk(){isRepositionActive.value?Lua_default.extensions.ui_liveryEditor_layerEdit.applyReposition():(Lua_default.extensions.ui_liveryEditor_layerEdit.endTransform(),Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!1).then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}))}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges(!1).then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)})}function onStateData(data){stateData.value=data,isReapplying.value=data.isStampReapplying}function onInitialLayerData(data){positionX.value=data.position.x,positionY.value=data.position.y,scaleX.value=data.scale.x,scaleY.value=data.scale.y,skewX.value=data.skew.x,skewY.value=data.skew.y,rotation.value=data.rotation}function assertInt(value){return typeof value==`string`?+value:value}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$70,[createBaseVNode(`div`,_hoisted_2$58,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$50,[createBaseVNode(`div`,_hoisted_4$38,[withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Transform`},{default:withCtx(()=>[createBaseVNode(`div`,{class:normalizeClass([`transform-inspector`,{"inspector-editing":isEdit.value}])},[createBaseVNode(`div`,_hoisted_5$33,[_cache[17]||=createBaseVNode(`div`,{class:`setting-item-name`},`Position`,-1),isRepositionActive.value&&isUseMouse.value?(openBlock(),createElementBlock(`div`,_hoisted_6$25,[..._cache[15]||=[createBaseVNode(`span`,null,`Using mouse position`,-1)]])):isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_7$23,[createBaseVNode(`div`,_hoisted_8$18,[createVNode(unref(bngInput_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[0]||=$event=>positionX.value=$event,type:`number`,step:.001,min:INPUT_MIN,max:1,prefix:`X`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:positionX.value,"onUpdate:modelValue":_cache[1]||=$event=>positionX.value=$event,step:.001,min:INPUT_MIN,max:1},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_9$16,[createVNode(unref(bngInput_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[2]||=$event=>positionY.value=$event,type:`number`,step:.001,min:INPUT_MIN,max:1,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:positionY.value,"onUpdate:modelValue":_cache[3]||=$event=>positionY.value=$event,step:.001,min:INPUT_MIN,max:1},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_10$12,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:positionX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:positionY.value},null,8,[`valueLabel`])])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngButton_default),{key:3,accent:`outlined`,class:`reposition-button`,onClick:toggleReposition},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`action_3`}),_cache[16]||=createBaseVNode(`span`,{class:`reposition-button-label`},`Reproject and Position`,-1)]),_:1}))]),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:0})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_11$10,[_cache[18]||=createBaseVNode(`div`,{class:`setting-item-name`},`Scale`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_12$7,[createBaseVNode(`div`,_hoisted_13$7,[createVNode(unref(bngInput_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[4]||=$event=>scaleX.value=$event,type:`number`,prefix:`X`,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleX.value,"onUpdate:modelValue":_cache[5]||=$event=>scaleX.value=$event,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_14$7,[createVNode(unref(bngInput_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[6]||=$event=>scaleY.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:15,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:scaleY.value,"onUpdate:modelValue":_cache[7]||=$event=>scaleY.value=$event,step:.01,min:INPUT_MIN,max:15},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_15$7,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:scaleX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:scaleY.value},null,8,[`valueLabel`])]))])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:2})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_16$7,[_cache[19]||=createBaseVNode(`div`,{class:`setting-item-name`},`Rotate`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_17$6,[createBaseVNode(`div`,_hoisted_18$5,[createVNode(unref(bngInput_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[8]||=$event=>rotation.value=$event,type:`number`,step:.1,min:INPUT_MIN,max:359.9,suffix:`deg`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:rotation.value,"onUpdate:modelValue":_cache[9]||=$event=>rotation.value=$event,step:.1,min:INPUT_MIN,max:359.9},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_19$3,[createVNode(unref(bngPropVal_default),{keyLabel:`deg`,valueLabel:rotation.value},null,8,[`valueLabel`])]))])),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngDivider_default),{key:4})),isRepositionActive.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_20$3,[_cache[20]||=createBaseVNode(`div`,{class:`setting-item-name`},`Skew`,-1),isEdit.value?(openBlock(),createElementBlock(`div`,_hoisted_21$3,[createBaseVNode(`div`,_hoisted_22$3,[createVNode(unref(bngInput_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[10]||=$event=>skewX.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:INPUT_MAX,prefix:`X`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewX.value,"onUpdate:modelValue":_cache[11]||=$event=>skewX.value=$event,step:.01,min:INPUT_MIN,max:INPUT_MAX},null,8,[`modelValue`])]),createBaseVNode(`div`,_hoisted_23$3,[createVNode(unref(bngInput_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[12]||=$event=>skewY.value=$event,type:`number`,step:.01,min:INPUT_MIN,max:INPUT_MAX,prefix:`Y`},null,8,[`modelValue`]),createVNode(unref(bngSlider_default),{modelValue:skewY.value,"onUpdate:modelValue":_cache[13]||=$event=>skewY.value=$event,step:.01,min:INPUT_MIN,max:INPUT_MAX},null,8,[`modelValue`])])])):(openBlock(),createElementBlock(`div`,_hoisted_24$2,[createVNode(unref(bngPropVal_default),{keyLabel:`X`,valueLabel:skewX.value},null,8,[`valueLabel`]),createVNode(unref(bngPropVal_default),{keyLabel:`Y`,valueLabel:skewY.value},null,8,[`valueLabel`])]))])),!isRepositionActive.value||!isUseMouse.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:6,accent:`text`,class:`inspector-edit-button`,onClick:_cache[14]||=$event=>isEdit.value=!isEdit.value},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`context`}),createBaseVNode(`span`,_hoisted_25$1,` Toggle `+toDisplayString(isEdit.value?`Simple`:`Advance`),1)]),_:1})),[[unref(BngOnUiNav_default),()=>isEdit.value=!isEdit.value,`ok`,{focusRequired:!0}]]):createCommentVNode(``,!0)],2)]),_:1})),[[unref(BngBlur_default)]]),!isRepositionActive.value||!isUseMouse.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`apply-button`,onClick:handleOk},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{uiEvent:`ok`}),_cache[21]||=createBaseVNode(`span`,null,`Apply`,-1)]),_:1})),[[unref(BngOnUiNav_default),handleOk,`ok`,{focusRequired:!0}]]):createCommentVNode(``,!0)])])])),[[unref(BngOnUiNav_default),handleOk,`ok`],[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),saveChanges,`menu`],[unref(BngOnUiNav_default),handleTranslateScalar,`focus_lr`],[unref(BngOnUiNav_default),handleTranslateScalar,`focus_ud`],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{up:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{down:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_l`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_r`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_u`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handleFocusLinear,`focus_d`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleRotateCam,`rotate_h_cam`],[unref(BngOnUiNav_default),handleRotateCam,`rotate_v_cam`],[unref(BngOnUiNav_default),handleRotateCam,`rotate_h_cam`,{modified:!0}],[unref(BngOnUiNav_default),handleRotateCam,`rotate_v_cam`,{modified:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{down:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{up:!0,modified:!0}],[unref(BngOnUiNav_default),handlePrecise,`action_2`,{down:!0,modified:!0}],[unref(BngOnUiNav_default),handleModifier,`tab_l`,{up:!0}],[unref(BngOnUiNav_default),handleModifier,`tab_l`,{down:!0}],[unref(BngOnUiNav_default),handleTabRight,`tab_r`,{up:!0}],[unref(BngOnUiNav_default),handleTabRight,`tab_r`,{down:!0}],[unref(BngOnUiNav_default),handleAction3,`action_3`],[unref(BngOnUiNav_default),toggleEdit,`context`],[unref(BngUiNavLabel_default),hintLabels.value.focus_lr,`focus_lr`],[unref(BngUiNavLabel_default),hintLabels.value.focus_ud,`focus_ud`],[unref(BngUiNavLabel_default),hintLabels.value.focus_l,`focus_l`],[unref(BngUiNavLabel_default),hintLabels.value.focus_r,`focus_r`],[unref(BngUiNavLabel_default),hintLabels.value.focus_u,`focus_u`],[unref(BngUiNavLabel_default),hintLabels.value.focus_d,`focus_d`],[unref(BngUiNavLabel_default),hintLabels.value.rotate_h_cam,`rotate_h_cam`],[unref(BngUiNavLabel_default),hintLabels.value.rotate_v_cam,`rotate_v_cam`],[unref(BngUiNavLabel_default),hintLabels.value.action_2,`action_2`],[unref(BngUiNavLabel_default),hintLabels.value.action_3,`action_3`],[unref(BngUiNavLabel_default),hintLabels.value.tab_r,`tab_r`],[unref(BngUiNavLabel_default),hintLabels.value.tab_l,`tab_l`],[unref(BngUiNavLabel_default),hintLabels.value.ok,`ok`],[unref(BngUiNavLabel_default),hintLabels.value.back,`back`]])}},LayerTransform_default=__plugin_vue_export_helper_default(_sfc_main$78,[[`__scopeId`,`data-v-a4399a23`]]),_hoisted_1$69={class:`layer-materials-view`,"bng-ui-scope":`layer-materials-scope`},_hoisted_2$57={class:`header`},_hoisted_3$49={class:`main-view-content`},_hoisted_4$37={class:`inspector-container`},_hoisted_5$32={class:`materials-inspector`},_hoisted_6$24={class:`materials-setting-item`},_hoisted_7$22={class:`color-values-container`,"bng-no-child-nav":``},_hoisted_8$17={class:`materials-setting-item`},_hoisted_9$15={class:`slider-text-container`},_hoisted_10$11={class:`materials-setting-item`},_hoisted_11$9={class:`slider-text-container`},BLOCKED_UI_EVENTS=[`tab_l`,`tab_r`,`action_2`,`rotate_h_cam`,`rotate_v_cam`,`focus_lr`,`focus_ud`],_sfc_main$77={__name:`LayerMaterials`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar(),uiNavBlocker=useUINavBlocker();useUINavScope(`layer-materials-scope`);let{events:events$3}=useBridge(),screenState=reactive({openedDialog:null}),color=ref({hue:.5,saturation:1,luminosity:.5}),inputHue=computed({get:()=>color.value.hue.toFixed(3),set:newValue=>{color.value.hue=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),inputSat=computed({get:()=>color.value.saturation.toFixed(3),set:newValue=>{color.value.saturation=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),inputLum=computed({get:()=>color.value.luminosity.toFixed(3),set:newValue=>{color.value.luminosity=typeof newValue==`string`?+newValue:newValue,onColorChanged()}}),metallicIntensity=ref(0),roughnessIntensity=ref(0),stateData=ref(),colorInitialized=ref(!1),isPreciseActive=ref(!1),colorPickerStep=computed(()=>isPreciseActive.value?.001:.01),slidersStep=computed(()=>isPreciseActive.value?.1:1),updateMaterialProperties=properties=>Lua_default.extensions.ui_liveryEditor_layerEdit.setLayerMaterials(properties);function onColorChanged(){if(!colorInitialized.value)return;let paint=new Paint;paint.hsl=[color.value.hue,color.value.saturation,color.value.luminosity],updateMaterialProperties({color:paint.rgba})}watch(()=>metallicIntensity.value,value=>updateMaterialProperties({metallicIntensity:value})),watch(()=>roughnessIntensity.value,value=>updateMaterialProperties({roughnessIntensity:value})),onBeforeMount(()=>{headerStore.setPreheader([`Materials`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,uiNavBlocker.blockOnly(BLOCKED_UI_EVENTS),events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_layerMaterialsData`,onMaterialPropertiesData),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestLayerMaterials()}),onBeforeUnmount(async()=>{events$3.off(`liveryEditor_layerEdit_layerMaterialsData`,onMaterialPropertiesData),events$3.off(`liveryEditor_layerEdit_state`,onStateData),uiNavBlocker.clear()});async function onStateData(data){stateData.value=data}function onMaterialPropertiesData(data){colorInitialized.value=!1;let paint=new Paint;data.color[3]=1;let isWhite=data.color.every(num=>num===1);paint.rgba=data.color,color.value.hue=paint.hue,color.value.saturation=isWhite?.5:paint.saturation,color.value.luminosity=paint.luminosity,colorInitialized.value=!0,metallicIntensity.value=data.metallicIntensity,roughnessIntensity.value=data.roughnessIntensity}function handleAction2(element){isPreciseActive.value=element.detail.value===1}function goBack(event){screenState.openedDialog||(screenState.openedDialog=`exit`,openConfirmation(`Exit`,`Exit and lose changes?`).then(res=>{res&&Lua_default.extensions.ui_liveryEditor_layerEdit.cancelChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)}),screenState.openedDialog=null}),event.stopPropagation())}function saveChanges(){Lua_default.extensions.ui_liveryEditor_layerEdit.saveChanges().then(()=>{window.bngVue.gotoGameState(`LiveryDecals`)})}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$69,[createBaseVNode(`div`,_hoisted_2$57,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$49,[createBaseVNode(`div`,_hoisted_4$37,[withDirectives((openBlock(),createBlock(LayerInspectorBase_default,{heading:`Materials`,class:``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$32,[createBaseVNode(`div`,_hoisted_6$24,[_cache[8]||=createBaseVNode(`div`,{class:`setting-item-name`},`Color`,-1),withDirectives(createVNode(unref(bngColorPicker_default),{modelValue:color.value,"onUpdate:modelValue":_cache[0]||=$event=>color.value=$event,step:colorPickerStep.value,onChange:onColorChanged},null,8,[`modelValue`,`step`]),[[unref(BngUiNavFocus_default),0]]),createBaseVNode(`div`,_hoisted_7$22,[createVNode(unref(bngInput_default),{prefix:`h`,modelValue:inputHue.value,"onUpdate:modelValue":_cache[1]||=$event=>inputHue.value=$event,type:`number`},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`s`,modelValue:inputSat.value,"onUpdate:modelValue":_cache[2]||=$event=>inputSat.value=$event,type:`number`},null,8,[`modelValue`]),createVNode(unref(bngInput_default),{prefix:`b`,modelValue:inputLum.value,"onUpdate:modelValue":_cache[3]||=$event=>inputLum.value=$event,type:`number`},null,8,[`modelValue`])])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_8$17,[_cache[9]||=createBaseVNode(`div`,{class:`setting-item-name`},`Metallic Intensity`,-1),createBaseVNode(`div`,_hoisted_9$15,[createVNode(unref(bngInput_default),{"bng-no-nav":``,modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[4]||=$event=>metallicIntensity.value=$event,type:`number`,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`]),createVNode(unref(bngSlider_default),{modelValue:metallicIntensity.value,"onUpdate:modelValue":_cache[5]||=$event=>metallicIntensity.value=$event,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`])])]),createVNode(unref(bngDivider_default)),createBaseVNode(`div`,_hoisted_10$11,[_cache[10]||=createBaseVNode(`div`,{class:`setting-item-name`},`Roughness Intensity`,-1),createBaseVNode(`div`,_hoisted_11$9,[createVNode(unref(bngInput_default),{"bng-no-nav":``,modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[6]||=$event=>roughnessIntensity.value=$event,type:`number`,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`]),createVNode(unref(bngSlider_default),{modelValue:roughnessIntensity.value,"onUpdate:modelValue":_cache[7]||=$event=>roughnessIntensity.value=$event,min:0,max:100,step:slidersStep.value},null,8,[`modelValue`,`step`])])])])]),_:1})),[[unref(BngBlur_default)]])])])])),[[unref(BngUiNavLabel_default),`Apply`,`context`],[unref(BngUiNavLabel_default),`[Hold]Precise`,`action_2`],[unref(BngUiNavLabel_default),`Back`,`back,menu`],[unref(BngOnUiNav_default),handleAction2,`action_2`,{up:!0}],[unref(BngOnUiNav_default),handleAction2,`action_2`,{down:!0}],[unref(BngOnUiNav_default),goBack,`back,menu`],[unref(BngOnUiNav_default),saveChanges,`context`]])}},LayerMaterials_default=__plugin_vue_export_helper_default(_sfc_main$77,[[`__scopeId`,`data-v-4b3730e9`]]),_hoisted_1$68={class:`layer-projection-view`,"bng-ui-scope":`layer-projection-scope`},_hoisted_2$56={class:`header`},_hoisted_3$48={class:`main-view-content`},_hoisted_4$36={class:`camera-views-container`},_hoisted_5$31={class:`mirror-settings-container`},CAMERA_BUTTONS=[{label:`Right`,icon:icons.cameraSideRight,value:`right`},{label:`Front`,icon:icons.cameraFront1,value:`front`},{label:`Left`,icon:icons.cameraSideLeft,value:`left`},{label:`Back`,icon:icons.cameraBack1,value:`back`},{label:`Top Right`,icon:icons.cameraTop1,value:`topright`},{label:`Top Left`,icon:icons.cameraTop1,value:`topleft`},{label:`Top Front`,icon:icons.cameraTop1,value:`topfront`},{label:`Top Back`,icon:icons.cameraTop1,value:`topback`}],_sfc_main$76={__name:`LayerProjection`,setup(__props){let{events:events$3}=useBridge(),headerStore=useEditorHeaderStore(),store$1=useLiveryEditorStore(),infobar=useInfoBar(),popover=usePopover(),uiNav=useUINavScope(`layer-projection-scope`),stateData=ref(null),mirrorState=reactive({mirrored:!1,mirrorFipped:!1,mirrorOffset:0}),mirrored=computed({get:()=>mirrorState.mirrored,set:async newValue=>{mirrorState.mirrored=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(newValue,mirrorState.mirrorFipped,mirrorState.mirrorOffset)}}),mirrorFipped=computed({get:()=>mirrorState.mirrorFipped,set:async newValue=>{mirrorState.mirrorFipped=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(mirrorState.mirrored,newValue,mirrorState.mirrorOffset)}}),mirrorOffset=computed({get:()=>mirrorState.mirrorOffset,set:async newValue=>{mirrorState.mirrorOffset=newValue,await Lua_default.extensions.ui_liveryEditor_layerEdit.setMirrored(mirrorState.mirrored,mirrorState.mirrorFipped,newValue)}}),NAV_HINTS=[{id:`apply`,content:{type:`binding`,props:{uiEvent:`menu`},label:`Done`},action:saveChanges},{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setPreheader([`Projection`]),headerStore.setHeader(`Decals`)}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_layerEdit_state`,onStateData),events$3.on(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestStateData(),await Lua_default.extensions.ui_liveryEditor_layerEdit.requestInitialLayerData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_layerEdit_state`,onStateData),events$3.off(`liveryEditor_layerEdit_initialLayerData`,onInitialLayerData)});function changeCameraView(view){popover.hide(`camera-views-menu`),console.log(`changeCameraView`,view),store$1.setOrthographicView(view)}function onStateData(data){console.log(`onStateData`,data),stateData.value=data}function onInitialLayerData(data){mirrorState.mirrored=data.mirrored,mirrorState.mirrorFipped=data.mirrorFipped,mirrorState.mirrorOffset=data.mirrorOffset}function goBack(){window.bngVue.gotoGameState(`LiveryLayerEdit`)}function saveChanges(){window.bngVue.gotoGameState(`LiveryLayerEdit`)}function onPopoverMenuHide(){uiNav.set(`layer-projection-scope`)}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$68,[createBaseVNode(`div`,_hoisted_2$56,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$48,[withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,icon:unref(icons).movieCamera,label:`Side`},null,8,[`icon`]),[[unref(BngBlur_default)],[unref(BngPopover_default),`camera-views-menu`,`right-start`,{click:!0}]]),withDirectives(createVNode(unref(bngImageTile_default),{"bng-nav-item":``,icon:unref(icons).reflect,label:`Mirror`},null,8,[`icon`]),[[unref(BngBlur_default)],[unref(BngPopover_default),`mirror-settings-menu`,`right-start`,{click:!0}]])]),createVNode(unref(bngPopoverMenu_default),{name:`camera-views-menu`,onHide:onPopoverMenuHide},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4$36,[createVNode(unref(bngList_default),{targetWidth:8,targetMargin:.5,noBackground:``},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(CAMERA_BUTTONS,view=>createVNode(unref(bngImageTile_default),{key:view.value,"bng-nav-item":``,label:view.label,icon:view.icon,onClick:$event=>changeCameraView(view.value)},null,8,[`label`,`icon`,`onClick`])),64))]),_:1})])]),_:1}),createVNode(unref(bngPopoverMenu_default),{name:`mirror-settings-menu`,onHide:onPopoverMenuHide},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$31,[createVNode(unref(bngPillCheckbox_default),{modelValue:mirrored.value,"onUpdate:modelValue":_cache[0]||=$event=>mirrored.value=$event},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(`Mirrored`,-1)]]),_:1},8,[`modelValue`]),withDirectives((openBlock(),createBlock(unref(bngPillCheckbox_default),{modelValue:mirrorFipped.value,"onUpdate:modelValue":_cache[1]||=$event=>mirrorFipped.value=$event},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(`Mirror Flipped`,-1)]]),_:1},8,[`modelValue`])),[[unref(BngDisabled_default),!mirrored.value]]),createVNode(unref(bngInput_default),{modelValue:mirrorOffset.value,"onUpdate:modelValue":_cache[2]||=$event=>mirrorOffset.value=$event,externalLabel:`Offset`,type:`number`,disabled:!mirrored.value},null,8,[`modelValue`,`disabled`])])]),_:1})])),[[unref(BngOnUiNav_default),goBack,`back`],[unref(BngOnUiNav_default),goBack,`menu`]])}},LayerProjection_default=__plugin_vue_export_helper_default(_sfc_main$76,[[`__scopeId`,`data-v-19e531c7`]]),_hoisted_1$67={class:`settings-main-view`,"bng-ui-scope":`settings-main-scope`},_hoisted_2$55={class:`header`},_hoisted_3$47={class:`main-view-content`},_hoisted_4$35={class:`settings-container`},_hoisted_5$30={class:`settings-item`},_sfc_main$75={__name:`LiverySettingsMain`,setup(__props){let headerStore=useEditorHeaderStore(),infobar=useInfoBar();useUINavScope(`settings-main-scope`);let{events:events$3}=useBridge(),stateData=ref(null),useSurfaceNormal=ref(!1);watch(()=>useSurfaceNormal.value,async value=>{await Lua_default.extensions.ui_liveryEditor.useSurfaceNormal(value)});let NAV_HINTS=[{id:`back`,content:{type:`binding`,props:{uiEvent:`back`},label:`Back`},action:goBack}];onBeforeMount(()=>{infobar.clearHints(),infobar.addHints(NAV_HINTS),headerStore.setHeader(`Decals`),headerStore.setPreheader([`Settings`])}),onMounted(async()=>{infobar.visible=!0,infobar.showSysInfo=!0,events$3.on(`liveryEditor_settingsData`,onSettingsData),await Lua_default.extensions.ui_liveryEditor.requestSettingsData()}),onBeforeUnmount(()=>{events$3.off(`liveryEditor_settingsData`,onSettingsData)});function onSettingsData(data){console.log(`onSettingsData`,data),stateData.value=data,useSurfaceNormal.value=data.useSurfaceNormal}function goBack(event){window.bngVue.gotoGameState(`LiveryMain`),event.stopPropagation()}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$67,[createBaseVNode(`div`,_hoisted_2$55,[createVNode(unref(LiveryEditorHeader_default))]),createBaseVNode(`div`,_hoisted_3$47,[withDirectives((openBlock(),createBlock(unref(bngCard_default),null,{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),null,{default:withCtx(()=>[..._cache[1]||=[createTextVNode(`Settings`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_4$35,[createBaseVNode(`div`,_hoisted_5$30,[_cache[2]||=createBaseVNode(`div`,{class:`settings-item-name`},`Use Surface Normal`,-1),withDirectives(createVNode(unref(bngSwitch_default),{modelValue:useSurfaceNormal.value,"onUpdate:modelValue":_cache[0]||=$event=>useSurfaceNormal.value=$event,label:useSurfaceNormal.value?`Yes`:`No`},null,8,[`modelValue`,`label`]),[[unref(BngUiNavFocus_default),0],[unref(BngFocusIf_default),!0]])])])]),_:1})),[[unref(BngBlur_default)]])])])),[[unref(BngOnUiNav_default),goBack,`back,menu`]])}},LiverySettingsMain_default=__plugin_vue_export_helper_default(_sfc_main$75,[[`__scopeId`,`data-v-ad4291e2`]]),routes_default$8=[{path:`/livery-editor`,name:`LiveryEditor`,component:LiveryEditor_default},{path:`/livery-main`,name:`LiveryMain`,component:LiveryMainNew_default},{path:`/livery-paint`,name:`LiveryPaint`,component:LiveryPaintMain_default},{path:`/livery-decals`,name:`LiveryDecals`,component:LiveryDecalsMain_default},{path:`/livery-settings`,name:`LiverySettings`,component:LiverySettingsMain_default},{path:`/livery-camera-settings`,name:`LiveryCameraSettings`,component:LiveryCameraSettings_default},{path:`/livery-decal-selector`,name:`LiveryDecalSelector`,component:LiveryDecalSelector_default},{path:`/livery-layer-edit`,name:`LiveryLayerEdit`,component:LiveryLayerEdit_default},{path:`/layer-transform`,name:`LayerTransform`,component:LayerTransform_default},{path:`/layer-materials`,name:`LayerMaterials`,component:LayerMaterials_default},{path:`/layer-projection`,name:`LayerProjection`,component:LayerProjection_default},{path:`/livery-manager`,name:`LiveryManager`,component:LiveryManager_default}],_hoisted_1$66={class:`logo-wrapper`},_sfc_main$74={__name:`Logo`,setup(__props){let logos={beamng:getAssetURL(`images/logos.svg#bng-beamng`),tech:getAssetURL(`images/logos.svg#bng-tech`),drive:getAssetURL(`images/logos.svg#bng-drive`),research:getAssetURL(`images/logos.svg#bng-research`)},productLogo=ref(logos.drive);return onMounted(async()=>{if(await Lua_default.extensions.tech_license.isValid())productLogo.value=logos.tech;else if(window.beamng){let name=window.beamng.product.replace(`BeamNG.`,``);name in logos&&(productLogo.value=logos[name])}else productLogo.value=logos.drive}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$66,[createBaseVNode(`div`,{class:`logo`,style:normalizeStyle({"--logo":`url('${productLogo.value}')`})},null,4)]))}},Logo_default=__plugin_vue_export_helper_default(_sfc_main$74,[[`__scopeId`,`data-v-69adfd8c`]]),_hoisted_1$65={class:`main-view`},_hoisted_2$54={class:`dev-info-content`},_hoisted_3$46={class:`dev-info-text`},_hoisted_4$34={class:`mainmenu-title`},_hoisted_5$29={key:1,class:`bottom-buttons`},_hoisted_6$23={class:`btn-content`},_hoisted_7$21={class:`label`},_hoisted_8$16={key:0,class:`small`},_hoisted_9$14={class:`btn-content`},_hoisted_10$10={class:`label`},_hoisted_11$8={key:0,class:`small`},_hoisted_12$6={class:`btn-content`},_hoisted_13$6={class:`label`},_hoisted_14$6={class:`btn-content`},_hoisted_15$6={class:`label`},_hoisted_16$6={class:`btn-content`},_hoisted_17$5={class:`label`},_sfc_main$73={__name:`MainMenu`,setup(__props){let events$3=useEvents(),infoBar=useInfoBar();useUINavScope(`mainmenuUI`);let withAngular=computed(()=>!sysInfo_default.mainMenuBackgroundRequired.value),firstTime=ref(sysInfo_default.mainMenuFirstTime.value),bgRequired=sysInfo_default.mainMenuBackgroundRequired,parentImageCarousel=inject(`mainBackground`),modCounts$1=sysInfo_default.modCounts,devEnv=reactive({env:window.beamng&&!window.beamng.shipping,vue:!1,simplemenu:window.beamng&&window.beamng.simplemenu,videoApi:null,UIEngine:null}),quickLoadLevel=()=>Lua_default.core_levels.startLevel(`/levels/smallgrid/main.level.json`),addons=ref({}),addButton=({translateid,icon,targetState,title,iconId,action})=>{let newButton;newButton=translateid||icon||targetState?{title:$translate.instant(translateid),icon,action:targetState}:{title,iconId,action},addons.value[newButton.title]=newButton},viewName=ref(),changeView=name=>{viewName.value=name,router_default.push(`/menu.mainmenu`+(name?`/`+name:``))};watch(()=>viewName.value,val=>{val&&infoBar.flashHints(`back`),parentImageCarousel.value&&nextTick(parentImageCarousel.value.carousel.showNext)});let route=useRoute();watch(()=>route.name,name=>{if(typeof name!=`string`){viewName.value=null;return}name.startsWith(`menu.mainmenu`)&&(viewName.value=name===`menu.mainmenu`?null:name.slice(14))},{immediate:!0});let navigate$1=(...state)=>window.bngVue.gotoGameState(...state);function quitGame(){Lua_default.quit(),runRaw(`TorqueScript.eval('quit();')`,!1)}let handleBack=event=>{event.detail.force||(viewName.value?(viewName.value=null,changeView(null)):(event.detail.name===`back`||event.detail.name===`menu`)&&window.globalAngularRootScope?.$broadcast(`MenuToggle`))},canDeactivateScope=()=>!viewName.value,canBubbleEvent=event=>{if(event.detail.value!==1)return!1;let eventName=event.detail.name;return eventName===`tab_l`||eventName===`tab_r`?!viewName.value:!1};function displayToast(type,title,titleContext,msg,messageContext){let msgTxt=$translate.contextTranslate({txt:msg,context:messageContext}),titleTxt=$translate.contextTranslate({txt:title,context:titleContext}),msgHtml=window.angularParseBBCode(msgTxt),titleHtml=window.angularParseBBCode(titleTxt);window.globalAngularRootScope.$broadcast(`toastrMsg`,{type,msg:msgHtml,title:titleHtml,config:{positionClass:`toast-top-right`,timeOut:0,extendedTimeOut:0,onTap(){window.bngVue.gotoGameState(`menu.options.performance`)}}})}async function checkHardware(){Lua_default.checkFSErrors();let info=await Lua_default.core_hardwareinfo.getInfo();if(info.globalState!==`ok`){for(let key in info)if(!(!info[key].warnings||!Array.isArray(info[key].warnings)))for(let warning of info[key].warnings)warning.ack||displayToast(info.globalState===`warn`?`warning`:`error`,`ui.performance.warnings.`+warning.msg,warning.context,`ui.mainmenu.warningdetails`,null)}}let repoEnabled=ref(!1),modsAfterUpdate=ref(!1),onSettingsChanged=data=>{modsAfterUpdate.value=data.values.disableModsAfterUpdate,repoEnabled.value=data.values.onlineFeatures===`enable`&&!data.values.disableModsAfterUpdate};return onMounted(async()=>{function advertMainMenu(){events$3.emit(`MainMenuButtons`,addButton),window.globalAngularRootScope.$broadcast(`MainMenuButtons`,addButton)}advertMainMenu(),events$3.on(`UiModsChanged`,advertMainMenu),events$3.on(`BroadcastMainMenuButtons`,advertMainMenu),events$3.on(`SettingsChanged`,onSettingsChanged),Lua_default.settings.notifyUI(),devEnv.env&&(devEnv.videoApi=await Lua_default.Engine.Render.getAdapterType(),devEnv.UIEngine=await Lua_default.Engine.UI.getUIEngine()),sysInfo_default.mainMenuFirstTime.value&&checkHardware();let settings$1=await useSettingsAsync();await Lua_default.extensions.tech_license.isValid()||(settings$1.values.onlineFeatures===`ask`||settings$1.values.telemetry===`ask`?window.bngVue.gotoGameState(`menu.onlineFeatures`):Lua_default.settings.getValue(`showedInputLayoutPopupV37`).then(value=>{value===!1&&window.bngVue.gotoGameState(`buttonLayout`)})),sysInfo_default.mainMenuFirstTime.value=!1}),onUnmounted(()=>{events$3.off(`SettingsChanged`,onSettingsChanged)}),(_ctx,_cache)=>{let _component_router_view=resolveComponent(`router-view`);return withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"mainmenu-container":!0,"mainmenu-with-angular":withAngular.value,"mainmenu-fadein":firstTime.value&&!withAngular.value}),onDeactivate:handleBack},[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$65,[devEnv.env?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`dev-info`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Developer Release`,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_2$54,[withDirectives(createVNode(unref(bngIcon_default),{class:`dev-info-icon`,type:unref(icons).bug,"bng-all-clicks-no-nav":``},null,8,[`type`]),[[unref(BngDoubleClick_default),quickLoadLevel]]),createBaseVNode(`div`,_hoisted_3$46,[createBaseVNode(`div`,null,` Graphics API: `+toDisplayString(devEnv.videoApi||`requesting...`),1),createBaseVNode(`div`,null,` UI Engine: `+toDisplayString(devEnv.UIEngine||`requesting...`),1)])])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$34,[createVNode(Logo_default)]),createVNode(_component_router_view,{"first-time":firstTime.value&&!withAngular.value,addons:addons.value,onChangeView:changeView},null,8,[`first-time`,`addons`]),viewName.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$29,[repoEnabled.value?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:`btn-mods`,accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>navigate$1(`menu.mods.repository`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$23,[createBaseVNode(`span`,_hoisted_7$21,toDisplayString(_ctx.$tt(`ui.mainmenu.repo`)),1),unref(modCounts$1).total>0?(openBlock(),createElementBlock(`span`,_hoisted_8$16,`\xA0(`+toDisplayString(unref(modCounts$1).active)+` / `+toDisplayString(unref(modCounts$1).total)+`)`,1)):createCommentVNode(``,!0)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`btn-mods`,{"mods-after-update":modsAfterUpdate.value}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>navigate$1(`menu.mods.local`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_9$14,[createBaseVNode(`span`,_hoisted_10$10,[modsAfterUpdate.value?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:`danger`,style:{"font-size":`1.1em`},color:`#ff2d00`})):createCommentVNode(``,!0),createTextVNode(toDisplayString(_ctx.$tt(`ui.mainmenu.mods`)),1)]),unref(modCounts$1).total>0?(openBlock(),createElementBlock(`span`,_hoisted_11$8,`\xA0(`+toDisplayString(unref(modCounts$1).active)+` / `+toDisplayString(unref(modCounts$1).total)+`)`,1)):createCommentVNode(``,!0)])]),_:1},8,[`class`,`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>navigate$1(`credits`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_12$6,[createBaseVNode(`span`,_hoisted_13$6,toDisplayString(_ctx.$tt(`ui.mainmenu.credits`)),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>navigate$1(`menu.options.display`)},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_14$6,[createBaseVNode(`span`,_hoisted_15$6,toDisplayString(_ctx.$tt(`ui.mainmenu.options`)),1)])]),_:1},8,[`accent`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]]),devEnv.simplemenu?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:`btn-quit`,accent:unref(ACCENTS).attention,icon:unref(icons).exit,onClick:_cache[4]||=$event=>quitGame()},{default:withCtx(()=>[unref(bgRequired)?(openBlock(),createBlock(BlurBackground_default,{key:0})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_16$6,[createBaseVNode(`span`,_hoisted_17$5,toDisplayString(_ctx.$tt(`ui.inputActions.general.quit.title`)),1)])]),_:1},8,[`accent`,`icon`])),[[unref(BngBlur_default),!unref(bgRequired)],[unref(BngSoundClass_default),`bng_click_hover_generic`]])]))])),[[unref(BngOnUiNav_default),handleBack,`back`]])],34)),[[unref(BngScopedNav_default),{activateOnMount:!0,canDeactivate:canDeactivateScope,canBubbleEvent}],[unref(BngOnUiNav_default),handleBack,`menu`]])}}},MainMenu_default=__plugin_vue_export_helper_default(_sfc_main$73,[[`__scopeId`,`data-v-1c7a0195`]]),_hoisted_1$64={key:1,class:`fancy-bg-wrap`},_hoisted_2$53={class:`mask-container`},_hoisted_3$45={key:0,class:`icon-text`},_hoisted_4$33={key:2,class:`tag`},_hoisted_5$28={key:3,class:`icon`},_hoisted_6$22={key:4,class:`icon`},_hoisted_7$20={key:5,class:`label-container`},_hoisted_8$15={class:`text`},_hoisted_9$13={key:6,class:`text`},_sfc_main$72={__name:`MenuButton`,props:{size:{type:String,default:`normal`},iconId:String,icon:String,highlighted:Boolean,disabled:Boolean,appearDisabled:Boolean,bgImg:String,bgImgAbs:String,tag:String,noBlur:Boolean},setup(__props,{expose:__expose}){let props=__props,btnRef=ref(null);__expose({getElement(){return btnRef.value}});let bgImgUrl=computed(()=>props.bgImgAbs?props.bgImgAbs:getAssetURL(props.bgImg)),hasBgImg=computed(()=>props.bgImgAbs||props.bgImg);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`btnRef`,ref:btnRef,class:normalizeClass({"mainmenu-button":!0,[`size-${__props.size}`]:!0,"fancy-bg":!!hasBgImg.value,"with-icon":!!__props.iconId,"semi-disabled":__props.appearDisabled}),style:normalizeStyle({"--fancy-bg-img":`url('${bgImgUrl.value}')`}),"bng-nav-item":``},[__props.noBlur?createCommentVNode(``,!0):(openBlock(),createBlock(BlurBackground_default,{key:0,class:normalizeClass(`corners-${__props.size}`)},null,8,[`class`])),createBaseVNode(`div`,{class:normalizeClass([`button-background`,{stack:__props.size===`big-stacked`,highlighted:__props.highlighted}])},null,2),hasBgImg.value?(openBlock(),createElementBlock(`div`,_hoisted_1$64,[createBaseVNode(`div`,{class:normalizeClass([`bg-container`,{"with-icon":!!__props.iconId}])},[_cache[0]||=createBaseVNode(`div`,{class:`bg-image`},null,-1),createBaseVNode(`div`,_hoisted_2$53,[__props.iconId?(openBlock(),createElementBlock(`div`,_hoisted_3$45,toDisplayString(unref(icons)[__props.iconId].glyph),1)):createCommentVNode(``,!0)])],2)])):createCommentVNode(``,!0),__props.tag?(openBlock(),createElementBlock(`div`,_hoisted_4$33,toDisplayString(__props.tag),1)):createCommentVNode(``,!0),__props.iconId&&!hasBgImg.value?(openBlock(),createElementBlock(`div`,_hoisted_5$28,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.iconId],color:hasBgImg.value?`transparent`:void 0},null,8,[`type`,`color`])])):__props.icon?(openBlock(),createElementBlock(`div`,_hoisted_6$22,[createVNode(unref(bngImageAsset_default),{externalSrc:__props.icon},null,8,[`externalSrc`])])):createCommentVNode(``,!0),__props.size==`big`||__props.size==`big-stacked`?(openBlock(),createElementBlock(`div`,_hoisted_7$20,[createBaseVNode(`span`,_hoisted_8$15,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])])):(openBlock(),createElementBlock(`span`,_hoisted_9$13,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)]))],6)),[[unref(BngSoundClass_default),!(__props.disabled||__props.appearDisabled)&&`bng_click_hover_generic`],[unref(BngDisabled_default),__props.disabled],[unref(BngBlur_default),!__props.noBlur]])}},MenuButton_default=__plugin_vue_export_helper_default(_sfc_main$72,[[`__scopeId`,`data-v-932e6a9a`]]),_hoisted_1$63={class:`center-wrap`},_hoisted_2$52={class:`primary`},IMG_PATH=`images/mainmenu/`,_sfc_main$71={__name:`MainView`,props:{firstTime:Boolean},emits:[`changeView`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit;ref(null);let settings$1=useSettings(),defaultWizardStep=computed(()=>settings$1.getValue(`freeroamSetupDefaultStep`)||`level`),firstTime=ref(props.firstTime);onMounted(()=>{firstTime.value&&setTimeout(()=>firstTime.value=!1,1500)});let navigate$1=(state,params=void 0)=>nextTick(()=>window.bngVue.gotoGameState(state,{params}));async function careerPrompt(){await openExperimental($translate.instant(`ui.career.experimentalTitle`),$translate.instant(`ui.career.experimentalPrompt`),[{label:$translate.instant(`ui.common.no`),value:!1,isCancel:!0,extras:{accent:ACCENTS.secondary}},{label:$translate.instant(`ui.career.experimentalAgree`),value:!0,default:!0}])&&navigate$1(`profiles`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$63,[createBaseVNode(`div`,_hoisted_2$52,[createVNode(MenuButton_default,{"bng-scoped-nav-autofocus":``,size:`big`,"icon-id":`keys1`,"bg-img":IMG_PATH+`experiences.jpg`,onClick:_cache[0]||=$event=>emit$1(`changeView`,`discover`),tag:_ctx.$t(`ui.playmodes.new`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.quickStartExperiences`)),1)]),_:1},8,[`bg-img`,`tag`]),createVNode(MenuButton_default,{size:`big`,"icon-id":`road`,"bg-img":IMG_PATH+`freeroam.jpg`,onClick:_cache[1]||=$event=>navigate$1(`menu.freeroamWizard`,{step:defaultWizardStep.value})},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.freeroam`)),1)]),_:1},8,[`bg-img`]),_ctx.$simplemenu.value?createCommentVNode(``,!0):(openBlock(),createBlock(MenuButton_default,{key:0,"appear-disabled":``,size:`big`,"icon-id":`cup`,"bg-img":IMG_PATH+`career.jpg`,onClick:_cache[2]||=$event=>careerPrompt(),tag:_ctx.$t(`ui.playmodes.comingSoon`),"tag-orange":``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.playmodes.career`)),1)]),_:1},8,[`bg-img`,`tag`])),createVNode(MenuButton_default,{size:`big-stacked`,"icon-id":`BNGFolder`,"bg-img":IMG_PATH+`others.jpg`,onClick:_cache[3]||=$event=>emit$1(`changeView`,`others`)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.mainmenu.more`)),1)]),_:1},8,[`bg-img`])])]))}},MainView_default=__plugin_vue_export_helper_default(_sfc_main$71,[[`__scopeId`,`data-v-0baa6516`]]),_hoisted_1$62={class:`center-wrap`},_hoisted_2$51={class:`others`},_hoisted_3$44={class:`buttons`},htmlBody=`
@/lua/ge/extensions/editor/mainToolbar.lua
  if gridSnapComboItemCurrent[0] == -1 then
    for i, val in pairs(gridSnapWidgetsComboItemsTbl) do
      if tonumber(val) == gridSize then gridSnapComboItemCurrent[0] = i - 1 end
  if rotateSnapComboItemCurrent[0] == -1 then
    for i, val in pairs(rotateSnapWidgetsComboItemsTbl) do
      if tonumber(val) == rotateSnapSize then rotateSnapComboItemCurrent[0] = i - 1 end
local function drawAlwaysVisibleToolbars()
  for key, val in pairs(editor.editModes) do
    if val["toolbarAlwaysVisible"] and val.onToolbar then
local function toolbarAlwaysVisibleModeExists()
  for key, val in pairs(editor.editModes) do
    if val["toolbarAlwaysVisible"] and val.onToolbar then
  local sortedKeys = {}
  for key, val in pairs(editor.editModes) do
    if key ~= "objectSelect" and key ~= "createObject" and val.icon then table.insert(sortedKeys, key) end
  local idx = 1
  for _, key in pairs(sortedKeys) do
    if key ~= "objectSelect" and key ~= "createObject" then
local function getModeKeyWithDisplayName(displayName)
  for key, val in pairs(editor.editModes) do
    if val.displayName == displayName then
    -- Find the mode key by display name
    for key, val in pairs(editor.editModes) do
      if val.displayName == modeName then
      allModes = {}
      for key, val in pairs(editor.editModes) do
        if val.icon and key ~= "objectSelect" and key ~= "createObject" then
        -- Clear the selected list
        for k in pairs(selectedModesList) do selectedModesList[k] = nil end
        -- Save changes to current set
          if pushedModeBtn then
            for _, val in pairs(editor.editModes) do
              -- toolbar is always visible in create mode
          if pushedModeBtn then
            for _, val in pairs(editor.editModes) do
              -- toolbar is always visible in create mode
@/lua/vehicle/controller/pyrotechnicCharge.lua
  if eventNodeName then
    for cid, node in pairs(v.data.nodes) do
      if node.name == eventNodeName then
@/lua/ge/extensions/editor/tech/roadArchitect/terraform.lua
  local quads, ctr = {}, 1
  for _, road in pairs(roads) do
    local rData = road.renderData
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveDampers.lua
  dampBeams = {}
  for _, b in pairs(v.data.beams) do
    if b.name then
    if b.name then
      for _, name in pairs(dampBeamNames) do
        if b.name == name then
  beamModes = {}
  for _, mode in pairs(modeData) do
    beamModes[mode.name] = {
@/lua/vehicle/controller/gauges/analogOdometer.lua
  --dump(configData)
  for k, v in pairs(jbeamData) do
    if k:sub(1, #"configuration_") == "configuration_" then
@/lua/ge/extensions/career/modules/delivery/parcelMods.lua
  local definitions = {}
  for key, _ in pairs(modKeys) do
    if modifiers[key] and modifiers[key].unlockFlag then
  local status = {}
  for modKey, info in pairs(modifiers) do
    status[modKey] = isParcelModUnlocked(modKey)
  local modsByTier = {}
  for modKey, info in pairs(modifiers) do
    local tier = 1
  end
  for tier, list in pairs(modsByTier) do
    table.sort(list)
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarage2GarageVehicle.lua
    local totalUsed = 0
    for _, modelConfigs in pairs(self.usedConfigs) do
      for _ in pairs(modelConfigs) do
    for _, modelConfigs in pairs(self.usedConfigs) do
      for _ in pairs(modelConfigs) do
        totalUsed = totalUsed + 1
@/lua/vehicle/wheels.lua
      if wheelData.treadBeams ~= nil then
        for _, beamcid in pairs(wheelData.treadBeams) do
          obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 2, -1, -1)
      if wheelData.sideBeams ~= nil then
        for _, beamcid in pairs(wheelData.sideBeams) do
          obj:setBeamSpringDamp(beamcid, 0, 10, -1, -1)
      if wheelData.peripheryBeams ~= nil then
        for _, beamcid in pairs(wheelData.peripheryBeams) do
          obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 2, -1, -1)
      if wheelData.reinfBeams ~= nil then
        for _, beamcid in pairs(wheelData.reinfBeams) do
          obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 0.7, 0, 0)
  if brakeThermalsEnabled then
    for _, wd in pairs(M.wheelRotators) do
      if wd.enableBrakeThermals then

  for _, wd in pairs(M.wheelRotators) do
    if wd.enableBrakeThermals then
      local node2Pos = vec3(v.data.nodes[wheel.node2].pos)
      for _, n in pairs(wheel.nodes) do
        local wheelNode = v.data.nodes[n]
      if wd.axleBeams then
        for _, name in pairs(wd.axleBeams) do
          if not axleBeamLookup[name] then
  local avgWheelPos = vec3(0, 0, 0)
  for _, rotator in pairs(M.wheelRotators) do
    if rotator.brakeTorque > 0 then

  for _, rotator in pairs(M.wheelRotators) do
    local wheelNodePos = vec3(v.data.nodes[rotator.node1].pos) --find the wheel position
@/lua/ge/extensions/ui/gameBlur.lua

    for _, list in pairs(M.blurRects) do
      for _, data in pairs(list) do
    for _, list in pairs(M.blurRects) do
      for _, data in pairs(list) do
        maskedBlurFX.obj:addFrameBlurRect(data[1], data[2], data[3], data[4], ColorF(1, 1, 1, data[5]))
@/lua/ge/extensions/util/jbeamStats.lua

          for partName, part in pairs(parts) do

            for sectionName, section in pairs(part) do
              if not sectionCount[sectionName] then sectionCount[sectionName] = 0 end
                local countedRows = 0
                for _, row in pairs(section) do
                  if type(row) == 'table' and row[1] then
  local newSectionCount = {}
  for s, c in pairs(sectionCount) do
    table.insert(newSectionCount, {s, c})
@/lua/vehicle/controller/hydraulics/hydraulicsCombustionEngineControl.lua
    if type(relevantElectricsNames) == "table" then
      for _, electricsName in pairs(relevantElectricsNames) do
        table.insert(relevantElectrics, electricsName)
@/lua/vehicle/energyStorage.lua

  for _, jbeamData in pairs(deepcopy(v.data.energyStorage or {})) do
    tableMergeRecursive(jbeamData, v.data[jbeamData.name] or {})

  for _, device in pairs(powertrain.getDevices()) do
    if device.energyStorage then
      end
      for _, s in pairs(device.energyStorage) do
        local storage = energyStorages[s]

  for _, storage in pairs(energyStorages) do
    table.insert(orderedStorages, storage)
  local beamTriggers = {}
  for _, storage in pairs(energyStorages) do
    if storage.breakTriggerBeam then

  for _, v in pairs(v.data.beams or {}) do
    if v.name and v.name ~= "" and beamTriggers[v.name] then
local function reset()
  for _, v in pairs(orderedStorages) do
    if v.reset then

  for _, device in pairs(powertrain.getDevices()) do
    if device.energyStorage then
      end
      for _, s in pairs(device.energyStorage) do
        local storage = energyStorages[s]
  --  end
  --  for name, storageData in pairs(data) do
  --    if name and energyStorages[name] then
  local data = {}
  for _, storage in pairs(energyStorages) do
    if storage.serialize then
@/gameplay/missionTypes/evade/constructor.lua
  unlockedStars.completeTraffic = false
  for id, v in pairs(gameplay_traffic.getTrafficData()) do
    if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imBegin.lua
  self.done = false
  for _, p in pairs(self.pinOut) do
    p.value = false
@/lua/ge/extensions/util/screenshotCreator.lua
  local count = 0
  for k, v in pairs(vehList) do
    if v[2][0] then
  local modelKeys={}
  for k,_ in pairs(models) do table.insert(modelKeys,k) end
  table.sort(modelKeys)
  -- Add the selection
  for k, v in pairs(vehList) do
    if v[2][0] then
    if workOptions.selection == "selectedModels" then -- take thumbnails of the selected models
      for _, modelName in pairs(listOfSelectedModels) do
        for _, configData in pairs(core_vehicles.getModel(modelName).configs) do
      for _, modelName in pairs(listOfSelectedModels) do
        for _, configData in pairs(core_vehicles.getModel(modelName).configs) do
          if forceQuit then
                local isCurrent
                for _, configData in pairs(core_vehicles.getModel(currModelName).configs) do
                  isCurrent = configData.key == currConfigName
@/lua/common/utils/simpleHttpServer.lua
  -- simple file server
  for _, v in pairs(handlers) do
    --print("** " .. tostring(req.uri.path) .. ' ~= ' .. tostring(v[1]))
@/lua/ge/extensions/career/modules/delivery/tasklist.lua
    cargoIdToTasklistElementId = {}
    for _, elem in pairs(tasklistElements) do
      elem.clear = true
    local hasNonClearElement = false
    for _, elem in pairs(tasklistElements) do
      hasNonClearElement = hasNonClearElement or not elem.clear
local function clearAll()
  for _, elem in pairs(tasklistElements) do
    elem.clear = true

  for id, _ in pairs(elementsToClearById) do
    tasklistElements[id] = nil
@/lua/ge/extensions/career/modules/milestones/generalMilestones/missions.lua
      table.insert(careerMissions, mission)
      for branchKey, _ in pairs(mission.unlocks.branchTags or {}) do
        missionsByBranch[branchKey] = missionsByBranch[branchKey] or {}
@/lua/ge/extensions/editor/drivePathEditor/playback.lua
  -- Disable the AI for all vehicles in the playing table.
  for _, v in pairs(playing) do
    v.vehicle.veh:queueLuaCommand('ai.setState({mode = "stop"})')
  -- Reset the vehicles to their starting positions.
  for _, d in pairs(playing) do
    splineMgr.resetVehiclePose(d.spline, d.vehicle)
local function handlePlayback()
  for _, d in pairs(playing) do
    local isStarted = d.isStarted
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox2.lua
  automaticHandling.availableModeLookup = {}
  for _, v in pairs(automaticHandling.availableModes) do
    automaticHandling.availableModeLookup[v] = true
@/lua/vehicle/extensions/telemetryLogger.lua
  local headers = "frame,"
  for _, p in pairs(csvHeaders) do
    headers = headers .. escapeCSV(p) .. ","
  f:write(headers .. "\r\n")
  for k, v in pairs(telemetryData) do
    local s = k .. ","
    local s = k .. ","
    for _, p in pairs(csvHeaders) do
      s = s .. escapeCSV(v[p]) .. ","
@/lua/ge/extensions/core/settings/graphicsQualityGroup.lua
  local group = qualitiyLevelsFilename and require(qualitiyLevelsFilename) or {}
  for k, v in pairs(group.qualityLevels or {}) do
    self.qualityLevels[k] = v
    local changeDetected = false
    for key,value in pairs(qualityLevel) do
      local currentValue = TorqueScriptLua.getVar(key)
@/lua/ge/extensions/editor/resourceChecker.lua
    local isTexture = false
    for _,b in pairs(cases) do
      if string.lower(res):find(b) then isTexture = true goto safeCnt end
      local count = 0
      for k,v in pairs(duplicateTable) do
        count = count + 1
        if im.TreeNode1("File: "..k) then
          for l,b in pairs(v) do
            count = count + 1
                  end
                  for j,c in pairs(b) do
                    count = count + 1
                        local stage = 0
                        for s,t in pairs(c) do
                          stage = stage + 1
                            if im.TreeNode1("Stage "..stage..":") then
                              for m,x in pairs(t) do
                                count = count + 1
                                  local txtstring = m..": "
                                  for a,f in pairs(x) do
                                    txtstring = txtstring..tostring(f)..", "
      if im.Button("Save changes and close window", im.ImVec2(220* im.uiscale[0],0)) then
        for k,v in pairs(duplicateTable) do
          if FS:fileExists(k) and v.modified == true then
            local materialFile = jsonReadFile(k) or {}
            for l,b in pairs(v) do
              if materialFile[l] and b ~= "removed" then
          local cases = {".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
          for _,b in pairs(cases) do
            if string.lower(res):find(b) then imageToPreview = res editor.showWindow(imageWindowName) end
          local cases = {".dae", ".dts", ".cdae", ".cached.dts"}
          for _,b in pairs(cases) do
            if string.lower(res):find(b) then editor_shapeEditor.showShapeEditorLoadFile(res) end
    local count = 0
    for k,v in pairs(data) do
      if count < maxLines then
          end
          for i,h in pairs(v) do
            if count < maxLines then
                end
                for d,g in pairs(h) do
                  if count < maxLines then
                      end
                      for a,o in pairs(g) do
                        if count < maxLines then
    local count = 0
    for k,v in pairs(data) do
      if searchFilter == true and skipK[k] then
    local count = 0
    for k,v in pairs(data) do
      if searchFilter == true and not string.match(string.lower(v), string.lower(ffi.string(searchTxt))) then
    if not tableIsEmpty(isSelected) then
      for k,v in pairs(isSelected) do
        cnt = cnt + 1
        local tempSel = isSelected
        for k,v in pairs(itemsList) do
          if not tempSel[v] then
    local filesCount, subdirCount = 0, 0
    for _,ch in pairs(n.children or {}) do
      if ch.isDir then subdirCount = subdirCount + 1 end
    if n.isDir and n.children then
      for _, ch in pairs(n.children) do
        computeDerived(ch)
    if n.children then
      for _,ch in pairs(n.children) do dfs(ch) end
    end
      local kids = {}
      for _,ch in pairs(n.children or {}) do kids[#kids+1] = ch end
      table.sort(kids, function(a,b) return (a.bytes or 0) > (b.bytes or 0) end)
@/lua/ge/extensions/flowgraph/variableStorage.lua
  local list = {}
  for name, elem in pairs(self.variables) do
    table.insert(list, {name = name, index = elem.index})
  local ret = 0
  for _,v in pairs(self.variables) do
    if v.index > ret then ret = v.index end
  local all = {}
  for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
  local vNodes = {}
  local vNodes = {}
  for _, graph in pairs(all) do
    for _, node in pairs(graph.nodes) do
  for _, graph in pairs(all) do
    for _, node in pairs(graph.nodes) do
      if node.nodeType == 'types/getVariable' or node.nodeType == 'types/setVariable' then
  local all = {}
  for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
  for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
  local vNodes = {}
  local vNodes = {}
  for _, graph in pairs(all) do
    for _, node in pairs(graph.nodes) do
  for _, graph in pairs(all) do
    for _, node in pairs(graph.nodes) do
      if node.nodeType == 'types/getVariable' or node.nodeType == 'types/setVariable' then
function C:finalizeChanges()
  for name, _ in pairs(self.variableChanges) do
    self.variables[name].mergeFuns.finalize(self.variables[name])
  table.clear(self.variableChanges)
  for name, var in pairs(self.variables) do
    if not var.keepAfterStop then
  }
  for name, val in pairs(self.variables) do
    table.insert(ret.list, {
@/lua/ge/extensions/flowgraph/nodes/states/transition.lua
      -- collect the in-pins of this node
      for name, pin in pairs(node.pinInLocal) do
        if name ~= 'flow' then
      -- collect the out-pins of this node
      for name, pin in pairs(node.pinOut) do
        if name ~= 'flow' then
  self._pinTemplates = {_in = {}, _out = {}}
  for name, type in pairs(pins) do  table.insert(self._pinTemplates._in,  {name = name, type = type}) end
  table.sort(self._pinTemplates._in,  function(a,b) return a.name < b.name end)
    local added = false
    for name, pin in pairs(self.pinIn) do
      if name ~= 'flow' then
@/lua/ge/extensions/util/export.lua

  for i, beam in pairs(v.vdata.beams) do
    local id1 = beam.id1

  for mesh, d in pairs(meshes) do
    if meshNodeMap[mesh] then
  local parentage = {}
  for parent, children in pairs(slotMap) do
    for idx, child in ipairs(children) do
    if partNode.children then
      for _, child in pairs(partNode.children) do
        partTreeParser(child,partNode.chosenPartName)

  for part, data in pairs(slotMap) do
    if parentPart[part] ~= nil and parentPart[part] ~= '' then
      if data.slots ~= nil then
        for subPart, d in pairs(data.slots) do
          if parentPart[subPart] ~= nil and parentPart[subPart] ~= '' then
  local parent = {}
  for kn,vn in pairs(gltfRoot.nodes) do
    if rootNodes[kn-1] then
  -- end
  -- for kp,rootNode in pairs(rootNodes) do
  --   if rootNodes then
  -- log("I", logTag, "===================================  dump child")
  -- for k,v in pairs(gltfRoot.nodes) do
  --   log("I", logTag, dbgNodeName(gltfRoot,k-1) .. dumps(v.children))

  for kn,vn in pairs(gltfRoot.nodes) do
    if not parent[kn-1] then
  --log("D", logTag,"export image indexes "..dumps(materialObj.name))
  for k,v in pairs(gltfCurrentMaterial) do
    if k:endswith("Map") then
  local partToFlexMesh = {}
  for _, flexMesh in pairs(v.vdata.flexbodies or {}) do
    local path = flexMesh.partPath or ""
  end
  for _, prop in pairs(v.vdata.props or {}) do
    -- print("prop["..dumps(_)..dumps(prop.mesh))
  gltfRoot.scenes[1].nodes = {}
  for nodeID, root in pairs(rootNodes) do
    if root then
    local matNames = veh:getMaterialNames()
    for i,v in pairs(gltfRoot.materials) do
      gltfRoot.materials[i].name = matNames[v.extras.bngMaterialId+1]

  for i, e in pairs(gltfRoot.scenes[1].nodes) do
    local node = gltfRoot.nodes[e + 1]
    local totalBinBufSize = getStartByteBufferView(#binaryBuffers)
    for k,v in pairs(gltfRoot.bufferViews) do
      if v.buffer ~= 0 then
@/lua/ge/extensions/gameplay/drag/times.lua
  if not dragData or not dragData.racers then return end
  for _, racer in pairs(dragData.racers) do
    racer.timersStarted = false
    racer.timersStarted = false
    for timerId,t in pairs(racer.timers) do
      if t.type ~= "dialTimer" then
  if not dragData or not dragData.racers or dragData.isCompleted then return end
  for _, racer in pairs(dragData.racers) do
    if not racer.timersStarted then goto continue end

      for timerName, timer in pairs(timers) do
        if addFrameHistoryDebug[timerName] and not timer.isSet and timer.type == "distanceTimer" then
            timer.frameHistory[#timer.frameHistory+1] = string.format("Racer: %d Went over threshold at %0.5fs (%d%% of this frames duration plus the previous frames) (so between frame %d and %d)", racer.vehId, timer.value, t*100, #timer.frameHistory-1, #timer.frameHistory)
            -- for _, frame in pairs(timer.frameHistory) do
            -- end
@/lua/ge/extensions/flowgraph/nodes/events/customizedTriggerBox.lua
  if noData then
    for _, p in pairs(self.pinOut) do p.value = nil end
  end
@/lua/ge/extensions/core/modmanager.lua
  --local list = {}
  --for k, v in pairs(mods) do
  --  table.insert(list, v)

  for _, v in pairs(files) do
    for k2, v2 in pairs(modeDef) do
  for _, v in pairs(files) do
    for k2, v2 in pairs(modeDef) do
      if v2.has and not couldBe[k2] then
      if v2.has and not couldBe[k2] then
        for _, v3 in pairs(v2.has) do
          if v:find(v3) then
      if v2.hasnt and not cannotBe[k2] then
        for _, v3 in pairs(v2.hasnt) do
          if v:find(v3) then

  for k, _ in pairs(couldBe) do
    if cannotBe[k] then
  if mods[modname].modData == nil or mods[modname].modData.hashes == nil then return false end
  for k,v in pairs(mods[modname].modData.hashes) do
    v[1] = v[1]:gsub("\\/","/")
    local hashes = mods[modname].modData.hashes
    for k,v in pairs(hashes) do
      v[1] = v[1]:gsub("\\/","/")
  if mods[modname].modData.hashes ~= nil then
    for k,v in pairs(mods[modname].modData.hashes) do
      v[1] = v[1]:gsub("\\/","/")

      for _,vf in pairs(vfiles) do
        if not modsOwnFile(modname,vf) then
  --refresh mod info if file is changed
  for k2, v2 in pairs(filesInZIP) do
    v2 = string.lower(v2)
          mods[modname].modData.imgs = {}
          for _,va in pairs(mods[modname].modData.attachments) do
            table.insert(mods[modname].modData.imgs, mods[modname].modInfoPath .. va.thumb_filename:gsub("\\", "/") )
        local filesInZIP = zip:getFileList()
        for k2, v2 in pairs(filesInZIP) do
          v2 = string.lower(v2)
                  idModList[modID] = {fp=filepath,lastUpdate=(modInfo.last_update or modInfo.release_date),modname=modname}
                  for kf,of in pairs(outFilelist) do
                    if of == oldFilepath then table.remove( outFilelist, kf ); break end
  end
  for _,v in pairs(oldModToDelete) do
    log('E', 'chkDupli.oldModToDelete', dumps(v.name))
  local mountList = {}
  for k,filename in pairs(fileList) do
    -- ensure the window is refreshing
  -- catch deleted files
  for k,v in pairs(mods) do
    if not FS:fileExists(v.fullpath) and not FS:directoryExists(v.fullpath) then
  local tim = hptimer()
  for k,v in pairs(newMountedFiles) do
    newMountedFiles[k] = {filename = v, type = "added" }
local function deactivateAllMods()
  for modname, v in pairs(mods) do
    M.deactivateMod(modname, true)
  local files = getFilesInDirectory('mods')
  for k, v in pairs(files) do
    --local hash = hashFile(v)
  local fileList = FS:findFiles( "/mods", "*.zip", -1, true, false )
  for k,v in pairs(fileList) do
    print( "ZIP file: " .. v )
    print("  entries: " .. tostring( #filesInZIP ) )
    for k2,v2 in pairs(filesInZIP) do
      print( "  " .. v2 )
  local mods = {}
  for file,v in pairs(overrides) do
    local mod = v[1]
  local result = {}
  for mod,files in pairs(mods) do
    log("W", "", "Possibly broken mod detected: "..dumps(mod)..". It overwrites the following files:")
local function getModNameFromID(modID)
  for name,m in pairs(mods) do
    if m.modData ~= nil and m.modData.tagid ~= nil and m.modData.tagid == modID then
  local modScripts = {}
  for modname, v in pairs(mods) do
    if not FS:isMounted(v.fullpath) then
local function deleteAllMods()
  for mod, v in pairs(mods) do
    if v.dirname == "/mods/repo/" then

  for k,v in pairs(fileList) do
    local zipPath = v

  for k,v in pairs(mods) do
    if v.modData ~= nil and v.modData.tagid ~= nil then
        --[[
        for k, v in pairs(filesInZIP) do
          local hash = zip:getFileEntryHashByIdx(k)
      else
        for k,v in pairs(request.responseData.data) do
          if v['action'] ~= nil then

    for modname, mod in pairs(mods) do
      if mod.fullpath == modPath then
  local r = {zip=0, unpacked=0, disabled=0}
  for modname,mdata in pairs(mods) do
    if not mdata.active then
  if oldMod == nil then
    for mn,md in pairs(mods) do
      if m.filename == oldFileName then
@/lua/ge/extensions/flowgraph/nodes/career/onMissionRunstateChanged.lua
  self.pinOut.started.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartPropertyView.lua
  fields = {}
  for k, v in pairs(vEditor.propertyTableEditTarget or {}) do
    if k ~= '__astNodeIdx' and type(v) ~= 'table' and k ~= '__schemaProcessed' then
@/lua/ge/extensions/editor/gen/decal.lua
lo('?? if_MM:'..tostring(mm[{1,2}]))
for key,v in pairs(mm) do
    local akey = {key}
local rdlist = editor.getAllRoads()
for id,_ in pairs(rdlist) do
    local obj = scenetree.findObjectById(id)
        local list = {}
        for i,n in pairs(anode) do
            list[#list+1] = n.pos
local function ind4id(id)
    for i,rd in pairs(adec) do
        if rd.id == id then
        D.undo()
        for _,dec in pairs(adec) do
            local ind = dec.ind
--                lo('?? pre:'..tableSize(editor.getAllRoads())..':'..#scenetree.getAllObjects())
            for _,o in pairs(aobj) do
--                lo('??^^^^^^^^^^^^^^^^^^^^^ for_gl_obj:'..tostring(o))
        end
        for ind,_ in pairs(dupd) do
            local rd = adec[ind]
--        lo('?? rem_from_ed:'..tostring(fedit)..':'..tostring(adec))
    for id,_ in pairs(adec) do
        local obj = scenetree.findObjectById(id)
            local nc = 0
    for i,row in pairs(aref) do
        for j,col in pairs(row) do
    for i,row in pairs(aref) do
        for j,col in pairs(row) do
            local agrid = {}
            local agrid = {}
            for _,a in pairs({-1,0,1}) do
                for _,b in pairs({-1,0,1}) do
            for _,a in pairs({-1,0,1}) do
                for _,b in pairs({-1,0,1}) do
                    if i+a < 1 or i+a > gmax or j+b < 1 or j+b > gmax then
            end
            for rsrc,asrc in pairs(aref[i][j]) do
--                        if i == 526 and j == 355 then
                for n = asrc[1],asrc[2] do
                    for _,g in pairs(agrid) do
                        if g == nil or g[1] == nil or g[2] == nil or aref[g[1]] == nil then
--                            if true then return end
                            for rtgt,atgt in pairs(aref[g[1]][g[2]]) do
--                                        if i == 526 and j == 355 and g[1] == 526 and g[2] == 355 then
]]
                                            for _,l in pairs(across[rsrc][n]) do
--                                                if rsrc == 68 and rtgt == 192 then
                                                if true then --and rsrc == 68 then
                                                    for ni,al in pairs(across[rsrc]) do
--                                                                U.dump(al, '?? checking:'..ni)
--                                                                U.dump(al, '?? checking:'..ni)
                                                        for il,l in pairs(al) do
    --                                                                U.dump(l, '?? link_check:')
    end
    for i,r in pairs(adec) do
        for k,n in pairs(r.list) do
    for i,r in pairs(adec) do
        for k,n in pairs(r.list) do
            adec[i].list[k].z = core_terrain.getTerrainHeight(adec[i].list[k])
--[[
    for _,p in pairs(out.avedit) do
        p.z = core_terrain.getTerrainHeight(p)
    --    local n = 1
        for roadID,_ in pairs(rdlist) do
            local rd = scenetree.findObjectById(roadID)
                local aw = {}
                for _,n in pairs(nlist) do
                    anode[#anode+1] = vec3(n.pos.x,n.pos.y)
    aref = {}
    for ir,r in pairs(adec) do
        if r.skip or #U.index(askip, r.id) > 0 then goto cont end
--            end
        for k,n in pairs(r.list) do
--                nn = nn + 1
            out.acyan = {}
    for ind,d in pairs(out.across) do
        for k,c in pairs(d) do
    for ind,d in pairs(out.across) do
        for k,c in pairs(d) do
            local abranch = {ind}
            local abr = {adec[ind]}
            for i,b in pairs(c) do
                abranch[#abranch+1] = b[1]
                    U.dump(c, '?? for_CROSS8:'..ind..':'..k)
                        for t,b in pairs(ajunc[#ajunc].list) do
                            local p = ajunc[#ajunc].p
]]
                for i,b in pairs(abr) do
                    if ajunc[#ajunc].p:distance(b.list[1]) < 1 then
    if list then
        for _,desc in pairs(list) do
            rdlist[desc.id] = true
    end
    for id,_ in pairs(rdlist) do
        local obj = scenetree.findObjectById(id)
    out[cname] = {}
    for i,p in pairs(list) do
        local v = f and f(p) or p
        lo('?? D.undo:'..tableSize(adec)..'/'..#adec..':'..tableSize(mask)..':'..tostring(silent))
    for ij,d in pairs(mask) do
--            U.dump(ij, '?? undo_ij:'..tostring(grid2p(ij))..':'..tostring(d[1]))
        tb:updateGrid()
        for i,rd in pairs(adec) do
            local obj = scenetree.findObjectById(rd.id)
            ilist = {}
            for _,ind in pairs(apick) do
                ilist[#ilist+1] = ind
    aconf = deepcopy(ilist)
    for _,ind in pairs(ilist) do
        list[#list+1] = adec[ind]
    local askip = {}
    for _,dec in pairs(list) do
--            dbg = dec.ind == 142 and true or nil
        local pinstep = 30 -- distance between pin points
--    for _,dec in pairs(adec) do
        local ind = dec.ind
        local ind = dec.ind
--    for _,ind in pairs(ilist) do
            local ccross
            for i,ref in pairs(bcross) do
                ccross = i
                local ai = {ind}
                for _,b in pairs(ref) do
                    ai[#ai+1] = b[1]
                    jrad = 0
                    for j,b in pairs(ref) do
            --                U.dump(b, '?? for_B:'..tostring(j))
                        end
            --            for k,b in pairs(ep) do
            --                abranch[#abranch+1] = {b[1],b[2]}
                    end
                    for j,b in pairs(ref) do
                        stamp = U.stamp({b[1],b[2]},true)
                if true then
        --            for j,b in pairs(abranch) do
                    local dir0
                    local pc
                    for k,d in pairs(aang) do
                            if dbg then U.dump(d, '?? for_ang:'..k) end
--                toMark(rd.apin, 'blue', nil, 0.1, 0.4)
--            for _,p in pairs(rd.apin)
--                if true then return end
        --            lo('?? set:'..n)
        --            for key,d in pairs(mask) do
        --                U.dump(d, '?? for_mask:'..tostring(key))
            U.dump(askip, '?? to_skip:')
    for _,rd in pairs(list) do
        if #U.index(askip, rd.ind) == 0 then
--            local ind = dec.ind
    --    for _,ind in pairs(ilist) do
--            local rd = adec[ind]
            -- update adjacent roads
            for _,ref in pairs(bcross) do
                for j,b in pairs(ref) do
            for _,ref in pairs(bcross) do
                for j,b in pairs(ref) do
                    adec[b[1]].body:setPosition(adec[b[1]].body:getPosition())
        if rd.aline then
            for i,l in pairs(rd.aline) do
                l.body:setPosition(l.body:getPosition())
    table.remove(tdec, 1)
    for _,t in pairs(tdec) do
--            lo('?? for_t1:'..t)
local anode = {}
for i,c in pairs(apair) do
    local ac = U.split(c,',')
local nn = 0
for ir,r in pairs(adec) do
for k,n in pairs(r) do
for ir,r in pairs(adec) do
for k,n in pairs(r) do
        nn = nn + 1
    local aw = {}
    for _,p in pairs(desc.list) do
        an[#an + 1] = {pos = p, width = desc.w}
    local dmi,imi,smi = math.huge
    for _,i in pairs(aind) do
        local d = epos(rd.body, i, side):distance(p)
        local e2d = rd.e2d
        for ie,d in pairs(e2d) do
            if d - dist > -U.small_dist then
--                lo('?? e_UPD:'..junc.wexit) -- tostring(junc.aexit[i].body)..':'..#anode)
    for k,n in pairs(apos) do
        local w = awidth[k] or rd.w
--[[
    for i,d in pairs(desc.list) do
        d.body = decalUp(d.desc)
    end
    for i,d in pairs(desc.aexit) do
        if d.dirty then
        lo('>> junctionUpdate:'..tostring(yes))
    for i,b in pairs(jdesc.list) do
        if b.dirty then
            toJunc(jdesc, i)
            for _,ie in pairs(b.aex) do
--                lo('?? ex_hide:'..tostring(jdesc.aexit[ie].body.hidden))
    forExits(jdesc, yes)
    for _,e in pairs(jdesc.aexit) do
        e.dirty = false
            lo('?? if_LINES:'..#edesc.aline)
        for i,ldesc in pairs(edesc.aline) do
            decalUp(ldesc)

    for i,b in pairs(jdesc.list) do
        local nodelast = b.io == 1 and b.list[#b.list] or b.list[1]
                out.avedit = {}
                for k,p in pairs(b.list) do
--                    lo('?? for_list:'..k)
                out.avedit = {}
                for k,p in pairs(b.listrad) do
--                    lo('?? for_list:'..k)
        end
        for il,d in pairs(adec[b.aexo[1]].aline) do
            d.body:setField('hidden', 0, 'true')
                if false then
                    for il,d in pairs(adec[b.aexo[1] ].aline) do
                        d.body:setField('hidden', 0, 'true')
                    end
                    for il,d in pairs(adec[b.aexi[1] ].aline) do
                        d.body:setField('hidden', 0, 'true')
                    end
                    for il,d in pairs(b.aline) do
                        d.body:setField('hidden', 0, 'true')
        -- build exits
        for _,idec in pairs(b.aexo) do
            local e = adec[idec]
                -- lines right
                for k,l in pairs(b.aline) do
                    l.on = true
    local aline,line,ex,rdfr,rdto,newline
    for i,br in pairs(jdesc.list) do
        if true then
--        local b = jdesc.list[i]
    for i,b in pairs(jdesc.list) do
--                lo('??+++++++++++++ branch_upd0:'..i..':'..#b.list)
                out.avedit = {}
                for k,p in pairs(b.list) do
--                    lo('?? for_list:'..k)
                out.avedit = {}
                for k,p in pairs(b.listrad) do
--                    lo('?? for_list:'..k)
        if #b.aexo > 0 and adec[b.aexo[1]] and adec[b.aexo[1]].aline then
            for il,d in pairs(adec[b.aexo[1]].aline) do
                d.body:setField('hidden', 0, 'true')
                if false then
                    for il,d in pairs(adec[b.aexo[1] ].aline) do
                        d.body:setField('hidden', 0, 'true')
                    end
                    for il,d in pairs(adec[b.aexi[1] ].aline) do
                        d.body:setField('hidden', 0, 'true')
                    end
                    for il,d in pairs(b.aline) do
                        d.body:setField('hidden', 0, 'true')
        -- build exits
        for _,idec in pairs(b.aexo) do
                lo('??******* for_EXo:'..i..':'..idec)
                -- lines right
                for k,l in pairs(b.aline) do
                    l.on = true
--            local br = jdesc.list[i]
        for i,br in pairs(jdesc.list) do
            if true then
    end
    for _,rd in pairs(jdesc.list) do
        rd.body:setPosition(rd.body:getPosition())
            ex.aline = line4exit(ex, bout, bin)
            for k,ldesc in pairs(ex.aline) do
                decalUp(ldesc)
--            local b = abr[i]
        for i,b in pairs(abr) do
--                U.dump(b.djrad, '??++++++++++++++ for_rad:'..i)
    else
        for i,b in pairs(abr) do
            local dw = U.mod(i+1, abr).w/2
                ex.aline = line4exit(ex, bout, bin)
                for k,ldesc in pairs(ex.aline) do
                    decalUp(ldesc)
        end
        for i,b in pairs(abr) do
            local dw = U.mod(i+1, abr).w/2
        pto = pto.list[#pto.list]
        for j,d in pairs(amatch) do
            if j~=k and j~=m and d.fr~=k and d.fr~=m then
        local jifr,jito = adec[amatch[k].ind].ij,adec[amatch[m].ind].ij
        for _,j in pairs(ajunc) do
            for ib,b in pairs(j.list) do
        for _,j in pairs(ajunc) do
            for ib,b in pairs(j.list) do
                if (_ ~= jifr[1] or ib ~= jifr[2]) and (_ ~= jito[1] or ib ~= jito[2]) then
        match = false
        for k,_ in pairs(amatch) do
            if not indrag then
            local dmi,imi = math.huge
            for m,_ in pairs(amatch) do
                local a,b = adec[amatch[k].ind],adec[amatch[m].ind]
                        end
                        for s,l in pairs(amatch) do
                            if l.to then
    end
    for k,d in pairs(amatch) do
        if not d.skip and d.to and not d.match then
    if false then
        for k,t in pairs(atry) do
                lo('?? to_plot:'..t.ifr..'>'..k)
        lo('<< forPlot:'..#aplot)
    for i,d in pairs(amatch) do
--        d.skip = nil
    if render then
        for i,d in pairs(aplot) do
            D.branchMerge(adec[amatch[d.fr].ind], adec[amatch[d.to].ind])
    local function ifCross(c,d)
        for k,v in pairs(atry) do
    while tableSize(tomatch) > 0 and n<15 do
        for i,_ in pairs(tomatch) do
            local bfr = d.list[i]
            -- fit branch
            for k,dto in pairs(ajunc) do
                if k ~= ind then
                if k ~= ind then
                    for j,bto in pairs(dto.list) do
                        local dist = (bto.list[#bto.list]-bfr.list[#bfr.list]):length()
            end
            for k,v in pairs(atry) do
                tomatch[v.ifr] = nil

    for k,t in pairs(atry) do
        local bfr = d.list[t.ifr]

        for i,bfr in pairs(d.list) do
    --        atry[i] = {}
            local dmi,imi = math.huge
            for k,dto in pairs(ajunc) do
                if k ~= ind then
                if k ~= ind then
                    for j,bto in pairs(dto.list) do
                        local dist = (bto.list[#bto.list]-bfr.list[#bfr.list]):length()
            U.dump(atry, '?? forPlot_ATRY:')
        for k,t in pairs(atry) do
            local bfr = d.list[t.ifr]
--        U.dump(ajunc, '>> junctionDown:'..tostring(ind)..':'..#ajunc)
    for i,b in pairs(jdesc.list) do
--        if U._MODE == 'conf' then
        -- exits
        for k,e in pairs(b.aexo) do
            editor.deleteRoad(adec[e].id)
--??            b.aexo.id = nil
            for j,l in pairs(adec[e].aline) do
                editor.deleteRoad(l.id)
        -- lines
        for k,e in pairs(b.aexo) do
--            editor.deleteRoad(adec[e].id)
--            lo('?? down:'..i..':'..b.id)
        for k,l in pairs(b.aline) do
            editor.deleteRoad(l.id)
        end
        for k,d in pairs(amatch) do
            if d.ind == b.ind then
    end
    for i,b in pairs(jdesc.list) do
        for k,e in pairs(b.aexi) do
    for i,b in pairs(jdesc.list) do
        for k,e in pairs(b.aexi) do
            if adec[e].id then
    be:reloadCollision()
    for i,d in pairs(ajunc) do
        for j,b in pairs(d.list) do
    for i,d in pairs(ajunc) do
        for j,b in pairs(d.list) do
            local rd = b.body
--        local b = jdesc.list[i]
    for i,b in pairs(jdesc.list) do
        if b.dirty then
            if tohide then
                for ie,e in pairs(b.aexi) do
                    if adec[e] then
                end
                for ie,e in pairs(b.aexo) do
                    if adec[e] then
--                    lo('??+++++++++++++++++++++++++++ line_hide:'..#b.aline..':'..tostring(tohide)..':'..tostring(b.aexo[1]))
--                for il,d in pairs(b.aline) do
                if adec[b.aexo[1]] then
                if adec[b.aexo[1]] then
                    for il,d in pairs(adec[b.aexo[1]].aline) do
                        if d.body then
--                        U.dump(adec[b.aexi[1]].aline, '?? for_ae_line:'..i)
                    for il,d in pairs(adec[b.aexi[1]].aline) do
                        if d.body then
                end
                for il,d in pairs(b.aline) do
                    d.body:setField('hidden', 0, tohide)
                    lo('??++++++++++++++++++++++++ junctionUpdate_render_branch:'..i..':'..tostring(show))
                for _,idec in pairs(b.aexo) do
    --                    U.dump(e, '?? ex_upd:'.._)
                    if e then
                        for k,b in pairs(ajunc[cjunc].list) do
                            if b.ind == e.frto[2] then
                        -- lines right
                        for k,l in pairs(b.aline) do
                            l.on = true
                        if aline then
                            for k,l in pairs(aline) do
    --                                lo('?? for_LINE:'..i..':'..k..':'..tostring(l.list and #l.list or nil))
                end
                for _,idec in pairs(b.aexi) do
                    local e = adec[idec]
                        local aline = line4exit(e, bout, bin)
                        for i,l in pairs(aline) do
                            nodesUpdate(e.aline[i], l.list)
--[[
    for _,v in pairs(shmap) do
        tb:setHeightWs(v[1], v[2])
]]
    for y,row in pairs(shmap) do
        for x,h in pairs(row) do
    for y,row in pairs(shmap) do
        for x,h in pairs(row) do
            tb:setHeightWs(vec3(x,y), h)
        if true then return end
    for id,data in pairs(aedit) do
        local anode = editor.getNodes(data.body)
        local anode = editor.getNodes(data.body)
        for i,n in pairs(anode) do
            editor.setNodeWidth(data.body, i-1, data.w)
local function inAdec(rid)
    for i,r in pairs(adec) do
        if r.id == rid then
        local list = {}
        for i,p in pairs(pth) do
            list[#list+1] = p.pos
--[[
    for i,r in pairs(adec) do
        if r.id == cpick then
    if cdec and across[cdec] then
        for n,lst in pairs(across[cdec]) do
            lo('?? for_cross:'..n)
    local ain = {}
    for i,p in pairs(aepin) do
        ain[#ain + 1] = {aeinfo[p[1]].d, p[2]}
    out.apicknode = {}
    for _,n in pairs(anode) do
        out.apicknode[#out.apicknode + 1] = n.pos
                        out.apick = {t}
                        for _,pe in pairs(ae) do
--                            out.apoint[#out.apoint+1] = pe
    local pp = {}
    for i,rd in pairs(adec) do
        if rd.id == cpick then
                U.dump(star, '?? star_post:')
            for _,b in pairs(star) do
        -- get neighbours
        for k,f in pairs(star) do
            if f.rdi == cdec then
        local ipre
        for i,n in pairs(n2e) do
            if ie and n.e > ie then
        local ipre
        for i,n in pairs(n2e) do
            if iel and n.e > iel then
    local aflag = {}
    for _,c in pairs(astem) do
        local lst = ard[c[1] ].list
    if not jdesc then jdesc = ajunc[cjunc] end
    for _,d in pairs(jdesc.list) do
        editor.deleteRoad(d.body:getID())
    end
    for _,d in pairs(jdesc.aexit) do
        editor.deleteRoad(d.body:getID())
    end
    for _,d in pairs(jdesc.aline) do
        editor.deleteRoad(d.body:getID())
    local wma = 0
    for i,rd in pairs(abr) do
        if rd.w > wma then
        -- prepair branches info
        for i,b in pairs(abr) do
            if b.list[1]:distance(ajunc[cjunc].p) < 0.5 then -- U.small_dist then
        local ai = {}
        for _,b in pairs(abr) do
            ai[#ai+1] = abr.ind
        local rma = 0
        for i,b in pairs(abr) do
--                    road2ter({abr[1].ind},true)
                local junc = ajunc[cjunc]
                for i,b in pairs(junc.list) do
                    road2ter({b.ind}, true)
                local list = {}
                for i,b in pairs(ajunc[cjunc].list) do
                    list[#list+1] = b.ind
                be:reloadCollision()
                for i,b in pairs(ajunc[cjunc].list) do
--                    for j,n in pairs(b.list) do
                for i,b in pairs(ajunc[cjunc].list) do
--                    for j,n in pairs(b.list) do
--                        editor.setNodePosition(b.body, j-1, n+vec3(0,0,10))
--[[
                for i,b in pairs(ajunc[cjunc].list) do
    --                editor.updateRoadVertices(b.body)
                        -- update lines
                        for j,l in pairs(b.aline) do
--                            l.body:setPosition(l.body:getPosition())
        jdesc.r = val
        for _,d in pairs(jdesc.list) do
            d.dirty = true
            d.dirty = true
            for k,e in pairs(d.aexo) do
                if adec[e] then
        --TODO: reconform
--        for _,d in pairs(jdesc.aexit) do
--            d.dirty = true
    elseif key == 'exit_w' then
        for _,d in pairs(jdesc.list) do
            d.dirty = true
            d.dirty = true
            for k,e in pairs(d.aexo) do
                if adec[e] then
        jdesc.wexit = val
        for _,d in pairs(jdesc.aexit) do
            d.dirty = true
    if not rd.ij then return end
    for i,b in pairs(ajunc[rd.ij[1]].list) do
        local cang = U.vang(b.dir, -rd.dir, true) --b.dir:dot(-rd.dir)
    local dmi,pmi,imi = math.huge
    for i,idec in pairs(rd.aexo) do
        local e = adec[idec]
D.matchClear = function()
    for i,m in pairs(amatch) do
        m.skip = nil
D.inMatch = function(ind)
    for i,m in pairs(amatch) do
        if m.ind == ind then
            lo('?? pick_TARGET:')
        for i,rd in pairs(adec) do
--            if onroad and onroad ~= rd.id then
    --                lo('?? onROAD:'..rd.id)
                for k,n in pairs(rd.list) do
                    if dircar:dot(n-car.pos) > 0 and n:distance(car.pos) >= default.v2tmin then
                        lo('?? wrongWay:'..tostring(car.pos))
                    for i,p in pairs(adec[ijmi[1] ].list) do
                        lo('?? cdist:'..ijmi[1]..':'..car.pos:distance(p))
                    end
                    for i,p in pairs(adec[icheck].list) do
                        lo('?? dist_check:'..icheck..':'..car.pos:distance(p)..':'..tostring(car.pos)..':'..tostring(p))
                        local ami,imi = math.huge
                        for i,b in pairs(jdesc.list) do
                            if U.vang(car.vel, b.dir) < ami then
    if false then
        for i,rd in pairs(adec) do
            if onroad and onroad ~= rd.id then
    --                lo('?? onROAD:'..rd.id)
                for k,n in pairs(rd.list) do
                    if dircar:dot(n-car.pos) > 0 and n:distance(car.pos) >= default.v2tmin then
                        lo('?? wrongWay:'..tostring(car.pos))
                    for i,p in pairs(adec[ijmi[1] ].list) do
                        lo('?? cdist:'..ijmi[1]..':'..car.pos:distance(p))
                    end
                    for i,p in pairs(adec[icheck].list) do
                        lo('?? dist_check:'..icheck..':'..car.pos:distance(p)..':'..tostring(car.pos)..':'..tostring(p))
                            local ama,imi = -math.huge
                            for i,b in pairs(ajunc[rd.ij[1] ].list) do
    --                                lo('?? if_nbr:'..i..':'..)
        if ard then
            for _,d in pairs(ard) do
                local pp = U.toPoly(pt, d.list)
        done = true
        for i,d in pairs(list) do
--                fout:write(tostring(n..':'..i..'\n'))
                U.proj2D(list[i].e[2]) + vec3(0,0,forZ(U.proj2D(list[i].e[2])))}
--        for i,d in pairs(list) do
        if i > 1 then
                local eb,ee = U.proj2D(rd.list[1]),U.proj2D(rd.list[#rd.list])
                for _,ijs in pairs(rd.aset) do
--                        lo('?? for_ijs:'..tostring(ijs))
                D.undo()
                for _,dec in pairs(adec) do
                    local ind = dec.ind
            -- render links
            for i,d in pairs(out.aplot) do
                Render.path(d.e, color(255,255,0,155), 4)
        if not im.IsWindowHovered(im.HoveredFlags_AnyWindow) and not im.IsAnyItemHovered() then
            for ind,rd in pairs(adec) do
                local roadID = rd.id
                local roadID = rd.id
--            for roadID, _ in pairs(rdlist) do
                local road = scenetree.findObjectById(roadID)
                                    local n = anode[i]
--                                for _,n in pairs(anode) do
                                    out.anode[#out.anode + 1] = n.pos
                                local dmi,jmi,imi = math.huge
                                for k,d in pairs(ajunc) do
                                    if d.list then
                                    if d.list then
                                        for i,r in pairs(d.list) do
                                            if roadID == r.id then
                                            cjunc = k
                                            for i,b in pairs(d.list) do
                                                if b.io == 1 and (b.list[2]-anode[2].pos):length() < U.small_val then
--                                        out.avedit = {}
                                        for i,b in pairs(d.list) do
                                            if b.io == 1 and (b.list[2]-anode[2].pos):length() < U.small_val then

                for _,m in pairs(amatch) do
                    if m.ind == out.pdrag.ind then
            lo('?? D.mup:'..tostring(cjunc)..':'..tostring(incontrol)..':'..tostring(cmover)..' ind:'..tostring(cdescmo)..':'..tostring(indrag)) --..':'..tostring(rayCast and rayCast.pos or nil)..':'..tostring(cdescmo and adec[cdescmo].body:getOrCreatePersistentID() or nil))
        for key,val in pairs(dval) do
                lo('?? for_val:'..key..':'..val)
--[[
            for _,b in pairs(ajunc[cjunc].list) do
                b.dirty = false
            end
            for _,e in pairs(ajunc[cjunc].aexit) do
                e.body:setField('hidden', 0, 'false')
                local dmi,jmi,nmi,ie1,ie2 = math.huge
                for j,dec in pairs(adec) do
                    if not out.sidepick or out.sidepick.src ~= dec.id then
--                    if not out.sidepick or out.sidepick.src ~= dec.ind then
                        for k,n in pairs(dec.list) do
                                if j == #adec then
--                            U.dump(across[#across], '?? ADDED:'..adec[#adec].ind..':'..adec[#adec].id)
                            for _,d in pairs(adec) do
                                if d.id == id then
            local dmi,imi = math.huge
            for i,d in pairs(ajunc) do
                if rayCast and rayCast.pos:distance(d.p) < 3 then
                    out.agreen = {}
                    for _,ind in pairs(apick) do
--                                lo('?? ind:'..tostring(ind))
                    lo('?? to_MERGE:'..#out.aplot)
                for _,d in pairs(out.aplot) do
    --                U.dump(d, '?? merging:'.._)
            local dmi,imi = math.huge
            for i,d in pairs(ajunc) do
                if rayCast.pos:distance(d.p) < 3 then
                local anode = editor.getNodes(croad)
                for i,n in pairs(anode) do
                    if rayCastHit and (rayCastHit - n.pos):length() < 1 then
                        out.agreen = {}
                        for _,ind in pairs(apick) do
--                                lo('?? ind:'..tostring(ind))
                -- merge roads via extend
                for i,rd in pairs(adec) do
                    if rd.id == cpick then
--                            U.dump(star, '?? star_got:'..i)
                        for _,f in pairs(star) do
                            if f.rdi == i then
                        local ami,fmi = math.huge
                        for _,f in pairs(star) do
                            if f.rdi ~= us.rdi then

--                        for k,lnk in pairs(across[fmi.rdi][])
                            local abranch,irem = {}
                            for k,lnk in pairs(across[cdec][ndi]) do
                                    lo('?? to_check:'..k..':'..lnk[1])
                            --- from theirs
                            for _,rdi in pairs(abranch) do
--                                    U.dump(across[rdi], '?? to_up:'..rdi)
--                                    U.dump(across[rdi], '?? to_up:'..rdi)
                                for n,alnk in pairs(across[rdi]) do
                                    for k,lnk in pairs(alnk) do
                                for n,alnk in pairs(across[rdi]) do
                                    for k,lnk in pairs(alnk) do
                                        if lnk[1] == cdec then
                            end
                            for n,alnk in pairs(across[fmi.rdi]) do
                                for k,lnk in pairs(alnk) do
                            for n,alnk in pairs(across[fmi.rdi]) do
                                for k,lnk in pairs(alnk) do
                                    if lnk[1] == cdec then
                        if across[cdec] then
                            for n,lst in pairs(across[cdec]) do
                                lo('?? for_cross:'..n)
    --            lo('?? key_R1:'..anode[1].width..':'..croad:getNodeWidth(1))
                for i,_ in pairs((tableSize(anodesel) > 0) and anodesel or anode) do
    --                    lo('?? to_w:'..i)
            local anode = editor.getNodes(croad)
            for i,_ in pairs((tableSize(anodesel) > 0) and anodesel or anode) do
--            for i,n in pairs(anode) do
            for i,_ in pairs((tableSize(anodesel) > 0) and anodesel or anode) do
--            for i,n in pairs(anode) do
                editor.setNodeWidth(croad, i-1, croad:getNodeWidth(i-1) - 1)
    -- MARKING
    for key,l in pairs(legend) do
        if out[key] then
            c.alpha = legend[key][3]
            for i,p in pairs(out[key]) do
                sphere(p, legend[key][2], c)
        -- render links
        for i,d in pairs(out.aplot) do
            Render.path(d.e, color(255,255,0,155), 4)
    if out.aseg then
        for i,e in pairs(out.aseg) do
--            U.dump(e, '?? for_eg:'..#out.aseg)
    if out.acirc then
        for _,d in pairs(out.acirc) do
            R.circle(d.p, d.r, color(255,255,0,255), 4)
    if out.atri then
        for _,t in pairs(out.atri) do
           debugDrawer:drawTriSolid(t[1],t[2],t[3],color(255,255,220,200))
    if out.ared ~= nil then
        for _,p in pairs(out.ared) do
            sphere(p, 2*rbase, ColorF(1,0,0,0.4))
    if out.agreen ~= nil then
        for _,p in pairs(out.agreen) do
            sphere(p, 2*rbase, ColorF(0,1,0,0.4))
    if out.acyan ~= nil then
        for _,p in pairs(out.acyan) do
            sphere(p, rbase, ColorF(0,1,1,0.4))
    if out.anode ~= nil then
        for _,p in pairs(out.anode) do
            local r = 0.1*math.sqrt((p-core_camera.getPosition()):length())
    if out.apicknode ~= nil then
        for i,p in pairs(out.apicknode) do
            local r = 0.1*math.sqrt((p-core_camera.getPosition()):length())
--            _dbdrag = true
        for _,s in pairs(out.avedit) do
            if s and s.x then
            if #anodesel > 0 then
                for i,_ in pairs(anodesel) do
                    editor.setNodeWidth(croad, i-1, croad:getNodeWidth(i-1) + 1)
            else
                for i,n in pairs(anode) do
                    if true or i < 3 then
@/lua/ge/extensions/career/modules/missionWrapper.lua
  gameplay_missions_progress.setSavePath(currentSavePath .. "/career/missions/")
  for id, dirtyDate in pairs(allMissionData) do
    if dirtyDate > oldSaveDate then
@/lua/common/jbeam/utils.lua

  for nodeKey, data in pairs(jbeamData) do
    if type(nodeKey) == 'string' and type(data) == 'table' and type(data.x) == 'number' and type(data.y) == 'number' and type(data.z) == 'number'
@/lua/ge/extensions/gameplay/drift/scoring.lua
local function translateTierNames()
  for id, data in pairs(driftTiers) do
    driftTiers[id].name = translateLanguage(tierTranslationPrefix..data.id, tierTranslationPrefix..data.id, true)
@/lua/ge/extensions/scenario/quickRaceLoader.lua
  -- filter paths to only return filename without extension
  for k,v in pairs(files) do
    files[k] = string.gsub(files[k], "(.*/)(.*)/(.*)", "%2")
        else
          for _,v in pairs(newLevel.vehicles) do
            if (v.playerUsable == true or v.playerUsable == '1') or (v.driver and v.driver.player == true) then
    local newPreviews = {}
    for _, img in pairs(levelInfo.levelInfo.previews) do
      table.insert(newPreviews, levelInfo.directory..'/' .. img)
    local tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.png', 0, true, false)
    for _, p in pairs(tmp) do
      table.insert(levelInfo.previews, p)
    tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.jpg', 0, true, false)
    for _, p in pairs(tmp) do
      table.insert(levelInfo.previews, p)
        file.previews = {}
        for _, p in pairs(tmp) do
          table.insert(file.previews, p)
        file.reversePreviews = {}
        for _, p in pairs(tmp) do
          table.insert(file.reversePreviews, p)
  -- add automatic prefabs only if they exist
  for list, suf in pairs(autoPrefabs) do
    for _, ext in ipairs(prefabExt) do
@/lua/ge/extensions/editor/crawlEditor/paths.lua

  for idx, obj in pairs(objects) do
    local distNodeToCam = (obj.pos - mouseInfo.camPos):length()
@/lua/vehicle/controller/esc.lua
  table.clear(allWheelSlips)
  for k, v in pairs(throttleFactorData) do
    throttleFactors[k] = v.throttleFactor
    end
    for k, v in pairs(throttleFactorData) do
      v.integral = 0
    end
    for k, v in pairs(throttleFactorData) do
      v.integral = 0

  for _, v in pairs(throttleFactorData) do
    v.lastSlip = v.peakSlip
    end
    for _, v in pairs(throttleFactorData) do
      v.integral = 0
  local maxUsefulThrottleIntegral = (1 - currentESCConfiguration.minThrottleFactor) / currentESCConfiguration.throttleIntegralFactor
  for k, v in pairs(throttleFactorData) do
    local doUseTCS = (tcsThrottleMode == "reduce" and v.allWheelSlip > 0) and v.tcsActive
        generator = function(entries)
          for k, v in pairs(escConfigurations) do
            local entry = {
  local totalMass = 0
  for _, v in pairs(v.data.nodes) do
    tmp = tmp + vec3(v.pos) * v.nodeWeight
  local twRight = 0
  for _, n in pairs(v.data.nodes) do
    if n.cid == wheelCache[frontRightWheelId].node1 then

  for id, wd in pairs(wheels.wheels) do
    if actionedWheelLookup[wd.name] then
  throttleFactorData = {}
  for _, v in pairs(throttleFactorAssingment) do
    throttleFactorWheelLookup[v.wheelName] = v.throttleFactorName
  wheelIdCache = {}
  for k, _ in pairs(wheelCache) do
    table.insert(wheelIdCache, k)
  local tmpConfigs = {}
  for name, config in pairs(escConfigs.configurations) do
    if type(config) == "table" and config.escConfigurationEnabled then
  )
  for _, config in pairs(tmpConfigs) do
    escConfigurations[counter] = config

  for _, config in pairs(escConfigurations) do
    if type(config) == "table" and config.escConfigurationEnabled and config.characteristicSpeed <= 0 then --calculate char. speed if no override is provided
  if escConfigs.blacklistedEngines and type(escConfigs.blacklistedEngines) == "table" then
    for _, v in pairs(escConfigs.blacklistedEngines) do
      blacklistedEngines[v] = true
  revLimiterEngines = {}
  for _, v in pairs(engines) do
    --make sure the device supports temp rev limiters, otherwise we'll just run into issues
@/lua/vehicle/extensions/mqttGrafanaDemo.lua

  for _, wd in pairs(wheels.wheels) do
    local name = wd.name
@/lua/ge/extensions/gameplay/traffic.lua
  local activeCount = 0
  for id, veh in pairs(traffic) do
    if veh.isAi and be:getObjectActive(id) then
local function refreshVehicles() -- resets core traffic vehicle data
  for _, veh in pairs(traffic) do
    veh:onRefresh()

  for k, v in pairs(data) do
    if k == 'aiMode' or k == 'aiDebug' or k == 'aiAware' then
          updateTrafficPool()
          for id, veh in pairs(traffic) do
            veh._teleport = true
    local outboundCount = 0
    for id, veh in pairs(traffic) do
      if veh.state == 'active' then
  tempVec.z = tempVec.z - 1
  for id, veh in pairs(traffic) do
    if be:getObjectActive(id) then
  local trafficData = {}
  for _, veh in pairs(traffic) do
    table.insert(trafficData, veh:onSerialize())
  if data.state == 'on' then
    for _, veh in pairs(data.traffic) do
      insertTraffic(veh.id, not veh.isAi)
@/lua/common/libs/luasocket/socket/ftp.lua
        local u = url.parse(t.url)
        for i,v in base.pairs(t) do
            u[i] = v
@/lua/ge/extensions/flowgraph/nodes/ui/buttons/setMultipleButtonsProperty.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.targetPin == self.pinInLocal['buttonId_'..i] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/getDragWinners.lua
  if self.pinOut.playerPos:isUsed() then
    for k, v in pairs(self.data) do
      if v.isPlayable then
@/lua/ge/extensions/ui/gameplaySelector/tileClustering.lua

  for _itemKey, item in pairs(clusteredItems.itemsByKey) do
    local favouriteIdx = backend.isFavourite(item.key) or 0

  for _, item in pairs(clusteredItems.itemsByKey) do
    if item.type ~= "Freeroam Spawnpoint" then

  for _, item in pairs(clusteredItems.itemsByKey) do
    if firstMissionTypeLabel == nil and item.missionTypeLabel then
    local itemsList = {}
    for _, item in pairs(clusteredItems.itemsByKey) do
      table.insert(itemsList, item)
  local sourceIconsLookup = {}
  for _, item in pairs(clusteredItems.itemsByKey) do
    for _, source in pairs(item.sourceIcons or {}) do
  for _, item in pairs(clusteredItems.itemsByKey) do
    for _, source in pairs(item.sourceIcons or {}) do
      sourceIconsLookup[source.icon or source.svg] = true
  local sourceIcons = {}
  for source, active in pairs(sourceIconsLookup) do
    if string.endswith(source, ".svg") then
  local sourceIconsWithOrder, sourceIconsWithoutOrder = {}, {}
  for _, sourceIcon in pairs(sourceIcons) do
    if sourceIconsOrder[sourceIcon.icon or sourceIcon.svg] then
  local auxiliarySum = true
  for _, item in pairs(clusteredItems.itemsByKey) do
    auxiliarySum = auxiliarySum and item.isAuxiliary

  for _, item in pairs(items) do
    local group = clusterModeFunctions[clusterMode](item) or "Other..."
@/lua/ge/extensions/core/checkpoints.lua
  local vehicleCheckpoints = M.state.vehicleCheckpoints
  for vid,data in pairs(vehicleCheckpoints) do
    data.checkTimer = data.checkTimer + dt
  resetData()
  for _, vid in pairs(scenario.vehicleNameToId or {}) do
    initialiseCheckpointData(vid)
@/lua/ge/extensions/gameplay/delivery/delivery.lua
  local lCount = 0
  for _, loc in pairs(self.sites.locations.objects) do
    if loc.customFields.tags[tag] then
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
    local data = editor.getPreference("dynamicDecalsTool.layerStack.layerTypeIconColor")
    for name, color in pairs(data) do
      if im.ColorEdit4("##layerIconColor_" .. tostring(name), editor.getTempFloatArray4_TableTable(color), im.flags(im.ColorEditFlags_NoInputs, im.ColorEditFlags_AlphaPreview)) then
@/lua/ge/extensions/editor/suspensionAudioDebug.lua
      im.Columns(2, "AudioTable")
      for i, v in pairs(filter) do
        for bi, val in ipairs(editor_suspensionAudioDebug.beamSounds) do
@/lua/ge/map.lua

  for nid, n in pairs(map.nodes) do
    for lid, edge in pairs(n.links) do
  for nid, n in pairs(map.nodes) do
    for lid, edge in pairs(n.links) do
      if not edge.speedLimit then

  for _, v in pairs(jsonMap.segments) do
    if type(v.nodes) == 'string' then
  local splits = {}
  for nid, data in pairs(nodesToMerge) do
    local edgeId = data[1]

  -- for n1id, n2id in pairs(newNodesCreated) do -- TODO: remove debug
  --   local n1 = map.nodes[n1id]
  -- check for private roads joining public roads
  for nid, n in pairs(map.nodes) do
    local privateCount, count = 0, 0
    local privateCount, count = 0, 0
    for lnid, d in pairs(n.links) do -- first, get any private links that exist from the current node
      if d.type == 'private' then
      if otherCount == 1 and privateCount == count - 1 then
        for lnid, d in pairs(n.links) do
          if d.type ~= 'private' then -- processes non-private segment due to it being the only one compared to the other links
      elseif privateCount >= 1 and otherCount >= 1 then
        for lnid, d in pairs(n.links) do
          if d.type == 'private' then
  local numOfEdges = 0
  for n1id, n1 in pairs(map.nodes) do
    noOfNodes = noOfNodes + 1
    local degree = 0
    for n2id, data in pairs(n1.links) do
      if n1id ~= n2id then
  visualLog = {}
  for nid, n in pairs(map.nodes) do
    local linksize = tableSize(n.links)
--   local maxColorCode = 0
--   for nodeId, node in pairs(mapNodes) do
--     if node.junction then
--   local dist = {}
--   for k, v in pairs(mapNodes) do
--     if v.debugColorCode then

--   for nodeId, node in pairs(mapNodes) do
--     if node.debugColorCode then node.debugColorCode = node.debugColorCode / maxColorCode end
  local colorCode = -1 -- initialize color code (-- TODO: can we get something from random initialization?)
  for nodeId, node in pairs(mapNodes) do
    if node.junction then
  local dist = {}
  for k, v in pairs(mapNodes) do
    if v.debugColorCode then
  numOfColorCodes = 1 / (numOfColorCodes-1)
  for nodeId, node in pairs(mapNodes) do
    if node.debugColorCode then node.debugColorCode = node.debugColorCode * numOfColorCodes end
  local nodeDrivabilities = {}
  for k, n in pairs(mapNodes) do
    nodeDrivabilities[k] = be:getTerrainDrivability(n.pos, n.radius)

  for nid, n in pairs(mapNodes) do -- edges are now single sided
    local nPos = n.pos
    edgeTab[1] = nid
    for lid, data in pairs(n.links) do
      local edgeDrivability = min(1, max(1e-30, (nodeDrivabilities[lid] + nidDrivability) * 0.5 * data.drivability))
  if not customMapNodes then
    for nodeName, v in pairs(manualWaypoints) do
      if mapNodes[nodeName] == nil or gp.graph[nodeName] == nil then
  local minX, minY, maxX, maxY = math.huge, math.huge, -math.huge, -math.huge
  for nid, n in pairs(m.nodes) do
    local pos = n.pos - terrainPosition
  if includeLinks then
    for nid, n in pairs(m.nodes) do
      for lid, dif in pairs(n.links) do
    for nid, n in pairs(m.nodes) do
      for lid, dif in pairs(n.links) do
        local p1 = n.pos - terrainPosition
    local nodes = svg.Group()
    for nid, n in pairs(m.nodes) do
      local p = n.pos - terrainPosition
      end
      for node2id, edgeData in pairs(node.links) do
        if node.junction then
local function onFilesChanged(files)
  for _,v in pairs(files) do
    if v.filename == mapFilename then
    be:sendToMailbox("updateDrivabilities", lpack.encodeBinWorkBuffer(changeSet)) -- mailbox is cleared when map is loaded
    for objId, _ in pairs(M.objects) do
      be:queueObjectLua(objId, "mapmgr.updateDrivabilities()")
local function getState()
  for k, v in pairs(M.objectNames) do
    if type(k) == 'string' then
  end
  for k, v in pairs(M.objects) do
    v.name = v.name or ''
@/lua/vehicle/powertrain/torsionReactor.lua
  device.torqueReactionNodes = {}
  for _, v in pairs(jbeamData.torqueReactionNodes_nodes or {}) do
    if type(v) == "number" then
@/lua/ge/extensions/flowgraph/modules/fileModule.lua
function C:afterTrigger()
  for file, _ in pairs(self.changed) do
    local p = savePath .. file .. ext
@/lua/common/extensions/ui/imguiUtils.lua
  if imgui.BeginPopup(label) then
    for k, item in pairs(items) do
      local lbl = item.label .. "###" .. label .. tostring(k)
  if imgui.BeginPopup(label) then
    for k, item in pairs(items) do
      local curX = imgui.GetCursorPosX()
  if imgui.BeginPopup(label.."rmb") then
    for k, item in pairs(itemsRMB) do
      if imgui.SmallButton(item.label.."##") then
  if imgui.BeginPopup(label) then
    for k, item in pairs(items) do
      if excludeCurrent then
  if tbl then
    for k,v in pairs(tbl) do
      if type(v) ~= 'table' then
  local tableType = 0
  for _, tv in pairs(t) do
    if type(tv) == 'table' then
  local sortedKeys = {}
  for k in pairs(t) do table.insert(sortedKeys, k) end
  table.sort(sortedKeys)
@/lua/ge/extensions/gameplay/rally/notebook/path.lua
      local sp = tc:getSystemPacenotes()
      for key,val in pairs(sp) do
        for i,variant in ipairs(val) do
  local stage3 = {}
  for k,v in pairs(stage2) do
    table.insert(stage3, v)
  local wps = {}
  for i,pacenote in pairs(self.pacenotes.objects) do
    for j,wp in pairs(pacenote.pacenoteWaypoints.objects) do
  for i,pacenote in pairs(self.pacenotes.objects) do
    for j,wp in pairs(pacenote.pacenoteWaypoints.objects) do
      wps[wp.id] = wp
function C:getWaypoint(wpId)
  for i, pacenote in pairs(self.pacenotes.objects) do
    for i, waypoint in pairs(pacenote.pacenoteWaypoints.objects) do
  for i, pacenote in pairs(self.pacenotes.objects) do
    for i, waypoint in pairs(pacenote.pacenoteWaypoints.objects) do
      if waypoint.id == wpId then
  local lang_set = {}
  for _, codriver in pairs(self.codrivers.objects) do
    if not lang_set[codriver.language] then
  local languages = {}
  for lang, codrivers in pairs(lang_set) do
    table.insert(languages, { language = lang , codrivers = codrivers })
function C:setAllRadii(newRadius, wpType)
  for i, pacenote in pairs(self.pacenotes.objects) do
    pacenote:setAllRadii(newRadius, wpType)
function C:allToTerrain()
  for i, pacenote in pairs(self.pacenotes.objects) do
    pacenote:allToTerrain()
@/lua/ge/extensions/editor/flowgraph/main.lua
  end
  for k, node in pairs(graph.nodes) do
    local status, err, res = xpcall(node.draw, debug.traceback, node, builder, style, drawType)
  local hiddenLinks = {}
  for _, link in pairs(graph.links) do
    if link.hidden then
    end
    for _,gr in pairs(self.mgr.graphs) do table.insert(allGraphs, gr) end
    -- graph tabs
                local nIds, boxes = {}, {}
                for _, g in pairs(self.mgr.graphs) do
                  for nid, _ in pairs(g.nodes) do
                for _, g in pairs(self.mgr.graphs) do
                  for nid, _ in pairs(g.nodes) do
                    local box = math.ceil(nid/100)
          -- DBEUG: draw all graphs:
          --for _, g in pairs(self.mgr.graphs) do self:drawGraph(g, builder, style) end
          -- draw current graph only:
            local lnks = {}
            for _, gr in pairs(self.mgr.graphs) do
              drawnThisFrame = false
              self:drawGraph(gr, builder, style)
              for k, node in pairs(gr.nodes) do
                for pinName, pin in pairs(node.pinInLocal) do
              for k, node in pairs(gr.nodes) do
                for pinName, pin in pairs(node.pinInLocal) do
                  if pin.type ~= "flow" then
                  else
                    for fName, flowPin in pairs(node._mInFlow[pinName] or {}) do
                      table.insert(lnks,{pin.id, flowPin.id, true})
            if globIn and globOut then table.insert(lnks,{globIn,globOut,true}) end
            for i,lnk in pairs(lnks) do
               ui_flowgraph_editor.Link(9999999+i, lnk[1],lnk[2], lnk[3] and virtualFlowPinLinkCol or virtualPinLinkCol,15, false, "...")

          --for _, node in pairs(gr.nodes) do
          --  node:overDraw()
              if self.fgEditor.delayedHistorySnapshot == nil and ui_flowgraph_editor.IsActive() then
                for _, node in pairs(graph.nodes) do
                  node:updateNodePosition()
      -- get unique names with their types
      for _, node in pairs(self.mgr.graph.nodes) do
        for _, p in pairs(node.pinList) do
      for _, node in pairs(self.mgr.graph.nodes) do
        for _, p in pairs(node.pinList) do
          if p.quickAccess and p.direction ~= pin.direction then
      self.quickConnectSortedNames = {}
      for name,_ in pairs(self.quickConnectPins) do
        table.insert(self.quickConnectSortedNames, name)
        local ffiName = ffi.string(self.quickAccessTextfield)
        for _, node in pairs(self.mgr.graph.nodes) do
          for _, p in pairs(node.pinList) do
        for _, node in pairs(self.mgr.graph.nodes) do
          for _, p in pairs(node.pinList) do
            if p.direction == pin.direction and p.quickAccess and p.accessName == ffiName then
        local lnkRemove = nil
        for _, lnk in pairs(self.mgr.graph.links) do
          if lnk.sourcePin == pin and lnk.targetPin == other or lnk.sourcePin == other and lnk.targetPin == pin then
                local toDelete = nil
                for _, lnk in pairs(self.mgr.graph.links) do
                  if lnk.targetPin.id == pin.id then
                local toDelete = nil
                for _, lnk in pairs(self.mgr.graph.links) do
                  if lnk.targetPin == other then
@/lua/ge/extensions/scenario/busdriver.lua
  -- clamp all stats
  for k,v in pairs(result) do
    result[k].fill = clamp(v.fill, 0,100)
    if #markers == 0 then
      for k,v in pairs(nameMarkers) do
        local mk = scenetree.findObject(v)
    local mapData = map.getMap()
    for k, v in pairs(currentLine.navhelp) do
      for _, wp in pairs(v) do
    for k, v in pairs(currentLine.navhelp) do
      for _, wp in pairs(v) do
        if not mapData.nodes[wp] then
  -- if bext.y*1.25 < w then w = bext.y*1.25 end
  for k,marker in pairs(markers)do
    if k == 1 then --top left
local function isTriggerOnBusLine(tasks,tname)
  for k,v in pairs(tasks) do
    if v[1] == tname then return true end
      if currentLine.navhelp then
        for k,v in pairs(currentLine.navhelp) do --reset passedWp because of navhelp
          for i2,v2 in ipairs(v) do
@/lua/ge/extensions/flowgraph/nodes/career/menuClosed.lua
  self.pinOut.menuClosed.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/vehicle/extensions/perfectLaunch.lua
    local peakSlipError = 0
    for _, wheel in pairs(wheels.wheels) do
      if wheel.hasDiffAttached then
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveTorsionBars.lua
  torsionBars = {}
  for _, b in pairs(v.data.torsionbars) do
    if b.name then
    if b.name then
      for _, name in pairs(torsionBarNames) do
        if b.name == name then
  torsionBarModes = {}
  for _, mode in pairs(modeData) do
    torsionBarModes[mode.name] = {
@/lua/ge/extensions/gameplay/traffic/roles/suspect.lua
    local policeIds = {}
    for id, veh in pairs(gameplay_police.getPoliceVehicles()) do
      if not veh.role.flags.pursuit and not veh.role.flags.reset then -- only available police vehicles
@/lua/common/jbeam/scaling.lua
  local stack = {}
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" and tableIsDict(entry) and not jbeamUtils.ignoreSections[keyEntry] then
        local data = stack[stackidx]
        for key, v in pairs(data) do
          local typev = type(v)
@/lua/common/jbeam/sectionMerger.lua
  -- add the source keys to target
  for k, v in pairs(vehicle[sectionNameSource]) do
    if vehicle[sectionNameTarget][k] then
@/lua/ge/extensions/editor/flowgraph/variables.lua
  local ret = {}
  for id, gr in pairs(graph:getChildren()) do
      table.insert(ret,gr)
  local ret = {}
  for id, gr in pairs(source) do
    if gr.parentId == nil then
@/lua/ge/extensions/editor/aiViz.lua
  local res
  for nid, _ in pairs(nodes) do
    if distances[nid] < min or not res then
  -- remove all nodes that are too far away
  for otherNid, data in pairs(mapNodes) do
    if data.pos:squaredDistance(node.pos) > square(maxConnectionRenderDistance) then
      -- remove the links
      for otherNid2, _ in pairs(data.links) do
        if nodesToCheck[otherNid2] then

    for neighbor, otherLinkData in pairs(nextNodeData.links) do
      if nodesToCheck[neighbor] and otherLinkData.inNode == nextNid then
  -- Add distances to the links that are close enough, but not on any shortest route from any node
  for otherNid, data in pairs(mapNodes) do
    if distancesOfLinks[otherNid] then
    if distancesOfLinks[otherNid] then
      for neighbor, linkData in pairs(data.links) do
        if distancesOfLinks[neighbor] and not distancesOfLinks[otherNid][neighbor] then
  -- map.nodes is single sided i.e. edge between nodes a, b is either in map.nodes[a].links[b] or map.nodes[b].links[a] but not both
  for lid, data in pairs(n.links) do
    if mapNodes[lid] then
      if mapNodes then
        for nid, n in pairs(mapNodes) do
          local nPos = n.pos

        for otherNid, link in pairs(node.links) do
          if link.inNode == nid then
  drawMode = nil
  for k, v in pairs(drawModes) do
    if v then drawMode = k end
  if enabled then
    for k, v in pairs(drawModes) do
      drawModes[k] = false
@/lua/vehicle/energyStorage/n2oTank.lua

  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
  --apply final weight as soon as possible
  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
  if jbeamData.nodes and jbeamData.nodes._engineGroup_nodes then
    for _, n in pairs(jbeamData.nodes._engineGroup_nodes) do
      storage.nodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the node weights
  --apply final weight as soon as possible
  for k, v in pairs(storage.nodes) do
    obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
@/lua/ge/extensions/ui/gameplayAppContainers.lua
    local container = appContainersById[containerId]
  for appId, app in pairs(container.apps) do
    app.visible = false
  local visibleApps = {}
  for appId, app in pairs(container.apps) do
    if app.visible then
  local data = {}
  for containerId, container in pairs(appContainersById) do
    data[containerId] = {}
    data[containerId] = {}
    for appId, app in pairs(container.apps) do
      data[containerId][appId] = app.visible
local function onDeserialize(data)
  for containerId, apps in pairs(data) do
    for appId, visible in pairs(apps) do
  for containerId, apps in pairs(data) do
    for appId, visible in pairs(apps) do
      setAppVisibility(containerId, appId, visible)
  local apps = {}
  for appId, app in pairs(appContainersById[containerId].apps) do
    apps[appId] = app

    for containerId, container in pairs(appContainersById) do
      im.Text("Container: " .. containerId)
      if im.Button("Show All##" .. containerId) then
        for appId, _ in pairs(container.apps) do
          showApp(containerId, appId)
@/lua/ge/extensions/gameplay/crawl/debug.lua
  if debugData.completedPathnodes then
    for _ in pairs(debugData.completedPathnodes) do
      debugData.completedCount = debugData.completedCount + 1
    if allStates then
      for crawlerId, state in pairs(allStates) do
        if state and state.active then
@/lua/ge/extensions/gameplay/drag/dragTypes/bracketRace.lua
  if dragData.racers then
    for _,racer in pairs(dragData.racers) do
      table.insert(dials, {vehId = racer.vehId, dial = racer.timers.dial.value})
  dragData = dData
  for _, racer in pairs(dragData.racers) do
    racer.currentPhase = pIndex
    local isActivityFinished = true
    for vehId, racer in pairs(dragData.racers) do
      if not racer.isFinished then
    local dependenciesCompleted = true
    for _, r in pairs(dragData.racers) do
      if not r.phases[r.currentPhase].completed then
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua

      for nodeName, nodeData in pairs(mapData.nodes) do
        if nodeData.pos then
@/lua/common/libs/LuLPeg/lulpeg.lua
    acc[#acc+1] = "{\n"
    for k, v in pairs( tbl ) do
        local str_indent = 1
    local res = {}
    for k,v in pairs(t1) do
        res[k] = {v, t2[k]}
    end
    for k,v in pairs(t2) do
        if res[k] == nil then
    for i = 1, select('#', ...) do
        for k,v in pairs((select(i, ...))) do
            destination[k] = v
    local function checkpatterns(g)
        for k,v in pairs(g.aux) do
            if not LL_ispattern(v) then
function add_elements(a, res)
    for k in pairs(a) do res[k] = true end
    return res
         , (type(b) == "number") and set_new{b} or b
    for el in pairs(a) do
        if a[el] and not b[el] then
    local list = {}
    for el in pairs(s) do
        t_insert(list,el)
        print(offset..prefix.."Grammar")
        for k, pt in pairs(pt.aux) do
            local prefix = ( type(k)~="string"
if Builder.proxymt then
    for k, v in pairs(LL) do
        if k:match"^__" then
@/lua/vehicle/controller/pneumatics.lua
    local maxPressureDiff = 0
    for _, v in pairs(groupData.beams) do
      local oldTarget = v.targetPressure
local function setBeamGroupsPressureRaw(groupNames, pressure)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
    local maxPressureDiff = 0
    for _, v in pairs(groupData.beams) do
      local oldTarget = v.targetPressure
local function setBeamGroupsPressureLevel(groupNames, pressureName)
  for _, g in pairs(groupNames) do
    setBeamGroupPressureLevel(g, pressureName)
local function toggleBeamGroupsMinMax(groupNames)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
      local isMax = true
      for _, v in pairs(groupData.beams) do
        isMax = isMax and abs(v.targetPressure - v.maxPressure) < 0.1
local function setBeamGroupsMomentaryIncrease(groupNames, enabled)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
local function setBeamGroupsMomentaryDecrease(groupNames, enabled)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
    local isAtLevel = true
    for _, v in pairs(groupData.beams) do
      isAtLevel = isAtLevel and v.currentPressure == v[levelName]
local function updateGFX(dt)
  for _, g in pairs(beamGroups) do
    local isFinishedChangingPressure = true -- used to check if we should stop the sound based on pressure change
    local avgVelocity = 0
    for _, v in pairs(g.beams) do
      if g.momentaryIncrease then
local function reset()
  for _, g in pairs(beamGroups) do
    for _, v in pairs(g.beams) do
  for _, g in pairs(beamGroups) do
    for _, v in pairs(g.beams) do
      v.targetPressure = v.defaultPressure
  if jbeamData.pressureLevels then
    for _, v in pairs(tableFromHeaderTable(jbeamData.pressureLevels)) do
      pressureLevels[v.name] = v.pressure
  local pressuredBeamNames = {}
  for _, v in pairs(pressureBeamData) do
    local name = v.beamName
  beamGroups = {}
  for _, pressureData in pairs(pressureBeamData) do
    local name = pressureData.beamName

    for k, v2 in pairs(pressureData) do
      local pressureStart = k:find("Pressure")

      for k, v in pairs(beamPressureLevels) do
        beamData[k] = v

  for _, v in pairs(pressureBeamSoundData) do
    local groupData = beamGroups[v.groupName]
local function resetSounds()
  for _, g in pairs(beamGroups) do
    if g.soundLoopUp then
@/lua/vehicle/damageTracker.lua
  local hasActiveTimeouts = false
  for group, names in pairs(temporaryDamageTimeoutTracker) do
    for name, data in pairs(names) do
  for group, names in pairs(temporaryDamageTimeoutTracker) do
    for name, data in pairs(names) do
      data.timeout = data.timeout - dt
@/lua/ge/extensions/editor/sensorDebugger.lua
  local camData = tech_cameraPreview.getCamData()
  for id, cam in pairs(camData) do
    if not cam.visualize[0] then
  local camData = tech_cameraPreview.getCamData()
  for id, cam in pairs(camData) do
    if cam.visualize[0] then
    end
    for id, cam in pairs(camData) do
      im.Text(tech_sensors.getCameraSensorName(cam.id))
@/lua/vehicle/props.lua
      local breakGroups = type(prop.breakGroup) == "table" and prop.breakGroup or {prop.breakGroup}
      for _, g in pairs(breakGroups) do
        if type(g) == "string" and g ~= "" then
      local deformGroups = type(prop.deformGroup) == "table" and prop.deformGroup or {prop.deformGroup}
      for _, g in pairs(deformGroups) do
        if type(g) == "string" and g ~= "" then
@/lua/ge/extensions/tech/sumoExporter.lua
  local children = {}
  for k, v in pairs(node) do
    if type(v) == 'table' then
local function doesCollectionContainSegment(collection, testSeg)
  for _, trialSeg in pairs(collection) do
    local matches = 0
    local matches = 0
    for _, v1 in pairs(trialSeg) do
      for _, v2 in pairs(testSeg) do
    for _, v1 in pairs(trialSeg) do
      for _, v2 in pairs(testSeg) do
        if v1 == v2 then

  for headKey, _ in pairs(graph) do
    local successors = getChildren(graph[headKey])
    local successors = getChildren(graph[headKey])
    for childKey, _ in pairs(successors) do
      local currentPath = { headKey }
        local allVisited = true
        for k, _ in pairs(nextSuccessors) do
          if not doesSegmentContainKey(currentPath, k) then
        local found = false
        for k, _ in pairs(nextSuccessors) do
          if not doesSegmentContainKey(currentPath, k) then
  local id = 0
  for k, v in pairs(coords3d) do
    keysToNodeMap[k] = k
@/lua/ge/extensions/editor/api/object.lua
  local objs = scenetree.getAllObjects()
  for _, objName in pairs(objs) do
    local obj = scenetree.findObject(objName)
  local fieldData = {}
  for fieldName, data in pairs(fields) do
    fieldData[data.id] = data
        for i = 0, data.elementCount - 1 do
          for arrayFieldName, arrayField in pairs(data.fields) do
            local value = editor.getFieldValue(objectID, arrayFieldName, i)
  if fields.fields then
    for fieldName, value in pairs(fields.fields) do
      editor.setFieldValue(targetObjectID, fieldName, value)
  if fields.dynamicFields then
    for fieldName, value in pairs(fields.dynamicFields) do
      editor.setDynamicFieldValue(targetObjectID, fieldName, value)
  if fields.fields then
    for fieldName, value in pairs(fields.fields) do
      targetObject:setField(fieldName, 0, value)
  if fields.dynamicFields then
    for fieldName, value in pairs(fields.dynamicFields) do
      targetObject:setDynDataFieldbyName(fieldName, 0, value)
  local newSelection = {}
  for _, objName in pairs(objects) do
    if string.find(objName, nameMask) then
  local newSelection = {}
  for _, objName in pairs(objects) do
    --TODO: cant we get the object refs and not the names? faster
@/lua/ge/extensions/util/trackBuilder/segmentToProceduralMesh.lua
  local meshes = {}
  for _,m in pairs(basicBorders.getMeshes(segment))    do meshes[#meshes+1] = m end
  for _,m in pairs(basicCenters.getMeshes(segment))    do meshes[#meshes+1] = m end
  for _,m in pairs(basicBorders.getMeshes(segment))    do meshes[#meshes+1] = m end
  for _,m in pairs(basicCenters.getMeshes(segment))    do meshes[#meshes+1] = m end
  for _,m in pairs(borderWall.getMeshes(segment))      do meshes[#meshes+1] = m end
  for _,m in pairs(basicCenters.getMeshes(segment))    do meshes[#meshes+1] = m end
  for _,m in pairs(borderWall.getMeshes(segment))      do meshes[#meshes+1] = m end
  for _,m in pairs(ceilingMesh.getMeshes(segment))     do meshes[#meshes+1] = m end
  for _,m in pairs(borderWall.getMeshes(segment))      do meshes[#meshes+1] = m end
  for _,m in pairs(ceilingMesh.getMeshes(segment))     do meshes[#meshes+1] = m end
@/lua/ge/extensions/gameplay/drift/scoreboard.lua
local function populateTierNames()
  for _, tierData in pairs(gameplay_drift_scoring.getDriftTiers()) do
    tiersAndScore[tierData.id] = {totalScore = 0, count = 0, name = tierData.name, order = tierData.order}
local function populateQuickMessagesNames()
  for quickMessageId, quickMessageData in pairs(gameplay_drift_quickMessages.getQuickMessages()) do
    quickMessages[quickMessageId] = {count = 0, totalScoreEarned = 0, msg = quickMessageData.msg}

  for quickMessageId, quickMessageData in pairs(quickMessagesToBeConfirmed) do
    local qmScoreEarnedWithMulti = quickMessageData.totalScoreEarned * data.combo
  -- translate all at once
  for name, data in pairs(compiledStats) do
    data.name = translateLanguage("missions.drift.stats."..name, "missions.drift.stats."..name, true)
@/lua/ge/extensions/editor/rallyEditor.lua

  for _,win in pairs(windows) do
    win:setPath(currentPath)
  local files = FS:findFiles(notebooksFullPath, '*.notebook.json', -1, true, false)
  for _,fname in pairs(files) do
    table.insert(paths, fname)
@/lua/ge/extensions/editor/gen/ui.lua
	if editor.texObj then
		for key,p in pairs(aicon) do
--                U.dump(aicon[key], '?? for_icon:'..tostring(aicon[key]))
local function buttonSelector(list, cb)
	for i,v in pairs(list) do
		im.SameLine()
						local adsc = W.forSel()
						for _,dsc in pairs(adsc) do
							W.conform(dsc)
		im.Dummy(im.ImVec2(0, 0))
		for k,s in pairs({'rectangle','hexagon','corner_cut','u_shape','t_shape','x_shape'}) do
--        for k,s in pairs(ashape) do
		for k,s in pairs({'rectangle','hexagon','corner_cut','u_shape','t_shape','x_shape'}) do
--        for k,s in pairs(ashape) do
			local c = W.ui.building_shape == s and im.ImVec4(0.6, 1.0, 0, 0.6) or colorList
			columnRight(174)
				for k,s in pairs({'b_shape', 'l_shape','t_shape','p_shape','s_shape'}) do
					local c = W.ui.building_shape == s and im.ImVec4(0.6, 1.0, 0, 0.6) or colorList

			for i,t in pairs({'Building', 'Floor', 'Wall', 'Side', 'Top'}) do
--            for i,t in pairs({'Building', 'Floor', 'Side', 'Wall', 'Top'}) do
			for i,t in pairs({'Building', 'Floor', 'Wall', 'Side', 'Top'}) do
--            for i,t in pairs({'Building', 'Floor', 'Side', 'Wall', 'Top'}) do
				if U._PRD == 1 then
		local mlist
--		for _,tp in pairs({'win','door','storefront','stairs','corner','stringcourse','balcony','pillar','pilaster'}) do
		for _,tp in pairs({'win','door','storefront','stairs','corner','stringcourse','balcony','pillar','pilaster','roofborder','plinth','gutter'}) do
--		for _,tp in pairs({'win','door','storefront','stairs','corner','stringcourse','balcony','pillar','pilaster'}) do
		for _,tp in pairs({'win','door','storefront','stairs','corner','stringcourse','balcony','pillar','pilaster','roofborder','plinth','gutter'}) do
			if W.ui.dbg then
			local selected = W.out.curselect or 0
			for i,s in pairs(list) do
				list[i] = tostring(list[i])
				-- render list
				for o,s in pairs(list) do
		--            lo('?? for_mat:'..tostring(s))
			color = im.ImVec4(0.7, 0.7, 0.75, 1) -- colorList
			for _,s in pairs({'flat','pyramid','shed','gable'}) do
				color = W.ifRoof(s) and im.ImVec4(0.7, 0.7, 0.75, 1) or colorOff
			else
--                for _,s in pairs({'flat', 'gable'}) do
			end

				for _,s in pairs({'flat','pyramid','shed','gable'}) do
					if not scope then break end
								local adsc = W.forSel()
								for _,dsc in pairs(adsc) do
									W.conform(dsc)
								local adsc = W.forSel()
								for _,dsc in pairs(adsc) do
									W.conform(dsc)
			local selected = W.out.curmselect or 0
			for i,s in pairs(mlist) do
				mlist[i] = tostring(mlist[i])

								for k,s in pairs({'b_shape', 'l_shape','t_shape','p_shape','s_shape'}) do
									local c = W.ui.building_shape == s and im.ImVec4(0.6, 1.0, 0, 0.6) or colorList
		local padding = 2
		for i,row in pairs(HTree) do
--            im.Indent(10)
				local nextline = false
				for _,c in pairs(row) do
					if _ == 1 then
		local toupdate = false
		for k,v in pairs(SCNow) do
			if SCPre[k] ~= SCNow[k] then
	local padding = 2
	for i,row in pairs(htree) do
--            im.Indent(10)
			local nextline = false
			for _,c in pairs(row) do
				if _ == 1 then
@/lua/ge/extensions/flowgraph/nodes/career/customTowAction.lua
  self.pinOut.tow.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/flowgraph/nodes/util/file/loadData.lua
  if self.pinIn.file.value then
    for name, pin in pairs(self.pinOut) do
      if name ~= 'flow'then
@/lua/ge/extensions/editor/dynamicDecals/loadSave.lua
  tblx = {}
  for _, mode in pairs(api.loadingModes) do
    table.insert(tblx, mode.key)
@/lua/ge/extensions/editor/multiSpawnManager.lua
  local sorted = {}
  for _, v in pairs(t) do
    table.insert(sorted, v)
  currGroup.generator = generatorData or deepcopy(defaultGenerator)
  for k, v in pairs(currGroup.generator) do
    if k == "amount" then

  for k, v in pairs(timedTexts) do
    if v[2] then
@/lua/common/testFramework/TestManager.lua
    local testNames = {}
    for name, func in pairs(tests) do
      if type(func) == "function" and name:match("^test") then
@/lua/ge/extensions/editor/util/editorElementHelper.lua
    table.sort(sortedKeys)
    for _, key in pairs(sortedKeys) do
      if key ~= "fieldName" and string.startswith(key, "fieldName") then
      -- find all field with fieldname
      for _, key in pairs(sortedKeys) do
        if key ~= "fieldName" and string.startswith(key, "fieldName") then
  C.__index = C
  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/ge/extensions/flowgraph/nodes/states/transitionStack.lua
  if self._stack then
    for name, pin in pairs(self.pinOut) do
      self.pinOut[name].value = self._stack[name]
      -- collect the in-pins of this node
      for name, pin in pairs(node.pinInLocal) do
        if name ~= 'flow' then
      -- collect the out-pins of this node
      for name, pin in pairs(node.pinOut) do
        if name ~= 'flow' then
  self._pinTemplates = {_in = {}, _out = {}}
  for name, type in pairs(pins) do  table.insert(self._pinTemplates._in,  {name = name, type = type}) end
  table.sort(self._pinTemplates._in,  function(a,b) return a.name < b.name end)
@/lua/ge/extensions/gameplay/missions/missionManager.lua

  for id, v in pairs(setupData.stashedVehicles) do
    if v == false and getObjectByID(id) then

  for id, v in pairs(setupData.stashedVehicles) do
    if v == true and getObjectByID(id) then
        local claimPrice = {}
        for att, amount in pairs(price) do
          claimPrice[att] = {amount = amount}
@/lua/ge/extensions/editor/camPathEditor.lua
local function changeMarkerFieldActionRedo(actionData)
  for index, values in pairs(actionData.markerValues) do
    actionData.path.markers[index][actionData.field] = values.new
local function changeMarkerFieldActionUndo(actionData)
  for index, values in pairs(actionData.markerValues) do
    actionData.path.markers[index][actionData.field] = values.old
@/lua/vehicle/extensions/tech/CANBus/ButtonBox.lua
local function emitInputs()
  for buttonName, buttonValue in pairs(hardwareState.buttons) do
    if lastHardwareState.buttons[buttonName] ~= buttonValue then

  for axisName, axisValue in pairs(hardwareState.axes) do
    if lastHardwareState.axes[axisName] ~= axisValue then
@/lua/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
  local totalMaxBrakeTorque = 0
  for _, wd in pairs(wheels.wheels) do
    totalMaxBrakeTorque = totalMaxBrakeTorque + wd.brakeTorque * (wd.brakeInputSplit + (1 - wd.brakeInputSplit) * wd.brakeSplitCoef)
    local totalBrakeTorque = 0
    for _, wd in pairs(wheels.wheels) do
      totalBrakeTorque = totalBrakeTorque + wd.brakeTorque * (min(brakeCoef, wd.brakeInputSplit) + max(brakeCoef - wd.brakeInputSplit, 0) * wd.brakeSplitCoef)
    local totalRegenTorque = 0
    for _, motor in pairs(motors) do
      totalRegenTorque = totalRegenTorque + regenCoef * motor.maxRegenTorque * motor.cumulativeGearRatio
  automaticHandling.availableModeLookup = {}
  for _, v in pairs(automaticHandling.availableModes) do
    automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
  local values = {}
  for map, asset in pairs(bulkChange.textures) do
    if map == "b" then
          -- remove obsolete v1 fields from terrain materials
          for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
            mtl.material:setDiffuseMap("")
      if im.CollapsingHeader1("Terrain Materials", im.TreeNodeFlags_DefaultOpen) then
        for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
          if im.Selectable1(mtl.internalName .. "##Terrain Materials" .. id, name == mtl.internalName, nil,
local function showTerrainMaterialsEditor(internalName)
  for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
    if mtl.internalName == internalName then
@/lua/ge/extensions/util/nodeStream.lua
  -- Process each flexbody and collect mapping parameters
  for flexKey, flexbody in pairs(vData.vdata.flexbodies) do
    local mappingData = {
@/lua/ge/extensions/editor/sitesEditor/locations.lua
  local closestNode = nil
  for idx, node in pairs(objects) do
    local distNodeToCam = (node.pos - mouseInfo.camPos):length()
@/lua/ge/extensions/core/audio.lua
  local reloadBanks = false
  for _,v in pairs(files) do
    local filename = v.filename
      -- We have to wait for all banks to complete building before we trigger hotloading
      for k,v1 in pairs(loadedBankCache) do
        if v1 == true then
@/lua/common/luaCore.lua
if not pcall(require, "table.clear") then
  table.clear = function(tab) for k, _ in pairs(tab) do tab[k] = nil end end
end
@/lua/ge/extensions/editor/meshEditor.lua
      local averagePos = vec3(0,0,0)
      for index,_ in pairs(selectedNodes) do
        averagePos = averagePos + selectedMesh:getNodePosition(index)
  local mesh = scenetree.findObjectById(actionData.meshID)
  for index, oldWidth in pairs(actionData.oldWidths) do
    editor.setNodeWidth(mesh, index, oldWidth)
  local mesh = scenetree.findObjectById(actionData.meshID)
  for index, _ in pairs(actionData.oldWidths) do
    editor.setNodeWidth(mesh, index, actionData.newWidth)
  local mesh = scenetree.findObjectById(actionData.meshID)
  for index, oldDepth in pairs(actionData.oldDepths) do
    editor.setNodeDepth(mesh, index, oldDepth)
  local mesh = scenetree.findObjectById(actionData.meshID)
  for index, _ in pairs(actionData.oldDepths) do
    editor.setNodeDepth(mesh, index, actionData.newDepth)
        local displayedWidth
        for index,_ in pairs(selectedNodes) do
          local width = selectedMesh:getNodeWidth(index)
      local oldWidths = {}
      for index,_ in pairs(selectedNodes) do
        oldWidths[index] = selectedMesh:getNodeWidth(index)
        local displayedDepth
        for index,_ in pairs(selectedNodes) do
          local depth = selectedMesh:getNodeDepth(index)
      local oldDepths = {}
      for index,_ in pairs(selectedNodes) do
        oldDepths[index] = selectedMesh:getNodeDepth(index)
  if selectedMesh then
    for id, _ in pairs(selectedNodes) do
      originalWidths[id] = selectedMesh:getNodeWidth(id)
  if editor.getAxisGizmoMode() == editor.AxisGizmoMode_Translate then
    for id, _ in pairs(selectedNodes) do
      local position = originalPositions[id] + (editor.getAxisGizmoTransform():getColumn(3) - originalGizmoPos)
    local euler = editor.getAxisGizmoTransform():toQuatF():toEuler()
    for id, _ in pairs(selectedNodes) do
      rotateAround(selectedMesh, id, euler, editor.getAxisGizmoTransform():getColumn(3))
  elseif editor.getAxisGizmoMode() == editor.AxisGizmoMode_Scale then
    for id, _ in pairs(selectedNodes) do
      editor.setNodeWidth(selectedMesh, id, originalWidths[id] + (editor.getAxisGizmoScale().x - 1))
    local newDepths = {}
    for id, _ in pairs(selectedNodes) do
      table.insert(nodeIDs, id)
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
  local reputationRewards = {}
  for rewardKey, rewardValue in pairs(originalRewards) do
    if rewardKey:endswith("Reputation") then
    partsBreakdown.rewards = {money = -origMoney}
    for rewardKey, rewardValue in pairs(reputationRewards) do
      partsBreakdown.rewards[rewardKey] = -2 * rewardValue
    partsBreakdown.rewards = {money = -(1-brokenPartsMultipler)*origMoney}
    for rewardKey, rewardValue in pairs(reputationRewards) do
      partsBreakdown.rewards[rewardKey] = -(1-brokenPartsMultipler) * rewardValue
        local rewards = {money=origMoney*0.15+10}
        for rewardKey, rewardValue in pairs(reputationRewards) do
          rewards[rewardKey] = math.ceil(rewardValue*0.125)
      local rewards = {money=origMoney*0.15+10}
      for rewardKey, rewardValue in pairs(reputationRewards) do
        rewards[rewardKey] = math.ceil(rewardValue*0.125)

  for organizationId, _ in pairs(taskData.loanerOrganisations or {}) do
    local organization = freeroam_organizations.getOrganization(organizationId)
  for _, bd in ipairs(breakdown) do
    for key, amount in pairs(bd.rewards) do
      adjustedRewards[key] = (adjustedRewards[key] or 0) + amount
  for _, taskData in ipairs(vehicleTasks) do
    for attKey, amount in pairs(M.getFineForAbandon(taskData)) do
      fine[attKey] = (fine[attKey] or 0) + amount
@/lua/common/graphpath.lua
  local i, edgeData = 0, table.new((edgeCount or 0) * 3, 0)
  for node1, links in pairs(self.graph) do
    for node2, linkData in pairs(links) do
  for node1, links in pairs(self.graph) do
    for node2, linkData in pairs(links) do
      if node1 > node2 then
    -- Consider succesors of node
    for adjNode, value in pairs(graph[node]) do
      if value.drivability == 1 then
    else -- get all scc of the map graph
      for node, _ in pairs(graph) do
        if nodeData[node] == nil then
  local isJunctionNode = {}
  for nid, n in pairs(graph) do
    if tableSize(n) ~= 2 then
  local graphMinor, visited = {}, {}
  for nid in pairs(graph) do
    if isJunctionNode[nid] then
      -- if there exist an edge to another junction/end node, add it to the minor graph
      for n2id in pairs(graph[nid]) do
        -- check if both n1id and n2id are junction nodes and also avoid including an edge twice
      if node == goal then break end
      for child, data in pairs(graph[node]) do
        if road[child] == nil then -- if the shortest path to child has not already been found
      edgeId[1] = fNode
      for child, data in pairs(graph[fNode]) do
        if child ~= bNode then -- a three way turn only makes sense to include at the start of the search, not mid way
      local parent = road[node]
      for child, data in pairs(graph[node]) do
        local edgeCost
      local parent = road[node]
      for child, edgeData in pairs(nodeLinks) do
        local edgeCost
      local linkCount = max(1, tableSize(graph[node]) - (minParent[node] and 1 or 0))
      for child, edgeData in pairs(graph[node]) do
        if road[child] == nil then
  table.clear(tab)
  for k, _ in pairs(graph[node]) do
    if road[k] == nil and road1[k] == nil then tab[k] = true end
        local linkCountCheck = next(gnode, linkCountGT1) or (not minParent[node] and not startMinParent and linkCountGT1) -- node has more than 2 neighboors or is start node with more than 1 neighboors (the only node without a minParent at this point is the start node)
        for child, edgeData in pairs(graph[node]) do
          if road[child] == nil and child ~= startMinParent then -- TODO: child ~= startMinParent -> in the case of a dead end it will not be able to turn back
        local linkCountCheck = next(gnode, linkCountGT1) or (not minParent1[node] and linkCountGT1) -- node has more than 2 neighboors or is start node with more than 1 neighboors
        for child, edgeData in pairs(graph[node]) do
          if not prevPathSet[child] and road1[child] == nil and road[child] == nil then
      if node == goal then break end
      for child, data in pairs(graph[node]) do
        if road[child] == nil then
      if node == target then break end
      for child, data in pairs(graph[node]) do
        if road[child] == nil then
      if node == goal then break end
      for child, data in pairs(graph[node]) do
        if road[child] == nil then
    if posNodeDist < radius * radius then
      for child, _ in pairs(graph[node]) do
        if visited[child] == nil then
      local childCount = 0
      for child, _ in pairs(graph[node]) do
        if visited[child] == nil then

    for child, link in pairs(graph[prevNode]) do
      local childPos = graphpos[child]

    for child, link in pairs(graph[prevNode]) do
      local pathVec = graphpos[child] - curPos
        local edgeDirVec = (positions[parent] - nodePos):normalized()
        for child, data in pairs(graph[node]) do
          if road[child] == nil then
@/lua/ge/extensions/editor/gen/region.lua
	local star = U.forStar(astem, adec)
	for i,s in pairs(star) do
		if s.rdi == ri and s.ndi == s.fr + dir then
		local vlist = parity == 1 and {abase[i][3 + ishift], abase[i][4 + ishift]} or {abase[i][4 + ishift], abase[i][3 + ishift]}
		for _,p in pairs(vlist) do
			prd,ni,s = p2side(p, side, side.fr)
				local asnxt = {aside[i % #aside + 1]}
				for _,sidenxt in pairs(asnxt) do
					local dplus = (i >= #aside - 1) and mm_depth[2] or 0
					local dplus = (i >= #aside - 1) and mm_depth[2] or 0
					for _,bc in pairs({base[2 + ishift], base[3 + ishift]}) do
						local prd = p2side(bc, sidenxt, sidenxt.fr)
				local dma = 0
				for _,p in pairs(list) do
					local prd,ni,s = p2side(p, side)
	out.apath = {}
	for _,b in pairs(abase) do
		out.apath[#out.apath + 1] = b
		local s = ''
		for _,a in pairs(acLen) do
			s = s..','..a
			asadj[#asadj + 1] = aside[i - 1]
			for _,sadj in pairs(asadj) do
				local anobjthem = editor.getNodes(scenetree.findObjectById(adec[sadj.rd].id))
	--- find closest edge
	for ind,r in pairs(adec) do
		for i = 1,#r.list-1 do
		local akey = {}
		for key,_ in pairs(across[rmi]) do
			akey[#akey+1] = key
		local ib,ie
		for i,key in pairs(akey) do
--                lo('?? for_key:'..key..'/'..nmi)

			for i,s in pairs(star) do
--                        U.dump(s, '?? for_stem:'..i)
				akey = {}
				for key,_ in pairs(across[stem.rdi]) do
					akey[#akey+1] = key
		out.avedit = {}
		for _,p in pairs(acorner) do
			out.avedit[#out.avedit + 1] = adec[p.rd].list[p.to]
	--- find closest edge
	for ind,r in pairs(adec) do
		for i = 1,#r.list-1 do
		local akey = {}
		for key,_ in pairs(across[rmi]) do
			akey[#akey+1] = key
		local ib,ie
		for i,key in pairs(akey) do
--                lo('?? for_key:'..key..'/'..nmi)

			for i,s in pairs(star) do
--                        U.dump(s, '?? for_stem:'..i)
			akey = {}
			for key,_ in pairs(across[stem.rdi]) do
				akey[#akey+1] = key
		out.avedit = {}
		for _,p in pairs(acorner) do
			out.avedit[#out.avedit + 1] = adec[p.rd].list[p.to]
	if not list then return end
	for _,p in pairs(list) do
		local r = rma * math.sqrt((p - core_camera.getPosition()):length())
	if out.apath ~= nil then
		for _,p in pairs(out.apath) do
			for i = 2,#p do
	local c = vec3(0,0,0)
	for _,p in pairs(base) do
		c = c + p
	local adist = {}
	for i,p in pairs(base) do
		local a,b = base[i] + desc.pos,base[i % #base + 1] + desc.pos
					local agrid = {}
					for _,a in pairs({-1,0,1}) do
						for _,b in pairs({-1,0,1}) do
					for _,a in pairs({-1,0,1}) do
						for _,b in pairs({-1,0,1}) do
							if i+a < 1 or i+a > gmax or j+b < 1 or j+b > gmax then
					local w
					for _,ij in pairs(agrid) do
--                                        if ij[1] == 101 and ij[2] == 101 then
											lo('?? for_NODE:'..ij[1]..':'..ij[2], true)
							for ind,dec in pairs(aref[ij[1]][ij[2]]) do
								local rd = adec[ind].list
			lo('?? obi:'..tostring(scenetree.findObjectById(desc.id)))
--        for _,s in pairs(dforest) do
--            editor.removeForestItem(fdata, s.item)
@/lua/ge/extensions/editor/missionEditor/progressMulti.lua

    for _,l in pairs(currentAggregatesByKey.labels) do
      im.TableSetupColumn(l)
    im.TableNextColumn()
    for _, missionData in pairs(currentAggregatesByKey.rows) do
      for _, c in pairs(missionData) do
    for _, missionData in pairs(currentAggregatesByKey.rows) do
      for _, c in pairs(missionData) do
        im.Text(c.text)
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/breakgroup.lua
  if groups then
    for _,g in pairs(groups) do
      veh:queueLuaCommand("beamstate.breakBreakGroup('" .. g .. "')")
@/lua/ge/extensions/ui/messagesTasksAppContainers.lua

  for _, app in pairs(container.apps) do
    app.visible = false
  local visibleApps = {}
  for appId, app in pairs(container.apps) do
    if app.visible then
  local apps = {}
  for appId, app in pairs(container.apps) do
    apps[appId] = app
  local data = {}
  for containerId, container in pairs(appContainersById) do
    data[containerId] = {}
    data[containerId] = {}
    for appId, app in pairs(container.apps) do
      data[containerId][appId] = app.visible

  for containerId, apps in pairs(data) do
    for appId, visible in pairs(apps) do
  for containerId, apps in pairs(data) do
    for appId, visible in pairs(apps) do
      setAppVisibility(containerId, appId, visible)

  for containerId, container in pairs(appContainersById) do
    im.Text("Container: " .. containerId)
    if im.Button("Show All##" .. containerId) then
      for appId, _ in pairs(container.apps) do
        showApp(containerId, appId)
@/lua/ge/extensions/editor/flowgraph/stateView.lua
  local states = {}
  for _, node in pairs(graph.nodes) do
    if node.nodeType == 'states/stateNode' and node.targetGraph and not node.targetGraph.isStateGraph then
  local children = {}
  for _, child in pairs(graph:getChildren()) do table.insert(children, child) end
  table.sort(children, function(a,b) return a.id
@/lua/ge/extensions/editor/preferences.lua

  for key, val in pairs(keys) do
    if preferencesPagesSortIndex[key] then
@/lua/vehicle/ai.lua
  local avgWheelNodePos, numOfWheels = vec3(), 0
  for _, wheel in pairs(wheels.wheels) do
    -- obj:getNodePosition is the pos vector of query node (wheel.node1) relative to ref node in world coordinates
  local avgBackWheelPos, backWheelCount = vec3(), 0
  for _, wheel in pairs(wheels.wheels) do
    local wheelPos = obj:getNodePosition(wheel.node1)
    else
      for k, v in pairs(mapmgr.objects) do
        if k ~= objectId then
    else
      for k, v in pairs(mapmgr.objects) do
        if k ~= objectId and v.active == true then
  local i = 0
  for id in pairs(mapmgr.getObjects()) do
    if id ~= objectId then
  local outEdgeDir, maxOutflow, minNode = vec3(), 0, nil
  for k, v in pairs(mapData.graph[wp2]) do
    if k ~= wp1 then

  for nodeId, edgeData in pairs(graph[newNode.id]) do
    if nodeId ~= newNode.nextNodeInPath and nodeId ~= prevNodeInPath then -- and not mapmgr.signalsData.nodes[newNode.id]
    local nextPosibleNode = nil
    for k, v in pairs(graph[newNode.id]) do
      if k ~= newNode.prevNodeInPath then
  table.clear(traffic.trafficTable)
  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then

  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then
    edgeDict = {}
    for nid, n in pairs(mapData.graph) do
      if currentSCC[nid] or not opt.driveInLaneFlag then
      if currentSCC[nid] or not opt.driveInLaneFlag then
        for lid, data in pairs(n) do
          if (currentSCC[lid] or not opt.driveInLaneFlag) and (data.drivability > cutOffDrivability) then

  for plID, v in pairs(mapmgr.getObjects()) do
    if plID ~= objectId and v.states then
          -- Check if there's a vehicle next to this one
          for otherID, v in pairs(mapmgr.getObjects()) do
            if otherID ~= objectId and v.pos and otherID ~= trafficStates.action.nearestPoliceId and v.dirVec and v.dirVec:dot(ego.dirVec) < 0 then
          if not giveWay and drivability < 1 then
            for _, edgeData in pairs(mapData.graph[nid1]) do
              if edgeData.drivability > drivability then
            if prevNode and tableSize(mapData.graph[nid1]) == 3 then
              for k, v in pairs(mapData.graph[nid1]) do
                if k ~= prevNode and k ~= nid2 then
            local distToJcenter = tSi.turnNode and ego.pos:distance(mapData.positions[tSi.turnNode]) or 1
            for vId, v in pairs(mapmgr.getObjects()) do
              if vId ~= objectId then
            -- get most distant non walked edge
            for k, v in pairs(edgeDict) do
              if v <= lim then
        local nodeDegree = 1
        for lid, _ in pairs(mapData.graph[target]) do
          -- we're looking for neighboring nodes other than the targetLink

      for vehId in pairs(mapmgr.getObjects()) do
        if vehId ~= objectId then

      for _, d in pairs(visDebug.debugSpots) do
        debugDrawer:drawSphere(0.2, d[1], d[2])
    if dt then
      for k, v in pairs(mapmgr.getObjects()) do
        if k ~= objectId then
    debugDrawer:drawSphere(0.1, refNodePos, color(255,0,0,255))
    for _, wheel in pairs(wheels.wheels) do
      local wheelRadius = wheel.radius
@/lua/ge/extensions/editor/sidewalkSpline/populate.lua
  meshPools[splineId] = meshPools[splineId] or {}
  for meshPath, neededCount in pairs(neededMeshes) do
    meshPools[splineId][meshPath] = meshPools[splineId][meshPath] or {}
  -- Delete meshes for paths that are no longer needed.
  for meshPath, pathPool in pairs(meshPools[splineId]) do
    if not neededMeshes[meshPath] then
  table.clear(counters)
  for meshPath, _ in pairs(neededMeshes) do
    counters[meshPath] = 1
  if meshPools[splineId] then
    for _, pathPool in pairs(meshPools[splineId]) do
      for i = #pathPool, 1, -1 do
@/lua/ge/extensions/editor/gen/render.lua
	if true then
		for _,pth in pairs(apath) do
			Render.path(pth, ColorF(c[1],c[2],c[3],c[4] or 1), w, true, z)
		local n = 0
		for _,pth in pairs(apath) do
			for i=1,#pth-1 do
	local campos = core_camera.getPosition()
	for _,pos in pairs(set) do
--			print('?? set:'..tostring(pos)..':'..tostring(campos)..':'..tostring(c))
	c = ColorF(c[1],c[2],c[3],c[4] or 1)
	for _,s in pairs(list) do
--			print('?? label:'..tostring(s[2])..':'..tostring(s[1]))
@/lua/ge/extensions/gameplay/discover/newPlayerExperience.lua
            local dones = {}
            for vehId, setup in pairs(setupVehs) do
              local veh = getObjectByID(vehId)
            end
            for id, _ in pairs(dones) do
              setupVehs[id] = nil

for _, discover in pairs(freeroamExperiences) do
  table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
end
for _, mission in pairs(missions) do
  table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/flowgraph/nodes/logic/booleanExpression.lua
  --dumpz(self.graph.links,2)
  for _, l in pairs(self.graph.links) do
    if l.targetNode.id == self.id then
  self.keyworkdWhiteListLookup = {}
  for _, v in pairs(keywordWhiteList) do
    self.keyworkdWhiteListLookup[v] = true
@/lua/ge/extensions/core/paths.lua
  local namesCounter = {}
  for _, filename in pairs(camPathFiles) do
    local path = loadPath(filename)
@/lua/ge/extensions/editor/buildingEditor.lua
	local alib = {}
	for _,p in pairs(apth) do
		unrequire(p)
	if UU._PRD == 0 or UU._HERE then
		for k,d in pairs(dexp) do
			if d.obj and d.obj.isactive and d.obj.out.up or (UU._PRD==0 and d.onstart) then
	local aang = {}
	for i,v in pairs(apos) do
		aang[#aang + 1] = {i, math.atan2(v.y, v.x) % (2*math.pi)}
		local s = '{ '
		for o,e in pairs(t) do
--            lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
	local star, anear = {}, {}
	for _,iuse in pairs(ause) do
		anear[#anear + 1] = iuse - 1
	end
	for _,j in pairs(anear) do
		if j > 0 and j <= #path then
		local dma = 0
		for i,n in pairs(anode) do
			local step = U.stamp({cp, i})
		local crossed, xc, yc
		for o,p in pairs(ap) do
			local w = wa * p.d/dma + wb * p.ang/math.pi + (1 - (wa + wb)) * p.used
				end
				for _,pth in pairs(apath) do
					crossed = forCross(pth)
					apath[#apath + 1] = path
					for _,s in pairs(path) do
						jointpath[#jointpath + 1] = s
	local aang, angp = {}, 0
	for _,i in pairs(star) do
		local v = anode[i].pos - anode[s].pos
	-- relative to p
	for o,_ in pairs(aang) do
		aang[o][2] = (aang[o][2] - angp) % (2*math.pi)
	local an = {}
	for _,p in pairs(apos) do
		an[#an + 1] = {pos = p, width = w}
	-- get branches
	for i,r in pairs(roads) do
		local inpath = U.index(r.path, icirc)
--                U.dump(r.apin, '?? r:'..i)
		for _,j in pairs(inpath) do
			inedge[#inedge + 1] = {i, r.apin[r.path2dec[j]][1]}
	local adir = {}
	for _,s in pairs(inedge) do
		lo('?? for_s:'..s[1]..':'..s[2])
	--------------------------
	for i,r in pairs(roads) do
		inedge[i] = {}
		local indec = {}
		for k,v in pairs(r.dec2path) do
--            lo('?? d2p:'..k..':'..i)
		local aee = {}
		for o,e in pairs(inedge[i]) do
			local av, step = r.av, r.avstep
	local mi, hmi = 1/0, nil
	for i,h in pairs(hmap) do
--        lo('?? height4edge:'..i..':'..h)
	local ro, ri
	for _,e in pairs(exits) do
		if e.meshid == idobj then
	end
	for _,e in pairs(exits) do
		if e.to[1] == ro.to[1] and e.to[2] == ro.to[2] and e.meshid ~= idobj then
			local p = pth[o]
	--        for o,p in pairs(dec) do
			local set = 0
	-- reset heights
	for o,n in pairs(adec) do
		if dbg then
	-- build decal
	for _,r in pairs(roads) do
		local rd = Net.path2decal(r, wHeighway)
		state = {}
		for i,l in pairs(lines) do
			local a = U.split(l,',')
		local apair = {}
		for o,s in pairs(edges.astamp) do
			if (edges.infaces[s] ~= nil and math.abs(edges.infaces[s]) == 1) or #edges.astamp == 1 then
	if W.out.border ~= nil then
		for _,base in pairs(W.out.border) do
			for i = 1,#base do
	if W.out.apath ~= nil then
		for _,p in pairs(W.out.apath) do
			for i = 2,#p do
	if D.out.apath ~= nil then
		for _,p in pairs(D.out.apath) do
			for i = 2,#p do
	if W.out.apick ~= nil then
		for _,s in pairs(W.out.apick) do
			local r = 0.01*math.sqrt((s-core_camera.getPosition()):length())
	if D.out.apick ~= nil then
		for _,s in pairs(D.out.apick) do
			local r = 0.03*math.sqrt((s-core_camera.getPosition()):length())
	if W.out.avedit ~= nil then
		for _,s in pairs(W.out.avedit) do
			local r = 0.02*math.sqrt((s-core_camera.getPosition()):length())
	if W.out.apoint ~= nil then
		for _,p in pairs(W.out.apoint) do
			local r = 0.03*math.sqrt((p-core_camera.getPosition()):length())
	if D.out.apoint ~= nil then
		for _,p in pairs(D.out.apoint) do
			local r = 0.03*math.sqrt((p-core_camera.getPosition()):length())

	for _,s in pairs(adbg) do
--        lo('?? DS:'..tostring(s[1]))
		-- circles
		for o,n in pairs(anode) do
			local clr = color(255,255,255,255)
		-- paths
		for i,l in pairs(apath) do
			for j,s in pairs(l) do
		for i,l in pairs(apath) do
			for j,s in pairs(l) do
				if j > 1 then
	-- decals sceletons
	for i,rd in pairs(roads) do
		local path = {}
			lo('?? BE.fdata2:'..#list, true)
		for _,f in pairs(list) do
			editor.removeForestItem(fdata, f)
--		print('?? to_RELOAD:')
		for k,d in pairs(dexp) do
			if d.obj and d.obj.isactive and d.obj.out.up or d.onstart then

	for i,d in pairs(dexp) do
--			lo('?? for_EXP:'..tostring(d.label)..':'..tostring(d.obj.isactive))
		editor.addWindowMenuItem("LandscapeGenerator (WIP)", onUp, {groupMenuName = 'Experimental'})
		for k,d in pairs(dexp) do
			editor.addWindowMenuItem(d.label, function()
		editor.addWindowMenuItem("LandscapeGenerator (WIP)", onUp, {groupMenuName = 'Experimental'})
		for k,d in pairs(dexp) do
			d.obj = assign({'/lua/ge/extensions/editor/gen/'..d.lib})
@/lua/ge/extensions/editor/assemblySpline/import.lua
      local totalWeight, total = 0, numGroupComponents
      for _, count in pairs(pathCounts) do -- Not round robin, must be random - calculate average weight.
        totalWeight = totalWeight + (count / total)
  local meshesInPolygon = {}
  for _, meshName in pairs(scenetree.findClassObjects("TSStatic")) do
    local obj = scenetree.findObject(meshName)
@/lua/ge/extensions/gameplay/missions/unlocks.lua
      end
      for key, _ in pairs(startTypes) do
        missionById[mId].unlocks.branchTags[key] = true
    branchTagForMission[m.id] = nil
    for bId, lvl in pairs(levelForBranch) do
      branchTagForMission[m.id] = branchTagForMission[m.id] or {}
  -- double-link the missions, so that missions know which ones come after that (conditions are looking "backward")
  for bId, list in pairs(backward) do
    for _, fId in ipairs(list or {}) do

    for key, value in pairs(aConds) do
      count = count+1
@/lua/ge/extensions/gameplay/traffic/roles/police.lua

  for k, v in pairs(self.baseActions) do
    self.actions[k] = v

  for id, veh in pairs(traffic) do
    if id ~= self.veh.id and veh.role.name ~= 'police' then
function C:onTrafficTick(dt)
  for id, veh in pairs(gameplay_traffic.getTrafficData()) do -- update data of potential targets
    if id ~= self.veh.id and veh.role.name ~= 'police' and not veh.ignorePolice and not self.flags.cooldown then
@/lua/ge/extensions/gameplay/drift/quickMessages.lua
local function checkPrimaryConditions()
  for messageId, data in pairs(quickMessages) do
    if not quickMessagesProcessed[messageId] then
      local conditionsMet = true
      for primaryCondition, conditionData in pairs(data.primaryConditions) do
        if not primaryConditions[primaryCondition](conditionData,
local function checkConfirmConditions(dt)
  for quickMessageId, confirmConditions_ in pairs(checkConfirmConditionsQueue) do
    local conditionsMet = true
    local conditionsMet = true
    for confirmConditionName, confirmConditionData in pairs(confirmConditions_) do
      local result = confirmConditions[confirmConditionName](confirmConditionData, {dt = dt})
local function checkResetConditions(dt)
  for messageId, messageData in pairs(quickMessages) do
    if messageData.reset.conditions then
    if messageData.reset.conditions then
      for conditionName, conditionData in pairs(messageData.reset.conditions) do
        -- Reuse the args table for GC
      if im.BeginChild1("Available quick messages", im.ImVec2(im.GetContentRegionAvailWidth(), 130), true) then
        for messageId, data in pairs(quickMessages) do
          im.Text('-' .. data.msg)
local function translateQuickMessages()
  for id, _ in pairs(quickMessages) do
    quickMessages[id].msg = translateLanguage("missions.drift.quickMessage."..id,"missions.drift.quickMessage."..id,true)
@/lua/ge/extensions/flowgraph/pin.lua
function C:highlightLinks()
  for i, lnk in pairs(self.links) do
    lnk._highlight = true
@/lua/ge/extensions/flowgraph/nodes/ui/onBigmapPoiSelected.lua
  self.pinOut.denavigated.value = false
  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/flowgraph/modules/buttonModule.lua
    local data = { }
    for id, btn in pairs(self.buttons) do
      if btn.active.value then
  self.buttonsChanged = nil
  for id, btn in pairs(self.buttons) do
    self.variables:change(id.."clicked", false)
@/lua/ge/extensions/editor/inspector.lua

  for fldName, field in pairs(ctx.fields) do
    if field.useCount == tableSize(valueInspector.selectedIds) then
  local fieldVal = nil
  for key, val in pairs(ctx.fields) do
    -- we start at the second object, since the first one we keep as reference
  -- set the sorted fields array and sort the array fields
  for _, field in pairs(ctx.fields) do
    if field.type == "beginArray" then
      field.sortedFields = {}
      for _, fld in pairs(field.fields) do table.insert(field.sortedFields, fld) end
      table.sort(field.sortedFields, function(a, b) return a.id < b.id end)
    if val then
      for k, v in pairs(inspectorFieldModifiers) do
        if v.callback then
    -- otherwise we skip it, since it would not make sense when not common
    for key, val in pairs(dynFieldUsage) do
      if val == #valueInspector.selectedIds then
  if guiInstancer.instances then
    for key, inspectorInfo in pairs(guiInstancer.instances) do
      local wndName = inspectorWindowNamePrefix .. key
          -- first lets check if we have multiple selection types
          for _, val in pairs(editor.selection) do
            if not tableIsEmpty(val) then
          imgui.Text("Multiple types selected:")
          for className, val in pairs(editor.selection) do
            imgui.Text(#val .. " " .. className .. "(s)")
          -- so we provide a function for the current mode, the default is object inspector objectInspectorGui function
          for typeName, typeHandler in pairs(inspectorTypeHandlers) do
            -- if we have a locked inspector, use its selection
  guiInstancer:deserialize("inspectorInstances", state)
  for key, val in pairs(guiInstancer.instances) do
    editor.registerWindow(inspectorWindowNamePrefix .. tostring(key), imgui.ImVec2(300, 500))
    if objFields then
      for fldName, field in pairs(objFields) do
        if sharedCtx.fields[fldName] == nil then
@/inspector/Models/Cookie.js
        // Set-Cookie:  =  ( ";" SP  )*?
        // NOTE: Some attributes can have pairs (e.g. "Path=/"), some are only a
        // single word (e.g. "Secure").
@/lua/ge/extensions/flowgraph/nodes/vehicle/touching.lua
      local ids = {}
      for k,v in pairs(cols) do
        table.insert(ids,k)
@/lua/ge/extensions/gameplay/traffic/roles/standard.lua

  for k, v in pairs(self.baseActions) do
    self.actions[k] = v
@/lua/ge/extensions/flowgraph/nodes/logic/select.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinInLocal['select_'..i] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresComplete.lua
      local _, fn, ext = path.splitWithoutExt(vData.config.partConfigFilename)
      for k, c in pairs(mData.configs) do
        if fn == c then
@/lua/vehicle/controller/tech/roadsSensor.lua
    local cands, c2Ctr = {}, 1
    for k, _ in pairs(graph[p_frontKey]) do
      cands[c2Ctr] = k
  local cands1, c1Ctr = {}, 1
  for k, _ in pairs(graph[p1Key]) do
    cands1[c1Ctr] = k
  local cands2, c2Ctr = {}, 1
  for k, _ in pairs(graph[p2Key]) do
    cands2[c2Ctr] = k
    graph, coords, widths = mapData.graph, mapData.positions, mapData.radius
    for k, v in pairs(coords) do
      normals[k] = mapmgr.surfaceNormalBelow(v)
  local wp, ctr = {}, 1
  for _, wheel in pairs(wheels.wheels) do
    wp[ctr] = obj:getNodePosition(wheel.node1)
@/lua/ge/extensions/core/weather.lua

  for objClassStr, attribTable in pairs(p) do
    local objs = getObjectsByClass(objClassStr)
      formerValues[objClassStr] = {}
      for _, obj in pairs(objs) do
        local id = obj:getId()
        local fields =  obj:getFields()
        for attrName, attrValue in pairs(attribTable) do
          formerValues[objClassStr][id][attrName] = {}
            formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
            for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
              formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
            formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
            for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
              formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
            formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
            for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
              formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
  local t = {}
  for k,v in pairs(ta) do
    t[k] = v - tb[k]

  for objClassStr, objs in pairs(formerValues) do
    diff[objClassStr] = {}
    diff[objClassStr] = {}
    for id, obj in pairs(objs) do
      diff[objClassStr][id] = {}
      diff[objClassStr][id] = {}
      for attrName, attrVal in pairs(obj) do
        if type(attrVal.value) == 'number' and p[objClassStr][attrName] ~= nil then

  for objName, objVal in pairs(formerValues) do
    local objects = getObjectsByClass(objName)
    values[objName] = {}
    for k,object in pairs(objects) do
      values[objName][object:getId()] = object
local function multiplyTable( tbl, factor )
  for k,v in pairs(tbl) do
    tbl[k] = tbl[k] * factor
  if diff and formerValues then
    for objClassStr, obs in pairs(formerValues) do
      for id, o in pairs(obs) do
    for objClassStr, obs in pairs(formerValues) do
      for id, o in pairs(obs) do
        for attrName, attrVal in pairs(o) do
      for id, o in pairs(obs) do
        for attrName, attrVal in pairs(o) do
          values[objClassStr][id][attrName] = formerValues[objClassStr][id][attrName]['setter'](formerValues[objClassStr][id][attrName]['value'], diff[objClassStr][id][attrName])

  for objClassStr, attribTable in pairs(p) do
    if type(objClassStr) ~= 'string' or type(attribTable) ~= 'table' then
    else
      for _, obj in pairs(objs) do
        for attrName, attrValue in pairs(attribTable) do
      for _, obj in pairs(objs) do
        for attrName, attrValue in pairs(attribTable) do
          local fields = obj:getFields()
  local globalFiles = FS:findFiles('art/weather/', '*.json', -1, true, false) -- {"art/weather/defaults.json"}
  for _, v in pairs(globalFiles) do
    loadPreset(v)
  local levelFiles = FS:findFiles(levelDir..'/weather/', '*.json', -1, true, false) -- {"levels/driver_training/weather/weather.json"}
  for _, v in pairs(levelFiles) do
    loadPreset(v)
  local p = {}
  for k,v in pairs(presets) do
    table.insert(p,k)
@/lua/ge/extensions/tech/openStreetMapExporter.lua
  coords2d = {}
  for k, p in pairs(coords3d) do
    coords2d[k] = vec3(p.x, p.y, 0.0)
  local ctr = 0
  for k, v in pairs(table) do
    if type(v) == 'table' then
local function doesCollectionContainSegment(collection, testSeg)
  for k, trialSeg in pairs(collection) do
    local matches = 0
    local matches = 0
    for k1, v1 in pairs(trialSeg) do
      for k2, v2 in pairs(testSeg) do
    for k1, v1 in pairs(trialSeg) do
      for k2, v2 in pairs(testSeg) do
        if v1 == v2 then
local function doesSegmentContainKey(currentPath, nextSuccessorKey)
  for k, v in pairs(currentPath) do
    if v == nextSuccessorKey then
  local ctr = 1
  for headKey, v1 in pairs(graph) do
    local firstChildren = getChildren(graph[headKey])
    -- Remove condition that filtered out nodes with 2 children
    for childKey, v2 in pairs(successors) do
      local currentPath = {}
        local allSuccessorsVisited = true
        for nextSuccessorKey, _ in pairs(nextSuccessors) do
          if not doesSegmentContainKey(currentPath, nextSuccessorKey) then
        local didFind = false
        for nextSuccessorKey, v3 in pairs(nextSuccessors) do
          if doesSegmentContainKey(currentPath, nextSuccessorKey) == false then

  for k, v in pairs(coords3d) do
    keysToNodeMap[k] = ctr
  local ways = {}
  for _, seg in pairs(pathSegments) do
    local n = {}
@/lua/ge/extensions/core/input/actions.lua
  local result = {}
  for actionName,v in pairs(actions) do
    if vehicleName and v.namespace ~= "common" then
  local result = {}
  for _,path in pairs(FS:findFiles(directory, pattern, 0, false, false)) do
    if active == tech_license.isAllowedActionsPath(path) then
      end
      for k,action in pairs(vehicleActions or {}) do
        action.source = path
    -- add actions from vehicle action files
    for uniqueActionName,action in pairs(readFromActionsFile(vehicleName, active)) do
      if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
    local vd = extensions.core_vehicle_manager.getVehicleData(vehicle:getID())
    for uniqueActionName,action in pairs(actionsToUniqueActions(vd and vd.vdata and vd.vdata.inputActions or {}, vehicleName)) do
      if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
      if vd and vd.vdata and vd.vdata.actionsEnabled then
        for _, action in pairs(vd.vdata.actionsEnabled or {}) do
          for resultActionName, resultAction in pairs(result) do
        for _, action in pairs(vd.vdata.actionsEnabled or {}) do
          for resultActionName, resultAction in pairs(result) do
            if resultAction.vehicle and resultActionName == playerVehicleName .. "__" .. action.name then
        -- If the vehicle has no actionsEnabled table, mark all vehicle-specific actions as usable
        for resultActionName, resultAction in pairs(result) do
          resultAction.usable = true

  for resultActionName, resultAction in pairs(result) do
    if resultAction.usable then
  -- add actions from normal action files
  for uniqueActionName,action in pairs(getNormalActions(active)) do
    if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
    table.clear(M.menuActionMapNames)
    for actionName, action in pairs(result) do
      local success, actionMap = M.actionToCommands(actionName, action)
@/lua/ge/extensions/career/modules/milestones/milestones.lua
    milestone.filter = milestone.filter or {missingFilter=true}
    for key, _ in pairs(milestone.filter) do
      filters[key] = true
@/lua/ge/extensions/flowgraph/nodes/ui/buttons/getMultipleButtons.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.sourcePin == self.pinOut['clicked_'..i] then
@/gameplay/missionTypes/dragStripAPM/constructor.lua
  local vehiclesUsedPerStar = saveData.vehiclesUsedPerStar or {}
  for star, achieved in pairs(attempt.unlockedStars or {}) do
    if achieved then
@/lua/common/jbeam/sections/mirror.lua
  if vehicle.mirrors ~= nil then
    for _, v in pairs(vehicle.mirrors) do
      if v.mesh then
@/lua/ge/extensions/flowgraph/nodes/types/setVariable.lua
  local links = {}
  for _,lnk in pairs(self.graph.links) do
    if lnk.targetPin == self.pinInLocal[self.varName] then
  local links = {}
  for _,lnk in pairs(self.graph.links) do
    if lnk.targetPin == self.pinInLocal[self.varName] then
@/lua/ge/extensions/flowgraph/nodes/vehicle/hasCouplerTag.lua
  local vehA = self.mgr.modules.vehicle:getVehicle(self.pinIn.vehA.value)
  for _, tag in pairs(couplerTags) do
    self.pinOut[tag].value = vehA.couplerTags[tag] or false
@/lua/ge/extensions/gameplay/crawl/boundary.lua

  for _, objectInfo in pairs(boundaryObjects) do
    local pos = objectInfo.finalPosition

  for objectId, objectInfo in pairs(boundaryObjects) do
    local pos = objectInfo.finalPosition

    for objectId, objectInfo in pairs(boundaryObjects) do
      local obj = scenetree.findObjectById(objectId)
local function resetBoundaryObjects()
  for objectId, objectInfo in pairs(boundaryObjects) do
    local obj = scenetree.findObjectById(objectId)

  for objectId, objectInfo in pairs(boundaryObjects) do
    local obj = scenetree.findObjectById(objectId)
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
    local i = 1
    for _, v in pairs(sel) do
      if i > 1 then return true end

  for layerUid, layerData in pairs(editor.selection["dynamicDecalLayer"]) do
    if multiSelect then

  for layerType, layerTypeId in pairs(api.layerTypes) do
    layerGui[layerTypeId] = function() im.TextUnformatted(string.format("No layerGui available for '%s'", layerType)) end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
    node.__selected = nil
    for k, v in pairs(node) do
      _clearNodeSelection(v)
    end
    for k, v in pairs(node) do
      _selectAndHighlightNode(v)
    end
    for k, v in pairs(node) do
      _deselectAndUnhighlightNode(v)
    node.__selected = true
    for k, v in pairs(node) do
      _selectNode(v)
    node.__hidden = hidden
    for _, n in pairs(node) do
      _setNodeHidden(n, hidden)
  --if not part.slotType then return end
  for partName, _ in pairs(partsList) do
    local part, jbeamFilename = deepcopy(jbeamIO.getPart(ioCtx, partName))
    if open then
      for k, v in pairs(node) do
        if k ~= '__astNodeIdx' and k ~= '__selected' and k ~= '__hidden' and k ~= 'maxIDs' and k ~= 'validTables' and k ~= '__schemaProcessed' then
  -- Render and pick the nodes
  for _, node in pairs(part.nodes) do
    if type(node) == 'table' and node.pos ~= nil then
  -- Render and pick the beams
  for key, beam in pairs(part.beams) do
    if type(beam) == 'table' then
@/lua/ge/extensions/career/modules/speedTraps.lua
local function hasLicensePlate(inventoryId)
  for partId, part in pairs(career_modules_partInventory.getInventory()) do
    if part.location == inventoryId then
@/lua/ge/extensions/scenario/raceGoals.lua
  local invalidValue = false
  for k,g in pairs(goalSchema) do
    invalidKey=false
    invalidType = false
    for kl,vl in pairs(g) do
      invalidValue = false
    if type(v.value) == "table" then
      for gkey,val in pairs(v.value) do
        checkGoalItem(goalSchema, v.id, gkey, val)
local function istable(t)
    for k, _ in pairs(t) do
        if type(k) ~= "number" then

  for _, goal in pairs(goals) do
    goal.init(scenario)
    -- iterate over all vehicles in the scene and find if goals exist
    for vName, vObjId in pairs(scenario.vehicleNameToId) do
      local tempGoals = nil
       if tempGoals then
        for k, v in pairs(tempGoals) do
          local goal = {}
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.updateFinalStatus(scenario)
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onRaceStart')
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onRaceInit')
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onRaceWaypointReached', data)
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onRaceTick', data)
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onRaceResult')
  local goals = M.state.goals
  for i, goal in pairs(goals) do
    goal.processState(scenario, 'onCountdownEnded')
@/lua/common/libs/luamqtt/mqtt/client.lua

	for key, value in pairs(args) do
		if type(key) ~= "string" then
	end
	for event, func in pairs(events) do
		assert(type(event) == "string", "expecting event to be a string")
@/lua/ge/extensions/campaign/dealer.lua
  for _,item in ipairs(entryTable) do
    for k,v in pairs(item) do
      if valueObj[k] == v then
@/lua/ge/extensions/ui/vehicleSelector/vehicleOperations.lua
      local validConfigs = {}
      for _, config in pairs(data.configs) do
        if not ui_vehicleSelector_general.passesFilters({model = config.model_key, config = config.key}) then
@/lua/ge/extensions/career/modules/insurance/history.lua

  for _, event in pairs(list) do
    event.date = os.date("%c", event.time)
@/lua/ge/extensions/gameplay/drag/utils.lua
  racer._wheelDistances = {}
  for k, wheel in pairs(racer.wheelsCenter) do
    racer._wheelDistances[k] = racer._wheelDistances[k] or vec3()
  local winnerList = {}
  for _, racer in pairs(dragData.racers) do
    table.insert(winnerList, {
  local winnerList = {}
  for _, racer in pairs(dragData.racers) do
    local dialDiff = (racer.timers.time_1_4.value + racer.timers.reactionTime.value) - racer.timers.dial.value
  if not dragData then return end
  for vehId, racer in pairs(dragData.racers) do
    local index = racer.currentPhase + 1
    local allRacersFinished = true
    for _, r in pairs(dragData.racers) do
      if not r.timers.time_1_4.isSet then

  for k, offset in pairs(racer.allWheelsOffsets) do
    if not racer.wheelsCenter[k] then

  for k, distVec in pairs(racer._wheelDistances or {}) do
    if not racer.beamState[k] then
@/gameplay/tutorials/customNodes/getLocationsNode.lua
  local flag = false
  for _,i in pairs(tablee) do
    if id == i then flag = true end
@/lua/ge/extensions/ui/topBar.lua
  local visibleItemObjects = {}
  for _, item in pairs(Config.TopBarEntries) do
    local isBlacklisted = item.blackListStates and M.state.currentUIState and
  local visibleItems = {}
  for _, item in pairs(visibleItemObjects) do
    table.insert(visibleItems, item.id)
  -- check if any substate matches the state
  for _, item in pairs(Config.TopBarEntries) do
    if item.targetState == M.state.currentUIState then
    elseif item.substates and #item.substates > 0 then
      for _, substate in pairs(item.substates) do
        if string.sub(M.state.currentUIState, 1, #substate) == substate then
@/lua/ge/extensions/editor/assetDeduplicator.lua
      job.allfiles = #jobData.selectedLinks
      for k,v in pairs(selectedLinks) do
        if job.status == 0 then
    local isTexture = false
    for _,b in pairs(cases) do
      if string.lower(leftPath):find(b) then isTexture = true end
    local isTexture = false
    for _,b in pairs(cases) do
      if string.lower(rightPath):find(b) then isTexture = true end
  local sortedKeys = {}
  for k in pairs(matches) do
    sortedKeys[#sortedKeys + 1] = k
      end
      for path, _ in pairs(stockLevels) do
        local filenames = FS:findFiles(path, "*.jpg\t*.png\t*.dds\t*.dae\t*.cdae\t*.glb\t*.gltf", -1, true, false)
      end
      for path, _ in pairs(modLevels) do
        local filenames = FS:findFiles(path, "*.jpg\t*.png\t*.dds\t*.dae\t*.cdae\t*.glb\t*.gltf", -1, true, false)
    local currentLevelRoot
    for p in pairs(currentLevelData) do
      job.yield()
    local assetsByKey = {}
    for path, info in pairs(assetData) do
      if not isBlacklisted(path) and allowedByModLink(info) then
    local artByKey = {}
    for path, info in pairs(artData) do
      if not isBlacklisted(path) and allowedByModLink(info) then
    local stockByKey = {}
    for _, folderTable in pairs(stockLevelsData) do
      if type(folderTable) == "table" then
      if type(folderTable) == "table" then
        for path, info in pairs(folderTable) do
          if not isBlacklisted(path) and allowedByModLink(info) then
    if modLink then
      for _, folderTable in pairs(modLevelsData) do
        if type(folderTable) == "table" then
        if type(folderTable) == "table" then
          for path, info in pairs(folderTable) do
            if not isBlacklisted(path) then

    for path in pairs(currentLevelData) do
      if not isBlacklisted(path) then

    for curPath, info in pairs(currentLevelData) do
      if not isBlacklisted(curPath) then
@/lua/ge/extensions/editor/drivePathEditor/splineMgr.lua
  local lines, edgeSeen = {}, {}
  for fromIdx, targets in pairs(graph) do
    local p0, w0 = positions[fromIdx], radius[fromIdx]
    if p0 then
      for toIdx, _ in pairs(targets) do
        local key = fromIdx < toIdx and (fromIdx .. "-" .. toIdx) or (toIdx .. "-" .. fromIdx)
@/lua/vehicle/extensions/dynoClient.lua
    local rearAxis = 0.0
    for k,wd in pairs(v.data.wheels) do
        frontAxis =  math.min( frontAxis, v.data.nodes[wd.node1].pos.y  )
@/lua/ge/extensions/ui/uiNavi.lua
    if info.spawnPoints then
      for _, point in pairs(info.spawnPoints) do
        spawnPointAdditionalInfo[point.objectname] = point

  for _, pid in pairs(spawnpoints) do
    local o = scenetree.findObject(pid)
  local poios = poi_set:getObjects() or {}
  for _, pid in pairs(poios) do
    local o = scenetree.findObject(pid)

  for _, pid in pairs(stops) do
    local o = scenetree.findObject(pid)
  local foundCoresponding = {}
  for id, vec in pairs(interm) do
    for id2, vec2 in pairs(interm) do
  for id, vec in pairs(interm) do
    for id2, vec2 in pairs(interm) do
      if id < id2 and vec:distance(vec2) < 70 then

  -- for id, vec in pairs(interm) do
  --   table.insert(res, {pos = vec:toTable()})

  for k, v in pairs(map.getTrackedObjects() or {}) do
    if v.uiState ~= 0 then
  -- we are just renaming the nodes and references inside the links here since we don't care about the names anyway
  for k, _ in pairs(tmpmap.nodes) do
    nameMap[k] = counter

  for k, v in pairs(tmpmap.nodes) do
    newNodes[nameMap[k]] = {
    newNodes[nameMap[k]].to = {}
    for j, w in pairs(v.links) do
      table.insert(newNodes[nameMap[k]].to, {nameMap[j], w.drivability, w.oneWay})

  for k, v in pairs(tmpmap.nodes) do
    if not v.hiddenInNavi then
      newNodes[k].links = {}
      for j, w in pairs(v.links) do
        if not w.hiddenInNavi then
@/lua/ge/extensions/freeroam/facilities/fuelPrice.lua
  cachedPriceData = {}
  for k,v in pairs(facilitiesData.gasStations) do
    if not v.prices then goto continueStation end
    if not v.prices then goto continueStation end
    for fuelType,v2 in pairs(v.prices) do
      if v2.disabled and v2.displayObjects then
  end
  for k,v in pairs(cachedPriceData) do
    if not v.prices then goto continueStation end
    if not v.prices then goto continueStation end
    for fuelType,v2 in pairs(v.prices) do
      if v2.displayObjects then
@/lua/ge/extensions/campaign/campaigns.lua
  if campaign and campaign.meta.subsections then
    for subsectionKey,subsection in pairs(campaign.meta.subsections) do
      for k,_ in pairs(subsection.locations) do
    for subsectionKey,subsection in pairs(campaign.meta.subsections) do
      for k,_ in pairs(subsection.locations) do
        if k == locationKey then
  local locations = campaign.meta.subsections[subsectionKey].locations
  for key,location in pairs(locations) do
    if location.entryMarker == markerName or location.exitLocation == markerName then
@/lua/ge/extensions/gameplay/drift/freeroam/driftSpots.lua
  local closest = math.huge
  for lineName, lineData in pairs(lines) do
    local dist = lineData.pos:distance(plPos)
        if score >= obj.score then
          for k, v in pairs(obj.rewards) do
            rewards[k] = (rewards[k] or 0) + v
  for _, spotData in ipairs(gameplay_drift_saveLoad.loadAndSanitizeDriftFreeroamSpotsCurrMap()) do
    for lineName, lineData in pairs(spotData.spatialInfo.lines) do
      local spotName = spotData.id
  if career_career.isActive() or settings.getValue("enableDriftInFreeroam") then
    for id, line in pairs(lines) do
      local spot = gameplay_drift_saveLoad.getDriftSpotById(line.spotName)
@/lua/common/utils/calltracer.lua

  for k, _ in pairs(nodes) do
    nodeMap[k] = c

  for k, callTable in pairs(nodes) do
    for callNode, _ in pairs(callTable) do
  for k, callTable in pairs(nodes) do
    for callNode, _ in pairs(callTable) do
        txt = txt ..  '' .. nodeMap[k] .. ' ' .. nodeMap[callNode] .. '\n'
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenWhole.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    local contained = false
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    if nm == action then
      canPayFee = true
      for key, value in pairs(entryFee) do
        hasEntryFee = hasEntryFee or value > 0
function C:onNodeReset()
  for _,pn in pairs(self.pinOut) do
    pn.value = false
@/lua/ge/extensions/editor/missionPlaybook/attributeViewer.lua
  local data = {}
  for key, val in pairs(atts) do
    local level, curLvlProgress, neededForNext = career_branches.getBranchLevel(key)
@/lua/ge/client/postFx.lua

    for key, obj in pairs(preset) do
      local flag =  string.format("$PostFXManager::Settings::%s", key)
      else
        for field, value in pairs(obj) do
          local fullFlag =  string.format("%s::%s", flag, field)
@/lua/ge/extensions/campaign/exploration.lua
  if subsection then
    for k,v in pairs(subsection.locations) do
      if k == poi then
  createDestMarker = true
  for k,v in pairs(subsection.locations) do
    if v.entryMarker then
    local subsections = campaign.meta.subsections or {}
    for k,_ in pairs(subsections) do
      if k == subsectionName then
    local locations = (campaign.meta.subsections and subsectionName and campaign.meta.subsections[subsectionName].locations) or {}
    for key,_ in pairs(locations) do
      if key == locationKey then
    local halfHeight = (0.5 * minimap.worldCoord.h) - border
    for k,v in pairs(subsection.locations) do
      if v.entryMarker and scenetree[v.entryMarker..'_marker'] then
  local info = {}
  for k,v in pairs(subsection.locations) do
    local validPoi = campaign_campaigns.canStartScenario(k) -- and campaign_campaigns.canImproveResult(k)
  if campaign_photoSafari.accept then
    for k,v in pairs(campaign_photoSafari.photoSafariData) do
      local poi = {}
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresLap.lua
      local _, fn, ext = path.splitWithoutExt(vData.config.partConfigFilename)
      for k, c in pairs(mData.configs) do
        if fn == c then
@/lua/ge/extensions/editor/assetManagementTool.lua

  for hash, asset in pairs(assetsByHash) do
    if string.sub(asset.targetPath, 1, size) == newPathNotSetString then

  for key, val in pairs(assetsByHash) do
    table.insert(assetsByIndex, val)

  for hash, asset in pairs(assetsByHash) do
    -- copy first asset in list to new location (ignore others in the list for this hash since they're the same)

  for hash, asset in pairs(allAssetsWithHashes) do
    -- if its more than one, then we have duplicates
local function setTargetPathForSelection(targetPath)
  for hash, _ in pairs(selectedHashes) do
    if assetsByHash[hash] then

  for key, val in pairs(assetsByHash) do
    for _, path in ipairs(val.paths) do
    if imgui.Button("Yes") then
      for hash, _ in pairs(selectedHashes) do
        local asset = assetsByHash[hash]
@/lua/ge/extensions/c2/panelPlugins/vehicleManager.lua
  local needAll = false
  for _, sub in pairs(subscribers) do
    if sub.all then
    local vehicles = getAllVehicles()
    for _, veh in pairs(vehicles) do
      table.insert(vehicleData, getVehicleData(veh))
    -- Only fetch specific IDs
    for _, sub in pairs(subscribers) do
      if sub.vid then
  -- Send appropriate data to each subscriber
  for peerId, sub in pairs(subscribers) do
    local dataToSend = {}
@/lua/ge/extensions/gameplay/markers/bigmapMarker.lua
    if iconRendererObj then
      for id, _ in pairs(self.iconDataById or {}) do
        iconRendererObj:removeIconById(id)
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
function C:checkCollisions() -- checks for contact with other tracked vehicles
  for id, veh in pairs(map.objects) do
    if self.id ~= id then

            for otherId, otherVeh in pairs(gameplay_traffic.getTrafficData()) do -- notify other traffic vehicles of collision
              if not otherVeh.otherCollisionFlag and otherId ~= self.id and otherId ~= id then

  for id, coll in pairs(self.collisions) do
    local veh = gameplay_traffic.getTrafficData()[id]

    for id, veh in pairs(gameplay_traffic.getTrafficData()) do
      if id ~= self.id then

      for id, _ in pairs(self.collisions) do
        self:trackCollision(id, dtSim)
    -- queued functions
    for k, v in pairs(self.queuedFuncs) do
      if not v.timer then v.timer = 0 end
@/lua/ge/extensions/gameplay/drag/general.lua
  -- Unload all tracked extensions
  for extName, _ in pairs(loadedDragExtensions) do
    if extensions.isExtensionLoaded(extName) then

      for key, _ in pairs(wheelsByFrontness) do
        if math.abs(tonumber(key) - frontness) < 0.2 then

  for k, v in pairs(racer.allWheelsOffsets) do
    racer.wheelsCenter[k] = {pos = vec3(), wheelCountInv = 1 / #racer.allWheelsOffsets[k]}
  }
  for timerId, timer in pairs(racer.timers) do
    if timer.type ~= "dialTimer" and addFrameHistoryDebug[timerId] and not timer.frameHistory then
  if dragData.racers then
    for vehId, racer in pairs(dragData.racers) do
      racer.currentPhase = 1
  rawData.racerInfos = {}
  for id, racer in pairs(dragData.racers) do
    local currentVehicle = core_vehicles.getVehicleDetails(id)

    for _, data in pairs(dragDataList) do
      if data.strip and data.strip.lanes then
@/lua/ge/extensions/core/input/virtualInput.lua
local function getDeviceInfo(vidpid)
  for deviceInstance, info in pairs(M.devices) do
    if info[2] == vidpid then
@/lua/ge/extensions/career/modules/delivery/progress.lua
  }
  for skill, _ in pairs(career_branches.getBranches()) do
    unlockStatus.skillLevels[skill] = career_branches.getBranchLevel(skill)
  TODO: reimplement
  for skill, _ in pairs(skillUnlockDescriptions) do
    for lvl = unlockStatus.skillLevels[skill], career_branches.getBranchLevel(skill) do
    dropOffDataStatus.playerVehicleData = {}
    for vehId, vehicleInfo in pairs(playerVehiclesById) do
      --table.sort(vehicleInfo.containers, function(a,b) return a.name < b.name end)
  -- still waiting for vehicles to be finished
  for _, data in pairs(dropOffDataStatus.vehicleData) do
    if not data.finished then return end
  local manualDropOffItems = {}
  for _, vehicleInfo in pairs(dropOffDataStatus.playerVehicleData or {}) do
    for _, con in pairs(vehicleInfo.containers) do
  for _, vehicleInfo in pairs(dropOffDataStatus.playerVehicleData or {}) do
    for _, con in pairs(vehicleInfo.containers) do
      for _, cargo in pairs(con.cargo) do
    for _, con in pairs(vehicleInfo.containers) do
      for _, cargo in pairs(con.cargo) do
        cargo.vehicleName = vehicleInfo.name
        -- add in rewards keys..?
        for key, amount in pairs(cargo.adjustedRewards) do
          branchInfo[key] = true
    table.insert(confirmedOfferIds, vehData.id)
    for key, amount in pairs(vehData.adjustedRewards) do
      branchInfo[key] = true
  dropOffDataStatus.customAmountPerMaterialType = {}
  for _, materialType in pairs(tableKeysSorted(unloadingMaterialInfoByKey)) do
    local info = unloadingMaterialInfoByKey[materialType]

    for key, _ in pairs(branchInfo) do
      branchInfo[key] = {
    local maxDelay = 0
    for _, delay in pairs(data) do
      maxDelay = math.max(delay, maxDelay)
          step.makeStepReturnTrueFunction(function()
            for vehId, data in pairs(data) do
              local veh = scenetree.findObjectById(vehId)
      -- 1s delay, no freeze
      for vehId, data in pairs(data) do
        local veh = scenetree.findObjectById(vehId)
    -- still waiting for vehicles to be finished
  for _, data in pairs(confirmedDropOffData.offers) do
    if not data.finished then return end
    -- format each group individually
  for gId, group in pairs(cargoByGroupId) do
    table.insert(itemNames, string.format("%dx %s", #group, group[1].name))
  for _, reward in ipairs(rewards) do
    for key, amount in pairs(reward) do
      rewardSum[key] = (rewardSum[key] or 0) + amount

  for key, _ in pairs(branchInfo) do
    local c = 0
    for key, v in pairs(facility.progress[direction].countByType) do
      c = c + v
  else
    for label, _ in pairs(soundNames) do
      local sound = scenetree.findObjectById(soundObjectIds[label])
@/lua/ge/extensions/tech/platoonFunctions.lua
local function printPlatoons()
  for leaderID, platoon in pairs(platoons) do
    for i, vehicleID in ipairs(platoon.vehicles) do

  for platoonID, platoon in pairs(platoons) do  -- Loop over all platoons
    for i, vehicleID in ipairs(platoon.vehicles) do  -- Loop over vehicles (index-based)
      sensorData = extensions.tech_sensors.getUltrasonicReadings(sensorID)
      for k, v in pairs(sensorData) do
        if k == "distance" then
@/lua/ge/extensions/editor/roadRiverCacheHandler.lua
  for _, group in ipairs(groups) do
    for _, name in pairs(group:getObjects()) do
      local object = scenetree.findObject(name)
@/lua/ge/extensions/career/modules/uiUtils.lua

  for _, br in pairs(career_branches.getSortedBranches()) do
    if not br.isSkill then
@/lua/vehicle/extensions/vehiclePerformanceData.lua
  local avgWheelPos = vec3(0, 0, 0)
  for _, wd in pairs(wheels.wheels) do
    wheelCount = wheelCount + 1
  local propulsedWheelLocations = {fr = 0, fl = 0, rr = 0, rl = 0}
  for _, wd in pairs(wheels.wheels) do
    if wd.isPropulsed then
  local transmissions = powertrain.getDevicesByCategory("gearbox")
  for _, v in pairs(transmissions) do
    transmissionTypes[v.type] = true
  local fuelTypes = {}
  for _, v in pairs(energyStorages) do
    if v.type == "fuelTank" then
  local inductionTypes = {}
  for _, v in pairs(engines) do
    inductionTypes.naturalAspiration = true
  --iterate active recordings and execute the update method
  for recordingType, _ in pairs(activeRecordingTypes) do
    recordingUpdateMethods[recordingType](dt)
--     local torqueData = {}
--     for _, v in pairs(engines) do
--       local tData = v:getTorqueData()
--       local engineCurves = td.curves[td.finalCurveName]
--       for rpm, torque in pairs(engineCurves.torque) do
--         torqueCurve[rpm] = (torqueCurve[rpm] or 0) + torque
--       end
--       for rpm, power in pairs(engineCurves.power) do
--         powerCurve[rpm] = (powerCurve[rpm] or 0) + power
--     end
--     for _, torque in pairs(torqueCurve) do
--       maxTorque = max(maxTorque, torque)
--     end
--     for _, power in pairs(powerCurve) do
--       maxPower = max(maxPower, power)
@/lua/ge/extensions/gameplay/drift/drift.lua
  -- Reset debug histories
  for _, historyData in pairs(debugHistories) do
    historyData.data = {}
  random = getBlueNoise1d(random)
  for _, scannerData in pairs(scanners) do
      -- remove oldest data
      for _, historyData in pairs(debugHistories) do
        if historyData.data and historyData.data[maxHistorySize] then
        im.BeginChild1("Debug Graph", im.ImVec2(im.GetContentRegionAvailWidth(), 400), true)
        for _, historyData in pairs(debugHistories) do
          im.PushStyleColor2(im.Col_Text, im.ImVec4(historyData.color[1], historyData.color[2], historyData.color[3], historyData.color[4]))
        local i = 1
        for _, historyData in pairs(debugHistories) do
          chartData[i] = {}
@/gameplay/missionTypes/aiRace/constructor.lua
  unlockedStars.trafficRace = false
  for id, v in pairs(gameplay_traffic.getTrafficData()) do
    if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/ge/extensions/editor/missionPlaybook.lua
        local isBranch = false
        for key, active in pairs(params.onlyBranch) do
          isBranch = isBranch or (active and m.unlocks.branchTags[key])
        local isTier = false
        for tier, active in pairs(params.onlyTier) do
          isTier = isTier or (active and m.unlocks.maxBranchlevel == tier)
@/lua/ge/extensions/career/modules/partShopping.lua
  if tree.children then
    for slotName, childNode in pairs(tree.children) do
      tableMerge(result, flattenPartsTree(childNode))
local function getPartSlotFromPartIdInShoppingCart(partId)
  for _, part in pairs(shoppingCart.partsIn) do
    if part.partId == partId then
        -- Add matching parts from inventory
        for partId, inventoryPart in pairs(career_modules_partInventory.getInventory()) do
          local partSlotOfThisPartInShoppingCart = getPartSlotFromPartIdInShoppingCart(partId)
  if treeNode.children then
    for childSlot, childNode in pairs(treeNode.children) do
      generatePartFromTree(childNode, childSlot, partInfo.slotInfoUi[childSlot], currentVehicleData, availableParts, vehicleObj)

  for partName, partInfo in pairs(availableParts) do
    if partInfo.slotInfoUi then
    if partInfo.slotInfoUi then
      for slotName, slotInfo in pairs(partInfo.slotInfoUi) do
        slotsNiceName[slotName] = slotInfo.description
    if node.children then
      for childSlot, childNode in pairs(node.children) do
        traverseTree(childNode, childSlot)
  local searchSlotList = {}
  for path, slotInfo in pairs(searchSlotDict) do
    table.insert(searchSlotList, slotInfo)

  for path, part in pairs(shoppingCart.partsIn) do
    shoppingCart.partsOut[path] = career_modules_partInventory.getInventory()[slotToPartIdMap[currentVehicle][path]]
  end
  for path, partName in pairs(initialVehicle.partList) do
    if partName ~= "" and (not previewVehicle.partList[path] or previewVehicle.partList[path] == "") then
  local counter = 1
  for slot, part in pairs(shoppingCart.partsIn) do
    shoppingCart.slotList[counter] = slot

  for slot, part in pairs(shoppingCart.partsOut) do
    if not slotsAdded[part.containingSlot] then
  local total = 0
  for slot, part in pairs(shoppingCart.partsIn) do
    total = total + part.finalValue
  shoppingData.vehicleSlotToPartMap = {}
  for partId, part in pairs(career_modules_partInventory.getInventory()) do
    if part.location == currentVehicle then
  local availableParts = jbeamIO.getAvailableParts(currentVehicleData.ioCtx)
  for _, partName in pairs(initialVehicle.partList) do
    if partName and partName ~= "" then
local function getFittingPartFromInventory(parentPart, slotName, currentVehicleData)
  for partId, inventoryPart in pairs(career_modules_partInventory.getInventory()) do
    local partSlotOfThisPartInShoppingCart = getPartSlotFromPartIdInShoppingCart(partId) -- for checking if the part is already in the shopping cart
  local combinedSlotToPartMap = {}
  for containingSlot, partId in pairs(slotToPartIdMap[inventoryId]) do
    combinedSlotToPartMap[containingSlot] = deepcopy(career_modules_partInventory.getInventory()[partId])
  end
  for _, part in pairs(parts) do
    combinedSlotToPartMap[part.containingSlot] = deepcopy(part)

  for path, part in pairs(combinedSlotToPartMap) do
    local jbeamData = jbeamIO.getPart(currentVehicleData.ioCtx, part.name)
  local resultParts = deepcopy(parts)
  for _, part in pairs(parts) do
    if part.description.slotInfoUi then
    if part.description.slotInfoUi then
      for slotName, slotInfo in pairs(part.description.slotInfoUi) do
        local path = part.containingSlot .. slotName .. "/"
  -- Traverse through the vehicle parts tree
  for slotName, childNode in pairs(node.children) do
    local subPartName = childNode.chosenPartName

  for path, part in pairs(vehicleParts) do
    -- Remove the root part
  if initialNode.children then
    for slotName, initialChildNode in pairs(initialNode.children) do
      -- Create preview child node if it doesn't exist
        addedParts, werePartsAdded = getNeededAdditionalParts(addedParts, currentVehicle)
        for path, part in pairs(addedParts) do
          local node = getNodeFromSlotPath(previewVehicle.config.partsTree, part.containingSlot)

    for containingSlot, part in pairs(removedParts) do
      -- If there was another part in the slot before, put the initial part back in, otherwise leave the slot empty
  -- Add new parts to preview vehicle data
  for _, part in pairs(shoppingCart.partsIn) do
    local node = getNodeFromSlotPath(previewVehicle.config.partsTree, part.containingSlot)
  local incompatibleParts = findIncompatiblePartsInShoppingCart()
  for slot, partName in pairs(incompatibleParts) do
    shoppingCart.partsIn[slot] = nil
  -- Add the partCondition of the new parts to the previewVehicle
  for _, part in pairs(shoppingCart.partsIn) do
    previewVehicle.partConditions[part.partPath] = part.partCondition
local function removePartBySlot(slot)
  for _, part in pairs(shoppingCart.partsIn) do
    if part.containingSlot == slot then
  local vehicle = career_modules_inventory.getVehicles()[currentVehicle]
  for slot, part in pairs(shoppingCart.partsOut) do
    part.location = 0

  for slot, part in pairs(shoppingCart.partsIn) do
    if part.emptyPlaceholder then
@/lua/ge/extensions/core/input/actionFilter.lua
  clearCFilter(filter)
  for actionGroupName, filtered in pairs(blockedActionGroups[filter]) do
    if filtered then
local function isActionBlocked(actionName)
  for filter, actions in pairs(blockedActions) do
    if actions[actionName] then
@/lua/ge/extensions/core/vehicleActivePooling.lua
    valid = true
    for id, _ in pairs(pools) do
      if id == new.id then
  if not data then return end
  for k, v in pairs(data) do
    self[k] = v
  if not keepVehicles then
    for k, v in pairs(self.inactiveVehs) do
      local obj = getObjectByID(v)

  for id, state in pairs(self.allVehs) do
    local obj = getObjectByID(id)
  if not name then return end
  for _, pool in pairs(pools) do
    if pool.name == name then return pool end
local function getPoolOfVeh(vehId)
  for id, pool in pairs(pools) do
    if pool.allVehs[vehId] then
local function deleteAllPools()
  for _, pool in pairs(pools) do
    pool:deletePool()
local function onVehicleActiveChanged(vehId, active)
  for _, pool in pairs(pools) do
    pool:_setVeh(vehId, active)
local function onVehicleDestroyed(vehId)
  for _, pool in pairs(pools) do
    pool:removeVeh(vehId)
  local data = {}
  for _, pool in pairs(pools) do
    table.insert(data, pool:onSerialize())
@/lua/ge/extensions/flowgraph/nodes/career/garageComputerUtil.lua

  for flag, act in pairs(self.flags) do
    self.pinOut[flag].value = act
@/lua/ge/extensions/gameplay/util/crashDetection.lua
  local totalDamage = 0
  for _, frameDamage in pairs(crashData.currentImpactData.frameDamages) do
    tempAveragePos:setAdd(frameDamage.vehPos)
    totalDamage = totalDamage + frameDamage.newDamage
    for vehId, _ in pairs(frameDamage.touchedVehIds) do
      tempVeh = be:getObjectByID(vehId)

  for _, impact in pairs(crashData.currentCrashImpacts) do
    if impact.touchedVehIds then
    if impact.touchedVehIds then
      for vehId, vehData in pairs(impact.touchedVehIds) do
        sanitizedCrashData.sanitizedData.touchedVehIds[vehId] = vehData
    end
    for _, frameDamage in pairs(impact.frameDamages) do
      sanitizedCrashData.totalDamage = sanitizedCrashData.totalDamage + frameDamage.newDamage
        -- remove oldest entries if we exceed max history
        for _, historyData in pairs(crashData.debug.histories) do
          if historyData.data and historyData.data[maxAccelHistory] then
local function populateImpactDataWithPreImpactData(crashData)
  for _, frameDamage in pairs(crashData.preImpactData.frameDamages) do
    table.insert(crashData.currentImpactData.frameDamages, frameDamage)
  -- using two arbitrary points to get a more accurate acceleration reading
  for _, point in pairs(crashData.accelData) do
    tempVecPos:set(vehData.pos + point.offsetFromCenter * vehData.dirVec)
    local vehicleListStr = ""
    for vehId, crashData in pairs(trackedVehIds) do
      if crashData.debug then
        local maxGraphNumber = 0
        for historyName, historyData in pairs(crashData.debug.histories) do
          if historyData.graphNumber and historyData.data then
  if crashData.currentCrashImpacts then
    for impactIndex, impactData in pairs(crashData.currentCrashImpacts) do
      -- draw the start of impact
      -- draw every frame damage
      for frameDamageIndex, frameDamageImpact in pairs(impactData.frameDamages) do
        if frameDamageImpact.isAboveDamageThreshold then
  table.clear(vehIdList)
  for vehId, _ in pairs(trackedVehIds) do
    table.insert(vehIdList, vehId)
@/lua/ge/extensions/ui/bindingsLegend.lua

  for _, action in pairs(actionsByName) do
    table.insert(result, action)
    -- get the modifier data from the cache and only update the active state
    for actionName, action in pairs(boundModifierActions) do
      if actionName == "modifier1modifier2" then
@/lua/ge/extensions/flowgraph/nodes/activity/activityHook.lua
  local pinData = {}
  for k, v in pairs(self.pinIn) do
    if k ~= 'flow' and k ~= 'reset' then
@/lua/vehicle/controller/bypassDampers.lua
  local beamNameLookup = {}
  for _, b in pairs(v.data.beams) do
    if b.name then
  local damperJbeamData = tableFromHeaderTable(jbeamData.dampers or {})
  for _, damperData in pairs(damperJbeamData) do
    local beamCid = beamNameLookup[damperData.beamName]
  local beamZones = {}
  for _, zone in pairs(zoneJbeamData) do
    local zoneData = {
  local sortedZoneDistances = {}
  for zoneDistance, _ in pairs(beamZones) do
    table.insert(sortedZoneDistances, zoneDistance)
@/lua/vehicle/extensions/aeroDebug.lua

  for _, wd in pairs(wheels.wheels) do
    local pos1 = obj:getNodePosition(wd.node1) + obj:getPosition()
    aeroData.wheelNameStrings = {}
    for _, wd in pairs(wheels.wheels) do
      table.insert(aeroData.wheelNameStrings, wd.name)
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarageSpots.lua
      local isLocal = self.pinIn.isLocal.value
      for name, spot in pairs(self.spots.byName) do
        if isLocal then
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
  editor.hideWindow(sensorPropWinName)
  for _, config in pairs(previewConfigs) do
    for _, preview in ipairs(config.openPreviews) do
@/lua/ge/extensions/core/camera.lua
    globalCamerasCache = {}
    for camName,constructor in pairs(getConstructors()) do
      local cam = constructor()
    runningCamsOrderCache = {}
    for camName,cam in pairs(getGlobalCameras()) do
      if cam.runningOrder then
  local camConfigs = {}
  for camMode,constructor in pairs(getConstructors()) do
    if tableFindKey(multicams, camMode) then
      local jbeamConfigs = vmcd[camMode] or {}
      for i,jbeamConfig in pairs(jbeamConfigs) do
        table.insert(camConfigs, {name=camMode.."."..jbeamConfig.name, constructor=constructor, jbeamConfig=jbeamConfig})
  local renaminingCamNames = {}
  for name, cam in pairs(vdata.cameras) do
    local configured = false
  if not cameraSet then
    for k,v in pairs(configuration) do
      if v.enabled and vdata.cameras[v.name] and not vdata.cameras[v.name].hidden then
  if not cameraSet then
    for k,v in pairs(configuration) do
      if vdata.cameras[v.name] then
    if vdata then
      for camName, camera in pairs(vdata.cameras) do
        camera.wasFocused = vdata.focusedCamName == camName
    if vdata then
      for _, camera in pairs(vdata.cameras) do
        if camera.wasFocused == true then
local function proxy_all(functionName, ...)
  for vid, vdata in pairs(getVehicleData()) do
    for _, cam in pairs(vdata.cameras) do
  for vid, vdata in pairs(getVehicleData()) do
    for _, cam in pairs(vdata.cameras) do
      if cam[functionName] then
  end
  for _,cam in pairs(getGlobalCameras()) do
    if cam[functionName] then
  settings.setValue('cameraConfig', "")
  for vid, vdata in pairs(getVehicleData()) do
    processVehicleCameraConfigChanged(vid, vdata, vdata.focusedCamName)
  data.globalCameras = {}
  for k,cam in pairs(getGlobalCameras()) do
    if cam.onSerialize then cam:onSerialize() end
  data.vehicleCameras = {}
  for vid, vdata in pairs(getVehicleData()) do
    data.vehicleCameras[vid] = {}
    data.vehicleCameras[vid].focusedCamName = vdata.focusedCamName
    for camName,cam in pairs(vdata.cameras) do
      data.vehicleCameras[vid].cameras[camName] = serialize(cam)
  -- global cameras
  for camName, cam in pairs(getGlobalCameras()) do
    if data.globalCameras[camName] then
  data.vehicleCameras = convertVehicleNameKeysToVehicleIdKeys(data.vehicleCameras)
  for vid, vdata in pairs(getVehicleData()) do
    local svdata = data.vehicleCameras[vid]
    local svdata = data.vehicleCameras[vid]
    for camName,cam in pairs(vdata.cameras) do
      if svdata then
@/lua/ge/extensions/gameplay/missions/missionTypes/baseMission.lua
  o:init()
  for k, v in pairs(derivedClass) do
    o[k] = v
@/lua/ge/extensions/editor/dataBlockEditor.lua
            inExistingTab = true
            for className, dataBlocks in pairs(dataBlockClasses) do
              if not tableIsEmpty(dataBlocks) then
          im.BeginChild1("New_Child", im.ImVec2(0, 0), false)
            for className, _ in pairs(dataBlockClasses) do
              im.TreeNodeEx1(className, bit.bor(im.TreeNodeFlags_Leaf))
@/lua/ge/extensions/freeroam/bigMapMarkers.lua
  local newOldMarkers = {}
  for clusterId, marker in pairs(oldMarkersByClusterId) do
    if not marker.visible then
  -- Move current markers to old markers list for gradual cleanup
  for clusterId, marker in pairs(markersByClusterId) do
    marker:hide()
  local markersToRemove = {}
  for clusterId, marker in pairs(oldMarkersByClusterId) do
    marker:update(updateData)
local function hideMarkers()
  for _, marker in pairs(markersByClusterId) do
    marker:hide()
  -- Also hide old markers
  for _, marker in pairs(oldMarkersByClusterId) do
    marker:hide()
  print("Clearing markers")
  for _, marker in pairs(markersByClusterId) do
    marker:clearObjects()
  -- Also clear old markers
  for _, marker in pairs(oldMarkersByClusterId) do
    marker:clearObjects()
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua

        for nodeIdx, v in pairs(vEditor.selectedASTNodeMap) do
          numSelectedLines = numSelectedLines + 1
@/lua/ge/extensions/editor/driftDataEditor.lua
  transformsUtils = {}
  for lineName, lineData in pairs(currDriftSpots[selectedDriftSpotId].spatialInfo.lines) do
    transformsUtils[lineName.."driftBox"] = createNewTransform("Sign pos", true, true, true, lineData.pos, quatFromEuler(lineData.rot.x, lineData.rot.y, lineData.rot.z), lineData.scl)
  }
  for lineName, lineData in pairs(spotData.spatialInfo.lines) do
    local newLineData = {
  local tempSpot
  for _, spotData in pairs(gameplay_drift_saveLoad.loadAndSanitizeDriftFreeroamSpotsCurrMap()) do
    tempSpot = sanitizeDriftSpot(spotData)
  currDriftSpots[spotId] = nil
  for key, value in pairs(currDriftSpots) do
    selectDriftSpot(key)
local function saveCurrentDriftSpots()
  for spotId, spotData in pairs(currDriftSpots) do
    local newSpotData = {
    local name = spotId:match("([^/]+)$")
    for lineName, lineData in pairs(spotData.spatialInfo.lines) do
      local newLineData = {
  im.TextWrapped("Drift spots in the current level: ")
  for spotId, spotData in pairs(currDriftSpots) do
    if im.Selectable1(spotId, spotId == selectedDriftSpotId) then
    im.Separator()
    for lineName, lineData in pairs(currDriftSpots[selectedDriftSpotId].spatialInfo.lines) do
      im.Text(lineName)
@/lua/common/extensions/ui/imguiWire.lua
extensions.load('ui_imgui')
for k, v in pairs(ui_imgui) do
  funcWrap(k)
@/lua/vehicle/thrusters.lua
  -- clusters
  for nodeId, thruster in pairs(clusterThrust) do
    local ttl = thruster[2]
  activeThrusters = {}
  for _, thruster in pairs(v.data.thrusters) do
    if thruster.control == "auto" then

  for _, thruster in pairs(activeThrusters) do
    thruster.factor = thruster.factor or 1
@/lua/ge/extensions/tech/sensors.lua
  local removedSensors = Research.SensorManager.removeSensorByVid(vid)
  for sensorId, sensorType in pairs(removedSensors) do
    extensions.hook('onSensorRemoved', sensorType, sensorId)
  local outData = {}
  for k, v in pairs(advancedIMULastRawReadings[sensorId]) do
    outData[k] = v
  local ctr = #advancedIMULastRawReadings[newReadings.sensorId]
  for k, v in pairs(newReadings.reading) do
    advancedIMULastRawReadings[newReadings.sensorId][ctr] = v
  local outData = {}
  for k, v in pairs(GPSLastRawReadings[sensorId]) do
    outData[k] = v
  local ctr = #GPSLastRawReadings[newReadings.sensorId]
  for k, v in pairs(newReadings.reading) do
    GPSLastRawReadings[newReadings.sensorId][ctr] = v
  local outData = {}
  for k, v in pairs(powertrainLastRawReadings[sensorId]) do
    outData[k] = v
  local ctr = #powertrainLastRawReadings[newReadings.sensorId]
  for k, v in pairs(newReadings.reading) do
    powertrainLastRawReadings[newReadings.sensorId][ctr] = v
  local outData = {}
  for k, v in pairs(idealRADARLastRawReadings[sensorId]) do
    outData[k] = v
  local ctr = #idealRADARLastRawReadings[newReadings.sensorId]
  for k, v in pairs(newReadings.reading) do
    idealRADARLastRawReadings[newReadings.sensorId][ctr] = v
  local outData = {}
  for k, v in pairs(roadsSensorLastRawReadings[sensorId]) do
    outData[k] = v
  local ctr = #roadsSensorLastRawReadings[newReadings.sensorId]
  for k, v in pairs(newReadings.reading) do
    roadsSensorLastRawReadings[newReadings.sensorId][ctr] = v
  local coords = {}
  for k, v in pairs(rawCoords) do
    coords[k] = { v.x, v.y, v.z }
  local rawNodes = map.getMap().nodes
  for k, v in pairs(rawNodes) do
    local n = v.normal
  end
  for sensorType, configs in pairs(luaSensorConfigurations) do
    for sensorId, _ in pairs(configs) do
  for sensorType, configs in pairs(luaSensorConfigurations) do
    for sensorId, _ in pairs(configs) do
      activeSensors[#activeSensors + 1] = {sensorType, sensorId}
  -- Manage all the Raw LiDAR sensor updates.
  for _, d in pairs(rawLidarData) do
  -- Perform visualisation for all ultrasonic sensors which require it.
  for sensorId, _ in pairs(visualisedUltrasonicSensors) do
    visualiseUltrasonicSensor(sensorId, dtSim)
@/lua/ge/extensions/gameplay/rally/notebook/pacenote.lua

  for _,wp in pairs(self.pacenoteWaypoints.objects) do
    foundTypes[wp.waypointType] = true
function C:onSerialize()
  for lang,langData in pairs(self.notes) do
    -- convert from old to new file format.
function C:upgradeFromV2ToV3()
  for lang,langData in pairs(self.notes) do
    local freeformnote = langData.note
function C:matchesSearchPattern(searchPattern)
  for lang,note in pairs(self.notes) do
    local fullNote = self:noteOutputFreeform(lang)
@/lua/vehicle/extensions/tech/GPS.lua
local function updateGFX(dtSim)
  for sensorId, _ in pairs(GPSs) do
    updateGPSGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(GPSs) do
    if vid == objectId then
@/lua/ge/extensions/ui/gridSelectorUtils/tilesModule.lua
    local groupsList = {}
    for _, group in pairs(groups) do
      if #group.tiles > 0 then
      -- Convert individual items to tiles
      for i, config in pairs(clusteredItems.configsByKey) do
        local tile = itemToTileConverter(config, true)
@/lua/ge/extensions/core/input/bindings.lua
  local testedKeys = {}
  for k1, v1 in pairs(t1) do
    local v2 = t2[k1]
  end
  for k2, v2 in pairs(t2) do
    if not testedKeys[k2] then
  local result = deepcopy(binding)
  for k, v in pairs(defaultBinding) do
    if deepcompare(result[k],v) then
  local count = 0
  for i,binding in pairs(bindings) do
    if binding.unused then
    end
    for k,v in pairs(fileData or {}) do
      if k == "bindings" then
  if list == nil then return result end
  for _,v in pairs(list) do
    if v.action  == nil then log("W", "bindings", "Binding is missing the 'action' field: " ..dumpbinding(v)) end
  local result = { bindings = {}, removed = {}, version = 1 }
  for k,v in pairs(old) do
    if k ~= "bindings" and k ~= "removed" then result[k] = v end
  local markedForRemoval = {}
  for k,v in pairs(dictOld) do
    if dictNew[k] == nil then
  -- process removed bindings
  for k,v in pairs(markedForRemoval) do
    log('D', 'bindings', "Removed binding (added to list): "..dumps(v.control).." : "..dumps(v.action))
  -- process modified/new bindings
  for k,v in pairs(dictNew) do
    if dumps(dictOld[k]) ~= dumps(v) then
local function applyResponseCurve(contents, path, curveInverted)
  for i,binding in pairs(contents.bindings) do
    if binding.ffb and binding.ffb.responseCorrected then
  if not allowDuplicates then
    for k,v in pairs(dictDiffReplaced) do
      for kk,vv in pairs(dictBase) do
    for k,v in pairs(dictDiffReplaced) do
      for kk,vv in pairs(dictBase) do
        if vv.control == v.control then
  -- merge removed bindings
  for k,v in pairs(dictDiffRemoved) do
    if dictBase[k] == nil then
  -- merge new/modified bindings
  for k,v in pairs(dictDiffReplaced) do
    dictBase[k] = v
  local bindings = {}
  for _,v in pairs(dictBase) do table.insert(bindings, cleanBindingDefaults(v)) end
  -- now check for removed devices
  for device,_ in pairs(oldDevices) do
    if newDevicesSet[device] == nil then
      local enabledActionsMap = {}
      for _, t in pairs(vd.vdata.actionsEnabled) do
        enabledActionsMap[t.name] = true
      -- fill/rewrite metadata (all except bindings themselves: guid, devtype...)
      for k,v in pairs(vehicleContents) do
        if k ~= "bindings" then contents[k] = v end
  local currentActions = {}
  for actionName,action in pairs(core_input_actions.getActiveActions()) do
    if action.vehicle == nil or action.vehicle == vehicleName then
  actionToControl = nil
  for i,s in pairs(ActionMap:getList())do
    for j,v in ipairs(s) do
    local vd = extensions.core_vehicle_manager.getVehicleData(veh:getId())
    for _, actionList in pairs(vd and vd.vdata and vd.vdata.triggerEventLinksDict or {}) do
      for _, linkList in pairs(actionList) do
    for _, actionList in pairs(vd and vd.vdata and vd.vdata.triggerEventLinksDict or {}) do
      for _, linkList in pairs(actionList) do
        for _, lnk in pairs(linkList) do
      for _, linkList in pairs(actionList) do
        for _, lnk in pairs(linkList) do
          if lnk.namespace == 'common' then
            lnk.inputAction = core_input_actions.upgradeAction(lnk.inputAction)
            for actionName, action in pairs(activeActions) do
              if actionName == lnk.inputAction then

  for _,data in pairs(M.bindings) do
    sendBindingsToGE(data.devname, data.contents.bindings, M.assignedPlayers[data.devname])
  -- remove the "unused" flag from the bindings for comparing and writing to disk
  for k,v in pairs(defaultData.bindings) do v.unused = nil end
  for k,v in pairs(data.bindings) do v.unused = nil end
  for k,v in pairs(defaultData.bindings) do v.unused = nil end
  for k,v in pairs(data.bindings) do v.unused = nil end
  -- convert from vehicle__actionname to actionname. this name-mangling is needed to prevent collisions with other vehicles' action names
  for _,b in pairs(diffData.bindings or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
  for _,b in pairs(diffData.removed  or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
  for _,b in pairs(diffData.bindings or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
  for _,b in pairs(diffData.removed  or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
  -- normal bindings
  for devname,info in pairs(M.devices) do
    if resetAllDevices or devname == desiredDevName then
  -- vehicle specific bindings
  for devname,info in pairs(M.devices) do
    if resetAllDevices or devname == desiredDevName then
  setMenuActionEnabled(enabled, nil, "MenuActionMap")
  for menuActionMapName,_ in pairs(core_input_actions.menuActionMapNames) do
    setMenuActionEnabled(enabled, nil, menuActionMapName)
@/lua/vehicle/powertrain/electricMotor.lua

  for k, v in pairs(device.torqueCurve) do
    if type(k) == "number" then
  device.energyStorageRegenRatios = {}
  for _, s in pairs(device.registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
  local previousStorageCount = device.storageWithEnergyCounter
  for _, s in pairs(device.registeredEnergyStorages) do
    local storage = energyStorage.getStorage(s)
    local hasValidReactioNodes = true
    for _, v in pairs(torqueReactionNodes_nodes) do
      if type(v) ~= "number" then
  local points = {}
  for _, v in pairs(torqueTable) do
    table.insert(points, {v.rpm, v.torque})
    points = {}
    for _, v in pairs(regenTorqueTable) do
      table.insert(points, {v.rpm, v.torque})
  tempElectricalEfficiencyTable = {}
  for k, v in pairs(copy) do
    if type(k) == "number" then
  device.electricalEfficiencyTable = {}
  for k, v in pairs(tempElectricalEfficiencyTable) do
    device.electricalEfficiencyTable[k * 0.01] = v
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/startScreenDial.lua
  end
  for racerId, racerData in pairs(dragData.racers) do
    table.insert(self.panel.dials,
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
  -- check for patched data from mission instance and apply it to the mission data
  for k, v in pairs(self.missionInstance.setupModules) do
    if v._compatibility then

  for k, v in pairs(m.setupModules) do
    if v.enabled == nil or (v.enabled and tableSize(v) <= 1) then
@/lua/vehicle/extensions/tech/mesh.lua
local function onVehicleDestroyed(vid)
  for sensorId, _ in pairs(meshes) do
    if vid == objectId then
local function updateGFX(dtSim)
  for sensorId, _ in pairs(meshes) do
    updateMesh(dtSim, sensorId, false, nil)
@/lua/ge/extensions/core/multiseat.lua
          local leastUsedN = math.huge
          for id,n in pairs(usedVehicles) do
            if n < leastUsedN then
@/lua/common/particles.lua
local function getOrAddMaterialIDByName(mats, s)
    for k, v in pairs(mats) do
        --print(" "..s.." == "..v.name)
local function getMaterialIDByName(mats, s)
    for k,v in pairs(mats) do
        --print(" "..s.." == "..v.name)
    -- fix the constants
    for k,v in pairs(particles) do
        v.materialID1 = getOrAddMaterialIDByName(materials, v.materialID1)
        local fields = {}
        for kc,vc in pairs(comparefields) do
            if v[kc] ~= "" then
@/lua/ge/extensions/gameplay/race/race.lua
  local pathLen = #self.aiDetailedPath
  for id, data in pairs(self.states) do
    if data.complete then
  local t = math.huge
  for k, v in pairs(inside) do
    if v ~= nil then
    if state.skippedLap then -- sets the segment to the final one
      for segId, currentSegment in pairs(self.path.config.graph) do
        if currentSegment.lastInLap then

  for id, state in pairs(self.states) do
    if state.timeDifferenceToFirst ~= nil then
@/lua/vehicle/partCondition.lua
  local partTypeTags
  for k, v in pairs(partData) do
    if type(v) == "table" then
  local partTypeTags = {}
  for _, flexbody in pairs(v.data.flexbodies) do
    --TODO: check maybe a tag that tells us if the flexbody can change color (and how?), paint vs glas vs plastic etc
  local beamsPerPart = {}
  for _, beam in pairs(v.data.beams) do
    if beam.partPath then

  for partId, partData in pairs(beamsPerPart) do
    if partData.deformableBeams > 0 or partData.breakableBeams > 0 then
  activeParts = {}
  for partId, partTypeName in pairs(v.data.activeParts) do
    activeParts[partId] = v.data.activePartsData[partTypeName]

  for partId, partData in pairs(activeParts) do
    --save root part id for later
    if powertrainClues then
      for part, types in pairs(powertrainClues) do
        partTypeData[part] = partTypeData[part] or {}
        partTypeData[part] = partTypeData[part] or {}
        for _, partType in pairs(types) do
          table.insert(partTypeData[part], partType)
  if flexbodyClues then
    for part, types in pairs(flexbodyClues) do
      partTypeData[part] = partTypeData[part] or {}
      partTypeData[part] = partTypeData[part] or {}
      for _, partType in pairs(types) do
        table.insert(partTypeData[part], partType)
  if jbeamClues then
    for part, types in pairs(jbeamClues) do
      partTypeData[part] = partTypeData[part] or {}
      partTypeData[part] = partTypeData[part] or {}
      for _, partType in pairs(types) do
        table.insert(partTypeData[part], partType)

  for partId, types in pairs(partTypeData) do
    local deduplication = {}
    local deduplication = {}
    for _, partType in pairs(types) do
      deduplication[partType] = true
    partTypeData[partId] = {}
    for partType, _ in pairs(deduplication) do
      table.insert(partTypeData[partId], partType)
local function setAllPartPaints(paints, paintOdometer)
  for partId, _ in pairs(activeParts) do
    setPartPaints(partId, paints, paintOdometer)
  local result = {}
  for partId, _ in pairs(activeParts) do
    xpcall(
    log("I", "partCondition.initConditions", "Parts condition not provided for vehicle, assuming fresh vehicle state for vehicle Id: " .. dumps(objectId))
    for partId, _ in pairs(activeParts) do
      initCondition(partId, fallbackOdometer or 0, fallbackIntegrityValue or 1, fallbackVisualValue or 1, defaultPaints)
  end
  for partId in pairs(activeParts) do
    local odometer, integrity, visual
@/lua/vehicle/extensions/tech/ACC.lua
    local keys = {}
    for key in pairs(tbl) do
        table.insert(keys, key)
local function getMass()
    for _, n in pairs(v.data.nodes) do
        mass = mass + n.nodeWeight
    local sum = 0
    for _, v in pairs(t) do
        sum = sum + v
    local vehicles, ctr = {}, 1
    for k, _ in pairs(mapmgr.getObjects()) do
        if k ~= objectId then
    if next(simData) ~= nil then
        for k, v in pairs(simData) do
            if type(v) == "table" then
                if k == "closestVehicles1" then
                    for k2, v2 in pairs(v) do
                        if k2 == "distToPlayerVehicleSq" then
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
local function createMenu(subItems)
  for _, item in pairs(subItems) do
    if item.group then
local function drawAlwaysVisibleToolbars()
  for key, val in pairs(editor.editModes) do
    if val["toolbarAlwaysVisible"] and val.onToolbar then
local function toolbarAlwaysVisibleModeExists()
  for key, val in pairs(editor.editModes) do
    if val["toolbarAlwaysVisible"] and val.onToolbar then
@/lua/ge/extensions/flowgraph/nodes/ui/contextTranslation.lua

  for nm, pin in pairs(self.pinInLocal) do
    if nm ~= 'flow' and nm ~= 'translationString' then
      if self.variablesState == 2 then
        for nm, pin in pairs(self.pinInLocal) do
          if nm ~= 'flow' and nm ~= 'translationString' then
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
  local t = { lines = {} }
  for k,v in pairs(Dumper) do t[k] = v end
        local txt = "{"
        for k,v in pairs(value) do
          txt = txt..safe_tostring(k)..":"..safe_tostring(v)
        end
        --for k,v in pairs(info) do print(k,v) end
        fun_name = fun_name or GuessFunctionName(info)
    local first = true
    for k,v in pairs(message) do
      if first then
      --print(info.namewhat, info.name)
      --for k,v in pairs(info) do print(k,v, type(v)) end
      local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name or tostring(info.func)
      --print("tail")
      --for k,v in pairs(info) do print(k,v, type(v)) end--print(info.namewhat, info.name)
      dumper:add_f("\n(%d) tail call", level_to_show)
      if not function_name or function_name == "?" then
        --for k,v in pairs(info) do print(k,v, type(v)) end
        function_name = GuessFunctionName(info)
    local first = true
    for k,v in pairs(message) do
      if first then
      --print(info.namewhat, info.name)
      --for k,v in pairs(info) do print(k,v, type(v)) end
      local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name or tostring(info.func)
      --print("tail")
      --for k,v in pairs(info) do print(k,v, type(v)) end--print(info.namewhat, info.name)
      dumper:add_f("(%d) tail call\n", level_to_show)
      if not function_name or function_name == "?" then
        --for k,v in pairs(info) do print(k,v, type(v)) end
        function_name = GuessFunctionName(info)
@/lua/vehicle/extensions/escMeasurement.lua
    local lines = {}
    for sp, spData in pairs(measurementsSTM) do
      for wap, wapData in pairs(spData) do
    for sp, spData in pairs(measurementsSTM) do
      for wap, wapData in pairs(spData) do
        local avgYawRate = 0

  -- for _, v in pairs(data[10] or {}) do
  --   filePivot:write(string.format("%.0f,%.0f,%.0f\r\n", v.frontWheelAngle * 1000, v.measuredYawAV * 1000, v.measuredBodySlipAngle * 1000))
@/lua/ge/extensions/career/modules/inventory.lua

      for inventoryId, transform in pairs(inventoryData.spawnedPlayerVehicles) do
        inventoryId = tonumber(inventoryId)
  local callbackCounter = 0
  for vehId, inventoryId in pairs(vehIdToInventoryId) do
    setVehicleDirty(inventoryId)
local function checkSaveFinished(currentSavePath, oldSaveDate)
  for _, fin in pairs(finishedSaveTasks) do
    if not fin then

  for id, vehicle in pairs(vehiclesCopy) do
    if dirtiedVehicles[id] or not vehicle.dirtyDate then
  data.spawnedPlayerVehicles = {}
  for inventoryId, vehId in pairs(inventoryIdToVehId) do
    local veh = getObjectByID(vehId)
  local ownedVehiclesAmount = 0
  for inventoryId, vehicle in pairs(vehicles) do
    if vehicle.owned and not vehicle.takesNoInventorySpace then ownedVehiclesAmount = ownedVehiclesAmount + 1 end
      local vehiclesToTeleportToGarage = {}
      for inventoryId, location in pairs(loadedVehiclesLocations) do
        local vehInfo = vehicles[inventoryId]
        function (job)
          for inventoryId, location in pairs(vehiclesToTeleportToGarage) do
            local veh = getObjectByID(location.vehId)
  if sellAllVehicles then
    for inventoryId, vehicle in pairs(vehicles) do
      if vehicle.owned then
  local res = {}
  for inventoryId, vehId in pairs(inventoryIdToVehId) do
    spawnedVehicles[inventoryId] = getObjectByID(vehId)
  for _, zone in ipairs(zones) do
    for inventoryId, veh in pairs(spawnedVehicles) do
      if intersecting then
  local inventoryIdsInGarage = getVehiclesInGarage(garage, true)
  for otherInventoryId, _ in pairs(inventoryIdsInGarage) do
    if otherInventoryId ~= inventoryId then

  for otherInventoryId, _ in pairs(inventoryIdsInGarage) do
    if otherInventoryId ~= inventoryId then

  for inventoryId, vehicle in pairs(vehicles) do
    data.vehicles[tostring(inventoryId)] = getVehicleUiData(inventoryId, inventoryIdsInGarage)

  for inventoryId, vehInfo in pairs(vehicles) do
    if vehInfo.timeToAccess then
  local inventoryIdsList = {}
  for inventoryId, _ in pairs(inventoryIdsInGarage) do
    table.insert(inventoryIdsList, inventoryId)
  if next(inventoryIdToVehId) then
    for invId, vehId in pairs(inventoryIdToVehId) do
      if be:getPlayerVehicleID(0) ~= vehId then -- don't display the current player's vehicle
@/lua/ge/extensions/editor/slotTrafficEditor.lua
  local res
  for nid, _ in pairs(nodes) do
    if distances[nid] < min or not res then
  -- remove all nodes that are too far away
  for otherNid, data in pairs(mapNodes) do
    if data.pos:squaredDistance(node.pos) > square(maxConnectionRenderDistance) then
      -- remove the links
      for otherNid2, _ in pairs(data.links) do
        if nodesToCheck[otherNid2] then

    for neighbor, otherLinkData in pairs(nextNodeData.links) do
      if nodesToCheck[neighbor] and otherLinkData.inNode == nextNid then
  -- Add distances to the links that are close enough, but not on any shortest route from any node
  for otherNid, data in pairs(mapNodes) do
    if distancesOfLinks[otherNid] then
    if distancesOfLinks[otherNid] then
      for neighbor, linkData in pairs(data.links) do
        if distancesOfLinks[neighbor] and not distancesOfLinks[otherNid][neighbor] then
  local result
  for nid1, nodeLinks in pairs(editor.selection.stLink) do
    for nid2, _ in pairs(nodeLinks) do
  for nid1, nodeLinks in pairs(editor.selection.stLink) do
    for nid2, _ in pairs(nodeLinks) do
      if result then return nil end
local function isLinkSelectionEmpty()
  for nid1, nodeLinks in pairs(editor.selection.stLink) do
    for nid2, _ in pairs(nodeLinks) do
  for nid1, nodeLinks in pairs(editor.selection.stLink) do
    for nid2, _ in pairs(nodeLinks) do
      return false
    -- Find which road this link belongs to
    for roadId, road in pairs(roads) do
      local controlPoints = road.controlPoints
local function changeNodeFieldActionUndo(actionData)
  for nid, _ in pairs(actionData.nids) do
    setNodeField(nid, actionData.fieldName, actionData.oldValues[nid])
local function changeNodeFieldActionRedo(actionData)
  for nid, _ in pairs(actionData.nids) do
    setNodeField(nid, actionData.fieldName, actionData.newValues[nid])
  local result = {}
  for nid, _ in pairs(nids) do
    result[nid] = mapNodes[nid].links
  nids[nid] = true
  for nid1, links in pairs(getConnectedLinks(nids)) do
    for nid2, link in pairs(links) do
  for nid1, links in pairs(getConnectedLinks(nids)) do
    for nid2, link in pairs(links) do
      deleteLink(nid1, nid2)
  if actionData.linkInfos then
    for nid1, links in pairs(actionData.linkInfos) do
      for nid2, linkInfo in pairs(links) do
    for nid1, links in pairs(actionData.linkInfos) do
      for nid2, linkInfo in pairs(links) do
        deleteLink(nid1, nid2)
  if actionData.linkInfos then
    for nid1, links in pairs(actionData.linkInfos) do
      for nid2, linkInfo in pairs(links) do
    for nid1, links in pairs(actionData.linkInfos) do
      for nid2, linkInfo in pairs(links) do
        mapNodes[nid1].links[nid2] = linkInfo
  -- Draw road segments connected to this node
  for roadId, road in pairs(roads) do
    local controlPoints = road.controlPoints
  mapNodes = {}
  for nid, node in pairs(rawNodes) do
    mapNodes[nid] = {
  -- Add links temporarily for road tracing
  for nid1, node in pairs(rawNodes) do
    for nid2, link in pairs(node.links) do
  for nid1, node in pairs(rawNodes) do
    for nid2, link in pairs(node.links) do
      -- Create two-way links for easier traversal

    for linkedNodeId, linkData in pairs(node.links) do
      if linkedNodeId ~= prevNodeId and
    if not prevNodeId then
      for linkedNodeId, _ in pairs(mapNodes[currentNodeId].links) do
        if not processedLinks[currentNodeId .. "-" .. linkedNodeId] and
  -- Process all nodes and links to create roads
  for nodeId, node in pairs(mapNodes) do
    -- Find unprocessed links from this node
    -- Find unprocessed links from this node
    for linkedNodeId, _ in pairs(node.links) do
      if not processedLinks[nodeId .. "-" .. linkedNodeId] and
  -- Clear temporary links from mapNodes
  for nid, node in pairs(mapNodes) do
    node.links = {}
    mapNodes = loadedNavgraph
    for nid1, node in pairs(mapNodes) do
      for nid2, link in pairs(node.links) do
    for nid1, node in pairs(mapNodes) do
      for nid2, link in pairs(node.links) do
        mapNodes[nid2].links[nid1] = link
          local roadsArray = {}
          for roadId, road in pairs(roads) do
            -- Apply filter if any

        for roadId, road in pairs(roads) do
          local controlPoints = road.controlPoints
        -- First add all nodes to the quadtree
        for nid, n in pairs(mapNodes) do
          local nPos = n.pos
        -- Then add edges from roads
        for roadId, road in pairs(roads) do
          local controlPoints = road.controlPoints

        for otherNid, link in pairs(node.links) do
          if link.inNode == nid then
          if not tableIsEmpty(editor.selection.stNode) then
            for nodeId, _ in pairs(editor.selection.stNode) do
              nodeOldPositions[nodeId] = mapNodes[nodeId].pos
          local newValues = {}
          for nid, _ in pairs(editor.selection.stNode) do
            newValues[nid] = vec3(mapNodes[nid].pos)
            if core_forest.getForestObject() then core_forest.getForestObject():disableCollision() end
            for nodeId, _ in pairs(editor.selection.stNode) do
              local rayDist = castRayStatic(nodeOldPositions[nodeId] + nodeOffset + upVector, downVector, 10)

  for nid, _ in pairs(mapNodes) do
    editor.selection.stNode[nid] = true
    local nodeInfos = {}
    for nid, _ in pairs(editor.selection.stNode) do
      local nodeInfo = {nid = nid, pos = vec3(mapNodes[nid].pos), radius = mapNodes[nid].radius, links = deepcopy(mapNodes[nid].links)}
    local linkInfos = {}
    for nid1, nodeLinks in pairs(editor.selection.stLink) do
      for nid2, _ in pairs(nodeLinks) do
    for nid1, nodeLinks in pairs(editor.selection.stLink) do
      for nid2, _ in pairs(nodeLinks) do
        if not linkInfos[nid1] then linkInfos[nid1] = {} end
    local mapNodesCopy = deepcopy(mapNodes)
    for nid1, node in pairs(mapNodes) do
      for nid2, link in pairs(node.links) do
    for nid1, node in pairs(mapNodes) do
      for nid2, link in pairs(node.links) do
        if link.inNode ~= nid1 then
@/lua/vehicle/extensions/tech/techCore.lua
  sensorRequest = request['sensors']
  for k, v in pairs(sensorRequest) do
    data = getSensorData(v)
@/lua/vehicle/controller/tech/MQTToutput.lua
local function init(jbeamData)
  for wheelId, wheel in pairs(wheels.wheels) do
    wheelLookup[wheel.name] = wheelId
@/lua/ge/extensions/flowgraph/nodes/states/stateExit.lua
  if self.graph:getParent() then
    for id, node in pairs(self.graph:getParent().nodes) do
      if node.targetGraph and node.targetGraph.id == self.graph.id then
@/lua/ge/extensions/career/modules/partInventory.lua
    if node.chosenPartName and node.chosenPartName ~= "" then
      for partId, inventoryPart in pairs(partInventory) do
        if inventoryPart.containingSlot == node.path and inventoryPart.location == vehicle.id then
    if node.children then
      for _, childNode in pairs(node.children) do
        traverseTree(childNode)
  initialRemovedNode.children = {}
  for partId, part in pairs(disconnectedParts) do
    -- remove the part
  local movedOut = {}
  for partId, _ in pairs(partsBefore) do
    if not partsAfter[partId] then
  local result = {}
  for partId, part in pairs(partInventory) do
    if part.location == inventoryId then
  if tree.children then
    for childSlot, childInfo in pairs(tree.children) do
      addPartFromTree(result, childInfo, vehicleData, availableParts, vehObj, inventoryId, partConditions)
  table.clear(coreSlots)
  for partId, part in pairs(partInventory) do
    coreSlots[part.location] = coreSlots[part.location] or {}
    if part.description.slotInfoUi then
      for slotName, slotInfo in pairs(part.description.slotInfoUi) do
        if slotInfo.coreSlot then
  table.clear(partPathToPartIdMap)
  for partId, part in pairs(partInventory) do
    slotToPartIdMap[part.location] = slotToPartIdMap[part.location] or {}
local function updatePartConditionsInInventory()
  for partId, part in pairs(partInventory) do
    if part.location > 0 and career_modules_inventory.getVehicles()[part.location].partConditions[part.partPath] then
  local vehicle = career_modules_inventory.getVehicles()[inventoryId]
  for partId, _ in pairs(partsThatMoved.movedOut) do
    local part = partInventory[partId]
  imgui.BeginChild1("partsInVehicle", imgui.ImVec2(200, 0), imgui.WindowFlags_ChildWindow)
    for partId, part in pairs(partInventory) do
      if part.location == currentVehicleInventoryIdForMenu then
    imgui.TableNextColumn()
    for partId, part in pairs(partInventory) do
      imgui.Text("" .. partId)
  data.brokenVehicleInventoryIds = {}
  for inventoryId, vehicle in pairs(vehicles) do
    data.brokenVehicleInventoryIds[tostring(inventoryId)] = career_modules_insurance_insurance.inventoryVehNeedsRepair(inventoryId)

  for partId, part in pairs(partInventory) do
    if not part.mainPart then
  local partInventoryCopy = deepcopy(partInventory)
  for partId, part in pairs(partInventoryCopy) do
    part.description = nil

  for partId, part in pairs(partInventory) do
    vehicleModels[part.vehicleModel] = true
  -- TODO if we need this data more often, we can put it in a local table in this file
  for vehicleModel, _ in pairs(vehicleModels) do
    local vehicleDir = string.format("/vehicles/%s/", vehicleModel)

  for partId, part in pairs(partInventory) do
    local partInfosVehicleModel = jBeamPartInfos[part.vehicleModel]
      -- Update older versions to use "slotType" instead of "slot"
      for partId, part in pairs(partInventory) do
        part.slotType = part.slot
      local partsToSell = {}
      for partId, part in pairs(partInventory) do
        if part.location == 0 then
  local partsToRemove = {}
  for partId, part in pairs(partInventory) do
    if part.location == inventoryId then

  for partId, _ in pairs(partsToRemove) do
    partInventory[partId] = nil
local function getPart(inventoryId, path)
  for partId, part in pairs(partInventory) do
    if part.location == inventoryId and part.containingSlot == path then
    local dirtyVehiclesList = {}
    for invId, _ in pairs(dirtyVehicles) do
      table.insert(dirtyVehiclesList, invId)
@/lua/common/jbeam/sections/camera.lua
local function cleanCameraData(d)
  for k, v in pairs(d) do
    -- delete unneeded data to keep the messages small
  local cameraData = {}
  for k,v in pairs(vehicle.cameras) do
    v = deepcopy(v) or {}
      local driverCameraSet = false -- only set 'driver' once
      for k, v in pairs(vehicle[oldName]) do
        -- rename variable "type" to "name"
  if vehicle.cameras ~= nil and vehicle.cameras.onboard ~= nil then
    for icKey, icam in pairs(vehicle.cameras.onboard) do
      if type(icam.x) == 'number' and type(icam.y) == 'number' and type(icam.z) == 'number' then
    -- try to emulate one from deducing values from the onboard camera system
    for icKey, icam in pairs(vehicle.cameras.onboard) do
      if type(icam.x) == 'number' and type(icam.y) == 'number' and type(icam.z) == 'number' then
      -- convert position table to vec3
      for _, cr in pairs(vehicle.cameras.relative) do
        cr.pos = vec3(cr)
    local foundCameras = {}
    for k, v in pairs(vehicle.cameras.onboard) do
      -- automatic numeric naming
@/lua/vehicle/controller/propAnimation/googlyEyes.lua

  for cid, data in pairs(eyeBeamData) do
    obj:setBeamLength(cid, data.defaultLength * sizeCoef)
  local boundCoef = linearScale(sizeCoef, maxSizeCoef, minSizeCoef, maxSizeBoundCoef, minSizeBoundCoef)
  for cid, data in pairs(eyeLimiterData) do
    obj:setBoundedBeamLongBound(cid, data.defaultLongBound * boundCoef)
  local attachmentCoef = linearScale(sizeCoef, minSizeCoef, maxSizeCoef, attachmentMinSizeCoef, attachmentMaxSizeCoef)
  for cid, data in pairs(eyeAttachmentData) do
    obj:setBeamLength(cid, data.defaultLength * attachmentCoef)
@/lua/ge/extensions/editor/gen/terrain.lua
    T.out[cname] = {}
    for i,p in pairs(list) do
        local v = f and f(p) or p
    aloop = {}
    for key,_ in pairs(legend) do
        T.out[key] = nil
    local rdlist = editor.getAllRoads()
    for roadID,_ in pairs(rdlist) do
        local rd = scenetree.findObjectById(roadID)
    end
    for _,p in pairs(mask) do
        tb:setHeightWs(p, 0)
local function corr(dw1, dw2)
    for f,d in pairs(dw2) do
        if not f2p[f] then f2p[f] = {list={}} end
            -- frequency goes on
            for _,p in pairs(f2p[f].list) do
                p[2] = p[2] + 1
--    for
    for f,d in pairs(f2p) do
        for _,p in pairs(d.list) do
    for f,d in pairs(f2p) do
        for _,p in pairs(d.list) do
            waveUp(f, p)
        lo('>> regionPlot:'..#aregion)
        for i,r in pairs(aregion) do
            aregion[i] = {p=r.p, w=r.w}
--            local dmi,imi = math.huge
            for k,d in pairs(aregion) do
                -- pick strongest
--        toMark(ap, 'white', nil, 0.2, 0.5)
    for i,list in pairs(afill) do
        aregion[i].amark = {}
        aregion[i].amark = {}
        for _,p in pairs(list) do
            aregion[i].amark[#aregion[i].amark+1] = p+vec3(0,0,forZ(p))
            U.dump(ahit, '?? for_HIT:'..#ahit)
            for i,d in pairs(ahit) do
                lo('?? for_HIT:'..i..':'..path[d.ind].seg.ind)
    end
    for i,h in pairs(ahit) do
        if i>1 and ahit[i-1].isclose then
--        decalUp(dec)
--    for i,p in pairs(ahit) do
    end
    -- project loop along dir
    for i,n in pairs(loop) do
--        local p,s =
                local am1 = {}
            for i,d in pairs(loop) do
                local pp,s = U.toLine(d.p, {a,b})
        end
        for i,b in pairs(junc.list) do
--                lo('?? for_BR:'..i..':'..b.ind)
        if not asli2 or not asli1 then return end
        for k,s in pairs(asli2) do
            local L = s[1]:distance(s[2])
            local dmi,dma,lmi,lma,pmi,pma = math.huge,0
            for l,t in pairs(asli1) do
                -- s - distance from s[1]
    local function ext(asli)
        for i,s in pairs(asli) do
            if s.w > default.WMI_TOMERGE*D.default.laneWidth then
                    local dmi,kmi = math.huge
                    for k,h in pairs(ahit) do
                        local dist = h.p:distance(s.list[1])
                    dmi,kmi = math.huge
                    for k,h in pairs(ahit) do
                        local dist = h.p:distance(s.list[#s.list])
                lo('?? for_SLI1:'..tostring(asli1 and #asli1 or nil)..':'..#loop)
            for _,s in pairs(asli1) do
                local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
--[[
        for _,s in pairs(asli2) do
            local desc = {list=s, w=(_==1 and 1.4 or 1)*D.default.laneWidth, mat='WarningMaterial', skip=true}
        ext(aslice)
        for _,s in pairs(asli2) do
            local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
        hasexit = false
        for i,s in pairs(asli1) do
            if i>1 and aslice[#aslice].w > default.WMI_TOMERGE*D.default.laneWidth then
        hasexit = false
        for i,s in pairs(asli2) do
            if i>1 and aslice[#aslice].w > default.WMI_TOMERGE*D.default.laneWidth then

    for i,desc in pairs(aslice) do
        decalUp(desc)
--[[
        for t,v in pairs(loop) do
            lo('?? in_LOOP:'..t..':'..tostring(v.p)..':'..tostring(v.w))
    T.out.inplace = true
    for i,r in pairs(aregion) do
        r.amark = nil
    local anode = {}
    for key,seg in pairs(dnode) do
        for i=1,2 do
                local p = vec3(0,0,0)
                for _,e in pairs(seg[i]) do
                    p = p + e
    -- build stars
    for i,r in pairs(aregion) do
        r.star = {} -- indexes of relevant nodes
        r.star = {} -- indexes of relevant nodes
        for k,n in pairs(anode) do
            if #U.index(n.key,i) > 0 then
            if i == 4 then
                for _,k in pairs(r.star) do
                    lo('?? for_ang:'..k..':'..U.vang(anode[k].p-r.p, vec3(1,0),true))
    local aseg = {}
    for i,r in pairs(aregion) do
        for k,ni in pairs(r.star) do
    for i,r in pairs(aregion) do
        for k,ni in pairs(r.star) do
            local nito = U.mod(k+1, r.star)
    -- place decals
    for key,s in pairs(aseg) do
        --- add segment
            desc.ind = #adec
            for _,ir in pairs(s.areg) do
                local reg = aregion[ir]
    local desc,reg
    for k,s in pairs(aseg) do
        reg = aregion[s.areg[1]]
            local dmi,imi = math.huge
            for i,p in pairs(s.list) do
                local L = aregion[s.areg[1]].p:distance(p)+aregion[s.areg[2]].p:distance(p)
            if reg.arad and #reg.arad > 0 then
                for k,d in pairs(reg.arad) do
                    rmi = rmi + d.list[1]:distance(d.list[#d.list])
        lo('?? pre_LOAD:'..#adec)
--        for i,d in pairs(adec) do
--            lo('?? for_DEC:'..i..':'..d.ind)
-- APPEND valency-2 junctions
    for i,reg in pairs(aregion) do
        local jset
        local jset
        for j,junc in pairs(ajunc) do
            if junc.p:distance(reg.p) < 1 then
                junc.list = reg.arad
                for i,b in pairs(junc.list) do
                    if junc.p:distance(b.list[1]) < 1 then
            ajunc[#ajunc+1] = {p=reg.p, list=reg.arad}
            for i,b in pairs(ajunc[#ajunc].list) do
                if ajunc[#ajunc].p:distance(b.list[1]) < 1 then
--        if true then return end
--        for i,c in pairs(ajunc) do
--            lo('?? for_junc:'..i..':'..tostring(c.p))
--        U.dump(across, '?? across:')
    for t,reg in pairs(aregion) do
        reg.amark = nil
--            lo('?? for_JUNC:'..#ajunc)
        for k,c in pairs(ajunc) do
--                lo('?? if_dist:'.._..':'..tostring(c.p)..':'..tostring(reg.p))
            if c.p:distance(reg.p) < U.small_dist then
                for i,b in pairs(c.list) do
--                        lo('?? for_SEC:'..t..':'..i)
--            toMark({junc.list[1].list[1],junc.list[1].list[#junc.list[1].list]}, 'mag', nil, 0.1, 1)
        for i,b in pairs(junc.list) do
--                lo('?? for_BR:'..i..':'..b.ind)
    local function trim(asli2,asli1)
        for k,s in pairs(asli2) do
            local L = s[1]:distance(s[2])
            local dmi,dma,lmi,lma,pmi,pma = math.huge,0
            for l,t in pairs(asli1) do
                -- s - distance from s[1]
--[[
    for i,r in pairs(aregion) do
        for k,s in pairs(aseg) do
    for i,r in pairs(aregion) do
        for k,s in pairs(aseg) do
            if #U.index(s.areg, i) > 0 then
                    -- render
                    for i,s in pairs(asli1) do
                        local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
                    end
                    for i,s in pairs(asli2) do
                        local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
--[[
                        for i,s in pairs(asli1) do
                            local desc = {list=s, w=1*D.default.laneWidth, mat='WarningMaterial'}
                        if true then return end
                    for i,s in pairs(asli2) do
                        local desc = {list=s, w=1*D.default.laneWidth, mat='WarningMaterial'}
            for j=i+1,#aregion do
                for _,nd in pairs(anode) do
                    if #U.index(nd.key,i)>0 and #U.index(nd.key,j)>0 then
        -- place decals
        for key,s in pairs(aseg) do
            if #s == 2 then
        aregion = jsonDecode(str)
        for i,d in pairs(aregion) do
            d.p = vec3(d.p.x,d.p.y)
    ama = 0
    for i,v in pairs(dw) do
        if v > ama then
--            aregion = jsonDecode(str)
            for i,d in pairs(aregion) do
                d.p = vec3(d.p.x,d.p.y)
        local loop = aloop[T.out.insector]
        for i,rd in pairs(loop.aslice) do
            decalDel(rd.ind)
        local loop = aloop[T.out.insector]
        for i,rd in pairs(loop.aslice) do
            decalDel(rd.ind)
        local loop = aloop[T.out.insector]
        for i,rd in pairs(loop.aslice) do
            decalDel(rd.ind)
        local loop = aloop[T.out.insector]
        for i,rd in pairs(loop.aslice) do
            decalDel(rd.ind)
        -- clean
        for i,rd in pairs(loop.aslice) do
--                lo('?? to_del:'..rd.ind..':'..#adec) --..':'..adec[rd.ind].ind)
            local torem
            for i,d in pairs(aregion) do
                if U.angDist(d.p) < 0.06 then
                local dmi,lmi,imi,pmi = math.huge
                for i,loop in pairs(aloop) do
                    local poly = {}
                    local poly = {}
                    for j,v in pairs(loop.list) do
                        poly[#poly+1] = v.p
--[[
            for i,reg in pairs(aregion) do
                if reg.p:distance(rayCast.pos) < 10 then
            local dmi,lmi,imi,pmi = math.huge
            for i,loop in pairs(aloop) do
                local poly = {}
                local poly = {}
                for j,v in pairs(loop.list) do
                    poly[#poly+1] = v.p
--[[
                for j,v in pairs(loop.list) do
                    if v.p:distance(p)
    if im.IsMouseReleased(0) then
        for key,val in pairs(dval) do
                lo('?? for_val:'..key..':'..val)
	if w ~= 0 and editor.keyModifiers.ctrl then
        for i,d in pairs(aregion) do
            if rayCast and d.p:distance(rayCast.pos)/core_camera.getPosition():distance(rayCast.pos) < 0.02 then
                local s = 0
                for j,o in pairs(aregion) do
                    s = s + o.w
                s = s/#aregion
                for j,o in pairs(aregion) do
                    o.w = o.w/s
--------------------
    for i,d in pairs(aregion) do
        if true or U._PRD == 1 then
--                lo('?? for_LKEY2:'..tostring(key)..':'..tostring(d.amark and #d.amark or nil)..':'..tostring(legend[key][2])..':'..tostring(d.amark[1]))
            for _,p in pairs(d.amark) do
                R.sphere(p, legend[key][2], c)

    for key,d in pairs(legend) do
        if T.out[key] and #T.out[key] > 0  then
--                lo('?? for_mark:'..tostring(T.out[key][1]))
            for i,p in pairs(T.out[key]) do
                R.sphere(p, legend[key][2], c)
@/lua/ge/extensions/editor/decalEditor.lua

  for index, instance in pairs(selectedInstances) do
    if not firstInstance then firstInstance = instance end
local function positionInstancesActionUndo(actionData)
  for id, oldPosition in pairs(actionData.oldPositions) do
    local instance = editor.getDecalInstance(id)
local function positionInstancesActionRedo(actionData)
  for id, newPosition in pairs(actionData.newPositions) do
    local instance = editor.getDecalInstance(id)
local function rotateInstancesActionUndo(actionData)
  for id, _ in pairs(actionData.oldTangents) do
    local instance = editor.getDecalInstance(id)
local function rotateInstancesActionRedo(actionData)
  for id, _ in pairs(actionData.newTangents) do
    local instance = editor.getDecalInstance(id)
local function changeInstancesSizeActionUndo(actionData)
  for id, _ in pairs(actionData.oldSizes) do
    local instance = editor.getDecalInstance(id)
local function changeInstancesSizeActionRedo(actionData)
  for id, _ in pairs(actionData.newSizes) do
    local instance = editor.getDecalInstance(id)
local function duplicateInstancesActionUndo(actionData)
  for id, instanceData in pairs(actionData.instancesData) do
    local instance = editor.getDecalInstance(id)
  selectedInstances = {}
  for id, instanceData in pairs(actionData.instancesData) do
    local instance = editor.addDecalInstanceWithTanForceId(instanceData.position, instanceData.normal, instanceData.tangent, instanceData.template, instanceData.size, instanceData.textureRectIdx, 3, 1, instanceData.id)
  local instancesData = {}
  for id, selectedInstance in pairs(selectedInstances) do
    local instance = {position = selectedInstance.position, normal = selectedInstance.normal, tangent = selectedInstance.tangent,
  local templateNamesSorted = {}
  for templateName, templateInstances in pairs(instances) do
    table.insert(templateNamesSorted, templateName)
    local selectedInstance
    for id, instance in pairs(selectedInstances) do
      selectedInstance = instance
    local copiedInstances = {}
    for id, instance in pairs(selectedInstances) do
      local copiedInstance = editor.addDecalInstanceWithTan(instance.position, instance.normal, instance.tangent, instance.template, 1, instance.textureRectIdx, 3, 1)
  originalPositions = {}
  for id, instance in pairs(selectedInstances) do
    originalSizes[id] = instance.size
    local instancesData = {}
    for id, selectedInstance in pairs(selectedInstances) do
      local instance = {position = selectedInstance.position, normal = selectedInstance.normal, tangent = selectedInstance.tangent,
  else
    for id, instance in pairs(selectedInstances) do
      newPositions[id] = instance.position
  if editor.getAxisGizmoMode() == editor.AxisGizmoMode_Translate then
    for id, instance in pairs(selectedInstances) do
      instance.position = originalPositions[id] + (editor.getAxisGizmoTransform():getColumn(3) - originalGizmoPos)
    local euler = editor.getAxisGizmoTransform():toQuatF():toEuler()
    for id, instance in pairs(selectedInstances) do
      rotateAround(instance, euler, editor.getAxisGizmoTransform():getColumn(3))
    local scale = editor.getAxisGizmoScale()
    for id, instance in pairs(selectedInstances) do
      local avgScale = (scale.x + scale.y) * 0.5
@/lua/common/libs/lua-websockets/websocket/server_ev.lua
  self.broadcast = function(_,...)
    for client in pairs(clients[protocol]) do
      if client.state == 'OPEN' then
  if opts.protocols then
    for protocol in pairs(opts.protocols) do
      clients[protocol] = {}
    if not keep_clients then
      for protocol,clients in pairs(clients) do
        for client in pairs(clients) do
      for protocol,clients in pairs(clients) do
        for client in pairs(clients) do
          client:close()
@/lua/ge/extensions/gameplay/statistic.lua

  for cbindex in pairs(cbs) do
    if not cbs[cbindex].trigger or newentry.value >= cbs[cbindex].trigger then

  for e in pairs( target ) do
    if target[e].trigger == trigger and target[e].func == callbackFunction then
        if im.TreeNode1("Timers") then
          for k,v in pairs(timers) do
            im.TextUnformatted(k..": "..dumps(v))
      if im.BeginTabItem("entries") then
        for k,v in pairs(fileData.entries) do
          if v.max then
        if fileDataCareer then
          for k,v in pairs(fileDataCareer.entries) do
            if v.max then
        if im.TreeNode1("callbacks general") then
          for k,v in pairs(callbacks) do
            im.TextUnformatted(k..": v="..dumps(v))
        if im.TreeNode1("callbacks career") then
          for k,v in pairs(callbacksCareer) do
            im.TextUnformatted(k..": v="..dumps(v))
local function forceTimerUpdate()
  for k in pairs(timers) do
    _timerSave(k)
@/lua/ge/extensions/career/modules/delivery/general.lua
      loadData.cargo = {}
      for key, fac in pairs(loadData.facilities) do
        fac.logisticGenerators = nil
  end
  for vehId, veh in pairs(vehs) do

        --for key, amount in pairs(elem.totalCargoSlots) do
        --  elem.usedCargoSlots[key] = 0
      -- check if all cargo was sent
      for key, val in pairs(vehCargoData) do
        if val == -1 then return end
      local ret = {}
      for _, list in pairs(vehCargoData) do
        for _, elem in ipairs(list) do
  local maxDelay = 0
  for _, delay in pairs(data) do
    maxDelay = math.max(delay, maxDelay)
      step.makeStepReturnTrueFunction(function()
        for vehId, data in pairs(data) do
          local veh = scenetree.findObjectById(vehId)
    -- 1s delay, no freeze
    for vehId, data in pairs(data) do
      local veh = scenetree.findObjectById(vehId)
  --if next(updatePerVehicle) then
  for vehId, data in pairs(updatePerVehicle) do
    local veh = scenetree.findObjectById(vehId)

    for _, con in pairs(updatePerVehicle[vehId]) do
      log("I","",string.format("Container %d => volume %0.1f | density: %0.1f",con.containerId, con.volume or 0, con.density or 1))
  local delayData = {}
  for vehId, data in pairs(updatePerVehicle) do
    delayData[vehId] = -1

  for vehId, data in pairs(updatePerVehicle) do
    local veh = scenetree.findObjectById(vehId)

      for key, val in pairs(delayData) do
        if val == -1 then return end
    local anyValue = false
    for key, value in pairs(loadData.penalty) do
      if value ~= 0 then

      for name, ap in pairs(fac.accessPointsByName) do
        local ps = ap.ps
          local pos = lastPsPos
          for name, ap in pairs(fac.accessPointsByName) do
            if ap.isInspectSpot then
        local fac = dGenerator.getFacilityById(elem.facId)
        for materialType, storage in pairs(fac.materialStorages) do
          if storage.isProvider then
    local fine = dVehicleTasks.getFineForAbandonAllVehicleTasks()
    for attKey, amount in pairs(fine) do
      penalty[attKey] = (penalty[attKey] or 0) + amount
@/lua/ge/extensions/editor/roadTemplateEditor.lua
    -- Set the fields for the decoration
    for field, value in pairs(jsonData.decorations[i]) do
      editor.setDynamicFieldValue(decoID, field, value, false)
@/lua/ge/extensions/editor/assetBrowser.lua
      file.inspectorData.materials = {}
      for matName, data in pairs(file.inspectorData.data) do
        if data.class == "Material" or data.class == "material" then
  if dir.dirs then
    for _,cDir in pairs(dir.dirs) do
      checkDirs(cDir)
  if dir.files then
    for k,asset in pairs(dir.files) do
      if assetFilterCheck(asset) == true then
  if dir.dirs then
    for _,cDir in pairs(dir.dirs) do
      checkAssets(cDir)
  if dir.textureSets then
    for k,set in pairs(dir.textureSets) do
      if im.ImGuiTextFilter_PassFilter(var.assetViewFilter, set.name) then
  if dir.dirs then
    for _,cDir in pairs(dir.dirs) do
      checkTextureSets(cDir)
  elseif var.options.assetViewFilterType == var.assetViewFilterType_enum.all_files then
    for _,dir in pairs(var.allDirs) do
      checkDirs(dir)
  elseif var.options.assetViewFilterType == var.assetViewFilterType_enum.all_files then
    for _,dir in pairs(var.allDirs) do
      checkAssets(dir)

  for _, group in pairs(var.filteredAssetGroups) do
    table.sort(group, sortAssetsByFilename)
  var.filteredAssetGroupsSorted = {}
  for assetGroupIdentifier, _ in pairs(var.filteredAssetGroups) do
    table.insert(var.filteredAssetGroupsSorted, {identifier = assetGroupIdentifier, open = true})
    if(var.selectedDirectory.textureSets) then
      for _, set in pairs(var.selectedDirectory.textureSets) do
        table.insert(var.filteredTextureSets, set)
  elseif var.options.assetViewFilterType == var.assetViewFilterType_enum.all_files then
    for _,dir in pairs(var.allDirs) do
      checkTextureSets(dir)
    im.Indent(var.iconSize.x + var.style.ItemSpacing.x)
    for index, item in pairs(var.defaultFilter) do
      savedFilterItem(index, item,nil, true)
    end
    for index, item in pairs(var.options.savedFilter) do
      savedFilterItem(index, item, true)
    end
    for _, message in pairs(var.newFolderMessages) do
      im.TextColored(message.color, message.text)
      showSavedSearches()
      for _,dir in pairs(var.allDirs) do
        showDirectoryInTreeView(dir)
          im.PushStyleColor2(im.Col_Button, editor.color.transparent.Value)
          for name, material in pairs(file.inspectorData.materials) do
            displayMaterialInAssetView(material, childSize)
        if file.open == true and file.inspectorData.materials then
          for k, material in pairs(file.inspectorData.materials) do
            displayMaterialInAssetView(material, childSize)
  im.TextUnformatted("Materials:")
  for matName, _ in pairs(asset.inspectorData.materials) do
    im.Bullet()
  local fileTypes = {}
  for typename, type in pairs(var.fileTypes) do
    table.insert(fileTypes, type)
  local simpleFileTypes = {}
  for typename, type in pairs(var.simpleFileTypes) do
    table.insert(simpleFileTypes, type)
  -- get all directories and files of the current level and put them into a tree struct
  for _,dir in pairs(var.allDirs) do
    getDirsAndFiles(dir)
  if path == "assetBrowser.general.typeColors" then
    for type, color in pairs(var.typeColors) do
      if value[type] then
@/lua/ge/extensions/flowgraph/baseModule.lua
  local baseInit = o.init
  for k, v in pairs(derivedClass) do
    --print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/setVehicleFlowgraph.lua
  local varData = {}
  for name, pin in pairs(self.pinIn) do
    if name ~= 'flow' and not pin.fixed then
@/lua/common/tech/techCommunication.lua

  for k, v in pairs(tab) do
    k = type(k) == 'number' and k or tostring(k)
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
  materialsMapMaterialIdxToMaterialName = {}
  for materialId, materialName in pairs(mNames) do
    materialsMapMaterialNameToMaterialIdx[materialName] = materialId

    for name, id in pairs(materialsMapMaterialNameToMaterialIdx) do
      if im.ImGuiTextFilter_PassFilter(materialsFilter, name) then
    local i = 0
    for name, enabled in pairs(sMeshes) do
      if im.ImGuiTextFilter_PassFilter(meshesFilter, name) then
    local textureResolution = api.getTextureResolution()
    for k,v in pairs(api.textureResolutions) do
      if textureResolution.x == v.value then
@/lua/ge/extensions/editor/api/roadRiver.lua
local function regenerateAllDecalRoads()
  for id, _ in pairs(allRoads) do
    local road = scenetree.findObjectById(id)
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua

  for id, measurement in pairs(self.measurements) do
    local serializedPoints = {}
  local maxId = 0
  for idStr, measurement in pairs(data.measurements or {}) do
    local deserializedPoints = {}
  -- Recalculate distances for all measurements
  for id, measurement in pairs(self.measurements) do
    self:calculateMeasurementDistance(id)

  for _, measurement in pairs(self.measurements) do
    if #measurement.points > 0 then
    local maxId = 0
    for id, _ in pairs(self.measurements) do
      if id > maxId then
  -- Search across all measurements
  for measurementId, measurement in pairs(self.measurements) do
    if measurement.points and #measurement.points > 0 then

  for measurementId, measurement in pairs(self.measurements) do
    local isSelected = measurement.id == self.selectedMeasurementId
@/lua/ge/extensions/flowgraph/nodes/activity/attemptStars.lua
    attempt.unlockedStars =  attempt.unlockedStars or {}
    for name, pin in pairs(self.pinInLocal) do
      if not pin.fixed and pin.type ~= 'flow' then
@/lua/ge/extensions/scenario/raceDebug.lua

  for _, wp in pairs(currentScenario.lapConfig) do
    local n = currentScenario.nodes[wp]
        local lastWpp = nil
        for _, wpp in pairs(path) do
          if wpp ~= lastWpp then
    local i = 0
    for _, wp in pairs(currentScenario.lapConfig) do
      i = i + 1
    local lastwpdStr = nil
    for _, wp in pairs(currentScenario.debugPath) do
      local wpd = currentScenario.debugNodes[wp]
@/lua/ge/extensions/editor/scriptAIEditor.lua
  local out = {}
  for id, tr in pairs(trajectories) do
    out[id] = ptr2ValTraj(tr)
  table.clear(trajectories)
  for id, tr in pairs(data) do
    trajectories[id] = val2PtrTraj(tr)
local function detachTrajectory(str)
  for k, tr in pairs(trajectories) do
    if tr.vehicle == str then
  local polyLinesToExecute = {}                                                   -- First, format all the trajectories so they can be run by the scriptAI backend.
  for k, tr in pairs(trajectories) do
    if tr.vehicle ~= "" and tr.vid ~= nil then
  end
  for vid, p in pairs(polyLinesToExecute) do                                      -- Execute all the vehicle trajectories using the scriptAI backend.
    scenetree.findObject(vid):queueLuaCommand('ai.startFollowing(' .. serialize(p) .. ')')
local function stopExecute()
  for k, tr in pairs(trajectories) do                                             -- Stop executing all the vehicle scripts.
    local vid = tr.vid
      local vehicles, numTrajectories, numVehicles = data.vehicles, 0, 0        -- Compute valid starting positions for all the vehicles which are to be spawned.
      for k, tr in pairs(trajectories) do
        numTrajectories = numTrajectories + 1
      end
      for k, tr in pairs(vehicles) do
        numVehicles = numVehicles + 1
        local ctr = 1
        for k, tr in pairs(trajectories) do
          local polyLine = tr.polyLine
      local ctr = 1                                                             -- Spawn all the vehicles which are required.
      for k, data in pairs(vehicles) do
        local _ = core_vehicles.spawnNewVehicle(data.jBeam, { pos = spawnPositions[ctr], config = data.config })
      local alreadyAttachedVehicles = {}
      for id, tr in pairs(trajectories) do
        local vehicle = tr.vehicle
  end
  for k, v in pairs(d.ratios) do                                                -- Project each time position to the mouse-controlled interval.
    if k ~= lLock and k ~= uLock then
  local isHovered = false
  for k, tr in pairs(trajectories) do
    local boxData = tr.boxData
  local dClosest, trClosest, nClosest = 1e30, nil, nil
  for id, tr in pairs(trajectories) do
    if tr.isDisplay[0] == true then
  -- Iterate over the full array of trajectories and ignore those which are not marked for display.
  for k, tr in pairs(trajectories) do
    local c = tr.col
  local numTrajectories = 0
  for k, tr in pairs(trajectories) do
    numTrajectories = numTrajectories + 1
    toolWinData.tStart, toolWinData.tEnd = 0.0, 0.0
    for k, tr in pairs(trajectories) do
      local polyLine = getPolyRef(tr)
      if editor.uiIconImageButton(editor.icons.watch_later, im.ImVec2(28, 28), nil, nil, nil, 'normalizeTrajectory') then
        for k, tr in pairs(trajectories) do
          local poly = getPolyRef(tr)
      local vehicleAttachState = "[not attached]"
      for k, tr in pairs(trajectories) do
        if tr.vehicle ~= nil and tr.vehicle == vehicle.string then
            table.remove(sceneVehicles, i)
            for tIdx, tr in pairs(trajectories) do
              if tr.vid == selectedVehicle.vid then
            local idx = nil
            for k, tr in pairs(trajectories) do
              if vehicle.vid == tr.vid then
      if im.BeginListBox("", im.ImVec2(170, 180), im.WindowFlags_ChildWindow) then
        for k, tr in pairs(trajectories) do
          im.Columns(3, "columns3", false)
  local numTrajectories = 0
  for k, tr in pairs(trajectories) do
    numTrajectories = numTrajectories + 1
  end
  for k, tr in pairs(trajectories) do
    if tr.vid == vid then
@/lua/vehicle/sounds.lua
  -- sound bank
  for _, snd in pairs(soundBank.sounds) do
    if snd.active then
      --apply modifiers if applicable
      for _, s in pairs(snd.volumeModifiers) do
        sndVol = sndVol * getSoundModifier(s)

      for _, s in pairs(snd.pitchModifiers) do
        sndPitch = sndPitch * getSoundModifier(s)

  for wi, wd in pairs(wheels.wheels) do
    local wheelSound = wheelsSounds[wi]
  local soundBank = {}
  for _, sbfn in pairs(sbeamFiles) do
    local tmp = readDictJSONTable(sbfn)
    if tmp then
      for _, v in pairs(tmp.sounds) do
        v.minVolume = v.minVolume * sbeamVolumeFactor
    soundBank.modifiersNamed = {}
    for _, sbm in pairs(soundBank.modifiers) do
      soundBank.modifiersNamed[sbm.name] = sbm
  if #powertrain.engineData > 0 then
    for _, v in pairs(powertrain.engineData) do
      maxrpm = max(maxrpm, v.maxSoundRPM or 1)
    local nodeNameIdx = {}
    for _, node in pairs(v.data.nodes) do
      if node.name then
    --check and postprocess them
    for skey, s in pairs(soundBank.sounds) do
      -- set default values

    for _, snd in pairs(soundBank.sounds) do
      for k2, v2 in pairs(snd) do
    for _, snd in pairs(soundBank.sounds) do
      for k2, v2 in pairs(snd) do
        if v2 == "MAXRPM" then
    local soundGroup = v.data.engine and v.data.engine.soundGroup
    for _, vl in pairs(soundBank.sounds) do
      vl.active = (vl.group == "default" or vl.group == soundGroup)
    if v.data.beams then
      for _, bm in pairs(v.data.beams) do
        if bm.soundFile ~= nil then

  for matId, event in pairs(scrapeMap) do
    if type(event) == "string" then --this can be nil (if nothing exists for a given material) or a boolean/false (if disabled via jbeam)

    for wi, wd in pairs(wheels.wheels) do
      addWheelSounds(wi, wd)
  if soundscapes then
    for name, soundscape in pairs(soundscapes) do
      bdebug.setNodeDebugText("Soundscape", type(soundscape.node) == "number" and soundscape.node or M.refNode, name .. ": " .. soundscape.src)
  --resend all static tire properties upon reset because the GE param cache is cleared upon vehicle reset
  for wi, wh in pairs(wheelsSounds or {}) do
    local wd = wheels.wheels[wi]

  for wi, wh in pairs(wheelsSounds or {}) do
    if wh.rigidRoll then
      if soundConfig then
        for name, data in pairs(soundConfig) do
          local blendFileName = data.blendFile:match("^.+/(.+)$")
@/lua/ge/extensions/gameplay/rally/notebook/structured.lua
  -- init all fields to defaults
  -- for fieldName, _ in pairs(Schema.schema) do
  --   self.fields[fieldName] = Schema.schema[fieldName].default
  -- overwrite fields with data
  for fieldName, _ in pairs(Schema.schema) do
    if data[fieldName] ~= nil then
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/trafficCustomGroup.lua
    for i = old, new + 1, -1 do
      for _, link in pairs(self.graph.links) do
        if link.targetPin == self.pinInLocal['model_'..i]then
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
  veh.canSave = false
  for k, v in pairs(moreData or {}) do data[k] = v end
  self.vehicles[data.id] = data
function C:getVehicleIdByInternalName(name)
  for id, data in pairs(self.vehicles) do
    if data.internalName == name then
  local ret = {}
  for id, data in pairs(self.vehicles) do
    if string.find(data.internalName, name) then
    --veh:queueLuaCommand('beamstate.getCouplerOffset("core_flowgraphManager.getManagerByID('..self.mgr.id..').modules.vehicle:addCouplerOffset(%s,%s)")')
    for tag, _ in pairs(couplerTags) do
      core_vehicleBridge.requestValue(veh,
  if data then
    for _,d in pairs(off) do
      table.insert(data.couplerOffset, {v = vec3(d), n = _, tag = tag})
      gameplay_walk.clearBlacklist()
      for id, blocked in pairs(self._storedWalkBlacklist) do
        if blocked then
@/lua/ge/extensions/flowgraph/nodes/gameplay/countdown.lua
  -- set out pins according to flags and reset flags
  for pName, val in pairs(self.flags) do
    self.pinOut[pName].value = val
@/lua/ge/extensions/gameplay/parking.lua

  for id, data in pairs(trackedVehData) do
    local valid, pData = trackParking(id)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua

  for partName, part in pairs(luaDataRaw) do
    if partName ~= '__astNodeIdx' then
  local astIdxToPart = {}
  for partName, part in pairs(luaDataRaw) do
    if partName ~= '__astNodeIdx' then
  local testedKeys = {}
  for k1, v1 in pairs(t1) do
    local v2 = t2[k1]
  end
  for k2, v2 in pairs(t2) do
    if not testedKeys[k2] then
@/lua/ge/extensions/editor/gen/exp_frame.lua
    local i = 1
    for k,d in pairs(body) do
        if not d.g then d.g = {} end
        else
            for j,_ in pairs(d.ac) do
                if j == 1 then
                local taa = {}
                for k,d in pairs(body) do
    --                lo('?? for_part:'..k..':'..#d.ac)
    --                lo('?? for_part:'..k..':'..#d.ac)
                    for _,c in pairs(d.ac) do
                        taa[#taa+1] = c
--        U.dump(body,'>> build:'..#ac..':'..cfix)
    for k,d in pairs(body) do
        for j,_ in pairs(d.ac) do
    for k,d in pairs(body) do
        for j,_ in pairs(d.ac) do
--            if i == ind then
    local list = {}
    for k,d in pairs(body) do
        list[#list+1] = {dnode[d.frto[1] ],dnode[d.frto[2] ]}
        if sdw then
            for i,v in pairs(adw[ind[2]]) do
                if sdw[i] then
    aa = {}
    for k,d in pairs(body) do
        lo('?? for_part:'..k..':'..#d.ac)
        lo('?? for_part:'..k..':'..#d.ac)
        for _,c in pairs(d.ac) do
            if d.fix then
        lo('?? for_L0:'..tostring(L)..':'..#aa)
    for k,c in pairs(aa) do
        local cac = step(aa, k, s)
    list = {}
    for k,d in pairs(body) do
        list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
    local set = {}
    for _,d in pairs(dnode) do
        set[#set+1] = d
    list = {}
    for k,d in pairs(body) do
        list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
    local list = {}
    for k,d in pairs(body) do
        list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
            local akey = {}
            for key,d in pairs(body) do
                akey[#akey+1] = key
                im.Columns(2)
                for _,key in pairs(akey) do
                    local d = body[key]
                    im.Indent(80)
                    for i,val in pairs(d.ac) do
                        ord = ord + 1
            akey = {}
            for key,d in pairs(dw) do
                akey[#akey+1] = key
            local tot = 0
            for i,key in pairs(akey) do
                im.Text(key)
@/gameplay/missionTypes/targetjump/customNodes/DrawSitesNode.lua

  for _, z in pairs(zones.objects) do
    z:drawDebug('faded', self.pointsColors[z.color or z.customFields:get('points') or 50])
@/lua/ge/extensions/gameplay/drift/stallingSystem.lua
  local variety = 0
  for _ in pairs(uniqueStunts) do
    variety = variety + 1
@/lua/ge/extensions/flowgraph/nodes/types/getVariable.lua
  local links = {}
  for _,lnk in pairs(self.graph.links) do
    if lnk.sourcePin == self.pinOut[self.varName] then
  local links = {}
  for _,lnk in pairs(self.graph.links) do
    if lnk.sourcePin == self.pinOut[self.varName] then
@/lua/ge/extensions/editor/roadEditor.lua
  selectedNodes = {}
  for roadID, arrayNodeIDs in pairs(nodeIDsTbl) do
    if not arrayNodeIDs then goto continue end
local function setNodesWidthActionUndo(actionData)
  for roadID, nodeWidthsTbl in pairs(actionData.oldWidths) do
    local road = scenetree.findObjectById(roadID)
    if road then
      for nodeID, oldWidth in pairs(nodeWidthsTbl) do
        editor.setNodeWidth(road, nodeID, oldWidth)
local function setNodesWidthActionRedo(actionData)
  for roadID, nodeWidthsTbl in pairs(actionData.newWidths) do
    local road = scenetree.findObjectById(roadID)
    if road then
      for nodeID, newWidth in pairs(nodeWidthsTbl) do
        editor.setNodeWidth(road, nodeID, newWidth)
local function positionNodeActionUndo(actionData)
  for roadID, nodes in pairs(actionData.roadAndNodeIDs) do
    local road = scenetree.findObjectById(roadID)
local function positionNodeActionRedo(actionData)
  for roadID, nodes in pairs(actionData.roadAndNodeIDs) do
    local road = scenetree.findObjectById(roadID)
  -- Loop the nodes from back to front
  for roadID, nodeInfo in pairs(actionData.roadInfos) do
    local road = scenetree.findObjectById(roadID)
local function insertNodeActionRedo(actionData)
  for roadID, nodeInfo in pairs(actionData.roadInfos) do
    editor.addRoadNode(roadID, nodeInfo)
local function deleteSelectionActionRedo(actionData)
  for roadID, _ in pairs(actionData.roadInfos) do
    editor.deleteRoad(roadID)
  -- Otherwise we will face invalid index issues because of deleting during iteration.
  for _, nodeInfos in pairs(actionData.nodeInfos) do
    if nodeInfos then

  for roadID, nodeInfos in pairs(actionData.nodeInfos) do
    for _, nodeInfo in ipairs(nodeInfos) do
local function deleteSelectionActionUndo(actionData)
  for roadID, roadInfo in pairs(actionData.roadInfos) do
    SimObject.setForcedId(roadID)
  -- Previous nodes must have been added so that current node index will be valid.
  for _, nodeInfos in pairs(actionData.nodeInfos) do
    if nodeInfos then

  for roadID, nodeInfos in pairs(actionData.nodeInfos) do
    editor.selectObjectById(roadID, editor.SelectMode_Add)
  local roadIndex = 1
  for originalRoadID, nodeID in pairs(actionData.originalRoadAndNodeIDs) do
    local originalRoad = scenetree.findObjectById(originalRoadID)

  for _, roadID in pairs(actionData.newRoadIDs) do
    editor.deleteRoad(roadID)

  for roadID, _ in pairs(actionData.originalRoadAndNodeIDs) do
    editor.selectObjectById(roadID, editor.SelectMode_Add)
  local roadIndex = 1
  for originalRoadID, nodeID in pairs(actionData.originalRoadAndNodeIDs) do
    local originalRoad = scenetree.findObjectById(originalRoadID)
local function splitRoads(roadAndNodeIDs)
  for roadID, nodeID in pairs(roadAndNodeIDs) do
    local road = scenetree.findObjectById(roadID)

  for _, nodeInfo in pairs(actionData.fuseRoadsInfo) do
    editor.selectObjectById(nodeInfo.roadID, editor.SelectMode_Add)
    if tableIsEmpty(selectedNodes) then return false end
    for _, arrayNodes in pairs(selectedNodes) do
      if arrayNodes and not tableIsEmpty(arrayNodes) then
  local nodeWidthVisible = nil
  for roadID, nodesTbl in pairs(selectedNodes) do
    local selectedRoad = scenetree.findObjectById(roadID)

      for roadID, nodes in pairs(selectedNodes) do
        newPositionsTbl[roadID] = {}
      local newWidths = {}
      for roadID, nodes in pairs(selectedNodes) do
        oldWidths[roadID] = {}
        local nonAiRoadsSelectable = editor.getPreference("roadEditor.general.nonAiRoadsSelectable")
        for roadID, _ in pairs(editor.getAllRoads()) do
          if scenetree.decalRoadContainsPoint(roadID, focusPointP3F) then

            for roadID, nodes in pairs(selectedNodes) do
              if not newPositionsTbl[roadID] then
        if roadTemplatesActive then
          for _, roadID in pairs(selectedRoadsIds) do
            local selectedRoad = scenetree.findObjectById(roadID)
        local diff = focusPoint - dragStartPosition
        for roadID, nodes in pairs(selectedNodes) do
          for _, nodeID in ipairs(nodes) do

    for roadID, nodes in pairs(selectedNodes) do
      local selectedRoad = scenetree.findObjectById(roadID)
      local nodePosTbl = dragNodesStartPositions[roadID]
      for _, id in pairs(nodes) do
        nodePosTbl[id] = selectedRoad:getNodePosition(id)

  for roadID, nodeIDs in pairs(selectedNodes) do
    local selectedRoad = scenetree.findObjectById(roadID)
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
  automaticHandling.availableModeLookup = {}
  for _, v in pairs(automaticHandling.availableModes) do
    automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/location.lua
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions or {}, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/setVehicleData.lua

    for k, v in pairs(self.vars) do
      veh[k] = v
@/lua/ge/extensions/freeroam/facilities.lua
  local data = jsonReadFile(file)
  for type, listKey in pairs(facilityTypeToListName) do
    for i, f in ipairs(data[listKey] or {}) do
    facilitiesByLevel[levelName] = {}
    for _, listKey in pairs(facilityTypeToListName) do facilitiesByLevel[levelName][listKey] = {} end
    -- put in the default values for this facility, if the facility itself did not define it
    for key, value in pairs(facilityPoiDefaults[f.type]) do
      e[key] = f[key]
@/lua/vehicle/controller/lightbar.lua
  -- Apply each static electrical value
  for k, value in pairs(currentMode.electricsOnce) do
    -- Set the electrical output, scaled by the electric's value (capped at 1.0)
    -- Reset all pattern timers and states
    for k, v in pairs(currentMode.electrics) do
      v.timer = 0 -- Reset pattern timing
  -- Update each electrics pattern
  for k, v in pairs(currentMode.electrics) do
    if electrics.values[lightbarElectric] > 0 then
  -- Reset all pattern states and timers for the new mode
  for k, v in pairs(currentMode.electrics) do
    v.timer = 0 -- Reset pattern timing
  modes = tableFromHeaderTable(jbeamData.modes)
  for _, vm in pairs(modes) do
    -- Convert mode config into usable format
    -- Process each config entry into pattern states
    for _, j in pairs(configEntries) do
      -- Create new pattern if it doesn't exist
    -- Optimize: Move single-state patterns to electricsOnce for better performance
    for electricName, data in pairs(vm.electrics) do
      if #data.states == 1 then
          -- Create menu entry for each available mode
          for k, v in pairs(modes) do
            local entry = {
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenBegin.lua
function C:_executionStarted()
  for _, p in pairs(self.pinOut) do
    p.value = false
  local strLinks = {}
  for _, lnk in pairs(self.graph.links) do
    if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
  local outPins = {}
  for _, pn in pairs(self.pinOut) do
    if tableContains(self.oldOptions, pn.name) then
  end
  for _, pn in pairs(outPins) do
    self:removePin(pn)
  local inPins = {}
  for _, pn in pairs(self.pinInLocal) do
    local contained = false
  end
  for _, pn in pairs(inPins) do
    self:removePin(pn)
function C:buttonPushed(action)
  for nm, pn in pairs(self.pinOut) do
    if nm == action then
      canPayFee = true
      for key, value in pairs(entryFee) do
        hasEntryFee = hasEntryFee or value > 0
function C:onNodeReset()
  for _,pn in pairs(self.pinOut) do
    pn.value = false
@/lua/vehicle/controller/inputOutputDemo.lua
  local storages = energyStorage.getStorages()
  for _, storage in pairs(storages) do
    --filter for electric batteries
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptActive.lua
    core_recoveryPrompt.deactivateAllButtons()
    for _, o in pairs({'flipMission','recoverMission','submitMission','restartMission'}) do
      if self.pinIn[o].value ~= nil then
@/lua/ge/extensions/scenario/scenarios.lua
  if scenario.vehicleNameToId then
    for k, vid in pairs(scenario.vehicleNameToId) do
      local bo = getObjectByID(vid)
  randomseed(os.time())
  for vName, vObjId in pairs(scenario.vehicleNameToId) do
    if scenario.vehicles[vName] then
        if type(scenario.vehicles[vName].driver["command"]) == "table" then
          for i,v in pairs(scenario.vehicles[vName].driver["command"]) do
            helper.queueLuaCommandByName(vName, scenario.vehicles[vName].driver["command"][i])
    scenario.vehicleIdToName[vid] = nil
    -- for index, name in pairs(scenario.playerUsableVehicles) do
    --   if name == vehicleName then
  if not initialLevelState then return end
  for objName, objFields in pairs(initialLevelState) do
    local levelObj = scenetree.findObject(objName)
    if levelObj and levelObj.obj then
      for field, value in pairs(objFields) do
        --log('D', logTag, 'setting [' .. tostring(objName)..'] field:'..tostring(field)..' value:'..tostring(value))
  if type(scenario.levelObjects) ~= 'table' then return end
  for objName, objFields in pairs(scenario.levelObjects) do
    local levelObj = scenetree.findObject(objName)
      initialLevelState[objName] = initialLevelState[objName] or {}
      for field, value in pairs(objFields) do
        --log('D', logTag, 'setting [' .. tostring(objName)..'] field:'..tostring(field)..' value:'..tostring(value))

  for _, v in pairs(statData.stats) do
    if data ~= nil then

  for _, v in pairs(stats.stats) do
    local value = v.value or 0
  scenario.startingTransforms = {}
  for vecName, vid in pairs(scenario.vehicleNameToId) do
    local vehicle = getObjectByID(vid)
        if type(vehicleConf.extensions) == 'table' then
          for vek, ve in pairs(vehicleConf.extensions) do
            to.obj:queueLuaCommand('extensions.scenario_' .. vek  .. '.onVehicleScenarioData(' .. serialize(ve) .. ')')
  if drawDebug and scenario.nodes then
    for nid, n in pairs(scenario.nodes) do
      if (n.pos - focusPos):length() < debugDrawDistance then
  local maxPlayers = scenario.playersCountRange.max
  for devName, _ in pairs(assignedPlayers) do
    local devicetype = string.split(devName, "%D+")[1] -- strip trailing number, if it exists (xinput0 -> xinput)

  for vehicleID,_ in pairs(scenario.aiControlledVehiclesById) do
    local vehicle = getObjectByID(vehicleID)

  for vName, vObjId in pairs(scenario.vehicleNameToId) do
    if scenario.vehicles[vName] then
    local reportedEvents = {}
    for vehName,data in pairs(scenario.vehicleTrackingTable) do
      local vehicle = scenetree.findObject(vehName)
      local objectCollisions = (vehicleData and vehicleData.objectCollisions) or {}
      for otherObjID, state in pairs(objectCollisions) do
        if state == 1 then

    for vName, _ in pairs(scenario.vehicleNameToId or {}) do
      local vehicle = scenetree.findObject(vName)
      -- spawn.lua setVehicleObject() by default
      for vehicleName, vehicleData in pairs(scenario.multiseatDeletedVehicles or {}) do
        local vehicle = scenetree.findObject(vehicleName)
        -- It would have been better to put them back in the correct prefab object, but its not required.
        for vehicleName, _ in pairs(scenario.multiseatDeletedVehicles or {}) do
          local vehicle = scenetree.findObject(vehicleName)
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
  local presets = editor.getPreference("dynamicDecalsTool.camera.presets")
  for name, val in pairs(presets) do
    if im.Button(string.format("%s##%s_%s", name:gsub("^%l", string.upper), "Generate Materials", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
  local changed = false
  for name, val in pairs(presets) do
    if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##dynDecals_camera_presets_remove_%d", i)) then
@/lua/ge/extensions/tech/pythonExport.lua
  local pythonData = LuaToPython[sensorType](sensor, vehicle)
  for _, kv in pairs(PythonDefaults[sensorType]) do
    local property, defaultValue = next(kv, nil)
  buffer:put("', beamng")
  for _, kv in pairs(nonDefaultData) do
    local length = #buffer - lineStart
@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.vehicle.toggleDiffMode.title",
                "onDown": "if #controller.getControllersByType('4wd') > 0 then for _,v in pairs(controller.getControllersByType('4wd')) do v.toggleDiffs() return end else powertrain.toggleDefaultDiffs() end",
                "order": 30.1,
                "title": "ui.inputActions.vehicle.toggle4WDStatus.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('4wd')) do v.toggle4WD() end",
                "order": 30.2,
                "title": "ui.inputActions.vehicle.toggleRangeStatus.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('4wd')) do v.toggleRange() end",
                "order": 30.3,
                "title": "ui.inputActions.vehicle.toggleLineLock.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('lineLock')) do v.toggleLineLock() end",
                "order": 32,
                "title": "ui.inputActions.vehicle.overrideNitrousOxide.title",
                "onUp": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(false) end",
                "onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(true) end",
                "onUp": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(false) end",
                "onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(true) end",
                "order": 33,
                "title": "ui.inputActions.vehicle.toggleLightbarMode.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('lightbar')) do v.toggleMode() end",
                "order": 37,
                "title": "ui.inputActions.vehicle.toggleNitrousOxide.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.toggleActive() end",
                "order": 34,
                "title": "ui.inputActions.vehicle.toggleTransbrake.title",
                "onDown": "for _,v in pairs(controller.getControllersByType('transbrake')) do v.toggleTransbrake() end",
                "order": 31,
@/lua/ge/extensions/editor/api/core.lua

  for _, v in pairs(filesAndFolders) do
    local newFilename = v

  for _, v in pairs(filesAndFolders) do
    local newFilename = v
      dirtyToolsSaveInfo = {}
      for name, _ in pairs(editor.dirtyTools) do
        dirtyToolsSaveInfo[name] = true
    imgui.BeginChild1("Windows", imgui.ImVec2(-1, imgui.GetContentRegionAvail().y - 30), imgui.WindowFlags_ChildWindow)
    for name, _ in pairs(editor.dirtyTools) do
      if imgui.Checkbox(name, imgui.BoolPtr(dirtyToolsSaveInfo[name])) then
    if imgui.Button("Save All") then
      for k, _ in pairs(dirtyToolsSaveInfo) do
        if editor.dirtyTools[k] then
    if imgui.Button("Save Selected") then
      for k, v in pairs(dirtyToolsSaveInfo) do
        if v == true then
local function getCurrentEditModeName()
  for key, val in pairs(editor.editModes) do
    if val == editor.editMode then return key end
@/lua/vehicle/extensions/escCalibration.lua

    for _, v in pairs(testResults) do
      filePivot:write(string.format("%s,%s,%s,%s,%s,%s,%s,%s\r\n", v.speed, v.angle, v.stiffnessFront, v.stiffnessRear, v.stiffnessFront / v.stiffnessRear, v.gForce, v.floatAngle, v.test))
@/lua/vehicle/controller/propAnimation/singleAxisLever.lua
  minExistingGearCoordinateIndex = 0
  for _, coordinate in pairs(gearCoordinateTable) do
    gearCoordinates[coordinate.gearIndex] = coordinate.value
@/lua/ge/extensions/scenario/scenariosLoader.lua
      local directory_cache = prefabCache[scenarioData.directory.."/"] or {}
      for prefabName, prefabPath in pairs(directory_cache) do
        if prefabsToFind[prefabName] or string.find(prefabName, scenarioData.scenarioName) then
      local levelPath_cache = prefabCache[levelPath] or {}
      for prefabName, prefabPath in pairs(levelPath_cache) do
        if prefabsToFind[prefabName] or string.find(prefabName, scenarioData.scenarioName) then
      scenarioData.previews = {}
      for _, p in pairs(tmp) do
        if string.startswith(p, scenarioData.directory) then
    if scenarioData.directory then
      for _,p in pairs(scenarioData.previews) do
          table.insert(np, imageExistsDefault(scenarioData.directory.."/"..p))
      local mgr = core_flowgraphManager.loadManager(path)
      for name, value in pairs(sc.variables or {}) do
        mgr.variables:changeBase(name, value)
  -- select the scenario again
  for k,v in pairs(scenarios) do
    if v.levelName == levelName and v.scenarioName == scenarioName and v.sourceFile == sourceFile then
    local newPreviews = {}
    for _, img in pairs(levelInfo.levelInfo.previews) do
      table.insert(newPreviews, directory..'/' .. img)
    local tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.png', 0, true, false)
    for _, p in pairs(tmp) do
      table.insert(previews, p)
    tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.jpg', 0, true, false)
    for _, p in pairs(tmp) do
      table.insert(previews, p)
      local routes = {}
      for _, file in pairs(busLineFiles) do
        local busLine = jsonReadFile(file)
        local busLine = jsonReadFile(file)
        for _, route in pairs(busLine.routes) do
          -- For now we assume there is only one bus scenario therefore
            scenario.stopCount = 0;
            for _, task in pairs(route.tasklist) do
              scenario.stopCount = scenario.stopCount + 1
@/lua/ge/extensions/flowgraph/nodes/macro/integrated.lua

  for _, node in pairs(graph.nodes) do
    if node.nodeType == "macro/io" then
  if self.inputNode then
    for _, pin in pairs(self.inputNode.pinList) do
      table.insert(inPins, self:createPin('in', pin.type, pin.name, pin.default, pin.description, true))
  if self.outputNode then
    for _, pin in pairs(self.outputNode.pinList) do
      table.insert(outPins,self:createPin('out', pin.type, pin.name, pin.default, pin.description, true))
  if self.inputNode then
    for name, pin in pairs(self.pinIn) do
      if not pin._hardcodedDummyPin then
  if self.outputNode then
    for name, pin in pairs(self.pinOut) do
      self.pinOut[name].value = self.outputNode.pinIn[name].value
function C:_executionStarted()
  for _, pin in pairs(self.pinIn) do
    if pin._hardcodedDummyPin then
function C:_executionStopped()
  for _, pin in pairs(self.pinIn) do
    if pin._hardcodedDummyPin then
@/lua/ge/extensions/gameplay/sites/sites.lua

  for k, _ in pairs(self.tags) do
    table.insert(self.sortedTags, k)
    if zone:containsPoint2D(pos) then
      for t, _ in pairs(zone.customFields.tags) do
        tags[t] = 1
  end
  for t, _ in pairs(tags) do
    table.insert(sortedTags, t)
@/lua/ge/extensions/flowgraph/nodes/states/stateNode.lua
  local rootGraphs = {}
  for _, graph in pairs(self.mgr.graphs) do
    if graph.type == "graph" and graph:getParent() == nil and (not self.mgr.stateGraph or graph.id ~= self.mgr.stateGraph.id) then
  if im.BeginCombo("Target Graph", label) then
    for _, graph in pairs(rootGraphs) do
      if im.Selectable1(graph.id .. "-"..graph.name, graph.id == id) then
  local names = {}
  for n, pin in pairs(self.pinOut) do
    table.insert(names,n)
@/lua/ge/extensions/gameplay/discover/discover_038.lua

for _, discover in pairs(freeroamExperiences) do
  table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
end
for _, mission in pairs(missions) do
  table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/core/flowgraphManager.lua
  local uniqueName = ""
  for nm, m in pairs(uniqueManagers) do
    if mgr.id == m.id then uniqueName = nm end
  end
  for name,u in pairs(uniqueManagers) do
    local index = -1
@/lua/vehicle/extensions/scenario/functionFreezer.lua
  if mode == 1 then -- freeze everything
    for _,funcString in pairs(functionNames) do
      if loadstring("return "..funcString.."_freeze_backup")() == nil then
  else -- revert function to its original code
    for _,funcString in pairs(functionNames) do
      if loadstring("return "..funcString.."_freeze_backup")() == nil then
@/lua/vehicle/controller/drivingDynamics/sensors/vehicleData.lua
  local totalMass = 0
  for _, n in pairs(v.data.nodes) do
    totalMass = totalMass + n.nodeWeight
  local inertiaZ = 0
  for _, v in pairs(v.data.nodes) do
    local posNoZ = vec3(v.pos.x, v.pos.y, 0)
  local cornerWheels = {}
  for _, wheelName in pairs(cornerWheelData) do
    cornerWheels[wheelName] = true
  --calculate avg wheel position for later being able to determine where a given wheel is
  for _, wheel in pairs(wheels.wheels) do
    if cornerWheels[wheel.name] then

  for _, wheel in pairs(wheels.wheels) do
    if cornerWheels[wheel.name] then
@/lua/ge/extensions/gameplay/crashTest/crashTestBoundaries.lua

  for _, zone in pairs(sites.zones.objects) do
    zone:drawDebug(nil, isPlayerOutOfBounds and red or white, 2, -0.5, not isPlayerOutOfBounds)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
  -- and have number arrays in all subbtables except first?
  for k, v in pairs(data) do
    if type(v) == "table" then
@/gameplay/missions/gridmap_v2/aiRace/001-grindergrandprix/script.lua
  -- Loop through all spinners and update their timers
  for id, timer in pairs(spinnerTimers) do
    timer = timer + dtSim
@/lua/ge/extensions/gameplay/crawl/flowgraphBridge.lua
  local allStates = gameplay_crawl_utils.getAllCrawlStates()
  for crawlerId, state in pairs(allStates) do
    if state and state.active then
@/lua/ge/extensions/flowgraph/nodes/activity/missionAttemptStars.lua
    local pinData = {}
    for name, pin in pairs(self.pinInLocal) do
      if not pin.fixed and pin.type ~= 'flow' then
@/lua/console/bananabench-async.lua
    local timeTotalSum = 0
    for k,vehicle in pairs(vehicles) do
        local testVehicle = 'vehicles/' .. vehicle .. '/'
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
    copy = {}
    for orig_key, orig_value in pairs(orig) do
      copy[orig_key] = orig_value
  if segment.noPoints then return end
  for name, index in pairs(segment.submeshIndexes) do
    segment.mesh:setMaterial(index, segment.selected and 'track_editor_grid' or segment.materialInfo[name])
      pieces[index].materialInfo = {}
      for key, val in pairs(pieceBefore.materialInfo) do
        pieces[index].materialInfo[key] = val
      end
      for key, val in pairs(p.materialInfo) do
      if not export.materials[s] then export.materials[s] = {} end
    for s,subMats in ipairs(import.materials) do
      for field, mats in pairs(subMats) do
        for mat, list in pairs(mats) do
      for field, mats in pairs(subMats) do
        for mat, list in pairs(mats) do
          for _, index in pairs(list) do
        for mat, list in pairs(mats) do
          for _, index in pairs(list) do
            subPieces[s][index].materialInfo[field] = mat
@/lua/ge/extensions/util/trackBuilder/basicBorders.lua

for _,shape in pairs(shapes) do computeNormals(shape) computeFaces(shape) end
@/lua/ge/extensions/util/trackBuilder/materialUtil.lua
  local ret = {}
  for key, value in pairs(material) do
    if type(material[key]) == "table" then
local function fillDefaults(material, original)
  for key, value in pairs(original) do
    if material[key] == nil then
  if not materials then return end
  for letter, mat in pairs(materials) do
    M.setSingleMaterial(letter,fillDefaults(mat,originalMaterials[letter]), skipSet)
  local ret = {}
  for letter, mat in pairs(currentMaterials) do
    ret[letter] = removeDefaults(mat,originalMaterials[letter])
@/lua/ge/extensions/career/modules/valueCalculator.lua
  local removedParts = {}
  for slotName, oldPart in pairs(originalParts) do
    local newPart = newParts[slotName]

  for slotName, newPart in pairs(newParts) do
    local oldPart = originalParts[slotName]
    if node.children then
      for childSlotName, childNode in pairs(node.children) do
        traversePartsTree(childNode)
  local damagedParts = getDamagedParts(invVehInfo)
  for _, part in pairs(damagedParts.partsToBeReplaced) do
    local price = part.value or 700
  -- Loop through partInventory to find parts belonging to this vehicle
  for _, part in pairs(partInventory) do
    if part.location == vehicle.id then
  local sumPartValues = 0
  for slot, partName in pairs(addedParts) do
    local part = career_modules_partInventory.getPart(vehicle.id, slot)

  for slot, partName in pairs(removedParts) do
    local part = {value = vehicle.originalParts[slot].value, year = vehicle.year, partCondition = {odometer = mileage}} -- use vehicle mileage to calculate the value of the removed part
  local counter = 0
  for partPath, info in pairs(partConditions) do
    if info.integrityValue and info.integrityValue == 0 then
  return getNumberOfBrokenParts(partConditions) >= brokenPartsThreshold
  --[[ for partPath, info in pairs(partConditions) do
    if info.integrityValue and info.integrityValue == 0 and not isPartException(partPath) then
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua
  automaticHandling.availableModeLookup = {}
  for _, v in pairs(automaticHandling.availableModes) do
    automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptEnabled.lua
function C:workOnce(args)
  for _, o in pairs({'flipMission','recoverMission','submitMission','restartMission'}) do
    if self.pinIn[o].value ~= nil then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/playRecording.lua
      local lastP
      for _, p in pairs(self.recording.recording.path) do
        debugDrawer:drawSphere(vec3(p), 0.1, ColorF(1,0,1,1))
@/lua/ge/extensions/editor/crawlEditor/presets.lua
  local presetList = {}
  for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.BOUNDARIES]) do
    table.insert(presetList, {name = name, preset = preset})
  local presetList = {}
  for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.PATHNODES]) do
    table.insert(presetList, {name = name, preset = preset})
  local presetList = {}
  for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.TRAILS]) do
    table.insert(presetList, {name = name, preset = preset})
@/lua/vehicle/controller/gauges/customModules/tireData.lua
    moduleData.temperatures = moduleData.temperatures or {}
    for _, wd in pairs(wheels.wheels) do
      moduleData.temperatures[wd.name] = "#ffffff"
    moduleData.pressures = moduleData.pressures or {}
    for _, wd in pairs(wheels.wheels) do
      local hasPressure = wd.pressureGroup and v.data.pressureGroups and v.data.pressureGroups[wd.pressureGroup]
@/lua/vehicle/controller/hydraulicSuspension.lua
local function setGroupsPosition(groupNames, position, speedCoef)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
    else
      for _, id in pairs(groupData.beamIds) do
        local beam = beams[id]
local function setGroupsBleed(groupNames, bleedCoef)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
    else
      for _, id in pairs(groupData.beamIds) do
        local beam = beams[id]
local function setGroupsMomentaryIncrease(groupNames, enabled, speedCoef)
  for _, g in pairs(groupNames) do
    local groupData = beamGroups[g]
    else
      for _, id in pairs(groupData.beamIds) do
        local beam = beams[id]
  local hydraulicBeamNames = {}
  for _, v in pairs(hydraulicsData) do
    local name = v.beamName
  local beamLookup = {}
  for _, hydraulicData in pairs(hydraulicsData) do
    local name = hydraulicData.beamName
@/lua/ge/server/server.lua

  for  _, filename in pairs(jsonFilesToLoad) do
    loadingProgress:update(-1, '')

  for  _, filename in pairs(tsFilesToExecute) do
    loadingProgress:update(-1, '')
@/lua/ge/extensions/editor/tech/roadArchitect/geometry.lua
  local w_q, hL_q, hR_q = {}, {}, {}
  for k, _ in pairs(w1) do
    local w1Key, hL1Key, hR1Key = w1[k][0], hL1[k][0], hR1[k][0]
      wDisc[ctr], hLDisc[ctr], hRDisc[ctr] = {}, {}, {}
      for k, _ in pairs(p1.widths) do
        wDisc[ctr][k] = im.FloatPtr(monotonicSteffen(p1.widths[k][0], p2.widths[k][0], p3.widths[k][0], p4.widths[k][0], 0, 1, 2, 3, qPlus1))
      wDisc[ctr], hLDisc[ctr], hRDisc[ctr] = {}, {}, {}
      for k, _ in pairs(p1.widths) do
        wDisc[ctr][k] = im.FloatPtr(monotonicSteffen(p1.widths[k][0], p2.widths[k][0], p3.widths[k][0], p4.widths[k][0], 0, 1, 2, 3, qPlus1))
        local numLanes = 0
        for k, _ in pairs(nodes[i].widths) do
          if nodes[i].widths[k][0] > 2.0 then
        local extraHairpinLaneWidth = extraHairpinWidth / numLanes
        for k, _ in pairs(nodes[i].widths) do
          if nodes[i].widths[k][0] > 2.0 then
      if origWidths[i] then
        for k, _ in pairs(origWidths[i]) do
          nodes[i].widths[k] = im.FloatPtr(origWidths[i][k])
@/lua/common/libs/copas/copas/limit.lua
    -- all tasks done, resume the waiting tasks so they can unblock/return
    for coro in pairs(self.waiting) do
      copas.wakeup(coro)
@/lua/vehicle/extensions/tech/vehicleSearcher.lua
  local whData, wCtr = {}, 1
  for k, _ in pairs(wheels.wheelRotatorIDs) do
    whData[wCtr] = k
  local elData, eCtr = {}, 1
  for k, v in pairs(electrics.values) do
    if type(k) == 'string' and type(v) ~= 'table' and type(v) ~= 'string' then
  local pData = {}
  for _, device in pairs(powertrain.getDevices()) do
    pData[device.name] = {
  local pProc, pCtr = {}, 1
  for kO, vO in pairs(pData) do
    local prefix = kO .. ' '
    local prefix = kO .. ' '
    for kI, vI in pairs(vO) do
      local fullName = prefix .. kI
@/lua/ge/extensions/core/vehicleTriggers.lua
            if vData and vData.vdata and type(vData.vdata.triggers) == 'table' then
              for _, trg in pairs(vData.vdata.triggers or {}) do

                for actionStr, lnkTable in pairs(vData.vdata.triggerEventLinksDict[trg.cid] or {}) do
                  if lnkTable and #lnkTable > 0 then
                  if lnkTable and #lnkTable > 0 then
                    for lnkIdx, lnk in pairs(lnkTable) do
            if vData and vData.vdata and type(vData.vdata.events) == 'table' then
              for _, evt in pairs(vData.vdata.events or {}) do
                im.TableNextRow()
            if vData and vData.vdata and type(vData.vdata.triggerEventLinksDict) == 'table' then
              for triggerId, lnkDict in pairs(vData.vdata.triggerEventLinksDict or {}) do
                im.TableNextRow()

                for actionStr, lnkTable in pairs(lnkDict) do
                  for _, lnk in pairs(lnkTable) do
                for actionStr, lnkTable in pairs(lnkDict) do
                  for _, lnk in pairs(lnkTable) do
                    if lnk.triggerInput then
  -- TODO: this is overly simplistic and serves as a prototype :)
  for _, lnk in pairs(vdata.triggerEventLinksDict[triggerId][actionStr]) do
    local actionsExecuted = executeLink(vdata, lnk, actionValue, vehicleId)
@/lua/ge/extensions/gameplay/drag/dragBridge.lua
  local activeId
  for vehId, racer in pairs(dragData.racers or {}) do
    if racer.isPlayable then activeId = vehId break end
  local activeId
  for vehId, racer in pairs(dragData.racers or {}) do
    if racer.isPlayable then activeId = vehId break end
  if not data then return nil end
  for vehId, racer in pairs(data.racers or {}) do
    if racer.isPlayable then return vehId end

  for _, config in pairs(configs.configs) do
    if config["Drag Times"] and config["Drag Times"].time_1_4 and config["Drag Times"].time_1_4 >= minTime and config["Drag Times"].time_1_4 < maxTime then
@/lua/ge/extensions/flowgraph/nodes/vehicle/gForce.lua

  for k, _ in pairs(values) do
    values[k] = core_vehicleBridge.getCachedVehicleData(vehId, k)
@/lua/vehicle/powertrain/shaft.lua

    for _, nid in pairs(wheel.nodes) do
      local n = v.data.nodes[nid]
    device.outputPorts = {}
    for _, v in pairs(jbeamData.outputPortOverride) do
      device.outputPorts[v] = true
@/lua/ge/extensions/editor/api/valueInspector.lua
      local i = 1
      for key, _ in pairs(annotationsTbl) do
        annotations[i] = key
@/lua/ge/extensions/gameplay/drift/destination.lua
  extractedWaypoints = {}
  for _, pathNode in pairs(pathData.pathnodes.sorted) do
    table.insert(extractedWaypoints, pathNode.pos)
@/lua/ge/extensions/tech/partAnnotations.lua
  local cfg = jsonReadFile(cfgFile)
  for part, color in pairs(cfg) do
    annotationKeywords[part] = ColorI(color[1], color[2], color[3], 1)
  local result = nil
  for keyword, color in pairs(annotationKeywords) do
    if string.find(part, keyword) ~= nil then
  local maxKnown = -1
  for keyword, color in pairs(matches) do
    local len = string.len(keyword)
@/lua/ge/extensions/telemetry/core.lua
  local trackersToUnload = {}
  for trackerName, _ in pairs(trackingExtensions) do
    local priority = trackerPriorities[trackerName] or 500
@/lua/ge/extensions/flowgraph/groupHelper.lua
  local entry, exit = nil, nil
  for _, node in pairs(graph.nodes) do
    if node.nodeType == 'states/stateEntry' then
  --dump(nodeLookup)
  for id, lnk in pairs(graph.links) do
    local i, o = nodeLookup[lnk.targetNode.id], nodeLookup[lnk.sourceNode.id]
  local selectedNodes = {}
  for id, _ in pairs(self.mgr.selectedNodes) do
    if oldGraph.nodes[id].nodeType ~= 'states/stateEntry' and oldGraph.nodes[id].nodeType ~= 'states/stateExit' then
  local graphRect = {math.huge, math.huge, -math.huge, -math.huge} -- minX, minY, maxX, maxY
  for nodeId, _ in pairs(selectedNodes) do
    local oldNode = oldGraph.nodes[nodeId]
  local outputLinks = {}
  for lid, link in pairs(oldGraph.links) do
    local sourceContained = selectedNodes[link.sourceNode.id]
  -- first, the easy links: the completely internal ones
  for _, link in pairs(internalLinks) do
    local linkData = link:__onSerialize()
  inputNode.allowCustomOutPins = true
  for _, link in pairs(inputLinks) do
    if not groupedPins[link.sourcePin.id] then

  for _, link in pairs(outputLinks) do
    if not groupedPins[link.sourcePin.id] then

  for nodeId, _ in pairs(selectedNodes) do
    local node = oldGraph.nodes[nodeId]
  if #inputLinks > 0 then
    for _, link in pairs(inputLinks) do
      if not groupedPins[link.sourcePin.id] then
  if #outputLinks > 0 then
    for _, link in pairs(outputLinks) do
      if not groupedPins[link.sourcePin.id] then
  local innerNodes = {}
  for id, nd in pairs(groupedGraph.nodes) do
    if nd.nodeType ~= 'states/stateEntry' and nd.nodeType ~= 'states/stateExit' then
  local gInLinks, gOutLinks = {},{}
  for id, lnk in pairs(newGraph.links) do
    if lnk.targetNode.id == groupNode.id then
@/lua/vehicle/controller/propAnimation/hPattern.lua
  minExistingGearCoordinateIndex = 0
  for _, coordinate in pairs(gearCoordinateTable) do
    gearCoordinates[coordinate.gearIndex] = {x = coordinate.x, y = coordinate.y}
@/lua/vehicle/controller/tech/powertrainSensor.lua
  local latestReading = {}
  for _, device in pairs(powertrain.getDevices()) do
    local deviceData = {inputAV = device.inputAV, gearRatio = device.gearRatio, isBroken = device.isBroken, mode = device.mode}
@/lua/ge/extensions/editor/gen/test.lua
        local list = groupBat:getObjects()
        for _,o in pairs(list) do
            local om = scenetree.findObjectById(tonumber(o))
        local list = fdata:getItems()
        for _,f in pairs(list) do
            editor.removeForestItem(fdata, f)
--		lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
	for i,s in pairs(list) do
--			lo('?? for_file:'..i..':'..s)
	list = FS:findFiles(pth, '*.json', -1, true, false)
	for i,s in pairs(list) do
		FS:removeFile(s)
--		lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
	for i,s in pairs(list) do
--			lo('?? for_file:'..i..':'..s)
		-- refresh static mmeshes
		for _,o in pairs(list) do
			local om = scenetree.findObjectById(tonumber(o))
	if true then
		for id,desc in pairs(adesc) do
			houseUp(nil, id)
				local ref = vec3(0,0,0)
				for i,v in pairs(am[1].verts) do
					local ang = U.vang(vec3(1,1,0),U.proj2D(v),true)
		local stamp
		for i,desc in pairs(adesc) do
			desc.selection = {}
--			desc.selection[2] = {1,6} --{1,3,2}
			for j,aw in pairs(desc.selection) do
				if not desc.aspline then desc.aspline = {} end --{aij={}} end

		for i,d in pairs(adesc) do
				d.selection = {}
				base = {}
				for j,aw in pairs(d.selection) do
					table.sort(aw)
					local isvalid = true
					for k,iw in pairs(aw) do
						if k>1 and aw[k]-aw[k-1]>1 then
				ref = vec3(0.0,0)
			for i,b in pairs(base) do
				base[i] = base[i]-ref
			lo('?? if_frst:'..tostring(#list))
		for _,o in pairs(list) do
			lo('?? if_ctx:'..tostring(o:getContextID())) --..tostring(o.ctxid)..':'..tostring(o.contextID)) --o:getContextID())
			lo('?? fdata:'..#list)
		for _,f in pairs(list) do
--			lo('?? for_it:'..tostring(f:getPosition()))
		-- {'b_22946.dae','b_22934.dae'}
		for _, nm in pairs(list) do
			if not scenetree.findObject(nm) then
		local dirname = editor.getLevelPath()..'bat/'
		for k,d in pairs(adesc) do
			local pth = dirname..'emat_2s.dae' -- 'emat_'..d.id..'.dae'
			if true then return end
		for k,d in pairs(adesc) do
				lo('?? for_DAE:'..k)
		local dirname = editor.getLevelPath()..'bat/'
		for k,d in pairs(adesc) do
				lo('?? for_DESC:'..tostring(d.id))
			lo('?? sdf:'..tostring(m.obj:getStaticDataFieldbyIndex(1, 1)))
		for k,f in pairs(fields) do
			lo('?? fof:'..tostring(k)..':'..tostring(f))
--			U.dump(m, '?? for_OBJ:')
--		for k,v in pairs(m.obj) do
--			lo('?? for_Key:'..tostring(k))

		for i,desc in pairs(adesc) do
			local ascan = W.buildingScan(desc, function(ascan)
			lo('??+++++++++++++++ if_TST:'..tostring(tst))
			for _,k in pairs(tst.kids) do
				lo('?? for_TST_KID:'.._..':'..tostring(k.type))
--			U.dump(nd_maingeo)
--			for _,k in pairs(nodevs.kids) do
--				lo('?? for_KID:'.._..':'..tostring(k.name))
    if false then
		for _,d in pairs(adesc) do
			W.buildingScan(d)
			lo('?? for_node:'..tostring(xml))
--		for i,k in pairs(xml.kids) do
--			lo(k.name)

--		for _,d in pairs(data) do
			if false then
--                lo('?? for_am:'..#adata)
			for i,d in pairs(adata) do
				-- set heights
			local mat
			for t,c in pairs({orange='1 0.5 0 1', green='0 1 0 1', blue='0 0 1 1',yellow='1 1 0 1'}) do
				mat = createObject("Material")
			local matFiles = FS:findFiles('/art/shapes/objects/', pref..'materials.json', -1, true, false)
			for _,f in pairs(afile) do
				matFiles[#matFiles+1] = f
			--    local list = {}
			for k,f in pairs(matFiles) do
					lo('?? for_mat_FILE:'..tostring(f))
--                loadJsonMaterialsFile(v)
--            for _,f in pairs(afile) do
				local desc = jsonReadFile(f)
				if desc then
					for k,v in pairs(desc) do
						local ind = U.index(amat, k)[1]
	local ref = base[1]
	for _,b in pairs(base) do
		av[#av+1] = b
	local af = {}
	for _,c in pairs(achunk) do
		af = M.zip(c, af)

	for _,e in pairs(out.fwhite) do
		e[1] = e[1] + vec3(-265,1148,1)
	if out.fyell then
		for _,e in pairs(out.fyell) do
			for i,n in pairs(e) do
		for _,e in pairs(out.fyell) do
			for i,n in pairs(e) do
				e[i] = e[i] + vec3(-265,1148,1)
	end
	for _,e in pairs(out.flbl) do
		e[1] = e[1] + vec3(-265,1148,1)
@/lua/ge/extensions/core/remoteController.lua

  for ip, lastPackageTime in pairs(lastPackageTimes) do
    -- Unplug controller after a 10 seconds timeout
local function onInputBindingsChanged(players)
  for device, player in pairs(players) do
    for _, dev in pairs(virtualDevices) do
  for device, player in pairs(players) do
    for _, dev in pairs(virtualDevices) do
      if "vinput"..dev.deviceInst == device then
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/generateDragOpponents.lua

  for i, v in pairs(configs.configs) do
    local modelData = core_vehicles.getModel(v.model_key)
  -- Find vehicles with similar dial times
  for _, v in pairs(vehConfigs) do
    if v["Drag Times"] then
@/lua/common/jbeam/optimization.lua
  end
  for k, v in pairs(vehicle.beams) do
    if type(v) == "table" and type(v.id1) == "number" and type(v.id2) == "number" and v.id1 > v.id2 then
  -- recurse
  for k, v in pairs(d) do
    if type(v) == 'string' and v == '' and k ~= 'mesh' then -- 'mesh' is a hack to prevent from cleaning flexbody.mesh values. Backward compatibility
  if vehicle.nodes then
    for _, n in pairs(vehicle.nodes) do
      if n.collision == true then n.collision = nil end -- the default
  if vehicle.beams then
    for _, b in pairs(vehicle.beams) do
      if b.beamType == 0 then b.beamType = nil end -- the default
  if vehicle.triangles then
    for _, t in pairs(vehicle.triangles) do
      t.cid = nil
  if vehicle.hydros then
    for _, hydro in pairs(vehicle.hydros) do
      hydro.beamCID = hydro.beam.cid
  if vehicle.wheels then
    for _, wheel in pairs(vehicle.wheels) do
      if wheel.sideBeams then
      if wheel.sideBeams then
        for k, b in pairs(wheel.sideBeams) do
          wheel.sideBeams[k] = b.cid
      if wheel.rimBeams then
        for k, b in pairs(wheel.rimBeams) do
          wheel.rimBeams[k] = b.cid
      if wheel.peripheryBeams then
        for k, b in pairs(wheel.peripheryBeams) do
          wheel.peripheryBeams[k] = b.cid
      if wheel.treadBeams then
        for k, b in pairs(wheel.treadBeams) do
          wheel.treadBeams[k] = b.cid
      if wheel.reinfBeams then
        for k, b in pairs(wheel.reinfBeams) do
          wheel.reinfBeams[k] = b.cid
      if wheel.pressuredBeams then
        for k, b in pairs(wheel.pressuredBeams) do
          wheel.pressuredBeams[k] = b.cid
      if wheel.treadNodes then
        for k, tn in pairs(wheel.treadNodes) do
          wheel.treadNodes[k] = tn.cid
      if wheel.nodes then
        for k, tn in pairs(wheel.nodes) do
          wheel.nodes[k] = type(tn) == 'table' and tn.cid or tn
  -- removing disabled sections
  for keyEntry, entry in pairs(vehicle) do
    if type(entry) == "table" and tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and tableIsDict(entry[0]) and entry[0]['disableSection'] ~= nil then
@/lua/ge/extensions/freeroam/specialTriggers.lua

  for k, _ in pairs(triggers[key].objects) do
    if scenetree.findObject(k) then

  for k, v in pairs(triggers[key].objects) do
    local obj = scenetree.findObject(k)
    triggers[key].objects = {}
    for k, v in pairs(data.objects) do
      triggers[key].objects[k] = {
  if useOrigState then
    for k, v in pairs(triggers) do
      removeTrigger(k, useOrigState)

  for k, v in pairs(data) do
    addTrigger(k, v)
  if not active then
    for _, vState in pairs(trigger.vehIds) do
      if vState then
    if trigger.objects then
      for _, objData in pairs(trigger.objects) do
        objData.timer = 0

  for k, v in pairs(triggers) do
    if v.type == 'zone' and zones.byName[k] and not v.vehIds[0] then -- veh id of 0 blocks detection

  for k, v in pairs(triggers) do
    if v.vehIds and isVehicleValid(k, newId) then

  for k, v in pairs(triggers) do
    if v.vehIds then
  local zoneExists = false
  for k, v in pairs(triggers) do
    if v.type == 'zone' then
    if v.objects then
      for name, data in pairs(v.objects) do
        local obj = scenetree.objectExists(name)
@/lua/vehicle/powertrain/dctGearbox.lua
  local reverseGears = {}
  for _, v in pairs(jbeamData.gearRatios) do
    table.insert(v >= 0 and forwardGears or reverseGears, v)
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsOutput) do
      device.gearWhineCoefsOutput[gearIndex] = v
    local gearIndex = device.minGearIndex
    for _, v in pairs(gearWhineCoefsInput) do
      device.gearWhineCoefsInput[gearIndex] = v
@/lua/vehicle/powertrain/hydraulicCylinder.lua

  for _, bvs in pairs(cylinder.beamVelocitySmoothers) do
    bvs:reset()
  end
  for k, _ in pairs(cylinder.previousBeamVelocities) do
    cylinder.previousBeamVelocities[k] = 0
  local currentExtend = 0
  for _, bt in pairs(cylinderData.beamTags) do
    if beamstate.tagBeamMap[bt] then
    if beamstate.tagBeamMap[bt] then
      for _, cid in pairs(beamstate.tagBeamMap[bt]) do
        table.insert(cylinder.beamCids, cid)
@/lua/ge/extensions/gameplay/rally/trafficExclusion.lua
  if path.startPositions and path.startPositions.objects then
    for _, sp in pairs(path.startPositions.objects) do
      if sp.pos then
  if path.pathnodes and path.pathnodes.objects then
    for _, pn in pairs(path.pathnodes.objects) do
      if pn.pos then
  if path.startPositions and path.startPositions.objects then
    for _, sp in pairs(path.startPositions.objects) do
      if sp.pos then
@/lua/ge/extensions/career/modules/vehiclePerformance.lua
  local vehicles = career_modules_inventory.getVehicles()
  for id, vehicle in pairs(vehicles) do
    if id ~= inventoryId then
@/lua/ge/extensions/editor/flowgraph/references.lua
function C:findNodesRecursive(nodeDirectory)
  for k, _ in pairs(nodeDirectory) do
    if k == "nodes" then
    if k == "nodes" then
      for node, nodeData in pairs(nodeDirectory[k]) do
  if not initialCheck then
    for _, nodeData in pairs(self.nodeTable) do
      nodeData.amount = 0
    for node in self.mgr:allNodes() do
      for k, v in pairs(self.nodeTable) do
        if v.displayName == node.name then

  for k, v in pairs(self.nodeStatistics.categories) do
    table.insert(res, { category = k, nodeTypeAmount = v.nodeTypeAmount, nodeInstancesAmount = v.nodeInstancesAmount })
    if data then
      for _, graph in pairs(data.graphs or {}) do
        for _, node in pairs(graph.nodes) do
      for _, graph in pairs(data.graphs or {}) do
        for _, node in pairs(graph.nodes) do
          self:updateNodeOccurrence(string.gsub(node.type, "(.*/)(.*)", "%2"), filename)
  if self.filterMode == 'All' then
    for k, v in pairs(self.nodeTable) do
      if string.find(k, ffi.string(self.searchText)) then
      if not alreadyExist then
        for k, v in pairs(self.nodeTable) do
          if v.displayName == node.name then
  elseif self.filterMode == 'Unused' then
    for k, v in pairs(self.nodeTable) do
      if v.amount == 0 then
  local res = {}
  for k, v in pairs(self.nodeTable[self.inspectedNode].amountForProjects) do
    table.insert(res, { projectFile = k, amount = v })
        im.TableNextColumn()
        for _, categoryData in pairs(self.sortedCategories) do
          im.TableSetBgColor(im.TableBgTarget_CellBg, im.GetColorU322(columnBackground), 0)
    local rowCount = 1
    for _, n in pairs(self.filteredNodes) do
      if editor.uiIconImageButton(editor.icons.subdirectory_arrow_right, im.ImVec2(24, 24)) then
      im.TableNextColumn()
      for behaviour, _ in pairs(self.nodeTable[self.inspectedNode].behaviour) do
        editor.uiIconImage(editor.icons[ui_flowgraph_editor.getBehaviourIcon(behaviour)], buttonSize)
@/lua/ge/extensions/flowgraph/nodes/scene/getPointOnDecalroad.lua
  self.roadObj = nil
  for _, p in pairs(self.pinOut) do
    p.value = nil
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veTCSDebug.lua
      if not didInit then
        for k, _ in pairs(vEditor.tcsData.wheelBrakeFactors) do
          brakeFactors[k] = {}

        for k, _ in pairs(vEditor.tcsData.wheelSlips) do
          wheelSlips[k] = {}

        for k, _ in pairs(vEditor.tcsData.throttleFactors) do
          throttleFactors[k] = {}

        for k, _ in pairs(vEditor.tcsData.allWheelSlips) do
          allWheelSlips[k] = {}
      table.remove(slipThresholds, 1)
      for _, v in pairs(brakeFactors) do
        table.remove(v, 1)
      end
      for _, v in pairs(wheelSlips) do
        table.remove(v, 1)
      local count = 1
      for k, v in pairs(vEditor.tcsData.wheelBrakeFactors) do
        table.insert(brakeFactors[k], v)
      count = 1
      for k, _ in pairs(brakeFactors) do
        if count > 1 then
      count = 2
      for k, v in pairs(vEditor.tcsData.wheelSlips) do
        table.insert(wheelSlips[k], v)

      for k, _ in pairs(wheelSlips) do
        im.SameLine()

      for _, v in pairs(throttleFactors) do
        table.remove(v, 1)
      end
      for _, v in pairs(allWheelSlips) do
        table.remove(v, 1)
      count = 1
      for k, v in pairs(vEditor.tcsData.throttleFactors) do
        table.insert(throttleFactors[k], v)
      count = 1
      for k, _ in pairs(throttleFactors) do
        if count > 1 then
      count = 1
      for k, v in pairs(vEditor.tcsData.allWheelSlips) do
        table.insert(allWheelSlips[k], v)
      count = 1
      for k, _ in pairs(allWheelSlips) do
        if count > 1 then
@/lua/ge/extensions/gameplay/rally/loop/rallyEventLog.lua
    local penalties = {}
    for penaltyType, data in pairs(groupData.penaltyTypes) do
      table.insert(penalties, {
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua
local function reset()
  for _, wheelGroup in pairs(tractionControlledWheelGroups) do
    wheelGroup.slipRange = 0
    wheelGroup.slipRange = 0
    for _, wheel in pairs(wheelGroup.wheels) do
      wheel.slip = 0
@/lua/ge/extensions/flowgraph/nodes/logic/and.lua
    for i = old, new+1, -1 do
      for _, lnk in pairs(self.graph.links) do
        if lnk.targetPin == self.pinInLocal['flow'..'_'..i] then
@/lua/ge/extensions/gameplay/sites/customFields.lua

  for name, val in pairs(self.values) do
    if self.types[name] == 'vec3' then
  table.clear(self.sortedTags)
  for k, _ in pairs(self.tags) do
    table.insert(self.sortedTags, k)
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
    -- Pre-format aggregates for the UI
    for key, prog in pairs(info.parentInfo.formattedProgress.formattedProgressByKey) do
      local ownAggregate = {}
  -- pre-format aggregates for the UI. This formatting might be the default later and then be moved to gameplay_missions_progress
  for key, prog in pairs(info.formattedProgress.formattedProgressByKey) do
    --dump(key)
    local canPayFee = true
    for key, value in pairs(entryFee) do
      hasEntryFee = hasEntryFee or value > 0
    if m.ignoreUserSettingsKeyForActiveStars then
      for key, _ in pairs(m.ignoreUserSettingsKeyForActiveStars) do
        flatSettings[key] = nil
    local same = true
    for k, v in pairs(defaultUserSettings) do
      if type(v) == "table" and type(flatSettings[k]) == "table" then
      if type(v) == "table" and type(flatSettings[k]) == "table" then
        for k2, v2 in pairs(v) do
          same = same and flatSettings[k][k2] == v2
    end
    for k, v in pairs(flatSettings) do
      if type(v) == "table" and type(defaultUserSettings[k]) == "table" then
      if type(v) == "table" and type(defaultUserSettings[k]) == "table" then
        for k2, v2 in pairs(v) do
          same = same and defaultUserSettings[k][k2] == v2

    for key, info in pairs(starInfo) do
      if info.visible then
   -- pre-format aggregates for the UI. This formatting might be the default later and then be moved to gameplay_missions_progress
  for key, prog in pairs(formattedProgress.formattedProgressByKey) do
    --dump(key)
  else
    for label, _ in pairs(soundNames) do
      local sound = scenetree.findObjectById(soundObjectIds[label])
  groupsByKey["all"] = {meta = {type = "all"}, sortingKey = "date", sortingDirection = "desc"}
  for _, diff in pairs(gameplay_missions_missions.getAdditionalAttributes().difficulty.valuesByKey) do
    groupsByKey["difficulty_"..diff.key] = {label = "Difficulty: " ..diff.translationKey, meta = {type = "difficulty"}}
  -- build group lists (new groups might have been added)
  for key, group in pairs(groupsByKey) do
    group.tileIdsUnsorted = {}
  -- add tiles to groups
  for id, tile in pairs(tilesById) do
    for groupKey, _ in pairs(tile.filterData.groupTags) do
  for id, tile in pairs(tilesById) do
    for groupKey, _ in pairs(tile.filterData.groupTags) do
      if groupsByKey[groupKey] then
    career_modules_branches_leagues.clearLeagueUnlockCache()
    for groupKey, group in pairs(groupsByKey) do
      if group.meta.type == "league" then
    -- Group by mission type outside career
    for groupKey, group in pairs(groupsByKey) do
      if group.meta.type == "all" then
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
      table.clear(occlusionPixels)
      for id, transform in pairs(occlusionTransforms) do
        local x, y, width, height = transform[1], transform[2], transform[3], transform[4]

  for _, transform in pairs(occlusionTransforms) do
    --im.Text(string.format("Pixel: %d, %d, %d, %d", pixel[1], pixel[2], pixel[3], pixel[4]))
  if debugSettings.drawOcclusion then
    for id, transform in pairs(occlusionTransforms) do
      im.Text(string.format("Occ %s: %0.3f, %0.3f, %0.3f, %0.3f", id, transform[1], transform[2], transform[3], transform[4]))
@/lua/ge/extensions/editor/extensionsDebug.lua
    local sortedKeys = extensions.getLoadedExtensionsNames()
    for _,k in pairs(sortedKeys) do
      if im.TreeNodeEx1(k) then
@/lua/ge/extensions/editor/raceEditor/pathnodes.lua
  if not self.path then return end
  for _, n in pairs(self.path.pathnodes.objects) do
    n._drawMode = 'normal'
  --self:selectPathnode(nil)
  for _, n in pairs(self.path.pathnodes.objects) do
    n._drawMode = 'faded'
  self.index = id
  for _, node in pairs(self.path.pathnodes.objects) do
    node._drawMode = (id == node.id) and 'highlight' or 'normal'
  local minNodeDist = 4294967295
  for name, n in pairs(map.getManualWaypoints()) do
    local node = self.map.nodes[name]
  local closestNode = nil
  for idx, node in pairs(self.path.pathnodes.objects) do
    local distNodeToCam = (node.pos - self.mouseInfo.camPos):length()
          local wps = {}
          for name, node in pairs(map.getManualWaypoints()) do
            local nd = self.map.nodes[name]
          table.clear(sortedWaypointsNames)
          for n,_ in pairs(map.getManualWaypoints()) do
            table.insert(sortedWaypointsNames, n)
        if im.BeginCombo("Target:##fromSegment", node.navgraphName) then
          for _, name in pairs(sortedWaypointsNames) do
            local nd = self.map.nodes[name]
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua

  for k,v in pairs(vEditor.aeroData.wheelNameStrings) do
    local key = wheelNames[v]
@/lua/ge/extensions/editor/rallyEditor/pacenotes/pacenoteForm.lua
  local keys = {}
  for k,v in pairs(RallyEnums.slowCornerReleaseTypeName) do
    table.insert(keys, k)
  local keys = {}
  for k,v in pairs(RallyEnums.triggerTypeName) do
    table.insert(keys, k)
@/lua/ge/extensions/freeroam/organizations.lua
      local data = jsonReadFile(file)
      for orgId, orgData in pairs(data) do
        orgData.id = orgId
  local result = {}
  for orgId, organization in pairs(getOrganizations()) do
    table.insert(result, getUIDataForOrg(orgId))
@/lua/ge/extensions/ui/policeInfo.lua
local function resetPursuitTable() -- resets values to zero
  for k, v in pairs(lastPursuitData) do
    if type(v) == 'number' then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamVariablesChecker.lua
local function analyzeJBeamFile(filePath, fileName, jbeamFileData, varToConfigsAndVals)
  for partName, partData in pairs(jbeamFileData) do
    jbeamTableSchema.process(partData, false, true)
    if partData.variables then
      for kv,vv in pairs(partData.variables) do
        checkValInRange(vv, vv.default, filePath, filePath, partName)
      if vehConfig.vars then
        for var, val in pairs(vehConfig.vars) do
          if not varToConfigsAndVals[var] then