PageSourceSearch

https://beatgig.com/_next/static/chunks/6934-20acb73b2fc54f58.js

js beatgig.com collected 2026-10-02 02:30:11 UTC 83,877 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6934],{55683:function(e,n,t){t.d(n,{TK:function(){return A},s8:function(){return $},zD:function(){return z}});var i=t(552322),r=t(541251),o=t(152673),l=t(202784),s=t(175111),a=t(986541),d=t(755338),c=t(760941),u=t(454300),h=t(18732),g=t(802572),m=t(400816),x=t(406457),j=t(134569),v=t(627145),p=t(703440),f=t.n(p),b=t(446285),y=t(321568),I=t(817564),S=t(103757),C=t(33229);let $=(0,l.memo)(function(e){let n=(0,r.Jc)(z,e.availChecks),t=(0,l.useMemo)(()=>e.artistName&&e.artistName.length>0?null==n?void 0:n.filter(n=>n.artist.name.toLowerCase().includes(e.artistName.toLowerCase())):n,[n,e.artistName]),o=(0,l.useMemo)(()=>{if(!t)return[];let e=f()(t,e=>e.artist.id);return(0,b.qh)(e).map(e=>{var n;let[t,i]=e,r=[...i].sort((e,n)=>new Date(e.startTime).getTime()-new Date(n.startTime).getTime());return{artistName:i[0].artist.name,artistSlug:i[0].artist.slug,artistId:t,publicCloudinaryId:null===(n=i[0].artist.profileImage)||void 0===n?void 0:n.publicCloudinaryId,availChecks:r,sellerIds:i[0].artist.sellerIds}})},[t]);return(0,i.jsx)(m.Z,{ListEmptyComponent:e.listEmptyState,data:o,keyExtractor:e=>e.artistId,renderItem:(0,l.useCallback)(n=>{let{item:t}=n;return(0,i.jsx)(A,{item:t,setSelectedItem:e.setSelectedItem})},[e.setSelectedItem]),estimatedItemSize:350})}),z=(0,o.B)("\n  fragment AvailCheckByArtistListCheck on AvailCheck {\n    slot {\n      id\n      stage {\n        id\n        name\n        indoorsOrOutdoors\n      }\n    }\n    id\n    startTime\n    location {\n      timezone\n    }\n    performanceLengthMins\n    artist {\n      id\n      slug\n      name\n      sellerIds\n      profileImage {\n        publicCloudinaryId\n      }\n    }\n    venue: organization {\n      id\n      slug\n      name\n      accountManager {\n        id\n        firebaseId\n      }\n    }\n    response\n    respondedAt\n  }\n"),A=(0,l.memo)(function(e){var n;let{item:t,setSelectedItem:r,isSelected:o=!1,setResponseFilter:m}=e,[p,f]=(0,l.useState)(!1),b=null===(n=(0,x.Z)().user)||void 0===n?void 0:n.uid,{openChat:$}=(0,v.P3)(),z=(0,j.Uo)(),A=(0,S.V)(async e=>{let{artistId:n,artistName:t,venueId:i,sellerIds:r,artistProfileImageId:o}=e;b&&(null==r?void 0:r.length)&&z.mutate({shouldUpsertRoom:!0,requestBody:{...t&&{name:t},...o&&{fallback_image_id:o},user_ids:Array.from(new Set([b,...r])),tags:{organization_tags:{add_ids:[i]},artist_tags:{add_ids:[n]}}}},{onSuccess(e){$(e.id)}})}),k=(0,l.useMemo)(()=>t.availChecks.filter(e=>"available"===e.response).length,[t.availChecks]),T=(0,l.useMemo)(()=>t.availChecks.filter(e=>"unavailable"===e.response).length,[t.availChecks]),w=(0,l.useMemo)(()=>t.availChecks.length-k-T,[t.availChecks,k,T]);return(0,i.jsx)(s.G,{pl:20,pr:20,mb:12,children:(0,i.jsxs)(s.G,{width:"100%",p:20,bg:p&&!o?"transparent":"#161617",br:10,gap:20,cursor:o?"default":"pointer",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPress:()=>{null==r||r(t)},children:[p&&!o&&"web"===C.Z.OS&&(0,i.jsx)(y.o,{colors:["rgba(255,255,255,0.02)","rgba(255,255,255,0.02)"],start:[0,0],end:[0,1],br:10,style:{...I.Z.absoluteFillObject,backgroundColor:"#161617",zIndex:-1}}),(0,i.jsxs)(s.G,{flexDirection:"row",jc:"space-between",children:[(0,i.jsxs)(s.G,{flexDirection:"row",gap:20,transition:"all 0.3s ease-in-out",children:[(0,i.jsx)(a.q,{size:42,round:!0,children:(0,i.jsx)(a.q.ImageOrInitials,{publicCloudinaryId:null==t?void 0:t.publicCloudinaryId,name:t.artistName,sizes:"42px"})}),(0,i.jsxs)(s.G,{gap:4,children:[(0,i.jsx)(d.x,{fontSize:16,numberOfLines:2,fontWeight:500,children:t.artistName}),(0,i.jsxs)(d.x,{color:"#9CA1A6",fontSize:14,fontWeight:400,children:[t.availChecks.length," requests sent"]})]})]}),!o&&(0,i.jsx)(s.G,{p:4,ai:"center",jc:"center",opacity:p?1:0,transition:"all 0.3s ease-in-out",left:p?0:-10,children:(0,i.jsx)(c.T,{size:24})}),o&&(0,i.jsx)(u.z,{accessibilityLabel:"Chat with artist",square:!0,p:12,borderRadius:"$rounded",bg:"#1F1F1F",hoverStyle:{bg:"#353537",scale:1},onPress:()=>{var e;A({artistId:t.artistId,venueName:t.availChecks[0].venue.name,artistName:t.artistName,venueId:t.availChecks[0].venue.id,sellerIds:t.sellerIds,artistProfileImageId:t.publicCloudinaryId,accountManagerId:null===(e=t.availChecks[0].venue.accountManager)||void 0===e?void 0:e.firebaseId})},children:(0,i.jsx)(u.z.Icon,{icon:h.j,size:16})})]}),(0,i.jsxs)(s.G,{flexDirection:"row",gap:8,children:[(0,i.jsxs)(s.G,{gap:8,flexDirection:"row",ai:"center",jc:"center",bg:"rgba(163, 235, 138, 0.10)",br:"$rounded",px:12,py:4,w:118,cursor:o?"pointer":"default",onPress:()=>{null==m||m("available")},children:[(0,i.jsx)(g.L,{color:"#A3EB8A",size:8}),(0,i.jsxs)(s.G,{gap:6,flexDirection:"row",ai:"center",children:[(0,i.jsx)(d.x,{fontSize:14,lh:21,fontWeight:500,children:k}),(0,i.jsx)(d.x,{fontSize:14,lh:21,fontWeight:500,children:"Available"})]})]}),(0,i.jsxs)(s.G,{gap:8,flexDirection:"row",ai:"center",jc:"center",bg:"rgba(255, 104, 104, 0.10)",br:"$rounded",px:12,py:4,maxWidth:59,cursor:o?"pointer":"default",onPress:()=>{null==m||m("unavailable")},children:[(0,i.jsx)(g.L,{color:"#FF6868",size:8}),(0,i.jsx)(d.x,{fontSize:14,lh:21,fontWeight:500,children:T})]}),(0,i.jsxs)(s.G,{gap:8,flexDirection:"row",ai:"center",jc:"center",bg:"rgba(156, 161, 166, 0.10)",br:"$rounded",px:12,py:4,maxWidth:59,cursor:o?"pointer":"default",onPress:()=>{null==m||m("pending")}
1,children:[(0,i.jsx)(g.L,{color:"#9CA1A6",size:8}),(0,i.jsx)(d.x,{fontSize:14,lh:21,fontWeight:500,children:w})]})]})]})})})},837070:function(e,n,t){t.d(n,{I:function(){return v},m:function(){return j}});var i=t(552322),r=t(652525),o=t(202784),l=t(152673),s=t(55683),a=t(720295),d=t(481108),c=t(175111),u=t(831318),h=t(755338),g=t(454300),m=t(791964),x=t(33229);function j(e){var n,t;let{venueSlugs:l,onlyShowAvailsWithCheckResponses:j,artistIds:f,setSelectedItem:b,artistName:y}=e,I=d.n.isAdmin((0,a.Z)().data),S=I&&!(null==l?void 0:l.length),C=(0,r.NE)(I?p:v,{memoizedVariables:(0,o.useMemo)(()=>({limit:1e4,order:{lastUpdatedAt:{dir:"ASC"}},filter:{isInFuture:{eq:!0},...(null==l?void 0:l.length)&&{organizationSlug:{in:l}},hasConfirmedBookingOnSlot:{eq:!1},...j&&{response:{exists:!0}},markedAsComplete:{neq:!0},...(null==f?void 0:f.length)&&{artistId:{in:f}}}}),[j,l,f]),requestPolicy:"cache-and-network",pause:S},{getLength:e=>e.availChecks.length}),{setOpenBookingFlow:$,setBookingType:z,setBookingStep:A}=(0,m.V2)(),k=(0,o.useMemo)(()=>{var e;return C.fetching||!(null===(e=C.data)||void 0===e?void 0:e.availChecks)||C.isLoadingInitial||C.stale?(0,i.jsx)(c.G,{p:"$2",ai:"center",jc:"center",h:50,children:(0,i.jsx)(u.T,{size:"small"})}):(0,i.jsxs)(c.G,{gap:40,minHeight:300,jc:"center",px:40,ai:"center",children:[(0,i.jsxs)(c.G,{gap:12,children:[(0,i.jsx)(h.x,{fontWeight:600,fontSize:18,lh:22,textAlign:"center",children:"Nothing Here Yet"}),(0,i.jsx)(h.x,{fontWeight:400,fontSize:14,lh:22,textAlign:"center",textOverflow:"ellipsis",textWrap:"wrap",children:"Start requesting artist availability to see \n who’s free for your upcoming dates."})]}),"web"===x.Z.OS&&(0,i.jsx)(g.z,{accessibilityLabel:"Request artist availability",br:3,h:40,maxWidth:208,brandV2:!0,onPress:()=>{z("availability"),A(2),$(!0)},children:(0,i.jsx)(g.z.Text,{fontSize:14,fontWeight:500,color:"#121214",children:"Request Artist Availability"})})]})},[null===(n=C.data)||void 0===n?void 0:n.availChecks,C.fetching,C.isLoadingInitial,C.stale,A,z,$]);return(0,i.jsx)(s.s8,{availChecks:null===(t=C.data)||void 0===t?void 0:t.availChecks,setSelectedItem:b,artistName:y,listEmptyState:k})}let v=(0,l.B)("\n  query ArtistAvailabilitiesByDateList(\n    $limit: Int!\n    $offset: Int!\n    $order: OrderAvailCheck!\n    $filter: FilterAvailCheck!\n  ) {\n    availChecks: availChecksByFilterBuyer(\n      limit: $limit\n      offset: $offset\n      order: $order\n      filter: $filter\n    ) {\n      id\n      ...AvailCheckByArtistListCheck\n    }\n  }\n"),p=(0,l.B)("\n  query ArtistAvailabilitiesByDateListWithAdmin(\n    $limit: Int!\n    $offset: Int!\n    $order: OrderAvailCheck!\n    $filter: FilterAvailCheck!\n  ) {\n    availChecks: availChecksByFilterAdmin(\n      limit: $limit\n      offset: $offset\n      order: $order\n      filter: $filter\n    ) {\n      id\n      ...AvailCheckByArtistListCheck\n    }\n  }\n")},232793:function(e,n,t){function i(e){var n;if(!(null==e?void 0:e.length))return null;let t=e[0];return{artistName:t.artist.name,artistSlug:t.artist.slug,artistId:t.artist.id,publicCloudinaryId:null===(n=t.artist.profileImage)||void 0===n?void 0:n.publicCloudinaryId,availChecks:e,sellerIds:t.artist.sellerIds}}function r(e,n){return e?e.filter(e=>"available"===n?"available"===e.response:"unavailable"===n?"unavailable"===e.response:"pending"!==n||null===e.response||void 0===e.response):[]}t.d(n,{D:function(){return i},N:function(){return r}})},251901:function(e,n,t){t.d(n,{l:function(){return i}});let i=(0,t(152673).B)("\n  mutation CreateConfirmedVenueBooking(\n    $dateAndTimes: [DateAndTime!]!\n    $bookingInsert: BookingInsertDIY!\n  ) {\n    createConfirmedBookings: createBookingsDiyBuyer(\n      startTimes: $dateAndTimes\n      insert: $bookingInsert\n    ) {\n      id\n    }\n  }\n")},952185:function(e,n,t){t.d(n,{h:function(){return h}});var i=t(552322),r=t(341732),o=t(755338),l=t(784420),s=t(175111),a=t(608955),d=t(183896),c=t(446285),u=t(202784);function h(e){let{onDelete:n,modal:t}=e,[h,g]=(0,u.useState)({isOpen:!1,id:null});(0,u.useImperativeHandle)(t,()=>({open:e=>{let{id:n}=e;return g({isOpen:!0,id:n})}}));let[m,x]=(0,u.useState)("THIS_EVENT"),j=()=>{g({isOpen:!1,id:null}),x("THIS_EVENT")};return(0,i.jsx)(d.Vq,{open:h.isOpen,onOpenChange:e=>{e||j()},children:(0,i.jsxs)(d.Vq.Portal,{children:[(0,i.jsx)(r.Theme,{inverse:!0,children:(0,i.jsx)(d.Vq.Overlay,{})}),(0,i.jsxs)(d.Vq.Content,{gap:"$4",maxWidth:400,children:[(0,i.jsx)(o.x,{fontWeight:"bold",children:"Delete repeat event"}),(0,i.jsx)(l.E,{value:m,gap:"$3",children:(0,c.qh)({THIS_EVENT:{title:"This event"},THIS_AND_FOLLOWING_EVENTS:{title:"This and following events"},ALL_EVENTS:{title:"All events"}}).map(e=>{let[n,{title:t}]=e;return(0,i.jsx)(u.Fragment,{children:(0,i.jsxs)(s.G,{cursor:"pointer",onPress:()=>{x(n)},fd:"row",gap:"$2",children:[(0,i.jsx)(l.E.Item,{value:n,cursor:"inherit",children:(0,i.jsx)(l.E.Indicator,{})}),(0,i.jsx)(s.G,{f:1,children:(0,i.jsx)(o.x,{cursor:"inherit",tag:"label",color:"$color12",children:t})})]})},n)})}),(0,i.jsxs)(s.G,{fd:"row",jc:"flex-end",gap:"$2",children:[(0,i.jsx)(a.$,{bg:"$color1",accessibilityLabel:"Cancel",onPress:j,children:(0,i.jsx)(a.$.Text,{children:"Cancel"})}),(0,i.jsx)(a.$,{theme:"red",accessibilityLabel:"Delete event",onPress:()=>{h.isOpen&&n({instruction:m,id:h.id}),j()},children:(0,i.jsx)(a.$.Text,{children:"Delete"})})]})]})]})})}h.useModal=function(){return(0,u.useRef)(null)}},33671:function(e,n,t){t.d(n,{j:function(){return o}});var i=t(652525),r=t(152673);function o(){return(0,i.Db)((0,r.B)("\n      mutation DeleteSlotsToFill($id: String!) {\n        deleteSlot(id: $id)\n      }\n    "))}},49094:function(e,n,t){t.d(n,{K:function(){return S}});var i=t(552322),r=t(175111),o=t(986541),l=t(755338),s=t(596823),a=t(105351),d=t(481752),c=t(481108),u=t
1(720295),h=t(915815),g=t(547876),m=t(606450),x=t(737007),j=t(566512),v=t(365053),p=t(152673),f=t(541251),b=t(505309),y=t(589288);let I=(0,p.B)("\n  fragment HoldExistingBooking on Hold {\n    id\n    __typename\n    booking {\n      ...BookingMyOrgPermissions\n      lastActionAt\n      lastActionDescriptions {\n        forBuyer\n        forSeller\n      }\n      id\n      startTime\n      timezone\n      status\n      artist {\n        id\n        slug\n        name\n        profileImage {\n          publicCloudinaryId\n        }\n      }\n      venue: organization {\n        slug\n        name\n        id\n      }\n    }\n  }\n");function S(e){let n=(0,f.Jc)(I,e.hold),{venueSlugs:t}=(0,j.e)(),p=null==n?void 0:n.booking,S=(0,u.Z)().data,C=c.n.isSeller(S);if(!p)return null;let{year:$,month:z,day:A}=(0,b.xe)({startTime:p.startTime,timezone:p.timezone}).luxon,k=h.A[p.status];return(0,i.jsxs)(y.T,{booking:p,children:[(0,i.jsxs)(r.G,{m:"$3",theme:k.theme,bg:"$color1",p:"$3",bw:2,boc:"$color7",br:"$3",gap:"$3",children:[(0,i.jsxs)(r.G,{fd:"row",gap:"$3",ai:"center",children:[p.artist.profileImage&&(0,i.jsx)(o.q,{round:!0,size:30,children:(0,i.jsx)(o.q.Image,{src:p.artist.profileImage.publicCloudinaryId,fill:!0,sizes:"50px",alt:p.artist.name,loader:"cloudinary"})}),(0,i.jsx)(r.G,{f:1,children:(0,i.jsx)(l.x,{weight:"bold",children:p.artist.name})})]}),(0,i.jsx)(s.C,{theme:k.theme,als:"flex-start",border:!0,children:(0,i.jsxs)(s.C.Text,{children:["Booking Status: ",k.title]})}),C?(0,i.jsx)(l.x,{children:p.lastActionDescriptions.forSeller}):(0,i.jsx)(v.LE,{requiredPermissions:["write_bookings","view_booking_pricing_and_invoices"],mode:"any permissions match",children:(0,i.jsx)(l.x,{children:p.lastActionDescriptions.forBuyer})}),(0,i.jsxs)(l.x,{color:"$color11",children:["Updated"," ",g.o.fromISO(p.lastActionAt).toLocaleString({weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"})]}),"declined"===p.status?(0,i.jsx)(r.G,{}):(0,i.jsxs)(d.Q,{themeInverse:!0,accessibilityLabel:"View Booking",replace:!0,experimental:{nativeBehavior:"stack-replace",isNestedNavigator:!0},href:p.venue?m.pagesPath.dashboard.venue_calendar.bookings._bookingId(p.id).$url({query:{year:$,month:z,day:A,venueSlug:t}}):m.pagesPath.dashboard.bookings._id(p.id).$url({query:{}}),children:[(0,i.jsx)(d.Q.Text,{children:"View Booking"}),(0,i.jsx)(d.Q.Icon,{icon:a.d})]})]}),(0,i.jsx)(x.tm,{})]})}},951863:function(e,n,t){t.d(n,{t:function(){return er}});var i=t(552322),r=t(175111),o=t(195388),l=t(755338),s=t(986541),a=t(105351),d=t(73031),c=t(831318),u=t(152673),h=t(541251),g=t(134569),m=t(650757),x=t(490667),j=t(955261),v=t(720295),p=t(273559),f=t(383969),b=t(33229),y=t(406457),I=t(419424),S=t(341732),C=t(861315),$=t(341175),z=t(652525),A=t(76100),k=t(884443),T=t(547876),w=t(306281),B=t(160889),G=t(339931),F=t(957013),D=t(454300),O=t(251901),P=t(238769),q=t(481108),_=t(497096),L=t(606450),E=t(181942),M=t(84951),Z=t(202784),N=t(330929),R=t(858612),W=t(727432),V=t(505309),H=t(940246);let U=(0,S.styled)(r.G,{br:"$3",bg:"$color1",p:"$3",bw:2,boc:"$borderColor"}),J=(0,W.A)(),Q=(0,u.B)("\n  query HoldDetailArtistAvailability_BookArtistModal($artistId: String!) {\n    artistById(id: $artistId) {\n      id\n      slug\n      name\n      category\n      profileImage {\n        publicCloudinaryId\n      }\n    }\n  }\n"),K=(0,u.B)("\n  fragment CreateBookingFromHold on Hold {\n    id\n    startTime\n    billing\n    indoorsOrOutdoors\n    performanceLengthMins\n    organization {\n      paysManually\n      id\n      slug\n      isDiy\n      venue {\n        id\n      }\n      location {\n        timezone\n      }\n      defaultPaymentMethod {\n        __typename\n        ... on StripeBankAccount {\n          id\n        }\n        ... on StripeCard {\n          id\n        }\n      }
1\n      ...VenueNewBookingForm_PaymentMethod\n    }\n    artist {\n      id\n      slug\n      name\n    }\n  }\n"),X=(0,C.$)(function(e){return(0,i.jsx)(A.Z.Portaled,{...e})},{Trigger:A.Z.Portaled.Trigger,Content:function(e){return(0,i.jsx)(A.Z.Portaled.Content,{scrollable:!1,dangerouslyDisableNativeScroll:!0,header:!0,title:"Create Booking",padded:!1,plainDiv:!0,children:(0,i.jsx)(ee,{...e})})}}),Y=(0,u.B)("\n  query CreateBookingFromHold($holdId: String!) {\n    holdById(id: $holdId) {\n      id\n      startTime\n      performanceLengthMins\n      organization {\n        id\n        slug\n      }\n      ...CreateBookingFromHold\n    }\n  }\n");function ee(e){let n=(0,I.t)(),{params:t}=(0,E.h)(),{toast:r}=(0,M.Z)(),o=e.artistId,l=A.Z.Portaled.useContext(),{data:s,error:a,stale:d}=(0,z.aM)(Y,{variables:{holdId:e.holdId}}),c=null==s?void 0:s.holdById;return c?(0,i.jsx)(en,{initialInsert:e.initialInsert,hold:c,artistId:o,onDidCreateBookings:e=>{var i;l.onRequestClose();let{day:o,month:s,year:a}=T.o.fromISO(c.startTime);r({title:1===e.length?"Booking created":"Bookings created",preset:"done",message:"Redirecting you..."}),n.replace(L.pagesPath.dashboard.venue_calendar.bookings._bookingId(e[0]).$url({query:{venueSlug:Array.from(new Set([c.organization.slug].concat(null!==(i=t.venueSlug)&&void 0!==i?i:[]))),year:a,month:s,day:o}}),void 0,{experimental:{isNestedNavigator:!0,nativeBehavior:"stack-replace"}})}},c.id):(0,i.jsx)(w.Z,{error:a})}function en(e){let n=(0,v.Z)().data,{artistId:t}=e,o="id"in e.hold?e.hold:(0,k.S3)(K,e.hold),{billing:a,indoorsOrOutdoors:d}=o,c=(0,z.Db)(P.d$),u=(0,z.Db)(O.l),h=(0,z.Db)(P.N9),g=J.useForm({defaultValues:{...e.initialInsert,holdIds:[o.id]}}),m=u.error||h.error,x=q.n.isAdmin(n)||o.organization.isDiy||q.n.isAgent(n),{toast:j}=(0,M.Z)(),[p,f]=(0,Z.useState)(!1);return(0,i.jsx)(J.FormProvider,{...g,children:(0,i.jsx)(z.AE,{query:Q,variables:{artistId:t},children:u=>{var h,v;let b=null===(h=u.data)||void 0===h?void 0:h.artistById;if(!b)return(0,i.jsx)(w.Z,{error:u.error});let y=i=>{let{shouldAutoConfirmBooking:r}=i;return g.handleSubmit(async i=>{var l,s,u;let h,{bandConfiguration:g,buyerPrice:m,comments:x,platformFee:v=0,agencyFee:f=0,buyerNotes:b,status:y=r?"confirmed":"negotiating"}=i;if(!q.n.isAgent(n))return;let I=(0,V.xe)({startTime:o.startTime,timezone:null!==(s=null===(l=o.organization.location)||void 0===l?void 0:l.timezone)&&void 0!==s?s:T.o.local().zoneName}).luxon,S={date:I.toISODate(),time:{hour:I.hour,minute:I.minute}},C={billing:a,indoorsOrOutdoors:d,performanceLengthMins:null!==(u=o.performanceLengthMins)&&void 0!==u?u:0,bandConfiguration:g,shouldAutoPublish:null!=o.organization.venue,fromHoldId:o.id,artistId:t,buyerPrice:m,organizationId:o.organization.id,isPublished:null!=o.organization.venue,comments:x,buyerNotes:b},{data:$,error:z}=await c.execute({startTimes:[S],input:{...C,status:y,stillRequiresContract:null==o.organization.venue&&!r,agencyFee:f,platformFee:v,buyerNotes:b,...q.n.isAdmin(n)&&p?{is4AmEvent:!0}:{}}});if(!z&&$){let[e,...n]=$.createBookingsAgent;e&&(h=[e.id,...n.map(e=>e.id)])}if(null==h?void 0:h.length){let[n,...t]=h;n&&e.onDidCreateBookings([n,...t])}else j({preset:"error",title:"Error creating booking",message:"No bookings created."})})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($.X,{children:(0,i.jsxs)(r.G,{gap:"$3",p:"$3",children:[(0,i.jsx)(l.x,{children:"Ready to create this booking?"}),(0,i.jsxs)(r.G,{gap:"$2",children:[(0,i.jsxs)(U,{fd:"row",gap:"$3",children:[(0,i.jsx)(s.q,{size:50,round:!0,children:(0,i.jsx)(s.q.ImageOrInitials,{name:b.name,sizes:"50px",publicCloudinaryId:null==b?void 0:null===(v=b.profileImage)||void 0===v?void 0:v.publicCloudinaryId})}),(0,i.jsx)(r.G,{als:"center",f:1,gap:"$2",children:(0,i.jsx)(l.x,{bold:!0,children:b.name})})]}),(0,i.jsxs)(U,{gap:"$2",children:[(0,i.jsx)(l.x,{color:"$color11",children:"Date"}),(0,i.jsxs)(r.G,{gap:"$1",children:[(0,i.jsx)(l.x,{children:T.o.fromISO(o.startTime).toLocaleString({dateStyle:"full"})}),(0,i.jsx)(l.x,{color:"$color11",children:T.o.fromISO(o.startTime).toLocaleString({timeStyle:"short"})})]})]}),(0,i.jsx)(r.G,{children:(0,i.jsx)(J.Controller,{name:"buyerPrice",rules:{required:!0},scrollToError:!0,render:e=>{let{field:t,fieldState:r}=e;return(0,i.jsxs)(U,{theme:r.error?"red":void 0,gap:"$1",children:[(0,i.jsx)(B.P,{error:r.error,inputRef:t.ref,onChange:t.onChange,rate:t.value}),q.n.isAdmin(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J.Controller,{name:"platformFee",rules:{validate:e=>null!=e||"Enter a price."},scrollToError:!0,render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(B.P,{error:r.error,rate:null!==(n=t.value)&&void 0!==n?n:null,title:"Platform Fee",onChange:t.onChange,inputRef:t.ref})}}),(0,i.jsx)(J.Controller,{name:"agencyFee",rules:{validate:e=>null!=e||"Enter a price."},scrollToError:!0,render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(B.P,{error:r.error,rate:null!==(n=t.value)&&void 0!==n?n:null,onChange:t.onChange,inputRef:t.ref,title:"Agency Fee"})}})]})]})}})}),(!b.category||!F.L.has(b.category))&&(0,i.jsx)(r.G,{children:(0,i.jsx)(J.Controller,{scrollToError:!0,name:"bandConfiguration",rules:{required:!0},render:e=>{let{field:n,fieldState:t}=e;return(0,i.jsxs)(U,{fd:"row",ai:"center",theme:t.error?"red":void 0,children:[(0,i.jsx)(r.G,{f:1,children:(0,i.jsx)(l.x,{color:"$color11",children:"Configuration"})}),(0,i.jsx)(G.D,{error:t.error,bandConfiguration:n.value,onChange:n.onChange})]})}})}),(0,i.jsx)(U,{children:(0,i.jsx)(J.Controller,{name:"comments",render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(R.h,{comments:null!==(n=t.value)&&void 0!==n?n:"",onCh
1ange:t.onChange,error:r.error})}})}),(0,i.jsx)(U,{children:(0,i.jsx)(J.Controller,{name:"status",render:e=>{let{field:n}=e;return(0,i.jsx)(r.G,{bg:"$color2",p:"$3",br:"$3",gap:"$2",children:(0,i.jsx)(H.E,{status:n.value,onChange:n.onChange})})}})}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_._,{error:m}),(0,i.jsx)(J.Submit,{children:e=>{let{isValid:n,isSubmitting:t}=e;return(0,i.jsx)(N.GY,{isValid:!0,fetching:{autoConfirm:t,sendOffer:t},onChangeIs4AmEvent:f,submit:{autoConfirm:y({shouldAutoConfirmBooking:!0}),sendOffer:y({shouldAutoConfirmBooking:!1})}})}})]})]})]})}),!x&&(0,i.jsxs)(r.G,{p:"$3",pt:"$2",gap:"$2",children:[(0,i.jsx)(_._,{error:m}),(0,i.jsx)(J.Submit,{children:e=>{let{isSubmitting:n,hasErrored:t}=e;return(0,i.jsx)(D.z,{themeInverse:!0,accessibilityLabel:"Submit Book artist from hold",...t&&{themeInverse:!1,theme:"red"},onPress:y({shouldAutoConfirmBooking:!1}),loading:n,children:(0,i.jsx)(D.z.Text,{children:"Submit Booking"})})}})]})]})}},t)})}var et=t(627145);let ei=(0,u.B)("\n  fragment HoldArtist on Hold {\n    id\n    startTime\n    publicNotes\n    organization {\n      id\n      slug\n      name\n      isDiy\n      venue {\n        id\n      }\n      accountManager {\n        firebaseId\n      }\n    }\n    artist {\n      id\n      slug\n      name\n      sellerIds\n      profileImage {\n        publicCloudinaryId\n      }\n    }\n  }\n");function er(e){var n,t;let u=(0,h.Jc)(ei,e.hold),S=(0,g.Uo)(),{openChat:C}=(0,et.P3)(),$=(0,v.Z)().data,{setParams:z,bookArtistId:A}=(0,j.t)(),k=e=>{z({bookArtistId:e})},T=null===(n=(0,y.Z)().user)||void 0===n?void 0:n.uid,w=(0,x.Z)(S.isPending),B=(0,I.t)();return u.artist?(0,i.jsxs)(r.G,{p:"$3",gap:"$3",children:[(0,i.jsxs)(r.G,{p:"$3",gap:"$3",bg:"$color1",br:"$3",ov:"hidden",children:[(0,i.jsxs)(r.G,{fd:"row",gap:"$2",ai:"center",children:[(0,i.jsx)(o.i,{size:20,color:"$brand"}),(0,i.jsx)(l.x,{fontSize:14,color:"$brand",children:"Hold Artist"})]}),(0,i.jsx)(r.G,{hoverStyle:{bg:"$color4"},mx:"$-3",cursor:"pointer",children:(0,i.jsxs)(p.h,{children:[(0,i.jsx)(p.h.Trigger,{children:(0,i.jsxs)(r.G,{py:"$2",fd:"row",px:"$3",ai:"center",gap:"$3",children:[(0,i.jsx)(s.q,{round:!0,children:(0,i.jsx)(s.q.ImageOrInitials,{publicCloudinaryId:null===(t=u.artist.profileImage)||void 0===t?void 0:t.publicCloudinaryId,name:u.artist.name,sizes:"50px"})}),(0,i.jsx)(r.G,{grow:!0,children:(0,i.jsx)(l.x,{bold:!0,children:u.artist.name})})]})}),(0,i.jsxs)(p.h.Content,{children:[(0,i.jsx)(p.h.Label,{children:u.artist.name}),(0,i.jsx)(p.h.Separator,{}),(0,i.jsxs)(p.h.Item,{onSelect:()=>{var e;k(null===(e=u.artist)||void 0===e?void 0:e.id)},children:[u.artist.profileImage&&(0,i.jsx)(p.h.ItemImage,{source:{src:(0,f.Z)(u.artist.profileImage,{width:100})},width:20,height:20,style:{width:20,height:20,borderRadius:50,marginRight:16}}),(0,i.jsx)(p.h.ItemTitle,{children:"Book Artist ⚡️"})]},"Book artist"),(0,i.jsx)(p.h.Separator,{}),(0,i.jsxs)(p.h.Group,{children:[(0,i.jsxs)(p.h.Item,{onSelect:()=>{var e;let n="/@".concat(null===(e=u.artist)||void 0===e?void 0:e.slug);"web"===b.Z.OS?window.open(n,"_blank"):B.push(n)},children:[(0,i.jsx)(p.h.ItemIcon,{icon:a.d,ios:{name:"link"}}),(0,i.jsx)(p.h.ItemTitle,{children:"View Artist Profile"})]},"view profile"),u.artist.sellerIds.length>0&&!!T&&q.n.isMultiVenueBuyer($)&&(0,i.jsxs)(p.h.Item,{onSelect:()=>{var e,n,t,i,r,o,l,s;S.mutate({shouldUpsertRoom:!0,requestBody:{user_ids:Array.from(new Set([T].concat(null!==(s=null===(e=u.artist)||void 0===e?void 0:e.sellerIds)&&void 0!==s?s:[]))),...(null===(t=u.artist)||void 0===t?void 0:null===(n=t.profileImage)||void 0===n?void 0:n.publicCloudinaryId)&&{fallback_image_id:u.artist.profileImage.publicCloudinaryId},...(null===(i=u.artist)||void 0===i?void 0:i.name)&&{name:"".concat(null===(r=u.artist)||void 0===r?void 0:r.name)},tags:{artist_tags:{add_ids:(null===(o=u.artist)||void 0===o?void 0:o.id)?[u.artist.id]:[]},organization_tags:{add_ids:(null===(l=u.organization)||void 0===l?void 0:l.id)?[u.organization.id]:[]}}}},{onSuccess(e){C(e.id)}})},children:[(0,i.jsx)(p.h.ItemIcon,{icon:d.Z,ios:{name:"message.circle"}}),(0,i.jsx)(p.h.ItemTitle,{children:"Chat with Artist"})]},"Chat with artist")]})]})]})}),w&&(0,i.jsxs)(r.G,{stretch:!0,ai:"center",gap:"$3",jc:"center",children:[(0,i.jsx)(m.x,{stretch:!0}),(0,i.jsx)(c.T,{}),(0,i.jsx)(l.x,{center:!0,children:"Creating chat"})]})]}),(0,i.jsx)(X,{open:!!A,onOpenChange:e=>{e||k(void 0)},children:!!A&&(0,i.jsx)(X.Content,{artistId:A,holdId:u.id,initialInsert:{comments:u.publicNotes}})})]}):null}},609092:function(e,n,t){t.d(n,{P:function(){return a}});var i=t(84951),r=t(652525);t(514865),t(547876);var o=t(152673),l=t(202784);let s=(0,o.B)("\n  mutation PatchHold($id: String!, $patch: HoldPatch!) {\n    patchHold: updateHold(id: $id, patch: $patch) {\n      id\n      __typename\n    }\n  }\n");function a(){let e=(0,r.Db)(s),{toast:n}=(0,i.Z)();return(0,l.useMemo)(()=>({...e,execute:async t=>e.execute(t).then(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.patchHold)&&!e.error&&n({title:"Booking Request Saved",preset:"done"}),e})}),[e,n])}(0,o.B)("\n  mutation UpdateHoldDate($id: String!, $startTime: DateTime) {\n    updateHold(id: $id, patch: { startTime: $startTime }) {\n      id\n      __typename\n    }\n  }\n")},67012:function(e,n,t){t.d(n,{E:function(){return o}});var i=t(652525),r=t(152673);function o(){return(0,i.Db)((0,r.B)("\n      mutation DeleteHold($id: String!) {\n        deleteHold(id: $id)\n      }\n    "))}},21769:function(e,n,t){t.d(n,{Z:function(){return o}});var i=t(652525);let r=(0,t(152673).B)("\n  query HoldDetail($id: String!) {\n    holdById(id: $
1id) {\n      id\n      __typename\n      buyerDisplayName\n      startTime\n      performanceLengthMins\n      artistConfigs\n      genres\n      indoorsOrOutdoors\n      billing\n      organization {\n        id\n        slug\n        name\n        location {\n          city\n          stateAbbr\n          streetAddress\n        }\n        isDiy\n        venue {\n          id\n        }\n      }\n      publicNotes\n      bandConfigs\n      artist {\n        id\n        slug\n        name\n        profileImage {\n          publicCloudinaryId\n        }\n      }\n      ...HoldExistingBooking\n      ...HoldArtist\n    }\n  }\n");function o(e){let{holdId:n}=e;return(0,i.aM)(r,{variables:{id:n},pause:!n,requestPolicy:"cache-and-network"})}},150954:function(e,n,t){t.d(n,{Z:function(){return o}});let{useParam:i,useParams:r}=(0,t(301036).X)();function o(){let[e="",n]=i("holdId",{initial:"",parse:String}),{setParams:t,params:o}=r();return{holdId:e,setHoldId:n,setParams:t,bookArtistId:null==o?void 0:o.bookArtistId}}},789207:function(e,n,t){t.d(n,{K:function(){return _}});var i=t(552322),r=t(419424),o=t(202784),l=t(720295),s=t(481108),a=t(175111),d=t(802572),c=t(755338),u=t(254051),h=t(345096),g=t(211147),m=t(967512),x=t(49934),j=t(18732),v=t(454300),p=t(79981),f=t(261411),b=t(652047),y=t(270770),I=t(627145),S=t(134569),C=t(406457),$=t(652525),z=t(439548),A=t(791964),k=t(84951),T=t(103757),w=t(820278),B=t(33229),G=t(55683),F=t(837070),D=t(400816),O=t(735702),P=t(629805),q=t(232793);function _(e){var n;let{onClose:t,venueSlugs:_}=e,L=(0,l.Z)().data,E=s.n.isAdmin(L),[M,Z]=(0,o.useState)(null),[N,R]=(0,o.useState)(null),[W,V]=(0,o.useState)(""),[H,U]=(0,o.useState)(!1),[J,Q]=(0,o.useState)(null),[K,X]=(0,o.useState)(null),Y=(0,o.useMemo)(()=>(0,q.N)(null==M?void 0:M.availChecks,N),[null==M?void 0:M.availChecks,N]),ee=(0,r.t)(),{openChat:en}=(0,I.P3)(),et=(0,S.Uo)(),ei=null===(n=(0,C.Z)().user)||void 0===n?void 0:n.uid,er=(0,$.Db)(z.u),{toast:eo}=(0,k.Z)(),{setOpenBookingModalWithArtist:el,setOpenBookingFlow:es,form:ea,setBookingType:ed,setBookingStep:ec}=(0,A.V2)(),eu=(0,T.V)(async e=>{let{artistId:n,artistName:t,venueId:i,sellerIds:r,artistProfileImageId:o}=e;ei&&(null==r?void 0:r.length)&&et.mutate({shouldUpsertRoom:!0,requestBody:{...t&&{name:t},...o&&{fallback_image_id:o},user_ids:Array.from(new Set([ei,...r])),tags:{organization_tags:{add_ids:[i]},artist_tags:{add_ids:[n]}}}},{onSuccess(e){en(e.id)}})}),eh=(0,o.useCallback)(e=>{var n,t,r,o;let{item:l}=e;return(0,i.jsxs)(a.G,{p:12,f:1,flexDirection:"row",gap:12,children:[(0,i.jsx)(a.G,{height:21,ai:"center",jc:"center",children:(0,i.jsx)(d.L,{color:(0,P.sW)(l.response),size:8})}),(0,i.jsxs)(a.G,{width:"100%",f:1,flexDirection:"row",jc:"space-between",children:[(0,i.jsxs)(a.G,{gap:4,children:[(0,i.jsx)(c.x,{fontWeight:500,fontSize:14,lh:21,children:(0,P.L0)(l.startTime,l.location.timezone)}),(0,i.jsxs)(c.x,{fontWeight:400,fontSize:14,lh:21,color:"#9CA1A6",children:[(0,P.KI)(l.startTime,l.location.timezone)," -"," ",(0,P.hh)(l.startTime,null!==(o=l.performanceLengthMins)&&void 0!==o?o:0,l.location.timezone)]}),(0,i.jsx)(c.x,{color:"$color11",children:(null===(t=l.slot)||void 0===t?void 0:null===(n=t.stage)||void 0===n?void 0:n.name)||"Main Stage"})]}),(0,i.jsxs)(u.J,{placement:"left-end",children:[(0,i.jsx)(u.J.Trigger,{height:"100%",jc:"center",children:(0,i.jsx)(a.G,{ml:"auto",cursor:"pointer",jc:"center",p:4,width:32,height:32,hoverStyle:{borderRadius:3,backgroundColor:"#232323"},children:(0,i.jsx)(h.F,{size:24})})}),(0,i.jsx)(u.J.Content,{unstyled:!0,children:(0,i.jsxs)(a.G,{bg:"#212122",br:3,borderWidth:.5,boc:"#34353C",children:[(0,i.jsxs)(a.G,{hoverStyle:{bg:"#35363A"},animation:"quick",fd:"row",ai:"center",gap:"$2.5",h:37,px:"$2",cursor:"pointer",onPress:()=>{var e,n,t,i,r,o,s,a,d,c,u,h,g;E?(Q(null===(e=l.slot)||void 0===e?void 0:e.id),X(l.artist.id)):(ea.setValue("selectedDates",[(0,P.KS)(l.startTime)]),ea.setValue("selectedTimeSlot.from",(0,P.KI)(l.startTime,l.location.timezone)),ea.setValue("selectedTimeSlot.to",(0,P.hh)(l.startTime,null!==(d=l.performanceLengthMins)&&void 0!==d?d:0,l.location.timezone)),el({id:l.artist.id,name:l.artist.name,slug:l.artist.slug,profileImage:l.artist.profileImage,fromSlotId:null!==(c=null===(n=l.slot)||void 0===n?void 0:n.id)&&void 0!==c?c:null,stage:{id:null!==(u=null===(i=l.slot)||void 0===i?void 0:null===(t=i.stage)||void 0===t?void 0:t.id)&&void 0!==u?u:null,name:null!==(h=null===(o=l.slot)||void 0===o?void 0:null===(r=o.stage)||void 0===r?void 0:r.name)&&void 0!==h?h:null,indoorsOrOutdoors:null!==(g=null===(a=l.slot)||void 0===a?void 0:null===(s=a.stage)||void 0===s?void 0:s.indoorsOrOutdoors)&&void 0!==g?g:"Indoors"}}),es(!0))},children:[(0,i.jsx)(g.R,{size:13}),(0,i.jsx)(c.x,{fontSize:14,fontWeight:500,children:"Book Artist"})]}
1),(null===(r=l.slot)||void 0===r?void 0:r.id)&&(0,i.jsxs)(a.G,{hoverStyle:{bg:"#35363A"},animation:"quick",fd:"row",ai:"center",gap:"$2.5",h:37,px:"$2",cursor:"pointer",onPress:()=>{var e;(null===(e=l.slot)||void 0===e?void 0:e.id)&&er.execute({slotId:l.slot.id,patch:{placeholderArtistId:l.artist.id}}).then(e=>{e.data&&!e.error&&eo({title:"Tentative artist set!",message:l.artist.name,preset:"done"})})},children:[(0,i.jsx)(m.D,{size:13}),(0,i.jsx)(c.x,{fontSize:14,fontWeight:500,children:"Set as Tentative"})]}),(0,i.jsxs)(a.G,{hoverStyle:{bg:"#35363A"},animation:"quick",fd:"row",ai:"center",gap:"$2.5",h:37,px:"$2",cursor:"pointer",onPress:()=>{let e="/dashboard/artist-discovery/".concat(l.artist.slug);"web"===B.Z.OS?window.open(e,"_blank"):ee.push(e)},boc:"#34353C",borderTopWidth:.5,children:[(0,i.jsx)(x.r,{size:13}),(0,i.jsx)(c.x,{fontSize:14,fontWeight:500,children:"View Artist Profile"})]}),(0,i.jsxs)(a.G,{hoverStyle:{bg:"#35363A"},animation:"quick",fd:"row",ai:"center",gap:"$2.5",h:37,px:"$2",cursor:"pointer",onPress:()=>{var e;eu({artistId:l.artist.id,venueName:l.venue.name,artistName:l.artist.name,venueId:l.venue.id,sellerIds:l.artist.sellerIds,artistProfileImageId:null===(e=l.artist.profileImage)||void 0===e?void 0:e.publicCloudinaryId,accountManagerId:void 0})},children:[(0,i.jsx)(j.j,{size:13}),(0,i.jsx)(c.x,{fontSize:14,fontWeight:500,children:"Chat With Artist"})]})]})})]})]})]})},[ea,E,eu,er,ee,es,el,eo]);return(0,i.jsxs)(a.G,{width:"100%",height:"100%",bg:"#101011",children:[(0,i.jsxs)(a.G,{flexDirection:"row",justifyContent:"space-between",px:20,py:24,ai:"center",children:[H?(0,i.jsxs)(a.G,{fd:"row",h:40,gap:12,children:[(0,i.jsx)(v.z,{onPress:()=>U(!1),accessibilityLabel:"close",square:!0,p:12,borderRadius:3,bg:"#131313",hoverStyle:{bg:"#353537",scale:1},children:(0,i.jsx)(v.z.Icon,{icon:p.o,size:16})}),(0,i.jsxs)(a.G,{f:1,boc:"#525253",bw:1,bg:"transparent",br:3,px:"$3",py:"$2.5",fd:"row",ai:"center",children:[(0,i.jsx)(w.o,{value:W,autoF
1ocus:!0,onChangeText:V,placeholder:"Type to Search...",placeholderTextColor:"#525253",autoCapitalize:"none",autoCorrect:!1,style:{flex:1,fontSize:14,fontWeight:"500",color:B.Z.select({web:"var(--color12)",default:"#fff"}),backgroundColor:"transparent",..."web"===B.Z.OS?{outlineStyle:"none"}:{}}}),(0,i.jsx)(a.G,{position:"absolute",right:16,top:12,children:(0,i.jsx)(f.Y,{size:16,color:"$color10"})})]})]}):(0,i.jsx)(c.x,{fontSize:18,lh:22.5,fontWeight:600,children:"Artist Availabilities"}),(0,i.jsxs)(a.G,{flexDirection:"row",h:40,gap:12,children:[!H&&(0,i.jsx)(v.z,{accessibilityLabel:M?"back":"search",square:!0,p:12,borderRadius:3,bg:"#1F1F1F",hoverStyle:{bg:"#353537",scale:1},onPress:()=>{M?(Z(null),R(null)):(U(!0),V(""))},children:M?(0,i.jsx)(v.z.Icon,{icon:b.W,size:16}):(0,i.jsx)(v.z.Icon,{icon:f.Y,size:16})}),(0,i.jsx)(v.z,{onPress:t,accessibilityLabel:"close",square:!0,p:12,borderRadius:3,bg:"#1F1F1F",hoverStyle:{bg:"#353537",scale:1},children:(0,i.jsx)(v.z.Icon,{icon:y.X,size:16})})]})]}),(0,i.jsxs)(a.G,{f:1,children:[(0,i.jsx)(F.m,{onlyShowAvailsWithCheckResponses:!1,venueSlugs:_,setSelectedItem:Z,artistName:W}),M?(0,i.jsxs)(a.G,{bg:"#101011",stretch:!0,children:[(0,i.jsx)(G.TK,{item:M,isSelected:!0,setResponseFilter:R}),(0,i.jsx)(D.Z,{renderItem:eh,data:Y,keyExtractor:e=>e.id,estimatedItemSize:70,...B.Z.select({web:{style:{paddingLeft:20,paddingRight:20,paddingBottom:24}},default:{contentContainerStyle:{paddingLeft:20,paddingRight:20,paddingBottom:24}}})})]}):null]}),(0,i.jsx)(O.I,{open:!!J,onOpenChange:e=>!e&&Q(null),children:!!J&&!!K&&(0,i.jsx)(O.I.Content,{slotId:J,artistId:K})})]})}},629805:function(e,n,t){t.d(n,{lZ:function(){return eQ},ZN:function(){return eX},sW:function(){return e5},KS:function(){return e2},L0:function(){return eY},KI:function(){return e0},hh:function(){return e1}});var i=t(552322),r=t(525925),o=t(460620),l=t(547876),s=t(606450),a=t(932867),d=t(548721),c=t(83652),u=t(707679),h=t(566512),g=t(971907),m=t(469340),x=t(419424),j=t(33639),v=t(175111),p=t(341175),f=t(755338),b=t(831318),y=t(126717),I=t(18732),S=t(559073),C=t(369735),$=t(354069),z=t(59874),A=t(788831),k=t(955261),T=t(420667),w=t(33671),B=t(952185),G=t(514865),F=t(306281),D=t(524257),O=t(291629),P=t(33229),q=t(845973),_=t(160930),L=t(292837),E=t(993702),M=t(156743),Z=t(134569),N=t(406457),R=t(627145),W=t(541251),V=t(884443),H=t(498042),U=t(425990),J=t(463049),Q=t(336837),K=t(211147),X=t(861315),Y=t(254051),ee=t(134603),en=t(454300),et=t(76100),ei=t(202784),er=t(727432),eo=t(652525),el=t(152673),es=t(298142),ea=t(84951),ed=t(517706),ec=t(61317),eu=t(714354),eh=t(776801);let eg=(0,er.A)(),em=(0,el.B)("\n  fragment EditRequestForm_Slot on Slot {\n    id\n    date\n    time {\n      hour\n      minute\n    }\n    durationMins\n    timezone\n    stage {\n      id\n      name\n      indoorsOrOutdoors\n    }\n    organization {\n      id\n      slug\n      stages {\n        id\n        name\n        indoorsOrOutdoors\n      }\n    }\n  }\n"),ex=(0,el.B)("\n  query GetSlotData($id: String!) {\n    slotToFillById: slotById(id: $id) {\n      id\n      ...EditRequestForm_Slot\n    }\n  }\n"),ej=(0,ei.createContext)(null),ev=(0,X.$)(()=>{var e;let n=(0,ei.useContext)(ej),t=null==n?void 0:null===(e=n.organization)||void 0===e?void 0:e.stages;return(0,i.jsx)(v.G,{f:1,children:(0,i.jsxs)(v.G,{gap:30,children:[(0,i.jsxs)(v.G,{gap:"$2.5",children:[(0,i.jsx)(Q.x,{fontSize:18,fontWeight:500,children:"Edit Request Details"}),(0,i.jsx)(Q.x,{fontSize:14,fontWeight:400,children:"You can modify the date and time for this request."})]}),(0,i.jsxs)(v.G,{gap:"$2.5",children:[(0,i.jsx)(Q.x,{fontSize:14,fontWeight:500,children:"Date"}),(0,i.jsxs)(Y.J,{children:[(0,i.jsx)(Y.J.Trigger,{children:(0,i.jsx)(eg.Controller,{name:"selectedDates",render:e=>{let{field:n}=e,t=1===n.value.length?n.value[0].toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):n.value.length>1?"Multiple Selected":"Select date";return(0,i.jsxs)(v.G,{gap:"$2",fd:"row",h:40,bg:"#1F1F1F",borderWidth:1,boc:"#303133",br:7,px:"$3",ai:"center",cursor:"pointer",w:150,children:[(0,i.jsx)(K.R,{size:16,color:"#8B8B8B"}),(0,i.jsx)(Q.x,{numberOfLines:1,ellipsizeMode:"tail",fontSize:14,fontWeight:400,color:n.value.length>0?"#fff":"$color11",children:t})]})}})}),(0,i.jsx)(Y.J.Content,{padding:0,borderWidth:0,borderRadius:0,children:(0,i.jsx)(v.G,{br:3,h:360,bg:"#212122",fd:"row",ov:"hidden",children:(0,i.jsx)(eg.Controller,{name:"selectedDates",render:e=>{let{field:n}=e;return(0,i.jsx)(ee.T,{selectedDates:n.value,setSelectedDates:n.onChange,id:"my-calendar",multipleDates:!1})}})})})]})]}),(0,i.jsxs)(v.G,{zIndex:3,gap:"$2.5",children:[(0,i.jsx)(Q.x,{fontSize:14,fontWeight:500,children:"Time"}),(0,i.jsx)(eg.Controller,{name:"selectedTimeSlot",render:e=>{let{field:n}=e;
1return(0,i.jsx)(es.G,{timeSlot:n.value,onTimeSlotChange:n.onChange})}})]}),(0,i.jsxs)(v.G,{d:(null==t?void 0:t.length)?"flex":"none",gap:"$2.5",children:[(0,i.jsx)(Q.x,{fontSize:14,fontWeight:500,children:"Stage"}),(0,i.jsx)(eu.Re,{stages:t||[]})]})]})})},{Submit:function(e){let n=(0,ei.useContext)(ej),{toast:t}=(0,ea.Z)(),r=(0,g.j)();return(0,i.jsx)(eg.Submit,{children:o=>{let{handleSubmit:s,isSubmitting:a}=o;return(0,i.jsx)(en.z,{onPress:s(async i=>{var o;let{selectedTimeSlot:s,selectedDates:a,selectedStage:d}=i,c=a[0],u=l.o.fromFormat(s.from,"h:mm a"),h=l.o.fromJSDate(c).set({hour:u.hour,minute:u.minute}),g=(0,eh.Bm)(s);await r.execute({id:n.id,patch:{date:h.toISODate(),time:{hour:h.hour,minute:h.minute},...d?{stageId:d.id,indoorsOrOutdoors:null!==(o=d.indoorsOrOutdoors)&&void 0!==o?o:"Indoors"}:{},durationMins:g}}).then(n=>{var i,r;(null===(i=n.data)||void 0===i?void 0:i.patchSlotsToFill)?null===(r=e.onDidUpdate)||void 0===r||r.call(e):t({title:"Error",message:(0,G.E)(n.error)[0],preset:"error"})})}),px:20,brandV2:!0,br:3,h:40,accessibilityLabel:"Save Changes",loading:a,als:"flex-start",children:(0,i.jsx)(en.z.Text,{color:"#000",fontSize:14,fontWeight:500,children:"Save Changes"})})}})},Provider:function(e){var n;let t=(0,W.Jc)(em,e.slot),r=l.o.fromObject({hour:t.time.hour,minute:t.time.minute}).toFormat("h:mm a"),o=l.o.fromISO(t.date,{zone:t.timezone}),s=l.o.fromObject({hour:t.time.hour,minute:t.time.minute}).plus({minute:t.durationMins}).toFormat("h:mm a"),a=eg.useForm({defaultValues:{selectedTimeSlot:{from:r,to:s},selectedDates:[o.toJSDate()],selectedStage:t.stage?{id:t.stage.id,name:t.stage.name,indoorsOrOutdoors:null!==(n=t.stage.
1indoorsOrOutdoors)&&void 0!==n?n:"Indoors"}:void 0}});return(0,i.jsx)(ej.Provider,{value:t,children:(0,i.jsx)(eg.FormProvider,{...a,children:e.children})})}});function ep(e){var n;let{onRequestClose:t}=et.Z.Portaled.useContext(),{setShouldPreventClose:r,UnsavedChangesDialog:o}=(0,ec.Rb)(t),l=(0,eo.aM)(ex,{variables:{id:e.id}});return(0,i.jsxs)(i.Fragment,{children:[(null===(n=l.data)||void 0===n?void 0:n.slotToFillById)?(0,i.jsxs)(ev.Provider,{slot:l.data.slotToFillById,children:[(0,i.jsx)(ec._T,{onDirtyChange:r}),(0,i.jsx)(v.G,{grow:!0,children:(0,i.jsx)(p.X,{children:(0,i.jsx)(ev,{})})}),!l.stale&&(0,i.jsx)(ev.Submit,{onDidUpdate:()=>{t()}})]}):(0,i.jsx)(ec.bz,{}),(0,i.jsx)(o,{})]})}let ef=(0,X.$)(function(e){return(0,i.jsx)(et.Z.Portaled,{...e})},{Trigger:et.Z.Portaled.Trigger,Content(e){let{onRequestClose:n}=et.Z.Portaled.useContext(),{shouldPreventClose:t,handleClose:r}=(0,ec.Rb)(n);return(0,i.jsx)(ed.E,{onRequestClose:r,disableBackdropClick:t,children:(0,i.jsx)(ep,{id:e.id})})}});var eb=t(245839),ey=t(865554),eI=t(782637),eS=t(934585);function eC(e){var n,t,r,o,a,c,k,W;let{slotId:V}=e,H=(0,m.R)({slotId:V}),Q=(0,Z.Uo)(),{venueSlugs:K,artistSlugs:X,...Y}=(0,h.e)(),ee=(0,x.t)(),en=(0,g.H)(),et=(0,g.j)(),er=j.F.useModal(),[eo,el]=(0,ei.useState)(!1);(0,T.Z)("[slot-detail]",H.data);let{toast:es}=(0,ea.Z)(),ed=(0,w.j)(),ec=B.h.useModal(),eu=null===(n=(0,N.Z)().user)||void 0===n?void 0:n.uid,{openChat:eh}=(0,R.P3)(),eg=()=>{el(!1)};if(!H.data)return(0,i.jsxs)(v.G,{f:1,children:[(0,i.jsx)(u.k.$l,{onClose:()=>{let e=l.o.local();ee.push(s.pagesPath.dashboard.venue_calendar.$url({query:{year:Y.year||e.year,month:Y.month||e.month,day:Y.day||e.day,venueSlug:K,artistSlugs:X}}))}}),(0,i.jsx)(F.Z,{error:H.error})]});let{date:em,time:ex,durationMins:ej}=H.data.slotToFillById,{year:ev,month:ep,day:ey}=l.o.fromISO(em),eI=H.data.slotToFillById,eC=e=>ed.execute({id:e}).then(e=>{e.data&&!e.error?(es({title:"Booking Request Deleted"}),ee.replace(s.pagesPath.dashboard.venue_calendar.$url({query:{year:ev,month:ep,day:ey,venueSlug:K}}),void 0,{experimental:{isNestedNavigator:!0,nativeBehavior:"stack-replace"}})):e.error&&es({title:"Error",message:(0,G.E)(e.error)[0],preset:"error"})}),ez=null==eI?void 0:eI.availChecks.map(e=>{var n,t;return null===(t=e.artist)||void 0===t?void 0:null===(n=t.profileImage)||void 0===n?void 0:n.publicCloudinaryId}).filter(Boolean),eA=!!eI.placeholderArtist;return(0,i.jsx)(D.Z.Group,{show:et.fetching,children:(0,i.jsxs)(v.G,{flex:1,bg:"#131314",children:[(0,i.jsx)(v.G,{display:P.Z.select({native:"none"}),position:"absolute",top:24,right:24,children:(0,i.jsx)(d.op,{zIndex:2,p:0,w:40,accessibilityLabel:"Close new event sidebar",onPress:()=>{ee.push(s.pagesPath.dashboard.venue_calendar.$url({query:{year:ev,month:ep,day:ey,venueSlug:K,artistSlugs:X}}))},bg:"#1F1F1F59",hoverStyle:{bg:"#1F1F1F"},children:(0,i.jsx)(y.D,{size:16})})}),(0,i.jsxs)(p.X,{children:[(0,i.jsx)(O.A_,{publicCloudinaryIds:eA?[null!==(W=null===(r=eI.placeholderArtist)||void 0===r?void 0:null===(t=r.profileImage)||void 0===t?void 0:t.publicCloudinaryId)&&void 0!==W?W:J.kW].filter(Boolean):ez,fromSlotDetail:!0,single:!1,children:(0,i.jsx)(v.G,{zIndex:2,position:"absolute",bottom:24,left:24,h:38,px:20,br:"$rounded",bg:eA?"#FFEB79":"#FFEF95D9",ai:"center",jc:"center",children:(0,i.jsx)(f.x,{color:"#000",fontSize:14,fontWeight:500,children:eA?"Tentative":"Requested"})})}),(0,i.jsxs)(v.G,{py:30,px:"$3.5",gap:30,children:[(0,i.jsxs)(v.G,{gap:"$2.5",children:[(0,i.jsxs)(v.G,{fd:"row",ai:"center",jc:"space-between",children:[(0,i.jsx)(f.x,{fontSize:24,fontWeight:500,lineHeight:30,children:eA?null===(o=eI.placeholderArtist)||void 0===o?void 0:o.name:"Availability Request"}),(0,i.jsxs)(v.G,{d:eA?"flex":"none",fd:"row",gap:"$2.5",children:[(0,i.jsx)(q.a1,{onPress:()=>{let e=null==eI?void 0:eI.placeholderArtist,n=null==eI?void 0:eI.organization;if(eu&&e){var t,i;Q.mutate({shouldUpsertRoom:!0,requestBody:{user_ids:Array.from(new Set([eu,...null!==(i=e.sellerIds)&&void 0!==i?i:[]])),...(null===(t=e.profileImage)||void 0===t?void 0:t.publicCloudinaryId)&&{fallback_image_id:e.profileImage.publicCloudinaryId}
1,name:"".concat(e.name),tags:{artist_tags:{add_ids:[e.id]},organization_tags:{add_ids:[n.id]}}}},{onSuccess(e){eh(e.id)}})}},children:(0,i.jsx)(I.j,{size:16})}),eI.placeholderArtist&&(0,i.jsx)(M.r,{href:s.pagesPath.dashboard.artist_discovery._artistSlug(null===(a=eI.placeholderArtist)||void 0===a?void 0:a.slug).$url(),children:(0,i.jsx)(q.a1,{children:(0,i.jsx)(S.O,{size:16})})}),(0,i.jsxs)(eb.h.Root,{open:eo,onOpenChange:e=>{el(e)},children:[(0,i.jsx)(eb.h.Trigger,{children:e=>{let{onOpen:n}=e;return(0,i.jsx)(q.a1,{w:"auto",px:20,onPress:n,children:(0,i.jsx)(f.x,{fontSize:14,fontWeight:500,children:"Book Artist"})})}}),(0,i.jsx)(eb.h.Content,{currentSlotId:eI.id,onDidCreate:()=>{eg()},preSelectedArtist:eI.placeholderArtist?{id:eI.placeholderArtist.id,name:eI.placeholderArtist.name,slug:eI.placeholderArtist.slug,profileImage:{publicCloudinaryId:null===(c=eI.placeholderArtist.profileImage)||void 0===c?void 0:c.publicCloudinaryId}}:void 0})]})]})]}),(0,i.jsxs)(v.G,{gap:"$2",children:[(0,i.jsx)(_.M,{dateTime:{year:ev,month:ep,day:ey,hour:ex.hour,minute:ex.minute}}),(0,i.jsx)(L.e,{dateTime:{hour:ex.hour,minute:ex.minute,day:ey,month:ep,year:ev},performanceLengthMins:eI.durationMins,timezone:eI.timezone})]})]}),(0,i.jsxs)(v.G,{fd:"row",children:[(0,i.jsx)(v.G,{w:140,gap:"$2.5",children:["Length","Location","Stage"].map(e=>(0,i.jsx)(f.x,{fontSize:14,fontWeight:400,color:"#9CA1A6",children:e},e))}),(0,i.jsxs)(v.G,{gap:"$2.5",children:[(0,i.jsxs)(v.G,{fd:"row",ai:"center",gap:"$2.5",children:[(0,i.jsx)(C.P,{size:16}),(0,i.jsx)(f.x,{fontSize:14,fontWeight:400,children:(0,E.J)(eI.durationMins)})]}),(0,i.jsxs)(v.G,{fd:"row",ai:"center",gap:"$2.5",children:[(0,i.jsx)($.g,{size:16}),(0,i.jsx)(f.x,{fontSize:14,fontWeight:400,children:null===(k=eI.organization)||void 0===k?void 0:k.name})]}),(0,i.jsxs)(v.G,{fd:"row",ai:"center",gap:"$2.5",children:[(0,i.jsx)(z.x,{size:16}),(0,i.jsx)(f.x,{fontSize:14,fontWeight:400,children:(0,eS.b)(eI.stage)})]})]})]}),(0,i.jsx)(q.Qt,{}),(0,i.jsx)(e$,{slot:eI})]}),(0,i.jsx)(j.F,{modal:er,error:en.error||et.error,isExecuting:en.fetching||et.fetching}),(0,i.jsx)(B.h,{modal:ec,onDelete:e=>{let{id:n}=e;eC(n)}})]}),(0,i.jsxs)(v.G,{p:"$3.5",jc:"space-between",fd:"row",ai:"center",children:[(0,i.jsx)(v.G,{f:1,children:(0,i.jsxs)(U.U,{children:[(0,i.jsx)(U.U.Trigger,{asChild:!0,children:(0,i.jsx)(d.op,{accessibilityLabel:"Cancel Request",als:"flex-start",bg:"#FF68681A",hoverStyle:{bg:"#FF686833"},children:ed.fetching?(0,i.jsx)(b.T,{size:"small"}):(0,i.jsx)(f.x,{color:"#FF6868",fontWeight:500,fontSize:14,children:"Cancel Request"})})}),(0,i.jsxs)(U.U.Content,{confirmationTitle:"Are you sure you want to cancel this request?",confirmationDescription:"This action cannot be undone.",children:[(0,i.jsx)(U.U.ActionButton,{actionAccessibilityLabel:"Delete Request",actionText:"Delete Request",type:"delete",onAction:()=>{eC(V)},actionIcon:A.r}),(0,i.jsx)(U.U.CancelButton,{cancelAccessibilityLabel:"Cancel",cancelText:"Cancel"})]})]})}),(0,i.jsxs)(ef,{children:[(0,i.jsx)(ef.Trigger,{children:(0,i.jsx)(d.op,{accessibilityLabel:"Edit Request",bg:"#2E2E2F",hoverStyle:{bg:"#424243"},children:(0,i.jsx)(f.x,{fontWeight:500,fontSize:14,children:"Edit Request"})})}),(0,i.jsx)(ef.Content,{id:V})]})]})]})})}let e$=e=>{let n=(0,W.Jc)(H.AM,e.slot),{year:t,month:r,day:o}=l.o.fromISO(n.date),{time:s,durationMins:a}=n,d=(0,eo.Db)(H.mw),{toast:c}=(0,ea.Z)(),u=(0,V.S3)(eI.zD,n.availChecks),h=async(e,n,t)=>{let i=e.map(e=>e.id);await d.execute({artistIds:i,slotIds:n}).then(e=>{var n;(null===(n=e.data)||void 0===n?void 0:n.createAvailChecksOnSlots)?(c({title:"Avails sent",preset:"done"}),t()):e.error&&c({title:"Error",message:(0,G.E)(e.error)[0],preset:"error"})})};return(0,i.jsx)(eu.P1.Trigger,{children:e=>{let{onOpen:l}=e;return(0,i.jsx)(ey.F,{availChecks:u,onSubmitRequest:h,loading:d.fetching,onPressBookingArtist:e=>{var i,d,c,u,h,g;l({id:e.id,name:e.name,slug:e.slug,profileImage:e.profileImage,dateTime:{year:t,month:r,day:o,hour:s.hour,minute:s.minute},durationMins:a,fromSlotId:n.id,stage:{id:null!==(u=null===(i=n.stage)||void 0===i?void 0:i.id)&&void 0!==u?u:null,name:null!==(h=null===(d=n.stage)||void 0===d?void 0:d.name)&&void 0!==h?h:null,indoorsOrOutdoors:null!==(g=null===(c=n.stage)||void 0===c?void 0:c.indoorsOrOutdoors)&&void 0!==g?g:"Indoors"}})},error:d.error,slotData:{id:n.id,date:n.date,time:n.time,durationMins:n.durationMins,stage:n.stage?{id:n.stage.id,name:n.stage.name}:null},slotId:n.id,placeholderArtist:n.placeholderArtist,showTentativeArtist:!0})}})};function ez(){let{slotId:e}=(0,k.t)();return(0,i.jsx)(eC,{slotId:e})}var eA=t(952781),ek=t(182953),eT=t(806856),ew=t(374631),eB=t(608955),eG=t(729879),eF=t(273559),eD=t(737007),eO=t(736870),eP=t(720295),eq=t(21769),e_=t
1(609092),eL=t(67012),eE=t(150954),eM=t(49094),eZ=t(951863),eN=t(481108);let{useForm:eR,FormProvider:eW}=(0,er.A)();function eV(e){var n;let{holdId:t,setHoldId:r}=e,o=(0,eq.Z)({holdId:t}),a=eR({defaultValues:{}}),{venueSlugs:d,artistSlugs:c,...g}=(0,h.e)(),m=(0,x.t)(),j=(0,e_.P)(),{toast:b}=(0,ea.Z)(),y=(0,eL.E)(),I=B.h.useModal(),S=(0,eP.Z)().data,C=eN.n.isAgent(S),$=eN.n.isAdmin(S);if(!C&&!$)return(0,i.jsx)(v.G,{f:1,ai:"center",jc:"center",children:(0,i.jsx)(f.x,{children:"Only agents and admins can view holds"})});if(!o.data)return(0,i.jsxs)(v.G,{f:1,children:[(0,i.jsx)(u.N.$l,{title:"Hold",onClose:()=>{let e=l.o.local();m.push(s.pagesPath.dashboard.venue_calendar.$url({query:{year:g.year||e.year,month:g.month||e.month,day:g.day||e.day,venueSlug:d,artistSlugs:c}}))}}),(0,i.jsx)(F.Z,{error:o.error})]});let{startTime:z,performanceLengthMins:A,artistConfigs:k,artist:T}=o.data.holdById,{hour:w=20,minute:O=0}=l.o.fromISO(z).toObject(),{year:P,month:q,day:_}=l.o.fromISO(z),L=e=>{if(e.data&&!e.error&&e.data.patchHold.id!==t&&r(e.data.patchHold.id),e.error){var n;b({title:"Error",message:null===(n=e.error.graphQLErrors[0])||void 0===n?void 0:n.message,preset:"error"})}return e},E=o.data.holdById,M=e=>y.execute({id:e}).then(e=>{e.data&&!e.error?(b({title:"Booking Request Deleted"}),m.replace(s.pagesPath.dashboard.venue_calendar.$url({query:{year:P,month:q,day:_,venueSlug:d}}),void 0,{experimental:{isNestedNavigator:!0,nativeBehavior:"stack-replace"}})):e.error&&b({title:"Error",message:(0,G.E)(e.error)[0],preset:"error"})});return(0,i.jsx)(D.Z.Group,{show:j.fetching,children:(0,i.jsx)(eW,{...a,children:(0,i.jsxs)(v.G,{flex:1,children:[(0,i.jsxs)(p.X,{children:[(0,i.jsxs)(ek.e,{eventType:"hold",header:(0,i.jsx)(u.N.$l,{title:"Hold",onClose:()=>{m.push(s.pagesPath.dashboard.venue_calendar.$url({query:{year:P,month:q,day:_,venueSlug:d,artistSlugs:c}}))}}),mutatingField:{time:j.fetching,durationMins:j.fetching,date:j.fetching},actions:{setTime(e){j.execute({id:t,patch:{}}
1).then(L)},setDate(e){let n=l.o.fromObject(e);j.execute({id:t,patch:{startTime:n.toISO()}}).then(L)},setDurationMins(e){j.execute({id:t,patch:{performanceLengthMins:e}}).then(L)}},date:{year:P,month:q,day:_},durationMins:A,time:{hour:w,minute:O},children:[(0,i.jsx)(eM.K,{hold:E}),(0,i.jsx)(eZ.t,{hold:E}),(0,i.jsx)(u.N.tm,{}),(0,i.jsxs)(v.G,{fd:"row",gap:"$2",p:"$3",ai:"center",children:[(0,i.jsx)(eD.SQ,{icon:eT.$}),(0,i.jsxs)(v.G,{f:1,gap:"$1",children:[(0,i.jsx)(f.x,{children:E.organization.name}),E.organization.location&&(0,i.jsx)(f.x,{color:"$color11",children:(0,eO.Z)(E.organization.location)})]})]}),(0,i.jsx)(u.N.tm,{}),(null===(n=E.genres)||void 0===n?void 0:n.length)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.G,{fd:"row",gap:"$2",children:(0,i.jsxs)(v.G,{fd:"row",gap:"$2",p:"$3",f:1,ai:"center",children:[(0,i.jsx)(eD.SQ,{icon:ew.a}),(0,i.jsxs)(v.G,{f:1,gap:"$2",children:[(0,i.jsx)(f.x,{color:"$color11",children:"Genres"}),(0,i.jsx)(f.x,{children:E.genres.length?E.genres.join(", "):"N/A"})]})]})}),(0,i.jsx)(u.N.tm,{})]}):null,E.publicNotes?(0,i.jsxs)(v.G,{px:"$3",gap:"$2",py:"$3",borderBottomWidth:.7,borderColor:"$color5",children:[(0,i.jsx)(f.x,{color:"$color11",children:"Notes for Artists"}),(0,i.jsx)(f.x,{children:E.publicNotes||""})]}):null]}),(0,i.jsx)(B.h,{modal:I,onDelete:e=>{let{id:n}=e;M(n)}})]}),(0,i.jsx)(v.G,{mb:"$2",mr:"$3",ai:"flex-end",position:"absolute",bottom:0,right:0,children:(0,i.jsxs)(eF.h.Root,{children:[(0,i.jsx)(eF.h.Trigger,{children:(0,i.jsx)(eB.$,{accessibilityLabel:"Delete",theme:"red",tooltip:!0,square:!0,loading:y.fetching,icon:(0,i.jsx)(eG.r,{color:"$color11"})})}),(0,i.jsx)(eF.h.Content,{children:(0,i.jsxs)(eF.h.Item,{destructive:!0,onSelect:()=>{M(t)},children:[(0,i.jsx)(eF.h.ItemIcon,{icon:eG.r}),(0,i.jsx)(eF.h.ItemTitle,{children:"Delete"})]},"delete")})]})})]})})})}function eH(){let{holdId:e,setHoldId:n}=(0,eE.Z)();return(0,i.jsx)(eV,{holdId:e,setHoldId:e=>{n(e,{webBehavior:"replace"})}})}var eU=t(172802),eJ=t(789207);let eQ=e=>{let{children:n,key:t}=e;return(0,i.jsx)(r.M,{initial:!1,children:(0,i.jsx)(o.G,{style:{position:"absolute",top:0,left:0,right:0,bottom:0},from:{opacity:0,scale:.98,zIndex:0},animate:{opacity:1,scale:1,zIndex:0},exit:{opacity:0,scale:.98,zIndex:2},transition:{type:"timing",duration:200,delay:200},exitTransition:{type:"timing",duration:200,delay:0},children:n},t)})},eK=l.o.local();function eX(){let e=(0,eP.Z)().data,n=eN.n.isBuyer(e),t=eN.n.isAdmin(e),r=(0,h.L)(),o=(0,x.t)(),{venueSlugs:l,year:g=eK.year,month:m=eK.month,day:j=eK.day}=(0,h.e)();(0,eU.kJ)(e=>{o.push(s.pagesPath.dashboard.calendar.$url({query:{venueSlug:(null==e?void 0:e.slug)?[null==e?void 0:e.slug]:void 0,year:g,month:m,day:j}}))});let{bookingId:v}=(0,a.d)(),{slotId:p}=(0,k.t)(),{holdId:f}=(0,eE.Z)(),b=()=>{o.push(s.pagesPath.dashboard.venue_calendar.$url({query:{venueSlug:l,year:g,month:m,day:j}}))},y=r&&(0,eA.V)(r,{"slot-detail":()=>(0,i.jsx)(eQ,{children:(0,i.jsx)(ez,{},p)},p),"hold-detail":()=>(0,i.jsx)(eQ,{children:(0,i.jsx)(eH,{},f)},f),"booking-detail":()=>(0,i.jsx)(eQ,{children:(0,i.jsx)(d.jA,{bookingId:v})},v),"external-booking-detail":()=>(0,i.jsx)(eQ,{children:(0,i.jsx)(c.l,{})},"external-booking"),"artist-avails":()=>(0,i.jsx)(eQ,{children:(0,i.jsx)(eJ.K,{onClose:b,venueSlugs:l})},"artist-avails")});return t||n||"artist-avails"!==r?(0,i.jsx)(u.k.YE,{onRequestClose:b,visible:null!=y,artistAvail:"artist-avails"===r,children:null==y?void 0:y()}):null}function eY(e,n){return l.o.fromISO(e,{zone:n}).toFormat("ccc, LLLL d, yyyy")}function e0(e,n){return l.o.fromISO(e,{zone:n}).toFormat("h:mm a")}function e1(e,n,t){return l.o.fromISO(e,{zone:t}).plus({minutes:n}).toFormat("h:mm a")}function e2(e){return new Date(Date.parse(e))}function e5(e){return"available"===e?"#A3EB8A":"unavailable"===e?"#FF6868":"#9CA1A6"}},735702:function(e,n,t){t.d(n,{I:function(){return W}});var i=t(552322),r=t(341732),o=t(175111),l=t(861315),s=t(341175),a=t(755338),d=t(986541),c=t(371894),u=t(379222),h=t(652525),g=t(76100),m=t(152673),x=t(884443),j=t(547876),v=t(394432),p=t(306281),f=t(160889),b=t(339931),y=t(957013),I=t(454300),S=t(251901),C=t(238769),$=t(720295),z=t(481108),A=t
1(497096),k=t(419424),T=t(606450),w=t(181942),B=t(84951),G=t(202784),F=t(240372),D=t(330929),O=t(858612),P=t(727432),q=t(669761),_=t(676298),L=t(495281),E=t(991389);let M=(0,r.styled)(o.G,{br:"$3",bg:"$color1",p:"$3",bw:2,boc:"$borderColor"}),Z=(0,P.A)(),N=(0,m.B)("\n  query SlotDetailArtistAvailability_BookArtistModal($artistId: String!) {\n    artistById(id: $artistId) {\n      id\n      slug\n      name\n      category\n      profileImage {\n        publicCloudinaryId\n      }\n    }\n  }\n"),R=(0,m.B)("\n  fragment CreateBookingFromSlot on Slot {\n    date\n    id\n    startTime\n    time {\n      hour\n      minute\n    }\n    billing\n    indoorsOrOutdoors\n    durationMins\n    organization {\n      paysManually\n      id\n      slug\n      isDiy\n      venue {\n        id\n      }\n      defaultPaymentMethod {\n        __typename\n        ... on StripeBankAccount {\n          id\n        }\n        ... on StripeCard {\n          id\n        }\n      }\n      ...VenueNewBookingForm_PaymentMethod\n    }\n    placeholderArtist {\n      id\n      name\n      slug\n    }\n    availChecks {\n      response\n      id\n      artist {\n        id\n        slug\n        name\n      }\n    }\n    stage {\n      id\n      name\n    }\n  }\n"),W=(0,l.$)(function(e){return(0,i.jsx)(g.Z.Portaled,{...e})},{Trigger:g.Z.Portaled.Trigger,Content:function(e){return(0,i.jsx)(g.Z.Portaled.Content,{scrollable:!1,dangerouslyDisableNativeScroll:!0,header:!0,title:"Create Booking",padded:!1,plainDiv:!0,children:(0,i.jsx)(H,{...e})})}}),V=(0,m.B)("\n  query CreateBookingFromSlot($slotId: String!) {\n    slotById(id: $slotId) {\n      id\n      date\n      organization {\n        id\n        slug\n      }\n      ...CreateBookingFromSlot\n    }\n  }\n");function H(e){let n=(0,k.t)(),{params:t}=(0,w.h)(),{toast:r}=(0,B.Z)(),o=e.artistId,l=g.Z.Portaled.useContext(),{data:s,error:a}=(0,h.aM)(V,{variables:{slotId:e.slotId}}),d=null==s?void 0:s.slotById;return d?(0,i.jsx)(U,{initialInsert:e.initialInsert,slot:d,artistId:o,onDidCreateBookings:e=>{var i;l.onRequestClose();let{day:o,month:s,year:a}=j.o.fromISO(d.date);r({title:1===e.length?"Booking created":"Bookings created",preset:"done",message:"Redirecting you..."}),n.replace(T.pagesPath.dashboard.venue_calendar.bookings._bookingId(e[0]).$url({query:{venueSlug:Array.from(new Set([d.organization.slug].concat(null!==(i=t.venueSlug)&&void 0!==i?i:[]))),year:a,month:s,day:o}}),void 0,{experimental:{isNestedNavigator:!0,nativeBehavior:"stack-replace"}})}},d.id):(0,i.jsx)(p.Z,{error:a})}function U(e){let n=(0,$.Z)().data,{artistId:t}=e,l="id"in e.slot?e.slot:(0,x.S3)(R,e.slot),g=(0,_.T)(l.organization.id),{billing:m,indoorsOrOutdoors:k}=l,T=(0,h.Db)(C.vz),w=(0,h.Db)(S.l),P=(0,h.Db)(C.N9),W=Z.useForm({defaultValues:{...e.initialInsert,slotIds:[l.id]}}),V=w.error||P.error,H=null==l?void 0:l.availChecks.find(e=>e.artist.id===t),U=H?(null==H?void 0:H.response)?v._[H.response]:v._.missing:null,J=z.n.isAdmin(n)||l.organization.isDiy,{toast:Q}=(0,B.Z)(),[K,X]=(0,G.useState)(!1);return(0,i.jsx)(Z.FormProvider,{...W,children:(0,i.jsx)(h.AE,{query:N,variables:{artistId:t},children:h=>{var x,v;let S=null===(x=h.data)||void 0===x?void 0:x.artistById;if(!S)return(0,i.jsx)(p.Z,{error:h.error});if(!g.data)return(0,i.jsx)(p.Z,{error:g.error});let C=g.data.slotsToFillViaFilter,$=i=>{let{shouldAutoConfirmBooking:r}=i;return W.handleSubmit(async i=>{let{bandConfiguration:o,buyerPrice:s,comments:a,platformFee:d=0,agencyFee:c=0,buyerNotes:u,slotIds:h}=i,g=[],x=()=>{Q({preset:"error",title:"Error creating booking",message:g.length?"".concat(g.length," created, one failed"):"No bookings created."})},j=new Map(C.map(e=>[e.id,e]));for(let e=0;e<h.length;e++){var v;let i;let p=h[e],f=j.get(p);if(!f)return x();let b=[{date:f.date,time:{hour:f.time.hour,minute:f.time.minute}}],y={billing:m,indoorsOrOutdoors:k,performanceLengthMins:f.durationMins,bandConfiguration:o,shouldAutoPublish:null!=f.organization.venue,fromSlotId:p,artistId:t,buyerPrice:s,organizationId:f.organization.id,isPublished:null!=f.organization.venue,comments:a,buyerNotes:u,stageId:null==l?void 0:null===(v=l.stage)||void 0===v?void 0:v.id};if(z.n.isAdmin(n)){let{data:e,error:n}=await T.execute({startTimes:b,input:{...y,status:r?"confirmed":"negotiating",stillRequiresContract:null==f.organization.venue&&!r,agencyFee:c,platformFee:d,buyerNotes:u,...K?{is4AmEvent:!0}:{}}});if(!n&&e){let[n,...t]=e.createBookingsAdmin;n&&(i=[n.id,...t.map(e=>e.id)])}}else if(f.organization.isDiy){let{data:e,error:l}=await w.execute({dateAndTimes:b,bookingInsert:{billing:m,indoorsOrOutdoors:k,performanceLengthMins:f.durationMins,bandConfiguration:o,shouldAutoPublish:!0,fromSlotId:f.id,artistId:t,buyerPrice
1:s,organizationId:f.organization.id,isPublished:!0,status:r?"confirmed":"negotiating",stillRequiresContract:!1,buyerNotes:u,...z.n.isAdmin(n)&&K?{is4AmEvent:!0}:{}}});if(!l&&e){let[n,...t]=e.createConfirmedBookings;n&&(i=[n.id,...t.map(e=>e.id)]),E.X.track("artist_avail_created",{num_dates_selected:null==i?void 0:i.length,eventType:"slot"})}}else{let{data:e,error:t}=await P.execute({input:{...y,firstStatus:"negotiating",comments:a,buyerNotes:u,...z.n.isAdmin(n)&&K?{is4AmEvent:!0}:{}},startTimes:b});if(!t&&e){let[n,...t]=e.createBookingsNonDiyBuyer;n&&(i=[n.id,...t.map(e=>e.id)])}}if(null==i||!i.length)return x();g.push(...i)}if(!(null==g?void 0:g.length))return;let[p,...f]=g;p&&e.onDidCreateBookings([p,...f])})};return j.o.fromISO(l.date).set({hour:l.time.hour,minute:l.time.minute}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.X,{children:(0,i.jsxs)(o.G,{gap:"$3",p:"$3",children:[(0,i.jsx)(a.x,{children:"Ready to create this booking?"}),(0,i.jsxs)(o.G,{gap:"$2",children:[(0,i.jsxs)(M,{fd:"row",gap:"$3",children:[(0,i.jsx)(d.q,{size:50,round:!0,children:(0,i.jsx)(d.q.ImageOrInitials,{name:S.name,sizes:"50px",publicCloudinaryId:null==S?void 0:null===(v=S.profileImage)||void 0===v?void 0:v.publicCloudinaryId})}),(0,i.jsx)(o.G,{als:"center",f:1,gap:"$2",theme:null==U?void 0:U.theme,children:(0,i.jsx)(a.x,{bold:!0,children:S.name})})]}),(0,i.jsx)(Z.Controller,{name:"slotIds",defaultValue:[l.id],render:e=>{let{field:n}=e;return(0,i.jsxs)(q.Q,{children:[(0,i.jsxs)(M,{gap:"$2",children:[(0,i.jsx)(a.x,{color:"$color11",children:1===n.value.length?"Date":"Dates"}),(0,i.jsx)(o.G,{gap:"$1",children:n.value.map(e=>{let n=C.find(n=>n.id===e),t=new Date().toISOString().split("T")[0];return l.date<t?null:n?(0,i.jsx)(q.Q.Trigger,{children:(0,i.jsx)(L.h,{slot:n})},e):(0,i.jsx)(q.Q.Trigger,{children:(0,i.jsx)(L.h,{slot:{},isLoading:!0})},e)})}),(0,i.jsxs)(o.G,{row:!0,ai:"center",gap:"$3",p:"$2",br:"$3",bw:2,boc:"$borderColor",theme:"blue",bg:"$color1",children:[(0,i.jsx)(o.G,{grow:!0,children:(0,i.jsx)(a.x,{children:"Want to add multiple dates?"})}),(0,i.jsx)(q.Q.Trigger,{children:(0,i.jsxs)(I.z,{als:"flex-end",accessibilityLabel:"Add Dates",themeInverse:!0,children:[(0,i.jsx)(I.z.Icon,{icon:c.v}),(0,i.jsx)(I.z.Text,{children:"Add Dates"})]})})]})]}),(0,i.jsx)(r.Theme,{reset:!0,children:(0,i.jsx)(q.Q.Content,{upcomingSlots:C,onChangeSlotIds:e=>n.onChange(Array.from(e)),selectedSlotIds:new Set(n.value),artistIdsToHighlight:[t],showPlaceholderArtists:!0})})]})}}),(0,i.jsx)(o.G,{children:(0,i.jsx)(Z.Controller,{name:"buyerPrice",rules:{required:!0},scrollToError:!0,render:e=>{let{field:t,fieldState:r}=e;return(0,i.jsxs)(M,{theme:r.error?"red":void 0,gap:"$1",children:[(0,i.jsx)(f.P,{error:r.error,inputRef:t.ref,onChange:t.onChange,rate:t.value}),z.n.isAdmin(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Z.Controller,{name:"platformFee",rules:{validate:e=>null!=e||"Enter a price."},scrollToError:!0,render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(f.P,{error:r.error,rate:null!==(n=t.value)&&void 0!==n?n:null,title:"Platform Fee",onChange:t.onChange,inputRef:t.ref})}}),(0,i.jsx)(Z.Controller,{name:"agencyFee",rules:{validate:e=>null!=e||"Enter a price."},scrollToError:!0,render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(f.P,{error:r.error,rate:null!==(n=t.value)&&void 0!==n?n:null,onChange:t.onChange,inputRef:t.ref,title:"Agency Fee"})}})]})]})}})}),(!S.category||!y.L.has(S.category))&&(0,i.jsx)(o.G,{children:(0,i.jsx)(Z.Controller,{scrollToError:!0,name:"bandConfiguration",rules:{required:!0},render:e=>{let{field:n,fieldState:t}=e;return(0,i.jsxs)(M,{fd:"row",ai:"center",theme:t.error?"red":void 0,children:[(0,i.jsx)(o.G,{f:1,children:(0,i.jsx)(a.x,{color:"$color11",children:"Configuration"})}),(0,i.jsx)(b.D,{error:t.error,bandConfiguration:n.value,onChange:n.onChange})]})}})}),(0,i.jsx)(M,{children:(0,i.jsx)(Z.Controller,{name:"comments",render:e=>{var n;let{field:t,fieldState:r}=e;return(0,i.jsx)(O.h,{comments:null!==(n=t.value)&&void 0!==n?n:"",onChange:t.onChange,error:r.error})}})}),z.n.isAdmin(n)&&(0,i.jsxs)(M,{theme:"yellow",fd:"row",ai:"center",jc:"space-between",children:[(0,i.jsx)(a.x,{children:"4AM Event"}),(0,i.jsx)(u.r,{checked:K,onCheckedChange:X})]}),!l.organization.defaultPaymentMethod&&(0,i.jsx)(M,{theme:"red",children:(0,i.jsx)(F.e,{venue:l.organization})}),J&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A._,{error:V}),(0,i.jsx)(Z.Submit,{children:e=>{let{isValid:n,isSubmitting:t}=e;return(0,i.jsx)(D.GY,{isValid:!0,fetching:{autoConfirm:t,sendOffer:t},onChangeIs4AmEvent:X,submit:{autoConfirm:$({shouldAutoConfirmBooking:!0}
1),sendOffer:$({shouldAutoConfirmBooking:!1})}})}})]})]})]})}),(l.organization.defaultPaymentMethod||l.organization.paysManually)&&!J&&(0,i.jsxs)(o.G,{p:"$3",pt:"$2",gap:"$2",children:[(0,i.jsx)(A._,{error:V}),(0,i.jsx)(Z.Submit,{children:e=>{let{isSubmitting:n,hasErrored:t}=e;return(0,i.jsx)(I.z,{themeInverse:!0,accessibilityLabel:"Submit Book artist from slot",...t&&{themeInverse:!1,theme:"red"},onPress:$({shouldAutoConfirmBooking:!1}),loading:n,children:(0,i.jsx)(I.z.Text,{children:"Submit Booking"})})}})]})]})}},t)})}},495281:function(e,n,t){t.d(n,{h:function(){return u}});var i=t(552322),r=t(175111),o=t(755338),l=t(152673),s=t(541251),a=t(547876),d=t(524257);let c=(0,l.B)("\n  fragment SelectedSlotItemForForm on Slot {\n    id\n    date\n    time {\n      hour\n      minute\n    }\n    organization {\n      id\n      name\n      location {\n        city\n      }\n    }\n  }\n");function u(e){var n,t;let l=(0,s.Jc)(c,e.slot),{isLoading:u=!1}=e;return(0,i.jsx)(r.G,{p:"$2",bg:"$color1",br:"$2",cur:"pointer",hoverStyle:{bg:"$color2"},gap:"$1",onPress:e.onPress,children:(0,i.jsxs)(d.Z.Group,{show:u,children:[(0,i.jsx)(o.x,{bold:!0,children:l.date?(0,i.jsxs)(i.Fragment,{children:[a.o.fromISO(l.date).toLocaleString({weekday:"short",day:"numeric",month:"long",year:"numeric"})," ",(0,i.jsxs)(o.x,{color:"$color11",children:["@"," ",l.time&&a.o.fromObject(l.time).toLocaleString({hour:"numeric",minute:"numeric"})]})]}):(0,i.jsx)(d.Z,{width:200,height:20})}),(0,i.jsx)(o.x,{children:(null===(n=l.organization)||void 0===n?void 0:n.name)?(0,i.jsxs)(i.Fragment,{children:[l.organization.name," ",!!(null===(t=l.organization.location)||void 0===t?void 0:t.city)&&"(".concat(l.organization.location.city,")")]}):(0,i.jsx)(d.Z,{width:150,height:16})})]})})}},669761:function(e,n,t){t.d(n,{Q:function(){return y}});var i=t(552322),r=t(175111),o=t(729879),l=t(239263),s=t(755338),a=t(596823),d=t(316431),c=t(861315),u=t(152673),h=t(541251),g=t(547876),m=t(454300),x=t(134042),j=t(76100),v=t(202784),p=t(394432);let f=(0,u.B)("\n  fragment SlotsSelector on Slot {\n    id\n    date\n    time {\n      hour\n      minute\n    }\n    organization {\n      id\n      name\n      location {\n        city\n      }\n    }\n    placeholderArtist {\n      id\n      name\n      slug\n    }\n    availChecks {\n      id\n      artist {\n        id\n        slug\n        name\n      }\n      response\n    }\n  }\n");function b(e){let{onChangeSlotIds:n,selectedSlotIds:t,artistIdsToHighlight:c,showPlaceholderArtists:u=!1,...j}=e,b=(0,h.Jc)(f,j.upcomingSlots);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.G,{mb:"$3",row:!0,jc:"flex-end",gap:"$1",children:[(0,i.jsxs)(m.z,{accessibilityLabel:"Clear All",onPress:()=>n(new Set),children:[(0,i.jsx)(m.z.Icon,{icon:o.r}),(0,i.jsx)(m.z.Text,{children:"Clear All"})]}),(0,i.jsx)(m.z,{als:"flex-start",accessibilityLabel:"Select All",onPress:()=>n(new Set(b.map(e=>e.id))),themeInverse:t.size===b.length,children:(0,i.jsx)(m.z.Icon,{icon:l.J})})]}),b.map(e=>{var o,l;let u=t.has(e.id),h=c?e.availChecks.filter(e=>c.includes(e.artist.id)):null,m=c&&e.placeholderArtist&&c.includes(e.placeholderArtist.id),j=()=>{let i=new Set(t);u?i.delete(e.id):i.add(e.id),n(i)};return(0,i.jsxs)(r.G,{row:!0,ai:"center",p:"$2",bg:"$color1",br:"$2",gap:"$3",children:[(0,i.jsx)(r.G,{children:(0,i.jsx)(x.X,{brand:!1,checked:u,onCheckedChange:j,children:(0,i.jsx)(x.X.Indicator,{})})}),(0,i.jsxs)(r.G,{grow:!0,onPress:j,gap:"$1",children:[(0,i.jsxs)(s.x,{children:[g.o.fromISO(e.date).toLocaleString({weekday:"short",day:"numeric",month:"long",year:"numeric"})," ",(0,i.jsxs)(s.x,{color:"$color11",children:["@"," ",g.o.fromObject(e.time).toLocaleString({hour:"numeric",minute:"numeric"})]})]}),(0,i.jsxs)(s.x,{children:[e.organization.name," ",!!(null===(o=e.organization.location)||void 0===o?void 0:o.city)&&"(".concat(e.organization.location.city,")")]}),(0,i.jsxs)(r.G,{row:!0,flexWrap:"wrap",gap:"$2",children:[!!(null==h?void 0:h.length)&&(0,i.jsx)(i.Fragment,{children:h.map(e=>{if(!e.response)return null;let n=p._[e.response];return(0,i.jsx)(v.Fragment,{children:(0,i.jsxs)(a.C,{theme:n.theme,children:[(0,i.jsx)(a.C.Icon,{icon:n.icon}),(0,i.jsxs)(a.C.Text,{children:[e.artist.name,": ",n.title]})]})},e.id)})}),!!m&&(0,i.jsxs)(a.C,{theme:"yellow",children:[(0,i.jsx)(a.C.Icon,{icon:d.S}),(0,i.jsxs)(a.C.Text,{children:[null===(l=e.placeholderArtist)||void 0===l?void 0:l.name,": Tentative"]})]})]})]})]},e.id)})]})}let y=(0,c.$)(function(e){return(0,i.jsx)(j.Z.Portaled,{...e})},{Trigger:j.Z.Portaled.Trigger,Content:function(e){return(0,i.jsx)(j.Z.Portaled.Content,{header:!0,title:"Select Dates (".concat(e.selectedSlotIds.size,")"),button:(0,i.jsx)(j.Z.Portaled.Close,{children:(0,i.jsx)(m.z,{brand:!0,accessibilityLabel:"Done",children:(0,i.jsx)(m.z.Text,{children:"Done"})})}),children:(0,i.jsx)(b,{...e})})}})},498042:function(e,n,t){t.d(n,{AM:function(){return Z},b6:function(){return N},mw:function(){return R}});
1var i=t(552322),r=t(175111),o=t(755338),l=t(534042),s=t(970930),a=t(831318),d=t(195388),c=t(986541),u=t(371894),h=t(341732),g=t(652525),m=t(76100),x=t(152673),j=t(541251),v=t(884443),p=t(202784),f=t(505309),b=t(547876),y=t(134569),I=t(933309),S=t(84951),C=t(650757),$=t(490667),z=t(454300),A=t(735702),k=t(955261),T=t(328462),w=t(527959),B=t(497096),G=t(438368),F=t(782637),D=t(854018),O=t(720295),P=t(481108),q=t(669761),_=t(676298),L=t(495281),E=t(279185),M=t(33229);let Z=(0,x.B)("\n  fragment SlotDetailArtistAvailability on Slot {\n    ...CreateBookingFromSlot\n    id\n    date\n    time {\n      hour\n      minute\n    }\n    stage {\n      id\n      name\n      indoorsOrOutdoors\n    }\n    publicNotes\n    organization {\n      id\n      slug\n      name\n      isDiy\n      venue {\n        id\n      }\n    }\n    placeholderArtist {\n      id\n      slug\n      name\n      profileImage {\n        publicCloudinaryId\n      }\n    }\n    durationMins\n    availChecks {\n      ...BuyerAvailCheck\n      id\n      startTime\n      location {\n        timezone\n      }\n      performanceLengthMins\n      artist {\n        slug\n        name\n        sellerIds\n\n        profileImage {\n          publicCloudinaryId\n        }\n      }\n      organization {\n        id\n        slug\n        accountManager {\n          id\n          firebaseId\n        }\n        venue {\n          id\n        }\n      }\n      fromGigboard\n      response\n      respondedAt\n    }\n  }\n");function N(e){var n,t,c,u,h;let g=(0,j.Jc)(Z,e.slot),[x,S]=(0,p.useState)(null),w=(0,y.Uo)(),B=null!==(c=null===(n=(0,v.S3)(F.zD,g.availChecks))||void 0===n?void 0:n.filter(e=>!e.fromGigboard))&&void 0!==c?c:[],G=null!==(u=null===(t=(0,v.S3)(F.zD,g.availChecks))||void 0===t?void 0:t.filter(e=>e.fromGigboard))&&void 0!==u?u:[],q=null==G?void 0:G.reduce((e,n)=>{let t=n.artist.slug,i=e.find(e=>e.artist.slug===t);if(i){if("available"===n.response&&"available"!==i.response){let i=e.findIndex(e=>e.artist.slug===t);e[i]=n}}else e.push(n);return e},[]),_={checks:B},L={checks:q},N=(0,O.Z)().data,R=P.n.isAdmin(N),{isGigBoardEnabled:V}=(0,E.g)(),H=g.availChecks[0],U=b.o.fromISO(g.date).set({hour:g.time.hour,minute:g.time.minute}),J=g.availChecks.find(e=>{let n=(0,f.xe)({startTime:e.startTime,timezone:e.location.timezone}).luxon;return["year","month","day","hour","minute"].some(e=>!U.hasSame(n,e))||g.durationMins!==(null==H?void 0:H.performanceLengthMins)}),{setParams:Q,bookArtistId:K}=(0,k.t)(),X=e=>{Q({bookArtistId:e})},Y=(0,$.Z)(w.isPending),[ee,en]=(0,p.useState)([]),et=!0===g.organization.isDiy;return R||et?(0,i.jsxs)(r.G,{p:"$3",gap:"$3",children:[(0,i.jsxs)(r.G,{py:30,px:20,gap:30,bg:"#161518",br:10,ov:"hidden",children:[(0,i.jsxs)(r.G,{h:22,gap:"$2",fd:"row",ai:"center",children:[(0,i.jsx)(o.x,{fontSize:16,fontWeight:600,children:"Artists Availability"}),(0,i.jsx)(o.x,{color:"#FFFFFF80",fontSize:16,fontWeight:500,children:_?" (".concat(_.checks.length,")"):""})]}),!(null==_?void 0:_.checks.length)&&(0,i.jsxs)(o.x,{children:["Use ",I.Z," to ask artists if they are free for this date."," Their responses will show here."]}),(0,i.jsxs)(i.Fragment,{children:[J?(0,i.jsxs)(r.G,{theme:"yellow",gap:"$3",p:"$2",bg:"$color3",br:"$2",children:[(0,i.jsx)(r.G,{children:(0,i.jsx)(l.u,{size:14,color:"$color11"})}),(0,i.jsxs)(r.G,{f:1,gap:"$2",children:[(0,i.jsxs)(o.x,{children:["This ","avail check's"," time"," ","doesn't match the booking request. Please be aware that artists may have given their availability for this time:"]}),(0,i.jsxs)(r.G,{children:[(0,i.jsxs)(o.x,{color:"$color11",children:[(0,f.xe)({startTime:J.startTime,timezone:J.location.timezone}).luxon.toLocaleString({weekday:"short"}),","," ",(0,f.xe)({startTime:J.startTime,timezone:J.location.timezone}).luxon.toLocaleString({dateStyle:"medium"})]}),(0,i.jsx)(o.x,{color:"$color11",children:(0,f.vW)({startTime:J.startTime,durationMins:null!==(h=J.performanceLengthMins)&&void 0!==h?h:0,timezone:J.location.timezone}).timeRange})]})]})]}):null,(0,i.jsxs)(D.T,{children:[(0,i.jsx)(D.T.Trigger,{children:e=>{let{onOpen:n}=e;return R||"web"!==M.Z.OS?(0,i.jsx)(F.B6,{availChecks:B,onPressBookingArtist:e=>{X(e.id)},onPressCreateArtistOption:e=>{n(e)}}):(0,i.jsx)(F.ZO,{availChecks:B,onPressBookingArtist:e=>{X(e.id)},onPressCreateArtistOption:e=>{n(e)}})}}),(0,i.jsx)(D.T.Content,{slotId:g.id})]}),(0,i.jsx)(T.V,{artistIds:ee,open:x===g.id,onChangeArtistIds:en,organizationId:g.organization.id,onOpenChange:e=>{e?S(g.id):S(null)},button:(0,i.jsxs)(m.Z.Portaled,{children:[(0,i.jsx)(m.Z.Portaled.Trigger,{children:(0,i.jsx)(z.z,{brand:!0,accessibilityLabel:"Next",disabled:!ee.length,children:(0,i.jsx)(z.z.Text,{children:"Next"})})}),(0,i.jsx)(m.Z.Portaled.Content,{header:!0,title:"Send Avails?",children:(0,i.jsx)(W,{venueId:g.organization.id,artistIds:ee,slotId:g.id,onSuccess:()=>{S(null),en([])}})})]}),children:(0,i.jsxs)(z.z,{accessibilityLabel:"View artist availability",h:40,bg:"#232323",br:100,py:0,children:[(0,i.jsx)(z.z.Text,{fontSize:14,fontWeight:500,children:"Add Artists"}),(0,i.jsx)(z.z.Icon,{icon:s.v})]})},g.id)]}),Y&&(0,i.jsxs)(r.G,{stretch:!0,ai:"center",gap:"$3",jc:"center",children:[(0,i.jsx)(C.x,{stretch:!0}),(0,i.jsx)(a.T,{}),(0,i.jsx)(o.x,{center:!0,children:"Creating chat"})]})]}),L&&L.checks.length>
10&&V&&(0,i.jsxs)(r.G,{p:"$3",gap:"$3",bg:"$color1",br:"$3",ov:"hidden",children:[(0,i.jsxs)(r.G,{fd:"row",gap:"$2",ai:"center",children:[(0,i.jsx)(d.i,{size:20,color:"$brand"}),(0,i.jsxs)(o.x,{fontSize:14,color:"$brand",children:["GigBoard Applications",L?" (".concat(L.checks.length,")"):""]})]}),(0,i.jsx)(F.ZO,{availChecks:L.checks,onPressBookingArtist:e=>{X(e.id)}})]}),(0,i.jsx)(A.I,{open:!!K,onOpenChange:e=>{e||X(void 0)},children:!!K&&(0,i.jsx)(A.I.Content,{artistId:K,slotId:g.id,initialInsert:{comments:g.publicNotes}})})]}):null}let R=(0,x.B)("\n  mutation AddArtistsToSlotsForAvails($artistIds: [String!]!, $slotIds: [String!]!) {\n    createAvailChecksOnSlots(artistIds: $artistIds, slotIds: $slotIds) {\n      id\n      artist {\n        id\n        slug\n      }\n    }\n  }\n");function W(e){var n,t,l;let{artistIds:s,slotId:a,venueId:d,onSuccess:m}=e,[x,j]=(0,p.useState)(new Set([a])),v=(0,w.R)(s),f=(0,_.T)(d),b=(0,g.Db)(R),{toast:y}=(0,S.Z)();return(0,i.jsxs)(r.G,{gap:"$3",children:[(0,i.jsxs)(o.x,{children:[1!==s.length?"Artists":"Artist"," to request availability from (",s.length,"):"]}),(0,i.jsxs)(r.G,{gap:"$3",children:[null===(n=v.data)||void 0===n?void 0:n.artistsByIds.map(e=>{var n;return(0,i.jsxs)(r.G,{center:!0,gap:"$3",row:!0,children:[(0,i.jsx)(r.G,{children:(0,i.jsx)(c.q,{round:!0,size:30,children:(0,i.jsx)(c.q.ImageOrInitials,{publicCloudinaryId:null===(n=e.profileImage)||void 0===n?void 0:n.publicCloudinaryId,name:e.name,sizes:"50px"})})}),(0,i.jsx)(r.G,{grow:!0,children:(0,i.jsx)(o.x,{children:e.name})})]},e.id)}),!v.data&&(0,i.jsx)(G.Z,{children:"Loading artists..."}),(0,i.jsx)(B._,{error:v.error})]}),(0,i.jsx)(r.G,{height:1,bg:"$borderColor"}),(0,i.jsxs)(o.x,{children:["For ",x.size," upcoming ",1===x.size?"date":"dates",":"]}),(0,i.jsx)(B._,{error:f.error}),(0,i.jsxs)(q.Q,{children:[(0,i.jsx)(r.G,{gap:"$1",children:null===(t=f.data)||void 0===t?void 0:t.slotsToFillViaFilter.map(e=>x.has(e.id)?(0,i.jsx)(q.Q.Trigger,{children:(0,i.jsx)(L.h,{slot:e})},e.id):null)}),(0,i.jsxs)(r.G,{p:"$3",bw:2,boc:"$borderColor",bg:"$color1",br:"$3",gap:"$3",theme:"blue",children:[(0,i.jsx)(o.x,{children:"Want to send these avail checks for multiple dates? Select dates below."}),(0,i.jsx)(q.Q.Trigger,{children:(0,i.jsxs)(z.z,{themeInverse:!0,als:"flex-start",accessibilityLabel:"Select Dates",loading:!f.data,children:[(0,i.jsx)(z.z.Icon,{icon:u.v}),(0,i.jsx)(z.z.Text,{children:"Select Dates"})]})})]}),(0,i.jsx)(h.Theme,{reset:!0,children:f.data&&(0,i.jsx)(q.Q.Content,{onChangeSlotIds:j,selectedSlotIds:x,upcomingSlots:null===(l=f.data)||void 0===l?void 0:l.slotsToFillViaFilter})})]}),(0,i.jsx)(B._,{error:b.error}),(0,i.jsx)(z.z,{accessibilityLabel:"Send Avails",onPress:()=>{b.execute({artistIds:s,slotIds:Array.from(x)}).then(e=>{var n,t;if((null===(n=e.data)||void 0===n?void 0:n.createAvailChecksOnSlots)&&!e.error){let n=null===(t=e.data)||void 0===t?void 0:t.createAvailChecksOnSlots;if(n.length===s.length)y({title:"Avails sent",preset:"done"});else{let e=s.filter(e=>!n.some(n=>n.artist.id===e));e.length&&y({title:"Avails sent",message:"".concat(e.length," ").concat(1===e.length?"artist is":"artists are"," unavailable"),preset:"done"})}m()}})},brand:!0,loading:b.fetching||f.fetching,children:(0,i.jsx)(z.z.Text,{children:"Send Avails"})})]})}},676298:function(e,n,t){t.d(n,{T:function(){return h}});var i=t(652525),r=t(202784),o=t(547876),l=t(720295),s=t(481108),a=t(152673),d=t(566512);let c=(0,a.B)("\n  query SendAvailsUpcomingSlots($filter: FilterSlot!, $isAdmin: Boolean!, $limit: Int!) {\n    slotsToFillViaFilter: slotsByFilterBuyer(\n      filter: $filter\n      limit: $limit\n      offset: 0\n      order: { startTime: { dir: ASC } }\n      isAdmin: $isAdmin\n    ) {\n      ...SlotsSelector\n      ...SelectedSlotItemForForm\n      id\n      date\n      time {\n        hour\n        minute\n      }\n      organization {\n        id\n        name\n        location {\n          city\n        }\n        venue {\n          id\n        }\n        isDiy\n      }\n      durationMins\n    }\n  }\n"),u=o.o.local();function h(e){let n=(0,l.Z)().data,{year:t,month:a,day:h}=(0,d.e)(),g=(0,r.useMemo)(()=>o.o.fromObject({day:h||u.day,month:a||u.month,year:t||u.year}),[h,a,t]),m=u.toISODate(),x=g.startOf("month").toISODate();return(0,i.aM)(c,(0,r.useMemo)(()=>({variables:{filter:{and:[{or:[{hasBooking:{eq:!1}},{bookingStatus:{nin:["confirmed","negotiating","contracting"]}}]}],organizationId:{eq:e},date:{gte:m>x?m:x}},isAdmin:s.n.isAdmin(n),limit:400},pause:!e,requestPolicy:"cache-and-network"}),[n,e,x,m]))}},33639:function(e,n,t){t.d(n,{F:function(){return x}});var i=t(552322),r=t(918517),o=t(341732),l=t(755338),s=t(784420),a=t(1
175111),d=t(608955),c=t(183896),u=t(33229),h=t(652525),g=t(446285),m=t(202784);function x(e){let{modal:n,isExecuting:t,error:x}=e,[j,v]=(0,m.useState)({isOpen:!1,id:null});(0,m.useImperativeHandle)(n,()=>({open:e=>{let{id:n,execute:t,onDiscardChanges:i}=e;return v({isOpen:!0,id:n,execute:async e=>t(e),onDiscardChanges(){null==i||i()}})}}));let[p,f]=(0,m.useState)("THIS_EVENT"),b=()=>{v({isOpen:!1,id:null,execute:null}),f("THIS_EVENT")};return(0,i.jsx)(c.Vq,{open:j.isOpen,onOpenChange:e=>{e||b()},children:(0,i.jsxs)(r.u,{visible:j.isOpen,onRequestClose:b,modalSheetSize:"mediumResizable",children:[(0,i.jsx)(o.Theme,{inverse:!0,children:(0,i.jsx)(c.Vq.Overlay,{onPress:b})}),(0,i.jsxs)(c.Vq.Content,{gap:"$4",flex:u.Z.select({native:1}),children:[(0,i.jsx)(l.x,{fontWeight:"bold",children:"Update repeat event"}),(0,i.jsx)(s.E,{value:p,gap:"$3",children:(0,g.qh)({THIS_EVENT:{title:"This event"},THIS_AND_FOLLOWING_EVENTS:{title:"This and following events"},ALL_EVENTS:{title:"All events"}}).map(e=>{let[n,{title:t}]=e;return(0,i.jsx)(m.Fragment,{children:(0,i.jsxs)(a.G,{cursor:"pointer",onPress:()=>{f(n)},fd:"row",gap:"$2",children:[(0,i.jsx)(s.E.Item,{onPress:()=>{f(n)},value:n,cursor:"inherit",children:(0,i.jsx)(s.E.Indicator,{})}),(0,i.jsx)(a.G,{f:1,children:(0,i.jsx)(l.x,{cursor:"inherit",tag:"label",color:"$color12",children:t})})]})},n)})}),(0,i.jsxs)(a.G,{fd:"row",jc:"space-between",gap:"$2",children:[(0,i.jsx)(d.$,{bg:"$color1",accessibilityLabel:"Discard Change",onPress:()=>{if(j.isOpen){var e;b(),null===(e=j.onDiscardChanges)||void 0===e||e.call(j)}},children:(0,i.jsx)(d.$.Text,{children:"Discard Change"})}),(0,i.jsx)(d.$,{themeInverse:!0,accessibilityLabel:"Save repeat event",loading:t,onPress:async()=>{if(j.isOpen){let{success:e}=await j.execute({instruction:p,id:j.id});e&&b()}},children:(0,i.jsx)(d.$.Text,{color:"$color12",children:t?"Saving...":"Save Event"})})]}),(0,i.jsx)(h.F7,{error:x,render:e=>(0,i.jsx)(l.x,{theme:"red",bg:"$color3",color:"$color11",p:"$3",br:"$2",children:e.join("\n")})})]})]})})}x.useModal=function(){return(0,m.useRef)(null)}},971907:function(e,n,t){t.d(n,{H:function(){return g},j:function(){return u}});var i=t(84951),r=t(652525),o=t(514865),l=t(547876),s=t(993702),a=t(152673),d=t(202784);let c=(0,a.B)("\n  mutation PatchSlot($id: String!, $patch: SlotPatch!) {\n    patchSlotsToFill: updateSlot(id: $id, patch: $patch) {\n      id\n      __typename\n      date\n      time {\n        hour\n        minute\n      }\n      durationMins\n      timezone\n      indoorsOrOutdoors\n      stage {\n        id\n        name\n      }\n      ...VenueSlotsCalendar_SlotFragment\n\n      ...VenueSlotsCalendar_SlotForBuyerAndAdminFragment\n    }\n  }\n");function u(){let e=(0,r.Db)(c),{toast:n}=(0,i.Z)();return(0,d.useMemo)(()=>({...e,execute:async t=>e.execute(t).then(e=>{var i;return(null===(i=e.data)||void 0===i?void 0:i.patchSlotsToFill)&&!e.error&&n({title:"Booking Request Saved",message:t.patch.durationMins?"New duration: ".concat((0,s.J)(t.patch.durationMins)):void 0,preset:"done"}),e})}),[e,n])}let h=(0,a.B)("\n  mutation UpdateSlotDate($id: String!, $date: Date, $time: TimeObjInput) {\n    updateTimingOfSlotsToFill: updateSlot(id: $id, patch: { date: $date, time: $time }) {\n      id\n      __typename\n      date\n      time {\n        hour\n        minute\n      }\n      durationMins\n      timezone\n      ...VenueSlotsCalendar_SlotFragment\n      ...VenueSlotsCalendar_SlotForBuyerAndAdminFragment\n    }\n  }\n");function g(){let e=(0,r.Db)(h),{toast:n}=(0,i.Z)();return(0,d.useMemo)(()=>({...e,execute:t=>e.execute({...t}).then(e=>{var i;if((null===(i=e.data)||void 0===i?void 0:i.updateTimingOfSlotsToFill)&&!e.error&&t.date&&t.time){let e=l.o.fromISO(t.date).set(t.time);n({title:"Booking Request Saved",message:[e.toLocaleString({dateStyle:"full"}),e.toLocaleString({timeStyle:"short"})].join(" @ "),preset:"done"})}else e.error&&n({title:"Error",message:(0,o.E)(e.error)[0],preset:"error"});return e})}),[e,n])}},955261:function(e,n,t){t.d(n,{t:function(){return o}});let{useParam:i,useParams:r}=(0,t(301036).X)();function o(){let[e="",n]=i("slotId",{initial:"",parse:String}),{setParams:t,params:o}=r();return{slotId:e,setSlotId:n,setParams:t,bookArtistId:null==o?void 0:o.bookArtistId}}}
1,183896:function(e,n,t){t.d(n,{Vq:function(){return d}});var i=t(536825),r=t(341732);let o=i.Vq,l=(0,r.styled)(i.Vq.Content,{bordered:!0,elevate:!0,borderColor:"$borderColor",animation:["quick",{opacity:{overshootClamping:!0}}],enterStyle:{x:0,y:-20,opacity:0,scale:.9},exitStyle:{x:0,y:10,opacity:0,scale:.95},x:0,scale:1,maxWidth:600,width:"100%",opacity:1,y:0,bg:"$color3",p:"$3",br:"$3",gap:"$3",onOpenAutoFocus(e){e.preventDefault()}}),s=(0,r.styled)(i.Vq.Portal,{width:"100%",px:"$3"}),a=(0,r.styled)(i.Vq.Overlay,{o:.47,bg:"$color9"}),d=(0,r.withStaticProperties)(o,{Portal:s,Overlay:a,Content:l,Trigger:i.Vq.Trigger,Title:i.Vq.Title,Close:i.Vq.Close})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.