1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="99fce4df-89d6-4b5e-a71f-89a65618c4a4",e._sentryDebugIdIdentifier="sentry-dbid-99fce4df-89d6-4b5e-a71f-89a65618c4a4")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4637],{84637:(e,t,s)=>{s.r(t),s.d(t,{default:()=>V});var a=s(95155),l=s(12115),r=s(31507),n=s.n(r),o=s(89658),i=s(30069),c=s(5463),d=s(72953),m=s(6716);let h=["Mozart","Beethoven","Bach","Chopin","Vivaldi","Tchaikovsky","Schubert","Brahms","Handel","Haydn","Liszt","Ravel","Debussy","Strauss","Mahler","DvoÅ\xe1k","Mendelssohn","Clara (Schumann)","Fanny (Mendelssohn)","Monteverdi","Verdi","Puccini","Prokofiev","Shostakovich","Saint-Sa\xebns"],x=["Allegro","Andante","Brio","Dolce","Serene","Lively","Noble","Graceful","Jubilant","Vibrant","Playful","Radiant","Tranquil","Majestic","Bold","Gentle","Spirited","Harmonic","Melodic","Resonant","Soaring","Tender","Dreamy","Elegant","Dynamic"],u=e=>{let t=0;for(let s=0;s<e.length;s++)t=(31*t+e.charCodeAt(s))%1e6;let s=x[t%x.length],a=h[(t>>3)%h.length];return`${s} ${a}`},p=[],f=null;var g=s(58719);let b={Music:["\uD83C\uDFB5","\uD83C\uDFB6","\uD83C\uDFBC","\uD83C\uDFB9","\uD83C\uDFBB","\uD83C\uDFBA","\uD83C\uDFB7","\uD83E\uDD41","\uD83C\uDFB8","\uD83C\uDFA4"],Emotions:["\uD83D\uDE0D","\uD83E\uDD70","\uD83D\uDE0A","\uD83D\uDE0C","\uD83E\uDD29","\uD83D\uDE2D","\uD83D\uDE22","\uD83E\uDD7A","\uD83D\uDE34","\uD83E\uDD14"],Reactions:["\uD83D\uDC4F","\uD83D\uDC4D","\uD83D\uDC4E","â¤ï¸","\uD83D\uDC95","\uD83D\uDD25","â¨","\uD83D\uDCAB","â","\uD83C\uDF1F"],Classical:["\uD83C\uDFDBï¸","\uD83D\uDC51","\uD83C\uDFAD","\uD83C\uDF39","\uD83D\uDCDA","\uD83D\uDD6Fï¸","\uD83C\uDF77","\uD83C\uDFA8","\uD83D\uDDBCï¸","\uD83D\uDCDC"]},w=(0,l.memo)(({onSelect:e,setShowEmotePicker:t})=>(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("button",{className:"absolute right-1 top-0 w-3 h-3 text-stone_s1",onClick:()=>t(!1),children:(0,a.jsx)(g.A,{className:"w-3 h-3"})}),Object.entries(b).map(([t,s])=>(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("h4",{className:"text-sm font-medium",children:t}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-2.5",children:s.map(t=>(0,a.jsx)("button",{className:"h-10 w-10 max-w-10 text-[22px] p-0",onClick:()=>e(t),children:t},t))})]},t))]}));var j=s(1066),v=s(40294);let y=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M14.5 8c0-3.59-2.91-6.5-6.5-6.5S1.5 4.41 1.5 8s2.91 6.5 6.5 6.5 6.5-2.91 6.5-6.5ZM0 8a8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8 8 8 0 0 1-8-8Zm5.54 1.981C6.01 10.47 6.826 11 8 11s1.99-.531 2.46-1.019a.75.75 0 0 1 1.081 1.038A4.855 4.855 0 0 1 8 12.5a4.855 4.855 0 0 1-3.54-1.481A.75.75 0 0 1 5.54 9.98ZM4.5 6.5a.999.999 0 1 1 2 0 .999.999 0 1 1-2 0Zm6-1a.999.999 0 1 1 0 2 .999.999 0 1 1 0-2Z"})}),N=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M16.763.178a.84.84 0 0 1 1.072 1.072l-5.563 15.528a1.089 1.089 0 0 1-2.034.044L8.23 11.884a.99.99 0 0 1 .163-1.018l2.953-3.513a.476.476 0 0 0-.672-.672L7.163 9.628c-.285.238-.675.3-1.019.163L1.191 7.775a1.089 1.089 0 0 1 .044-2.034L16.763.178Z"})});var _=s(67117),k=s(37662);let S=(0,l.memo)(({socket:e,reply:t,setReply:s,inputTextRef:r,setMessages:n})=>{let[o,i]=(0,l.useState)(!1),[c,h]=(0,l.useState)(""),{user:x}=(0,k.G)(e=>e.authReducer),{COMMUNITY_GUIDELINES:b,COMMUNITY_GUIDELINES_VERSION:S}=(0,k.G)(e=>e.globalReducer),{toggleModalBaseWithName:M}=(0,_.A)(),{donationUrl:C}=(0,d.y)(),A=x?.display_name?.trim()?x?.display_name:u(x?.dynamoID??"0"),R=(0,l.useCallback)(()=>{let a=(()=>{let e=Date.now();if(f&&e<f){let t=Math.ceil((f-e)/1e3);return{allowed:!1,reason:`You have been muted for ${t} seconds.`}}return((p=p.filter(t=>e-t<3e4)).push(e),p.length>=6)?(f=e+6e4,p=[],{allowed:!1,reason:"You have been muted for 60 seconds."}):{allowed:!0}})(),l=c.trim();if(0===l.length||c.length>250)return;if(!a.allowed)return void n(e=>[...e,{id:"0001",auth0Sub:"0001",name:"Maestro",messageBody:a?.reason??"",avatar:"",reactions:{},isModerator:!0,reply:null,type:"warn",referenceTo:"public",sentAt:new Date}]);let r={name:A,messageBody:l,avatar:x?.picture||null,auth0Sub:x?.sub,hubspotId:x?.hubspotId,reactions:{},isModerator:!1,reply:t,type:null,referenceTo:"public",sentAt:new Date,role:x?.role||"default"};h(""),e.emit("message",r),s(null)},[t,c,x?.sub,e]);return(0,l.useEffect)(()=>{let e=r.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,138)+"px")},[c]),(0,a.jsx)(a.Fragment,{children:x?(0,a.jsx)(a.Fragment,{children:b===S?(0,a.jsxs)("div",{className:"relative",children:[t&&(0,a.jsxs)("div",{className:"flex w-full justify-between items-center bg-white shadow-[0_-1px_14px_0_rgba(0,0,0,0.08)] px-3 py-2 rounded-[10px_10px_0_0]",children:[(0,a.jsxs)("span",{className:"whitespace-nowrap mr-1 text-[11px] italic text-mineShaft font-normal leading-[normal]",children:["Replying to: ",(0,a.jsxs)("b",{className:"!not-italic !text-black",children:["@",t?.name]})]}),(0,a.jsx)("span",{className:"flex-1 overflow-hidden text-shaft text-ellipsis whitespace-nowrap text-xs font-normal leading-[normal]",children:t?.message}),(0,a.jsx)("button",{className:"ml-2 flex-shrink-0 text-stone_s1",onClick:()=>s(null),children:(0,a.jsx)(g.A,{width:"10px",height:"10px"})})]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 p-4 pt-3 pb-6 border-t border-stone_t2 relative bg-white",children:[(0,a.jsxs)("div",{className:"w-full relative text-[0px]",children:[(0,a.jsx)("textarea",{ref:r,value:c,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),R())},rows:1,placeholder:`${t?"Reply to @"+t?.name:"Share your thoughts"}`,className:`resize-none overscroll-contain w-full min-h-10 border px-3 py-2 pr-10 text-sm font-normal leading-[22px] rounded-lg border-solid transition ${c.length>250?"focus:outline-red border-red":"focus:outline-main border-stone_t2"}`}),(0,a.jsx)("button",{className:"flex items-center justify-center absolute right-[8px] bottom-[
110px] w-5 h-5 text-stone_t0 transition hover:text-stone_s1",onClick:()=>i(!o),children:(0,a.jsx)(y,{className:"aspect-square w-4 h-4"})}),(0,a.jsxs)("span",{className:`absolute right-0 -bottom-[19px] text-xs font-normal leading-[normal] ${c.length>250?"text-red":" text-stone_t0"}`,children:[c.length,"/250"]})]}),(0,a.jsx)("button",{onClick:R,className:"w-full btn btn-sm max-w-[40px] p-0 rounded-full",disabled:0===c.trim().length,children:(0,a.jsx)(N,{className:"aspect-square w-5 h-5 text-black"})}),C&&(0,a.jsx)(j.A,{href:C,"aria-label":"Donate",className:"w-full btn btn-sm btn-donate max-w-[40px] p-0 rounded-full",children:(0,a.jsx)(v.A,{className:"aspect-square w-5 h-5"})}),o&&(0,a.jsx)("div",{className:"absolute bottom-full left-0 w-full border-b p-3 pl-3 pr-1 py-2 bg-white max-h-[7.625rem] overflow-y-auto flex flex-col items-start border border-solid border-stone_t2",children:(0,a.jsx)(w,{onSelect:e=>{let t=r.current;h(t=>t+e+" "),i(!1),t?.focus()},setShowEmotePicker:i})})]}),c.length>250&&(0,a.jsx)("span",{className:"block text-[12px] -bottom-4 text-red left-4 max-w-[60%] h-5 relative -top-[22px]",children:"Youâve reached maximum amount of characters allowed per message"})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 p-4 pt-3 border-t border-stone_t2 relative",children:[(0,a.jsx)("p",{className:"text-center text-dune",children:"\uD83C\uDFBC Join our community of classical music lovers"}),(0,a.jsx)("button",{className:"btn w-full",onClick:()=>M({status:!0,name:m.MF.COMMUNITY_GUIDELINES,props:{}}),children:"Join the Conversation"}
1),C&&(0,a.jsxs)(j.A,{href:C,"aria-label":"Donate",className:"w-full btn btn-donate",children:[(0,a.jsx)("span",{children:"Support Classical California"}),(0,a.jsx)(v.A,{className:"aspect-square w-6 sm:w-4 h-6 sm:h-4"})]})]})}):(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 p-4 pt-3 border-t border-stone_t2 relative",children:[(0,a.jsx)("p",{className:"text-center text-dune",children:"\uD83C\uDFBC Join our community of classical music lovers"}),(0,a.jsx)("button",{className:"btn w-full",onClick:()=>M({name:m.gM.INTRO,props:{source:"live_chat"}}),children:"Login / Sign Up"}),C&&(0,a.jsxs)(j.A,{href:C,"aria-label":"Donate",className:"w-full btn btn-donate",children:[(0,a.jsx)("span",{children:"Support Classical California"}),(0,a.jsx)(v.A,{className:"aspect-square w-6 sm:w-4 h-6 sm:h-4"})]})]})})});var M=s(66195),C=s(73590),A=s.n(C),R=s(98500),E=s.n(R),I=s(98673),B=s(19159);let L=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M6 1.8c-1.515 0-2.728.69-3.611 1.511C1.51 4.127.924 5.101.645 5.77a.596.596 0 0 0 0 .462c.28.67.866 1.644 1.744 2.458C3.272 9.509 4.485 10.2 6 10.2c1.515 0 2.728-.69 3.611-1.511.878-.816 1.465-1.789 1.744-2.458a.596.596 0 0 0 0-.462c-.28-.669-.866-1.644-1.744-2.458C8.728 2.491 7.515 1.8 6 1.8ZM3.3 6a2.7 2.7 0 1 1 5.401.001A2.7 2.7 0 0 1 3.3 6ZM6 4.8a1.201 1.201 0 0 1-1.794 1.043 1.801 1.801 0 1 0 1.637-1.637c.099.174.157.377.157.594Z"})}),Z=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",...e,viewBox:"1 1 14 14",children:(0,a.jsx)("path",{fill:"#67686B",d:"M13.2 8A5.2 5.2 0 0 0 8 2.8 5.2 5.2 0 0 0 2.8 8 5.2 5.2 0 0 0 8 13.2 5.2 5.2 0 0 0 13.2 8ZM1.6 8a6.4 6.4 0 1 1 12.8 0A6.4 6.4 0 1 1 1.6 8Zm4.432 1.585c.375.39 1.028.815 1.968.815s1.592-.425 1.967-.815a.6.6 0 0 1 .865.83A3.884 3.884 0 0 1 8 11.6c-1.333 0-2.28-.61-2.833-1.185a.6.6 0 0 1 .865-.83ZM5.2 6.8a.8.8 0 1 1 1.598-.002A.8.8 0 0 1 5.2 6.8ZM10 6A.8.8 0 1 1 10 7.598.8.8 0 0 1 10 6Z"})}),D=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",...e,viewBox:"1 1 14 14",children:(0,a.jsx)("path",{fill:"#67686B",d:"M6 4.8v.6c0 .332.267.6.6.6H10a3.2 3.2 0 0 1 3.2 3.2c0 .382-.048.727-.13 1.038A3.599 3.599 0 0 0 9.6 7.6h-3c-.333 0-.6.267-.6.6v1.635L2.965 6.8 6 3.765V4.8Zm2 4h1.6a2.4 2.4 0 0 1 2.4 2.4c0 .433-.105.763-.238 1.005a1.542 1.542 0 0 1-.318.412c-.012.013-.025.023-.035.036a.665.665 0 0 0-.207.452c0 .272.22.492.492.492.07 0 .14-.014.203-.047a4.736 4.736 0 0 0 .785-.55c.755-.645 1.717-1.852 1.717-3.803a4.4 4.4 0 0 0-4.4-4.4H7.2v-2a.803.803 0 0 0-1.367-.567l-4 4a.801.801 0 0 0 0 1.132l4 4c.23.23.573.298.873.173A.796.796 0 0 0 7.2 10.8v-2H8Z"})}),O=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",...e,viewBox:"1 1 14 14",children:(0,a.jsx)("path",{fill:"#67686B",d:"M11.227 12.078 3.922 4.772a5.2 5.2 0 0 0 7.305 7.305Zm.848-.848A5.2 5.2 0 0 0 4.77 3.925l7.307 7.302-.002.003ZM1.6 8a6.4 6.4 0 1 1 12.8 0A6.4 6.4 0 1 1 1.6 8Z"})});var T=s(16680);let F=["\uD83C\uDFB5","â¤ï¸","\uD83D\uDC4D","\uD83D\uDE02","\uD83D\uDE2E","\uD83C\uDF89"],H=(0,l.memo)(({message:e,toggleReaction:t,setReply:s,toggleBlockUserById:l,showReactionPicker:r,setShowReactionPicker:n,messageIndex:o,moderatorRef:i})=>{let{user:c}=(0,k.G)(e=>e.authReducer),{COMMUNITY_GUIDELINES:d,COMMUNITY_GUIDELINES_VERSION:m}=(0,k.G)(e=>e.globalReducer),h=e?.auth0Sub===c?.sub,x=c?.display_name?.trim()?c?.display_name:u(c?.dynamoID??"0");return(0,a.jsx)(a.Fragment,{children:e?.type==="service"?(0,a.jsx)("div",{className:"text-center text-xs font-normal text-stone_s1 mb-1",children:e.messageBody}):(0,a.jsx)("div",{id:e?.id,className:"relative p-2 pl-0 pr-0 pb-0 rounded group mb-1",children:(0,a.jsxs)("div",{className:`flex items-start gap-3 relative w-full ${e?.isModerator&&(e?.type==="block"||e?.type==="warn")?"px-2 py-3 rounded-lg bg-gallery":""}`,children:[(0,a.jsx)(B.A,{role:e?.role,avatar:e?.avatar,name:e?.name,auth0Sub:e?.auth0Sub,isModerator:e?.isModerator,className:"relative left-1"}
1),(0,a.jsxs)("div",{className:"min-w-0 w-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 w-full justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 w-full h-7",children:[(0,a.jsx)("span",{className:"text-sm font-bold leading-[normal] text-dune",children:e?.name}),e?.isModerator&&(0,a.jsx)("span",{className:"flex justify-center items-center gap-1 bg-[#BEDAFF] px-2 py-0.5 rounded-[100px] text-[#074BA5] text-center text-[10px] font-normal leading-[normal] uppercase whitespace-nowrap",children:"AI Moderator"}),e?.auth0Sub===c?.sub&&(0,a.jsx)("span",{className:"flex justify-center items-center gap-1 bg-ivory px-2 py-0.5 rounded-[100px] text-main_s1 text-center text-[10px] font-normal leading-[normal] uppercase whitespace-nowrap",children:"YOU"}),e?.role==="host"&&e?.auth0Sub!==c?.sub&&(0,a.jsx)("span",{className:"flex justify-center items-center gap-1 bg-secondary px-2 py-0.5 rounded-[100px] text-mineShaft text-center text-[10px] font-normal leading-[normal] uppercase whitespace-nowrap",children:"Host"}),(0,a.jsx)("time",{className:"text-stone_s1 text-xs font-normal leading-[normal]",children:A()(e?.sentAt).format("hh:mm A")})]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 relative",children:[!e?.isModerator&&c&&d===m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"flex items-center justify-center w-7 h-7 opacity-0 group-hover:opacity-100 transition-opacity shadow-[0_0_3px_0_rgba(133,133,133,0.25)] rounded-[100px] md:opacity-100",onClick:()=>s({id:e.id,message:e.messageBody,name:e.name,auth0Sub:e.auth0Sub}),children:(0,a.jsx)(D,{})}),!h&&(0,a.jsx)("button",{className:"flex items-center justify-center w-7 h-7 opacity-0 group-hover:opacity-100 transition-opacity shadow-[0_0_3px_0_rgba(133,133,133,0.25)] rounded-[100px] md:opacity-100",onClick:()=>l({[e?.auth0Sub]:e?.name}),children:(0,a.jsx)(O,{})}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),n(r===e.id?"":e.id)},className:`flex items-center mr-2 justify-center w-7 h-7 opacity-0 group-hover:opacity-100 transition-opacity shadow-[0_0_3px_0_rgba(133,133,133,0.25)] rounded-[100px] ${r===e?.id&&"!opacity-100"} md:opacity-100`,children:(0,a.jsx)(Z,{})})]}),r===e?.id&&(0,a.jsx)("div",{className:`flex flex-col items-center absolute z-10 px-[7
1px] py-[4px] right-[3px] ${o>3?"bottom-[2.25rem]":"top-[2.25rem]"} h-fit bg-white shadow-[0_0_3px_0_rgba(133,133,133,0.25)] rounded-lg`,children:F.map(s=>(0,a.jsx)("button",{className:"rounded text-[16px] leading-4 transition-colors px-[4px] py-[5px]",onClick:()=>{t({id:e.id,reaction:{[s]:c?.sub}}),n("")},children:s},s))})]})]}),(0,a.jsxs)("div",{children:[e?.reply&&(0,a.jsxs)("a",{href:"#"+e?.reply?.id,className:"w-full block text-[11px] italic overflow-hidden text-ellipsis whitespace-nowrap bg-alabaster border-l border-stone_t0 px-2 py-0.5 rounded-[0_4px_4px_0]",children:["Replying to: ",(0,a.jsxs)("b",{className:"not-italic",children:["@",e?.reply?.name]})," ",(0,a.jsx)("span",{className:"not-italic text-xs font-normal leading-[normal]",children:e?.reply?.message})]}),e?.isModerator&&e?.type==="search"&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("span",{className:"block break-words whitespace-pre-wrap max-w-full text-sm font-normal leading-[normal] moderator-message mb-1 text-shaft",children:["Want to dig deeper? \xa0\uD83D\uDD0D\xa0\xa0",(0,a.jsx)(T.A,{searchTerm:e.messageBody||"",buttonText:"Letâs Search",messageId:e.id,moderatorRef:i,source:"live_chat"})]})}),e?.isModerator&&(e?.type==="block"||e?.type==="warn")&&(0,a.jsx)("span",{className:"flex items-center bg-white absolute -top-2 right-5 h-[17px] border border-gallery rounded-full",children:(0,a.jsxs)("span",{className:"text-stone_s0 relative text-[10px] font-medium flex items-center whitespace-nowrap px-2 py-0.5 uppercase",children:[(0,a.jsx)(L,{className:"mr-1"})," Only visible to you"]})}),e?.isModerator&&e?.type==="block"?(0,a.jsxs)("span",{className:"flex flex-col gap-3 break-words whitespace-pre-wrap max-w-full text-sm text-shaft font-normal leading-[normal]",children:[(0,a.jsx)("span",{children:e.messageBody}),(0,a.jsx)(E(),{href:I.Nb.HELP_CENTER,className:"inline-block link link-primary",children:"Please see Community Guidelines."}),(0,a.jsxs)("span",{className:"bg-[#FFF0F0] p-3 flex flex-col gap-3 rounded-lg",children:[(0,a.jsx)("span",{className:"flex justify-center w-fit items-center gap-1 bg-red px-2 py-0.5 rounded-[100px] text-white text-center text-[10px] font-normal leading-[normal] uppercase whitespace-nowrap",children:"blocked by ai"}),(0,a.jsxs)("span",{className:"text-[14px] leading-[normal] text-stone_s0 italic",children:["Reason for violation: ",e.actionReason]}),(0,a.jsxs)("span",{children:[(0,a.jsxs)("span",{className:"flex items-center gap-3 w-fit",children:[(0,a.jsx)("span",{className:"font-bold text-dune",children:x}),(0,a.jsx)("time",{className:"text-stone_s0 text-xs font-normal leading-[normal]",children:A()(e?.sentAt).format("hh:mm A")})]}),(0,a.jsx)("span",{className:"line-through text-shaft",children:e.userMessage})]})]})]}):(0,a.jsx)(a.Fragment,{children:"search"!==e.type&&(0,a.jsx)("span",{className:"block break-words whitespace-pre-wrap max-w-full text-sm font-normal leading-[normal] moderator-message mb-1 text-shaft",dangerouslySetInnerHTML:{__html:e?.messageBody??""}})})]}),!e?.isModerator&&c&&(0,a.jsx)("div",{className:"w-full flex items-center gap-1.5",children:(0,a.jsx)(()=>(0,a.jsx)(a.Fragment,{children:e?.reactions&&globalThis.Object.keys(e?.reactions)?.map((s,l)=>(0,a.jsx)("button",{className:"flex items-center",type:"button",onClick:()=>t({id:e.id,reaction:{[s]:c?.sub}}),children:(0,a.jsxs)("span",{className:`bg-alabaster flex justify-center items-center w-fit h-6 p-2 rounded-[100px] ${e?.reactions[s]?.find(e=>e===c?.sub)&&"!bg-[#FFF2E9]"}`,children:[s,(0,a.jsx)("span",{className:"text-stone_s1 text-[14px] ml-1",children:e?.reactions[s]?.length})]})},l))}),{})})]})]})})})}),P=(0,l.memo)(({messages:e,setMessages:t,socket:r,setReply:n,setIsAutoScroll:i,messagesEndRef:c,isAutoScroll:d,blockList:m,toggleBlockUserById:h})=>{let x=(0,l.useRef)(null),[u,p]=(0,l.useState)(""),f=(0,k.j)(),{addReportedModeratorMessageId:g}=M.GM.actions,b=(0,k.G)(e=>e.globalReducer.reportedModeratorMessageIds),w=(0,l.useRef)(null),j=(0,l.useRef)(new Map),v=(0,l.useCallback)(e=>
1{b.includes(e)||(f(g(e)),(0,o.U)({event:"internal_maestro_search_impression"}))},[b,f,g]);(0,l.useEffect)(()=>(w.current=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let t=e.target.dataset.messageId;t&&(v(t),w.current?.unobserve(e.target))}})},{root:x.current,threshold:.5}),j.current.forEach(e=>{w.current?.observe(e)}),()=>{w.current?.disconnect()}),[v]);let y=(0,l.useCallback)((e,t)=>{t?(j.current.set(e,t),w.current?.observe(t)):j.current.delete(e)},[]),N=(0,l.useCallback)(({id:e,reaction:t})=>{r.emit("toggleReaction",{id:e,reaction:t})},[r]),_=(0,l.useCallback)(()=>{let e=x.current;if(!e)return;i(e.scrollHeight-e.scrollTop-e.clientHeight<10);let t=t=>{let{scrollTop:s,scrollHeight:a,clientHeight:l}=e;(0===s&&t.deltaY<0||s+l>=a&&t.deltaY>0)&&t.preventDefault()};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[e]);return(0,l.useEffect)(()=>{d&&c?.current?.scrollIntoView({behavior:"smooth"})},[e,d]),(0,l.useEffect)(()=>{let e=x.current;if(!e)return;let t=()=>{e.scrollTop=e.scrollHeight};return s.g?.window?.addEventListener("resize",t),()=>s.g?.window?.removeEventListener("resize",t)},[]),(0,a.jsxs)("div",{ref:x,onScroll:_,onClick:()=>p(""),className:"flex-1 min-h-0 overflow-auto p-2 mb-2 scrollbar-display-none scroll-smooth",children:[e.map((s,l)=>!m.hasOwnProperty(s?.auth0Sub)&&!m.hasOwnProperty(s?.reply?.auth0Sub)&&(0,a.jsx)(H,{message:s,setMessages:t,toggleReaction:N,setReply:n,toggleBlockUserById:h,isLastMessage:l+1===e.length,showReactionPicker:u,setShowReactionPicker:p,messageIndex:l,moderatorRef:"search"===s.type?e=>y(s.id,e):void 0},l)),(0,a.jsx)("div",{ref:c})]})}),G=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e,viewBox:"0 0 20 20",children:[(0,a.jsx)("g",{clipPath:"url(#a)",children:(0,a.jsx)("path",{fill:"#201E1C",d:"M3 17v.25c0 .416.334.75.75.75s.75-.334.75-.75V17a4 4 0 0 1 4-4h1.544c.253-.55.584-1.056.984-1.5H8.5A5.5 5.5 0 0 0 3 17ZM6 6a4 4 0 1 0 8 0 4 4 0 0 0-8 0Zm1.5 0a2.5 2.5 0 1 1 4.999-.001A2.5 2.5 0 0 1 7.5 6Zm3.5 9.5a4.501 4.501 0 0 0 9 0 4.501 4.501 0 0 0-9 0Zm1.5 0c0-.556.153-1.075.416-1.522l4.106 4.103a2.965 2.965 0 0 1-1.522.419 3 3 0 0 1-3-3Zm1.478-2.584A3 3 0 0 1 18.5 15.5c0 .556-.156 1.075-.419 1.522l-4.103-4.106Z"})}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"a",children:(0,a.jsx)("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),$=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e,viewBox:"0 0 24 24",children:[(0,a.jsx)("g",{clipPath:"url(#a)",children:(0,a.jsx)("path",{fill:"#000",stroke:"#201E1C",d:"M7.064 9.644a.495.495 0 0 1 .702 0L12 13.877l.355-.353 3.88-3.88a.516.516 0 0 1 .714.002.495.495 0 0 1-.001.7l-4.591 4.59a.495.495 0 0 1-.702 0l-4.59-4.59a.495.495 0 0 1 0-.702Z"})}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"a",children:(0,a.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),U=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e,children:(0,a.jsx)("path",{fill:"#201E1C",d:"M4.347 16.834C3.124 15.323 2.4 13.44 2.4 11.4c0-4.969 4.298-9 9.6-9 5.303 0 9.6 4.031 9.6 9s-4.297 9-9.6 9c-1.368 0-2.67-.27-3.847-.75l-4.365 1.871a1.06 1.06 0 0 1-.431.079.955.955 0 0 1-.84-1.414l1.83-3.352ZM5.745 15.7c.458.566.53 1.354.18 1.995l-.675 1.241 2.194-.94a1.79 1.79 0 0 1 1.391-.012 8.345 8.345 0 0 0 3.162.615c4.417 0 7.8-3.33 7.8-7.2S16.417 4.2 12 4.2s-7.8 3.33-7.8 7.2c0 1.605.567 3.09 1.545 4.301Z"})});var z=s(85219);let V=(0,l.memo)(({showChat:e,toggleShowChat:t,setLastChatMessage:s})=>{let r=(0,k.j)(),{setCommunityGuidelines:d}=M.GM.actions,m=(0,l.useRef)(null),{user:h}=(0,k.G)(e=>e.authReducer),[x,u]=(0,l.useState)([]),[p,f]=(0,l.useState)(null),g=(0,l.useRef)(null),b=(0,l.useRef)(null),w=(0,z.x)(),[j,v]=(0,l.useState)(!1),y=(0,l.useRef)(null),[N,_]=(0,l.useState)(!0),[C,A]=(0,l.useState)(!1),[R,E]=(0,l.useState)(localStorage.getItem("BLOCK_LIST")?JSON.parse(localStorage.getItem("BLOCK_LIST")):[]),[I,B]=(0,l.useState)(!1),L=(0,l.useRef)(null),{communityGuidelines:Z}=(0,k.G)(e=>e.globalReducer);(0,l.useEffect)(()=>{let e=((e="")=>(0,i.io)("https://api.classicalcalifornia.org",{query:{auth0Sub:e},transports:["websocket"],withCredentials:!0,autoConnect:!0}))(h?.sub);return m.current=e,()=>{e.disconnect()}},[h]),(0,l.useEffect)(()=>{p&&b.current?.focus()},[p]),(0,l.useEffect)(()=>{let e=h?.sub??"guest";if(L.current===e)return;let t=h?.sub?`?auth0Sub=${encodeURIComponent(h.sub)}`:"";w({apiEndpoint:`https://api.classicalcalifornia.org/firebase/chat-history${t}`,method:"GET"}).then(t=>{u(t?.data),L.current=e}).catch(()=>null)},[w,h]),(0,l.useEffect)(()=>{h&&m?.current?.emit("identity",{user:h?.given_name})},[h]),(0,l.useEffect)(()=>{s(x[x.length-1]);let e=e=>{u(t=>{let s=[...t,e];return e?.auth0Sub===h?.sub&&(v(!0),(0,o.U)({event:"internal_chat_message_sent",message_length_char:e?.messageBody?.length??0,moderator_action:e?.moderatorAction??"",action_rule:e?.moderatorRule??"",HubSpot_id:h?.hubspotId??""})),e?.isModerator&&(0,o.U)({event:"internal_ai_message_displayed",message_length_char:e?.messageBody?.length??0,ai_message_type:e?.type??"",moderation_message:e?.messageBody??""}),s})};return m?.current?.on("message",e),()=>{m?.current?.off("message",e)}},[h]),(0,l.useEffect)(()=>{s(x[x.length-1])},[x]),(0,l.useLayoutEffect)(()=>
1{if(y.current)return I?j&&(y.current.scrollIntoView({behavior:"smooth"}),v(!1)):(y.current.scrollIntoView({behavior:"auto"}),B(!0)),()=>{B(!1)}},[x,j,e]),(0,l.useEffect)(()=>{let e=({id:e,reaction:t})=>{let s,a;if(t&&"object"==typeof t){let e=Object.keys(t);1===e.length?a=String(t[s=e[0]]):"emoji"in t&&(s=t.emoji,a=String(t.userId??t.auth0Sub))}s&&a&&u(t=>(t??[]).map(t=>{if(t.id!==e)return t;let l={...t.reactions||{}},r=l[s]?[...l[s]]:[],n=r.indexOf(a);return n>-1?(r.splice(n,1),r.length?l[s]=r:delete l[s]):l[s]=[...r,a],{...t,reactions:l}}))};return m?.current?.on("toggleReaction",e),()=>{m?.current?.off("toggleReaction",e)}},[m,h]);let D=(0,l.useCallback)(e=>{if(!e)return;let t=Object.keys(e)[0],s=e[t];if(!t)return;let a=localStorage.getItem("BLOCK_LIST"),l=a?JSON.parse(a):{};l[t]?delete l[t]:l[t]=s,E(l),localStorage.setItem("BLOCK_LIST",JSON.stringify(l))},[R]);return(0,l.useEffect)(()=>{h&&Z&&(u(e=>[...e,Z]),r(d(null)))},[h,Z,r,d]),(0,a.jsx)("div",{children:e&&(0,a.jsx)("div",{"data-gtm-chat-window":"true","data-user-status":h?.sub?"logged_in":"guest",ref:g,className:"flex flex-col fixed right-2 bottom-[5.5rem] z-[15] bg-white w-full max-w-[28rem] h-[62vh] max-h-[34rem] min-w-[18rem] min-h-[22rem] overflow-auto shadow-[0_3px_20px_0_rgba(0,0,0,0.20)] rounded-xl xs:right-0 md:bottom-[5.375rem] xs:bottom-[4.625rem]",children:(0,a.jsxs)("div",{className:"flex flex-col flex-1 overflow-auto",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start p-3 border-b border-stone_t2 mb-2",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("h2",{className:"flex items-center gap-3",children:[(0,a.jsx)(U,{}),(0,a.jsx)("span",{className:"text-2xl font-bold leading-[normal]",children:"Community Chat"})]}),(0,a.jsx)("div",{className:"ml-[2.25rem] uppercase text-[10px] font-medium bg-[#FCEAB1] text-mineShaft rounded-full px-2 py-[1px] w-fit whitespace-nowrap",children:"AI Moderated"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[Object.keys(R)?.length!==0&&(0,a.jsx)("button",{onClick:()=>A(!C),children:(0,a.jsx)(G,{})}),(0,a.jsx)("button",{onClick:()=>t(!e),children:(0,a.jsx)($,{})})]})]}),(0,a.jsx)(P,{socket:m?.current,messages:x,setMessages:u,setReply:f,isAutoScroll:N,setIsAutoScroll:_,messagesEndRef:y,toggleBlockUserById:D,blockList:R}),(0,a.jsx)(S,{socket:m?.current,reply:p,setReply:f,inputTextRef:b,setMessages:u}),C&&(0,a.jsxs)("div",{className:"absolute top-0 left-0 bottom-0 right-0 z-20 bg-white",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start p-3 border-b border-stone_t2 mb-2",children:[(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsxs)("h2",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{className:"cursor-pointer",onClick:()=>A(!R),children:(0,a.jsx)($,{className:"rotate-90"})}),(0,a.jsx)("span",{className:"text-2xl font-bold leading-[normal] text-dune",children:"Your Blocked List"})]})}),(0,a.jsx)("div",{className:"flex items-center gap-3"})]}),Object.keys(R)?.length===0&&(0,a.jsx)("div",{className:"w-auto absolute italic text-stone_s1 text-[10px] top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 ",children:"No blocked users"}),(0,a.jsx)("div",{className:"p-2",children:Object.keys(R)?.map(e=>(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-2 relative group",children:[(0,a.jsx)("div",{className:"rounded-full w-7 h-7 min-w-7 min-h-7 overflow-hidden",style:{backgroundColor:(0,c.A)(e)},children:(0,a.jsx)(n(),{name:R[e]||"",className:"rounded-full w-7 h-7 flex items-center justify-center font-extralight text-[1rem] text-white"})}),(0,a.jsx)("span",{className:"text-sm font-bold leading-[normal] text-dune",children:R[e]}),(0,a.jsx)("button",{className:"hidden text-sm font-medium leading-5 text-red group-hover:block md:block",onClick:()=>D({[e]:R[e]}),children:"Unblock"})]},e))})]})]})})})})}}]);
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.