Merge pull request #47 from The-Order-Of-The-Sacred-Framework/dev

Dev
This commit is contained in:
MrNewb authored and GitHub committed 2025-02-24 18:31:51 -05:00
commit 308af9e46d
60 files changed
+13065 -165

No files matched your search

+7 -1
View File
@@ -4,7 +4,7 @@ lua54 'yes'
use_experimental_fxv2_oal 'yes' use_experimental_fxv2_oal 'yes'
author 'The Order of the Sacred Framework' author 'The Order of the Sacred Framework'
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.' description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
version '0.3.1' version '0.3.11'
shared_scripts { shared_scripts {
'@ox_lib/init.lua', '@ox_lib/init.lua',
@@ -49,10 +49,16 @@ client_scripts {
'modules/input/*.lua', 'modules/input/*.lua',
'modules/menu/*.lua', 'modules/menu/*.lua',
'modules/notify/**/client.lua', 'modules/notify/**/client.lua',
'modules/dialogue/**/client/*.lua',
'init.lua', 'init.lua',
} }
ui_page 'web/dist/index.html'
files { files {
'web/dist/index.html',
'web/dist/assets/*.css',
'web/dist/assets/*.js',
'locales/*.json', 'locales/*.json',
'lib/client/*.lua', 'lib/client/*.lua',
'lib/shared/*.lua', 'lib/shared/*.lua',
+11 -17
View File
@@ -11,6 +11,7 @@ function Bridge.RegisterModule(moduleName, moduleTable)
local wrappedModule = {} local wrappedModule = {}
if type(moduleTable) == 'function' then if type(moduleTable) == 'function' then
Bridge[moduleName] = wrappedModule Bridge[moduleName] = wrappedModule
exports(moduleName, moduleTable)
return return
end end
for functionName, func in pairs(moduleTable) do for functionName, func in pairs(moduleTable) do
@@ -20,6 +21,12 @@ function Bridge.RegisterModule(moduleName, moduleTable)
print("^2 Registering module:", moduleName, "^0") print("^2 Registering module:", moduleName, "^0")
end end
Bridge[moduleName] = wrappedModule Bridge[moduleName] = wrappedModule
exports(moduleName, function()
return wrappedModule
end)
--trigger update object event --trigger update object event
TriggerEvent("Bridge:Refresh", moduleName, wrappedModule) TriggerEvent("Bridge:Refresh", moduleName, wrappedModule)
end end
@@ -62,19 +69,6 @@ Bridge.RegisterModule("Perlin", cLib.Perlin)
Bridge.RegisterModule("Actions", cLib.Actions) Bridge.RegisterModule("Actions", cLib.Actions)
CreateThread(function()
Wait(100)
for moduleName, moduleFunction in pairs(Bridge) do
if type(moduleFunction) == 'table' then
exports(moduleName, function()
return moduleFunction
end)
else
exports(moduleName, moduleFunction)
end
end
end)
exports('Bridge', function() exports('Bridge', function()
return Bridge return Bridge
end) end)
@@ -97,14 +91,14 @@ if IsDuplicityVersion() then return end
Bridge.RegisterModule("Fuel", Fuel) Bridge.RegisterModule("Fuel", Fuel)
Bridge.RegisterModule("Input", Input) Bridge.RegisterModule("Input", Input)
Bridge.RegisterModule("Progressbar", Progressbar) Bridge.RegisterModule("ProgressBar", ProgressBar)
Bridge.RegisterModule("Target", Target) Bridge.RegisterModule("Target", Target)
Bridge.RegisterModule("Menu", Menu) Bridge.RegisterModule("Menu", Menu)
Bridge.RegisterModule("Utility", cLib.Utility) Bridge.RegisterModule("Dialogue", Dialogue)
Bridge.RegisterModule("Placeable", cLib.Placeable) Bridge.RegisterModule("Utility", cLib.Utility)
--new Bridge.RegisterModule("Placeable", cLib.Placeable)--new
Bridge.RegisterModule("Gizmo", cLib.Gizmo) Bridge.RegisterModule("Gizmo", cLib.Gizmo)
Bridge.RegisterModule("Scaleform", cLib.Scaleform) Bridge.RegisterModule("Scaleform", cLib.Scaleform)
Bridge.RegisterModule("Raycast", cLib.Raycast) Bridge.RegisterModule("Raycast", cLib.Raycast)
+1 -1
View File
@@ -90,7 +90,7 @@ if not isServer then goto client end
function ReboundEntities.Create(entityData, src) function ReboundEntities.Create(entityData, src)
local entity = ReboundEntities.Register(entityData) local entity = ReboundEntities.Register(entityData)
assert(entity and entity.position, "Invalid entity data") assert(entity and entity.position, "Invalid entity data")
entity.rotation = entity.rotation or vector3(0, 0, 0) entity.rotation = entity.rotation or vector3(0, 0, entityData.heading or 0)
TriggerClientEvent(GetCurrentResourceName() .. ":client:CreateReboundEntity", src or -1, entity) TriggerClientEvent(GetCurrentResourceName() .. ":client:CreateReboundEntity", src or -1, entity)
return entity return entity
end end
+157
View File
@@ -0,0 +1,157 @@
local promises = {}
local activeDialogue = nil
local pendingCameraDestroy = false
Dialogue = {}
local cam = nil
local npc = nil
function Dialogue.Close(name)
-- Instead of destroying immediately, wait to see if new dialogue opens
pendingCameraDestroy = true
activeDialogue = nil
SetNuiFocus(false, false)
SendNUIMessage({
type = "close",
name = name
})
-- Wait brief moment to see if new dialogue opens
CreateThread(function()
Wait(50) -- Small delay to allow new dialogue to open
if pendingCameraDestroy and not activeDialogue then
-- No new dialogue opened, safe to destroy camera
RenderScriptCams(false, 1, 1000, 1, 0)
SetCamActive(cam, false)
DestroyCam(cam, false)
cam = nil
end
end)
promises[name] = nil
end
--- Open a dialogue with the player
--- @param name string
--- @param dialogue string
--- @param options table example = {{ id = string, label = string}}
function Dialogue.Open( name, dialogue, characterOptions, dialogueOptions, onSelected)
assert(name, "Name is required")
assert(dialogue, "Dialogue is required")
assert(dialogueOptions, "Dialogue options are required")
assert(characterOptions, "CharacterOptions must be a number or table containing an entity")
local isCharacterATable = type(characterOptions) == "table"
local entity = isCharacterATable and characterOptions.entity or tonumber(characterOptions)
local offset = isCharacterATable and characterOptions.offset or vector3(0, 0, 0)
local rotationOffset = isCharacterATable and characterOptions.rotationOffset or vector3(0, 0, 0)
-- Cancel any pending camera destroy
pendingCameraDestroy = false
activeDialogue = name
-- camera magic!
if entity then
local pedHeading = GetEntityHeading(entity)
-- Convert heading to radians and calculate offset
local angleRad = math.rad(pedHeading)
local offsetX = math.sin(angleRad) * 1.5
local offsetY = math.cos(angleRad) * 1.5
-- Get position in front of ped based on their heading
local endLocation = GetEntityCoords(entity) + vector3(offsetX, offsetY, 0.5) + offset
if not cam then cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", 1) end
local camPos = GetCamCoord(cam)
local dist = #(endLocation - camPos)
local abs = cam and math.abs(dist)
if not abs or abs > 0.5 then
local camAngle = (pedHeading + 180.0) % 360.0
SetCamRot(cam, rotationOffset.x, rotationOffset.y, camAngle + rotationOffset.z, 2)
SetCamCoord(cam, endLocation.x, endLocation.y, endLocation.z)
RenderScriptCams(true, true, 1000, true, false)
SetCamActive(cam, true)
end
end
SendNUIMessage({
type = "open",
text = dialogue,
name = name,
options = dialogueOptions
})
SetNuiFocus(true, true)
local wrappedFunction = function(selected)
SetNuiFocus(false, false)
Dialogue.Close(name)
onSelected(selected)
end
promises[name] = wrappedFunction
end
RegisterNuiCallback("dialogue:SelectOption", function(data)
local promis = promises[data.name]
if not promis then return end
promis(data.id)
end)
-- Debug command
if BridgeSharedConfig.DebugLevel >= 1 then
RegisterCommand("dialogue", function()
local pos = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0, 2.0, 0)
local timeout = 500
local model = `a_f_y_hipster_01`
RequestModel(model)
while not HasModelLoaded(model) do
Wait(0)
timeout = timeout - 1
if timeout == 0 then
print("Failed to load model")
return
end
end
local ped = CreatePed(0, model, pos.x, pos.y, pos.z, 0.0, false, false)
local characterData = {
entity = ped,
offset = vector3(0, 0, 0),
rotationOffset = vector3(0, 0, 0)
}
Wait(750)
Dialogue.Open("Akmed", "Hello how are you doing my friend?", characterData, {
{
label = "Trade with me",
id = 'something',
},
{
label = "Goodbye",
id = 'someotherthing',
},
},
function(selectedId)
if selectedId == 'something' then
Dialogue.Open( "Akmed" , "Thank you for wanting to purchase me lucky charms", characterData, {
{
label = "Fuck off",
id = 'something',
},
{
label = "Goodbye",
id = 'someotherthing',
},
},
function(selectedId)
DeleteEntity(ped)
if selectedId == "something" then
print("You hate lucky charms")
else
print("Thanks for keeping it civil")
end
end)
else
DeleteEntity(ped)
end
end)
end)
end
+2 -1
View File
@@ -1,4 +1,5 @@
if GetResourceState('gksphone') ~= 'started' then return end if GetResourceState('gksphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "gksphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.SendEmail = function(email, title, message) Phone.SendEmail = function(email, title, message)
+2 -1
View File
@@ -1,4 +1,5 @@
if GetResourceState('gksphone') ~= 'started' then return end if GetResourceState('gksphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "gksphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.GetPlayerPhone = function(src) Phone.GetPlayerPhone = function(src)
+2 -1
View File
@@ -1,4 +1,5 @@
if GetResourceState('lb-phone') ~= 'started' then return end if GetResourceState('lb-phone') ~= 'started' or (BridgeSharedConfig.Phone ~= "lb-phone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.SendEmail = function(email, title, message) Phone.SendEmail = function(email, title, message)
+2 -1
View File
@@ -1,4 +1,5 @@
if GetResourceState('lb-phone') ~= 'started' then return end if GetResourceState('lb-phone') ~= 'started' or (BridgeSharedConfig.Phone ~= "lb-phone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.GetPlayerPhone = function(src) Phone.GetPlayerPhone = function(src)
+2 -1
View File
@@ -1,4 +1,5 @@
if GetResourceState('qs-smartphone') ~= 'started' then return end if GetResourceState('qs-smartphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "qs-smartphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.SendEmail = function(email, title, message) Phone.SendEmail = function(email, title, message)
+1 -1
View File
@@ -1,4 +1,4 @@
if GetResourceState('qs-smartphone') ~= 'started' then return end if GetResourceState('qs-smartphone') ~= 'started' or (BridgeSharedConfig.Phone ~= "qs-smartphone" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
Phone = {} Phone = {}
Phone.GetPlayerPhone = function(src) Phone.GetPlayerPhone = function(src)
+108 -35
View File
@@ -1,38 +1,111 @@
if BridgeClientConfig.ProgressBar ~= "ox" then return end -- if BridgeClientConfig.ProgressBar ~= "ox" then return end
Progressbar = {} -- Progressbar = {}
local _progBarType = BridgeClientConfig.ProgressBarStyle or "bar" -- local _progBarType = BridgeClientConfig.ProgressBarStyle or "bar"
Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction) -- Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
local runTime = time or 10000 -- local runTime = time or 10000
local textLabel = label or "Doing something" -- local textLabel = label or "Doing something"
local deadBool = whiledead or false -- local deadBool = whiledead or false
local cancelBool = cancancel or false -- local cancelBool = cancancel or false
local disableKeys = disable or { move = true, sprint = true, car = true, combat = true, } -- local disableKeys = disable or { move = true, sprint = true, car = true, combat = true, }
local anim = animTable or nil -- local anim = animTable or nil
local success = successAction or function() Prints.Debug("Success") end -- local success = successAction or function() Prints.Debug("Success") end
local canceled = canceledAction or function() Prints.Debug("Cancelled") end -- local canceled = canceledAction or function() Prints.Debug("Cancelled") end
if _progBarType == "bar" then -- if _progBarType == "bar" then
if exports.ox_lib:progressBar({ -- if exports.ox_lib:progressBar({
duration = runTime, -- duration = runTime,
label = textLabel, -- label = textLabel,
useWhileDead = deadBool, -- useWhileDead = deadBool,
canCancel = cancelBool, -- canCancel = cancelBool,
disable = disableKeys, -- disable = disableKeys,
anim = anim, -- anim = anim,
}) then success() else canceled() end -- }) then success() else canceled() end
elseif _progBarType == "circle" then -- elseif _progBarType == "circle" then
if exports.ox_lib:progressCircle({ -- if exports.ox_lib:progressCircle({
duration = runTime, -- duration = runTime,
label = textLabel, -- label = textLabel,
position = 'bottom', -- position = 'bottom',
useWhileDead = deadBool, -- useWhileDead = deadBool,
canCancel = cancelBool, -- canCancel = cancelBool,
disable = disableKeys, -- disable = disableKeys,
anim = anim, -- anim = anim,
}) then success() else canceled() end -- }) then success() else canceled() end
end -- end
-- end
-- Progressbar.IsProgressBarActive = function()
-- return exports.ox_lib:progressActive()
-- end
if GetResourceState('ox_lib') ~= 'started' or (BridgeClientConfig.ProgressBarSystem ~= "ox" and BridgeClientConfig.InputSystem ~= "auto") then return end
ProgressBar = ProgressBar or {}
local function convertFromQB(options)
if not options then return options end
local prop1 = options.prop or {}
local prop2 = options.propTwo or {}
local props = {
{
model = prop1.model,
bone = prop1.bone,
pos = prop1.coords,
rot = prop1.rotation,
},
{
model = prop2.model,
bone = prop2.bone,
pos = prop2.coords,
rot = prop2.rotation,
}
}
return {
duration = options.duration,
label = options.label,
position = 'bottom',
useWhileDead = options.useWhileDead,
canCancel = options.canCancel,
disable = {
move = options.controlDisables?.disableMovement,
car = options.controlDisables?.disableCarMovement,
combat = options.controlDisables?.disableCombat,
mouse = options.controlDisables?.disableMouse
},
anim = {
dict = options.animation?.animDict,
clip = options.animation?.anim
},
prop = props,
}
end end
Progressbar.IsProgressBarActive = function() function ProgressBar.Open(options, cb, isQBInput)
return exports.ox_lib:progressActive() if isQBInput then
end options = convertFromQB(options)
end
local style = options.style or 'bar'
local success = style == 'circle' and exports.ox_lib:progressCircle(options) or exports.ox_lib:progressBar(options)
if cb then cb(not success) end
return success
end
RegisterCommand("progressbar", function()
ProgressBar.Open({
duration = 5000,
label = "Searching",
disable = {
move = true,
combat = true
},
anim = {
dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@",
clip = "machinic_loop_mechandplayer"
}
}, function(cancelled)
print(cancelled and "Cancelled" or "Complete")
end)
end)
+128 -55
View File
@@ -1,60 +1,133 @@
if BridgeClientConfig.ProgressBar ~= "qb" then return end -- if BridgeClientConfig.ProgressBar ~= "qb" then return end
Progressbar = {} -- Progressbar = {}
local function convertOxToQB(disabledTable, animTable) -- local function convertOxToQB(disabledTable, animTable)
local repackedTable = { disabled = {}, animations = {}} -- local repackedTable = { disabled = {}, animations = {}}
for _, v in pairs(disabledTable) do -- for _, v in pairs(disabledTable) do
if v.move then -- if v.move then
repackedTable.disabled.disableMovement = v.move -- repackedTable.disabled.disableMovement = v.move
end -- end
if v.car then -- if v.car then
repackedTable.disabled.disableCarMovement = v.car -- repackedTable.disabled.disableCarMovement = v.car
end -- end
if v.combat then -- if v.combat then
repackedTable.disabled.disableCombat = v.combat -- repackedTable.disabled.disableCombat = v.combat
end -- end
if v.mouse then -- if v.mouse then
repackedTable.disabled.disableMouse = v.mouse -- repackedTable.disabled.disableMouse = v.mouse
end -- end
end -- end
for _, v in pairs(animTable) do -- for _, v in pairs(animTable) do
if v.dict then -- if v.dict then
repackedTable.animations.animDict = v.animDict -- repackedTable.animations.animDict = v.animDict
end -- end
if v.clip then -- if v.clip then
repackedTable.animations.anim = v.anim -- repackedTable.animations.anim = v.anim
end -- end
end -- end
return repackedTable -- return repackedTable
-- end
-- Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
-- local runTime = time or 10000
-- local textLabel = label or "Doing something"
-- local deadBool = whiledead or false
-- local cancelBool = cancancel or false
-- local success = successAction or function() Prints.Debug("Success") end
-- local canceled = canceledAction or function() Prints.Debug("Cancelled") end
-- local repackedTable = convertOxToQB(disable, animTable)
-- exports['progressbar']:Progress({
-- name = textLabel,
-- duration = runTime,
-- label = textLabel,
-- useWhileDead = deadBool,
-- canCancel = cancelBool,
-- controlDisables = repackedTable.disabled,
-- animation = repackedTable.animations,
-- prop = {},
-- propTwo = {}
-- }, function(cancelled)
-- if not cancelled then
-- success()
-- else
-- canceled()
-- end
-- end)
-- end
-- Progressbar.IsProgressBarActive = function()
-- return exports["progressbar"]:isDoingSomething()
-- end
if GetResourceState('progressbar') ~= 'started' or (BridgeClientConfig.ProgressBarSystem ~= "qb" and BridgeClientConfig.ProgressBarSystem ~= "auto") then return end
ProgressBar = ProgressBar or {}
local function convertFromOx(options)
if not options then return options end
local prop1 = options.prop?[1] or options.prop or {}
local prop2 = options.prop?[2] or {}
return {
name = options.label,
duration = options.duration,
label = options.label,
useWhileDead = options.useWhileDead,
canCancel = options.canCancel,
controlDisables = {
disableMovement = options.disable?.move,
disableCarMovement = options.disable?.car,
disableMouse = options.disable?.mouse,
disableCombat = options.disable?.combat
},
animation = {
animDict = options.anim?.dict,
anim = options.anim?.clip
},
prop = {
model = prop1.model,
bone = prop1.bone,
coords = prop1.pos,
rotation = prop1.rot
},
propTwo = {
model = prop2.model,
bone = prop2.bone,
coords = prop2.pos,
rotation = prop2.rot
}
}
end end
Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction) function ProgressBar.Open(options, cb, qbFormat)
local runTime = time or 10000 if not exports['progressbar'] then return false end
local textLabel = label or "Doing something"
local deadBool = whiledead or false if not qbFormat then
local cancelBool = cancancel or false options = convertFromOx(options)
local success = successAction or function() Prints.Debug("Success") end end
local canceled = canceledAction or function() Prints.Debug("Cancelled") end
local repackedTable = convertOxToQB(disable, animTable) exports['progressbar']:Progress(options, cb)
exports['progressbar']:Progress({
name = textLabel,
duration = runTime,
label = textLabel,
useWhileDead = deadBool,
canCancel = cancelBool,
controlDisables = repackedTable.disabled,
animation = repackedTable.animations,
prop = {},
propTwo = {}
}, function(cancelled)
if not cancelled then
success()
else
canceled()
end
end)
end end
Progressbar.IsProgressBarActive = function()
return exports["progressbar"]:isDoingSomething() -- Example usage:
end RegisterCommand("progressbar", function()
ProgressBar.Open({
duration = 5000,
label = "Searching",
disable = {
move = true,
combat = true
},
anim = {
dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@",
clip = "machinic_loop_mechandplayer"
},
prop = {
model = "prop_ar_arrow_3",
pos = vector3(0.0, 0.0, 0.0),
rot = vector3(0.0, 0.0, 0.0)
},
}, function(cancelled)
print(cancelled and "Cancelled" or "Complete")
end)
end)
+45
View File
@@ -0,0 +1,45 @@
Target = Target or {}
local function warnUser()
print("Currently Only Targeting Is Supported.")
end
Target.AddGlobalPlayer = function(options)
warnUser()
end
Target.AddGlobalVehicle = function(options)
warnUser()
end
Target.RemoveGlobalVehicle = function(options)
warnUser()
end
Target.AddLocalEntity = function(entities, _options)
warnUser()
end
Target.AddModel = function(models, options)
warnUser()
end
Target.AddBoxZone = function(name, coords, size, heading, options)
warnUser()
end
Target.RemoveGlobalPlayer = function()
warnUser()
end
Target.RemoveLocalEntity = function(entity)
warnUser()
end
Target.RemoveModel = function(model)
warnUser()
end
Target.RemoveZone = function(name)
warnUser()
end
+1 -1
View File
@@ -12,7 +12,7 @@ detectDebugEnabled()
local ox_target = exports.ox_target local ox_target = exports.ox_target
local targetZones = {} local targetZones = {}
Target = {} Target = Target or {}
Target.FixOptions = function(options) Target.FixOptions = function(options)
for k, v in pairs(options) do for k, v in pairs(options) do
+1 -1
View File
@@ -11,7 +11,7 @@ detectDebugEnabled()
local targetZones = {} local targetZones = {}
Target = {} Target = Target or {}
Target.FixOptions = function(options) Target.FixOptions = function(options)
for k, v in pairs(options) do for k, v in pairs(options) do
@@ -0,0 +1,35 @@
if GetResourceState('sleepless_interact') ~= 'started' then return end
local sleepless = exports.sleepless_interact
Target = Target or {}
Target.FixOptions = function(options)
for k, v in pairs(options) do
local action = v.onSelect or v.action
local select = function(entityOrData)
if type(entityOrData) == 'table' then
return action(entityOrData.entity)
end
return action(entityOrData)
end
options[k].onSelect = select
end
return options
end
Target.AddLocalEntity = function(entity, _options)
local options = Target.FixOptions(_options)
sleepless:addLocalEntity({
id = entity,
entity = entity,
options = options,
renderDistance = 10.0,
activeDistance = 2.0,
cooldown = 1500
})
end
Target.RemoveLocalEntity = function(entity)
sleepless:removeLocalEntity(entity)
end
@@ -1,4 +1,4 @@
if GetResourceState('F_RealCarKeysSystem') ~= 'started' then return end if GetResourceState('F_RealCarKeysSystem') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "F_RealCarKeysSystem" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end if GetResourceState('MrNewbVehicleKeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "MrNewbVehicleKeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('MrNewbVehicleKeys') ~= 'started' then return end if GetResourceState('MrNewbVehicleKeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "MrNewbVehicleKeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
@@ -1,12 +1,13 @@
if GetResourceState('Renewed-Vehiclekeys') ~= 'started' then return end if GetResourceState('Renewed-Vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "Renewed-Vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end if not plate and not DoesEntityExist(vehicle) then return false end
return exports['Renewed-Vehiclekeys']:addKey(plate) return exports['Renewed-Vehiclekeys']:addKey(plate)
end end
VehicleKey.RemoveKeys = function(vehicle, plate) VehicleKey.RemoveKeys = function(vehicle, plate)
if not DoesEntityExist(vehicle) then return false end if not plate and not DoesEntityExist(vehicle) then return false end
return exports['Renewed-Vehiclekeys']:removeKey(plate) return exports['Renewed-Vehiclekeys']:removeKey(plate)
end end
@@ -1,10 +1,13 @@
if GetResourceState('Renewed-Vehiclekeys') ~= 'started' then return end if GetResourceState('Renewed-Vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "Renewed-Vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
--wip if not plate then plate = GetVehicleNumberPlateText(vehicle) end
exports['Renewed-Vehiclekeys']:addKey(src, plate)
end end
VehicleKey.RemoveKeys = function(src, vehicle, plate) VehicleKey.RemoveKeys = function(src, vehicle, plate)
-- wip if not plate then plate = GetVehicleNumberPlateText(vehicle) end
exports['Renewed-Vehiclekeys']:removeKey(src, plate)
end end
@@ -1,4 +1,4 @@
if GetResourceState('cd_garage') ~= 'started' then return end if GetResourceState('cd_garage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "cd_garage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,4 @@
if GetResourceState('cd_garage') ~= 'started' then return end if GetResourceState('cd_garage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "cd_garage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('mk_vehiclekeys') ~= 'started' then return end if GetResourceState('mk_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mk_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('mk_vehiclekeys') ~= 'started' then return end if GetResourceState('mk_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mk_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
@@ -1,4 +1,4 @@
if GetResourceState('mono_carkeys') ~= 'started' then return end if GetResourceState('mono_carkeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "mono_carkeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('okokGarage') ~= 'started' then return end if GetResourceState('okokGarage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "okokGarage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -1,4 +1,5 @@
if GetResourceState('okokGarage') ~= 'started' then return end if GetResourceState('okokGarage') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "okokGarage" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
@@ -1,14 +1,12 @@
if GetResourceState('qb-vehiclekeys') ~= 'started' then return end if GetResourceState('qb-vehiclekeys') ~= 'started' and not GetResourceState("qbx_vehiclekeys") == "started" or (BridgeSharedConfig.VehicleKey ~= "qb-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
if GetResourceState('qbx_vehiclekeys') == 'started' then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
if plate == nil and vehicle and DoesEntityExist(vehicle) then if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
plate = GetVehicleNumberPlateText(vehicle) TriggerServerEvent("qb-vehiclekeys:server:AcquireVehicleKeys", plate)
end
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
end end
VehicleKey.RemoveKeys = function(vehicle, plate) VehicleKey.RemoveKeys = function(vehicle, plate)
TriggerEvent('qb-vehiclekeys:client:RemoveKeys', plate) if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
TriggerEvent("qb-vehiclekeys:client:RemoveKeys", plate)
end end
@@ -1,15 +1,17 @@
if GetResourceState('qb-vehiclekeys') ~= 'started' then return end if GetResourceState('qb-vehiclekeys') ~= 'started' and not GetResourceState("qbx_vehiclekeys") == "started" or (BridgeSharedConfig.VehicleKey ~= "qb-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
if GetResourceState('qbx_vehiclekeys') == 'started' then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
if plate then if not plate and vehicle then
return exports["qb-vehiclekeys"]:GiveKeys(src, plate) plate = GetVehicleNumberPlateText(vehicle)
end end
return exports["qb-vehiclekeys"]:GiveKeys(src, plate)
end end
VehicleKey.RemoveKeys = function(src, vehicle, plate) VehicleKey.RemoveKeys = function(src, vehicle, plate)
if plate then if not plate and vehicle then
return exports["qb-vehiclekeys"]:RemoveKeys(src, plate) plate = GetVehicleNumberPlateText(vehicle)
end end
return exports["qb-vehiclekeys"]:RemoveKeys(src, plate)
end end
@@ -1,7 +1,9 @@
if GetResourceState('qbx_vehiclekeys') ~= 'started' then return end if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qbx_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate) TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
end end
@@ -1,4 +1,5 @@
if GetResourceState('qbx_vehiclekeys') ~= 'started' then return end if GetResourceState('qbx_vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qbx_vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
@@ -1,12 +1,29 @@
if GetResourceState('qs-vehiclekeys') ~= 'started' then return end if GetResourceState('qs-vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qs-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
if not vehicle then return end
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
local verifiedPlate = GetVehicleNumberPlateText(vehicle) local verifiedPlate = GetVehicleNumberPlateText(vehicle)
exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true) return exports['qs-vehiclekeys']:GiveKeys(verifiedPlate, model, true)
end end
VehicleKey.RemoveKeys = function(vehicle, plate) VehicleKey.RemoveKeys = function(vehicle, plate)
return true if not vehicle then return end
end local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
local verifiedPlate = GetVehicleNumberPlateText(vehicle)
return exports['qs-vehiclekeys']:RemoveKeys(verifiedPlate, model)
end
RegisterNetEvent("community_bridge:vehicleKey:removeKeys", function(netId, plate)
if not NetworkDoesNetworkIdExist(netId) then return end
local vehicle = NetworkGetEntityFromNetworkId(netId)
VehicleKey.RemoveKeys(vehicle, plate)
end)
RegisterNetEvent("community_bridge:vehicleKey:giveKeys", function(netId, plate)
if not NetworkDoesNetworkIdExist(netId) then return end
local vehicle = NetworkGetEntityFromNetworkId(netId)
VehicleKey.GiveKeys(vehicle, plate)
end)
@@ -1,10 +1,15 @@
if GetResourceState('qs-vehiclekeys') ~= 'started' then return end if GetResourceState('qs-vehiclekeys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "qs-vehiclekeys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
--wip if not vehicle and not plate then return end
local netId = NetworkGetNetworkIdFromEntity(vehicle)
TriggerClientEvent("community_bridge:vehicleKey:giveKeys", src, netId, plate)
end end
VehicleKey.RemoveKeys = function(src, vehicle, plate) VehicleKey.RemoveKeys = function(src, vehicle, plate)
-- wip if not vehicle and not plate then return end
local netId = NetworkGetNetworkIdFromEntity(vehicle)
TriggerClientEvent("community_bridge:vehicleKey:removeKeys", src, netId, plate)
end end
@@ -1,4 +1,5 @@
if GetResourceState('t1ger_keys') ~= 'started' then return end if GetResourceState('t1ger_keys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "t1ger_keys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
@@ -9,4 +10,8 @@ end
VehicleKey.RemoveKeys = function(vehicle, plate) VehicleKey.RemoveKeys = function(vehicle, plate)
end end
RegisterNetEvent("community_bridge:vehicleKey:giveKeys", function(plate)
VehicleKey.GiveKeys(nil, plate)
end)
@@ -1,10 +1,11 @@
if GetResourceState('t1ger_keys') ~= 'started' then return end if GetResourceState('t1ger_keys') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "t1ger_keys" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
--wip TriggerClientEvent("community_bridge:vehicleKey:giveKeys", src, plate)
end end
VehicleKey.RemoveKeys = function(src, vehicle, plate) VehicleKey.RemoveKeys = function(src, vehicle, plate)
-- wip
end end
@@ -1,10 +1,12 @@
if GetResourceState('wasabi_carlock') ~= 'started' then return end if GetResourceState('wasabi_carlock') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "wasabi_carlock" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(vehicle, plate) VehicleKey.GiveKeys = function(vehicle, plate)
if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
exports.wasabi_carlock:GiveKey(plate) exports.wasabi_carlock:GiveKey(plate)
end end
VehicleKey.RemoveKeys = function(vehicle, plate) VehicleKey.RemoveKeys = function(vehicle, plate)
if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
exports.wasabi_carlock:RemoveKey(plate) exports.wasabi_carlock:RemoveKey(plate)
end end
@@ -1,10 +1,12 @@
if GetResourceState('wasabi_carlock') ~= 'started' then return end if GetResourceState('wasabi_carlock') ~= 'started' or (BridgeSharedConfig.VehicleKey ~= "wasabi_carlock" and BridgeSharedConfig.VehicleKey ~= "auto") then return end
VehicleKey = VehicleKey or {} VehicleKey = VehicleKey or {}
VehicleKey.GiveKeys = function(src, vehicle, plate) VehicleKey.GiveKeys = function(src, vehicle, plate)
--wip if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
exports.wasabi_carlock:GiveKey(src, plate)
end end
VehicleKey.RemoveKeys = function(src, vehicle, plate) VehicleKey.RemoveKeys = function(src, vehicle, plate)
-- wip if not plate and vehicle then plate = GetVehicleNumberPlateText(vehicle) end
exports.wasabi_carlock:RemoveKey(src, plate)
end end
+2 -1
View File
@@ -1,10 +1,11 @@
BridgeClientConfig = {} BridgeClientConfig = {}
BridgeClientConfig.DebugLevel = 2 -- Debug level, 0 for none, 1 for some, 2 for all data BridgeClientConfig.DebugLevel = 0 -- Debug level, 0 for none, 1 for some, 2 for all data
BridgeClientConfig.NotifySystem = "ox" -- [ ox | qb | esx | mythic | pNotify | t-notify | wasabi | lab | custom ] BridgeClientConfig.NotifySystem = "ox" -- [ ox | qb | esx | mythic | pNotify | t-notify | wasabi | lab | custom ]
BridgeClientConfig.HelpTextSystem = "auto" BridgeClientConfig.HelpTextSystem = "auto"
BridgeClientConfig.ShowHelpText = "ox" -- [ox | jg | qb | lab | custom ] BridgeClientConfig.ShowHelpText = "ox" -- [ox | jg | qb | lab | custom ]
BridgeClientConfig.InputSystem = "auto" -- [ auto | ox | qb ] BridgeClientConfig.InputSystem = "auto" -- [ auto | ox | qb ]
BridgeClientConfig.MenuSystem = "auto" -- [ auto | ox | qb ] BridgeClientConfig.MenuSystem = "auto" -- [ auto | ox | qb ]
BridgeClientConfig.ProgressBarSystem = "auto"
BridgeClientConfig.ZoneSystem = "ox" -- [ ox | poly ] BridgeClientConfig.ZoneSystem = "ox" -- [ ox | poly ]
BridgeClientConfig.ProgressBar = "ox" -- [ ox | qb ] BridgeClientConfig.ProgressBar = "ox" -- [ ox | qb ]
+2
View File
@@ -1,5 +1,7 @@
BridgeSharedConfig = {} BridgeSharedConfig = {}
BridgeSharedConfig.Lang = "auto" -- Change this to your preferred language (must match the locale file name ex. en or fr etc) BridgeSharedConfig.Lang = "auto" -- Change this to your preferred language (must match the locale file name ex. en or fr etc)
BridgeSharedConfig.DebugLevel = 0 -- Change this to your Debug level, 0 for none, 1 for some, 2 for all data BridgeSharedConfig.DebugLevel = 0 -- Change this to your Debug level, 0 for none, 1 for some, 2 for all data
BridgeSharedConfig.VehicleKey = "auto" -- Change this to your prefrence or leave it as auto
BridgeSharedConfig.Phone = "auto" -- Change this to your prefrence or leave it as auto
return BridgeSharedConfig return BridgeSharedConfig
+21
View File
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
+23
View File
@@ -0,0 +1,23 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+8
View File
@@ -0,0 +1,8 @@
# React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
+40
View File
@@ -0,0 +1,40 @@
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const o of u.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=n(l);fetch(l.href,u)}})();function rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hi={exports:{}},el={},Wi={exports:{}},T={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xn=Symbol.for("react.element"),lc=Symbol.for("react.portal"),uc=Symbol.for("react.fragment"),oc=Symbol.for("react.strict_mode"),ic=Symbol.for("react.profiler"),sc=Symbol.for("react.provider"),ac=Symbol.for("react.context"),cc=Symbol.for("react.forward_ref"),fc=Symbol.for("react.suspense"),dc=Symbol.for("react.memo"),pc=Symbol.for("react.lazy"),Do=Symbol.iterator;function mc(e){return e===null||typeof e!="object"?null:(e=Do&&e[Do]||e["@@iterator"],typeof e=="function"?e:null)}var Qi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ki=Object.assign,Yi={};function ln(e,t,n){this.props=e,this.context=t,this.refs=Yi,this.updater=n||Qi}ln.prototype.isReactComponent={};ln.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ln.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Xi(){}Xi.prototype=ln.prototype;function Uu(e,t,n){this.props=e,this.context=t,this.refs=Yi,this.updater=n||Qi}var $u=Uu.prototype=new Xi;$u.constructor=Uu;Ki($u,ln.prototype);$u.isPureReactComponent=!0;var Io=Array.isArray,Gi=Object.prototype.hasOwnProperty,Vu={current:null},Zi={key:!0,ref:!0,__self:!0,__source:!0};function Ji(e,t,n){var r,l={},u=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(u=""+t.key),t)Gi.call(t,r)&&!Zi.hasOwnProperty(r)&&(l[r]=t[r]);var i=arguments.length-2;if(i===1)l.children=n;else if(1<i){for(var s=Array(i),c=0;c<i;c++)s[c]=arguments[c+2];l.children=s}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)l[r]===void 0&&(l[r]=i[r]);return{$$typeof:Xn,type:e,key:u,ref:o,props:l,_owner:Vu.current}}function hc(e,t){return{$$typeof:Xn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Au(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xn}function vc(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fo=/\/+/g;function wl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vc(""+e.key):t.toString(36)}function gr(e,t,n,r,l){var u=typeof e;(u==="undefined"||u==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(u){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Xn:case lc:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+wl(o,0):r,Io(l)?(n="",e!=null&&(n=e.replace(Fo,"$&/")+"/"),gr(l,t,n,"",function(c){return c})):l!=null&&(Au(l)&&(l=hc(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(Fo,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",Io(e))for(var i=0;i<e.length;i++){u=e[i];var s=r+wl(u,i);o+=gr(u,t,n,s,l)}else if(s=mc(e),typeof s=="function")for(e=s.call(e),i=0;!(u=e.next()).done;)u=u.value,s=r+wl(u,i++),o+=gr(u,t,n,s,l);else if(u==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function tr(e,t,n){if(e==null)return e;var r=[],l=0;return gr(e,r,"","",function(u){return t.call(n,u,l++)}),r}function yc(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var oe={current:null},wr={transition:null},gc={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:wr,ReactCurrentOwner:Vu};function qi(){throw Error("act(...) is not supported in production builds of React.")}T.Children={map:tr,forEach:function(e,t,n){tr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tr(e,function(){t++}),t},toArray:function(e){return tr(e,function(t){return t})||[]},only:function(e){if(!Au(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};T.Component=ln;T.Fragment=uc;T.Profiler=ic;T.PureComponent=Uu;T.StrictMode=oc;T.Suspense=fc;T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gc;T.act=qi;T.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ki({},e.props),l=e.key,u=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(u=t.ref,o=Vu.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(s in t)Gi.call(t,s)&&!Zi.hasOwnProperty(s)&&(r[s]=t[s]===void 0&&i!==void 0?i[s]:t[s])}var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){i=Array(s);for(var c=0;c<s;c++)i[c]=arguments[c+2];r.children=i}return{$$typeof:Xn,type:e.type,key:l,ref:u,props:r,_owner:o}};T.createContext=function(e){return e={$$typeof:ac,_currentValue:e,_currentValue2:e,_threadCount:0,ProviderLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Sc=wt,kc=Symbol.for("react.element"),Ec=Symbol.for("react.fragment"),Cc=Object.prototype.hasOwnProperty,_c=Sc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xc={key:!0,ref:!0,__self:!0,__source:!0};function bi(e,t,n){var r,l={},u=null,o=null;n!==void 0&&(u=""+n),t.key!==void 0&&(u=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Cc.call(t,r)&&!xc.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:kc,type:e,key:u,ref:o,props:l,_owner:_c.current}}el.Fragment=Ec;el.jsx=bi;el.jsxs=bi;Hi.exports=el;var Pe=Hi.exports,Ql={},es={exports:{}},ye={},ts={exports:{}},ns={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(C,P){var z=C.length;C.push(P);e:for(;0<z;){var H=z-1>>>1,X=C[H];if(0<l(X,P))C[H]=P,C[z]=X,z=H;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var P=C[0],z=C.pop();if(z!==P){C[0]=z;e:for(var H=0,X=C.length,bn=X>>>1;H<bn;){var ht=2*(H+1)-1,gl=C[ht],vt=ht+1,er=C[vt];if(0>l(gl,z))vt<X&&0>l(er,gl)?(C[H]=er,C[vt]=z,H=vt):(C[H]=gl,C[ht]=z,H=ht);else if(vt<X&&0>l(er,z))C[H]=er,C[vt]=z,H=vt;else break e}}return P}function l(C,P){var z=C.sortIndex-P.sortIndex;return z!==0?z:C.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var s=[],c=[],m=1,h=null,p=3,g=!1,w=!1,S=!1,F=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(C){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=C)r(c),P.sortIndex=P.expirationTime,t(s,P);else break;P=n(c)}}function v(C){if(S=!1,d(C),!w)if(n(s)!==null)w=!0,vl(E);else{var P=n(c);P!==null&&yl(v,P.startTime-C)}}function E(C,P){w=!1,S&&(S=!1,f(N),N=-1),g=!0;var z=p;try{for(d(P),h=n(s);h!==null&&(!(h.expirationTime>P)||C&&!xe());){var H=h.callback;if(typeof H=="function"){h.callback=null,p=h.priorityLevel;var X=H(h.expirationTime<=P);P=e.unstable_now(),typeof X=="function"?h.callback=X:h===n(s)&&r(s),d(P)}else r(s);h=n(s)}if(h!==null)var bn=!0;else{var ht=n(c);ht!==null&&yl(v,ht.startTime-P),bn=!1}return bn}finally{h=null,p=z,g=!1}}var _=!1,x=null,N=-1,B=5,L=-1;function xe(){return!(e.unstable_now()-L<B)}function sn(){if(x!==null){var C=e.unstable_now();L=C;var P=!0;try{P=x(!0,C)}finally{P?an():(_=!1,x=null)}}else _=!1}var an;if(typeof a=="function")an=function(){a(sn)};else if(typeof MessageChannel<"u"){var Mo=new MessageChannel,nc=Mo.port2;Mo.port1.onmessage=sn,an=function(){nc.postMessage(null)}}else an=function(){F(sn,0)};function vl(C){x=C,_||(_=!0,an())}function yl(C,P){N=F(function(){C(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,vl(E))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(C){switch(p){case 1:case 2:case 3:var P=3;break;default:P=p}var z=p;p=P;try{return C()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var z=p;p=C;try{return P()}finally{p=z}},e.unstable_scheduleCallback=function(C,P,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,C){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=z+X,C={id:m++,callback:P,priorityLevel:C,startTime:z,expirationTime:X,sortIndex:-1},z>H?(C.sortIndex=z,t(c,C),n(s)===null&&C===n(c)&&(S?(f(N),N=-1):S=!0,yl(v,z-H))):(C.sortIndex=X,t(s,C),w||g||(w=!0,vl(E))),C},e.unstable_shouldYield=xe,e.unstable_wrapCallback=function(C){var P=p;return function(){var z=p;p=P;try{return C.apply(this,arguments)}finally{p=z}}}})(ns);ts.exports=ns;var Nc=ts.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Pc=wt,ve=Nc;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rs=new Set,Rn={};function Lt(e,t){Jt(e,t),Jt(e+"Capture",t)}function Jt(e,t){for(Rn[e]=t,e=0;e<t.length;e++)rs.add(t[e])}var We=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kl=Object.prototype.hasOwnProperty,zc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,jo={},Uo={};function Tc(e){return Kl.call(Uo,e)?!0:Kl.call(jo,e)?!1:zc.test(e)?Uo[e]=!0:(jo[e]=!0,!1)}function Lc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Rc(e,t,n,r){if(t===null||typeof t>"u"||Lc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ie(e,t,n,r,l,u,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=o}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new ie(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){b[e]=new ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){b[e]=new ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){b[e]=new ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){b[e]=new ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bu=/[\-:]([a-z])/g;function Hu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Bu,Hu);b[t]=new ie(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Bu,Hu);b[t]=new ie(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Bu,Hu);b[t]=new ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!1,!1)});b.xlinkHref=new ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wu(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t Line truncated
`+Sl+e}var kl=!1;function El(e,t){if(!e||kl)return"";kl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
`),u=r.stack.split(`
`),o=l.length-1,i=u.length-1;1<=o&&0<=i&&l[o]!==u[i];)i--;for(;1<=o&&0<=i;o--,i--)if(l[o]!==u[i]){if(o!==1||i!==1)do if(o--,i--,0>i||l[o]!==u[i]){var s=`
`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{kl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gn(e):""}function Oc(e){switch(e.tag){case 5:return gn(e.type);case 16:return gn("Lazy");case 13:return gn("Suspense");case 19:return gn("SuspenseList");case 0:case 2:case 15:return e=El(e.type,!1),e;case 11:return e=El(e.type.render,!1),e;case 1:return e=El(e.type,!0),e;default:return""}}function Zl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dt:return"Fragment";case Mt:return"Portal";case Yl:return"Profiler";case Qu:return"StrictMode";case Xl:return"Suspense";case Gl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case us:return(e.displayName||"Context")+".Consumer";case ls:return(e._context.displayName||"Context")+".Provider";case Ku:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yu:return t=e.displayName||null,t!==null?t:Zl(e.type)||"Memo";case Ze:t=e._payload,e=e._init;try{return Zl(e(t))}catch{}}return null}function Mc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zl(t);case 8:return t===Qu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ct(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function is(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Dc(e){var t=is(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rr(e){e._valueTracker||(e._valueTracker=Dc(e))}function ss(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=is(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Jl(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ct(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function as(e,t){t=t.checked,t!=null&&Wu(e,"checked",t,!1)}function ql(e,t){as(e,t);var n=ct(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bl(e,t.type,n):t.hasOwnProperty("defaultValue")&&bl(e,t.type,ct(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ao(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bl(e,t,n){(t!=="number"||Lr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wn=Array.isArray;function Qt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ct(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function eu(e,t){if(t.dang Line truncated
`).replace(Qf,"")}function fr(e,t,n){if(t=ci(t),ci(e)!==t&&n)throw Error(y(425))}function Ur(){}var pu=null,mu=null;function hu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vu=typeof setTimeout=="function"?setTimeout:void 0,Kf=typeof clearTimeout=="function"?clearTimeout:void 0,fi=typeof Promise=="function"?Promise:void 0,Yf=typeof queueMicrotask=="function"?queueMicrotask:typeof fi<"u"?function(e){return fi.resolve(null).then(e).catch(Xf)}:vu;function Xf(e){setTimeout(function(){throw e})}function Il(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Fn(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Fn(t)}function ut(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function di(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var on=Math.random().toString(36).slice(2),Fe="__reactFiber$"+on,An="__reactProps$"+on,Qe="__reactContainer$"+on,yu="__reactEvents$"+on,Gf="__reactListeners$"+on,Zf="__reactHandles$"+on;function St(e){var t=e[Fe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qe]||n[Fe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=di(e);e!==null;){if(n=e[Fe])return n;e=di(e)}return t}e=n,n=e.parentNode}return null}function Jn(e){return e=e[Fe]||e[Qe],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ut(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(y(33))}function ul(e){return e[An]||null}var gu=[],$t=-1;function pt(e){return{current:e}}function I(e){0>$t||(e.current=gu[$t],gu[$t]=null,$t--)}function M(e,t){$t++,gu[$t]=e.current,e.current=t}var ft={},re=pt(ft),ce=pt(!1),xt=ft;function qt(e,t){var n=e.type.contextTypes;if(!n)return ft;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function fe(e){return e=e.childContextTypes,e!=null}function $r(){I(ce),I(re)}function pi(e,t,n){if(re.current!==ft)throw Error(y(168));M(re,t),M(ce,n)}function Js(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,Mc(e)||"Unknown",l));return V({},n,r)}function Vr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ft,xt=re.current,M(re,e),M(ce,ce.current),!0}function mi(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=Js(e,t,xt),r.__reactInternalMemoizedMergedChildContext=e,I(ce),I(re),M(re,e)):I(ce),M(ce,n)}var Ve=null,ol=!1,Fl=!1;function qs(e){Ve===null?Ve=[e]:Ve.push(e)}function Jf(e){ol=!0,qs(e)}function mt(){if(!Fl&&Ve!==null){Fl=!0;var e=0,t=O;try{var n=Ve;for(O=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ve=null,ol=!1}catch(l){throw Ve!==null&&(Ve=Ve.slice(e+1)),Cs(Gu,mt),l}finally{O=t,Fl=!1}}return null}var Vt=[],At=0,Ar=null,Br=0,we=[],Se=0,Nt=null,Ae=1,Be="";function yt(e,t){Vt[At++]=Br,Vt[At++]=Ar,Ar=e,Br=t}function bs(e,t,n){we[Se++]=Ae,we[Se++]=Be,we[Se++]=Nt,Nt=e;var r=Ae;e=Be;var l=32-Re(r)-1;r&=~(1<<l),n+=1;var u=32-Re(t)+l;if(30<u){var o=l-l%5;u=(r&(1<<o)-1).toString(32),r>>=o,l-=o,Ae=1<<32-Re(t)+l|n<<l|r,Be=u+e}else Ae=1<<u|n<<l|r,Be=e}function lo(e){e.return!==null&&(yt(e,1),bs(e,1,0))}function uo(e){for(;e===Ar;)Ar=Vt[--At],Vt[At]=null,Br=Vt[--At],Vt[At]=null;for(;e===Nt;)Nt=we[--Se],we[Se]=null,Be=we[--Se],we[Se]=null,Ae=we[--Se],we[Se]=null}var he=null,me=null,j=!1,Le=null;function ea(e,t){var n=ke(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function hi(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,he=e,me=ut(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,he=e,me=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Nt!==null?{id:Ae,overflow:Be}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ke(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,he=e,me=null,!0):!1;default:return!1}}function wu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Su(e){if(j){var t=me;if(t){var n=t;if(!hi(e,t)){if(wu(e))throw Error(y(418));t=ut(n.nextSibling);var r=he;t&&hi(e,t)?ea(r,n):(e.flags=e.flags&-4097|2,j=!1,he=e)}}else{if(wu(e))throw Error(y(418));e.flags=e.flags&-4097|2,j=!1,he=e}}}function vi(e){for(e=e.return;e!==null&&e.t Line truncated
Error generating stack: `+u.message+`
`+u.stack}return{value:e,source:t,stack:l,digest:null}}function Al(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _u(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var od=typeof WeakMap=="function"?WeakMap:Map;function Pa(e,t,n){n=He(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zr||(Zr=!0,Du=r),_u(e,t)},n}function za(e,t,n){n=He(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){_u(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){_u(e,t),typeof r!="function"&&(it===null?it=new Set([this]):it.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function _i(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Sd.bind(null,e,t,n),t.then(e,e))}function xi(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ni(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=He(-1,1),t.tag=2,ot(n,t,1))),n.lanes|=1),e)}var id=Xe.ReactCurrentOwner,ae=!1;function le(e,t,n,r){t.child=e===null?ra(t,null,n,r):en(t,e.child,n,r)}function Pi(e,t,n,r,l){n=n.render;var u=t.ref;return Gt(t,l),r=yo(e,t,n,r,u,l),n=go(),e!==null&&!ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ye(e,t,l)):(j&&n&&lo(t),t.flags|=1,le(e,t,r,l),t.child)}function zi(e,t,n,r,l){if(e===null){var u=n.type;return typeof u=="function"&&!zo(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,Ta(e,t,u,r,l)):(e=Tr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!(e.lanes&l)){var o=u.memoizedProps;if(n=n.compare,n=n!==null?n:Un,n(o,r)&&e.ref===t.ref)return Ye(e,t,l)}return t.flags|=1,e=at(u,r),e.ref=t.ref,e.return=t,t.child=e}function Ta(e,t,n,r,l){if(e!==null){var u=e.memoizedProps;if(Un(u,r)&&e.ref===t.ref)if(ae=!1,t.pendingProps=r=u,(e.lanes&l)!==0)e.flags&131072&&(ae=!0);else return t.lanes=e.lanes,Ye(e,t,l)}return xu(e,t,n,r,l)}function La(e,t,n){var r=t.pendingProps,l=r.children,u=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},M(Wt,pe),pe|=n;else{if(!(n&1073741824))return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,M(Wt,pe),pe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=u!==null?u.baseLanes:n,M(Wt,pe),pe|=r}else u!==null?(r=u.baseLanes|n,t.memoizedState=null):r=n,M(Wt,pe),pe|=r;return le(e,t,l,n),t.child}function Ra(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function xu(e,t,n,r,l){var u=fe(n)?xt:re.current;return u=qt(t,u),Gt(t,l),n=yo(e,t,n,r,u,l),r=go(),e!==null&&!ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ye(e,t,l)):(j&&r&&lo(t),t.flags|=1,le(e,t,n,l),t.child)}function Ti(e,t,n,r,l){if(fe(n)){var u=!0;Vr(t)}else u=!1;if(Gt(t,l),t.stateNode===null)Nr(e,t),Na(t,n,r),Cu(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,i=t.memoizedProps;o.props=i;var s=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ce(c):(c=fe(n)?xt:re.current,c=qt(t,c));var m=n.getDerivedStateFromProps,h=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==r||s!==c)&&Ci(t,o,r,c),Je=!1;var p=t.memoizedState;o.state=p,Qr(t,r,o,l),s=t.memoizedState,i!==r||p!==s||ce.current||Je?(typeof m=="function"&&(Eu(t,n,m,r),s=t.memoizedState),(i=Je||Ei(t,n,i,r,p,s,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=c,r=i):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ua(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:ze(t.type,i),o.props=c,h=t.pendingProps,p=o.context,s=n.contextType,typeof s=="object"&&s!==null?s=Ce(s):(s=fe(n)?xt:re.current,s=qt(t,s));var g=n.getDerivedStateFromProps;(m=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==h||p!==s)&&Ci(t,o,r,s),Je=!1,p=t.memoizedState,o.state=p,Qr(t,r,o,l);var w=t.memoizedState;i Line truncated
+1
View File
@@ -0,0 +1 @@
.container{display:flex;flex-direction:column;align-items:center;width:100%;min-height:100vh;background:transparent}.dialogue-container{position:fixed;bottom:30px;width:50%;background:transparent;padding:25px;left:50%;transform:translate(-50%)}.dialogue-text{background:#000000d9;padding:20px;border-radius:4px;margin:15px 0;line-height:1.6;font-size:1.1em;border:1px solid rgba(255,255,255,.15);box-shadow:0 4px 16px #0000004d}.dialogue-options{display:flex;flex-direction:row;flex-wrap:wrap;gap:12px;justify-content:space-between;margin-top:20px;width:100%}.dialogue-button{background:#000000d9;border:1px solid rgba(255,255,255,.15);color:#fff;padding:12px 24px;border-radius:4px;cursor:pointer;transition:all .2s ease;font-size:.95em;flex:1;text-align:center;min-width:calc(33.333% - 8px);box-shadow:0 4px 16px #0003}.dialogue-button:hover{background:#3333338c;transform:translateY(-1px);box-shadow:0 6px 20px #0000004d;border:1px solid rgba(255,255,255,.3)}h2{color:#fff;margin:0;font-size:1.4em;font-weight:600;text-shadow:0 2px 4px rgba(0,0,0,.3)}p{color:#fff;margin:0;text-shadow:0 1px 2px rgba(0,0,0,.2)}*{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.hidden{display:none}*{overflow-y:hidden;overflow-x:hidden}
+13
View File
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MRC Scuba</title>
<script type="module" crossorigin src="./assets/index-B0fYxqh2.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BEeeZu6c.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MRC Scuba</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/main.jsx"></script>
</body>
</html>
+12078
View File
File diff suppressed because it is too large. Load diff
+31
View File
@@ -0,0 +1,31 @@
{
"name": "sonar-ui",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build --watch",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@mantine/core": "^7.17.0",
"@mantine/hooks": "^7.17.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"vite": "^5.3.1"
}
}
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+82
View File
@@ -0,0 +1,82 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
min-height: 100vh;
background: transparent;
}
.dialogue-container {
position: fixed;
bottom: 30px;
width: 50%;
background: transparent;
padding: 25px;
left: 50%;
transform: translateX(-50%);
}
.dialogue-text {
background: rgba(0, 0, 0, 0.85);
padding: 20px;
border-radius: 4px;
margin: 15px 0;
line-height: 1.6;
font-size: 1.1em;
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.dialogue-options {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 12px;
justify-content: space-between;
margin-top: 20px;
width: 100%;
}
.dialogue-button {
background: rgba(0, 0, 0, 0.85);
border: 1px solid rgba(255, 255, 255, 0.15);
color: white;
padding: 12px 24px;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s ease;
font-size: 0.95em;
flex: 1;
text-align: center;
min-width: calc(33.333% - 8px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.dialogue-button:hover {
background: rgba(51, 51, 51, 0.55);
transform: translateY(-1px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.3);
}
h2 {
color: #ffffff;
margin: 0;
font-size: 1.4em;
font-weight: 600;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
p {
color: #fff;
margin: 0;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
/* Add this for better text rendering */
* {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
+54
View File
@@ -0,0 +1,54 @@
import { useState } from 'react'
import { fetchNui } from './fetch'
import './dialogue.css'
function Dialogue() {
const [count, setCount] = useState(0)
const [dialogueOptions, setDialogueOption] = useState([])
const [currentText, setCurrentText] = useState("Welcome traveler! How can I help you today?")
const [speakerName, setSpeakerName] = useState("Friendly NPC")
const handleMessage = (event) => {
var data = event.data;
if (data !== undefined && data.type === "close") {
document.getElementById('root').classList.add("hidden");
}
if (data !== undefined && data.type === "open") {
setDialogueOption(data.options);
setCurrentText(data.text);
setSpeakerName(data.name);
document.getElementById('root').classList.remove("hidden");
}
};
window.addEventListener("message", handleMessage);
return (
<>
<div className="container">
{/* Dialogue System */}
<div className="dialogue-container">
<h2>{speakerName}</h2>
<div className="dialogue-text">
<p>{currentText}</p>
</div>
<div className="dialogue-options">
{dialogueOptions.map((option) => (
<button
key={option.id}
onClick={() => fetchNui("dialogue:SelectOption", { name: speakerName, id: option.id })}
className="dialogue-button"
>
{option.label}
</button>
))}
</div>
</div>
</div>
</>
)
}
export default Dialogue
+26
View File
@@ -0,0 +1,26 @@
export const fetchNui = async (cbName, data = {}) => {
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
body: JSON.stringify(data)
};
try {
const resourceName = window.GetParentResourceName?.() || '';
const resp = await fetch(`https://${resourceName}/${cbName}`, options);
if (!resp.ok) {
throw new Error(`HTTP error! status: ${resp.status}`);
}
return await resp.json();
} catch (error) {
console.error(`Fetch error for ${cbName}:`, error);
if (!window.GetParentResourceName?.()) {
console.error('Resource name is null - are you testing in browser?');
}
return null;
}
};
+9
View File
@@ -0,0 +1,9 @@
.hidden {
display: none;
}
* {
overflow-y: hidden;
overflow-x: hidden;
}
+9
View File
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import Dialogue from './dialogue';
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<Dialogue />
</React.StrictMode>
);
+14
View File
@@ -0,0 +1,14 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import Dialogue from './dialogue.jsx'
import './index.css'
const root = document.getElementById('root')
ReactDOM.createRoot(root).render(
<React.StrictMode>
<Dialogue />
</React.StrictMode>,
)
// add hidden to root element
root.classList.add('hidden')
View File
Whitespace-only changes.
+3
View File
@@ -0,0 +1,3 @@
.hidden {
display: none;
}
+32
View File
@@ -0,0 +1,32 @@
import { useState } from 'react'
import './test.css'
function Dialogue() {
const [count, setCount] = useState(0)
const handleMessage = (event) => {
var data = event.data;
if (data !== undefined && data.type === "hide") {
document.getElementById('root').classList.add("hidden");
}
if (data !== undefined && data.type === "open") {
document.getElementById('root').classList.remove("hidden");
}
};
window.addEventListener("message", handleMessage);
return (
<>
<div className="container">
<img src= "https://dunb17ur4ymx4.cloudfront.net/wysiwyg/1364588/7b504ad7f496249800123e36ecfb3905677e337d.png"></img>
<br></br>
<button onClick={() => setCount(count + 1)}>Click me</button>
<p>You clicked {count} times</p>
</div>
</>
)
}
export default Dialogue
+7
View File
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})