From f62103d44b4fa01a5f78e57c67d52c0765a57774 Mon Sep 17 00:00:00 2001 From: MeghdadFadaee Date: Wed, 9 Sep 2026 20:54:39 +0330 Subject: [PATCH] fix: correct dark branding and tenant logo rendering --- CHANGELOG.md | 13 +++++++ README.md | 4 ++- dist/css/tool.css | 2 +- dist/js/tool.js | 2 +- dist/mix-manifest.json | 4 +-- resources/css/tool.css | 42 ++++++++++++----------- resources/js/components/TenantAppLogo.vue | 7 +++- src/NovaTenancy.php | 4 +-- tests-js/TenantAppLogo.test.js | 6 ++++ tests/Feature/TenantEndpointsTest.php | 17 +++++++++ 10 files changed, 73 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6225496..3beef0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. +## [1.1.1] - 2026-09-09 + +### Changed + +- Support Nova primary palettes whose color entries already include an alpha channel. +- Document that custom logo response callbacks may return `null` to use the default logo resolution. + +### Fixed + +- Keep selected tenant branding on Nova's primary color in dark mode. +- Show successful tenant logos without decorative framing while retaining the framed initial fallback. + ## [1.1.0] - 2026-09-09 ### Changed @@ -40,6 +52,7 @@ All notable changes to this project will be documented in this file. - Optional tenant-aware Nova resource base and reusable context helpers. - English and Persian translations. +[1.1.1]: https://github.com/MeghdadFadaee/nova-tenancy/releases/tag/v1.1.1 [1.1.0]: https://github.com/MeghdadFadaee/nova-tenancy/releases/tag/v1.1.0 [1.0.2]: https://github.com/MeghdadFadaee/nova-tenancy/releases/tag/v1.0.2 [1.0.1]: https://github.com/MeghdadFadaee/nova-tenancy/releases/tag/v1.0.1 diff --git a/README.md b/README.md index 0cf2f07..bc7750f 100644 --- a/README.md +++ b/README.md @@ -200,11 +200,13 @@ NovaTenancy::landingUsing( ); NovaTenancy::logoResponseUsing( - fn (Request $request, Model $tenant): Response => Storage::disk('private') + fn (Request $request, Model $tenant): ?Response => Storage::disk('private') ->response($tenant->logo_path) ); ``` +The logo response callback may return `null` to continue with the tenant URL or configured fallback logo. + `TenantSelected` and `TenantCleared` events are dispatched after changes. English and Persian translations can be published with: ```bash diff --git a/dist/css/tool.css b/dist/css/tool.css index 16ad8ab..5039e5b 100644 --- a/dist/css/tool.css +++ b/dist/css/tool.css @@ -1 +1 @@ -.nova-tenancy-page{--nt-primary:rgba(var(--colors-primary-500,14,165,233),1);--nt-primary-soft:rgba(var(--colors-primary-500,14,165,233),0.12);--nt-primary-strong:rgba(var(--colors-primary-600,2,132,199),1);--nt-surface:rgba(var(--colors-white,255,255,255),1);--nt-border:rgba(var(--colors-gray-200,226,232,240),1);--nt-text:rgba(var(--colors-gray-900,15,23,42),1);--nt-muted:rgba(var(--colors-gray-500,100,116,139),1);--nt-shadow:rgba(var(--colors-gray-900,15,23,42),0.08);display:flex;flex-direction:column;gap:1.5rem;padding-bottom:3rem}.nova-tenancy-hero{align-items:flex-end;background:radial-gradient(circle at 12% 10%,rgba(var(--colors-primary-400,56,189,248),.58),transparent 34%),radial-gradient(circle at 88% 85%,rgba(var(--colors-primary-500,14,165,233),.38),transparent 38%),linear-gradient(135deg,color-mix(in srgb,var(--nt-primary-strong) 68%,#0f172a) 0,var(--nt-primary-strong) 50%,color-mix(in srgb,var(--nt-primary) 48%,#0f172a) 100%);border:1px solid hsla(0,0%,100%,.16);border-radius:1rem;box-shadow:0 24px 60px color-mix(in srgb,var(--nt-primary) 24%,transparent);color:#fff;display:flex;gap:2rem;justify-content:space-between;min-height:15rem;overflow:hidden;padding:clamp(1.5rem,4vw,3rem);position:relative}.nova-tenancy-hero:after{background-image:linear-gradient(hsla(0,0%,100%,.04) 1px,transparent 0),linear-gradient(90deg,hsla(0,0%,100%,.04) 1px,transparent 0);background-size:32px 32px;content:"";inset:0;-webkit-mask-image:linear-gradient(180deg,#000,transparent);mask-image:linear-gradient(180deg,#000,transparent);pointer-events:none;position:absolute}.nova-tenancy-hero__glow{background:hsla(0,0%,100%,.09);border-radius:9999px;filter:blur(2px);height:22rem;position:absolute;right:-5rem;top:-8rem;width:22rem}.nova-tenancy-current,.nova-tenancy-hero__content{position:relative;z-index:1}.nova-tenancy-hero__content{max-width:42rem}.nova-tenancy-kicker{color:color-mix(in srgb,var(--nt-primary) 24%,#fff);font-size:.72rem;font-weight:800;letter-spacing:.16em;margin:0 0 .65rem;text-transform:uppercase}.nova-tenancy-title{font-size:clamp(2rem,5vw,3.5rem);font-weight:750;letter-spacing:-.045em;line-height:1;margin:0}.nova-tenancy-description{color:hsla(0,0%,100%,.82);font-size:1rem;line-height:1.7;margin:1rem 0 0;max-width:35rem}.nova-tenancy-current{align-items:center;backdrop-filter:blur(14px);background:hsla(0,0%,100%,.1);border:1px solid hsla(0,0%,100%,.16);border-radius:.5rem;display:flex;gap:.8rem;min-width:min(100%,17rem);padding:.8rem}.nova-tenancy-card__logo,.nova-tenancy-current__logo{border-radius:.9rem;display:grid;flex:none;font-weight:800;overflow:hidden;place-items:center}.nova-tenancy-current__logo{background:#fff;color:var(--nt-primary-strong);height:3rem;width:3rem}.nova-tenancy-card__logo img,.nova-tenancy-current__logo img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.nova-tenancy-current__copy{display:flex;flex:1;flex-direction:column;min-width:0}.nova-tenancy-current__copy span{color:hsla(0,0%,100%,.7);font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.nova-tenancy-current__copy strong{margin-top:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-pulse{background:rgba(var(--colors-green-400,74,222,128),1);border:2px solid hsla(0,0%,100%,.8);border-radius:9999px;box-shadow:0 0 0 4px rgba(var(--colors-green-400,74,222,128),.2);height:.55rem;width:.55rem}.nova-tenancy-toolbar{align-items:center;display:flex;gap:1rem}.nova-tenancy-search{align-items:center;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex:1;gap:.75rem;max-width:34rem;min-width:0;padding-inline:1rem;transition:border-color .16s,box-shadow .16s}.nova-tenancy-search:focus-within{border-color:rgba(var(--colors-primary-400,56,189,248),.7);box-shadow:0 0 0 3px var(--nt-primary-soft)}.nova-tenancy-search svg{fill:none;stroke:var(--nt-muted);stroke-linecap:round;stroke-width:1.8;width:1.2rem}.nova-tenancy-search input{background:transparent;border:0;color:var(--nt-text);outline:0;padding:.85rem 0;width:100%}.nova-tenancy-count{background:var(--nt-primary-soft);border-radius:9999px;color:var(--nt-primary-strong);display:grid;font-size:.78rem;font-weight:800;height:2.5rem;min-width:2.5rem;place-items:center}.nova-tenancy-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr))}.nova-tenancy-card{--tenant-accent:var(--nt-primary);--tenant-accent-contrast:#fff;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex-direction:column;min-height:17rem;overflow:hidden;padding:1.25rem;position:relative;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.nova-tenancy-card:hover{border-color:color-mix(in srgb,var(--tenant-accent) 42%,transparent);box-shadow:0 10px 24px var(--nt-shadow);transform:translateY(-3px)}.nova-tenancy-card--selected{border-color:color-mix(in srgb,var(--tenant-accent) 70%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--tenant-accent) 16%,transparent),0 10px 24px var(--nt-shadow)}.nova-tenancy-card__accent{background:linear-gradient(90deg,var(--tenant-accent),color-mix(in srgb,var(--tenant-accent) 25%,#fff));height:.26rem;inset:0 0 auto;position:absolute}.nova-tenancy-card__header{align-items:flex-start;display:flex;gap:1rem;justify-content:space-between}.nova-tenancy-card__logo{background:color-mix(in srgb,var(--tenant-accent) 11%,#fff);border-radius:.5rem;font-size:1.35rem;height:4rem;width:4rem}.nova-tenancy-badge,.nova-tenancy-card__logo{color:color-mix(in srgb,var(--tenant-accent) 72%,var(--nt-text))}.nova-tenancy-badge{background:color-mix(in srgb,var(--tenant-accent) 10%,#fff);border-radius:9999px;font-size:.68rem;font-weight:800;padding:.35rem .65rem}.nova-tenancy-check{background:var(--tenant-accent);border-radius:9999px;color:var(--tenant-accent-contrast);display:grid;height:1.8rem;place-items:center;width:1.8rem}.nova-tenancy-check svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2;width:1rem}.nova-tenancy-card__body{flex:1;padding-block:1.2rem}.nova-tenancy-card__body h2{color:var(--nt-text);font-size:1rem;font-weight:700;line-height:1.4;margin:0}.nova-tenancy-card__body p{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--nt-muted);display:-webkit-box;font-size:.84rem;line-height:1.6;margin:.55rem 0 0;overflow:hidden}.nova-tenancy-card__body .nova-tenancy-card__key{color:color-mix(in srgb,var(--tenant-accent) 68%,var(--nt-muted));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.nova-tenancy-button,.nova-tenancy-pagination button,.nova-tenancy-select{align-items:center;border:0;border-radius:.5rem;cursor:pointer;display:inline-flex;font-weight:700;gap:.55rem;justify-content:center;transition:transform .15s,background-color .15s,opacity .15s}.nova-tenancy-select{background:var(--tenant-accent);color:var(--tenant-accent-contrast);min-height:2.7rem;width:100%}.nova-tenancy-button:hover,.nova-tenancy-pagination button:not(:disabled):hover,.nova-tenancy-select:not(:disabled):hover{transform:translateY(-1px)}.nova-tenancy-select--selected{background:color-mix(in srgb,var(--tenant-accent) 10%,#fff);color:color-mix(in srgb,var(--tenant-accent) 72%,var(--nt-text))}.nova-tenancy-pagination button:disabled,.nova-tenancy-select:disabled{cursor:default;opacity:.72}.nova-tenancy-select svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8;width:1rem}.nova-tenancy-spinner{animation:nova-tenancy-spin .65s linear infinite;border:2px solid color-mix(in srgb,currentColor 40%,transparent);border-radius:9999px;border-top-color:currentcolor;height:1rem;width:1rem}.nova-tenancy-card--skeleton{gap:1.3rem;pointer-events:none}.nova-tenancy-card--skeleton span{animation:nova-tenancy-shimmer 1.4s ease infinite;background:linear-gradient(90deg,rgba(var(--colors-gray-100,241,245,249),1),rgba(var(--colors-gray-200,226,232,240),1),rgba(var(--colors-gray-100,241,245,249),1));background-size:220% 100%;border-radius:9999px;display:block;height:1rem}.nova-tenancy-card--skeleton span:first-child{border-radius:1rem;height:4rem;width:4rem}.nova-tenancy-card--skeleton span:nth-child(2){width:70%}.nova-tenancy-card--skeleton span:nth-child(3){width:45%}.nova-tenancy-state{align-items:center;background:var(--nt-surface);border:1px dashed var(--nt-border);border-radius:.5rem;display:flex;flex-direction:column;justify-content:center;min-height:18rem;padding:2rem;text-align:center}.nova-tenancy-state__icon{background:rgba(var(--colors-red-100,254,226,226),1);border-radius:1rem;color:rgba(var(--colors-red-700,185,28,28),1);display:grid;font-size:1.5rem;font-weight:800;height:3.5rem;place-items:center;width:3.5rem}.nova-tenancy-state__icon--empty{background:var(--nt-primary-soft);color:var(--nt-primary)}.nova-tenancy-state__icon svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5;width:1.8rem}.nova-tenancy-state h2{color:var(--nt-text);font-size:1.1rem;margin:1rem 0 0}.nova-tenancy-state p{color:var(--nt-muted);margin:.5rem 0 0;max-width:28rem}.nova-tenancy-button{background:var(--nt-primary);color:#fff;margin-top:1rem;padding:.65rem 1rem}.nova-tenancy-pagination{align-items:center;display:flex;gap:.8rem;justify-content:center}.nova-tenancy-pagination button{background:var(--nt-surface);border:1px solid var(--nt-border);color:var(--nt-text);padding:.55rem .9rem}.nova-tenancy-pagination span{color:var(--nt-muted);font-size:.8rem;font-weight:700}.nova-tenancy-brand{align-items:center;background:transparent;border:0;color:rgba(var(--colors-primary-500,14,165,233),1);cursor:pointer;display:flex;gap:.75rem;max-width:14.5rem;min-width:0;padding:0}.nova-tenancy-brand__logo{background:rgba(var(--colors-primary-500,14,165,233),.12);border:1px solid rgba(var(--colors-primary-500,14,165,233),.24);border-radius:.65rem;box-shadow:0 3px 12px rgba(var(--colors-gray-900,15,23,42),.12);color:rgba(var(--colors-primary-600,2,132,199),1);display:grid;flex:none;height:2.75rem;overflow:hidden;place-items:center;width:2.75rem}.nova-tenancy-brand__logo img{height:100%;-o-object-fit:contain;object-fit:contain;padding:.15rem;width:100%}.nova-tenancy-brand__initial{font-size:1rem;font-weight:800;line-height:1}.nova-tenancy-brand__title{font-size:1.125rem;font-weight:800;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-brand:focus-visible,.nova-tenancy-button:focus-visible,.nova-tenancy-pagination button:focus-visible,.nova-tenancy-select:focus-visible{outline:2px solid var(--nt-primary);outline-offset:3px}.nova-tenancy-sr-only{clip:rect(0,0,0,0);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.dark .nova-tenancy-page{--nt-primary-soft:rgba(var(--colors-primary-500,14,165,233),0.2);--nt-surface:rgba(var(--colors-gray-800,30,41,59),1);--nt-border:rgba(var(--colors-gray-700,51,65,85),1);--nt-text:rgba(var(--colors-gray-100,241,245,249),1);--nt-muted:rgba(var(--colors-gray-400,148,163,184),1);--nt-shadow:rgba(0,0,0,.22)}.dark .nova-tenancy-card__body h2,.dark .nova-tenancy-pagination button,.dark .nova-tenancy-search input,.dark .nova-tenancy-state h2{color:var(--nt-text)}.dark .nova-tenancy-brand{color:rgba(var(--colors-primary-400,56,189,248),1)}.dark .nova-tenancy-brand__logo{background:rgba(var(--colors-primary-500,14,165,233),.2);border-color:rgba(var(--colors-primary-400,56,189,248),.32);color:rgba(var(--colors-primary-300,125,211,252),1)}.dark .nova-tenancy-count,.dark .nova-tenancy-state__icon--empty{background:var(--nt-primary-soft);color:rgba(var(--colors-primary-400,56,189,248),1)}.dark .nova-tenancy-badge,.dark .nova-tenancy-card__logo,.dark .nova-tenancy-select--selected{background:color-mix(in srgb,var(--tenant-accent) 22%,var(--nt-surface))}.dark .nova-tenancy-card--skeleton span{background:linear-gradient(90deg,rgba(var(--colors-gray-800,30,41,59),1),rgba(var(--colors-gray-700,51,65,85),1),rgba(var(--colors-gray-800,30,41,59),1));background-size:220% 100%}@media (max-width:700px){.nova-tenancy-hero{align-items:stretch;flex-direction:column}.nova-tenancy-current{width:100%}.nova-tenancy-brand__title{display:none}}@media (prefers-reduced-motion:reduce){.nova-tenancy-button,.nova-tenancy-card,.nova-tenancy-pagination button,.nova-tenancy-select{transition:none}.nova-tenancy-card--skeleton span,.nova-tenancy-spinner{animation:none}}@keyframes nova-tenancy-spin{to{transform:rotate(1turn)}}@keyframes nova-tenancy-shimmer{to{background-position:-220% 0}} +.nova-tenancy-page{--nt-primary:rgba(var(--colors-primary-500,14,165,233));--nt-primary-soft:color-mix(in srgb,var(--nt-primary) 12%,transparent);--nt-primary-strong:rgba(var(--colors-primary-600,2,132,199));--nt-surface:rgba(var(--colors-white,255,255,255),1);--nt-border:rgba(var(--colors-gray-200,226,232,240),1);--nt-text:rgba(var(--colors-gray-900,15,23,42),1);--nt-muted:rgba(var(--colors-gray-500,100,116,139),1);--nt-shadow:rgba(var(--colors-gray-900,15,23,42),0.08);display:flex;flex-direction:column;gap:1.5rem;padding-bottom:3rem}.nova-tenancy-hero{align-items:flex-end;background:radial-gradient(circle at 12% 10%,color-mix(in srgb,rgba(var(--colors-primary-400,56,189,248)) 58%,transparent),transparent 34%),radial-gradient(circle at 88% 85%,color-mix(in srgb,var(--nt-primary) 38%,transparent),transparent 38%),linear-gradient(135deg,color-mix(in srgb,var(--nt-primary-strong) 68%,#0f172a) 0,var(--nt-primary-strong) 50%,color-mix(in srgb,var(--nt-primary) 48%,#0f172a) 100%);border:1px solid hsla(0,0%,100%,.16);border-radius:1rem;box-shadow:0 24px 60px color-mix(in srgb,var(--nt-primary) 24%,transparent);color:#fff;display:flex;gap:2rem;justify-content:space-between;min-height:15rem;overflow:hidden;padding:clamp(1.5rem,4vw,3rem);position:relative}.nova-tenancy-hero:after{background-image:linear-gradient(hsla(0,0%,100%,.04) 1px,transparent 0),linear-gradient(90deg,hsla(0,0%,100%,.04) 1px,transparent 0);background-size:32px 32px;content:"";inset:0;-webkit-mask-image:linear-gradient(180deg,#000,transparent);mask-image:linear-gradient(180deg,#000,transparent);pointer-events:none;position:absolute}.nova-tenancy-hero__glow{background:hsla(0,0%,100%,.09);border-radius:9999px;filter:blur(2px);height:22rem;position:absolute;right:-5rem;top:-8rem;width:22rem}.nova-tenancy-current,.nova-tenancy-hero__content{position:relative;z-index:1}.nova-tenancy-hero__content{max-width:42rem}.nova-tenancy-kicker{color:color-mix(in srgb,var(--nt-primary) 24%,#fff);font-size:.72rem;font-weight:800;letter-spacing:.16em;margin:0 0 .65rem;text-transform:uppercase}.nova-tenancy-title{font-size:clamp(2rem,5vw,3.5rem);font-weight:750;letter-spacing:-.045em;line-height:1;margin:0}.nova-tenancy-description{color:hsla(0,0%,100%,.82);font-size:1rem;line-height:1.7;margin:1rem 0 0;max-width:35rem}.nova-tenancy-current{align-items:center;backdrop-filter:blur(14px);background:hsla(0,0%,100%,.1);border:1px solid hsla(0,0%,100%,.16);border-radius:.5rem;display:flex;gap:.8rem;min-width:min(100%,17rem);padding:.8rem}.nova-tenancy-card__logo,.nova-tenancy-current__logo{border-radius:.9rem;display:grid;flex:none;font-weight:800;overflow:hidden;place-items:center}.nova-tenancy-current__logo{background:#fff;color:var(--nt-primary-strong);height:3rem;width:3rem}.nova-tenancy-card__logo img,.nova-tenancy-current__logo img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.nova-tenancy-current__copy{display:flex;flex:1;flex-direction:column;min-width:0}.nova-tenancy-current__copy span{color:hsla(0,0%,100%,.7);font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.nova-tenancy-current__copy strong{margin-top:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-pulse{background:rgba(var(--colors-green-400,74,222,128),1);border:2px solid hsla(0,0%,100%,.8);border-radius:9999px;box-shadow:0 0 0 4px rgba(var(--colors-green-400,74,222,128),.2);height:.55rem;width:.55rem}.nova-tenancy-toolbar{align-items:center;display:flex;gap:1rem}.nova-tenancy-search{align-items:center;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex:1;gap:.75rem;max-width:34rem;min-width:0;padding-inline:1rem;transition:border-color .16s,box-shadow .16s}.nova-tenancy-search:focus-within{border-color:color-mix(in srgb,rgba(var(--colors-primary-400,56,189,248)) 70%,transparent);box-shadow:0 0 0 3px var(--nt-primary-soft)}.nova-tenancy-search svg{fill:none;stroke:var(--nt-muted);stroke-linecap:round;stroke-width:1.8;width:1.2rem}.nova-tenancy-search input{background:transparent;border:0;color:var(--nt-text);outline:0;padding:.85rem 0;width:100%}.nova-tenancy-count{background:var(--nt-primary-soft);border-radius:9999px;color:var(--nt-primary-strong);display:grid;font-size:.78rem;font-weight:800;height:2.5rem;min-width:2.5rem;place-items:center}.nova-tenancy-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr))}.nova-tenancy-card{--tenant-accent:var(--nt-primary);--tenant-accent-contrast:#fff;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex-direction:column;min-height:17rem;overflow:hidden;padding:1.25rem;position:relative;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.nova-tenancy-card:hover{border-color:color-mix(in srgb,var(--tenant-accent) 42%,transparent);box-shadow:0 10px 24px var(--nt-shadow);transform:translateY(-3px)}.nova-tenancy-card--selected{border-color:color-mix(in srgb,var(--tenant-accent) 70%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--tenant-accent) 16%,transparent),0 10px 24px var(--nt-shadow)}.nova-tenancy-card__accent{background:linear-gradient(90deg,var(--tenant-accent),color-mix(in srgb,var(--tenant-accent) 25%,#fff));height:.26rem;inset:0 0 auto;position:absolute}.nova-tenancy-card__header{align-items:flex-start;display:flex;gap:1rem;justify-content:space-between}.nova-tenancy-card__logo{background:color-mix(in srgb,var(--tenant-accent) 11%,#fff);border-radius:.5rem;font-size:1.35rem;height:4rem;width:4rem}.nova-tenancy-badge,.nova-tenancy-card__logo{color:color-mix(in srgb,var(--tenant-accent) 72%,var(--nt-text))}.nova-tenancy-badge{background:color-mix(in srgb,var(--tenant-accent) 10%,#fff);border-radius:9999px;font-size:.68rem;font-weight:800;padding:.35rem .65rem}.nova-tenancy-check{background:var(--tenant-accent);border-radius:9999px;color:var(--tenant-accent-contrast);display:grid;height:1.8rem;place-items:center;width:1.8rem}.nova-tenancy-check svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2;width:1rem}.nova-tenancy-card__body{flex:1;padding-block:1.2rem}.nova-tenancy-card__body h2{color:var(--nt-text);font-size:1rem;font-weight:700;line-height:1.4;margin:0}.nova-tenancy-card__body p{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--nt-muted);display:-webkit-box;font-size:.84rem;line-height:1.6;margin:.55rem 0 0;overflow:hidden}.nova-tenancy-card__body .nova-tenancy-card__key{color:color-mix(in srgb,var(--tenant-accent) 68%,var(--nt-muted));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.nova-tenancy-button,.nova-tenancy-pagination button,.nova-tenancy-select{align-items:center;border:0;border-radius:.5rem;cursor:pointer;display:inline-flex;font-weight:700;gap:.55rem;justify-content:center;transition:transform .15s,background-color .15s,opacity .15s}.nova-tenancy-select{background:var(--tenant-accent);color:var(--tenant-accent-contrast);min-height:2.7rem;width:100%}.nova-tenancy-button:hover,.nova-tenancy-pagination button:not(:disabled):hover,.nova-tenancy-select:not(:disabled):hover{transform:translateY(-1px)}.nova-tenancy-select--selected{background:color-mix(in srgb,var(--tenant-accent) 10%,#fff);color:color-mix(in srgb,var(--tenant-accent) 72%,var(--nt-text))}.nova-tenancy-pagination button:disabled,.nova-tenancy-select:disabled{cursor:default;opacity:.72}.nova-tenancy-select svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8;width:1rem}.nova-tenancy-spinner{animation:nova-tenancy-spin .65s linear infinite;border:2px solid color-mix(in srgb,currentColor 40%,transparent);border-radius:9999px;border-top-color:currentcolor;height:1rem;width:1rem}.nova-tenancy-card--skeleton{gap:1.3rem;pointer-events:none}.nova-tenancy-card--skeleton span{animation:nova-tenancy-shimmer 1.4s ease infinite;background:linear-gradient(90deg,rgba(var(--colors-gray-100,241,245,249),1),rgba(var(--colors-gray-200,226,232,240),1),rgba(var(--colors-gray-100,241,245,249),1));background-size:220% 100%;border-radius:9999px;display:block;height:1rem}.nova-tenancy-card--skeleton span:first-child{border-radius:1rem;height:4rem;width:4rem}.nova-tenancy-card--skeleton span:nth-child(2){width:70%}.nova-tenancy-card--skeleton span:nth-child(3){width:45%}.nova-tenancy-state{align-items:center;background:var(--nt-surface);border:1px dashed var(--nt-border);border-radius:.5rem;display:flex;flex-direction:column;justify-content:center;min-height:18rem;padding:2rem;text-align:center}.nova-tenancy-state__icon{background:rgba(var(--colors-red-100,254,226,226),1);border-radius:1rem;color:rgba(var(--colors-red-700,185,28,28),1);display:grid;font-size:1.5rem;font-weight:800;height:3.5rem;place-items:center;width:3.5rem}.nova-tenancy-state__icon--empty{background:var(--nt-primary-soft);color:var(--nt-primary)}.nova-tenancy-state__icon svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5;width:1.8rem}.nova-tenancy-state h2{color:var(--nt-text);font-size:1.1rem;margin:1rem 0 0}.nova-tenancy-state p{color:var(--nt-muted);margin:.5rem 0 0;max-width:28rem}.nova-tenancy-button{background:var(--nt-primary);color:#fff;margin-top:1rem;padding:.65rem 1rem}.nova-tenancy-pagination{align-items:center;display:flex;gap:.8rem;justify-content:center}.nova-tenancy-pagination button{background:var(--nt-surface);border:1px solid var(--nt-border);color:var(--nt-text);padding:.55rem .9rem}.nova-tenancy-pagination span{color:var(--nt-muted);font-size:.8rem;font-weight:700}.nova-tenancy-brand{align-items:center;background:transparent;border:0;color:rgba(var(--colors-primary-500,14,165,233));cursor:pointer;display:flex;gap:.75rem;max-width:14.5rem;min-width:0;padding:0}.nova-tenancy-brand__logo{border-radius:.65rem;display:grid;flex:none;height:2.75rem;overflow:hidden;place-items:center;width:2.75rem}.nova-tenancy-brand__logo img{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.nova-tenancy-brand__logo--fallback{background:color-mix(in srgb,rgba(var(--colors-primary-500,14,165,233)) 12%,transparent);border:1px solid color-mix(in srgb,rgba(var(--colors-primary-500,14,165,233)) 24%,transparent);box-shadow:0 3px 12px rgba(var(--colors-gray-900,15,23,42),.12);color:rgba(var(--colors-primary-600,2,132,199))}.nova-tenancy-brand__initial{font-size:1rem;font-weight:800;line-height:1}.nova-tenancy-brand__title{font-size:1.125rem;font-weight:800;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-brand:focus-visible,.nova-tenancy-button:focus-visible,.nova-tenancy-pagination button:focus-visible,.nova-tenancy-select:focus-visible{outline:2px solid rgba(var(--colors-primary-500,14,165,233));outline-offset:3px}.nova-tenancy-sr-only{clip:rect(0,0,0,0);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.dark .nova-tenancy-page{--nt-primary-soft:color-mix(in srgb,var(--nt-primary) 20%,transparent);--nt-surface:rgba(var(--colors-gray-800,30,41,59),1);--nt-border:rgba(var(--colors-gray-700,51,65,85),1);--nt-text:rgba(var(--colors-gray-100,241,245,249),1);--nt-muted:rgba(var(--colors-gray-400,148,163,184),1);--nt-shadow:rgba(0,0,0,.22)}.dark .nova-tenancy-card__body h2,.dark .nova-tenancy-pagination button,.dark .nova-tenancy-search input,.dark .nova-tenancy-state h2{color:var(--nt-text)}.dark .nova-tenancy-brand,.dark .nova-tenancy-brand__logo--fallback{color:rgba(var(--colors-primary-500,14,165,233))}.dark .nova-tenancy-brand__logo--fallback{background:color-mix(in srgb,rgba(var(--colors-primary-500,14,165,233)) 20%,transparent);border-color:color-mix(in srgb,rgba(var(--colors-primary-500,14,165,233)) 32%,transparent)}.dark .nova-tenancy-count,.dark .nova-tenancy-state__icon--empty{background:var(--nt-primary-soft);color:rgba(var(--colors-primary-500,14,165,233))}.dark .nova-tenancy-badge,.dark .nova-tenancy-card__logo,.dark .nova-tenancy-select--selected{background:color-mix(in srgb,var(--tenant-accent) 22%,var(--nt-surface))}.dark .nova-tenancy-card--skeleton span{background:linear-gradient(90deg,rgba(var(--colors-gray-800,30,41,59),1),rgba(var(--colors-gray-700,51,65,85),1),rgba(var(--colors-gray-800,30,41,59),1));background-size:220% 100%}@media (max-width:700px){.nova-tenancy-hero{align-items:stretch;flex-direction:column}.nova-tenancy-current{width:100%}.nova-tenancy-brand__title{display:none}}@media (prefers-reduced-motion:reduce){.nova-tenancy-button,.nova-tenancy-card,.nova-tenancy-pagination button,.nova-tenancy-select{transition:none}.nova-tenancy-card--skeleton span,.nova-tenancy-spinner{animation:none}}@keyframes nova-tenancy-spin{to{transform:rotate(1turn)}}@keyframes nova-tenancy-shimmer{to{background-position:-220% 0}} diff --git a/dist/js/tool.js b/dist/js/tool.js index 8ff0f20..92b850e 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1,2 +1,2 @@ /*! For license information please see tool.js.LICENSE.txt */ -(()=>{"use strict";var e,n={733(){const e=Vue;var n=function(e,n){return null!==e&&null!==n&&String(e)===String(n)},t=function(e){return String(e||"T").trim().charAt(0).toLocaleUpperCase()},r=function(e){if(!/^#[0-9a-f]{6}$/i.test(e||""))return"#ffffff";var n=e.slice(1).match(/.{2}/g).map(function(e){return Number.parseInt(e,16)/255}).map(function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}),t=.2126*n[0]+.7152*n[1]+.0722*n[2];return(t+.05)/.068>1.05/(t+.05)?"#0f172a":"#ffffff"},a=function(e){return e.accent?{"--tenant-accent":e.accent,"--tenant-accent-contrast":r(e.accent)}:{}};function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return c(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t3?(a=f===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=t<2&&pr||r>f)&&(o[4]=t,o[5]=r,d.n=f,l=0))}if(a||t>1)return c;throw v=!0,r}return function(a,s,f){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&p(s,f),l=s,i=f;(n=l<2?e:i)||!v;){o||(l?l<3?(l>1&&(d.n=-1),p(l,i)):d.n=i:d.v=i);try{if(u=2,o){if(l||(a="next"),n=o[a]){if(!(n=n.call(o,i)))throw TypeError("iterator result is not an object");if(!n.done)return n;i=n.value,l<2&&(l=0)}else 1===l&&(n=o.return)&&n.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((n=(v=d.n<0)?i:t.call(r,d))!==c)break}catch(n){o=e,l=1,i=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),s}var c={};function u(){}function s(){}function v(){}n=Object.getPrototypeOf;var d=[][r]?n(n([][r]())):(i(n={},r,function(){return this}),n),p=v.prototype=u.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return s.prototype=v,i(p,"constructor",v),i(v,"constructor",s),s.displayName="GeneratorFunction",i(v,a,"GeneratorFunction"),i(p),i(p,a,"Generator"),i(p,r,function(){return this}),i(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:f}})()}function i(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,n,t,r){function o(n,t){i(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},i(e,n,t,r)}function u(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}function s(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){u(o,r,a,c,l,"next",e)}function l(e){u(o,r,a,c,l,"throw",e)}c(void 0)})}}var v={class:"nova-tenancy-page"},d={class:"nova-tenancy-hero"},p={class:"nova-tenancy-hero__content"},f={class:"nova-tenancy-kicker"},y={class:"nova-tenancy-title"},m={class:"nova-tenancy-description"},g={key:0,class:"nova-tenancy-current"},k={class:"nova-tenancy-current__logo"},h=["src"],b={key:1},E={class:"nova-tenancy-current__copy"},N=["aria-label"],B={class:"nova-tenancy-search"},_={class:"nova-tenancy-sr-only"},V=["placeholder"],S={key:0,class:"nova-tenancy-count"},w={key:0,class:"nova-tenancy-grid","aria-busy":"true"},P={key:1,class:"nova-tenancy-state",role:"alert"},O={key:2,class:"nova-tenancy-state"},D={key:3,class:"nova-tenancy-grid"},T=["aria-current"],j={class:"nova-tenancy-card__header"},C={class:"nova-tenancy-card__logo"},x=["src","onError"],M={key:1},G={key:0,class:"nova-tenancy-badge"},A=["title"],U={class:"nova-tenancy-card__body"},F={key:0},L={key:1,class:"nova-tenancy-card__key"},I=["disabled","aria-busy","onClick"],$={key:0,class:"nova-tenancy-spinner","aria-hidden":"true"},q={key:1,viewBox:"0 0 20 20","aria-hidden":"true"},z={key:4,class:"nova-tenancy-pagination","aria-label":"Pagination"},K=["disabled"],H=["disabled"];const R={__name:"NovaTenancy",setup:function(r){var c,i,u,R=Nova.config("novaTenancy")||{},W=R.copy||{},Z=(0,e.ref)([]),J=(0,e.ref)(null!==(c=null===(i=R.current)||void 0===i?void 0:i.key)&&void 0!==c?c:null),Q=(0,e.ref)(""),X=(0,e.ref)(!0),Y=(0,e.ref)(!1),ee=(0,e.ref)(null),ne=(0,e.reactive)(new Set),te=(0,e.reactive)({currentPage:1,lastPage:1,perPage:Number(R.perPage||12),total:0}),re=0,ae=(0,e.computed)(function(){var e,t;return Z.value.find(function(e){return ie(e)})||(n(null!==(e=null===(t=R.current)||void 0===t?void 0:t.key)&&void 0!==e?e:null,J.value)?R.current:null)}),oe=function(){var e=s(l().m(function e(){var n,t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=++re,X.value=!0,Y.value=!1,e.p=1,e.n=2,Nova.request().get("".concat(R.apiBase||"/nova-vendor/nova-tenancy","/tenants"),{params:{search:Q.value||void 0,page:te.currentPage,perPage:te.perPage}});case 2:if(t=e.v,n===re){e.n=3;break}return e.a(2);case 3:Z.value=t.data.data,J.value=t.data.currentKey,Object.assign(te,t.data.meta),e.n=5;break;case 4:e.p=4,e.v,n===re&&(Y.value=!0);case 5:return e.p=5,n===re&&(X.value=!1),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=s(l().m(function e(n){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null===ee.value&&!ie(n)){e.n=1;break}return e.a(2);case 1:return ee.value=String(n.key),e.p=2,e.n=3,Nova.request().post("".concat(R.apiBase||"/nova-vendor/nova-tenancy","/current"),{tenant:String(n.key)});case 3:t=e.v,J.value=t.data.current.key,Nova.$emit("nova-tenancy:changed",t.data),Nova.visit(t.data.redirectTo||"/"),e.n=5;break;case 4:e.p=4,e.v,Nova.$emit("error",W.error||"Unable to select tenant.");case 5:return e.p=5,ee.value=null,e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(n){return e.apply(this,arguments)}}(),le=function(e){te.currentPage=e,oe()},ie=function(e){return n(e.key,J.value)},ue=t,se=a,ve=function(e){return ne.add(String(e))};return(0,e.watch)(Q,function(){clearTimeout(u),u=setTimeout(function(){te.currentPage=1,oe()},Number(R.searchDebounce||300))}),(0,e.onMounted)(oe),(0,e.onBeforeUnmount)(function(){return clearTimeout(u)}),function(n,t){var r=(0,e.resolveComponent)("Head");return(0,e.openBlock)(),(0,e.createElementBlock)("div",v,[(0,e.createVNode)(r,{title:(0,e.unref)(W).pageTitle},null,8,["title"]),(0,e.createElementVNode)("section",d,[t[5]||(t[5]=(0,e.createElementVNode)("div",{class:"nova-tenancy-hero__glow","aria-hidden":"true"},null,-1)),(0,e.createElementVNode)("div",p,[(0,e.createElementVNode)("p",f,(0,e.toDisplayString)((0,e.unref)(W).pageKicker),1),(0,e.createElementVNode)("h1",y,(0,e.toDisplayString)((0,e.unref)(W).pageTitle),1),(0,e.createElementVNode)("p",m,(0,e.toDisplayString)((0,e.unref)(W).pageDescription),1)]),ae.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",g,[(0,e.createElementVNode)("div",k,[ae.value.logoUrl&&!ne.has(String(ae.value.key))?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:ae.value.logoUrl,alt:"",onError:t[0]||(t[0]=function(e){return ve(ae.value.key)})},null,40,h)):((0,e.openBlock)(),(0,e.createElementBlock)("span",b,(0,e.toDisplayString)((0,e.unref)(ue)(ae.value.title)),1))]),(0,e.createElementVNode)("div",E,[(0,e.createElementVNode)("span",null,(0,e.toDisplayString)((0,e.unref)(W).currentTenant),1),(0,e.createElementVNode)("strong",null,(0,e.toDisplayString)(ae.value.title),1)]),t[4]||(t[4]=(0,e.createElementVNode)("span",{class:"nova-tenancy-pulse","aria-hidden":"true"},null,-1))])):(0,e.createCommentVNode)("",!0)]),(0,e.createElementVNode)("section",{class:"nova-tenancy-toolbar","aria-label":(0,e.unref)(W).search},[(0,e.createElementVNode)("label",B,[t[6]||(t[6]=(0,e.createElementVNode)("svg",{viewBox:"0 0 24 24","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"m21 21-4.35-4.35m2.35-5.65a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"})],-1)),(0,e.createElementVNode)("span",_,(0,e.toDisplayString)((0,e.unref)(W).search),1),(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":t[1]||(t[1]=function(e){return Q.value=e}),type:"search",placeholder:(0,e.unref)(W).searchPlaceholder,autocomplete:"off"},null,8,V),[[e.vModelText,Q.value]])]),X.value?(0,e.createCommentVNode)("",!0):((0,e.openBlock)(),(0,e.createElementBlock)("span",S,(0,e.toDisplayString)(te.total.toLocaleString()),1))],8,N),X.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",w,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(6,function(n){return(0,e.createElementVNode)("div",{key:n,class:"nova-tenancy-card nova-tenancy-card--skeleton"},o(t[7]||(t[7]=[(0,e.createElementVNode)("span",null,null,-1),(0,e.createElementVNode)("span",null,null,-1),(0,e.createElementVNode)("span",null,null,-1)])))}),64))])):Y.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",P,[t[8]||(t[8]=(0,e.createElementVNode)("div",{class:"nova-tenancy-state__icon"},"!",-1)),(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)((0,e.unref)(W).error),1),(0,e.createElementVNode)("button",{type:"button",class:"nova-tenancy-button",onClick:oe},(0,e.toDisplayString)((0,e.unref)(W).retry),1)])):0===Z.value.length?((0,e.openBlock)(),(0,e.createElementBlock)("div",O,[t[9]||(t[9]=(0,e.createElementVNode)("div",{class:"nova-tenancy-state__icon nova-tenancy-state__icon--empty"},[(0,e.createElementVNode)("svg",{viewBox:"0 0 24 24","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"M3 21h18M5 21V7l7-4 7 4v14M9 10h.01M9 14h.01M9 18h.01M15 10h.01M15 14h.01M15 18h.01"})])],-1)),(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)((0,e.unref)(W).emptyTitle),1),(0,e.createElementVNode)("p",null,(0,e.toDisplayString)((0,e.unref)(W).emptyDescription),1)])):((0,e.openBlock)(),(0,e.createElementBlock)("div",D,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(Z.value,function(n){return(0,e.openBlock)(),(0,e.createElementBlock)("article",{key:n.key,class:(0,e.normalizeClass)(["nova-tenancy-card",{"nova-tenancy-card--selected":ie(n)}]),style:(0,e.normalizeStyle)((0,e.unref)(se)(n)),"aria-current":ie(n)?"true":void 0},[t[12]||(t[12]=(0,e.createElementVNode)("div",{class:"nova-tenancy-card__accent","aria-hidden":"true"},null,-1)),(0,e.createElementVNode)("div",j,[(0,e.createElementVNode)("div",C,[n.logoUrl&&!ne.has(String(n.key))?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:n.logoUrl,alt:"",loading:"lazy",onError:function(e){return ve(n.key)}},null,40,x)):((0,e.openBlock)(),(0,e.createElementBlock)("span",M,(0,e.toDisplayString)((0,e.unref)(ue)(n.title)),1))]),n.badge?((0,e.openBlock)(),(0,e.createElementBlock)("span",G,(0,e.toDisplayString)(n.badge),1)):ie(n)?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:1,class:"nova-tenancy-check",title:(0,e.unref)(W).selected},o(t[10]||(t[10]=[(0,e.createElementVNode)("svg",{viewBox:"0 0 20 20","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"m5 10 3 3 7-7"})],-1)])),8,A)):(0,e.createCommentVNode)("",!0)]),(0,e.createElementVNode)("div",U,[(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)(n.title),1),n.description?((0,e.openBlock)(),(0,e.createElementBlock)("p",F,(0,e.toDisplayString)(n.description),1)):((0,e.openBlock)(),(0,e.createElementBlock)("p",L,"#"+(0,e.toDisplayString)(n.key),1))]),(0,e.createElementVNode)("button",{type:"button",class:(0,e.normalizeClass)(["nova-tenancy-select",{"nova-tenancy-select--selected":ie(n)}]),disabled:null!==ee.value||ie(n),"aria-busy":ee.value===String(n.key),onClick:function(e){return ce(n)}},[ee.value===String(n.key)?((0,e.openBlock)(),(0,e.createElementBlock)("span",$)):(0,e.createCommentVNode)("",!0),(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(ie(n)?(0,e.unref)(W).selected:(0,e.unref)(W).select),1),ie(n)?(0,e.createCommentVNode)("",!0):((0,e.openBlock)(),(0,e.createElementBlock)("svg",q,o(t[11]||(t[11]=[(0,e.createElementVNode)("path",{d:"M4 10h12m-4-4 4 4-4 4"},null,-1)]))))],10,I)],14,T)}),128))])),te.lastPage>1?((0,e.openBlock)(),(0,e.createElementBlock)("nav",z,[(0,e.createElementVNode)("button",{type:"button",disabled:te.currentPage<=1||X.value,onClick:t[2]||(t[2]=function(e){return le(te.currentPage-1)})},(0,e.toDisplayString)((0,e.unref)(W).previous),9,K),(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(te.currentPage)+" / "+(0,e.toDisplayString)(te.lastPage),1),(0,e.createElementVNode)("button",{type:"button",disabled:te.currentPage>=te.lastPage||X.value,onClick:t[3]||(t[3]=function(e){return le(te.currentPage+1)})},(0,e.toDisplayString)((0,e.unref)(W).next),9,H)])):(0,e.createCommentVNode)("",!0)])}}},W=R;function Z(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function o(t,r,a,o){var i=r&&r.prototype instanceof l?r:l,u=Object.create(i.prototype);return J(u,"_invoke",function(t,r,a){var o,l,i,u=0,s=a||[],v=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(n,t){return o=n,l=0,i=e,d.n=t,c}};function p(t,r){for(l=t,i=r,n=0;!v&&u&&!a&&n3?(a=f===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=t<2&&pr||r>f)&&(o[4]=t,o[5]=r,d.n=f,l=0))}if(a||t>1)return c;throw v=!0,r}return function(a,s,f){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&p(s,f),l=s,i=f;(n=l<2?e:i)||!v;){o||(l?l<3?(l>1&&(d.n=-1),p(l,i)):d.n=i:d.v=i);try{if(u=2,o){if(l||(a="next"),n=o[a]){if(!(n=n.call(o,i)))throw TypeError("iterator result is not an object");if(!n.done)return n;i=n.value,l<2&&(l=0)}else 1===l&&(n=o.return)&&n.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((n=(v=d.n<0)?i:t.call(r,d))!==c)break}catch(n){o=e,l=1,i=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),u}var c={};function l(){}function i(){}function u(){}n=Object.getPrototypeOf;var s=[][r]?n(n([][r]())):(J(n={},r,function(){return this}),n),v=u.prototype=l.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,J(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e}return i.prototype=u,J(v,"constructor",u),J(u,"constructor",i),i.displayName="GeneratorFunction",J(u,a,"GeneratorFunction"),J(v),J(v,a,"Generator"),J(v,r,function(){return this}),J(v,"toString",function(){return"[object Generator]"}),(Z=function(){return{w:o,m:d}})()}function J(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}J=function(e,n,t,r){function o(n,t){J(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},J(e,n,t,r)}function Q(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}var X=["title"],Y={key:0,class:"nova-tenancy-brand__logo","aria-hidden":"true"},ee=["src"],ne={key:1,class:"nova-tenancy-brand__initial"},te={key:1,class:"nova-tenancy-brand__title"};const re=Object.assign({inheritAttrs:!1},{__name:"TenantAppLogo",setup:function(n){var r=Nova.config("novaTenancy")||{},a=(0,e.ref)(null),o=(0,e.ref)(r.current||null),c=(0,e.ref)(Date.now()),l=(0,e.ref)(!1),i=null,u=(0,e.computed)(function(){var e;return!1!==(null===(e=r.branding)||void 0===e?void 0:e.show_logo)}),s=(0,e.computed)(function(){var e;return!1!==(null===(e=r.branding)||void 0===e?void 0:e.show_title)}),v=(0,e.computed)(function(){var e,n;return(null===(e=o.value)||void 0===e?void 0:e.title)||(null===(n=r.copy)||void 0===n?void 0:n.selectTenant)||"Select tenant"}),d=(0,e.computed)(function(){return t(v.value)}),p=(0,e.computed)(function(){var e,n;return function(e,n,t){return"".concat(e,"/current/logo?tenant=").concat(encodeURIComponent(null!=n?n:"none"),"&v=").concat(t)}(r.apiBase||"/nova-vendor/nova-tenancy",null!==(e=null===(n=o.value)||void 0===n?void 0:n.key)&&void 0!==e?e:"none",c.value)}),f=function(e){var n,t;o.value=null!==(n=null!==(t=null==e?void 0:e.current)&&void 0!==t?t:e)&&void 0!==n?n:null,c.value=Date.now(),l.value=!1},y=function(){var e,n=(e=Z().m(function e(){var n;return Z().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Nova.request().get("".concat(r.apiBase||"/nova-vendor/nova-tenancy","/current"));case 1:n=e.v,f(n.data),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){Q(o,r,a,c,l,"next",e)}function l(e){Q(o,r,a,c,l,"throw",e)}c(void 0)})});return function(){return n.apply(this,arguments)}}(),m=function(){var e,n;Nova.visit("home"===(n=null===(e=r.branding)||void 0===e?void 0:e.link)?"/":"string"==typeof n&&n.startsWith("/")?n:r.selectorPath||"/nova-tenancy")},g=function(e){e.preventDefault(),e.stopImmediatePropagation(),m()};return(0,e.onMounted)(function(){var e,n;Nova.$on("nova-tenancy:changed",f),null===(n=i=(null===(e=a.value)||void 0===e?void 0:e.closest("a"))||null)||void 0===n||n.addEventListener("click",g,!0),y()}),(0,e.onBeforeUnmount)(function(){var e;Nova.$off("nova-tenancy:changed",f),null===(e=i)||void 0===e||e.removeEventListener("click",g,!0)}),function(n,t){return(0,e.openBlock)(),(0,e.createElementBlock)("span",{ref_key:"brand",ref:a,class:"nova-tenancy-brand",title:v.value,onClick:(0,e.withModifiers)(m,["stop","prevent"])},[u.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",Y,[l.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",ne,(0,e.toDisplayString)(d.value),1)):((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:p.value,src:p.value,alt:"",onError:t[0]||(t[0]=function(e){return l.value=!0})},null,40,ee))])):(0,e.createCommentVNode)("",!0),s.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",te,(0,e.toDisplayString)(v.value),1)):(0,e.createCommentVNode)("",!0)],8,X)}}}),ae=re;Nova.inertia("NovaTenancy",W),Nova.booting(function(e){var n;!1!==(null===(n=Nova.config("novaTenancy"))||void 0===n||null===(n=n.branding)||void 0===n?void 0:n.enabled)&&e.component("AppLogo",ae)}),Nova.request().interceptors.response.use(function(e){return e},function(e){var n,t;if(409===(null===(n=e.response)||void 0===n?void 0:n.status)&&"tenant_selection_required"===(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.code)){var r,a=(null===(r=Nova.config("novaTenancy"))||void 0===r?void 0:r.selectorPath)||"/nova-tenancy";Nova.visit(a)}return Promise.reject(e)})},351(){}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return n[e](o,o.exports,r),o.exports}r.m=n,e=[],r.O=(n,t,a,o)=>{if(!t){var c=1/0;for(s=0;s=o)&&Object.keys(r.O).every(e=>r.O[e](t[i]))?t.splice(i--,1):(l=!1,o0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[t,a,o]},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={416:0,757:0};r.O.j=n=>0===e[n];var n=(n,t)=>{var a,o,[c,l,i]=t,u=0;if(c.some(n=>0!==e[n])){for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(i)var s=i(r)}for(n&&n(t);ur(733));var a=r.O(void 0,[757],()=>r(351));a=r.O(a)})(); \ No newline at end of file +(()=>{"use strict";var e,n={733(){const e=Vue;var n=function(e,n){return null!==e&&null!==n&&String(e)===String(n)},t=function(e){return String(e||"T").trim().charAt(0).toLocaleUpperCase()},r=function(e){if(!/^#[0-9a-f]{6}$/i.test(e||""))return"#ffffff";var n=e.slice(1).match(/.{2}/g).map(function(e){return Number.parseInt(e,16)/255}).map(function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}),t=.2126*n[0]+.7152*n[1]+.0722*n[2];return(t+.05)/.068>1.05/(t+.05)?"#0f172a":"#ffffff"},a=function(e){return e.accent?{"--tenant-accent":e.accent,"--tenant-accent-contrast":r(e.accent)}:{}};function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return c(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t3?(a=p===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=f&&((a=t<2&&fr||r>p)&&(o[4]=t,o[5]=r,d.n=p,l=0))}if(a||t>1)return c;throw v=!0,r}return function(a,s,p){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&f(s,p),l=s,i=p;(n=l<2?e:i)||!v;){o||(l?l<3?(l>1&&(d.n=-1),f(l,i)):d.n=i:d.v=i);try{if(u=2,o){if(l||(a="next"),n=o[a]){if(!(n=n.call(o,i)))throw TypeError("iterator result is not an object");if(!n.done)return n;i=n.value,l<2&&(l=0)}else 1===l&&(n=o.return)&&n.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((n=(v=d.n<0)?i:t.call(r,d))!==c)break}catch(n){o=e,l=1,i=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),s}var c={};function u(){}function s(){}function v(){}n=Object.getPrototypeOf;var d=[][r]?n(n([][r]())):(i(n={},r,function(){return this}),n),f=v.prototype=u.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=v,i(f,"constructor",v),i(v,"constructor",s),s.displayName="GeneratorFunction",i(v,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function i(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,n,t,r){function o(n,t){i(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},i(e,n,t,r)}function u(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}function s(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){u(o,r,a,c,l,"next",e)}function l(e){u(o,r,a,c,l,"throw",e)}c(void 0)})}}var v={class:"nova-tenancy-page"},d={class:"nova-tenancy-hero"},f={class:"nova-tenancy-hero__content"},p={class:"nova-tenancy-kicker"},y={class:"nova-tenancy-title"},m={class:"nova-tenancy-description"},g={key:0,class:"nova-tenancy-current"},k={class:"nova-tenancy-current__logo"},h=["src"],b={key:1},E={class:"nova-tenancy-current__copy"},N=["aria-label"],B={class:"nova-tenancy-search"},_={class:"nova-tenancy-sr-only"},V=["placeholder"],S={key:0,class:"nova-tenancy-count"},w={key:0,class:"nova-tenancy-grid","aria-busy":"true"},P={key:1,class:"nova-tenancy-state",role:"alert"},O={key:2,class:"nova-tenancy-state"},D={key:3,class:"nova-tenancy-grid"},T=["aria-current"],j={class:"nova-tenancy-card__header"},C={class:"nova-tenancy-card__logo"},x=["src","onError"],M={key:1},G={key:0,class:"nova-tenancy-badge"},A=["title"],U={class:"nova-tenancy-card__body"},F={key:0},L={key:1,class:"nova-tenancy-card__key"},I=["disabled","aria-busy","onClick"],$={key:0,class:"nova-tenancy-spinner","aria-hidden":"true"},q={key:1,viewBox:"0 0 20 20","aria-hidden":"true"},z={key:4,class:"nova-tenancy-pagination","aria-label":"Pagination"},K=["disabled"],H=["disabled"];const R={__name:"NovaTenancy",setup:function(r){var c,i,u,R=Nova.config("novaTenancy")||{},W=R.copy||{},Z=(0,e.ref)([]),J=(0,e.ref)(null!==(c=null===(i=R.current)||void 0===i?void 0:i.key)&&void 0!==c?c:null),Q=(0,e.ref)(""),X=(0,e.ref)(!0),Y=(0,e.ref)(!1),ee=(0,e.ref)(null),ne=(0,e.reactive)(new Set),te=(0,e.reactive)({currentPage:1,lastPage:1,perPage:Number(R.perPage||12),total:0}),re=0,ae=(0,e.computed)(function(){var e,t;return Z.value.find(function(e){return ie(e)})||(n(null!==(e=null===(t=R.current)||void 0===t?void 0:t.key)&&void 0!==e?e:null,J.value)?R.current:null)}),oe=function(){var e=s(l().m(function e(){var n,t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=++re,X.value=!0,Y.value=!1,e.p=1,e.n=2,Nova.request().get("".concat(R.apiBase||"/nova-vendor/nova-tenancy","/tenants"),{params:{search:Q.value||void 0,page:te.currentPage,perPage:te.perPage}});case 2:if(t=e.v,n===re){e.n=3;break}return e.a(2);case 3:Z.value=t.data.data,J.value=t.data.currentKey,Object.assign(te,t.data.meta),e.n=5;break;case 4:e.p=4,e.v,n===re&&(Y.value=!0);case 5:return e.p=5,n===re&&(X.value=!1),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=s(l().m(function e(n){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null===ee.value&&!ie(n)){e.n=1;break}return e.a(2);case 1:return ee.value=String(n.key),e.p=2,e.n=3,Nova.request().post("".concat(R.apiBase||"/nova-vendor/nova-tenancy","/current"),{tenant:String(n.key)});case 3:t=e.v,J.value=t.data.current.key,Nova.$emit("nova-tenancy:changed",t.data),Nova.visit(t.data.redirectTo||"/"),e.n=5;break;case 4:e.p=4,e.v,Nova.$emit("error",W.error||"Unable to select tenant.");case 5:return e.p=5,ee.value=null,e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(n){return e.apply(this,arguments)}}(),le=function(e){te.currentPage=e,oe()},ie=function(e){return n(e.key,J.value)},ue=t,se=a,ve=function(e){return ne.add(String(e))};return(0,e.watch)(Q,function(){clearTimeout(u),u=setTimeout(function(){te.currentPage=1,oe()},Number(R.searchDebounce||300))}),(0,e.onMounted)(oe),(0,e.onBeforeUnmount)(function(){return clearTimeout(u)}),function(n,t){var r=(0,e.resolveComponent)("Head");return(0,e.openBlock)(),(0,e.createElementBlock)("div",v,[(0,e.createVNode)(r,{title:(0,e.unref)(W).pageTitle},null,8,["title"]),(0,e.createElementVNode)("section",d,[t[5]||(t[5]=(0,e.createElementVNode)("div",{class:"nova-tenancy-hero__glow","aria-hidden":"true"},null,-1)),(0,e.createElementVNode)("div",f,[(0,e.createElementVNode)("p",p,(0,e.toDisplayString)((0,e.unref)(W).pageKicker),1),(0,e.createElementVNode)("h1",y,(0,e.toDisplayString)((0,e.unref)(W).pageTitle),1),(0,e.createElementVNode)("p",m,(0,e.toDisplayString)((0,e.unref)(W).pageDescription),1)]),ae.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",g,[(0,e.createElementVNode)("div",k,[ae.value.logoUrl&&!ne.has(String(ae.value.key))?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:ae.value.logoUrl,alt:"",onError:t[0]||(t[0]=function(e){return ve(ae.value.key)})},null,40,h)):((0,e.openBlock)(),(0,e.createElementBlock)("span",b,(0,e.toDisplayString)((0,e.unref)(ue)(ae.value.title)),1))]),(0,e.createElementVNode)("div",E,[(0,e.createElementVNode)("span",null,(0,e.toDisplayString)((0,e.unref)(W).currentTenant),1),(0,e.createElementVNode)("strong",null,(0,e.toDisplayString)(ae.value.title),1)]),t[4]||(t[4]=(0,e.createElementVNode)("span",{class:"nova-tenancy-pulse","aria-hidden":"true"},null,-1))])):(0,e.createCommentVNode)("",!0)]),(0,e.createElementVNode)("section",{class:"nova-tenancy-toolbar","aria-label":(0,e.unref)(W).search},[(0,e.createElementVNode)("label",B,[t[6]||(t[6]=(0,e.createElementVNode)("svg",{viewBox:"0 0 24 24","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"m21 21-4.35-4.35m2.35-5.65a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"})],-1)),(0,e.createElementVNode)("span",_,(0,e.toDisplayString)((0,e.unref)(W).search),1),(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":t[1]||(t[1]=function(e){return Q.value=e}),type:"search",placeholder:(0,e.unref)(W).searchPlaceholder,autocomplete:"off"},null,8,V),[[e.vModelText,Q.value]])]),X.value?(0,e.createCommentVNode)("",!0):((0,e.openBlock)(),(0,e.createElementBlock)("span",S,(0,e.toDisplayString)(te.total.toLocaleString()),1))],8,N),X.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",w,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(6,function(n){return(0,e.createElementVNode)("div",{key:n,class:"nova-tenancy-card nova-tenancy-card--skeleton"},o(t[7]||(t[7]=[(0,e.createElementVNode)("span",null,null,-1),(0,e.createElementVNode)("span",null,null,-1),(0,e.createElementVNode)("span",null,null,-1)])))}),64))])):Y.value?((0,e.openBlock)(),(0,e.createElementBlock)("div",P,[t[8]||(t[8]=(0,e.createElementVNode)("div",{class:"nova-tenancy-state__icon"},"!",-1)),(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)((0,e.unref)(W).error),1),(0,e.createElementVNode)("button",{type:"button",class:"nova-tenancy-button",onClick:oe},(0,e.toDisplayString)((0,e.unref)(W).retry),1)])):0===Z.value.length?((0,e.openBlock)(),(0,e.createElementBlock)("div",O,[t[9]||(t[9]=(0,e.createElementVNode)("div",{class:"nova-tenancy-state__icon nova-tenancy-state__icon--empty"},[(0,e.createElementVNode)("svg",{viewBox:"0 0 24 24","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"M3 21h18M5 21V7l7-4 7 4v14M9 10h.01M9 14h.01M9 18h.01M15 10h.01M15 14h.01M15 18h.01"})])],-1)),(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)((0,e.unref)(W).emptyTitle),1),(0,e.createElementVNode)("p",null,(0,e.toDisplayString)((0,e.unref)(W).emptyDescription),1)])):((0,e.openBlock)(),(0,e.createElementBlock)("div",D,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(Z.value,function(n){return(0,e.openBlock)(),(0,e.createElementBlock)("article",{key:n.key,class:(0,e.normalizeClass)(["nova-tenancy-card",{"nova-tenancy-card--selected":ie(n)}]),style:(0,e.normalizeStyle)((0,e.unref)(se)(n)),"aria-current":ie(n)?"true":void 0},[t[12]||(t[12]=(0,e.createElementVNode)("div",{class:"nova-tenancy-card__accent","aria-hidden":"true"},null,-1)),(0,e.createElementVNode)("div",j,[(0,e.createElementVNode)("div",C,[n.logoUrl&&!ne.has(String(n.key))?((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:0,src:n.logoUrl,alt:"",loading:"lazy",onError:function(e){return ve(n.key)}},null,40,x)):((0,e.openBlock)(),(0,e.createElementBlock)("span",M,(0,e.toDisplayString)((0,e.unref)(ue)(n.title)),1))]),n.badge?((0,e.openBlock)(),(0,e.createElementBlock)("span",G,(0,e.toDisplayString)(n.badge),1)):ie(n)?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:1,class:"nova-tenancy-check",title:(0,e.unref)(W).selected},o(t[10]||(t[10]=[(0,e.createElementVNode)("svg",{viewBox:"0 0 20 20","aria-hidden":"true"},[(0,e.createElementVNode)("path",{d:"m5 10 3 3 7-7"})],-1)])),8,A)):(0,e.createCommentVNode)("",!0)]),(0,e.createElementVNode)("div",U,[(0,e.createElementVNode)("h2",null,(0,e.toDisplayString)(n.title),1),n.description?((0,e.openBlock)(),(0,e.createElementBlock)("p",F,(0,e.toDisplayString)(n.description),1)):((0,e.openBlock)(),(0,e.createElementBlock)("p",L,"#"+(0,e.toDisplayString)(n.key),1))]),(0,e.createElementVNode)("button",{type:"button",class:(0,e.normalizeClass)(["nova-tenancy-select",{"nova-tenancy-select--selected":ie(n)}]),disabled:null!==ee.value||ie(n),"aria-busy":ee.value===String(n.key),onClick:function(e){return ce(n)}},[ee.value===String(n.key)?((0,e.openBlock)(),(0,e.createElementBlock)("span",$)):(0,e.createCommentVNode)("",!0),(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(ie(n)?(0,e.unref)(W).selected:(0,e.unref)(W).select),1),ie(n)?(0,e.createCommentVNode)("",!0):((0,e.openBlock)(),(0,e.createElementBlock)("svg",q,o(t[11]||(t[11]=[(0,e.createElementVNode)("path",{d:"M4 10h12m-4-4 4 4-4 4"},null,-1)]))))],10,I)],14,T)}),128))])),te.lastPage>1?((0,e.openBlock)(),(0,e.createElementBlock)("nav",z,[(0,e.createElementVNode)("button",{type:"button",disabled:te.currentPage<=1||X.value,onClick:t[2]||(t[2]=function(e){return le(te.currentPage-1)})},(0,e.toDisplayString)((0,e.unref)(W).previous),9,K),(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(te.currentPage)+" / "+(0,e.toDisplayString)(te.lastPage),1),(0,e.createElementVNode)("button",{type:"button",disabled:te.currentPage>=te.lastPage||X.value,onClick:t[3]||(t[3]=function(e){return le(te.currentPage+1)})},(0,e.toDisplayString)((0,e.unref)(W).next),9,H)])):(0,e.createCommentVNode)("",!0)])}}},W=R;function Z(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function o(t,r,a,o){var i=r&&r.prototype instanceof l?r:l,u=Object.create(i.prototype);return J(u,"_invoke",function(t,r,a){var o,l,i,u=0,s=a||[],v=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return o=n,l=0,i=e,d.n=t,c}};function f(t,r){for(l=t,i=r,n=0;!v&&u&&!a&&n3?(a=p===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=f&&((a=t<2&&fr||r>p)&&(o[4]=t,o[5]=r,d.n=p,l=0))}if(a||t>1)return c;throw v=!0,r}return function(a,s,p){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&f(s,p),l=s,i=p;(n=l<2?e:i)||!v;){o||(l?l<3?(l>1&&(d.n=-1),f(l,i)):d.n=i:d.v=i);try{if(u=2,o){if(l||(a="next"),n=o[a]){if(!(n=n.call(o,i)))throw TypeError("iterator result is not an object");if(!n.done)return n;i=n.value,l<2&&(l=0)}else 1===l&&(n=o.return)&&n.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((n=(v=d.n<0)?i:t.call(r,d))!==c)break}catch(n){o=e,l=1,i=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),u}var c={};function l(){}function i(){}function u(){}n=Object.getPrototypeOf;var s=[][r]?n(n([][r]())):(J(n={},r,function(){return this}),n),v=u.prototype=l.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,J(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e}return i.prototype=u,J(v,"constructor",u),J(u,"constructor",i),i.displayName="GeneratorFunction",J(u,a,"GeneratorFunction"),J(v),J(v,a,"Generator"),J(v,r,function(){return this}),J(v,"toString",function(){return"[object Generator]"}),(Z=function(){return{w:o,m:d}})()}function J(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}J=function(e,n,t,r){function o(n,t){J(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},J(e,n,t,r)}function Q(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}var X=["title"],Y=["src"],ee={key:1,class:"nova-tenancy-brand__initial"},ne={key:1,class:"nova-tenancy-brand__title"};const te=Object.assign({inheritAttrs:!1},{__name:"TenantAppLogo",setup:function(n){var r=Nova.config("novaTenancy")||{},a=(0,e.ref)(null),o=(0,e.ref)(r.current||null),c=(0,e.ref)(Date.now()),l=(0,e.ref)(!1),i=null,u=(0,e.computed)(function(){var e;return!1!==(null===(e=r.branding)||void 0===e?void 0:e.show_logo)}),s=(0,e.computed)(function(){var e;return!1!==(null===(e=r.branding)||void 0===e?void 0:e.show_title)}),v=(0,e.computed)(function(){var e,n;return(null===(e=o.value)||void 0===e?void 0:e.title)||(null===(n=r.copy)||void 0===n?void 0:n.selectTenant)||"Select tenant"}),d=(0,e.computed)(function(){return t(v.value)}),f=(0,e.computed)(function(){var e,n;return function(e,n,t){return"".concat(e,"/current/logo?tenant=").concat(encodeURIComponent(null!=n?n:"none"),"&v=").concat(t)}(r.apiBase||"/nova-vendor/nova-tenancy",null!==(e=null===(n=o.value)||void 0===n?void 0:n.key)&&void 0!==e?e:"none",c.value)}),p=function(e){var n,t;o.value=null!==(n=null!==(t=null==e?void 0:e.current)&&void 0!==t?t:e)&&void 0!==n?n:null,c.value=Date.now(),l.value=!1},y=function(){var e,n=(e=Z().m(function e(){var n;return Z().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Nova.request().get("".concat(r.apiBase||"/nova-vendor/nova-tenancy","/current"));case 1:n=e.v,p(n.data),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){Q(o,r,a,c,l,"next",e)}function l(e){Q(o,r,a,c,l,"throw",e)}c(void 0)})});return function(){return n.apply(this,arguments)}}(),m=function(){var e,n;Nova.visit("home"===(n=null===(e=r.branding)||void 0===e?void 0:e.link)?"/":"string"==typeof n&&n.startsWith("/")?n:r.selectorPath||"/nova-tenancy")},g=function(e){e.preventDefault(),e.stopImmediatePropagation(),m()};return(0,e.onMounted)(function(){var e,n;Nova.$on("nova-tenancy:changed",p),null===(n=i=(null===(e=a.value)||void 0===e?void 0:e.closest("a"))||null)||void 0===n||n.addEventListener("click",g,!0),y()}),(0,e.onBeforeUnmount)(function(){var e;Nova.$off("nova-tenancy:changed",p),null===(e=i)||void 0===e||e.removeEventListener("click",g,!0)}),function(n,t){return(0,e.openBlock)(),(0,e.createElementBlock)("span",{ref_key:"brand",ref:a,class:"nova-tenancy-brand",title:v.value,onClick:(0,e.withModifiers)(m,["stop","prevent"])},[u.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:0,class:(0,e.normalizeClass)(["nova-tenancy-brand__logo",{"nova-tenancy-brand__logo--fallback":l.value}]),"aria-hidden":"true"},[l.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",ee,(0,e.toDisplayString)(d.value),1)):((0,e.openBlock)(),(0,e.createElementBlock)("img",{key:f.value,src:f.value,alt:"",onError:t[0]||(t[0]=function(e){return l.value=!0})},null,40,Y))],2)):(0,e.createCommentVNode)("",!0),s.value?((0,e.openBlock)(),(0,e.createElementBlock)("span",ne,(0,e.toDisplayString)(v.value),1)):(0,e.createCommentVNode)("",!0)],8,X)}}}),re=te;Nova.inertia("NovaTenancy",W),Nova.booting(function(e){var n;!1!==(null===(n=Nova.config("novaTenancy"))||void 0===n||null===(n=n.branding)||void 0===n?void 0:n.enabled)&&e.component("AppLogo",re)}),Nova.request().interceptors.response.use(function(e){return e},function(e){var n,t;if(409===(null===(n=e.response)||void 0===n?void 0:n.status)&&"tenant_selection_required"===(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.code)){var r,a=(null===(r=Nova.config("novaTenancy"))||void 0===r?void 0:r.selectorPath)||"/nova-tenancy";Nova.visit(a)}return Promise.reject(e)})},351(){}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return n[e](o,o.exports,r),o.exports}r.m=n,e=[],r.O=(n,t,a,o)=>{if(!t){var c=1/0;for(s=0;s=o)&&Object.keys(r.O).every(e=>r.O[e](t[i]))?t.splice(i--,1):(l=!1,o0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[t,a,o]},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={416:0,757:0};r.O.j=n=>0===e[n];var n=(n,t)=>{var a,o,[c,l,i]=t,u=0;if(c.some(n=>0!==e[n])){for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(i)var s=i(r)}for(n&&n(t);ur(733));var a=r.O(void 0,[757],()=>r(351));a=r.O(a)})(); \ No newline at end of file diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json index 297ab2a..d55e601 100644 --- a/dist/mix-manifest.json +++ b/dist/mix-manifest.json @@ -1,4 +1,4 @@ { - "/js/tool.js": "/js/tool.js?id=343e4b7ca33f00e486dadce9cf791649", - "/css/tool.css": "/css/tool.css?id=3eaee65b7bfd1e6457e413f9f981cfee" + "/js/tool.js": "/js/tool.js?id=54cef83dfae48e83d70e959fd452bc99", + "/css/tool.css": "/css/tool.css?id=78e955750268e2fd2573608a0d532c52" } diff --git a/resources/css/tool.css b/resources/css/tool.css index 478d6cb..89604bc 100644 --- a/resources/css/tool.css +++ b/resources/css/tool.css @@ -1,7 +1,7 @@ .nova-tenancy-page { - --nt-primary: rgba(var(--colors-primary-500, 14, 165, 233), 1); - --nt-primary-soft: rgba(var(--colors-primary-500, 14, 165, 233), 0.12); - --nt-primary-strong: rgba(var(--colors-primary-600, 2, 132, 199), 1); + --nt-primary: rgba(var(--colors-primary-500, 14, 165, 233)); + --nt-primary-soft: color-mix(in srgb, var(--nt-primary) 12%, transparent); + --nt-primary-strong: rgba(var(--colors-primary-600, 2, 132, 199)); --nt-surface: rgba(var(--colors-white, 255, 255, 255), 1); --nt-border: rgba(var(--colors-gray-200, 226, 232, 240), 1); --nt-text: rgba(var(--colors-gray-900, 15, 23, 42), 1); @@ -26,8 +26,8 @@ padding: clamp(1.5rem, 4vw, 3rem); color: white; background: - radial-gradient(circle at 12% 10%, rgba(var(--colors-primary-400, 56, 189, 248), 0.58), transparent 34%), - radial-gradient(circle at 88% 85%, rgba(var(--colors-primary-500, 14, 165, 233), 0.38), transparent 38%), + radial-gradient(circle at 12% 10%, color-mix(in srgb, rgba(var(--colors-primary-400, 56, 189, 248)) 58%, transparent), transparent 34%), + radial-gradient(circle at 88% 85%, color-mix(in srgb, var(--nt-primary) 38%, transparent), transparent 38%), linear-gradient( 135deg, color-mix(in srgb, var(--nt-primary-strong) 68%, #0f172a) 0%, @@ -183,7 +183,7 @@ } .nova-tenancy-search:focus-within { - border-color: rgba(var(--colors-primary-400, 56, 189, 248), 0.7); + border-color: color-mix(in srgb, rgba(var(--colors-primary-400, 56, 189, 248)) 70%, transparent); box-shadow: 0 0 0 3px var(--nt-primary-soft); } @@ -500,7 +500,7 @@ gap: 0.75rem; border: 0; padding: 0; - color: rgba(var(--colors-primary-500, 14, 165, 233), 1); + color: rgba(var(--colors-primary-500, 14, 165, 233)); background: transparent; cursor: pointer; } @@ -512,20 +512,22 @@ flex: none; place-items: center; overflow: hidden; - border: 1px solid rgba(var(--colors-primary-500, 14, 165, 233), 0.24); border-radius: 0.65rem; - color: rgba(var(--colors-primary-600, 2, 132, 199), 1); - background: rgba(var(--colors-primary-500, 14, 165, 233), 0.12); - box-shadow: 0 3px 12px rgba(var(--colors-gray-900, 15, 23, 42), 0.12); } .nova-tenancy-brand__logo img { width: 100%; height: 100%; - padding: 0.15rem; object-fit: contain; } +.nova-tenancy-brand__logo--fallback { + border: 1px solid color-mix(in srgb, rgba(var(--colors-primary-500, 14, 165, 233)) 24%, transparent); + color: rgba(var(--colors-primary-600, 2, 132, 199)); + background: color-mix(in srgb, rgba(var(--colors-primary-500, 14, 165, 233)) 12%, transparent); + box-shadow: 0 3px 12px rgba(var(--colors-gray-900, 15, 23, 42), 0.12); +} + .nova-tenancy-brand__initial { font-size: 1rem; font-weight: 800; @@ -545,7 +547,7 @@ .nova-tenancy-button:focus-visible, .nova-tenancy-pagination button:focus-visible, .nova-tenancy-brand:focus-visible { - outline: 2px solid var(--nt-primary); + outline: 2px solid rgba(var(--colors-primary-500, 14, 165, 233)); outline-offset: 3px; } @@ -559,7 +561,7 @@ } .dark .nova-tenancy-page { - --nt-primary-soft: rgba(var(--colors-primary-500, 14, 165, 233), 0.2); + --nt-primary-soft: color-mix(in srgb, var(--nt-primary) 20%, transparent); --nt-surface: rgba(var(--colors-gray-800, 30, 41, 59), 1); --nt-border: rgba(var(--colors-gray-700, 51, 65, 85), 1); --nt-text: rgba(var(--colors-gray-100, 241, 245, 249), 1); @@ -575,18 +577,18 @@ } .dark .nova-tenancy-brand { - color: rgba(var(--colors-primary-400, 56, 189, 248), 1); + color: rgba(var(--colors-primary-500, 14, 165, 233)); } -.dark .nova-tenancy-brand__logo { - border-color: rgba(var(--colors-primary-400, 56, 189, 248), 0.32); - color: rgba(var(--colors-primary-300, 125, 211, 252), 1); - background: rgba(var(--colors-primary-500, 14, 165, 233), 0.2); +.dark .nova-tenancy-brand__logo--fallback { + border-color: color-mix(in srgb, rgba(var(--colors-primary-500, 14, 165, 233)) 32%, transparent); + color: rgba(var(--colors-primary-500, 14, 165, 233)); + background: color-mix(in srgb, rgba(var(--colors-primary-500, 14, 165, 233)) 20%, transparent); } .dark .nova-tenancy-count, .dark .nova-tenancy-state__icon--empty { - color: rgba(var(--colors-primary-400, 56, 189, 248), 1); + color: rgba(var(--colors-primary-500, 14, 165, 233)); background: var(--nt-primary-soft); } diff --git a/resources/js/components/TenantAppLogo.vue b/resources/js/components/TenantAppLogo.vue index 7451f3c..6fd11bc 100644 --- a/resources/js/components/TenantAppLogo.vue +++ b/resources/js/components/TenantAppLogo.vue @@ -5,7 +5,12 @@ :title="title" @click.stop.prevent="visitBrandDestination" > -