@nice2dev/events 1.0.30 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/README.md +41 -10
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +695 -13
- package/dist/index.mjs +3462 -863
- package/package.json +16 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
# @nice2dev/events — Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.5
|
|
4
|
+
|
|
5
|
+
No changes in this release.
|
|
6
|
+
|
|
7
|
+
## 1.1.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Eight new event controls, covering the gaps OmniVerk raised for 1.0.32.
|
|
12
|
+
|
|
13
|
+
**New in `@nice2dev/events`**
|
|
14
|
+
|
|
15
|
+
- `NiceSeatingChart` / `NiceSeatPicker` — pick seats from a venue plan. SVG with
|
|
16
|
+
three levels of detail chosen from how many seats are actually in view, so the
|
|
17
|
+
number of DOM nodes stays bounded whatever the venue size. Pan, pinch-zoom and
|
|
18
|
+
a roving keyboard cursor, plus an always-present section → row → seat list with
|
|
19
|
+
"best available" — the path that actually works with a screen reader. Built on
|
|
20
|
+
the `SeatingChart` types that already shipped in `venue/venue-spatial.ts`.
|
|
21
|
+
- `NiceGiftRegistry` — gift registry and wishlist in one control (`kind`), with
|
|
22
|
+
group gifting, progress to goal and a guest mode that works with no signed-in
|
|
23
|
+
user.
|
|
24
|
+
- `NiceParticipantList` — guest roster with RSVP, check-in, grouping, search and
|
|
25
|
+
a paste-a-list invite box. Fills in the React component that the Angular, Vue
|
|
26
|
+
and Web Component adapters have been exporting a name for.
|
|
27
|
+
- `NiceRsvpControl` — yes / maybe / no with plus-ones, for a public invitation page.
|
|
28
|
+
- `NiceExpenseSplit` — who owes whom, reduced to few transfers. Integer
|
|
29
|
+
minor-unit arithmetic, so balances sum to exactly zero; currencies are grouped
|
|
30
|
+
rather than converted.
|
|
31
|
+
- `NiceInvitationDesigner` — invitation editor on `NiceHtmlEditor` with
|
|
32
|
+
`{{token}}` substitution, live preview and bulk send guarded by `sending`.
|
|
33
|
+
- `NiceMediaCollage` — arrange media into an ordered collage and play it back.
|
|
34
|
+
Drag or keyboard reordering via Pointer Events, so it works on touch.
|
|
35
|
+
|
|
36
|
+
**Changed**
|
|
37
|
+
|
|
38
|
+
- `NiceEventMedia` gains `onReorder`, and `EventMediaItem` gains `order`. Items
|
|
39
|
+
sort by `order` (falling back to array position); the component never keeps its
|
|
40
|
+
own copy of the sequence, so the view cannot drift from what was saved.
|
|
41
|
+
- `SeatSelectionConfig`: every field is now optional, plus new `adjacentOnly`
|
|
42
|
+
(refuse selections that strand a single seat) and `allowedCategories`. Widening
|
|
43
|
+
a type is safe for anyone constructing one; anyone _reading_ a
|
|
44
|
+
`SeatSelectionConfig` value must now handle `undefined`. The type had no
|
|
45
|
+
consumers in this repo, but it is public API, so it is called out here.
|
|
46
|
+
- `Seat` gains `accessType`. `SeatStatus` folds `'wheelchair'`/`'companion'` into
|
|
47
|
+
the same union as `'sold'`, so an accessible seat lost that fact the moment it
|
|
48
|
+
was booked. `accessType` is independent of availability; the old status values
|
|
49
|
+
keep working as an alias for an available accessible seat. The union itself is
|
|
50
|
+
unchanged.
|
|
51
|
+
- `@nice2dev/ui` ships `styles/controls-events.css` with the styles for the above.
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Round-24 showcase-feedback fixes.
|
|
56
|
+
|
|
57
|
+
**@nice2dev/ui**
|
|
58
|
+
|
|
59
|
+
- **NiceDateRangeBox / NiceDateTimePicker.** Fix a real day/month transposition: the
|
|
60
|
+
keyboard `t`/Today shortcut (`writeDate`) built digits in ISO order but they were
|
|
61
|
+
interpreted in display order, so for a localized mask (`dd.MM.yyyy`) Today produced a
|
|
62
|
+
transposed value that then drove the other picker's greyed range. `writeDate` now builds
|
|
63
|
+
an ISO string and routes through the ISO-safe `applyIso`. The popup **Today/Now** buttons
|
|
64
|
+
are also disabled when today is outside `[min, max]`, instead of silently clamping to `min`.
|
|
65
|
+
- **NiceDateTimePicker (clock mode).** The highlight now rides the selected **hour number**
|
|
66
|
+
on the ring (not the hand tip); **both** hands are always drawn (active in the accent
|
|
67
|
+
colour, the other muted); and `minuteStep` (5/10/15/20/30) draws snap markers + labels and
|
|
68
|
+
clicks snap to them.
|
|
69
|
+
- **NiceTreeView.** New optional `header` prop rendered above the search box / tree.
|
|
70
|
+
- **NiceKanbanBoard.** New `collapseDirection: 'vertical' | 'horizontal'` prop (a short
|
|
71
|
+
horizontal bar as an alternative to the slim vertical rail); the collapsed count renders as
|
|
72
|
+
a one-line diagonal fraction (`2/3`).
|
|
73
|
+
- **NicePivotGridFieldChooser.** Working HTML5 drag-and-drop, `name (type)` field bars (new
|
|
74
|
+
`NicePivotField.dataType`), the per-field area buttons replaced by a `NiceSelect` gated
|
|
75
|
+
behind a new `showAreaSelect` prop, and a single-column layout so Filters no longer wraps.
|
|
76
|
+
- **NiceTabs.** New `countLocation: 'right' | 'bottom'` prop — `'bottom'` stacks a tab's
|
|
77
|
+
badge/count under the icon as a heavily-rounded pill.
|
|
78
|
+
|
|
79
|
+
**@nice2dev/icons** — geometry fixes across all variants: NtdBank (roof/columns lowered ~20%
|
|
80
|
+
and centred), NtdMusic (note heads meet stems flush), NtdHome (square floor + lower walls),
|
|
81
|
+
NtdPlanet (ring uses the secondary colour in solid/outline), NtdPizza (arc crust, not a
|
|
82
|
+
triangle), NtdDroplet (slimmer profiled sides), NtdHexagon & NtdSend (sharp, not rounded).
|
|
83
|
+
|
|
84
|
+
**@nice2dev/events** — NiceEventPlanning grows from 6 to 10 tabs (Schedule, Tasks, Vendors,
|
|
85
|
+
Documents), each optional tab hideable via a `show*` boolean prop, plus a `countLocation`
|
|
86
|
+
prop (`'bottom'` default | `'right'`) forwarded to NiceTabs.
|
|
87
|
+
|
|
88
|
+
**@nice2dev/ui-api** — NiceAPIDesigner rebuilt on Nice controls with real, editable Paths /
|
|
89
|
+
Schemas / Security editors and a seeded Pet-Store example so it opens populated.
|
|
90
|
+
|
|
91
|
+
**@nice2dev/ui-graphics** — NicePixelEditor: the right settings panel folds into collapsible
|
|
92
|
+
NiceCollapse sections, the top menu into NiceMenu dropdowns, and the active tool now has a
|
|
93
|
+
clearly-visible highlight.
|
|
94
|
+
|
|
3
95
|
## 1.0.30
|
|
4
96
|
|
|
5
97
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -18,16 +18,38 @@ npm install @nice2dev/events
|
|
|
18
18
|
|
|
19
19
|
## Components
|
|
20
20
|
|
|
21
|
-
| Component
|
|
22
|
-
|
|
|
23
|
-
| `NiceEventMedia`
|
|
24
|
-
| `NiceEventPlanning`
|
|
25
|
-
| `NiceRoundList`
|
|
26
|
-
| `NiceRoundCard`
|
|
27
|
-
| `NiceSongPicker`
|
|
28
|
-
| `NiceKaraokePicker`
|
|
29
|
-
| `NiceAttractionPicker`
|
|
30
|
-
| `NiceAttractionVoting`
|
|
21
|
+
| Component | Category | Description |
|
|
22
|
+
| ------------------------ | ----------- | ----------------------------------------------------- |
|
|
23
|
+
| `NiceEventMedia` | Content | Media gallery with upload, photos, and collages |
|
|
24
|
+
| `NiceEventPlanning` | Planning | Event planning with dates, location, surveys, billing |
|
|
25
|
+
| `NiceRoundList` | Rounds | Round system list with status and scoring |
|
|
26
|
+
| `NiceRoundCard` | Rounds | Individual round card with actions, timer, scoreboard |
|
|
27
|
+
| `NiceSongPicker` | Music | Song selection for music events |
|
|
28
|
+
| `NiceKaraokePicker` | Music | Karaoke song picker with queue management |
|
|
29
|
+
| `NiceAttractionPicker` | Attractions | Attraction selection grid with categories |
|
|
30
|
+
| `NiceAttractionVoting` | Attractions | Anonymous voting on attractions |
|
|
31
|
+
| `NiceMediaCollage` | Content | Ordered photo/video collage with slideshow playback |
|
|
32
|
+
| `NiceParticipantList` | Guests | Guest roster with RSVP, check-in, grouping and search |
|
|
33
|
+
| `NiceRsvpControl` | Guests | Yes/maybe/no reply with plus-ones, for a public page |
|
|
34
|
+
| `NiceSeatingChart` | Seating | Venue seating plan with level-of-detail rendering |
|
|
35
|
+
| `NiceSeatPicker` | Seating | Buy-a-ticket seat selection with an accessible list |
|
|
36
|
+
| `NiceExpenseSplit` | Money | Shared expenses, balances and a settlement plan |
|
|
37
|
+
| `NiceGiftRegistry` | Gifts | Gift registry / wishlist with group gifting |
|
|
38
|
+
| `NiceInvitationDesigner` | Invitations | Invitation editor with token preview and bulk send |
|
|
39
|
+
|
|
40
|
+
### Notes on a few of these
|
|
41
|
+
|
|
42
|
+
- **`NiceSeatingChart`** picks its detail level from how many seats are actually in view —
|
|
43
|
+
sections when zoomed out, row strips in between, individual seats up close — so the number of
|
|
44
|
+
rendered nodes stays bounded whatever the venue size. Keep `showList` on for ticket sales: the
|
|
45
|
+
non-visual section → row → seat picker is the only workable path with a screen reader.
|
|
46
|
+
- **`NiceGiftRegistry`** covers both a registry and a wishlist via `kind`. The prop is `kind`, not
|
|
47
|
+
`variant`, because `variant` already means colour intent across the library.
|
|
48
|
+
- **`NiceExpenseSplit`** runs on integer minor units, so balances sum to exactly zero. Different
|
|
49
|
+
currencies are grouped and settled separately, never converted. `BillingItem.isPaid` means the
|
|
50
|
+
vendor was paid — not that the group settled up — so it does not affect balances.
|
|
51
|
+
- **Public pages:** `NiceGiftRegistry`, `NiceParticipantList` and `NiceRsvpControl` all work with no
|
|
52
|
+
signed-in user. An anonymous guest types a name, which arrives as `userName` with no `userId`.
|
|
31
53
|
|
|
32
54
|
## Types & Interfaces
|
|
33
55
|
|
|
@@ -37,6 +59,15 @@ npm install @nice2dev/events
|
|
|
37
59
|
- `EventAttraction` — Attraction with voting
|
|
38
60
|
- `EventService` — Abstract API interface for backend integration
|
|
39
61
|
- `ChatMessage`, `SongEntry`, `KaraokeSong`, `BillingItem`, `EventSurvey`, `EventMediaItem`
|
|
62
|
+
- `NiceGiftRegistryItem`, `NiceGiftContribution` — gift registry / wishlist entries
|
|
63
|
+
- `NiceSettlementTransfer`, `NiceParticipantBalance`, `NiceExpenseIssue` — expense settlement
|
|
64
|
+
- `NiceRsvpAnswer`, `NiceRsvpSelection` — RSVP replies
|
|
65
|
+
- `NiceCollageItem`, `NiceMediaCollageLayout` — collage tiles
|
|
66
|
+
- `SeatingChart`, `SeatingSection`, `Seat`, `SeatStatus`, `SeatSelectionConfig` — venue seating
|
|
67
|
+
(re-exported from `venue/venue-spatial`)
|
|
68
|
+
|
|
69
|
+
> ⚠ `ZoneOccupancy` is exported by both this package and `@nice2dev/ui-buildings`, with different
|
|
70
|
+
> shapes. If you import both, use a namespace import to disambiguate.
|
|
40
71
|
|
|
41
72
|
## Usage
|
|
42
73
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("@nice2dev/icons"),o=require("@nice2dev/ui"),a=require("react"),A=require("@nice2dev/ui-core"),Oe=({item:I})=>{const[f,k]=a.useState(!1),t=I.thumbnailUrl??I.url;return I.type==="video"?e.jsx("div",{className:"nice-event-media__video-thumb",children:e.jsx(N.NtdPlay,{size:26})}):f||!t?e.jsx("div",{className:"nice-event-media__broken",title:"Image unavailable",children:e.jsx(N.NtdImage,{size:24})}):e.jsx("img",{src:t,alt:I.caption??"",className:"nice-event-media__thumb",loading:"lazy",onError:()=>k(!0)})},$e=a.forwardRef(function(f,k){const{items:t,onUpload:p,onDelete:h,onLike:m,onItemClick:x,layout:v="grid",uploadEnabled:y=!0,typeFilter:g="all",className:S,style:_}=f,[i,d]=a.useState(""),b=a.useMemo(()=>g==="all"?t:t.filter(u=>u.type===g),[t,g]),j=u=>{const n=u[0];!n||!p||(p(n,i.trim()||void 0),d(""))},C=v==="list";return e.jsxs("div",{ref:k,className:`nice-event-media nice-event-media--${v} ${S??""}`,style:_,children:[e.jsx("div",{className:"nice-event-media__header",children:e.jsxs("h3",{children:["Media (",b.length,")"]})}),y&&p&&e.jsxs("div",{className:"nice-event-media__upload",children:[e.jsx(o.NiceUpload,{accept:"image/*,video/*",multiple:!1,imagePreview:!1,onFilesSelected:j}),e.jsx(o.NiceTextInput,{value:i,onChange:d,placeholder:"Add a caption…"})]}),b.length===0?e.jsx("p",{className:"nice-event-media__empty",children:"No media yet."}):e.jsx(o.NiceCardGroup,{columns:C?1:void 0,minColumnWidth:200,gap:12,align:"stretch",children:b.map(u=>e.jsxs("div",{className:`nice-event-media__card${C?" nice-event-media__card--row":""}`,onClick:()=>x==null?void 0:x(u),role:x?"button":void 0,tabIndex:x?0:void 0,children:[e.jsx(Oe,{item:u}),e.jsxs("div",{className:"nice-event-media__body",children:[u.caption&&e.jsx("span",{className:"nice-event-media__caption",children:u.caption}),u.uploadedByName&&e.jsx("span",{className:"nice-event-media__uploader",children:u.uploadedByName}),e.jsxs("div",{className:"nice-event-media__actions",children:[m&&e.jsxs("button",{type:"button",className:"nice-event-media__action",onClick:n=>{n.stopPropagation(),m(u.id)},"aria-label":"Like",children:[e.jsx(N.NtdHeart,{size:15})," ",u.likes??0]}),h&&e.jsx("button",{type:"button",className:"nice-event-media__action nice-event-media__action--danger",onClick:n=>{n.stopPropagation(),h(u.id)},"aria-label":"Delete",children:e.jsx(N.NtdTrash,{size:15})})]})]})]},u.id))})]})});function G(I){const f=I.toLowerCase();return["active","live","published","completed","confirmed"].includes(f)?"success":["cancelled","canceled","rejected","failed"].includes(f)?"error":["scheduled","pending","planning"].includes(f)?"info":["draft","archived"].includes(f)?"secondary":"warning"}const Ve={micro:[],compact:["details","location","budget"],normal:["details","location","participants","surveys","budget"],full:["details","location","participants","surveys","budget","settings"]},De=a.forwardRef(function(f,k){var Z,ee,ne,te,se,ie;const{event:t,participants:p=[],surveys:h=[],billing:m=[],displayMode:x="normal",tabs:v,activeTab:y,onTabChange:g,tabsIconOnly:S=!0,tabsCentered:_="auto",editable:i=!1,onSave:d,onPublish:b,onShare:j,onExport:C,onUpdateEvent:u,onUpdateLocation:n,onAddSurvey:r,onSurveyRespond:s,onAddBilling:w,className:l,style:z}=f,[T,M]=a.useState(t.title),[P,ce]=a.useState(t.description??""),[O,re]=a.useState(t.startDate??""),[$,le]=a.useState(t.endDate??""),[V,oe]=a.useState(((Z=t.location)==null?void 0:Z.name)??""),[D,de]=a.useState(((ee=t.location)==null?void 0:ee.address)??""),[q,ue]=a.useState(((ne=t.location)==null?void 0:ne.virtualUrl)??""),[E,me]=a.useState(((te=t.location)==null?void 0:te.isVirtual)??!1),[B,H]=a.useState(""),[U,pe]=a.useState("single"),[W,K]=a.useState(""),[L,Y]=a.useState(""),[F,J]=a.useState(""),[Q,he]=a.useState("PLN"),X=v??Ve[x],[xe,ve]=a.useState(X[0]??"details"),ge=y??xe,je=a.useCallback(c=>{const R=c;y===void 0&&ve(R),g==null||g(R)},[y,g]),Ne=a.useCallback(()=>{u==null||u({title:T,description:P||void 0,startDate:O||void 0,endDate:$||void 0})},[T,P,O,$,u]),fe=a.useCallback(()=>{n==null||n({name:V,address:D||void 0,virtualUrl:q||void 0,isVirtual:E})},[V,D,q,E,n]),ye=a.useCallback(()=>{if(!B.trim()||!r)return;const c=W.split(",").map(R=>R.trim()).filter(Boolean);r(B.trim(),U,c.length>0?c:void 0),H(""),K("")},[B,U,W,r]),_e=a.useCallback(()=>{!L.trim()||!w||(w({label:L.trim(),amount:parseFloat(F)||0,currency:Q}),Y(""),J(""))},[L,F,Q,w]),be=a.useMemo(()=>m.map(c=>({label:c.label,amount:c.amount})),[m]),ke=a.useMemo(()=>m.reduce((c,R)=>c+R.amount,0),[m]),Se=((se=m[0])==null?void 0:se.currency)??"PLN",Ce=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceTextInput,{label:"Title",value:T,onChange:M,readOnly:!i}),e.jsx(o.NiceTextArea,{label:"Description",value:P,onChange:ce,readOnly:!i,rows:3}),e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"Start"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:O,onChange:c=>re(c.target.value),readOnly:!i})]}),e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"End"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:$,onChange:c=>le(c.target.value),readOnly:!i})]})]}),i&&e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:Ne,children:"Save details"})]}),we=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceToggle,{label:"Virtual event",checked:E,onChange:me,disabled:!i}),e.jsx(o.NiceTextInput,{label:"Venue name",value:V,onChange:oe,readOnly:!i}),E?e.jsx(o.NiceTextInput,{label:"Virtual URL",value:q,onChange:ue,readOnly:!i}):e.jsx(o.NiceTextInput,{label:"Address",value:D,onChange:de,readOnly:!i}),i&&e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:fe,children:"Save location"})]}),Ie=e.jsx("div",{className:"nice-event-planning__participants",children:p.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No participants yet."}):e.jsxs(e.Fragment,{children:[e.jsx(o.NiceAvatarGroup,{max:8,children:p.map(c=>e.jsx(o.NiceAvatar,{name:c.name,src:c.avatarUrl},c.id))}),e.jsx("ul",{className:"nice-event-planning__participant-list",children:p.map(c=>e.jsxs("li",{className:"nice-event-planning__participant",children:[e.jsx(o.NiceAvatar,{name:c.name,src:c.avatarUrl,size:"sm"}),e.jsx("span",{className:"nice-event-planning__participant-name",children:c.name}),e.jsx(o.NiceBadge,{size:"xs",subtle:!0,variant:G(c.status),children:c.status})]},c.id))})]})}),ze=e.jsxs("div",{className:"nice-event-planning__form",children:[h.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No surveys yet."}):h.map(c=>e.jsxs("div",{className:"nice-event-planning__survey",children:[e.jsx("strong",{children:c.question})," ",e.jsx(o.NiceBadge,{size:"xs",outline:!0,variant:"info",children:c.type}),c.options&&e.jsx("div",{className:"nice-event-planning__survey-options",children:c.options.map((R,Ee)=>e.jsx(o.NiceButton,{size:"sm",variant:"outline",onClick:()=>s==null?void 0:s(c.id,R),children:R},Ee))}),c.responses&&e.jsxs("span",{className:"nice-event-planning__muted",children:[c.responses.length," responses"]})]},c.id)),i&&r&&e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceTextInput,{label:"New survey question",value:B,onChange:H,placeholder:"Question"}),e.jsx(o.NiceSelect,{label:"Type",value:U,onChange:c=>pe(c),options:[{value:"single",label:"Single choice"},{value:"multiple",label:"Multiple choice"},{value:"text",label:"Free text"},{value:"rating",label:"Rating"}]}),e.jsx(o.NiceTextInput,{label:"Options (comma-separated)",value:W,onChange:K,placeholder:"Yes, No, Maybe"}),e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"plus",size:"sm"}),onClick:ye,disabled:!B.trim(),children:"Add survey"})]})]}),Ae=e.jsxs("div",{className:"nice-event-planning__form",children:[m.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No billing items yet."}):e.jsx(o.NiceAmountBreakdown,{lines:[...be,{label:"Total",amount:ke,isSummary:!0}],currency:Se}),i&&w&&e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsx(o.NiceTextInput,{label:"Item",value:L,onChange:Y,placeholder:"Catering"}),e.jsx(o.NiceTextInput,{label:"Amount",value:F,onChange:J,placeholder:"0.00"}),e.jsx(o.NiceSelect,{label:"Currency",value:Q,onChange:c=>he(c),options:["PLN","EUR","USD","GBP"]}),e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"plus",size:"sm"}),onClick:_e,disabled:!L.trim(),children:"Add"})]})]}),Te=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceToggle,{label:"Public event",checked:t.isPublic??!1,disabled:!i}),e.jsx(o.NiceTextInput,{label:"Max participants",value:t.maxParticipants!=null?String(t.maxParticipants):"",onChange:()=>{},readOnly:!i}),e.jsxs("div",{className:"nice-event-planning__muted",children:["Host: ",t.hostName," · Created ",new Date(t.createdAt).toLocaleDateString()]})]}),Re={details:Ce,location:we,participants:Ie,surveys:ze,budget:Ae,settings:Te},Be={details:"file",location:"home",participants:"users",surveys:"clipboard",budget:"file",settings:"settings"},Le={participants:p.length||void 0,surveys:h.length||void 0,budget:m.length||void 0},Me=X.map(c=>({id:c,label:c.charAt(0).toUpperCase()+c.slice(1),icon:e.jsx(A.NiceIcon,{name:Be[c],size:"sm"}),badge:Le[c],content:Re[c]})),Pe=e.jsxs("div",{className:"nice-event-planning__toolbar",children:[e.jsxs("div",{className:"nice-event-planning__toolbar-title",children:[e.jsx(A.NiceIcon,{name:"calendar",size:"md"}),e.jsx("span",{className:"nice-event-planning__title",children:t.title}),e.jsx(o.NiceBadge,{size:"sm",variant:G(t.status),children:t.status})]}),e.jsx("span",{className:"nice-event-planning__toolbar-spacer"}),e.jsxs("div",{className:"nice-event-planning__toolbar-actions",children:[d&&e.jsx(o.NiceButton,{size:"sm",variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:()=>d({title:T,description:P}),children:"Save"}),b&&e.jsx(o.NiceButton,{size:"sm",variant:"success",leftIcon:e.jsx(A.NiceIcon,{name:"upload",size:"sm"}),onClick:b,children:"Publish"}),j&&e.jsx(o.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(A.NiceIcon,{name:"link",size:"sm"}),onClick:j,children:"Share"}),C&&e.jsx(o.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(A.NiceIcon,{name:"download",size:"sm"}),onClick:C,children:"Export"})]})]});return x==="micro"?e.jsx("div",{ref:k,className:`nice-event-planning nice-event-planning--micro ${l??""}`,style:z,children:e.jsxs("div",{className:"nice-event-planning__micro",children:[e.jsx(A.NiceIcon,{name:"calendar",size:"md"}),e.jsxs("div",{className:"nice-event-planning__micro-body",children:[e.jsx("span",{className:"nice-event-planning__title",children:t.title}),e.jsxs("span",{className:"nice-event-planning__muted",children:[t.startDate?new Date(t.startDate).toLocaleString():"No date",(ie=t.location)!=null&&ie.name?` · ${t.location.name}`:""]})]}),e.jsx(o.NiceBadge,{size:"sm",variant:G(t.status),children:t.status}),p.length>0&&e.jsx(o.NiceAvatarGroup,{max:4,size:"sm",children:p.map(c=>e.jsx(o.NiceAvatar,{name:c.name,src:c.avatarUrl,size:"sm"},c.id))})]})}):e.jsxs("div",{ref:k,className:`nice-event-planning nice-event-planning--${x} ${l??""}`,style:z,children:[Pe,e.jsx(o.NiceTabs,{tabs:Me,activeTab:ge,onChange:je,iconOnly:S,centered:_})]})}),qe={upcoming:"⏳",active:"▶️",voting:"🗳️",scored:"📊",completed:"✅",skipped:"⏭️"},Ue={upcoming:"#9ca3af",active:"#22c55e",voting:"#eab308",scored:"#3b82f6",completed:"#6b7280",skipped:"#d1d5db"},We=a.forwardRef(function(f,k){const{rounds:t,activeRoundId:p,onSelect:h,onStart:m,onEnd:x,onCreate:v,editable:y=!1,className:g,style:S}=f,_=[...t].sort((i,d)=>i.order-d.order);return e.jsxs("div",{ref:k,className:`nice-round-list ${g??""}`,style:S,children:[e.jsxs("div",{className:"nice-round-list__header",children:[e.jsxs("h3",{children:["Rounds (",t.length,")"]}),y&&v&&e.jsx("button",{onClick:v,children:"+ Add Round"})]}),_.length===0?e.jsx("p",{className:"nice-round-list__empty",children:"No rounds yet."}):e.jsx("div",{className:"nice-round-list__items",children:_.map(i=>{const d=i.id===p;return e.jsxs("div",{className:`nice-round-list__item ${d?"nice-round-list__item--active":""}`,onClick:()=>h==null?void 0:h(i),role:h?"button":void 0,tabIndex:h?0:void 0,children:[e.jsxs("span",{className:"nice-round-list__order",children:["#",i.order]}),e.jsx("span",{className:"nice-round-list__icon",children:qe[i.status]}),e.jsxs("div",{className:"nice-round-list__info",children:[e.jsx("strong",{className:"nice-round-list__name",children:i.name}),i.description&&e.jsx("small",{children:i.description}),i.type&&e.jsx("span",{className:"nice-round-list__type",children:i.type})]}),e.jsx("span",{className:"nice-round-list__status",style:{color:Ue[i.status]},children:i.status}),i.durationMinutes&&e.jsxs("span",{className:"nice-round-list__duration",children:[i.durationMinutes,"m"]}),i.winnerIds&&i.winnerIds.length>0&&e.jsxs("span",{className:"nice-round-list__winners",children:["🏆 ",i.winnerIds.length]}),y&&e.jsxs("div",{className:"nice-round-list__actions",onClick:b=>b.stopPropagation(),children:[i.status==="upcoming"&&m&&e.jsx("button",{onClick:()=>m(i.id),children:"Start"}),(i.status==="active"||i.status==="voting")&&x&&e.jsx("button",{onClick:()=>x(i.id),children:"End"})]})]},i.id)})})]})}),Fe=a.forwardRef(function(f,k){const{round:t,timerRunning:p=!1,remainingSeconds:h,onSubmitScore:m,onStart:x,onEnd:v,onSkip:y,editable:g=!1,footerActions:S,className:_,style:i}=f,[d,b]=a.useState({}),j=a.useCallback(n=>{const r=parseFloat(d[n]??"");isNaN(r)||!m||(m(n,r),b(s=>({...s,[n]:""})))},[d,m]),C=n=>{const r=Math.floor(n/60),s=n%60;return`${r}:${s.toString().padStart(2,"0")}`},u=t.scores?[...t.scores].sort((n,r)=>r.score-n.score):[];return e.jsxs("div",{ref:k,className:`nice-round-card nice-round-card--${t.status} ${_??""}`,style:i,children:[e.jsxs("div",{className:"nice-round-card__header",children:[e.jsxs("span",{className:"nice-round-card__order",children:["Round #",t.order]}),e.jsx("h3",{className:"nice-round-card__name",children:t.name}),e.jsx("span",{className:"nice-round-card__status",children:t.status})]}),t.description&&e.jsx("p",{className:"nice-round-card__description",children:t.description}),(p||h!=null)&&e.jsxs("div",{className:`nice-round-card__timer ${p?"nice-round-card__timer--running":""}`,children:["⏱️ ",h!=null?C(h):"—"]}),u.length>0&&e.jsxs("div",{className:"nice-round-card__scoreboard",children:[e.jsx("h4",{children:"Scoreboard"}),e.jsxs("table",{className:"nice-round-card__scores-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Participant"}),e.jsx("th",{children:"Score"})]})}),e.jsx("tbody",{children:u.map((n,r)=>e.jsxs("tr",{className:r<3?`nice-round-card__top-${r+1}`:"",children:[e.jsxs("td",{children:[n.rank??r+1,r===0?" 🥇":r===1?" 🥈":r===2?" 🥉":""]}),e.jsx("td",{children:n.participantName}),e.jsx("td",{children:n.score})]},n.participantId))})]})]}),m&&(t.status==="active"||t.status==="voting")&&u.length>0&&e.jsxs("div",{className:"nice-round-card__score-input",children:[e.jsx("h4",{children:"Submit Scores"}),u.map(n=>e.jsxs("div",{className:"nice-round-card__score-row",children:[e.jsx("span",{children:n.participantName}),e.jsx("input",{type:"number",value:d[n.participantId]??"",onChange:r=>b(s=>({...s,[n.participantId]:r.target.value})),min:0,step:1,placeholder:"Score"}),e.jsx("button",{onClick:()=>j(n.participantId),children:"Submit"})]},n.participantId))]}),e.jsxs("div",{className:"nice-round-card__footer",children:[g&&e.jsxs("div",{className:"nice-round-card__actions",children:[t.status==="upcoming"&&x&&e.jsx("button",{onClick:x,children:"▶ Start Round"}),(t.status==="active"||t.status==="voting")&&v&&e.jsx("button",{onClick:v,children:"⏹ End Round"}),t.status==="upcoming"&&y&&e.jsx("button",{onClick:y,children:"⏭ Skip"})]}),S]}),t.winnerIds&&t.winnerIds.length>0&&e.jsxs("div",{className:"nice-round-card__winners",children:["🏆 Winners: ",t.winnerIds.length]})]})}),Qe=a.forwardRef(function(f,k){const{songs:t,onAdd:p,onRemove:h,onVote:m,onSearch:x,showQueue:v=!0,readOnly:y=!1,className:g,style:S}=f,[_,i]=a.useState(""),d=a.useMemo(()=>{if(!_.trim())return t;const n=_.toLowerCase();return t.filter(r=>r.title.toLowerCase().includes(n)||r.artist.toLowerCase().includes(n))},[t,_]),b=a.useMemo(()=>t.filter(n=>n.isQueued),[t]),j=t.find(n=>n.isPlaying),C=n=>{i(n),x==null||x(n)},u=n=>{if(!n)return"";const r=Math.floor(n/60),s=n%60;return`${r}:${s.toString().padStart(2,"0")}`};return e.jsxs("div",{ref:k,className:`nice-song-picker ${g??""}`,style:S,children:[j&&e.jsxs("div",{className:"nice-song-picker__now-playing",children:[e.jsx("span",{className:"nice-song-picker__np-label",children:"🎵 Now Playing"}),j.albumArt&&e.jsx("img",{src:j.albumArt,alt:"",className:"nice-song-picker__album-art"}),e.jsx("strong",{children:j.title}),e.jsx("span",{children:j.artist})]}),e.jsx("input",{type:"text",value:_,onChange:n=>C(n.target.value),placeholder:"Search songs…",className:"nice-song-picker__search"}),e.jsx("div",{className:"nice-song-picker__list",children:d.length===0?e.jsx("p",{className:"nice-song-picker__empty",children:"No songs found."}):d.map(n=>e.jsxs("div",{className:`nice-song-picker__item ${n.isPlaying?"nice-song-picker__item--playing":""}`,children:[n.albumArt&&e.jsx("img",{src:n.albumArt,alt:"",className:"nice-song-picker__thumb"}),e.jsxs("div",{className:"nice-song-picker__info",children:[e.jsx("strong",{children:n.title}),e.jsx("span",{children:n.artist}),n.duration&&e.jsx("span",{className:"nice-song-picker__duration",children:u(n.duration)}),n.addedByName&&e.jsxs("small",{children:["Added by ",n.addedByName]})]}),!y&&e.jsxs("div",{className:"nice-song-picker__actions",children:[m&&e.jsxs("button",{onClick:()=>m(n.id),children:["👍 ",n.votes??0]}),p&&!n.isQueued&&e.jsx("button",{onClick:()=>p(n.id),children:"+ Queue"}),h&&n.isQueued&&e.jsx("button",{onClick:()=>h(n.id),children:"Remove"})]})]},n.id))}),v&&b.length>0&&e.jsxs("div",{className:"nice-song-picker__queue",children:[e.jsxs("h4",{children:["Queue (",b.length,")"]}),b.map((n,r)=>e.jsxs("div",{className:"nice-song-picker__queue-item",children:[e.jsxs("span",{className:"nice-song-picker__queue-pos",children:[r+1,"."]}),e.jsxs("span",{children:[n.title," — ",n.artist]})]},n.id))]})]})}),Ge=a.forwardRef(function(f,k){const{songs:t,queue:p=[],onEnqueue:h,onDequeue:m,onNext:x,nowPlayingId:v,readOnly:y=!1,className:g,style:S}=f,[_,i]=a.useState(""),[d,b]=a.useState(""),j=t.find(s=>s.id===v),C=a.useMemo(()=>{let s=t;if(_.trim()){const w=_.toLowerCase();s=s.filter(l=>l.title.toLowerCase().includes(w)||l.artist.toLowerCase().includes(w))}return d&&(s=s.filter(w=>w.difficulty===d)),s},[t,_,d]),u=a.useMemo(()=>new Set(p.map(s=>s.id)),[p]),n=["easy","medium","hard","expert"],r=s=>{switch(s){case"easy":return"#4caf50";case"medium":return"#ff9800";case"hard":return"#f44336";case"expert":return"#9c27b0";default:return"#999"}};return e.jsxs("div",{ref:k,className:`nice-karaoke-picker ${g??""}`,style:S,children:[j&&e.jsxs("div",{className:"nice-karaoke-picker__now-singing",style:{borderLeft:"4px solid #e91e63",padding:"12px",marginBottom:12,background:"#fce4ec"},children:[e.jsx("span",{style:{fontWeight:600},children:"🎤 Now Singing"}),e.jsxs("div",{children:[e.jsx("strong",{children:j.title})," — ",j.artist,j.performerName&&e.jsxs("span",{children:[" (by ",j.performerName,")"]})]}),!y&&x&&e.jsx("button",{onClick:x,style:{marginTop:8},children:"Skip / Next ⏭"})]}),e.jsxs("div",{className:"nice-karaoke-picker__filters",style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("input",{type:"text",value:_,onChange:s=>i(s.target.value),placeholder:"Search songs or artists…",style:{flex:1}}),e.jsxs("select",{value:d,onChange:s=>b(s.target.value),children:[e.jsx("option",{value:"",children:"All Difficulties"}),n.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsx("div",{className:"nice-karaoke-picker__catalog",children:C.length===0?e.jsx("p",{children:"No songs match your search."}):C.map(s=>e.jsxs("div",{className:"nice-karaoke-picker__song",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #eee"},children:[e.jsxs("div",{children:[e.jsx("strong",{children:s.title})," — ",s.artist,s.difficulty&&e.jsxs("span",{style:{marginLeft:8,fontSize:12,color:r(s.difficulty),fontWeight:600},children:["[",s.difficulty,"]"]}),s.hasLyrics&&e.jsx("span",{style:{marginLeft:6,fontSize:12},title:"Lyrics available",children:"📝"}),s.language&&e.jsxs("span",{style:{marginLeft:6,fontSize:12,color:"#666"},children:["(",s.language,")"]})]}),!y&&e.jsx("div",{children:u.has(s.id)?e.jsx("button",{onClick:()=>m==null?void 0:m(s.id),style:{color:"#f44336"},children:"Remove"}):e.jsx("button",{onClick:()=>h==null?void 0:h(s.id),children:"🎤 Sing"})})]},s.id))}),p.length>0&&e.jsxs("div",{className:"nice-karaoke-picker__queue",style:{marginTop:16},children:[e.jsxs("h4",{children:["🎶 Queue (",p.length,")"]}),p.map((s,w)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0"},children:[e.jsxs("span",{children:[e.jsxs("strong",{children:[w+1,"."]})," ",s.title," — ",s.artist,s.performerName&&e.jsxs("em",{children:[" (",s.performerName,")"]})]}),!y&&m&&e.jsx("button",{onClick:()=>m(s.id),style:{fontSize:12},children:"✕"})]},s.id))]})]})}),ae={game:N.NtdGamepad,music:N.NtdMusic,dance:N.NtdMusic,quiz:N.NtdHelp,karaoke:N.NtdMicrophone,photo:N.NtdCamera,custom:N.NtdSparkle},He={game:"Games",music:"Music",dance:"Dance",quiz:"Quiz",karaoke:"Karaoke",photo:"Photo",custom:"Custom"},Ke=a.forwardRef(function(f,k){const{attractions:t,onSelect:p,onDeselect:h,onVote:m,selectedIds:x=[],maxSelections:v,showVotes:y=!0,readOnly:g=!1,layout:S="grid",className:_,style:i}=f,[d,b]=a.useState(""),[j,C]=a.useState(""),u=a.useMemo(()=>new Set(x),[x]),n=a.useMemo(()=>{const l=new Set(t.map(z=>z.category));return Array.from(l)},[t]),r=a.useMemo(()=>{let l=t;if(d&&(l=l.filter(z=>z.category===d)),j.trim()){const z=j.toLowerCase();l=l.filter(T=>{var M;return T.name.toLowerCase().includes(z)||((M=T.description)==null?void 0:M.toLowerCase().includes(z))})}return l},[t,d,j]),s=!v||u.size<v,w=l=>{g||(u.has(l)?h==null||h(l):s&&(p==null||p(l)))};return e.jsxs("div",{ref:k,className:`nice-attraction-picker ${_??""}`,style:{color:"var(--text-primary)",...i},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h3",{style:{margin:0},children:"Attractions"}),v&&e.jsxs("span",{style:{color:"var(--text-secondary, #64748b)",fontSize:14},children:[u.size,"/",v," selected"]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap"},children:[e.jsx("input",{type:"text",value:j,onChange:l=>C(l.target.value),placeholder:"Search attractions…",style:{flex:1,minWidth:150}}),e.jsx("button",{onClick:()=>b(""),style:{fontWeight:d?400:700},children:"All"}),n.map(l=>e.jsxs("button",{onClick:()=>b(l===d?"":l),style:{fontWeight:l===d?700:400,display:"inline-flex",alignItems:"center",gap:4},children:[a.createElement(ae[l],{size:14})," ",He[l]]},l))]}),e.jsx("div",{style:{display:S==="grid"?"grid":"flex",gridTemplateColumns:S==="grid"?"repeat(auto-fill, minmax(200px, 1fr))":void 0,gap:12,flexDirection:S==="list"?"column":void 0},children:r.length===0?e.jsx("p",{children:"No attractions found."}):r.map(l=>{const z=u.has(l.id);return e.jsxs("div",{className:"nice-attraction-picker__card",style:{border:z?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",borderRadius:8,padding:12,cursor:g?"default":"pointer",background:z?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",transition:"all 0.2s"},onClick:()=>w(l.id),children:[l.imageUrl&&e.jsx("img",{src:l.imageUrl,alt:l.name,style:{width:"100%",borderRadius:6,marginBottom:8,objectFit:"cover",maxHeight:120}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{display:"inline-flex"},children:a.createElement(ae[l.category],{size:16})}),e.jsx("strong",{children:l.name})]}),l.description&&e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",margin:"6px 0"},children:l.description}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:8},children:[y&&e.jsxs("span",{style:{fontSize:13,display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(N.NtdThumbsUp,{size:14})," ",l.votes??0]}),!g&&m&&e.jsx("button",{onClick:T=>{T.stopPropagation(),m(l.id)},style:{fontSize:12},children:"Vote"})]})]},l.id)})})]})}),Ye={game:N.NtdGamepad,music:N.NtdMusic,dance:N.NtdMusic,quiz:N.NtdHelp,karaoke:N.NtdMicrophone,photo:N.NtdCamera,custom:N.NtdSparkle},Je=a.forwardRef(function(f,k){const{attractions:t,onVote:p,onUnvote:h,votedIds:m=[],maxVotes:x,closed:v=!1,sortBy:y="votes",showResults:g=!0,className:S,style:_}=f,i=a.useMemo(()=>new Set(m),[m]),d=x?x-i.size:void 0,b=a.useMemo(()=>{const n=[...t];switch(y){case"votes":n.sort((r,s)=>(s.votes??0)-(r.votes??0));break;case"name":n.sort((r,s)=>r.name.localeCompare(s.name));break;case"category":n.sort((r,s)=>r.category.localeCompare(s.category));break}return n},[t,y]),j=a.useMemo(()=>Math.max(...t.map(n=>n.votes??0),1),[t]),C=n=>{v||(i.has(n)?h==null||h(n):(!d||d>0)&&(p==null||p(n)))},u=n=>{switch(n){case 0:return e.jsx(N.NtdTrophy,{size:18,primaryColor:"#f59e0b",title:"1st place"});case 1:return e.jsx(N.NtdMedal,{size:18,primaryColor:"#94a3b8",title:"2nd place"});case 2:return e.jsx(N.NtdMedal,{size:18,primaryColor:"#b45309",title:"3rd place"});default:return`${n+1}.`}};return e.jsxs("div",{ref:k,className:`nice-attraction-voting ${S??""}`,style:{color:"var(--text-primary)",..._},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[e.jsxs("h3",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(N.NtdClipboardCheck,{size:20}),v?"Voting Results":"Vote for Attractions"]}),!v&&d!==void 0&&e.jsxs("span",{style:{fontSize:14,color:d>0?"var(--color-primary, #6366f1)":"var(--color-error, #ef4444)"},children:[d," vote",d!==1?"s":""," remaining"]})]}),v&&e.jsx("p",{style:{color:"var(--text-secondary, #64748b)",marginBottom:12},children:"Voting is closed. Final results:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:b.map((n,r)=>{const s=i.has(n.id),w=n.votes??0,l=g?`${Math.round(w/j*100)}%`:"0%";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:8,border:s?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",background:s?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",cursor:v?"default":"pointer",transition:"all 0.2s"},onClick:()=>C(n.id),children:[g&&e.jsx("span",{style:{fontSize:18,minWidth:32,textAlign:"center"},children:u(r)}),e.jsx("span",{style:{display:"inline-flex",fontSize:20},children:a.createElement(Ye[n.category],{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:600},children:n.name}),n.description&&e.jsx("div",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.description}),g&&e.jsx("div",{style:{marginTop:4,height:6,borderRadius:3,background:"var(--bg-tertiary, #e2e8f0)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:l,background:"var(--color-primary, #6366f1)",borderRadius:3,transition:"width 0.3s"}})})]}),g&&e.jsx("span",{style:{fontWeight:600,fontSize:16,minWidth:40,textAlign:"right"},children:w}),!v&&e.jsx("button",{onClick:z=>{z.stopPropagation(),C(n.id)},style:{padding:"4px 12px",borderRadius:4,border:"none",background:s?"var(--color-error, #ef4444)":"var(--color-primary, #6366f1)",color:"#fff",cursor:"pointer",fontSize:13},children:s?"Unvote":"Vote"})]},n.id)})}),g&&e.jsxs("div",{style:{marginTop:12,textAlign:"right",fontSize:13,color:"var(--text-secondary, #64748b)"},children:["Total votes: ",t.reduce((n,r)=>n+(r.votes??0),0)]})]})});exports.NiceAttractionPicker=Ke;exports.NiceAttractionVoting=Je;exports.NiceEventMedia=$e;exports.NiceEventPlanning=De;exports.NiceKaraokePicker=Ge;exports.NiceRoundCard=Fe;exports.NiceRoundList=We;exports.NiceSongPicker=Qe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),B=require("@nice2dev/icons"),f=require("@nice2dev/ui"),o=require("react"),Z=require("@nice2dev/ui-core");function An(i){return i.map((s,a)=>({item:s,index:a,key:s.order??a})).sort((s,a)=>s.key-a.key||s.index-a.index).map(s=>s.item)}function Ve(i,s,a){if(s===a)return[...i];if(s<0||s>=i.length)return[...i];if(a<0||a>=i.length)return[...i];const n=[...i],[r]=n.splice(s,1);return n.splice(a,0,r),n}function Je(i){const{items:s,onReorder:a,disabled:n=!1}=i,[r,l]=o.useState(null),[d,m]=o.useState(null),[h,t]=o.useState(!1),u=o.useRef(null),p=o.useCallback(b=>s.findIndex(k=>k.id===b),[s]),_=o.useCallback((b,k)=>{const j=p(b),M=p(k);j<0||M<0||j===M||a==null||a(Ve([...s],j,M).map(c=>c.id))},[s,p,a]),g=o.useCallback(()=>{l(null),m(null),t(!1),u.current=null},[]),x=o.useCallback((b,k)=>({role:"button",draggable:!1,tabIndex:n?-1:0,"aria-grabbed":r===b,onPointerDown:j=>{var N,v;if(n||j.button!==0&&j.pointerType==="mouse")return;(v=(N=j.currentTarget).setPointerCapture)==null||v.call(N,j.pointerId),l(b),t(!0),u.current=s.map(T=>T.id);const M=()=>{window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",c),t(!1),l(null),m(null)},c=()=>{window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",c),u.current&&(a==null||a(u.current)),g()};window.addEventListener("pointerup",M),window.addEventListener("pointercancel",c)},onPointerEnter:()=>{n||!r||r===b||(m(b),_(r,b))},onKeyDown:j=>{if(n)return;if(j.key===" "||j.key==="Enter"){j.preventDefault(),r===b?g():(l(b),u.current=s.map(T=>T.id));return}if(j.key==="Escape"&&r===b){j.preventDefault(),u.current&&(a==null||a(u.current)),g();return}if(r!==b)return;const c=j.key==="ArrowLeft"||j.key==="ArrowUp"?-1:j.key==="ArrowRight"||j.key==="ArrowDown"?1:0;if(c===0)return;j.preventDefault();const N=p(b),v=N+c;v<0||v>=s.length||a==null||a(Ve([...s],N,v).map(T=>T.id))},...k?{"aria-label":k}:{}}),[r,_,n,g,p,s,a]);return{activeId:r,overId:d,getHandleProps:x,dragging:h}}const $n=({item:i})=>{const[s,a]=o.useState(!1),n=i.thumbnailUrl??i.url;return i.type==="video"?e.jsx("div",{className:"nice-event-media__video-thumb",children:e.jsx(B.NtdPlay,{size:26})}):s||!n?e.jsx("div",{className:"nice-event-media__broken",title:"Image unavailable",children:e.jsx(B.NtdImage,{size:24})}):e.jsx("img",{src:n,alt:i.caption??"",className:"nice-event-media__thumb",loading:"lazy",onError:()=>a(!0)})},Pn=o.forwardRef(function(s,a){const{items:n,onUpload:r,onDelete:l,onLike:d,onItemClick:m,layout:h="grid",uploadEnabled:t=!0,typeFilter:u="all",onReorder:p,className:_,style:g}=s,[x,b]=o.useState(""),k=o.useMemo(()=>An(n),[n]),j=o.useMemo(()=>u==="all"?k:k.filter(T=>T.type===u),[k,u]),M=!!p&&u==="all",c=Je({items:k,onReorder:p,disabled:!M}),N=T=>{const S=T[0];!S||!r||(r(S,x.trim()||void 0),b(""))},v=h==="list";return e.jsxs("div",{ref:a,className:`nice-event-media nice-event-media--${h} ${_??""}`,style:g,children:[e.jsx("div",{className:"nice-event-media__header",children:e.jsxs("h3",{children:["Media (",j.length,")"]})}),t&&r&&e.jsxs("div",{className:"nice-event-media__upload",children:[e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!1,imagePreview:!1,onFilesSelected:N}),e.jsx(f.NiceTextInput,{value:x,onChange:b,placeholder:"Add a caption…"})]}),j.length===0?e.jsx("p",{className:"nice-event-media__empty",children:"No media yet."}):e.jsx(f.NiceCardGroup,{columns:v?1:void 0,minColumnWidth:200,gap:12,align:"stretch",children:j.map((T,S)=>{const R=M?c.getHandleProps(T.id,`Move ${T.caption??`item ${S+1}`}`):null;return e.jsxs("div",{className:`nice-event-media__card${v?" nice-event-media__card--row":""}${c.activeId===T.id?" nice-event-media__card--dragging":""}`,onClick:()=>m==null?void 0:m(T),onPointerEnter:R==null?void 0:R.onPointerEnter,role:m?"button":void 0,tabIndex:m?0:void 0,children:[R&&e.jsx("span",{className:"nice-event-media__grip",role:R.role,tabIndex:R.tabIndex,"aria-grabbed":R["aria-grabbed"],"aria-label":R["aria-label"],draggable:R.draggable,onPointerDown:R.onPointerDown,onKeyDown:R.onKeyDown,onClick:y=>y.stopPropagation(),children:e.jsx(B.NtdMove,{size:14})}),e.jsx($n,{item:T}),e.jsxs("div",{className:"nice-event-media__body",children:[T.caption&&e.jsx("span",{className:"nice-event-media__caption",children:T.caption}),T.uploadedByName&&e.jsx("span",{className:"nice-event-media__uploader",children:T.uploadedByName}),e.jsxs("div",{className:"nice-event-media__actions",children:[d&&e.jsxs("button",{type:"button",className:"nice-event-media__action",onClick:y=>{y.stopPropagation(),d(T.id)},"aria-label":"Like",children:[e.jsx(B.NtdHeart,{size:15})," ",T.likes??0]}),l&&e.jsx("button",{type:"button",className:"nice-event-media__action nice-event-media__action--danger",onClick:y=>{y.stopPropagation(),l(T.id)},"aria-label":"Delete",children:e.jsx(B.NtdTrash,{size:15})})]})]})]},T.id)})})]})}),me=({title:i,description:s,icon:a,action:n,className:r})=>e.jsx(f.NiceEmpty,{size:"sm",title:i,description:s,icon:a,action:n,className:r}),Bn=o.forwardRef(function(s,a){const{items:n,layout:r="grid",onReorder:l,onItemAdd:d,onItemRemove:m,onCaptionChange:h,onItemClick:t,previewMode:u=!1,transition:p="fade",defaultDurationMs:_=3e3,autoPlay:g=!0,disabled:x=!1,readOnly:b=!1,size:k="md",className:j,style:M}=s,[c,N]=o.useState(0),[v,T]=o.useState(null),[S,R]=o.useState(""),y=x||b,E=!!l&&!y,X=Je({items:n,onReorder:l,disabled:!E}),D=n.length>0?Math.min(c,n.length-1):0,I=n[D],L=(I==null?void 0:I.durationMs)??_;o.useEffect(()=>{if(!u||!g||n.length<2)return;const P=window.setTimeout(()=>N(q=>(q+1)%n.length),Math.max(250,L));return()=>window.clearTimeout(P)},[u,g,n.length,D,L]);const z=o.useMemo(()=>n.reduce((P,q)=>P+(q.durationMs??_),0),[n,_]),A=P=>{h==null||h(P,S),T(null),R("")};return n.length===0?e.jsx("div",{ref:a,className:`nice-media-collage ${j??""}`,style:M,children:e.jsx(me,{icon:e.jsx(B.NtdImage,{size:28}),title:"Nothing in the collage yet",description:"Add photos or video to start arranging them.",action:d&&!y?e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!0,onFilesSelected:d}):void 0})}):u?e.jsxs("div",{ref:a,className:`nice-media-collage nice-media-collage--preview nice-media-collage--${p} ${j??""}`,style:M,children:[e.jsxs("div",{className:"nice-media-collage__stage","aria-live":"polite",children:[(I==null?void 0:I.type)==="video"?e.jsx("video",{className:"nice-media-collage__slide",src:I.mediaUrl,controls:!0},I.id):e.jsx("img",{className:"nice-media-collage__slide",src:I==null?void 0:I.mediaUrl,alt:(I==null?void 0:I.caption)??""},I==null?void 0:I.id),(I==null?void 0:I.caption)&&e.jsx("p",{className:"nice-media-collage__slide-caption",children:I.caption})]}),e.jsxs("div",{className:"nice-media-collage__playbar",children:[e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:()=>N(P=>(P-1+n.length)%n.length),children:"Previous"}),e.jsxs("span",{className:"nice-media-collage__counter",children:[D+1," / ",n.length]}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:()=>N(P=>(P+1)%n.length),children:"Next"})]})]}):e.jsxs("div",{ref:a,className:`nice-media-collage nice-media-collage--${r} nice-media-collage--${k} ${j??""}`,style:M,children:[e.jsxs("div",{className:"nice-media-collage__toolbar",children:[e.jsx(f.NiceSegmentedControl,{size:"sm",value:r,readOnly:!0,options:[{value:"sequence",label:"Sequence"},{value:"grid",label:"Grid"},{value:"mosaic",label:"Mosaic"}]}),e.jsxs("span",{className:"nice-media-collage__duration",children:[n.length," item",n.length===1?"":"s"," · ",Math.round(z/1e3),"s"]}),d&&!y&&e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!0,imagePreview:!1,onFilesSelected:d})]}),e.jsx("ol",{className:"nice-media-collage__tiles","aria-label":"Collage order","aria-busy":X.dragging,children:n.map((P,q)=>{const F=E?X.getHandleProps(P.id,`Move ${P.caption??`item ${q+1}`}`):null;return e.jsxs("li",{className:`nice-media-collage__tile${X.activeId===P.id?" nice-media-collage__tile--active":""}${X.overId===P.id?" nice-media-collage__tile--over":""}`,onPointerEnter:F==null?void 0:F.onPointerEnter,children:[e.jsx("span",{className:"nice-media-collage__index","aria-hidden":"true",children:q+1}),e.jsx("button",{type:"button",className:"nice-media-collage__thumb-button",onClick:()=>t==null?void 0:t(P),disabled:!t,children:P.type==="video"?e.jsx("span",{className:"nice-media-collage__video-thumb",children:e.jsx(B.NtdPlay,{size:22})}):e.jsx("img",{className:"nice-media-collage__thumb",src:P.mediaUrl,alt:P.caption??"",loading:"lazy"})}),v===P.id?e.jsx(f.NiceTextInput,{value:S,onChange:R,placeholder:"Caption",autoFocus:!0,size:"sm",onBlur:()=>A(P.id),onKeyDown:C=>{C.key==="Enter"&&A(P.id),C.key==="Escape"&&T(null)}}):e.jsx("button",{type:"button",className:"nice-media-collage__caption",disabled:!h||y,onClick:()=>{T(P.id),R(P.caption??"")},children:P.caption||e.jsx("em",{children:"Add a caption"})}),e.jsxs("div",{className:"nice-media-collage__tile-actions",children:[F&&e.jsx("span",{className:"nice-media-collage__grip",role:F.role,tabIndex:F.tabIndex,"aria-grabbed":F["aria-grabbed"],"aria-label":F["aria-label"],draggable:F.draggable,onPointerDown:F.onPointerDown,onKeyDown:F.onKeyDown,children:e.jsx(B.NtdMove,{size:14})}),m&&!b&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Remove ${P.caption??`item ${q+1}`}`,disabled:x,onClick:()=>m(P.id),children:e.jsx(B.NtdTrash,{size:14})})]})]},P.id)})}),d&&!y&&n.length>0&&e.jsxs("p",{className:"nice-media-collage__hint",children:[e.jsx(B.NtdPlus,{size:12})," Drag a tile, or focus one and press Space then the arrow keys."]})]})});function Ie(i){const s=i.toLowerCase();return["active","live","published","completed","confirmed"].includes(s)?"success":["cancelled","canceled","rejected","failed"].includes(s)?"error":["scheduled","pending","planning"].includes(s)?"info":["draft","archived"].includes(s)?"secondary":"warning"}const Rn={micro:[],compact:["details","location","budget"],normal:["details","location","schedule","participants","tasks","surveys","budget"],full:["details","location","schedule","participants","tasks","surveys","vendors","budget","documents","settings"]},En=o.forwardRef(function(s,a){var Le,Oe,Ue,Ye,Xe,Fe;const{event:n,participants:r=[],surveys:l=[],billing:d=[],scheduleItems:m=[],tasks:h=[],vendors:t=[],documents:u=[],displayMode:p="normal",tabs:_,activeTab:g,onTabChange:x,tabsIconOnly:b=!0,tabsCentered:k="auto",countLocation:j="bottom",showDetails:M=!0,showLocation:c=!0,showSchedule:N=!0,showParticipants:v=!0,showTasks:T=!0,showSurveys:S=!0,showVendors:R=!0,showBudget:y=!0,showDocuments:E=!0,showSettings:X=!0,editable:D=!1,onSave:I,onPublish:L,onShare:z,onExport:A,onUpdateEvent:P,onUpdateLocation:q,onAddSurvey:F,onSurveyRespond:C,onAddBilling:Y,className:V,style:K}=s,[O,Q]=o.useState(n.title),[G,he]=o.useState(n.description??""),[se,re]=o.useState(n.startDate??""),[pe,ke]=o.useState(n.endDate??""),[xe,le]=o.useState(((Le=n.location)==null?void 0:Le.name)??""),[ge,Te]=o.useState(((Oe=n.location)==null?void 0:Oe.address)??""),[oe,ie]=o.useState(((Ue=n.location)==null?void 0:Ue.virtualUrl)??""),[ne,Ne]=o.useState(((Ye=n.location)==null?void 0:Ye.isVirtual)??!1),[de,je]=o.useState(""),[ue,Ae]=o.useState("single"),[ye,_e]=o.useState(""),[ae,be]=o.useState(""),[fe,$]=o.useState(""),[U,W]=o.useState("PLN"),H={details:M,location:c,schedule:N,participants:v,tasks:T,surveys:S,vendors:R,budget:y,documents:E,settings:X},ce=(_??Rn[p]).filter(w=>H[w]!==!1),[Se,cn]=o.useState(ce[0]??"details"),rn=g??Se,ln=o.useCallback(w=>{const te=w;g===void 0&&cn(te),x==null||x(te)},[g,x]),on=o.useCallback(()=>{P==null||P({title:O,description:G||void 0,startDate:se||void 0,endDate:pe||void 0})},[O,G,se,pe,P]),dn=o.useCallback(()=>{q==null||q({name:xe,address:ge||void 0,virtualUrl:oe||void 0,isVirtual:ne})},[xe,ge,oe,ne,q]),un=o.useCallback(()=>{if(!de.trim()||!F)return;const w=ye.split(",").map(te=>te.trim()).filter(Boolean);F(de.trim(),ue,w.length>0?w:void 0),je(""),_e("")},[de,ue,ye,F]),mn=o.useCallback(()=>{!ae.trim()||!Y||(Y({label:ae.trim(),amount:parseFloat(fe)||0,currency:U}),be(""),$(""))},[ae,fe,U,Y]),hn=o.useMemo(()=>d.map(w=>({label:w.label,amount:w.amount})),[d]),pn=o.useMemo(()=>d.reduce((w,te)=>w+te.amount,0),[d]),xn=((Xe=d[0])==null?void 0:Xe.currency)??"PLN",gn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceTextInput,{label:"Title",value:O,onChange:Q,readOnly:!D}),e.jsx(f.NiceTextArea,{label:"Description",value:G,onChange:he,readOnly:!D,rows:3}),e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"Start"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:se,onChange:w=>re(w.target.value),readOnly:!D})]}),e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"End"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:pe,onChange:w=>ke(w.target.value),readOnly:!D})]})]}),D&&e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:on,children:"Save details"})]}),fn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceToggle,{label:"Virtual event",checked:ne,onChange:Ne,disabled:!D}),e.jsx(f.NiceTextInput,{label:"Venue name",value:xe,onChange:le,readOnly:!D}),ne?e.jsx(f.NiceTextInput,{label:"Virtual URL",value:oe,onChange:ie,readOnly:!D}):e.jsx(f.NiceTextInput,{label:"Address",value:ge,onChange:Te,readOnly:!D}),D&&e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:dn,children:"Save location"})]}),vn=e.jsx("div",{className:"nice-event-planning__participants",children:r.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No participants yet."}):e.jsxs(e.Fragment,{children:[e.jsx(f.NiceAvatarGroup,{max:8,children:r.map(w=>e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl},w.id))}),e.jsx("ul",{className:"nice-event-planning__participant-list",children:r.map(w=>e.jsxs("li",{className:"nice-event-planning__participant",children:[e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl,size:"sm"}),e.jsx("span",{className:"nice-event-planning__participant-name",children:w.name}),e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Ie(w.status),children:w.status})]},w.id))})]})}),Nn=e.jsxs("div",{className:"nice-event-planning__form",children:[l.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No surveys yet."}):l.map(w=>e.jsxs("div",{className:"nice-event-planning__survey",children:[e.jsx("strong",{children:w.question})," ",e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"info",children:w.type}),w.options&&e.jsx("div",{className:"nice-event-planning__survey-options",children:w.options.map((te,Tn)=>e.jsx(f.NiceButton,{size:"sm",variant:"outline",onClick:()=>C==null?void 0:C(w.id,te),children:te},Tn))}),w.responses&&e.jsxs("span",{className:"nice-event-planning__muted",children:[w.responses.length," responses"]})]},w.id)),D&&F&&e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceTextInput,{label:"New survey question",value:de,onChange:je,placeholder:"Question"}),e.jsx(f.NiceSelect,{label:"Type",value:ue,onChange:w=>Ae(w),options:[{value:"single",label:"Single choice"},{value:"multiple",label:"Multiple choice"},{value:"text",label:"Free text"},{value:"rating",label:"Rating"}]}),e.jsx(f.NiceTextInput,{label:"Options (comma-separated)",value:ye,onChange:_e,placeholder:"Yes, No, Maybe"}),e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"plus",size:"sm"}),onClick:un,disabled:!de.trim(),children:"Add survey"})]})]}),jn=e.jsxs("div",{className:"nice-event-planning__form",children:[d.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No billing items yet."}):e.jsx(f.NiceAmountBreakdown,{lines:[...hn,{label:"Total",amount:pn,isSummary:!0}],currency:xn}),D&&Y&&e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsx(f.NiceTextInput,{label:"Item",value:ae,onChange:be,placeholder:"Catering"}),e.jsx(f.NiceTextInput,{label:"Amount",value:fe,onChange:$,placeholder:"0.00"}),e.jsx(f.NiceSelect,{label:"Currency",value:U,onChange:w=>W(w),options:["PLN","EUR","USD","GBP"]}),e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"plus",size:"sm"}),onClick:mn,disabled:!ae.trim(),children:"Add"})]})]}),yn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceToggle,{label:"Public event",checked:n.isPublic??!1,disabled:!D}),e.jsx(f.NiceTextInput,{label:"Max participants",value:n.maxParticipants!=null?String(n.maxParticipants):"",onChange:()=>{},readOnly:!D}),e.jsxs("div",{className:"nice-event-planning__muted",children:["Host: ",n.hostName," · Created ",new Date(n.createdAt).toLocaleDateString()]})]}),_n=e.jsx("div",{className:"nice-event-planning__list",children:m.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No agenda items yet."}):e.jsx("ul",{className:"nice-event-planning__schedule",children:m.map(w=>e.jsxs("li",{className:"nice-event-planning__schedule-item",children:[e.jsxs("span",{className:"nice-event-planning__schedule-time",children:[e.jsx(Z.NiceIcon,{name:"clock",size:"sm"}),w.startTime??"",w.endTime?`–${w.endTime}`:""]}),e.jsx("span",{className:"nice-event-planning__schedule-title",children:w.title}),w.location&&e.jsx("span",{className:"nice-event-planning__muted",children:w.location})]},w.id))})}),bn=e.jsx("div",{className:"nice-event-planning__list",children:h.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No tasks yet."}):e.jsx("ul",{className:"nice-event-planning__tasks",children:h.map(w=>e.jsxs("li",{className:"nice-event-planning__task",children:[e.jsx(f.NiceToggle,{label:w.title,checked:w.done??!1,disabled:!D}),w.assigneeName&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"info",children:w.assigneeName}),w.dueDate&&e.jsx("span",{className:"nice-event-planning__muted",children:w.dueDate})]},w.id))})}),wn=e.jsx("div",{className:"nice-event-planning__list",children:t.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No vendors yet."}):e.jsx("ul",{className:"nice-event-planning__vendors",children:t.map(w=>e.jsxs("li",{className:"nice-event-planning__vendor",children:[e.jsx(Z.NiceIcon,{name:"briefcase",size:"sm"}),e.jsx("span",{className:"nice-event-planning__vendor-name",children:w.name}),w.category&&e.jsx("span",{className:"nice-event-planning__muted",children:w.category}),w.status&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Ie(w.status),children:w.status}),w.cost!=null&&e.jsxs("span",{className:"nice-event-planning__vendor-cost",children:[w.cost," ",w.currency??""]})]},w.id))})}),kn=e.jsx("div",{className:"nice-event-planning__list",children:u.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No documents yet."}):e.jsx("ul",{className:"nice-event-planning__documents",children:u.map(w=>e.jsxs("li",{className:"nice-event-planning__document",children:[e.jsx(Z.NiceIcon,{name:"file",size:"sm"}),e.jsx("span",{className:"nice-event-planning__document-name",children:w.name}),w.fileType&&e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"secondary",children:w.fileType}),w.sizeKb!=null&&e.jsxs("span",{className:"nice-event-planning__muted",children:[w.sizeKb," KB"]})]},w.id))})}),Sn={details:gn,location:fn,schedule:_n,participants:vn,tasks:bn,surveys:Nn,vendors:wn,budget:jn,documents:kn,settings:yn},In={details:"file",location:"home",schedule:"clock",participants:"users",tasks:"list",surveys:"clipboard",vendors:"briefcase",budget:"dollar",documents:"folder",settings:"settings"},Cn={schedule:m.length||void 0,participants:r.length||void 0,tasks:h.length||void 0,surveys:l.length||void 0,vendors:t.length||void 0,budget:d.length||void 0,documents:u.length||void 0},zn=ce.map(w=>({id:w,label:w.charAt(0).toUpperCase()+w.slice(1),icon:e.jsx(Z.NiceIcon,{name:In[w],size:"sm"}),badge:Cn[w],content:Sn[w]})),Mn=e.jsxs("div",{className:"nice-event-planning__toolbar",children:[e.jsxs("div",{className:"nice-event-planning__toolbar-title",children:[e.jsx(Z.NiceIcon,{name:"calendar",size:"md"}),e.jsx("span",{className:"nice-event-planning__title",children:n.title}),e.jsx(f.NiceBadge,{size:"sm",variant:Ie(n.status),children:n.status})]}),e.jsx("span",{className:"nice-event-planning__toolbar-spacer"}),e.jsxs("div",{className:"nice-event-planning__toolbar-actions",children:[I&&e.jsx(f.NiceButton,{size:"sm",variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:()=>I({title:O,description:G}),children:"Save"}),L&&e.jsx(f.NiceButton,{size:"sm",variant:"success",leftIcon:e.jsx(Z.NiceIcon,{name:"upload",size:"sm"}),onClick:L,children:"Publish"}),z&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(Z.NiceIcon,{name:"link",size:"sm"}),onClick:z,children:"Share"}),A&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(Z.NiceIcon,{name:"download",size:"sm"}),onClick:A,children:"Export"})]})]});return p==="micro"?e.jsx("div",{ref:a,className:`nice-event-planning nice-event-planning--micro ${V??""}`,style:K,children:e.jsxs("div",{className:"nice-event-planning__micro",children:[e.jsx(Z.NiceIcon,{name:"calendar",size:"md"}),e.jsxs("div",{className:"nice-event-planning__micro-body",children:[e.jsx("span",{className:"nice-event-planning__title",children:n.title}),e.jsxs("span",{className:"nice-event-planning__muted",children:[n.startDate?new Date(n.startDate).toLocaleString():"No date",(Fe=n.location)!=null&&Fe.name?` · ${n.location.name}`:""]})]}),e.jsx(f.NiceBadge,{size:"sm",variant:Ie(n.status),children:n.status}),r.length>0&&e.jsx(f.NiceAvatarGroup,{max:4,size:"sm",children:r.map(w=>e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl,size:"sm"},w.id))})]})}):e.jsxs("div",{ref:a,className:`nice-event-planning nice-event-planning--${p} ${V??""}`,style:K,children:[Mn,e.jsx(f.NiceTabs,{tabs:zn,activeTab:rn,onChange:ln,iconOnly:b,centered:k,countLocation:j})]})});function Dn(i){switch(i){case"confirmed":return"success";case"checked-in":return"info";case"declined":return"error";case"no-show":return"warning";default:return"secondary"}}const $e=({participant:i,showRole:s=!0,showStatus:a=!0,meta:n,children:r,size:l="md",className:d})=>e.jsxs("li",{className:`nice-participant-row nice-participant-row--${l} ${d??""}`,children:[e.jsx(f.NiceAvatar,{name:i.name,src:i.avatarUrl,size:l}),e.jsx("span",{className:"nice-participant-row__name",children:i.name}),s&&i.role&&e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"info",children:i.role}),a&&i.status&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Dn(i.status),children:i.status}),n&&e.jsx("span",{className:"nice-participant-row__meta",children:n}),r&&e.jsx("span",{className:"nice-participant-row__trailing",children:r})]}),Ln=/^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/,qe=/^.*<\s*([^<>\s]+)\s*>$/;function en(i){var l,d;const s=[],a=[],n=new Set;let r=0;if(!i)return{valid:s,invalid:a,duplicates:r};for(const m of i.split(/[,;\r\n\t]+/)){const h=m.trim();if(!h)continue;const t=((d=(l=qe.exec(h))==null?void 0:l[1])==null?void 0:d.trim())??h,u=qe.test(h)?[t]:t.split(/\s+/);for(const p of u){if(!p)continue;if(!Ln.test(p)){a.push(p);continue}const _=p.toLowerCase();if(n.has(_)){r+=1;continue}n.add(_),s.push(p)}}return{valid:s,invalid:a,duplicates:r}}function On(i,s){const a=new Set(i.map(r=>r.toLowerCase())),n=[...i];for(const r of s){const l=r.toLowerCase();a.has(l)||(a.add(l),n.push(r))}return n}function nn(i={}){const{currentUserId:s,currentUserName:a,requireIdentity:n=!0}=i,[r,l]=o.useState(""),d=!s,m=a??r,h=!n||m.trim().length>0;return{isAnonymous:d,name:m,setName:l,canAct:h,actor:{userId:s,userName:m.trim()}}}const Un=[{answer:"yes",label:"Yes",variant:"success",Icon:B.NtdCheck},{answer:"maybe",label:"Maybe",variant:"warning",Icon:B.NtdHelp},{answer:"no",label:"No",variant:"error",Icon:B.NtdClose}],Pe=o.forwardRef(function(s,a){const{value:n,onRespond:r,allowPlusOnes:l=!1,maxPlusOnes:d=5,plusOnes:m=0,allowNote:h=!1,currentUserId:t,currentUserName:u,compact:p=!1,disabled:_=!1,readOnly:g=!1,size:x="md",className:b,style:k}=s,j=nn({currentUserId:t,currentUserName:u}),[M,c]=o.useState(m),[N,v]=o.useState(""),T=!p&&j.isAnonymous&&!j.canAct,S=_||g,R=y=>{S||!r||r({answer:y,plusOnes:l&&y!=="no"?M:void 0,note:h&&N.trim()?N.trim():void 0,userId:j.actor.userId,userName:j.actor.userName||void 0})};return e.jsxs("div",{ref:a,className:`nice-rsvp-control nice-rsvp-control--${x}${p?" nice-rsvp-control--compact":""} ${b??""}`,style:k,children:[!p&&j.isAnonymous&&e.jsx(f.NiceTextInput,{label:"Your name",value:j.name,onChange:j.setName,placeholder:"Who is replying?",required:!0,disabled:S,size:x}),e.jsx("div",{className:"nice-rsvp-control__answers",role:"group","aria-label":"Your reply",children:Un.map(({answer:y,label:E,variant:X,Icon:D})=>e.jsx(f.NiceButton,{size:x,variant:n===y?X:"outline",leftIcon:e.jsx(D,{size:16}),disabled:S||T,"aria-pressed":n===y,onClick:()=>R(y),children:E},y))}),!p&&l&&n!=="no"&&e.jsxs("label",{className:"nice-rsvp-control__field",children:[e.jsx("span",{className:"nice-rsvp-control__field-label",children:"Additional guests"}),e.jsx(f.NiceNumericInput,{value:M,onChange:y=>c(Math.max(0,Math.min(d,y??0))),min:0,max:d,step:1,size:"xs",disabled:S})]}),!p&&h&&e.jsx(f.NiceTextInput,{label:"Note",value:N,onChange:v,placeholder:"Anything we should know?",disabled:S,size:x}),T&&e.jsx("p",{className:"nice-rsvp-control__hint",children:"Enter your name to reply."})]})}),Yn={yes:"confirmed",maybe:"invited",no:"declined"},We={confirmed:"yes","checked-in":"yes",declined:"no"},Ce=["confirmed","checked-in","invited","declined","no-show"],Xn=o.forwardRef(function(s,a){const{participants:n,mode:r="organizer",currentUserId:l,currentUserName:d,onRsvpChange:m,onCheckIn:h,onScan:t,checkInSlot:u,onInvite:p,extraFields:_,groupBy:g="none",showSummary:x=!0,showSearch:b=!0,allowPlusOnes:k=!1,disabled:j=!1,readOnly:M=!1,size:c="md",className:N,style:v}=s,[T,S]=o.useState(""),[R,y]=o.useState("all"),[E,X]=o.useState(""),D=j||M,I=r==="guest",L=o.useMemo(()=>{const C={total:n.length};for(const Y of Ce)C[Y]=0;for(const Y of n)C[Y.status]=(C[Y.status]??0)+1;return C},[n]),z=o.useMemo(()=>{if(I)return n.filter(Y=>Y.userId===l||Y.id===l);const C=T.trim().toLowerCase();return n.filter(Y=>R!=="all"&&Y.status!==R?!1:!C||Y.name.toLowerCase().includes(C))},[n,I,l,T,R]),A=o.useMemo(()=>{if(g==="none"||I)return[{key:"all",label:"",items:z}];const C=new Map;for(const V of z){const K=g==="status"?V.status:V.role,O=C.get(K);O?O.push(V):C.set(K,[V])}return[...C.keys()].sort((V,K)=>g!=="status"?V.localeCompare(K):Ce.indexOf(V)-Ce.indexOf(K)).map(V=>({key:V,label:V,items:C.get(V)??[]}))},[z,g,I]),P=o.useMemo(()=>en(E),[E]),q=C=>Y=>{m==null||m(C,Yn[Y.answer],Y)},F=()=>{!p||P.valid.length===0||(p(P.valid),X(""))};if(I){const C=z[0];return C?e.jsxs("div",{ref:a,className:`nice-participant-list nice-participant-list--guest ${N??""}`,style:v,children:[e.jsx("ul",{className:"nice-participant-list__rows",children:e.jsx($e,{participant:C,size:c})}),e.jsx(Pe,{value:We[C.status],onRespond:q(C.id),allowPlusOnes:k,currentUserId:l??C.userId,currentUserName:d??C.name,disabled:j,readOnly:M,size:c})]}):e.jsx("div",{ref:a,className:`nice-participant-list ${N??""}`,style:v,children:e.jsx(me,{title:"You are not on this guest list",description:"Ask the host for an invitation link."})})}return e.jsxs("div",{ref:a,className:`nice-participant-list ${N??""}`,style:v,children:[x&&e.jsxs("div",{className:"nice-participant-list__summary",children:[e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.confirmed})," confirmed"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.invited})," awaiting reply"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.declined})," declined"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L["checked-in"]})," checked in"]}),e.jsxs("span",{className:"nice-participant-list__stat nice-participant-list__stat--total",children:[e.jsx("strong",{children:L.total})," total"]})]}),(b||u||t)&&e.jsxs("div",{className:"nice-participant-list__toolbar",children:[b&&e.jsxs(e.Fragment,{children:[e.jsx(f.NiceTextInput,{value:T,onChange:S,placeholder:"Search guests…",prefix:e.jsx(B.NtdSearch,{size:15}),size:c}),e.jsx(f.NiceSelect,{value:R,onChange:C=>y(C),size:c,options:[{value:"all",label:"All statuses"},...Ce.map(C=>({value:C,label:C}))]})]}),u,t&&!u&&e.jsxs("span",{className:"nice-participant-list__scan-hint",children:[e.jsx(B.NtdQrCode,{size:15})," Scanner ready"]})]}),z.length===0?e.jsx(me,{title:"No guests yet",description:n.length>0?"No one matches the current filter.":"Invite people to see them here."}):A.map(C=>e.jsxs("section",{className:"nice-participant-list__group",children:[C.label&&e.jsxs("h4",{className:"nice-participant-list__group-title",children:[C.label," ",e.jsxs("span",{children:["(",C.items.length,")"]})]}),e.jsx("ul",{className:"nice-participant-list__rows",children:C.items.map(Y=>e.jsxs($e,{participant:Y,size:c,meta:_==null?void 0:_.map(V=>e.jsx("span",{className:"nice-participant-list__extra",children:V.render?V.render(Y):String(Y[V.key]??"")},V.key)),children:[m&&e.jsx(Pe,{compact:!0,value:We[Y.status],onRespond:q(Y.id),currentUserId:Y.userId,currentUserName:Y.name,disabled:D,size:"sm"}),h&&Y.status!=="checked-in"&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",leftIcon:e.jsx(B.NtdCheck,{size:14}),disabled:D,onClick:()=>h(Y.id),children:"Check in"})]},Y.id))})]},C.key)),p&&!M&&e.jsxs("div",{className:"nice-participant-list__invite",children:[e.jsx(f.NiceTextArea,{label:"Invite by email",value:E,onChange:X,placeholder:"Paste addresses — commas, semicolons or new lines",rows:3,disabled:j,size:c}),e.jsxs(f.NiceButton,{variant:"primary",size:c,leftIcon:e.jsx(B.NtdMail,{size:15}),disabled:j||P.valid.length===0,onClick:F,children:["Invite ",P.valid.length>0?`(${P.valid.length})`:""]}),(P.invalid.length>0||P.duplicates>0)&&e.jsxs("p",{className:"nice-participant-list__invite-hint",children:[P.duplicates>0&&`${P.duplicates} duplicate(s) removed. `,P.invalid.length>0&&`${P.invalid.length} entry(ies) not recognised.`]})]})]})}),Fn={BIF:0,CLP:0,DJF:0,GNF:0,ISK:0,JPY:0,KMF:0,KRW:0,PYG:0,RWF:0,UGX:0,UYI:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function Re(i){return Fn[i==null?void 0:i.toUpperCase()]??2}function Ee(i,s){return Number.isFinite(i)?Math.round(i*10**Re(s)):0}function ze(i,s){const a=Re(s);return a===0?i:i/10**a}function Vn(i,s,a){const n=Re(s),r=ze(i,s);try{return new Intl.NumberFormat(a,{style:"currency",currency:s.toUpperCase(),minimumFractionDigits:n,maximumFractionDigits:n}).format(r)}catch{return`${r.toFixed(n)} ${s}`}}function ee(i,s,a){return Vn(Ee(i,s),s,a)}const Be={minX:0,minY:0,maxX:0,maxY:0};function qn(i,s=0){if(i.length===0)return{...Be};let a=1/0,n=1/0,r=-1/0,l=-1/0;for(const d of i)d.x<a&&(a=d.x),d.y<n&&(n=d.y),d.x>r&&(r=d.x),d.y>l&&(l=d.y);return{minX:a-s,minY:n-s,maxX:r+s,maxY:l+s}}function Ge(i,s){return{minX:Math.min(i.minX,s.minX),minY:Math.min(i.minY,s.minY),maxX:Math.max(i.maxX,s.maxX),maxY:Math.max(i.maxY,s.maxY)}}function Ke(i,s){return i.minX<=s.maxX&&i.maxX>=s.minX&&i.minY<=s.maxY&&i.maxY>=s.minY}function Wn(i,s,a=0){const n=i.zoom||1,r=-i.pan.x/n-a,l=-i.pan.y/n-a;return{minX:r,minY:l,maxX:r+s.width/n+a*2,maxY:l+s.height/n+a*2}}function Gn(i,s=12){const a=[],n=[],r=new Map,l=new Map;let d=null,m=0;for(const h of i.sections??[]){let t=null,u=0;(h.rows??[]).forEach((_,g)=>{const x=Kn(_.seats??[]);if(x.length===0)return;const b=qn(x,s);n.push({sectionId:h.id,rowIndex:g,label:_.label,seats:x,bounds:b}),x.forEach((k,j)=>{r.set(k.id,k),l.set(k.id,{sectionId:h.id,rowIndex:g,seatIndex:j})}),u+=x.length,t=t?Ge(t,b):b});const p=t??{...Be};a.push({section:h,bounds:p,seatCount:u}),m+=u,u>0&&(d=d?Ge(d,p):p)}return{sections:a,rows:n,bounds:d??{...Be},totalSeats:m,seatById:r,locationById:l}}function Kn(i){return[...i].sort((s,a)=>s.number-a.number||s.x-a.x)}function Hn(i,s){return i>s*4?"section":i>s?"row":"seat"}function Qn(i,s,a=2500,n){const r=i.sections.filter(u=>Ke(u.bounds,s)),l=new Set(r.map(u=>u.section.id)),d=i.rows.filter(u=>l.has(u.sectionId)&&Ke(u.bounds,s));let m=0;for(const u of d)for(const p of u.seats)p.x>=s.minX&&p.x<=s.maxX&&p.y>=s.minY&&p.y<=s.maxY&&(m+=1);const h=n??Hn(m,a);let t=[];if(h==="seat"){t=[];for(const u of d)for(const p of u.seats)p.x>=s.minX&&p.x<=s.maxX&&p.y>=s.minY&&p.y<=s.maxY&&t.push(p)}return{tier:h,sections:r,rows:h==="section"?[]:d,seats:t,visibleSeatCount:m}}function De(i){if(i.accessType)return i.accessType;if(i.status==="wheelchair"||i.status==="companion")return i.status}function ve(i,s){const a=(s==null?void 0:s[i.id])??i.status;return a==="wheelchair"||a==="companion"?"available":a}function He(i,s,a){var r;const n=(r=s.priceCategories)==null?void 0:r.find(l=>l.id===i.priceCategoryId);return{amount:(n==null?void 0:n.price)??a.basePrice,currency:a.currency}}function Zn(i,s={},a){return!(ve(i,a)!=="available"||s.allowedCategories&&!s.allowedCategories.includes(i.priceCategoryId))}function sn(i,s={},a){const n=[];let r=null;return i.forEach((l,d)=>{Zn(l,s,a)?r?r.seats.push(l):r={start:d,seats:[l]}:r&&(n.push(r),r=null)}),r&&n.push(r),n}function Jn(i,s,a={},n){const r=a.maxSeats??8;if(i.length>r)return{ok:!1,reason:"max-seats"};for(const d of i){const m=s.seatById.get(d);if(m){if(ve(m,n)!=="available")return{ok:!1,reason:"unavailable",seatId:d};if(a.allowedCategories&&!a.allowedCategories.includes(m.priceCategoryId))return{ok:!1,reason:"category-not-allowed",seatId:d}}}if(!a.adjacentOnly||i.length===0)return{ok:!0};const l=new Map;for(const d of i){const m=s.locationById.get(d);if(!m)continue;const h=`${m.sectionId}::${m.rowIndex}`,t=l.get(h);t?t.push(d):l.set(h,[d])}for(const[d,m]of l){const[h,t]=d.split("::"),u=Number(t),p=s.rows.find(c=>c.sectionId===h&&c.rowIndex===u);if(!p)continue;const _=sn(p.seats,a,n),g=new Set(m);let x=null;for(const c of _)if(c.seats.some(N=>g.has(N.id))){if(x)return{ok:!1,reason:"not-adjacent",seatId:m[0]};x=c}if(!x)continue;const b=x.seats.map((c,N)=>g.has(c.id)?N:-1).filter(c=>c>=0);if(b.length===0)continue;const k=b[0],j=b[b.length-1];if(j-k+1!==b.length)return{ok:!1,reason:"not-adjacent",seatId:m[0]};const M=x.seats.length;if(M>1&&(k===1||M-1-j===1))return{ok:!1,reason:"orphan-seat",seatId:m[0]}}return{ok:!0}}function es(i,s,a,n={},r){if(i.includes(s))return{selected:i.filter(m=>m!==s)};const l=[...i,s],d=Jn(l,a,n,r);return d.ok?{selected:l}:{rejected:d.reason??"not-adjacent"}}function ns(i,s,a={},n={},r){if(s<=0)return[];const l=n.categoryId?{...a,allowedCategories:[n.categoryId]}:a;let d=null;for(const m of i.rows)if(!(n.sectionId&&m.sectionId!==n.sectionId))for(const h of sn(m.seats,l,r)){const t=h.seats.length;if(!(t<s))for(let u=0;u+s<=t;u+=1){const p=u+s-1;if(t>s&&(u===1||t-1-p===1))continue;const _=h.seats.slice(u,p+1),g=_.reduce((x,b)=>x+(b.viewScore??50),0)/s;(!d||g>d.score)&&(d={ids:_.map(x=>x.id),score:g})}}return(d==null?void 0:d.ids)??[]}function ss(i,s,a){var u,p,_,g;const n=i.locationById.get(s);if(!n)return null;const r=i.rows.findIndex(x=>x.sectionId===n.sectionId&&x.rowIndex===n.rowIndex);if(r<0)return null;const l=i.rows[r];if(a==="left")return((u=l.seats[n.seatIndex-1])==null?void 0:u.id)??null;if(a==="right")return((p=l.seats[n.seatIndex+1])==null?void 0:p.id)??null;if(a==="row-start")return((_=l.seats[0])==null?void 0:_.id)??null;if(a==="row-end")return((g=l.seats[l.seats.length-1])==null?void 0:g.id)??null;const d=i.rows[a==="up"?r-1:r+1];if(!d)return null;const m=l.seats[n.seatIndex].x;let h=null,t=1/0;for(const x of d.seats){const b=Math.abs(x.x-m);b<t&&(t=b,h=x)}return(h==null?void 0:h.id)??null}function ts(i,s,a){var h,t,u;const n=i.sections.filter(p=>p.seatCount>0);if(n.length===0)return null;const r=s?(h=i.locationById.get(s))==null?void 0:h.sectionId:void 0,l=n.findIndex(p=>p.section.id===r),d=l<0?0:a==="next"?l+1:l-1,m=n[d];return m?((u=(t=i.rows.find(p=>p.sectionId===m.section.id))==null?void 0:t.seats[0])==null?void 0:u.id)??null:null}const we=8;function is(i,s){return i.seats.length===0?0:i.seats.filter(n=>ve(n,s)==="available").length/i.seats.length}const as=({cull:i,selectedIds:s,cursorId:a,statusOverrides:n,sectionColorById:r,interactive:l,onSeatClick:d,onSectionClick:m,describeSeat:h})=>i.tier==="section"?e.jsx("g",{className:"nice-seating-chart__sections",children:i.sections.map(({section:t,bounds:u,seatCount:p})=>e.jsxs("g",{className:"nice-seating-chart__section",children:[e.jsx("rect",{x:u.minX,y:u.minY,width:u.maxX-u.minX,height:u.maxY-u.minY,rx:12,className:"nice-seating-chart__section-shape",style:{fill:r.get(t.id)},role:m?"button":"img","aria-label":`${t.name}, ${p} seats`,tabIndex:m?0:void 0,onClick:m?()=>m(t.id):void 0}),e.jsx("text",{x:(u.minX+u.maxX)/2,y:(u.minY+u.maxY)/2,className:"nice-seating-chart__section-label",textAnchor:"middle",dominantBaseline:"middle","aria-hidden":"true",children:t.name})]},t.id))}):i.tier==="row"?e.jsx("g",{className:"nice-seating-chart__rows",children:i.rows.map(t=>{const u=is(t,n);return e.jsxs("g",{children:[e.jsx("rect",{x:t.bounds.minX,y:t.bounds.minY,width:t.bounds.maxX-t.bounds.minX,height:t.bounds.maxY-t.bounds.minY,rx:8,className:"nice-seating-chart__row-shape",style:{fill:r.get(t.sectionId),fillOpacity:.25+u*.65},role:"img","aria-label":`Row ${t.label}, ${t.seats.length} seats, ${Math.round(u*t.seats.length)} available`}),e.jsx("text",{x:t.bounds.minX-6,y:(t.bounds.minY+t.bounds.maxY)/2,className:"nice-seating-chart__row-label",textAnchor:"end",dominantBaseline:"middle","aria-hidden":"true",children:t.label})]},`${t.sectionId}-${t.rowIndex}`)})}):e.jsx("g",{className:"nice-seating-chart__seats",children:i.seats.map(t=>{const u=ve(t,n),p=De(t),_=s.has(t.id),g=a===t.id,x={row:t.row,number:t.number},b=["nice-seating-chart__seat",`nice-seating-chart__seat--${u}`,_?"nice-seating-chart__seat--selected":"",p?`nice-seating-chart__seat--${p}`:"",g?"nice-seating-chart__seat--cursor":""].filter(Boolean).join(" ");return e.jsxs("g",{className:b,"data-seat-id":t.id,role:"gridcell","aria-selected":_,"aria-disabled":u!=="available","aria-label":h(t),tabIndex:g?0:-1,onClick:l&&d?()=>d(t):void 0,children:[p?e.jsx("rect",{x:t.x-we,y:t.y-we,width:we*2,height:we*2,rx:3,className:"nice-seating-chart__seat-shape",fill:p==="companion"?"url(#nice-seat-companion-hatch)":void 0}):e.jsx("circle",{cx:t.x,cy:t.y,r:we,className:"nice-seating-chart__seat-shape"}),p==="wheelchair"&&e.jsx(B.NtdWheelchair,{size:10,x:t.x-5,y:t.y-5,className:"nice-seating-chart__seat-glyph"}),e.jsx("title",{children:h(t)}),e.jsx("text",{x:t.x,y:t.y,className:"nice-seating-chart__seat-number",textAnchor:"middle",dominantBaseline:"middle","aria-hidden":"true",children:x.number})]},t.id)})}),cs=({index:i,selectedIds:s,statusOverrides:a,maxSeats:n,onSeatToggle:r,onBestAvailable:l,describeSeat:d,disabled:m=!1,defaultOpen:h=!1})=>{var M;const t=o.useMemo(()=>i.sections.filter(c=>c.seatCount>0),[i.sections]),[u,p]=o.useState(((M=t[0])==null?void 0:M.section.id)??""),[_,g]=o.useState(0),[x,b]=o.useState(2),k=o.useMemo(()=>i.rows.filter(c=>c.sectionId===u),[i.rows,u]),j=k.find(c=>c.rowIndex===_)??k[0];return e.jsxs(f.NiceCollapse,{trigger:"Choose seats without the map",defaultExpanded:h,className:"nice-seating-chart__list-panel",children:[l&&e.jsxs("div",{className:"nice-seating-chart__best",children:[e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"How many seats?"}),e.jsx(f.NiceNumericInput,{value:x,onChange:c=>b(Math.max(1,Math.min(n,c??1))),min:1,max:n,size:"xs",disabled:m})]}),e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:m,onClick:()=>l(x,{sectionId:u||void 0}),children:"Best available"})]}),e.jsxs("div",{className:"nice-seating-chart__pickers",children:[e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"Section"}),e.jsx(f.NiceSelect,{size:"sm",value:u,disabled:m,onChange:c=>{p(c),g(0)},options:t.map(c=>({value:c.section.id,label:`${c.section.name} (${c.seatCount})`}))})]}),e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"Row"}),e.jsx(f.NiceSelect,{size:"sm",value:String((j==null?void 0:j.rowIndex)??0),disabled:m||k.length===0,onChange:c=>g(Number(c)),options:k.map(c=>({value:String(c.rowIndex),label:`${c.label} (${c.seats.length})`}))})]})]}),j&&e.jsx("ul",{className:"nice-seating-chart__seat-list",children:j.seats.map(c=>{const N=ve(c,a),v=De(c),T=s.has(c.id);return e.jsx("li",{children:e.jsxs(f.NiceButton,{size:"sm",variant:T?"primary":"outline",disabled:m||N!=="available",ariaLabel:d(c),"aria-pressed":T,onClick:()=>r(c),children:[c.number,v&&e.jsx(B.NtdWheelchair,{size:11})]})},c.id)})})]})},rs={zoom:1,pan:{x:0,y:0}};function ls(i={}){const{minZoom:s=.1,maxZoom:a=10,initial:n=rs,viewport:r,onViewportChange:l,disabled:d=!1}=i,[m,h]=o.useState(n),t=r??m,[u,p]=o.useState(!1),_=o.useRef(new Map),g=o.useRef(null),x=o.useRef(null),b=o.useCallback(y=>{r===void 0&&h(y),l==null||l(y)},[r,l]),k=o.useCallback(y=>Math.min(a,Math.max(s,y)),[s,a]),j=o.useCallback((y,E)=>{const X=k(t.zoom*y);if(X===t.zoom)return;const D=X/t.zoom;b({zoom:X,pan:{x:E.x-(E.x-t.pan.x)*D,y:E.y-(E.y-t.pan.y)*D}})},[b,k,t]),M=o.useCallback((y,E,X)=>{const D=E??(X?{x:X.width/2,y:X.height/2}:{x:0,y:0});j(y,D)},[j]),c=o.useCallback((y,E,X=24)=>{const D=Math.max(1,y.maxX-y.minX),I=Math.max(1,y.maxY-y.minY),L=k(Math.min((E.width-X*2)/D,(E.height-X*2)/I));b({zoom:L,pan:{x:(E.width-D*L)/2-y.minX*L,y:(E.height-I*L)/2-y.minY*L}})},[b,k]),N=o.useCallback(()=>b(n),[b,n]),v=o.useCallback(y=>({x:(y.x-t.pan.x)/t.zoom,y:(y.y-t.pan.y)/t.zoom}),[t]),T=o.useCallback(y=>({x:y.x*t.zoom+t.pan.x,y:y.y*t.zoom+t.pan.y}),[t]),S=y=>{const E=y.currentTarget.getBoundingClientRect();return{x:y.clientX-E.left,y:y.clientY-E.top}};return{viewport:t,setViewport:b,containerProps:d?{}:{onWheel:y=>{y.preventDefault();const E=Math.exp(-y.deltaY*.002);j(Math.min(2,Math.max(.5,E)),S(y))},onPointerDown:y=>{var X,D;const E=S(y);if(_.current.set(y.pointerId,E),(D=(X=y.currentTarget).setPointerCapture)==null||D.call(X,y.pointerId),_.current.size===2){const[I,L]=[..._.current.values()];g.current={distance:Math.hypot(I.x-L.x,I.y-L.y)||1,zoom:t.zoom}}else x.current=E,p(!0)},onPointerMove:y=>{if(!_.current.has(y.pointerId))return;const E=S(y);if(_.current.set(y.pointerId,E),_.current.size===2&&g.current){const[I,L]=[..._.current.values()],z=Math.hypot(I.x-L.x,I.y-L.y)||1,A=k(g.current.zoom*(z/g.current.distance)),P={x:(I.x+L.x)/2,y:(I.y+L.y)/2};A!==t.zoom&&j(A/t.zoom,P);return}if(!x.current)return;const X=E.x-x.current.x,D=E.y-x.current.y;x.current=E,b({zoom:t.zoom,pan:{x:t.pan.x+X,y:t.pan.y+D}})},onPointerUp:y=>{_.current.delete(y.pointerId),_.current.size<2&&(g.current=null),_.current.size===0&&(x.current=null,p(!1))},onPointerCancel:y=>{_.current.delete(y.pointerId),g.current=null,x.current=null,p(!1)}},zoomBy:M,fitTo:c,reset:N,screenToWorld:v,worldToScreen:T,panning:u}}const os={"orphan-seat":"That would leave a single empty seat. Pick a different seat.","not-adjacent":"Seats must be next to each other.","max-seats":"You have selected as many seats as this order allows.","category-not-allowed":"That seat is not part of the selected ticket type.",unavailable:"That seat is not available."},tn=o.forwardRef(function(s,a){var ae,be,fe;const{chart:n,mode:r="select",selection:l={},selectedSeatIds:d,defaultSelectedSeatIds:m=[],onSelectionChange:h,onSelectionRejected:t,seatStatusOverrides:u,onSeatClick:p,onBestAvailable:_,lod:g="auto",onLodChange:x,maxRenderedSeats:b=2500,containerSize:k,showLegend:j=!0,showList:M=!1,zoomable:c=!0,locale:N,disabled:v=!1,readOnly:T=!1,className:S,style:R}=s,y=o.useRef(null),[E,X]=o.useState({width:800,height:500}),[D,I]=o.useState(!1),[L,z]=o.useState(m),[A,P]=o.useState(null),[q,F]=o.useState(""),C=d??L,Y=o.useMemo(()=>new Set(C),[C]),V=r==="select"&&!v&&!T&&l.interactive!==!1,K=l.maxSeats??8,O=o.useMemo(()=>Gn(n),[n]),Q=k??E,G=!!k||D;o.useEffect(()=>{if(k||!y.current||typeof ResizeObserver>"u")return;const $=y.current,U=new ResizeObserver(([W])=>{const{width:H,height:J}=W.contentRect;H>0&&J>0&&(X({width:H,height:J}),I(!0))});return U.observe($),()=>U.disconnect()},[k]);const he=ls({disabled:!c||v}),{fitTo:se,viewport:re}=he,pe=o.useRef(!1);o.useEffect(()=>{pe.current||!G||O.totalSeats===0||Q.width<=0||(pe.current=!0,se(O.bounds,Q))},[se,O,Q,G]);const ke=o.useMemo(()=>Wn(re,Q,40),[re,Q]),xe=g!=="auto"?g:A?"seat":void 0,le=o.useMemo(()=>Qn(O,ke,b,xe),[O,ke,b,xe]),ge=o.useRef(null);o.useEffect(()=>{ge.current!==le.tier&&(ge.current=le.tier,x==null||x(le.tier))},[le.tier,x]);const Te=o.useMemo(()=>{var $;return new Map((($=n.sections)==null?void 0:$.map(U=>[U.id,U.color]))??[])},[n.sections]),oe=o.useMemo(()=>{var $;return new Map((($=n.sections)==null?void 0:$.map(U=>[U.id,U]))??[])},[n.sections]),ie=o.useCallback($=>{const U=oe.get($.sectorId),W=ve($,u),H=De($),J=[U?U.name:"",`row ${$.row}`,`seat ${$.number}`].filter(Boolean);if(U&&l.showPrices!==!1){const ce=He($,n,U);J.push(ee(ce.amount,ce.currency,N))}return J.push(W),H==="wheelchair"&&J.push("wheelchair accessible"),H==="companion"&&J.push("companion seat"),J.join(", ")},[n,oe,u,l.showPrices,N]),ne=o.useCallback($=>{d===void 0&&z($),h==null||h($)},[d,h]),Ne=o.useCallback($=>{if(p==null||p($),!V)return;const U=es(C,$.id,O,l,u);if("rejected"in U){t==null||t({reason:U.rejected,seatId:$.id}),F(os[U.rejected]);return}ne(U.selected),F(`${ie($)}. ${U.selected.length} of ${K} selected.`)},[ne,ie,O,V,K,p,t,u,C,l]),de=o.useCallback(($,U)=>{if(_){_($,U);return}const W=ns(O,$,l,U,u);if(W.length===0){F(`No block of ${$} seats together is available.`);return}ne(W),P(W[0]),F(`Selected ${W.length} seats together.`)},[ne,O,_,u,l]),je=o.useCallback($=>{const U=O.locationById.get($);if(!U)return;const W=O.rows.find(H=>H.sectionId===U.sectionId&&H.rowIndex===U.rowIndex);W&&se(W.bounds,Q,80)},[se,O,Q]),ue=o.useCallback($=>{if(!$)return;P($),je($);const U=O.seatById.get($);U&&F(ie(U))},[ie,O.seatById,je]),Ae=$=>{var J,ce;const U=A??((ce=(J=O.rows[0])==null?void 0:J.seats[0])==null?void 0:ce.id)??null;if(!U)return;const H={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"row-start",End:"row-end"}[$.key];if(H){$.preventDefault(),ue(A?ss(O,U,H):U);return}if($.key==="PageDown"||$.key==="PageUp"){$.preventDefault(),ue(ts(O,A,$.key==="PageDown"?"next":"prev"));return}if($.key==="Enter"||$.key===" "){$.preventDefault();const Se=O.seatById.get(U);Se&&Ne(Se);return}$.key==="Escape"&&C.length>0&&($.preventDefault(),ne([]),F("Selection cleared."))};if(O.totalSeats===0)return e.jsx("div",{ref:a,className:`nice-seating-chart ${S??""}`,style:R,children:e.jsx(me,{title:"This chart has no seats",description:"Add sections and rows to the seating chart to see it here."})});const ye=C.reduce(($,U)=>{const W=O.seatById.get(U),H=W?oe.get(W.sectorId):void 0;return!W||!H?$:$+He(W,n,H).amount},0),_e=((be=(ae=n.sections)==null?void 0:ae[0])==null?void 0:be.currency)??"PLN";return e.jsxs("div",{ref:a,className:`nice-seating-chart nice-seating-chart--${r} ${S??""}`,style:R,children:[e.jsxs("div",{ref:y,className:"nice-seating-chart__canvas-host",role:"grid","aria-label":`${n.name} seating chart`,"aria-rowcount":O.rows.length,"aria-colcount":O.totalSeats,tabIndex:A?-1:0,onKeyDown:Ae,...he.containerProps,children:[e.jsxs("svg",{className:"nice-seating-chart__canvas",width:"100%",height:"100%",role:"presentation",children:[e.jsx("defs",{children:e.jsx("pattern",{id:"nice-seat-companion-hatch",width:4,height:4,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:e.jsx("line",{x1:0,y1:0,x2:0,y2:4,className:"nice-seating-chart__hatch"})})}),e.jsx("g",{transform:`translate(${re.pan.x} ${re.pan.y}) scale(${re.zoom})`,children:e.jsx(as,{cull:le,selectedIds:Y,cursorId:A,statusOverrides:u,sectionColorById:Te,interactive:V,onSeatClick:Ne,onSectionClick:l.sectionSelect?$=>{var W;const U=(W=O.rows.find(H=>H.sectionId===$))==null?void 0:W.seats[0];U&&ue(U.id)}:void 0,describeSeat:ie})})]}),c&&e.jsxs("div",{className:"nice-seating-chart__zoom",children:[e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Zoom in",onClick:()=>he.zoomBy(1.25,void 0,Q),children:"+"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Zoom out",onClick:()=>he.zoomBy(.8,void 0,Q),children:"−"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Fit to view",onClick:()=>se(O.bounds,Q),children:"Fit"})]})]}),e.jsx("p",{className:"nice-seating-chart__status",role:"status","aria-live":"polite",children:q}),j&&e.jsxs("ul",{className:"nice-seating-chart__legend",children:[(fe=n.priceCategories)==null?void 0:fe.map($=>e.jsxs("li",{className:"nice-seating-chart__legend-item",children:[e.jsx("span",{className:"nice-seating-chart__legend-swatch",style:{background:$.color},"aria-hidden":"true"}),$.name," · ",ee($.price,_e,N)]},$.id)),e.jsxs("li",{className:"nice-seating-chart__legend-item nice-seating-chart__legend-item--sold",children:[e.jsx("span",{className:"nice-seating-chart__legend-swatch","aria-hidden":"true"})," Sold"]})]}),r==="select"&&C.length>0&&e.jsxs("p",{className:"nice-seating-chart__total",children:[C.length," seat",C.length===1?"":"s"," ·"," ",ee(ye,_e,N)]}),M&&e.jsx(cs,{index:O,selectedIds:Y,statusOverrides:u,maxSeats:K,onSeatToggle:Ne,onBestAvailable:de,describeSeat:ie,disabled:!V,defaultOpen:r==="select"&&M})]})}),ds=o.forwardRef(function({showList:s=!0,className:a,...n},r){return e.jsx(tn,{ref:r,mode:"select",showList:s,className:`nice-seat-picker ${a??""}`,...n})}),an=/\{\{\s*([\w.-]+)\s*\}\}/g,us={"&":"&","<":"<",">":">",'"':""","'":"'"};function ms(i){return i.replace(/[&<>"']/g,s=>us[s]??s)}function hs(i){const s=[],a=new Set;for(const n of i.matchAll(an)){const r=n[1];a.has(r)||(a.add(r),s.push(r))}return s}function ps(i,s={},a={}){const{escape:n=!0,missing:r="keep"}=a;return i.replace(an,(l,d)=>{const m=s[d];return m==null?r==="blank"?"":l:n?ms(String(m)):String(m)})}function Qe(i){return`{{${i}}}`}function xs(i,s={}){return hs(i).filter(a=>s[a]===void 0||s[a]===null)}const gs=["bold","italic","underline","h1","h2","ul","ol","link","image","alignLeft","alignCenter","undo","redo"],fs=o.forwardRef(function(s,a){const{template:n,onTemplateChange:r,tokens:l=[],previewData:d={},recipients:m=[],onRecipientsChange:h,onSend:t,sending:u=!1,toolbar:p=gs,disabled:_=!1,readOnly:g=!1,size:x="md",className:b,style:k}=s,[j,M]=o.useState(""),c=_||g||u,N=o.useMemo(()=>en(j),[j]),v=o.useMemo(()=>{const I={};for(const L of l)L.sample!==void 0&&(I[L.key]=L.sample);return{...I,...d}},[l,d]),T=o.useMemo(()=>ps(n.body??"",v),[n.body,v]),S=o.useMemo(()=>xs(n.body??"",v),[n.body,v]),R=m.map(I=>I.email),y=I=>r==null?void 0:r({...n,...I}),E=I=>{y({body:`${n.body??""}${Qe(I)}`})},X=()=>{!h||N.valid.length===0||(h(On(R,N.valid)),M(""))},D=I=>{h==null||h(R.filter(L=>L!==I))};return e.jsxs("div",{ref:a,className:`nice-invitation-designer nice-invitation-designer--${x} ${b??""}`,style:k,children:[e.jsxs("section",{className:"nice-invitation-designer__editor",children:[e.jsx(f.NiceTextInput,{label:"Template name",value:n.name,onChange:I=>y({name:I}),placeholder:"Birthday invitation",disabled:c,size:x}),l.length>0&&!g&&e.jsxs("div",{className:"nice-invitation-designer__tokens",children:[e.jsx("span",{className:"nice-invitation-designer__tokens-label",children:"Insert:"}),l.map(I=>e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:c,onClick:()=>E(I.key),children:I.label},I.key))]}),e.jsx(f.NiceHtmlEditor,{value:n.body??"",onChange:I=>y({body:I}),toolbar:p,height:280,readOnly:g||u,disabled:_})]}),e.jsxs("section",{className:"nice-invitation-designer__preview","aria-label":"Invitation preview",children:[e.jsxs("header",{className:"nice-invitation-designer__preview-header",children:[e.jsx("h4",{children:"Preview"}),S.length>0&&e.jsxs(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:[S.length," unresolved"]})]}),n.coverImageUrl&&e.jsx("img",{className:"nice-invitation-designer__cover",src:n.coverImageUrl,alt:""}),e.jsx("div",{className:"nice-invitation-designer__preview-body",dangerouslySetInnerHTML:{__html:T}}),S.length>0&&e.jsxs("p",{className:"nice-invitation-designer__unresolved",children:["No preview value for: ",S.map(I=>Qe(I)).join(", ")]})]}),e.jsxs("section",{className:"nice-invitation-designer__recipients",children:[e.jsx("header",{className:"nice-invitation-designer__recipients-header",children:e.jsxs("h4",{children:["Recipients ",e.jsxs("span",{children:["(",m.length,")"]})]})}),h&&!g&&e.jsxs(e.Fragment,{children:[e.jsx(f.NiceTextArea,{label:"Add addresses",value:j,onChange:M,placeholder:"Paste a list — commas, semicolons or new lines",rows:3,disabled:c,size:x}),e.jsxs("div",{className:"nice-invitation-designer__paste-actions",children:[e.jsxs(f.NiceButton,{size:x,variant:"outline",leftIcon:e.jsx(B.NtdMail,{size:15}),disabled:c||N.valid.length===0,onClick:X,children:["Add ",N.valid.length>0?`(${N.valid.length})`:""]}),(N.invalid.length>0||N.duplicates>0)&&e.jsxs("span",{className:"nice-invitation-designer__paste-hint",children:[N.duplicates>0&&`${N.duplicates} duplicate(s). `,N.invalid.length>0&&`${N.invalid.length} not recognised: ${N.invalid.slice(0,3).join(", ")}`]})]})]}),m.length>0&&e.jsx("ul",{className:"nice-invitation-designer__recipient-list",children:m.map(I=>e.jsxs("li",{className:"nice-invitation-designer__recipient",children:[e.jsx("span",{children:I.name?`${I.name} <${I.email}>`:I.email}),I.status&&I.status!=="pending"&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:I.status==="sent"?"success":"error",children:I.status}),h&&!g&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Remove ${I.email}`,disabled:c,onClick:()=>D(I.email),children:e.jsx(B.NtdTrash,{size:13})})]},I.email))}),t&&!g&&e.jsx(f.NiceButton,{variant:"primary",size:x,leftIcon:e.jsx(B.NtdSend,{size:15}),loading:u,ariaLabel:"Send invitations",disabled:_||u||m.length===0,onClick:()=>t({templateId:n.id,emails:R}),children:u?"Sending…":`Send to ${m.length}`})]})]})}),vs=({value:i,max:s,currency:a,locale:n,label:r,className:l})=>{const d=s>0?s:1,m=i>=s&&s>0,h=(t,u)=>a?`${ee(t,a,n)} / ${ee(u,a,n)}`:`${t} / ${u}`;return e.jsx(f.NiceProgress,{className:l,value:Math.min(i,d),max:d,variant:m?"success":"primary",size:"sm",showValue:!0,formatValue:()=>h(i,s),"aria-label":r})};function Ns(i,s){if(s==="wishlist")return{value:i.isPurchased?1:0,max:1,complete:!!i.isPurchased};const a=i.quantityNeeded??1,n=i.quantityContributed??0;return{value:n,max:a,complete:a>0&&n>=a}}const js=o.forwardRef(function(s,a){const{items:n,kind:r="registry",mode:l="owner",currency:d="PLN",locale:m,hideContributors:h=!1,currentUserId:t,currentUserName:u,onContribute:p,onClaim:_,onUnclaim:g,onItemAdd:x,onItemDelete:b,onItemClick:k,layout:j="grid",disabled:M=!1,readOnly:c=!1,size:N="md",className:v,style:T}=s,S=nn({currentUserId:t,currentUserName:u}),[R,y]=o.useState(null),[E,X]=o.useState(0),[D,I]=o.useState(""),L=l==="owner",z=M||c,A=r==="wishlist",P=o.useMemo(()=>A?[...n].sort((C,Y)=>Number(C.isPurchased??!1)-Number(Y.isPurchased??!1)||(Y.priority??0)-(C.priority??0)):n,[n,A]),q=()=>{y(null),X(0)},F=C=>{!p||!S.canAct||(p(C.id,{amount:E>0?E:void 0,quantity:E>0?void 0:1,userName:S.actor.userName,userId:S.actor.userId}),q())};return n.length===0?e.jsx("div",{ref:a,className:`nice-gift-registry ${v??""}`,style:T,children:e.jsx(me,{icon:e.jsx(B.NtdGiftCard,{size:28}),title:A?"Nothing on the wishlist yet":"No gifts on the registry yet",description:L?"Add what you would like and share the link.":"The host has not added anything yet."})}):e.jsxs("div",{ref:a,className:`nice-gift-registry nice-gift-registry--${r} nice-gift-registry--${j} nice-gift-registry--${N} ${v??""}`,style:T,children:[!L&&S.isAnonymous&&(p||_)&&e.jsx(f.NiceTextInput,{label:"Your name",value:S.name,onChange:S.setName,placeholder:"So the host knows who to thank",required:!0,disabled:z,size:N}),e.jsx(f.NiceCardGroup,{columns:j==="list"?1:void 0,minColumnWidth:240,gap:12,children:P.map(C=>{const{value:Y,max:V,complete:K}=Ns(C,r),O=C.price,Q=C.contributions??[];return e.jsxs("div",{className:`nice-gift-registry__item${K?" nice-gift-registry__item--complete":""}`,children:[C.imageUrl&&e.jsx("img",{src:C.imageUrl,alt:"",className:"nice-gift-registry__image",loading:"lazy"}),e.jsxs("div",{className:"nice-gift-registry__body",children:[e.jsx("button",{type:"button",className:"nice-gift-registry__title",onClick:()=>k==null?void 0:k(C),disabled:!k,children:C.title}),C.description&&e.jsx("p",{className:"nice-gift-registry__description",children:C.description}),e.jsxs("div",{className:"nice-gift-registry__facts",children:[O&&e.jsx("span",{className:"nice-gift-registry__price",children:ee(O.amount,O.currency||d,m)}),A&&(C.priority??0)>0&&e.jsxs(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:[e.jsx(B.NtdStar,{size:11})," ",C.priority]}),K&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"success",children:A?"bought":"fully covered"}),C.url&&e.jsxs("a",{className:"nice-gift-registry__link",href:C.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(B.NtdLink,{size:13})," Shop"]})]}),!A&&e.jsx(vs,{value:Y,max:V,label:`${C.title}: ${Y} of ${V} covered`}),!h&&Q.length>0&&e.jsx("ul",{className:"nice-gift-registry__contributors",children:Q.map(G=>e.jsxs("li",{className:"nice-gift-registry__contributor",children:[e.jsx("strong",{children:G.contributorName}),G.amount!==void 0&&` — ${ee(G.amount,(O==null?void 0:O.currency)||d,m)}`,G.amount===void 0&&G.quantity?` — ${G.quantity}×`:"",G.message&&e.jsxs("em",{children:[" “",G.message,"”"]})]},G.id))}),e.jsxs("div",{className:"nice-gift-registry__actions",children:[!L&&!K&&_&&e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:z||!S.canAct,leftIcon:e.jsx(B.NtdCheck,{size:14}),onClick:()=>_(C.id,{...S.actor,quantity:1}),children:"I'll take this"}),!L&&K&&g&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",disabled:z,onClick:()=>g(C.id),children:"Release"}),!L&&!K&&!A&&p&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:z||!S.canAct,onClick:()=>y(R===C.id?null:C.id),children:"Chip in"}),L&&b&&!c&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Delete ${C.title}`,disabled:M,onClick:()=>b(C.id),children:e.jsx(B.NtdTrash,{size:14})})]}),R===C.id&&e.jsxs("div",{className:"nice-gift-registry__pledge",children:[e.jsxs("label",{className:"nice-gift-registry__pledge-field",children:[e.jsxs("span",{children:["Amount (",(O==null?void 0:O.currency)||d,")"]}),e.jsx(f.NiceNumericInput,{value:E,onChange:G=>X(Math.max(0,G??0)),min:0,size:"xs",disabled:z})]}),e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:z||!S.canAct,onClick:()=>F(C),children:"Confirm"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:q,children:"Cancel"})]})]})]},C.id)})}),L&&x&&!c&&e.jsxs("div",{className:"nice-gift-registry__add",children:[e.jsx(f.NiceTextInput,{label:A?"Add a wish":"Add a gift",value:D,onChange:I,placeholder:"What would you like?",disabled:M,size:N}),e.jsx(f.NiceButton,{variant:"primary",size:N,leftIcon:e.jsx(B.NtdPlus,{size:15}),disabled:M||!D.trim(),onClick:()=>{x({title:D.trim(),quantityNeeded:1}),I("")},children:"Add"})]})]})});function ys(i){const s=new Map;for(const a of i){const n=(a.currency||"").toUpperCase(),r=s.get(n);r?r.push(a):s.set(n,[a])}return s}function _s(i,s,a){var h;const n=new Set(s.map(t=>t.id)),r=s.map(t=>t.id),l=new Map(r.map(t=>[t,0])),d=[];let m=0;if(r.length===0)return{balances:l,issues:i.map(t=>({itemId:t.id,reason:"no-participants"})),totalMinor:0};for(const t of i){const u=t.paidById;if(!u){d.push({itemId:t.id,reason:"no-payer"});continue}if(!n.has(u)){d.push({itemId:t.id,reason:"unknown-payer"});continue}let p=(h=t.splitAmong)!=null&&h.length?t.splitAmong.filter(j=>n.has(j)):r;p.length===0&&(p=r);const _=Ee(t.amount,a);m+=_;const g=p.length,x=Math.floor(_/g),b=_-x*g,k=new Map(p.map(j=>[j,x]));if(b!==0)if(k.has(u))k.set(u,(k.get(u)??0)+b);else{const j=[...p].sort(Me),M=b>0?1:-1;for(let c=0;c<Math.abs(b);c+=1){const N=j[c%j.length];k.set(N,(k.get(N)??0)+M)}}l.set(u,(l.get(u)??0)+_);for(const[j,M]of k)l.set(j,(l.get(j)??0)-M)}return{balances:l,issues:d,totalMinor:m}}function bs(i,s,a){for(const n of s){if((n.currency||"").toUpperCase()!==a||!i.has(n.fromId)||!i.has(n.toId))continue;const r=Ee(n.amount,a);i.set(n.fromId,(i.get(n.fromId)??0)+r),i.set(n.toId,(i.get(n.toId)??0)-r)}}function ws(i,s,a){const n=new Map(s.map(t=>[t.id,t.name])),r=[...i.entries()].filter(([,t])=>t>0).map(([t,u])=>({id:t,v:u})).sort((t,u)=>u.v-t.v||Me(t.id,u.id)),l=[...i.entries()].filter(([,t])=>t<0).map(([t,u])=>({id:t,v:u})).sort((t,u)=>t.v-u.v||Me(t.id,u.id)),d=[];let m=0,h=0;for(;m<l.length&&h<r.length;){const t=Math.min(-l[m].v,r[h].v);t>0&&d.push({fromId:l[m].id,fromName:n.get(l[m].id)??l[m].id,toId:r[h].id,toName:n.get(r[h].id)??r[h].id,amount:ze(t,a),currency:a}),l[m].v+=t,r[h].v-=t,l[m].v===0&&(m+=1),r[h].v===0&&(h+=1)}return d}function ks(i,s,a=[]){const n=[],r=[],l=[...ys(i).entries()].sort(([d],[m])=>Me(d,m));for(const[d,m]of l){const h=_s(m,s,d);r.push(...h.issues),bs(h.balances,a,d),n.push({currency:d,total:ze(h.totalMinor,d),balances:s.map(t=>({participantId:t.id,participantName:t.name,amount:ze(h.balances.get(t.id)??0,d),currency:d})),transfers:ws(h.balances,s,d)})}return{groups:n,issues:r}}function Me(i,s){return i<s?-1:i>s?1:0}const Ss=o.forwardRef(function(s,a){const{items:n,participants:r,settlements:l=[],view:d,defaultView:m="expenses",onViewChange:h,onSettle:t,onItemDelete:u,onItemClick:p,onValidationChange:_,sortBy:g="date",locale:x,disabled:b=!1,readOnly:k=!1,size:j="md",className:M,style:c}=s,[N,v]=o.useState(m),T=d??N,S=b||k,R=o.useMemo(()=>r.map(z=>({id:z.id,name:z.name})),[r]),y=o.useMemo(()=>ks(n,R,l),[n,R,l]),E=o.useMemo(()=>g==="none"?n:n.map((z,A)=>({item:z,index:A})).sort((z,A)=>{if(g==="amount")return A.item.amount-z.item.amount||z.index-A.index;const P=z.item.incurredAt,q=A.item.incurredAt;return P&&q?P.localeCompare(q)||z.index-A.index:P?-1:q?1:z.index-A.index}).map(z=>z.item),[n,g]),X=y.issues.map(z=>`${z.itemId}:${z.reason}`).join("|");o.useEffect(()=>{_==null||_(y.issues)},[X]);const D=o.useMemo(()=>new Map(r.map(z=>[z.id,z.avatarUrl])),[r]),I=o.useMemo(()=>new Map(y.issues.map(z=>[z.itemId,z.reason])),[y.issues]),L=z=>{d===void 0&&v(z),h==null||h(z)};return n.length===0?e.jsx("div",{ref:a,className:`nice-expense-split ${M??""}`,style:c,children:e.jsx(me,{icon:e.jsx(B.NtdReceipt,{size:28}),title:"No expenses yet",description:"Add what people paid for and this will work out who owes whom."})}):e.jsxs("div",{ref:a,className:`nice-expense-split nice-expense-split--${j} ${M??""}`,style:c,children:[e.jsx(f.NiceSegmentedControl,{size:j,value:T,onChange:z=>L(z),options:[{value:"expenses",label:"Expenses"},{value:"balances",label:"Balances"},{value:"settlement",label:"Settle up"}]}),T==="expenses"&&e.jsx("ul",{className:"nice-expense-split__items",children:E.map(z=>{const A=I.get(z.id);return e.jsxs("li",{className:`nice-expense-split__item${A?" nice-expense-split__item--excluded":""}`,children:[e.jsxs("button",{type:"button",className:"nice-expense-split__item-main",onClick:()=>p==null?void 0:p(z),disabled:!p,children:[e.jsx("span",{className:"nice-expense-split__item-label",children:z.label}),e.jsxs("span",{className:"nice-expense-split__item-payer",children:[z.paidByName??z.paidById??"nobody"," paid"]})]}),e.jsx("span",{className:"nice-expense-split__item-amount",children:ee(z.amount,z.currency,x)}),z.isPaid&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"success",children:"paid"}),A&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:A==="no-payer"?"no payer":"unknown payer"}),u&&!k&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Delete ${z.label}`,disabled:b,onClick:()=>u(z.id),children:e.jsx(B.NtdTrash,{size:14})})]},z.id)})}),T==="balances"&&y.groups.map(z=>e.jsxs("section",{className:"nice-expense-split__group",children:[e.jsxs("h4",{className:"nice-expense-split__group-title",children:[z.currency,e.jsxs("span",{className:"nice-expense-split__group-total",children:[ee(z.total,z.currency,x)," total"]})]}),e.jsx("ul",{className:"nice-participant-list__rows",children:z.balances.map(A=>e.jsx($e,{participant:{id:A.participantId,name:A.participantName,avatarUrl:D.get(A.participantId)},showRole:!1,showStatus:!1,size:j,children:e.jsxs("span",{className:`nice-expense-split__balance nice-expense-split__balance--${A.amount>0?"owed":A.amount<0?"owes":"settled"}`,children:[A.amount===0?"settled up":ee(Math.abs(A.amount),A.currency,x),A.amount>0&&e.jsx("em",{children:" is owed"}),A.amount<0&&e.jsx("em",{children:" owes"})]})},A.participantId))})]},z.currency)),T==="settlement"&&(y.groups.every(z=>z.transfers.length===0)?e.jsx(me,{icon:e.jsx(B.NtdCoins,{size:28}),title:"All settled up",description:"Nobody owes anybody anything."}):y.groups.filter(z=>z.transfers.length>0).map(z=>e.jsxs("section",{className:"nice-expense-split__group",children:[e.jsxs("h4",{className:"nice-expense-split__group-title",children:[z.currency,e.jsxs("span",{className:"nice-expense-split__group-total",children:[z.transfers.length," transfer",z.transfers.length===1?"":"s"]})]}),e.jsx("ul",{className:"nice-expense-split__transfers",children:z.transfers.map(A=>e.jsxs("li",{className:"nice-expense-split__transfer",children:[e.jsx("span",{className:"nice-expense-split__transfer-from",children:A.fromName}),e.jsx(B.NtdArrowRight,{size:15}),e.jsx("span",{className:"nice-expense-split__transfer-to",children:A.toName}),e.jsx("span",{className:"nice-expense-split__transfer-amount",children:ee(A.amount,A.currency,x)}),t&&!k&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:S,onClick:()=>t(A),children:"Mark paid"})]},`${A.fromId}-${A.toId}-${A.amount}`))})]},z.currency)))]})}),Is={upcoming:"⏳",active:"▶️",voting:"🗳️",scored:"📊",completed:"✅",skipped:"⏭️"},Cs={upcoming:"#9ca3af",active:"#22c55e",voting:"#eab308",scored:"#3b82f6",completed:"#6b7280",skipped:"#d1d5db"},zs=o.forwardRef(function(s,a){const{rounds:n,activeRoundId:r,onSelect:l,onStart:d,onEnd:m,onCreate:h,editable:t=!1,className:u,style:p}=s,_=[...n].sort((g,x)=>g.order-x.order);return e.jsxs("div",{ref:a,className:`nice-round-list ${u??""}`,style:p,children:[e.jsxs("div",{className:"nice-round-list__header",children:[e.jsxs("h3",{children:["Rounds (",n.length,")"]}),t&&h&&e.jsx("button",{onClick:h,children:"+ Add Round"})]}),_.length===0?e.jsx("p",{className:"nice-round-list__empty",children:"No rounds yet."}):e.jsx("div",{className:"nice-round-list__items",children:_.map(g=>{const x=g.id===r;return e.jsxs("div",{className:`nice-round-list__item ${x?"nice-round-list__item--active":""}`,onClick:()=>l==null?void 0:l(g),role:l?"button":void 0,tabIndex:l?0:void 0,children:[e.jsxs("span",{className:"nice-round-list__order",children:["#",g.order]}),e.jsx("span",{className:"nice-round-list__icon",children:Is[g.status]}),e.jsxs("div",{className:"nice-round-list__info",children:[e.jsx("strong",{className:"nice-round-list__name",children:g.name}),g.description&&e.jsx("small",{children:g.description}),g.type&&e.jsx("span",{className:"nice-round-list__type",children:g.type})]}),e.jsx("span",{className:"nice-round-list__status",style:{color:Cs[g.status]},children:g.status}),g.durationMinutes&&e.jsxs("span",{className:"nice-round-list__duration",children:[g.durationMinutes,"m"]}),g.winnerIds&&g.winnerIds.length>0&&e.jsxs("span",{className:"nice-round-list__winners",children:["🏆 ",g.winnerIds.length]}),t&&e.jsxs("div",{className:"nice-round-list__actions",onClick:b=>b.stopPropagation(),children:[g.status==="upcoming"&&d&&e.jsx("button",{onClick:()=>d(g.id),children:"Start"}),(g.status==="active"||g.status==="voting")&&m&&e.jsx("button",{onClick:()=>m(g.id),children:"End"})]})]},g.id)})})]})}),Ms=o.forwardRef(function(s,a){const{round:n,timerRunning:r=!1,remainingSeconds:l,onSubmitScore:d,onStart:m,onEnd:h,onSkip:t,editable:u=!1,footerActions:p,className:_,style:g}=s,[x,b]=o.useState({}),k=o.useCallback(c=>{const N=parseFloat(x[c]??"");isNaN(N)||!d||(d(c,N),b(v=>({...v,[c]:""})))},[x,d]),j=c=>{const N=Math.floor(c/60),v=c%60;return`${N}:${v.toString().padStart(2,"0")}`},M=n.scores?[...n.scores].sort((c,N)=>N.score-c.score):[];return e.jsxs("div",{ref:a,className:`nice-round-card nice-round-card--${n.status} ${_??""}`,style:g,children:[e.jsxs("div",{className:"nice-round-card__header",children:[e.jsxs("span",{className:"nice-round-card__order",children:["Round #",n.order]}),e.jsx("h3",{className:"nice-round-card__name",children:n.name}),e.jsx("span",{className:"nice-round-card__status",children:n.status})]}),n.description&&e.jsx("p",{className:"nice-round-card__description",children:n.description}),(r||l!=null)&&e.jsxs("div",{className:`nice-round-card__timer ${r?"nice-round-card__timer--running":""}`,children:["⏱️ ",l!=null?j(l):"—"]}),M.length>0&&e.jsxs("div",{className:"nice-round-card__scoreboard",children:[e.jsx("h4",{children:"Scoreboard"}),e.jsxs("table",{className:"nice-round-card__scores-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Participant"}),e.jsx("th",{children:"Score"})]})}),e.jsx("tbody",{children:M.map((c,N)=>e.jsxs("tr",{className:N<3?`nice-round-card__top-${N+1}`:"",children:[e.jsxs("td",{children:[c.rank??N+1,N===0?" 🥇":N===1?" 🥈":N===2?" 🥉":""]}),e.jsx("td",{children:c.participantName}),e.jsx("td",{children:c.score})]},c.participantId))})]})]}),d&&(n.status==="active"||n.status==="voting")&&M.length>0&&e.jsxs("div",{className:"nice-round-card__score-input",children:[e.jsx("h4",{children:"Submit Scores"}),M.map(c=>e.jsxs("div",{className:"nice-round-card__score-row",children:[e.jsx("span",{children:c.participantName}),e.jsx("input",{type:"number",value:x[c.participantId]??"",onChange:N=>b(v=>({...v,[c.participantId]:N.target.value})),min:0,step:1,placeholder:"Score"}),e.jsx("button",{onClick:()=>k(c.participantId),children:"Submit"})]},c.participantId))]}),e.jsxs("div",{className:"nice-round-card__footer",children:[u&&e.jsxs("div",{className:"nice-round-card__actions",children:[n.status==="upcoming"&&m&&e.jsx("button",{onClick:m,children:"▶ Start Round"}),(n.status==="active"||n.status==="voting")&&h&&e.jsx("button",{onClick:h,children:"⏹ End Round"}),n.status==="upcoming"&&t&&e.jsx("button",{onClick:t,children:"⏭ Skip"})]}),p]}),n.winnerIds&&n.winnerIds.length>0&&e.jsxs("div",{className:"nice-round-card__winners",children:["🏆 Winners: ",n.winnerIds.length]})]})}),Ts=o.forwardRef(function(s,a){const{songs:n,onAdd:r,onRemove:l,onVote:d,onSearch:m,showQueue:h=!0,readOnly:t=!1,className:u,style:p}=s,[_,g]=o.useState(""),x=o.useMemo(()=>{if(!_.trim())return n;const c=_.toLowerCase();return n.filter(N=>N.title.toLowerCase().includes(c)||N.artist.toLowerCase().includes(c))},[n,_]),b=o.useMemo(()=>n.filter(c=>c.isQueued),[n]),k=n.find(c=>c.isPlaying),j=c=>{g(c),m==null||m(c)},M=c=>{if(!c)return"";const N=Math.floor(c/60),v=c%60;return`${N}:${v.toString().padStart(2,"0")}`};return e.jsxs("div",{ref:a,className:`nice-song-picker ${u??""}`,style:p,children:[k&&e.jsxs("div",{className:"nice-song-picker__now-playing",children:[e.jsx("span",{className:"nice-song-picker__np-label",children:"🎵 Now Playing"}),k.albumArt&&e.jsx("img",{src:k.albumArt,alt:"",className:"nice-song-picker__album-art"}),e.jsx("strong",{children:k.title}),e.jsx("span",{children:k.artist})]}),e.jsx("input",{type:"text",value:_,onChange:c=>j(c.target.value),placeholder:"Search songs…",className:"nice-song-picker__search"}),e.jsx("div",{className:"nice-song-picker__list",children:x.length===0?e.jsx("p",{className:"nice-song-picker__empty",children:"No songs found."}):x.map(c=>e.jsxs("div",{className:`nice-song-picker__item ${c.isPlaying?"nice-song-picker__item--playing":""}`,children:[c.albumArt&&e.jsx("img",{src:c.albumArt,alt:"",className:"nice-song-picker__thumb"}),e.jsxs("div",{className:"nice-song-picker__info",children:[e.jsx("strong",{children:c.title}),e.jsx("span",{children:c.artist}),c.duration&&e.jsx("span",{className:"nice-song-picker__duration",children:M(c.duration)}),c.addedByName&&e.jsxs("small",{children:["Added by ",c.addedByName]})]}),!t&&e.jsxs("div",{className:"nice-song-picker__actions",children:[d&&e.jsxs("button",{onClick:()=>d(c.id),children:["👍 ",c.votes??0]}),r&&!c.isQueued&&e.jsx("button",{onClick:()=>r(c.id),children:"+ Queue"}),l&&c.isQueued&&e.jsx("button",{onClick:()=>l(c.id),children:"Remove"})]})]},c.id))}),h&&b.length>0&&e.jsxs("div",{className:"nice-song-picker__queue",children:[e.jsxs("h4",{children:["Queue (",b.length,")"]}),b.map((c,N)=>e.jsxs("div",{className:"nice-song-picker__queue-item",children:[e.jsxs("span",{className:"nice-song-picker__queue-pos",children:[N+1,"."]}),e.jsxs("span",{children:[c.title," — ",c.artist]})]},c.id))]})]})}),As=o.forwardRef(function(s,a){const{songs:n,queue:r=[],onEnqueue:l,onDequeue:d,onNext:m,nowPlayingId:h,readOnly:t=!1,className:u,style:p}=s,[_,g]=o.useState(""),[x,b]=o.useState(""),k=n.find(v=>v.id===h),j=o.useMemo(()=>{let v=n;if(_.trim()){const T=_.toLowerCase();v=v.filter(S=>S.title.toLowerCase().includes(T)||S.artist.toLowerCase().includes(T))}return x&&(v=v.filter(T=>T.difficulty===x)),v},[n,_,x]),M=o.useMemo(()=>new Set(r.map(v=>v.id)),[r]),c=["easy","medium","hard","expert"],N=v=>{switch(v){case"easy":return"#4caf50";case"medium":return"#ff9800";case"hard":return"#f44336";case"expert":return"#9c27b0";default:return"#999"}};return e.jsxs("div",{ref:a,className:`nice-karaoke-picker ${u??""}`,style:p,children:[k&&e.jsxs("div",{className:"nice-karaoke-picker__now-singing",style:{borderLeft:"4px solid #e91e63",padding:"12px",marginBottom:12,background:"#fce4ec"},children:[e.jsx("span",{style:{fontWeight:600},children:"🎤 Now Singing"}),e.jsxs("div",{children:[e.jsx("strong",{children:k.title})," — ",k.artist,k.performerName&&e.jsxs("span",{children:[" (by ",k.performerName,")"]})]}),!t&&m&&e.jsx("button",{onClick:m,style:{marginTop:8},children:"Skip / Next ⏭"})]}),e.jsxs("div",{className:"nice-karaoke-picker__filters",style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("input",{type:"text",value:_,onChange:v=>g(v.target.value),placeholder:"Search songs or artists…",style:{flex:1}}),e.jsxs("select",{value:x,onChange:v=>b(v.target.value),children:[e.jsx("option",{value:"",children:"All Difficulties"}),c.map(v=>e.jsx("option",{value:v,children:v},v))]})]}),e.jsx("div",{className:"nice-karaoke-picker__catalog",children:j.length===0?e.jsx("p",{children:"No songs match your search."}):j.map(v=>e.jsxs("div",{className:"nice-karaoke-picker__song",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #eee"},children:[e.jsxs("div",{children:[e.jsx("strong",{children:v.title})," — ",v.artist,v.difficulty&&e.jsxs("span",{style:{marginLeft:8,fontSize:12,color:N(v.difficulty),fontWeight:600},children:["[",v.difficulty,"]"]}),v.hasLyrics&&e.jsx("span",{style:{marginLeft:6,fontSize:12},title:"Lyrics available",children:"📝"}),v.language&&e.jsxs("span",{style:{marginLeft:6,fontSize:12,color:"#666"},children:["(",v.language,")"]})]}),!t&&e.jsx("div",{children:M.has(v.id)?e.jsx("button",{onClick:()=>d==null?void 0:d(v.id),style:{color:"#f44336"},children:"Remove"}):e.jsx("button",{onClick:()=>l==null?void 0:l(v.id),children:"🎤 Sing"})})]},v.id))}),r.length>0&&e.jsxs("div",{className:"nice-karaoke-picker__queue",style:{marginTop:16},children:[e.jsxs("h4",{children:["🎶 Queue (",r.length,")"]}),r.map((v,T)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0"},children:[e.jsxs("span",{children:[e.jsxs("strong",{children:[T+1,"."]})," ",v.title," — ",v.artist,v.performerName&&e.jsxs("em",{children:[" (",v.performerName,")"]})]}),!t&&d&&e.jsx("button",{onClick:()=>d(v.id),style:{fontSize:12},children:"✕"})]},v.id))]})]})}),Ze={game:B.NtdGamepad,music:B.NtdMusic,dance:B.NtdMusic,quiz:B.NtdHelp,karaoke:B.NtdMicrophone,photo:B.NtdCamera,custom:B.NtdSparkle},$s={game:"Games",music:"Music",dance:"Dance",quiz:"Quiz",karaoke:"Karaoke",photo:"Photo",custom:"Custom"},Ps=o.forwardRef(function(s,a){const{attractions:n,onSelect:r,onDeselect:l,onVote:d,selectedIds:m=[],maxSelections:h,showVotes:t=!0,readOnly:u=!1,layout:p="grid",className:_,style:g}=s,[x,b]=o.useState(""),[k,j]=o.useState(""),M=o.useMemo(()=>new Set(m),[m]),c=o.useMemo(()=>{const S=new Set(n.map(R=>R.category));return Array.from(S)},[n]),N=o.useMemo(()=>{let S=n;if(x&&(S=S.filter(R=>R.category===x)),k.trim()){const R=k.toLowerCase();S=S.filter(y=>{var E;return y.name.toLowerCase().includes(R)||((E=y.description)==null?void 0:E.toLowerCase().includes(R))})}return S},[n,x,k]),v=!h||M.size<h,T=S=>{u||(M.has(S)?l==null||l(S):v&&(r==null||r(S)))};return e.jsxs("div",{ref:a,className:`nice-attraction-picker ${_??""}`,style:{color:"var(--text-primary)",...g},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h3",{style:{margin:0},children:"Attractions"}),h&&e.jsxs("span",{style:{color:"var(--text-secondary, #64748b)",fontSize:14},children:[M.size,"/",h," selected"]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap"},children:[e.jsx("input",{type:"text",value:k,onChange:S=>j(S.target.value),placeholder:"Search attractions…",style:{flex:1,minWidth:150}}),e.jsx("button",{onClick:()=>b(""),style:{fontWeight:x?400:700},children:"All"}),c.map(S=>e.jsxs("button",{onClick:()=>b(S===x?"":S),style:{fontWeight:S===x?700:400,display:"inline-flex",alignItems:"center",gap:4},children:[o.createElement(Ze[S],{size:14})," ",$s[S]]},S))]}),e.jsx("div",{style:{display:p==="grid"?"grid":"flex",gridTemplateColumns:p==="grid"?"repeat(auto-fill, minmax(200px, 1fr))":void 0,gap:12,flexDirection:p==="list"?"column":void 0},children:N.length===0?e.jsx("p",{children:"No attractions found."}):N.map(S=>{const R=M.has(S.id);return e.jsxs("div",{className:"nice-attraction-picker__card",style:{border:R?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",borderRadius:8,padding:12,cursor:u?"default":"pointer",background:R?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",transition:"all 0.2s"},onClick:()=>T(S.id),children:[S.imageUrl&&e.jsx("img",{src:S.imageUrl,alt:S.name,style:{width:"100%",borderRadius:6,marginBottom:8,objectFit:"cover",maxHeight:120}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{display:"inline-flex"},children:o.createElement(Ze[S.category],{size:16})}),e.jsx("strong",{children:S.name})]}),S.description&&e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",margin:"6px 0"},children:S.description}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:8},children:[t&&e.jsxs("span",{style:{fontSize:13,display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(B.NtdThumbsUp,{size:14})," ",S.votes??0]}),!u&&d&&e.jsx("button",{onClick:y=>{y.stopPropagation(),d(S.id)},style:{fontSize:12},children:"Vote"})]})]},S.id)})})]})}),Bs={game:B.NtdGamepad,music:B.NtdMusic,dance:B.NtdMusic,quiz:B.NtdHelp,karaoke:B.NtdMicrophone,photo:B.NtdCamera,custom:B.NtdSparkle},Rs=o.forwardRef(function(s,a){const{attractions:n,onVote:r,onUnvote:l,votedIds:d=[],maxVotes:m,closed:h=!1,sortBy:t="votes",showResults:u=!0,className:p,style:_}=s,g=o.useMemo(()=>new Set(d),[d]),x=m?m-g.size:void 0,b=o.useMemo(()=>{const c=[...n];switch(t){case"votes":c.sort((N,v)=>(v.votes??0)-(N.votes??0));break;case"name":c.sort((N,v)=>N.name.localeCompare(v.name));break;case"category":c.sort((N,v)=>N.category.localeCompare(v.category));break}return c},[n,t]),k=o.useMemo(()=>Math.max(...n.map(c=>c.votes??0),1),[n]),j=c=>{h||(g.has(c)?l==null||l(c):(!x||x>0)&&(r==null||r(c)))},M=c=>{switch(c){case 0:return e.jsx(B.NtdTrophy,{size:18,primaryColor:"#f59e0b",title:"1st place"});case 1:return e.jsx(B.NtdMedal,{size:18,primaryColor:"#94a3b8",title:"2nd place"});case 2:return e.jsx(B.NtdMedal,{size:18,primaryColor:"#b45309",title:"3rd place"});default:return`${c+1}.`}};return e.jsxs("div",{ref:a,className:`nice-attraction-voting ${p??""}`,style:{color:"var(--text-primary)",..._},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[e.jsxs("h3",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(B.NtdClipboardCheck,{size:20}),h?"Voting Results":"Vote for Attractions"]}),!h&&x!==void 0&&e.jsxs("span",{style:{fontSize:14,color:x>0?"var(--color-primary, #6366f1)":"var(--color-error, #ef4444)"},children:[x," vote",x!==1?"s":""," remaining"]})]}),h&&e.jsx("p",{style:{color:"var(--text-secondary, #64748b)",marginBottom:12},children:"Voting is closed. Final results:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:b.map((c,N)=>{const v=g.has(c.id),T=c.votes??0,S=u?`${Math.round(T/k*100)}%`:"0%";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:8,border:v?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",background:v?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",cursor:h?"default":"pointer",transition:"all 0.2s"},onClick:()=>j(c.id),children:[u&&e.jsx("span",{style:{fontSize:18,minWidth:32,textAlign:"center"},children:M(N)}),e.jsx("span",{style:{display:"inline-flex",fontSize:20},children:o.createElement(Bs[c.category],{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:600},children:c.name}),c.description&&e.jsx("div",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.description}),u&&e.jsx("div",{style:{marginTop:4,height:6,borderRadius:3,background:"var(--bg-tertiary, #e2e8f0)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:S,background:"var(--color-primary, #6366f1)",borderRadius:3,transition:"width 0.3s"}})})]}),u&&e.jsx("span",{style:{fontWeight:600,fontSize:16,minWidth:40,textAlign:"right"},children:T}),!h&&e.jsx("button",{onClick:R=>{R.stopPropagation(),j(c.id)},style:{padding:"4px 12px",borderRadius:4,border:"none",background:v?"var(--color-error, #ef4444)":"var(--color-primary, #6366f1)",color:"#fff",cursor:"pointer",fontSize:13},children:v?"Unvote":"Vote"})]},c.id)})}),u&&e.jsxs("div",{style:{marginTop:12,textAlign:"right",fontSize:13,color:"var(--text-secondary, #64748b)"},children:["Total votes: ",n.reduce((c,N)=>c+(N.votes??0),0)]})]})});exports.NiceAttractionPicker=Ps;exports.NiceAttractionVoting=Rs;exports.NiceEventMedia=Pn;exports.NiceEventPlanning=En;exports.NiceExpenseSplit=Ss;exports.NiceGiftRegistry=js;exports.NiceInvitationDesigner=fs;exports.NiceKaraokePicker=As;exports.NiceMediaCollage=Bn;exports.NiceParticipantList=Xn;exports.NiceRoundCard=Ms;exports.NiceRoundList=zs;exports.NiceRsvpControl=Pe;exports.NiceSeatPicker=ds;exports.NiceSeatingChart=tn;exports.NiceSongPicker=Ts;
|