{{ data.strings.none }}
+ + +| {{ point.label }} | +{{ point.value }} | +
|---|
{{ strings.subtitle }}
+{{ strings.list.empty }}
+ +| {{ strings.list.issue }} | +{{ strings.list.level }} | +{{ strings.list.events }} | +{{ strings.list.users }} | +{{ strings.list.last_seen }} | +
|---|---|---|---|---|
|
+ {{ issue.short_class }}
+ {{ strings.statuses[issue.status] }}
+ {{ issue.title }} +{{ issue.culprit }} + |
+ + {{ strings.levels[issue.level] ?? issue.level }} + {{ strings.kinds[issue.kind] ?? issue.kind }} + | +{{ issue.times_seen }} | +{{ issue.users_seen }} | ++ {{ date(issue.last_seen_at) }} + {{ issue.last_release }} + | +
{{ issue.class }}
+{{ issue.message }}
+{{ issue.culprit }}
++ {{ strings.statuses[issue.status] }} + {{ strings.levels[issue.level] ?? issue.level }} + {{ strings.kinds[issue.kind] ?? issue.kind }} + {{ replace(s.resolved_in, { release: issue.resolved_in }) }} + {{ s.regressed }}: {{ date(issue.regressed_at) }} +
+{{ replace(s.resolve_next_hint, { release: currentRelease }) }}
+ +{{ s.no_event }}
+ + +{{ s.caused_by }}
+{{ exception.class }}
+{{ exception.message }}
+ ++ {{ frame.function || s.none }} + {{ where(frame) }} +
+{{ frame.line - frame.context.pre.length + c }}{{ code }}{{ frame.line }}{{ frame.context.line }}{{ frame.line + 1 + c }}{{ code }}
+ | {{ s[key] }} | +|||||
|---|---|---|---|---|---|
| + {{ date(row.created_at) }} · {{ s.shown }} + {{ date(row.created_at) }} + | +{{ row.site ?? s.none }} | +{{ row.method ?? s.none }} | +{{ row.path ?? s.none }} | +{{ row.release }} | +{{ row.user_id ?? s.none }} | +
Fragment
')); + Route::get('/multiple', static fn () => response('', 300)); + Route::get('/created', static fn () => response('', 201)); + Route::get('/streamed', static fn () => response()->stream(static function (): void { + echo ''; + }, 200, ['Content-Type' => 'text/html'])); + Route::get('/admin/help', static fn () => response('Help')); + }); + } + + protected function setUp(): void + { + parent::setUp(); + + // Far above anything one test sends: the throttle has its own tests. + config(['atrium-errors.browser.per_minute' => 10000]); + } + + public function test_a_switched_off_endpoint_says_it_does_not_accept(): void + { + $this->postJson('/atrium-errors/browser', ['message' => 'x']) + ->assertNotFound() + ->assertExactJson(['message' => 'Not accepted']); + + $this->assertSame(0, Occurrence::query()->count()); + } + + public function test_an_endpoint_switched_on_for_the_admin_only_accepts_too(): void + { + $this->settings(['browser_admin' => true]); + + $this->postJson('/atrium-errors/browser', ['message' => 'x', 'source' => 'admin'])->assertStatus(202); + } + + public function test_a_report_that_is_not_valid_is_refused_in_so_many_words(): void + { + $this->settings(['browser_site' => true]); + + $this->postJson('/atrium-errors/browser', ['name' => 'TypeError']) + ->assertStatus(422) + ->assertExactJson(['message' => 'Invalid report']); + $this->postJson('/atrium-errors/browser', ['message' => 'x', 'source' => 'mobile'])->assertStatus(422); + $this->call('POST', '/atrium-errors/browser', [], [], [], ['CONTENT_TYPE' => 'application/json'], '[1,2')->assertStatus(422); + $this->call('POST', '/atrium-errors/browser', [], [], [], ['CONTENT_TYPE' => 'application/json'], '"text"')->assertStatus(422); + } + + public function test_every_optional_field_may_be_null(): void + { + $this->settings(['browser_site' => true]); + + $this->postJson('/atrium-errors/browser', ['message' => 'x', 'name' => null, 'stack' => null, 'url' => null, 'line' => null, 'column' => null, 'source' => null]) + ->assertStatus(202); + + $this->assertSame(['source' => 'site'], Occurrence::query()->sole()->payload['context']); + } + + #[DataProvider('fieldLimits')] + public function test_a_field_is_refused_just_over_its_limit_and_taken_on_it(string $field, mixed $fits, mixed $over): void + { + $this->settings(['browser_site' => true]); + + $this->postJson('/atrium-errors/browser', ['message' => 'x', $field => $fits])->assertStatus(202); + $this->postJson('/atrium-errors/browser', ['message' => 'x', $field => $over])->assertStatus(422); + } + + /** + * @return arrayFragment
', $this->get('/no-head')->assertOk()->getContent()); + } + + public function test_a_streamed_page_is_left_as_it_is(): void + { + $this->settings(['browser_site' => true]); + + $response = $this->get('/streamed')->assertOk(); + + $this->assertSame('', $response->streamedContent()); + } + + public function test_only_answers_under_three_hundred_get_the_script(): void + { + $this->settings(['browser_site' => true]); + + $this->assertStringContainsString('atrium-errors.js', (string) $this->get('/created')->assertStatus(201)->getContent()); + $this->assertSame('', $this->get('/multiple')->assertStatus(300)->getContent()); + } + + #[DataProvider('prefixes')] + public function test_the_admin_is_told_by_the_prefix_of_the_panel_with_or_without_slashes(string $prefix): void + { + $this->settings(['browser_admin' => true]); + config(['atrium.prefix' => $prefix]); + + $this->assertStringContainsString('data-source="admin"', (string) $this->get('/admin/help')->getContent()); + } + + /** + * @return arrayFragment
')); + Route::get('/data.json', static fn () => response()->json(['ok' => true])); + Route::get('/brochure', static fn () => response('', 200, ['Content-Type' => 'text/html', 'Content-Disposition' => 'attachment; filename=brochure.html'])); + Route::get('/moved', static fn () => redirect('/tours')); + Route::get('/admin/help', static fn () => response('Help')); + }); + } + + public function test_a_report_is_stored_with_its_stack_and_page(): void + { + $this->settings(['browser_site' => true]); + + $this->withHeader('Referer', 'http://localhost/tours/greece?utm_source=mail&token=abc123') + ->postJson('/atrium-errors/browser', [ + 'message' => "Cannot read properties of undefined (reading 'price')", + 'name' => 'TypeError', + 'stack' => "TypeError: Cannot read properties of undefined\n at renderPrice (http://localhost/build/app-Bx91kQ2z.js?v=3:10:5)\n at http://localhost/build/app-Bx91kQ2z.js:20:1\n at https://cdn.example.test/lib.js:1:1", + 'source' => 'site', + 'line' => 10, + 'column' => 5, + ]) + ->assertStatus(202); + + $issue = Issue::query()->sole(); + $this->assertSame('browser', $issue->kind); + $this->assertSame('TypeError', $issue->class); + + $event = Occurrence::query()->sole(); + $this->assertSame('/tours/greece', $event->path); + $payload = $event->payload; + $this->assertSame(['source' => 'site'], $payload['context']); + $this->assertStringNotContainsString('abc123', (string) $payload['request']['url']); + + $frames = $payload['exceptions'][0]['frames']; + $this->assertSame(['/build/app-Bx91kQ2z.js', '/build/app-Bx91kQ2z.js', 'https://cdn.example.test/lib.js'], array_column($frames, 'file')); + $this->assertSame(['renderPrice', '', ''], array_column($frames, 'function')); + $this->assertSame([true, true, false], array_column($frames, 'in_app')); + } + + public function test_firefox_stacks_and_reports_without_a_stack_are_understood(): void + { + $this->settings(['browser_admin' => true]); + + $this->postJson('/atrium-errors/browser', ['message' => 'a is null', 'stack' => "save@http://localhost/admin.js:4:2\n@http://localhost/admin.js:9:1", 'source' => 'admin'])->assertStatus(202); + $this->postJson('/atrium-errors/browser', ['message' => 'Script error.', 'url' => 'http://localhost/inline.js', 'line' => 3, 'name' => 'bad name!'])->assertStatus(202); + + $first = Occurrence::query()->orderBy('id')->first()?->payload; + $this->assertSame(['save', ''], array_column($first['exceptions'][0]['frames'], 'function')); + $this->assertSame(['source' => 'admin'], $first['context']); + + $second = Occurrence::query()->orderByDesc('id')->first()?->payload; + $this->assertSame('/inline.js', $second['exceptions'][0]['frames'][0]['file']); + $this->assertSame('Error', $second['exceptions'][0]['class']); + $this->assertNull(Occurrence::query()->orderByDesc('id')->first()?->path); + } + + public function test_the_endpoint_is_closed_while_both_switches_are_off(): void + { + $this->postJson('/atrium-errors/browser', ['message' => 'x'])->assertNotFound(); + + $this->assertSame(0, Occurrence::query()->count()); + } + + /** + * @return array${t(a)}
`))}return i(),n.join(``)}function J(e){let t=e.target.closest?.(`a[data-ai-link]`);t&&(e.preventDefault(),w.visit(t.getAttribute(`href`)))}function Y(e){e.key===`Escape`&&y.value&&(y.value=!1)}return(t,n)=>d.value?(a(),E(`div`,{key:0,class:`fixed bottom-4 right-4 z-40 flex flex-col items-end gap-3`,dusk:`ai-helper`,onKeydown:Y},[y.value?(a(),E(`section`,{key:0,class:`flex w-[22rem] max-w-[calc(100vw-2rem)] max-h-[min(36rem,calc(100vh-8rem))] flex-col rounded-lg border border-line bg-surface text-fg shadow-xl`,role:`dialog`,"aria-label":f.value.title,dusk:`ai-chat`},[D(`header`,Ge,[D(`h2`,Ke,v(f.value.title),1),D(`div`,qe,[O.value.length?(a(),E(`button`,{key:0,type:`button`,class:`text-muted hover:text-fg`,dusk:`ai-clear`,onClick:R},v(f.value.clear),1)):e(``,!0),D(`button`,{type:`button`,class:`text-muted hover:text-fg`,"aria-label":f.value.close,dusk:`ai-close`,onClick:n[0]||=e=>y.value=!1},[...n[2]||=[D(`svg`,{class:`h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},[D(`path`,{d:`M5.3 4.3 10 9l4.7-4.7 1 1L11 10l4.7 4.7-1 1L10 11l-4.7 4.7-1-1L9 10 4.3 5.3z`})],-1)]],8,Je)])]),D(`div`,{ref_key:`list`,ref:k,class:`flex-1 space-y-3 overflow-y-auto px-4 py-3 text-sm`,"aria-live":`polite`,onClick:J},[D(`p`,Ye,v(f.value.hello),1),(a(!0),E(T,null,l(O.value,(e,t)=>(a(),E(`div`,{key:t,class:c([`flex`,e.role===`user`?`justify-end`:`justify-start`])},[e.role===`user`?(a(),E(`p`,Xe,v(e.text),1)):(a(),E(`div`,{key:1,class:c([`max-w-[90%] space-y-2 rounded-lg px-3 py-2`,e.error?`border border-danger bg-danger-soft text-danger-soft-fg`:`bg-surface-alt`]),dusk:e.error?`ai-error`:`ai-answer`,innerHTML:q(e.text)},null,10,Ze))],2))),128)),b.value?(a(),E(`p`,Qe,v(f.value.thinking),1)):e(``,!0)],512),D(`form`,{class:`border-t border-line p-3`,onSubmit:h(B,[`prevent`])},[D(`div`,$e,[r(D(`textarea`,{ref_key:`input`,ref:A,"onUpdate:modelValue":n[1]||=e=>C.value=e,rows:`2`,maxlength:`2000`,class:`flex-1 resize-none rounded-md border border-field bg-surface px-3 py-2 text-sm text-fg focus:border-focus focus:outline-none focus:ring-1 focus:ring-focus`,placeholder:f.value.placeholder,"aria-label":f.value.placeholder,dusk:`ai-input`,onKeydown:W},null,40,et),[[x,C.value]]),D(`button`,{type:`submit`,class:`rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover disabled:opacity-50`,disabled:b.value||C.value.trim()===``,dusk:`ai-send`},v(f.value.send),9,tt)]),D(`p`,$,v(f.value.note),1)],32)],8,We)):e(``,!0),D(`button`,{ref_key:`mascot`,ref:M,type:`button`,class:c([`ai-mascot group relative h-16 w-16 rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,{"is-thinking":b.value,"is-open":y.value}]),"aria-label":f.value.open,"aria-expanded":y.value,title:f.value.open,dusk:`ai-mascot`,onClick:L},[(a(),E(`svg`,rt,[n[9]||=D(`ellipse`,{class:`ai-mascot-shadow fill-fg`,cx:`24`,cy:`49`,rx:`15`,ry:`2.2`,opacity:`0.15`},null,-1),D(`g`,it,[n[5]||=D(`path`,{class:`fill-fg`,d:`M6 42V22a18 18 0 0 1 36 0v20H32V22a8 8 0 0 0-16 0v20z`},null,-1),n[6]||=D(`rect`,{class:`ai-mascot-belt fill-accent`,x:`16`,y:`28`,width:`16`,height:`5`},null,-1),n[7]||=D(`rect`,{class:`fill-fg`,x:`4`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),n[8]||=D(`rect`,{class:`fill-fg`,x:`31`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),D(`g`,at,[n[3]||=D(`circle`,{class:`fill-surface`,cx:`19`,cy:`10.5`,r:`3`},null,-1),n[4]||=D(`circle`,{class:`fill-surface`,cx:`29`,cy:`10.5`,r:`3`},null,-1),D(`circle`,{class:`fill-fg`,cx:19+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,ot),D(`circle`,{class:`fill-fg`,cx:29+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,st)])])]))],10,nt)],32)):e(``,!0)}},[[`__scopeId`,`data-v-6928fa25`]]),lt={class:`min-h-screen bg-page`},ut={"data-page-content":`true`,class:`p-4 lg:p-6`},dt={key:0,"data-flash":`success`,class:`mb-4 p-4 bg-success-soft border border-success text-success-soft-fg rounded`},ft={key:1,"data-flash":`error`,class:`mb-4 p-4 bg-danger-soft border border-danger text-danger-soft-fg rounded`},pt={__name:`AdminLayout`,props:{title:{type:String,default:``}},setup(n){let r=S(),i=p(!1),o=p(!1),s=g(()=>r.props.branding||{}),l=g(()=>r.props.menu||[]),u=g(()=>r.props.auth?.user||{}),d=()=>{i.value=!i.value},f=()=>{o.value=!o.value},h=()=>{i.value=!1};return(r,p)=>(a(),E(T,null,[t(m(C),{title:n.title||``},null,8,[`title`]),D(`div`,lt,[i.value?(a(),E(`div`,{key:0,class:`fixed inset-0 z-40 bg-black/50 lg:hidden`,onClick:h})):e(``,!0),t(ce,{open:i.value,collapsed:o.value,menu:l.value,branding:s.value,onClose:h},null,8,[`open`,`collapsed`,`menu`,`branding`]),D(`div`,{class:c([`transition-all duration-300`,o.value?`lg:pl-20`:`lg:pl-64`])},[t(Be,{user:u.value,branding:s.value,onToggleSidebar:d,onToggleCollapse:f},null,8,[`user`,`branding`]),D(`main`,ut,[r.$page.props.flash?.success?(a(),E(`div`,dt,v(r.$page.props.flash.success),1)):e(``,!0),r.$page.props.flash?.error?(a(),E(`div`,ft,v(r.$page.props.flash.error),1)):e(``,!0),O(r.$slots,`default`)])],2),t(ct)])],64))}};export{X as i,Z as n,Q as r,pt as t}; \ No newline at end of file +import{$ as e,C as t,E as n,F as r,G as i,H as a,I as o,M as s,P as c,Q as l,R as u,S as d,T as f,W as p,X as m,_ as h,b as g,c as _,h as v,i as y,m as b,o as x,r as S,s as C,tt as w,v as T,w as E,x as D,z as O}from"./dist-Bie52OmN.js";import{n as k,r as A,t as j}from"./LocaleSwitcher-DAWnmZni.js";import{n as M,t as N}from"./app-BCJOqmKO.js";var P=[`aria-expanded`,`title`],F={class:`flex items-center`},I=[`innerHTML`],L={key:0},R=[`innerHTML`],z={key:0,class:`mt-1 ml-4 space-y-1 border-l border-sidebar-line pl-3`},B=[`innerHTML`],V={key:0},H=`flex items-center px-3 py-2 text-sm rounded-lg transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-accent`,U=`bg-sidebar-active text-sidebar-active-fg font-semibold shadow-[inset_3px_0_0_var(--atrium-sidebar-accent)]`,W=`text-sidebar-fg font-medium hover:bg-sidebar-hover`,G={__name:`AdminMenuItem`,props:{item:{type:Object,required:!0},collapsed:Boolean},setup(r){let a=r,s=x(),c=m(!1),h=g(()=>a.item.children&&a.item.children.length>0),_=e=>{let t=route(e,void 0,!1),n=s.url.split(`?`)[0];return n===t||t!==route(`admin.dashboard`,void 0,!1)&&n.startsWith(t+`/`)},b=g(()=>!!a.item.route&&_(a.item.route)),S=g(()=>h.value?a.item.children.some(e=>e.route&&_(e.route)):!1),C=()=>{h.value&&(c.value=!c.value)};S.value&&(c.value=!0);let O={home:`${t(a)}
`))}return i(),n.join(``)}function J(e){let t=e.target.closest?.(`a[data-ai-link]`);t&&(e.preventDefault(),C.visit(t.getAttribute(`href`)))}function Y(e){e.key===`Escape`&&v.value&&(v.value=!1)}return(n,r)=>d.value?(o(),E(`div`,{key:0,class:`fixed bottom-4 right-4 z-40 flex flex-col items-end gap-3`,dusk:`ai-helper`,onKeydown:Y},[v.value?(o(),E(`section`,{key:0,class:`flex w-[22rem] max-w-[calc(100vw-2rem)] max-h-[min(36rem,calc(100vh-8rem))] flex-col rounded-lg border border-line bg-surface text-fg shadow-xl`,role:`dialog`,"aria-label":f.value.title,dusk:`ai-chat`},[D(`header`,Ge,[D(`h2`,Ke,w(f.value.title),1),D(`div`,qe,[O.value.length?(o(),E(`button`,{key:0,type:`button`,class:`text-muted hover:text-fg`,dusk:`ai-clear`,onClick:R},w(f.value.clear),1)):t(``,!0),D(`button`,{type:`button`,class:`text-muted hover:text-fg`,"aria-label":f.value.close,dusk:`ai-close`,onClick:r[0]||=e=>v.value=!1},[...r[2]||=[D(`svg`,{class:`h-4 w-4`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},[D(`path`,{d:`M5.3 4.3 10 9l4.7-4.7 1 1L11 10l4.7 4.7-1 1L10 11l-4.7 4.7-1-1L9 10 4.3 5.3z`})],-1)]],8,Je)])]),D(`div`,{ref_key:`list`,ref:k,class:`flex-1 space-y-3 overflow-y-auto px-4 py-3 text-sm`,"aria-live":`polite`,onClick:J},[D(`p`,Ye,w(f.value.hello),1),(o(!0),E(T,null,u(O.value,(t,n)=>(o(),E(`div`,{key:n,class:e([`flex`,t.role===`user`?`justify-end`:`justify-start`])},[t.role===`user`?(o(),E(`p`,Xe,w(t.text),1)):(o(),E(`div`,{key:1,class:e([`max-w-[90%] space-y-2 rounded-lg px-3 py-2`,t.error?`border border-danger bg-danger-soft text-danger-soft-fg`:`bg-surface-alt`]),dusk:t.error?`ai-error`:`ai-answer`,innerHTML:q(t.text)},null,10,Ze))],2))),128)),y.value?(o(),E(`p`,Qe,w(f.value.thinking),1)):t(``,!0)],512),D(`form`,{class:`border-t border-line p-3`,onSubmit:h(B,[`prevent`])},[D(`div`,$e,[i(D(`textarea`,{ref_key:`input`,ref:A,"onUpdate:modelValue":r[1]||=e=>S.value=e,rows:`2`,maxlength:`2000`,class:`flex-1 resize-none rounded-md border border-field bg-surface px-3 py-2 text-sm text-fg focus:border-focus focus:outline-none focus:ring-1 focus:ring-focus`,placeholder:f.value.placeholder,"aria-label":f.value.placeholder,dusk:`ai-input`,onKeydown:W},null,40,et),[[b,S.value]]),D(`button`,{type:`submit`,class:`rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover disabled:opacity-50`,disabled:y.value||S.value.trim()===``,dusk:`ai-send`},w(f.value.send),9,tt)]),D(`p`,$,w(f.value.note),1)],32)],8,We)):t(``,!0),D(`button`,{ref_key:`mascot`,ref:M,type:`button`,class:e([`ai-mascot group relative h-16 w-16 rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-focus`,{"is-thinking":y.value,"is-open":v.value}]),"aria-label":f.value.open,"aria-expanded":v.value,title:f.value.open,dusk:`ai-mascot`,onClick:L},[(o(),E(`svg`,rt,[r[9]||=D(`ellipse`,{class:`ai-mascot-shadow fill-fg`,cx:`24`,cy:`49`,rx:`15`,ry:`2.2`,opacity:`0.15`},null,-1),D(`g`,it,[r[5]||=D(`path`,{class:`fill-fg`,d:`M6 42V22a18 18 0 0 1 36 0v20H32V22a8 8 0 0 0-16 0v20z`},null,-1),r[6]||=D(`rect`,{class:`ai-mascot-belt fill-accent`,x:`16`,y:`28`,width:`16`,height:`5`},null,-1),r[7]||=D(`rect`,{class:`fill-fg`,x:`4`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),r[8]||=D(`rect`,{class:`fill-fg`,x:`31`,y:`41`,width:`13`,height:`3.5`,rx:`1.75`},null,-1),D(`g`,at,[r[3]||=D(`circle`,{class:`fill-surface`,cx:`19`,cy:`10.5`,r:`3`},null,-1),r[4]||=D(`circle`,{class:`fill-surface`,cx:`29`,cy:`10.5`,r:`3`},null,-1),D(`circle`,{class:`fill-fg`,cx:19+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,ot),D(`circle`,{class:`fill-fg`,cx:29+j.value.x,cy:10.5+j.value.y,r:`1.4`},null,8,st)])])]))],10,nt)],32)):t(``,!0)}},[[`__scopeId`,`data-v-6928fa25`]]),lt={class:`min-h-screen bg-page`},ut={"data-page-content":`true`,class:`p-4 lg:p-6`},dt={key:0,"data-flash":`success`,class:`mb-4 p-4 bg-success-soft border border-success text-success-soft-fg rounded`},ft={key:1,"data-flash":`error`,class:`mb-4 p-4 bg-danger-soft border border-danger text-danger-soft-fg rounded`},pt={__name:`AdminLayout`,props:{title:{type:String,default:``}},setup(r){let i=x(),a=m(!1),s=m(!1),c=g(()=>i.props.branding||{}),u=g(()=>i.props.menu||[]),d=g(()=>i.props.auth?.user||{}),f=()=>{a.value=!a.value},p=()=>{s.value=!s.value},h=()=>{a.value=!1};return(i,m)=>(o(),E(T,null,[n(l(S),{title:r.title||``},null,8,[`title`]),D(`div`,lt,[a.value?(o(),E(`div`,{key:0,class:`fixed inset-0 z-40 bg-black/50 lg:hidden`,onClick:h})):t(``,!0),n(ce,{open:a.value,collapsed:s.value,menu:u.value,branding:c.value,onClose:h},null,8,[`open`,`collapsed`,`menu`,`branding`]),D(`div`,{class:e([`transition-all duration-300`,s.value?`lg:pl-20`:`lg:pl-64`])},[n(Be,{user:d.value,branding:c.value,onToggleSidebar:f,onToggleCollapse:p},null,8,[`user`,`branding`]),D(`main`,ut,[i.$page.props.flash?.success?(o(),E(`div`,dt,w(i.$page.props.flash.success),1)):t(``,!0),i.$page.props.flash?.error?(o(),E(`div`,ft,w(i.$page.props.flash.error),1)):t(``,!0),O(i.$slots,`default`)])],2),n(ct)])],64))}};export{X as i,Z as n,Q as r,pt as t}; \ No newline at end of file diff --git a/packages/admin/dist/assets/AdminModal-DNJ_V4iq.js b/packages/admin/dist/assets/AdminModal-DKazeNNa.js similarity index 62% rename from packages/admin/dist/assets/AdminModal-DNJ_V4iq.js rename to packages/admin/dist/assets/AdminModal-DKazeNNa.js index 717bcf40..3ee85084 100644 --- a/packages/admin/dist/assets/AdminModal-DNJ_V4iq.js +++ b/packages/admin/dist/assets/AdminModal-DKazeNNa.js @@ -1 +1 @@ -import{C as e,E as t,H as n,I as r,Q as i,S as a,W as o,c as s,et as c,w as l,x as u,y as d,z as f}from"./dist-MY__znoP.js";var p={key:0,"data-modal":`true`,class:`fixed inset-0 z-50 overflow-y-auto`},m={class:`flex min-h-full items-center justify-center p-4`},h={key:0,class:`px-6 py-4 border-b border-line`},g={class:`text-lg font-medium text-fg`},_={class:`p-6`},v={key:1,class:`px-6 py-4 border-t border-line bg-surface-alt flex justify-end space-x-3`},y={__name:`AdminModal`,props:{show:Boolean,maxWidth:{type:String,default:`md`},closeable:{type:Boolean,default:!0},title:String},emits:[`close`],setup(y,{emit:b}){let x=y,S=b,C=()=>{x.closeable&&S(`close`)},w={sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`};return n(()=>x.show,e=>{e?document.body.style.overflow=`hidden`:document.body.style.overflow=``}),(n,b)=>(r(),a(d,{to:`body`},[t(s,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:o(()=>[y.show?(r(),l(`div`,p,[u(`div`,{class:`fixed inset-0 bg-black/50 transition-opacity`,onClick:C}),u(`div`,m,[t(s,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:o(()=>[y.show?(r(),l(`div`,{key:0,class:i([`relative transform overflow-hidden rounded-lg bg-surface shadow-xl transition-all sm:my-8 sm:w-full`,w[y.maxWidth]])},[y.title||n.$slots.header?(r(),l(`div`,h,[f(n.$slots,`header`,{},()=>[u(`h3`,g,c(y.title),1)]),y.closeable?(r(),l(`button`,{key:0,onClick:C,class:`absolute top-4 right-4 text-muted hover:text-fg`},[...b[0]||=[u(`svg`,{class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[u(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])):e(``,!0)])):e(``,!0),u(`div`,_,[f(n.$slots,`default`)]),n.$slots.footer?(r(),l(`div`,v,[f(n.$slots,`footer`)])):e(``,!0)],2)):e(``,!0)]),_:3})])])):e(``,!0)]),_:3})]))}};export{y as t}; \ No newline at end of file +import{$ as e,C as t,E as n,H as r,I as i,S as a,W as o,c as s,tt as c,w as l,x as u,y as d,z as f}from"./dist-Bie52OmN.js";var p={key:0,"data-modal":`true`,class:`fixed inset-0 z-50 overflow-y-auto`},m={class:`flex min-h-full items-center justify-center p-4`},h={key:0,class:`px-6 py-4 border-b border-line`},g={class:`text-lg font-medium text-fg`},_={class:`p-6`},v={key:1,class:`px-6 py-4 border-t border-line bg-surface-alt flex justify-end space-x-3`},y={__name:`AdminModal`,props:{show:Boolean,maxWidth:{type:String,default:`md`},closeable:{type:Boolean,default:!0},title:String},emits:[`close`],setup(y,{emit:b}){let x=y,S=b,C=()=>{x.closeable&&S(`close`)},w={sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`};return r(()=>x.show,e=>{e?document.body.style.overflow=`hidden`:document.body.style.overflow=``}),(r,b)=>(i(),a(d,{to:`body`},[n(s,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:o(()=>[y.show?(i(),l(`div`,p,[u(`div`,{class:`fixed inset-0 bg-black/50 transition-opacity`,onClick:C}),u(`div`,m,[n(s,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:o(()=>[y.show?(i(),l(`div`,{key:0,class:e([`relative transform overflow-hidden rounded-lg bg-surface shadow-xl transition-all sm:my-8 sm:w-full`,w[y.maxWidth]])},[y.title||r.$slots.header?(i(),l(`div`,h,[f(r.$slots,`header`,{},()=>[u(`h3`,g,c(y.title),1)]),y.closeable?(i(),l(`button`,{key:0,onClick:C,class:`absolute top-4 right-4 text-muted hover:text-fg`},[...b[0]||=[u(`svg`,{class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[u(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])):t(``,!0)])):t(``,!0),u(`div`,_,[f(r.$slots,`default`)]),r.$slots.footer?(i(),l(`div`,v,[f(r.$slots,`footer`)])):t(``,!0)],2)):t(``,!0)]),_:3})])])):t(``,!0)]),_:3})]))}};export{y as t}; \ No newline at end of file diff --git a/packages/admin/dist/assets/AdminPagination-D7rwNfhd.js b/packages/admin/dist/assets/AdminPagination-D7rwNfhd.js new file mode 100644 index 00000000..27ba5a53 --- /dev/null +++ b/packages/admin/dist/assets/AdminPagination-D7rwNfhd.js @@ -0,0 +1 @@ +import{$ as e,I as t,Q as n,R as r,S as i,T as a,W as o,b as s,i as c,tt as l,v as u,w as d,x as f}from"./dist-Bie52OmN.js";var p={class:`bg-surface px-4 py-3 border-t border-line sm:px-6`},m={class:`flex items-center justify-between`},h={class:`text-sm text-fg`},g={class:`inline-flex -space-x-px rounded-md shadow-sm`},_={key:1,class:`relative inline-flex items-center rounded-l-md px-2 py-2 text-muted ring-1 ring-inset ring-field`},v={key:0,class:`relative inline-flex items-center px-4 py-2 text-sm font-semibold text-fg ring-1 ring-inset ring-field`},y={key:3,class:`relative inline-flex items-center rounded-r-md px-2 py-2 text-muted ring-1 ring-inset ring-field`},b={__name:`AdminPagination`,props:{paginator:{type:Object,required:!0}},setup(b){let x=b,S=s(()=>{let e=x.paginator.current_page,t=x.paginator.last_page,n=[],r=[];for(let r=1;r<=t;r++)(r===1||r===t||r>=e-2&&r<=e+2)&&n.push(r);let i=null;for(let e of n)i&&(e-i===2?r.push(i+1):e-i!==1&&r.push(`...`)),r.push(e),i=e;return r});return(s,x)=>(t(),d(`div`,p,[f(`div`,m,[f(`div`,h,l(s.$t(`resource.pagination.showing`,{from:b.paginator.from,to:b.paginator.to,total:b.paginator.total})),1),f(`nav`,g,[b.paginator.prev_page_url?(t(),i(n(c),{key:0,href:b.paginator.prev_page_url,class:`relative inline-flex items-center rounded-l-md px-2 py-2 text-muted ring-1 ring-inset ring-field hover:bg-hover`,"preserve-scroll":``},{default:o(()=>[...x[0]||=[f(`svg`,{class:`h-5 w-5`,viewBox:`0 0 20 20`,fill:`currentColor`},[f(`path`,{"fill-rule":`evenodd`,d:`M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`href`])):(t(),d(`span`,_,[...x[1]||=[f(`svg`,{class:`h-5 w-5`,viewBox:`0 0 20 20`,fill:`currentColor`},[f(`path`,{"fill-rule":`evenodd`,d:`M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z`,"clip-rule":`evenodd`})],-1)]])),(t(!0),d(u,null,r(S.value,r=>(t(),d(u,{key:r},[r===`...`?(t(),d(`span`,v,` ... `)):(t(),i(n(c),{key:1,href:`${b.paginator.path}?page=${r}`,class:e([`relative inline-flex items-center px-4 py-2 text-sm font-semibold ring-1 ring-inset ring-field`,r===b.paginator.current_page?`z-10 bg-accent text-on-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus`:`text-fg hover:bg-hover`]),"preserve-scroll":``},{default:o(()=>[a(l(r),1)]),_:2},1032,[`href`,`class`]))],64))),128)),b.paginator.next_page_url?(t(),i(n(c),{key:2,href:b.paginator.next_page_url,class:`relative inline-flex items-center rounded-r-md px-2 py-2 text-muted ring-1 ring-inset ring-field hover:bg-hover`,"preserve-scroll":``},{default:o(()=>[...x[2]||=[f(`svg`,{class:`h-5 w-5`,viewBox:`0 0 20 20`,fill:`currentColor`},[f(`path`,{"fill-rule":`evenodd`,d:`M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`href`])):(t(),d(`span`,y,[...x[3]||=[f(`svg`,{class:`h-5 w-5`,viewBox:`0 0 20 20`,fill:`currentColor`},[f(`path`,{"fill-rule":`evenodd`,d:`M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z`,"clip-rule":`evenodd`})],-1)]]))])])]))}};export{b as t}; \ No newline at end of file diff --git a/packages/admin/dist/assets/BarChart-wks0RLo_.js b/packages/admin/dist/assets/BarChart-wks0RLo_.js new file mode 100644 index 00000000..f561b188 --- /dev/null +++ b/packages/admin/dist/assets/BarChart-wks0RLo_.js @@ -0,0 +1 @@ +import{C as e,I as t,R as n,b as r,et as i,o as a,tt as o,v as s,w as c,x as l}from"./dist-Bie52OmN.js";var u=[`aria-label`],d=[`title`],f={key:0,class:`mb-0.5 text-[10px] leading-none text-fg tabular-nums`,"data-bar-value":``},p={class:`mt-1 flex gap-px`,"aria-hidden":`true`},m={class:`sr-only`},h={key:0},g={scope:`row`},_=14,v={__name:`BarChart`,props:{points:{type:Array,required:!0},every:{type:Number,default:1},label:{type:String,default:``},height:{type:Number,default:96}},setup(v){let y=v,b=a(),x=r(()=>new Intl.NumberFormat(String(b.props.locale||`en`).replace(`_`,`-`),{notation:`compact`})),S=r(()=>Math.max(1,...y.points.map(e=>Number(e.value)||0)));function C(e){return e>0?`${Math.max(2,e/S.value*(y.height-_))}px`:`0px`}return(r,a)=>(t(),c(`figure`,{class:`w-full`,"aria-label":v.label,dusk:`bar-chart`},[l(`div`,{class:`flex items-end gap-px`,style:i({height:`${v.height}px`}),"aria-hidden":`true`},[(t(!0),c(s,null,n(v.points,(n,r)=>(t(),c(`div`,{key:r,class:`flex-1 min-w-0 h-full flex flex-col items-center justify-end`,title:`${n.label}: ${n.value}`,"data-bar":``},[n.value>0?(t(),c(`span`,f,o(x.value.format(n.value)),1)):e(``,!0),l(`div`,{class:`w-full rounded-t-sm bg-accent`,style:i({height:C(n.value)})},null,4)],8,d))),128))],4),a[0]||=l(`div`,{class:`h-px bg-field`,"aria-hidden":`true`},null,-1),l(`div`,p,[(t(!0),c(s,null,n(v.points,(e,n)=>(t(),c(`span`,{key:n,class:`flex-1 min-w-0 text-[10px] text-muted tabular-nums whitespace-nowrap`},o(n%v.every===0?e.label:``),1))),128))]),l(`table`,m,[v.label?(t(),c(`caption`,h,o(v.label),1)):e(``,!0),l(`tbody`,null,[(t(!0),c(s,null,n(v.points,(e,n)=>(t(),c(`tr`,{key:n},[l(`th`,g,o(e.label),1),l(`td`,null,o(e.value),1)]))),128))])])],8,u))}};export{v as t}; \ No newline at end of file diff --git a/packages/admin/dist/assets/ContentLocaleSwitcher-BJIieXK-.js b/packages/admin/dist/assets/ContentLocaleSwitcher-HJzbB87a.js similarity index 59% rename from packages/admin/dist/assets/ContentLocaleSwitcher-BJIieXK-.js rename to packages/admin/dist/assets/ContentLocaleSwitcher-HJzbB87a.js index b3a342e0..b0197cf3 100644 --- a/packages/admin/dist/assets/ContentLocaleSwitcher-BJIieXK-.js +++ b/packages/admin/dist/assets/ContentLocaleSwitcher-HJzbB87a.js @@ -1 +1 @@ -import{C as e,G as t,H as n,I as r,Q as i,R as a,T as o,Y as s,b as c,et as l,h as u,v as d,w as f,x as p,z as m}from"./dist-MY__znoP.js";var h={class:`admin-tabs`},g={class:`border-b border-line`},_=[`aria-label`],v=[`data-tab`,`data-tab-active`,`onClick`],y=[`innerHTML`],b=[`data-tab-badge`],x={class:`mt-6`},S={__name:`AdminTabs`,props:{tabs:{type:Array,required:!0,default:()=>[]},modelValue:{type:String,default:``}},emits:[`update:modelValue`],setup(t,{emit:n}){let s=t,u=n,S=c({get:()=>s.modelValue||s.tabs[0]?.name||``,set:e=>u(`update:modelValue`,e)}),C={"document-text":`