1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1818],{53766:function(e,t,n){"use strict";n.d(t,{Zb:function(){return i},aY:function(){return l},xx:function(){return c}});var s=n(85893),a=n(88426),r=n(67294),o=n(37174);const i=r.forwardRef(((e,t)=>{let{asChild:n,className:r,edgeToEdgeMobile:i,...l}=e;const c=n?a.g7:"div";return(0,s.jsx)(c,{ref:t,className:(0,o.cn)("bg-background dark:bg-background-10 border-b sm:rounded-lg sm:border",i?"rounded-none border-b":"rounded-lg border",r),...l})}));i.displayName="Card";const l=r.forwardRef(((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)("div",{ref:t,className:(0,o.cn)("px-4 py-5 sm:p-8",n),...a})}));l.displayName="CardContent";const c=r.forwardRef(((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)("div",{ref:t,className:(0,o.cn)("bg-background-20 -mx-4 my-5 h-[1px] sm:-mx-8 sm:my-8",n),...a})}));c.displayName="CardDivider"},33522:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var s=n(85893),a=(n(67294),n(51221)),r=n.n(a);function o(e){let{children:t,className:n,light:a=!1,orientation:o="center",style:i,type:l="horizontal"}=e,c=["horizontal"===l?r()["sbui-divider"]:r()["sbui-divider-vertical"]];return a&&c.push(r()["sbui-divider--light"]),t?c.push(r()["sbui-divider--".concat(o)]):t||"horizontal"!==l||c.push(r()["sbui-divider--no-text"]),n&&c.push(n),(0,s.jsx)("div",{className:c.join(" "),role:"seperator",style:i,children:t&&(0,s.jsx)("p",{className:r()["sbui-divider__content"],children:t})})}},62472:function(e,t,n){"use strict";n.d(t,{i:function(){return s.Z}});var s=n(33522)},39818:function(e,t,n){"use strict";var s=n(85893),a=n(4298),r=n.n(a),o=n(67294),i=n(83509);t.Z=e=>{let{initialTextValue:t,onSelect:n}=e;const[a,l]=(0,o.useState)(!1),c=document.documentElement.classList.contains("dark");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r(),{src:"https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyB4mnDLmjo_YgGu1Mv6vqr28CrFZnKBxSs","&language=en_gb&libraries=places"),onReady:()=>l(!0)}),a?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(i.Z,{inputType:"search",inputClassName:"overflow-hidden rounded-md",inputStyle:"--color: blue;",minLength:4,style:{input:{width:"100%",fontSize:"1rem"},suggests:{borderRadius:"0.375rem",padding:"10px 20px",background:c?"#2A2A2A":"white"},suggestItem:{margin:"5px 0",cursor:"pointer",fontSize:"0.875rem"}},inputMode:"search",placeholder:"Type and select location",onSuggestSelect:e=>{var t,s;if(!e)return n(void 0);const a=null===e||void 0===e?void 0:e.gmaps.address_components.filter((e=>e.types.includes("locality"))),r=null===e||void 0===e?void 0:e.gmaps.address_components.filter((e=>e.types.includes("country")));n({lat:parseFloat(e.location.lat.toFixed(2)),lng:parseFloat(e.location.lng.toFixed(2)),city:null===(t=a[0])||void 0===t?void 0:t.long_name,country:null===(s=r[0])||void 0===s?void 0:s.long_name,label:e.label})},initialValue:t})}):(0,s.jsx)(s.Fragment,{})]})}},23794:function(e,t,n){"use strict";n.d(t,{i:function(){return s.Z}});var s=n(39818)},70456:function(e,t,n){"use strict";n.d(t,{fB:function(){return u}});var s=n(85893),a=n(67294),r=n(97366);const o=(0,a.forwardRef)(((e,t)=>{const[n,o]=(0,a.useState)(0),i=t=>{const n=e.items[t];n&&e.command({id:n.id,label:n.name,type:n.type,slug:n.slug})};return(0,a.useEffect)((()=>o(0)),[e.items]),(0,a.useImperativeHandle)(t,(()=>({onKeyDown:t=>{let{event:s}=t;return"ArrowUp"===s.key?(o((n+e.items.length-1)%e.items.length),!0):"ArrowDown"===s.key?(o((n+1)%e.items.length),!0):"Enter"===s.key&&(i(n),!0)}}))),(0,s.jsx)("div",{className:"bg-background dark:bg-background-10 ring-background-20 flex flex-col items-start rounded-lg shadow-lg ring-1 ring-opacity-5",children:e.items.length?e.items.map(((e,t)=>(0,s.jsxs)("button",{className:"".concat(t===n?"hover:bg-accent-60 dark:hover:bg-background-30 bg-accent-60 dark:bg-background-30 font-medium":"hover:bg-accent-60 dark:hover:bg-background-30"," item flex w-full items-center gap-x-2 px-4 py-1 text-base"),onClick:()=>i(t),children:[(0,s.jsx)(r.Yt,{className:"h-8 w-8",src:e.avatar}),e.name]},t))):(0,s.jsx)("div",{className:"item px-4 py-1",children:"No result"})})}));o.displayName="MentionsList";var i=o,l=n(71284),c=n(46488),d=n(52435);function u(){const e=d.S.useContext();return m((async()=>[...await e.users.getAll.fetch({}),...(await e.team.getAll.fetch({})).teams]))}const m=e=>({items:async t=>{let{query:n}=t;return(await e()).map((e=>{let{firstName:t,lastName:n,id:s,avatar:a,name:r,slug:o,members:i}=e;return{name:r?"".concat(r):"".concat(t," ").concat(n),id:s,slug:o,avatar:a,type:i?"team":"user"}})).filter((e=>e.name.toLowerCase().indexOf(n.toLowerCase())>=0)).slice(0,5)},render:()=>{let e,t;return{onStart:n=>{e=new l.M_(i,{props:n,editor:n.editor}),n.clientRect&&(t=(0,c.ZP)("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){e.updateProps(n),n.clientRect&&t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var s;return"Escape"===n.event.key?(t[0].hide(),!0):null===e||void 0===e||null===(s=e.ref)||void 0===s?void 0:s.onKeyDown(n)},onExit(){null===t||void 0===t||t[0].destroy(),null===e||void 0===e||e.destroy()}}}})},62931:function(e,t,n){"use strict";n.d(t,{t:function(){return c}});var s=n(85893),a=n(30120),r=n(70302),o=n(97366),i=n(91678);function l(e){let{name:t,user:n,visibility:l,embedded:c,href:d,createdAt:u,spaceName:m,spaceSlug:p,isPinned:h,team:f}=e;return(0,s.jsxs)("div",{className:"flex w-full items-center",children:[(0,s.jsx)("span",{className:"flex-shrink-0",children:(0,s.jsx)(o.Yt,{className:"h-12 w-12",linkToProfile:!c,href:d,user:n,text:t,team:f})}),(0,s.jsxs)("div",{className:"ml-4",children:[(0,s.jsx)("span",{className:"text-foreground font-medium",children:t}),(0,s.jsxs)("div",{className:"text-foreground-10 block w-full text-sm sm:text-xs",children:[(0,s.jsxs)(r.X,{useNormalLink:Boolean(c),href:"/spaces/".concat(p),className:"group",children:[(0,s.jsxs)("span",{className:"text-foreground-10",children:[h?"Pinned in":"Posted in"," "]}),(0,s.jsx)("span",{className:"font-semibold group-hover:underline",children:m}),(0,s.jsx)("span",{className:"text-foreground-10 ",children:" \u2022 "})]}),(0,s.jsx)(i.Z,{content:a.ou.fromJSDate(u).setLocale("en-US").toLocaleStr
1ing(a.ou.DATETIME_MED),children:(0,s.jsx)("span",{className:"text-foreground-10 block cursor-help hover:underline sm:inline-block",children:a.ou.fromJSDate(u).toRelative({style:"short"})})}),"public"!==(null===l||void 0===l?void 0:l.toLowerCase())&&l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-foreground-10 ",children:" \u2022 "}),(0,s.jsxs)("span",{className:"text-foreground-10 capitalize",children:[(null===l||void 0===l?void 0:l.toLowerCase())||"unknown"," "]})]})]})]})]})}const c=e=>{let{post:t,embedded:n=!1}=e;var a,r,o,i;const c=t.team?t.team.name:"".concat(t.creator.firstName," ").concat(t.creator.lastName);return(0,s.jsx)(l,{name:c||"Unknown",user:t.creator,visibility:null===t||void 0===t||null===(a=t.topics[0])||void 0===a?void 0:a.visibility,embedded:n,href:t.team?"/teams/".concat(null===(r=t.team)||void 0===r?void 0:r.slug):void 0,createdAt:(null===t||void 0===t?void 0:t.scheduledAt)||(null===t||void 0===t?void 0:t.createdAt),spaceName:null===t||void 0===t||null===(o=t.topics[0])||void 0===o?void 0:o.title,spaceSlug:null===t||void 0===t||null===(i=t.topics[0])||void 0===i?void 0:i.slug,isPinned:null===t||void 0===t?void 0:t.isPinned,team:t.team})}},17326:function(e,t,n){"use strict";n.d(t,{tz:function(){return E},An:function(){return F},nq:function(){return H}});var s=n(85893),a=n(70385),r=n(41664),o=n.n(r),i=n(4298),l=n.n(i),c=n(67294),d=n(86501),u=n(70302),m=n(24158),p=n(52435),h=n(79570),f=n(37174),v=n(62131),g=n(18922),x=n(92395),b=n(42393),y=n(53402),j=n(58238),w=n(41790),N=n(97366),k=n(11163),C=n(13500),T=n(54565),P=n(6343),L=n(69217),S=n(5628),_=n(62472),I=n(65951),A=n(89112),M=n(26551);var R=e=>{let{post:t,className:n,buttonClassName:a}=e;const r=(0,L.e)(),o=p.S.useContext(),i=(0,S.Z)(),l=(0,k.useRouter)(),{push:u}=(0,k.useRouter)(),{mutate:m}=p.S.posts.save.useMutation({onSuccess(){d.ZP.success("Post Saved"),o.invalidate()},onError(){d.ZP.error("Post could not be saved")}}),{mutate:h}=p.S.posts.unsave.useMutation({onSuccess(){d.ZP.success("Post Unsaved"),o.invalidate()},onError(){d.ZP.error("Message could not be unsaved")}}),{mutate:v}=p.S.report.send.useMutation({onSuccess(){d.ZP.success("Post Reported")},onError(){d.ZP.error("Post could not be reported")}}),{mutate:b}=p.S.posts.delete.useMutation({async onSuccess(e){var t,n;(null===(t=l.query.postSlug)||void 0===t?void 0:t.includes(e.id))&&l.pathname.includes("/posts/[postSlug]")?(null===(n=e.topics[0])||void 0===n?void 0:n.id)?await u("/topics/".concat((0,f.QF)({id:e.topics[0].id,title:e.topics[0].title}))):await u("/"):o.invalidate();d.ZP.success("Post Deleted!")}}),{mutate:y}=p.S.posts.pinPost.useMutation({onSuccess(){o.invalidate(),(0,d.ZP)("Post updated!",{icon:"\ud83d\udccc"})}}),[j,w]=(0,c.useState)(!1);return(0,s.jsxs)("div",{className:(0,f.cn)("flex self-end sm:gap-x-1",n),children:[j&&(0,s.jsx)(A.IW,{post:t,close:()=>w(!1)}),r&&(0,s.jsx)(I.L,{className:"z-50 w-auto",align:"end",overlay:(0,s.jsxs)(s.Fragment,{children:[t&&(0,s.jsx)(P.b,{creatorId:null===t||void 0===t?void 0:t.creatorId,teamId:(null===t||void 0===t?void 0:t.teamId)||void 0,children:(0,s.jsx)("div",{onClick:()=>w(!0),children:(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.yl5,{}),disabled:!0,children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Edit"})})})}),(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.vUr,{}),onClick:()=>{(0,C.v)("".concat(window.location.origin,"/posts/").concat(t.slug))},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Copy link to post"})}),!1===t.savedByMe?(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.BZM,{}),onClick:()=>{m({id:t.id})},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Save post"})}):(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.BZM,{}),onClick:()=>{h({id:t.id})},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Unsave post"})}),(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.DpU,{}),onClick:async()=>{await i({title:"Are you sure?",description:"Are you sure you want to report this post?",confirmText:"Report"})&&(null===t||void 0===t?void 0:t.id)&&(null===t||void 0===t?void 0:t.postType)&&v({contentId:null===t||void 0===t?void 0:t.id,contentType:null===t||void 0===t?void 0:t.postType})},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Report"})}),t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.G,{children:(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.wRQ,{}),onClick:()=>y({id:null===t||void 0===t?void 0:t.id,isPinned:!(null===t||void 0===t?void 0:t.isPinned)}),children:(0,s.jsx)(M.C.Text,{className:"truncate",children:(null===t||void 0===t?void 0:t.isPinned)?"Unpin Post":"Pin Post"})})}),(0,s.jsx)(_.i,{}),(0,s.jsx)(P.b,{creatorId:null===t||void 0===t?void 0:t.creatorId,teamId:(null===t||void 0===t?void 0:t.teamId)||void 0,children:(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.IT9,{}),onClick:async()=>{await i({title:"Are you sure?",description:"Are you sure you want to delete this post?",confirmText:"Delete",variant:"danger"})&&b({id:null===t||void 0===t?void 0:t.id})},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Delete"})})}),(0,s.jsx)(T.G,{children:(0,s.jsx)(I.L.Item,{icon:(0,s.jsx)(x.IT9,{}),onClick:async()=>{await i({title:"Are you sure?",description:"Are you sure you want to delete this post?",confirmText:"Delete",variant:"danger"})&&b({id:null===t||void 0===t?void 0:t.id})},children:(0,s.jsx)(M.C.Text,{className:"truncate",children:"Delete as admin"})})})]})]}),children:(0,s.jsx)(g.z,{className:(0,f.cn)("!text-foreground-10",a),type:"text","aria-label":"Post actions",role:"menu",icon:(0,s.jsx)(x.q3n,{strokeWidth:2}),as:"div"})})]})};const E=e=>{let{post:t,embedded:n=!1,layout:r=a.Layout.LIST}=e;var i;const d=(0,h.S)(),[m,p]=(0,c.useState)(!1);var v;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,s.jsxs)("div",{onClick:()=>{p(!0)},className:"group flex cursor-pointer items-center sm:w-1/2 ".concat(t.reactionsPreview.length>
10&&"gap-x-2"),children:[(0,s.jsx)("div",{className:"flex -space-x-1",children:t.reactionsPreview.map((e=>(0,s.jsx)("span",{className:"bg-background-20 ring-background flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full text-xs ring-2",children:(0,w.fC)(e.type)},e.id)))}),(0,s.jsx)("span",{className:"text-foreground-10 cursor-pointer whitespace-nowrap text-xs font-medium group-hover:underline sm:text-sm",children:t.reactionsPreviewText})]}),(0,s.jsx)("div",{className:"flex justify-end sm:w-1/2",children:t.comments.length>0&&(0,s.jsxs)(o(),{href:"/posts/".concat(t.slug),className:"text-foreground-10 text-xs font-medium hover:underline sm:text-sm",children:[t.comments.length||0,1===t.comments.length?" comment":" comments"]})})]}),(0,s.jsxs)("div",{hidden:n,className:"mt-2 flex items-center justify-between border-t pt-2 sm:justify-normal sm:gap-x-2",children:[(0,s.jsx)(j.Z,{post:t,layout:r}),(0,s.jsx)(u.X,{useNormalLink:n,href:"/posts/".concat(t.slug,"/#comment"),children:(0,s.jsx)(g.z,{as:"div",type:"text",className:(0,f.cn)("!text-foreground-10 !text-xs sm:!text-sm ",r===a.Layout.GRID&&"sm:!text-xs "),icon:(0,s.jsx)(x.clf,{strokeWidth:"2"}),children:"Comment"})}),(null===(i=t.topics[0])||void 0===i?void 0:i.visibility)===a.TopicVisibilty.PUBLIC&&!0!==(null===d||void 0===d?void 0:d.isPrivate)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l(),{src:"https://unpkg.com/share-api-polyfill/dist/share-min.js"}),(0,s.jsx)(g.z,{type:"text",icon:(0,s.jsx)(x.FOM,{strokeWidth:"2"}),className:(0,f.cn)("!text-foreground-10 !text-xs sm:!text-sm",r===a.Layout.GRID&&"sm:!text-xs "),onClick:()=>{(0,w.wG)(t)},children:"Share"})]}),(0,s.jsx)(R,{post:t,className:"sm:ml-auto",buttonClassName:"h-[30px]"})]}),(0,s.jsx)(y.Z,{visible:m,title:"Reactions",hideFooter:!0,closable:!0,closeOnBackdropClick:!0,onCancel:()=>p(!1),children:(0,s.jsx)(F,{forId:t.id,forType:"post",title:null!==(v=t.title)&&void 0!==v?v:void 0})})]})},F=e=>{let{forId:t,forType:n,title:a}=e;var r;const{data:o,isLoading:i,isFetching:l,fetchNextPage:c,hasNextPage:u}=p.S.reactions.getAll.useInfiniteQuery({limit:50,forType:n,forId:t,excludeTypes:["going"]},{getNextPageParam:e=>e.nextCursor,keepPreviousData:!0}),{data:h,isLoading:f,isFetching:x,fetchNextPage:y,hasNextPage:j}=p.S.reactions.getAll.useInfiniteQuery({limit:50,forType:n,forId:t,types:["going"]},{getNextPageParam:e=>e.nextCursor,keepPreviousData:!0}),{refetch:N,isRefetching:k}=p.S.reactions.exportAttendees.useQuery({forType:n,forId:t,types:["going"]},{enabled:!1,onSuccess:e=>{const t=(a||"event").replace(/[^a-zA-Z0-9]+/g,"-").replace(/-+$/,"");(0,m.G)(e,"".concat(t,"-attendees-").concat(e.length||""))},onError:()=>d.ZP.error("Failed to download attendees")}),C=null===o||void 0===o?void 0:o.pages.flatMap((e=>e.reactions)),T=null===h||void 0===h?void 0:h.pages.flatMap((e=>e.reactions));return i||f?(0,s.jsx)("div",{className:"h-16",children:(0,s.jsx)(b.T,{active:!0})}):(0,s.jsxs)(s.Fragment,{children:[0===(null===C||void 0===C?void 0:C.length)&&(0,s.jsx)("div",{className:"text-foreground-10 text-center",children:(0,s.jsx)("p",{children:"No reactions yet, be the first!"})}),C&&(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[Object.entries((0,w.wl)(C)).map((e=>{let[t,n]=e;const s=n[0];if(s)return H(s,n,t)})),u&&(0,s.jsx)("div",{className:"mb-4 mt-4 flex justify-center",children:(0,s.jsx)(g.z,{loading:l,type:"outline",loadingCentered:!0,size:"large",onClick:()=>c(),children:"More reactions"})})]}),T&&0!==(null===T||void 0===T?void 0:T.length)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.ZT$.Title,{style:{marginBottom:".1rem"},level:4,children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-x-2",children:[(0,s.jsxs)("span",{children:["Attendees ","(".concat((null===h||void 0===h||null===(r=h.pages[0])||void 0===r?void 0:r.count)||0,")")]}),(0,s.jsxs)(g.z,{type:"text",size:"small",loading:k,onClick:()=>N(),children:["Export attendees",(0,s.jsx)(v.DjJ,{strokeWidth:"2",className:"h-4 w-4"})]})]})}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[Object.entries((0,w.wl)(T)).map((e=>{let[t,n]=e;const s=n[0];if(s)return H(s,n,t)})),j&&(0,s.jsx)("div",{className:"mb-4 mt-4 flex justify-center",children:(0,s.jsx)(g.z,{loading:x,type:"outline",loadingCentered:!0,size:"large",onClick:()=>{y()},children:"More attendees"})})]})]})]})},H=(e,t,n)=>{var a,r,i,l,c,d,u,m,p,h;return(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsxs)(o(),{href:(null===e||void 0===e?void 0:e.team)?"/teams/".concat(null===e||void 0===e||null===(a=e.team)||void 0===a?void 0:a.slug):"/user/".concat(null===e||void 0===e?void 0:e.creator.slug),className:"text-foreground flex flex-1 cursor-pointer items-center gap-x-2 text-sm ",children:[(0,s.jsx)(N.Yt,{src:(null===e||void 0===e?void 0:e.team)?(null===e||void 0===e||null===(r=e.team)||void 0===r?void 0:r.avatar)||void 0:(null===e||void 0===e||null===(i=e.creator)||void 0===i?void 0:i.avatar)||void 0,text:(null===e||void 0===e?void 0:e.team)?null===e||void 0===e||null===(l=e.team)||void 0===l?void 0:l.name:"".concat(null===e||void 0===e||null===(c=e.creator)||void 0===c?void 0:c.firstName," ").concat(null===e||void 0===e||null===(d=e.creator)||void 0===d?void 0:d.lastName),className:"h-6 w-6"}),(0,s.jsx)("span",{className:"hover:underline",children:(null===e||void 0===e||null===(u=e.team)||void 0===u?void 0:u.name)?null===e||void 0===e||null===(m=e.team)||void 0===m?void 0:m.name:"".concat(null===e||void 0===e||null===(p=e.creator)||void 0===p?void 0:p.firstName," ").concat(null===e||void 0===e||null===(h=e.creator)||void 0===h?void 0:h.lastName)})]}
1),(0,s.jsx)("div",{className:"flex -space-x-1 overflow-hidden",children:t.map((e=>(0,s.jsx)("span",{className:" bg-background-10 ring-background flex h-6 w-6 items-center justify-center rounded-full text-xs ring-2",children:(0,w.fC)(e.type)},e.id)))})]},n)}},72991:function(e,t,n){"use strict";n.d(t,{y:function(){return y}});var s=n(85893),a=n(12003),r=n(37174),o=n(42752),i=n(98860),l=n(71284),c=n(67294),d=n(71015);function u(e,t,n){var s,a;if("text"===e.type)return e;if(e.type&&!t.nodes[e.type])return n.add(e.type),null;const r=null===(s=e.marks)||void 0===s?void 0:s.filter((e=>{const s=null!=t.marks[e.type];return s||n.add("mark:".concat(e.type)),s})),o=null===(a=e.content)||void 0===a?void 0:a.map((e=>u(e,t,n))).filter((e=>null!==e));return{...e,...r?{marks:r}:{},...o?{content:o}:{}}}const m=o.NB.create({name:"heading",priority:999,renderHTML:()=>""}),p=o.NB.create({name:"youtubeEmbed",priority:999,renderHTML:()=>""}),h=o.NB.create({name:"soundCloud",priority:999,renderHTML:()=>""}),f=o.NB.create({name:"image",priority:999,renderHTML:()=>""}),v=o.NB.create({name:"indyPlayerV2",priority:999,renderHTML:()=>""}),g=["youtubeEmbed","image","heading","soundCloud","indyPlayerV2"],x=e=>{let{json:t,type:n="detail"}=e;const[a,r]=(0,c.useState)(!1);(0,c.useEffect)((()=>{r(!0)}),[]);let x=(0,d.Mu)();"preview"===n&&(x=x.filter((e=>!1===g.includes(e.name))),x=[...x,..."preview"===n?[p]:[],..."preview"===n?[h]:[],..."preview"===n?[m]:[],..."preview"===n?[f]:[],..."preview"===n?[v]:[]]);const b=(0,c.useMemo)((()=>(0,o.J1)(x)),[x]),y=(0,c.useMemo)((()=>{const e=new Set;var n;const s=null!==(n=u(t,b,e))&&void 0!==n?n:{type:"doc",content:[]};return e.size>0&&console.warn("TipTapRenderer: dropped unsupported content (".concat(Array.from(e).join(", "),") while rendering a post. The stored content references node/mark types that aren't registered as extensions.")),s}),[t,b]),j=(0,c.useMemo)((()=>{try{return(0,i.a)(y,x)}catch(e){return console.error("TipTapRenderer: failed to generate HTML for post",e),""}}),[x,y]),w=(0,l.jE)({content:y,editable:!1,extensions:x});return(0,c.useEffect)((()=>{w&&w.commands.setContent(y)}),[y,w]),a?(0,s.jsx)(l.kg,{editor:w}):(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:j}})},b=(0,a.j)("",{variants:{type:{detail:(0,r.cn)(d.G1,"prose-a:underline mb-4"),shortPostPreview:"sm:prose lg:prose-xl prose-p:text-base prose-p:mb-4 text-md line-clamp-[15]",preview:"sm:prose lg:prose-xl prose-p:text-base prose-p:mb-4 text-md line-clamp-5",blogPostPreview:"sm:prose lg:prose-xl prose-p:text-base prose-p:mb-4 text-sm line-clamp-[15]"}},defaultVariants:{type:"detail"}}),y=e=>{let{className:t,body:n,type:a}=e;const[o,i]=(0,c.useState)(!1),[l,d]=(0,c.useState)(!1),u=(0,c.useRef)(null);return(0,c.useEffect)((()=>{const e=u.current;e&&d(e.scrollHeight>e.clientHeight)}),[n,a]),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{ref:u,className:(0,r.cn)(b({type:a,className:t}),o?"line-clamp-none":""),children:(0,s.jsx)(x,{type:a||"detail",json:n})}),!o&&l&&(0,s.jsx)("div",{className:"mb-4 mt-2 text-right",children:(0,s.jsx)("button",{className:"text-foreground text-sm font-semibold hover:underline",onClick:()=>{i(!0)},children:"Read More"})})]})};y.displayName="PostBody"},50801:function(e,t,n){"use strict";n.d(t,{I:function(){return h},J:function(){return p}});var s=n(85893),a=n(70385),r=n(70302),o=n(53766),i=n(37174),l=n(65194),c=n(17326),d=n(72991),u=n(53917),m=n(62931);const p=e=>{let{post:t,embedded:n=!1,id:p,layout:h=a.Layout.LIST}=e;return(0,s.jsx)(o.Zb,{asChild:!0,className:"mx-auto mb-2 flex w-full max-w-4xl scroll-mt-28 flex-col rounded-lg border p-4 shadow sm:rounded-lg sm:p-6",id:p,"data-testid":"preview-blog-".concat(p),children:(0,s.jsxs)("article",{children:[t.coverPhotoFile&&(0,s.jsxs)("div",{className:"relative mb-3",children:[(0,s.jsx)("img",{className:(0,i.cn)(" w-full rounded-lg object-cover",h===a.Layout.LIST&&"aspect-[296/206] lg:aspect-[848/324]",h===a.Layout.GRID&&"aspect-[394/262]"),alt:"Cover photo for ".concat(t.title),src:(0,i.Jn)(t.coverPhotoFile.url,1776,1236,"crop")}),(0,s.jsx)(l.p,{additionalData:t.coverPhotoFile||{attributionAuthor:t.coverPhotoAuthor,attributionUrl:t.coverPhotoLink}})]}),(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)(m.t,{post:t,embedded:n})}),(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"my-4 grow",children:[(0,s.jsx)(r.X,{useNormalLink:Boolean(n),href:"/posts/".concat(t.slug),children:(0,s.jsx)(u.D,{layout:h,post:t,className:"text-accent-10 mb-0 text-2xl"})}),(0,s.jsx)(d.y,{body:t.body,type:"blogPostPreview"})]}),(0,s.jsx)(c.tz,{post:t,layout:h})]})]})})},h={imageCropAspectRatio:1.4368932039,willRenderCanvas:(e,t)=>{const{utilVisibility:n,selectionRect:s,backgroundColor:a,lineColor:r}=t;if(n.crop<=0)return e;const{x:o,y:i,width:l,height:c}=s,d=(c-.5486*c)/2,u={x:o,y:i+d/2-8,width:l,fontSize:16,fontStyle:"normal",lineHeight:16,text:"This area will not be visible on de
1sktop",color:[0,0,0],textAlign:"center"},m={points:[{x:o,y:i+c-d},{x:o+l,y:i+c-d},{x:o+l,y:i+c},{x:o,y:i+c}],backgroundColor:[...a,.35],pathClose:!0},p={points:[{x:o,y:i},{x:o+l,y:i},{x:o+l,y:i+d},{x:o,y:i+d}],backgroundColor:[...a,.35],pathClose:!0},h={x1:o,y1:i+d,x2:o+l,y2:i+d,strokeWidth:1,strokeColor:[...r,.2]};return{...e,interfaceShapes:[p,m,u,{...u,y:i+c-d/2},h,{...h,y1:i+c-d,y2:i+c-d},...e.interfaceShapes]}}}},53917:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var s=n(85893),a=n(70385),r=n(70302),o=n(37174);const i=e=>{let{post:t,embedded:n=!1,className:i,layout:l=a.Layout.LIST}=e;return(0,s.jsx)("div",{className:"flex items-center",children:(null===t||void 0===t?void 0:t.title)&&(0,s.jsx)(r.X,{useNormalLink:Boolean(n),href:"/posts/".concat(t.slug),className:(0,o.cn)("text-accent-10 w-full break-words text-2xl font-semibold",l===a.Layout.LIST,i),children:t.title})})}},91678:function(e,t,n){"use strict";var s=n(85893),a=n(83722);t.Z=e=>{let{children:t,content:n}=e;return(0,s.jsx)(a.zt,{delayDuration:300,children:(0,s.jsxs)(a.fC,{children:[(0,s.jsx)(a.xz,{asChild:!0,children:t}),(0,s.jsx)(a.h_,{children:(0,s.jsxs)(a.VY,{className:"TooltipContent border-background-20 bg-background dark:bg-background-10 text-foreground relative z-40 rounded-md border px-4 py-2 text-xs shadow-md duration-300 will-change-transform ",sideOffset:3,children:[n,(0,s.jsx)(a.Eh,{className:"TooltipArrow fill-background shadow-md"})]})})]})})}},43006:function(e,t,n){"use strict";n.d(t,{w:function(){return l}});var s=n(85893),a=n(86501),r=n(52435),o=(n(67294),n(77818)),i=n(13115);function l(e){let{selectedTags:t,setSelectedTags:n}=e;const{data:o,refetch:i}=r.S.tags.getTags.useQuery({tagType:"POST"}),{mutate:l,isLoading:d}=r.S.tags.add.useMutation({onSuccess(){i()},onError(e){a.ZP.error(JSON.parse(e.message)[0].message)}});return(0,s.jsx)(c,{tags:o,onCreateTag:function(e,t){l({name:e,tagType:t})},isTagLoading:d,selectedTags:t,setSelectedTags:n,infoMessage:"Choose from the list or create your own. Boost visibility by adding relevant tags that describe your post\xb4s content. If you are unable to add tags yourself and would like to request one, please contact your community manager."})}function c(e){let{tags:t,selectedTags:n,setSelectedTags:a,infoMessage:r,onCreateTag:l,isTagLoading:c}=e;if(!t)return(0,s.jsx)(s.Fragment,{});if(t&&0===t.length)return(0,s.jsx)(s.Fragment,{});return(0,s.jsxs)("div",{className:"relative block",children:[(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-y-1",children:[(0,s.jsx)("label",{className:" text-foreground block text-sm font-medium",children:"Select post tags"}),r&&(0,s.jsx)(o.b,{className:"ml-2",infoFor:"tags",children:r}),(0,s.jsx)("p",{className:"block w-full text-xs",children:"Add up to ".concat(12," topic tags to your post to make it easier for others to\n discover.")})]}),(0,s.jsx)(i.w,{tags:t,selectedTags:n,setSelectedTags:a,onCreateTag:l,isTagLoading:c,label:"Add tags",tagLimitNumber:12,avoidCollisions:!0})]})}},83154:function(e,t,n){"use strict";n.d(t,{sK:function(){return _},y5:function(){return k},NF:function(){return F},Cx:function(){return B},C2:function(){return g},Ny:function(){return C},Xl:function(){return D},DZ:function(){return o},rU:function(){return R},QB:function(){return Z},rF:function(){return I},qJ:function(){return q},x9:function(){return W},kH:function(){return K}});var s=n(85893),a=n(70385),r=n(97156);function o(e){let{defaultValue:t,postType:n,onChange:o}=e;return n===a.PostType.short?null:(0,s.jsx)(r.Z,{required:!0,defaultValue:t||void 0,onChange:e=>o(e.target.value),label:"Title",name:"title",placeholder:"Enter a title"})}var i=n(67294),l=n(71015),c=n(86294),d=n(82598),u=n(18971),m=n(87486),p=n(92395),h=n(54071),f=n.n(h);function v(e){let{videoId:t,libraryId:n}=e;const[a,r]=(0,i.useState)(null),[o,l]=(0,i.useState)(!0),[c,h]=(0,i.useState)(!1),[v,g]=(0,i.useState)(""),[x,b]=(0,i.useState)(""),[,y]=(0,i.useState)(0),j=(0,i.useRef)(null),w=[f()["sbui-btn--anim--spin"]];(0,i.useEffect)((()=>{let e=!1;return(async()=>{try{l(!0);const s=await(0,d.pU)(n,t);e||r(s)}catch(s){console.error(s)}})(),()=>{e=!0}}),[n,t]),(0,i.useEffect)((()=>{(null===a||void 0===a?void 0:a.thumbnailUrl)&&(l(!0),y(0),b("".concat(a.thumbnailUrl,"?t=").concat(Date.now())))}),[null===a||void 0===a?void 0:a.thumbnailUrl]);return(0,s.jsx)("div",{children:a?(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"relative w-28",children:[o&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)(p.pAw,{className:w.join(" ")})}
1),(0,s.jsx)("img",{src:v||x,alt:"Thumbnail",className:"w-28 rounded ".concat(o?"opacity-0":"opacity-100"),onLoad:()=>{l(!1)},onError:()=>{v?l(!1):y((e=>{if(e>=6)return l(!1),e;const t=e+1;return setTimeout((()=>{b("".concat(a.thumbnailUrl,"?t=").concat(Date.now()))}),400*t),t}))}})]}),(0,s.jsx)("div",{className:"flex items-center justify-center gap-4",children:(0,s.jsxs)("label",{className:"relative inline-flex",children:[(0,s.jsx)("input",{ref:j,type:"file",accept:"image/*",disabled:o||c,className:"absolute inset-0 cursor-pointer opacity-0",onChange:async e=>{var s;const a=null===(s=e.target.files)||void 0===s?void 0:s[0];a&&await(async e=>{h(!0);try{const s=await(0,m.cT)(e,[]),a=await(0,d.zX)(n,t,s.secure_url);(null===a||void 0===a?void 0:a.success)&&(g(s.secure_url),l(!0))}finally{h(!1)}})(a)}}),(0,s.jsx)(u.Z,{type:"primary",loading:c,disabled:o||c,onClick:()=>{var e;null===(e=j.current)||void 0===e||e.click()},children:c?"Uploading":"Choose File"})]})})]}):(0,s.jsx)("div",{children:(0,s.jsx)(p.pAw,{className:w.join(" ")})})})}function g(e){let{onChange:t,postType:n,defaultValue:r}=e;const[o,d]=(0,i.useState)([]),u=e=>(null===e||void 0===e?void 0:e.content)?e.content.filter((e=>{var t;return"video"===e.type&&(null===(t=e.attrs)||void 0===t?void 0:t.src)})).map((e=>{const t=e.attrs.src.split("/");return{libraryId:t[t.length-2],videoId:t[t.length-1]}})):[];return(0,i.useEffect)((()=>{const e=u(r);d(e)}),[r]),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"text-foreground block text-sm font-medium",children:["Post Content",n!==a.PostType.poll&&(0,s.jsx)("span",{className:"text-warning",children:" *"})]}),(0,s.jsx)(l.Kx,{className:"h-full min-h-[4rem] sm:h-auto sm:min-h-[8rem]",autofocus:!0,editable:!0,onUpdate:e=>(e=>{const n=u(e.editor.getJSON());d(n),t(e.editor.getJSON())})(e),content:r,children:e=>(0,s.jsxs)(l.G3,{children:[(0,s.jsx)(c.$,{editor:e}),(0,s.jsx)(c.z6,{editor:e}),(0,s.jsx)(c.zA,{editor:e}),(0,s.jsx)(c.gI,{editor:e}),(0,s.jsx)(c.uf,{editor:e}),(0,s.jsx)(c.k1,{editor:e}),(0,s.jsx)(c.eD,{editor:e}),(0,s.jsx)(c.Qj,{editor:e}),(0,s.jsx)(c.Km,{editor:e}),(0,s.jsx)(c.py,{editor:e})]})}),(null===o||void 0===o?void 0:o.length)>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("h2",{className:"mb-2 text-sm font-medium",children:"Set a custom thumbnail"}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:o.map((e=>(0,s.jsx)(v,{videoId:e.videoId,libraryId:e.libraryId},"".concat(e.libraryId,"-").concat(e.videoId))))})]})]})}var x=n(50801),b=n(5152),y=n.n(b),j=n(53766),w=n(42393);const N=y()((()=>Promise.all([n.e(3662),n.e(7719),n.e(4841),n.e(2121)]).then(n.bind(n,42121)).then((e=>e.HandleImage))),{loadableGenerated:{webpack:()=>[42121]},ssr:!1,loading:()=>(0,s.jsx)(j.Zb,{className:"flex h-24 flex-col items-center",children:(0,s.jsx)(w.T,{active:!0,className:"relative"})})});function k(e){let{onChange:t,postType:n,file:r}=e;const o=n===a.PostType.blog?x.I:{imageCropAspectRatio:16/9};return(0,s.jsx)("div",{hidden:n!==a.PostType.blog&&n!==a.PostType.event&&n!==a.PostType.job,children:(0,s.jsx)(N,{label:"Cover Photo",imageType:"coverImage",editorOptions:o,files:r?[r]:void 0,onChange:e=>t(null===e||void 0===e?void 0:e[0])})})}function C(e){let{onChange:t,setImageIsUploading:n,postType:r,post:o}=e;return r!==a.PostType.short?null:(0,s.jsx)("div",{className:"space-y-1",children:(0,s.jsx)(N,{label:"Image",imageType:"coverImage",files:null===o||void 0===o?void 0:o.files,onChange:t,setImageIsUploading:n})})}var T=n(52435),P=n(69217),L=n(67867),S=n(32533);function _(e){let{author:t,setAuthor:n}=e;const{data:a}=T.S.team.getMyTeams.useQuery(),r=(0,P.e)();return!a||a&&0===a.length?null:(0,s.jsxs)(L.P,{label:"Post as",value:t,required:!0,onChange:async e=>{const t=e.target.value;n(t)},children:[(0,s.jsxs)(S.Wx,{value:"self",children:[null===r||void 0===r?void 0:r.firstName," ",null===r||void 0===r?void 0:r.lastName]},"self"),a.map((e=>(0,s.jsx)(S.Wx,{value:e.id,children:e.name},e.id)))]})}function I(e){let{topic:t,author:n,postType:r,onChange:o}=e;var l;const{data:c,isLoading:d}=T.S.topics.getAll.useQuery({actAsTeamId:"self"===n?null:n}),u=T.S.useContext(),[m,p]=(0,i.useState)(),[h,f]=(0,i.useState)();(0,i.useEffect)((()=>{p(t),t&&(f(t.id),o(t.id))}),[t,o]);const v=(null===c||void 0===c?void 0:c.map((e=>{const t=c.find((t=>
1t.id===e.parentId)),n=(null===t||void 0===t?void 0:t.title)?"".concat(t.title," / "):"";return{...e,title:"".concat(n).concat(e.title)}})).filter((e=>e.userCanPost)).sort(((e,t)=>e.title.localeCompare(t.title))))||[],g=!d&&v.length<=1,x=(null===t||void 0===t?void 0:t.id)||(null===(l=v[0])||void 0===l?void 0:l.id);if((0,i.useEffect)((()=>{g&&x&&(f(x),o(x))}),[g,x,o]),d||g)return null;const b=r===a.PostType.event?"Choose which Feed to post your content to. Once published, it can't move it. All Event posts will be shown in the chosen Feed as well as on the Community Event Page.":"Choose which Feed your post should be published in. Once posted, it cannot be moved to a different Feed.";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(L.P,{value:h,label:"Post to",required:!0,infoMessage:b,onChange:async e=>{const t=e.target.value;o(t),f(t),p(await u.topics.getOne.fetch({id:t}))},children:[(0,s.jsx)("option",{value:"",selected:!(null===t||void 0===t?void 0:t.id),disabled:!0,children:"Choose a Feed"}),v.map((e=>(0,s.jsx)(S.Wx,{value:e.id,children:e.title},e.id)))]}),(0,s.jsx)(A,{space:m})]})}function A(e){let{space:t}=e;return t?(0,s.jsxs)("div",{className:"flex items-center",children:["PRIVATE"===(null===t||void 0===t?void 0:t.visibility)?(0,s.jsx)(p._V1,{}):(0,s.jsx)(p.vcr,{}),(0,s.jsxs)("p",{className:"text-foreground-10 ml-2 text-sm",children:["PUBLIC"===t.visibility&&(0,s.jsx)(s.Fragment,{children:"Posts in this feed are public"}),"MEMBERS"===t.visibility&&(0,s.jsx)(s.Fragment,{children:"Posts in this feed are visible to community members only"}),"PRIVATE"===t.visibility&&(0,s.jsx)(s.Fragment,{children:"Posts in this feed are private"})]})]}):null}var M=n(77818);function R(e){let{postType:t,onChange:n,defaultValue:o}=e;return t!==a.PostType.event&&t!==a.PostType.job?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center",children:[(0,s.jsx)("label",{className:"text-foreground block text-sm font-medium",children:t===a.PostType.event?"Event Link":(0,s.jsxs)(s.Fragment,{children:["Application Link",(0,s.jsx)("span",{className:"text-warning",children:" *"})]})}),t===a.PostType.event&&(0,s.jsx)(M.b,{infoFor:"link",className:"ml-2",children:"Include a link to your streaming platform, registration page, ticket provider etc."})]}),(0,s.jsx)(r.Z,{required:t===a.PostType.job,type:"url",name:"url",onChange:e=>n(e.target.value),placeholder:"https://www.example.com",defaultValue:o})]})}var E=n(46292);function F(e){let{postType:t,checked:n,onChange:r,disabled:o=!1,infoMessage:i}=e;return t!==a.PostType.event?null:(0,s.jsx)(E.Z,{disabled:o,checked:n,onChange:()=>{r(!n)},infoMessage:i,label:"Create group chat for the Event"})}var H=n(23794);function D(e){let{postType:t,locationRef:n}=e;var r;return t!==a.PostType.job&&t!==a.PostType.event?null:(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-foreground mb-1 block text-sm font-medium",children:t===a.PostType.event?"Event Location":"Location"}),(0,s.jsx)(H.i,{initialTextValue:null===n||void 0===n||null===(r=n.current)||void 0===r?void 0:r.label,onSelect:e=>n.current=e})]})}function Z(e){let{postType:t,setPostType:n}=e;const r=(0,P.e)(),o=(null===r||void 0===r?void 0:r.role)===a.UserRole.ADMIN;return(0,s.jsxs)(L.P,{label:"Type",value:t,infoMessage:"Posts capture quick thoughts. This setting can not be changed after posting.",onChange:e=>{const t=e.target.value;n(t)},children:[(0,s.jsx)("option",{value:"short",children:"Post"}),(0,s.jsx)("option",{value:"event",children:"Event"}),(o||(null===r||void 0===r?void 0:r.activeTeamId))&&(0,s.jsx)("option",{value:"job",children:"Opportunity"}),(0,s.jsx)("option",{value:"poll",children:"Poll"})]})}var U=n(30120),z=n(62131);function B(e){let{dates:t,setDates:n,postType:o}=e;const[l,c]=(0,i.useState)(!!t.start&&t.start.includes("T")&&"00:00"!==t.start.split("T")[1]),[d,u]=(0,i.useState)(!!t.end&&t.end.includes("T")&&"23:59"!==t.end.split("T")[1]);if(o!==a.PostType.event)return null;const m=t.start?U.ou.fromFormat(t.start,"yyyy-LL-dd'T'HH:mm").toFormat("yyyy-LL-dd"):"",p=l&&t.start?U.ou.fromFormat(t.start,"yyyy-LL-dd'T'HH:mm").toFormat("HH:mm"):"",h=t.end?U.ou.fromFormat(t.end,"yyyy-LL-dd'T'HH:mm").toFormat("yyyy-LL-dd"):"",f=d&&t.end?U.ou.fromFormat(t.end,"yyyy-LL-dd'T'HH:mm").toFormat("HH:mm"):"",v=U.ou.now().toFormat("yyyy-LL-dd");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("label",{className:"text-foreground mb-1 block text-sm font-medium",children:["Start Date ",(0,s.jsx)("span",{className:"text-warning",children:"*"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.Z,{required:!0,value:m,min:v,name:"startDate",type:"date",className:"flex-1",onChange:e=>{const s=e.target.value;if(!s)return;const a=l&&p?"".concat(s,"T").concat(p):"".concat(s,"T00:00");n({...t,start:a})}}),(0,s.jsx)(r.Z,{value:p,name:"startTime",type:"time",className:"w-1/2",placeholder:"--:--",onChange:e=>{const s=e.target.value;if(c(!0),!m)return;const a=s?"".concat(m,"T").concat(s):"".concat(m,"T00:00");n({...t,start:a})}})]}),(0,s.jsx)("div",{className:"mt-2",children:p&&(0,s.jsx)(z.zxk,{size:"tiny",type:"default",onClick:()=>{c(!1),n({...t,start:"".concat(m,"T00:00")})},children:"Remove time"})})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"text-foreground mb-1 block text-sm font-medium",children:"End Date"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.Z,{value:h,min:m||v,name:"endDate",type:"date",className:"flex-1",onChange:e=>{const s=e.target.value;if(!s)return void n({...t,end:void 0});const a=d&&f?"".concat(s,"T").concat(f):"".concat(s,"T23:59");n({...t,end:a})}}),(0,s.jsx)(r.Z,{value:f,name:"endTime",type:"time",className:"w-1/2",disabled:!h,infoMessage:"Set date first",placeholder:"--:--",onChange:e=>{const s=e.target.value;if(u(!0),!h)return;const a=s?"".concat(h,"T").concat(s):"".concat(h,"T23:59");n({...t,end:a})}})]}),(0,s.jsx)("div",{className:"mt-2",children:f&&(0,s.jsx)(z.zxk,{size:"tiny",type:"default",onClick:()=>{u(!1),n({...t,end:"".concat(h,"T23:59")})},children:"Remove time"})})]})]})}var O=n(41664),V=n.n(O),Y=n(86501);function W(e){let{data:t,text:n}=e;Y.ZP.success((e=>(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{children:n||"Post created! "}),(0,s.jsx)(V(),{href:"/posts/".concat(t.id),onClick:()=>Y.ZP.dismiss(e.id),className:"strong underline",children:"View post"})]})),{duration:5e3})}function q(e){let{title:t,message:n,httpStatus:s,toastMessage:a}=e;return t&&t.length>191&&Y.ZP.error("Post title is too long: "+t.length+"/190"),JSON.parse(n)?Y.ZP.error(JSON.parse(n)[0].message,{id:"postError"}):403===s?Y.ZP.error("You do not have permission to post in this feed"):Y.ZP.error(a||"Unable to post")}var G=n(5628);function K(e){let{body:t,close:n}=e;const s=(0,G.Z)();return async()=>
1{if(null===t||void 0===t?void 0:t.current){await s({title:"Confirm leaving",description:"Are you sure? You will lose any unsaved post content.",confirmText:"Yes"})&&n()}else n()}}},75810:function(e,t,n){"use strict";n.d(t,{H:function(){return N}});var s=n(85893),a=n(70385),r=n(30120),o=n(67294),i=n(86501),l=n(52435),c=n(69217),d=n(97366),u=n(62472),m=n(53402),p=n(43006),h=n(18922),f=n(92395),v=n(77818),g=n(33732),x=n(67867);const b=e=>{let{postType:t,onChange:n}=e;const[r,i]=(0,o.useState)([]),[l,c]=(0,o.useState)("SINGLE_CHOICE");return(0,o.useEffect)((()=>{t===a.PostType.poll&&n({allowedAnswersCount:l,alternatives:r.map((e=>e.value))})}),[r,l,n,t]),t!==a.PostType.poll?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(x.P,{value:l,label:"Voting type",infoMessage:"This cannot be modified once been published.",onChange:e=>c(e.currentTarget.value),children:[(0,s.jsx)("option",{value:"SINGLE_CHOICE",children:"Single choice"}),(0,s.jsx)("option",{value:"MULTI_CHOICE",children:"Multi choice"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("label",{className:"text-foreground block text-sm font-medium",children:["Voting Options ",(0,s.jsx)("span",{className:"text-warning",children:" *"})]}),(0,s.jsx)(v.b,{className:"ml-2",infoFor:"voting options",children:"Once published, options cannot be added, updated, or removed."})]}),r.map((e=>(0,s.jsx)(g.Z,{name:"option",placeholder:"Enter an option",defaultValue:null===e||void 0===e?void 0:e.value,onBlur:t=>{t.target.value!==e.value&&i([...r.map((n=>n.id===e.id?{...n,value:t.target.value}:n))])},actions:(0,s.jsx)(h.S,{type:"text",danger:!0,onClick:()=>i([...r.filter((t=>t.id!==e.id))]),children:"Remove"})},null===e||void 0===e?void 0:e.id))),(0,s.jsx)("div",{className:"flex flex-col justify-start gap-y-2 sm:flex-row sm:items-center sm:justify-between",children:(0,s.jsx)(h.S,{type:"primary",icon:(0,s.jsx)(f.ymu,{}),onClick:()=>{i([...r,{id:String(Date.now()),value:""}])},children:"Add Option"})})]})]})};var y=n(97156),j=n(83154),w=n(34424);const N=e=>{let{close:t,topic:n,defaultPostType:d=a.PostType.short}=e;var h,f;const v=(0,c.e)(),g=l.S.useContext(),{data:x}=l.S.tenant.get.useQuery(),N=(0,o.useRef)(),C=(0,o.useRef)(),T=(0,o.useRef)(),P=(0,o.useRef)(void 0),[L,S]=(0,o.useState)(),[_,I]=(0,o.useState)(),[A,M]=(0,o.useState)(),[R,E]=(0,o.useState)([]),[F,H]=(0,o.useState)(),[D,Z]=(0,o.useState)(!0),[U,z]=(0,o.useState)(""),[B,O]=(0,o.useState)(!1),[V,Y]=(0,o.useState)({start:r.ou.now().startOf("day").toFormat("yyyy-LL-dd'T'HH:mm"),end:void 0}),[W,q]=(0,o.useState)(d||"short"),[G,K]=(0,o.useState)((null===v||void 0===v||null===(h=v.activeTeam)||void 0===h?void 0:h.id)||"self"),J=(null===v||void 0===v||null===(f=v.activeTeam)||void 0===f?void 0:f.name)||"".concat(null===v||void 0===v?void 0:v.firstName," ").concat(null===v||void 0===v?void 0:v.lastName)||"New Post",{mutate:Q,isLoading:$}=l.S.posts.add.useMutation({onSuccess(e){(0,j.x9)({data:e}),t(),g.invalidate()},onError(e){var t;return(0,j.qJ)({title:N.current,message:e.message,httpStatus:null===(t=e.data)||void 0===t?void 0:t.httpStatus})}}),X=(0,j.kH)({body:T,close:t});return(0,s.jsxs)(m.Z,{closable:!0,id:"postModal",onOpenAutoFocus:e=>e.preventDefault(),title:J,loading:$||B||(null===A||void 0===A?void 0:A.some((e=>!e))),visible:!0,confirmText:"Post",alignFooter:"right",footerBackground:!0,avatarImage:(0,s.jsx)(k,{}),onConfirm:function(){return L?U&&!(0,w.I)(U)?i.ZP.error("Invalid Stripe link"):void Q({body:null===T||void 0===T?void 0:T.current,topicIds:[L],coverPhoto:_,title:N.current||void 0,postType:W,postAsId:"self"===G?null:G,startDate:V.start?new Date(V.start):void 0,endDate:V.end?new Date(V.end):void 0,location:P.current,createGroupChat:D,tagIds:R.map((e=>e.id)),link:C.current||void 0,stripeLink:U||void 0,files:A,poll:F}):i.ZP.error("Please select a feed")},onCancel:X,children:[(0,s.jsx)(u.i,{}),(0,s.jsx)(j.sK,{author:G,setAuthor:K}),(0,s.jsx)(j.QB,{postType:W,setPostType:q}),(0,s.jsx)(j.rF,{author:G,topic:n,postType:W,onChange:S}),(0,s.jsx)(j.DZ,{postType:W,onChange:e=>N.current=e}),(0,s.jsx)(j.Cx,{postType:W,dates:V,setDates:e=>Y((t=>({...t,...e})))}),(0,s.jsx)(j.Xl,{locationRef:P,postType:W}),(null===x||void 0===x?void 0:x.isChatEnabled)&&(0,s.jsx)(j.NF,{postType:W,checked:D,onChange:Z,infoMessage:"You cannot edit the chat setting after creating the event!"}),(0,s.jsx)(j.y5,{postType:W,onChange:I}),(0,s.jsx)(j.rU,{postType:W,onChange:e=>C.current=e}),(0,s.jsx)(j.C2,{postType:W,onChange:e=>T.current=e}),(0,s.jsx)(y.Z,{onChange:e=>z(e.target.value),name:"stripeLink",placeholder:"Type here...",label:"Str
1ipe pay-what-you-want link - optional",hideActionsBlock:!0}),(0,s.jsx)(b,{postType:W,onChange:e=>H(e)}),(0,s.jsx)(p.w,{selectedTags:R,setSelectedTags:E}),(0,s.jsx)(j.Ny,{onChange:M,setImageIsUploading:O,postType:W})]})};function k(){var e,t;const n=(0,c.e)();return(0,s.jsx)(d.p1,{className:"h-12 w-12",user:(null===n||void 0===n?void 0:n.activeTeam)?void 0:n,src:(null===n||void 0===n||null===(e=n.activeTeam)||void 0===e?void 0:e.avatar)||void 0,text:(null===n||void 0===n||null===(t=n.activeTeam)||void 0===t?void 0:t.name)||"?"})}},89112:function(e,t,n){"use strict";n.d(t,{IW:function(){return f},lc:function(){return g}});var s=n(85893),a=n(11163),r=n(67294),o=n(86501),i=n(52435),l=n(37174),c=n(30120),d=n(53402),u=n(43006),m=n(97156),p=n(83154),h=n(34424);const f=e=>{let{close:t,post:n}=e;const a=i.S.useContext(),{data:l}=i.S.tenant.get.useQuery(),f=(0,r.useRef)(),v=(0,r.useRef)(n.link),[g,x]=(0,r.useState)(),b=(0,r.useRef)(),y=(0,r.useRef)(n.location),[j,w]=(0,r.useState)(),[N,k]=(0,r.useState)(),[C,T]=(0,r.useState)(n.tags||[]),[P,L]=function(e){return(0,r.useState)({start:c.ou.fromJSDate(e.startDate||new Date).toFormat("yyyy-LL-dd'T'HH:mm")||"",end:e.endDate?c.ou.fromJSDate(e.endDate).toFormat("yyyy-LL-dd'T'HH:mm"):""})}(n),[S,_]=(0,r.useState)(n.stripeLink),[I,A]=(0,r.useState)(n.teamId||"self"),[M,R]=(0,r.useState)(!1),{mutate:E,isLoading:F}=i.S.posts.edit.useMutation({onSuccess(e){(0,p.x9)({data:e,text:"Post edited "}),t(),a.invalidate()},onError(e){var t;return(0,p.qJ)({title:f.current,message:e.message,httpStatus:null===(t=e.data)||void 0===t?void 0:t.httpStatus,toastMessage:"Unable to edit post"})}}),H=(0,p.kH)({body:b,close:t});return(0,s.jsxs)(d.Z,{closable:!0,id:"postModal",onOpenAutoFocus:e=>e.preventDefault(),title:"Edit Post",loading:F||M||(null===N||void 0===N?void 0:N.some((e=>!e))),onCancel:H,visible:!0,confirmText:"Save",alignFooter:"right",footerBackground:!0,onConfirm:function(){return g?S&&!(0,h.I)(S)?o.ZP.error("Invalid Stripe link"):void E({id:n.id,topicIds:[g],body:null===b||void 0===b?void 0:b.current,coverPhoto:j,postAsId:"self"===I?null:I,title:f.current||void 0,startDate:P.start?new Date(P.start):void 0,endDate:P.end?new Date(P.end):void 0,location:y.current,tagIds:C.map((e=>e.id)),link:v.current||void 0,stripeLink:S||void 0,files:N}):o.ZP.error("Please select a space")},children:[(0,s.jsx)(p.sK,{author:I,setAuthor:A}),(0,s.jsx)(p.DZ,{defaultValue:n.title,postType:n.postType,onChange:e=>f.current=e}),(0,s.jsx)(p.rF,{author:I,topic:n.topics[0],postType:n.postType,onChange:x}),(0,s.jsx)(p.Cx,{postType:n.postType,dates:P,setDates:e=>L((t=>({...t,...e})))}),(0,s.jsx)(p.Xl,{postType:n.postType,locationRef:y}),(null===l||void 0===l?void 0:l.isChatEnabled)&&(0,s.jsx)(p.NF,{postType:n.postType,checked:!!n.threadId,onChange:()=>{},disabled:!0,infoMessage:"You cannot change the chat setting after the event was created!"}),(0,s.jsx)(p.y5,{postType:n.postType,onChange:e=>w(e),file:n.coverPhotoFile}),(0,s.jsx)(p.rU,{postType:n.postType,onChange:e=>v.current=e,defaultValue:n.link||void 0}),(0,s.jsx)(p.C2,{postType:n.postType,onChange:e=>b.current=e,defaultValue:n.body}),(0,s.jsx)(m.Z,{onChange:e=>_(e.target.value),defaultValue:n.stripeLink||"",name:"stripeLink",placeholder:"Type here...",label:"Stripe pay-what-you-want link - optional",hideActionsBlock:!0}),(0,s.jsx)(u.w,{selectedTags:C,setSelectedTags:T}),(0,s.jsx)(p.Ny,{onChange:k,setImageIsUploading:R,postType:n.postType,post:n})]})};var v=n(75810);var g=e=>{let{children:t,post:n,triggerButton:c,className:d,defaultPostType:u}=e;const[m,p]=(0,r.useState)(!1),{query:{spaceSlug:h}}=(0,a.useRouter)(),g=(0,l.OR)(h),{data:x}=i.S.topics.getOne.useQuery({id:g},{enabled:!!g});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{onClick:()=>(()=>{if(p(!0),!1===(null===x||void 0===x?void 0:x.userCanPost)&&!n)return(0,o.ZP)("You do not have permission to post in this feed",{icon:"\ud83d\udd12",id:"userCannotPost"})})(),className:(0,l.cn)(!1===(null===x||void 0===x?void 0:x.userCanPost)?"disabled cursor-not-allowed":"cursor-pointer",d),children:[c,t]}),m&&(n?(0,s.jsx)(f,{post:n,close:()=>p(!1)}):(0,s.jsx)(v.H,{close:()=>p(!1),topic:x,defaultPostType:u}))]})}},58238:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var s=n(85893),a=n(70385),r=n(30709),o=n(67294),i=n(86501),l=n(52435),c=n(69217),d=n(37174),u=n(18922),m=n(92395),p=n(41790);function h(e){let{type:t,onClick:n,isReacted:a}=e;return(0,s.jsxs)("div",{className:"tranform group relative block cursor-pointer text-center text-2xl transition-transform hover:scale-125",onClick:()=>n(),children:[(0,s.jsx)("span",{className:"tabular-nums",children:(0,p.fC)(t)}),a&&(0,s.jsx)("span",{className:"bg-accent text-accent-contrast absolute right-0 top-0 inline-flex h-4 w-4 items-center justify-center rounded-full text-xs",children:(0,s.jsx)(m.NOm,{strokeWidth:2,size:12,className:"text-accent-contrast"})})]})}var f=n(35008);const v=e=>{let{children:t,layout:n,asIcon:o}=e;return(0,s.jsxs)(r.fC,{children:[(0,s.jsx)(r.xz,{className:"focus:outline-none",children:(0,s.jsx)(u.z,{as:"div",block:!0,className:(0,d.cn)("!text-foreground-10 !text-xs !font-semibold sm:!text-sm",n===a.Layout.GRID&&"sm:!text-xs "),type:"text",icon:o?(0,s.jsx)(m.lID,{strokeWidth:"1"}):(0,s.jsx)(m.hNh,{strokeWidth:"1"}),children:!o&&"Like"})}),(0,s.jsx)(r.h_,{children:(0,s.jsx)(r.VY,{className:"data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=top]:animate-slideDownAndFade z-50 w-[100vw] will-change-[transform,opacity] focus:outline-none sm:w-auto",sideOffset:6,side:"top",children:(0,s.jsx)("div",{className:"bg-background dark:bg-background-10 mx-auto w-[90vw] rounded-full border px-4 py-2 shadow sm:mx-0 sm:w-[320px]",children:(0,s.jsx)("div",{className:"grid grid-cols-5 ga
1p-x-1 gap-y-1",children:p.WJ.map((e=>t({type:e})))})})})})]})};var g=e=>{let{post:t,comment:n,message:r,layout:d=a.Layout.LIST,asIcon:u,asUser:m}=e;const p=(0,c.e)(),[g,x]=(0,o.useState)(void 0),b=l.S.useContext(),{mutate:y}=l.S.reactions.react.useMutation({async onMutate(){await b.tenantUser.get.cancel(void 0)},onSettled(){b.invalidate()},onError(e){var t;401===(null===(t=e.data)||void 0===t?void 0:t.httpStatus)?((0,f.C)(),i.ZP.error("You must login or register to react")):(b.invalidate(),i.ZP.error("Unable to react. Please try again later."))}});(0,o.useEffect)((()=>{x(void 0)}),[p]);const j=(null===n||void 0===n?void 0:n.viewerReactions)||(null===t||void 0===t?void 0:t.viewerReactions)||(null===r||void 0===r?void 0:r.reactions),w=(null===j||void 0===j?void 0:j.filter((e=>(null===p||void 0===p?void 0:p.activeTeamId)&&!m?e.teamId===(null===p||void 0===p?void 0:p.activeTeamId):e.creatorId===(null===p||void 0===p?void 0:p.id)&&!e.teamId)).map((e=>e.type)))||[];if(!t&&!n&&!r)return null;const N=e=>g?g.includes(e):w.includes(e);return(0,s.jsx)(v,{asIcon:u,layout:d,children:e=>{let{type:a}=e;return(0,s.jsx)(h,{type:a,isReacted:N(a),onClick:()=>{y({type:a,commentId:null===n||void 0===n?void 0:n.id,postId:null===t||void 0===t?void 0:t.id,messageId:null===r||void 0===r?void 0:r.id,asUser:m}),p&&x((e=>{let t=void 0!==e?e:w;return N(a)?t.filter((e=>e!==a)):[...t,a]}))}},a)}})}},41790:function(e,t,n){"use strict";n.d(t,{WJ:function(){return o},fC:function(){return i},wG:function(){return l},wl:function(){return c}});var s=n(7739),a=n.n(s),r=n(86501);const o=["like","angryFace","heart","applause","fire","laugh","cool","laughsweat","laughcry","mindblown"],i=e=>{switch(e){case"like":return"\ud83d\udc4d";case"heart":return"\u2764\ufe0f";case"angryFace":return"\ud83d\udc4e";case"going":return"\ud83d\udcc5";case"cool":return"\ud83d\ude0e";case"applause":return"\ud83d\udc4f";case"mindblown":return"\ud83e\udd2f";case"laugh":return"\ud83d\ude04";case"laughsweat":return"\ud83d\ude05";case"fire":return"\ud83d\udd25";case"laughcry":return"\ud83d\ude02";default:return e}},l=e=>{navigator.share?navigator.share({title:"Check out this post",url:"".concat(window.location.origin,"/posts/").concat(e.slug)}).then((()=>{r.ZP.success("Post shared successfully")})).catch((()=>{})):r.ZP.error("Your browser does not support this feature")},c=e=>a()(e,(e=>e.teamId?e.teamId:e.creatorId))},3593:function(e,t,n){"use strict";n.d(t,{C:function(){return c},Y:function(){return a}});var s=n(42752);function a(e){return"".concat("https://indyplayerv2.vercel.app","/embed/").concat(encodeURIComponent(e))}function r(e){var t;if(!e)return null;const n=null===(t=e.match(/\/embed\/([a-zA-Z0-9_-]+)/))||void 0===t?void 0:t[1];return n?decodeURIComponent(n):null}const o=/<iframe[^>]*\bsrc=["']https?:\/\/indyplayerv2\.vercel\.app\/embed\/([a-zA-Z0-9_-]+)["'][^>]*>\s*<\/iframe>/gi,i=/<script[^>]*\bsrc=["']https?:\/\/indyplayerv2\.vercel\.app\/loader\.js["'][^>]*>\s*<\/script>/gi;function l(e,t){const n=e.resolve(t.from),s=n.depth;if(0===s)return null;const a=n.before(s),r=n.after(s),o=a+1,i=r-1;return t.from<=o&&t.to>=i?{from:a,to:r}:null}const c=s.NB.create({name:"indyPlayerV2",group:"block",atom:!0,addAttributes:()=>({playerId:{default:null,parseHTML:e=>r(e.getAttribute("src")),renderHTML:()=>({})}}),parseHTML:()=>[{tag:'iframe[src*="indyplayerv2.vercel.app/embed/"]',getAttrs:e=>{const t=r(e.getAttribute("src"));return!!t&&{playerId:t}}}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["iframe",(0,s.P1)({src:a(t.attrs.playerId),width:"100%",height:"520",style:"max-width:768px;border:0;border-radius:16px",allow:"autoplay",loading:"lazy"},n)]},addCommands(){return{setIndyPlayerV2:e=>t=>{let{commands:n}=t;return!!e&&n.insertContent({type:this.name,attrs:{playerId:e}})}}},addPasteRules(){return[new s.hD({find:o,handler:e=>{let{match:t,chain:n,range:s,state:a}=e;const r=t[1];if(!r)return;const o=l(a.doc,s),i=null!==o&&void 0!==o?o:s;n().deleteRange(i).insertContentAt(i.from,{type:this.name,attrs:{playerId:r}}).focus().run()}}),new s.hD({find:i,handler:e=>{let{chain:t,range:n,state:s}=e;const a=l(s.doc,n),r=a?function(e,t){const n=e.resolve(t.from).nodeBefore;return n&&n.isTextblock&&0===n.content.size?{from:t.from-n.nodeSize,to:t.to}:t}(s.doc,a):n;t().deleteRange(r).run()}})]}})},86294:function(e,t,n){"use strict";n.d(t,{gI:function(){return E},Km:function(){return S},$:function(){return P},z6:function(){return L},zA:function(){return R},Qj:function(){return M},eD:function(){return H},py:function(){return I},c7:function(){return _},qi:function(){return k},uf:function(){return F},k1:function(){return A}});var s=n(85893),a=n(30709),r=n(5152),o=n.n(r),i=n(67294),l=n(86501),c=n(87486),d=n(69217),u=n(37174),m=n(92395),p=n(79381),h=n(4494);const f=e=>{let{strokeWidth:t=2,className:n}=e;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:n,children:(0,s.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})},v=()=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",className:"pointer-events-none",children:(0,s.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1",d:"m17 15l4 4m0-4l-4 4M7 6V5h11v1M7 19h4m2-14L9 19"})}),g=e=>{let{strokeWidth:t=2,className:n}=e;return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",className:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M8 6H21",stroke:"rgb(var(--foreground))",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M8 12H21",stroke:"rgb(var(--foreground))",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M8 18H21",stroke:"rgb(var(--foreground))",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 6L3 5V10",stroke:"rgb(var(--foreground))",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M4 19H2L4 14.998C4 14.4447 3.55141 13.9961 2.99805 13.9961C2.44468 13.9961 1.99609 14.4447 1.99609 14.998",stroke:"rgb(var(--foreground))",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"})]})};var x=n(82598),b=n(3134),y=n(12003),j=n(30665);const w=(0,y.j)("bg-accent-10 hover:bg-accent-60 relative active:bg-accent-30 hover:text-accent-10 rounded p-2 text-white transition duration-75",{variants:{variant:{default:"",disabled:"bg-accent-10 pointer-events-none opacity-20",active:"bg-background-10 border-accent-50 hover:bg-accent-60 hover:border-accent-40"},defaultVariants:{variant:"default"}}}),N=i.forwardRef(((e,t)=>{let{tag:n,...s}=e;const a=n||"button";return i.createElement(a,{...s,ref:t},s.children)}));N.displayName="CustomElement";const k=i.forwardRef(((e,t)=>{let{children:n,className:a,active:r,disabled:o,aria:i,...l}=e;const c=(0,u.cn)(a,w({variant:r?"active":o?"disabled":"default"}));return(0,s.jsx)(N,{...l,ref:t,"aria-label":i,className:(0,u.cn)(c,a),children:n})}));function C(e){let{text:t,children:n,wrapperClassName:a,...r}=e;return(0,s.jsx)(j.u,{text:t,side:"top",sideOffset:16,className:(0,u.cn)("flex justify-center",a),children:(0,s.jsx)(k,{...r,children:(0,s.jsx)("div",{className:"w-5 text-center",children:n})})})}k.displayName="TipTapButton";n(62472);const T=o()((()=>Promise.all([n.e(314),n.e(9510),n.e(3458)]).then(n.bind(n,63458)).then((e=>e.EmojiPicker))),{loadableGenerated:{webpack:()=>[63458]},ssr:!1});function P(e){let{editor:t,className:n}=e;return(0,s.jsxs)(a.fC,{children:[(0,s.jsx)(a.xz,{className:"block focus:outline-none",children:(0,s.jsx)(C,{text:"Format text: Bold, Italic, Underline, etc",className:(0,u.cn)("font-light underline",n
1),tag:"div",children:"B"})}),(0,s.jsx)(a.h_,{children:(0,s.jsx)(a.VY,{className:"data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade bg-background dark:bg-background-10 z-[1000] w-auto rounded-md border p-2 will-change-[transform,opacity] focus:outline-none",sideOffset:8,collisionPadding:{top:20,left:20},children:(0,s.jsxs)("div",{className:"flex items-center gap-x-4",children:[(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleBold().run(),children:(null===t||void 0===t?void 0:t.isActive("bold"))?(0,s.jsx)(m.lM8,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(m.lM8,{className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleItalic().run(),children:(null===t||void 0===t?void 0:t.isActive("italic"))?(0,s.jsx)(m.C9_,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(m.C9_,{className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleUnderline().run(),children:(null===t||void 0===t?void 0:t.isActive("underline"))?(0,s.jsx)(m.xxo,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(m.xxo,{strokeWidth:1,className:"pointer-events-none"})})]})})})]})}function L(e){let{editor:t}=e;return(0,s.jsxs)(a.fC,{children:[(0,s.jsx)(a.xz,{className:"block focus:outline-none",children:(0,s.jsxs)(C,{text:"Add titles or change text type",className:"font-light",tag:"div",children:["T",(0,s.jsx)("small",{children:"T"})]})}),(0,s.jsx)(a.h_,{children:(0,s.jsx)(a.VY,{className:"data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade bg-background dark:bg-background-10 z-[1000] w-auto rounded-md border p-2 will-change-[transform,opacity] focus:outline-none",sideOffset:8,collisionPadding:{top:20,left:20},children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-y-2",children:[(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().setParagraph().run(),className:"text-sm font-light tabular-nums",children:"Paragraph"}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleHeading({level:2}).run(),className:"text-lg font-bold tabular-nums",children:"Title"}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleHeading({level:3}).run(),className:"text-base font-semibold tabular-nums",children:"Heading1"}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleHeading({level:4}).run(),className:"text-sm font-semibold tabular-nums",children:"Heading2"})]})})})]})}function S(e){let{editor:t,className:n}=e;return(0,s.jsxs)(a.fC,{children:[(0,s.jsx)(a.xz,{className:"hidden focus:outline-none sm:block",children:(0,s.jsx)(C,{text:"Add emojis",tag:"div",className:n,children:(0,s.jsx)(m.lID,{className:"pointer-events-none"})})}),(0,s.jsx)(a.h_,{children:(0,s.jsx)(a.VY,{className:"data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade z-[1000] w-auto will-change-[transform,opacity] focus:outline-none",sideOffset:8,collisionPadding:{top:20,left:20},children:(0,s.jsx)(T,{rows:4,maxFrequentRows:1,navPosition:"none",skinTonePosition:"none",previewPosition:"none",onEmojiSelect:e=>null===t||void 0===t?void 0:t.chain().focus().insertContent(e.native).run()})})})]})}function _(e){let{onClick:t,className:n}=e;return(0,s.jsx)("div",{className:"ml-auto flex items-center",children:(0,s.jsx)(k,{onClick:t,aria:"Send message",className:n,children:(0,s.jsxs)("div",{className:"w-5 text-center",children:[" ",(0,s.jsx)(m.h9l,{className:"pointer-events-none -translate-x-1 rotate-45"})]})})})}function I(e){let{editor:t,className:n}=e;return(0,s.jsxs)(a.fC,{children:[(0,s.jsx)(a.xz,{className:"block focus:outline-none",children:(0,s.jsx)(C,{text:"More options",tag:"div",className:n,children:(0,s.jsx)(m.q3n,{className:"pointer-events-none"})})}),(0,s.jsx)(a.h_,{children:(0,s.jsx)(a.VY,{className:"data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade bg-background dark:bg-background-10 z-[1000] w-auto rounded-md border p-2 will-change-[transform,opacity] focus:outline-none",sideOffset:8,collisionPadding:{top:20,left:2
10},children:(0,s.jsxs)("div",{className:"flex items-center gap-x-4",children:[(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleBulletList().run(),children:(null===t||void 0===t?void 0:t.isActive("bulletList"))?(0,s.jsx)(m.ZdG,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(m.ZdG,{className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleOrderedList().run(),children:(null===t||void 0===t?void 0:t.isActive("orderedList"))?(0,s.jsx)(g,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(g,{strokeWidth:1,className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleBlockquote().run(),children:(null===t||void 0===t?void 0:t.isActive("blockquote"))?(0,s.jsx)(f,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(f,{strokeWidth:1,className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>null===t||void 0===t?void 0:t.chain().focus().toggleCodeBlock().run(),children:(null===t||void 0===t?void 0:t.isActive("codeblock"))?(0,s.jsx)(m.seM,{strokeWidth:2,className:"pointer-events-none"}):(0,s.jsx)(m.seM,{strokeWidth:1,className:"pointer-events-none"})}),(0,s.jsx)("button",{onClick:()=>{(null===t||void 0===t?void 0:t.state.selection.empty)?l.ZP.error("Select text first to remove formatting"):(null===t||void 0===t||t.chain().focus().unsetAllMarks().run(),null===t||void 0===t||t.chain().focus().setParagraph().run())},children:(0,s.jsx)(v,{})})]})})})]})}function A(e){let{editor:t,className:n}=e;const a=(0,h.Z)(),r=(0,i.useRef)(null),o=(0,i.useRef)(null);(0,i.useEffect)((()=>{r.current&&o.current&&(r.current=640,o.current=480)}),[r,o]);return(0,s.jsx)(C,{text:"Add YouTube video",onClick:()=>(async()=>{const e=await a({title:"Add Youtube video",description:"Enter YouTube URL",confirmText:"Add"});e&&(null===t||void 0===t||t.chain().setYoutubeVideo({src:e,width:Math.max(320,parseInt(r.current,10))||640,height:Math.max(180,parseInt(o.current,10))||480}).createParagraphNear().run())})(),className:n,children:(0,s.jsx)(m.zA_,{className:"pointer-events-none"})})}function M(e){let{editor:t,className:n}=e;const a=(0,h.Z)();return(0,s.jsx)(C,{text:"Add URL link",onClick:()=>(async()=>{if(null===t||void 0===t?void 0:t.state.selection.empty)return void l.ZP.error("Select text first to add a link");const e=await a({title:"Add a link",description:"Enter a valid URL",confirmText:"Add"});e&&(null===t||void 0===t||t.commands.setLink({href:e,target:"_blank"}))})(),className:n,children:(0,s.jsx)(m.JHz,{className:"pointer-events-none"})})}function R(e){let{editor:t,imgTags:n,className:a}=e;const r=(0,i.useRef)(null),o=(0,d.e)(),{uploadFile:l,isUploading:h}=(0,c.uk)(n||["tenantUserId=".concat(null===o||void 0===o?void 0:o.id),"tenantId=".concat(null===o||void 0===o?void 0:o.tenantId)]);return(0,s.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,s.jsx)("input",{ref:r,hidden:!0,type:"file",accept:"image/*",onChange:async e=>{const n=await l(e.target.files[0]);null===t||void 0===t||t.chain().insertContent('<img src="'.concat(n.secure_url,'"/>')).createParagraphNear().run()}}),(0,s.jsx)(p.g,{active:h,className:"h-full",children:(0,s.jsx)(C,{text:"Add image",onClick:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.click()},className:(0,u.cn)("h-full",a),wrapperClassName:"h-full",children:(0,s.jsx)(m.Zay,{className:"pointer-events-none"})})})]})}function E(e){let{editor:t,imgTags:n,className:a}=e;const r=(0,i.useRef)(null),o=(0,d.e)(),{uploadMultipleFiles:h,isUploading:f}=(0,c.HO)(n||["tenantUserId=".concat(null===o||void 0===o?void 0:o.id),"tenantId=".concat(null===o||void 0===o?void 0:o.tenantId)]);return(0,s.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,s.jsx)("input",{ref:r,hidden:!0,type:"file",accept:"image/*",multiple:!0,onChange:async e=>{const n=e.target.files;if(n)try{null===t||void 0===t||t.chain().focus().insertContent({type:"image-gallery",attrs:{loading:!0,count:0,images:[]}}).run();const e=await h(Array.from(n));if(!e)throw"No files were uploaded";null===t||void 0===t||t.chain().focus().selectNodeBackward().updateAttributes("image-gallery",{loading:!1,count:e.length,images:e.map((e=>({src:e.secure_url})))}).createParagraphNear().run()}catch(e){l.ZP.error("Failed to upload images. Please try again later."),null===t||void 0===t||t.commands.undo()}else l.ZP.error("No files selected")}}),(0,s.jsx)(p.g,{active:f,className:"h-full",children:(0,s.jsx)(C,{text:"Add image carousel",onClick:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.click()},className:(0,u.cn)("h-full",a),wrapperClassName:"h-full",children:(0,s.jsx)(m.RMM,{className:"pointer-events-none"})})})]})}function F(e){let{editor:t,className:n}=e;const a=(0,d.e)(),r=(0,i.useMemo)((()=>["tenantUserId=".concat(null===a||void 0===a?void 0:a.id),"tenantId=".concat(null===a||void 0===a?void 0:a.tenantId)]),[null===a||void 0===a?void 0:a.id,null===a||void 0===a?void 0:a.tenantId]),o=(0,i.useCallback)((e=>{null===t||void 0===t||t.chain().insertContent({type:"video",attrs:{src:e}}).createParagraphNear().run()}),[t]),c=(0,i.useCallback)((async e=>{var t,n;if(!(null===(t=e.target.files)||void 0===t?void 0:t[0]))return;const s=e.target.files[0],a=null===(n=s.name.split(".").pop())||void 0===n?void 0:n.toLowerCase();
1if(["mp4","mov","wmv","avi","mkv","flv","webm"].includes(a||""))try{const e="372750",{tenantId:t}=(0,b.V)(r),n=await(0,x.Hu)(e,t);if(!n)throw new Error("Collection ".concat(t," not found after creation."));const a=await(0,x.w_)(e,s.name,n);await(0,x.nz)(e,a,s);const i="https://iframe.mediadelivery.net/embed/".concat(e,"/").concat(a);o(i)}catch(i){l.ZP.error(i.message||"Failed to upload video.")}else l.ZP.error("Invalid file format.")}),[o,r]);return(0,s.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,s.jsx)(C,{text:"Upload video",className:n,onClick:()=>{const e=document.querySelector("#video-upload-input");null===e||void 0===e||e.click()},children:(0,s.jsx)(m.GnS,{className:"pointer-events-none"})}),(0,s.jsx)("input",{type:"file",accept:"video/mp4,video/mov,video/wmv,video/quicktime,video/avi,video/mkv,video/flv,video/webm",id:"video-upload-input",className:"hidden",onChange:c})]})}function H(e){let{editor:t,className:n}=e;return(0,s.jsx)(C,{text:"Mention someone. Can also be used by typing @ and their name",onClick:()=>null===t||void 0===t?void 0:t.chain().focus().insertContent("@").run(),className:n,children:(0,s.jsx)(m.AZT,{className:"pointer-events-none"})})}},85400:function(e,t,n){"use strict";n.d(t,{y:function(){return S},l:function(){return _}});var s=n(7490),a=n(99404),r=n(48510),o=n(97509),i=n(42752),l=n(2376),c=n(16722);const d=new l.H$("mention"),u=i.NB.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel(e){let{options:t,node:n}=e;var s;return"".concat(t.suggestion.char).concat(null!==(s=n.attrs.label)&&void 0!==s?s:n.attrs.id)},suggestion:{char:"@",pluginKey:d,command:e=>{let{editor:t,range:n,props:s}=e;var a,r;const o=t.view.state.selection.$to.nodeAfter;(null===o||void 0===o||null===(a=o.text)||void 0===a?void 0:a.startsWith(" "))&&(n.to+=1),t.chain().focus().insertContentAt(n,[{type:this.name,attrs:s},{type:"text",text:" "}]).run(),null===(r=window.getSelection())||void 0===r||r.collapseToEnd()},allow:e=>{let{state:t,range:n}=e;const s=t.doc.resolve(n.from),a=t.schema.nodes[this.name];return!!s.parent.type.contentMatch.matchType(a)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({slug:{default:null,parseHTML:e=>e.getAttribute("data-slug"),renderHTML:e=>e.slug?{"data-slug":e.slug}:{}},id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},type:{default:null,parseHTML:e=>e.getAttribute("data-type"),renderHTML:e=>e.type?{"data-type":e.type}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:'span[data-type="'.concat(this.name,'"]')}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["a",(0,i.P1)({"data-type":this.name},{href:"/".concat("user"===n["data-type"]?"user":"teams","/").concat(n["data-slug"]||n["data-id"])},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((e=>{let{tr:t,state:n}=e,s=!1;const{selection:a}=n,{empty:r,anchor:o}=a;return!!r&&(n.doc.nodesBetween(o-1,o,((e,n)=>{if(e.type.name===this.name)return s=!0,t.insertText(this.options.suggestion.char||"",n,n+e.nodeSize),!1})),s)}))}},addProseMirrorPlugins(){return[(0,c.ZP)({editor:this.editor,...this.options.suggestion})]}});var m=n(26761),p=n(37174);const h=i.NB.create({name:"video",group:"block",addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>{const t=(0,p.cy)(e.src);return t.includes("iframe.mediadelivery.net/embed")?{src:t}:{src:t,poster:(0,p.Dt)(e.src),preload:"none"}}}}),parseHTML:()=>[{tag:"video",getAttrs:e=>({src:e.getAttribute("src")})},{tag:"iframe",getAttrs:e=>({src:e.getAttribute("src")})}],renderHTML(e){let{HTMLAttributes:t}=e;return t.src.includes("iframe.mediadelivery.net/embed")?["div",{class:"relative w-full pb-[56.25%] h-0"},["iframe",{src:"".concat(t.src,"?autoplay=0"),class:"absolute top-0 left-0 w-full h-full",frameborder:"0",allow:"accelerometer; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"true",playsinline:"true"}]]:["video",{controls:"true",controlsList:"nodownload",style:"width: 100%",...t},["source",t]]}}),f=e=>{const t=e.trim(),n=t.match(/src=["']([^"']+)["']/i);var s;const a=null!==(s=null===n||void 0===n?void 0:n[1])&&void 0!==s?s:t;return/^https:\/\/w\.soundcloud\.com\/player\/\?/i.test(a)?a:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(a),"&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual
1=true")},v=i.NB.create({name:"soundCloud",group:"block",atom:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})}}),parseHTML:()=>[{tag:"iframe[data-soundcloud]",getAttrs:e=>({src:e.getAttribute("src")})}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",(0,i.P1)(t,{"data-soundcloud":!0,width:"100%",height:"300",scrolling:"no",frameborder:"no",src:t.src})]},addCommands:()=>({setSoundCloud:e=>t=>{let{commands:n}=t;const s=f(e);return n.insertContent({type:"soundCloud",attrs:{src:s}})}}),addPasteRules:()=>[new i.hD({find:/https?:\/\/(?:w\.)?soundcloud\.com\/[^\s"]+/g,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[0],r=f(a);n().deleteRange(s).insertContent({type:"soundCloud",attrs:{src:r}}).focus().run()}})]});var g=n(8045);const x=i.NB.create({name:"youtubeEmbed",group:"block",atom:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})}}),parseHTML:()=>[{tag:"iframe[data-youtube]",getAttrs:e=>({src:e.getAttribute("src")})}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",(0,i.P1)(t,{"data-youtube":!0,width:"100%",height:"390",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"true",src:t.src})]},addCommands:()=>({setYoutubeEmbed:e=>{let{url:t}=e;return e=>{let{commands:n}=e;const s=function(e){const t=[/youtu\.be\/([\w-]+)/,/youtube\.com\/watch\?v=([\w-]+)/,/youtube\.com\/live\/([\w-]+)/,/youtube\.com\/shorts\/([\w-]+)/];for(const n of t){const t=e.match(n);if(null===t||void 0===t?void 0:t[1])return t[1]}return null}(t);return!!s&&n.insertContent({type:"youtubeEmbed",attrs:{src:"https://www.youtube.com/embed/".concat(s)}})}}}),addPasteRules:()=>[new i.hD({find:/https?:\/\/(?:www\.)?(youtube\.com\/(?:watch\?v=|live\/|shorts\/)|youtu\.be\/)([\w-]+)/g,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[2];a&&n().deleteRange(s).insertContent({type:"youtubeEmbed",attrs:{src:"https://www.youtube.com/embed/".concat(a)}}).focus().run()}})]});const b=e=>{const t=e.trim(),n=t.match(/src=["']([^"']+)["']/i);var s;const a=null!==(s=null===n||void 0===n?void 0:n[1])&&void 0!==s?s:t;return/^https?:\/\/(?:www\.)?whyp\.it\/(?:embeds\/|tracks\/embed)/i.test(a)||/^https?:\/\/(?:www\.)?whyp\.it\//i.test(a),a},y=i.NB.create({name:"whyp",group:"block",atom:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})}}),parseHTML:()=>[{tag:"iframe",getAttrs:e=>{const t=e.getAttribute("src")||"";return!!/https?:\/\/(?:www\.)?whyp\.it\//i.test(t)&&{src:t}}}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",(0,i.P1)(t,{"data-whyp":!0,src:t.src,width:"100%",height:"400",scrolling:"no",frameborder:"0",loading:"lazy"})]},addCommands(){return{setWhyp:e=>t=>{let{commands:n}=t;const s=b(e);return n.insertContent({type:this.name,attrs:{src:s}})}}},addPasteRules(){return[new i.hD({find:/<iframe[^>]+src=["'](https?:\/\/(?:www\.)?whyp\.it\/[^\s"]+)["'][^>]*><\/iframe>/gi,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[1],r=b(a||"");n().deleteRange(s).insertContent({type:this.name,attrs:{src:r}}).focus().run()}}),new i.hD({find:/https?:\/\/(?:www\.)?whyp\.it\/[^\s"]+/gi,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[0],r=b(a);n().deleteRange(s).insertContent({type:this.name,attrs:{src:r}}).focus().run()}})]}}),j=e=>{const t=e.trim(),n=t.match(/src=["']([^"']+)["']/i);var s;const a=null!==(s=null===n||void 0===n?void 0:n[1])&&void 0!==s?s:t;return/^https?:\/\/(?:www\.)?teeplay\.baert\.no\/embed\//i.test(a)?a:/^https?:\/\/(?:www\.)?teeplay\.baert\.no\//i.test(a)?"https://teeplay.baert.no/embed/winamp?preset=Classic&tracks=".concat(encodeURIComponent(a)):a},w=i.NB.create({name:"teeplay",group:"block",atom:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})}}),parseHTML:()=>[{tag:"iframe",getAttrs:e=>{const t=e.getAttribute("src")||"";return!!/https?:\/\/(?:www\.)?teeplay\.baert\.no\//i.test(t)&&{src:t}}}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",(0,i.P1)(t,{"data-teeplay":!0,src:t.src,width:"100%",height:"400",frameborder:"0",loading:"lazy",style:"display:block;margin:0 auto;max-width:100%;"})]},addCommands(){return{setTeeplay:e=>t=>{let{commands:n}=t;const s=j(e);return n.insertContent({type:this.name,attrs:{src:s}})}}},addPasteRules(){return[new i.hD({find:/<iframe[^>]+src=["'](https?:\/\/(?:www\.)?teeplay\.baert\.no\/[^\s"]+)["'][^>]*><\/iframe>/gi,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[1]||"",r=j(a);n().deleteRange(s).insertContent({type:this.name,attrs:{src:r}}).focus().run()}}),new i.hD({find:/https?:\/\/(?:www\.)?teeplay\.baert\.no\/[^\s"]+/gi,handler:e=>{let{match:t,chain:n,range:s}=e;const a=t[0],r=j(a);n().deleteRange(s).insertContent({type:this.name,attrs:{src:r}}).focus().run()}})]}}),N=["player.indyriot.com","indyplayer-six.vercel.app","kaizmaster.vercel.app","www.vimondtv.com"],k=N.map((e=>e.replaceAll(".","\\."))).join("|"),C=e=>{try{const{hostname:t}=new URL(e);return N.includes(t)}catch(t){return!1}},T=e=>{const t=e.trim(),n=t.match(/src=["']([^"']+)["']/i);var s;const a=null!==(s=null===n||void 0===n?void 0:n[1])&&void 0!==s?s:t;return C(a)?a:""},P=i.NB.create({name:"indyriot",group:"block",atom:!0,addAttributes:()=>({src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})}}),parseHTML:()=>[{tag:"iframe",getAttrs:e=>{const t=e.getAttribute("src")||"";return!!C(t)&&{src:t}}}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",(0,i.P1)(t,{"data-indyriot":!0,src:t.src,width:"100%",height:"400",frameborder:"0",loading:"lazy",allow:"autoplay; encrypted-media; fullscreen",style:"display:block;margin:0 auto;max-width:100%;"})]},addCommands(){return{setIndyRiot:e=>t=>{let{commands:n}=t;const s=T(e);return!!s&&n.insertContent({type:this.name,attrs:{src:s}})}}},addPasteRules(){return[new i.hD({find:new RegExp("<iframe[^>]+src=[\"'](https?:\\/\\/(?:".concat(k,")\\/[^\\s\"']+)[\"'][^>]*>(?:<\\/iframe>)?"),"gi"),handler:e=>{let{match:t,chain:n,range:s}=e;var a;const r=null!==(a=t[1])&&void 0!==a?a:"",o=T(r);o&&n().deleteRange(s).insertContent({type:this.name,attrs:{src:o}}).focus().run()}}),new i.hD({find:new RegExp("https?:\\/\\/(?:".concat(k,")\\/[^\\s\"']+"),"gi"),handler:e=>{let{match:t,chain:n,range:s}=e;var a;const r=null!==(a=t[0])&&void 0!==a?a:"",o=T(r);o&&n().deleteRange(s).insertContent({type:this.name,attrs:{src:o}}).focus().run()}})]}});var L=n(3593);function S(){let{editable:e=!0,suggestion:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[o.Z.configure({heading:!1}),s.Z,r.Z,a.ZP.configure({openOnClick:!e}),g.Z.configure({}),x,v,h,y,w,P,L.C,u.configure({HTMLAttributes:{class:"mention"},renderLabel(e){let{node:t}=e;return"".concat(t.attrs.label)},suggestion:t})]}function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[m.Ee,...S(e)]}},71015:function(e,t,n){"use strict";n.d(t,{Kx:function(){return q},G3:function(){return V},xg:function(){return Y},dD:function(){return G},G1:function(){return W},Mu:function(){return B}});var s=n(85893),a=n(37174),r=n(25003),o=n(88776),i=n(93237),l=n(71284),c=n(67294),d=n(86501),u=n(87486),m=n(69217),p=n(70456),h=n(86294),f=n(85400),v=n(25675),g=n.n(v),x=n(26761),b=n(51204),y=n(12854),j=n(42393),w=n(26126);const N=x.Ee.extend({addNodeView:()=>(0,l.fW)((e=>{const[t,n]=(0,c.useState)(!1),[r,o]=(0,c.useState)(!1);var i;i=()=>n(!1),(0,c.useEffect)((()=>{function e(e){if("Escape"===e.key)return i()}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[i]),(0,c.useEffect)((()=>{t&&o(!1)}),[t]),((e,t)=>{const[n,s]=(0,c.useState)(0);(0,c.useEffect)((()=>{s((e=>e+1)),n<1||t(e)}),[e])})(e.selected,(()=>{n(e.selected)}));const d=function(){const t=e.node.attrs.src;if(!t)return null;try{const e=new URL(t).searchParams.get("url");return e||t}catch(n){return null}}();if(!d)return null;const u=t=>{let{size:n,onClick:r,className:o}=t;return(0,s.jsx)(g(),{width:n,height:n,src:d,alt:e.node.attrs.alt||"chat image",className:(0,a.cn)("!my-2 rounded-lg object-cover",o),onClick:r})},m=e=>{let{children:t}=e;return(0,s.jsx)("div",{className:"fixed top-0 z-50 flex h-screen w-screen items-center justify-center overflow-auto",onClick:()=>n(!1),children:(0,s.jsxs)(y.cZ,{className:"flex items-center justify-center overflow-auto",children:[(0,s.jsx)(b.GG,{className:"bg-background dark:bg-background-10 z-20"}),t]})})};return(0,s.jsx)(l.T5,{className:"react-component-with-content",children:(0,s.jsx)("div",{className:"w-full backdrop-blur-md",children:(0,s.jsxs)(b.Vq,{open:t,children:[(0,s.jsx)(u,{size:600,className:"w-full",onClick:()=>n(!0)}),(0,s.jsxs)(b.PK,{children:[(0,s.jsx)(b.t9,{}),(0,s.jsx)(m,{children:(0,s.jsx)(w.d$,{initialScale:1,maxScale:5,doubleClick:{mode:"zoomIn"},wheel:{disabled:!1},pinch:{disabled:!1},panning:{disabled:!1},limitToBounds:!1,centerOnInit:!0,children:(0,s.jsx)(w.Uv,{wrapperStyle:{width:"100vw",height:"100vh"},children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"relative flex items-center justify-center",children:[(0,s.jsx)("img",{src:d,alt:e.node.attrs.alt||"image",className:"max-w-screen h-auto max-h-[90vh] w-auto rounded-lg object-contain",onLoad:()=>o(!0)}),!r&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)(j.T,{active:!0})})]})})})})]})]})})})}))});var k=n(2376);const C=x.Ee.extend({addProseMirrorPlugins(){return[new k.Sy({key:new k.H$("customImageDropPlugin"),props:{handleDOMEvents:{drop:(e,t)=>{var n,s,a;const r=this.options.uploadHandler,o=null===(s=t.dataTransfer)||void 0===s||null===(n=s.files)||void 0===n?void 0:n.length,i=null===(a=t.dataTransfer)||void 0===a?void 0:a.getData("text/uri-l
1ist");return!o&&(i&&(t.preventDefault(),r(i).then((t=>{e.dispatch(e.state.tr.replaceSelectionWith(this.type.create({src:t})))}))),!0)}}}})]}});var T=n(42752),P=n(92395);const L=e=>{let{images:t,isLoading:n,setText:r,handleDelete:o}=e;return(0,s.jsx)("div",{className:"relative bg-gray-200 p-2",children:n?(0,s.jsx)(j.T,{active:n,className:"absolute bottom-0 left-0 right-0 top-0"}):(0,s.jsx)("div",{className:"mb-4 grid grid-cols-2 gap-2",children:t.map(((e,n)=>(0,s.jsxs)("div",{className:"relative flex flex-col justify-between rounded bg-white p-2 shadow",children:[t.length>2&&(0,s.jsx)("button",{className:"absolute right-2 top-2 bg-gray-900 p-1 align-middle text-black hover:opacity-50",onClick:()=>o(n),"aria-label":"Remove image ".concat(n+1),children:(0,s.jsx)(P.IF3,{size:"xlarge"})}),(0,s.jsx)("div",{className:"flex flex-grow items-center justify-center",children:(0,s.jsx)(g(),{src:(0,a.qE)(e.src,200,200),alt:e.text||"Gallery image",width:200,height:200,className:"mb-2 max-h-48 w-auto max-w-full rounded"})}),(0,s.jsx)("input",{type:"text",placeholder:"Text",maxLength:2e3,value:e.text||"",onChange:e=>r(n,e.target.value),className:"mt-2 w-full rounded border p-1"})]},n)))})})};var S=n(91155),_=n.n(S);const I=e=>{const{children:t,...n}=e;return(0,s.jsxs)("button",{className:"text-accent ".concat(_().embla__button," ").concat(_()["embla__button--prev"]),type:"button",...n,children:[(0,s.jsx)("svg",{className:_().embla__button__svg,viewBox:"0 0 532 532",children:(0,s.jsx)("path",{fill:"currentColor",d:"M355.66 11.354c13.793-13.805 36.208-13.805 50.001 0 13.785 13.804 13.785 36.238 0 50.034L201.22 266l204.442 204.61c13.785 13.805 13.785 36.239 0 50.044-13.793 13.796-36.208 13.796-50.002 0a5994246.277 5994246.277 0 0 0-229.332-229.454 35.065 35.065 0 0 1-10.326-25.126c0-9.2 3.393-18.26 10.326-25.2C172.192 194.973 332.731 34.31 355.66 11.354Z"})}),t]})},A=e=>{const{children:t,...n}=e;return(0,s.jsxs)("button",{className:"text-accent ".concat(_().embla__button," ").concat(_()["embla__button--next"]),type:"button",...n,children:[(0,s.jsx)("svg",{className:_().embla__button__svg,viewBox:"0 0 532 532",children:(0,s.jsx)("path",{fill:"currentColor",d:"M176.34 520.646c-13.793 13.805-36.208 13.805-50.001 0-13.785-13.804-13.785-36.238 0-50.034L330.78 266 126.34 61.391c-13.785-13.805-13.785-36.239 0-50.044 13.793-13.796 36.208-13.796 50.002 0 22.928 22.947 206.395 206.507 229.332 229.454a35.065 35.065 0 0 1 10.326 25.126c0 9.2-3.393 18.26-10.326 25.2-45.865 45.901-206.404 206.564-229.332 229.52Z"})}),t]})};var M=n(89382),R=n(21861);const E=e=>{const{images:t,options:n}=e,[r,o]=(0,M.Z)(n),{prevBtnDisabled:i,nextBtnDisabled:l,onPrevButtonClick:d,onNextButtonClick:u}=(e=>{const[t,n]=(0,c.useState)(!0),[s,a]=(0,c.useState)(!0),r=(0,c.useCallback)((()=>{e&&e.scrollPrev()}),[e]),o=(0,c.useCallback)((()=>{e&&e.scrollNext()}),[e]),i=(0,c.useCallback)((e=>{n(!e.canScrollPrev()),a(!e.canScrollNext())}),[]);return(0,c.useEffect)((()=>{e&&(i(e),e.on("reInit",i).on("select",i))}),[e,i]),{prevBtnDisabled:t,nextBtnDisabled:s,onPrevButtonClick:r,onNextButtonClick:o}})(o);return(0,s.jsx)("section",{className:_().embla,children:(0,s.jsxs)("div",{className:_().embla__viewport,ref:r,children:[(0,s.jsx)("div",{className:_().embla__container,children:t.map(((e,t)=>(0,s.jsx)(R.P,{src:e.src,trigger:t=>(0,s.jsxs)("div",{className:_().embla__slide,onClick:t,children:[(0,s.jsx)(g(),{src:(0,a.qE)(e.src,800,600),alt:e.text||"Gallery image",className:_().embla__slide__image,width:800,height:600}),e.text&&(0,s.jsx)("span",{className:_().embla__slide__text,children:e.text})]})},t)))}),(0,s.jsx)(I,{onClick:e=>{e.preventDefault(),d()},disabled:i}),(0,s.jsx)(A,{onClick:e=>{e.preventDefault(),u()},disabled:l})]})})},F=e=>{let{images:t,deleteSlide:n,setImageText:a,isEditable:r,isLoading:o}=e;const i=(0,c.useCallback)((e=>{n(e)}),[n]),l=(0,c.useCallback)(((e,t)=>{a(e,t)}),[a]);return(0,s.jsx)("section",{className:"rounded-xl",children:(0,s.jsx)("div",{className:"container",children:r?(0,s.jsx)(L,{images:t,isLoading:o,setText:l,handleDelete:i}):(0,s.jsx)(E,{images:t,options:{loop:!0}})})})},H=e=>{const{node:t,updateAttributes:n,editor:a}=e,r=t.attrs.images,o=t.attrs.loading,i=!!(null===a||void 0===a?void 0:a.isEditable);return(0,s.jsx)(l.T5,{className:"react-component",children:(0,s.jsx)(F,{images:r,deleteSlide:e=>{n({images:r.filter(((t,n)=>n!==e)),count:r.length-1})},isEditable:i,setImageText:(e,t)=>
1{n({images:r.map(((n,s)=>s===e?{...n,text:t}:n))})},isLoading:o})})},D=T.NB.create({name:"image-gallery",group:"block",atom:!0,addAttributes:()=>({count:{default:0},images:{default:[]},loading:{default:!0}}),parseHTML:()=>[{tag:"image-gallery"}],renderHTML(e){let{HTMLAttributes:t}=e;return["image-gallery",(0,T.P1)(t)]},addNodeView:()=>(0,l.fW)(H)});var Z=n(3593);const U=e=>{let{node:t,editor:n}=e;const a=t.attrs.playerId;return!!(null===n||void 0===n?void 0:n.isEditable)?(0,s.jsxs)(l.T5,{as:"div",className:"not-prose border-background-20 bg-background-10 text-foreground-10 my-2 flex items-center gap-2 rounded-md border border-dashed p-3 text-sm",contentEditable:!1,children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\ud83c\udfb5"}),(0,s.jsx)("span",{children:"IndyPlayer embed - plays once posted"})]}):a?(0,s.jsx)(l.T5,{as:"div",className:"not-prose my-2",contentEditable:!1,children:(0,s.jsx)("iframe",{src:(0,Z.Y)(a),width:"100%",height:520,style:{maxWidth:768,border:0,borderRadius:16},allow:"autoplay",loading:"lazy"})}):null},z=Z.C.extend({addNodeView:()=>(0,l.fW)(U)});function B(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,m.e)(),n=["tenantUserId=".concat(null===t||void 0===t?void 0:t.id),"tenantId=".concat(null===t||void 0===t?void 0:t.tenantId)],{uploadFile:s}=(0,u.uk)(n),{uploadMultipleFiles:a}=(0,u.HO)(n);async function r(e,t,n){const a=await s(n);e.chain().insertContentAt(t,{type:"image",attrs:{src:a.secure_url}}).focus().run()}async function o(e,t,n){try{if(!e)throw new Error("Editor is not available");null===e||void 0===e||e.chain().focus().insertContentAt(t,{type:"image-gallery",attrs:{loading:!0,count:0,images:[]}}).run();const s=await a(n);if(!s)return;null===e||void 0===e||e.chain().focus().selectNodeBackward().updateAttributes("image-gallery",{loading:!1,count:s.length,images:s.map((e=>({src:e.secure_url})))}).createParagraphNear().run()}catch(s){console.error("Error handling multiple images:",s),null===e||void 0===e||e.commands.undo(),d.ZP.error("Failed to upload images")}}return O(e,{handleImage:r,handleMultipleImages:o,tags:n})}function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;const s=null===(n=e.nodeViews)||void 0===n||n,{limit:a,editable:l=!0,suggestion:c,placeholder:d="Write something..."}=e,m=(0,f.y)({suggestion:c,editable:l}),p=async e=>(await(0,u.cT)(e,null===t||void 0===t?void 0:t.tags)).secure_url;function h(e){return/^https?:\/\/(www\.)?soundcloud\.com\/[^\s]+$/g.test(e)}return[...m.filter((e=>"indyPlayerV2"!==e.name)),z,s?N:C.configure({uploadHandler:p}),D,i.Z.configure({placeholder:d}),o.Z.configure({limit:a}),r.ZP.configure({allowedMimeTypes:["image/png","image/jpeg","image/gif","image/webp"],onDrop:(e,n,s)=>{if(n.length>1)null===t||void 0===t||t.handleMultipleImages(e,s,n);else{const a=n[0];if(!a)return!1;null===t||void 0===t||t.handleImage(e,s,a)}},onPaste:(e,n,s)=>{if(s&&h(s))return e.chain().focus().setSoundCloud(s).run(),!0;if(n.length>1)null===t||void 0===t||t.handleMultipleImages(e,e.state.selection.anchor,
1n);else{const a=n[0];if(s)return!1;if(!a)return!1;null===t||void 0===t||t.handleImage(e,e.state.selection.anchor,a)}}})]}function V(e){let{children:t,className:n}=e;return(0,s.jsx)("div",{className:(0,a.cn)("bg-accent-10 relative flex flex-wrap rounded-b-md p-1",n),children:t})}function Y(e){return(0,s.jsx)(q,{...e,editable:!(void 0!==e.editable)||e.editable,children:t=>(0,s.jsxs)(V,{children:[(0,s.jsx)(h.$,{editor:t}),(0,s.jsx)(h.z6,{editor:t}),(0,s.jsx)(h.zA,{editor:t,imgTags:e.imgTags}),(0,s.jsx)(h.k1,{editor:t}),(0,s.jsx)(h.eD,{editor:t}),(0,s.jsx)(h.Qj,{editor:t}),(0,s.jsx)(h.Km,{editor:t}),(0,s.jsx)(h.py,{editor:t})]})})}const W="sm:prose lg:prose-xl text-foreground prose-li:marker:text-foreground-10 prose-blockquote:border-foreground-20 prose-a:break-words prose-a:underline prose-p:break-words first:prose-a:mt-0 last:prose-a:mb-0 first:prose-blockquote:mt-0 last:prose-blockquote:mb-0 first:prose-ol:mt-0 last:prose-ol:mb-0 first:prose-ul:mt-0 last:prose-ul:mb-0 first:prose-li:mt-0 last:prose-li:mb-0 first:prose-video:mt-0 last:prose-video:mb-0 first:prose-img:mt-0 last:prose-img:mb-0 first:prose-p:mt-0 last:prose-p:mb-0 break-words text-left leading-6";function q(e){let{children:t,editor:n,editable:r=!1,className:o,textAreaClassName:i,placeholder:d="What's on your mind?",content:u,onUpdate:m=(()=>{}),autofocus:h=!1,limit:f,textArea:v=!0,nodeViews:g=!1}=e;const x="function"===typeof t,b=(0,p.fB)(),y={class:(0,a.cn)("ProseMirror max-w-none focus:outline-none",W,o)},j=B({nodeViews:g,placeholder:d,suggestion:b,limit:f}),w=(0,l.jE)({editorProps:{attributes:y},content:u,onUpdate:m,editable:r,autofocus:h,extensions:j});return(0,c.useEffect)((()=>{w&&w.commands.setContent(u)}),[u,w]),w?r?(0,s.jsxs)("div",{className:(0,a.cn)("border-background-20 bg-background dark:bg-background-10 focus-within:border-link focus-within:ring-link focus:border-link focus:ring-link disabled:text-background-10 relative block w-full rounded-md border border-solid transition-all focus:outline-none disabled:cursor-not-allowed",i),children:[v&&(0,s.jsx)(G,{editor:n||w}),t&&x?t(n||w):t]}):(0,s.jsx)(l.kg,{editor:w}):null}function G(e){let{editor:t}=e;return(0,s.jsx)("div",{className:"max-h-64 overflow-x-clip overflow-y-scroll p-4",children:(0,s.jsx)(l.kg,{editor:t})})}},13115:function(e,t,n){"use strict";n.d(t,{w:function(){return v}});var s=n(85893),a=n(70385),r=n(67294),o=n(18922),i=n(114),l=n(62472),c=n(92395),d=n(55268),u=n(65768),m=n(44814),p=n(44886),h=n(96109),f=n(79570);const v=e=>{let{tags:t,selectedTags:n=[],setSelectedTags:v,label:g,onCreateTag:x,isTagLoading:b,tagLimitNumber:y,avoidCollisions:j=!1}=e;const w=(0,f.S)(),[N,k]=(0,r.useState)(!1),[C,T]=(0,r.useState)(""),P=(0,r.useRef)(null),L=(null===w||void 0===w?void 0:w.canUserCreateTags)&&x;if((0,u.t$)(P,(()=>{T("")})),!(null===t||void 0===t?void 0:t.length))return(0,s.jsx)(s.Fragment,{});const S=t.filter((e=>e.value.toLowerCase().includes(C.toLowerCase()))),_=n.length>0,I=y&&n.length>=y,A=t.some((e=>e.value===C));return(0,s.jsx)("div",{className:"relative mb-3 flex justify-start",children:(0,s.jsx)("div",{className:"relative my-0.5 flex flex-grow justify-between sm:justify-normal",children:(0,s.jsxs)(m.J2,{open:N,onOpenChange:k,children:[(0,s.jsxs)("div",{className:"bg-background dark:bg-background-10 grid grid-cols-[auto_1fr] rounded border",children:[(0,s.jsx)(m.xo,{children:(0,s.jsxs)(o.S,{className:"whitespace-nowrap",onClick:()=>k(!N),type:"icon",children:[(0,s.jsx)(c.Aho,{className:"h-4 w-4"}),g||"Filter tags"]})}),(0,s.jsxs)("div",{className:"col-span-1 flex overflow-x-auto ".concat(_?"gap-3":"hidden"),children:[(0,s.jsx)(l.i,{className:"my-1 h-full flex-shrink-0",type:"vertical"}),n.length>4?(0,s.jsx)("div",{className:"flex last:mr-3 sm:gap-3",children:(0,s.jsx)("div",{className:"flex self-center",children:(0,s.jsx)(d.C,{variant:"active",children:(0,s.jsx)("p",{children:"".concat(n.length," selected")})})})}):(0,s.jsxs)("div",{className:"flex last:mr-3 sm:gap-3",children:[null===t||void 0===t?void 0:t.map((e=>{if(n.some((t=>t.id===e.id)))return(0,s.jsx)("div",{className:"self-center",children:(0,s.jsxs)(d.C,{variant:"active",className:"hidden gap-1 sm:flex",children:[(0,s.jsx)("p",{className:"whitespace-nowrap",children:e.value}),(0,s.jsx)("span",{children:(0,s.jsx)(c.NOm,{className:"h-3 w-3"})})]})},e.id)})),(0,s.jsx)("div",{className:"self-center whitespace-nowrap sm:hidden ".concat(_?"":"hidden"),children:(0,s.jsx)(d.C,{variant:"active",children:(0,s.jsx)("p",{children:"".concat(n.length," selected")})})})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center sm:pl-2",children:[_&&(0,s.jsxs)(o.S,{className:"flex-shrink-0",type:"icon",onClick:()=>v([]),children:[(0,s.jsx)("span",{className:"hidden text-sm sm:inline-block",children:"Reset"}),(0,s.jsx)(c.kLi,{className:"h-5 w-5 sm:h-4 sm:w-4"})]}),(0,s.jsx)(p.oF,{onInteractOutside:()=>T(""),align:"start",open:N,avoidCollisions:j,children:(0,s.jsxs)(h.mY,{className:"m-1 flex w-72",children:[(0,s.jsx)(h.sZ,{value:C,onValueChange:T,placeholder:"Search tags..."}),(0,s.jsxs)(h.e8,{children:[(0,s.jsx)(h.rb,{children:"No results found"}),(0,s.jsx)(h.fu,{children:S.map((e=>{const t=n.some((t=>
1t.id===e.id));return(0,s.jsx)(h.di,{value:e.value,className:"flex aria-selected:bg-transparent ".concat(I&&!t?"pointer-events-none cursor-auto":"cursor-pointer"),children:(0,s.jsxs)("div",{className:"flex flex-grow justify-between",children:[(0,s.jsx)(i.Z,{onChange:()=>v(t?n.filter((t=>t.id!==e.id)):[...n,e]),label:e.value,className:"cursor-pointer",checked:t}),(0,s.jsx)("span",{className:"text-sm",children:e._count.posts})]})},e.id)}))})]}),(_||C.length>1)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.i,{}),(0,s.jsx)(o.S,{loading:b,disabled:A,onClick:()=>L?x(C,a.TagType.POST):v([]),block:!0,type:"default",className:"m-2",children:L&&C.length>1?'Create tag "'.concat(C,'"'):"Clear all tags"})]})]})})]})]})})})};v.displayName="TopicTags"},97366:function(e,t,n){"use strict";n.d(t,{p1:function(){return M},Yt:function(){return E}});var s=n(85893),a=n(32947),r=n(33299),o=n(41664),i=n.n(o),l=n(67294),c=n(52435),d=n(18922),u=n(79381);function m(e){let{user:t,src:n,alt:a,team:r}=e;const o=r||t;return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"cursor-pointer rounded-full",children:(0,s.jsx)(M,{className:"h-12 w-12",user:t,src:n,alt:a,team:r})}),(0,s.jsx)(i(),{href:"/".concat(r?"teams":"user","/").concat(null===o||void 0===o?void 0:o.slug),children:(0,s.jsx)(d.z,{type:"default",as:"div",children:"View Profile"})})]})}function p(e){let{user:t,team:n}=e;const a=n||t;return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-foreground text-base font-semibold leading-none",children:n?null===n||void 0===n?void 0:n.name:(null===t||void 0===t?void 0:t.firstName)+" "+(null===t||void 0===t?void 0:t.lastName)}),(null===a||void 0===a?void 0:a.biography)&&(0,s.jsx)("p",{className:"text-foreground my-2 line-clamp-2 text-sm",children:a.biography})]})}function h(e){let{stats:t}=e;return t?(0,s.jsxs)("ul",{className:"flex gap-x-2 text-sm font-light",children:[(0,s.jsxs)("li",{children:[(0,s.jsxs)("span",{className:"text-foreground font-semibold",children:[null===t||void 0===t?void 0:t._count.followedByUsers," "," "]}),(0,s.jsx)("span",{children:"Followers"})]}),(0,s.jsxs)("li",{className:"mr-2",children:[(0,s.jsxs)("span",{className:"text-foreground font-semibold",children:[null===t||void 0===t?void 0:t._count.followsUsers," "]}),(0,s.jsx)("span",{children:"Following"})]})]}):null}function f(e){var t,n;const{data:a}=(0,r.useSession)(),{data:o,isLoading:i}=c.S.tenantUser.getStats.useQuery({id:null===(t=e.user)||void 0===t?void 0:t.id},{enabled:Boolean(null===(n=e.user)||void 0===n?void 0:n.id)});return a?(0,s.jsxs)("div",{className:"flex w-[16rem] flex-col gap-2",children:[(0,s.jsx)(m,{...e}),(0,s.jsx)(p,{user:e.user,team:e.team}),!e.team&&(0,s.jsx)(u.g,{active:i,children:(0,s.jsx)(h,{stats:o})})]}):null}var v=n(87019),g=n(10952),x=n(12003),b=n(25675),y=n.n(b),j=n(37174);const w=(0,x.j)("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{default:"h-10 w-10 ",lg:"h-12 w-12"}},defaultVariants:{size:"default"}}),N=l.forwardRef(((e,t)=>{let{className:n,size:a,...r}=e;return(0,s.jsx)(g.fC,{ref:t,className:(0,j.cn)(w({size:a,className:n})),...r})}));N.displayName=g.fC.displayName;l.forwardRef(((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)(g.Ee,{ref:t,className:(0,j.cn)("border-foreground-20 aspect-square h-full w-full rounded-[inherit] border object-cover",n),...a}
1)})).displayName=g.Ee.displayName;const k=l.forwardRef(((e,t)=>{let{className:n,alt:a,...r}=e;const[o,i]=l.useState();return"error"===o?null:(0,s.jsx)(y(),{onError:()=>i("error"),ref:t,alt:a,quality:100,className:(0,j.cn)("border-background dark:border-background-20 aspect-square h-full w-full rounded-[inherit] border-2 object-cover ",n),...r})}));k.displayName="AvatarNextImage";const C=l.forwardRef(((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)(g.NY,{ref:t,className:(0,j.cn)("bg-accent text-accent-contrast border-background dark:border-background-20 flex h-full w-full items-center justify-center rounded-full border-2 uppercase",n),...a})}));C.displayName=g.NY.displayName;const T=a.fC,P=a.xz,L=l.forwardRef(((e,t)=>{let{className:n,align:r="center",sideOffset:o=4,...i}=e;return(0,s.jsx)(a.VY,{ref:t,align:r,sideOffset:o,className:(0,j.cn)("bg-background dark:bg-background-10 text-foreground animate-in zoom-in-90 border-background-10 z-50 rounded-lg border p-2 shadow-sm outline-none ",n),...i})}));L.displayName=a.VY.displayName;var S=n(75874),_=n.n(S),I=n(21861);function A(e,t){if(!t)return;let n;if("w"===e&&(n=/w-(\d+)/g),"h"===e&&(n=/h-(\d+)/g),!n)return;const s=t.match(n);if(!s)return;const a=Math.max(...s.map((e=>parseInt(e.slice(2)))));return a in _().spacing?4*a:void 0}function M(e){const{alt:t,AvatarIcon:n,children:a,className:r,width:o,height:i}=e;let l=A("w",r),c=A("h",r);l||c||i||o||console.error("Avatar must have a width or height defined in the className or as a prop");const{src:d,text:u}=function(e){let t=e.src,n=e.text;return e.team?(t=e.team.avatar||void 0,n=e.team.name):e.user&&(e.user.avatar?(t=e.user.avatar,n=e.user.firstName):n=e.user.firstName),{src:t,text:n}}(e);return d?e.expandable?(0,s.jsx)(I.P,{src:d,alt:t||"",trigger:e=>(0,s.jsx)(N,{className:r,onClick:e,children:(0,s.jsx)(k,{src:d,alt:t||"",width:l||o,height:c||i,fill:!(l||c||i||o)})})}):(0,s.jsx)(N,{className:r,children:(0,s.jsx)(k,{src:d,alt:t||"",width:l||o,height:c||i,fill:!(l||c||i||o)})}):n?(0,s.jsx)(N,{className:r,children:(0,s.jsx)(C,{children:(0,s.jsx)(n,{})})}):u?(0,s.jsx)(N,{className:r,children:(0,s.jsx)(C,{children:(m=u,m[0])})}):a?(0,s.jsx)(N,{children:a}):(0,s.jsx)(N,{className:r,children:(0,s.jsx)(C,{children:(0,s.jsx)(v.f,{})})});var m}const R=l.forwardRef(((e,t)=>{const{children:n,user:a,href:r}=e,o=r||"/user/".concat(null===a||void 0===a?void 0:a.slug);return(0,s.jsx)(i(),{ref:t,href:o,className:"cursor-pointer rounded-full",children:n})}));function E(e){var t;const{data:n}=(0,r.useSession)(),{className:o,...i}=e;return(null===(t=e.user)||void 0===t?void 0:t.id)&&e.linkToProfile&&n?(0,s.jsxs)(T,{children:[(0,s.jsx)(P,{asChild:!0,children:(0,s.jsx)("div",{className:"inline-block",children:(0,s.jsx)(R,{...i,children:(0,s.jsx)(M,{...i,className:o})})})}),(0,s.jsx)(a.E,{children:(0,s.jsx)(L,{className:"p-3 pb-6",children:(0,s.jsx)(f,{...i})})})]}):(0,s.jsx)(M,{...e})}R.displayName="AvatarLink"},55268:function(e,t,n){"use strict";n.d(t,{C:function(){return i},t:function(){return o}});var s=n(85893),a=n(12003),r=(n(67294),n(37174));const o=(0,a.j)("inline-flex items-center rounded-lg px-3 py-1 text-xs text-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border text-foreground border-accent bg-background dark:bg-background-10 font-semibold",active:"bg-accent-60 dark:bg-background-30 font-semibold",neutral:"bg-foreground-10 bg-opacity-10 font-normal"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:n,...a}=e;return(0,s.jsx)("div",{className:(0,r.cn)(o({variant:n}),t),...a})}},44886:function(e,t,n){"use strict";n.d(t,{Q$:function(){return d},Sf:function(){return c},oF:function(){return u}});var s=n(85893),a=n(67294),r=n(79381),o=n(44814),i=n(37174);var l=n(92395);function c(e){let{children:t,onClick:n,className:a,loading:o=!1}=e;return(0,s.jsxs)("div",{className:(0,i.cn)("bg-accent-60 dark:bg-background-30 text-foreground flex h-7 w-max cursor-default items-center justify-center rounded-md p-2 text-xs",a),children:[t,(0,s.jsx)(r.g,{active:o,className:"h-4 w-4",children:(0,s.jsx)(l.kLi,{className:"hover:text-accent ml-1 h-4 w-4 cursor-pointer text-inherit transition-colors",onClick:e=>null===n||void 0===n?void 0:n(e)})})]})}function d(e){let{open:t,children:n,placeholder:r}=e;return(0,s.jsx)(o.xo,{className:"w-full","aria-label":r,children:(0,s.jsxs)("div",{className:"border-background-20 grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-md border p-2 pl-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[0===a.Children.toArray(n).length&&(0,s.jsx)("p",{className:"text-foreground-10 h-7 leading-[1.8]",children:r}),n]}),t?(0,s.jsx)(l.y_Q,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"}):(0,s.jsx)(l.C26,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}function u(e){let{children:t,open:n,align:r,onInteractOutside:i,avoidCollisions:l
1=!0}=e;const{rect:c,elRef:d,updateRef:u}=function(){const e=(0,a.useRef)(null),[t,n]=(0,a.useState)(void 0);function s(){var t;n(null===(t=e.current)||void 0===t?void 0:t.getBoundingClientRect())}return(0,a.useEffect)((()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s))),[e,n]),{rect:t,elRef:e,updateRef:s}}(),[m,p]=(0,a.useState)(void 0);return(0,a.useLayoutEffect)((()=>{var e,t;u(),p(null!==(t=null===(e=d.current)||void 0===e?void 0:e.closest('[role="dialog"]'))&&void 0!==t?t:void 0)}),[n]),(0,s.jsx)("div",{ref:d,className:"relative",children:(0,s.jsx)(o.yk,{avoidCollisions:l,collisionPadding:8,onInteractOutside:i,className:"border-background-20 flex w-full min-w-min flex-col overflow-y-hidden border p-0",container:m,align:r,style:{width:null===c||void 0===c?void 0:c.width},children:t})})}},96109:function(e,t,n){"use strict";n.d(t,{di:function(){return p},e8:function(){return d},fu:function(){return m},mY:function(){return l},rb:function(){return u},sZ:function(){return c}});var s=n(85893),a=n(65309),r=n(67294),o=(n(51204),n(37174)),i=n(92395);const l=r.forwardRef(((e,t)=>{let{className:n,...r}=e;return(0,s.jsx)(a.mY,{ref:t,className:(0,o.cn)("bg-background dark:bg-background-10 text-foreground flex min-h-0 w-full flex-1 flex-col overflow-hidden rounded-md",n),...r})}));l.displayName=a.mY.displayName;const c=r.forwardRef(((e,t)=>{let{className:n,rightIcon:r,...l}=e;return(0,s.jsxs)("div",{className:"input flex shrink-0 items-center border px-3","cmdk-input-wrapper":"",children:[(0,s.jsx)(i.jVj,{className:"text-foreground-10"}),(0,s.jsx)(a.mY.Input,{ref:t,className:(0,o.cn)("placeholder:text-foreground-10 border-accent flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",n),...l}),r]})}));c.displayName=a.mY.Input.displayName;const d=r.forwardRef(((e,t)=>{let{className:n,...r}=e;return(0,s.jsx)(a.mY.List,{ref:t,className:(0,o.cn)("max-h-[min(310px,var(--radix-popover-content-available-height,310px))] min-h-0 flex-1 overflow-y-auto overflow-x-hidden",n),...r})}));d.displayName=a.mY.List.displayName;const u=r.forwardRef(((e,t)=>(0,s.jsx)(a.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e})));u.displayName=a.mY.Empty.displayName;const m=r.forwardRef(((e,t)=>{let{className:n,...r}=e;return(0,s.jsx)(a.mY.Group,{ref:t,className:(0,o.cn)("text-foreground [&_[cmdk-group-heading]]:text-foreground-10 overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",n),...r})}));m.displayName=a.mY.Group.displayName;r.forwardRef(((e,t)=>{let{className:n,...r}=e;return(0,s.jsx)(a.mY.Separator,{ref:t,className:(0,o.cn)("bg-border -mx-1 h-px",n),...r})})).displayName=a.mY.Separator.displayName;const p=r.forwardRef(((e,t)=>{let{className:n,...r}=e;return(0,s.jsx)(a.mY.Item,{ref:t,className:(0,o.cn)("aria-selected:bg-accent-60 dark:aria-selected:bg-background-30 aria-selected:text-foreground relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...r})}));p.displayName=a.mY.Item.displayName},44814:function(e,t,n){"use strict";n.d(t,{J2:function(){return l},xo:function(){return c},yk:function(){return u}});var s=n(85893),a=n(30709),r=n(12003),o=n(67294),i=n(37174);const l=a.fC,c=a.xz,d=(a.ee,(0,r.j)("animate-in data-[side=left]:animate-slideLeftAndFade data-[side=top]:animate-slideUpAndFade data-[side=bottom]:animate-slideDownAndFade data-[side=right]:animate-slideRightAndFade max-h-[var(--radix-popover-content-available-height)] z-[99] w-72 overflow-y-auto outline-none",{variants:{variant:{default:"bg-background dark:bg-background-10 rounded-md border p-4 shadow-md ",dark:"bg-foreground text-background rounded-md border p-4 shadow-md "}},defaultVariants:{variant:"default"}})),u=o.forwardRef(((e,t)=>{let{className:n,align:r="center",sideOffset:o=4,variant:l="default",...c}=e;return(0,s.jsx)(a.h_,{container:c.container,children:(0,s.jsx)(a.VY,{ref:t,align:r,sideOffset:o,className:(0,i.cn)(d({variant:l}),n),...c})})}));u.displayName=a.VY.displayName},70302:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});var s=n(85893),a=n(41664),r=n.n(a);const o=e=>{let{href:t,useNormalLink:n,children:a,className:o,disabled:i=!1,...l}=e;return i?(0,s.jsx)("span",{className:o,children:a}):n?(0,s.jsx)("a",{className:o,href:t,...l,children:a}):(0,s.jsx)(r(),{className:o,href:t,...l,children:a})}},82598:function(e,t,n){"use strict";async function s(e,t){const n="8976ab4a-9c7a-49b0-84a6a6e7a211-f2b1-4801";const s=new Headers({"Content-Type":"application/octet-stream",AccessKey:n}),a=await fetch(e,{method:"PUT",headers:s,body:t});if(!a.ok){const e=await a.text();throw new Error("Request failed: ".concat(a.status," - ").concat(e))}return a}
1async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"root";const n="657d3207-260c-4f2a-b60cadd1e9d3-d736-436d";if(!n)throw new Error("Bunny API Key is not found.");const s="https://video.bunnycdn.com/library/".concat(e,"/collections"),a=await fetch(s,{method:"GET",headers:{accept:"application/json",AccessKey:n}});if(!a.ok)throw new Error("Failed to fetch collections: ".concat(a.status));const r=await a.json(),o=r.items.find((e=>e.name===t));if(o)return o.guid;const i="https://video.bunnycdn.com/library/".concat(e,"/collections"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json",AccessKey:n},body:JSON.stringify({name:t})});if(!l.ok){const e=await l.text();throw new Error("Failed to create collection: ".concat(l.status," - ").concat(e))}const c=await l.json();return c.guid}async function r(e,t,n){const s="657d3207-260c-4f2a-b60cadd1e9d3-d736-436d";const a=new Headers({"Content-Type":"application/json",accept:"application/json",AccessKey:s}),r=JSON.stringify({title:t,collectionId:n}),o="https://video.bunnycdn.com/library/".concat(e,"/videos"),i=await fetch(o,{method:"POST",headers:a,body:r});if(!i.ok){const e=await i.text();throw new Error("Failed to create video entry: ".concat(i.status," - ").concat(e))}const l=await i.json();if(!l.guid)throw new Error("Failed to retrieve videoId (GUID) from the response.");return l.guid}async function o(e,t,n){const s="657d3207-260c-4f2a-b60cadd1e9d3-d736-436d";const a=new Headers({accept:"application/json",AccessKey:s}),r="https://video.bunnycdn.com/library/".concat(e,"/videos/").concat(t),o=await fetch(r,{method:"PUT",headers:a,body:n});if(!o.ok){const e=await o.text();throw new Error("Failed to upload video: ".concat(o.status," - ").concat(e))}}async function i(e){if(!(e instanceof File))return e;const t="image/heic"===e.type||"image/heif"===e.type,s=await async function(e){const t=["ftypheic","ftypmif1","ftypmsf1"],n="\x89PNG\r\n\x1a\n",s=await e.slice(0,12).arrayBuffer(),a=new Uint8Array(s),r=new TextDecoder("utf-8").decode(a);if("image/png"===e.type&&t.some((e=>r.includes(e))))return!0;if("image/png"===e.type&&r.startsWith(n))return!1;return!1}(e);if(!t&&!s)return e;try{const t=(await n.e(4838).then(n.t.bind(n,1616,23))).default,s=await t({blob:e,toType:"image/webp"}),a=Array.isArray(s)?s[0]:s,r=new File([a],e.name.replace(/(\.heic|\.heif)$/i,".webp"),{type:"image/webp"}),o=r.size>3145728?await async function(e){return new Promise(((t,n)=>{const s=new Image;s.onload=()=>{const a=document.createElement("canvas"),r=a.getContext("2d"),o=.8;a.width=s.width*o,a.height=s.height*o,null===r||void 0===r||r.drawImage(s,0,0,a.width,a.height);const i="image/webp";a.toBlob((s=>{if(!s)return void n(new Error("Image compression failed!"));const a=new File([s],e.name.replace(/\.png$/,"image/webp"===i?".webp":".png"),{type:i});t(a)}),i,.8)},s.src=URL.createObjectURL(e)}))}(r):r;return o}catch(a){throw new Error("Failed to convert HEIC file.")}}async function l(e,t){const n="657d3207-260c-4f2a-b60cadd1e9d3-d736-436d";const s=new Headers({accept:"application/json",AccessKey:n}),a="https://video.bunnycdn.com/library/".concat(e,"/videos/").concat(t,"/play?expires=0"),r=await fetch(a,{method:"GET",headers:s});if(!r.ok){const e=await r.text();throw new Error("Failed to fetch video details: ".concat(r.status," - ").concat(e))}return r.json()}async function c(e,t,n){const s="657d3207-260c-4f2a-b60cadd1e9d3-d736-436d";const a=new Headers({accept:"application/json",AccessKey:s}),r=new URL("https://video.bunnycdn.com/library/".concat(e,"/videos/").concat(t,"/thumbnail"));r.searchParams.set("thumbnailUrl",n);const o=await fetch(r.toString(),{method:"POST",headers:a});if(!o.ok){const e=await o.text();throw new Error("Failed to set thumbnail: ".concat(o.status," - ").concat(e))}return o.json()}n.d(t,{Hu:function(){return a},i2:function(){return s},nz:function(){return o},pU:function(){return l},qk:function(){return i},w_:function(){return r},zX:function(){return c}})},13500:function(e,t,n){"use strict";n.d(t,{v:function(){return a}});var s=n(86501);const a=async e=>{try{await navigator.clipboard.writeText(e),s.ZP.success("Comment link copied!")}catch(t){s.ZP.error("Unable to copy comment link")}}},24158:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var s=n(93162);const a=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tenant-users";if(!e||0===e.length)return!1;try{const a=(await n.e(7460).then(n.t.bind(n,57460,23))).default,r=new Blob([a.unparse(e)]),o=URL.createObjectURL(r);(0,s.saveAs)(o,"".concat(t,".csv"))}catch(a){return console.error("Error exporting to CSV:",a),!1}}},3134:function(e,t,n){"use strict";function s(e){const t=e.find((e=>e.startsWith("tenantId="))),n=e.find((e=>e.startsWith("tenantUserId=")));return{tenantId:null===t||void 0===t?void 0:t.split("=")[1],tenantUserId:null===n||void 0===n?void 0:n.split("=")[1]}}n.d(t,{V:function(){return s}})},34424:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});const s=e=>{if(!e||"string"!==typeof e)return!1;let t;try{t=new URL(e)}catch(s){return!1}if("https:"!==t.protocol)return!1;const n=t.hostname.toLowerCase();return!!new Set(["buy.stripe.com","billing.stripe.com","invoice.stripe.com","pay.stripe.com"]).has(n)&&(!t.username&&!t.password&&(!(!t.pathname||"/"===t.pathname)&&!/\s/.test(e)))}},54565:function(e,t,n){"use strict";n.d(t,{G:function(){return r}});var s=n(70385),a=n(69217);const r=e=>{let{children:t}=e;const n=(0,a.e)();return null!==(null===n||void 0===n?void 0:n.activeTeamId)?null:(null===n||void 0===n?void 0:n.role)===s.UserRole.ADMIN?t:null}},6343:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var s=n(33299),a=n(52435);const r=e=>{let{children:t,creatorId:n,teamId:r}=e;const{data:o}
1=(0,s.useSession)(),{data:i}=a.S.tenantUser.get.useQuery(void 0,{enabled:!!o});return i?r?i&&i.activeTeamId===r?t:null:i&&i.id===n?t:null:null}},35008:function(e,t,n){"use strict";n.d(t,{C:function(){return r},f:function(){return o}});var s=n(11163),a=n.n(s);function r(){window.self!==window.top&&(a().query.showAuth="true",a().replace(a()))}function o(){window.self!==window.top&&(delete a().query.showAuth,a().replace(a()))}},87486:function(e,t,n){"use strict";n.d(t,{HO:function(){return c},cT:function(){return i},uk:function(){return l}});var s=n(67294),a=(n(69217),n(25934)),r=n(82598),o=n(3134);async function i(e,t){let n=e;n=await(0,r.qk)(e);const{url:s,path:a}=d(n,t),o=await(0,r.i2)(s,n);if(201===o.status)return{secure_url:"".concat("https://indyriot-images.b-cdn.net","/").concat(a)};{const e=await o.text();throw new Error("Upload failed: ".concat(e))}}function l(e){const[t,n]=(0,s.useState)(!1);return{async uploadFile(t){n(!0);const s=await i(t,e);return n(!1),s},isUploading:t}}function c(e){const[t,n]=(0,s.useState)(!1);return{uploadMultipleFiles:async t=>{n(!0);try{const s=await async function(e,t){const n=e.filter((e=>void 0!==e));return await Promise.all(n.map((async e=>{let n=e;n=await(0,r.qk)(e);const{url:s,path:a}=d(n,t),o=await(0,r.i2)(s,n);if(201===o.status)return{secure_url:"".concat("https://indyriot-images.b-cdn.net","/").concat(a)};{const e=await o.text();throw new Error("Upload failed for file ".concat(n.name,": ").concat(e))}})))}(t,e);return s}catch(s){throw console.error("Error uploading multipe files:",s),s}finally{n(!1)}},isUploading:t}}function d(e,t){const n=e instanceof File&&(null===e||void 0===e?void 0:e.name)||"",s="".concat(Date.now(),"-").concat((0,a.Z)(),"-").concat(n);let r=s;if(null===t||void 0===t?void 0:t.length){const{tenantId:e,tenantUserId:n}=(0,o.V)(t);e&&n&&(r="".concat(e,"/").concat(n,"/").concat(s))}return{url:"https://".concat("se.storage.bunnycdn.com","/").concat("indyriot-images","/").concat(r),path:r}}},69217:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});var s=n(33299),a=n(52435);const r=()=>{const{data:e}=(0,s.useSession)(),{data:t}=a.S.tenantUser.get.useQuery(void 0,{enabled:!!e});return t}},51221:function(e){e.exports={"sbui-divider":"Divider_sbui-divider__BhkAG","sbui-divider-vertical":"Divider_sbui-divider-vertical__FKlCl","sbui-divider--light":"Divider_sbui-divider--light__7oECq","sbui-divider--no-text":"Divider_sbui-divider--no-text__mEiLR","sbui-divider--left":"Divider_sbui-divider--left__mlQBe","sbui-divider--right":"Divider_sbui-divider--right__cBCbS","sbui-divider--center":"Divider_sbui-divider--center__Z4BcV"}},91155:function(e){e.exports={embla:"Carousel_embla__MyysF",embla__viewport:"Carousel_embla__viewport__s7OK1",embla__container:"Carousel_embla__container__IKyZX",embla__slide:"Carousel_embla__slide__iNFeT",embla__slide__image:"Carousel_embla__slide__image__vFRTF",embla__slide__text:"Carousel_embla__slide__text__rfuew",embla__controls:"Carousel_embla__controls__lEwCj",embla__buttons:"Carousel_embla__buttons__HSlyJ",embla__button:"Carousel_embla__button__qkeH6",embla__button__svg:"Carousel_embla__button__svg__pjSy8","embla__button--prev":"Carousel_embla__button--prev__5WKmJ","embla__button--next":"Carousel_embla__button--next__TN3b_"}}}]);
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.