diff --git a/VERSION b/VERSION index c7446443..7d07660c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.1.21p +v2.1.22p diff --git a/app/trace/ceic.go b/app/trace/ceic.go index 4ed7954d..d5bc2d82 100644 --- a/app/trace/ceic.go +++ b/app/trace/ceic.go @@ -91,7 +91,7 @@ func (c *CEIC) Format(latitude, longitude float64, data map[string]any) ([]Event Magnitude: string2Float(v["M"].(string)), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/cwa.go b/app/trace/cwa.go index fe68815a..19dc31f1 100644 --- a/app/trace/cwa.go +++ b/app/trace/cwa.go @@ -97,7 +97,7 @@ func (c *CWA) Format(latitude, longitude float64, data map[string]any) ([]Event, Magnitude: v.(map[string]any)["magnitude"].(float64), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/estimate.go b/app/trace/estimate.go index 310bcd2c..55b1a357 100644 --- a/app/trace/estimate.go +++ b/app/trace/estimate.go @@ -1,5 +1,10 @@ package trace -func getEstimation(distance float64) float64 { - return distance / 5.0 +func getEstimation(distance float64) estimation { + pWave := distance / 6.0 + sWave := distance / 3.5 + return estimation{ + P: pWave, + S: sWave, + } } diff --git a/app/trace/hko.go b/app/trace/hko.go index a248908a..17949bbf 100644 --- a/app/trace/hko.go +++ b/app/trace/hko.go @@ -87,7 +87,7 @@ func (h *HKO) Format(latitude, longitude float64, data map[string]any) ([]Event, Magnitude: string2Float(v["Mag"].(string)), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/jma.go b/app/trace/jma.go index e3d30d06..0f44c9a1 100644 --- a/app/trace/jma.go +++ b/app/trace/jma.go @@ -81,7 +81,7 @@ func (j *JMA) Format(latitude, longitude float64, data map[string]any) ([]Event, Magnitude: string2Float(v["mag"].(string)), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/scea-b.go b/app/trace/scea-b.go index 632428f3..9c1ee6fa 100644 --- a/app/trace/scea-b.go +++ b/app/trace/scea-b.go @@ -73,7 +73,7 @@ func (s *SCEA_B) Format(latitude, longitude float64, data map[string]any) ([]Eve Timestamp: time.UnixMilli(int64(v.(map[string]any)["shockTime"].(float64))).UnixMilli(), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/scea-e.go b/app/trace/scea-e.go index 49cf77bf..e0d42728 100644 --- a/app/trace/scea-e.go +++ b/app/trace/scea-e.go @@ -61,7 +61,7 @@ func (s *SCEA_E) Format(latitude, longitude float64, data map[string]any) ([]Eve Timestamp: time.UnixMilli(int64(v.(map[string]any)["shockTime"].(float64))).UnixMilli(), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/app/trace/types.go b/app/trace/types.go index 7ad79d91..6d7bd62b 100644 --- a/app/trace/types.go +++ b/app/trace/types.go @@ -10,17 +10,22 @@ type Binding struct { Source string `form:"source" json:"source" xml:"source" binding:"required"` } +type estimation struct { + P float64 `json:"p"` + S float64 `json:"s"` +} + type Event struct { - Verfied bool `json:"verfied"` - Timestamp int64 `json:"timestamp"` - Event string `json:"event"` - Region string `json:"region"` - Depth float64 `json:"depth"` - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - Distance float64 `json:"distance"` - Magnitude float64 `json:"magnitude"` - Estimated float64 `json:"estimated"` + Verfied bool `json:"verfied"` + Timestamp int64 `json:"timestamp"` + Event string `json:"event"` + Region string `json:"region"` + Depth float64 `json:"depth"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + Distance float64 `json:"distance"` + Magnitude float64 `json:"magnitude"` + Estimation estimation `json:"estimation"` } type DataSource interface { diff --git a/app/trace/usgs.go b/app/trace/usgs.go index 29415739..af8a962e 100644 --- a/app/trace/usgs.go +++ b/app/trace/usgs.go @@ -96,7 +96,7 @@ func (u *USGS) Format(latitude, longitude float64, data map[string]any) ([]Event Magnitude: properties.(map[string]any)["mag"].(float64), } l.Distance = getDistance(latitude, l.Latitude, longitude, l.Longitude) - l.Estimated = getEstimation(l.Distance) + l.Estimation = getEstimation(l.Distance) list = append(list, l) } diff --git a/build/assets/config.json b/build/assets/config.json index 70613e22..c5a49095 100644 --- a/build/assets/config.json +++ b/build/assets/config.json @@ -2,8 +2,8 @@ "station_settings": { "uuid": "a373e39c-8e15-44ae-a1ad-6fb622bc49e6", "name": "Test Station", - "latitude": 1.0, - "longitude": 1.0, + "latitude": 39.9, + "longitude": 116.3, "altitude": 0 }, "geophone_settings": { @@ -32,8 +32,8 @@ }, "serial_settings": { "packet": 4, - "baud": 19200, - "device": "/dev/ttyUSB0" + "baud": 115200, + "device": "/dev/rfcomm0" }, "ntpclient_settings": { "host": "0.pool.ntp.org", diff --git a/config/types.go b/config/types.go index 875a567c..7f43730c 100644 --- a/config/types.go +++ b/config/types.go @@ -63,6 +63,16 @@ type miniseed struct { LifeCycle int `json:"lifecycle"` } +type seedlink struct { + Enable bool `json:"enable"` + Host string `json:"host"` + Port int `json:"port"` + Station string `json:"station"` + Network string `json:"network"` + Buffer string `json:"buffer"` + Size int `json:"size"` +} + type Conf struct { Station station `json:"station_settings"` Serial serial `json:"serial_settings"` @@ -72,6 +82,7 @@ type Conf struct { Archiver archiver `json:"archiver_settings"` Server server `json:"server_settings"` MiniSEED miniseed `json:"miniseed_settings"` + SeedLink seedlink `json:"seedlink_settings"` } type Args struct { diff --git a/feature/miniseed/callbacks.go b/feature/miniseed/callbacks.go index 0c5bd751..a5fd619c 100644 --- a/feature/miniseed/callbacks.go +++ b/feature/miniseed/callbacks.go @@ -7,15 +7,15 @@ import ( "github.com/fatih/color" ) -func (g *MiniSEED) OnStart(options *feature.FeatureOptions, v ...any) { +func (m *MiniSEED) OnStart(options *feature.FeatureOptions, v ...any) { logger.Print(MODULE, text.Concat(v...), color.FgMagenta, false) } -func (g *MiniSEED) OnStop(options *feature.FeatureOptions, v ...any) { +func (m *MiniSEED) OnStop(options *feature.FeatureOptions, v ...any) { logger.Print(MODULE, text.Concat(v...), color.FgBlue, false) } -func (a *MiniSEED) OnReady(options *feature.FeatureOptions, v ...any) { +func (m *MiniSEED) OnReady(options *feature.FeatureOptions, v ...any) { logger.Print(MODULE, "1 record has been written", color.FgGreen, false) } diff --git a/feature/ntpclient/callbacks.go b/feature/ntpclient/callbacks.go index c16848df..1946fd7e 100644 --- a/feature/ntpclient/callbacks.go +++ b/feature/ntpclient/callbacks.go @@ -7,15 +7,15 @@ import ( "github.com/fatih/color" ) -func (g *NTPClient) OnStart(options *feature.FeatureOptions, v ...any) { +func (n *NTPClient) OnStart(options *feature.FeatureOptions, v ...any) { logger.Print(MODULE, text.Concat(v...), color.FgMagenta, false) } -func (g *NTPClient) OnStop(options *feature.FeatureOptions, v ...any) { +func (n *NTPClient) OnStop(options *feature.FeatureOptions, v ...any) { logger.Print(MODULE, text.Concat(v...), color.FgBlue, false) } -func (a *NTPClient) OnReady(options *feature.FeatureOptions, v ...any) { +func (n *NTPClient) OnReady(options *feature.FeatureOptions, v ...any) { options.Status.System.Offset = v[0].(float64) options.Status.IsReady = true logger.Print(MODULE, "time alignment succeed", color.FgGreen, false) diff --git a/feature/seedlink/callbacks.go b/feature/seedlink/callbacks.go new file mode 100644 index 00000000..ba06e3b1 --- /dev/null +++ b/feature/seedlink/callbacks.go @@ -0,0 +1,17 @@ +package seedlink + +import ( + "github.com/bclswl0827/observer/feature" +) + +func (s *SeedLink) OnStart(options *feature.FeatureOptions, v ...any) { +} + +func (s *SeedLink) OnStop(options *feature.FeatureOptions, v ...any) { +} + +func (s *SeedLink) OnReady(options *feature.FeatureOptions, v ...any) { +} + +func (s *SeedLink) OnError(options *feature.FeatureOptions, err error) { +} diff --git a/feature/seedlink/daemon.go b/feature/seedlink/daemon.go new file mode 100644 index 00000000..845d574f --- /dev/null +++ b/feature/seedlink/daemon.go @@ -0,0 +1,14 @@ +package seedlink + +import ( + "sync" + + "github.com/bclswl0827/observer/feature" +) + +func (s *SeedLink) Run(options *feature.FeatureOptions, waitGroup *sync.WaitGroup) { + if !options.Config.SeedLink.Enable { + s.OnStop(options, "service is disabled") + return + } +} diff --git a/feature/seedlink/types.go b/feature/seedlink/types.go new file mode 100644 index 00000000..7aead588 --- /dev/null +++ b/feature/seedlink/types.go @@ -0,0 +1,9 @@ +package seedlink + +const MODULE string = "seedlink" + +const ( + RELEASE string = "SeedLink v3.1 (Observer edition) :: SLPROTO:3.1 :: Constructing Realtime Seismic Network Ambitiously." +) + +type SeedLink struct{} diff --git a/frontend/dist/asset-manifest.json b/frontend/dist/asset-manifest.json index 51305b91..14754b8b 100644 --- a/frontend/dist/asset-manifest.json +++ b/frontend/dist/asset-manifest.json @@ -1,11 +1,11 @@ { "files": { "main.css": "/static/css/main.3d547ccc.css", - "main.js": "/static/js/main.43baa15e.js", + "main.js": "/static/js/main.c4219939.js", "static/css/278.525e2941.chunk.css": "/static/css/278.525e2941.chunk.css", "static/js/278.f2bbf51e.chunk.js": "/static/js/278.f2bbf51e.chunk.js", - "static/js/967.89477617.chunk.js": "/static/js/967.89477617.chunk.js", - "static/js/555.a23f4689.chunk.js": "/static/js/555.a23f4689.chunk.js", + "static/js/967.8f28312d.chunk.js": "/static/js/967.8f28312d.chunk.js", + "static/js/555.c29bef82.chunk.js": "/static/js/555.c29bef82.chunk.js", "static/js/756.f470d0ba.chunk.js": "/static/js/756.f470d0ba.chunk.js", "static/js/886.2b35e155.chunk.js": "/static/js/886.2b35e155.chunk.js", "static/js/377.f0e1c66a.chunk.js": "/static/js/377.f0e1c66a.chunk.js", @@ -17,7 +17,7 @@ "static/js/979.14e4e415.chunk.js": "/static/js/979.14e4e415.chunk.js", "static/js/822.ae40dac1.chunk.js": "/static/js/822.ae40dac1.chunk.js", "static/js/912.2ed8ddb3.chunk.js": "/static/js/912.2ed8ddb3.chunk.js", - "static/js/730.cafd7702.chunk.js": "/static/js/730.cafd7702.chunk.js", + "static/js/730.31759149.chunk.js": "/static/js/730.31759149.chunk.js", "static/media/gear-solid.svg": "/static/media/gear-solid.bf34f9d52ff44a67baec8a0d4220d3a3.svg", "static/media/bug-solid.svg": "/static/media/bug-solid.7f781f9ddd35c29f11111e36602dcc87.svg", "static/media/earth-americas-solid.svg": "/static/media/earth-americas-solid.4105ee3951f1c7ac60331fccafc17c1f.svg", @@ -47,6 +47,6 @@ }, "entrypoints": [ "static/css/main.3d547ccc.css", - "static/js/main.43baa15e.js" + "static/js/main.c4219939.js" ] } \ No newline at end of file diff --git a/frontend/dist/i18n/en-US.json b/frontend/dist/i18n/en-US.json index b321846d..63d62cc1 100644 --- a/frontend/dist/i18n/en-US.json +++ b/frontend/dist/i18n/en-US.json @@ -128,7 +128,7 @@ "modals": { "choose_event": { "title": "Select an Earthquake Event", - "template": "[M{{ magnitude }}] {{ event }}\nTime: {{ time }}\nDepth: {{ depth }} km\nEstimated arrival time: {{ estimated }} seconds" + "template": "[M{{ magnitude }}] {{ event }}\nTime: {{ time }}\nDepth: {{ depth }} km\nDistance: {{ distance }} km\nEstimated P-Wave Arrival: {{ p_wave }} sec\nEstimated S-Wave Arrival: {{ s_wave }} sec" } }, "selects": { @@ -191,7 +191,7 @@ "end_time": "Select End Time" }, "toasts": { - "time_error": "Please select the correct time range", + "duration_error": "Please select the correct time range", "metadata_error": "An error occurred while retrieving station information. The functionality is not available.", "is_exporting_sac": "Exporting SAC format waveforms, please wait...", "export_sac_success": "SAC format waveform data export successful", @@ -206,7 +206,9 @@ "fetch_waveform_success": "Historical waveform data query successful", "fetch_waveform_error": "Historical waveform data query failed", "copy_link_success": "Share link has copied to clipboard", - "copy_link_error": "Failed to copy share link to clipboard" + "copy_link_error": "Failed to copy share link to clipboard", + "duration_excceed": "The event duration exceeds the limit. Please manually query according to the arrival time of P/S waves at the station, or change the earthquake event", + "event_select_success": "Event selection successful.\nP-Wave arrival is about {{ p_wave }}\nS-Wave arrival is about {{ s_wave }}" } }, "export": { diff --git a/frontend/dist/i18n/zh-CN.json b/frontend/dist/i18n/zh-CN.json index e1bb9625..5cba0831 100644 --- a/frontend/dist/i18n/zh-CN.json +++ b/frontend/dist/i18n/zh-CN.json @@ -40,7 +40,7 @@ }, "success": { "label": "{{ station }} 已连接", - "text": "服务器在线时长 {{ uptime }} 秒\n服务器采用架构 {{ arch }}/{{ os }}\nUUID:{{ uuid }}" + "text": "服务器在线时长 {{ uptime }} 秒\n服务器采用架构 {{ arch }}/{{ os }}\nUUID {{ uuid }}" }, "error": { "label": "连接失败", @@ -50,17 +50,17 @@ "areas": { "cpu": { "label": "CPU 使用率", - "text": "当前占用率:{{ usage }}%" + "text": "当前占用率 {{ usage }}%" }, "memory": { "label": "内存使用率", - "text": "当前占用率:{{ usage }}%" + "text": "当前占用率 {{ usage }}%" } }, "map": { "area": { "label": "测站所在位置", - "text": "经度:{{ longitude }} °\n纬度:{{ latitude }} °\n海拔:{{ altitude }} m" + "text": "经度 {{ longitude }} °\n纬度 {{ latitude }} °\n海拔 {{ altitude }} 米" } }, "labels": { @@ -108,15 +108,15 @@ "areas": { "ehz": { "label": "EHZ 通道波形计数", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" }, "ehe": { "label": "EHE 通道波形计数", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" }, "ehn": { "label": "EHN 通道波形计数", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" } }, "toasts": { @@ -128,7 +128,7 @@ "modals": { "choose_event": { "title": "选择一个地震事件", - "template": "[M{{ magnitude }}] {{ event }}\n震发时间 {{ time }}\n震源深度 {{ depth }} km\n预计到站 {{ estimated }} 秒" + "template": "[M{{ magnitude }}] {{ event }}\n震发时间 {{ time }}\n震源深度 {{ depth }} 公里\n震央距离 {{ distance }} 公里\nP 波到站 {{ p_wave }} 秒\nS 波到站 {{ s_wave }} 秒" } }, "selects": { @@ -191,7 +191,7 @@ "end_time": "选择结束时间" }, "toasts": { - "time_error": "请选择正确的时间范围", + "duration_error": "请选择正确的时间范围", "metadata_error": "取得测站资讯时发生错误,功能无法使用", "is_exporting_sac": "正在导出 SAC 格式波形,请稍等...", "export_sac_success": "SAC 格式波形数据导出成功", @@ -206,7 +206,9 @@ "fetch_waveform_success": "历史波形数据查询成功", "fetch_waveform_error": "历史波形数据查询失败", "copy_link_success": "分享链接已复制到剪贴板", - "copy_link_error": "分享链接复制失败" + "copy_link_error": "分享链接复制失败", + "duration_excceed": "事件时间跨度超出限制,请根据 P/S 波到达测站时间点手动进行查询,或更换地震事件", + "event_select_success": "事件选择成功\nP 波约在 {{ p_wave }} 到站\nS 波约在 {{ s_wave }} 到站" } }, "export": { @@ -273,7 +275,7 @@ "duration_set": "历史波形默认查询范围已更改为 {{ duration }} s,页面即将刷新" }, "contents": { - "select_scale": "当前震度标准:{{ scale }}\n震度标准是用来衡量地震震度的标准,不同的标准会导致不同的震度值。", + "select_scale": "当前震度标准 {{ scale }}\n震度标准是用来衡量地震震度的标准,不同的标准会导致不同的震度值。", "purge_cache": "应用出现问题时,可尝试重置应用偏好。\n执行重置后,浏览器中的偏好将被清理,不会对后端服务器产生影响。", "waveform_retention": "此项设定实时波形页面的波形会保留的时间,当前 {{ retention }} s。\n以秒为单位,需要大于 0 且小于 1000,否则将会被重置为默认值 180 秒。", "query_duration": "此项设定历史查询页面自动填写的时间范围,当前 {{ duration }} s。\n以秒为单位,需要大于 0 且小于 3600,否则将会被重置为默认值 300 秒。" diff --git a/frontend/dist/i18n/zh-TW.json b/frontend/dist/i18n/zh-TW.json index c4cbf6eb..c81c57c5 100644 --- a/frontend/dist/i18n/zh-TW.json +++ b/frontend/dist/i18n/zh-TW.json @@ -40,7 +40,7 @@ }, "success": { "label": "{{ station }} 已連線", - "text": "伺服器在線時長 {{ uptime }} 秒\n伺服器採用架構 {{ arch }}/{{ os }}\nUUID:{{ uuid }}" + "text": "伺服器在線時長 {{ uptime }} 秒\n伺服器採用架構 {{ arch }}/{{ os }}\nUUID {{ uuid }}" }, "error": { "label": "連線失敗", @@ -50,17 +50,17 @@ "areas": { "cpu": { "label": "CPU 使用率", - "text": "目前佔用率:{{ usage }}%" + "text": "目前佔用率 {{ usage }}%" }, "memory": { "label": "記憶體使用率", - "text": "目前佔用率:{{ usage }}%" + "text": "目前佔用率 {{ usage }}%" } }, "map": { "area": { "label": "站點所在位置", - "text": "經度:{{ longitude }} °\n緯度:{{ latitude }} °\n海拔:{{ altitude }} m" + "text": "經度 {{ longitude }} °\n緯度 {{ latitude }} °\n海拔 {{ altitude }} 公尺" } }, "labels": { @@ -108,15 +108,15 @@ "areas": { "ehz": { "label": "EHZ 通道波形計數", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" }, "ehe": { "label": "EHE 通道波形計數", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" }, "ehn": { "label": "EHN 通道波形計數", - "text": "PGA:{{ pga }} gal\nPGV:{{ pgv }} kine\n震度:{{ intensity }}" + "text": "PGA {{ pga }} gal\nPGV {{ pgv }} kine\n震度 {{ intensity }}" } }, "toasts": { @@ -128,7 +128,7 @@ "modals": { "choose_event": { "title": "選擇一個地震事件", - "template": "[M{{ magnitude }}] {{ event }}\n震發時間 {{ time }}\n震央深度 {{ depth }} 公里\n預定到站 {{ estimated }} 秒" + "template": "[M{{ magnitude }}] {{ event }}\n震發時間 {{ time }}\n震央深度 {{ depth }} 公里\n震央距离 {{ distance }} 公里\nP 波到站 {{ p_wave }} 秒\nS 波到站 {{ s_wave }} 秒" } }, "selects": { @@ -191,7 +191,7 @@ "end_time": "選擇結束時間" }, "toasts": { - "time_error": "請選擇正確的時間範圍", + "duration_error": "請選擇正確的時間範圍", "metadata_error": "取得測站資訊時發生錯誤,功能無法使用", "is_exporting_sac": "正在匯出 SAC 格式波形,請稍候...", "export_sac_success": "SAC 格式波形資料匯出成功", @@ -206,7 +206,9 @@ "fetch_waveform_success": "歷史波形資料查詢成功", "fetch_waveform_error": "歷史波形資料查詢失敗", "copy_link_success": "分享連結已複製到剪貼簿", - "copy_link_error": "分享連結複製失敗" + "copy_link_error": "分享連結複製失敗", + "duration_excceed": "事件時間跨度超出限制,請根據 P/S 波到達測站時間點手動進行查詢,或更換地震事件", + "event_select_success": "事件選擇成功\nP 波約在 {{ p_wave }} 到站\nS 波約在 {{ s_wave }} 到站" } }, "export": { @@ -273,7 +275,7 @@ "duration_set": "歷史波形預設查詢範圍已更改為 {{ duration }} 秒,頁面即將刷新" }, "contents": { - "select_scale": "目前震度標準:{{ scale }}\n震度標準是用來衡量地震震度的標準,不同的標準會導致不同的震度值。", + "select_scale": "目前震度標準 {{ scale }}\n震度標準是用來衡量地震震度的標準,不同的標準會導致不同的震度值。", "purge_cache": "應用出現問題時,可嘗試重置應用偏好。\n執行重置後,瀏覽器中的偏好將被清理,不會對後端伺服器產生影響。", "waveform_retention": "此項設定實時波形頁面的波形會保留的時間,目前 {{ retention }} 秒。\n以秒為單位,需要大於 0 且小於 1000,否則將會被重置為預設值 180 秒。", "query_duration": "此項設定歷史查詢頁面自動填寫的時間範圍,目前 {{ duration }} 秒。\n以秒為單位,需要大於 0 且小於 3600,否則將會被重置為預設值 300 秒。" diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 597824a0..350c3d6a 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/frontend/dist/static/js/555.a23f4689.chunk.js b/frontend/dist/static/js/555.a23f4689.chunk.js deleted file mode 100644 index b8a47110..00000000 --- a/frontend/dist/static/js/555.a23f4689.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkobserver=self.webpackChunkobserver||[]).push([[555],{5608:function(e,t,n){var r=n(5671),a=n(3144),s=n(136),o=n(9388),i=n(7313),c=n(5590),l=n(6417),u=function(e){(0,s.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.children,r=e.label,a=e.text;return(0,l.jsxs)("div",{className:"mb-4 flex flex-col rounded-xl text-gray-700 shadow-lg",children:[(0,l.jsx)("div",{className:"mx-4 rounded-lg overflow-hidden shadow-lg",children:n}),(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsx)("h6",{className:"text-md font-bold text-gray-800",children:t(r.id,r.format)}),a&&(0,l.jsx)("span",{className:"text-md",children:t(a.id,a.format).split("\n").map((function(e,t){return(0,l.jsxs)("p",{children:[e,(0,l.jsx)("br",{})]},t)}))})]})]})}}]),n}(i.Component);t.Z=(0,c.Zh)()(u)},4595:function(e,t,n){var r=n(5671),a=n(3144),s=n(136),o=n(9388),i=n(7313),c=n(5590),l=n(6417),u=function(e){(0,s.Z)(n,e);var t=(0,o.Z)(n);function n(e){var a;return(0,r.Z)(this,n),(a=t.call(this,e)).state={isBusy:!1},a}return(0,a.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.className,r=e.label,a=e.onClick;return(0,l.jsx)("button",{className:"w-full text-white font-medium text-sm shadow-lg rounded-lg py-2 ".concat(n),onClick:a,children:t(r.id,r.format)})}}]),n}(i.Component);t.Z=(0,c.Zh)()(u)},3387:function(e,t,n){var r=n(5671),a=n(3144),s=n(136),o=n(9388),i=n(7313),c=n(5590),l=n(6417),u=function(e){(0,s.Z)(n,e);var t=(0,o.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,a.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.className,r=e.label,a=e.sublabel,s=e.children,o=Array.isArray(s)?s:[s];return(0,l.jsx)("div",{className:"w-full h-full text-gray-800",children:(0,l.jsxs)("div",{className:"flex flex-col shadow-lg rounded-lg",children:[(0,l.jsxs)("div",{className:"px-4 py-3 font-bold",children:[a&&(0,l.jsx)("h6",{className:"text-gray-500 text-xs",children:t(a.id,a.format)}),(0,l.jsx)("h2",{className:"text-xl",children:t(r.id,r.format)})]}),(0,l.jsx)("div",{className:"p-4 m-2 flex flex-col justify-center gap-4 ".concat(n),children:o.map((function(e,t){return(0,l.jsx)("div",{children:e},t)}))})]})})}}]),n}(i.Component);t.Z=(0,c.Zh)()(u)},3676:function(e,t,n){var r=n(1413),a=n(5671),s=n(3144),o=n(136),i=n(9388),c=n(7313),l=n(5845),u=n(7548),h=n(1259),d=n.n(h),p=n(5590),f=n(6417);d()(l);var v=function(e){(0,o.Z)(n,e);var t=(0,i.Z)(n);function n(e){var r;(0,a.Z)(this,n);var s=(r=t.call(this,e)).props,o=s.height,i=s.legend,c=s.tooltip,l=s.zooming,u=s.animation,h=s.lineWidth,d=s.tickInterval,p=s.tickPrecision,f=s.lineColor,v=s.backgroundColor;return r.state={accessibility:{enabled:!1},boost:{enabled:!0,seriesThreshold:5},chart:{zooming:l?{type:"x"}:{},marginTop:20,height:o,animation:u,backgroundColor:v},legend:{enabled:i,itemStyle:{color:"#fff"}},plotOptions:{series:{states:{hover:{enabled:!1}},lineWidth:h}},xAxis:{labels:{style:{color:"#fff"},format:"{value:%H:%M:%S}"},type:"datetime",tickColor:"#fff",lineColor:f},yAxis:{labels:{style:{color:"#fff"},format:p?"{value:".concat(p,"f}"):"{value:0.2f}"},title:{text:""},opposite:!0,lineColor:f,tickInterval:d},tooltip:{enabled:c,followPointer:!0,followTouchMove:!0,xDateFormat:"%Y-%m-%d %H:%M:%S",padding:12},credits:{enabled:!1},time:{useUTC:!1},title:{text:""}},r}return(0,s.Z)(n,[{key:"componentDidUpdate",value:function(){var e=this.props.t;l.setOptions({lang:{resetZoom:e("components.chart.reset_zoom"),resetZoomTitle:e("components.chart.reset_zoom_title")}})}},{key:"render",value:function(){var e=this.props.series,t=this.state;if(e.data)e.data.sort((function(e,t){return e[0]-t[0]}));else if(e.length)for(var n=0,a=e;n0){var l=e[c];e[c]=e[c+1],e[c+1]=l}return e}},2468:function(e,t,n){var r=n(4165),a=n(5861),s=n(6573),o=n(2968),i=n(1677),c=n(1061),l=n(281),u=n(8585),h=n.n(u),d=n(5827),p=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(t){var n,a,u,p,f,v,m,Z,y,g,x,b,w,k,j,_,C,S,N,M,T,P,z,E,H,D,F;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.tag,u=t.header,p=t.body,f=t.blob,v=t.filename,m=t.onUpload,Z=t.onDownload,y=t.cancelToken,g=t.timeout,x=void 0===g?d.Z.app_settings.timeout:g,(b=s.Z.create({timeout:1e3*x})).interceptors.request.use((function(e){return f||(e.headers.Accept="application/json"),e})),b.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)})),w=(0,l.Z)(a),k=null===(n=i.Z.find((function(e){return e.tag===a})))||void 0===n?void 0:n.method,e.prev=6,"ws"!==(null===(j=i.Z.find((function(e){return e.tag===a})))||void 0===j?void 0:j.type)){e.next=10;break}throw new Error("websocket protocol is not supported");case 10:return _="".concat(window.location.protocol).concat((0,c.Z)()),e.next=13,b.request({data:p,method:k,headers:u,url:"".concat(_).concat(w),onUploadProgress:m,onDownloadProgress:Z,cancelToken:null===y||void 0===y?void 0:y.token,responseType:f?"blob":"json"});case 13:if(C=e.sent,S=C.data,N=C.headers,!f){e.next=21;break}return(M=N["content-disposition"])?(P=null===(T=M.split(";").find((function(e){return e.includes("filename=")})))||void 0===T?void 0:T.split("=")[1])?h()(S,P):h()(S,"stream"):v?h()(S,v):h()(S,"stream"),z=(new Date).toISOString(),e.abrupt("return",{time:z,path:w,data:null,error:!1,status:200,message:"Returned data is a blob"});case 21:return e.abrupt("return",S);case 24:return e.prev=24,e.t0=e.catch(6),E=(new Date).toISOString(),H=e.t0,D=H.message,F=H.status,e.abrupt("return",{time:E,message:D,path:w,data:null,error:!(0,o.Mw)(e.t0),status:F||500});case 29:case"end":return e.stop()}}),e,null,[[6,24]])})));return function(t){return e.apply(this,arguments)}}();t.Z=p},5664:function(e,t){t.Z=function(e,t){for(var n=[],r=0;r"),i=function(){var t=o[c];try{if(t.includes("[")||t.includes("]")){var n,a,i=(null===(n=t.match(/^(.*?)\[/))||void 0===n?void 0:n[1])||"",l=(null===(a=t.match(/\[(.*?)\]/))||void 0===a?void 0:a[1])||":";if(!l.length)throw new Error("invalid path given");var u=l.split(":"),h=(0,r.Z)(u,2),d=h[0],p=h[1];s=i.length?s[i].find((function(e){return e[d]===p})):s.find((function(e){return e[d]===p}))}else s=s[t]}catch(f){return{v:e}}},c=0;c1&&void 0!==arguments[1]?arguments[1]:500;return function(){for(var r=this,a=arguments.length,s=new Array(a),o=0;ovalue",M.toFixed(2)),(0,ve.Z)(e,"[tag:ehz-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(C,M))),(0,ve.Z)(e,"[tag:ehe-pga]>value",T.toFixed(2)),(0,ve.Z)(e,"[tag:ehe-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(S,T))),(0,ve.Z)(e,"[tag:ehn-pga]>value",P.toFixed(2)),(0,ve.Z)(e,"[tag:ehn-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(N,P))),e},ye=n(7703),ge=n(8146),xe=n(6135),be=n(8780),we=n(5608),ke=function(e,t){for(var n=(0,de.Z)(t,"ts","number","asc"),r=0,a=["ehz","ehe","ehn"];rchart>series>data"),c)}return e},je=n(9439),_e=function(){var e=window.location,t=e.hash,n=e.search,r="hash"===me.Z.app_settings.router?t.split("?")[1]:n.split("?")[1];if(r){var a,s=r.split("&"),o={},i=(0,ue.Z)(s);try{for(i.s();!(a=i.n()).done;){var c=a.value.split("="),l=(0,je.Z)(c,2),u=l[0],h=l[1];o[u]=h}}catch(d){i.e(d)}finally{i.f()}return o}return{}},Ce=n(3250),Se=n(6573),Ne=n(3152),Me=function(e){(0,c.Z)(n,e);var t=(0,l.Z)(n);function n(e){var i;return(0,o.Z)(this,n),(i=t.call(this,e)).promisedSetState=function(e){return new Promise((function(t){return i.setState(e,t)}))},i.handleTimeChange=function(e,t){switch(e){case"start":i.setState((function(e){return{history:(0,s.Z)((0,s.Z)({},e.history),{},{start:t})}}));break;case"end":i.setState((function(e){return{history:(0,s.Z)((0,s.Z)({},e.history),{},{end:t})}}))}},i.handleQueryHistory=(0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,s,o,c,l,u,h,d,p,f,v,m,Z;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.state.history,n=t.start,a=t.end,s=t.format,o=t.channel,!(a-n<=0)&&n&&a){e.next=7;break}return c=i.props.t,l=c("views.history.toasts.time_error"),V.ZP.error(l),e.abrupt("return",Promise.reject(l));case 7:return u=i.state.tokens,h=Se.Z.CancelToken.source,d=h(),u.push(d),e.next=13,(0,O.Z)({cancelToken:d,body:t,tag:"history",blob:"sac"===s,filename:"".concat(o,"_").concat(n,"_").concat(a,".").concat(s)});case 13:if(p=e.sent,f=p.error,v=p.data,!f){e.next=21;break}return m=i.props.t,Z=m("sac"===s?"views.history.toasts.export_sac_error":"views.history.toasts.fetch_waveform_error"),"sac"===s&&V.ZP.error(Z),e.abrupt("return",Promise.reject(Z));case 21:return e.abrupt("return",v);case 22:case"end":return e.stop()}}),e)}))),i.handleQueryEvents=(0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,o,c,l,u,h;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.state,n=t.tokens,a=t.trace,o=Se.Z.CancelToken.source,c=o(),n.push(c),e.next=6,(0,O.Z)({cancelToken:c,body:a,tag:"trace"});case 6:if(l=e.sent,u=l.error,h=l.data,!u){e.next=11;break}return e.abrupt("return",Promise.reject(u));case 11:i.setState((function(e){return{modal:(0,s.Z)((0,s.Z)({},e.modal),{},{open:!0,values:h.map((function(e){var t=e.magnitude,n=e.region,r=e.event,a=e.timestamp,s=e.depth,o=e.estimated,c=(0,i.props.t)("views.history.modals.choose_event.template",{event:r,time:(0,ie.Z)(a),magnitude:t.toFixed(1),estimated:o.toFixed(1),depth:-1!==s?s.toFixed(1):"Unknown"});return[n,a+1e3*o,c]}))})}}));case 12:case"end":return e.stop()}}),e)}))),i.handleChooseEvent=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(t){var n,a,o,c,l;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.props.duration.duration,a=1e3*n/2,o=new Date(t).getTime(),c=o-a,l=o+a,e.next=7,i.promisedSetState({history:{start:c,end:l,format:"json"},modal:(0,s.Z)((0,s.Z)({},i.state.modal),{},{open:!1})});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.handleSelect=(0,Ne.Z)(function(){var e=(0,a.Z)((0,r.Z)().mark((function e(t,n){var a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.props.t,o={from:"history",dialog:(0,s.Z)((0,s.Z)({},i.state.select.dialog),{},{open:!1})},e.t0=t,e.next="history"===e.t0?5:"trace"===e.t0?10:15;break;case 5:return e.next=7,i.promisedSetState({select:o,history:(0,s.Z)((0,s.Z)({},i.state.history),{},{channel:n,format:"sac"})});case 7:return e.next=9,V.ZP.promise(i.handleQueryHistory(),{loading:a("views.history.toasts.is_exporting_sac"),success:a("views.history.toasts.export_sac_success"),error:a("views.history.toasts.export_sac_error")});case 9:case 14:return e.abrupt("break",15);case 10:return e.next=12,i.promisedSetState({select:o,trace:(0,s.Z)((0,s.Z)({},i.state.trace),{},{source:n})});case 12:return e.next=14,V.ZP.promise(i.handleQueryEvents(),{loading:a("views.history.toasts.is_fetching_events"),success:a("views.history.toasts.fetch_events_success"),error:a("views.history.toasts.fetch_events_error")});case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),200),i.handleQueryWaveform=(0,Ne.Z)((0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,o,c,l,u,h;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.promisedSetState({history:(0,s.Z)((0,s.Z)({},i.state.history),{},{format:"json"})});case 2:return t=i.props.t,e.next=5,V.ZP.promise(i.handleQueryHistory(),{loading:t("views.history.toasts.is_fetching_waveform"),success:t("views.history.toasts.fetch_waveform_success"),error:t("views.history.toasts.fetch_waveform_error")});case 5:(n=e.sent)&&(a=i.state,o=a.adc,c=a.geophone,l=a.scale,u=Ze(i.state.labels,n,o,c,l),h=ke(i.state.areas,n),i.setState({areas:h,labels:u}));case 7:case"end":return e.stop()}}),e)})))),i.handleQuerySACFile=(0,a.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i.setState((function(e){return{select:(0,s.Z)((0,s.Z)({},e.select),{},{from:"history",dialog:{open:!0,values:[["Vertical","EHZ"],["East-West","EHE"],["North-South","EHN"]],title:{id:"views.history.selects.choose_channel.title"}}})}}));case 1:case"end":return e.stop()}}),e)}))),i.handleQuerySource=(0,Ne.Z)((0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,o,c,l,u,h,d,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.props.t,n={source:"show"},a=i.state.tokens,o=Se.Z.CancelToken.source,c=o(),a.push(c),l=V.ZP.loading(t("views.history.toasts.is_fetching_source")),e.next=9,(0,O.Z)({cancelToken:c,body:n,tag:"trace"});case 9:if(u=e.sent,h=u.data,d=u.error,V.ZP.remove(l),!d&&h){e.next=19;break}return p=t("views.history.toasts.fetch_source_error"),V.ZP.error(p),e.abrupt("return",Promise.reject(p));case 19:V.ZP.success(t("views.history.toasts.fetch_source_success"));case 20:i.setState((function(e){return{select:{from:"trace",dialog:(0,s.Z)((0,s.Z)({},e.select.dialog),{},{open:!0,values:h.map((function(e){return[e.name,e.value]})),title:{id:"views.history.selects.choose_source.title"}})}}}));case 21:case"end":return e.stop()}}),e)})))),i.handleGetShareLink=(0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,s,o,c,l,u,h,d,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,Ce.Z)(),n=i.props.t,a=window.location,s=a.hash,o=a.origin,c=i.state.history,l=c.start,u=c.end,h="".concat(o).concat(s.length&&"/#").concat(t),d="".concat(h,"?start=").concat(l,"&end=").concat(u),!(p=navigator.clipboard||{writeText:function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}})){e.next=13;break}return e.next=10,p.writeText(d);case 10:V.ZP.success(n("views.history.toasts.copy_link_success")),e.next=14;break;case 13:V.ZP.error(n("views.history.toasts.copy_link_error"));case 14:case"end":return e.stop()}}),e)}))),i.state={tokens:[],trace:{source:"show"},history:{start:0,end:0,format:"json",channel:"EHZ"},areas:[{tag:"ehz",area:{label:{id:"views.history.areas.ehz.label"}},chart:{backgroundColor:"#d97706",lineWidth:1,height:300,series:{name:"EHZ",type:"line",color:"#f1f5f9",data:[]}}},{tag:"ehe",area:{label:{id:"views.history.areas.ehe.label"}},chart:{backgroundColor:"#10b981",lineWidth:1,height:300,series:{name:"EHE",type:"line",color:"#f1f5f9",data:[]}}},{tag:"ehn",area:{label:{id:"views.history.areas.ehn.label"}},chart:{backgroundColor:"#0ea5e9",lineWidth:1,height:300,series:{name:"EHN",type:"line",color:"#f1f5f9",data:[]}}}],select:{from:"history",dialog:{open:!1,title:{id:"views.history.selects.choose_channel.title"},values:[["Vertical","EHZ"],["East-West","EHE"],["North-South","EHN"]]}},modal:{open:!1,values:[],title:{id:"views.history.modals.choose_event.title"}},geophone:{ehz:1,ehe:1,ehn:1},adc:{fullscale:1,resolution:1},labels:[{tag:"ehz-pga",label:{id:"views.history.labels.ehz_pga.label"},unit:{id:"views.history.labels.ehz_pga.unit"},value:"0"},{tag:"ehz-intensity",label:{id:"views.history.labels.ehz_intensity.label"},unit:{id:"views.history.labels.ehz_intensity.unit"},value:"Unknown"},{tag:"ehe-pga",label:{id:"views.history.labels.ehe_pga.label"},unit:{id:"views.history.labels.ehe_pga.unit"},value:"0"},{tag:"ehe-intensity",label:{id:"views.history.labels.ehe_intensity.label"},unit:{id:"views.history.labels.ehe_intensity.unit"},value:"Unknown"},{tag:"ehn-pga",label:{id:"views.history.labels.ehn_pga.label"},unit:{id:"views.history.labels.ehn_pga.unit"},value:"0"},{tag:"ehn-intensity",label:{id:"views.history.labels.ehn_intensity.label"},unit:{id:"views.history.labels.ehn_intensity.unit"},value:"Unknown"}],scale:me.m.property()},i}return(0,i.Z)(n,[{key:"componentDidMount",value:function(){var e=(0,a.Z)((0,r.Z)().mark((function e(){var t,n,a,o,i,c,l,u,h,d,p,f,v,m,Z,y,g,x,b,w,k;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props.adc.adc,a=n.resolution,o=this.props.geophone.geophone,c=(i=o).ehz,l=i.ehe,u=i.ehn,h=this.props.scale.scale,-1!==a&&c*l*u!==0){e.next=20;break}return e.next=8,(0,O.Z)({tag:"station"});case 8:if(!(d=e.sent).data){e.next=17;break}o=R(d),n=Y(d),p=this.props,f=p.updateADC,(v=p.updateGeophone)&&v(o),f&&f(n),e.next=20;break;case 17:return m=this.props.t,V.ZP.error(m("views.history.toasts.metadata_error")),e.abrupt("return");case 20:Z=this.props.duration.duration,y=_e(),g=y.start,x=y.end,b=(0,s.Z)((0,s.Z)({},this.state.history),{},{start:g?Number(g):Date.now()-1e3*Z,end:x?Number(x):Date.now()}),w=me.Z.app_settings.scales,k=(null===(t=w.find((function(e){return e.property().value===h})))||void 0===t?void 0:t.property())||me.m.property(),this.setState({history:b,adc:n,geophone:o,scale:k});case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.state.tokens.forEach((function(e){return e.cancel()}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.areas,r=t.select,a=t.modal,o=t.history,i=t.labels,c=r.from,l=r.dialog,u=o.start,y=o.end;return(0,F.jsxs)(v.Z,{children:[(0,F.jsx)(h.Z,{}),(0,F.jsx)(d.Z,{}),(0,F.jsxs)(f.Z,{children:[(0,F.jsx)(p.Z,{}),(0,F.jsxs)(q.Z,{className:"mb-6",layout:"grid",children:[(0,F.jsxs)(U.Z,{className:"h-[360px]",label:{id:"views.history.cards.query_history"},children:[(0,F.jsx)(Q,{value:u,label:{id:"views.history.time_pickers.start_time"},onChange:function(t){return e.handleTimeChange("start",t)}}),(0,F.jsx)(Q,{value:y,label:{id:"views.history.time_pickers.end_time"},onChange:function(t){return e.handleTimeChange("end",t)}}),(0,F.jsx)(L.Z,{className:"bg-indigo-700 hover:bg-indigo-800",onClick:this.handleQueryWaveform,label:{id:"views.history.buttons.query_waveform"}}),(0,F.jsx)(L.Z,{className:"bg-green-700 hover:bg-green-800",onClick:this.handleQuerySACFile,label:{id:"views.history.buttons.query_sac_file"}}),(0,F.jsx)(L.Z,{className:"bg-yellow-700 hover:bg-yellow-800",onClick:this.handleQuerySource,label:{id:"views.history.buttons.query_source"}}),(0,F.jsx)(L.Z,{className:"bg-cyan-700 hover:bg-cyan-800",onClick:this.handleGetShareLink,label:{id:"views.history.buttons.get_share_link"}})]}),(0,F.jsx)(U.Z,{label:{id:"views.history.cards.analyse_history"},children:(0,F.jsx)(q.Z,{layout:"grid",children:i.map((function(e,t){return(0,F.jsx)(ce.Z,(0,s.Z)({},e),t)}))})})]}),n.map((function(e,t){var n=e.area,r=e.chart;return(0,F.jsx)(we.Z,(0,s.Z)((0,s.Z)({},n),{},{children:(0,F.jsx)(I.Z,(0,s.Z)((0,s.Z)({},r),{},{tooltip:!0,zooming:!0,animation:!1,tickPrecision:1,tickInterval:10}))}),t)}))]}),(0,F.jsx)(m.Z,{}),(0,F.jsx)(Z.Z,{}),(0,F.jsx)(G.Z,(0,s.Z)((0,s.Z)({},l),{},{onSelect:function(t){return e.handleSelect(c,t)}})),(0,F.jsx)(oe,(0,s.Z)((0,s.Z)({},a),{},{onSelect:this.handleChooseEvent,onClose:function(){return e.setState({modal:(0,s.Z)((0,s.Z)({},a),{},{open:!1})})}})),(0,F.jsx)(V.x7,{position:"top-center"})]})}}]),n}(u.Component),Te=(0,xe.$j)(be.Z,{updateGeophone:ge.V,updateADC:ye.V})((0,D.Zh)()(Me))}}]); \ No newline at end of file diff --git a/frontend/dist/static/js/555.c29bef82.chunk.js b/frontend/dist/static/js/555.c29bef82.chunk.js new file mode 100644 index 00000000..f2c8dba0 --- /dev/null +++ b/frontend/dist/static/js/555.c29bef82.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkobserver=self.webpackChunkobserver||[]).push([[555],{5608:function(e,t,r){var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590),l=r(6417),u=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.t,r=e.children,n=e.label,a=e.text;return(0,l.jsxs)("div",{className:"mb-4 flex flex-col rounded-xl text-gray-700 shadow-lg",children:[(0,l.jsx)("div",{className:"mx-4 rounded-lg overflow-hidden shadow-lg",children:r}),(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsx)("h6",{className:"text-md font-bold text-gray-800",children:t(n.id,n.format)}),a&&(0,l.jsx)("span",{className:"text-md",children:t(a.id,a.format).split("\n").map((function(e,t){return(0,l.jsxs)("p",{children:[e,(0,l.jsx)("br",{})]},t)}))})]})]})}}]),r}(i.Component);t.Z=(0,c.Zh)()(u)},4595:function(e,t,r){var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590),l=r(6417),u=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(e){var a;return(0,n.Z)(this,r),(a=t.call(this,e)).state={isBusy:!1},a}return(0,a.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.t,r=e.className,n=e.label,a=e.onClick;return(0,l.jsx)("button",{className:"w-full text-white font-medium text-sm shadow-lg rounded-lg py-2 ".concat(r),onClick:a,children:t(n.id,n.format)})}}]),r}(i.Component);t.Z=(0,c.Zh)()(u)},3387:function(e,t,r){var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590),l=r(6417),u=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.t,r=e.className,n=e.label,a=e.sublabel,s=e.children,o=Array.isArray(s)?s:[s];return(0,l.jsx)("div",{className:"w-full h-full text-gray-800",children:(0,l.jsxs)("div",{className:"flex flex-col shadow-lg rounded-lg",children:[(0,l.jsxs)("div",{className:"px-4 py-3 font-bold",children:[a&&(0,l.jsx)("h6",{className:"text-gray-500 text-xs",children:t(a.id,a.format)}),(0,l.jsx)("h2",{className:"text-xl",children:t(n.id,n.format)})]}),(0,l.jsx)("div",{className:"p-4 m-2 flex flex-col justify-center gap-4 ".concat(r),children:o.map((function(e,t){return(0,l.jsx)("div",{children:e},t)}))})]})})}}]),r}(i.Component);t.Z=(0,c.Zh)()(u)},3676:function(e,t,r){var n=r(1413),a=r(5671),s=r(3144),o=r(136),i=r(9388),c=r(7313),l=r(5845),u=r(7548),h=r(1259),d=r.n(h),p=r(5590),f=r(6417);d()(l);var v=function(e){(0,o.Z)(r,e);var t=(0,i.Z)(r);function r(e){var n;(0,a.Z)(this,r);var s=(n=t.call(this,e)).props,o=s.height,i=s.legend,c=s.tooltip,l=s.zooming,u=s.animation,h=s.lineWidth,d=s.tickInterval,p=s.tickPrecision,f=s.lineColor,v=s.backgroundColor;return n.state={accessibility:{enabled:!1},boost:{enabled:!0,seriesThreshold:5},chart:{zooming:l?{type:"x"}:{},marginTop:20,height:o,animation:u,backgroundColor:v},legend:{enabled:i,itemStyle:{color:"#fff"}},plotOptions:{series:{states:{hover:{enabled:!1}},lineWidth:h}},xAxis:{labels:{style:{color:"#fff"},format:"{value:%H:%M:%S}"},type:"datetime",tickColor:"#fff",lineColor:f},yAxis:{labels:{style:{color:"#fff"},format:p?"{value:".concat(p,"f}"):"{value:0.2f}"},title:{text:""},opposite:!0,lineColor:f,tickInterval:d},tooltip:{enabled:c,followPointer:!0,followTouchMove:!0,xDateFormat:"%Y-%m-%d %H:%M:%S",padding:12},credits:{enabled:!1},time:{useUTC:!1},title:{text:""}},n}return(0,s.Z)(r,[{key:"componentDidUpdate",value:function(){var e=this.props.t;l.setOptions({lang:{resetZoom:e("components.chart.reset_zoom"),resetZoomTitle:e("components.chart.reset_zoom_title")}})}},{key:"render",value:function(){var e=this.props.series,t=this.state;if(e.data)e.data.sort((function(e,t){return e[0]-t[0]}));else if(e.length)for(var r=0,a=e;r0){var l=e[c];e[c]=e[c+1],e[c+1]=l}return e}},2468:function(e,t,r){var n=r(4165),a=r(5861),s=r(6573),o=r(2968),i=r(1677),c=r(1061),l=r(281),u=r(8585),h=r.n(u),d=r(5827),p=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,u,p,f,v,m,Z,y,g,x,b,w,k,j,_,C,S,N,M,P,T,z,E,D,H,A;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.tag,u=t.header,p=t.body,f=t.blob,v=t.filename,m=t.onUpload,Z=t.onDownload,y=t.cancelToken,g=t.timeout,x=void 0===g?d.Z.app_settings.timeout:g,(b=s.Z.create({timeout:1e3*x})).interceptors.request.use((function(e){return f||(e.headers.Accept="application/json"),e})),b.interceptors.response.use((function(e){return e}),(function(e){return Promise.reject(e)})),w=(0,l.Z)(a),k=null===(r=i.Z.find((function(e){return e.tag===a})))||void 0===r?void 0:r.method,e.prev=6,"ws"!==(null===(j=i.Z.find((function(e){return e.tag===a})))||void 0===j?void 0:j.type)){e.next=10;break}throw new Error("websocket protocol is not supported");case 10:return _="".concat(window.location.protocol).concat((0,c.Z)()),e.next=13,b.request({data:p,method:k,headers:u,url:"".concat(_).concat(w),onUploadProgress:m,onDownloadProgress:Z,cancelToken:null===y||void 0===y?void 0:y.token,responseType:f?"blob":"json"});case 13:if(C=e.sent,S=C.data,N=C.headers,!f){e.next=21;break}return(M=N["content-disposition"])?(T=null===(P=M.split(";").find((function(e){return e.includes("filename=")})))||void 0===P?void 0:P.split("=")[1])?h()(S,T):h()(S,"stream"):v?h()(S,v):h()(S,"stream"),z=(new Date).toISOString(),e.abrupt("return",{time:z,path:w,data:null,error:!1,status:200,message:"Returned data is a blob"});case 21:return e.abrupt("return",S);case 24:return e.prev=24,e.t0=e.catch(6),E=(new Date).toISOString(),D=e.t0,H=D.message,A=D.status,e.abrupt("return",{time:E,message:H,path:w,data:null,error:!(0,o.Mw)(e.t0),status:A||500});case 29:case"end":return e.stop()}}),e,null,[[6,24]])})));return function(t){return e.apply(this,arguments)}}();t.Z=p},5664:function(e,t){t.Z=function(e,t){for(var r=[],n=0;n"),i=function(){var t=o[c];try{if(t.includes("[")||t.includes("]")){var r,a,i=(null===(r=t.match(/^(.*?)\[/))||void 0===r?void 0:r[1])||"",l=(null===(a=t.match(/\[(.*?)\]/))||void 0===a?void 0:a[1])||":";if(!l.length)throw new Error("invalid path given");var u=l.split(":"),h=(0,n.Z)(u,2),d=h[0],p=h[1];s=i.length?s[i].find((function(e){return e[d]===p})):s.find((function(e){return e[d]===p}))}else s=s[t]}catch(f){return{v:e}}},c=0;c1&&void 0!==arguments[1]?arguments[1]:500;return function(){for(var n=this,a=arguments.length,s=new Array(a),o=0;ovalue",M.toFixed(2)),(0,ve.Z)(e,"[tag:ehz-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(C,M))),(0,ve.Z)(e,"[tag:ehe-pga]>value",P.toFixed(2)),(0,ve.Z)(e,"[tag:ehe-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(S,P))),(0,ve.Z)(e,"[tag:ehn-pga]>value",T.toFixed(2)),(0,ve.Z)(e,"[tag:ehn-intensity]>value","".concat(a.value," ").concat(null===z||void 0===z?void 0:z.intensity(N,T))),e},ye=r(7703),ge=r(8146),xe=r(6135),be=r(8780),we=r(5608),ke=function(e,t){for(var r=(0,de.Z)(t,"ts","number","asc"),n=0,a=["ehz","ehe","ehn"];nchart>series>data"),c)}return e},je=r(9439),_e=function(){var e=window.location,t=e.hash,r=e.search,n="hash"===me.Z.app_settings.router?t.split("?")[1]:r.split("?")[1];if(n){var a,s=n.split("&"),o={},i=(0,ue.Z)(s);try{for(i.s();!(a=i.n()).done;){var c=a.value.split("="),l=(0,je.Z)(c,2),u=l[0],h=l[1];o[u]=h}}catch(d){i.e(d)}finally{i.f()}return o}return{}},Ce=r(3250),Se=r(6573),Ne=r(3152),Me=function(e){(0,c.Z)(r,e);var t=(0,l.Z)(r);function r(e){var i;return(0,o.Z)(this,r),(i=t.call(this,e)).promisedSetState=function(e){return new Promise((function(t){return i.setState(e,t)}))},i.handleTimeChange=function(e,t){switch(e){case"start":i.setState((function(e){return{history:(0,s.Z)((0,s.Z)({},e.history),{},{start:t})}}));break;case"end":i.setState((function(e){return{history:(0,s.Z)((0,s.Z)({},e.history),{},{end:t})}}))}},i.handleQueryHistory=(0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,s,o,c,l,u,h,d,p,f,v,m,Z;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.state.history,r=t.start,a=t.end,s=t.format,o=t.channel,!(a-r<=0)&&r&&a){e.next=7;break}return c=i.props.t,l=c("views.history.toasts.duration_error"),V.ZP.error(l),e.abrupt("return",Promise.reject(l));case 7:return u=i.state.tokens,h=Se.Z.CancelToken.source,d=h(),u.push(d),e.next=13,(0,O.Z)({cancelToken:d,body:t,tag:"history",blob:"sac"===s,filename:"".concat(o,"_").concat(r,"_").concat(a,".").concat(s)});case 13:if(p=e.sent,f=p.error,v=p.data,!f){e.next=21;break}return m=i.props.t,Z=m("sac"===s?"views.history.toasts.export_sac_error":"views.history.toasts.fetch_waveform_error"),"sac"===s&&V.ZP.error(Z),e.abrupt("return",Promise.reject(Z));case 21:return e.abrupt("return",v);case 22:case"end":return e.stop()}}),e)}))),i.handleQueryEvents=(0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,o,c,l,u,h;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.state,r=t.tokens,a=t.trace,o=Se.Z.CancelToken.source,c=o(),r.push(c),e.next=6,(0,O.Z)({cancelToken:c,body:a,tag:"trace"});case 6:if(l=e.sent,u=l.error,h=l.data,!u){e.next=11;break}return e.abrupt("return",Promise.reject(u));case 11:i.setState((function(e){return{modal:(0,s.Z)((0,s.Z)({},e.modal),{},{open:!0,values:h.map((function(e){var t=e.distance,r=e.magnitude,n=e.region,a=e.event,s=e.timestamp,o=e.depth,c=e.estimation,l=(0,i.props.t)("views.history.modals.choose_event.template",{event:a,time:(0,ie.Z)(s),magnitude:r.toFixed(1),distance:t.toFixed(1),p_wave:c.p.toFixed(1),s_wave:c.s.toFixed(1),depth:-1!==o?o.toFixed(1):"-"});return[n,[s+1e3*c.p,s+1e3*c.s],l]}))})}}));case 12:case"end":return e.stop()}}),e)}))),i.handleChooseEvent=function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var r,a,o,c,l,u,h,d;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Date(Array.isArray(t)?t[0]:t).getTime(),a=new Date(Array.isArray(t)?t[1]:t).getTime(),o=i.props.duration.duration,c=r-(o*=500),l=a+o,u=i.props.t,!((l-c)/1e3>3600)){e.next=13;break}return h=u("views.history.toasts.duration_excceed"),V.ZP.error(h),e.abrupt("return",Promise.reject(h));case 13:d=u("views.history.toasts.event_select_success",{p_wave:(0,ie.Z)(r),s_wave:(0,ie.Z)(a)}),V.ZP.success(d,{duration:6e4});case 15:return e.next=17,i.promisedSetState({history:{start:c,end:l,format:"json"},modal:(0,s.Z)((0,s.Z)({},i.state.modal),{},{open:!1})});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.handleSelect=(0,Ne.Z)(function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t,r){var a,o;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.props.t,o={from:"history",dialog:(0,s.Z)((0,s.Z)({},i.state.select.dialog),{},{open:!1})},e.t0=t,e.next="history"===e.t0?5:"trace"===e.t0?10:15;break;case 5:return e.next=7,i.promisedSetState({select:o,history:(0,s.Z)((0,s.Z)({},i.state.history),{},{channel:r,format:"sac"})});case 7:return e.next=9,V.ZP.promise(i.handleQueryHistory(),{loading:a("views.history.toasts.is_exporting_sac"),success:a("views.history.toasts.export_sac_success"),error:a("views.history.toasts.export_sac_error")});case 9:case 14:return e.abrupt("break",15);case 10:return e.next=12,i.promisedSetState({select:o,trace:(0,s.Z)((0,s.Z)({},i.state.trace),{},{source:r})});case 12:return e.next=14,V.ZP.promise(i.handleQueryEvents(),{loading:a("views.history.toasts.is_fetching_events"),success:a("views.history.toasts.fetch_events_success"),error:a("views.history.toasts.fetch_events_error")});case 15:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),200),i.handleQueryWaveform=(0,Ne.Z)((0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,o,c,l,u,h;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.promisedSetState({history:(0,s.Z)((0,s.Z)({},i.state.history),{},{format:"json"})});case 2:return t=i.props.t,e.next=5,V.ZP.promise(i.handleQueryHistory(),{loading:t("views.history.toasts.is_fetching_waveform"),success:t("views.history.toasts.fetch_waveform_success"),error:t("views.history.toasts.fetch_waveform_error")});case 5:(r=e.sent)&&(a=i.state,o=a.adc,c=a.geophone,l=a.scale,u=Ze(i.state.labels,r,o,c,l),h=ke(i.state.areas,r),i.setState({areas:h,labels:u}));case 7:case"end":return e.stop()}}),e)})))),i.handleQuerySACFile=(0,a.Z)((0,n.Z)().mark((function e(){return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i.setState((function(e){return{select:(0,s.Z)((0,s.Z)({},e.select),{},{from:"history",dialog:{open:!0,values:[["Vertical","EHZ"],["East-West","EHE"],["North-South","EHN"]],title:{id:"views.history.selects.choose_channel.title"}}})}}));case 1:case"end":return e.stop()}}),e)}))),i.handleQuerySource=(0,Ne.Z)((0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,o,c,l,u,h,d,p;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.props.t,r={source:"show"},a=i.state.tokens,o=Se.Z.CancelToken.source,c=o(),a.push(c),l=V.ZP.loading(t("views.history.toasts.is_fetching_source")),e.next=9,(0,O.Z)({cancelToken:c,body:r,tag:"trace"});case 9:if(u=e.sent,h=u.data,d=u.error,V.ZP.remove(l),!d&&h){e.next=19;break}return p=t("views.history.toasts.fetch_source_error"),V.ZP.error(p),e.abrupt("return",Promise.reject(p));case 19:V.ZP.success(t("views.history.toasts.fetch_source_success"));case 20:i.setState((function(e){return{select:{from:"trace",dialog:(0,s.Z)((0,s.Z)({},e.select.dialog),{},{open:!0,values:h.map((function(e){return[e.name,e.value]})),title:{id:"views.history.selects.choose_source.title"}})}}}));case 21:case"end":return e.stop()}}),e)})))),i.handleGetShareLink=(0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,s,o,c,l,u,h,d,p;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,Ce.Z)(),r=i.props.t,a=window.location,s=a.hash,o=a.origin,c=i.state.history,l=c.start,u=c.end,h="".concat(o).concat(s.length&&"/#").concat(t),d="".concat(h,"?start=").concat(l,"&end=").concat(u),!(p=navigator.clipboard||{writeText:function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}})){e.next=13;break}return e.next=10,p.writeText(d);case 10:V.ZP.success(r("views.history.toasts.copy_link_success")),e.next=14;break;case 13:V.ZP.error(r("views.history.toasts.copy_link_error"));case 14:case"end":return e.stop()}}),e)}))),i.state={tokens:[],trace:{source:"show"},history:{start:0,end:0,format:"json",channel:"EHZ"},areas:[{tag:"ehz",area:{label:{id:"views.history.areas.ehz.label"}},chart:{backgroundColor:"#d97706",lineWidth:1,height:300,series:{name:"EHZ",type:"line",color:"#f1f5f9",data:[]}}},{tag:"ehe",area:{label:{id:"views.history.areas.ehe.label"}},chart:{backgroundColor:"#10b981",lineWidth:1,height:300,series:{name:"EHE",type:"line",color:"#f1f5f9",data:[]}}},{tag:"ehn",area:{label:{id:"views.history.areas.ehn.label"}},chart:{backgroundColor:"#0ea5e9",lineWidth:1,height:300,series:{name:"EHN",type:"line",color:"#f1f5f9",data:[]}}}],select:{from:"history",dialog:{open:!1,title:{id:"views.history.selects.choose_channel.title"},values:[["Vertical","EHZ"],["East-West","EHE"],["North-South","EHN"]]}},modal:{open:!1,values:[],title:{id:"views.history.modals.choose_event.title"}},geophone:{ehz:1,ehe:1,ehn:1},adc:{fullscale:1,resolution:1},labels:[{tag:"ehz-pga",label:{id:"views.history.labels.ehz_pga.label"},unit:{id:"views.history.labels.ehz_pga.unit"},value:"0"},{tag:"ehz-intensity",label:{id:"views.history.labels.ehz_intensity.label"},unit:{id:"views.history.labels.ehz_intensity.unit"},value:"-"},{tag:"ehe-pga",label:{id:"views.history.labels.ehe_pga.label"},unit:{id:"views.history.labels.ehe_pga.unit"},value:"0"},{tag:"ehe-intensity",label:{id:"views.history.labels.ehe_intensity.label"},unit:{id:"views.history.labels.ehe_intensity.unit"},value:"-"},{tag:"ehn-pga",label:{id:"views.history.labels.ehn_pga.label"},unit:{id:"views.history.labels.ehn_pga.unit"},value:"0"},{tag:"ehn-intensity",label:{id:"views.history.labels.ehn_intensity.label"},unit:{id:"views.history.labels.ehn_intensity.unit"},value:"-"}],scale:me.m.property()},i}return(0,i.Z)(r,[{key:"componentDidMount",value:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(){var t,r,a,o,i,c,l,u,h,d,p,f,v,m,Z,y,g,x,b,w,k;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.props.adc.adc,a=r.resolution,o=this.props.geophone.geophone,c=(i=o).ehz,l=i.ehe,u=i.ehn,h=this.props.scale.scale,-1!==a&&c*l*u!==0){e.next=20;break}return e.next=8,(0,O.Z)({tag:"station"});case 8:if(!(d=e.sent).data){e.next=17;break}o=R(d),r=Y(d),p=this.props,f=p.updateADC,(v=p.updateGeophone)&&v(o),f&&f(r),e.next=20;break;case 17:return m=this.props.t,V.ZP.error(m("views.history.toasts.metadata_error")),e.abrupt("return");case 20:Z=this.props.duration.duration,y=_e(),g=y.start,x=y.end,b=(0,s.Z)((0,s.Z)({},this.state.history),{},{start:g?Number(g):Date.now()-1e3*Z,end:x?Number(x):Date.now()}),w=me.Z.app_settings.scales,k=(null===(t=w.find((function(e){return e.property().value===h})))||void 0===t?void 0:t.property())||me.m.property(),this.setState({history:b,adc:r,geophone:o,scale:k});case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.state.tokens.forEach((function(e){return e.cancel()}))}},{key:"render",value:function(){var e=this,t=this.state,r=t.areas,n=t.select,a=t.modal,o=t.history,i=t.labels,c=n.from,l=n.dialog,u=o.start,y=o.end;return(0,A.jsxs)(v.Z,{children:[(0,A.jsx)(h.Z,{}),(0,A.jsx)(d.Z,{}),(0,A.jsxs)(f.Z,{children:[(0,A.jsx)(p.Z,{}),(0,A.jsxs)(q.Z,{className:"mb-6",layout:"grid",children:[(0,A.jsxs)(L.Z,{className:"h-[360px]",label:{id:"views.history.cards.query_history"},children:[(0,A.jsx)(Q,{value:u,label:{id:"views.history.time_pickers.start_time"},onChange:function(t){return e.handleTimeChange("start",t)}}),(0,A.jsx)(Q,{value:y,label:{id:"views.history.time_pickers.end_time"},onChange:function(t){return e.handleTimeChange("end",t)}}),(0,A.jsx)(U.Z,{className:"bg-indigo-700 hover:bg-indigo-800",onClick:this.handleQueryWaveform,label:{id:"views.history.buttons.query_waveform"}}),(0,A.jsx)(U.Z,{className:"bg-green-700 hover:bg-green-800",onClick:this.handleQuerySACFile,label:{id:"views.history.buttons.query_sac_file"}}),(0,A.jsx)(U.Z,{className:"bg-yellow-700 hover:bg-yellow-800",onClick:this.handleQuerySource,label:{id:"views.history.buttons.query_source"}}),(0,A.jsx)(U.Z,{className:"bg-cyan-700 hover:bg-cyan-800",onClick:this.handleGetShareLink,label:{id:"views.history.buttons.get_share_link"}})]}),(0,A.jsx)(L.Z,{label:{id:"views.history.cards.analyse_history"},children:(0,A.jsx)(q.Z,{layout:"grid",children:i.map((function(e,t){return(0,A.jsx)(ce.Z,(0,s.Z)({},e),t)}))})})]}),r.map((function(e,t){var r=e.area,n=e.chart;return(0,A.jsx)(we.Z,(0,s.Z)((0,s.Z)({},r),{},{children:(0,A.jsx)(I.Z,(0,s.Z)((0,s.Z)({},n),{},{tooltip:!0,zooming:!0,animation:!1,tickPrecision:1,tickInterval:10}))}),t)}))]}),(0,A.jsx)(m.Z,{}),(0,A.jsx)(Z.Z,{}),(0,A.jsx)(G.Z,(0,s.Z)((0,s.Z)({},l),{},{onSelect:function(t){return e.handleSelect(c,t)}})),(0,A.jsx)(oe,(0,s.Z)((0,s.Z)({},a),{},{onSelect:this.handleChooseEvent,onClose:function(){return e.setState({modal:(0,s.Z)((0,s.Z)({},a),{},{open:!1})})}})),(0,A.jsx)(V.x7,{position:"top-center"})]})}}]),r}(u.Component),Pe=(0,xe.$j)(be.Z,{updateGeophone:ge.V,updateADC:ye.V})((0,H.Zh)()(Me))}}]); \ No newline at end of file diff --git a/frontend/dist/static/js/730.31759149.chunk.js b/frontend/dist/static/js/730.31759149.chunk.js new file mode 100644 index 00000000..3021be0d --- /dev/null +++ b/frontend/dist/static/js/730.31759149.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkobserver=self.webpackChunkobserver||[]).push([[730],{5608:function(t,e,n){var r=n(5671),o=n(3144),a=n(136),i=n(9388),s=n(7313),l=n(5590),c=n(6417),d=function(t){(0,a.Z)(n,t);var e=(0,i.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.t,n=t.children,r=t.label,o=t.text;return(0,c.jsxs)("div",{className:"mb-4 flex flex-col rounded-xl text-gray-700 shadow-lg",children:[(0,c.jsx)("div",{className:"mx-4 rounded-lg overflow-hidden shadow-lg",children:n}),(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("h6",{className:"text-md font-bold text-gray-800",children:e(r.id,r.format)}),o&&(0,c.jsx)("span",{className:"text-md",children:e(o.id,o.format).split("\n").map((function(t,e){return(0,c.jsxs)("p",{children:[t,(0,c.jsx)("br",{})]},e)}))})]})]})}}]),n}(s.Component);e.Z=(0,l.Zh)()(d)},318:function(t,e,n){n.d(e,{Z:function(){return h}});var r=n(5671),o=n(3144),a=n(136),i=n(9388),s=n(7313);var l=n.p+"static/media/rss-solid.167813b1d681372ed1d98e45b6b6c0f7.svg";var c=n.p+"static/media/link-solid.49819f951200a220d9839699fbccd8de.svg";var d=n.p+"static/media/link-slash-solid.7893b9a51ad07ceedeb88c9649c58439.svg",u=n(5590),p=n(6417),f=function(t){(0,a.Z)(n,t);var e=(0,i.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.t,n=t.type,r=t.label,o=t.text,a="";switch(n){case"success":a="from-green-400 to-blue-500";break;case"warning":a="from-orange-400 to-orange-600";break;case"error":a="from-red-400 to-red-600"}return(0,p.jsx)("div",{className:"my-2 shadow-xl p-6 text-sm text-white rounded-lg bg-gradient-to-r ".concat(a),children:(0,p.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,p.jsxs)("div",{className:"flex gap-2 font-bold text-lg",children:[(0,p.jsx)("img",{className:"success"===n?"w-6 h-6":"hidden",src:l,alt:""}),(0,p.jsx)("img",{className:"warning"===n?"w-6 h-6":"hidden",src:c,alt:""}),(0,p.jsx)("img",{className:"error"===n?"w-6 h-6":"hidden",src:d,alt:""}),(0,p.jsx)("span",{children:e(r.id,r.format)})]}),(0,p.jsx)("span",{className:"pl-3 text-md font-medium",children:e(o.id,o.format).split("\n").map((function(t,e){return(0,p.jsxs)("p",{children:[t,(0,p.jsx)("br",{})]},e)}))})]})})}}]),n}(s.Component),h=(0,u.Zh)()(f)},3676:function(t,e,n){var r=n(1413),o=n(5671),a=n(3144),i=n(136),s=n(9388),l=n(7313),c=n(5845),d=n(7548),u=n(1259),p=n.n(u),f=n(5590),h=n(6417);p()(c);var m=function(t){(0,i.Z)(n,t);var e=(0,s.Z)(n);function n(t){var r;(0,o.Z)(this,n);var a=(r=e.call(this,t)).props,i=a.height,s=a.legend,l=a.tooltip,c=a.zooming,d=a.animation,u=a.lineWidth,p=a.tickInterval,f=a.tickPrecision,h=a.lineColor,m=a.backgroundColor;return r.state={accessibility:{enabled:!1},boost:{enabled:!0,seriesThreshold:5},chart:{zooming:c?{type:"x"}:{},marginTop:20,height:i,animation:d,backgroundColor:m},legend:{enabled:s,itemStyle:{color:"#fff"}},plotOptions:{series:{states:{hover:{enabled:!1}},lineWidth:u}},xAxis:{labels:{style:{color:"#fff"},format:"{value:%H:%M:%S}"},type:"datetime",tickColor:"#fff",lineColor:h},yAxis:{labels:{style:{color:"#fff"},format:f?"{value:".concat(f,"f}"):"{value:0.2f}"},title:{text:""},opposite:!0,lineColor:h,tickInterval:p},tooltip:{enabled:l,followPointer:!0,followTouchMove:!0,xDateFormat:"%Y-%m-%d %H:%M:%S",padding:12},credits:{enabled:!1},time:{useUTC:!1},title:{text:""}},r}return(0,a.Z)(n,[{key:"componentDidUpdate",value:function(){var t=this.props.t;c.setOptions({lang:{resetZoom:t("components.chart.reset_zoom"),resetZoomTitle:t("components.chart.reset_zoom_title")}})}},{key:"render",value:function(){var t=this.props.series,e=this.state;if(t.data)t.data.sort((function(t,e){return t[0]-e[0]}));else if(t.length)for(var n=0,o=t;nn&&t.splice(0,t.length-n),(0,r.Z)(t)}},2468:function(t,e,n){var r=n(4165),o=n(5861),a=n(6573),i=n(2968),s=n(1677),l=n(1061),c=n(281),d=n(8585),u=n.n(d),p=n(5827),f=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(e){var n,o,d,f,h,m,v,g,x,b,Z,w,y,k,j,C,N,T,S,D,P,_,z,A,I,M,O;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.tag,d=e.header,f=e.body,h=e.blob,m=e.filename,v=e.onUpload,g=e.onDownload,x=e.cancelToken,b=e.timeout,Z=void 0===b?p.Z.app_settings.timeout:b,(w=a.Z.create({timeout:1e3*Z})).interceptors.request.use((function(t){return h||(t.headers.Accept="application/json"),t})),w.interceptors.response.use((function(t){return t}),(function(t){return Promise.reject(t)})),y=(0,c.Z)(o),k=null===(n=s.Z.find((function(t){return t.tag===o})))||void 0===n?void 0:n.method,t.prev=6,"ws"!==(null===(j=s.Z.find((function(t){return t.tag===o})))||void 0===j?void 0:j.type)){t.next=10;break}throw new Error("websocket protocol is not supported");case 10:return C="".concat(window.location.protocol).concat((0,l.Z)()),t.next=13,w.request({data:f,method:k,headers:d,url:"".concat(C).concat(y),onUploadProgress:v,onDownloadProgress:g,cancelToken:null===x||void 0===x?void 0:x.token,responseType:h?"blob":"json"});case 13:if(N=t.sent,T=N.data,S=N.headers,!h){t.next=21;break}return(D=S["content-disposition"])?(_=null===(P=D.split(";").find((function(t){return t.includes("filename=")})))||void 0===P?void 0:P.split("=")[1])?u()(T,_):u()(T,"stream"):m?u()(T,m):u()(T,"stream"),z=(new Date).toISOString(),t.abrupt("return",{time:z,path:y,data:null,error:!1,status:200,message:"Returned data is a blob"});case 21:return t.abrupt("return",T);case 24:return t.prev=24,t.t0=t.catch(6),A=(new Date).toISOString(),I=t.t0,M=I.message,O=I.status,t.abrupt("return",{time:A,message:M,path:y,data:null,error:!(0,i.Mw)(t.t0),status:O||500});case 29:case"end":return t.stop()}}),t,null,[[6,24]])})));return function(e){return t.apply(this,arguments)}}();e.Z=f},7912:function(t,e,n){var r=n(9439);e.Z=function(t,e,n){for(var o,a=t,i=e.split(">"),s=function(){var e=i[l];try{if(e.includes("[")||e.includes("]")){var n,o,s=(null===(n=e.match(/^(.*?)\[/))||void 0===n?void 0:n[1])||"",c=(null===(o=e.match(/\[(.*?)\]/))||void 0===o?void 0:o[1])||":";if(!c.length)throw new Error("invalid path given");var d=c.split(":"),u=(0,r.Z)(d,2),p=u[0],f=u[1];a=s.length?a[s].find((function(t){return t[p]===f})):a.find((function(t){return t[p]===f}))}else a=a[e]}catch(h){return{v:t}}},l=0;ln&&t.splice(0,t.length-n),(0,r.Z)(t)}},2468:function(t,e,n){var r=n(4165),o=n(5861),a=n(6573),i=n(2968),s=n(1677),l=n(1061),c=n(281),u=n(8585),d=n.n(u),p=n(5827),f=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(e){var n,o,u,f,h,m,v,g,b,x,Z,y,w,k,j,C,N,T,S,D,P,_,z,A,I,M,O;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.tag,u=e.header,f=e.body,h=e.blob,m=e.filename,v=e.onUpload,g=e.onDownload,b=e.cancelToken,x=e.timeout,Z=void 0===x?p.Z.app_settings.timeout:x,(y=a.Z.create({timeout:1e3*Z})).interceptors.request.use((function(t){return h||(t.headers.Accept="application/json"),t})),y.interceptors.response.use((function(t){return t}),(function(t){return Promise.reject(t)})),w=(0,c.Z)(o),k=null===(n=s.Z.find((function(t){return t.tag===o})))||void 0===n?void 0:n.method,t.prev=6,"ws"!==(null===(j=s.Z.find((function(t){return t.tag===o})))||void 0===j?void 0:j.type)){t.next=10;break}throw new Error("websocket protocol is not supported");case 10:return C="".concat(window.location.protocol).concat((0,l.Z)()),t.next=13,y.request({data:f,method:k,headers:u,url:"".concat(C).concat(w),onUploadProgress:v,onDownloadProgress:g,cancelToken:null===b||void 0===b?void 0:b.token,responseType:h?"blob":"json"});case 13:if(N=t.sent,T=N.data,S=N.headers,!h){t.next=21;break}return(D=S["content-disposition"])?(_=null===(P=D.split(";").find((function(t){return t.includes("filename=")})))||void 0===P?void 0:P.split("=")[1])?d()(T,_):d()(T,"stream"):m?d()(T,m):d()(T,"stream"),z=(new Date).toISOString(),t.abrupt("return",{time:z,path:w,data:null,error:!1,status:200,message:"Returned data is a blob"});case 21:return t.abrupt("return",T);case 24:return t.prev=24,t.t0=t.catch(6),A=(new Date).toISOString(),I=t.t0,M=I.message,O=I.status,t.abrupt("return",{time:A,message:M,path:w,data:null,error:!(0,i.Mw)(t.t0),status:O||500});case 29:case"end":return t.stop()}}),t,null,[[6,24]])})));return function(e){return t.apply(this,arguments)}}();e.Z=f},7912:function(t,e,n){var r=n(9439);e.Z=function(t,e,n){for(var o,a=t,i=e.split(">"),s=function(){var e=i[l];try{if(e.includes("[")||e.includes("]")){var n,o,s=(null===(n=e.match(/^(.*?)\[/))||void 0===n?void 0:n[1])||"",c=(null===(o=e.match(/\[(.*?)\]/))||void 0===o?void 0:o[1])||":";if(!c.length)throw new Error("invalid path given");var u=c.split(":"),d=(0,r.Z)(u,2),p=d[0],f=d[1];a=s.length?a[s].find((function(t){return t[p]===f})):a.find((function(t){return t[p]===f}))}else a=a[e]}catch(h){return{v:t}}},l=0;lchart>series>data"),C);var j=m.reduce((function(e,t){var n=Math.abs(e),a=Math.abs(t);return Math.max(n,a)}),0),z=x.reduce((function(e,t){var n=Math.abs(e),a=Math.abs(t);return Math.max(n,a)}),0),D=H.Z.app_settings.scales.find((function(e){return e.property().value===s.value})),M=null===D||void 0===D?void 0:D.intensity(j,z);(0,_.Z)(e,"[tag:".concat(p,"]>area>text"),{id:"views.realtime.areas.".concat(p,".text"),format:{pga:z.toFixed(5),pgv:j.toFixed(5),intensity:"".concat(s.value," ").concat(M)}})},l=0,u=["ehz","ehe","ehn"];lchart>series>data"),C);var j=m.reduce((function(e,t){var n=Math.abs(e),a=Math.abs(t);return Math.max(n,a)}),0),z=x.reduce((function(e,t){var n=Math.abs(e),a=Math.abs(t);return Math.max(n,a)}),0),D=P.Z.app_settings.scales.find((function(e){return e.property().value===s.value})),M=null===D||void 0===D?void 0:D.intensity(j,z);(0,F.Z)(e,"[tag:".concat(p,"]>area>text"),{id:"views.realtime.areas.".concat(p,".text"),format:{pga:z.toFixed(5),pgv:j.toFixed(5),intensity:"".concat(s.value," ").concat(M)}})},l=0,u=["ehz","ehe","ehn"];l=432&&e>116?"10 \u5ea6":t>=432?"11 \u5ea6":"12 \u5ea6"}}]),e}(),c=function(){function e(){(0,o.Z)(this,e)}return(0,a.Z)(e,[{key:"property",value:function(){return{name:"\u4e2d\u56fd\u5730\u9707\u5730\u9707\u9707\u5ea6",value:"CSIS"}}},{key:"intensity",value:function(e,t){var n=3.17*Math.log10(t)+6.59,r=3*Math.log10(e)+9.77,o=1;return(o=n>=6&&r>=6?r:(n+r)/2)<1?o=1:o>12&&(o=12),"".concat(o.toFixed(1)," \u7ea7")}}]),e}(),s=function(){return"064af51d-20231021132725"},f=function(){return"v2.1.20p"}(),d=s(),p=(0,r.Z)(),h=[new i,new u,new l,new c],v={app_settings:{version:f,release:d,scales:h,timeout:100,retention:180,duration:300,router:"hash",name:"config.global.name",author:"config.global.author",title:"config.global.title",description:"config.global.description"},api_settings:{backend:p,version:"v1",prefix:"/api",types:["http","ws"]}},y=h[0]},7902:function(e,t,n){var r=n(7313),o=n(6417),a=(0,r.lazy)((function(){return Promise.all([n.e(377),n.e(453),n.e(596),n.e(822),n.e(912),n.e(730),n.e(278)]).then(n.bind(n,8244))})),i=(0,r.lazy)((function(){return Promise.all([n.e(377),n.e(453),n.e(59),n.e(596),n.e(912),n.e(730),n.e(967)]).then(n.bind(n,967))})),u=(0,r.lazy)((function(){return Promise.all([n.e(377),n.e(453),n.e(59),n.e(596),n.e(366),n.e(165),n.e(979),n.e(912),n.e(555)]).then(n.bind(n,6555))})),l=(0,r.lazy)((function(){return Promise.all([n.e(377),n.e(453),n.e(59),n.e(366),n.e(912),n.e(756)]).then(n.bind(n,756))})),c=(0,r.lazy)((function(){return Promise.all([n.e(377),n.e(59),n.e(366),n.e(165),n.e(912),n.e(886)]).then(n.bind(n,8886))})),s=[{uri:"/",title:"config.router.index",node:(0,o.jsx)(a,{})},{uri:"/realtime",title:"config.router.realtime",node:(0,o.jsx)(i,{})},{uri:"/history",title:"config.router.history",node:(0,o.jsx)(u,{})},{uri:"/export",title:"config.router.export",node:(0,o.jsx)(l,{})},{uri:"/setting",title:"config.router.setting",node:(0,o.jsx)(c,{})}];t.Z=s},1061:function(e,t){t.Z=function(){return"//".concat(window.location.host)}},7703:function(e,t,n){n.d(t,{V:function(){return a}});var r=(0,n(827).oM)({name:"adc",initialState:{adc:{fullscale:0,resolution:-1}},reducers:{onUpdate:function(e,t){var n=t.payload;e.adc=n}}}),o=r.actions.onUpdate,a=function(e){return function(t){t(o(e))}};t.Z=r.reducer},5549:function(e,t,n){n.d(t,{V:function(){return u}});var r=n(827),o=n(5827).Z.app_settings.duration,a=(0,r.oM)({name:"duration",initialState:{duration:o},reducers:{onUpdate:function(e,t){var n=t.payload;e.duration=n>0&&n<=3600?n:o}}}),i=a.actions.onUpdate,u=function(e){return function(t){t(i(e))}};t.Z=a.reducer},8146:function(e,t,n){n.d(t,{V:function(){return a}});var r=(0,n(827).oM)({name:"geophone",initialState:{geophone:{ehz:0,ehe:0,ehn:0}},reducers:{onUpdate:function(e,t){var n=t.payload;e.geophone=n}}}),o=r.actions.onUpdate,a=function(e){return function(t){t(o(e))}};t.Z=r.reducer},5467:function(e,t,n){n.d(t,{V:function(){return u}});var r=n(827),o=n(5827).Z.app_settings.retention,a=(0,r.oM)({name:"retention",initialState:{retention:o},reducers:{onUpdate:function(e,t){var n=t.payload;e.retention=n>0&&n<=1e3?n:o}}}),i=a.actions.onUpdate,u=function(e){return function(t){t(i(e))}};t.Z=a.reducer},1236:function(e,t,n){n.d(t,{V:function(){return u}});var r=n(827),o=n(5827).m.property().value,a=(0,r.oM)({name:"scale",initialState:{scale:o},reducers:{onUpdate:function(e,t){var n=t.payload;e.scale=n}}}),i=a.actions.onUpdate,u=function(e){return function(t){t(i(e))}};t.Z=a.reducer},5296:function(e,t,n){n.d(t,{Z:function(){return oe}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?s(w,--g):0,y--,10===b&&(y=1,v--),b}function E(){return b=g2||O(b)>3?"":" "}function z(e,t){for(;--t&&E()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return C(e,P()+(t<6&&32==_()&&32==E()))}function M(e){for(;E();)switch(b){case e:return g;case 34:case 39:34!==e&&39!==e&&M(b);break;case 40:41===e&&M(e);break;case 92:E()}return g}function L(e,t){for(;E()&&e+b!==57&&(e+b!==84||47!==_()););return"/*"+C(t,g-1)+"*"+a(47===e?e:E())}function I(e){for(;!O(_());)E();return C(e,g)}var D="-ms-",A="-moz-",F="-webkit-",U="comm",$="rule",Z="decl",W="@keyframes";function B(e,t){for(var n="",r=p(e),o=0;o0&&d(A)-m&&h(b>32?J(A+";",r,n,m-1):J(l(A," ","")+";",r,n,m-2),p);break;case 59:A+=";";default:if(h(D=Q(A,t,n,v,y,o,f,j,N=[],M=[],m),i),123===O)if(0===y)q(A,t,D,D,N,i,m,f,M);else switch(99===g&&110===s(A,3)?100:g){case 100:case 108:case 109:case 115:q(e,D,D,r&&h(Q(e,D,D,0,0,o,f,j,o,N=[],m),M),o,M,m,f,r?N:M);break;default:q(A,D,D,D,[""],M,0,f,M)}}v=y=b=0,S=C=1,j=A="",m=u;break;case 58:m=1+d(A),b=w;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==x())continue;switch(A+=a(O),O*S){case 38:C=y>0?1:(A+="\f",-1);break;case 44:f[v++]=(d(A)-1)*C,C=1;break;case 64:45===_()&&(A+=T(E())),g=_(),y=m=d(j=A+=I(P())),O++;break;case 45:45===w&&2==d(A)&&(S=0)}}return i}function Q(e,t,n,r,a,i,c,s,d,h,v){for(var y=a-1,m=0===a?i:[""],g=p(m),b=0,w=0,k=0;b0?m[x]+" "+E:l(E,/&\f/g,m[x])))&&(d[k++]=_);return S(e,t,n,0===a?$:s,d,h,v)}function K(e,t,n){return S(e,t,n,U,a(b),f(e,2,-2),0)}function J(e,t,n,r){return S(e,t,n,Z,f(e,0,r),f(e,r+1,-1),r)}var X=function(e,t,n){for(var r=0,o=0;r=o,o=_(),38===r&&12===o&&(t[n]=1),!O(o);)E();return C(e,g)},Y=function(e,t){return N(function(e,t){var n=-1,r=44;do{switch(O(r)){case 0:38===r&&12===_()&&(t[n]=1),e[n]+=X(g-1,t,n);break;case 2:e[n]+=T(r);break;case 4:if(44===r){e[++n]=58===_()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=a(r)}}while(r=E());return e}(j(e),t))},G=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||G.get(n))&&!r){G.set(e,!0);for(var o=[],a=Y(t,o),i=n.props,u=0,l=0;u6)switch(s(e,t+1)){case 109:if(45!==s(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+A+(108==s(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?ne(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==s(e,t+1))break;case 6444:switch(s(e,d(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+F)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+F+(45===s(e,14)?"inline-":"")+"box$3$1"+F+"$2$3$1"+D+"$2box$3")+e}break;case 5936:switch(s(e,t+11)){case 114:return F+e+D+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+D+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+D+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+D+e+e}return e}var re=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Z:e.return=ne(e.value,e.length);break;case W:return B([k(e,{value:l(e.value,"@","@"+F)})],r);case $:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return B([k(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return B([k(e,{props:[l(t,/:(plac\w+)/,":"+F+"input-$1")]}),k(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),k(e,{props:[l(t,/:(plac\w+)/,D+"input-$1")]})],r)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||re;var a,i,u={},l=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:d}}},5696:function(e,t,n){var r;n.d(t,{L:function(){return i},j:function(){return u}});var o=n(7313),a=!!(r||(r=n.t(o,2))).useInsertionEffect&&(r||(r=n.t(o,2))).useInsertionEffect,i=a||function(e){return e()},u=a||o.useLayoutEffect},827:function(e,t,n){function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:d(e)?2:p(e)?3:0}function l(e,t){return 2===u(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===u(e)?e.get(t):e[t]}function s(e,t,n){var r=u(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return Z&&e instanceof Map}function p(e){return W&&e instanceof Set}function h(e){return e.o||e.t}function v(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=J(e);delete t[q];for(var n=K(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=m),Object.freeze(e),t&&i(e,(function(e,t){return y(t,!0)}),!0)),e}function m(){r(2)}function g(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(e){var t=X[e];return t||r(18,e),t}function w(e,t){X[e]||(X[e]=t)}function S(){return U}function k(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function x(e){E(e),e.p.forEach(P),e.p=null}function E(e){e===U&&(U=e.l)}function _(e){return U={p:[],l:U,h:e,m:!0,_:0}}function P(e){var t=e[q];0===t.i||1===t.i?t.j():t.g=!0}function C(e,t){t._=t.p.length;var n=t.p[0],o=void 0!==e&&e!==n;return t.h.O||b("ES5").S(t,e,o),o?(n[q].P&&(x(t),r(4)),a(e)&&(e=O(t,e),t.l||N(t,e)),t.u&&b("Patches").M(n[q].t,e,t.u,t.s)):e=O(t,n,[]),x(t),t.u&&t.v(t.u,t.s),e!==V?e:void 0}function O(e,t,n){if(g(t))return t;var r=t[q];if(!r)return i(t,(function(o,a){return j(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return N(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=v(r.k):r.o,a=o,u=!1;3===r.i&&(a=new Set(o),o.clear(),u=!0),i(a,(function(t,a){return j(e,r,o,t,a,n,u)})),N(e,o,!1),n&&e.u&&b("Patches").N(r,n,e.u,e.s)}return r.o}function j(e,t,n,r,i,u,c){if(o(i)){var f=O(e,i,u&&t&&3!==t.i&&!l(t.R,r)?u.concat(r):void 0);if(s(n,r,f),!o(f))return;e.m=!1}else c&&n.add(i);if(a(i)&&!g(i)){if(!e.h.D&&e._<1)return;O(e,i),t&&t.A.l||N(e,i)}}function N(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&y(t,n)}function T(e,t){var n=e[q];return(n?h(n):e)[t]}function R(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function z(e){e.P||(e.P=!0,e.l&&z(e.l))}function M(e){e.o||(e.o=v(e.t))}function L(e,t,n){var r=d(t)?b("MapSet").F(t,n):p(t)?b("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:S(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=Y;n&&(o=[r],a=G);var i=Proxy.revocable(o,a),u=i.revoke,l=i.proxy;return r.k=l,r.j=u,l}(t,n):b("ES5").J(t,n);return(n?n.A:S()).p.push(r),r}function I(e){return o(e)||r(22,e),function e(t){if(!a(t))return t;var n,r=t[q],o=u(t);if(r){if(!r.P&&(r.i<4||!b("ES5").K(r)))return r.t;r.I=!0,n=D(t,o),r.I=!1}else n=D(t,o);return i(n,(function(t,o){r&&c(r.t,t)===o||s(n,t,e(o))})),3===o?new Set(n):n}(e)}function D(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return v(e)}function A(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[q];return Y.get(t,e)},set:function(t){var n=this[q];Y.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][q];if(!o.P)switch(o.i){case 5:r(o)&&z(o);break;case 4:n(o)&&z(o)}}}function n(e){for(var t=e.t,n=e.k,r=K(n),o=r.length-1;o>=0;o--){var a=r[o];if(a!==q){var i=t[a];if(void 0===i&&!l(t,a))return!0;var u=n[a],c=u&&u[q];if(c?c.t!==i:!f(u,i))return!0}}var s=!!t[q];return r.length!==K(t).length+(s?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r1?r-1:0),a=1;a1?r-1:0),a=1;a=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var a=b("Patches").$;return o(e)?a(e,t):this.produce(e,(function(e){return a(e,t)}))},e}(),te=new ee,ne=te.produce,re=(te.produceWithPatches.bind(te),te.setAutoFreeze.bind(te),te.setUseProxies.bind(te),te.applyPatches.bind(te),te.createDraft.bind(te),te.finishDraft.bind(te),ne),oe=n(9038);function ae(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var ie=ae();ie.withExtraArgument=ae;var ue=ie,le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function O(e,t,n,r){void 0===r&&(r={});var o=r,a=o.window,i=void 0===a?document.defaultView:a,u=o.v5Compat,l=void 0!==u&&u,c=i.history,s=d.Pop,f=null,p=h();function h(){return(c.state||{idx:null}).idx}function v(){s=d.Pop;var e=h(),t=null==e?null:e-p;p=e,f&&f({action:s,location:g.location,delta:t})}function y(e){var t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:P(e);return k(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==p&&(p=0,c.replaceState(m({},c.state,{idx:p}),""));var g={get action(){return s},get location(){return e(i,c)},listen:function(e){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(b,v),f=e,function(){i.removeEventListener(b,v),f=null}},createHref:function(e){return t(i,e)},createURL:y,encodeLocation:function(e){var t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=d.Push;var r=_(g.location,e,t);n&&n(r,e);var o=E(r,p=h()+1),a=g.createHref(r);try{c.pushState(o,"",a)}catch(u){if(u instanceof DOMException&&"DataCloneError"===u.name)throw u;i.location.assign(a)}l&&f&&f({action:s,location:g.location,delta:1})},replace:function(e,t){s=d.Replace;var r=_(g.location,e,t);n&&n(r,e);var o=E(r,p=h()),a=g.createHref(r);c.replaceState(o,"",a),l&&f&&f({action:s,location:g.location,delta:0})},go:function(e){return c.go(e)}};return g}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function j(e,t,n){void 0===n&&(n="/");var r=W(("string"===typeof t?C(t):t).pathname||"/",n);if(null==r)return null;var o=N(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var n=e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(o);for(var a=null,i=0;null==a&&i0&&(k(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),N(e.children,t,l,u)),(null!=e.path||e.index)&&t.push({path:u,score:F(u,e.index),routesMeta:l})};return e.forEach((function(e,t){var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?")){var r,a=(0,v.Z)(T(e.path));try{for(a.s();!(r=a.n()).done;){var i=r.value;o(e,t,i)}}catch(u){a.e(u)}finally{a.f()}}else o(e,t)})),t}function T(e){var t=e.split("/");if(0===t.length)return[];var n=(0,h.Z)(t),r=n[0],o=n.slice(1),a=r.endsWith("?"),i=r.replace(/\?$/,"");if(0===o.length)return a?[i,""]:[i];var u=T(o.join("/")),l=[];return l.push.apply(l,(0,y.Z)(u.map((function(e){return""===e?i:[i,e].join("/")})))),a&&l.push.apply(l,(0,y.Z)(u)),l.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}var R=/^:\w+$/,z=3,M=2,L=1,I=10,D=-2,A=function(e){return"*"===e};function F(e,t){var n=e.split("/"),r=n.length;return n.some(A)&&(r+=D),t&&(r+=M),n.filter((function(e){return!A(e)})).reduce((function(e,t){return e+(R.test(t)?z:""===t?L:I)}),r)}function U(e,t){for(var n=e.routesMeta,r={},o="/",a=[],i=0;i and the router will parse it for you.'}function V(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function H(e,t,n,r){var o;void 0===r&&(r=!1),"string"===typeof e?o=C(e):(k(!(o=m({},e)).pathname||!o.pathname.includes("?"),B("?","pathname","search",o)),k(!o.pathname||!o.pathname.includes("#"),B("#","pathname","hash",o)),k(!o.search||!o.search.includes("#"),B("#","search","hash",o)));var a,i=""===e||""===o.pathname,u=i?"/":o.pathname;if(r||null==u)a=n;else{var l=t.length-1;if(u.startsWith("..")){for(var c=u.split("/");".."===c[0];)c.shift(),l-=1;o.pathname=c.join("/")}a=l>=0?t[l]:"/"}var s=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?C(e):e,r=n.pathname,o=n.search,a=void 0===o?"":o,i=n.hash,u=void 0===i?"":i,l=r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t;return{pathname:l,search:K(a),hash:J(u)}}(o,a),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&n.endsWith("/");return s.pathname.endsWith("/")||!f&&!d||(s.pathname+="/"),s}var q=function(e){return e.join("/").replace(/\/\/+/g,"/")},Q=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},K=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},J=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},X=function(e){(0,a.Z)(n,e);var t=(0,i.Z)(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(f(Error));function Y(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var G=["post","put","patch","delete"],ee=(new Set(G),["get"].concat(G));new Set(ee),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},7861:function(e,t,n){var r=n(9456),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function l(e){return r.isMemo(e)?i:u[e.$$typeof]||o}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=i;var c=Object.defineProperty,s=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=s(n);f&&(i=i.concat(f(n)));for(var u=l(t),v=l(n),y=0;y