robin 0.1.1-java → 0.1.2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +4 -1
- data/lib/robin/client.rb +6 -4
- data/lib/robin/config.rb +20 -0
- data/lib/robin/iterable_job.rb +1 -1
- data/lib/robin/recovery.rb +1 -1
- data/lib/robin/retrier.rb +6 -4
- data/lib/robin/scheduler.rb +1 -1
- data/lib/robin/scripts.rb +1 -1
- data/lib/robin/testing.rb +2 -2
- data/lib/robin/version.rb +1 -1
- data/lib/robin/web/dist/assets/{main-pdtvjejb.js → main-hjmqn8vx.js} +2 -2
- data/lib/robin/web/dist/assets/main-hjmqn8vx.js.gz +0 -0
- data/lib/robin/web/dist/index.html +1 -1
- data/lib/robin_resp/robin_resp.jar +0 -0
- data/sig/robin/config.rbs +13 -0
- metadata +3 -3
- data/lib/robin/web/dist/assets/main-pdtvjejb.js.gz +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa3a985e6dd6abac8e5e7c238ed52c00f5598ba879c05fd439894ebcfc2b134f
|
|
4
|
+
data.tar.gz: 0c6d521d19e6adb2e6b29f13fb48082e51c98700e9c4068f10334e9d51953082
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13088598afc47492edfaa2df08b99b3aed099af04d0f58e09d66bbe36f5cd78e2ca35356125750f2f1af553702a066b81976a262bada665d8bd8515e6d984a3f
|
|
7
|
+
data.tar.gz: d019732d8bb599a676d0fb5b366d9862f9d80cc57791771ec96fdb403077de9897fb971ab8d6bd5972394a864fc65ae94940d728c6dfab2077d7529b0e618f45
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.2] - 2026-11-22
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `config.job_timestamps = :seconds` records a job's times (`created_at`,
|
|
15
|
+
`enqueued_at`, `failed_at` and `retried_at`) in Float epoch seconds,
|
|
16
|
+
for other tools reading the jobs in Redis that expect them.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Job times in Float epoch seconds (written by another tool) show
|
|
21
|
+
correctly on the dashboard, and a job's expiry counts from them
|
|
22
|
+
correctly.
|
|
23
|
+
- A compressed `error_backtrace` whose Base64 is broken into lines (as
|
|
24
|
+
some tools write it) is read, rather than shown as unreadable.
|
|
25
|
+
|
|
10
26
|
## [0.1.1] - 2026-11-22
|
|
11
27
|
|
|
12
28
|
### Added
|
data/README.md
CHANGED
|
@@ -1405,7 +1405,10 @@ process's record at its identity) keep the formats common Ruby job tools
|
|
|
1405
1405
|
share: queues are lists pushed at the head and taken from the tail; the
|
|
1406
1406
|
schedule, retry and dead sets are scored in epoch seconds; jobs are JSON
|
|
1407
1407
|
with `created_at` and `enqueued_at` in epoch milliseconds, a 0-based
|
|
1408
|
-
`retry_count` and a compressed `error_backtrace`.
|
|
1408
|
+
`retry_count` and a compressed `error_backtrace`. Tools that expect a
|
|
1409
|
+
job's times (`created_at`, `enqueued_at`, `failed_at` and `retried_at`)
|
|
1410
|
+
in Float epoch seconds can have them, with `config.job_timestamps =
|
|
1411
|
+
:seconds`. Robin reads either. Robin's own keys
|
|
1409
1412
|
(batches, limiters, metrics, in-flight jobs...) can get a prefix of
|
|
1410
1413
|
their own with `config.internal_key_prefix`, so with `key_prefix = ""` the
|
|
1411
1414
|
job keys sit at the top level, where other tools look for them.
|
data/lib/robin/client.rb
CHANGED
|
@@ -194,13 +194,13 @@ module Robin
|
|
|
194
194
|
item["queue"] = queue.empty? ? "default" : queue
|
|
195
195
|
item["retry"] = true unless item.key?("retry")
|
|
196
196
|
item["jid"] ||= Robin.generate_jid
|
|
197
|
-
item["created_at"] ||= Robin.now_ms
|
|
197
|
+
item["created_at"] ||= @config.job_timestamp(Robin.now_ms)
|
|
198
198
|
at = item.delete("at")
|
|
199
199
|
at_ms = self.class.timestamp_ms(at) if at
|
|
200
200
|
item["at"] = Robin.epoch_seconds(at_ms) if at_ms
|
|
201
201
|
if (expires_in = item.delete("expires_in"))
|
|
202
202
|
# The clock starts when the job is due to run.
|
|
203
|
-
item["expires_at"] = [at_ms, item.fetch("created_at")].compact.max + Integer(expires_in.to_f * 1000)
|
|
203
|
+
item["expires_at"] = [at_ms, Robin.ms_of(item.fetch("created_at"))].compact.max + Integer(expires_in.to_f * 1000)
|
|
204
204
|
end
|
|
205
205
|
if (window = item["retry_for"]) && !(window.is_a?(Numeric) && window.positive?)
|
|
206
206
|
raise ArgumentError, "job 'retry_for' must be a positive number of seconds"
|
|
@@ -240,7 +240,8 @@ module Robin
|
|
|
240
240
|
# counts from then (the template's counted from its creation).
|
|
241
241
|
def schedule(payload, at_ms)
|
|
242
242
|
payload["at"] = Robin.epoch_seconds(at_ms)
|
|
243
|
-
|
|
243
|
+
# (created_at is an Integer or a Float; Steep picks neither of Integer#-'s overloads.)
|
|
244
|
+
payload["expires_at"] += [at_ms - Robin.ms_of(payload.fetch("created_at")), 0].max if payload["expires_at"] # steep:ignore UnresolvedOverloading
|
|
244
245
|
end
|
|
245
246
|
|
|
246
247
|
# Config#push_deferrer may take over delivery (e.g. until a database
|
|
@@ -311,9 +312,10 @@ module Robin
|
|
|
311
312
|
args = group.flat_map { |p| [p.fetch("at"), Robin.dump_json(p.except("at", "enqueued_at"))] }
|
|
312
313
|
pipe.call("ZADD", @config.key("schedule"), *args)
|
|
313
314
|
else
|
|
315
|
+
enqueued_at = @config.job_timestamp(now)
|
|
314
316
|
entries = group.map do |p|
|
|
315
317
|
p.delete("at")
|
|
316
|
-
p["enqueued_at"] =
|
|
318
|
+
p["enqueued_at"] = enqueued_at
|
|
317
319
|
Robin.dump_json(p)
|
|
318
320
|
end
|
|
319
321
|
pipe.call("SADD", @config.key("queues"), queue)
|
data/lib/robin/config.rb
CHANGED
|
@@ -100,6 +100,25 @@ module Robin
|
|
|
100
100
|
:metrics_retention_days, :reliable_push, :shutdown_requeue, :job_wrapper,
|
|
101
101
|
:health_bind
|
|
102
102
|
|
|
103
|
+
# How a job records when it was created, enqueued, failed and retried
|
|
104
|
+
# ("created_at", "enqueued_at", "failed_at" and "retried_at"):
|
|
105
|
+
# :milliseconds (the default), Integer epoch milliseconds, or :seconds,
|
|
106
|
+
# Float epoch seconds, for other programs reading the jobs in Redis that
|
|
107
|
+
# expect those. Robin reads both.
|
|
108
|
+
attr_reader :job_timestamps
|
|
109
|
+
|
|
110
|
+
JOB_TIMESTAMPS = %i[milliseconds seconds].freeze
|
|
111
|
+
|
|
112
|
+
def job_timestamps=(unit)
|
|
113
|
+
raise ArgumentError, "job_timestamps is :milliseconds or :seconds, not #{unit.inspect}" unless JOB_TIMESTAMPS.include?(unit)
|
|
114
|
+
|
|
115
|
+
@job_timestamps = unit
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# The time +ms+ (epoch milliseconds) as a job records it (see
|
|
119
|
+
# #job_timestamps).
|
|
120
|
+
def job_timestamp(ms) = @job_timestamps.equal?(:seconds) ? Robin.epoch_seconds(ms) : ms
|
|
121
|
+
|
|
103
122
|
# How long to wait before running a job again that hit a rate limit:
|
|
104
123
|
# a callable taking (count, error, payload), where count is how many
|
|
105
124
|
# times the job has hit a limit and error the Robin::Limiter::OverLimit,
|
|
@@ -259,6 +278,7 @@ module Robin
|
|
|
259
278
|
@metrics_retention_days = 90
|
|
260
279
|
@reliable_push = false
|
|
261
280
|
@shutdown_requeue = true
|
|
281
|
+
@job_timestamps = :milliseconds
|
|
262
282
|
@gvl_monitoring = true
|
|
263
283
|
@idle_gc = false
|
|
264
284
|
@jit_warmup = JIT_WARMUP
|
data/lib/robin/iterable_job.rb
CHANGED
|
@@ -265,7 +265,7 @@ module Robin
|
|
|
265
265
|
# As stored, so decrypted (or mutated) arguments never are.
|
|
266
266
|
item = Robin.pristine(payload).dup
|
|
267
267
|
%w[at error_class error_message error_backtrace failed_at retried_at].each { |k| item.delete(k) }
|
|
268
|
-
item["enqueued_at"] = Robin.now_ms
|
|
268
|
+
item["enqueued_at"] = config.job_timestamp(Robin.now_ms)
|
|
269
269
|
queue = item["queue"] || "default"
|
|
270
270
|
checkpoint(config, key, total) do |tx|
|
|
271
271
|
tx.call("SADD", config.key("queues"), queue)
|
data/lib/robin/recovery.rb
CHANGED
|
@@ -116,7 +116,7 @@ module Robin
|
|
|
116
116
|
payload = Robin.load_json(raw).except("enqueued_at")
|
|
117
117
|
payload["error_class"] = "Robin::PoisonPill"
|
|
118
118
|
payload["error_message"] = "job was running when its process died #{config.max_recoveries + 1} times"
|
|
119
|
-
payload["failed_at"] ||= Robin.now_ms
|
|
119
|
+
payload["failed_at"] ||= config.job_timestamp(Robin.now_ms)
|
|
120
120
|
payload
|
|
121
121
|
end
|
|
122
122
|
conn.multi do |tx|
|
data/lib/robin/retrier.rb
CHANGED
|
@@ -25,8 +25,10 @@ module Robin
|
|
|
25
25
|
def self.unpack_backtrace(value)
|
|
26
26
|
return value unless value.instance_of?(String)
|
|
27
27
|
|
|
28
|
-
#
|
|
29
|
-
|
|
28
|
+
# Base64 with or without line breaks (some tools write it with them,
|
|
29
|
+
# every 60 characters). (unpack1 returns a String; Steep can't tell
|
|
30
|
+
# from the format.)
|
|
31
|
+
deflated = value.delete_prefix(BACKTRACE_PREFIX).unpack1("m") #: String
|
|
30
32
|
Robin.load_json(Zlib.inflate(deflated))
|
|
31
33
|
rescue Zlib::Error, ArgumentError, JSON::ParserError
|
|
32
34
|
["(unreadable backtrace)"]
|
|
@@ -90,11 +92,11 @@ module Robin
|
|
|
90
92
|
payload["error_class"] = exception.class.name
|
|
91
93
|
payload["error_message"] = truncate(self.class.message_of(exception))
|
|
92
94
|
now = Robin.now_ms
|
|
93
|
-
payload["failed_at"] ||= now
|
|
95
|
+
payload["failed_at"] ||= config.job_timestamp(now)
|
|
94
96
|
# retry_count is 0 after the first failure, then counts the retries
|
|
95
97
|
# that failed too.
|
|
96
98
|
if payload["retry_count"]
|
|
97
|
-
payload["retried_at"] = now
|
|
99
|
+
payload["retried_at"] = config.job_timestamp(now)
|
|
98
100
|
payload["retry_count"] = Integer(payload.fetch("retry_count")) + 1
|
|
99
101
|
else
|
|
100
102
|
payload["retry_count"] = 0
|
data/lib/robin/scheduler.rb
CHANGED
|
@@ -64,7 +64,7 @@ module Robin
|
|
|
64
64
|
*replies, @processes = conn.pipelined do |p|
|
|
65
65
|
sets.each do |set|
|
|
66
66
|
p.evalsha(Scripts::ENQUEUE_DUE, [@config.key(set), @config.key("queues")],
|
|
67
|
-
[Robin.epoch_seconds(now), "#{@config.key("queue")}:", BATCH, now])
|
|
67
|
+
[Robin.epoch_seconds(now), "#{@config.key("queue")}:", BATCH, @config.job_timestamp(now)])
|
|
68
68
|
end
|
|
69
69
|
p.call("SCARD", @config.key("processes"))
|
|
70
70
|
end
|
data/lib/robin/scripts.rb
CHANGED
|
@@ -47,7 +47,7 @@ module Robin
|
|
|
47
47
|
#
|
|
48
48
|
# KEYS: sorted set, queues set
|
|
49
49
|
# ARGV: now (epoch seconds), queue key prefix ("<prefix>queue:"), max
|
|
50
|
-
# jobs per call, now (
|
|
50
|
+
# jobs per call, now as jobs record it (Config#job_timestamp)
|
|
51
51
|
ENQUEUE_DUE = Redis::Script.new(<<~LUA)
|
|
52
52
|
local jobs = redis.call('ZRANGE', KEYS[1], '-inf', ARGV[1], 'BYSCORE', 'LIMIT', 0, tonumber(ARGV[3]))
|
|
53
53
|
for _, job in ipairs(jobs) do
|
data/lib/robin/testing.rb
CHANGED
|
@@ -88,7 +88,7 @@ module Robin
|
|
|
88
88
|
def push(payloads)
|
|
89
89
|
payloads.each do |payload|
|
|
90
90
|
job = Robin.load_json(Robin.dump_json(payload))
|
|
91
|
-
job["enqueued_at"] ||= Robin.now_ms unless job["at"]
|
|
91
|
+
job["enqueued_at"] ||= Robin.config.job_timestamp(Robin.now_ms) unless job["at"]
|
|
92
92
|
if inline?
|
|
93
93
|
execute(job)
|
|
94
94
|
else
|
|
@@ -129,7 +129,7 @@ module Robin
|
|
|
129
129
|
@mutex.synchronize do
|
|
130
130
|
candidates = @queues.values.flatten
|
|
131
131
|
candidates = candidates.select { |j| j.fetch("class") == class_name } if class_name
|
|
132
|
-
job = candidates.min_by { |j| j["at"] ? Robin.epoch_ms(j
|
|
132
|
+
job = candidates.min_by { |j| j["at"] ? Robin.epoch_ms(j.fetch("at")) : Robin.ms_of(j["enqueued_at"]) || 0 }
|
|
133
133
|
@queues.fetch(job.fetch("queue")).delete(job) if job
|
|
134
134
|
end
|
|
135
135
|
end
|
data/lib/robin/version.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as G,b as N}from"./main-zz8zzhwn.js";var L,sd,Ao,yi,md,dd,ir,ji,dr,Kd,Md,Po,Gi=Symbol.for("pv"),rd={},od=[],_o=/^m(i|n|o|s|text|space)$/,Yd=Array.isArray,Zd=od.slice,Mi=Object.assign;function mi(d){d&&d.parentNode&&d.remove()}function rr(d,r,o){var p,l,v,b={},n=arguments.length;for(v in r)v=="key"?p=r[v]:v=="ref"&&typeof d!="function"?l=r[v]:b[v]=r[v];return n>2&&(b.children=n>3?Zd.call(arguments,2):o),_i(d,b,p,l,null)}function _i(d,r,o,p,l){var v={type:d,props:r,key:o,ref:p,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Gi,__v:l||++sd,__i:-1,__u:0};return!l&&L.vnode&&L.vnode(v),v}function V(d){return d.children}function si(d,r){this.props=d,this.context=r,this.__g=0}function ci(d,r){if(r==null)return d.__&&ci(d.__,d.__i+1);for(var o;r<d.__k.length;r++)if((o=d.__k[r])&&o.__e)return o.__e;return typeof d.type!="function"||d.props.__P?null:ci(d)}function Go(d){var r,o=d.__v,p=o.__e,l=[],v=[],b=d.__P;b&&((r=Mi({constructor:Gi},o)).__v=o.__v+1,L.vnode&&L.vnode(r),Wd(b,r,o,d.__n,b.namespaceURI,32&o.__u?[p]:null,l,p||ci(o),32&o.__u,v),r.__v=o.__v,r.__.__k[r.__i]=r,br(l,r,v),o.__=o.__e=null,r.__e!=p&&or(r))}function or(d){if((d=d.__)&&d.__c&&!d.props.__P)return d.__e=null,d.__k.some(function(r){return r&&(d.__e=r.__e)}),or(d)}function xd(d){(8&d.__g||(d.__g|=8,yi.push(d),dd++))&&md==L.debounceRendering||((md=L.debounceRendering)||queueMicrotask)(ar)}function ar(){try{for(var d,r=1;yi.length;)yi.length>r&&yi.sort(ir),d=yi.shift(),r=yi.length,8&d.__g&&Go(d)}finally{(dd=yi.length)&&(md||queueMicrotask)(ar)}}function pr(d,r,o,p,l,v,b,n,z,y,h){var k,M,g,X,f,I,W=p.__k||od,J=r.length;for(z=No(o,r,W,z,J),k=0;k<J;k++)(g=o.__k[k])!=null&&(M=~g.__i&&W[g.__i]||rd,g.__i=k,I=Wd(d,g,M,l,v,b,n,z,y,h),X=g.__e,(M.ref!=g.ref||8&M.__u)&&(M.ref&&Qd(M.ref,null,g,M),g.ref&&h.push(g.ref,g.__c||X,g)),f=f||X,4&g.__u?(z=lr(g,z,d,!M.__v),M.__e&&(M.__e=null)):typeof g.type=="function"&&I!==void 0?z=I:X&&(z=X.nextSibling),g.__u&=-21);return o.__e=f,z}function No(d,r,o,p,l){var v,b,n,z,y,h,k,M,g,X=o.length,f=X,I=0,W=0,J=d.__k=Array(l);for(v=0;v<l;v++)(b=r[v])!=null&&typeof b!="boolean"&&typeof b!="function"?(typeof b!="object"||b.constructor===String?b=J[v]=_i(null,b):Yd(b)?b=J[v]=_i(V,{children:b}):b.constructor===Gi&&b.__b?b=J[v]=_i(b.type,b.props,b.key,b.ref,b.__v):J[v]=b,z=v+I,b.__=d,b.__b=d.__b+1,n=null,~(y=b.__i=Co(b,o,z,f))&&(f--,(n=o[y])&&(n.__u|=2)),n&&n.__v?(b.__u|=16,y==z-1?I--:y==z+1?I++:y!=z&&(y>z?I--:I++,W=1)):(~y||(l>X?I--:l<X&&I++),typeof b.type!="function"&&(b.__u|=4))):J[v]=null;if(W){for(h=[],k=[],v=0;v<l;v++)if((b=J[v])&&16&b.__u){for(I=0,M=h.length;I<M;)h[g=I+M>>1]<b.__i?I=g+1:M=g;h[I]=b.__i,k[v]=I+1}for(I=h.length;v--;)k[v]&&(k[v]==I?I--:J[v].__u|=4)}if(f)for(v=0;v<X;v++)!(n=o[v])||2&n.__u||(n.__e==p&&(p=ci(n)),Dd(n,n));return p}function lr(d,r,o,p){var l,v,b,n;if(typeof d.type=="function"){if(d.props.__P)return r;if(l=d.__k)for(v=0;v<l.length;v++)l[v]&&(l[v].__=d,r=lr(l[v],r,o,!1));return r}for(r&&!r.parentNode&&(r=ci(d))&&!r.parentNode&&(r=null),b=d.__e,n=r;n&&n.nodeType==8;)n=n.nextSibling;for(b!=n&&(!p&&o.moveBefore&&b.parentNode?o.moveBefore(b,r):o.insertBefore(b,r||null)),r=b;(r=r&&r.nextSibling)&&r.nodeType==8&&!r.data.startsWith("$s"););return r}function Co(d,r,o,p){var l,v=d.key,b=d.type,n=r[o],z=n&&!(2&n.__u);if(n===null&&v==null||z&&v==n.key&&b==n.type)return o;if(p>(z?1:0)){for(l=o-1;l>=0;l--)if((n=r[l])&&!(2&n.__u)&&v==n.key&&b==n.type)return l;for(l=o+1;l<r.length;l++)if((n=r[l])&&!(2&n.__u)&&v==n.key&&b==n.type)return l}return-1}function jd(d,r,o){o==null&&(o=""),r[0]=="-"?d.setProperty(r,o):d[r]=o}function xi(d,r,o,p,l){var v,b;if(r=="style")if(typeof o=="string")d.style.cssText=o;else{if(typeof p=="string"&&(d.style.cssText=p=""),p)for(r in p)o&&r in o||jd(d.style,r);if(o)for(r in o)p&&o[r]==p[r]||jd(d.style,r,o[r])}else if(r[0]=="o"&&r[1]=="n")typeof o!="function"&&(o=null),typeof p!="function"&&(p=null),(d.__e||(d.__e={}))[r]=o,o&&p||(b=Md[r]||(Md[r]=qo(r)),(d.__a||(d.__a={}))[r]=Kd,v=r!=(r=r.replace(dr,"$1")),(r=r.slice(2))[0]<"a"&&(r=r.toLowerCase()),o?d.addEventListener(r,b,v):d.removeEventListener(r,b,v));else{if(l=="http://www.w3.org/2000/svg")r=r.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(r!="width"&&r!="height"&&r!="href"&&r!="list"&&r!="form"&&r!="tabIndex"&&r!="download"&&r!="rowSpan"&&r!="colSpan"&&r!="role"&&r!="popover"&&r in d)try{return void(d[r]=o==null?"":o)}catch(n){}if(typeof o=="function")return;o==null||o===!1&&r[4]!="-"?d.removeAttribute(r):d.setAttribute(r,r=="popover"&&o==1?"":o)}}function qo(d){return function(r){var o=this.__e;if(o){if(o=o[d],r[ji]==null)r[ji]=Kd++;else if(r[ji]<this.__a[d])return;return o(L.event?L.event(r):r)}}}function Wd(d,r,o,p,l,v,b,n,z,y){var h,k,M,g,X,f,I,W,J,_,Y,u,pi,bi,H,ni,di,gi,ai=r.type;if(r.constructor!==Gi)return null;128&o.__u&&(z=32&o.__u,h=o.__c.__z)&&(r.__u|=z,k=v=[],h.nodeType==8?n=id(h,v):v.push(h),n=v[0]||n),(h=L.__b)&&h(r);i:if(typeof ai=="function"){M=b.length;try{if(W=r.props,J=(h=ai.prototype)&&h.render,_=(h=ai.contextType)&&p[h.__c],Y=h?_?_.props.value:h.__:p,(g=o.__c)?(r.__c=g,2&g.__g&&(g.__g|=1)):(J?r.__c=g=new ai(W,Y):(r.__c=g=new si(W,Y),g.constructor=ai,g.render=So),_&&_.sub(g),g.state||(g.state={}),g.__n=p,g.__g|=8,g.__h=[],g.__k=[]),J&&(g.__s||(g.__s=g.state),ai.getDerivedStateFromProps&&(g.__s==g.state&&(g.__s=Mi({},g.__s)),Mi(g.__s,ai.getDerivedStateFromProps(W,g.__s)))),X=g.props,f=g.state,g.__v=r,o.__c){if(W!==X&&J&&!ai.getDerivedStateFromProps&&g.componentWillReceiveProps&&g.componentWillReceiveProps(W,Y),r.__v==o.__v&&!(8&g.__g)||!(4&g.__g)&&g.shouldComponentUpdate&&g.shouldComponentUpdate(W,g.__s,Y)===!1){r.__v!=o.__v&&(g.props=W,g.state=g.__s,g.__g&=-9),r.__e=o.__e,r.__k=o.__k,r.__k.some(function(s){s&&(s.__=r)}),od.push.apply(g.__h,g.__k),g.__k=[],g.__h.length&&b.push(g),n=ci(o);break i}g.componentWillUpdate&&g.componentWillUpdate(W,g.__s,Y),J&&g.componentDidUpdate&&g.__h.push(function(){g.componentDidUpdate(X,f,I)})}else J&&!ai.getDerivedStateFromProps&&g.componentWillMount&&g.componentWillMount(),J&&g.componentDidMount&&g.__h.push(g.componentDidMount);g.context=Y,g.props=W,g.__P=d,g.__g&=-5,u=L.__r,pi=J?25:0;do g.__g&=-9,u&&u(r),h=g.render(g.props,g.state=g.__s,g.context);while(8&g.__g&&++pi<25);J&&(od.push.apply(g.__h,g.__k),g.__k=[]),g.state=g.__s,g.getChildContext&&(p=Mi({},p,g.getChildContext())),J&&o.__c&&g.getSnapshotBeforeUpdate&&(I=g.getSnapshotBeforeUpdate(X,f)),bi=h&&h.type===V&&h.key==null?h.props.children:h,W.__P&&(h=n,l=(d=W.__P).namespaceURI,z=v=null,o.props&&o.props.__P!=d&&(o.__k.some(function(s){s&&Dd(s,s)}),o.__k=null),n=o.__k?ci(o,0):null),n=pr(d,Yd(bi)?bi:[bi],r,o,p,l,v,b,n,z,y),W.__P&&(r.__e=null,n=h),r.__u&=-161,k&&k.some(mi),g.__h.length&&b.push(g),1&g.__g&&(g.__g&=-4)}catch(s){if(b.length=M,r.__v=null,z||v)if(s&&s.then){if(r.__u|=128|z,v){for(~(di=v.indexOf(n||void 0))||(di=v.length);(gi=v[di-1])&&gi.nodeType==8;)di--;for(;di<v.length;di++)if(gi=v[di])if(v[di]=null,H){if(gi==ni)break}else{if(gi.nodeType!=8)break;gi.data.startsWith("$s")&&(ni=id(H=gi))}}if(!H){for(;n&&n.nodeType==8&&n.nextSibling;)n=n.nextSibling;H=n}(h=id(H=r.__c.__z||(r.__c.__z=H)))?(r.__e=H,n=h):r.__e=n,n=n&&n.nextSibling}else v&&v.some(mi);else r.__e=o.__e;r.__k||(r.__k=o.__k||[]),s&&s.then||vr(r),L.__e(s,r,o)}}else n=r.__e=Fo(o.__e,r,o,p,l,v,b,z,y,d);return(h=L.diffed)&&h(r),n}function id(d,r){if(d&&d.nodeType==8&&d.data.startsWith("$s"))for(var o=1;d=d.nextSibling;){if(d.nodeType==8){if(d.data.startsWith("$s"))o++;else if(d.data.startsWith("/$s")&&!--o)return d}r&&r.push(d)}}function vr(d){d&&(d.__c&&(d.__c.__g|=4),d.__k&&d.__k.some(vr))}function br(d,r,o){for(var p=0;p<o.length;)Qd(o[p++],o[p++],o[p++]);L.__c&&L.__c(r,d),d.some(function(l){try{d=l.__h,l.__h=[],d.some(function(v){v.call(l)})}catch(v){L.__e(v,l.__v)}})}function Fo(d,r,o,p,l,v,b,n,z,y){var h,k,M,g,X,f,I,W,J=o.props||rd,_=r.props,Y=r.type;if(Y=="svg"?l="http://www.w3.org/2000/svg":Y=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),v){for(h=0;h<v.length;h++)if((X=v[h])&&(Y?X.localName==Y:X.nodeType==3)){d=X,v[h]=null;break}}if(!d){if(W=y.ownerDocument||document,!Y)return W.createTextNode(_);d=W.createElementNS(l,Y,_.is?_:y),n&&(L.__m&&L.__m(r,v),n=!1),v=null}if(Y){if(y=Y=="template"&&d.content||d,v=Y=="textarea"&&_.defaultValue!=null?null:v&&Zd.call(y.childNodes),!n&&v)for(J={},h=0;h<d.attributes.length;h++)J[(X=d.attributes[h]).name]=X.value;for(h in J)X=J[h],h=="dangerouslySetInnerHTML"?M=X:h=="children"||(h in _)||h=="value"&&("defaultValue"in _)||h=="checked"&&("defaultChecked"in _)||xi(d,h,null,X,l);for(h in _)X=_[h],h=="children"?g=X:h=="dangerouslySetInnerHTML"?k=X:h=="value"?f=X:h=="checked"?I=X:n&&typeof X!="function"||J[h]===X||xi(d,h,X,J[h],l);k?(n||M&&(k.__html==M.__html||k.__html==d.innerHTML)||(d.innerHTML=k.__html),r.__k=[]):(M&&(d.textContent=""),(Y=="foreignObject"||l=="http://www.w3.org/1998/Math/MathML"&&_o.test(Y))&&(l="http://www.w3.org/1999/xhtml"),pr(y,Yd(g)?g:[g],r,o,p,l,v,b,v?v[0]:o.__k&&ci(o,0),n,z),v&&v.some(mi)),n&&Y!="textarea"||(h="value",Y=="progress"&&f==null?d.removeAttribute(h):f==null||f===d[h]&&(Y!="progress"||f)||xi(d,h,f,J[h],l),h="checked",I!=null&&I!=d[h]&&xi(d,h,I,J[h],l))}else J===_||n&&d.data==_||(d.data=_);return d}function Qd(d,r,o,p){try{typeof d=="function"?r?r.__x=d(r)||1:p&&(p=p.__c||p.__e)&&(r=p.__x)&&(p.__x=null,typeof r=="function"?r():d(null)):d.current=r}catch(l){L.__e(l,o)}}function Dd(d,r,o){var p,l,v,b;if(L.unmount&&L.unmount(d),!(p=d.ref)||p.current&&p.current!=d.__e||Qd(p,null,r,d),p=d.__c){if(p.componentWillUnmount)try{p.componentWillUnmount()}catch(n){L.__e(n,r)}p.__P=p.__n=null}if(p=d.__k)for(b=0;b<p.length;b++)p[b]&&Dd(p[b],r,typeof d.type!="function"||o&&!d.props.__P);!o&&(p=d.__c)&&(p=p.__z)&&(l=id(p,v=[]))&&(p==d.__e&&v.some(mi),mi(l),mi(p)),o||mi(d.__e),d.__e=d.__c=d.__=null}function So(d,r,o){return this.constructor(d,o)}function nr(d,r){var o,p,l,v;L.__&&L.__(d,r),r.nodeType==9&&(r=r.documentElement),p=(o=d&&32&d.__u)?null:r.__k,r.__k=_i(V,{children:[d]}),l=[],v=[],Wd(r,r.__k,p||rd,rd,r.namespaceURI,p?null:r.firstChild?Zd.call(r.childNodes):null,l,p?p.__e:r.firstChild,o,v),br(l,r.__k,v),r.__k.props.children=null}L={__e:function(d,r,o,p){for(var l,v,b;r=r.__;)if((l=r.__c)&&!(1&l.__g)){l.__g|=4;try{if((b=(v=l.constructor)&&v.getDerivedStateFromError)&&l.setState(v.getDerivedStateFromError(d)),l.componentDidCatch&&(l.componentDidCatch(d,p||{}),b=1),b&&8&l.__g)return void(l.__g|=2)}catch(n){d=n}}throw dd=0,d}},sd=0,Ao=function(d){return d!=null&&d.constructor===Gi},si.prototype.setState=function(d,r){var o=this.__s;o&&o!=this.state||(o=this.__s=Mi({},this.state)),typeof d=="function"&&(d=d(Mi({},o),this.props)),d&&(Mi(o,d),this.__v&&(r&&this.__k.push(r),xd(this)))},si.prototype.forceUpdate=function(d){this.__v&&(this.__g|=4,d&&this.__h.push(d),xd(this))},si.prototype.render=V,yi=[],dd=0,ir=function(d,r){return d.__v.__b-r.__v.__b},ji=Symbol(),dr=/(PointerCapture)$|Capture$/i,Kd=0,Md={},Po=0;var $i,F,Rd,hr,Od=Object.is,Ci=0,Xr=[],Ud=[],C=L,gr=C.__b,fr=C.__r,zr=C.diffed,yr=C.__c,cr=C.unmount,Vr=C.__;function ad(d,r){C.__h&&C.__h(F,d,Ci||r),Ci=0;var o=F.__H||(F.__H={__:[],__h:[]});return d>=o.__.length&&o.__.push({}),o.__[d]}function R(d){return Ci=1,eo(mr,d)}function eo(d,r,o){var p=ad($i++,2);if(p.t=d,!p.__c&&(p.__=[o?o(r):mr(void 0,r),function(v){var b=(p.__N||p.__)[0],n=p.t(b,v);Od(b,n)||(p.__N=[n,p.__[1]],p.__c.setState({}))}],p.__c=F,!F.__f)){F.__f=!0;var l=F.shouldComponentUpdate;F.shouldComponentUpdate=function(v,b,n){var z=this.__H;if(!z)return!0;var y=!1,h=this.props!=v;if(z.__.some(function(M){M.__N&&(y=!0,Od(M.__[0],M.__N[0])||(h=!0))}),l){var k=l.call(this,v,b,n);return y?k||h:k}return!y||h}}return p.__}function S(d,r){var o=ad($i++,3);!C.__s&&Bd(o.__H,r)&&(o.__P=!0,o.__=d,o.u=r,F.__H.__h.push(o))}function Hr(d,r){var o=ad($i++,4);!C.__s&&Bd(o.__H,r)&&(o.__P=!1,o.__=d,o.u=r,F.__h.push(o))}function Vi(d){return Ci=5,Ir(function(){return{current:d}},[])}function Ir(d,r){var o=ad($i++,7);return Bd(o.__H,r)&&(o.__=d(),o.__H=r),o.__}function Jr(d,r){return Ci=8,Ir(function(){return d},r)}function uo(){var d;do{for(;d=Ud.shift();)try{Ni(d)}catch(o){C.__e(o,{__:(d=d.__P)&&d.__v})}for(;d=Xr.shift();){var r=d.__H;if(d.__P&&r)try{r.__h.some(Ni),r.__h.some($d),r.__h=[]}catch(o){r.__h=[],C.__e(o,d.__v)}}}while(Ud.length)}C.__b=function(d){F=null,gr&&gr(d)},C.__=function(d,r){d&&r.__k&&r.__k.__m&&(d.__m=r.__k.__m),Vr&&Vr(d,r)},C.__r=function(d){fr&&fr(d),$i=0;var r=(F=d.__c).__H;r&&(Rd==F?F.__h=[]:(r.__h.some(Ni),r.__h.some($d),$i=0),r.__h=[],r.__.some(function(o){o.__N&&(o.__=o.__N),o.u=o.__N=void 0})),Rd=F},C.diffed=function(d){zr&&zr(d);var r=d.__c;r&&r.__H&&(r.__H.__h.length&&wr(Xr.push(r)),r.__H.__.some(function(o){o.u&&(o.__H=o.u)})),Rd=F=null},C.__c=function(d,r){r.some(function(o){try{o.__h.some(Ni),o.__h=o.__h.filter(function(p){return!p.__||$d(p)})}catch(p){o.__h=[function(){throw p}]}}),yr&&yr(d,r)},C.unmount=function(d){cr&&cr(d);var r,o,p=d.__c;p&&p.__H&&(p.__H.__.some(function(l){try{if(l.__P&&l.__c){if(o===void 0){for(o=d.__;o&&(!o.__c||!o.__c.__P);)o=o.__;o=o&&o.__c}l.__P=o,wr(Ud.push(l))}else Ni(l)}catch(v){r=v}}),p.__H=void 0,r&&C.__e(r,p.__v))};var kr=typeof requestAnimationFrame=="function";function to(d){var r,o=function(){clearTimeout(p),kr&&cancelAnimationFrame(r),setTimeout(d)},p=setTimeout(o,35);kr&&(r=requestAnimationFrame(o))}function wr(d){d!=1&&hr==C.requestAnimationFrame||((hr=C.requestAnimationFrame)||to)(uo)}function Ni(d){var r=F,o=d.__c;typeof o=="function"&&(d.__c=void 0,o()),F=r}function $d(d){var r=F;d.__c=d.__(),F=r}function Bd(d,r){return!d||d.length!=r.length||r.some(function(o,p){return!Od(o,d[p])})}function mr(d,r){return typeof r=="function"?r(d):r}function x(d){let r=d,o=new Set;return{get:()=>r,set(p){r=p,o.forEach((l)=>l())},update(p){this.set(p(r))},subscribe(p){return o.add(p),()=>{o.delete(p)}}}}function P(d){let[,r]=R({});return S(()=>d.subscribe(()=>{r({})}),[d]),d.get()}var Bi={ar:{name:"العربية",rtl:!0,load:()=>import("./ar-y7v9b75f.js")},cs:{name:"Čeština",load:()=>import("./cs-df88mq5e.js")},da:{name:"Dansk",load:()=>import("./da-kemms74g.js")},de:{name:"Deutsch",load:()=>import("./de-z8kkqg65.js")},en:{name:"English"},es:{name:"Español",load:()=>import("./es-9ahrrn1s.js")},fa:{name:"فارسی",rtl:!0,load:()=>import("./fa-7r0x28nc.js")},fr:{name:"Français",load:()=>import("./fr-r7mqf3d9.js")},he:{name:"עברית",rtl:!0,load:()=>import("./he-7t46b6rt.js")},hi:{name:"हिन्दी",load:()=>import("./hi-zj434tx4.js")},it:{name:"Italiano",load:()=>import("./it-pqc2m7gm.js")},ja:{name:"日本語",load:()=>import("./ja-k9rgm1pj.js")},ko:{name:"한국어",load:()=>import("./ko-bxersv91.js")},nb:{name:"Norsk bokmål",load:()=>import("./nb-fjnc5064.js")},nl:{name:"Nederlands",load:()=>import("./nl-9p8b95b6.js")},pl:{name:"Polski",load:()=>import("./pl-8xsrdn8n.js")},"pt-BR":{name:"Português (Brasil)",load:()=>import("./pt-BR-650j7cvg.js")},ru:{name:"Русский",load:()=>import("./ru-a9ftyw3d.js")},sv:{name:"Svenska",load:()=>import("./sv-j9gqamr1.js")},tr:{name:"Türkçe",load:()=>import("./tr-y9z0q51g.js")},uk:{name:"Українська",load:()=>import("./uk-2dr9ew3p.js")},ur:{name:"اردو",rtl:!0,load:()=>import("./ur-h25nzq1s.js")},vi:{name:"Tiếng Việt",load:()=>import("./vi-9y2ff1bd.js")},"zh-CN":{name:"简体中文",load:()=>import("./zh-CN-tbj9mf98.js")},"zh-TW":{name:"繁體中文",load:()=>import("./zh-TW-59q8j9vw.js")}},ki=x({code:"en",catalogue:{}}),Mr="robin.locale",e=()=>ki.get().code,pd=(d,r)=>d.replace(/\{(\w+)\}/g,(o,p)=>(p in r)?String(r[p]):o),c=(d)=>d;function a(d,r={}){let o=ki.get().catalogue[d];return pd(typeof o==="string"?o:d,r)}function Kr(d,r,o){let p=ki.get().catalogue[`${d}|${r}`];if(typeof p!=="object")return o===1?d:r;return p[new Intl.PluralRules(e()).select(o)]??p.other}var Yr=(d)=>new Intl.NumberFormat(e()).format(d);function Q(d,r,o,p={}){return pd(Kr(d,r,o),{n:Yr(o),...p})}function Zr(d,r){let p=d.split(/\{(\w+)\}/).map((l,v)=>v%2?l in r?r[l]:`{${l}}`:l);return rr(V,null,...p.filter((l)=>l!==""))}var q=(d,r)=>Zr(a(d),r),Ki=(d,r,o,p)=>Zr(Kr(d,r,o),{n:Yr(o),...p});function Wr(d=localStorage.getItem(Mr),r=navigator.languages){if(d&&Object.hasOwn(Bi,d))return d;let o=Object.keys(Bi);for(let p of r){let[l,...v]=p.toLowerCase().split("-");if(l==="zh")return xo(v);let b=o.find((n)=>n.split("-")[0]===l);if(b)return b}return"en"}function xo(d){if(d.includes("hans"))return"zh-CN";if(d.includes("hant"))return"zh-TW";return["tw","hk","mo"].some((r)=>d.includes(r))?"zh-TW":"zh-CN"}async function ld(d,r=!0){let o=Object.hasOwn(Bi,d)?d:"en",p=Bi[o],l=p.load?(await p.load()).default:{};if(r)localStorage.setItem(Mr,o);document.documentElement.lang=o,document.documentElement.dir=p.rtl?"rtl":"ltr",ki.set({code:o,catalogue:l})}class Ed extends Error{status;constructor(d,r){super(r);this.status=d}}var qi=x(localStorage.getItem("robin.cluster")??"");function Qr(d){localStorage.setItem("robin.cluster",d),qi.set(d)}function Ei(d,r={}){let o=new URLSearchParams;for(let[v,b]of Object.entries(r))if(b!==void 0&&b!=="")o.set(v,String(b));let p=qi.get();if(p)o.set("cluster",p);let l=o.toString();return`api/${d}${l?`?${l}`:""}`}async function Dr(d){let r=await d.text(),o;try{o=r?JSON.parse(r):{}}catch{throw new Ed(d.status,a("The server sent an unexpected response ({status}).",{status:d.status}))}if(!d.ok)throw new Ed(d.status,o.error??a("Request failed ({status}).",{status:d.status}));return o}async function Ti(d,r){let o=await fetch(Ei(d,r),{headers:{accept:"application/json"},credentials:"same-origin"});return Dr(o)}async function Td(d,r,o,p){let l=await fetch(Ei(r,p),{method:d,credentials:"same-origin",headers:{"content-type":"application/json",accept:"application/json","x-robin-request":"1"},body:JSON.stringify(o)});return Dr(l)}var w=encodeURIComponent;var Rr=new Map;function Ld(d={}){let r=`${e()} ${JSON.stringify(d)}`,o=Rr.get(r);if(!o)Rr.set(r,o=new Intl.NumberFormat(e(),d));return o}var t=(d,r)=>Ld({minimumFractionDigits:r,maximumFractionDigits:r,useGrouping:!1}).format(d);function K(d,r=!1){if(d==null||Number.isNaN(d))return"–";if(r&&Math.abs(d)>=1e4)return Ld({notation:"compact",maximumFractionDigits:1}).format(d);return Ld().format(Math.round(d))}function li(d){if(d==null||Number.isNaN(d))return"–";let r=Math.max(0,d);if(r<1)return a("{n} ms",{n:Math.round(r*1000)});if(r<60)return a("{n} s",{n:r<10?t(r,1):Math.round(r)});let o=Math.floor(r/60);if(o<60)return a("{m} m {s} s",{m:o,s:Math.round(r%60)});let p=Math.floor(o/60);if(p<24)return a("{h} h {m} m",{h:p,m:o%60});let l=Math.floor(p/24);return a("{d} d {h} h",{d:K(l),h:p%24})}function Yi(d){if(d==null||Number.isNaN(d))return"–";if(d<1)return a("{n} ms",{n:t(d,2)});return li(d/1000)}var jo=[["second",1,60],["minute",60,3600],["hour",3600,86400],["day",86400,2592000],["month",2592000,31536000],["year",31536000,1/0]];function Or(d,r=Date.now()){if(!d)return"–";let o=(d-r)/1000,p=Math.abs(o);if(p<5)return a("just now");let[l,v]=jo.find(([,,b])=>p<b);return new Intl.RelativeTimeFormat(e(),{numeric:"auto"}).format(Math.round(o/v),l)}function Ur(d){if(!d)return"";let r=new Date(d),o=(p)=>String(p).padStart(2,"0");return`${r.getFullYear()}-${o(r.getMonth()+1)}-${o(r.getDate())} ${o(r.getHours())}:${o(r.getMinutes())}:${o(r.getSeconds())}`}function $r(d){if(!d)return"–";if(d<1024)return a("{n} KB",{n:d});if(d<1048576)return a("{n} MB",{n:t(d/1024,d<10240?1:0)});return a("{n} GB",{n:t(d/1024/1024,1)})}function Zi(d){let r=+d.slice(0,4),o=+d.slice(4,6)-1,p=+d.slice(6,8),l=+d.slice(8,10),v=+d.slice(10,12);return Date.UTC(r,o,p,l,v)}function fi(d,r=120){let o=d.map((p)=>JSON.stringify(p)).join(", ");return o.length>r?`${o.slice(0,r-1)}…`:o}function Li(d,r){return r>0?Math.min(100,Math.max(0,d/r*100)):0}function wi(d){let r=d.split(":");return{host:r.slice(0,-2).join(":")||d,pid:r[r.length-2]??""}}function Ad(d,r=4){if(d<=0)return[0];let o=d/r,p=10**Math.floor(Math.log10(o)),l=[1,2,2.5,5,10].map((b)=>b*p).find((b)=>b>=o),v=Math.ceil(d/l-0.000000001);return Array.from({length:v+1},(b,n)=>Math.round(n*l*1e6)/1e6)}var Pd=new URL(document.baseURI).pathname.replace(/\/$/,"");function vd(){let d=location.pathname;return{path:d.startsWith(`${Pd}/`)?d.slice(Pd.length):"/",query:new URLSearchParams(location.search)}}var _d=x(vd());window.addEventListener("popstate",()=>_d.set(vd()));function Gd(d){return`${Pd}${d}`}function j(d,{replace:r=!1}={}){let o=Gd(d);if(history[r?"replaceState":"pushState"](null,"",o),_d.set(vd()),!r)window.scrollTo({top:0})}function Wi(d){let{path:r,query:o}=vd();for(let[l,v]of Object.entries(d))if(v===void 0||v===""||v===1&&l==="page")o.delete(l);else o.set(l,String(v));let p=o.toString();j(`${r}${p?`?${p}`:""}`,{replace:!0})}function ri(){return P(_d)}var Br=(d)=>d.replace(/\/$/,"").split("/");function Nd(d,r){let o=Br(d),p=Br(r);if(o.length!==p.length)return null;let l={};for(let[v,b]of o.entries()){let n=p[v];if(b.startsWith(":"))l[b.slice(1)]=decodeURIComponent(n);else if(b!==n)return null}return l}var vi=x(null);async function qd(){vi.set(await Ti("session"))}function Z(d){return vi.get()?.permissions[d]===!0}var Xi=x(null),Tr=x([]),Fi=x(localStorage.getItem("robin.paused")==="1"),Ai=x("live"),Er=3,Cd=null,Lr,bd=0;function Ar(d){Xi.set(d),Tr.update((r)=>[...r.slice(-89),{at:d.at,processed:d.stats.processed,failed:d.stats.failed}])}function so(){Cd?.close(),Cd=null,clearInterval(Lr)}function i1(){let d=vi.get();Ai.set(d.live_updates==="stream"?"polling":"live");let r=()=>{Ti("stats").then(Ar,()=>Ai.set("offline"))};r(),Lr=setInterval(r,Math.max(1,d.stream_interval)*1000)}function Si(){if(so(),Fi.get())return;if(vi.get().live_updates!=="stream"||bd>=Er){i1();return}let d=new EventSource(Ei("stream"));Cd=d,d.addEventListener("stats",(r)=>{bd=0,Ai.set("live"),Ar(JSON.parse(r.data))}),d.onerror=()=>{if(bd+=1,bd>=Er)Si()}}function Pr(d){localStorage.setItem("robin.paused",d?"1":"0"),Fi.set(d),Si()}qi.subscribe(()=>{Tr.set([]),Xi.set(null),qd().then(Si,()=>Ai.set("offline"))});var hd=x(localStorage.getItem("robin.theme")??"system"),_r=matchMedia("(prefers-color-scheme: dark)");function gd(){let d=hd.get(),r=d==="dark"||d==="system"&&_r.matches;document.documentElement.dataset.theme=r?"dark":"light"}function Gr(d){localStorage.setItem("robin.theme",d),hd.set(d),gd()}_r.addEventListener("change",gd);var nd=x([]),d1=0;function zi(d,r="ok"){let o=++d1;nd.update((p)=>[...p.slice(-3),{id:o,message:d,kind:r}]),setTimeout(()=>{nd.update((p)=>p.filter((l)=>l.id!==o))},r==="error"?7000:3500)}var fd=x(null);function Nr(d){return new Promise((r)=>{fd.set({...d,resolve:r})})}function E(d,r={},o=0){let p=P(qi),l=P(Fi),[v,b]=R({data:null,error:null}),n=JSON.stringify(r),z=`${d}?${n}@${p}`,y=Vi(z);y.current=z;let h=Jr(()=>{Ti(d,JSON.parse(n)).then((k)=>{if(y.current===z)b({data:k,error:null})},(k)=>{if(y.current===z)b((M)=>({data:M.data,error:k.message}))})},[d,n,z]);return S(h,[h]),S(()=>{if(!o||l)return;let k=setInterval(()=>{if(document.visibilityState==="visible")h()},o*1000);return()=>{clearInterval(k)}},[h,o,l]),{...v,reload:h}}var r1=Symbol.for("pv"),o1=0;function i(d,r,o,p,l,v){r||(r={});var b,n,z=r;if("ref"in z&&typeof d!="function")for(n in z={},r)n=="ref"?b=r[n]:z[n]=r[n];var y={type:d,props:z,key:o,ref:b,__k:null,__:null,__b:0,__e:null,__c:null,constructor:r1,__v:--o1,__i:-1,__u:0};return(l||v)&&(y.__source=l,y.__self=v),L.vnode&&L.vnode(y),y}var a1={dashboard:"M3 11 L10 4 L17 11 M5 9.5 V16 H15 V9.5",busy:"M3 10 H6 L8 5 L12 15 L14 10 H17",queues:"M4 5 H16 M4 10 H16 M4 15 H11",scheduled:"M10 4 A6 6 0 1 0 10.01 4 M10 6.5 V10 L12.5 11.5",retries:"M4.5 9 A5.5 5.5 0 0 1 15 7 M15 3.5 V7 H11.5 M15.5 11 A5.5 5.5 0 0 1 5 13 M5 16.5 V13 H8.5",dead:"M5 5 L15 15 M15 5 L5 15",metrics:"M4 16 V9 M8 16 V5 M12 16 V11 M16 16 V7",batches:"M4 6 L10 3 L16 6 L10 9 Z M4 10 L10 13 L16 10 M4 14 L10 17 L16 14",limiters:"M3.5 13 A6.5 6.5 0 0 1 16.5 13 M10 13 L13.5 8.5",cron:"M4 6 H16 V16 H4 Z M4 9 H16 M7 4 V7 M13 4 V7 M8 12.5 L9.5 14 L12.5 11",settings:"M10 7.5 A2.5 2.5 0 1 0 10.01 7.5 M10 2.8 V5 M10 15 V17.2 M2.8 10 H5 M15 10 H17.2 M4.9 4.9 L6.5 6.5 M13.5 13.5 L15.1 15.1 M4.9 15.1 L6.5 13.5 M13.5 6.5 L15.1 4.9",search:"M8.5 4 A4.5 4.5 0 1 0 8.51 4 M12 12 L16 16",sun:"M10 7 A3 3 0 1 0 10.01 7 M10 2.5 V4 M10 16 V17.5 M2.5 10 H4 M16 10 H17.5 M4.7 4.7 L5.8 5.8 M14.2 14.2 L15.3 15.3 M4.7 15.3 L5.8 14.2 M14.2 5.8 L15.3 4.7",moon:"M15.5 12.5 A6 6 0 0 1 7.5 4.5 A6 6 0 1 0 15.5 12.5 Z",check:"M4 10.5 L8 14.5 L16 5.5",alert:"M10 3 L18 16.5 H2 Z M10 8 V11.5 M10 13.8 V14",menu:"M3 6 H17 M3 10 H17 M3 14 H17",gem:"M6 4 H14 L17 8 L10 16 L3 8 Z M3 8 H17 M8 4 L10 8 L12 4 M10 8 V16",profiles:"M3 16 H17 M4 13 H16 M5 10 H11 M6 7 H9 M12 10 H15 M7 4 H8",extension:"M4 4 H9 V7 A1.5 1.5 0 0 0 9 10 V16 H4 Z M11 4 H16 V9 H13 A1.5 1.5 0 0 0 11 9 Z M11 11 H16 V16 H11 Z",download:"M10 3 V12 M6 8.5 L10 12.5 L14 8.5 M4 16 H16"};function ii({name:d,title:r,...o}){return i("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"miter","aria-hidden":r?void 0:"true",role:r?"img":void 0,...o,children:[r&&i("title",{children:r}),i("path",{d:a1[d]})]})}function m({href:d,children:r,onClick:o,...p}){return i("a",{href:Gd(d),...p,onClick:(l)=>{if(o?.(l),l.defaultPrevented||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey)return;l.preventDefault(),j(d)},children:r})}var Qi=document.querySelector('meta[name="robin-logo"]')?.content??"",Cr=document.querySelector('meta[name="robin-wordmark"]')?.content??"",qr=[{items:[{href:"/",label:c("Dashboard"),icon:"dashboard"},{href:"/busy",label:c("Busy"),icon:"busy",count:(d)=>d.busy},{href:"/queues",label:c("Queues"),icon:"queues",count:(d)=>d.enqueued},{href:"/scheduled",label:c("Scheduled"),icon:"scheduled",count:(d)=>d.scheduled},{href:"/retries",label:c("Retries"),icon:"retries",count:(d)=>d.retries,alert:!0},{href:"/dead",label:c("Dead"),icon:"dead",count:(d)=>d.dead}]},{group:c("Insight"),items:[{href:"/metrics",label:c("Metrics"),icon:"metrics"},{href:"/batches",label:c("Batches"),icon:"batches"},{href:"/limiters",label:c("Rate limits"),icon:"limiters"},{href:"/cron",label:c("Cron"),icon:"cron"},{href:"/profiles",label:c("Profiles"),icon:"profiles"}]}],ei=(d)=>d.titles?.[e()]??d.title;function p1(d=[]){if(d.length===0)return qr;let r=d.map((o)=>({href:`/ext/${encodeURIComponent(o.slug)}`,label:ei(o),icon:"extension"}));return[...qr,{group:c("Extensions"),items:r}]}function l1(d,r){return r===d||r.startsWith(`${d}/`)||r.startsWith(`/sets${d}/`)}function v1({onNavigate:d}){let{path:r}=ri(),o=P(Xi),p=P(vi),l=o?.stats,v=p?.title??"Robin";return i("aside",{class:"side","aria-label":a("Main navigation"),children:[i(m,{href:"/",class:"brand",onClick:d,children:[Qi&&i("img",{src:Qi,alt:""}),i("span",{class:"brand-name",children:[Cr&&v==="Robin"?i("img",{class:"brand-wordmark",src:Cr,alt:"Robin"}):v,i("span",{class:"brand-version",children:["v",p?.version]})]})]}),i("nav",{class:"nav",children:p1(p?.extensions).map((b)=>i(V,{children:[b.group&&i("div",{class:"nav-group",children:a(b.group)}),b.items.map((n)=>{let z=l&&n.count?.(l);return i(m,{href:n.href,"aria-current":l1(n.href,r)?"page":void 0,onClick:d,children:[i(ii,{name:n.icon}),n.icon==="extension"?n.label:a(n.label),z!==void 0&&i("span",{class:`count${n.alert&&z>0?" alert":""}`,children:K(z,!0)})]},n.href)})]}))}),i("div",{class:"side-foot",children:i(m,{href:"/settings",class:"row",onClick:d,"aria-current":r==="/settings"?"page":void 0,children:[i(ii,{name:"settings",width:15,height:15})," ",a("Settings & about")]})})]})}function b1(){let d=P(Ai),r=P(Fi),o=r?a("Paused"):d==="live"?a("Live"):d==="polling"?a("Polling"):a("Offline");return i("button",{class:"live","data-state":r?"paused":d,"aria-pressed":!r,title:r?a("Resume live updates"):a("Pause live updates"),onClick:()=>Pr(!r),children:[i("span",{class:"dot"}),o]})}var n1={light:c("Light theme"),system:c("System theme"),dark:c("Dark theme")};function h1(){let d=P(hd);return i("div",{class:"seg",role:"group","aria-label":a("Color theme"),children:["light","system","dark"].map((r)=>i("button",{"aria-pressed":d===r,onClick:()=>Gr(r),title:a(n1[r]),children:r==="light"?i(ii,{name:"sun",width:15,height:15,title:a("Light")}):r==="dark"?i(ii,{name:"moon",width:15,height:15,title:a("Dark")}):a("Auto")},r))})}function g1(){let[d,r]=R("");return i("form",{class:"search",role:"search",onSubmit:(o)=>{o.preventDefault();let p=d.trim();if(p)j(`/jobs/${encodeURIComponent(p)}`);r("")},children:[i(ii,{name:"search"}),i("input",{class:"input",placeholder:a("Find a job by ID"),"aria-label":a("Find a job by ID"),value:d,onInput:(o)=>r(o.target.value)})]})}function f1(){let d=P(vi);if(!d||d.clusters.length<2)return null;return i("label",{class:"row small",children:[i("span",{class:"dim",children:a("Cluster")}),i("select",{class:"select",value:d.cluster,onChange:(r)=>Qr(r.target.value),children:d.clusters.map((r)=>i("option",{value:r,children:r},r))})]})}function Fr({children:d}){let{path:r}=ri(),[o,p]=R(null),l=o===r,v=()=>p(null);return S(()=>{let b=(n)=>{if(n.key==="/"&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement))n.preventDefault(),document.querySelector(".topbar .search input")?.focus();if(n.key==="Escape")v()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]),i("div",{class:`shell${l?" nav-open":""}`,children:[i(v1,{onNavigate:v}),i("main",{class:"main",id:"main",children:[i("div",{class:"mobile-bar",children:[i("button",{class:"btn btn-ghost","aria-label":a("Open navigation"),onClick:()=>p(r),children:i(ii,{name:"menu"})}),Qi&&i("img",{src:Qi,alt:""}),i("strong",{children:"Robin"})]}),i("div",{class:"content",children:[i("div",{class:"topbar",children:[i(g1,{}),i("span",{class:"spacer"}),i(f1,{}),i(b1,{}),i(h1,{})]}),d]})]})]})}function z1(d=15){let[r,o]=R(Date.now());return S(()=>{let p=setInterval(()=>o(Date.now()),d*1000);return()=>clearInterval(p)},[d]),r}function T({at:d}){let r=z1();if(!d)return i("span",{class:"dim",children:"–"});return i("time",{dateTime:new Date(d).toISOString(),title:Ur(d),children:Or(d,r)})}function oi({jid:d}){if(!d)return i("span",{class:"dim",children:"–"});let r=()=>{let o=navigator.clipboard;if(!o){zi(a("Copying needs HTTPS"),"error");return}o.writeText(d).then(()=>zi(a("Copied {jid}",{jid:d})),()=>zi(a("Couldn't copy to the clipboard"),"error"))};return i("button",{type:"button",class:"jid",title:a("Copy job ID"),onClick:r,children:d})}function ui({seconds:d}){if(d>=300)return i("span",{class:"lat-bad",title:a("Jobs are waiting more than 5 minutes"),children:a("{time} behind",{time:li(d)})});if(d>=30)return i("span",{class:"lat-warn",title:a("Jobs are waiting more than 30 seconds"),children:a("{time} slow",{time:li(d)})});return i("span",{class:"lat-ok",children:li(d)})}function $({title:d,children:r,icon:o="gem"}){return i("div",{class:"empty",children:[i(ii,{name:o}),i("h3",{children:d}),r&&i("p",{children:r})]})}function O({message:d,onRetry:r}){return i("div",{class:"problem row",role:"alert",children:[i(ii,{name:"alert",width:18,height:18}),i("span",{children:d}),r&&i("button",{class:"btn btn-small right",onClick:r,children:a("Try again")})]})}function U({rows:d=5}){return i("div",{class:"panel-pad stack","aria-busy":"true","aria-label":a("Loading"),children:Array.from({length:d},(r,o)=>i("div",{class:"skeleton",style:{width:`${90-o*9}%`}},o))})}function zd({page:d,perPage:r,total:o}){let p=Math.max(1,Math.ceil(o/r));if(o<=r&&d===1)return null;let l=o===0?0:(d-1)*r+1,v=Math.min(o,d*r);return i("nav",{class:"pager","aria-label":a("Pagination"),children:[i("span",{class:"num",children:a("{from}–{to} of {total}",{from:K(l),to:K(v),total:K(o)})}),i("span",{class:"spacer"}),i("button",{class:"btn btn-small",disabled:d<=1,onClick:()=>Wi({page:d-1}),children:a("Previous")}),i("span",{class:"num",children:a("Page {page} of {pages}",{page:K(d),pages:K(p)})}),i("button",{class:"btn btn-small",disabled:d>=p,onClick:()=>Wi({page:d+1}),children:a("Next")})]})}function Sr({value:d,placeholder:r,onSearch:o}){let[p,l]=R(d);return S(()=>l(d),[d]),i("form",{class:"search",role:"search",onSubmit:(v)=>{v.preventDefault(),o(p.trim())},children:[i(ii,{name:"search"}),i("input",{class:"input",type:"search",placeholder:r,"aria-label":r,value:p,onInput:(v)=>l(v.target.value)})]})}function Hi({tags:d}){return i(V,{children:d?.map((r)=>i("span",{class:"tag",children:r},r))})}function hi({name:d,wrapper:r}){return i("span",{class:"cls",children:[i(m,{href:`/metrics/jobs/${encodeURIComponent(d)}`,children:d}),r&&i("span",{class:"dim small",style:{fontWeight:400},children:[" ",a("via {name}",{name:r.split("::").pop()})]})]})}function Fd({value:d,indent:r}){let o=" ".repeat(r);if(d===null||typeof d==="boolean")return i("span",{class:"json-lit",children:String(d)});if(typeof d==="number")return i("span",{class:"json-num",children:d});if(typeof d==="string")return i("span",{class:"json-str",children:JSON.stringify(d)});if(Array.isArray(d)){let l=d;if(l.length===0)return"[]";return i(V,{children:[`[
|
|
1
|
+
import{a as G,b as N}from"./main-zz8zzhwn.js";var L,sd,Po,yi,md,dd,ir,ji,dr,Kd,Md,_o,Gi=Symbol.for("pv"),rd={},od=[],Go=/^m(i|n|o|s|text|space)$/,Yd=Array.isArray,Zd=od.slice,Mi=Object.assign;function mi(d){d&&d.parentNode&&d.remove()}function rr(d,r,o){var p,l,v,b={},n=arguments.length;for(v in r)v=="key"?p=r[v]:v=="ref"&&typeof d!="function"?l=r[v]:b[v]=r[v];return n>2&&(b.children=n>3?Zd.call(arguments,2):o),_i(d,b,p,l,null)}function _i(d,r,o,p,l){var v={type:d,props:r,key:o,ref:p,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Gi,__v:l||++sd,__i:-1,__u:0};return!l&&L.vnode&&L.vnode(v),v}function V(d){return d.children}function si(d,r){this.props=d,this.context=r,this.__g=0}function ci(d,r){if(r==null)return d.__&&ci(d.__,d.__i+1);for(var o;r<d.__k.length;r++)if((o=d.__k[r])&&o.__e)return o.__e;return typeof d.type!="function"||d.props.__P?null:ci(d)}function No(d){var r,o=d.__v,p=o.__e,l=[],v=[],b=d.__P;b&&((r=Mi({constructor:Gi},o)).__v=o.__v+1,L.vnode&&L.vnode(r),Wd(b,r,o,d.__n,b.namespaceURI,32&o.__u?[p]:null,l,p||ci(o),32&o.__u,v),r.__v=o.__v,r.__.__k[r.__i]=r,br(l,r,v),o.__=o.__e=null,r.__e!=p&&or(r))}function or(d){if((d=d.__)&&d.__c&&!d.props.__P)return d.__e=null,d.__k.some(function(r){return r&&(d.__e=r.__e)}),or(d)}function xd(d){(8&d.__g||(d.__g|=8,yi.push(d),dd++))&&md==L.debounceRendering||((md=L.debounceRendering)||queueMicrotask)(ar)}function ar(){try{for(var d,r=1;yi.length;)yi.length>r&&yi.sort(ir),d=yi.shift(),r=yi.length,8&d.__g&&No(d)}finally{(dd=yi.length)&&(md||queueMicrotask)(ar)}}function pr(d,r,o,p,l,v,b,n,z,y,h){var k,M,g,X,f,I,W=p.__k||od,J=r.length;for(z=Co(o,r,W,z,J),k=0;k<J;k++)(g=o.__k[k])!=null&&(M=~g.__i&&W[g.__i]||rd,g.__i=k,I=Wd(d,g,M,l,v,b,n,z,y,h),X=g.__e,(M.ref!=g.ref||8&M.__u)&&(M.ref&&Qd(M.ref,null,g,M),g.ref&&h.push(g.ref,g.__c||X,g)),f=f||X,4&g.__u?(z=lr(g,z,d,!M.__v),M.__e&&(M.__e=null)):typeof g.type=="function"&&I!==void 0?z=I:X&&(z=X.nextSibling),g.__u&=-21);return o.__e=f,z}function Co(d,r,o,p,l){var v,b,n,z,y,h,k,M,g,X=o.length,f=X,I=0,W=0,J=d.__k=Array(l);for(v=0;v<l;v++)(b=r[v])!=null&&typeof b!="boolean"&&typeof b!="function"?(typeof b!="object"||b.constructor===String?b=J[v]=_i(null,b):Yd(b)?b=J[v]=_i(V,{children:b}):b.constructor===Gi&&b.__b?b=J[v]=_i(b.type,b.props,b.key,b.ref,b.__v):J[v]=b,z=v+I,b.__=d,b.__b=d.__b+1,n=null,~(y=b.__i=qo(b,o,z,f))&&(f--,(n=o[y])&&(n.__u|=2)),n&&n.__v?(b.__u|=16,y==z-1?I--:y==z+1?I++:y!=z&&(y>z?I--:I++,W=1)):(~y||(l>X?I--:l<X&&I++),typeof b.type!="function"&&(b.__u|=4))):J[v]=null;if(W){for(h=[],k=[],v=0;v<l;v++)if((b=J[v])&&16&b.__u){for(I=0,M=h.length;I<M;)h[g=I+M>>1]<b.__i?I=g+1:M=g;h[I]=b.__i,k[v]=I+1}for(I=h.length;v--;)k[v]&&(k[v]==I?I--:J[v].__u|=4)}if(f)for(v=0;v<X;v++)!(n=o[v])||2&n.__u||(n.__e==p&&(p=ci(n)),Dd(n,n));return p}function lr(d,r,o,p){var l,v,b,n;if(typeof d.type=="function"){if(d.props.__P)return r;if(l=d.__k)for(v=0;v<l.length;v++)l[v]&&(l[v].__=d,r=lr(l[v],r,o,!1));return r}for(r&&!r.parentNode&&(r=ci(d))&&!r.parentNode&&(r=null),b=d.__e,n=r;n&&n.nodeType==8;)n=n.nextSibling;for(b!=n&&(!p&&o.moveBefore&&b.parentNode?o.moveBefore(b,r):o.insertBefore(b,r||null)),r=b;(r=r&&r.nextSibling)&&r.nodeType==8&&!r.data.startsWith("$s"););return r}function qo(d,r,o,p){var l,v=d.key,b=d.type,n=r[o],z=n&&!(2&n.__u);if(n===null&&v==null||z&&v==n.key&&b==n.type)return o;if(p>(z?1:0)){for(l=o-1;l>=0;l--)if((n=r[l])&&!(2&n.__u)&&v==n.key&&b==n.type)return l;for(l=o+1;l<r.length;l++)if((n=r[l])&&!(2&n.__u)&&v==n.key&&b==n.type)return l}return-1}function jd(d,r,o){o==null&&(o=""),r[0]=="-"?d.setProperty(r,o):d[r]=o}function xi(d,r,o,p,l){var v,b;if(r=="style")if(typeof o=="string")d.style.cssText=o;else{if(typeof p=="string"&&(d.style.cssText=p=""),p)for(r in p)o&&r in o||jd(d.style,r);if(o)for(r in o)p&&o[r]==p[r]||jd(d.style,r,o[r])}else if(r[0]=="o"&&r[1]=="n")typeof o!="function"&&(o=null),typeof p!="function"&&(p=null),(d.__e||(d.__e={}))[r]=o,o&&p||(b=Md[r]||(Md[r]=Fo(r)),(d.__a||(d.__a={}))[r]=Kd,v=r!=(r=r.replace(dr,"$1")),(r=r.slice(2))[0]<"a"&&(r=r.toLowerCase()),o?d.addEventListener(r,b,v):d.removeEventListener(r,b,v));else{if(l=="http://www.w3.org/2000/svg")r=r.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(r!="width"&&r!="height"&&r!="href"&&r!="list"&&r!="form"&&r!="tabIndex"&&r!="download"&&r!="rowSpan"&&r!="colSpan"&&r!="role"&&r!="popover"&&r in d)try{return void(d[r]=o==null?"":o)}catch(n){}if(typeof o=="function")return;o==null||o===!1&&r[4]!="-"?d.removeAttribute(r):d.setAttribute(r,r=="popover"&&o==1?"":o)}}function Fo(d){return function(r){var o=this.__e;if(o){if(o=o[d],r[ji]==null)r[ji]=Kd++;else if(r[ji]<this.__a[d])return;return o(L.event?L.event(r):r)}}}function Wd(d,r,o,p,l,v,b,n,z,y){var h,k,M,g,X,f,I,W,J,_,Y,u,pi,bi,H,ni,di,gi,ai=r.type;if(r.constructor!==Gi)return null;128&o.__u&&(z=32&o.__u,h=o.__c.__z)&&(r.__u|=z,k=v=[],h.nodeType==8?n=id(h,v):v.push(h),n=v[0]||n),(h=L.__b)&&h(r);i:if(typeof ai=="function"){M=b.length;try{if(W=r.props,J=(h=ai.prototype)&&h.render,_=(h=ai.contextType)&&p[h.__c],Y=h?_?_.props.value:h.__:p,(g=o.__c)?(r.__c=g,2&g.__g&&(g.__g|=1)):(J?r.__c=g=new ai(W,Y):(r.__c=g=new si(W,Y),g.constructor=ai,g.render=eo),_&&_.sub(g),g.state||(g.state={}),g.__n=p,g.__g|=8,g.__h=[],g.__k=[]),J&&(g.__s||(g.__s=g.state),ai.getDerivedStateFromProps&&(g.__s==g.state&&(g.__s=Mi({},g.__s)),Mi(g.__s,ai.getDerivedStateFromProps(W,g.__s)))),X=g.props,f=g.state,g.__v=r,o.__c){if(W!==X&&J&&!ai.getDerivedStateFromProps&&g.componentWillReceiveProps&&g.componentWillReceiveProps(W,Y),r.__v==o.__v&&!(8&g.__g)||!(4&g.__g)&&g.shouldComponentUpdate&&g.shouldComponentUpdate(W,g.__s,Y)===!1){r.__v!=o.__v&&(g.props=W,g.state=g.__s,g.__g&=-9),r.__e=o.__e,r.__k=o.__k,r.__k.some(function(s){s&&(s.__=r)}),od.push.apply(g.__h,g.__k),g.__k=[],g.__h.length&&b.push(g),n=ci(o);break i}g.componentWillUpdate&&g.componentWillUpdate(W,g.__s,Y),J&&g.componentDidUpdate&&g.__h.push(function(){g.componentDidUpdate(X,f,I)})}else J&&!ai.getDerivedStateFromProps&&g.componentWillMount&&g.componentWillMount(),J&&g.componentDidMount&&g.__h.push(g.componentDidMount);g.context=Y,g.props=W,g.__P=d,g.__g&=-5,u=L.__r,pi=J?25:0;do g.__g&=-9,u&&u(r),h=g.render(g.props,g.state=g.__s,g.context);while(8&g.__g&&++pi<25);J&&(od.push.apply(g.__h,g.__k),g.__k=[]),g.state=g.__s,g.getChildContext&&(p=Mi({},p,g.getChildContext())),J&&o.__c&&g.getSnapshotBeforeUpdate&&(I=g.getSnapshotBeforeUpdate(X,f)),bi=h&&h.type===V&&h.key==null?h.props.children:h,W.__P&&(h=n,l=(d=W.__P).namespaceURI,z=v=null,o.props&&o.props.__P!=d&&(o.__k.some(function(s){s&&Dd(s,s)}),o.__k=null),n=o.__k?ci(o,0):null),n=pr(d,Yd(bi)?bi:[bi],r,o,p,l,v,b,n,z,y),W.__P&&(r.__e=null,n=h),r.__u&=-161,k&&k.some(mi),g.__h.length&&b.push(g),1&g.__g&&(g.__g&=-4)}catch(s){if(b.length=M,r.__v=null,z||v)if(s&&s.then){if(r.__u|=128|z,v){for(~(di=v.indexOf(n||void 0))||(di=v.length);(gi=v[di-1])&&gi.nodeType==8;)di--;for(;di<v.length;di++)if(gi=v[di])if(v[di]=null,H){if(gi==ni)break}else{if(gi.nodeType!=8)break;gi.data.startsWith("$s")&&(ni=id(H=gi))}}if(!H){for(;n&&n.nodeType==8&&n.nextSibling;)n=n.nextSibling;H=n}(h=id(H=r.__c.__z||(r.__c.__z=H)))?(r.__e=H,n=h):r.__e=n,n=n&&n.nextSibling}else v&&v.some(mi);else r.__e=o.__e;r.__k||(r.__k=o.__k||[]),s&&s.then||vr(r),L.__e(s,r,o)}}else n=r.__e=So(o.__e,r,o,p,l,v,b,z,y,d);return(h=L.diffed)&&h(r),n}function id(d,r){if(d&&d.nodeType==8&&d.data.startsWith("$s"))for(var o=1;d=d.nextSibling;){if(d.nodeType==8){if(d.data.startsWith("$s"))o++;else if(d.data.startsWith("/$s")&&!--o)return d}r&&r.push(d)}}function vr(d){d&&(d.__c&&(d.__c.__g|=4),d.__k&&d.__k.some(vr))}function br(d,r,o){for(var p=0;p<o.length;)Qd(o[p++],o[p++],o[p++]);L.__c&&L.__c(r,d),d.some(function(l){try{d=l.__h,l.__h=[],d.some(function(v){v.call(l)})}catch(v){L.__e(v,l.__v)}})}function So(d,r,o,p,l,v,b,n,z,y){var h,k,M,g,X,f,I,W,J=o.props||rd,_=r.props,Y=r.type;if(Y=="svg"?l="http://www.w3.org/2000/svg":Y=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),v){for(h=0;h<v.length;h++)if((X=v[h])&&(Y?X.localName==Y:X.nodeType==3)){d=X,v[h]=null;break}}if(!d){if(W=y.ownerDocument||document,!Y)return W.createTextNode(_);d=W.createElementNS(l,Y,_.is?_:y),n&&(L.__m&&L.__m(r,v),n=!1),v=null}if(Y){if(y=Y=="template"&&d.content||d,v=Y=="textarea"&&_.defaultValue!=null?null:v&&Zd.call(y.childNodes),!n&&v)for(J={},h=0;h<d.attributes.length;h++)J[(X=d.attributes[h]).name]=X.value;for(h in J)X=J[h],h=="dangerouslySetInnerHTML"?M=X:h=="children"||(h in _)||h=="value"&&("defaultValue"in _)||h=="checked"&&("defaultChecked"in _)||xi(d,h,null,X,l);for(h in _)X=_[h],h=="children"?g=X:h=="dangerouslySetInnerHTML"?k=X:h=="value"?f=X:h=="checked"?I=X:n&&typeof X!="function"||J[h]===X||xi(d,h,X,J[h],l);k?(n||M&&(k.__html==M.__html||k.__html==d.innerHTML)||(d.innerHTML=k.__html),r.__k=[]):(M&&(d.textContent=""),(Y=="foreignObject"||l=="http://www.w3.org/1998/Math/MathML"&&Go.test(Y))&&(l="http://www.w3.org/1999/xhtml"),pr(y,Yd(g)?g:[g],r,o,p,l,v,b,v?v[0]:o.__k&&ci(o,0),n,z),v&&v.some(mi)),n&&Y!="textarea"||(h="value",Y=="progress"&&f==null?d.removeAttribute(h):f==null||f===d[h]&&(Y!="progress"||f)||xi(d,h,f,J[h],l),h="checked",I!=null&&I!=d[h]&&xi(d,h,I,J[h],l))}else J===_||n&&d.data==_||(d.data=_);return d}function Qd(d,r,o,p){try{typeof d=="function"?r?r.__x=d(r)||1:p&&(p=p.__c||p.__e)&&(r=p.__x)&&(p.__x=null,typeof r=="function"?r():d(null)):d.current=r}catch(l){L.__e(l,o)}}function Dd(d,r,o){var p,l,v,b;if(L.unmount&&L.unmount(d),!(p=d.ref)||p.current&&p.current!=d.__e||Qd(p,null,r,d),p=d.__c){if(p.componentWillUnmount)try{p.componentWillUnmount()}catch(n){L.__e(n,r)}p.__P=p.__n=null}if(p=d.__k)for(b=0;b<p.length;b++)p[b]&&Dd(p[b],r,typeof d.type!="function"||o&&!d.props.__P);!o&&(p=d.__c)&&(p=p.__z)&&(l=id(p,v=[]))&&(p==d.__e&&v.some(mi),mi(l),mi(p)),o||mi(d.__e),d.__e=d.__c=d.__=null}function eo(d,r,o){return this.constructor(d,o)}function nr(d,r){var o,p,l,v;L.__&&L.__(d,r),r.nodeType==9&&(r=r.documentElement),p=(o=d&&32&d.__u)?null:r.__k,r.__k=_i(V,{children:[d]}),l=[],v=[],Wd(r,r.__k,p||rd,rd,r.namespaceURI,p?null:r.firstChild?Zd.call(r.childNodes):null,l,p?p.__e:r.firstChild,o,v),br(l,r.__k,v),r.__k.props.children=null}L={__e:function(d,r,o,p){for(var l,v,b;r=r.__;)if((l=r.__c)&&!(1&l.__g)){l.__g|=4;try{if((b=(v=l.constructor)&&v.getDerivedStateFromError)&&l.setState(v.getDerivedStateFromError(d)),l.componentDidCatch&&(l.componentDidCatch(d,p||{}),b=1),b&&8&l.__g)return void(l.__g|=2)}catch(n){d=n}}throw dd=0,d}},sd=0,Po=function(d){return d!=null&&d.constructor===Gi},si.prototype.setState=function(d,r){var o=this.__s;o&&o!=this.state||(o=this.__s=Mi({},this.state)),typeof d=="function"&&(d=d(Mi({},o),this.props)),d&&(Mi(o,d),this.__v&&(r&&this.__k.push(r),xd(this)))},si.prototype.forceUpdate=function(d){this.__v&&(this.__g|=4,d&&this.__h.push(d),xd(this))},si.prototype.render=V,yi=[],dd=0,ir=function(d,r){return d.__v.__b-r.__v.__b},ji=Symbol(),dr=/(PointerCapture)$|Capture$/i,Kd=0,Md={},_o=0;var $i,F,Rd,hr,Od=Object.is,Ci=0,Xr=[],Ud=[],C=L,gr=C.__b,fr=C.__r,zr=C.diffed,yr=C.__c,cr=C.unmount,Vr=C.__;function ad(d,r){C.__h&&C.__h(F,d,Ci||r),Ci=0;var o=F.__H||(F.__H={__:[],__h:[]});return d>=o.__.length&&o.__.push({}),o.__[d]}function R(d){return Ci=1,uo(mr,d)}function uo(d,r,o){var p=ad($i++,2);if(p.t=d,!p.__c&&(p.__=[o?o(r):mr(void 0,r),function(v){var b=(p.__N||p.__)[0],n=p.t(b,v);Od(b,n)||(p.__N=[n,p.__[1]],p.__c.setState({}))}],p.__c=F,!F.__f)){F.__f=!0;var l=F.shouldComponentUpdate;F.shouldComponentUpdate=function(v,b,n){var z=this.__H;if(!z)return!0;var y=!1,h=this.props!=v;if(z.__.some(function(M){M.__N&&(y=!0,Od(M.__[0],M.__N[0])||(h=!0))}),l){var k=l.call(this,v,b,n);return y?k||h:k}return!y||h}}return p.__}function S(d,r){var o=ad($i++,3);!C.__s&&Bd(o.__H,r)&&(o.__P=!0,o.__=d,o.u=r,F.__H.__h.push(o))}function Hr(d,r){var o=ad($i++,4);!C.__s&&Bd(o.__H,r)&&(o.__P=!1,o.__=d,o.u=r,F.__h.push(o))}function Vi(d){return Ci=5,Ir(function(){return{current:d}},[])}function Ir(d,r){var o=ad($i++,7);return Bd(o.__H,r)&&(o.__=d(),o.__H=r),o.__}function Jr(d,r){return Ci=8,Ir(function(){return d},r)}function to(){var d;do{for(;d=Ud.shift();)try{Ni(d)}catch(o){C.__e(o,{__:(d=d.__P)&&d.__v})}for(;d=Xr.shift();){var r=d.__H;if(d.__P&&r)try{r.__h.some(Ni),r.__h.some($d),r.__h=[]}catch(o){r.__h=[],C.__e(o,d.__v)}}}while(Ud.length)}C.__b=function(d){F=null,gr&&gr(d)},C.__=function(d,r){d&&r.__k&&r.__k.__m&&(d.__m=r.__k.__m),Vr&&Vr(d,r)},C.__r=function(d){fr&&fr(d),$i=0;var r=(F=d.__c).__H;r&&(Rd==F?F.__h=[]:(r.__h.some(Ni),r.__h.some($d),$i=0),r.__h=[],r.__.some(function(o){o.__N&&(o.__=o.__N),o.u=o.__N=void 0})),Rd=F},C.diffed=function(d){zr&&zr(d);var r=d.__c;r&&r.__H&&(r.__H.__h.length&&wr(Xr.push(r)),r.__H.__.some(function(o){o.u&&(o.__H=o.u)})),Rd=F=null},C.__c=function(d,r){r.some(function(o){try{o.__h.some(Ni),o.__h=o.__h.filter(function(p){return!p.__||$d(p)})}catch(p){o.__h=[function(){throw p}]}}),yr&&yr(d,r)},C.unmount=function(d){cr&&cr(d);var r,o,p=d.__c;p&&p.__H&&(p.__H.__.some(function(l){try{if(l.__P&&l.__c){if(o===void 0){for(o=d.__;o&&(!o.__c||!o.__c.__P);)o=o.__;o=o&&o.__c}l.__P=o,wr(Ud.push(l))}else Ni(l)}catch(v){r=v}}),p.__H=void 0,r&&C.__e(r,p.__v))};var kr=typeof requestAnimationFrame=="function";function xo(d){var r,o=function(){clearTimeout(p),kr&&cancelAnimationFrame(r),setTimeout(d)},p=setTimeout(o,35);kr&&(r=requestAnimationFrame(o))}function wr(d){d!=1&&hr==C.requestAnimationFrame||((hr=C.requestAnimationFrame)||xo)(to)}function Ni(d){var r=F,o=d.__c;typeof o=="function"&&(d.__c=void 0,o()),F=r}function $d(d){var r=F;d.__c=d.__(),F=r}function Bd(d,r){return!d||d.length!=r.length||r.some(function(o,p){return!Od(o,d[p])})}function mr(d,r){return typeof r=="function"?r(d):r}function x(d){let r=d,o=new Set;return{get:()=>r,set(p){r=p,o.forEach((l)=>l())},update(p){this.set(p(r))},subscribe(p){return o.add(p),()=>{o.delete(p)}}}}function P(d){let[,r]=R({});return S(()=>d.subscribe(()=>{r({})}),[d]),d.get()}var Bi={ar:{name:"العربية",rtl:!0,load:()=>import("./ar-y7v9b75f.js")},cs:{name:"Čeština",load:()=>import("./cs-df88mq5e.js")},da:{name:"Dansk",load:()=>import("./da-kemms74g.js")},de:{name:"Deutsch",load:()=>import("./de-z8kkqg65.js")},en:{name:"English"},es:{name:"Español",load:()=>import("./es-9ahrrn1s.js")},fa:{name:"فارسی",rtl:!0,load:()=>import("./fa-7r0x28nc.js")},fr:{name:"Français",load:()=>import("./fr-r7mqf3d9.js")},he:{name:"עברית",rtl:!0,load:()=>import("./he-7t46b6rt.js")},hi:{name:"हिन्दी",load:()=>import("./hi-zj434tx4.js")},it:{name:"Italiano",load:()=>import("./it-pqc2m7gm.js")},ja:{name:"日本語",load:()=>import("./ja-k9rgm1pj.js")},ko:{name:"한국어",load:()=>import("./ko-bxersv91.js")},nb:{name:"Norsk bokmål",load:()=>import("./nb-fjnc5064.js")},nl:{name:"Nederlands",load:()=>import("./nl-9p8b95b6.js")},pl:{name:"Polski",load:()=>import("./pl-8xsrdn8n.js")},"pt-BR":{name:"Português (Brasil)",load:()=>import("./pt-BR-650j7cvg.js")},ru:{name:"Русский",load:()=>import("./ru-a9ftyw3d.js")},sv:{name:"Svenska",load:()=>import("./sv-j9gqamr1.js")},tr:{name:"Türkçe",load:()=>import("./tr-y9z0q51g.js")},uk:{name:"Українська",load:()=>import("./uk-2dr9ew3p.js")},ur:{name:"اردو",rtl:!0,load:()=>import("./ur-h25nzq1s.js")},vi:{name:"Tiếng Việt",load:()=>import("./vi-9y2ff1bd.js")},"zh-CN":{name:"简体中文",load:()=>import("./zh-CN-tbj9mf98.js")},"zh-TW":{name:"繁體中文",load:()=>import("./zh-TW-59q8j9vw.js")}},ki=x({code:"en",catalogue:{}}),Mr="robin.locale",e=()=>ki.get().code,pd=(d,r)=>d.replace(/\{(\w+)\}/g,(o,p)=>(p in r)?String(r[p]):o),c=(d)=>d;function a(d,r={}){let o=ki.get().catalogue[d];return pd(typeof o==="string"?o:d,r)}function Kr(d,r,o){let p=ki.get().catalogue[`${d}|${r}`];if(typeof p!=="object")return o===1?d:r;return p[new Intl.PluralRules(e()).select(o)]??p.other}var Yr=(d)=>new Intl.NumberFormat(e()).format(d);function Q(d,r,o,p={}){return pd(Kr(d,r,o),{n:Yr(o),...p})}function Zr(d,r){let p=d.split(/\{(\w+)\}/).map((l,v)=>v%2?l in r?r[l]:`{${l}}`:l);return rr(V,null,...p.filter((l)=>l!==""))}var q=(d,r)=>Zr(a(d),r),Ki=(d,r,o,p)=>Zr(Kr(d,r,o),{n:Yr(o),...p});function Wr(d=localStorage.getItem(Mr),r=navigator.languages){if(d&&Object.hasOwn(Bi,d))return d;let o=Object.keys(Bi);for(let p of r){let[l,...v]=p.toLowerCase().split("-");if(l==="zh")return jo(v);let b=o.find((n)=>n.split("-")[0]===l);if(b)return b}return"en"}function jo(d){if(d.includes("hans"))return"zh-CN";if(d.includes("hant"))return"zh-TW";return["tw","hk","mo"].some((r)=>d.includes(r))?"zh-TW":"zh-CN"}async function ld(d,r=!0){let o=Object.hasOwn(Bi,d)?d:"en",p=Bi[o],l=p.load?(await p.load()).default:{};if(r)localStorage.setItem(Mr,o);document.documentElement.lang=o,document.documentElement.dir=p.rtl?"rtl":"ltr",ki.set({code:o,catalogue:l})}class Ed extends Error{status;constructor(d,r){super(r);this.status=d}}var qi=x(localStorage.getItem("robin.cluster")??"");function Qr(d){localStorage.setItem("robin.cluster",d),qi.set(d)}function Ei(d,r={}){let o=new URLSearchParams;for(let[v,b]of Object.entries(r))if(b!==void 0&&b!=="")o.set(v,String(b));let p=qi.get();if(p)o.set("cluster",p);let l=o.toString();return`api/${d}${l?`?${l}`:""}`}async function Dr(d){let r=await d.text(),o;try{o=r?JSON.parse(r):{}}catch{throw new Ed(d.status,a("The server sent an unexpected response ({status}).",{status:d.status}))}if(!d.ok)throw new Ed(d.status,o.error??a("Request failed ({status}).",{status:d.status}));return o}async function Ti(d,r){let o=await fetch(Ei(d,r),{headers:{accept:"application/json"},credentials:"same-origin"});return Dr(o)}async function Td(d,r,o,p){let l=await fetch(Ei(r,p),{method:d,credentials:"same-origin",headers:{"content-type":"application/json",accept:"application/json","x-robin-request":"1"},body:JSON.stringify(o)});return Dr(l)}var w=encodeURIComponent;var Rr=new Map;function Ld(d={}){let r=`${e()} ${JSON.stringify(d)}`,o=Rr.get(r);if(!o)Rr.set(r,o=new Intl.NumberFormat(e(),d));return o}var t=(d,r)=>Ld({minimumFractionDigits:r,maximumFractionDigits:r,useGrouping:!1}).format(d);function K(d,r=!1){if(d==null||Number.isNaN(d))return"–";if(r&&Math.abs(d)>=1e4)return Ld({notation:"compact",maximumFractionDigits:1}).format(d);return Ld().format(Math.round(d))}function li(d){if(d==null||Number.isNaN(d))return"–";let r=Math.max(0,d);if(r<1)return a("{n} ms",{n:Math.round(r*1000)});if(r<60)return a("{n} s",{n:r<10?t(r,1):Math.round(r)});let o=Math.floor(r/60);if(o<60)return a("{m} m {s} s",{m:o,s:Math.round(r%60)});let p=Math.floor(o/60);if(p<24)return a("{h} h {m} m",{h:p,m:o%60});let l=Math.floor(p/24);return a("{d} d {h} h",{d:K(l),h:p%24})}function Yi(d){if(d==null||Number.isNaN(d))return"–";if(d<1)return a("{n} ms",{n:t(d,2)});return li(d/1000)}var so=[["second",1,60],["minute",60,3600],["hour",3600,86400],["day",86400,2592000],["month",2592000,31536000],["year",31536000,1/0]];function Or(d){return d<100000000000?d*1000:d}function Ur(d,r=Date.now()){if(!d)return"–";let o=(d-r)/1000,p=Math.abs(o);if(p<5)return a("just now");let[l,v]=so.find(([,,b])=>p<b);return new Intl.RelativeTimeFormat(e(),{numeric:"auto"}).format(Math.round(o/v),l)}function $r(d){if(!d)return"";let r=new Date(d),o=(p)=>String(p).padStart(2,"0");return`${r.getFullYear()}-${o(r.getMonth()+1)}-${o(r.getDate())} ${o(r.getHours())}:${o(r.getMinutes())}:${o(r.getSeconds())}`}function Br(d){if(!d)return"–";if(d<1024)return a("{n} KB",{n:d});if(d<1048576)return a("{n} MB",{n:t(d/1024,d<10240?1:0)});return a("{n} GB",{n:t(d/1024/1024,1)})}function Zi(d){let r=+d.slice(0,4),o=+d.slice(4,6)-1,p=+d.slice(6,8),l=+d.slice(8,10),v=+d.slice(10,12);return Date.UTC(r,o,p,l,v)}function fi(d,r=120){let o=d.map((p)=>JSON.stringify(p)).join(", ");return o.length>r?`${o.slice(0,r-1)}…`:o}function Li(d,r){return r>0?Math.min(100,Math.max(0,d/r*100)):0}function wi(d){let r=d.split(":");return{host:r.slice(0,-2).join(":")||d,pid:r[r.length-2]??""}}function Ad(d,r=4){if(d<=0)return[0];let o=d/r,p=10**Math.floor(Math.log10(o)),l=[1,2,2.5,5,10].map((b)=>b*p).find((b)=>b>=o),v=Math.ceil(d/l-0.000000001);return Array.from({length:v+1},(b,n)=>Math.round(n*l*1e6)/1e6)}var Pd=new URL(document.baseURI).pathname.replace(/\/$/,"");function vd(){let d=location.pathname;return{path:d.startsWith(`${Pd}/`)?d.slice(Pd.length):"/",query:new URLSearchParams(location.search)}}var _d=x(vd());window.addEventListener("popstate",()=>_d.set(vd()));function Gd(d){return`${Pd}${d}`}function j(d,{replace:r=!1}={}){let o=Gd(d);if(history[r?"replaceState":"pushState"](null,"",o),_d.set(vd()),!r)window.scrollTo({top:0})}function Wi(d){let{path:r,query:o}=vd();for(let[l,v]of Object.entries(d))if(v===void 0||v===""||v===1&&l==="page")o.delete(l);else o.set(l,String(v));let p=o.toString();j(`${r}${p?`?${p}`:""}`,{replace:!0})}function ri(){return P(_d)}var Er=(d)=>d.replace(/\/$/,"").split("/");function Nd(d,r){let o=Er(d),p=Er(r);if(o.length!==p.length)return null;let l={};for(let[v,b]of o.entries()){let n=p[v];if(b.startsWith(":"))l[b.slice(1)]=decodeURIComponent(n);else if(b!==n)return null}return l}var vi=x(null);async function qd(){vi.set(await Ti("session"))}function Z(d){return vi.get()?.permissions[d]===!0}var Xi=x(null),Lr=x([]),Fi=x(localStorage.getItem("robin.paused")==="1"),Ai=x("live"),Tr=3,Cd=null,Ar,bd=0;function Pr(d){Xi.set(d),Lr.update((r)=>[...r.slice(-89),{at:d.at,processed:d.stats.processed,failed:d.stats.failed}])}function i1(){Cd?.close(),Cd=null,clearInterval(Ar)}function d1(){let d=vi.get();Ai.set(d.live_updates==="stream"?"polling":"live");let r=()=>{Ti("stats").then(Pr,()=>Ai.set("offline"))};r(),Ar=setInterval(r,Math.max(1,d.stream_interval)*1000)}function Si(){if(i1(),Fi.get())return;if(vi.get().live_updates!=="stream"||bd>=Tr){d1();return}let d=new EventSource(Ei("stream"));Cd=d,d.addEventListener("stats",(r)=>{bd=0,Ai.set("live"),Pr(JSON.parse(r.data))}),d.onerror=()=>{if(bd+=1,bd>=Tr)Si()}}function _r(d){localStorage.setItem("robin.paused",d?"1":"0"),Fi.set(d),Si()}qi.subscribe(()=>{Lr.set([]),Xi.set(null),qd().then(Si,()=>Ai.set("offline"))});var hd=x(localStorage.getItem("robin.theme")??"system"),Gr=matchMedia("(prefers-color-scheme: dark)");function gd(){let d=hd.get(),r=d==="dark"||d==="system"&&Gr.matches;document.documentElement.dataset.theme=r?"dark":"light"}function Nr(d){localStorage.setItem("robin.theme",d),hd.set(d),gd()}Gr.addEventListener("change",gd);var nd=x([]),r1=0;function zi(d,r="ok"){let o=++r1;nd.update((p)=>[...p.slice(-3),{id:o,message:d,kind:r}]),setTimeout(()=>{nd.update((p)=>p.filter((l)=>l.id!==o))},r==="error"?7000:3500)}var fd=x(null);function Cr(d){return new Promise((r)=>{fd.set({...d,resolve:r})})}function E(d,r={},o=0){let p=P(qi),l=P(Fi),[v,b]=R({data:null,error:null}),n=JSON.stringify(r),z=`${d}?${n}@${p}`,y=Vi(z);y.current=z;let h=Jr(()=>{Ti(d,JSON.parse(n)).then((k)=>{if(y.current===z)b({data:k,error:null})},(k)=>{if(y.current===z)b((M)=>({data:M.data,error:k.message}))})},[d,n,z]);return S(h,[h]),S(()=>{if(!o||l)return;let k=setInterval(()=>{if(document.visibilityState==="visible")h()},o*1000);return()=>{clearInterval(k)}},[h,o,l]),{...v,reload:h}}var o1=Symbol.for("pv"),a1=0;function i(d,r,o,p,l,v){r||(r={});var b,n,z=r;if("ref"in z&&typeof d!="function")for(n in z={},r)n=="ref"?b=r[n]:z[n]=r[n];var y={type:d,props:z,key:o,ref:b,__k:null,__:null,__b:0,__e:null,__c:null,constructor:o1,__v:--a1,__i:-1,__u:0};return(l||v)&&(y.__source=l,y.__self=v),L.vnode&&L.vnode(y),y}var p1={dashboard:"M3 11 L10 4 L17 11 M5 9.5 V16 H15 V9.5",busy:"M3 10 H6 L8 5 L12 15 L14 10 H17",queues:"M4 5 H16 M4 10 H16 M4 15 H11",scheduled:"M10 4 A6 6 0 1 0 10.01 4 M10 6.5 V10 L12.5 11.5",retries:"M4.5 9 A5.5 5.5 0 0 1 15 7 M15 3.5 V7 H11.5 M15.5 11 A5.5 5.5 0 0 1 5 13 M5 16.5 V13 H8.5",dead:"M5 5 L15 15 M15 5 L5 15",metrics:"M4 16 V9 M8 16 V5 M12 16 V11 M16 16 V7",batches:"M4 6 L10 3 L16 6 L10 9 Z M4 10 L10 13 L16 10 M4 14 L10 17 L16 14",limiters:"M3.5 13 A6.5 6.5 0 0 1 16.5 13 M10 13 L13.5 8.5",cron:"M4 6 H16 V16 H4 Z M4 9 H16 M7 4 V7 M13 4 V7 M8 12.5 L9.5 14 L12.5 11",settings:"M10 7.5 A2.5 2.5 0 1 0 10.01 7.5 M10 2.8 V5 M10 15 V17.2 M2.8 10 H5 M15 10 H17.2 M4.9 4.9 L6.5 6.5 M13.5 13.5 L15.1 15.1 M4.9 15.1 L6.5 13.5 M13.5 6.5 L15.1 4.9",search:"M8.5 4 A4.5 4.5 0 1 0 8.51 4 M12 12 L16 16",sun:"M10 7 A3 3 0 1 0 10.01 7 M10 2.5 V4 M10 16 V17.5 M2.5 10 H4 M16 10 H17.5 M4.7 4.7 L5.8 5.8 M14.2 14.2 L15.3 15.3 M4.7 15.3 L5.8 14.2 M14.2 5.8 L15.3 4.7",moon:"M15.5 12.5 A6 6 0 0 1 7.5 4.5 A6 6 0 1 0 15.5 12.5 Z",check:"M4 10.5 L8 14.5 L16 5.5",alert:"M10 3 L18 16.5 H2 Z M10 8 V11.5 M10 13.8 V14",menu:"M3 6 H17 M3 10 H17 M3 14 H17",gem:"M6 4 H14 L17 8 L10 16 L3 8 Z M3 8 H17 M8 4 L10 8 L12 4 M10 8 V16",profiles:"M3 16 H17 M4 13 H16 M5 10 H11 M6 7 H9 M12 10 H15 M7 4 H8",extension:"M4 4 H9 V7 A1.5 1.5 0 0 0 9 10 V16 H4 Z M11 4 H16 V9 H13 A1.5 1.5 0 0 0 11 9 Z M11 11 H16 V16 H11 Z",download:"M10 3 V12 M6 8.5 L10 12.5 L14 8.5 M4 16 H16"};function ii({name:d,title:r,...o}){return i("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"miter","aria-hidden":r?void 0:"true",role:r?"img":void 0,...o,children:[r&&i("title",{children:r}),i("path",{d:p1[d]})]})}function m({href:d,children:r,onClick:o,...p}){return i("a",{href:Gd(d),...p,onClick:(l)=>{if(o?.(l),l.defaultPrevented||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey)return;l.preventDefault(),j(d)},children:r})}var Qi=document.querySelector('meta[name="robin-logo"]')?.content??"",qr=document.querySelector('meta[name="robin-wordmark"]')?.content??"",Fr=[{items:[{href:"/",label:c("Dashboard"),icon:"dashboard"},{href:"/busy",label:c("Busy"),icon:"busy",count:(d)=>d.busy},{href:"/queues",label:c("Queues"),icon:"queues",count:(d)=>d.enqueued},{href:"/scheduled",label:c("Scheduled"),icon:"scheduled",count:(d)=>d.scheduled},{href:"/retries",label:c("Retries"),icon:"retries",count:(d)=>d.retries,alert:!0},{href:"/dead",label:c("Dead"),icon:"dead",count:(d)=>d.dead}]},{group:c("Insight"),items:[{href:"/metrics",label:c("Metrics"),icon:"metrics"},{href:"/batches",label:c("Batches"),icon:"batches"},{href:"/limiters",label:c("Rate limits"),icon:"limiters"},{href:"/cron",label:c("Cron"),icon:"cron"},{href:"/profiles",label:c("Profiles"),icon:"profiles"}]}],ei=(d)=>d.titles?.[e()]??d.title;function l1(d=[]){if(d.length===0)return Fr;let r=d.map((o)=>({href:`/ext/${encodeURIComponent(o.slug)}`,label:ei(o),icon:"extension"}));return[...Fr,{group:c("Extensions"),items:r}]}function v1(d,r){return r===d||r.startsWith(`${d}/`)||r.startsWith(`/sets${d}/`)}function b1({onNavigate:d}){let{path:r}=ri(),o=P(Xi),p=P(vi),l=o?.stats,v=p?.title??"Robin";return i("aside",{class:"side","aria-label":a("Main navigation"),children:[i(m,{href:"/",class:"brand",onClick:d,children:[Qi&&i("img",{src:Qi,alt:""}),i("span",{class:"brand-name",children:[qr&&v==="Robin"?i("img",{class:"brand-wordmark",src:qr,alt:"Robin"}):v,i("span",{class:"brand-version",children:["v",p?.version]})]})]}),i("nav",{class:"nav",children:l1(p?.extensions).map((b)=>i(V,{children:[b.group&&i("div",{class:"nav-group",children:a(b.group)}),b.items.map((n)=>{let z=l&&n.count?.(l);return i(m,{href:n.href,"aria-current":v1(n.href,r)?"page":void 0,onClick:d,children:[i(ii,{name:n.icon}),n.icon==="extension"?n.label:a(n.label),z!==void 0&&i("span",{class:`count${n.alert&&z>0?" alert":""}`,children:K(z,!0)})]},n.href)})]}))}),i("div",{class:"side-foot",children:i(m,{href:"/settings",class:"row",onClick:d,"aria-current":r==="/settings"?"page":void 0,children:[i(ii,{name:"settings",width:15,height:15})," ",a("Settings & about")]})})]})}function n1(){let d=P(Ai),r=P(Fi),o=r?a("Paused"):d==="live"?a("Live"):d==="polling"?a("Polling"):a("Offline");return i("button",{class:"live","data-state":r?"paused":d,"aria-pressed":!r,title:r?a("Resume live updates"):a("Pause live updates"),onClick:()=>_r(!r),children:[i("span",{class:"dot"}),o]})}var h1={light:c("Light theme"),system:c("System theme"),dark:c("Dark theme")};function g1(){let d=P(hd);return i("div",{class:"seg",role:"group","aria-label":a("Color theme"),children:["light","system","dark"].map((r)=>i("button",{"aria-pressed":d===r,onClick:()=>Nr(r),title:a(h1[r]),children:r==="light"?i(ii,{name:"sun",width:15,height:15,title:a("Light")}):r==="dark"?i(ii,{name:"moon",width:15,height:15,title:a("Dark")}):a("Auto")},r))})}function f1(){let[d,r]=R("");return i("form",{class:"search",role:"search",onSubmit:(o)=>{o.preventDefault();let p=d.trim();if(p)j(`/jobs/${encodeURIComponent(p)}`);r("")},children:[i(ii,{name:"search"}),i("input",{class:"input",placeholder:a("Find a job by ID"),"aria-label":a("Find a job by ID"),value:d,onInput:(o)=>r(o.target.value)})]})}function z1(){let d=P(vi);if(!d||d.clusters.length<2)return null;return i("label",{class:"row small",children:[i("span",{class:"dim",children:a("Cluster")}),i("select",{class:"select",value:d.cluster,onChange:(r)=>Qr(r.target.value),children:d.clusters.map((r)=>i("option",{value:r,children:r},r))})]})}function Sr({children:d}){let{path:r}=ri(),[o,p]=R(null),l=o===r,v=()=>p(null);return S(()=>{let b=(n)=>{if(n.key==="/"&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement))n.preventDefault(),document.querySelector(".topbar .search input")?.focus();if(n.key==="Escape")v()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]),i("div",{class:`shell${l?" nav-open":""}`,children:[i(b1,{onNavigate:v}),i("main",{class:"main",id:"main",children:[i("div",{class:"mobile-bar",children:[i("button",{class:"btn btn-ghost","aria-label":a("Open navigation"),onClick:()=>p(r),children:i(ii,{name:"menu"})}),Qi&&i("img",{src:Qi,alt:""}),i("strong",{children:"Robin"})]}),i("div",{class:"content",children:[i("div",{class:"topbar",children:[i(f1,{}),i("span",{class:"spacer"}),i(z1,{}),i(n1,{}),i(g1,{})]}),d]})]})]})}function y1(d=15){let[r,o]=R(Date.now());return S(()=>{let p=setInterval(()=>o(Date.now()),d*1000);return()=>clearInterval(p)},[d]),r}function T({at:d}){let r=y1();if(!d)return i("span",{class:"dim",children:"–"});let o=Or(d);return i("time",{dateTime:new Date(o).toISOString(),title:$r(o),children:Ur(o,r)})}function oi({jid:d}){if(!d)return i("span",{class:"dim",children:"–"});let r=()=>{let o=navigator.clipboard;if(!o){zi(a("Copying needs HTTPS"),"error");return}o.writeText(d).then(()=>zi(a("Copied {jid}",{jid:d})),()=>zi(a("Couldn't copy to the clipboard"),"error"))};return i("button",{type:"button",class:"jid",title:a("Copy job ID"),onClick:r,children:d})}function ui({seconds:d}){if(d>=300)return i("span",{class:"lat-bad",title:a("Jobs are waiting more than 5 minutes"),children:a("{time} behind",{time:li(d)})});if(d>=30)return i("span",{class:"lat-warn",title:a("Jobs are waiting more than 30 seconds"),children:a("{time} slow",{time:li(d)})});return i("span",{class:"lat-ok",children:li(d)})}function $({title:d,children:r,icon:o="gem"}){return i("div",{class:"empty",children:[i(ii,{name:o}),i("h3",{children:d}),r&&i("p",{children:r})]})}function O({message:d,onRetry:r}){return i("div",{class:"problem row",role:"alert",children:[i(ii,{name:"alert",width:18,height:18}),i("span",{children:d}),r&&i("button",{class:"btn btn-small right",onClick:r,children:a("Try again")})]})}function U({rows:d=5}){return i("div",{class:"panel-pad stack","aria-busy":"true","aria-label":a("Loading"),children:Array.from({length:d},(r,o)=>i("div",{class:"skeleton",style:{width:`${90-o*9}%`}},o))})}function zd({page:d,perPage:r,total:o}){let p=Math.max(1,Math.ceil(o/r));if(o<=r&&d===1)return null;let l=o===0?0:(d-1)*r+1,v=Math.min(o,d*r);return i("nav",{class:"pager","aria-label":a("Pagination"),children:[i("span",{class:"num",children:a("{from}–{to} of {total}",{from:K(l),to:K(v),total:K(o)})}),i("span",{class:"spacer"}),i("button",{class:"btn btn-small",disabled:d<=1,onClick:()=>Wi({page:d-1}),children:a("Previous")}),i("span",{class:"num",children:a("Page {page} of {pages}",{page:K(d),pages:K(p)})}),i("button",{class:"btn btn-small",disabled:d>=p,onClick:()=>Wi({page:d+1}),children:a("Next")})]})}function er({value:d,placeholder:r,onSearch:o}){let[p,l]=R(d);return S(()=>l(d),[d]),i("form",{class:"search",role:"search",onSubmit:(v)=>{v.preventDefault(),o(p.trim())},children:[i(ii,{name:"search"}),i("input",{class:"input",type:"search",placeholder:r,"aria-label":r,value:p,onInput:(v)=>l(v.target.value)})]})}function Hi({tags:d}){return i(V,{children:d?.map((r)=>i("span",{class:"tag",children:r},r))})}function hi({name:d,wrapper:r}){return i("span",{class:"cls",children:[i(m,{href:`/metrics/jobs/${encodeURIComponent(d)}`,children:d}),r&&i("span",{class:"dim small",style:{fontWeight:400},children:[" ",a("via {name}",{name:r.split("::").pop()})]})]})}function Fd({value:d,indent:r}){let o=" ".repeat(r);if(d===null||typeof d==="boolean")return i("span",{class:"json-lit",children:String(d)});if(typeof d==="number")return i("span",{class:"json-num",children:d});if(typeof d==="string")return i("span",{class:"json-str",children:JSON.stringify(d)});if(Array.isArray(d)){let l=d;if(l.length===0)return"[]";return i(V,{children:[`[
|
|
2
2
|
`,l.map((v,b)=>i(V,{children:[o," ",i(Fd,{value:v,indent:r+1}),b<l.length-1?`,
|
|
3
3
|
`:`
|
|
4
4
|
`]})),o,"]"]})}let p=Object.entries(d);if(p.length===0)return"{}";return i(V,{children:[`{
|
|
5
5
|
`,p.map(([l,v],b)=>i(V,{children:[o," ",i("span",{class:"json-key",children:JSON.stringify(l)}),": ",i(Fd,{value:v,indent:r+1}),b<p.length-1?`,
|
|
6
6
|
`:`
|
|
7
|
-
`]})),o,"}"]})}function yd({value:d}){return i("pre",{class:"code",children:i(Fd,{value:d,indent:0})})}function er({lines:d}){return i("pre",{class:"code",children:d.map((r)=>i("div",{class:/\/(gems|ruby|rubygems)\//.test(r)?"bt-lib":"bt-app",children:r}))})}function ur(){let d=P(nd);return i("div",{class:"toasts",role:"status","aria-live":"polite",children:d.map((r)=>i("div",{class:`toast ${r.kind}`,children:[i(ii,{name:r.kind==="error"?"alert":"check"}),r.message]},r.id))})}function tr(){let d=P(fd),r=Vi(null);S(()=>{let p=r.current;if(d&&!p.open)p.showModal();if(!d&&p.open)p.close()},[d]);let o=(p)=>{d?.resolve(p),fd.set(null)};return i("dialog",{class:"confirm",ref:r,onCancel:(p)=>{p.preventDefault(),o(!1)},"aria-labelledby":"confirm-title",children:d&&i("form",{method:"dialog",onSubmit:(p)=>{p.preventDefault(),o(!0)},children:[i("h3",{id:"confirm-title",children:d.title}),d.body&&i("p",{children:d.body}),i("div",{class:"btn-group",children:[i("button",{type:"button",class:"btn",onClick:()=>o(!1),autofocus:!!d.danger,children:a("Cancel")}),i("button",{type:"submit",class:d.danger?"btn btn-danger solid":"btn btn-primary",autofocus:!d.danger,children:d.action})]})]})})}function io(){let d=Vi(null),[r,o]=R(0);return Hr(()=>{let p=d.current;o(p.clientWidth);let l=new ResizeObserver(([v])=>{o(Math.round(v.contentRect.width))});return l.observe(p),()=>{l.disconnect()}},[]),[d,r]}var y1=c("Succeeded"),c1=c("Failed");function Di(){return[{label:a(y1),cls:"s-processed"},{label:a(c1),cls:"s-failed"}]}function Pi(d,r){let[o,p]=Di();return[{...o,values:d,area:!0},{...p,values:r}]}var D={top:12,right:16,bottom:26,left:44};function xr(d,r,o){return d.map((p,l)=>`${l?"L":"M"}${r(l).toFixed(1)},${o(p).toFixed(1)}`).join("")}var V1={"s-processed":"processed","s-failed":"failed"};function ro({s:d}){return i("i",{class:`swatch ${d.cls?V1[d.cls]:""}`,style:d.color?{background:`var(${d.color})`}:void 0})}function Ri({series:d}){if(d.length<2)return null;return i("div",{class:"legend","aria-hidden":"true",children:d.map((r)=>i("span",{children:[i(ro,{s:r}),r.label]},r.label))})}function oo({left:d,title:r,series:o,at:p,format:l,marks:v=[]}){return i("div",{class:"tooltip",style:{left:`${d}px`,top:`${D.top}px`},children:[i("div",{class:"tt-title",children:r}),o.map((b)=>i("div",{class:"tt-row",children:[i(ro,{s:b}),i("span",{children:b.label}),i("span",{children:l(b.values[p]??0)})]},b.label)),v.map((b)=>i("div",{class:"tt-row tt-mark",children:[i("i",{class:"swatch mark"}),i("span",{children:ao(b)})]},b.at))]})}var ao=(d)=>d.label?a("Deploy: {label}",{label:d.label}):a("Deploy"),jr=(d,r,o)=>d.filter((p)=>p.at>=r&&p.at<o);function Oi({xs:d,series:r,height:o=220,xLabel:p,yFormat:l=(n)=>K(n,!0),label:v,marks:b=[]}){let[n,z]=io(),[y,h]=R(null),k=d.length,M=Math.max(1,...r.flatMap((H)=>H.values)),g=Ad(M),X=g[g.length-1],f=Math.max(0,z-D.left-D.right),I=o-D.top-D.bottom,W=(H)=>D.left+(k<=1?f/2:H/(k-1)*f),J=(H)=>D.top+I-H/X*I,_=Math.max(1,Math.ceil(k/Math.max(2,Math.floor(f/90)))),Y=d[1]-d[0],u=jr(b,d[0],d[k-1]+Y),pi=(H)=>D.left+Math.min(1,(H-d[0])/(d[k-1]-d[0]))*f,bi=(H)=>{if(k===0)return;let ni=H.currentTarget.getBoundingClientRect(),di=H.clientX-ni.left-D.left;h(Math.max(0,Math.min(k-1,Math.round(di/f*(k-1)))))};return i("div",{class:"chart",ref:n,children:[z>0&&i("svg",{width:z,height:o,role:"img","aria-label":v,onMouseMove:bi,onMouseLeave:()=>h(null),children:[i("g",{class:"grid",children:g.map((H)=>i("line",{x1:D.left,x2:D.left+f,y1:J(H),y2:J(H)},H))}),i("g",{class:"axis",children:[g.map((H)=>i("text",{x:D.left-8,y:J(H)+4,"text-anchor":"end",children:l(H)},H)),d.map((H,ni)=>ni%_===0?i("text",{x:W(ni),y:o-6,"text-anchor":ni===0?"start":"middle",children:p(H)},H):null)]}),i("line",{class:"baseline",x1:D.left,x2:D.left+f,y1:J(0),y2:J(0)}),r.map((H)=>i("g",{class:H.cls,style:H.color?{stroke:`var(${H.color})`,fill:`var(${H.color})`}:void 0,children:[H.area&&k>1&&i("path",{class:"area",d:`${xr(H.values,W,J)}L${W(k-1)},${J(0)}L${W(0)},${J(0)}Z`}),i("path",{class:"line",d:xr(H.values,W,J)})]},H.label)),u.map((H)=>i("g",{class:"mark",children:[i("line",{x1:pi(H.at),x2:pi(H.at),y1:D.top,y2:D.top+I}),i("title",{children:ao(H)})]},H.at)),y!==null&&i("g",{children:[i("line",{class:"crosshair",x1:W(y),x2:W(y),y1:D.top,y2:D.top+I}),r.map((H)=>i("circle",{class:`dot ${H.cls??""}`,style:H.color?{fill:`var(${H.color})`}:void 0,cx:W(y),cy:J(H.values[y]??0),r:4.5},H.label))]}),i("rect",{x:D.left,y:D.top,width:f,height:I,fill:"transparent"})]}),y!==null&&z>0&&i(oo,{left:Math.min(W(y)+12,z-170),title:p(d[y]),series:r,at:y,format:l,marks:jr(u,d[y],d[y]+Y)})]})}function Sd({labels:d,series:r,height:o=200,label:p,tickLabel:l=(b)=>b,titleFor:v=(b)=>b}){let[b,n]=io(),[z,y]=R(null),h=d.length,k=d.map((Y,u)=>r.reduce((pi,bi)=>pi+(bi.values[u]??0),0)),M=Ad(Math.max(1,...k)),g=M[M.length-1],X=Math.max(0,n-D.left-D.right),f=o-D.top-D.bottom,I=h?X/h:0,W=Math.max(2,Math.min(28,I*0.62)),J=(Y)=>D.top+f-Y/g*f,_=Math.max(1,Math.ceil(h/Math.max(2,Math.floor(X/70))));return i("div",{class:"chart",ref:b,children:[n>0&&i("svg",{width:n,height:o,role:"img","aria-label":p,onMouseLeave:()=>y(null),children:[i("g",{class:"grid",children:M.map((Y)=>i("line",{x1:D.left,x2:D.left+X,y1:J(Y),y2:J(Y)},Y))}),i("g",{class:"axis",children:[M.map((Y)=>i("text",{x:D.left-8,y:J(Y)+4,"text-anchor":"end",children:K(Y,!0)},Y)),d.map((Y,u)=>u%_===0?i("text",{x:D.left+I*u+I/2,y:o-6,"text-anchor":"middle",children:l(Y)},Y):null)]}),d.map((Y,u)=>{let pi=0,bi=D.left+I*u+I/2;return i("g",{onMouseEnter:()=>y(u),children:[i("rect",{x:D.left+I*u,y:D.top,width:I,height:f,fill:"transparent"}),r.map((H,ni)=>{let di=H.values[u]??0;if(di<=0)return null;let gi=J(pi);pi+=di;let ai=J(pi),s=ni>0?2:0;return i("rect",{class:`${H.cls==="s-failed"?"bar bar-failed":"bar"}${z===u?" on":""}`,x:bi-W/2,y:ai,width:W,height:Math.max(1,gi-ai-s),rx:Math.min(3,W/3)},H.label)})]},Y)}),i("line",{class:"baseline",x1:D.left,x2:D.left+X,y1:J(0),y2:J(0)})]}),z!==null&&n>0&&i(oo,{left:Math.min(D.left+I*z+I/2+12,n-170),title:v(d[z]),series:r,at:z,format:(Y)=>K(Y)})]})}function po({buckets:d,height:r=200}){let o=d.map((n,z)=>n.le===null?`> ${sr(d[z-1]?.le??0)}`:`≤ ${sr(n.le)}`),p=d.findIndex((n)=>n.count>0);if(p<0)return i("div",{class:"chart-empty",style:{height:`${r}px`},children:a("No executions in this window")});let l=d.findLastIndex((n)=>n.count>0),v=Math.max(0,p-1),b=l+2;return i(Sd,{label:a("Execution time histogram"),labels:o.slice(v,b),series:[{label:a("Jobs"),cls:"s-processed",values:d.slice(v,b).map((n)=>n.count)}],height:r,tickLabel:(n)=>n.replace("≤ ",""),titleFor:(n)=>a("Took {time}",{time:n})})}function sr(d){return d>=1000?`${d/1000}s`:`${d}ms`}function k1({stats:d,perMinute:r,queues:o}){let p=o.reduce((v,b)=>!v||b.latency>v.latency?b:v,null),l=[];if(d.processes===0)l.push(i(V,{children:[a("No Robin processes are running.")," "]}),d.enqueued>0?Ki("{jobs} is waiting for one to start.","{jobs} are waiting for one to start.",d.enqueued,{jobs:i(m,{href:"/queues",children:i("b",{children:Q("{n} job","{n} jobs",d.enqueued)})})}):i(V,{children:a("Nothing is waiting, either.")}));else{let v=i(m,{href:"/busy",children:i("b",{children:Q("{n} process","{n} processes",d.processes)})});if(l.push(i(V,{children:[r?Ki("Robin is working through {rate} job a minute on {processes}","Robin is working through {rate} jobs a minute on {processes}",r,{rate:i("b",{children:K(r)}),processes:v}):d.busy>0?q("Robin is running on {processes}",{processes:v}):q("Robin is standing by on {processes}",{processes:v}),d.busy>0?Ki(", with {threads} thread busy right now.",", with {threads} threads busy right now.",d.busy,{threads:i("b",{children:K(d.busy)})}):a(".")," "]})),d.enqueued>0&&p&&p.latency>=1)l.push(i(V,{children:[q("The oldest of {jobs} has been in {queue} for {time}.",{jobs:i("b",{children:Q("{n} waiting job","{n} waiting jobs",d.enqueued)}),queue:i(m,{href:`/queues/${encodeURIComponent(p.name)}`,children:p.name}),time:i("b",{children:li(p.latency)})})," "]}))}return l.push(d.retries>0?i(V,{children:[i(m,{href:"/retries",class:"warn",children:Ki("{jobs} is waiting to retry","{jobs} are waiting to retry",d.retries,{jobs:i("b",{children:Q("{n} job","{n} jobs",d.retries)})})}),a(".")]}):i("span",{class:"calm",children:a("Nothing is waiting to retry.")})),i("p",{class:"status-line","aria-live":"polite",children:l})}function w1({stats:d}){let r=[[c("Processed"),d.processed,"/metrics"],[c("Failed"),d.failed,"/metrics"],[c("Enqueued"),d.enqueued,"/queues"],[c("Scheduled"),d.scheduled,"/scheduled"],[c("Retries"),d.retries,"/retries",d.retries>0],[c("Dead"),d.dead,"/dead"]];return i("div",{class:"facts",children:r.map(([o,p,l,v])=>i(m,{href:l,class:`fact${v?" alert":""}`,children:[i("span",{class:"fact-value",children:K(p,!0)}),i("span",{class:"fact-label",children:a(o)})]},o))})}var X1=(d)=>new Date(d).toLocaleTimeString(e(),{hour:"2-digit",minute:"2-digit"});function lo(){let[d,r]=R(60),[o,p]=R(30),l=E("dashboard",{minutes:d,days:o},20),v=P(Xi);if(l.error&&!l.data)return i(O,{message:l.error,onRetry:l.reload});if(!l.data)return i(U,{rows:8});let b=l.data,n=v?.stats??b.stats,z=b.queues.map((f)=>({...f,size:v?.queues[f.name]??f.size})),y=b.realtime.slice(0,-1),h=y.at(-1),k=h?h.s+h.f:null,M=y.map((f)=>Zi(f.t)),g=Object.keys(b.history.processed).sort(),X=Math.max(1,...z.map((f)=>f.size));return i(V,{children:[i("h1",{class:"sr-only",children:a("Dashboard")}),i(k1,{stats:n,perMinute:k,queues:z}),i(w1,{stats:n}),i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Throughput")}),i("span",{class:"panel-note",children:a("Jobs finished per minute")}),i("span",{class:"spacer"}),i(Ri,{series:Di()}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:[60,240,480].map((f)=>i("button",{"aria-pressed":d===f,onClick:()=>r(f),children:a("{n} h",{n:f/60})},f))})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("Jobs succeeded and failed per minute"),xs:M,xLabel:X1,height:240,series:Pi(y.map((f)=>f.s),y.map((f)=>f.f))})})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Queues")}),i("span",{class:"spacer"}),i(m,{href:"/queues",class:"small",children:a("All queues")})]}),z.length===0?i("p",{class:"panel-pad dim",children:a("No queues yet. They appear as soon as a job is pushed.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Queue")}),i("th",{class:"r",children:a("Waiting")}),i("th",{style:{width:"28%"},children:i("span",{class:"sr-only",children:a("Relative size")})}),i("th",{class:"r",children:a("Latency")})]})}),i("tbody",{children:z.slice(0,8).map((f)=>i("tr",{children:[i("td",{class:"cls",children:[i(m,{href:`/queues/${encodeURIComponent(f.name)}`,children:f.name})," ",f.paused&&i("span",{class:"badge amber",children:a("Paused")})]}),i("td",{class:"r",children:K(f.size)}),i("td",{children:i("div",{class:"qbar","aria-hidden":"true",children:i("span",{style:{width:`${f.size/X*100}%`}})})}),i("td",{class:"r",children:i(ui,{seconds:f.latency})})]},f.name))})]})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Daily history")}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("History window"),children:[7,30,90].map((f)=>i("button",{"aria-pressed":o===f,onClick:()=>p(f),children:a("{n} d",{n:f})},f))})]}),i("div",{class:"panel-pad",children:[i(Sd,{label:a("Jobs succeeded and failed per day"),labels:g,tickLabel:(f)=>f.slice(5).replace("-","/"),titleFor:(f)=>new Date(`${f}T00:00:00Z`).toLocaleDateString(e(),{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}),series:Pi(g.map((f)=>Math.max(0,b.history.processed[f]-(b.history.failed[f]??0))),g.map((f)=>b.history.failed[f]??0))}),i("div",{class:"mt",children:i(Ri,{series:Di()})})]})]})]})]})}async function B(d,r,o){if(o&&!await Nr(o))return;try{let p=await d();return zi(typeof r==="function"?r(p):r),p}catch(p){zi(p.message,"error");return}}var A=(d,r,o)=>Td("POST",d,r,o),Ii=(d,r)=>Td("DELETE",d,r);function cd({progress:d}){let{pct:r,msg:o}=d,p=d.meta?.iterations;return i(V,{children:[r===null?i("div",{class:"progress progress-unknown",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,children:i("span",{class:"p-run"})}):i("div",{class:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i("span",{class:"p-ok",style:{width:`${r}%`}})}),i("div",{class:"progress-label",children:[i("span",{children:o??(typeof p==="number"?a("{n} done",{n:K(p)}):"")}),i("span",{class:"num",children:r===null?"":a("{pct}%",{pct:t(r,Number.isInteger(r)?0:1)})})]})]})}function Vd({job:d,where:r,when:o}){return i("dl",{class:"kv",children:[i("dt",{children:a("Job")}),i("dd",{children:i(hi,{name:d.class,wrapper:d.wrapper})}),i("dt",{children:a("Job ID")}),i("dd",{children:i(oi,{jid:d.jid})}),i("dt",{children:a("Queue")}),i("dd",{children:i(m,{href:`/queues/${w(d.queue)}`,children:d.queue})}),r&&i(V,{children:[i("dt",{children:a("Where it is")}),i("dd",{children:r})]}),d.at&&i(V,{children:[i("dt",{children:o??a("Runs")}),i("dd",{children:i(T,{at:d.at})})]}),i("dt",{children:a("Created")}),i("dd",{children:i(T,{at:d.created_at})}),d.enqueued_at&&i(V,{children:[i("dt",{children:a("Enqueued")}),i("dd",{children:i(T,{at:d.enqueued_at})})]}),d.failures?i(V,{children:[i("dt",{children:a("Failures")}),i("dd",{class:"num",children:d.failures})]}):null,d.failed_at&&i(V,{children:[i("dt",{children:a("First failed")}),i("dd",{children:i(T,{at:d.failed_at})})]}),d.retried_at&&i(V,{children:[i("dt",{children:a("Last failed")}),i("dd",{children:i(T,{at:d.retried_at})})]}),d.bid&&i(V,{children:[i("dt",{children:a("Batch")}),i("dd",{children:i(m,{href:`/batches/${w(d.bid)}`,class:"mono",children:d.bid})})]}),d.tags.length>0&&i(V,{children:[i("dt",{children:a("Tags")}),i("dd",{children:i(Hi,{tags:d.tags})})]}),d.info?.map((p)=>i(V,{children:[i("dt",{children:p.label}),i("dd",{children:p.href?i("a",{href:p.href,rel:"noopener noreferrer",children:p.text}):p.text})]},p.label))]})}function kd({job:d}){if(!d.error_class)return null;return i("section",{class:"stack mt",children:[i("div",{class:"error-box",children:[i("span",{class:"err",children:d.error_class}),i("span",{class:"err-msg",children:d.error_message})]}),d.backtrace&&d.backtrace.length>0&&i("div",{children:[i("h2",{children:a("Backtrace")}),i(er,{lines:d.backtrace})]})]})}function vo({set:d,job:r,onDone:o}){let[p,l]=R(JSON.stringify(r.args,null,2)),[v,b]=R(null),n=async()=>{let z;try{z=JSON.parse(p)}catch(h){b(a("That isn't valid JSON: {error}",{error:h.message}));return}if(!Array.isArray(z)){b(a('Arguments must be a JSON array, like [1, "two"].'));return}b(null);let y=await B(()=>A(`sets/${d}/${w(r.id)}/edit`,{args:z}),(h)=>a("Enqueued with new arguments as {jid}",{jid:h.jid}));if(y)o(),j(`/jobs/${w(y.jid)}`)};return i("div",{class:"panel panel-pad mt",children:[i("h2",{children:a("Edit arguments and retry")}),i("p",{class:"subtitle mb",children:a("The job is removed from this set and pushed again with a new job ID and a clean failure count.")}),i("textarea",{"aria-label":a("Job arguments as JSON"),class:"input",spellcheck:!1,value:p,onInput:(z)=>l(z.target.value)}),v&&i("p",{class:"err small",role:"alert",children:v}),i("div",{class:"btn-group mt",children:[i("button",{class:"btn btn-primary",onClick:n,children:a("Retry with these arguments")}),i("button",{class:"btn",onClick:o,children:a("Cancel")})]})]})}function wd({job:d}){if(!d.payload)return null;return i("section",{class:"mt",children:[i("h2",{children:a("Payload")}),i(yd,{value:d.payload})]})}function bo({jid:d}){if(!Z("cancel"))return null;return i("button",{class:"btn",onClick:()=>B(()=>A(`jobs/${w(d)}/cancel`),a("Cancellation requested"),{title:a("Cancel this job?"),body:a("If it hasn't started, it's skipped. If it's running, cancelled? turns true so it can stop early."),action:a("Cancel job"),danger:!0}),children:a("Cancel job")})}var no=[[void 0,c("All")],["processes",c("Processes")],["jobs",c("Running jobs")]];function ti(d,r,o){let p=d&&wi(d).host,l=d?`processes/${w(d)}/${r}`:`processes/${r}`,v=r==="stop"?{title:p?a("Stop {host}?",{host:p}):a("Stop every process?"),body:a("Running jobs get the shutdown timeout to finish; unfinished jobs go back on their queues."),action:a("Stop"),danger:!0}:r==="quiet"?{title:p?a("Quiet {host}?",{host:p}):a("Quiet every process?"),body:a("It finishes the jobs it's running but won't start new ones. This can't be undone without restarting it."),action:a("Quiet")}:void 0,b=r==="dump"?a("Thread dump requested; check the process logs"):r==="quiet"?a("Quiet signal sent"):a("Stop signal sent");return B(()=>A(l),b,v).then(o)}var ho=1000,H1=50;function I1({identity:d,capsule:r,concurrency:o,label:p,reload:l}){let[v,b]=R(String(o));S(()=>b(String(o)),[o]);let n=Number(v),z=Number.isInteger(n)&&n>=1&&n<=ho;return i("form",{class:"resize",onSubmit:(y)=>{y.preventDefault(),B(()=>A(`processes/${w(d)}/resize`,{concurrency:n,capsule:r}),a("Resize requested; the new thread count shows at the next heartbeat")).then(l)},children:[i("label",{children:[p," ",i("input",{class:"input",type:"number",min:1,max:ho,step:1,required:!0,value:v,onInput:(y)=>b(y.target.value)})]}),i("button",{class:"btn btn-small",type:"submit",disabled:!z||n===o,children:a("Apply")})]})}function J1({pct:d}){let r=t(d,0);if(d>=H1)return i("span",{class:"lat-warn",title:a("Threads often wait for the GVL; CPU-heavy jobs may run better with fewer threads or more processes"),children:a("{pct}% high",{pct:r})});return i(V,{children:a("{pct}%",{pct:r})})}function m1({p:d,reload:r}){let{host:o,pid:p}=wi(d.identity),l=Z("process_control"),v=Object.entries(d.capsules??{default:{concurrency:d.concurrency,queues:{}}});return i("div",{class:"proc",children:[i("div",{children:[i("div",{class:"proc-name",children:[o,i("span",{class:"dim",children:[":",p]})," ",d.leader&&i("span",{class:"badge egg",title:a("Runs cron and recovery for the cluster"),children:a("Leader")})," ",d.quiet&&i("span",{class:"badge amber",children:a("Quiet")})," ",d.embedded&&i("span",{class:"badge",children:a("Embedded")})]}),i("div",{class:"proc-meta",children:[d.tag&&i(V,{children:[i("strong",{children:d.tag}),", "]}),q("working {queues}, started {time}",{queues:d.queues.join(", "),time:i(T,{at:d.started_at})})]}),i("div",{class:"threads","aria-label":Q("{busy} of {n} thread busy","{busy} of {n} threads busy",d.concurrency,{busy:d.busy}),children:Array.from({length:Math.min(d.concurrency,64)},(b,n)=>i("i",{class:n<d.busy?"on":""},n))}),l&&!d.quiet&&i("div",{class:"resizes",children:v.map(([b,n])=>i(I1,{identity:d.identity,capsule:b,concurrency:n.concurrency,reload:r,label:v.length===1?a("Threads"):a("{capsule} threads",{capsule:b})},b))})]}),i("div",{children:[i("div",{class:"proc-k",children:a("Busy")}),i("div",{class:"proc-v",children:[d.busy," / ",d.concurrency]})]}),i("div",{children:[i("div",{class:"proc-k",children:a("Memory")}),i("div",{class:"proc-v",children:$r(d.rss_kb)})]}),i("div",{class:"proc-hide",children:[i("div",{class:"proc-k",children:a("Redis RTT")}),i("div",{class:"proc-v",children:d.rtt_us?a("{n} ms",{n:t(d.rtt_us/1000,1)}):"–"})]}),i("div",{class:"proc-hide",children:d.gvl_contention!=null&&i(V,{children:[i("div",{class:"proc-k",title:a("Share of the last heartbeat interval threads spent waiting for Ruby's global VM lock (GVL)"),children:a("GVL wait")}),i("div",{class:"proc-v",children:i(J1,{pct:d.gvl_contention})})]})}),i("div",{class:"proc-hide",children:[i("div",{class:"proc-k",children:a("Heartbeat")}),i("div",{class:"proc-v",children:i(T,{at:d.beat})})]}),i("div",{class:"btn-group",children:[l&&i("button",{class:"btn btn-small",onClick:()=>ti(d.identity,"dump",r),title:a("Log every thread's backtrace"),children:a("Dump threads")}),l&&!d.quiet&&i("button",{class:"btn btn-small",onClick:()=>ti(d.identity,"quiet",r),children:a("Quiet")}),l&&i("button",{class:"btn btn-small btn-danger",onClick:()=>ti(d.identity,"stop",r),children:a("Stop")})]})]})}function go(){let d=E("busy",{},3),{query:r}=ri(),o=no.find(([b])=>b&&b===r.get("only"))?.[0];if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let p=d.data,l=p?.processes.reduce((b,n)=>b+n.concurrency,0)??0,v=p?.processes.reduce((b,n)=>b+n.busy,0)??0;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a("Busy")}),p&&i("p",{class:"subtitle",children:a("{processes} running {busy} of {threads}.",{processes:Q("{n} process","{n} processes",p.processes.length),busy:K(v),threads:Q("{n} thread","{n} threads",l)})})]}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("Show"),children:no.map(([b,n])=>i("button",{"aria-pressed":o===b,onClick:()=>Wi({only:b}),children:a(n)},n))}),Z("process_control")&&p&&p.processes.length>0&&i("div",{class:"btn-group",children:[i("button",{class:"btn",onClick:()=>ti(null,"quiet",d.reload),children:a("Quiet all")}),i("button",{class:"btn btn-danger",onClick:()=>ti(null,"stop",d.reload),children:a("Stop all")})]})]}),o!=="jobs"&&i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Processes")})}),!p?i(U,{}):p.processes.length===0?i($,{title:a("No processes are running"),icon:"busy",children:q("Start one with {command} and it shows up here within a few seconds.",{command:i("code",{children:"bundle exec robin"})})}):i("div",{class:"proc-list",children:p.processes.map((b)=>i(m1,{p:b,reload:d.reload},b.identity))})]}),o!=="processes"&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Running jobs")})}),!p?i(U,{}):p.work.length===0?i($,{title:a("All threads are idle"),icon:"check",children:a("Jobs appear here while they run, with live progress if they report it.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),i("th",{children:a("Progress")}),i("th",{children:a("Process")}),i("th",{children:a("Started")}),i("th",{})]})}),i("tbody",{children:p.work.map((b)=>i("tr",{children:[i("td",{children:[i(hi,{name:b.job.class,wrapper:b.job.wrapper})," ",i(Hi,{tags:b.job.tags}),i("div",{children:[i(oi,{jid:b.job.jid})," ",i("span",{class:"dim small",children:q("in {queue}",{queue:i(m,{href:`/queues/${w(b.queue)}`,children:b.queue})})})]})]}),i("td",{class:"args",children:fi(b.job.args)}),i("td",{style:{minWidth:"160px"},children:b.progress?i(cd,{progress:b.progress}):i("span",{class:"dim",children:"–"})}),i("td",{class:"small",children:[wi(b.identity).host,i("div",{class:"dim",children:b.thread})]}),i("td",{children:i(T,{at:b.run_at})}),i("td",{class:"r",children:Z("cancel")&&i("button",{class:"btn btn-small",onClick:()=>B(()=>A(`jobs/${w(b.job.jid)}/cancel`),a("Cancellation requested"),{title:a("Cancel {job}?",{job:b.job.class}),body:a("The job sees cancelled? turn true and should stop at its next check."),action:a("Cancel job"),danger:!0}),children:a("Cancel")})})]},b.job.jid))})]})})]})]})}function Xd(d,r){return B(()=>A(`classes/${w(d.name)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {class}",{class:d.name}):a("Paused {class}",{class:d.name}),d.paused?void 0:{title:a("Pause {class}?",{class:d.name}),body:a("Workers set its jobs aside, in every queue, until you resume it. Jobs already running finish."),action:a("Pause class")}).then(r)}function Hd(d){let[r,o]=R(new Set),p=new Set(d.filter((v)=>r.has(v))),l=d.length>0&&p.size===d.length;return{selected:p,count:p.size,all:l,has:(v)=>p.has(v),toggle:(v)=>{o((b)=>{let n=new Set(b);if(!n.delete(v))n.add(v);return n})},toggleAll:()=>{o(l?new Set:new Set(d))},clear:()=>{o(new Set)}}}function fo(d,r){return B(()=>A(`queues/${w(d.name)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {queue}",{queue:d.name}):a("Paused {queue}",{queue:d.name}),d.paused?void 0:{title:a("Pause {queue}?",{queue:d.name}),body:a("Processes stop taking jobs from this queue until you resume it. Jobs can still be pushed."),action:a("Pause queue")}).then(r)}function zo(d,r,o){return B(()=>Ii(`queues/${w(d)}`),a("Cleared {queue}",{queue:d}),{title:a("Delete every job in {queue}?",{queue:d}),body:Q("{n} job will be removed for good.","{n} jobs will be removed for good.",r),action:a("Delete all jobs"),danger:!0}).then((p)=>p&&o())}function yo(){let d=E("queues",{},5),r=P(Xi);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let o=d.data?.queues.map((v)=>({...v,size:r?.queues[v.name]??v.size})),p=o?.reduce((v,b)=>v+b.size,0)??0,l=d.data?.paused_classes??[];return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Queues")}),o&&i("p",{class:"subtitle",children:a("{jobs} waiting across {queues}.",{jobs:Q("{n} job","{n} jobs",p),queues:Q("{n} queue","{n} queues",o.length)})})]})}),i("section",{class:"panel",children:!o?i(U,{}):o.length===0?i($,{title:a("No queues yet"),icon:"queues",children:a("A queue appears as soon as a job is pushed to it.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Queue")}),i("th",{class:"r",children:a("Waiting")}),i("th",{class:"r",children:a("Latency")}),i("th",{children:a("Status")}),i("th",{})]})}),i("tbody",{children:o.map((v)=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/queues/${w(v.name)}`,children:v.name})}),i("td",{class:"r",children:K(v.size)}),i("td",{class:"r",children:i(ui,{seconds:v.latency})}),i("td",{children:v.paused?i("span",{class:"badge amber",children:a("Paused")}):i("span",{class:"dim",children:a("Running")})}),i("td",{class:"r",children:i("div",{class:"btn-group",children:[Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>fo(v,d.reload),children:v.paused?a("Resume"):a("Pause")}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>zo(v.name,v.size,d.reload),children:a("Clear")})]})})]},v.name))})]})})}),l.length>0&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Paused classes")})}),i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{class:"r",children:a("Parked")}),i("th",{})]})}),i("tbody",{children:l.map((v)=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/metrics/jobs/${w(v.name)}`,children:v.name})}),i("td",{class:"r",children:K(v.parked)}),i("td",{class:"r",children:Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>Xd({name:v.name,paused:!0},d.reload),children:a("Resume")})})]},v.name))})]})})]})]})}function co({name:d}){let{query:r}=ri(),o=Number(r.get("page")??1)||1,p=E(`queues/${w(d)}`,{page:o},5),l=p.data?.jobs??[],v=Hd(l.map((k)=>k.jid));if(p.error&&!p.data)return i(O,{message:p.error,onRetry:p.reload});let b=p.data,n=()=>B(()=>A(`queues/${w(d)}/delete_jobs`,{jids:[...v.selected]}),(k)=>Q("Deleted {n} job","Deleted {n} jobs",k.deleted),{title:Q("Delete {n} job?","Delete {n} jobs?",v.count),body:a("They won't run."),action:a("Delete"),danger:!0}).then(()=>{v.clear(),p.reload()}),z=new Set(l.filter((k)=>v.has(k.jid)).map((k)=>k.class)),y=z.size===1?[...z][0]:null,h=(k)=>B(()=>A(`queues/${w(d)}/delete_class`,{class:k}),(M)=>Q("Deleted {n} job","Deleted {n} jobs",M.deleted),{title:a("Delete every {class} job in {queue}?",{class:k,queue:d}),body:a("This takes every one in the queue, not only those on this page. They won't run."),action:a("Delete all"),danger:!0}).then(()=>{v.clear(),p.reload()});return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/queues",children:a("Queues")})}),i("h1",{children:d}),b&&i("p",{class:"subtitle",children:[Ki("{n} job waiting. Oldest has waited {latency}.","{n} jobs waiting. Oldest has waited {latency}.",b.queue.size,{latency:i(ui,{seconds:b.queue.latency})})," ",b.queue.paused&&i("span",{class:"badge amber",children:a("Paused")})]})]}),i("span",{class:"spacer"}),b&&i("div",{class:"btn-group",children:[Z("pause")&&i("button",{class:"btn",onClick:()=>fo({name:d,paused:b.queue.paused},p.reload),children:b.queue.paused?a("Resume queue"):a("Pause queue")}),Z("delete")&&i("button",{class:"btn btn-danger",onClick:()=>zo(d,b.queue.size,()=>j("/queues")),children:a("Clear queue")})]})]}),i("section",{class:"panel",children:[Z("delete")&&l.length>0&&i("div",{class:"bulkbar",children:[i("span",{class:"sel",children:v.count?Q("{n} job selected","{n} jobs selected",v.count):a("Select jobs to act on them")}),i("span",{class:"spacer"}),i("button",{class:"btn btn-small btn-danger",disabled:!v.count,onClick:n,children:a("Delete")}),y&&i("button",{class:"btn btn-small btn-danger",onClick:()=>h(y),children:a("Delete every {class}",{class:y})})]}),!b?i(U,{}):l.length===0?i($,{title:a("{queue} is empty",{queue:d}),icon:"check",children:a("Every job pushed here has been picked up.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[Z("delete")&&i("th",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select all on this page"),checked:v.all,onChange:v.toggleAll})}),i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),i("th",{children:a("Enqueued")})]})}),i("tbody",{children:l.map((k)=>i("tr",{children:[Z("delete")&&i("td",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select {jid}",{jid:k.jid}),checked:v.has(k.jid),onChange:()=>v.toggle(k.jid)})}),i("td",{children:[i(hi,{name:k.class,wrapper:k.wrapper})," ",i(Hi,{tags:k.tags}),i("div",{children:i(oi,{jid:k.jid})})]}),i("td",{class:"args",children:k.encrypted?i("span",{class:"badge",children:a("Encrypted")}):fi(k.args)}),i("td",{children:i(T,{at:k.enqueued_at??k.created_at})})]},k.jid))})]})}),b&&i(zd,{page:b.page,perPage:b.per_page,total:b.total})]})]})}var ed={scheduled:{title:c("Scheduled"),path:"/scheduled",when:c("Runs"),empty:c("Nothing is scheduled"),emptyBody:c("Jobs pushed with perform_in or perform_at wait here until their time comes."),noMatch:c("Nothing in scheduled contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Enqueue now"),kill:!0,edit:!1,icon:"scheduled"},retries:{title:c("Retries"),path:"/retries",when:c("Next retry"),empty:c("No jobs are waiting to retry"),emptyBody:c("Failed jobs wait here with exponential backoff before they run again."),noMatch:c("Nothing in retries contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Retry now"),kill:!0,edit:!0,icon:"check"},dead:{title:c("Dead"),path:"/dead",when:c("Died"),empty:c("No dead jobs"),emptyBody:c("Jobs that run out of retries land here so you can inspect and replay them."),noMatch:c("Nothing in dead contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Retry now"),kill:!1,edit:!0,icon:"check"}};function Vo(d,r,o){if(r==="delete")return Q("Deleted {n} job","Deleted {n} jobs",o);if(r==="kill")return Q("Killed {n} job","Killed {n} jobs",o);return d==="scheduled"?Q("Enqueued {n} job","Enqueued {n} jobs",o):Q("Retried {n} job","Retried {n} jobs",o)}function ud(d){return Object.hasOwn(ed,d)?ed[d]:void 0}function Id({set:d}){let r=ed[d],{query:o}=ri(),p=Number(o.get("page")??1)||1,l=o.get("q")??"",v=E(`sets/${d}`,{page:p,q:l},10),b=v.data?.jobs??[],n=Hd(b.map((f)=>f.id)),z=d!=="scheduled",y=Z("retry")||Z("delete")||r.kill&&Z("kill"),h=(f)=>{let I=n.count;return B(()=>A(`sets/${d}/bulk`,{action:f,ids:[...n.selected]}),(W)=>Vo(d,f,W.affected),f==="retry"?void 0:{title:f==="delete"?Q("Delete {n} job?","Delete {n} jobs?",I):Q("Kill {n} job?","Kill {n} jobs?",I),body:f==="delete"?a("They won't run again."):a("They move to the dead set without running again."),action:f==="delete"?a("Delete"):a("Kill"),danger:!0}).then(()=>{n.clear(),v.reload()})},k=d==="scheduled",M={retry:k?a("Enqueue all"):a("Retry all"),delete:a("Delete all"),kill:a("Kill all")},g=(f)=>{let I=v.data.total,W={retry:k?Q("Enqueue all {n} job?","Enqueue all {n} jobs?",I):Q("Retry all {n} job?","Retry all {n} jobs?",I),delete:Q("Delete all {n} job?","Delete all {n} jobs?",I),kill:Q("Kill all {n} job?","Kill all {n} jobs?",I)}[f],J={retry:a("Every job in this set is pushed onto its queue right away."),delete:a("Every job in this set is removed for good."),kill:a("Every job in this set moves to the dead set.")}[f];return B(()=>A(`sets/${d}/all`,{action:f}),(_)=>Vo(d,f,_.affected),{title:W,body:J,action:M[f],danger:f!=="retry"}).then(v.reload)};if(v.error&&!v.data)return i(O,{message:v.error,onRetry:v.reload});let X=v.data;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a(r.title)}),X&&i("p",{class:"subtitle",children:l?Q("{n} job matching “{q}”.","{n} jobs matching “{q}”.",X.total,{q:l}):Q("{n} job.","{n} jobs.",X.total)})]}),i("span",{class:"spacer"}),i(Sr,{value:l,placeholder:a("Search class, args, error…"),onSearch:(f)=>Wi({q:f,page:void 0})})]}),i("section",{class:"panel",children:[y&&X&&X.total>0&&i("div",{class:"bulkbar",children:[i("span",{class:"sel",children:n.count?Q("{n} job selected","{n} jobs selected",n.count):a("Select jobs, or act on the whole set")}),i("span",{class:"spacer"}),n.count>0?i(V,{children:[Z("retry")&&i("button",{class:"btn btn-small",onClick:()=>h("retry"),children:a(r.retryLabel)}),r.kill&&Z("kill")&&i("button",{class:"btn btn-small",onClick:()=>h("kill"),children:a("Kill")}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>h("delete"),children:a("Delete")})]}):i(V,{children:[Z("retry")&&i("button",{class:"btn btn-small",onClick:()=>g("retry"),children:M.retry}),r.kill&&Z("kill")&&i("button",{class:"btn btn-small",onClick:()=>g("kill"),children:M.kill}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>g("delete"),children:M.delete})]})]}),!X?i(U,{}):b.length===0?l?i($,{title:a("No matches"),icon:"search",children:a(r.noMatch,{q:l})}):i($,{title:a(r.empty),icon:r.icon,children:a(r.emptyBody)}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[y&&i("th",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select all on this page"),checked:n.all,onChange:n.toggleAll})}),i("th",{children:a(r.when)}),i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),z&&i("th",{children:a("Error")}),z&&i("th",{class:"r",children:a("Failures")})]})}),i("tbody",{children:b.map((f)=>i("tr",{children:[y&&i("td",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select {jid}",{jid:f.jid}),checked:n.has(f.id),onChange:()=>n.toggle(f.id)})}),i("td",{children:i(m,{href:`/sets/${d}/${w(f.id)}`,children:i(T,{at:f.at})})}),i("td",{children:[i(hi,{name:f.class,wrapper:f.wrapper})," ",i(Hi,{tags:f.tags}),i("div",{children:[i(oi,{jid:f.jid})," ",i("span",{class:"dim small",children:f.queue})]})]}),i("td",{class:"args",children:f.encrypted?i("span",{class:"badge",children:a("Encrypted")}):fi(f.args,90)}),z&&i("td",{children:[i(m,{href:`/sets/${d}/${w(f.id)}`,class:"err",children:f.error_class}),i("div",{class:"err-msg",children:(f.error_message??"").slice(0,140)})]}),z&&i("td",{class:"r",children:f.failures??0})]},f.id))})]})}),X&&i(zd,{page:X.page,perPage:X.per_page,total:X.total})]})]})}function ko({set:d,id:r}){let o=ud(d),p=E(`sets/${d}/${w(r)}`),[l,v]=R(!1);if(!o)return i(O,{message:a(`There's no "{set}" set.`,{set:d})});if(p.error)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:o.path,children:a(o.title)})}),i(O,{message:p.error})]});if(!p.data)return i(U,{rows:10});let b=p.data.job,n=()=>j(o.path),z={retry:d==="scheduled"?a("Job enqueued"):a("Job retried"),delete:a("Job deleted"),kill:a("Job killed")},y=(h,k)=>B(()=>A(`sets/${d}/bulk`,{action:h,ids:[r]}),z[h],k&&{...k,danger:!0}).then((M)=>M&&n());return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:o.path,children:a(o.title)})}),i("h1",{children:b.class}),i("p",{class:"subtitle",children:i(oi,{jid:b.jid})})]}),i("span",{class:"spacer"}),i("div",{class:"btn-group",children:[Z("retry")&&i("button",{class:"btn btn-primary",onClick:()=>y("retry"),children:a(o.retryLabel)}),o.edit&&Z("edit")&&!b.encrypted&&i("button",{class:"btn",onClick:()=>v(!0),children:a("Edit arguments")}),o.kill&&Z("kill")&&i("button",{class:"btn",onClick:()=>y("kill",{title:a("Kill job?"),action:a("Kill job")}),children:a("Kill")}),Z("delete")&&i("button",{class:"btn btn-danger",onClick:()=>y("delete",{title:a("Delete job?"),action:a("Delete job")}),children:a("Delete")})]})]}),l&&i(vo,{set:d,job:b,onDone:()=>v(!1)}),i("div",{class:"grid-3-1 mt",children:[i("div",{children:[i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Arguments")}),b.encrypted?i("p",{class:"dim",children:a("These arguments are encrypted at rest and can't be shown.")}):i(yd,{value:b.args})]}),i(kd,{job:b}),i(wd,{job:b})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i(Vd,{job:b,where:a(o.title),when:a(o.when)})]})]})]})}function wo({jid:d}){let r=E(`jobs/${w(d)}`,{},5);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});if(!r.data)return i(U,{rows:8});let o=r.data,p=o.results.at(0);return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:a("Job lookup")}),i("h1",{children:p?p.job.class:a("Job not found")}),i("p",{class:"subtitle mono",children:d})]}),i("span",{class:"spacer"}),p&&p.where!=="dead"&&i(bo,{jid:d})]}),o.cancelled&&i("p",{class:"notice mb",children:a("Cancellation was requested for this job.")}),!p?i("section",{class:"panel",children:i($,{title:a("No job with that ID right now"),icon:"search",children:a("It may have finished (finished jobs aren't kept), or it lives in a queue too large to search. Check the ID and try again.")})}):o.results.map((l)=>{let v=ud(l.where),b=l.where==="busy"?a("Running on {process}",{process:l.identity}):l.where==="queue"?a("Waiting in {queue}",{queue:l.queue}):v?a(v.title):l.where;return i("div",{class:"grid-3-1 mb",children:[i("div",{children:[o.progress&&l.where==="busy"&&i("section",{class:"panel panel-pad mb",children:[i("h2",{children:a("Progress")}),i(cd,{progress:o.progress})]}),l.job.id&&v&&i("p",{class:"mb",children:i(m,{href:`/sets/${l.where}/${w(l.job.id)}`,children:a("Open in {set} to retry, edit or delete it",{set:a(v.title)})})}),i(kd,{job:l.job}),i(wd,{job:l.job})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i(Vd,{job:l.job,where:b,when:v&&a(v.when)})]})]},l.where)})]})}var Xo=[{key:"1h",label:c("1 hour"),summary:c("{count} executions in the last hour, {failed}."),path:"metrics",params:{minutes:60},hourly:!1},{key:"8h",label:c("8 hours"),summary:c("{count} executions in the last 8 hours, {failed}."),path:"metrics",params:{minutes:480},hourly:!1},{key:"7d",label:c("7 days"),summary:c("{count} executions in the last 7 days, {failed}."),path:"metrics/history",params:{hours:168},hourly:!0},{key:"30d",label:c("30 days"),summary:c("{count} executions in the last 30 days, {failed}."),path:"metrics/history",params:{hours:720},hourly:!0}],Ui=(d)=>d.s+d.f;function M1(d){if(!d.f)return a("none failed");let r=d.f/Ui(d);return a("{pct}% failed",{pct:t(r*100,r<0.01?2:1)})}var K1=["--series-1","--series-2","--series-3","--series-4","--series-5"];function Jd(d){return(r)=>d?new Date(r).toLocaleString(e(),{month:"short",day:"numeric",hour:"2-digit"}):new Date(r).toLocaleTimeString(e(),{hour:"2-digit",minute:"2-digit"})}function Y1({hourly:d}){let r=E("metrics/queues",{granularity:d?"hour":"minute",points:d?168:60},60);if(!r.data)return i(U,{rows:3});let o=r.data.points,p={};for(let b of o)for(let[n,z]of Object.entries(b.queues))p[n]=Math.max(p[n]??0,z.size);let l=Object.entries(p).sort((b,n)=>n[1]-b[1]).slice(0,5).map(([b])=>b).sort();if(Object.values(p).every((b)=>b===0))return i("div",{class:"chart-empty",style:{height:"180px"},children:a("Queue sizes are sampled once a minute by the leader process.")});let v=l.map((b,n)=>({label:b,color:K1[n],values:o.map((z)=>(b in z.queues)?z.queues[b].size:0)}));return i(V,{children:[i("div",{class:"mb",children:i(Ri,{series:v})}),i(Oi,{label:a("Queue size over time"),xs:o.map((b)=>Zi(b.t)),xLabel:Jd(d),series:v,height:200}),Object.keys(p).length>5&&i("p",{class:"small dim mt",children:a("Showing the five queues with the largest peaks.")})]})}function Ho(){let[d,r]=R("1h"),[o,p]=R(""),l=Xo.find((y)=>y.key===d),v=E(l.path,l.params,l.hourly?300:30);if(v.error&&!v.data)return i(O,{message:v.error,onRetry:v.reload});let b=v.data&&!l.hourly?{...v.data,series:v.data.series.slice(0,-1)}:v.data,n=b?Object.entries(b.classes).filter(([y])=>y.toLowerCase().includes(o.toLowerCase())).sort((y,h)=>Ui(h[1])-Ui(y[1])):[],z=b?Object.values(b.classes).reduce((y,h)=>({s:y.s+h.s,f:y.f+h.f}),{s:0,f:0}):{s:0,f:0};return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a("Metrics")}),b&&i("p",{class:"subtitle",children:a(l.summary,{count:K(Ui(z)),failed:M1(z)})})]}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:Xo.map((y)=>i("button",{"aria-pressed":y.key===d,onClick:()=>r(y.key),children:a(y.label)},y.key))})]}),i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Executions")}),i("span",{class:"panel-note",children:l.hourly?a("per hour"):a("per minute")}),i("span",{class:"spacer"}),i(Ri,{series:Di()})]}),i("div",{class:"panel-pad",children:!b?i(U,{rows:4}):i(Oi,{label:a("Executions over time"),xs:b.series.map((y)=>Zi(y.t)),xLabel:Jd(l.hourly),series:Pi(b.series.map((y)=>y.s),b.series.map((y)=>y.f)),marks:b.deploys})})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Jobs")}),i("span",{class:"spacer"}),i("input",{class:"input",type:"search",placeholder:a("Filter by class"),"aria-label":a("Filter by class"),value:o,onInput:(y)=>p(y.target.value)})]}),i("div",{class:"mt"}),!b?i(U,{}):n.length===0?i($,{title:o?a("No classes match"):a("No jobs ran in this window"),icon:"metrics",children:a("Metrics are flushed by each process every few seconds.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{class:"r",children:a("Succeeded")}),i("th",{class:"r",children:a("Failed")}),i("th",{class:"r",children:a("Avg time")}),i("th",{class:"r",children:a("Total time")})]})}),i("tbody",{children:n.map(([y,h])=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/metrics/jobs/${encodeURIComponent(y)}`,children:y})}),i("td",{class:"r",children:K(h.s)}),i("td",{class:`r${h.f?"":" muted"}`,children:K(h.f)}),i("td",{class:"r",children:Yi(h.avg_ms)}),i("td",{class:"r",children:Yi(h.ms)})]},y))})]})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Queue sizes")})}),i("div",{class:"panel-pad",children:i(Y1,{hourly:l.hourly})})]})]})]})}function Io({klass:d}){let[r,o]=R(60),p=E(`metrics/jobs/${encodeURIComponent(d)}`,{minutes:r},30);if(p.error&&!p.data)return i(O,{message:p.error,onRetry:p.reload});let l=p.data&&{...p.data,series:p.data.series.slice(0,-1)},v=l?Ui(l.totals):0;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/metrics",children:a("Metrics")})}),i("h1",{children:d}),l&&i("p",{class:"subtitle",children:[Q("{count} executions in the last hour, averaging {time}","{count} executions in the last {n} hours, averaging {time}",r/60,{count:K(v),time:Yi(l.totals.avg_ms)}),l.totals.f?a(", {n} failed",{n:K(l.totals.f)}):"",a("."),l.paused&&i(V,{children:[" ",i("span",{class:"badge amber",children:a("Paused")})]})]})]}),i("span",{class:"spacer"}),l&&Z("pause")&&i("button",{class:"btn",onClick:()=>Xd({name:d,paused:!!l.paused},p.reload),children:l.paused?a("Resume class"):a("Pause class")}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:[60,240,480].map((b)=>i("button",{"aria-pressed":r===b,onClick:()=>o(b),children:a("{n} h",{n:b/60})},b))})]}),!l?i(U,{rows:8}):i("div",{class:"grid-2",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Executions")}),i("span",{class:"spacer"}),i(Ri,{series:Di()})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("{job} executions per minute",{job:d}),xs:l.series.map((b)=>Zi(b.t)),xLabel:Jd(!1),series:Pi(l.series.map((b)=>b.s),l.series.map((b)=>b.f)),marks:l.deploys})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Execution time")}),i("span",{class:"panel-note",children:a("How long each run took")})]}),i("div",{class:"panel-pad",children:i(po,{buckets:l.histogram,height:220})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Average time")}),i("span",{class:"panel-note",children:a("per minute")})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("{job} average execution time per minute",{job:d}),xs:l.series.map((b)=>Zi(b.t)),xLabel:Jd(!1),yFormat:(b)=>Yi(b),series:[{label:a("Average"),cls:"s-processed",values:l.series.map((b)=>Ui(b)?b.ms/Ui(b):0)}],marks:l.deploys})})]})]})]})}function Ji({title:d,hint:r}){return i("section",{class:"panel",children:i($,{title:d,icon:"gem",children:r})})}function Jo(d){if(d.success_at)return{label:a("Succeeded"),cls:"egg"};if(d.cancelled_at)return{label:a("Cancelled"),cls:"amber"};if(d.complete_at)return{label:a("Complete with failures"),cls:"ruby"};if(d.failures>0)return{label:a("Running, with failures"),cls:"ruby"};return{label:a("Running"),cls:""}}function td({b:d}){let r=Math.max(0,d.total-d.pending),o=Math.min(d.failures,d.pending),p=Math.max(0,d.pending-o);return i("div",{children:[i("div",{class:"progress",role:"progressbar","aria-valuenow":Math.round(Li(r,d.total)),"aria-valuemin":0,"aria-valuemax":100,"aria-label":a("Batch progress"),children:[r>0&&i("span",{class:"p-ok",style:{width:`${Li(r,d.total)}%`}}),o>0&&i("span",{class:"p-fail",style:{width:`${Li(o,d.total)}%`}})]}),i("div",{class:"progress-label",children:[i("span",{children:o?a("{done} of {total} done, {failing} failing",{done:K(r),total:K(d.total),failing:K(o)}):a("{done} of {total} done",{done:K(r),total:K(d.total)})}),i("span",{class:"num",children:p?a("{n} waiting",{n:K(p)}):""})]})]})}function mo({tags:d}){return i(V,{children:d?.map((r)=>i(m,{href:`/batches?tag=${encodeURIComponent(r)}`,class:"tag",children:r},r))})}function Mo(){let d=ri().query.get("tag")??"",r=E("batches",d?{tag:d}:{},5);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Batches")}),i("p",{class:"subtitle",children:d?q("Batches tagged {tag}. {all}",{tag:i("span",{class:"tag",children:d}),all:i(m,{href:"/batches",children:a("Show all batches")})}):a("Groups of jobs tracked together, with callbacks when they complete or succeed.")})]})}),!o?i("section",{class:"panel",children:i(U,{})}):!o.available?i(Ji,{title:a("Batches aren't available on this server"),hint:a("This server's Robin version doesn't include batch support.")}):(o.batches??[]).length===0?i("section",{class:"panel",children:d?i($,{title:a("No batches have this tag"),icon:"batches",children:a("Tagged batches show up here while Robin keeps them (30 days).")}):i($,{title:a("No batches yet"),icon:"batches",children:q("Create one with {new} and push jobs inside {block}.",{new:i("code",{children:"Robin::Batch.new"}),block:i("code",{children:"batch.jobs { … }"})})})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Batch")}),i("th",{children:a("Status")}),i("th",{style:{width:"34%"},children:a("Progress")}),i("th",{children:a("Created")})]})}),i("tbody",{children:o.batches.map((p)=>{let l=Jo(p);return i("tr",{children:[i("td",{children:[i(m,{href:`/batches/${w(p.bid)}`,class:"cls",children:p.description||a("Untitled batch")}),i("div",{class:"dim small mono",children:p.bid}),p.tags&&p.tags.length>0&&i("div",{children:i(mo,{tags:p.tags})})]}),i("td",{children:i("span",{class:`badge ${l.cls}`,children:l.label})}),i("td",{children:i(td,{b:p})}),i("td",{children:i(T,{at:p.created_at})})]},p.bid)})})]})})})]})}function Ko({bid:d}){let r=E(`batches/${w(d)}`,{},5);if(r.error&&!r.data)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:"/batches",children:a("Batches")})}),i(O,{message:r.error,onRetry:r.reload})]});if(!r.data)return i(U,{rows:8});if(!r.data.batch)return i(Ji,{title:a("Batches aren't available on this server"),hint:a("This server's Robin version doesn't include batch support.")});let o=r.data.batch,p=Jo(o),l=o.children??[];return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:[i(m,{href:"/batches",children:a("Batches")}),o.parent_bid&&i(V,{children:[" / ",i(m,{href:`/batches/${w(o.parent_bid)}`,children:a("parent")})]})]}),i("h1",{children:o.description||a("Untitled batch")}),i("p",{class:"subtitle",children:[i("span",{class:`badge ${p.cls}`,children:p.label})," ",i("span",{class:"mono small",children:o.bid})]})]}),i("span",{class:"spacer"}),i("div",{class:"btn-group",children:[Z("cancel")&&!o.cancelled_at&&!o.complete_at&&i("button",{class:"btn",onClick:()=>B(()=>A(`batches/${w(d)}/cancel`),a("Batch cancelled"),{title:a("Cancel this batch?"),body:a("Its jobs that haven't started are skipped, and running ones see cancelled? turn true. Child batches are cancelled too."),action:a("Cancel batch"),danger:!0}).then(r.reload),children:a("Cancel batch")}),Z("batches")&&i("button",{class:"btn btn-danger",onClick:()=>B(()=>Ii(`batches/${w(d)}`),a("Batch deleted"),{title:a("Delete this batch's tracking data?"),body:a("Jobs already pushed still run, but callbacks won't fire."),action:a("Delete batch"),danger:!0}).then((v)=>v&&j("/batches")),children:a("Delete")})]})]}),i("section",{class:"panel panel-pad mb",children:i(td,{b:o})}),i("div",{class:"grid-3-1",children:[i("div",{class:"stack",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Failed jobs")})}),(o.failed_jobs??[]).length===0?i($,{title:a("No failures"),icon:"check",children:a("Jobs that fail at least once are listed here until they succeed.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job ID")}),i("th",{children:a("Error")})]})}),i("tbody",{children:o.failed_jobs.map((v)=>i("tr",{children:[i("td",{children:i(m,{href:`/jobs/${w(v.jid)}`,class:"mono small",children:v.jid})}),i("td",{children:[i("span",{class:"err",children:v.error_class}),i("div",{class:"err-msg",children:v.error_message})]})]},v.jid))})]})})]}),l.length>0&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Child batches")})}),i("div",{class:"table-wrap",children:i("table",{class:"table",children:i("tbody",{children:l.map((v)=>{let b=typeof v==="string"?null:v,n=typeof v==="string"?v:v.bid;return i("tr",{children:[i("td",{children:i(m,{href:`/batches/${w(n)}`,children:b?.description||n})}),i("td",{style:{width:"50%"},children:b&&typeof b.total==="number"?i(td,{b}):null})]},n)})})})})]})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i("dl",{class:"kv",children:[i("dt",{children:a("Jobs")}),i("dd",{class:"num",children:Q("{n} job","{n} jobs",o.total)}),o.tags&&o.tags.length>0?i(V,{children:[i("dt",{children:a("Tags")}),i("dd",{children:i(mo,{tags:o.tags})})]}):null,i("dt",{children:a("Pending")}),i("dd",{class:"num",children:K(o.pending)}),i("dt",{children:a("Failures")}),i("dd",{class:"num",children:K(o.failures)}),i("dt",{children:a("Created")}),i("dd",{children:i(T,{at:o.created_at})}),i("dt",{children:a("Completed")}),i("dd",{children:i(T,{at:o.complete_at})}),i("dt",{children:a("Succeeded")}),i("dd",{children:i(T,{at:o.success_at})}),o.cancelled_at?i(V,{children:[i("dt",{children:a("Cancelled")}),i("dd",{children:i(T,{at:o.cancelled_at})})]}):null,o.callbacks&&Object.keys(o.callbacks).length>0?i(V,{children:[i("dt",{children:a("Callbacks")}),i("dd",{children:i("code",{class:"small",children:JSON.stringify(o.callbacks)})})]}):null]}),o.jids&&o.jids.length>0&&i(V,{children:[i("h2",{class:"mt",children:a("Pending job IDs")}),i("div",{class:"stack",style:{gap:"4px"},children:o.jids.slice(0,50).map((v)=>i(oi,{jid:v},v))})]})]})]})]})}var Yo={1:c("per second"),60:c("per minute"),3600:c("per hour"),86400:c("per day")},Z1=(d)=>Object.hasOwn(Yo,d)?a(Yo[d]):a("per {time}",{time:li(d)}),Zo={concurrent:c("Concurrent"),bucket:c("Bucket"),window:c("Sliding window"),leaky:c("Leaky bucket"),points:c("Points")};function Wo(){let d=E("limiters",{},5);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Rate limits")}),i("p",{class:"subtitle",children:a("Shared limits that keep jobs from overwhelming APIs and databases. Jobs over a limit are rescheduled, not failed.")})]})}),!r?i("section",{class:"panel",children:i(U,{})}):!r.available?i(Ji,{title:a("Rate limits aren't available on this server"),hint:a("This server's Robin version doesn't include rate limiting.")}):(r.limiters??[]).length===0?i("section",{class:"panel",children:i($,{title:a("No rate limiters yet"),icon:"limiters",children:a('They appear here the first time a job calls one, e.g. Robin::Limiter.concurrent("stripe", 10).')})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Limiter")}),i("th",{children:a("Kind")}),i("th",{style:{width:"26%"},children:a("In use")}),i("th",{class:"r",children:a("Times over limit")}),i("th",{children:a("Last used")}),i("th",{})]})}),i("tbody",{children:r.limiters.map((o)=>{let p=o.used??0,l=p>=o.limit;return i("tr",{children:[i("td",{class:"cls",children:o.name}),i("td",{children:[Object.hasOwn(Zo,o.type)?a(Zo[o.type]):o.type,o.interval?i("span",{class:"dim",children:[" ",Z1(o.interval)]}):null]}),i("td",{children:[i("div",{class:"qbar","aria-hidden":"true",children:i("span",{style:{width:`${Li(p,o.limit)}%`,background:l?"var(--ruby)":"var(--egg)"}})}),i("div",{class:"small",children:[i("span",{class:"num",children:a("{used} of {limit}",{used:K(p),limit:K(o.limit)})}),l&&i("span",{class:"err",children:[" ",a("at limit")]})]})]}),i("td",{class:"r",children:K(o.over_limit_count??0)}),i("td",{children:i(T,{at:o.last_used_at})}),i("td",{class:"r",children:Z("limiters")&&i("div",{class:"btn-group",children:[i("button",{class:"btn btn-small",onClick:()=>B(()=>A(`limiters/${w(o.name)}/reset`),a("Reset {limiter}",{limiter:o.name}),{title:a("Reset {limiter}?",{limiter:o.name}),body:a("Its current usage is cleared, so waiting jobs may run right away."),action:a("Reset")}).then(d.reload),children:a("Reset")}),i("button",{class:"btn btn-small btn-danger",onClick:()=>B(()=>Ii(`limiters/${w(o.name)}`),a("Deleted {limiter}",{limiter:o.name}),{title:a("Delete {limiter}?",{limiter:o.name}),body:a("Its state and statistics are removed. It's recreated the next time a job uses it."),action:a("Delete"),danger:!0}).then(d.reload),children:a("Delete")})]})})]},o.name)})})]})})})]})}function W1(d,r){return B(()=>A(`cron/${w(d.id)}/enqueue`),(o)=>a("Enqueued {job} as {jid}",{job:d.class,jid:o.jid})).then(r)}function Q1(d,r){return B(()=>A(`cron/${w(d.id)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {job}",{job:d.class}):a("Paused {job}",{job:d.class})).then(r)}function Qo({j:d,reload:r}){return i("div",{class:"btn-group",children:[Z("enqueue")&&i("button",{class:"btn btn-small",onClick:()=>W1(d,r),children:a("Run now")}),Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>Q1(d,r),children:d.paused?a("Resume"):a("Pause")})]})}function Do(){let d=E("cron",{},15);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Cron")}),i("p",{class:"subtitle",children:r?.leader?q("Jobs pushed on a schedule by the cluster leader, currently {leader}.",{leader:i("strong",{children:wi(r.leader).host})}):a("Jobs pushed on a schedule by the cluster leader.")})]})}),!r?i("section",{class:"panel",children:i(U,{})}):!r.available?i(Ji,{title:a("Cron jobs aren't available on this server"),hint:a("This server's Robin version doesn't include periodic jobs.")}):(r.jobs??[]).length===0?i("section",{class:"panel",children:i($,{title:a("No cron jobs registered"),icon:"cron",children:q("Register them inside {block} with {code}.",{block:i("code",{children:"configure_server"}),code:i("code",{children:'config.periodic { |cron| cron.register "0 * * * *", "HourlyJob" }'})})})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Schedule")}),i("th",{children:a("Job")}),i("th",{children:a("Next run")}),i("th",{children:a("Last run")}),i("th",{})]})}),i("tbody",{children:r.jobs.map((o)=>i("tr",{children:[i("td",{children:[i(m,{href:`/cron/${w(o.id)}`,class:"mono",children:o.cron}),o.tz&&i("span",{class:"dim small",children:[" ",o.tz]}),o.description&&i("div",{class:"small dim",children:o.description})]}),i("td",{children:[i(hi,{name:o.class})," ",i("span",{class:"dim small",children:a("in {queue}",{queue:o.queue})}),o.args.length?i("div",{class:"args",children:fi(o.args,60)}):null]}),i("td",{children:o.paused?i("span",{class:"badge amber",children:a("Paused")}):i(T,{at:o.next_at})}),i("td",{children:i(T,{at:o.last_at})}),i("td",{class:"r",children:i(Qo,{j:o,reload:d.reload})})]},o.id))})]})})})]})}function Ro({id:d}){let r=E(`cron/${w(d)}`,{},15);if(r.error&&!r.data)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:"/cron",children:a("Cron")})}),i(O,{message:r.error,onRetry:r.reload})]});if(!r.data)return i(U,{rows:8});if(!r.data.job)return i(Ji,{title:a("Cron jobs aren't available on this server"),hint:a("This server's Robin version doesn't include periodic jobs.")});let o=r.data.job,p=r.data.history??[];return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/cron",children:a("Cron")})}),i("h1",{children:o.class}),i("p",{class:"subtitle",children:[i("span",{class:"mono",children:o.cron}),o.tz?` ${a("in {zone}",{zone:o.tz})}`:"",o.description?`, ${o.description}`:""]})]}),i("span",{class:"spacer"}),i(Qo,{j:o,reload:r.reload})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Recent runs")})}),p.length===0?i($,{title:a("Hasn't run yet"),icon:"cron",children:a("Runs show up here once the leader enqueues this job.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Enqueued")}),i("th",{children:a("Job ID")})]})}),i("tbody",{children:p.map((l)=>i("tr",{children:[i("td",{children:i(T,{at:l.at})}),i("td",{children:i(m,{href:`/jobs/${w(l.jid)}`,class:"mono small",children:l.jid})})]},l.jid))})]})})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i("dl",{class:"kv",children:[i("dt",{children:a("Queue")}),i("dd",{children:i(m,{href:`/queues/${w(o.queue)}`,children:o.queue})}),i("dt",{children:a("Arguments")}),i("dd",{class:"args",children:fi(o.args)}),i("dt",{children:a("Next run")}),i("dd",{children:o.paused?a("Paused"):i(T,{at:o.next_at})}),i("dt",{children:a("Last run")}),i("dd",{children:i(T,{at:o.last_at})}),o.last_jid&&i(V,{children:[i("dt",{children:a("Last job")}),i("dd",{children:i(oi,{jid:o.last_jid})})]})]})]})]})]})}var Oo={read:c("View the dashboard"),retry:c("Retry and enqueue jobs"),edit:c("Edit job arguments"),delete:c("Delete jobs and clear queues"),kill:c("Kill jobs"),pause:c("Pause queues and cron jobs"),cancel:c("Cancel jobs"),process_control:c("Quiet and stop processes"),enqueue:c("Run cron jobs now"),limiters:c("Reset rate limiters"),batches:c("Delete batches"),profiles:c("Delete job profiles"),extensions:c("Use actions on extension pages")};function D1(){let{code:d}=P(ki);return i("label",{class:"row",children:[i("span",{class:"sr-only",children:a("Language")}),i("select",{class:"select",value:d,onChange:(r)=>void ld(r.target.value),children:Object.entries(Bi).map(([r,o])=>i("option",{value:r,lang:r,children:o.name},r))})]})}function Uo(){let d=P(vi),r=E("info");if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data,p=o?.redis??{},l=Number(p.keyspace_hits??0),v=Number(p.keyspace_misses??0);return i(V,{children:[i("div",{class:"page-head",children:i("div",{class:"row",style:{gap:"18px",alignItems:"center"},children:[Qi&&i("img",{src:Qi,alt:a("Robin, a red-bellied bird in a mask"),width:84,height:84}),i("div",{children:[i("h1",{children:["Robin ",d.version]}),i("p",{class:"subtitle",children:a("Fast, reliable background jobs for Ruby. Free and open source under the LGPL.")})]})]})}),!o?i(U,{rows:8}):i("div",{class:"grid-2",children:[i("section",{class:"panel panel-pad",children:[i("h2",{children:"Robin"}),i("dl",{class:"kv",children:[i("dt",{children:a("Version")}),i("dd",{children:o.robin.version}),i("dt",{children:"Ruby"}),i("dd",{class:"small",children:o.robin.ruby}),i("dt",{children:a("Cluster")}),i("dd",{children:d.cluster}),i("dt",{children:a("Processes")}),i("dd",{children:K(o.processes)}),i("dt",{children:a("Leader")}),i("dd",{children:o.leader?wi(o.leader).host:a("None elected")}),i("dt",{children:a("Key prefix")}),i("dd",{children:i("code",{children:o.robin.key_prefix})}),i("dt",{children:a("Default retries")}),i("dd",{children:o.robin.max_retries}),i("dt",{children:a("Dead set")}),i("dd",{children:a("{jobs} jobs, kept {days} days",{jobs:K(o.robin.dead_max_jobs),days:o.robin.dead_timeout_days})}),i("dt",{children:a("Protocol parser")}),i("dd",{children:o.robin.native_resp?a("Native extension"):a("Pure Ruby")})]})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:"Redis"}),i("dl",{class:"kv",children:[i("dt",{children:a("Server")}),i("dd",{children:i("code",{children:o.redis_url})}),i("dt",{children:a("Version")}),i("dd",{children:[p.redis_version??"–"," ",p.role&&i("span",{class:"dim",children:["(",p.role,")"]})]}),i("dt",{children:a("Uptime")}),i("dd",{children:p.uptime_in_seconds?li(Number(p.uptime_in_seconds)):"–"}),i("dt",{children:a("Memory")}),i("dd",{children:[p.used_memory_human??"–",p.used_memory_peak_human&&i("span",{class:"dim",children:[" ",a("(peak {memory})",{memory:p.used_memory_peak_human})]})]}),i("dt",{children:a("Max memory")}),i("dd",{children:[p.maxmemory_human==="0B"?a("Unlimited"):p.maxmemory_human??"–"," ",p.maxmemory_policy&&i("span",{class:"dim",children:p.maxmemory_policy})]}),i("dt",{children:a("Clients")}),i("dd",{children:p.connected_clients??"–"}),i("dt",{children:a("Ops per second")}),i("dd",{children:p.instantaneous_ops_per_sec??"–"}),i("dt",{children:a("Hit rate")}),i("dd",{children:l+v?a("{pct}%",{pct:t(l/(l+v)*100,1)}):"–"})]}),p.maxmemory_policy&&p.maxmemory_policy!=="noeviction"&&i("p",{class:"notice mt",children:a("Redis may evict keys under memory pressure ({policy}). Set maxmemory-policy to noeviction so jobs are never silently dropped.",{policy:p.maxmemory_policy})})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Your access")}),d.read_only&&i("p",{class:"notice mb",children:a("This dashboard is read-only.")}),i("dl",{class:"kv",children:Object.entries(d.permissions).map(([b,n])=>i(V,{children:[i("dt",{children:Object.hasOwn(Oo,b)?a(Oo[b]):b}),i("dd",{children:n?a("Allowed"):i("span",{class:"dim",children:a("Not allowed")})})]}))})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Language")}),i(D1,{}),i("h2",{class:"mt",children:a("Keyboard")}),i("dl",{class:"kv",children:[i("dt",{children:i("kbd",{children:"/"})}),i("dd",{children:a("Find a job by ID")}),i("dt",{children:i("kbd",{children:"Esc"})}),i("dd",{children:a("Close dialogs and the menu")})]}),i("h2",{class:"mt",children:"Prometheus"}),i("p",{class:"small",children:q("Scrape {path} for queue sizes, latency and job counters.",{path:i("code",{children:new URL("metrics",document.baseURI).pathname})})})]})]})]})}function R1(d){if(d<1024)return a("{n} B",{n:d});if(d<1048576)return a("{n} KB",{n:t(d/1024,1)});return a("{n} MB",{n:t(d/1024/1024,1)})}function $o(){let d=E("profiles",{},15);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data?.profiles;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Profiles")}),i("p",{class:"subtitle",children:q("Where single job runs spent their time. Download one and drop it onto the {profiler} to explore it.",{profiler:i("a",{href:"https://profiler.firefox.com",target:"_blank",rel:"noreferrer",children:"Firefox Profiler"})})})]})}),i("section",{class:"panel",children:!r?i(U,{}):r.length===0?i($,{title:a("No profiles yet"),icon:"profiles",children:q("Push a job with {code} (servers need the vernier gem) and its run shows up here for a week.",{code:i("code",{children:"set(profile: true)"})})}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{children:a("Label")}),i("th",{class:"r",children:a("Took")}),i("th",{children:a("Result")}),i("th",{children:a("Recorded")}),i("th",{class:"r",children:a("Size")}),i("th",{})]})}),i("tbody",{children:r.map((o)=>i("tr",{children:[i("td",{children:[i(m,{href:`/metrics/jobs/${w(o.class)}`,class:"cls",children:o.class}),i("div",{class:"dim small mono",children:[o.jid,o.queue&&i(V,{children:[" · ",o.queue]})]})]}),i("td",{children:o.label??i("span",{class:"dim",children:"–"})}),i("td",{class:"r num",children:Yi(o.duration_ms)}),i("td",{children:o.ok?i("span",{class:"badge egg",children:a("Succeeded")}):i("span",{class:"badge ruby",children:a("Failed")})}),i("td",{children:i(T,{at:o.started_at})}),i("td",{class:"r num",children:R1(o.bytes)}),i("td",{class:"r",children:i("div",{class:"btn-group",children:[i("a",{class:"btn btn-small",href:Ei(`profiles/${w(o.jid)}`),download:`robin-${o.jid}.json`,children:[i(ii,{name:"download",width:14,height:14})," ",a("Download")]}),Z("profiles")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>B(()=>Ii(`profiles/${w(o.jid)}`),a("Profile deleted"),{title:a("Delete this profile?"),body:a("The profile of {job} ({jid}) is removed.",{job:o.class,jid:o.jid}),action:a("Delete"),danger:!0}).then(d.reload),children:a("Delete")})]})})]},o.jid))})]})})})]})}function Bo(d){return d===null?"–":d.toLocaleString(e())}var O1={load:(d)=>import(d)};function U1(d,r={}){let o=e();return{slug:d,locale:o,t:(p,l={})=>pd(Object.hasOwn(r,p)?r[p]:p,l),data:(p,l={})=>Ti(`extensions/${w(d)}/data/${w(p)}`,{...l,locale:o}),action:async(p,l={})=>(await A(`extensions/${w(d)}/actions/${w(p)}`,l,{locale:o})).message,toast:zi,navigate:(p)=>j(p)}}function $1({page:d}){let r=Vi(null),[o,p]=R(null),{slug:l,script:v,stylesheet:b,messages:n}=d;return S(()=>{if(!b)return;let z=document.createElement("link");return z.rel="stylesheet",z.href=new URL(b,document.baseURI).href,document.head.append(z),()=>z.remove()},[b]),S(()=>{let z=!1,y;return O1.load(new URL(v,document.baseURI).href).then((h)=>{let k=r.current;if(z||!k)return;if(typeof h.default!=="function"){p(a("{script} has no default export to call.",{script:v}));return}y=h.default(k,U1(l,n))},(h)=>p(a("{script} couldn't be loaded: {error}",{script:v,error:h.message}))),()=>{if(z=!0,typeof y==="function")y()}},[l,v,n]),i(V,{children:[o&&i(O,{message:o}),i("div",{class:"ext-script",ref:r})]})}function B1({slug:d,items:r,reload:o}){if(!Z("extensions"))return null;return i("div",{class:"btn-group",children:r.map((p)=>i("button",{class:p.danger?"btn btn-danger":"btn",onClick:()=>B(()=>A(`extensions/${w(d)}/actions/${w(p.action)}`,void 0,{locale:e()}),(l)=>l.message,p.confirm?{title:p.confirm,action:p.label,danger:p.danger}:void 0).then(o),children:p.label},p.action))})}function E1({block:d,slug:r,reload:o}){switch(d.type){case"heading":return i("h2",{class:"ext-heading",children:d.text});case"text":return i("p",{class:"ext-text",children:d.text});case"stats":return i("div",{class:"facts",children:d.items.map((p)=>i("div",{class:"fact",children:[i("span",{class:"fact-value",children:Bo(p.value)}),i("span",{class:"fact-label",children:p.label})]},p.label))});case"table":return i("section",{class:"panel ext-block",children:d.rows.length===0?i($,{title:a("Nothing to show")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:d.columns.map((p)=>i("th",{children:p},p))})}),i("tbody",{children:d.rows.map((p,l)=>i("tr",{children:p.map((v,b)=>i("td",{children:Bo(v)},b))},l))})]})})});case"actions":return i("div",{class:"ext-block",children:i(B1,{slug:r,items:d.items,reload:o})})}return null}function Eo({slug:d}){let r=E(`extensions/${w(d)}`,{locale:e()},0);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:i("h1",{children:o?ei(o):a("Loading…")})})}),!o?i("section",{class:"panel",children:i(U,{})}):o.blocks.length===0&&!o.script?i("section",{class:"panel",children:i($,{title:a("This page is empty"),icon:"extension"})}):i(V,{children:[o.blocks.map((p,l)=>i(E1,{block:p,slug:d,reload:r.reload},l)),o.script&&i($1,{page:{...o,script:o.script}})]})]})}function To(){return i("section",{class:"panel",children:i($,{title:a("There's nothing at this address"),icon:"search",children:q("The page may have moved. {link}.",{link:i(m,{href:"/",children:a("Go to the dashboard")})})})})}var T1=[["/",()=>i(lo,{})],["/busy",()=>i(go,{})],["/queues",()=>i(yo,{})],["/queues/:name",(d)=>i(co,{name:d.name})],["/scheduled",()=>i(Id,{set:"scheduled"})],["/retries",()=>i(Id,{set:"retries"})],["/dead",()=>i(Id,{set:"dead"})],["/sets/:set/:id",(d)=>i(ko,{set:d.set,id:d.id})],["/jobs/:jid",(d)=>i(wo,{jid:d.jid})],["/metrics",()=>i(Ho,{})],["/metrics/jobs/:klass",(d)=>i(Io,{klass:d.klass})],["/batches",()=>i(Mo,{})],["/batches/:bid",(d)=>i(Ko,{bid:d.bid})],["/limiters",()=>i(Wo,{})],["/cron",()=>i(Do,{})],["/cron/:id",(d)=>i(Ro,{id:d.id})],["/profiles",()=>i($o,{})],["/ext/:slug",(d)=>i(Eo,{slug:d.slug})],["/settings",()=>i(Uo,{})]],Lo={"/":c("Dashboard"),"/busy":c("Busy"),"/queues":c("Queues"),"/scheduled":c("Scheduled"),"/retries":c("Retries"),"/dead":c("Dead"),"/metrics":c("Metrics"),"/batches":c("Batches"),"/limiters":c("Rate limits"),"/cron":c("Cron"),"/profiles":c("Profiles"),"/settings":c("Settings")};function L1(){let{path:d}=ri(),r=P(vi),{code:o}=P(ki),[p,l]=R(null);if(S(()=>{qd().then(Si,(b)=>l(b.message))},[]),S(()=>{let b=r?.title??"Robin",n=Nd("/ext/:slug",d)&&r?.extensions?.find((h)=>`/ext/${encodeURIComponent(h.slug)}`===d),z=Lo[d]??Lo[`/${d.split("/")[1]}`],y=z?a(z):n&&ei(n);document.title=y?`${y} | ${b}`:b},[d,r,o]),p)return i("div",{style:{padding:"40px",maxWidth:"640px"},children:i(O,{message:a("Robin couldn't load: {error}",{error:p}),onRetry:()=>location.reload()})});if(!r)return null;let v=i(To,{});for(let[b,n]of T1){let z=Nd(b,d);if(z){v=n(z);break}}return i(V,{children:[i(Fr,{children:v}),i(ur,{}),i(tr,{})]})}gd();ld(Wr(),!1).finally(()=>nr(i(L1,{}),document.getElementById("app")));
|
|
7
|
+
`]})),o,"}"]})}function yd({value:d}){return i("pre",{class:"code",children:i(Fd,{value:d,indent:0})})}function ur({lines:d}){return i("pre",{class:"code",children:d.map((r)=>i("div",{class:/\/(gems|ruby|rubygems)\//.test(r)?"bt-lib":"bt-app",children:r}))})}function tr(){let d=P(nd);return i("div",{class:"toasts",role:"status","aria-live":"polite",children:d.map((r)=>i("div",{class:`toast ${r.kind}`,children:[i(ii,{name:r.kind==="error"?"alert":"check"}),r.message]},r.id))})}function xr(){let d=P(fd),r=Vi(null);S(()=>{let p=r.current;if(d&&!p.open)p.showModal();if(!d&&p.open)p.close()},[d]);let o=(p)=>{d?.resolve(p),fd.set(null)};return i("dialog",{class:"confirm",ref:r,onCancel:(p)=>{p.preventDefault(),o(!1)},"aria-labelledby":"confirm-title",children:d&&i("form",{method:"dialog",onSubmit:(p)=>{p.preventDefault(),o(!0)},children:[i("h3",{id:"confirm-title",children:d.title}),d.body&&i("p",{children:d.body}),i("div",{class:"btn-group",children:[i("button",{type:"button",class:"btn",onClick:()=>o(!1),autofocus:!!d.danger,children:a("Cancel")}),i("button",{type:"submit",class:d.danger?"btn btn-danger solid":"btn btn-primary",autofocus:!d.danger,children:d.action})]})]})})}function ro(){let d=Vi(null),[r,o]=R(0);return Hr(()=>{let p=d.current;o(p.clientWidth);let l=new ResizeObserver(([v])=>{o(Math.round(v.contentRect.width))});return l.observe(p),()=>{l.disconnect()}},[]),[d,r]}var c1=c("Succeeded"),V1=c("Failed");function Di(){return[{label:a(c1),cls:"s-processed"},{label:a(V1),cls:"s-failed"}]}function Pi(d,r){let[o,p]=Di();return[{...o,values:d,area:!0},{...p,values:r}]}var D={top:12,right:16,bottom:26,left:44};function jr(d,r,o){return d.map((p,l)=>`${l?"L":"M"}${r(l).toFixed(1)},${o(p).toFixed(1)}`).join("")}var k1={"s-processed":"processed","s-failed":"failed"};function oo({s:d}){return i("i",{class:`swatch ${d.cls?k1[d.cls]:""}`,style:d.color?{background:`var(${d.color})`}:void 0})}function Ri({series:d}){if(d.length<2)return null;return i("div",{class:"legend","aria-hidden":"true",children:d.map((r)=>i("span",{children:[i(oo,{s:r}),r.label]},r.label))})}function ao({left:d,title:r,series:o,at:p,format:l,marks:v=[]}){return i("div",{class:"tooltip",style:{left:`${d}px`,top:`${D.top}px`},children:[i("div",{class:"tt-title",children:r}),o.map((b)=>i("div",{class:"tt-row",children:[i(oo,{s:b}),i("span",{children:b.label}),i("span",{children:l(b.values[p]??0)})]},b.label)),v.map((b)=>i("div",{class:"tt-row tt-mark",children:[i("i",{class:"swatch mark"}),i("span",{children:po(b)})]},b.at))]})}var po=(d)=>d.label?a("Deploy: {label}",{label:d.label}):a("Deploy"),sr=(d,r,o)=>d.filter((p)=>p.at>=r&&p.at<o);function Oi({xs:d,series:r,height:o=220,xLabel:p,yFormat:l=(n)=>K(n,!0),label:v,marks:b=[]}){let[n,z]=ro(),[y,h]=R(null),k=d.length,M=Math.max(1,...r.flatMap((H)=>H.values)),g=Ad(M),X=g[g.length-1],f=Math.max(0,z-D.left-D.right),I=o-D.top-D.bottom,W=(H)=>D.left+(k<=1?f/2:H/(k-1)*f),J=(H)=>D.top+I-H/X*I,_=Math.max(1,Math.ceil(k/Math.max(2,Math.floor(f/90)))),Y=d[1]-d[0],u=sr(b,d[0],d[k-1]+Y),pi=(H)=>D.left+Math.min(1,(H-d[0])/(d[k-1]-d[0]))*f,bi=(H)=>{if(k===0)return;let ni=H.currentTarget.getBoundingClientRect(),di=H.clientX-ni.left-D.left;h(Math.max(0,Math.min(k-1,Math.round(di/f*(k-1)))))};return i("div",{class:"chart",ref:n,children:[z>0&&i("svg",{width:z,height:o,role:"img","aria-label":v,onMouseMove:bi,onMouseLeave:()=>h(null),children:[i("g",{class:"grid",children:g.map((H)=>i("line",{x1:D.left,x2:D.left+f,y1:J(H),y2:J(H)},H))}),i("g",{class:"axis",children:[g.map((H)=>i("text",{x:D.left-8,y:J(H)+4,"text-anchor":"end",children:l(H)},H)),d.map((H,ni)=>ni%_===0?i("text",{x:W(ni),y:o-6,"text-anchor":ni===0?"start":"middle",children:p(H)},H):null)]}),i("line",{class:"baseline",x1:D.left,x2:D.left+f,y1:J(0),y2:J(0)}),r.map((H)=>i("g",{class:H.cls,style:H.color?{stroke:`var(${H.color})`,fill:`var(${H.color})`}:void 0,children:[H.area&&k>1&&i("path",{class:"area",d:`${jr(H.values,W,J)}L${W(k-1)},${J(0)}L${W(0)},${J(0)}Z`}),i("path",{class:"line",d:jr(H.values,W,J)})]},H.label)),u.map((H)=>i("g",{class:"mark",children:[i("line",{x1:pi(H.at),x2:pi(H.at),y1:D.top,y2:D.top+I}),i("title",{children:po(H)})]},H.at)),y!==null&&i("g",{children:[i("line",{class:"crosshair",x1:W(y),x2:W(y),y1:D.top,y2:D.top+I}),r.map((H)=>i("circle",{class:`dot ${H.cls??""}`,style:H.color?{fill:`var(${H.color})`}:void 0,cx:W(y),cy:J(H.values[y]??0),r:4.5},H.label))]}),i("rect",{x:D.left,y:D.top,width:f,height:I,fill:"transparent"})]}),y!==null&&z>0&&i(ao,{left:Math.min(W(y)+12,z-170),title:p(d[y]),series:r,at:y,format:l,marks:sr(u,d[y],d[y]+Y)})]})}function Sd({labels:d,series:r,height:o=200,label:p,tickLabel:l=(b)=>b,titleFor:v=(b)=>b}){let[b,n]=ro(),[z,y]=R(null),h=d.length,k=d.map((Y,u)=>r.reduce((pi,bi)=>pi+(bi.values[u]??0),0)),M=Ad(Math.max(1,...k)),g=M[M.length-1],X=Math.max(0,n-D.left-D.right),f=o-D.top-D.bottom,I=h?X/h:0,W=Math.max(2,Math.min(28,I*0.62)),J=(Y)=>D.top+f-Y/g*f,_=Math.max(1,Math.ceil(h/Math.max(2,Math.floor(X/70))));return i("div",{class:"chart",ref:b,children:[n>0&&i("svg",{width:n,height:o,role:"img","aria-label":p,onMouseLeave:()=>y(null),children:[i("g",{class:"grid",children:M.map((Y)=>i("line",{x1:D.left,x2:D.left+X,y1:J(Y),y2:J(Y)},Y))}),i("g",{class:"axis",children:[M.map((Y)=>i("text",{x:D.left-8,y:J(Y)+4,"text-anchor":"end",children:K(Y,!0)},Y)),d.map((Y,u)=>u%_===0?i("text",{x:D.left+I*u+I/2,y:o-6,"text-anchor":"middle",children:l(Y)},Y):null)]}),d.map((Y,u)=>{let pi=0,bi=D.left+I*u+I/2;return i("g",{onMouseEnter:()=>y(u),children:[i("rect",{x:D.left+I*u,y:D.top,width:I,height:f,fill:"transparent"}),r.map((H,ni)=>{let di=H.values[u]??0;if(di<=0)return null;let gi=J(pi);pi+=di;let ai=J(pi),s=ni>0?2:0;return i("rect",{class:`${H.cls==="s-failed"?"bar bar-failed":"bar"}${z===u?" on":""}`,x:bi-W/2,y:ai,width:W,height:Math.max(1,gi-ai-s),rx:Math.min(3,W/3)},H.label)})]},Y)}),i("line",{class:"baseline",x1:D.left,x2:D.left+X,y1:J(0),y2:J(0)})]}),z!==null&&n>0&&i(ao,{left:Math.min(D.left+I*z+I/2+12,n-170),title:v(d[z]),series:r,at:z,format:(Y)=>K(Y)})]})}function lo({buckets:d,height:r=200}){let o=d.map((n,z)=>n.le===null?`> ${io(d[z-1]?.le??0)}`:`≤ ${io(n.le)}`),p=d.findIndex((n)=>n.count>0);if(p<0)return i("div",{class:"chart-empty",style:{height:`${r}px`},children:a("No executions in this window")});let l=d.findLastIndex((n)=>n.count>0),v=Math.max(0,p-1),b=l+2;return i(Sd,{label:a("Execution time histogram"),labels:o.slice(v,b),series:[{label:a("Jobs"),cls:"s-processed",values:d.slice(v,b).map((n)=>n.count)}],height:r,tickLabel:(n)=>n.replace("≤ ",""),titleFor:(n)=>a("Took {time}",{time:n})})}function io(d){return d>=1000?`${d/1000}s`:`${d}ms`}function w1({stats:d,perMinute:r,queues:o}){let p=o.reduce((v,b)=>!v||b.latency>v.latency?b:v,null),l=[];if(d.processes===0)l.push(i(V,{children:[a("No Robin processes are running.")," "]}),d.enqueued>0?Ki("{jobs} is waiting for one to start.","{jobs} are waiting for one to start.",d.enqueued,{jobs:i(m,{href:"/queues",children:i("b",{children:Q("{n} job","{n} jobs",d.enqueued)})})}):i(V,{children:a("Nothing is waiting, either.")}));else{let v=i(m,{href:"/busy",children:i("b",{children:Q("{n} process","{n} processes",d.processes)})});if(l.push(i(V,{children:[r?Ki("Robin is working through {rate} job a minute on {processes}","Robin is working through {rate} jobs a minute on {processes}",r,{rate:i("b",{children:K(r)}),processes:v}):d.busy>0?q("Robin is running on {processes}",{processes:v}):q("Robin is standing by on {processes}",{processes:v}),d.busy>0?Ki(", with {threads} thread busy right now.",", with {threads} threads busy right now.",d.busy,{threads:i("b",{children:K(d.busy)})}):a(".")," "]})),d.enqueued>0&&p&&p.latency>=1)l.push(i(V,{children:[q("The oldest of {jobs} has been in {queue} for {time}.",{jobs:i("b",{children:Q("{n} waiting job","{n} waiting jobs",d.enqueued)}),queue:i(m,{href:`/queues/${encodeURIComponent(p.name)}`,children:p.name}),time:i("b",{children:li(p.latency)})})," "]}))}return l.push(d.retries>0?i(V,{children:[i(m,{href:"/retries",class:"warn",children:Ki("{jobs} is waiting to retry","{jobs} are waiting to retry",d.retries,{jobs:i("b",{children:Q("{n} job","{n} jobs",d.retries)})})}),a(".")]}):i("span",{class:"calm",children:a("Nothing is waiting to retry.")})),i("p",{class:"status-line","aria-live":"polite",children:l})}function X1({stats:d}){let r=[[c("Processed"),d.processed,"/metrics"],[c("Failed"),d.failed,"/metrics"],[c("Enqueued"),d.enqueued,"/queues"],[c("Scheduled"),d.scheduled,"/scheduled"],[c("Retries"),d.retries,"/retries",d.retries>0],[c("Dead"),d.dead,"/dead"]];return i("div",{class:"facts",children:r.map(([o,p,l,v])=>i(m,{href:l,class:`fact${v?" alert":""}`,children:[i("span",{class:"fact-value",children:K(p,!0)}),i("span",{class:"fact-label",children:a(o)})]},o))})}var H1=(d)=>new Date(d).toLocaleTimeString(e(),{hour:"2-digit",minute:"2-digit"});function vo(){let[d,r]=R(60),[o,p]=R(30),l=E("dashboard",{minutes:d,days:o},20),v=P(Xi);if(l.error&&!l.data)return i(O,{message:l.error,onRetry:l.reload});if(!l.data)return i(U,{rows:8});let b=l.data,n=v?.stats??b.stats,z=b.queues.map((f)=>({...f,size:v?.queues[f.name]??f.size})),y=b.realtime.slice(0,-1),h=y.at(-1),k=h?h.s+h.f:null,M=y.map((f)=>Zi(f.t)),g=Object.keys(b.history.processed).sort(),X=Math.max(1,...z.map((f)=>f.size));return i(V,{children:[i("h1",{class:"sr-only",children:a("Dashboard")}),i(w1,{stats:n,perMinute:k,queues:z}),i(X1,{stats:n}),i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Throughput")}),i("span",{class:"panel-note",children:a("Jobs finished per minute")}),i("span",{class:"spacer"}),i(Ri,{series:Di()}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:[60,240,480].map((f)=>i("button",{"aria-pressed":d===f,onClick:()=>r(f),children:a("{n} h",{n:f/60})},f))})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("Jobs succeeded and failed per minute"),xs:M,xLabel:H1,height:240,series:Pi(y.map((f)=>f.s),y.map((f)=>f.f))})})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Queues")}),i("span",{class:"spacer"}),i(m,{href:"/queues",class:"small",children:a("All queues")})]}),z.length===0?i("p",{class:"panel-pad dim",children:a("No queues yet. They appear as soon as a job is pushed.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Queue")}),i("th",{class:"r",children:a("Waiting")}),i("th",{style:{width:"28%"},children:i("span",{class:"sr-only",children:a("Relative size")})}),i("th",{class:"r",children:a("Latency")})]})}),i("tbody",{children:z.slice(0,8).map((f)=>i("tr",{children:[i("td",{class:"cls",children:[i(m,{href:`/queues/${encodeURIComponent(f.name)}`,children:f.name})," ",f.paused&&i("span",{class:"badge amber",children:a("Paused")})]}),i("td",{class:"r",children:K(f.size)}),i("td",{children:i("div",{class:"qbar","aria-hidden":"true",children:i("span",{style:{width:`${f.size/X*100}%`}})})}),i("td",{class:"r",children:i(ui,{seconds:f.latency})})]},f.name))})]})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Daily history")}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("History window"),children:[7,30,90].map((f)=>i("button",{"aria-pressed":o===f,onClick:()=>p(f),children:a("{n} d",{n:f})},f))})]}),i("div",{class:"panel-pad",children:[i(Sd,{label:a("Jobs succeeded and failed per day"),labels:g,tickLabel:(f)=>f.slice(5).replace("-","/"),titleFor:(f)=>new Date(`${f}T00:00:00Z`).toLocaleDateString(e(),{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}),series:Pi(g.map((f)=>Math.max(0,b.history.processed[f]-(b.history.failed[f]??0))),g.map((f)=>b.history.failed[f]??0))}),i("div",{class:"mt",children:i(Ri,{series:Di()})})]})]})]})]})}async function B(d,r,o){if(o&&!await Cr(o))return;try{let p=await d();return zi(typeof r==="function"?r(p):r),p}catch(p){zi(p.message,"error");return}}var A=(d,r,o)=>Td("POST",d,r,o),Ii=(d,r)=>Td("DELETE",d,r);function cd({progress:d}){let{pct:r,msg:o}=d,p=d.meta?.iterations;return i(V,{children:[r===null?i("div",{class:"progress progress-unknown",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,children:i("span",{class:"p-run"})}):i("div",{class:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i("span",{class:"p-ok",style:{width:`${r}%`}})}),i("div",{class:"progress-label",children:[i("span",{children:o??(typeof p==="number"?a("{n} done",{n:K(p)}):"")}),i("span",{class:"num",children:r===null?"":a("{pct}%",{pct:t(r,Number.isInteger(r)?0:1)})})]})]})}function Vd({job:d,where:r,when:o}){return i("dl",{class:"kv",children:[i("dt",{children:a("Job")}),i("dd",{children:i(hi,{name:d.class,wrapper:d.wrapper})}),i("dt",{children:a("Job ID")}),i("dd",{children:i(oi,{jid:d.jid})}),i("dt",{children:a("Queue")}),i("dd",{children:i(m,{href:`/queues/${w(d.queue)}`,children:d.queue})}),r&&i(V,{children:[i("dt",{children:a("Where it is")}),i("dd",{children:r})]}),d.at&&i(V,{children:[i("dt",{children:o??a("Runs")}),i("dd",{children:i(T,{at:d.at})})]}),i("dt",{children:a("Created")}),i("dd",{children:i(T,{at:d.created_at})}),d.enqueued_at&&i(V,{children:[i("dt",{children:a("Enqueued")}),i("dd",{children:i(T,{at:d.enqueued_at})})]}),d.failures?i(V,{children:[i("dt",{children:a("Failures")}),i("dd",{class:"num",children:d.failures})]}):null,d.failed_at&&i(V,{children:[i("dt",{children:a("First failed")}),i("dd",{children:i(T,{at:d.failed_at})})]}),d.retried_at&&i(V,{children:[i("dt",{children:a("Last failed")}),i("dd",{children:i(T,{at:d.retried_at})})]}),d.bid&&i(V,{children:[i("dt",{children:a("Batch")}),i("dd",{children:i(m,{href:`/batches/${w(d.bid)}`,class:"mono",children:d.bid})})]}),d.tags.length>0&&i(V,{children:[i("dt",{children:a("Tags")}),i("dd",{children:i(Hi,{tags:d.tags})})]}),d.info?.map((p)=>i(V,{children:[i("dt",{children:p.label}),i("dd",{children:p.href?i("a",{href:p.href,rel:"noopener noreferrer",children:p.text}):p.text})]},p.label))]})}function kd({job:d}){if(!d.error_class)return null;return i("section",{class:"stack mt",children:[i("div",{class:"error-box",children:[i("span",{class:"err",children:d.error_class}),i("span",{class:"err-msg",children:d.error_message})]}),d.backtrace&&d.backtrace.length>0&&i("div",{children:[i("h2",{children:a("Backtrace")}),i(ur,{lines:d.backtrace})]})]})}function bo({set:d,job:r,onDone:o}){let[p,l]=R(JSON.stringify(r.args,null,2)),[v,b]=R(null),n=async()=>{let z;try{z=JSON.parse(p)}catch(h){b(a("That isn't valid JSON: {error}",{error:h.message}));return}if(!Array.isArray(z)){b(a('Arguments must be a JSON array, like [1, "two"].'));return}b(null);let y=await B(()=>A(`sets/${d}/${w(r.id)}/edit`,{args:z}),(h)=>a("Enqueued with new arguments as {jid}",{jid:h.jid}));if(y)o(),j(`/jobs/${w(y.jid)}`)};return i("div",{class:"panel panel-pad mt",children:[i("h2",{children:a("Edit arguments and retry")}),i("p",{class:"subtitle mb",children:a("The job is removed from this set and pushed again with a new job ID and a clean failure count.")}),i("textarea",{"aria-label":a("Job arguments as JSON"),class:"input",spellcheck:!1,value:p,onInput:(z)=>l(z.target.value)}),v&&i("p",{class:"err small",role:"alert",children:v}),i("div",{class:"btn-group mt",children:[i("button",{class:"btn btn-primary",onClick:n,children:a("Retry with these arguments")}),i("button",{class:"btn",onClick:o,children:a("Cancel")})]})]})}function wd({job:d}){if(!d.payload)return null;return i("section",{class:"mt",children:[i("h2",{children:a("Payload")}),i(yd,{value:d.payload})]})}function no({jid:d}){if(!Z("cancel"))return null;return i("button",{class:"btn",onClick:()=>B(()=>A(`jobs/${w(d)}/cancel`),a("Cancellation requested"),{title:a("Cancel this job?"),body:a("If it hasn't started, it's skipped. If it's running, cancelled? turns true so it can stop early."),action:a("Cancel job"),danger:!0}),children:a("Cancel job")})}var ho=[[void 0,c("All")],["processes",c("Processes")],["jobs",c("Running jobs")]];function ti(d,r,o){let p=d&&wi(d).host,l=d?`processes/${w(d)}/${r}`:`processes/${r}`,v=r==="stop"?{title:p?a("Stop {host}?",{host:p}):a("Stop every process?"),body:a("Running jobs get the shutdown timeout to finish; unfinished jobs go back on their queues."),action:a("Stop"),danger:!0}:r==="quiet"?{title:p?a("Quiet {host}?",{host:p}):a("Quiet every process?"),body:a("It finishes the jobs it's running but won't start new ones. This can't be undone without restarting it."),action:a("Quiet")}:void 0,b=r==="dump"?a("Thread dump requested; check the process logs"):r==="quiet"?a("Quiet signal sent"):a("Stop signal sent");return B(()=>A(l),b,v).then(o)}var go=1000,I1=50;function J1({identity:d,capsule:r,concurrency:o,label:p,reload:l}){let[v,b]=R(String(o));S(()=>b(String(o)),[o]);let n=Number(v),z=Number.isInteger(n)&&n>=1&&n<=go;return i("form",{class:"resize",onSubmit:(y)=>{y.preventDefault(),B(()=>A(`processes/${w(d)}/resize`,{concurrency:n,capsule:r}),a("Resize requested; the new thread count shows at the next heartbeat")).then(l)},children:[i("label",{children:[p," ",i("input",{class:"input",type:"number",min:1,max:go,step:1,required:!0,value:v,onInput:(y)=>b(y.target.value)})]}),i("button",{class:"btn btn-small",type:"submit",disabled:!z||n===o,children:a("Apply")})]})}function m1({pct:d}){let r=t(d,0);if(d>=I1)return i("span",{class:"lat-warn",title:a("Threads often wait for the GVL; CPU-heavy jobs may run better with fewer threads or more processes"),children:a("{pct}% high",{pct:r})});return i(V,{children:a("{pct}%",{pct:r})})}function M1({p:d,reload:r}){let{host:o,pid:p}=wi(d.identity),l=Z("process_control"),v=Object.entries(d.capsules??{default:{concurrency:d.concurrency,queues:{}}});return i("div",{class:"proc",children:[i("div",{children:[i("div",{class:"proc-name",children:[o,i("span",{class:"dim",children:[":",p]})," ",d.leader&&i("span",{class:"badge egg",title:a("Runs cron and recovery for the cluster"),children:a("Leader")})," ",d.quiet&&i("span",{class:"badge amber",children:a("Quiet")})," ",d.embedded&&i("span",{class:"badge",children:a("Embedded")})]}),i("div",{class:"proc-meta",children:[d.tag&&i(V,{children:[i("strong",{children:d.tag}),", "]}),q("working {queues}, started {time}",{queues:d.queues.join(", "),time:i(T,{at:d.started_at})})]}),i("div",{class:"threads","aria-label":Q("{busy} of {n} thread busy","{busy} of {n} threads busy",d.concurrency,{busy:d.busy}),children:Array.from({length:Math.min(d.concurrency,64)},(b,n)=>i("i",{class:n<d.busy?"on":""},n))}),l&&!d.quiet&&i("div",{class:"resizes",children:v.map(([b,n])=>i(J1,{identity:d.identity,capsule:b,concurrency:n.concurrency,reload:r,label:v.length===1?a("Threads"):a("{capsule} threads",{capsule:b})},b))})]}),i("div",{children:[i("div",{class:"proc-k",children:a("Busy")}),i("div",{class:"proc-v",children:[d.busy," / ",d.concurrency]})]}),i("div",{children:[i("div",{class:"proc-k",children:a("Memory")}),i("div",{class:"proc-v",children:Br(d.rss_kb)})]}),i("div",{class:"proc-hide",children:[i("div",{class:"proc-k",children:a("Redis RTT")}),i("div",{class:"proc-v",children:d.rtt_us?a("{n} ms",{n:t(d.rtt_us/1000,1)}):"–"})]}),i("div",{class:"proc-hide",children:d.gvl_contention!=null&&i(V,{children:[i("div",{class:"proc-k",title:a("Share of the last heartbeat interval threads spent waiting for Ruby's global VM lock (GVL)"),children:a("GVL wait")}),i("div",{class:"proc-v",children:i(m1,{pct:d.gvl_contention})})]})}),i("div",{class:"proc-hide",children:[i("div",{class:"proc-k",children:a("Heartbeat")}),i("div",{class:"proc-v",children:i(T,{at:d.beat})})]}),i("div",{class:"btn-group",children:[l&&i("button",{class:"btn btn-small",onClick:()=>ti(d.identity,"dump",r),title:a("Log every thread's backtrace"),children:a("Dump threads")}),l&&!d.quiet&&i("button",{class:"btn btn-small",onClick:()=>ti(d.identity,"quiet",r),children:a("Quiet")}),l&&i("button",{class:"btn btn-small btn-danger",onClick:()=>ti(d.identity,"stop",r),children:a("Stop")})]})]})}function fo(){let d=E("busy",{},3),{query:r}=ri(),o=ho.find(([b])=>b&&b===r.get("only"))?.[0];if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let p=d.data,l=p?.processes.reduce((b,n)=>b+n.concurrency,0)??0,v=p?.processes.reduce((b,n)=>b+n.busy,0)??0;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a("Busy")}),p&&i("p",{class:"subtitle",children:a("{processes} running {busy} of {threads}.",{processes:Q("{n} process","{n} processes",p.processes.length),busy:K(v),threads:Q("{n} thread","{n} threads",l)})})]}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("Show"),children:ho.map(([b,n])=>i("button",{"aria-pressed":o===b,onClick:()=>Wi({only:b}),children:a(n)},n))}),Z("process_control")&&p&&p.processes.length>0&&i("div",{class:"btn-group",children:[i("button",{class:"btn",onClick:()=>ti(null,"quiet",d.reload),children:a("Quiet all")}),i("button",{class:"btn btn-danger",onClick:()=>ti(null,"stop",d.reload),children:a("Stop all")})]})]}),o!=="jobs"&&i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Processes")})}),!p?i(U,{}):p.processes.length===0?i($,{title:a("No processes are running"),icon:"busy",children:q("Start one with {command} and it shows up here within a few seconds.",{command:i("code",{children:"bundle exec robin"})})}):i("div",{class:"proc-list",children:p.processes.map((b)=>i(M1,{p:b,reload:d.reload},b.identity))})]}),o!=="processes"&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Running jobs")})}),!p?i(U,{}):p.work.length===0?i($,{title:a("All threads are idle"),icon:"check",children:a("Jobs appear here while they run, with live progress if they report it.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),i("th",{children:a("Progress")}),i("th",{children:a("Process")}),i("th",{children:a("Started")}),i("th",{})]})}),i("tbody",{children:p.work.map((b)=>i("tr",{children:[i("td",{children:[i(hi,{name:b.job.class,wrapper:b.job.wrapper})," ",i(Hi,{tags:b.job.tags}),i("div",{children:[i(oi,{jid:b.job.jid})," ",i("span",{class:"dim small",children:q("in {queue}",{queue:i(m,{href:`/queues/${w(b.queue)}`,children:b.queue})})})]})]}),i("td",{class:"args",children:fi(b.job.args)}),i("td",{style:{minWidth:"160px"},children:b.progress?i(cd,{progress:b.progress}):i("span",{class:"dim",children:"–"})}),i("td",{class:"small",children:[wi(b.identity).host,i("div",{class:"dim",children:b.thread})]}),i("td",{children:i(T,{at:b.run_at})}),i("td",{class:"r",children:Z("cancel")&&i("button",{class:"btn btn-small",onClick:()=>B(()=>A(`jobs/${w(b.job.jid)}/cancel`),a("Cancellation requested"),{title:a("Cancel {job}?",{job:b.job.class}),body:a("The job sees cancelled? turn true and should stop at its next check."),action:a("Cancel job"),danger:!0}),children:a("Cancel")})})]},b.job.jid))})]})})]})]})}function Xd(d,r){return B(()=>A(`classes/${w(d.name)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {class}",{class:d.name}):a("Paused {class}",{class:d.name}),d.paused?void 0:{title:a("Pause {class}?",{class:d.name}),body:a("Workers set its jobs aside, in every queue, until you resume it. Jobs already running finish."),action:a("Pause class")}).then(r)}function Hd(d){let[r,o]=R(new Set),p=new Set(d.filter((v)=>r.has(v))),l=d.length>0&&p.size===d.length;return{selected:p,count:p.size,all:l,has:(v)=>p.has(v),toggle:(v)=>{o((b)=>{let n=new Set(b);if(!n.delete(v))n.add(v);return n})},toggleAll:()=>{o(l?new Set:new Set(d))},clear:()=>{o(new Set)}}}function zo(d,r){return B(()=>A(`queues/${w(d.name)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {queue}",{queue:d.name}):a("Paused {queue}",{queue:d.name}),d.paused?void 0:{title:a("Pause {queue}?",{queue:d.name}),body:a("Processes stop taking jobs from this queue until you resume it. Jobs can still be pushed."),action:a("Pause queue")}).then(r)}function yo(d,r,o){return B(()=>Ii(`queues/${w(d)}`),a("Cleared {queue}",{queue:d}),{title:a("Delete every job in {queue}?",{queue:d}),body:Q("{n} job will be removed for good.","{n} jobs will be removed for good.",r),action:a("Delete all jobs"),danger:!0}).then((p)=>p&&o())}function co(){let d=E("queues",{},5),r=P(Xi);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let o=d.data?.queues.map((v)=>({...v,size:r?.queues[v.name]??v.size})),p=o?.reduce((v,b)=>v+b.size,0)??0,l=d.data?.paused_classes??[];return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Queues")}),o&&i("p",{class:"subtitle",children:a("{jobs} waiting across {queues}.",{jobs:Q("{n} job","{n} jobs",p),queues:Q("{n} queue","{n} queues",o.length)})})]})}),i("section",{class:"panel",children:!o?i(U,{}):o.length===0?i($,{title:a("No queues yet"),icon:"queues",children:a("A queue appears as soon as a job is pushed to it.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Queue")}),i("th",{class:"r",children:a("Waiting")}),i("th",{class:"r",children:a("Latency")}),i("th",{children:a("Status")}),i("th",{})]})}),i("tbody",{children:o.map((v)=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/queues/${w(v.name)}`,children:v.name})}),i("td",{class:"r",children:K(v.size)}),i("td",{class:"r",children:i(ui,{seconds:v.latency})}),i("td",{children:v.paused?i("span",{class:"badge amber",children:a("Paused")}):i("span",{class:"dim",children:a("Running")})}),i("td",{class:"r",children:i("div",{class:"btn-group",children:[Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>zo(v,d.reload),children:v.paused?a("Resume"):a("Pause")}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>yo(v.name,v.size,d.reload),children:a("Clear")})]})})]},v.name))})]})})}),l.length>0&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Paused classes")})}),i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{class:"r",children:a("Parked")}),i("th",{})]})}),i("tbody",{children:l.map((v)=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/metrics/jobs/${w(v.name)}`,children:v.name})}),i("td",{class:"r",children:K(v.parked)}),i("td",{class:"r",children:Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>Xd({name:v.name,paused:!0},d.reload),children:a("Resume")})})]},v.name))})]})})]})]})}function Vo({name:d}){let{query:r}=ri(),o=Number(r.get("page")??1)||1,p=E(`queues/${w(d)}`,{page:o},5),l=p.data?.jobs??[],v=Hd(l.map((k)=>k.jid));if(p.error&&!p.data)return i(O,{message:p.error,onRetry:p.reload});let b=p.data,n=()=>B(()=>A(`queues/${w(d)}/delete_jobs`,{jids:[...v.selected]}),(k)=>Q("Deleted {n} job","Deleted {n} jobs",k.deleted),{title:Q("Delete {n} job?","Delete {n} jobs?",v.count),body:a("They won't run."),action:a("Delete"),danger:!0}).then(()=>{v.clear(),p.reload()}),z=new Set(l.filter((k)=>v.has(k.jid)).map((k)=>k.class)),y=z.size===1?[...z][0]:null,h=(k)=>B(()=>A(`queues/${w(d)}/delete_class`,{class:k}),(M)=>Q("Deleted {n} job","Deleted {n} jobs",M.deleted),{title:a("Delete every {class} job in {queue}?",{class:k,queue:d}),body:a("This takes every one in the queue, not only those on this page. They won't run."),action:a("Delete all"),danger:!0}).then(()=>{v.clear(),p.reload()});return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/queues",children:a("Queues")})}),i("h1",{children:d}),b&&i("p",{class:"subtitle",children:[Ki("{n} job waiting. Oldest has waited {latency}.","{n} jobs waiting. Oldest has waited {latency}.",b.queue.size,{latency:i(ui,{seconds:b.queue.latency})})," ",b.queue.paused&&i("span",{class:"badge amber",children:a("Paused")})]})]}),i("span",{class:"spacer"}),b&&i("div",{class:"btn-group",children:[Z("pause")&&i("button",{class:"btn",onClick:()=>zo({name:d,paused:b.queue.paused},p.reload),children:b.queue.paused?a("Resume queue"):a("Pause queue")}),Z("delete")&&i("button",{class:"btn btn-danger",onClick:()=>yo(d,b.queue.size,()=>j("/queues")),children:a("Clear queue")})]})]}),i("section",{class:"panel",children:[Z("delete")&&l.length>0&&i("div",{class:"bulkbar",children:[i("span",{class:"sel",children:v.count?Q("{n} job selected","{n} jobs selected",v.count):a("Select jobs to act on them")}),i("span",{class:"spacer"}),i("button",{class:"btn btn-small btn-danger",disabled:!v.count,onClick:n,children:a("Delete")}),y&&i("button",{class:"btn btn-small btn-danger",onClick:()=>h(y),children:a("Delete every {class}",{class:y})})]}),!b?i(U,{}):l.length===0?i($,{title:a("{queue} is empty",{queue:d}),icon:"check",children:a("Every job pushed here has been picked up.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[Z("delete")&&i("th",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select all on this page"),checked:v.all,onChange:v.toggleAll})}),i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),i("th",{children:a("Enqueued")})]})}),i("tbody",{children:l.map((k)=>i("tr",{children:[Z("delete")&&i("td",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select {jid}",{jid:k.jid}),checked:v.has(k.jid),onChange:()=>v.toggle(k.jid)})}),i("td",{children:[i(hi,{name:k.class,wrapper:k.wrapper})," ",i(Hi,{tags:k.tags}),i("div",{children:i(oi,{jid:k.jid})})]}),i("td",{class:"args",children:k.encrypted?i("span",{class:"badge",children:a("Encrypted")}):fi(k.args)}),i("td",{children:i(T,{at:k.enqueued_at??k.created_at})})]},k.jid))})]})}),b&&i(zd,{page:b.page,perPage:b.per_page,total:b.total})]})]})}var ed={scheduled:{title:c("Scheduled"),path:"/scheduled",when:c("Runs"),empty:c("Nothing is scheduled"),emptyBody:c("Jobs pushed with perform_in or perform_at wait here until their time comes."),noMatch:c("Nothing in scheduled contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Enqueue now"),kill:!0,edit:!1,icon:"scheduled"},retries:{title:c("Retries"),path:"/retries",when:c("Next retry"),empty:c("No jobs are waiting to retry"),emptyBody:c("Failed jobs wait here with exponential backoff before they run again."),noMatch:c("Nothing in retries contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Retry now"),kill:!0,edit:!0,icon:"check"},dead:{title:c("Dead"),path:"/dead",when:c("Died"),empty:c("No dead jobs"),emptyBody:c("Jobs that run out of retries land here so you can inspect and replay them."),noMatch:c("Nothing in dead contains “{q}”. Search matches anywhere in the job's JSON."),retryLabel:c("Retry now"),kill:!1,edit:!0,icon:"check"}};function ko(d,r,o){if(r==="delete")return Q("Deleted {n} job","Deleted {n} jobs",o);if(r==="kill")return Q("Killed {n} job","Killed {n} jobs",o);return d==="scheduled"?Q("Enqueued {n} job","Enqueued {n} jobs",o):Q("Retried {n} job","Retried {n} jobs",o)}function ud(d){return Object.hasOwn(ed,d)?ed[d]:void 0}function Id({set:d}){let r=ed[d],{query:o}=ri(),p=Number(o.get("page")??1)||1,l=o.get("q")??"",v=E(`sets/${d}`,{page:p,q:l},10),b=v.data?.jobs??[],n=Hd(b.map((f)=>f.id)),z=d!=="scheduled",y=Z("retry")||Z("delete")||r.kill&&Z("kill"),h=(f)=>{let I=n.count;return B(()=>A(`sets/${d}/bulk`,{action:f,ids:[...n.selected]}),(W)=>ko(d,f,W.affected),f==="retry"?void 0:{title:f==="delete"?Q("Delete {n} job?","Delete {n} jobs?",I):Q("Kill {n} job?","Kill {n} jobs?",I),body:f==="delete"?a("They won't run again."):a("They move to the dead set without running again."),action:f==="delete"?a("Delete"):a("Kill"),danger:!0}).then(()=>{n.clear(),v.reload()})},k=d==="scheduled",M={retry:k?a("Enqueue all"):a("Retry all"),delete:a("Delete all"),kill:a("Kill all")},g=(f)=>{let I=v.data.total,W={retry:k?Q("Enqueue all {n} job?","Enqueue all {n} jobs?",I):Q("Retry all {n} job?","Retry all {n} jobs?",I),delete:Q("Delete all {n} job?","Delete all {n} jobs?",I),kill:Q("Kill all {n} job?","Kill all {n} jobs?",I)}[f],J={retry:a("Every job in this set is pushed onto its queue right away."),delete:a("Every job in this set is removed for good."),kill:a("Every job in this set moves to the dead set.")}[f];return B(()=>A(`sets/${d}/all`,{action:f}),(_)=>ko(d,f,_.affected),{title:W,body:J,action:M[f],danger:f!=="retry"}).then(v.reload)};if(v.error&&!v.data)return i(O,{message:v.error,onRetry:v.reload});let X=v.data;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a(r.title)}),X&&i("p",{class:"subtitle",children:l?Q("{n} job matching “{q}”.","{n} jobs matching “{q}”.",X.total,{q:l}):Q("{n} job.","{n} jobs.",X.total)})]}),i("span",{class:"spacer"}),i(er,{value:l,placeholder:a("Search class, args, error…"),onSearch:(f)=>Wi({q:f,page:void 0})})]}),i("section",{class:"panel",children:[y&&X&&X.total>0&&i("div",{class:"bulkbar",children:[i("span",{class:"sel",children:n.count?Q("{n} job selected","{n} jobs selected",n.count):a("Select jobs, or act on the whole set")}),i("span",{class:"spacer"}),n.count>0?i(V,{children:[Z("retry")&&i("button",{class:"btn btn-small",onClick:()=>h("retry"),children:a(r.retryLabel)}),r.kill&&Z("kill")&&i("button",{class:"btn btn-small",onClick:()=>h("kill"),children:a("Kill")}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>h("delete"),children:a("Delete")})]}):i(V,{children:[Z("retry")&&i("button",{class:"btn btn-small",onClick:()=>g("retry"),children:M.retry}),r.kill&&Z("kill")&&i("button",{class:"btn btn-small",onClick:()=>g("kill"),children:M.kill}),Z("delete")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>g("delete"),children:M.delete})]})]}),!X?i(U,{}):b.length===0?l?i($,{title:a("No matches"),icon:"search",children:a(r.noMatch,{q:l})}):i($,{title:a(r.empty),icon:r.icon,children:a(r.emptyBody)}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[y&&i("th",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select all on this page"),checked:n.all,onChange:n.toggleAll})}),i("th",{children:a(r.when)}),i("th",{children:a("Job")}),i("th",{children:a("Arguments")}),z&&i("th",{children:a("Error")}),z&&i("th",{class:"r",children:a("Failures")})]})}),i("tbody",{children:b.map((f)=>i("tr",{children:[y&&i("td",{class:"check",children:i("input",{type:"checkbox","aria-label":a("Select {jid}",{jid:f.jid}),checked:n.has(f.id),onChange:()=>n.toggle(f.id)})}),i("td",{children:i(m,{href:`/sets/${d}/${w(f.id)}`,children:i(T,{at:f.at})})}),i("td",{children:[i(hi,{name:f.class,wrapper:f.wrapper})," ",i(Hi,{tags:f.tags}),i("div",{children:[i(oi,{jid:f.jid})," ",i("span",{class:"dim small",children:f.queue})]})]}),i("td",{class:"args",children:f.encrypted?i("span",{class:"badge",children:a("Encrypted")}):fi(f.args,90)}),z&&i("td",{children:[i(m,{href:`/sets/${d}/${w(f.id)}`,class:"err",children:f.error_class}),i("div",{class:"err-msg",children:(f.error_message??"").slice(0,140)})]}),z&&i("td",{class:"r",children:f.failures??0})]},f.id))})]})}),X&&i(zd,{page:X.page,perPage:X.per_page,total:X.total})]})]})}function wo({set:d,id:r}){let o=ud(d),p=E(`sets/${d}/${w(r)}`),[l,v]=R(!1);if(!o)return i(O,{message:a(`There's no "{set}" set.`,{set:d})});if(p.error)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:o.path,children:a(o.title)})}),i(O,{message:p.error})]});if(!p.data)return i(U,{rows:10});let b=p.data.job,n=()=>j(o.path),z={retry:d==="scheduled"?a("Job enqueued"):a("Job retried"),delete:a("Job deleted"),kill:a("Job killed")},y=(h,k)=>B(()=>A(`sets/${d}/bulk`,{action:h,ids:[r]}),z[h],k&&{...k,danger:!0}).then((M)=>M&&n());return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:o.path,children:a(o.title)})}),i("h1",{children:b.class}),i("p",{class:"subtitle",children:i(oi,{jid:b.jid})})]}),i("span",{class:"spacer"}),i("div",{class:"btn-group",children:[Z("retry")&&i("button",{class:"btn btn-primary",onClick:()=>y("retry"),children:a(o.retryLabel)}),o.edit&&Z("edit")&&!b.encrypted&&i("button",{class:"btn",onClick:()=>v(!0),children:a("Edit arguments")}),o.kill&&Z("kill")&&i("button",{class:"btn",onClick:()=>y("kill",{title:a("Kill job?"),action:a("Kill job")}),children:a("Kill")}),Z("delete")&&i("button",{class:"btn btn-danger",onClick:()=>y("delete",{title:a("Delete job?"),action:a("Delete job")}),children:a("Delete")})]})]}),l&&i(bo,{set:d,job:b,onDone:()=>v(!1)}),i("div",{class:"grid-3-1 mt",children:[i("div",{children:[i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Arguments")}),b.encrypted?i("p",{class:"dim",children:a("These arguments are encrypted at rest and can't be shown.")}):i(yd,{value:b.args})]}),i(kd,{job:b}),i(wd,{job:b})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i(Vd,{job:b,where:a(o.title),when:a(o.when)})]})]})]})}function Xo({jid:d}){let r=E(`jobs/${w(d)}`,{},5);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});if(!r.data)return i(U,{rows:8});let o=r.data,p=o.results.at(0);return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:a("Job lookup")}),i("h1",{children:p?p.job.class:a("Job not found")}),i("p",{class:"subtitle mono",children:d})]}),i("span",{class:"spacer"}),p&&p.where!=="dead"&&i(no,{jid:d})]}),o.cancelled&&i("p",{class:"notice mb",children:a("Cancellation was requested for this job.")}),!p?i("section",{class:"panel",children:i($,{title:a("No job with that ID right now"),icon:"search",children:a("It may have finished (finished jobs aren't kept), or it lives in a queue too large to search. Check the ID and try again.")})}):o.results.map((l)=>{let v=ud(l.where),b=l.where==="busy"?a("Running on {process}",{process:l.identity}):l.where==="queue"?a("Waiting in {queue}",{queue:l.queue}):v?a(v.title):l.where;return i("div",{class:"grid-3-1 mb",children:[i("div",{children:[o.progress&&l.where==="busy"&&i("section",{class:"panel panel-pad mb",children:[i("h2",{children:a("Progress")}),i(cd,{progress:o.progress})]}),l.job.id&&v&&i("p",{class:"mb",children:i(m,{href:`/sets/${l.where}/${w(l.job.id)}`,children:a("Open in {set} to retry, edit or delete it",{set:a(v.title)})})}),i(kd,{job:l.job}),i(wd,{job:l.job})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i(Vd,{job:l.job,where:b,when:v&&a(v.when)})]})]},l.where)})]})}var Ho=[{key:"1h",label:c("1 hour"),summary:c("{count} executions in the last hour, {failed}."),path:"metrics",params:{minutes:60},hourly:!1},{key:"8h",label:c("8 hours"),summary:c("{count} executions in the last 8 hours, {failed}."),path:"metrics",params:{minutes:480},hourly:!1},{key:"7d",label:c("7 days"),summary:c("{count} executions in the last 7 days, {failed}."),path:"metrics/history",params:{hours:168},hourly:!0},{key:"30d",label:c("30 days"),summary:c("{count} executions in the last 30 days, {failed}."),path:"metrics/history",params:{hours:720},hourly:!0}],Ui=(d)=>d.s+d.f;function K1(d){if(!d.f)return a("none failed");let r=d.f/Ui(d);return a("{pct}% failed",{pct:t(r*100,r<0.01?2:1)})}var Y1=["--series-1","--series-2","--series-3","--series-4","--series-5"];function Jd(d){return(r)=>d?new Date(r).toLocaleString(e(),{month:"short",day:"numeric",hour:"2-digit"}):new Date(r).toLocaleTimeString(e(),{hour:"2-digit",minute:"2-digit"})}function Z1({hourly:d}){let r=E("metrics/queues",{granularity:d?"hour":"minute",points:d?168:60},60);if(!r.data)return i(U,{rows:3});let o=r.data.points,p={};for(let b of o)for(let[n,z]of Object.entries(b.queues))p[n]=Math.max(p[n]??0,z.size);let l=Object.entries(p).sort((b,n)=>n[1]-b[1]).slice(0,5).map(([b])=>b).sort();if(Object.values(p).every((b)=>b===0))return i("div",{class:"chart-empty",style:{height:"180px"},children:a("Queue sizes are sampled once a minute by the leader process.")});let v=l.map((b,n)=>({label:b,color:Y1[n],values:o.map((z)=>(b in z.queues)?z.queues[b].size:0)}));return i(V,{children:[i("div",{class:"mb",children:i(Ri,{series:v})}),i(Oi,{label:a("Queue size over time"),xs:o.map((b)=>Zi(b.t)),xLabel:Jd(d),series:v,height:200}),Object.keys(p).length>5&&i("p",{class:"small dim mt",children:a("Showing the five queues with the largest peaks.")})]})}function Io(){let[d,r]=R("1h"),[o,p]=R(""),l=Ho.find((y)=>y.key===d),v=E(l.path,l.params,l.hourly?300:30);if(v.error&&!v.data)return i(O,{message:v.error,onRetry:v.reload});let b=v.data&&!l.hourly?{...v.data,series:v.data.series.slice(0,-1)}:v.data,n=b?Object.entries(b.classes).filter(([y])=>y.toLowerCase().includes(o.toLowerCase())).sort((y,h)=>Ui(h[1])-Ui(y[1])):[],z=b?Object.values(b.classes).reduce((y,h)=>({s:y.s+h.s,f:y.f+h.f}),{s:0,f:0}):{s:0,f:0};return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("h1",{children:a("Metrics")}),b&&i("p",{class:"subtitle",children:a(l.summary,{count:K(Ui(z)),failed:K1(z)})})]}),i("span",{class:"spacer"}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:Ho.map((y)=>i("button",{"aria-pressed":y.key===d,onClick:()=>r(y.key),children:a(y.label)},y.key))})]}),i("section",{class:"panel mb",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Executions")}),i("span",{class:"panel-note",children:l.hourly?a("per hour"):a("per minute")}),i("span",{class:"spacer"}),i(Ri,{series:Di()})]}),i("div",{class:"panel-pad",children:!b?i(U,{rows:4}):i(Oi,{label:a("Executions over time"),xs:b.series.map((y)=>Zi(y.t)),xLabel:Jd(l.hourly),series:Pi(b.series.map((y)=>y.s),b.series.map((y)=>y.f)),marks:b.deploys})})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Jobs")}),i("span",{class:"spacer"}),i("input",{class:"input",type:"search",placeholder:a("Filter by class"),"aria-label":a("Filter by class"),value:o,onInput:(y)=>p(y.target.value)})]}),i("div",{class:"mt"}),!b?i(U,{}):n.length===0?i($,{title:o?a("No classes match"):a("No jobs ran in this window"),icon:"metrics",children:a("Metrics are flushed by each process every few seconds.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{class:"r",children:a("Succeeded")}),i("th",{class:"r",children:a("Failed")}),i("th",{class:"r",children:a("Avg time")}),i("th",{class:"r",children:a("Total time")})]})}),i("tbody",{children:n.map(([y,h])=>i("tr",{children:[i("td",{class:"cls",children:i(m,{href:`/metrics/jobs/${encodeURIComponent(y)}`,children:y})}),i("td",{class:"r",children:K(h.s)}),i("td",{class:`r${h.f?"":" muted"}`,children:K(h.f)}),i("td",{class:"r",children:Yi(h.avg_ms)}),i("td",{class:"r",children:Yi(h.ms)})]},y))})]})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Queue sizes")})}),i("div",{class:"panel-pad",children:i(Z1,{hourly:l.hourly})})]})]})]})}function Jo({klass:d}){let[r,o]=R(60),p=E(`metrics/jobs/${encodeURIComponent(d)}`,{minutes:r},30);if(p.error&&!p.data)return i(O,{message:p.error,onRetry:p.reload});let l=p.data&&{...p.data,series:p.data.series.slice(0,-1)},v=l?Ui(l.totals):0;return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/metrics",children:a("Metrics")})}),i("h1",{children:d}),l&&i("p",{class:"subtitle",children:[Q("{count} executions in the last hour, averaging {time}","{count} executions in the last {n} hours, averaging {time}",r/60,{count:K(v),time:Yi(l.totals.avg_ms)}),l.totals.f?a(", {n} failed",{n:K(l.totals.f)}):"",a("."),l.paused&&i(V,{children:[" ",i("span",{class:"badge amber",children:a("Paused")})]})]})]}),i("span",{class:"spacer"}),l&&Z("pause")&&i("button",{class:"btn",onClick:()=>Xd({name:d,paused:!!l.paused},p.reload),children:l.paused?a("Resume class"):a("Pause class")}),i("div",{class:"seg",role:"group","aria-label":a("Time window"),children:[60,240,480].map((b)=>i("button",{"aria-pressed":r===b,onClick:()=>o(b),children:a("{n} h",{n:b/60})},b))})]}),!l?i(U,{rows:8}):i("div",{class:"grid-2",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Executions")}),i("span",{class:"spacer"}),i(Ri,{series:Di()})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("{job} executions per minute",{job:d}),xs:l.series.map((b)=>Zi(b.t)),xLabel:Jd(!1),series:Pi(l.series.map((b)=>b.s),l.series.map((b)=>b.f)),marks:l.deploys})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Execution time")}),i("span",{class:"panel-note",children:a("How long each run took")})]}),i("div",{class:"panel-pad",children:i(lo,{buckets:l.histogram,height:220})})]}),i("section",{class:"panel",children:[i("div",{class:"panel-head",children:[i("h2",{children:a("Average time")}),i("span",{class:"panel-note",children:a("per minute")})]}),i("div",{class:"panel-pad",children:i(Oi,{label:a("{job} average execution time per minute",{job:d}),xs:l.series.map((b)=>Zi(b.t)),xLabel:Jd(!1),yFormat:(b)=>Yi(b),series:[{label:a("Average"),cls:"s-processed",values:l.series.map((b)=>Ui(b)?b.ms/Ui(b):0)}],marks:l.deploys})})]})]})]})}function Ji({title:d,hint:r}){return i("section",{class:"panel",children:i($,{title:d,icon:"gem",children:r})})}function mo(d){if(d.success_at)return{label:a("Succeeded"),cls:"egg"};if(d.cancelled_at)return{label:a("Cancelled"),cls:"amber"};if(d.complete_at)return{label:a("Complete with failures"),cls:"ruby"};if(d.failures>0)return{label:a("Running, with failures"),cls:"ruby"};return{label:a("Running"),cls:""}}function td({b:d}){let r=Math.max(0,d.total-d.pending),o=Math.min(d.failures,d.pending),p=Math.max(0,d.pending-o);return i("div",{children:[i("div",{class:"progress",role:"progressbar","aria-valuenow":Math.round(Li(r,d.total)),"aria-valuemin":0,"aria-valuemax":100,"aria-label":a("Batch progress"),children:[r>0&&i("span",{class:"p-ok",style:{width:`${Li(r,d.total)}%`}}),o>0&&i("span",{class:"p-fail",style:{width:`${Li(o,d.total)}%`}})]}),i("div",{class:"progress-label",children:[i("span",{children:o?a("{done} of {total} done, {failing} failing",{done:K(r),total:K(d.total),failing:K(o)}):a("{done} of {total} done",{done:K(r),total:K(d.total)})}),i("span",{class:"num",children:p?a("{n} waiting",{n:K(p)}):""})]})]})}function Mo({tags:d}){return i(V,{children:d?.map((r)=>i(m,{href:`/batches?tag=${encodeURIComponent(r)}`,class:"tag",children:r},r))})}function Ko(){let d=ri().query.get("tag")??"",r=E("batches",d?{tag:d}:{},5);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Batches")}),i("p",{class:"subtitle",children:d?q("Batches tagged {tag}. {all}",{tag:i("span",{class:"tag",children:d}),all:i(m,{href:"/batches",children:a("Show all batches")})}):a("Groups of jobs tracked together, with callbacks when they complete or succeed.")})]})}),!o?i("section",{class:"panel",children:i(U,{})}):!o.available?i(Ji,{title:a("Batches aren't available on this server"),hint:a("This server's Robin version doesn't include batch support.")}):(o.batches??[]).length===0?i("section",{class:"panel",children:d?i($,{title:a("No batches have this tag"),icon:"batches",children:a("Tagged batches show up here while Robin keeps them (30 days).")}):i($,{title:a("No batches yet"),icon:"batches",children:q("Create one with {new} and push jobs inside {block}.",{new:i("code",{children:"Robin::Batch.new"}),block:i("code",{children:"batch.jobs { … }"})})})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Batch")}),i("th",{children:a("Status")}),i("th",{style:{width:"34%"},children:a("Progress")}),i("th",{children:a("Created")})]})}),i("tbody",{children:o.batches.map((p)=>{let l=mo(p);return i("tr",{children:[i("td",{children:[i(m,{href:`/batches/${w(p.bid)}`,class:"cls",children:p.description||a("Untitled batch")}),i("div",{class:"dim small mono",children:p.bid}),p.tags&&p.tags.length>0&&i("div",{children:i(Mo,{tags:p.tags})})]}),i("td",{children:i("span",{class:`badge ${l.cls}`,children:l.label})}),i("td",{children:i(td,{b:p})}),i("td",{children:i(T,{at:p.created_at})})]},p.bid)})})]})})})]})}function Yo({bid:d}){let r=E(`batches/${w(d)}`,{},5);if(r.error&&!r.data)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:"/batches",children:a("Batches")})}),i(O,{message:r.error,onRetry:r.reload})]});if(!r.data)return i(U,{rows:8});if(!r.data.batch)return i(Ji,{title:a("Batches aren't available on this server"),hint:a("This server's Robin version doesn't include batch support.")});let o=r.data.batch,p=mo(o),l=o.children??[];return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:[i(m,{href:"/batches",children:a("Batches")}),o.parent_bid&&i(V,{children:[" / ",i(m,{href:`/batches/${w(o.parent_bid)}`,children:a("parent")})]})]}),i("h1",{children:o.description||a("Untitled batch")}),i("p",{class:"subtitle",children:[i("span",{class:`badge ${p.cls}`,children:p.label})," ",i("span",{class:"mono small",children:o.bid})]})]}),i("span",{class:"spacer"}),i("div",{class:"btn-group",children:[Z("cancel")&&!o.cancelled_at&&!o.complete_at&&i("button",{class:"btn",onClick:()=>B(()=>A(`batches/${w(d)}/cancel`),a("Batch cancelled"),{title:a("Cancel this batch?"),body:a("Its jobs that haven't started are skipped, and running ones see cancelled? turn true. Child batches are cancelled too."),action:a("Cancel batch"),danger:!0}).then(r.reload),children:a("Cancel batch")}),Z("batches")&&i("button",{class:"btn btn-danger",onClick:()=>B(()=>Ii(`batches/${w(d)}`),a("Batch deleted"),{title:a("Delete this batch's tracking data?"),body:a("Jobs already pushed still run, but callbacks won't fire."),action:a("Delete batch"),danger:!0}).then((v)=>v&&j("/batches")),children:a("Delete")})]})]}),i("section",{class:"panel panel-pad mb",children:i(td,{b:o})}),i("div",{class:"grid-3-1",children:[i("div",{class:"stack",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Failed jobs")})}),(o.failed_jobs??[]).length===0?i($,{title:a("No failures"),icon:"check",children:a("Jobs that fail at least once are listed here until they succeed.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job ID")}),i("th",{children:a("Error")})]})}),i("tbody",{children:o.failed_jobs.map((v)=>i("tr",{children:[i("td",{children:i(m,{href:`/jobs/${w(v.jid)}`,class:"mono small",children:v.jid})}),i("td",{children:[i("span",{class:"err",children:v.error_class}),i("div",{class:"err-msg",children:v.error_message})]})]},v.jid))})]})})]}),l.length>0&&i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Child batches")})}),i("div",{class:"table-wrap",children:i("table",{class:"table",children:i("tbody",{children:l.map((v)=>{let b=typeof v==="string"?null:v,n=typeof v==="string"?v:v.bid;return i("tr",{children:[i("td",{children:i(m,{href:`/batches/${w(n)}`,children:b?.description||n})}),i("td",{style:{width:"50%"},children:b&&typeof b.total==="number"?i(td,{b}):null})]},n)})})})})]})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i("dl",{class:"kv",children:[i("dt",{children:a("Jobs")}),i("dd",{class:"num",children:Q("{n} job","{n} jobs",o.total)}),o.tags&&o.tags.length>0?i(V,{children:[i("dt",{children:a("Tags")}),i("dd",{children:i(Mo,{tags:o.tags})})]}):null,i("dt",{children:a("Pending")}),i("dd",{class:"num",children:K(o.pending)}),i("dt",{children:a("Failures")}),i("dd",{class:"num",children:K(o.failures)}),i("dt",{children:a("Created")}),i("dd",{children:i(T,{at:o.created_at})}),i("dt",{children:a("Completed")}),i("dd",{children:i(T,{at:o.complete_at})}),i("dt",{children:a("Succeeded")}),i("dd",{children:i(T,{at:o.success_at})}),o.cancelled_at?i(V,{children:[i("dt",{children:a("Cancelled")}),i("dd",{children:i(T,{at:o.cancelled_at})})]}):null,o.callbacks&&Object.keys(o.callbacks).length>0?i(V,{children:[i("dt",{children:a("Callbacks")}),i("dd",{children:i("code",{class:"small",children:JSON.stringify(o.callbacks)})})]}):null]}),o.jids&&o.jids.length>0&&i(V,{children:[i("h2",{class:"mt",children:a("Pending job IDs")}),i("div",{class:"stack",style:{gap:"4px"},children:o.jids.slice(0,50).map((v)=>i(oi,{jid:v},v))})]})]})]})]})}var Zo={1:c("per second"),60:c("per minute"),3600:c("per hour"),86400:c("per day")},W1=(d)=>Object.hasOwn(Zo,d)?a(Zo[d]):a("per {time}",{time:li(d)}),Wo={concurrent:c("Concurrent"),bucket:c("Bucket"),window:c("Sliding window"),leaky:c("Leaky bucket"),points:c("Points")};function Qo(){let d=E("limiters",{},5);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Rate limits")}),i("p",{class:"subtitle",children:a("Shared limits that keep jobs from overwhelming APIs and databases. Jobs over a limit are rescheduled, not failed.")})]})}),!r?i("section",{class:"panel",children:i(U,{})}):!r.available?i(Ji,{title:a("Rate limits aren't available on this server"),hint:a("This server's Robin version doesn't include rate limiting.")}):(r.limiters??[]).length===0?i("section",{class:"panel",children:i($,{title:a("No rate limiters yet"),icon:"limiters",children:a('They appear here the first time a job calls one, e.g. Robin::Limiter.concurrent("stripe", 10).')})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Limiter")}),i("th",{children:a("Kind")}),i("th",{style:{width:"26%"},children:a("In use")}),i("th",{class:"r",children:a("Times over limit")}),i("th",{children:a("Last used")}),i("th",{})]})}),i("tbody",{children:r.limiters.map((o)=>{let p=o.used??0,l=p>=o.limit;return i("tr",{children:[i("td",{class:"cls",children:o.name}),i("td",{children:[Object.hasOwn(Wo,o.type)?a(Wo[o.type]):o.type,o.interval?i("span",{class:"dim",children:[" ",W1(o.interval)]}):null]}),i("td",{children:[i("div",{class:"qbar","aria-hidden":"true",children:i("span",{style:{width:`${Li(p,o.limit)}%`,background:l?"var(--ruby)":"var(--egg)"}})}),i("div",{class:"small",children:[i("span",{class:"num",children:a("{used} of {limit}",{used:K(p),limit:K(o.limit)})}),l&&i("span",{class:"err",children:[" ",a("at limit")]})]})]}),i("td",{class:"r",children:K(o.over_limit_count??0)}),i("td",{children:i(T,{at:o.last_used_at})}),i("td",{class:"r",children:Z("limiters")&&i("div",{class:"btn-group",children:[i("button",{class:"btn btn-small",onClick:()=>B(()=>A(`limiters/${w(o.name)}/reset`),a("Reset {limiter}",{limiter:o.name}),{title:a("Reset {limiter}?",{limiter:o.name}),body:a("Its current usage is cleared, so waiting jobs may run right away."),action:a("Reset")}).then(d.reload),children:a("Reset")}),i("button",{class:"btn btn-small btn-danger",onClick:()=>B(()=>Ii(`limiters/${w(o.name)}`),a("Deleted {limiter}",{limiter:o.name}),{title:a("Delete {limiter}?",{limiter:o.name}),body:a("Its state and statistics are removed. It's recreated the next time a job uses it."),action:a("Delete"),danger:!0}).then(d.reload),children:a("Delete")})]})})]},o.name)})})]})})})]})}function Q1(d,r){return B(()=>A(`cron/${w(d.id)}/enqueue`),(o)=>a("Enqueued {job} as {jid}",{job:d.class,jid:o.jid})).then(r)}function D1(d,r){return B(()=>A(`cron/${w(d.id)}/${d.paused?"unpause":"pause"}`),d.paused?a("Resumed {job}",{job:d.class}):a("Paused {job}",{job:d.class})).then(r)}function Do({j:d,reload:r}){return i("div",{class:"btn-group",children:[Z("enqueue")&&i("button",{class:"btn btn-small",onClick:()=>Q1(d,r),children:a("Run now")}),Z("pause")&&i("button",{class:"btn btn-small",onClick:()=>D1(d,r),children:d.paused?a("Resume"):a("Pause")})]})}function Ro(){let d=E("cron",{},15);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Cron")}),i("p",{class:"subtitle",children:r?.leader?q("Jobs pushed on a schedule by the cluster leader, currently {leader}.",{leader:i("strong",{children:wi(r.leader).host})}):a("Jobs pushed on a schedule by the cluster leader.")})]})}),!r?i("section",{class:"panel",children:i(U,{})}):!r.available?i(Ji,{title:a("Cron jobs aren't available on this server"),hint:a("This server's Robin version doesn't include periodic jobs.")}):(r.jobs??[]).length===0?i("section",{class:"panel",children:i($,{title:a("No cron jobs registered"),icon:"cron",children:q("Register them inside {block} with {code}.",{block:i("code",{children:"configure_server"}),code:i("code",{children:'config.periodic { |cron| cron.register "0 * * * *", "HourlyJob" }'})})})}):i("section",{class:"panel",children:i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Schedule")}),i("th",{children:a("Job")}),i("th",{children:a("Next run")}),i("th",{children:a("Last run")}),i("th",{})]})}),i("tbody",{children:r.jobs.map((o)=>i("tr",{children:[i("td",{children:[i(m,{href:`/cron/${w(o.id)}`,class:"mono",children:o.cron}),o.tz&&i("span",{class:"dim small",children:[" ",o.tz]}),o.description&&i("div",{class:"small dim",children:o.description})]}),i("td",{children:[i(hi,{name:o.class})," ",i("span",{class:"dim small",children:a("in {queue}",{queue:o.queue})}),o.args.length?i("div",{class:"args",children:fi(o.args,60)}):null]}),i("td",{children:o.paused?i("span",{class:"badge amber",children:a("Paused")}):i(T,{at:o.next_at})}),i("td",{children:i(T,{at:o.last_at})}),i("td",{class:"r",children:i(Do,{j:o,reload:d.reload})})]},o.id))})]})})})]})}function Oo({id:d}){let r=E(`cron/${w(d)}`,{},15);if(r.error&&!r.data)return i(V,{children:[i("div",{class:"crumb",children:i(m,{href:"/cron",children:a("Cron")})}),i(O,{message:r.error,onRetry:r.reload})]});if(!r.data)return i(U,{rows:8});if(!r.data.job)return i(Ji,{title:a("Cron jobs aren't available on this server"),hint:a("This server's Robin version doesn't include periodic jobs.")});let o=r.data.job,p=r.data.history??[];return i(V,{children:[i("div",{class:"page-head",children:[i("div",{children:[i("div",{class:"crumb",children:i(m,{href:"/cron",children:a("Cron")})}),i("h1",{children:o.class}),i("p",{class:"subtitle",children:[i("span",{class:"mono",children:o.cron}),o.tz?` ${a("in {zone}",{zone:o.tz})}`:"",o.description?`, ${o.description}`:""]})]}),i("span",{class:"spacer"}),i(Do,{j:o,reload:r.reload})]}),i("div",{class:"grid-3-1",children:[i("section",{class:"panel",children:[i("div",{class:"panel-head",children:i("h2",{children:a("Recent runs")})}),p.length===0?i($,{title:a("Hasn't run yet"),icon:"cron",children:a("Runs show up here once the leader enqueues this job.")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Enqueued")}),i("th",{children:a("Job ID")})]})}),i("tbody",{children:p.map((l)=>i("tr",{children:[i("td",{children:i(T,{at:l.at})}),i("td",{children:i(m,{href:`/jobs/${w(l.jid)}`,class:"mono small",children:l.jid})})]},l.jid))})]})})]}),i("section",{class:"panel panel-pad",style:{alignSelf:"start"},children:[i("h2",{children:a("Details")}),i("dl",{class:"kv",children:[i("dt",{children:a("Queue")}),i("dd",{children:i(m,{href:`/queues/${w(o.queue)}`,children:o.queue})}),i("dt",{children:a("Arguments")}),i("dd",{class:"args",children:fi(o.args)}),i("dt",{children:a("Next run")}),i("dd",{children:o.paused?a("Paused"):i(T,{at:o.next_at})}),i("dt",{children:a("Last run")}),i("dd",{children:i(T,{at:o.last_at})}),o.last_jid&&i(V,{children:[i("dt",{children:a("Last job")}),i("dd",{children:i(oi,{jid:o.last_jid})})]})]})]})]})]})}var Uo={read:c("View the dashboard"),retry:c("Retry and enqueue jobs"),edit:c("Edit job arguments"),delete:c("Delete jobs and clear queues"),kill:c("Kill jobs"),pause:c("Pause queues and cron jobs"),cancel:c("Cancel jobs"),process_control:c("Quiet and stop processes"),enqueue:c("Run cron jobs now"),limiters:c("Reset rate limiters"),batches:c("Delete batches"),profiles:c("Delete job profiles"),extensions:c("Use actions on extension pages")};function R1(){let{code:d}=P(ki);return i("label",{class:"row",children:[i("span",{class:"sr-only",children:a("Language")}),i("select",{class:"select",value:d,onChange:(r)=>void ld(r.target.value),children:Object.entries(Bi).map(([r,o])=>i("option",{value:r,lang:r,children:o.name},r))})]})}function $o(){let d=P(vi),r=E("info");if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data,p=o?.redis??{},l=Number(p.keyspace_hits??0),v=Number(p.keyspace_misses??0);return i(V,{children:[i("div",{class:"page-head",children:i("div",{class:"row",style:{gap:"18px",alignItems:"center"},children:[Qi&&i("img",{src:Qi,alt:a("Robin, a red-bellied bird in a mask"),width:84,height:84}),i("div",{children:[i("h1",{children:["Robin ",d.version]}),i("p",{class:"subtitle",children:a("Fast, reliable background jobs for Ruby. Free and open source under the LGPL.")})]})]})}),!o?i(U,{rows:8}):i("div",{class:"grid-2",children:[i("section",{class:"panel panel-pad",children:[i("h2",{children:"Robin"}),i("dl",{class:"kv",children:[i("dt",{children:a("Version")}),i("dd",{children:o.robin.version}),i("dt",{children:"Ruby"}),i("dd",{class:"small",children:o.robin.ruby}),i("dt",{children:a("Cluster")}),i("dd",{children:d.cluster}),i("dt",{children:a("Processes")}),i("dd",{children:K(o.processes)}),i("dt",{children:a("Leader")}),i("dd",{children:o.leader?wi(o.leader).host:a("None elected")}),i("dt",{children:a("Key prefix")}),i("dd",{children:i("code",{children:o.robin.key_prefix})}),i("dt",{children:a("Default retries")}),i("dd",{children:o.robin.max_retries}),i("dt",{children:a("Dead set")}),i("dd",{children:a("{jobs} jobs, kept {days} days",{jobs:K(o.robin.dead_max_jobs),days:o.robin.dead_timeout_days})}),i("dt",{children:a("Protocol parser")}),i("dd",{children:o.robin.native_resp?a("Native extension"):a("Pure Ruby")})]})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:"Redis"}),i("dl",{class:"kv",children:[i("dt",{children:a("Server")}),i("dd",{children:i("code",{children:o.redis_url})}),i("dt",{children:a("Version")}),i("dd",{children:[p.redis_version??"–"," ",p.role&&i("span",{class:"dim",children:["(",p.role,")"]})]}),i("dt",{children:a("Uptime")}),i("dd",{children:p.uptime_in_seconds?li(Number(p.uptime_in_seconds)):"–"}),i("dt",{children:a("Memory")}),i("dd",{children:[p.used_memory_human??"–",p.used_memory_peak_human&&i("span",{class:"dim",children:[" ",a("(peak {memory})",{memory:p.used_memory_peak_human})]})]}),i("dt",{children:a("Max memory")}),i("dd",{children:[p.maxmemory_human==="0B"?a("Unlimited"):p.maxmemory_human??"–"," ",p.maxmemory_policy&&i("span",{class:"dim",children:p.maxmemory_policy})]}),i("dt",{children:a("Clients")}),i("dd",{children:p.connected_clients??"–"}),i("dt",{children:a("Ops per second")}),i("dd",{children:p.instantaneous_ops_per_sec??"–"}),i("dt",{children:a("Hit rate")}),i("dd",{children:l+v?a("{pct}%",{pct:t(l/(l+v)*100,1)}):"–"})]}),p.maxmemory_policy&&p.maxmemory_policy!=="noeviction"&&i("p",{class:"notice mt",children:a("Redis may evict keys under memory pressure ({policy}). Set maxmemory-policy to noeviction so jobs are never silently dropped.",{policy:p.maxmemory_policy})})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Your access")}),d.read_only&&i("p",{class:"notice mb",children:a("This dashboard is read-only.")}),i("dl",{class:"kv",children:Object.entries(d.permissions).map(([b,n])=>i(V,{children:[i("dt",{children:Object.hasOwn(Uo,b)?a(Uo[b]):b}),i("dd",{children:n?a("Allowed"):i("span",{class:"dim",children:a("Not allowed")})})]}))})]}),i("section",{class:"panel panel-pad",children:[i("h2",{children:a("Language")}),i(R1,{}),i("h2",{class:"mt",children:a("Keyboard")}),i("dl",{class:"kv",children:[i("dt",{children:i("kbd",{children:"/"})}),i("dd",{children:a("Find a job by ID")}),i("dt",{children:i("kbd",{children:"Esc"})}),i("dd",{children:a("Close dialogs and the menu")})]}),i("h2",{class:"mt",children:"Prometheus"}),i("p",{class:"small",children:q("Scrape {path} for queue sizes, latency and job counters.",{path:i("code",{children:new URL("metrics",document.baseURI).pathname})})})]})]})]})}function O1(d){if(d<1024)return a("{n} B",{n:d});if(d<1048576)return a("{n} KB",{n:t(d/1024,1)});return a("{n} MB",{n:t(d/1024/1024,1)})}function Bo(){let d=E("profiles",{},15);if(d.error&&!d.data)return i(O,{message:d.error,onRetry:d.reload});let r=d.data?.profiles;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:[i("h1",{children:a("Profiles")}),i("p",{class:"subtitle",children:q("Where single job runs spent their time. Download one and drop it onto the {profiler} to explore it.",{profiler:i("a",{href:"https://profiler.firefox.com",target:"_blank",rel:"noreferrer",children:"Firefox Profiler"})})})]})}),i("section",{class:"panel",children:!r?i(U,{}):r.length===0?i($,{title:a("No profiles yet"),icon:"profiles",children:q("Push a job with {code} (servers need the vernier gem) and its run shows up here for a week.",{code:i("code",{children:"set(profile: true)"})})}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:[i("th",{children:a("Job")}),i("th",{children:a("Label")}),i("th",{class:"r",children:a("Took")}),i("th",{children:a("Result")}),i("th",{children:a("Recorded")}),i("th",{class:"r",children:a("Size")}),i("th",{})]})}),i("tbody",{children:r.map((o)=>i("tr",{children:[i("td",{children:[i(m,{href:`/metrics/jobs/${w(o.class)}`,class:"cls",children:o.class}),i("div",{class:"dim small mono",children:[o.jid,o.queue&&i(V,{children:[" · ",o.queue]})]})]}),i("td",{children:o.label??i("span",{class:"dim",children:"–"})}),i("td",{class:"r num",children:Yi(o.duration_ms)}),i("td",{children:o.ok?i("span",{class:"badge egg",children:a("Succeeded")}):i("span",{class:"badge ruby",children:a("Failed")})}),i("td",{children:i(T,{at:o.started_at})}),i("td",{class:"r num",children:O1(o.bytes)}),i("td",{class:"r",children:i("div",{class:"btn-group",children:[i("a",{class:"btn btn-small",href:Ei(`profiles/${w(o.jid)}`),download:`robin-${o.jid}.json`,children:[i(ii,{name:"download",width:14,height:14})," ",a("Download")]}),Z("profiles")&&i("button",{class:"btn btn-small btn-danger",onClick:()=>B(()=>Ii(`profiles/${w(o.jid)}`),a("Profile deleted"),{title:a("Delete this profile?"),body:a("The profile of {job} ({jid}) is removed.",{job:o.class,jid:o.jid}),action:a("Delete"),danger:!0}).then(d.reload),children:a("Delete")})]})})]},o.jid))})]})})})]})}function Eo(d){return d===null?"–":d.toLocaleString(e())}var U1={load:(d)=>import(d)};function $1(d,r={}){let o=e();return{slug:d,locale:o,t:(p,l={})=>pd(Object.hasOwn(r,p)?r[p]:p,l),data:(p,l={})=>Ti(`extensions/${w(d)}/data/${w(p)}`,{...l,locale:o}),action:async(p,l={})=>(await A(`extensions/${w(d)}/actions/${w(p)}`,l,{locale:o})).message,toast:zi,navigate:(p)=>j(p)}}function B1({page:d}){let r=Vi(null),[o,p]=R(null),{slug:l,script:v,stylesheet:b,messages:n}=d;return S(()=>{if(!b)return;let z=document.createElement("link");return z.rel="stylesheet",z.href=new URL(b,document.baseURI).href,document.head.append(z),()=>z.remove()},[b]),S(()=>{let z=!1,y;return U1.load(new URL(v,document.baseURI).href).then((h)=>{let k=r.current;if(z||!k)return;if(typeof h.default!=="function"){p(a("{script} has no default export to call.",{script:v}));return}y=h.default(k,$1(l,n))},(h)=>p(a("{script} couldn't be loaded: {error}",{script:v,error:h.message}))),()=>{if(z=!0,typeof y==="function")y()}},[l,v,n]),i(V,{children:[o&&i(O,{message:o}),i("div",{class:"ext-script",ref:r})]})}function E1({slug:d,items:r,reload:o}){if(!Z("extensions"))return null;return i("div",{class:"btn-group",children:r.map((p)=>i("button",{class:p.danger?"btn btn-danger":"btn",onClick:()=>B(()=>A(`extensions/${w(d)}/actions/${w(p.action)}`,void 0,{locale:e()}),(l)=>l.message,p.confirm?{title:p.confirm,action:p.label,danger:p.danger}:void 0).then(o),children:p.label},p.action))})}function T1({block:d,slug:r,reload:o}){switch(d.type){case"heading":return i("h2",{class:"ext-heading",children:d.text});case"text":return i("p",{class:"ext-text",children:d.text});case"stats":return i("div",{class:"facts",children:d.items.map((p)=>i("div",{class:"fact",children:[i("span",{class:"fact-value",children:Eo(p.value)}),i("span",{class:"fact-label",children:p.label})]},p.label))});case"table":return i("section",{class:"panel ext-block",children:d.rows.length===0?i($,{title:a("Nothing to show")}):i("div",{class:"table-wrap",children:i("table",{class:"table",children:[i("thead",{children:i("tr",{children:d.columns.map((p)=>i("th",{children:p},p))})}),i("tbody",{children:d.rows.map((p,l)=>i("tr",{children:p.map((v,b)=>i("td",{children:Eo(v)},b))},l))})]})})});case"actions":return i("div",{class:"ext-block",children:i(E1,{slug:r,items:d.items,reload:o})})}return null}function To({slug:d}){let r=E(`extensions/${w(d)}`,{locale:e()},0);if(r.error&&!r.data)return i(O,{message:r.error,onRetry:r.reload});let o=r.data;return i(V,{children:[i("div",{class:"page-head",children:i("div",{children:i("h1",{children:o?ei(o):a("Loading…")})})}),!o?i("section",{class:"panel",children:i(U,{})}):o.blocks.length===0&&!o.script?i("section",{class:"panel",children:i($,{title:a("This page is empty"),icon:"extension"})}):i(V,{children:[o.blocks.map((p,l)=>i(T1,{block:p,slug:d,reload:r.reload},l)),o.script&&i(B1,{page:{...o,script:o.script}})]})]})}function Lo(){return i("section",{class:"panel",children:i($,{title:a("There's nothing at this address"),icon:"search",children:q("The page may have moved. {link}.",{link:i(m,{href:"/",children:a("Go to the dashboard")})})})})}var L1=[["/",()=>i(vo,{})],["/busy",()=>i(fo,{})],["/queues",()=>i(co,{})],["/queues/:name",(d)=>i(Vo,{name:d.name})],["/scheduled",()=>i(Id,{set:"scheduled"})],["/retries",()=>i(Id,{set:"retries"})],["/dead",()=>i(Id,{set:"dead"})],["/sets/:set/:id",(d)=>i(wo,{set:d.set,id:d.id})],["/jobs/:jid",(d)=>i(Xo,{jid:d.jid})],["/metrics",()=>i(Io,{})],["/metrics/jobs/:klass",(d)=>i(Jo,{klass:d.klass})],["/batches",()=>i(Ko,{})],["/batches/:bid",(d)=>i(Yo,{bid:d.bid})],["/limiters",()=>i(Qo,{})],["/cron",()=>i(Ro,{})],["/cron/:id",(d)=>i(Oo,{id:d.id})],["/profiles",()=>i(Bo,{})],["/ext/:slug",(d)=>i(To,{slug:d.slug})],["/settings",()=>i($o,{})]],Ao={"/":c("Dashboard"),"/busy":c("Busy"),"/queues":c("Queues"),"/scheduled":c("Scheduled"),"/retries":c("Retries"),"/dead":c("Dead"),"/metrics":c("Metrics"),"/batches":c("Batches"),"/limiters":c("Rate limits"),"/cron":c("Cron"),"/profiles":c("Profiles"),"/settings":c("Settings")};function A1(){let{path:d}=ri(),r=P(vi),{code:o}=P(ki),[p,l]=R(null);if(S(()=>{qd().then(Si,(b)=>l(b.message))},[]),S(()=>{let b=r?.title??"Robin",n=Nd("/ext/:slug",d)&&r?.extensions?.find((h)=>`/ext/${encodeURIComponent(h.slug)}`===d),z=Ao[d]??Ao[`/${d.split("/")[1]}`],y=z?a(z):n&&ei(n);document.title=y?`${y} | ${b}`:b},[d,r,o]),p)return i("div",{style:{padding:"40px",maxWidth:"640px"},children:i(O,{message:a("Robin couldn't load: {error}",{error:p}),onRetry:()=>location.reload()})});if(!r)return null;let v=i(Lo,{});for(let[b,n]of L1){let z=Nd(b,d);if(z){v=n(z);break}}return i(V,{children:[i(Sr,{children:v}),i(tr,{}),i(xr,{})]})}gd();ld(Wr(),!1).finally(()=>nr(i(A1,{}),document.getElementById("app")));
|
|
Binary file
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<meta name="color-scheme" content="light dark">
|
|
11
11
|
<link rel="icon" type="image/svg+xml" href="assets/favicon-1ebfcc0182.svg">
|
|
12
12
|
<link rel="stylesheet" href="assets/main-anw3f6ba.css">
|
|
13
|
-
<script type="module" src="assets/main-
|
|
13
|
+
<script type="module" src="assets/main-hjmqn8vx.js"></script>
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="app"></div>
|
|
Binary file
|
data/sig/robin/config.rbs
CHANGED
|
@@ -83,6 +83,9 @@ module Robin
|
|
|
83
83
|
include _Object
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Config#job_timestamps.
|
|
87
|
+
type job_timestamps = :milliseconds | :seconds
|
|
88
|
+
|
|
86
89
|
type job_wrapper = ^(job_hash payload) { () -> void } -> void | _JobWrapper
|
|
87
90
|
|
|
88
91
|
# A group of worker threads with its own queues and concurrency.
|
|
@@ -199,6 +202,16 @@ module Robin
|
|
|
199
202
|
|
|
200
203
|
attr_accessor shutdown_requeue: bool
|
|
201
204
|
|
|
205
|
+
JOB_TIMESTAMPS: Array[Symbol]
|
|
206
|
+
|
|
207
|
+
# How jobs record their times.
|
|
208
|
+
attr_reader job_timestamps: job_timestamps
|
|
209
|
+
|
|
210
|
+
def job_timestamps=: (job_timestamps unit) -> job_timestamps
|
|
211
|
+
|
|
212
|
+
# +ms+ (epoch ms) as a job records it: Integer ms or Float seconds.
|
|
213
|
+
def job_timestamp: (Integer ms) -> (Integer | Float)
|
|
214
|
+
|
|
202
215
|
attr_accessor job_wrapper: job_wrapper?
|
|
203
216
|
|
|
204
217
|
attr_accessor health_bind: String
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: robin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Erik Berlin
|
|
@@ -161,8 +161,8 @@ files:
|
|
|
161
161
|
- lib/robin/web/dist/assets/ko-bxersv91.js.gz
|
|
162
162
|
- lib/robin/web/dist/assets/main-anw3f6ba.css
|
|
163
163
|
- lib/robin/web/dist/assets/main-anw3f6ba.css.gz
|
|
164
|
-
- lib/robin/web/dist/assets/main-
|
|
165
|
-
- lib/robin/web/dist/assets/main-
|
|
164
|
+
- lib/robin/web/dist/assets/main-hjmqn8vx.js
|
|
165
|
+
- lib/robin/web/dist/assets/main-hjmqn8vx.js.gz
|
|
166
166
|
- lib/robin/web/dist/assets/main-zz8zzhwn.js
|
|
167
167
|
- lib/robin/web/dist/assets/main-zz8zzhwn.js.gz
|
|
168
168
|
- lib/robin/web/dist/assets/nb-fjnc5064.js
|
|
Binary file
|