/*! For license information please see main.d0bc6f9e.js.LICENSE.txt */ (()=>{var __webpack_modules__={67787:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/behance.1a39d1b87cbcffc24495310a1d5a4770.svg"},55227:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/dribbble.96aa35fe9d561f658e438e47c1b2c5c2.svg"},64125:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/facebook.2728600b3606fd416738af6ab6d25d6e.svg"},16442:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/globe-icon.13641ca0d1bfe06b5f4b73accac86430.svg"},71703:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/instagram.c4874259f6de104db298e0d1ee63b0d1.svg"},48044:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/left-arrow-icon.48269c30fc3078a910c44504f9c21fb4.svg"},89859:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/linkedin.e7fb297d7eb0cb628f5dbdbdf9aa5f7b.svg"},86285:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/pinterest.be98129b3866c0a1dd38bef2f39c62e0.svg"},10515:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/plus-gray-icon.63c5c56d936e7933ac2e61befe03b6b3.svg"},57321:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/plus-icon.24b386f770f41ca5af4c243f32a84d0b.svg"},8233:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/question-icon.b5cbb12c691d7be444be5fcba8a460e0.svg"},13629:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/quiz-option-correct-icon.bc1f0923d52bf58345a9be18b554661a.svg"},32922:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/quiz-option-icon.de78ad2e114684f7926e235d8f269ca6.svg"},54790:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/quiz-question-remove-icon.16d1978a9fec6235d10b5b9e5c347ec7.svg"},30881:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/send-message-icon.8a9a6a9e473c72a2388b1defe438042c.svg"},38298:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/twitter.c5f280fa97bc754c8fcff3001370baee.svg"},92704:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});n(20975);const r=n.p+"static/media/youtube.6d684aa9d70ab53db76700a0a6e13cb8.svg"},61592:()=>{},56455:()=>{},91965:()=>{},28836:(e,t,n)=>{"use strict";n.d(t,{B:()=>O,A:()=>R});var r=n(20975),o=n(31305),i=n(82993),s=n(47760),a=n(89449),l=n(16478),c=n(65186);function d(e){const[t,n]=(0,r.useState)(!1);(0,r.useEffect)((()=>{e&&"admin"===e.myRole&&!t&&(function(e,t,n){function r(){let e=t.getElementsByTagName("script")[0],n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://beacon-v2.helpscout.net",e.parentNode.insertBefore(n,e)}if(e.Beacon=n=function(t,n,r){e.Beacon.readyQueue.push({method:t,options:n,data:r})},n.readyQueue=[],"complete"===t.readyState)return r();e.attachEvent?e.attachEvent("onload",r):e.addEventListener("load",r,!1)}(window,document,window.Beacon||function(){}),window.Beacon("init","c8430dd6-2a64-4b61-962f-ed18a2da7ea4"),window.Beacon("config",{display:{style:"manual"}}),n(!0))}),[e,t])}var u=n(51772),p=n(43039),h=n(42414),m=n(31696),f=n(82256),g=n(62391);const b=(0,a.wj)((0,o.Ng)((e=>({user:e.auth,community:e.community})),(e=>(0,i.zH)({updateCommunity:h.Km},e)))((function(e){let{user:t,community:n,updateCommunity:o,addToast:i,web3Logout:s}=e;const[l,d]=(0,r.useState)(!1),u=null===n||void 0===n?void 0:n.id,{analyticsService:h}=(0,c.W)();return(0,r.useEffect)((()=>{n&&!("joined"in n)&&t&&"New User"!==t.name&&(d(!0),p.BE.getCommunityById(t,n.id).then((e=>{let{community:n}=e;n.joined?(d(!1),o(n)):p.BE.joinCommunity(t,n.id).then((e=>{let{community:t}=e;d(!1),h.track("subscribe-community",{communityPlan:t.plan?t.plan.planType:"free"}),o(t),i("Subscribed to "+t.name)})).catch((e=>{d(!1),console.log({error:e,message:"Subscribe to community failed!"}),i("Could not subscribe to "+n.name,"",a.lm.danger)}))})).catch((e=>{d(!1),console.log({error:e,message:"Loading community by id failed!"}),i("Could not load community by id "+n.name,"",a.lm.danger)})))}),[u,t]),(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background",children:[(0,g.jsx)(f.R,{}),n.joined?(0,g.jsxs)("div",{className:"flex flex-col items-center rounded bg-card p-12 pb-8",children:[(0,g.jsx)("img",{src:n.logo,alt:"",className:"w-72 rounded"}),(0,g.jsx)("div",{className:"my-4 text-center text-lg font-bold text-secondary-foreground/85",children:"Your membership is pending"}),(0,g.jsx)("div",{className:"w-72 text-center text-secondary-foreground/80",children:"You'll be notified if your request to join has been approved."}),(0,g.jsx)("div",{className:"my-8 h-0.5 w-full border-b border-border"}),(0,g.jsx)("div",{className:"theme-border-danger mt-4 flex w-64 cursor-pointer place-content-center border",children:(0,g.jsx)("button",{className:"w-full rounded-full px-4 py-2 text-alert",onClick:()=>{m.A.logout(n,s)},children:"Logout"})})]}):"Joining Community..."]})})));var v=n(55854),y=n(93591),k=n(64373),w=n(23277);function x(){return(0,g.jsxs)("div",{className:"h-screen w-full animate-pulse",children:[(0,g.jsx)("div",{children:(0,g.jsx)(k.A,{})}),(0,g.jsx)(y.g,{children:(0,g.jsxs)("div",{className:"AppContainer two-column h-screen w-full",children:[(0,g.jsx)("div",{className:"Sidebar",children:(0,g.jsx)(w.A,{})}),(0,g.jsxs)("div",{className:"flex flex-col space-y-2 px-4 sm:p-0",children:[(0,g.jsx)("div",{className:"h-96 w-full bg-card"}),(0,g.jsxs)("div",{className:"flex h-full space-x-2",children:[(0,g.jsx)("div",{className:"CommunityPostTab h-full w-full bg-card"}),(0,g.jsx)("div",{className:"hidden h-full w-1/3 bg-card xl:flex"})]})]})]})})]})}var _=n(78220),A=n(96621),C=n(16118),S=n(26914),j=n(77255),E=n(41153),N=n(93668);function P(e){if(!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))throw console.log("Could not parse Hex Color",{hex:e}),new Error("Could not parse Hex Color");e.startsWith("#")&&(e=e.slice(1));const t=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,r=parseInt(e.slice(4,6),16)/255,o=Math.max(t,n,r),i=Math.min(t,n,r),s=(o+i)/2;let a=0,l=0;if(o!==i){const e=o-i;switch(l=s>.5?e/(2-o-i):e/(o+i),o){case t:a=(n-r)/e+(nn.e(69).then(n.bind(n,99120)))),M=r.lazy((()=>Promise.all([n.e(687),n.e(534)]).then(n.bind(n,11534)))),T=r.lazy((()=>Promise.all([n.e(867),n.e(677),n.e(687),n.e(760)]).then(n.bind(n,70760)))),I=r.lazy((()=>n.e(248).then(n.bind(n,97248))));function O(e){let{community:t}=e;const{user:n}=(0,l.G)((e=>({user:e.auth})));const r=getComputedStyle(document.body).getPropertyValue("--theme-dark-primary-color");return t&&n&&r&&L(n),t?(0,g.jsx)("link",{rel:"stylesheet",href:A.C+"/theme/"+t.id+"/style.css",onLoad:e=>{L(n)}}):(0,g.jsx)(g.Fragment,{})}function L(e){var t,n,r,o=getComputedStyle(document.body);const i=o.getPropertyValue("--theme-background-color"),s="dark"===(null===e||void 0===e||null===(t=e.preferences)||void 0===t?void 0:t.themeChoice)?o.getPropertyValue("--theme-dark-primary-color"):o.getPropertyValue("--theme-primary-color"),a="dark"===(null===e||void 0===e||null===(n=e.preferences)||void 0===n?void 0:n.themeChoice)?o.getPropertyValue("--theme-dark-on-primary-color"):o.getPropertyValue("--theme-on-primary-color");let l;var c;["dark","light"].includes(null===e||void 0===e||null===(r=e.preferences)||void 0===r?void 0:r.themeChoice)?l="dark"===(null===e||void 0===e||null===(c=e.preferences)||void 0===c?void 0:c.themeChoice):l="#141519"===i;const d=P(s),u=P(a),p=d.l,h=d.h,m=d.s,f=p+50>=100?p+40>=100?p+30>=100?p+20>=100?p+10>=100?p:p+5:p+10:p+20:p+30:p+40,g="\n :root {\n --primary: ".concat(d.h+"deg,"+d.s+"%,"+d.l+"%, 100%",";\n --primary-light: ").concat(h+"deg ,"+m+"%,"+f+"%, 100%",";\n --primary-foreground: ").concat(u.h+"deg,"+u.s+"%,"+u.l+"%, 100%",";\n }\n ");document.head.insertAdjacentHTML("beforeend","")),localStorage.setItem("pensil.theme",l?"dark":"light"),document.documentElement.classList.toggle("dark",l)}const R=(0,o.Ng)((e=>({user:e.auth,community:e.community})),(e=>(0,i.zH)({setCommunity:h.Km,setCommunityPac:E.c,setUser:j.jw,updateGroupsByIds:N.tg},e)))((function(e){let{user:t,community:n,setUser:o,setCommunity:i,setCommunityPac:h,updateGroupsByIds:f}=e;const[y,k]=(0,r.useState)(!1),[w,A]=(0,r.useState)(!1),{analyticsService:j}=(0,c.W)(),[E,N]=((0,l.G)((e=>e.groups)),(0,r.useState)(!1)),[P,L]=(0,r.useState)(!1),[R,B]=(0,r.useState)(!1),z=window.location.hostname.split(".")[0],F=window.location.port,U=new URLSearchParams(window.location.search),V=U.get("redirect"),G=U.get("token"),H=U.get("auth_token"),W=U.get("access_token"),q=U.get("action"),[K,Y]=(0,r.useState)(!1),[$,Q]=(0,r.useState)(window.location.pathname);d(n);const Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"stocomo-community";return window.location.hostname.endsWith(C.pD)&&"app"!==e&&"embed"!==e?e:window.location.hostname}(z);(0,r.useEffect)((()=>{Z&&(k(!0),p.BE.getCommunity(Z).then((e=>{i(e.community),e.community.pac&&h(e.community.pac),j.track("load-community",{userType:null===t||void 0===t?void 0:t.role,communityPlan:e.community.plan?e.community.plan.planType:"free"})})).catch((e=>{if(console.log({err:e}),e.response&&e.response.data){const{data:t}=e.response;t.message}})).finally((()=>{A(!0),k(!1)})))}),[Z,i]),(0,r.useEffect)((()=>{n&&n.needsAdminVerification&&(!t||E||R||P||(L(!0),p.DL.getUserProfile({token:t.token}).then((e=>{let{user:r}=e;localStorage.setItem("pensil.user",JSON.stringify({...r,token:t.token,email:t.email?t.email:r.email,mobile:t.mobile?t.mobile:r.mobile})),Array.isArray(r.adminVerifiedCommunities)&&r.adminVerifiedCommunities.includes(n.id)&&N(!0),B(!0),L(!1),o({...r,token:t.token,email:t.email?t.email:r.email,mobile:t.mobile?t.mobile:r.mobile})})).catch((e=>{B(!0),L(!1),console.log({error:e}),m.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")}))))}),[n,t,E,R,P]),(0,r.useEffect)((()=>{const e=_.b6.listen(((e,t)=>{Q(window.location.pathname)}));return()=>{e()}}),[]);const J=null===n||void 0===n?void 0:n.authRedirectUrl,X=null===n||void 0===n?void 0:n.id;(0,r.useEffect)((()=>{J&&(H||W)&&(Y(!0),p.BE.verifyThirdPartyToken(X,null!==H&&void 0!==H?H:W).then((e=>{let{user:t}=e;localStorage.setItem("pensil.user",JSON.stringify(t)),o(t),window.location.href=window.location.origin+"?action="+q})).catch((e=>{Y(!1),console.log({message:"Failed loading user from token",err:e})})))}),[J,X,H,W,q]),(0,r.useEffect)((()=>{G&&ne()}),[G]);const ee=null===t||void 0===t?void 0:t.id,te=null===t||void 0===t?void 0:t.walletAddress;(0,r.useEffect)((()=>{ee&&X&&te&&async function(e){try{const{accessibleGroupIds:t}=await p.SP.checkForGatedGroupAccess(e);await f(t,{myRole:"user",joinStatus:"joined"},(e=>"admin"!==(null===e||void 0===e?void 0:e.myRole)))}catch(t){console.log("ERROR checkForGatedGroupAccess failed",t)}}(X)}),[ee,X,te]);const ne=()=>{p.DL.getUserProfile({token:G}).then((e=>{let{user:t}=e;localStorage.setItem("pensil.user",JSON.stringify({...t,token:G})),window.location.href=window.location.origin+"?action="+q})).catch((e=>{console.log({error:e}),m.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")}))};if(V&&t)return["google-login","facebook-login"].includes(q)?(localStorage.clear("pensil.user"),S.r.reset(),window.location.reload(),(0,g.jsx)("div",{children:"Redirecting..."})):(window.location.href=V+"?token="+t.token+"&action=autosub",(0,g.jsx)("div",{children:"Redirecting..."}));if("embed"===z)return(0,g.jsx)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:(0,g.jsx)(D,{})});if("localhost"===window.location.hostname||"app"===z&&"app.pensil.com"===window.location.hostname)return V&&"logout"===q?(localStorage.clear("pensil.user"),S.r.reset(),window.location.href=V,(0,g.jsx)("div",{children:"Redirecting..."})):(0,g.jsxs)("div",{className:"App",children:[(0,g.jsx)(O,{community:n}),t?(0,g.jsx)(r.Suspense,{fallback:(0,g.jsx)(x,{}),children:(0,g.jsxs)(s.$M,{children:[" ",(0,g.jsx)(T,{user:t,community:n})]})}):(0,g.jsx)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:(0,g.jsx)(I,{})}),(0,g.jsx)(a.q5,{})]});if("logout"===q)return localStorage.clear("pensil.user"),S.r.reset(),window.location.href=window.location.origin,(0,g.jsx)("div",{children:"Logging out..."});if(y||!w||K)return(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(v.A,{}),(0,g.jsx)("span",{className:"text-gray-500",children:"Please wait while we are loading data..."})]});if(!n)return(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)("span",{className:"mb-2 text-gray-500",children:"It seems like this community is not available."}),(0,g.jsx)("a",{className:"text-primary",target:"_blank",rel:"noopener noreferrer",href:"http://app.pensil.com"+(F?":"+F:"")+"/create-community",children:"Create your own"})]});if(G)return(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)("div",{className:"my-2",children:(0,g.jsx)(v.A,{})}),(0,g.jsx)("span",{className:"text-gray-500",children:"Please wait while we are loading data..."})]});if(t)G&&(window.location.href=window.location.origin+"?action="+q);else{if(n&&n.authRedirectUrl&&(H||W))return(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)("div",{className:"my-2",children:(0,g.jsx)(v.A,{})}),(0,g.jsx)("span",{className:"text-gray-500",children:"Please wait while we are loading data..."})]});if(G)return(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)("div",{className:"my-2",children:(0,g.jsx)(v.A,{})}),(0,g.jsx)("span",{className:"text-gray-500",children:"Please wait while we are loading data..."})]})}return!n.needsAdminVerification||!P&&R?n.needsAdminVerification&&!n.joinVerifiedByAdmin&&"admin"!==n.myRole?t?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(b,{})]}):(0,g.jsxs)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(I,{})]}):n.isLoginRequired&&!t?(0,g.jsxs)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(I,{})]}):!t||!n.isMobileAndEmailVerificationRequired||t.email&&t.mobile||"admin"===n.myRole?(0,g.jsxs)("div",{className:"App bg-background text-secondary-foreground/80",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:!$.startsWith("/login")&&!$.startsWith("/register")||t?(0,g.jsxs)(s.$M,{children:[" ",(0,g.jsx)(T,{user:t,community:n})]}):(0,g.jsx)(I,{})}),(0,g.jsx)(a.q5,{})]}):(0,g.jsxs)(r.Suspense,{fallback:(0,g.jsx)(u.aH,{}),children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(M,{user:t,community:n})]}):t?(0,g.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center bg-background text-secondary-foreground/90",children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)("div",{className:"my-2",children:(0,g.jsx)(v.A,{})}),(0,g.jsx)("span",{className:"text-gray-500",children:"Please wait while we are checking for admin verification..."})]}):(0,g.jsxs)(r.Suspense,{fallback:(0,g.jsx)(v.A,{}),children:[(0,g.jsx)(O,{community:n}),(0,g.jsx)(I,{})]})}))},16120:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(34458),o=n(62391);const i=e=>{let{openPortal:t,children:n}=e;const i=document.body;return(0,o.jsx)(o.Fragment,{children:t&&r.createPortal((0,o.jsx)(o.Fragment,{children:(0,o.jsx)("div",{children:n})}),i)})}},11052:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(5564),o=n.n(r),i=n(53871),s=n(19328),a=n(91900),l=n(62391);const c=function(e){let{onSubmit:t=(()=>{}),onCancelSubmit:n=(()=>{}),title:r,subTitle:c="",header:d,isLoading:u,active:p=!1,labelCancel:h="Cancel",labelSubmit:m="Yes, Go Ahead",btnColor:f,disabled:g=!1,setActive:b=(e=>{}),large:v=!1,className:y=""}=e;return(0,l.jsx)(a.a,{className:"CreateGroupModal",active:p,width:"390px",padding:!1,setActive:b,children:(0,l.jsxs)("div",{className:"px-5 py-8 text-secondary-foreground/85",children:[(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)(i.A,{children:r})}),c?(0,l.jsx)("div",{className:"mt-2 text-center text-xs font-semibold text-primary",children:c}):null,(0,l.jsx)("div",{className:"mt-5",children:(0,l.jsx)("div",{className:"mx-auto",children:u?(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(s.a,{})}):(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)("button",{disabled:g,className:o()("theme-bg-disable border-2 border-border font-semibold focus:outline-none"+y,{"rounded px-6 py-2":v,"rounded px-3 py-1":!v}),onClick:n,children:(0,l.jsx)(i.A,{children:h})}),(0,l.jsx)("button",{disabled:g,className:o()("border-2 border-primary bg-primary font-semibold text-primary-foreground focus:outline-none"+y,{"rounded px-6 py-2":v,"rounded px-3 py-1":!v}),onClick:t,children:(0,l.jsx)(i.A,{children:m})})]})})})]})})}},60553:(e,t,n)=>{"use strict";n.d(t,{W:()=>p,c:()=>h});var r=n(20975),o=n(34458),i=n(53871),s=n(58157),a=n(44139),l=n(90559),c=n(91900),d=n(62391);function u(e){let{onSubmit:t,title:n,header:r,isLoading:u,btnColor:p,children:h,active:m=!1,setActive:f=(e=>{}),buttons:g=[]}=e;const b=()=>{f(!1)};return m?o.createPortal((0,d.jsxs)(c.a,{className:"ActionModalComponent",active:m,width:"390px",padding:!1,setActive:f,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,d.jsx)("span",{className:"font-bold text-secondary-foreground/85",children:(0,d.jsx)(i.A,{children:r})}),(0,d.jsx)(l.A,{icon:"cross",size:"md",onClick:()=>{b()}})]}),(0,d.jsxs)("div",{className:"px-5 py-8 text-secondary-foreground/85",children:[h||(0,d.jsx)("div",{className:"text-center",children:(0,d.jsx)(i.A,{children:n})}),(0,d.jsx)("div",{className:"mt-5",children:(0,d.jsx)("div",{className:"mx-auto",children:(0,d.jsx)("div",{className:"flex space-x-4",children:null!==g&&void 0!==g&&g.length?g.map(((e,t)=>e.isFlat?(0,d.jsx)(s.A,{disabled:u,onClick:e.onClick,className:"mr-2 w-full border border-primary p-2",label:e.label},t):(0,d.jsx)(a.$,{onClick:e.onClick,isLoading:u,btnColor:p,className:"w-full p-2",label:e.label,large:!0},t))):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s.A,{disabled:u,onClick:b,className:"mr-2 w-full border border-primary p-2",label:"Cancel"}),(0,d.jsx)(a.$,{onClick:t,isLoading:u,btnColor:p,className:"w-full p-2",label:"Yes, Go Ahead",large:!0})]})})})})]})]}),document.body):(0,d.jsx)(d.Fragment,{})}function p(e){let{component:t,onSubmit:n=(e=>{}),header:o="",isLoading:i=!1,btnColor:s="red",children:a}=e;const[l,c]=(0,r.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{onClick:e=>{c(!0)},children:t||(a||(0,d.jsx)("span",{children:"Click me!"}))}),(0,d.jsx)(u,{active:l,setActive:c,onSubmit:()=>{n((()=>{c(!1)}))},header:o,isLoading:i,btnColor:s})]})}const h=u},1796:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=n(62391);const s={label:"Options",disabled:!1,value:"option1"};const a=function(e){var t;let{options:n=[],placeHolder:r="Please select an option",value:a=s,className:l="",disabled:c=!1,onChange:d=(()=>{})}=e;return(0,i.jsxs)("div",{className:"customDropdown relative z-10 inline-block text-left ".concat(l),children:[(0,i.jsxs)("button",{className:o()("inline-flex w-full items-center justify-between space-x-1 rounded-md border border-border px-4 py-2 text-sm font-medium leading-5 transition duration-150 ease-in-out",{"theme-bg-disable cursor-not-allowed text-secondary-foreground/80":c,"focus:shadow-outline-blue bg-card text-secondary-foreground hover:text-secondary-foreground/85 focus:border-primary focus:outline-none":!c}),type:"button",disabled:c,"aria-haspopup":"true","aria-expanded":"true",children:[(0,i.jsx)("span",{className:"text-left",children:null!==(t=null===a||void 0===a?void 0:a.label)&&void 0!==t?t:r}),(0,i.jsx)("svg",{className:"-mr-1 ml-2 h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]}),(0,i.jsx)("div",{className:"dropdown-menu invisible origin-top-right -translate-y-2 scale-95 transform opacity-0 transition-all duration-300",children:(0,i.jsx)("div",{className:"absolute right-0 z-50 mt-2 origin-top-right divide-y rounded-md border border-border bg-card shadow-lg outline-none",role:"menu",children:n.map(((e,t)=>(0,i.jsx)("div",{className:o()("flex border-border",{"cursor-not-allowed":e.disabled}),role:"menuitem",children:(0,i.jsx)("button",{disabled:e.disabled,onClick:t=>{d(e),t.currentTarget.blur()},className:o()("flex flex-grow items-center px-4 py-2 text-left",{"theme-bg-disabled cursor-not-allowed text-secondary-foreground/70":e.disabled,"hover:bg-theme-primary-lightest cursor-pointer hover:bg-background":!e.disabled}),children:(0,i.jsx)("span",{className:"text-sm font-medium",children:e.label})})},t)))})})]})}},53871:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(52853),o=n(62391);const i=(0,r.L)((function(e){var t,n;let{lang:r,children:i}=e;return i&&null!==i?"string"!==typeof i?(console.warn("I18 component only accepts string as children",i),i):null!==(t=null!==(n=r.trans(i))&&void 0!==n?n:i)&&void 0!==t?t:(0,o.jsx)(o.Fragment,{}):null!==i&&void 0!==i?i:(0,o.jsx)(o.Fragment,{})}))},68466:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var r=n(62391);function o(e){var t;let{selectedTab:n=null,components:o={}}=e;return n?null!==(t=o[n])&&void 0!==t?t:(0,r.jsx)("div",{className:"p-4 text-center",children:"There is nothing to view here."}):(0,r.jsx)(r.Fragment,{})}},53558:(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var r=n(13362),o=n(62391);function i(e){let{selectedTab:t,setSelectedTab:n=(e=>{}),tabs:i=[],className:s=""}=e;return(0,o.jsx)("div",{className:"tab-holder flex justify-start px-3 ".concat(s),children:i.map((e=>(0,o.jsx)(r.A,{onClick:r=>{t!==e.key&&n(e.key)},tab:e.label,selected:t===e.key},e.key)))})}},8934:(e,t,n)=>{"use strict";n.d(t,{Lw:()=>k,Yp:()=>y,eu:()=>b});var r=n(5564),o=n.n(r),i=n(72006),s=n.n(i),a=n(20975),l=n(31305),c=n(78220),d=n(18228),u=n(43039),p=n(97843),h=n(53871),m=n(1689),f=n(19328),g=n(62391);function b(e){let{user:t,extraInfo:n,hideNameOnMobile:r=!1,activityAvatar:i=!1,subCommentAvatar:s=!1,noPicture:l=!1,showSubtitle:c=!1,showDotSeperator:d=!1,noName:u=!1,tag:p=(0,g.jsx)(g.Fragment,{}),picture:h="picture",size:m=36,showDetailsOnHover:b=!1,onClick:y=(e=>{}),isProcessing:k=!1,className:w="",buttonLabel:x="",buttonOnClick:_=(e=>{}),notificationCount:A=0,bold:C=!1}=e;const[S,j]=(0,a.useState)(!1);return(0,g.jsxs)("div",{onClick:y,onMouseEnter:e=>{b&&!S&&j(!0)},onMouseLeave:e=>{b&&S&&j(!1)},className:o()("flex ".concat(l?"":"items-center"," justify-between"),w,{"hide-on-mobile":r}),children:[(0,g.jsxs)("div",{className:"flex ".concat(l?"":"items-center"),children:[l?(0,g.jsx)(g.Fragment,{}):(0,g.jsx)("div",{style:{backgroundImage:"url('"+(null===t||void 0===t?void 0:t[h])+"')",width:m+"px",height:m+"px",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",borderRadius:"50%",marginRight:"10px",flexShrink:0}}),(0,g.jsxs)("div",{className:"mt-1 flex-col",children:[(0,g.jsxs)("div",{className:"flex items-center gap-1",children:[u?(0,g.jsx)(g.Fragment,{}):(0,g.jsx)("div",{className:"name text-xs font-bold text-secondary-foreground",children:null===t||void 0===t?void 0:t.name}),p,A?(0,g.jsx)("span",{className:"update-marker",children:A}):(0,g.jsx)(g.Fragment,{}),d&&(0,g.jsx)("div",{className:"inline-block h-1 w-1 rounded-full bg-gray-400"}),!i&&(0,g.jsx)("div",{className:s?"extra-info text-xxs font-normal text-secondary-foreground/70":"text-xxs extra-info font-semibold text-secondary-foreground/70",children:n})]}),c?(0,g.jsx)("div",{className:"text-xxs -mt-0.5 font-light text-secondary-foreground",children:null===t||void 0===t?void 0:t.shortBio}):(0,g.jsx)(g.Fragment,{})]})]}),k?(0,g.jsx)(f.a,{}):(0,g.jsx)("div",{className:"text-sm font-semibold text-primary",onClick:e=>{_(e),e.preventDefault()},children:x}),b?(0,g.jsx)(v,{user:t,visibility:S}):(0,g.jsx)(g.Fragment,{})]})}const v=(0,l.Ng)((e=>({loggedInUser:e.auth})))((e=>{let{loggedInUser:t,user:n,visibility:r=!1}=e;const[i,s]=(0,a.useState)(null),[l,c]=(0,a.useState)(!0);return(0,a.useEffect)((()=>{u.DL.getUserProfileById(t,null===n||void 0===n?void 0:n.id).then((e=>{let{user:t}=e;s(t),c(!1)})).catch((e=>{console.error({error:e,message:"Could not load user detail in AvatarDetails"}),c(!1)}))}),[t,n]),(0,g.jsx)("div",{className:o()("Avatar details card flex items-center justify-between rounded bg-white px-5 py-3",{flex:r,hidden:!r}),children:l?(0,g.jsx)(f.a,{}):i?(0,g.jsxs)("div",{className:"flex items-center overflow-hidden",children:[(0,g.jsx)("div",{style:{backgroundImage:"url('"+(null===i||void 0===i?void 0:i.picture)+"')",width:"48px",height:"48px",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",borderRadius:"50%",marginRight:"12px",flexShrink:0}}),(0,g.jsxs)("div",{className:"extra-info-holder",children:[(0,g.jsx)("div",{className:"name font-bold text-secondary-foreground",children:null===i||void 0===i?void 0:i.name}),null!==i&&void 0!==i&&i.mobile?(0,g.jsxs)("div",{className:"extra-info text-xs font-semibold",children:[(0,g.jsx)("img",{src:"/assets/vectors/call-icon.svg",alt:"Call Icon"}),null===i||void 0===i?void 0:i.mobile]}):(0,g.jsx)(g.Fragment,{}),null!==i&&void 0!==i&&i.email?(0,g.jsxs)("div",{className:"extra-info text-xs font-semibold",children:[(0,g.jsx)("img",{src:"/assets/vectors/mail-icon.svg",alt:"Mail Icon"}),null===i||void 0===i?void 0:i.email]}):(0,g.jsx)(g.Fragment,{})]})]}):(0,g.jsx)("div",{className:"text-alert",children:"Data could not be loaded!"})})})),y=(0,l.Ng)((e=>({loggedInUser:e.auth})))((e=>{let{loggedInUser:t,user:n,noBG:r=!1}=e;const[i,s]=(0,a.useState)(null),[l,c]=(0,a.useState)(!0);return(0,a.useEffect)((()=>{u.DL.getUserProfileById(t,null===n||void 0===n?void 0:n.id).then((e=>{let{user:t}=e;s(t),c(!1)})).catch((e=>{console.error({error:e,message:"Could not load user detail in AvatarDetails"}),c(!1)}))}),[t,n]),(0,g.jsx)("div",{className:o()("Avatar detailed card flex items-center justify-between rounded px-5 py-3",{flex:!0,"bg-white":!r}),children:l?(0,g.jsx)(f.a,{}):i?(0,g.jsxs)("div",{className:"flex items-center overflow-hidden",children:[(0,g.jsx)("div",{style:{backgroundImage:"url('"+(null===i||void 0===i?void 0:i.picture)+"')",width:"48px",height:"48px",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",borderRadius:"50%",marginRight:"12px",flexShrink:0}}),(0,g.jsxs)("div",{className:"extra-info-holder",children:[(0,g.jsx)("div",{className:"name font-bold text-secondary-foreground",children:null===i||void 0===i?void 0:i.name}),(0,g.jsxs)("div",{className:"flex items-center",children:[null!==i&&void 0!==i&&i.mobile?(0,g.jsxs)("div",{className:"extra-info flex items-center text-xs font-semibold text-secondary-foreground/85",children:[null===i||void 0===i?void 0:i.countryCode," ",null===i||void 0===i?void 0:i.mobile]}):(0,g.jsx)(g.Fragment,{}),null!==i&&void 0!==i&&i.mobile&&null!==i&&void 0!==i&&i.email?(0,g.jsx)("div",{className:"px-1",children:"\u2022"}):(0,g.jsx)(g.Fragment,{}),null!==i&&void 0!==i&&i.email?(0,g.jsx)("div",{className:"extra-info flex items-center text-xs font-semibold text-secondary-foreground/85",children:null===i||void 0===i?void 0:i.email}):(0,g.jsx)(g.Fragment,{})]})]})]}):(0,g.jsx)("div",{className:"text-alert",children:(0,g.jsx)(h.A,{children:"Data could not be loaded!"})})})})),k=(0,l.Ng)((e=>({loggedInUser:e.auth})))((e=>{var t,n,r;let{user:i,post:a,tag:l,onClick:u=(e=>{})}=e;const{hideDate:f}=null!==(t=a.preferences)&&void 0!==t?t:{};return(0,g.jsx)("div",{className:o()("Avatar flex items-center justify-between rounded"),children:i?(0,g.jsxs)("div",{className:"flex items-center overflow-hidden",children:[(0,g.jsx)(m.A,{src:null===i||void 0===i?void 0:i.picture,onClick:u,className:"m-auto h-12 w-12 flex-shrink-0 cursor-pointer rounded-full object-cover"}),(0,g.jsxs)("div",{className:"extra-info-holder",children:[(0,g.jsxs)("div",{onClick:u,className:"name ml-2.5 flex cursor-pointer items-center whitespace-nowrap text-xs font-bold text-secondary-foreground/85",children:[null!==i&&void 0!==i&&i.name&&(null===i||void 0===i?void 0:i.name.length)>12?(null===i||void 0===i?void 0:i.name.substring(0,10))+"...":null===i||void 0===i?void 0:i.name,(0,g.jsx)("div",{className:"extra-info font-normal text-secondary-foreground/70",children:l})]}),(0,g.jsx)("div",{className:"text-xxs ml-2.5 line-clamp-1 text-secondary-foreground",children:p.A.hasValue(null===(n=a.createdBy)||void 0===n?void 0:n.shortBio)?null===(r=a.createdBy)||void 0===r?void 0:r.shortBio:" "}),(0,g.jsxs)("div",{onClick:()=>c.b6.push((0,d.x6)(a.group,a.tab)),className:"text-xxs text- ml-2.5 flex cursor-pointer text-secondary-foreground/70",children:[(0,g.jsx)(h.A,{children:"Posted in"}),(0,g.jsx)("span",{className:"ml-0.5 cursor-pointer hover:text-primary",children:a.tab&&a.tab.name?a.tab.name:""}),!f&&(0,g.jsxs)("div",{className:"flex",children:[(0,g.jsx)("div",{className:"ml-1 mt-1.5 inline-block h-1 w-1 rounded-full bg-gray-400"}),(0,g.jsx)("div",{className:"text-xxs ml-1 font-normal",children:a.createdAt&&s()(a.createdAt).fromNow().replace(" days ago","d ago").replace("an hour ago","1h ago").replace(" hours ago","h ago").replace(" weeks ago","w ago").replace(" minutes ago","m ago").replace(" seconds ago","s ago").replace(" months ago","mo ago").replace(" years ago","y ago")})]})]})]})]}):(0,g.jsx)("div",{className:"text-alert",children:(0,g.jsx)(h.A,{children:"Data could not be loaded!"})})})}))},74345:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(20975),o=n(89449),i=n(62270),s=n(43039),a=n(44139),l=n(86129),c=n(62391);function d(e){let{community:t="",addToast:n=null,activeProps:d=null,displayProps:u=null,createdById:p,blockCallback:h}=e;const m=(0,i.A)(),{active:f,setActive:g}=d,{displayClosePrompt:b,setDisplayClosePrompt:v}=u,[y,k]=(0,r.useState)("");return(0,r.useEffect)((()=>{b&&((""===y||window.confirm(m.trans("Are you sure you want to discard Block?")))&&(k(""),g(!1)),v(!1))}),[b]),(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(l.A,{visible:f,setVisible:g,hideHeader:!0,className:"CreatePost max-w-lg w-half flex flex-col bg-card max-h-[95vh] rounded p-5",children:[(0,c.jsxs)("div",{className:"flex flex-col mb-3 align-center justify-center w-half",children:[(0,c.jsx)("p",{className:"flex justify-center text-sm",children:"Are you sure you want to block the user?"}),(0,c.jsx)("p",{className:"flex justify-center text-xs text-gray-500 w-half",children:"You\u2019ll not be able to see any post, comment, reply or messages from this user. And they will also not be able to see your content."})]}),(0,c.jsxs)("div",{className:"flex justify-around",children:[(0,c.jsx)(a.$,{className:"my-4 flex-grow mr-2",label:"Cancel",btnColor:"gray",onClick:()=>{v(!0)}}),(0,c.jsx)(a.$,{className:"my-4 flex-grow ml-2",label:"Yes, Block",btnColor:"red",onClick:()=>{(async()=>{try{const e=await s.DL.blockPeer(t,p);if(console.log(typeof e),null===e)throw new Error("Blocking failed - Contact admin"+e.message);h(),n("Blocked successfully","",o.lm.success),k(""),g(!1)}catch(e){console.error("Blocking-error",e),n("Blocking failed - Contact admin","",o.lm.danger)}})()}})]})]})})}},4201:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{children:t,padding:n=!0,className:r="",style:s={},onClick:a=(e=>{})}=e;return(0,i.jsx)("div",{onClick:a,style:s,className:o()("Card rounded bg-background shadow "+r,{"p-4":n}),children:t})}},13041:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(20975),o=n(31305),i=n(78220),s=n(62731),a=n(43039),l=n(60553),c=n(62391);const d=(0,o.Ng)((e=>({community:e.community})))((function(e){let{community:t,checkForNonAdmin:n=!1,children:o}=e;const d=a.BE.checkIfCommunityActionShouldBeDisabled(t,n),[u,p]=(0,r.useState)(!1);if(!d)return o;const h=r.Children.map(o,(e=>r.cloneElement(e,{onClick:()=>{p(!0)}})));return d?(0,c.jsxs)("span",{className:"ExpiredActionPreventor",children:[h,(0,c.jsx)(l.c,{active:u,setActive:p,title:"Your plan has expired! Please Upgrade your community to paid plan.",header:"Plan Expired!",onSubmit:e=>{i.b6.push(s.s)}})]}):o}))},33740:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(20975),o=n(16478);const i=n.p+"static/media/main-logo.fb298aa6e8fc3010ff63d144d30f409d.svg";var s=n(62391);function a(e){var t,n;let{community:a=null,height:l=54,width:c=null,maxSize:d=!1,className:u=""}=e;const[p,h]=(0,r.useState)(!1),[m,f]=(0,r.useState)(),g=(0,o.G)((e=>e.auth)),b=null===g||void 0===g||null===(t=g.preferences)||void 0===t?void 0:t.themeChoice;return(0,r.useEffect)((()=>{if(a){var e;const t=null!==(e=document.documentElement.classList.contains("dark"))&&void 0!==e?e:"dark"===b;t&&"string"===typeof a.darkModeLogo?f(a.darkModeLogo):t&&!a.darkModeLogo||a.logo?f(a.logo):f(i)}else f(i)}),[a,b]),m&&!p?(0,s.jsx)("img",{src:m,className:"flex-shrink-0 rounded "+u,alt:a?(null===a||void 0===a?void 0:a.name)+" Logo":"Pensil Logo",style:{width:"auto",height:d?"auto":l+"px",maxWidth:"260px",maxHeight:d?l+"px":"auto"},onError:e=>{h(!0)}}):(0,s.jsx)("svg",{className:"flex-shrink-0 rounded "+u,style:{backgroundColor:"hsl(var(--primary))",width:"36px",height:"36px"},children:(0,s.jsx)("text",{x:"50%",y:"55%",fontSize:"21",fontWeight:"bold",textAnchor:"middle",fill:"hsl(var(--primary-foreground))",dominantBaseline:"middle",children:(v=null!==(n=null===a||void 0===a?void 0:a.name)&&void 0!==n?n:"Pensil",v.split(" ").map((e=>e[0])).slice(0,2).join("").toUpperCase())})});var v}},64451:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(51772),l=n(89449),c=n(48514),d=n(97843),u=n(8934),p=n(41146),h=n(1334),m=n(90559),f=n(91900),g=n(62391);function b(e){let{value:t,title:n,subtitle:r,subItems:i=[],updateItem:s=(e=>{}),selected:a=!1,onSelect:l=(e=>{})}=e;return(0,g.jsxs)("div",{className:o()("mb-3 cursor-pointer rounded border px-4 py-3 hover:border-primary",{"border-primary":a}),onClick:e=>{l(t)},children:[(0,g.jsxs)("div",{className:"flex",children:[(0,g.jsx)(h.s,{selected:a}),(0,g.jsxs)("div",{className:"ml-2 flex-grow",children:[(0,g.jsx)("div",{className:"font-semibold text-secondary-foreground",children:n}),r?(0,g.jsx)("div",{className:"mt-2 text-sm text-secondary-foreground/70",children:r}):(0,g.jsx)(g.Fragment,{})]})]}),a&&i.length>0?(0,g.jsx)("div",{className:"mt-2 border-t py-2",children:i.map((e=>(0,g.jsxs)("div",{className:"my-2",onClick:t=>{t.preventDefault(),s(e.value,!e.selected)},children:[(0,g.jsx)(p.S,{selected:e.selected}),(0,g.jsx)("div",{className:"ml-8 flex-grow",children:(0,g.jsx)("div",{className:"text-secondary-foreground/70 hover:text-secondary-foreground/80",children:e.label})})]},e.value+e.selected)))}):(0,g.jsx)(g.Fragment,{})]})}const v=(0,l.wj)((0,s.Ng)((e=>({community:e.community,user:e.auth,groups:e.groups})))((function(e){let{community:t,user:n,groups:r,activeGroup:o,selectedUser:s,updateGroupMember:p,updateSubscriber:h,unselectUser:v,addToast:y}=e;const[k,w]=(0,i.useState)(null),[x,_]=(0,i.useState)(null),[A,C]=(0,i.useState)(r.map((e=>({label:e.name,value:e.id})))),[S,j]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),P=t.id;(0,i.useEffect)((()=>{d.A.hasValue(r)&&!k&&C(r.map((e=>({label:e.name,value:e.id}))))}),[r,k]),(0,i.useEffect)((()=>{if(!E&&d.A.hasValue(A)){const e=A.map((e=>({...e,selected:!1})));C(e)}}),[s]),(0,i.useEffect)((()=>{s&&d.A.hasValue(r)&&!E&&(N(!0),c.W.getRole(P,s.id).then((e=>{let{user:t,selectedRole:n,groupRoles:r}=e;w(n),_(r)})).catch((e=>{console.log("RoleService.getRole failed",{err:e}),y("Failed to get role","",l.lm.danger)})).finally((()=>{N(!1),console.log("RoleService.getRole finally")})))}),[s,P,r]),(0,i.useEffect)((()=>{if(!k)return;const e=A.map((e=>{const t=x[e.value];return e.selected=t===k,{...e}}));C(e)}),[k]);const D=(0,i.useCallback)(((e,t)=>{const n=A.map((n=>n.value===e?{...n,selected:t}:{...n}));C(n)}),[A]);if(!s)return(0,g.jsx)(g.Fragment,{});const M=e=>{w(e)};return(0,g.jsxs)(f.a,{className:"bg-card",setActive:v,active:v,padding:!1,children:[(0,g.jsxs)("div",{className:"flex items-center justify-between bg-background py-2 pl-4 pr-2",children:[(0,g.jsx)("span",{className:"font-bold text-secondary-foreground",children:"Change Role"}),(0,g.jsx)(m.A,{hoverable:!0,icon:"cross",size:"xs",iconClass:"text-secondary-foreground/70 text-xs",onClick:()=>{v(!1)}})]}),(0,g.jsxs)("div",{className:"bg-card p-5 text-secondary-foreground",children:[(0,g.jsx)("div",{className:"rounded bg-background p-2",children:(0,g.jsx)(u.eu,{user:s,tag:(0,g.jsxs)("span",{className:"ml-1 text-xs",children:["\u2022 ",s.userId]}),extraInfo:[s.countryCode+"-"+s.mobile,s.email].join(" \u2022 ")})}),E?(0,g.jsxs)("div",{className:"flex h-full animate-pulse flex-col items-center justify-center gap-4",children:[(0,g.jsx)("div",{className:"theme-default-border h-32 w-full border bg-background"}),(0,g.jsx)("div",{className:"theme-default-border h-64 w-full border bg-background"}),(0,g.jsx)("div",{className:"theme-default-border h-24 w-full border bg-background"})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"py-6",children:[(0,g.jsx)(b,{title:"Super Admin",subtitle:"Super admin of community will have full access to the community settings",value:"superadmin",selected:"superadmin"===k,onSelect:M}),(0,g.jsx)(b,{title:"Group Admin",subtitle:"Admin of selected group can edit the group information and create, edit or delete Channel under selected groups.",subItems:A,updateItem:D,value:"admin",selected:"admin"===k,onSelect:M}),(0,g.jsx)(b,{title:"Group Moderator",subtitle:"Group Moderator can create or delete post, comment, reply & message in the group.",subItems:A,updateItem:D,value:"moderator",selected:"moderator"===k,onSelect:M}),(0,g.jsx)(b,{title:"User",value:"user",selected:"user"===k,onSelect:M})]}),(0,g.jsx)("div",{className:"my-5",children:(0,g.jsxs)("div",{className:"mx-auto flex items-center justify-between",children:[(0,g.jsx)(a.$n,{onClick:e=>{v(!1)},flat:!0,className:"",label:"Cancel",large:!0}),(0,g.jsx)(a.$n,{disabled:!k,onClick:e=>{e.preventDefault(),j(!0),c.W.updateRole(t.id,s.id,k,A.filter((e=>e.selected)).map((e=>e.value))).then((e=>{let{message:t,userRoleUpdateStatus:n}=e;o&&Object.keys(n).includes(o.id)&&(p({...s,groupRole:n[o.id]}),h({...s,groupRole:n[o.id]?n[o.id]:s.groupRole,communityRole:"superadmin"===k?"admin":"user"})),y(t)})).catch((e=>{console.error("submitForm ~ error:",e),y(e.message,"",l.lm.danger)})).finally((()=>{j(!1),v(!1)}))},className:"",label:"Save",large:!0,isLoading:S})]})})]})]})]})})))},23184:(e,t,n)=>{"use strict";n.d(t,{T$:()=>re});var r=n(5564),o=n.n(r),i=n(72006),s=n.n(i),a=n(20975),l=n(31305),c=n(71214),d=n(89449),u=n(65186),p=n(62270);const h=n.p+"static/media/image-icon.b39574bca63801d37ab252db6a52bec6.svg";var m=n(10515),f=n(8233),g=n(87573),b=n(34268),v=n(70924),y=n(53871),k=n(8934),w=n(44139),x=n(4201),_=n(13041),A=n(21788),C=n(54479),S=n(32679),j=n(71986),E=n(2016),N=n(54859),P=n(19328),D=n(91900),M=n(3622),T=n(57321),I=n(13629),O=n(32922),L=n(54790),R=n(1776),B=n(62391);const z={statement:"",options:["","","",""],answer:""};function F(e){let{errors:t,isPoll:n=!1,setIsPoll:r=(e=>{}),quizTitle:o="",setQuizTitle:i=(()=>{}),quizDuration:s=10,setQuizDuration:a=(()=>{}),quizInstruction:l="",setQuizInstruction:c=(()=>{}),quizQuestions:d=[],setQuizQuestions:u=(()=>{})}=e;const p=(e,t)=>{const n=[...d];n.splice(e,1,t),u(n)},h=e=>{const t=[...d];t.splice(e,1),u(t)};return(0,B.jsxs)("div",{className:"CreatePostQuiz mt-5",children:[(0,B.jsxs)("div",{className:"flex items-center justify-between bg-card p-4",style:{margin:"1rem -1rem"},children:[(0,B.jsx)("span",{children:"Toggle to Question"}),(0,B.jsx)(R.H,{selected:n,onClick:r})]}),(0,B.jsxs)("div",{style:{backgroundColor:"#F5F6F8",marginLeft:"-1rem",marginRight:"-1rem"},className:"px-4 pb-4 pt-6",children:[(0,B.jsx)("div",{className:"text-secondary-foreground/85",children:"Test Series"}),(0,B.jsxs)("div",{className:"mt-2",children:[(0,B.jsx)("input",{type:"text",placeholder:"Enter Test Title here",className:"block w-full rounded-lg bg-transparent px-4 py-3 focus:outline-none",value:o,onChange:e=>{i(e.target.value)}}),(0,B.jsx)(j.j,{error:t&&t.title})]})]}),d.map(((e,n)=>(0,B.jsxs)("div",{className:"my-5",children:[(0,B.jsx)(U,{index:n,question:e,updateQuestion:p,deleteQuestion:h}),(0,B.jsx)(j.j,{error:t&&t.questions&&t.questions[n]&&t.questions[n].statement}),(0,B.jsx)(V,{index:n,question:e,errors:t&&t.questions&&t.questions[n]&&t.questions[n].options,updateQuestion:p})]},n))),(0,B.jsx)("div",{className:"my-5",children:(0,B.jsxs)("button",{className:"flex items-center justify-center text-xs font-semibold text-primary focus:outline-none",onClick:e=>{(()=>{const e=[...d];e.push(z),u(e)})()},children:[(0,B.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full border border-primary",children:(0,B.jsx)("img",{src:T.A,alt:"Add question",width:"12px"})}),(0,B.jsx)("span",{className:"px-2",children:"Add Question"})]})}),(0,B.jsxs)("div",{style:{backgroundColor:"#F5F6F8",marginLeft:"-1rem",marginRight:"-1rem"},className:"flex px-4 pb-4 pt-6",children:[(0,B.jsxs)("div",{className:"w-2/3",children:[(0,B.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:"Instruction (Optional)"}),(0,B.jsx)("div",{className:"mr-4 mt-2",children:(0,B.jsx)("input",{type:"text",placeholder:"Enter Instruction here",className:"block w-full rounded-lg bg-transparent px-4 py-3 focus:outline-none",value:l,onChange:e=>{c(e.target.value)}})})]}),(0,B.jsxs)("div",{className:"w-1/3",children:[(0,B.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:"Duration"}),(0,B.jsx)("div",{className:"mt-2",children:(0,B.jsxs)("select",{type:"text",placeholder:"Enter Test Title here",className:"block w-full rounded-lg bg-transparent px-4 py-3 focus:outline-none",value:s,onChange:e=>{a(e.target.value)},children:[(0,B.jsx)("option",{value:5,children:"5 Mins"}),(0,B.jsx)("option",{value:10,children:"10 Mins"}),(0,B.jsx)("option",{value:20,children:"20 Mins"}),(0,B.jsx)("option",{value:30,children:"30 Mins"}),(0,B.jsx)("option",{value:40,children:"40 Mins"}),(0,B.jsx)("option",{value:60,children:"60 Mins"})]})})]})]})]})}function U(e){let{index:t,question:n,updateQuestion:r,deleteQuestion:o}=e;return(0,B.jsxs)("div",{className:"QuizQuestion",children:[(0,B.jsxs)("div",{className:"mb-4 flex",children:[(0,B.jsxs)("span",{className:"text-secondary-foreground/85",children:["Question ",t+1]}),0===t?(0,B.jsx)(B.Fragment,{}):(0,B.jsx)("img",{src:L.A,width:"20px",alt:"Quiz Option",className:"mx-2 cursor-pointer",onClick:e=>{o(t)}})]}),(0,B.jsx)("input",{type:"text",placeholder:"Enter Question",className:"block w-full rounded-lg border border-border px-4 py-3 hover:shadow focus:outline-none",value:n.statement,onChange:e=>{r(t,{...n,statement:e.target.value})}})]})}function V(e){let{index:t,question:n,errors:r,updateQuestion:o}=e;return(0,B.jsx)("div",{className:"QuizOptions my-2",children:n.options.map(((e,i)=>(0,B.jsxs)("div",{className:"QuizOption my-2",children:[(0,B.jsxs)("div",{className:"flex",children:[(0,B.jsx)("img",{src:e&&n.answer===e?I.A:O.A,width:"20px",alt:"Quiz Option",className:"cursor-pointer",onClick:r=>{o(t,{...n,answer:e})}}),(0,B.jsx)("input",{type:"text",placeholder:"Option "+(i+1),className:"ml-3 block w-full rounded-lg border border-border px-4 py-3 hover:shadow focus:outline-none",value:e,onChange:e=>{const r=[...n.options];r.splice(i,1,e.target.value),o(t,{...n,options:r})}})]}),(0,B.jsx)(j.j,{error:r&&r[i]&&r[i]})]},i)))})}var G=n(72613),H=n(54617),W=n(62144),q=n(60478);const K=a.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),Y=a.lazy((()=>Promise.all([n.e(439),n.e(972)]).then(n.bind(n,22972)))),$=new c.A;let Q=[];const Z=a.memo((function(e){let{images:t=[],setImages:n=(()=>{})}=e;return(0,B.jsx)("div",{className:"SelectedImagesPreview",children:(0,B.jsx)(G.f,{images:t.map(((e,t)=>URL.createObjectURL(e))),onDelete:e=>{const r=[...t];r.splice(e,1),n(r)}})})})),J=a.memo((function(e){let{videos:t=[],setVideos:n=(()=>{})}=e;return(0,B.jsx)("div",{className:"SelectedVideoPreview",children:t.map(((e,r)=>(0,B.jsxs)("div",{className:"SelectedVideo my-2",children:[(0,B.jsx)("video",{src:URL.createObjectURL(e),className:"w-full",controlsList:"nodownload"}),(0,B.jsx)("div",{onClick:e=>{const o=[...t];o.splice(r,1),n(o)},className:"remove",children:"\xd7"})]},r)))})}));function X(e){let{embedCode:t,setEmbedCode:n,group:r}=e;const[o,i]=(0,a.useState)(t),s=(0,p.A)();return r&&["admin","moderator"].includes(r.myRole)?o?(0,B.jsxs)("div",{className:"PostEmbedCode mt-5",children:[(0,B.jsx)("div",{className:"mb-1 text-secondary-foreground/80",children:(0,B.jsx)(y.A,{children:"Embed Code"})}),(0,B.jsx)("textarea",{rows:2,type:"text",value:t,onChange:e=>{n(e.target.value)},placeholder:s.trans("Paste your embed code here!"),className:"mt-2 block w-full flex-grow resize-none rounded border border-border bg-background bg-transparent px-2 focus:outline-none"})]}):(0,B.jsx)("span",{className:"cursor-pointer text-primary",onClick:e=>{i(!0)},children:(0,B.jsx)(y.A,{children:"Click here to add embed code."})}):(0,B.jsx)(B.Fragment,{})}function ee(e){let{document:t=null,setDocument:n=(e=>{}),uploadPercent:r=0}=e;return t?(0,B.jsxs)("div",{className:"SelectedDocumentPreview relative my-8",children:[(0,B.jsxs)("a",{download:!0,target:"_blank",rel:"noreferrer",href:"/#",title:"Open file",className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold",children:[(0,B.jsx)(W.A,{icon:"document",className:"h-9 text-3xl"}),(0,B.jsx)("div",{className:"flex flex-grow items-center justify-between space-x-4",children:(0,B.jsxs)("div",{className:"items-center",children:[(0,B.jsx)("div",{children:t.name}),(0,B.jsx)("div",{className:"text-xs uppercase",children:t.name.split(".").pop()})]})})]}),(0,B.jsx)("div",{onClick:e=>{n(null)},className:"remove",children:"\xd7"}),(0,B.jsx)(q.A,{percentComplete:r})]}):(0,B.jsx)(B.Fragment,{})}function te(e){let{title:t,community:n,images:r=[],setImages:o,videos:i=[],setVideos:s,document:l,setDocument:c,isLoading:d,setIsLoading:u,tabId:p,groupId:h,group:m,user:f,closeModal:g,isQuiz:b,setIsQuiz:v,isPoll:y,setIsPoll:k,canPost:w,createPost:x}=e,_=(0,a.useRef)(null),A=(0,a.useRef)(null);return(0,B.jsx)("div",{className:"CreatePostFooter mt-4 flex justify-between border-t border-border pt-3",children:(0,B.jsxs)("div",{className:"flex w-full justify-start",children:[(0,B.jsx)("input",{type:"file",className:"hidden",ref:_,onChange:e=>{e.target.files[0].type.startsWith("image/")&&o([...r,e.target.files[0]]),e.target.files[0].type.startsWith("video/")&&s([...i,e.target.files[0]])}}),(0,B.jsx)(E.A,{icon:"img",iconSmall:!0,label:"Image/Video",img:"/assets/images/create-post/media.png",className:"mx-1",onClick:e=>{_.current.click()}}),(0,B.jsx)("input",{type:"file",className:"hidden",ref:A,onChange:e=>{c(e.target.files[0])}}),(0,B.jsx)(E.A,{icon:"img",img:"/assets/images/create-post/attachment.png",iconSmall:!0,label:"Attachment",className:"mx-1",onClick:e=>{A.current.click()}}),(0,B.jsx)(E.A,{icon:"img",img:"/assets/images/create-post/quiz.png",iconSmall:!0,label:"Quiz",onClick:()=>{k(!y),v(!1)},className:"mx-1"})]})})}const ne=function(e){let{onSubmit:t,header:n,isLoading:r,active:o=!1,query:i,setQuery:s,tagsList:l,selectedTags:c,onSelectTags:d,setActive:u=(e=>{})}=e;const[h,g]=(0,a.useState)(!1);(0,p.A)(),(0,a.useEffect)((()=>{s("")}),[]);const b=()=>{s(""),u(!1)},v=(e,t)=>{s(""),d(e,t)};return(0,B.jsx)(D.a,{className:"CreateTagModal",active:o,width:"390px",padding:!1,setActive:u,children:(0,B.jsx)(C.A,{fallback:(0,B.jsx)(B.Fragment,{children:"CreateTagModal"}),children:(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,B.jsx)("span",{className:"font-bold text-secondary-foreground/85",children:(0,B.jsx)(y.A,{children:n})}),(0,B.jsx)(E.A,{icon:m.A,rotate:45,onClick:()=>b()})]}),(0,B.jsxs)("div",{className:"p-5 text-secondary-foreground/85",children:[(0,B.jsx)("div",{className:"rounded",children:(0,B.jsx)(H.k,{prefix:(0,B.jsx)("img",{src:f.A,alt:"",className:"search-tag-icon ml-2 bg-transparent",style:{filter:"opacity(0.5)",width:"18px"}}),noPrefixSeparator:!0,noBorder:!0,type:"text",validator:e=>{if(e.match(/\s/g))return g(!0),"Tag must not contain any spaces";g(!1)},validationOutsideBox:!0,placeholder:"Search for tags",value:i,noMargin:!0,onChange:e=>{s(e)},containerClassName:"py-2 bg-background focus:outline-none border border-border rounded mt-1"})}),(0,B.jsxs)("div",{className:"modal-body",children:[l?l.map(((e,t)=>(0,B.jsx)("div",{className:"flex rounded",children:c.includes(e.name)?(0,B.jsxs)("div",{className:"hover:theme-bg-disable flex cursor-pointer rounded-lg p-2",onClick:()=>v(e.name,t),children:[(0,B.jsx)("span",{className:"border-pensil-green flex h-5 w-5 items-center justify-center rounded-full border bg-success",children:(0,B.jsx)(W.A,{icon:"check",size:"xs",className:""})}),(0,B.jsx)("span",{className:"ml-4",children:e.name})]},t):(0,B.jsxs)("div",{className:"hover:theme-bg-disable flex cursor-pointer rounded-lg p-2",onClick:()=>v(e.name,t),children:[(0,B.jsx)("span",{className:"theme-bg-disable flex h-5 w-5 items-center justify-center rounded-full border border-border",children:(0,B.jsx)(W.A,{icon:"add",size:"xs",className:""})}),(0,B.jsx)("span",{className:"ml-4",children:e.name})]},t)},t))):"",0!==l.length||h?"":(0,B.jsxs)("div",{className:"flex items-center rounded",children:[(0,B.jsx)("span",{className:"tag-title ml-4",children:(0,B.jsx)(y.A,{children:"Create Tag"})}),(0,B.jsxs)("div",{onClick:()=>v(i),className:"ml-2 flex cursor-pointer rounded-lg p-2 hover:bg-background",children:[(0,B.jsx)("span",{className:"theme-bg-disable flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border",children:(0,B.jsx)(W.A,{icon:"add",size:"xs",className:""})}),(0,B.jsx)("span",{className:"tag-title ml-4",children:i})]})]})]})]}),(0,B.jsx)("div",{className:"search-tag-modal-footer bg-card",children:(0,B.jsx)("div",{className:"mx-auto flex",style:{justifyContent:"flex-end"},children:r?(0,B.jsx)("div",{className:"flex justify-center",children:(0,B.jsx)(P.a,{})}):(0,B.jsx)("div",{className:"flex-end",children:(0,B.jsx)(w.$,{onClick:b,className:"my-4 p-4",label:"Update"})})})})]})})})};(0,d.wj)((0,l.Ng)((e=>({community:e.community,user:e.auth})))((function(e){var t;let{community:n=null,groupId:r=null,group:i=null,tabId:l=null,user:c,compact:m=!1,addPost:f=(e=>{}),inlineButtonComponent:C=null,addToast:j}=e;const{analyticsService:E}=(0,u.W)(),[D,T]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[L,R]=(0,a.useState)(""),[U,V]=(0,a.useState)(""),[G,H]=(0,a.useState)(1),[oe,ie]=(0,a.useState)(""),[se,ae]=(0,a.useState)([]),[le,ce]=(0,a.useState)([]),[de,ue]=(0,a.useState)(null),[pe,he]=(0,a.useState)(null),[me,fe]=(0,a.useState)(0),[ge,be]=(0,a.useState)(0),[ve,ye]=(0,a.useState)(0),[ke,we]=(0,a.useState)(0),[xe,_e]=(0,a.useState)(!1),[Ae,Ce]=(0,a.useState)(""),[Se,je]=(0,a.useState)([]),[Ee,Ne]=(0,a.useState)([]),[Pe,De]=(0,a.useState)(!1),[Me,Te]=(0,a.useState)(""),[Ie,Oe]=(0,a.useState)(10),[Le,Re]=(0,a.useState)([z]),[Be,ze]=(0,a.useState)(""),[Fe,Ue]=(0,a.useState)(!1),[Ve,Ge]=(0,a.useState)(!1),[He,We]=(0,a.useState)(s()().add(12,"h")),[qe,Ke]=(0,a.useState)(!1),[Ye,$e]=(0,a.useState)(null),[Qe,Ze]=(0,a.useState)(!1),[Je,Xe]=(0,a.useState)(null),[et,tt]=(0,a.useState)(null),[nt,rt]=(0,a.useState)(null),[ot,it]=(0,a.useState)(null),[st,at]=(0,a.useState)(null),[lt,ct]=(0,a.useState)(null),[dt,ut]=(0,a.useState)({}),pt=0===L.length&&0===Ee.length&&0===Se.length&&0===U.length&&!Pe&&!Fe&&0===se.length&&0===le.length&&!de,ht=null===n||void 0===n?void 0:n.id;(0,a.useEffect)((()=>{ht&&D&&mt()}),[ht,D]),(0,a.useEffect)((()=>{ft()}),[Ae]);const mt=async()=>{let e=await v.K.getTagsBySearch(c,Ae,n.id);Q=e.tags,je(e.tags)},ft=async()=>{let e=[];Ae.length>0?(e=Se.filter((e=>e.name.toLowerCase().includes(Ae.toLowerCase()))),je(e)):je(Q)},gt=async(e,t)=>{let n=[...Ee],r=[...Se];n.includes(e)?(n=n.filter((t=>t!==e)),Ne(n)):0==r.filter((t=>t.name==e)).length?(r.unshift({name:e}),Q.unshift({name:e}),n.push(e),Ne(n),je(r)):(n.push(e),Ne(n))};function bt(){Xe(null),it(null),at(null),ct(null),tt(null),rt(null)}const vt=function(){(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||pt||window.confirm("Are you sure you want to discard current post?"))&&(R(""),V(""),ie(""),H(1),Ue(!1),Ge(!1),De(!1),Te(""),Re([z]),Ne([]),ae([]),ce([]),ue(null),he(null),fe(0),be(0),ye(0),we(0),$e(null),T(!1),bt(),ut({}))},yt=async e=>{try{var t;const e=U.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 "),o=null!==n&&void 0!==n&&null!==(t=n.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?U:$.turndown(e),a={title:L,description:o,groupId:r,embedCode:oe,tabId:l,notifyUsers:qe,tags:Ee,meta:{slug:(0,A.xx)(null===Je?(0,A.xx)(L):Je),title:(0,A.cT)(null===et?L:et),description:(0,A.cT)(null===nt?o:nt),openGraphTitle:(0,A.cT)(null===ot?L:ot),openGraphDescription:(0,A.cT)(null===st?o:st),openGraphImage:lt}};Pe&&(a.poll={isQuiz:!0,isQuestion:!1,title:Me,questions:Le,duration:Ie,endTime:s()().add(1,"month")}),Fe&&(a.poll={isQuiz:!1,isQuestion:Ve,title:Me,questions:Le,duration:Ie,endTime:He});const d=re(a,se,le,de);if($e(d),d)return;O(!0);let u=await v.K.createPost(c,a);se.length>0&&(u=await v.K.uploadImages(c,u.post.id,se,fe)),le.length>0&&(u=await v.K.uploadVideos(c,u.post.id,le,be)),de&&(u=await v.K.uploadDocument(c,u.post.id,de,we)),pe&&(u=await v.K.uploadCoverPicture(c,u.post.id,pe,ye)),f(u.post),g.A.logEvent(g.B.Post.name,g.B.Post.create),E.track("create-post",{userType:n.myRole,groupName:i.name,sectionName:l,postType:Pe?"quiz":Fe?"poll":de?"attachment":"none",notifyusers:qe,postid:u.post.id}),O(!1),j("Post added successfully!"),vt()}catch(o){O(!1),console.log({error:o}),o&&o.response&&o.response.data.errors&&o.response.data.errors.title&&ut({title:o.response.data.errors.title[0]}),j("Failed to create post. Please check post content and retry again. ","",d.lm.danger)}},kt=e=>{let{label:t=""}=e;return I?(0,B.jsxs)("div",{className:"mx-5 my-1",children:[" ",(0,B.jsx)(P.a,{})]}):(0,B.jsx)(w.$,{label:t||"Post",className:o()({"hidden md:block":!D}),disabled:pt,onClick:yt})},wt=(0,p.A)();return D?(0,B.jsxs)("div",{onClick:e=>{D?vt(!0):T(!0)},onKeyUp:e=>{"Escape"===e.key&&vt(!0)},className:o()("CreatePostCard",{active:D}),children:[(0,B.jsxs)(x.Z,{onClick:e=>{D&&e.stopPropagation()},children:[(0,B.jsxs)("div",{className:"flex items-start justify-between",children:[(0,B.jsx)("div",{className:"flex flex-grow",children:(0,B.jsx)(k.eu,{user:c,extraInfo:"now"})}),(0,B.jsx)(kt,{})]}),(0,B.jsxs)("div",{className:"my-2",children:[(0,B.jsx)(N.A,{picture:pe,setPicture:he,aspectRatio:16/9,recommendedRatio:"16:9",cropRatioMessage:"Picture ratio: 16:9",selectPictureComponent:(0,B.jsxs)("div",{className:"flex cursor-pointer select-none items-center space-x-2 bg-background px-2 pb-2 pt-4",children:[(0,B.jsx)("img",{src:h,alt:"post",className:"h-4 w-4"}),(0,B.jsx)("span",{className:"text-xs font-semibold text-secondary-foreground/80",children:(0,B.jsx)(y.A,{children:"Add Cover Picture"})})]})}),(0,B.jsx)(q.A,{percentComplete:ve})]}),(0,B.jsxs)("div",{className:"",children:[(0,B.jsx)("input",{className:"post-title w-full flex-grow bg-transparent py-1 text-lg font-semibold focus:outline-none md:px-2",onChange:e=>{R(e.target.value)},placeholder:wt.trans("Title (Optional)"),value:L}),(0,B.jsx)(S.S,{error:null===dt||void 0===dt?void 0:dt.title})]}),(0,B.jsx)(Z,{images:se,setImages:ae}),(0,B.jsx)(J,{videos:le,setVideos:ce}),(0,B.jsx)(q.A,{percentComplete:me}),(0,B.jsx)(q.A,{percentComplete:ge}),(0,B.jsx)("div",{className:"pb-2 pt-2",children:null!==n&&void 0!==n&&null!==(t=n.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?(0,B.jsx)(a.Suspense,{fallback:(0,B.jsx)(B.Fragment,{}),children:(0,B.jsx)(Y,{text:U,setText:V,getMentionsFeed:async e=>{const t=(await b.w.searchInCommunity(c,n.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return t}})}):(0,B.jsx)(a.Suspense,{fallback:(0,B.jsx)(B.Fragment,{}),children:(0,B.jsx)(K,{text:U,setText:V,className:"max-w-1/2",getMentionsFeed:async e=>{const t=(await b.w.searchInCommunity(c,n.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return t}})})}),(0,B.jsx)(X,{embedCode:oe,group:i,setEmbedCode:ie}),(0,B.jsxs)("div",{className:"tags-container items-center",children:[(0,B.jsxs)("div",{onClick:()=>_e(!0),className:"hover:theme-bg-disable flex cursor-pointer items-center rounded-[20px] px-2",children:[(0,B.jsx)("div",{className:"m-0 rounded px-2 py-1 font-bold text-secondary-foreground/70",children:(0,B.jsx)(y.A,{children:"Add Tags"})}),(0,B.jsx)("span",{className:"ml-2 flex h-5 w-5 items-center justify-center rounded-full border border-primary bg-primary",children:(0,B.jsx)(W.A,{icon:"plus",size:"xxs",className:"text-primary-foreground"})})]}),0===Ee.length&&Se?Se.slice(0,5).map(((e,t)=>(0,B.jsx)("div",{className:"ml-2 mt-2 flex items-center rounded-full px-2 py-1 text-xs text-primary-foreground ".concat(Ee.includes(e.name)?"bg-primary":"theme-bg-disable"),onClick:()=>gt(e.name),children:(0,B.jsx)("span",{className:"tag-title",children:e.name})},t))):Se.map(((e,t)=>(0,B.jsx)(B.Fragment,{children:Ee.includes(e.name)?(0,B.jsx)("div",{className:"ml-2 mt-2 flex items-center rounded-full px-2 py-1 text-xs text-primary-foreground ".concat(Ee.includes(e.name)?"bg-primary":"theme-bg-disable"),onClick:()=>gt(e.name),children:(0,B.jsx)("span",{className:"tag-title",children:e.name})},t):null})))]}),Pe?(0,B.jsx)(F,{errors:Ye&&Ye.poll?Ye.poll:null,isPoll:Fe,setIsPoll:e=>{De(!1),Ue(!0)},quizTitle:Me,setQuizTitle:Te,quizDuration:Ie,setQuizDuration:Oe,quizInstruction:Be,setQuizInstruction:ze,quizQuestions:Le,setQuizQuestions:Re}):(0,B.jsx)(B.Fragment,{}),Fe?(0,B.jsx)(M.Q,{errors:Ye&&Ye.poll?Ye.poll:null,isQuestion:Ve,setIsQuestion:Ge,isQuiz:Pe,setIsQuiz:e=>{De(!0),Ue(!1)},quizTitle:Me,setQuizTitle:Te,quizDuration:Ie,setQuizDuration:Oe,quizInstruction:Be,setQuizInstruction:ze,quizQuestions:Le,setQuizQuestions:Re,endTime:He,setEndTime:We}):(0,B.jsx)(B.Fragment,{}),(0,B.jsx)(ee,{document:de,setDocument:ue,uploadPercent:ke}),D?(0,B.jsx)(te,{title:L,community:n,images:se,setImages:ae,document:de,setDocument:ue,videos:le,setVideos:ce,isLoading:I,setIsLoading:O,tabId:l,groupId:r,group:i,user:c,closeModal:vt,isQuiz:Pe,setIsQuiz:De,isPoll:Fe,setIsPoll:Ue,canPost:pt,createPost:yt}):(0,B.jsx)(B.Fragment,{}),(0,B.jsxs)("div",{className:"item-center flex place-content-between",children:[(0,B.jsxs)("div",{onClick:()=>{Ze(!0)},className:"flex cursor-pointer items-center space-x-2 font-semibold text-secondary-foreground",children:[(0,B.jsx)(W.A,{icon:"settings",size:"xl",className:"mr-1 text-secondary-foreground/70"}),"Advanced Settings"]}),(0,B.jsx)(A.Ay,{community:n,active:Qe,setActive:Ze,slug:null===Je?(0,A.xx)(L):Je,slugPrefix:"p",setSlug:Xe,title:null===et?L:et,setTitle:tt,description:null===nt?$.turndown(U):nt,setDescription:rt,OGTitle:null===ot?L:ot,setOGTitle:it,OGDescription:null===st?$.turndown(U):st,setOGDescription:at,OGImage:lt,setOGImage:ct,OgImageSubtitle:"By default it will take up the image uploaded with the post",clearSlugMeta:bt})]})]}),xe?(0,B.jsx)(ne,{active:xe,setActive:_e,header:"Add Tags",query:Ae,setQuery:Ce,tagsList:Se,selectedTags:Ee,onSelectTags:gt}):(0,B.jsx)(B.Fragment,{})]}):m?(0,B.jsx)(_.A,{children:C?(0,B.jsx)("span",{onClick:e=>{D?vt(!0):T(!0)},children:C}):(0,B.jsx)(w.$,{label:"Create Post",className:o()({"flex-shrink-0":!D}),onClick:e=>{D?vt(!0):T(!0)}})}):(0,B.jsx)("div",{onClick:e=>{D?vt(!0):T(!0)},onKeyUp:e=>{"Escape"===e.key&&vt(!0)},className:o()("CreatePostCard",{active:D}),children:(0,B.jsx)(x.Z,{onClick:e=>{D&&e.stopPropagation()},children:(0,B.jsxs)("div",{className:"items-start justify-between md:flex",children:[(0,B.jsxs)("div",{className:"flex flex-grow",children:[(0,B.jsx)(k.eu,{user:{...c,name:""}}),(0,B.jsx)("input",{className:"post-title flex-grow py-1 text-xl font-semibold focus:outline-none md:px-2",onChange:e=>{R(e.target.value)},placeholder:wt.trans("Write Here"),value:L})]}),(0,B.jsx)(kt,{})]})})})})));function re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const o={};return e.title||e.description||e.poll||0!==t.length||0!==n.length||r||(o.description="Description or title is required!"),e.title.length>180&&(o.title="Title must be less than 180 characters"),e.poll&&(o.poll={},e.poll.isQuiz&&!e.poll.title&&(o.poll.title="Title is required!"),0===e.poll.questions.length?e.poll.questionsList="Atleast 1 question is required!":(o.poll.questions={},e.poll.questions.forEach(((t,n)=>{o.poll.questions[n]={},e.poll.questions[n].statement||(o.poll.questions[n].statement="Question statement is required!"),e.poll.questions[n].options.length<2?o.poll.questions[n].optionsList="Atleast 2 options are required!":(o.poll.questions[n].options={},e.poll.questions[n].options.forEach(((e,t)=>{e||(o.poll.questions[n].options[t]="Option is not valid!")})),0===Object.keys(o.poll.questions[n].options).length&&delete o.poll.questions[n].options),(e.poll.isQuiz||e.poll.isQuestion)&&(e.poll.questions[n].options.includes(e.poll.questions[n].answer)||(o.poll.questions[n].answer="Please select a valid answer!")),0===Object.keys(o.poll.questions[n]).length&&delete o.poll.questions[n]})),0===Object.keys(o.poll.questions).length&&delete o.poll.questions),0===Object.keys(o.poll).length&&delete o.poll),0===Object.keys(o).length?null:o}},84983:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(20975),o=n(89449),i=n(53871),s=n(90559),a=n(91900),l=n(54617),c=n(62144),d=n(62391);const u=(0,o.wj)((function(e){let{link:t="",active:n=!1,setActive:o=(e=>{}),addToast:u}=e;const[p,h]=(0,r.useState)("200");return(0,d.jsxs)(a.a,{active:n,setActive:o,padding:!1,className:"EmbedLinkModal",children:[(0,d.jsxs)("div",{className:"py- flex items-center justify-between bg-card pl-4 pr-2",children:[(0,d.jsx)("span",{className:"font-bold text-secondary-foreground/85",children:(0,d.jsx)(i.A,{children:"Embed"})}),(0,d.jsx)(s.A,{icon:"cross",size:"md",onClick:()=>{o(!1)}})]}),(0,d.jsxs)("div",{className:"p-5",children:[(0,d.jsxs)("div",{className:"mb-2",children:[(0,d.jsx)(i.A,{children:"Just copy paste this code wherever you want it to be embedded"}),":"]}),(0,d.jsxs)("div",{className:"flex items-center",children:[(0,d.jsxs)("span",{className:"font-semibold",children:[(0,d.jsx)(i.A,{children:"Height"}),":"]}),(0,d.jsx)("div",{className:"flex-grow pl-3 pr-1",children:(0,d.jsx)(l.k,{placeholder:"Height",defaultValue:p,className:"bg-card",validator:e=>/^(\d)+$/g.test(e)?"":"Height can only be a number",onChange:e=>{/^(\d)+$/g.test(e)&&h(e)}})}),(0,d.jsx)("span",{className:"font-semibold",children:"px"})]}),(0,d.jsxs)("pre",{className:"relative mb-2 overflow-y-auto border border-border bg-card p-2 text-primary",children:[(0,d.jsx)("code",{children:'\n')}),(0,d.jsx)("div",{onClick:()=>{const e=document.createElement("textarea");e.value='\n '),document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),u("Copied to clipboard")},className:"theme-bg-disable t absolute right-2 top-2 cursor-pointer rounded px-2 py-1 text-secondary-foreground",children:(0,d.jsx)(c.A,{icon:"copy",size:"sm"})})]}),(0,d.jsxs)("div",{className:"mb-2 font-semibold",children:[(0,d.jsx)(i.A,{children:"Preview"}),":"]}),(0,d.jsx)("embed",{height:"".concat(p,"px"),width:"100%",src:t,className:"w-full",type:"text/html"})]})]})}))},54479:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(20975),o=n(62391);class i extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.log(e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,o.jsx)("h1",{children:"Something went wrong."}):this.props.children}}},32679:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(62391);function o(e){let{error:t="",textCenter:n=!1}=e;return(0,r.jsx)("div",{className:"text-sm text-alert "+(n?"text-center":""),children:t})}},57032:(e,t,n)=>{"use strict";n.d(t,{u:()=>K});var r=n(41745),o=n(31012),i=n(20975),s=n(73159),a=n.n(s),l=(n(56455),n(31305)),c=n(82993),d=n(34067),u=n(71214),p=n(89449),h=n(65186),m=n(62270),f=n(8233),g=n(13362);const b="meeting",v="webinar";var y=n(43039),k=n(42498),w=n(11052),x=n(53871),_=n(8934),A=n(44139),C=n(90663),S=n(21788),j=n(41146),E=n(90559),N=n(54859),P=n(19328),D=n(91900),M=n(54617),T=n(62391);const I=["#f97316","#8b5cf6","#06b6d4","#10b981","#ef4444","#f59e0b","#3b82f6","#ec4899","#14b8a6","#6366f1"];function O(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").slice(0,2).map((e=>e[0])).join("").toUpperCase()}function L(){const e=[...arguments.length>0&&void 0!==arguments[0]?arguments[0]:""].reduce(((e,t)=>e+t.charCodeAt(0)),0)%I.length;return I[e]}function R(e){let{picture:t,name:n}=e;return t&&"null"!==t?(0,T.jsx)("div",{style:{backgroundImage:"url('".concat(t,"')"),width:"36px",height:"36px",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",borderRadius:"50%",marginRight:"10px",flexShrink:0}}):(0,T.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"50%",marginRight:"10px",flexShrink:0,backgroundColor:L(n),display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"12px",fontWeight:"600"},children:O(n)})}const B=function(e){var t,n;let{user:r,eventToUpdate:o={}}=e;const[s,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(!1),d=null===o||void 0===o||null===(t=o.liveCall)||void 0===t?void 0:t.meetingId,u=null===o||void 0===o?void 0:o.community;return(0,i.useEffect)((()=>{d&&u&&(c(!0),k.U.getMeetingAttendance(r,d,u).then((e=>a(e))).catch(console.error).finally((()=>c(!1))))}),[d,u]),d?l?(0,T.jsx)("div",{className:"py-6 text-center text-sm text-secondary-foreground/60",children:(0,T.jsx)(x.A,{children:"Loading attendance..."})}):(0,T.jsxs)("div",{className:"w-full overflow-hidden",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between px-3 py-1",children:[(0,T.jsxs)("div",{className:"pl-2 font-semibold",children:[null!==(n=null===s||void 0===s?void 0:s.totalJoined)&&void 0!==n?n:0," ",(0,T.jsx)(x.A,{children:"Joined"})]}),(null===s||void 0===s?void 0:s.totalJoined)>0&&(0,T.jsx)("button",{onClick:()=>{k.U.exportAttendanceCSV(r,d,u).catch(console.error)},className:"font-bold text-primary",children:(0,T.jsx)(x.A,{children:"Download CSV"})})]}),s&&0!==s.totalJoined?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("div",{className:"mt-2 h-80 overflow-auto",children:(0,T.jsxs)("table",{className:"w-full text-sm",children:[(0,T.jsx)("thead",{className:"sticky top-0 bg-card border-b border-border",children:(0,T.jsxs)("tr",{className:"font-semibold",children:[(0,T.jsx)("th",{className:"px-4 py-3 text-left",children:(0,T.jsx)(x.A,{children:"Member"})}),(0,T.jsx)("th",{className:"w-24 px-4 py-3 text-center",children:(0,T.jsx)(x.A,{children:"Role"})}),(0,T.jsx)("th",{className:"w-24 px-4 py-3 text-center",children:(0,T.jsx)(x.A,{children:"Joined At"})})]})}),(0,T.jsx)("tbody",{children:s.participants.map(((e,t)=>(0,T.jsxs)("tr",{className:"border border-border",children:[(0,T.jsx)("td",{className:"px-4 py-3",children:(0,T.jsxs)("div",{className:"flex items-center",children:[(0,T.jsx)(R,{picture:e.picture,name:e.name}),(0,T.jsxs)("div",{className:"min-w-0",children:[(0,T.jsx)("div",{className:"font-semibold",children:e.name}),(0,T.jsx)("div",{className:"text-xs text-secondary-foreground/60",children:e.email})]})]})}),(0,T.jsx)("td",{className:"w-24 px-4 py-3 text-center text-secondary-foreground/70",children:e.isHost?(0,T.jsx)(x.A,{children:"Host"}):(0,T.jsx)(x.A,{children:"Attendee"})}),(0,T.jsx)("td",{className:"w-24 px-4 py-3 text-center text-secondary-foreground/70",children:e.joinedAt?new Date(e.joinedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"-"})]},t)))})]})})}):(0,T.jsx)("div",{className:"py-6 text-center text-sm text-secondary-foreground/60",children:(0,T.jsx)(x.A,{children:"No attendance data yet"})})]}):(0,T.jsx)("div",{className:"py-6 text-center text-sm text-secondary-foreground/60",children:(0,T.jsx)(x.A,{children:"No meeting data available for this event"})})};var z=n(5564),F=n.n(z),U=n(79957),V=n(51926);const G=function(e){let{user:t,community:n,groups:r=[],eventToUpdate:o={},resetForm:s=(()=>{}),openModel:a=(()=>{}),addToast:l=(()=>{}),onUpdateEvent:c=(()=>{})}=e;const[d,u]=(0,i.useState)([]),[m,f]=(0,i.useState)([]),[g,b]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),[w,_]=(0,i.useState)(o?(0,U.createEventDetailSlugPageRoute)(o):""),{analyticsService:C}=(0,h.W)();return(0,i.useEffect)((()=>{if(o.id){let e=(0,U.createPostDetailPageUrl)(o);_(e),y(!0)}}),[o,w,v]),(0,T.jsxs)("div",{className:"flex w-full cursor-pointer flex-col space-y-5 overflow-hidden rounded pt-2",children:[(0,T.jsxs)("div",{className:"mx-4 mt-2 rounded bg-card px-2 pt-3",children:[(0,T.jsx)("div",{className:"pl-2 font-semibold",children:(0,T.jsx)(x.A,{children:"Share event via link"})}),v?(0,T.jsx)(V.A,{text:w}):(0,T.jsx)(M.k,{noPrefixSeparator:!0,noBorder:!0,noMargin:!0,readOnly:!0,defaultValue:w,containerClassName:"py-1 focus:outline-none bg-card rounded",postfix:(0,T.jsxs)("div",{className:"mr-2 flex cursor-pointer items-center",children:[(0,T.jsx)("i",{className:"fi fi-rr-copy px-1 text-base font-semibold text-primary"}),(0,T.jsx)("div",{className:"mb-1 font-semibold text-primary",children:(0,T.jsx)(x.A,{children:"Copy"})})]})},"2")]}),(0,T.jsxs)("div",{className:"px-5",children:[(0,T.jsx)("div",{className:"theme-text-heading- font-semibold",children:(0,T.jsx)(x.A,{children:"Select channel to post this event"})}),(0,T.jsx)("div",{className:"mt-2 overflow-y-auto",style:{maxHeight:"calc(100vh - 320px)"},children:r&&r.length>0?r.map(((e,t)=>{if("admin"===e.myRole)return(0,T.jsxs)("div",{className:"rounded bg-card py-2",children:[(0,T.jsx)("div",{className:"px-2 text-sm font-semibold text-secondary-foreground/85",children:e.name}),e.tabs.map(((t,n)=>(0,T.jsx)("div",{className:F()("mx-2 cursor-pointer rounded px-4 py-2 text-secondary-foreground/85 hover:bg-primary-light"),children:(0,T.jsx)(j.S,{className:"mb-1",disabled:!1,selected:m.includes(t.id),onClick:n=>{if(((e,t)=>{let n=d;if(d.map((e=>e.id)).includes(e.id)){let r=n.findIndex(((t,n)=>t.id===e.id)),o=n[r].sections;o.includes(t.id)?o.length>1?n[r].sections.splice(n[r].sections.indexOf(t.id),1):n.splice(r,1):n[r].sections.push(t.id)}else{let r=[];r.push(t.id),n.push({id:e.id,sections:r})}u(n)})(e,t),m.includes(t.id)){let e=m.filter((e=>e!==t.id));f(e)}else f([...m,t.id])},children:(0,T.jsxs)("div",{className:F()("flex items-center pl-2"),children:[(0,T.jsx)("div",{className:F()("emoji",{hash:!t.emoji||"#"===t.emoji}),children:t.emoji?t.emoji:"#"}),(0,T.jsx)("span",{className:F()("pl-3"),children:t.name})]})})},n)))]},t)})):null})]}),(0,T.jsxs)("div",{className:"flex items-center justify-between px-3 pb-3",children:[(0,T.jsx)(A.$,{onClick:e=>{s(),a(!1)},flat:!0,label:"Cancel",large:!0}),(0,T.jsx)(A.$,{disabled:0===m.length,onClick:()=>{b(!0),C.track("event-shared"),k.U.inviteSections(t,n.id,o.id,d).then((e=>{l("Posted successfully","",p.lm.success),b(!1),c(e.event),s(),a(!1)})).catch((e=>{b(!1),l("Error while posting event","",p.lm.danger)}))},label:"Post",large:!0,isLoading:g})]})]})},H=i.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),W=new u.A,q=Object.freeze({details:1,invite:2,attendee:3,Slug:4});const K=(0,p.wj)((0,l.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups})),(e=>(0,c.zH)({},e)))((function(e){let{user:t,community:n,active:s,groups:l,eventToUpdate:c,startDate:u,isShowAttendee:I=!1,isShowInvite:O=!1,isPastEventModal:L=!1,setIsShowInvite:R=(()=>{}),setIsShowAttendee:z=(()=>{}),onUpdateEvent:F=(e=>{}),cancelUpdate:U=(e=>{}),openModel:V=(e=>{}),addToast:K=(e=>{}),onNewEventAdded:Y=(e=>{}),onClearModal:$=(e=>{})}=e;const Q=new d.F,Z=(0,m.A)(),J=["Does not repeat","Daily","Weekly","Bi Weekly"],X=c&&c.id,[ee,te]=(0,i.useState)(!1),[ne,re]=(0,i.useState)(!0),[oe,ie]=(0,i.useState)(X?c.title:""),[se,ae]=(0,i.useState)(X?Q.render(c.description):""),[le,ce]=(0,i.useState)(X?c.callType:""),[de,ue]=(0,i.useState)(!1),[pe,he]=(0,i.useState)(X?c.location:""),[me,fe]=(0,i.useState)(!1),[ge,be]=(0,i.useState)(X?c.banner:null),[ve,ye]=(0,i.useState)(!1),[ke,we]=(0,i.useState)(X?new Date(c.startTime):u),[xe,_e]=(0,i.useState)(X?new Date(c.endTime):null),[Ae,Ce]=(0,i.useState)(q.details),[Se,je]=(0,i.useState)(!1),[Ee,Ne]=(0,i.useState)(!X),[Pe,De]=(0,i.useState)(!1),[Me,Te]=(0,i.useState)(!1),[Ie,Oe]=(0,i.useState)(""),[Le,Re]=(0,i.useState)(X?c.host:{}),[Be,ze]=(0,i.useState)(X&&""!==c.webURL?c.webURL:""),[Fe,Ue]=(0,i.useState)(""),[Ve,Ge]=(0,i.useState)([]),[He,We]=(0,i.useState)([]),[qe,Ke]=(0,i.useState)(!1),[Ye,$e]=(0,i.useState)(!1),[Qe,Ze]=(0,i.useState)(1),[Je,Xe]=(0,i.useState)(J[0]),[et,tt]=(0,i.useState)(),[nt,rt]=(0,i.useState)(null),[ot,it]=(0,i.useState)(null),[st,at]=(0,i.useState)([]),[lt,ct]=(0,i.useState)(void 0!==X&&void 0!==c.meta&&void 0!==c.meta.slug?c.meta.slug:null),[dt,ut]=(0,i.useState)(X&&c.meta&&c.meta.title?c.meta.title:null),[pt,ht]=(0,i.useState)(X&&c.meta&&c.meta.description?c.meta.description:null),[mt,ft]=(0,i.useState)(X&&c.meta&&c.meta.openGraphTitle?c.meta.openGraphTitle:null),[gt,bt]=(0,i.useState)(X&&c.meta&&c.meta.openGraphDescription?c.meta.openGraphDescription:null),[vt,yt]=(0,i.useState)(X&&c.meta&&c.OGImage?c.OGImage:null),kt=X&&c.meta&&c.meta.slug?c.meta.slug:oe,wt=X&&c.meta&&c.meta.title?c.meta.title:oe,xt=X&&c.meta&&c.meta.openGraphTitle?c.meta.openGraphDescription:mt,{analyticsService:_t}=(0,h.W)();function At(e){return X&&c.meta&&c.meta.openGraphTitle?c.meta.description:void 0!==e?W.turndown(e):""}function Ct(e){return X&&c.meta&&c.meta.openGraphDescription?c.meta.openGraphDescription:void 0!==e?W.turndown(e):""}const St=X&&c.endTime&&new Date(c.endTime)2&&ke&&xe&&(Ie||Ee)&&ne,Et=(0,i.useRef)(),Nt=(0,i.useRef)(null),Pt=(0,i.useRef)(null),Dt=(0,i.useRef)(),Mt=(0,i.useRef)(null);(0,i.useEffect)((()=>{X?(I&&Ce(q.attendee),O&&Ce(q.invite),0===c.maximumRegistrations?Ne(!0):Oe(c.maximumRegistrations),ie(c.title),ue(c.isPrivate),Re(c.host),be(c.banner),ae(Q.render(c.description)),We(c.participants),we(c.startTime?new Date(c.startTime):null),_e(c.endTime?new Date(c.endTime):null),null!==c.liveCall?ze(c.liveCall.webUrl):ze(c.webURL),he(c.location),fe(null!==c.liveCall)):u&&we(u)}),[X,s]),(0,i.useEffect)((()=>{const e=e=>{Se&&Et.current&&!Et.current.contains(e.target)&&je(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[Se]),(0,i.useEffect)((()=>{["admin"].includes(n.myRole)&&y.BE.getCommunitySubscribersPaginated(t,n.id,10,1,Fe).then((e=>{let{users:t}=e;Ge(t),te(!1)})).catch((e=>{console.error({error:e}),te(!1)})),X||Re(t)}),[t,n.id,n.myRole]);const Tt=i.useCallback((0,o.debounce)((e=>{["admin"].includes(n.myRole)&&(te(!0),y.BE.getCommunitySubscribersPaginated(t,n.id,10,1,e).then((e=>{let{users:t}=e;Ge(t),te(!1),$e(!1)})).catch((e=>{console.error({error:e}),te(!1)})))}),1e3),[n.myRole]),It=i.useCallback((()=>{if(Dt.current){const{scrollTop:e,scrollHeight:r,clientHeight:o}=Dt.current;if(e+o===r&&!qe&&!Ye){const e=Qe+1;Ke(!0),y.BE.getCommunitySubscribersPaginated(t,n.id,10,e,Fe).then((t=>{0===t.users.length?$e(!0):(Ge([...Ve,...t.users]),Ze(e)),Ke(!1)})).catch((e=>{console.error({error:e}),te(!1)}))}}}),[qe,Ye,Qe,Fe,Ve]);async function Ot(){try{te(!0);let e=Ee?0:Ie,r=se.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");r=W.turndown(r);const o={slug:(0,S.xx)(null===lt?kt:lt),title:null===dt?wt:dt,description:null===pt?At(r):pt,openGraphTitle:null===mt?xt:mt,openGraphDescription:null===gt?Ct(r):gt,openGraphImage:vt},i=await k.U.updateEvent(t,n.id,c.id,Pe,ke,xe,de,oe,r,pe,Be,e,Le?Le.id:"",me,o);i&&(ve&&await Rt(i.event.id,(e=>{i.event.banner=e})),K("Event updated successfully","",p.lm.success),F(i.event),V(!1)),te(!1),at([])}catch(e){te(!1),K("Error in updating event","",p.lm.danger),e.response&&e.response.data&&e.response.data.errors&&at(e.response.data.errors)}}function Lt(e){let{errors:t,errorKey:n}=e;return n in t?(0,T.jsx)("div",{children:t[n].map(((e,t)=>(0,T.jsx)("div",{className:"text-xs text-alert",children:e},t)))}):(0,T.jsx)(T.Fragment,{})}(0,i.useEffect)((()=>{Pe&&Ot()}),[Pe]);const Rt=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{};if(null==ge||void 0==ge)return;const o=k.U.updateEventBanner(t,n.id,e,ge).catch((e=>(K("Error in uploading banner","",p.lm.danger),null))),i=new Promise((e=>setTimeout((()=>e(null)),3e4))),s=await Promise.race([o,i]);null!=s&&s.event&&r(s.event.banner)};if(!s)return(0,T.jsx)(T.Fragment,{});const Bt=()=>{X&&(ie(""),Re({}),ae(""),Oe(""),be(null),we(null),_e(null),ce(""),ue(!1),it(null),Xe(null),tt(null),rt(null),ze(""),he(""),Ce(q.details),R(!1),z(!1),$()),ie(""),ae(""),Oe(""),be(null),we(null),_e(null),ce(""),ue(!1),ze(""),he(""),Ce(q.details),R(!1),z(!1),zt()};function zt(){ct(null),ft(null),bt(null),yt(null),ut(null),ht(null)}return(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(D.a,{className:"CreateGroupModal",active:s,width:"590px",padding:!1,setActive:e=>{V(e),Bt()},children:[(0,T.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,T.jsx)("span",{className:"font-bold text-secondary-foreground/85",children:X?oe&&oe.length>30?oe.substring(0,28)+"...":oe:(0,T.jsx)(x.A,{children:"Create Event"})}),(0,T.jsx)(E.A,{hoverable:!0,icon:"cross",size:"md",iconClass:"text-secondary-foreground/70",onClick:()=>{V(!1),Bt()}})]}),(0,T.jsxs)("div",{className:"tab-holder flex justify-start bg-card px-5",children:[!L&&(0,T.jsx)(g.A,{onClick:e=>{Ae!==q.details&&Ce(q.details)},tab:"Event Details",selected:Ae===q.details}),!L&&(0,T.jsx)(g.A,{onClick:e=>{Ae!==q.slug&&Ce(q.slug)},tab:"Settings",selected:Ae===q.slug}),(0,T.jsx)(g.A,{onClick:e=>{Ae!==q.invite&&Ce(q.invite)},tab:"Invite",selected:Ae===q.invite,disabled:!X||St}),!L&&(0,T.jsx)(g.A,{onClick:e=>{Ae!==q.attendee&&Ce(q.attendee)},tab:"Attendee",selected:Ae===q.attendee,disabled:!X})]}),(0,T.jsxs)("div",{className:"p-5 text-secondary-foreground/85 ".concat(Ae===q.details?"block":"hidden"),children:[(0,T.jsx)(N.A,{picture:ge,setPicture:be,setPictureSelected:ye,cropRatioMessage:"Picture ratio: 16:9",displayUnsplashSearch:!0,initialPhotoSearchQuery:"Event"}),(0,T.jsxs)("div",{className:"mb-5 mt-2",children:[(0,T.jsx)("div",{className:"mb-2 font-bold after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,T.jsx)(x.A,{children:"Event name"})}),(0,T.jsx)(M.k,{placeholder:"Enter event name",defaultValue:oe,validator:e=>e&&e.length>2?null:Z.trans("Event name is invalid!"),onChange:e=>{ie(e)},large:!0,noMargin:!0,className:"bg-card"}),(0,T.jsx)(Lt,{errors:st,errorKey:"title"})]}),(0,T.jsxs)("div",{className:"relative mb-5 mt-2",children:[(0,T.jsx)("div",{className:"mb-2 font-bold",children:(0,T.jsx)(x.A,{children:"Host name"})}),(0,T.jsx)("div",{onClick:()=>je(!0),className:"mr-1 flex cursor-pointer items-center justify-between rounded border border-border bg-card px-2 py-2 outline-none",children:Object.keys(Le).length>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(_.eu,{user:Le,tag:(0,T.jsxs)(T.Fragment,{children:["admin"===Le.communityRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,T.jsx)(x.A,{children:"Community Admin"})}):(0,T.jsx)(T.Fragment,{}),"admin"===Le.groupRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,T.jsx)(x.A,{children:"Admin"})}):"moderator"===Le.groupRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,T.jsx)(x.A,{children:"Moderator"})}):(0,T.jsx)(T.Fragment,{})]})}),(0,T.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),Re({})},className:"".concat(Object.keys(Le).length>0?"":"hidden"),children:(0,T.jsx)("i",{className:"fi fi-rr-cross text-sm text-secondary-foreground/85"})})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"mt-1 py-1.5 text-sm text-secondary-foreground/70",children:(0,T.jsx)(x.A,{children:"You will be made host if none selected"})}),(0,T.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),je(!Se)},children:(0,T.jsx)("i",{className:"fi fi-rr-angle-down text-sm text-secondary-foreground/85"})})]})}),(0,T.jsx)(Lt,{errors:st,errorKey:"eventHost"}),Se?(0,T.jsxs)("div",{className:"absolute z-10 mt-1 h-60 w-full rounded border border-border bg-background shadow-lg",ref:Et,children:[(0,T.jsx)("div",{className:"m-auto w-11/12",children:(0,T.jsx)(M.k,{prefix:(0,T.jsx)("img",{src:f.A,alt:"Search Icon",width:"15",className:"ml-4 -rotate-90 transform pb-4"}),noPrefixSeparator:!0,placeholder:"Search by name",noBorder:!0,validationOutsideBox:!0,noMargin:!0,value:Fe,containerClassName:"bg-card py-1 focus:outline-none border border-border rounded mt-4",onChange:e=>{te(!0),Ue(e),Tt(e)},postfix:Fe.length>0?(0,T.jsx)("i",{onClick:()=>{te(!0),Ue(""),Tt("")},className:"fi fi-rr-cross cursor-pointer pr-1 text-sm text-secondary-foreground/85"}):null})}),ee?(0,T.jsx)("div",{className:"p-1",children:(0,T.jsx)(P.a,{})}):(0,T.jsx)(T.Fragment,{}),(0,T.jsx)("div",{onScroll:It,ref:Dt,className:"z-30 h-44 w-full overflow-scroll",children:Ve&&Ve.length>0?Ve.map((e=>(0,T.jsx)("div",{className:"m-3 ml-10 flex cursor-pointer items-center justify-between py-2",children:(0,T.jsx)("div",{onClick:()=>{je(!1),Re(e)},className:"flex items-center justify-center",children:(0,T.jsx)(_.eu,{user:e,tag:(0,T.jsxs)(T.Fragment,{children:["admin"===e.communityRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:"Community Admin"}):(0,T.jsx)(T.Fragment,{}),"admin"===e.groupRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:"Admin"}):"moderator"===e.groupRole?(0,T.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(0,T.jsx)(T.Fragment,{})]})})})},e.id))):(0,T.jsx)(T.Fragment,{})})]}):null]}),(0,T.jsxs)("div",{className:"mb-5 mt-2",children:[(0,T.jsx)("div",{className:"mb-2 font-bold",children:(0,T.jsx)(x.A,{children:"Description"})}),(0,T.jsx)("div",{children:(0,T.jsx)(i.Suspense,{fallback:(0,T.jsx)(T.Fragment,{}),children:(0,T.jsx)(H,{text:se,setText:ae,className:"bg-card"})})}),(0,T.jsx)(Lt,{errors:st,errorKey:"description"})]}),(0,T.jsx)("div",{className:"mb-2 font-bold",children:(0,T.jsx)(x.A,{children:"When & where"})}),(0,T.jsxs)("div",{className:"rounded border bg-card p-5",children:[(0,T.jsxs)("div",{className:"block md:flex",children:[(0,T.jsx)("div",{className:"flex justify-start",children:(0,T.jsxs)("div",{className:"w-98",children:[(0,T.jsx)("div",{className:"mb-1 font-bold after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,T.jsx)(x.A,{children:"From"})}),(0,T.jsxs)("div",{onClick:()=>{Nt.current.deferFocusInput()},className:"mr-1 flex cursor-pointer rounded border border-border bg-background px-2 py-4 outline-none",children:[(0,T.jsx)(a(),{ref:Nt,className:"w-24 bg-background",selected:ke,minDate:new Date,onChange:e=>{we(e)},shouldCloseOnSelect:!0,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:2,timeCaption:"time",placeholderText:"Start date",dateFormat:"dd - MM - yyyy"}),(0,T.jsx)("div",{className:"mx-1 border-r-2"}),(0,T.jsx)("div",{className:"md:w-18 w-20 select-none rounded bg-background",children:(0,T.jsxs)("div",{className:"text-center text-secondary-foreground/85",children:[ke&&(0,r.default)(ke," h:mm a"),!ke&&(0,T.jsx)("p",{className:"text-secondary-foreground/70",children:(0,T.jsx)(x.A,{children:"time"})})]})})]}),(0,T.jsx)(Lt,{errors:st,errorKey:"startTime"})]})}),(0,T.jsx)("div",{className:"mt-4 flex md:ml-4 md:mt-0",children:(0,T.jsxs)("div",{className:"w-98",children:[(0,T.jsx)("div",{className:"mb-1 font-bold after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,T.jsx)(x.A,{children:"To"})}),(0,T.jsxs)("div",{onClick:()=>{ke&&Pt.current.deferFocusInput()},className:"mr-1 flex rounded border border-border bg-background px-2 py-4 outline-none ".concat(ke?"cursor-pointer bg-background":"theme-bg-disable cursor-not-allowed"),children:[(0,T.jsx)(a(),{ref:Pt,className:"w-24 border-border ".concat(ke?"cursor-pointer bg-background":"theme-bg-disable cursor-not-allowed"),selected:xe,minDate:ke,onChange:e=>{_e(e),at([])},showTimeSelect:!0,disabled:!ke,timeFormat:"HH:mm",timeIntervals:2,timeCaption:"time",placeholderText:"End date",dateFormat:"dd - MM - yyyy"}),(0,T.jsx)("div",{className:"mx-1 border-r-2"}),(0,T.jsx)("div",{className:"md:w-18 w-20 border-border ".concat(ke?"cursor-pointer bg-background":"theme-bg-disable cursor-not-allowed"),children:(0,T.jsxs)("div",{className:"text-center text-secondary-foreground/85",children:[xe&&(0,r.default)(xe," h:mm a"),!xe&&(0,T.jsx)("p",{className:"text-secondary-foreground/70",children:(0,T.jsx)(x.A,{children:"time"})})]})})]}),(0,T.jsx)(Lt,{errors:st,errorKey:"endTime"})]})})]}),(0,T.jsxs)("span",{className:"text-xs text-secondary-foreground/70",children:[(0,T.jsx)(x.A,{children:"Current timezone:"})," ",n.timezone?n.timezone:"Asia/Kolkata"," (",(0,T.jsx)(x.A,{children:"can be updated from community settings"}),")"]}),(0,T.jsx)("div",{className:"mb-3 mt-3 block md:flex",children:(0,T.jsxs)("div",{className:"mb-2 flex flex-col justify-between",children:[(0,T.jsx)("div",{className:"mb-1 font-bold",children:(0,T.jsx)(x.A,{children:"Repeats"})}),(0,T.jsx)(C.A,{list:J,value:Je,required:!0,className:"rounded border border-border bg-background focus:outline-none",onStateChange:e=>{console.log(e),Xe(e)}})]})}),("Daily"===Je||"Weekly"===Je||"Bi Weekly"===Je)&&(0,T.jsxs)("div",{className:"mb-5 flex h-[70px] w-full items-baseline justify-between",children:[(0,T.jsxs)("div",{className:"mb-2 flex w-[45%] flex-col justify-between",children:[(0,T.jsx)("div",{className:"mb-1 font-bold",children:(0,T.jsx)(x.A,{children:"Event Ends"})}),(0,T.jsx)(C.A,{list:["After","On"],required:!0,className:"rounded border border-border bg-background focus:outline-none",onStateChange:e=>{tt(e)}})]}),"After"===et&&(0,T.jsxs)("div",{className:"-mt-2 w-[45%]",children:[(0,T.jsx)("div",{className:"mb-1 font-bold",children:(0,T.jsx)(x.A,{children:"Occurences"})}),(0,T.jsx)(M.k,{noPrefixSeparator:!0,validator:e=>{if(isNaN(e))return re(!1),"Invalid count of occurences";re(!0)},noBorder:!0,validationOutsideBox:!0,noMargin:!0,containerClassName:"flex py-2 focus:outline-none border border-border bg-background rounded h-10 items-center",onChange:e=>{rt(e)}},"occurences")]}),"On"===et&&(0,T.jsxs)("div",{className:"-mt-2 w-[45%]",children:[(0,T.jsx)("div",{className:"mb-1 font-bold text-transparent",children:(0,T.jsx)(x.A,{children:"null"})}),(0,T.jsx)("div",{onClick:()=>{Mt.current.deferFocusInput()},className:"mb-10 flex h-10 cursor-pointer items-center justify-center rounded border border-border bg-background outline-none",children:(0,T.jsx)(a(),{ref:Mt,className:"w-24 bg-background",selected:ot,minDate:new Date,onChange:e=>{it(e)},shouldCloseOnSelect:!0,placeholderText:"Ends On",dateFormat:"dd - MM - yyyy"})}),(0,T.jsx)(Lt,{errors:st,errorKey:"startTime"})]})]}),(0,T.jsxs)("div",{className:"mb-5 mt-2",children:[(0,T.jsxs)("div",{className:"mb-2 flex flex-col",children:[(0,T.jsx)("div",{className:"font-bold",children:(0,T.jsx)(x.A,{children:"Online event"})}),X||n.isDealRedeemed?null:(0,T.jsxs)("div",{className:"mt-2 flex w-full flex-col justify-between gap-1 md:flex-row md:gap-0",children:[(0,T.jsx)(j.S,{className:"",selected:le===b,onClick:e=>{fe(!0),ce(b),ze(""),re(!0)},children:(0,T.jsx)("span",{className:"".concat(me&&le===b?"font-semibold text-blue-700":"font-semibold"),children:(0,T.jsx)(x.A,{children:"Add Video Call link"})})}),(0,T.jsx)(j.S,{className:"",selected:le===v,onClick:e=>{fe(!0),ce(v),ze(""),re(!0)},children:(0,T.jsx)("span",{className:"".concat(me&&le===v?"font-semibold text-blue-700":"font-semibold"),children:(0,T.jsx)(x.A,{children:"Add Webinar link"})})}),(0,T.jsx)(j.S,{className:"",selected:""===le,onClick:e=>{ce("")},children:(0,T.jsx)("span",{className:"".concat(me&&""===le?"font-semibold text-blue-700":"font-semibold"),children:(0,T.jsx)(x.A,{children:"Add Custom Link"})})})]})]}),le===b||le===v?(0,T.jsx)(M.k,{prefix:(0,T.jsx)("i",{className:"fi fi-rr-video-camera px-4 text-base text-gray-500"}),noPrefixSeparator:!0,placeholder:"Meeting link will be generated once event is created",noBorder:!0,validationOutsideBox:!0,defaultValue:Be,readOnly:!0,noMargin:!0,containerClassName:"py-2 focus:outline-none border border-border bg-background rounded"},"1"):(0,T.jsx)(M.k,{prefix:(0,T.jsx)("i",{className:"fi fi-rr-video-camera px-4 text-base text-red-500"}),noPrefixSeparator:!0,validator:e=>{if(!e.startsWith("http://")&&!e.startsWith("https://")&&0!==e.length)return re(!1),"Invalid meeting url!";re(!0)},placeholder:X&&Be?Be:X?"You can not edit generated meeting link":"https://",disabled:X,noBorder:!0,validationOutsideBox:!0,noMargin:!0,defaultValue:Be,containerClassName:"py-2 focus:outline-none border border-border bg-background rounded",onChange:e=>{ze(e)}},"2")]}),(0,T.jsxs)("div",{className:"mb-5 mt-2",children:[(0,T.jsx)("div",{className:"font-bold",children:(0,T.jsx)(x.A,{children:"Event Type"})}),(0,T.jsxs)("div",{className:"mt-3 flex w-full gap-4 md:flex-row",children:[(0,T.jsx)(j.S,{className:"",selected:!de,onClick:e=>{ue(!1)},children:(0,T.jsx)("span",{className:"".concat(de?"font-semibold":"font-semibold text-blue-700"),children:(0,T.jsx)(x.A,{children:"Public"})})}),(0,T.jsx)(j.S,{className:"",selected:de,onClick:e=>{ue(!0)},children:(0,T.jsx)("span",{className:"".concat(de?"font-semibold text-blue-700":"font-semibold"),children:(0,T.jsx)(x.A,{children:"Private"})})})]})]}),(0,T.jsxs)("div",{className:"mb-5 mt-2",children:[(0,T.jsx)("div",{className:"mb-2 font-bold",children:(0,T.jsx)(x.A,{children:"Venue"})}),(0,T.jsx)(M.k,{prefix:(0,T.jsx)("i",{className:"fi fi-rr-marker px-4 text-base text-blue-500"}),noPrefixSeparator:!0,placeholder:"Enter address",noBorder:!0,validationOutsideBox:!0,noMargin:!0,defaultValue:pe,containerClassName:"py-2 focus:outline-none border border-border bg-background rounded",onChange:e=>{he(e)}})]})]}),(0,T.jsx)("div",{className:"mt-5",children:(0,T.jsxs)("div",{className:"mx-auto flex items-center justify-between",children:[(0,T.jsx)(A.$,{onClick:e=>{X?(Bt(),V(!1)):(V(!1),Bt())},flat:!0,label:"Cancel",large:!0}),(0,T.jsx)(A.$,{disabled:!jt,onClick:()=>{X?Te(!0):(async()=>{try{te(!0);let e=Ee?0:Ie,r=se.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");r=W.turndown(r);const o={slug:(0,S.xx)(null===lt?kt:lt),title:null===dt?wt:dt,description:null===pt?At(r):pt,openGraphTitle:null===mt?xt:mt,openGraphDescription:null===gt?Ct(r):gt,openGraphImage:vt},i=await k.U.createEvent(t,n.id,ke,xe,de,oe,r,le,pe,Be,e,Je,nt,ot,Le?Le.id:null,me,o);if(_t.track("new-event-created",{}),i){for(const e of i.events)await Rt(e.id);K("Event created successfully","",p.lm.success),_t.track("new-event-created",{meetingURL:Be});for(const e of i.events)Y(e);De(!1),setTimeout((()=>{Ce(q.invite)}),400)}te(!1),at([])}catch(e){te(!1),De(!1),K("Error in creating event","",p.lm.danger),e.response&&e.response.data&&e.response.data.errors&&at(e.response.data.errors)}})()},label:X?"Update":"Create",large:!0,isLoading:ee})]})})]}),Ae===q.slug&&(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("div",{className:"mb-2 p-4",children:(0,T.jsx)(S.jX,{community:n,slug:(0,S.xx)(null===lt?kt:lt),slugPrefix:"event",setSlug:ct,title:(0,S.cT)(null===dt?wt:dt),setTitle:ut,description:(0,S.cT)(null===pt?At(se):pt),setDescription:ht,OGTitle:(0,S.cT)(null==mt?xt:mt),setOGTitle:e=>{ft(e)},OGDescription:(0,S.cT)(null===gt?Ct(se):gt),setOGDescription:e=>{bt(e)},OGImage:vt,OgImageSubtitle:"By default it will take up the banner uploaded with the event",setOGImage:yt,clearSlugMeta:zt})})}),(0,T.jsx)("div",{className:"h-1/2 text-secondary-foreground/85 ".concat(Ae===q.invite?"block":"hidden"),children:(0,T.jsx)(G,{user:t,community:n,groups:l,eventToUpdate:c,resetForm:Bt,openModel:V,addToast:K,onUpdateEvent:F})}),(0,T.jsx)("div",{className:"p-5 text-secondary-foreground/85 ".concat(Ae===q.attendee?"block":"hidden"),children:(0,T.jsx)(B,{user:t,attendeeList:He,eventToUpdate:c})}),(0,T.jsx)(w.c,{active:Me,setActive:Te,onSubmit:()=>{De(!0),Te(!1)},onCancelSubmit:()=>{Te(!1),Ot()},labelCancel:"No, its okay",labelSubmit:"Yes, Notify them",title:"Do you wish to notify these changes to attendees?",subTitle:"".concat(X&&c.participantCount>0?"".concat(c.participantCount," ").concat(Z.trans("users wants to attend this event")):""," "),isLoading:ee,large:!0,btnColor:"theme-bg-disabled"})]})})})))},27376:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(20975),o=n(62391);const i=r.lazy((()=>n.e(636).then(n.bind(n,25636))));function s(e){let{placeholder:t="#",hidePlaceholder:n=!1,emoji:s,setEmoji:a,visible:l=!1,setVisible:c=(e=>{})}=e;const[d,u]=r.useState("light");return(0,r.useEffect)((()=>{const e=localStorage.getItem("pensil.theme");u(null!==e&&void 0!==e?e:"light")}),[]),(0,o.jsxs)("div",{className:"EmojiPicker relative",onBlur:e=>{},children:[n?null:(0,o.jsx)("span",{onClick:e=>{l||c(!0)},className:"cursor-pointer px-2 py-1 text-center",children:s||t}),l?(0,o.jsx)("div",{className:"picker-container",style:{position:"absolute",zIndex:"100"},children:(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(o.Fragment,{}),children:(0,o.jsx)(i,{onEmojiClick:(e,t)=>{a(e.emoji),console.log(e.emoji),c(!1)},disableAutoFocus:!0,theme:d,skinTonesDisabled:!0,groupNames:{smileys_people:"PEOPLE"},native:!0})})}):(0,o.jsx)(o.Fragment,{})]})}},1776:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{children:t,className:n="",selected:r=!1,onClick:s=(e=>{}),alt:a=!1}=e;return(0,i.jsx)("div",{onClick:s,className:o()("Switch cursor-pointer "+n,{selected:r,"no-children":!t,alt:a}),children:t})}},1334:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{children:t,className:n="",selected:r=!1,disabled:s=!1,onClick:a=(e=>{})}=e;return(0,i.jsx)("div",{children:(0,i.jsxs)("div",{onClick:()=>{s||a()},className:o()("Radio "+n,{selected:r,"cursor-pointer":!s,"cursor-not-allowed":s}),children:[(0,i.jsx)("span",{className:o()("radio-comp-1 relative transition-all duration-300 ease-linear",{"border-primary":r,"theme-border-subtitle-1":!r,"theme-border-subtitle-2":s,"hover:border-primary":!s}),children:(0,i.jsx)("span",{className:o()("radio-comp-2 absolute bottom-auto left-auto right-auto top-auto transition-all duration-300 ease-linear",{"bg-primary":r,"theme-border-subtitle-2":s})})}),t]})})}},94503:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(68662),o=n(5564),i=n.n(o),s=n(20975),a=n(82086),l=n.n(a),c=n(62270),d=n(78220),u=n(35964),p=n(62391);function h(e){let{text:t="

Hi, guys!

",setText:n=(e=>{}),getMentionsFeed:o=(async e=>[]),placeholder:a="Write here...",className:d="",onSubmit:u,uploadImage:h=!0}=e;const b=(0,c.A)(),[v,y]=(0,s.useState)(null);return(0,s.useEffect)((()=>{if(v){const e=(e,t)=>{"Enter"!==t.domEvent.key||t.domEvent.shiftKey||u(e)};return v.editing.view.document.on("keydown",e),()=>{v.editing.view.document.off("keydown",e)}}}),[v,u]),(0,p.jsx)("div",{className:i()("RichTextEditor headings "+d),children:(0,p.jsx)(r.CKEditor,{editor:l(),data:t,onReady:e=>{y(e)},onChange:(e,t)=>{const r=t.getData();n(r)},config:{toolbar:{items:["bold","italic","link","bulletedList","numberedList","|","heading","outdent","indent","codeBlock","|",h?"uploadImage":null,"blockQuote"],location:"bottom"},placeholder:b.trans(a),extraPlugins:[g,f],mention:{feeds:[{marker:"@",feed:o,minimumCharacters:1,itemRenderer:m}]},fontSize:{options:["tiny","default","big"]}},onBlur:(e,t)=>{},onFocus:(e,t)=>{}})})}function m(e){const t=document.createElement("span"),n=document.createElement("img"),r=document.createElement("div"),o=document.createElement("div");t.classList.add("flex"),t.classList.add("items-center"),n.src=e.picture,n.style.width="32px",n.style.height="32px";const i=document.createElement("div");return i.style.padding="0 6px",r.style.fontSize="smaller",r.textContent=e.id,o.textContent=e.name,t.appendChild(n),t.appendChild(i),i.appendChild(o),i.appendChild(r),t}function f(e){e.conversion.for("upcast").elementToAttribute({view:{name:"a",key:"data-mention",classes:"mention",attributes:{href:!0}},model:{key:"mention",value:t=>e.plugins.get("Mention").toMentionAttribute(t)},converterPriority:"high"}),e.conversion.for("downcast").attributeToElement({model:"mention",view:(e,t)=>{let n,{writer:r}=t;if(e)return"@"===e.id[0]&&(n="".concat((0,u.mB)(e.userId))),r.createAttributeElement("a",{class:"mention","data-mention":e.id,href:n,innerText:e.name},{priority:20,id:e.uid})},converterPriority:"high"})}function g(e){e.plugins.get("FileRepository").createUploadAdapter=e=>new b(e)}class b{constructor(e){this.loader=e,this.url=d.vZ.misc.uploadImage}upload(){return new Promise(((e,t)=>{this._initRequest(),this._initListeners(e,t),this._sendRequest()}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json",e.setRequestHeader("Access-Control-Allow-Origin","*"),e.setRequestHeader("Authorization","Bearer "+JSON.parse(localStorage.getItem("pensil.user")).token)}_initListeners(e,t){const n=this.xhr,r=this.loader,o="Couldn't upload file:"+" ".concat(r.file.name,".");n.addEventListener("error",(()=>t(o))),n.addEventListener("abort",(()=>t())),n.addEventListener("load",(()=>{const r=n.response;if(!r||!r.s3Url)return t(r&&r.errors&&r.errors.image?r.errors.image[0]:o);e({default:r.s3Url})})),n.upload&&n.upload.addEventListener("progress",(e=>{e.lengthComputable&&(r.uploadTotal=e.total,r.uploaded=e.loaded)}))}_sendRequest(){const e=new FormData;this.loader.file.then((t=>{e.append("image",t),this.xhr.send(e)}))}}},5673:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(62391);function o(e){let{success:t=!1,minimal:n=!1}=e;return(0,r.jsx)("div",{className:"Tick "+(t?"success":"")+(n?"minimal":"")})}},71986:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(5564),o=n.n(r),i=n(53871),s=n(62391);function a(e){let{error:t,padding0:n=!1}=e;return t?(0,s.jsx)("span",{className:o()("FormError text-xs text-alert",{"px-2":!n&&t}),children:(0,s.jsx)(i.A,{children:t})}):null}},19681:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(71214),l=n(16478),c=n(65186),d=n(16118),u=n(34268),p=n(24881),h=n(76224),m=n(60553),f=n(53871),g=n(29646),b=n(69302),v=n(43532),y=n(16120),k=n(55267),w=n(68108),x=n(62144),_=n(62391);const A=i.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),C=new a.A;const S=(0,s.Ng)((e=>({community:e.community})))((function(e){let{community:t,user:n,groupId:r,group:s,activeTab:a,tabId:S,otherUserId:j,parentMessage:E=null,addPost:N=(()=>{})}=e;const[P,D]=(0,i.useState)(""),[M,T]=(0,i.useState)(!1),{analyticsService:I}=(0,c.W)(),[O,L]=(0,i.useState)([]),[R,B]=(0,i.useState)([]),{activeTabModel:z}=(0,l.G)((e=>({activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null})));(0,i.useEffect)((()=>{const e=document.createElement("style");return e.appendChild(document.createTextNode("\n .ck.ck-balloon-panel.ck-balloon-panel_toolbar_west.ck-balloon-panel_visible {\n display: none;\n }\n")),document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]);const[F,U]=(0,i.useState)(),[V,G]=(0,i.useState)(!1),H=async e=>{try{const e=await(0,h.A)(P);if(e.length>0)return void B(e);const t=await P.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");const o={description:await C.turndown(t),groupId:r,tabId:S,attachments:O,parentId:null===E||void 0===E?void 0:E.id},i=function(e){const t={};e.description||e.attachments.length||(t.description="Description is required!");if(0===Object.keys(t).length)return null;return t}(o);if(U(i),!i&&P&&P.trim().length>0){T(!0);let e=j?await p.b.sendDirectMessage(n,o.description,j):await p.b.sendMessage(n,o);N(e.message),I.track("group-message",{sectionName:null===a||void 0===a?void 0:a.name,groupName:null===s||void 0===s?void 0:s.name}),D(""),T(!1)}}catch(t){T(!1),console.log({error:t})}try{if(O.length){T(!0);const e=j?await p.b.uploadDirectAttachments(n,O,j):await p.b.uploadAttachments(n,{groupId:r,tabId:S,parentId:null===E||void 0===E?void 0:E.id},O);N(e.message),T(!1),L([])}else console.log("no attachments")}catch(t){T(!1),console.log({error:t})}};return n?(0,_.jsxs)("div",{className:"RealtimeSectionMessageEditor",children:[(0,_.jsx)(k.Cj,{message:{attachments:O},removeAttachment:e=>{L(O.filter(((t,n)=>n!==e)))}}),(0,_.jsx)("div",{className:o()("items-center rounded-lg border border-border bg-card p-2.5"),children:(0,_.jsxs)("div",{className:"flex-col",children:[(0,_.jsx)(i.Suspense,{fallback:(0,_.jsx)(_.Fragment,{}),children:(0,_.jsx)(A,{className:"noBorder minHeightDefault w-full max-w-[70vh] overflow-y-auto pb-2 text-sm text-secondary-foreground",text:P,setText:D,onSubmit:H,placeholder:"Message in ".concat(null===z||void 0===z?void 0:z.emoji," ").concat(null===z||void 0===z?void 0:z.name),getMentionsFeed:async e=>{const r=(await u.w.searchInCommunity(n,t.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return r}})}),(0,_.jsxs)("div",{className:"flex items-center justify-between",children:[(0,_.jsxs)("div",{className:"flex gap-4",children:[(0,_.jsx)(g.A,{label:"Attachment",children:(0,_.jsx)(b.z,{accept:"*",maxFileSize:10,disabled:O.length>3,onChange:e=>{L([...O,e])},children:(0,_.jsx)("div",{className:o()("theme-bg-disable flex h-6 w-6 cursor-pointer place-content-center items-center rounded-full text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":O.length>3}),children:(0,_.jsx)(x.A,{size:"xs",icon:"plus"})})})}),(0,_.jsx)(g.A,{label:"Gif",className:!G&&"hidden",children:(0,_.jsx)("button",{className:"p-.05 mt-0.5 hover:scale-110",onClick:()=>{G(!V)},children:(0,_.jsx)("span",{className:"rounded border border-border px-2 text-xs text-secondary-foreground",children:(0,_.jsx)(f.A,{children:"Gif"})})})})]}),(0,_.jsx)(y.A,{openPortal:V,children:(0,_.jsx)(w.A,{active:V,setActive:G,initialSearchQuery:"",onGifSelect:async e=>{G(!1),L([e.blobData])}})}),(0,_.jsx)(v.J,{onClick:H,disabled:!P,isLoading:M})]})]})}),(0,_.jsx)(m.c,{active:R.length>0,header:"Message",buttons:[{label:"OK",type:"primary",onClick:()=>{B([])}}],children:(0,_.jsxs)("div",{className:"flex flex-col px-4 pb-4",children:[(0,_.jsx)("p",{className:"font-bold",children:"The following links are restricted and cannot be used in the message"}),(0,_.jsx)("ul",{className:"ml-4 list-decimal",children:R.map((e=>(0,_.jsx)("li",{className:"text-secondary-foreground/80 text-sm",children:e},e)))})]}),setActive:e=>{B([])},onSubmit:()=>{B([])}})]}):(0,_.jsxs)("div",{children:[(0,_.jsx)(k.Cj,{message:{attachments:O},removeAttachment:e=>{L(O.filter(((t,n)=>n!==e)))}}),(0,_.jsxs)("section",{className:"border-b border-l border-r border-border bg-background p-4",children:[(0,_.jsx)("span",{className:"cursor-pointer text-primary",onClick:e=>{(0,d.D4)(t)},children:(0,_.jsx)(f.A,{children:"Sign in"})})," ",(0,_.jsx)("span",{children:(0,_.jsx)(f.A,{children:"to add a comment"})})]})]})}))},2016:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var r=n(5564),o=n.n(r);n(20975);const i=n.p+"static/media/bell-icon.ee353903a5ef1447e18d6df5049d6c69.svg";const s=n.p+"static/media/bookmark-active-icon.0b86c90527d49bb0093c511225d5cab2.svg";const a=n.p+"static/media/bookmark-icon.35bdbdc3d9df88187a7d8c375b3f1b2a.svg";const l=n.p+"static/media/comment-blue-icon.2524d994c378ee51c30ceaf88a71ac39.svg";const c=n.p+"static/media/comment-icon.87f9a4b4f9734cba1adb206f0d7bf662.svg";const d=n.p+"static/media/ellipsis-icon.c7a076adaf9ab5aecc28d4940526c154.svg";var u=n(48044);const p=n.p+"static/media/like-blue-icon.a1a0fffc60ba5e07a66a282d6b75a27c.svg";const h=n.p+"static/media/like-icon.9b64f02aa23209ac512e3243e58839c5.svg";const m=n.p+"static/media/message-icon.611660e4be7ca181600601326389686f.svg";var f=n(10515),g=n(57321),b=n(30881);const v=n.p+"static/media/setting-2-icon.ea8248f607eb954af069f502d8360de0.svg";const y=n.p+"static/media/setting-icon.3a7b2fc5788a791ecebecdc8ddd8f2a9.svg";const k=n.p+"static/media/share-icon.6d0166bd75fe67b025595d069408c0b8.svg";var w=n(62391);function x(e){let{icon:t,iconSmall:n=!1,hoverIcon:r=null,title:x="",label:_="",active:A=!1,hoverable:C=!0,small:S=!1,alt:j,onClick:E=(e=>{}),large:N=!1,img:P=null,rotate:D=0,className:M=""}=e;switch(t){case"bell":j=t,t=i;break;case"ellipsis":j=t,t=d;break;case"message":j=t,t=m;break;case"setting":j=t,t=y;break;case"setting2":j=t,t=v;break;case"like":j=t,t=h;break;case"like-blue":j=t,t=p;break;case"comment":j=t,t=c;break;case"comment-blue":j=t,t=l;break;case"share":j=t,t=k;break;case"bookmark":j=t,t=a;break;case"bookmark-active":j=t,t=s;break;case"send-message":j=t,t=b.A;break;case"plus":j=t,t=g.A;break;case"plus-gray":j=t,t=f.A;break;case"left-arrow":j=t,t=u.A;break;case"img":j="",t=P}return N||S||(M+=" p-2 h-10"),S&&(M+=" p-1 h-8 w-8"),S||(_?n||(M+=" pl-3"):M+=" w-10"),C&&(M+=" hover:bg-accent"),(0,w.jsxs)("div",{className:o()("IconButton flex flex-shrink-0 cursor-pointer items-center justify-center rounded-full",M,{"has-hover-icon":!!r}),onClick:E,title:x||_,children:[(0,w.jsx)("img",{src:t,alt:j,style:{transform:"rotate("+D+"deg)"},className:o()("default-icon",{"w-4":n})}),(0,w.jsx)("img",{src:r,alt:j,style:{transform:"rotate("+D+"deg)"},className:o()("hover-icon",{"w-4":n})}),_?(0,w.jsx)("div",{className:o()("label mt-1 font-semibold",{"text-primary":A,"text-secondary-foreground/80":!A,"mx-3":!n,"mx-1":n}),children:_}):(0,w.jsx)(w.Fragment,{})]})}},51772:(e,t,n)=>{"use strict";n.d(t,{$n:()=>r.$,Sm:()=>o.S,jQ:()=>i.j,aH:()=>s.a,RK:()=>l.RK,Bs:()=>a.B,ks:()=>c.k,cn:()=>r.cn,Wv:()=>l.Wv,pD:()=>l.pD});var r=n(44139),o=(n(4201),n(23184),n(32679)),i=n(71986),s=n(19328),a=n(18040),l=n(93092);n(62391);var c=n(54617)},19328:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});var r=n(62391);const o={padding:"2px"},i=(e,t,n,r)=>({content:" ",display:"block",background:0,borderRadius:"50%",width:"".concat(n,"px"),height:"".concat(n,"px"),margin:0,boxSizing:"border-box",border:"".concat(r,"px solid #fff"),borderColor:e?"white transparent white transparent":"".concat(t," transparent ").concat(t," transparent")});function s(e){let{white:t=!1,spinnerColor:n="var(--theme-primary-color)",size:s=24,stroke:a=2}=e;return(0,r.jsx)("div",{className:"Loader flex justify-center",style:o,children:(0,r.jsx)("div",{className:"spinner",style:i(t,n,s,a)})})}},55854:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(62391);function o(){return(0,r.jsx)("div",{id:"loader",className:"firstLoader",children:(0,r.jsx)("div",{className:"preloader",children:(0,r.jsx)("div",{className:"preloader-spin"})})})}},91900:(e,t,n)=>{"use strict";n.d(t,{a:()=>a});var r=n(5564),o=n.n(r),i=n(4201),s=n(62391);function a(e){let{children:t,className:n="",isModalFullScreen:r=!1,width:a="540px",height:l="",padding:c=!0,active:d=!1,isDismissible:u=!0,overflow:p="overflow-hidden",setActive:h=(e=>{}),...m}=e;return(0,s.jsx)("div",{onClick:e=>{h(!d||!u)},onKeyUp:e=>{"Escape"===e.key&&h(!1)},className:o()("Modal backdrop-blur-sm"+n,{active:d}),...m,children:(0,s.jsx)(i.Z,{onClick:e=>{d&&e.stopPropagation()},padding:c,className:n,style:{maxWidth:a,margin:r&&"0px"},children:t})})}},12014:(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var r=n(37365),o=n(62391);function i(e){let{children:t}=e;return(0,o.jsx)(r.A,{componentDecorator:(e,t,n)=>(0,o.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:e,children:t},n),children:t})}function s(e){let{text:t="",passTextThrough:n=(e=>e)}=e;const r=t.split("\n");return(0,o.jsx)("p",{className:"NL2BR text-xs",children:r.map(((e,t)=>(0,o.jsxs)("span",{children:[0!==t?(0,o.jsx)("br",{}):(0,o.jsx)(o.Fragment,{}),(0,o.jsx)(i,{children:n(e)})]},t)))})}},799:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(5564),o=n.n(r),i=n(20975),s=n(62391);const a="...",l=(e,t)=>{let n=t-e+1;return Array.from({length:n},((t,n)=>n+e))},c=e=>{let{totalCount:t,pageSize:n,siblingCount:r=1,currentPage:o}=e;return(0,i.useMemo)((()=>{const e=Math.ceil(t/n);if(r+5>=e)return l(1,e);const i=Math.max(o-r,1),s=Math.min(o+r,e),c=i>2,d=s{let{onPageChange:t,totalCount:n,siblingCount:r=1,currentPage:i,pageSize:l,className:d}=e;const u=c({currentPage:i,totalCount:n,siblingCount:r,pageSize:l});if(0===n)return(0,s.jsx)(s.Fragment,{});let p=u[u.length-1];return(0,s.jsxs)("ul",{className:o()("pagination-container",{[d]:d}),children:[(0,s.jsx)("li",{className:o()("pagination-item cursor-pointer",{disabled:1===i,"hover:bg-background":1!==i}),onClick:()=>{t(i-1)},children:(0,s.jsx)("div",{className:"arrow left cursor-pointer"})}),u.map(((e,n)=>e===a?(0,s.jsx)("li",{className:"pagination-item dots",children:"\u2026"},n):(0,s.jsx)("li",{className:o()("pagination-item cursor-pointer",{"hover:bg-background":e!==i,"bg-primary text-primary-foreground":e===i}),onClick:()=>t(e),children:e},n))),(0,s.jsx)("li",{className:o()("pagination-item cursor-pointer",{disabled:i===p,"hover:bg-background":i!==p}),onClick:()=>{t(i+1)},children:(0,s.jsx)("div",{className:"arrow right cursor-pointer"})})]})}},85306:(e,t,n)=>{"use strict";n.d(t,{A:()=>M});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(71214),l=n(65186),c=n(16118),d=n(38545),u=n(43039),p=n(87573),h=n(34268),m=n(36357),f=n(76224),g=n(97843),b=n(60553),v=n(63360),y=n(53871),k=n(29646),w=n(8934),x=n(54479),_=n(69302),A=n(43532),C=n(68108),S=n(62144),j=n(21143),E=n(62391);const N=i.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),P=new a.A;function D(e){let{document:t=null,subDocument:n=[],setDocument:r=(e=>{}),setSubDocument:i=(e=>{}),isSubComment:s}=e,a=t;return!g.A.hasValue(a)&&g.A.hasValue(n)&&(a=n[0]),a?["mp3"].includes(a.name.split(".").pop())?(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("div",{className:"SelectedDocumentPreview w-full",children:(0,E.jsxs)("div",{className:"relative mt-2 w-full py-3",children:[(0,E.jsx)("audio",{src:URL.createObjectURL(a),controls:!0,className:o()("w-full py-2")}),(0,E.jsx)(v.J,{className:"absolute -right-2 top-1 bg-alert/80 text-alert-foreground/95 hover:bg-alert hover:text-alert-foreground",size:"sm",onClick:e=>{s?i([]):r(null)}})]})})}):(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)("div",{className:"SelectedDocumentPreview relative my-3",children:[(0,E.jsxs)("div",{className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold text-secondary-foreground/70",children:[(0,E.jsx)(S.A,{icon:"document",className:"h-9 text-3xl"}),(0,E.jsx)("div",{className:"flex w-full flex-grow items-center justify-between space-x-4",children:(0,E.jsxs)("div",{className:"w-full items-center text-ellipsis",children:[(0,E.jsx)("div",{className:"line-clamp-2 w-full text-clip font-normal text-secondary-foreground/70",children:(0,m.Bu)(a.name,60,!1)}),(0,E.jsx)("div",{className:"text-xs font-semibold uppercase text-secondary-foreground",children:a.name.split(".").pop()})]})})]}),(0,E.jsx)(v.J,{className:"absolute -right-2 -top-2 bg-alert/80 text-alert-foreground/95 hover:bg-alert hover:text-alert-foreground",size:"sm",onClick:e=>{s?i([]):r(null)}})]})}):(0,E.jsx)(E.Fragment,{})}const M=(0,s.Ng)((e=>({community:e.community})))((function(e){let{post:t,user:n,updatePost:r=(e=>{}),isSubComment:s=!1,commentId:a,community:m}=e;const{analyticsService:g}=(0,l.W)(),[M,T]=(0,i.useState)(""),[I,O]=(0,i.useState)(!1),[L,R]=(0,i.useState)([]),[B,z]=(0,i.useState)(null),[F,U]=(0,i.useState)(!1),[V,G]=(0,i.useState)([]),[H,W]=(0,i.useState)([]),q=(0,i.useRef)(),[K,Y]=(0,i.useState)(!1),[$,Q]=(0,i.useState)([]);return n?(0,E.jsx)(x.A,{children:(0,E.jsxs)("div",{className:"flex py-2",children:[(0,E.jsx)("div",{children:(0,E.jsx)(w.eu,{user:n,hideNameOnMobile:!0,noName:!0,size:36,className:"cursor-pointer"})}),(0,E.jsxs)("div",{className:o()("flex w-full flex-col items-start rounded-xl border border-border px-4 py-2",{"":!s,"bg-card":s}),children:[L.length>0?(0,E.jsxs)("div",{className:"relative mb-2",children:[(0,E.jsx)("img",{className:"h-40 w-full rounded-xl object-cover",src:URL.createObjectURL(L[0]),alt:"CommentImage"}),(0,E.jsx)(v.J,{className:"absolute -right-2 top-0 bg-alert/80 text-alert-foreground/95 hover:bg-alert hover:text-alert-foreground",size:"sm",onClick:e=>{R([])}})]}):(0,E.jsx)(E.Fragment,{}),H.length>0?(0,E.jsxs)("div",{className:"relative",children:[(0,E.jsx)("div",{className:"mt-2 py-1",children:(0,E.jsx)("video",{className:"m-0 w-full",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:URL.createObjectURL(H[0])})})}),(0,E.jsx)(v.J,{className:"absolute -right-2 top-0 bg-alert/80 text-alert-foreground/95 hover:bg-alert hover:text-alert-foreground",size:"sm",onClick:e=>{W([])}})]}):(0,E.jsx)(E.Fragment,{}),B&&["mp4","mov","webm","ogg"].includes(B.name.split(".").pop())?(0,E.jsxs)("div",{className:"relative",children:[(0,E.jsx)("div",{className:"mt-2 py-1",children:(0,E.jsx)("video",{className:"m-0",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:URL.createObjectURL(B)})})}),(0,E.jsx)(v.J,{className:"absolute -right-2 top-0 bg-alert/80 text-alert-foreground/95 hover:bg-alert hover:text-alert-foreground",size:"sm",onClick:e=>{z(null)}})]}):(0,E.jsx)(D,{document:B,isSubComment:s,subDocument:V,setDocument:z,setSubDocument:G}),(0,E.jsx)(j.A,{isRecorderVisible:F,setIsRecorderVisible:U,setRecording:e=>{s?(W([]),R([]),G([]),G([e])):(R([]),z(e))}}),(0,E.jsx)(i.Suspense,{fallback:(0,E.jsx)(E.Fragment,{}),children:(0,E.jsx)(N,{className:"noBorder minHeightDefault w-full overflow-y-auto text-xs text-secondary-foreground",text:M,setText:T,placeholder:s?"Write Reply...":"Write Comment...",getMentionsFeed:async e=>{const t=(await h.w.searchInCommunity(n,m.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return t}})}),(0,E.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,E.jsxs)("div",{className:"Toolbar flex items-center gap-x-5",children:[(0,E.jsx)(k.A,{label:"Picture",children:(0,E.jsx)(_.z,{accept:"image/*",maxFileSize:10,disabled:L.length>0,onChange:L.length>0?()=>{}:e=>{R([e]),z(null),G([]),W([])},children:(0,E.jsx)("div",{className:o()("cursor-pointe text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":L.length>0}),children:(0,E.jsx)(S.A,{size:"md",icon:"picture"})})})}),(0,E.jsx)(k.A,{label:"Video",className:!W&&"hidden",children:(0,E.jsx)(_.z,{accept:"video/*",maxFileSize:100,disabled:H.length>0,onChange:e=>{e&&(W([e]),R([]),G([]),z(null))},children:(0,E.jsx)("div",{className:o()("cursor-pointer text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":H.length>0}),children:(0,E.jsx)(S.A,{size:"md",icon:"play-alt"})})})}),(0,E.jsx)(k.A,{label:"Attachment",children:(0,E.jsx)(_.z,{accept:"file/*",maxFileSize:100,disabled:B||V.length>0,onChange:e=>{s?(W([]),R([]),G([]),G([e])):(z(null),R([]),z(e))},children:(0,E.jsx)("div",{className:o()("cursor-pointer text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":B||V.length>0}),children:(0,E.jsx)(S.A,{size:"md",icon:"file-add"})})})}),(0,E.jsx)(k.A,{label:"Record Audio",children:(0,E.jsx)("button",{disabled:B||V.length>0,className:o()("cursor-pointer text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":B||V.length>0}),onClick:()=>{U(!F)},children:(0,E.jsx)(S.A,{size:"md",icon:"microphone"})})}),(0,E.jsx)(k.A,{label:"Gif",className:!Y&&"hidden",children:(0,E.jsx)("button",{className:"p-.05 mb-1 hover:scale-110",onClick:()=>{Y(!K)},children:(0,E.jsx)("span",{className:"text-xxs rounded-sm border border-secondary-foreground px-0.5",children:(0,E.jsx)(y.A,{children:"Gif"})})})}),(0,E.jsx)(C.A,{active:K,setActive:Y,initialSearchQuery:"",onGifSelect:async e=>{R([e.blobData]),z(null),G([]),W([]),Y(!1)}})]}),(0,E.jsx)(A.J,{onClick:async function(){if(!M)return window.alert("Comment text is required!");const e=await(0,f.A)(M);if(e.length>0)Q(e);else if(O(!0),s)try{const e=await M.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");let o=await P.turndown(e),{commentReply:i}=await u.K$.addCommentReply(n,t.id,a,{description:o});return g.track("post-reply",{comment:M,groupName:null===t||void 0===t?void 0:t.group.name,sectionName:null===t||void 0===t?void 0:t.tab.name,attachment:!!(B||L.length>0),postUrl:window.location.origin+(0,d.createPostDetailPageRouteFromSlug)(t)}),p.A.logEvent(p.B.Post.comment.reply.name,p.B.Post.comment.reply.create),V.length>0&&(i=(await u.K$.uploadDocumentToCommentReply(n,t.id,a,i.id,V)).commentReply),L.length>0&&(i=(await u.K$.uploadDocumentToCommentReply(n,t.id,a,i.id,L)).commentReply),H.length>0&&(i=(await u.K$.uploadDocumentToCommentReply(n,t.id,a,i.id,H)).commentReply),T(""),G([]),R([]),W([]),q.current&&window.setTimeout((()=>{q.current.style.height="auto"}),0),O(!1),void r(i,a)}catch(o){O(!1)}else try{const e=await M.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");let o=await P.turndown(e),{post:i,commentId:s}=await u.K$.addComment(n,t.id,{description:o});return p.A.logEvent(p.B.Post.comment.name,p.B.Post.comment.create),g.track("post-comment",{comment:M,groupName:null===t||void 0===t?void 0:t.group.name,sectionName:null===t||void 0===t?void 0:t.tab.name,attachment:!!(B||L.length>0),postUrl:window.location.origin+(0,d.createPostDetailPageRouteFromSlug)(t)}),L.length>0&&(i=(await u.K$.uploadImagesToComment(n,t.id,s,L)).post),B&&(i=(await u.K$.uploadDocumentToComment(n,t.id,s,B)).post),R([]),z(null),T(""),q.current&&window.setTimeout((()=>{q.current.style.height="auto"}),0),O(!1),void r(i)}catch(o){O(!1)}},disabled:!M,isLoading:I})]})]}),L.length>0?(0,E.jsxs)("div",{className:"preview-image mb-2",children:[(0,E.jsx)("img",{className:"h-40 w-full",src:URL.createObjectURL(L[0]),alt:"CommentImage"}),(0,E.jsx)("span",{className:"remove",onClick:e=>{R([])},children:"\xd7"})]}):(0,E.jsx)(E.Fragment,{}),H.length>0?(0,E.jsxs)("div",{className:"preview-video",children:[(0,E.jsx)("div",{className:"mt-2 py-1",children:(0,E.jsx)("video",{className:"m-0 w-full",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:URL.createObjectURL(H[0])})})}),(0,E.jsx)("span",{className:"remove",onClick:e=>{W([])},children:"\xd7"})]}):(0,E.jsx)(E.Fragment,{}),B&&["mp4","mov","webm","ogg"].includes(B.name.split(".").pop())?(0,E.jsxs)("div",{className:"preview-video",children:[(0,E.jsx)("div",{className:"mt-2 py-1",children:(0,E.jsx)("video",{className:"m-0",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:URL.createObjectURL(B)})})}),(0,E.jsx)("span",{className:"remove",onClick:e=>{z(null)},children:"\xd7"})]}):(0,E.jsx)(D,{document:B,isSubComment:s,subDocument:V,setDocument:z,setSubDocument:G}),(0,E.jsx)(j.A,{isRecorderVisible:F,setIsRecorderVisible:U,setRecording:e=>{s?(W([]),R([]),G([]),G([e])):(R([]),z(e))}}),(0,E.jsx)(b.c,{active:$.length>0,header:"Message",buttons:[{label:"OK",type:"primary",onClick:()=>{Q([])}}],children:(0,E.jsxs)("div",{className:"flex flex-col px-4 pb-4",children:[(0,E.jsx)("p",{className:"font-bold",children:"The following links are restricted and cannot be used in the comment"}),(0,E.jsx)("ul",{className:"ml-4 list-decimal",children:$.map((e=>(0,E.jsx)("li",{className:"text-secondary-foreground/80 text-sm",children:e},e)))})]}),setActive:e=>{Q([])},onSubmit:()=>{Q([])}})]})}):(0,E.jsxs)("section",{className:"border-b border-l border-r border-border bg-background p-4",children:[(0,E.jsx)("span",{className:"cursor-pointer text-primary",onClick:e=>{(0,c.D4)(m)},children:"Sign in"})," ",(0,E.jsx)("span",{children:"to add a comment,"})]})}))},63133:(e,t,n)=>{"use strict";n.d(t,{I:()=>M,L:()=>I});var r=n(20975),o=n(25715),i=n(93092),s=n(5564),a=n.n(s),l=n(72006),c=n.n(l),d=n(34067),u=n(62270),p=n(55049),h=n(78220),m=n(38545),f=n(43039),g=n(35084),b=n(60553),v=n(68150),y=n(53871),k=n(8934),w=n(27376),x=n(90559),_=n(2016),A=n(19328),C=n(30725),S=n(62144),j=n(85306),E=n(62391);const N=new d.F,P=300;function D(e){let{description:t,isExpanded:n,setIsExpanded:r}=e;const o=N.render(t),i=t.length>P,s=i&&!n?N.render(t.slice(0,P)+"..."):o;return(0,E.jsxs)("div",{className:"text-xs font-light",style:{wordBreak:"break-word",overflowWrap:"anywhere"},children:[(0,E.jsx)("div",{dangerouslySetInnerHTML:{__html:s}}),i&&(0,E.jsx)("span",{className:"cursor-pointer text-xs font-medium text-primary",onClick:()=>r(!n),children:n?" Read less":" Read more"})]})}function M(e){let{post:t,user:n,group:s,comment:l,postId:d,updatePost:S,updateComment:N,addToast:P,community:M}=e;const I=(0,u.A)(),[O,L]=(0,r.useState)(!1),[R,B]=(0,r.useState)(!1),[z,F]=(0,r.useState)([]),[U,V]=(0,r.useState)(!1),[G,H]=(0,r.useState)(!1),[W,q]=(0,r.useState)(!1),[K,Y]=(0,r.useState)(null),[$,Q]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(!1),[X,ee]=(0,r.useState)(!1),{profileModelState:{setShowProfileModel:te,setIdToViewProfile:ne}}=(0,p.A)();(0,r.useEffect)((()=>{F(l.replies?l.replies:[])}),[l.replies]);const re=()=>{B(!R)},oe=e=>{f.K$.addCommentReaction(n,d,l.id,e).then((e=>{let{comment:t}=e;N(t)})).catch((e=>{console.log({err:e})}))},ie=e=>{let t=z.filter((t=>t.id!==e.id));F(t)};(0,r.useEffect)((()=>{const e=e=>{q(e.target.src)};return document.querySelectorAll("#PostComment PostImages PostImage img").forEach((t=>{t.addEventListener("click",e)})),()=>{document.querySelectorAll("#PostComment PostImages PostImage img").forEach((t=>{t.removeEventListener("click",e)}))}}),[t]);c().duration(c()(new Date).diff(c()(l.createdAt))).asDays();const se=l.id?"PostComment_"+l.id:null;return(0,r.useEffect)((()=>{if(se){document.querySelectorAll("#".concat(se," pre>code")).forEach((e=>{const t=e.parentElement;t.style.position="relative";const n=document.createElement("span");n.style.position="absolute",n.style.top="0px",n.style.right="5px",n.style.cursor="pointer",n.innerText="Copy",n.onclick=async()=>{try{return void await navigator.clipboard.writeText(e.innerText)}catch(n){console.error("Cannot copy to clipboard, trying legacy")}const t=document.createElement("textarea");t.value=e.innerText,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),P("Copied to clipboard")},t.appendChild(n)}))}}),[l.description]),l.isProhibited&&!l.isUnblockable?(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)("div",{className:"flex",children:[(0,E.jsx)("div",{className:"mt-3",children:(0,E.jsx)("div",{className:"cursor-disabled",children:(0,E.jsx)(k.eu,{user:{name:"Unknown",picture:h.vZ.misc.defaultImageFromBackendUrl},showDetailsOnHover:!0,noName:!0,onClick:e=>{}})})}),(0,E.jsx)("div",{className:"PostComment my-2 w-full rounded bg-background pl-3 pt-1",children:(0,E.jsx)("span",{className:"text-xs text-secondary-foreground/70",children:"This content is not available to you"})})]})}):(0,E.jsxs)(E.Fragment,{children:[W&&["png","jpg","jpeg","gif"].includes(W.split(".").pop())?(0,E.jsx)("div",{className:"PostImageFullPreview",onClick:e=>{q(null)},children:(0,E.jsxs)("div",{className:"holder",children:[(0,E.jsx)("img",{src:W,alt:"Preview",loading:"lazy"}),(0,E.jsx)(_.A,{icon:"plus",rotate:45,className:"close-button",onClick:e=>{q(null)}})]})}):(0,E.jsx)(E.Fragment,{}),(0,E.jsxs)("div",{className:"flex",children:[(0,E.jsxs)("div",{className:"mt-3",children:[(0,E.jsx)("div",{className:"cursor-pointer",children:(0,E.jsx)(k.eu,{user:l.createdBy,noName:!0,onClick:e=>{ne(l.createdBy.id),te(!0)}})}),R?(0,E.jsx)("div",{className:"avatar-thread-border ml-4 mt-3 border-l-2 border-border"}):(0,E.jsx)(E.Fragment,{})]}),(0,E.jsxs)("div",{id:se,className:"my-1 w-full",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between",children:[(0,E.jsx)("div",{className:"",children:(0,E.jsx)(k.eu,{user:l.createdBy,extraInfo:(0,g.f)(l.createdAt),noPicture:!0,showSubtitle:!0,showDotSeperator:!0,size:36,className:"cursor-pointer",onClick:e=>{ne(l.createdBy.id),te(!0)}})}),(0,E.jsx)(C.A,{contentLink:window.location.origin+(0,m.createPostDetailPageRouteFromSlug)(t),community:M,addToast:P,activeProps:{active:Z,setActive:J},displayProps:{displayClosePrompt:X,setDisplayClosePrompt:ee},content:"post-comment: description: "+l.description}),(0,E.jsx)(o.A,{icon:"menu-dots",actions:[{icon:"trash",label:n&&l.createdBy&&l.createdBy.id===n.id||t.canDeleteComment?"Delete":"",onClick:e=>{L(!0),H(!0),L(!1)},actionType:o.X.alert},{icon:"flag",label:"Report",onClick:e=>{J(!0)}}],hideOnEmpty:!0}),(0,E.jsx)(b.c,{active:G,setActive:H,header:"Delete Comment",title:"Are you sure you want to delete this comment?",onSubmit:e=>{f.K$.deleteComment(n,d,l.id).then((e=>{S(e.post),P("Comment deleted!")})).catch((e=>{L(!1)}))}})]}),(0,E.jsx)(D,{description:l.description,isExpanded:U,setIsExpanded:V}),(0,E.jsxs)("div",{className:"PostImages",children:[l.images&&l.images.length>0?(0,E.jsx)(i.WE,{image:l.images[0],className:a()("object-cover object-center",{"h-40 max-w-max rounded":"gif"===l.images[0].split(".").pop()})}):(0,E.jsx)(E.Fragment,{}),(0,E.jsx)(i.gy,{post:l,smallMargin:!0})]}),(0,E.jsxs)("div",{className:"mt-1 flex items-center justify-between",children:[(0,E.jsxs)("div",{className:"flex items-center space-x-1",children:[l.reactions.details.map(((e,t)=>(0,E.jsxs)("div",{className:a()("mr-2 flex cursor-pointer items-center rounded px-1 py-0.5 text-xs font-light",{"bg-background text-secondary-foreground/90":e.isByMe,"theme-bg-disable":!e.isByMe}),onClick:t=>{e.isByMe?f.K$.removeCommentReaction(n,d,l.id).then((e=>{let{comment:t}=e;N(t)})).catch((e=>{console.log({err:e})})):oe(e.emoji)},title:"Reacted by "+e.users.map((e=>e.name)).join(", "),children:[(0,E.jsx)("span",{className:"pr-1",children:e.emoji}),(0,E.jsx)("span",{className:"pl-1",children:e.count})]},e.emoji+e.count+t))),(0,E.jsx)(v.A,{alignment:"left-1",dropdownClassName:"-left-32 sm:left-1",button:(0,E.jsx)(x.A,{icon:"grin-alt",size:"sm",iconClass:"text-secondary-foreground/70",className:"mr-2 mt-1.5",onClick:()=>{Q(!0)}}),children:$&&(0,E.jsx)(w.A,{emoji:null,hidePlaceholder:!0,setEmoji:e=>{oe(e)},visible:!0})}),(0,E.jsx)("div",{onClick:re,children:n?(0,E.jsx)("div",{className:"flex cursor-pointer items-center",children:(0,E.jsx)("span",{className:"text-xs font-light",children:(0,E.jsx)(y.A,{children:"Reply"})})}):(0,E.jsx)(E.Fragment,{})})]}),z&&z.length>0?(0,E.jsx)("div",{onClick:re,className:"mr-2",children:(0,E.jsx)("span",{className:"cursor-pointer text-xs font-light",children:"".concat(z.length," ").concat(z.length>1?I.trans("Replies"):I.trans("Reply"))})}):(0,E.jsx)(E.Fragment,{})]}),R?(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("div",{className:z.length>0?"mr-2 rounded":"mr-2 rounded pb-2",children:z.length>0?z.map(((e,r)=>(0,E.jsx)(T,{post:t,group:s,user:n,postId:t.id,commentRepliesArr:z,comment:l,reply:e,index:r,deleteSubComment:ie,updateComment:N,addToast:P},e.id))):(0,E.jsx)(E.Fragment,{})})}):(0,E.jsx)(E.Fragment,{}),R?(0,E.jsxs)("div",{className:"mr-4 pb-3",children:[R?(0,E.jsx)(E.Fragment,{}):(0,E.jsx)("div",{className:"mr-2 mt-4 border-t border-border"}),(0,E.jsx)("div",{className:"my-1",children:(0,E.jsx)(j.A,{post:t,user:n,updatePost:e=>{let t=[...z,e];F(t),B(!0)},commentId:l.id,isSubComment:!0})})]}):(0,E.jsx)(E.Fragment,{}),O?(0,E.jsx)("div",{className:"processing",children:(0,E.jsx)(A.a,{})}):(0,E.jsx)(E.Fragment,{})]},l.id)]})]})}function T(e){let{post:t,user:n,group:i,comment:s,reply:l,index:d,commentRepliesArr:u,postId:h,deleteSubComment:m,updateComment:y=(e=>{}),addToast:_}=e;const[C,S]=(0,r.useState)(!1),[j,P]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1),{profileModelState:{setShowProfileModel:T,setIdToViewProfile:O}}=(0,p.A)(),L=e=>{f.K$.addCommentReplyReaction(n,h,s.id,l.id,e).then((e=>{let{comment:t}=e;y(t)})).catch((e=>{console.log({err:e})}))},R=(c().duration(c()(new Date).diff(c()(l.createdAt))).asDays(),s.id?"PostSubComment_"+s.id:null);return(0,r.useEffect)((()=>{if(R){document.querySelectorAll("#".concat(R," pre>code")).forEach((e=>{const t=e.parentElement;t.style.position="relative";const n=document.createElement("span");n.style.position="absolute",n.style.top="0px",n.style.right="5px",n.style.cursor="pointer",n.innerText="Copy",n.onclick=async()=>{try{return void await navigator.clipboard.writeText(e.innerText)}catch(n){console.error("Cannot copy to clipboard, trying legacy")}const t=document.createElement("textarea");t.value=e.innerText,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),_("Copied to clipboard")},t.appendChild(n)}))}}),[s.description]),(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)("div",{id:R,className:"zm-auto mt-2 rounded border-t border-border pl-1 pt-1",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between",children:[(0,E.jsx)("div",{className:"text-sm",children:(0,E.jsx)(k.eu,{user:l.createdBy,extraInfo:(0,g.f)(l.createdAt),size:36,className:"cursor-pointer",subCommentAvatar:!0,onClick:e=>{O(l.createdBy.id),T(!0)}})}),(0,E.jsx)(o.A,{icon:"menu-dots",hideOnEmpty:!0,actions:[{label:n&&l.createdBy&&l.createdBy.id===n.id||t.canDeleteReply?"Delete":"",onClick:e=>{M(!0),P(!0)},actionType:o.X.alert,icon:"trash"}]}),(0,E.jsx)(b.c,{active:j,setActive:P,header:"Delete Reply",title:"Are you sure you want to delete this reply?",onSubmit:e=>{f.K$.deleteSubComment(n,h,s.id,l.id).then((e=>{m(e.commentReply),M(!1),_("Reply Deleted")})).catch((e=>{M(!1)}))}})]}),(0,E.jsxs)("div",{className:"pl-12",children:[(0,E.jsx)("div",{className:"pb-1 text-xs font-light",style:{wordBreak:"break-word",overflowWrap:"anywhere"},dangerouslySetInnerHTML:{__html:N.render(l.description)}}),(0,E.jsx)("div",{className:"PostSubCommentDocumentPreview",children:l.documents.length>0?(0,E.jsx)(I,{reply:l,smallMargin:!0}):(0,E.jsx)(E.Fragment,{})}),(0,E.jsx)("div",{className:"mt-1 flex items-center justify-between",children:(0,E.jsxs)("div",{className:"flex items-center",children:[l.reactions.details.map(((e,t)=>(0,E.jsxs)("div",{className:a()("mr-2 flex cursor-pointer items-center rounded px-1 py-0.5 text-xs font-light",{"theme-text-on-default bg-background":e.isByMe,"theme-bg-disable":!e.isByMe}),onClick:t=>{e.isByMe?f.K$.removeCommentReplyReaction(n,h,s.id,l.id).then((e=>{let{comment:t}=e;y(t)})).catch((e=>{console.log({err:e})})):L(e.emoji)},title:"Reacted by "+e.users.map((e=>e.name)).join(", "),children:[(0,E.jsx)("span",{className:"pr-1",children:e.emoji}),(0,E.jsx)("span",{className:"pl-1",children:e.count})]},e.emoji+e.count+t))),(0,E.jsx)(v.A,{alignment:"",dropdownClassName:"-left-24 sm:left-1",button:(0,E.jsx)(x.A,{icon:"grin-alt",size:"md",iconClass:"text-secondary-foreground/70",className:"mt-1 h-4",onClick:()=>{S(!0)}}),children:C&&(0,E.jsx)(w.A,{emoji:null,hidePlaceholder:!0,setEmoji:e=>{L(e)},visible:!0})})]})})]}),(0,E.jsx)("div",{className:u&&u.length-1===d?"":"ml-12 mt-2"}),D?(0,E.jsx)("div",{className:"processing",children:(0,E.jsx)(A.a,{})}):(0,E.jsx)(E.Fragment,{})]},l.id)})}function I(e){let{reply:t,activityType:n="",isActivity:o=!1}=e;const[i,s]=(0,r.useState)(null),l=["mp4","mov","webm","ogg"],c=["png","jpg","jpeg","gif","blob"],[d,u]=(0,r.useState)("");return(0,r.useEffect)((()=>{""==n||"comment-reply"==n?u(t.documents.length>0?t.documents[0].location.split(".").pop():""):t.images&&t.images.length>0?u(t.images[0].split(".").pop()):t.document&&""!==t.document&&u(t.document.split(".").pop())}),[]),(0,E.jsxs)(E.Fragment,{children:[i&&c.includes(i.split(".").pop())?(0,E.jsx)("div",{className:"PostImageFullPreview",onClick:e=>{s(null)},children:(0,E.jsxs)("div",{className:"holder",children:[(0,E.jsx)("img",{src:i,alt:"Preview"}),(0,E.jsx)(_.A,{icon:"plus",rotate:45,className:"close-button",onClick:e=>{s(null)}})]})}):(0,E.jsx)(E.Fragment,{}),""===n||"comment-reply"===n?(0,E.jsx)("div",{className:"PostComment m-auto mt-2",children:l.includes(d)&&t.documents.length>0?(0,E.jsx)("div",{className:"mt-2 py-1 pl-12 pr-4",children:(0,E.jsx)("video",{className:"m-0 h-64 w-full rounded-md object-cover",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:t.documents[0].location})})}):["wav","mp3","aac","amr"].includes(d)&&t.documents.length>0?(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("div",{className:"mt-2 py-1 pl-12 pr-4",children:(0,E.jsx)("audio",{className:"m-0 w-full rounded-md py-1",controls:!0,controlsList:"nodownload",children:(0,E.jsx)("source",{src:t.documents[0].location})})})}):c.includes(d)&&t.documents.length>0?(0,E.jsx)("div",{className:"PostImage relative w-full pl-12 pr-2",children:(0,E.jsx)("img",{onClick:e=>s(e.target.src),alt:"",className:a()("w-full rounded-md object-cover object-center",{"h-40 max-w-max rounded":"gif"===t.documents[0].location.split(".").pop(),"h-60":"gif"===!t.documents[0].location.split(".").pop()}),src:t.documents[0].location})}):t.documents.length>0?(0,E.jsx)("div",{className:"relative m-2 ml-12",children:(0,E.jsxs)("a",{download:!0,target:"_blank",rel:"noreferrer",href:t.documents.length>0&&!o?t.documents[0].location:"/#",title:"Open file",className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold",children:[(0,E.jsx)(S.A,{icon:"document",className:"h-9 text-3xl"}),(0,E.jsxs)("div",{className:"flex flex-grow items-center justify-between space-x-4",children:[(0,E.jsxs)("div",{className:"items-center",children:[(0,E.jsx)("div",{children:t.documents.length>0?t.documents[0].name:""}),(0,E.jsx)("div",{className:"text-xs uppercase",children:t.documents.length>0?t.documents[0].name.split(".").pop():""})]}),(0,E.jsx)("span",{className:"flex-none",children:(0,E.jsx)(S.A,{icon:"download",className:"text-xl"})})]})]})}):(0,E.jsx)(E.Fragment,{})},t.id):(0,E.jsx)("div",{className:"PostComment m-auto mt-2",children:t.images.length>0&&c.includes(d)?(0,E.jsx)("div",{className:"PostImage relative w-full pl-12 pr-2",children:(0,E.jsx)("img",{className:a()("w-full rounded-md object-cover object-center",{"h-40 max-w-max rounded":"gif"===t.images[0].split(".").pop(),"h-60":"gif"===!t.images[0].split(".").pop()}),src:t.images[0],alt:""})}):t.document&&l.includes(d)?(0,E.jsx)("div",{className:"mt-2 py-1 pl-12 pr-4",children:(0,E.jsx)("video",{className:"m-0 h-64 w-full rounded-md object-cover",controls:!0,children:(0,E.jsx)("source",{src:t.document})})}):t.document&&""!==t.document?(0,E.jsx)("div",{className:"relative m-2 ml-12",children:(0,E.jsxs)("a",{download:!0,target:"_blank",rel:"noreferrer",href:"/#",title:"Open file",className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold",children:[(0,E.jsx)(S.A,{icon:"document",className:"h-9 text-3xl"}),(0,E.jsxs)("div",{className:"flex flex-grow items-center justify-between space-x-4",children:[(0,E.jsxs)("div",{className:"items-center",children:[(0,E.jsx)("div",{children:""!==t.documentName?t.documentName:""}),(0,E.jsx)("div",{className:"text-xs uppercase",children:t.document&&""!==t.document?t.document.split(".").pop():""})]}),(0,E.jsx)("span",{className:"flex-none",children:(0,E.jsx)(S.A,{icon:"download",className:"text-xl"})})]})]})}):(0,E.jsx)(E.Fragment,{})},t.id)]})}},34689:(e,t,n)=>{"use strict";n.d(t,{S:()=>c});var r=n(7711),o=n(53871),i=n(54617),s=n(22375),a=n(62391);const l=[{label:"Before Description",value:"top"},{label:"After Description",value:"bottom"}];function c(e){let{buttons:t,setButtons:n}=e;const c=(e,r)=>{const o=[...t];o[e]=r,n(o)};return(0,a.jsxs)("div",{id:"CreatePostCustomButton",children:[(0,a.jsx)("div",{className:"mb-1 font-bold",children:(0,a.jsx)(s._,{text:"ADD BUTTON"})}),t.map(((e,t)=>{return(0,a.jsxs)("div",{className:"mb-4 rounded border border-border p-4",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("div",{className:"w-1/2 pr-2",children:[(0,a.jsx)("div",{className:"font-bold",children:(0,a.jsx)(o.A,{children:"Button Label"})}),(0,a.jsx)(i.k,{placeholder:"Eg. Join, Buy, Learn more",className:"h-9",defaultValue:e.label,onChange:n=>{c(t,{...e,label:n})}})]}),(0,a.jsxs)("div",{className:"w-1/2 pl-2",children:[(0,a.jsx)("div",{className:"mb-3 font-bold",children:(0,a.jsx)(o.A,{children:"Button Position"})}),(0,a.jsx)(r.Ay,{className:"select cursor-pointer rounded border-border bg-card text-secondary-foreground",defaultValue:e.position,value:e.position,placeholder:(n=e.position,"bottom"===n?"After Description":"Before Description"),onChange:n=>{c(t,{...e,position:n.value})},options:l,styles:{control:(e,t)=>({...e,borderColor:"var(--theme-divider-color)",color:"var(--theme-default-text-color)",backgroundColor:"var(--bg-card)",cursor:"pointer"}),menu:(e,t)=>({...e,color:"var(--theme-heading-2-text-color)"}),menuList:(e,t)=>({...e,backgroundColor:"var(--theme-surface-color)",borderColor:"var(--theme-divider-color)"}),option:(e,t)=>{let{data:n,isDisabled:r,isFocused:o,isSelected:i}=t;return{fontFamily:n.label,padding:"5px 10px",...e,backgroundColor:i?"var(--bg-primary)":"var(--theme-surface-color)",cursor:"pointer",color:"var(--text-secondary-foreground/85)",":hover":{backgroundColor:"var(--theme-background-color)",color:"var(--theme-heading-1-text-color)"}}}}})]})]}),(0,a.jsx)("div",{className:"font-bold",children:(0,a.jsx)(o.A,{children:"Button URL"})}),(0,a.jsx)(i.k,{placeholder:"https://",className:"h-9",defaultValue:e.url,onChange:n=>{c(t,{...e,url:n})}})]},t);var n}))]})}},6949:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(5564),o=n.n(r),i=n(89449),s=n(83789),a=n(44427),l=n(78220);class c{static async uploadMedia(e,t,n,r){const o=new FormData;return null===n||void 0===n||n.forEach((e=>{o.append("".concat(r,"s[]"),e,e.fileName)})),a.A.post(l.vZ.media.uploadMedia(t,r),o,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}var d=n(29646),u=n(44139),p=n(69302),h=n(68108),m=n(62144),f=n(62391);const g=function(e){const{community:t,user:n,images:r=[],setImages:a,videos:l=[],setVideos:g,documents:b=[],setDocument:v,description:y,setDescription:k,isEmbedEditorVisible:w,setIsEmbedEditorVisible:x,isPollVisible:_,setIsPollVisibleVisible:A,isModalFullScreen:C,setAreFilesUploading:S,isRecorderVisible:j,setIsRecorderVisible:E,isGifPickerVisible:N,setIsGifPickerVisible:P,isButtonsSectionVisible:D,setIsButtonsSectionVisible:M,uploadedMedia:T,setUploadedMedia:I,setRemovedMediaUploadsOnEdit:O,addToast:L,disableSubmit:R=!0,isSavingPost:B=!1,onSubmitPost:z=(()=>{}),submitButtonLabel:F="Create Post"}=e,U=async e=>{S(!0);try{const r=await c.uploadMedia(n,t.id,e,s.A.IMAGE);I((e=>({...e,images:[...e.images,...r.publicUrls]})))}catch(r){console.log("Error: ",r),a([]),L("Something went wrong!","",i.lm.danger)}S(!1)};return(0,f.jsxs)("div",{className:"Toolbar sticky bottom-0 flex justify-between border-t border-border bg-card px-2 pb-3 pt-4 ".concat(C?"lg:left-1/4 lg:w-1/2":""),children:[(0,f.jsxs)("div",{className:"ToolbarIcon flex flex-nowrap items-center justify-start gap-x-2 text-secondary-foreground md:gap-x-4",children:[(0,f.jsx)(d.A,{label:"Picture",children:(0,f.jsx)(p.z,{accept:"image/*",maxFileSize:10,maxFiles:5,multiple:!0,disabled:5===r.length,onChange:e=>{if(e){var t=[...T.images,...e].slice(0,5);a(t),r.length>0?U([...e]):U(t)}},children:(0,f.jsx)("div",{className:o()("h-6 cursor-pointer hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":r.length>4}),children:(0,f.jsx)(m.A,{size:"lg",icon:"picture"})})})}),(0,f.jsx)(d.A,{label:"Video",children:(0,f.jsx)(p.z,{accept:"video/*",disabled:!1,onChange:e=>{g([e]),(async e=>{S(!0);try{const r=await c.uploadMedia(n,t.id,[e],s.A.VIDEO);I((e=>({...e,videos:[...e.videos,...r.publicUrls]})))}catch(r){console.log("Error: ",r),g([]),L("Something went wrong!","",i.lm.danger)}S(!1)})(e)},children:(0,f.jsx)("div",{className:o()("h-6 cursor-pointer hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":l.length>0}),children:(0,f.jsx)(m.A,{size:"lg",icon:"play-alt"})})})}),(0,f.jsx)(d.A,{label:"Attach file",children:(0,f.jsx)(p.z,{accept:"file/*",disabled:b.length>0,onChange:e=>{v([e]),(async e=>{S(!0);const r=await c.uploadMedia(n,t.id,[e],s.A.DOCUMENT);T.document[0]&&O((e=>[...e,T.document[0]])),I((e=>({...e,document:[...e.document,...r.publicUrls]}))),S(!1)})(e)},children:(0,f.jsx)("div",{className:o()("h-6 cursor-pointer hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":b.length>0}),children:(0,f.jsx)(m.A,{size:"lg",icon:"clip"})})})}),(0,f.jsx)(d.A,{label:"Poll",className:!A&&"hidden",children:(0,f.jsx)("button",{type:"button",className:"mt-1 h-6 hover:scale-110",onClick:()=>{A(!_)},children:(0,f.jsx)(m.A,{size:"lg",icon:"stats"})})}),(0,f.jsx)(d.A,{label:"Embed Code",className:!x&&"hidden",children:(0,f.jsx)("button",{type:"button",className:"h-6 hover:scale-110",onClick:()=>{x(!w)},children:(0,f.jsxs)("div",{className:"flex place-content-center",children:[(0,f.jsx)(m.A,{size:"sm",icon:"angle-left"}),(0,f.jsx)(m.A,{size:"sm",icon:"angle-right"})]})})}),(0,f.jsx)(d.A,{label:"Gif",className:!P&&"hidden",children:(0,f.jsx)("button",{type:"button",className:"hover:scale-110",onClick:()=>{r.length<5?P(!N):L("You can add 5 images or GIFs in total!","",i.lm.danger)},children:(0,f.jsx)("span",{className:"rounded border border-secondary-foreground px-1",children:"Gif"})})}),(0,f.jsx)(d.A,{label:"Custom buttons",className:!M&&"hidden",children:(0,f.jsx)("button",{type:"button",className:"hover:scale-110",onClick:()=>{M(!D)},children:(0,f.jsx)("span",{className:"rounded border border-secondary-foreground px-1",children:"Btn"})})}),(0,f.jsx)(d.A,{label:"Record Audio",children:(0,f.jsx)("button",{type:"button",className:"mt-1 h-6 hover:scale-110",onClick:()=>{0===(null===b||void 0===b?void 0:b.length)&&E(!j)},children:(0,f.jsx)("div",{className:o()("h-6 cursor-pointer hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":(null===b||void 0===b?void 0:b.length)>0}),children:(0,f.jsx)(m.A,{size:"lg",icon:"microphone"})})})})]}),(0,f.jsx)(h.A,{active:N,setActive:P,initialSearchQuery:"HAHA",onGifSelect:async e=>{var t,n,o,i;null!==e&&void 0!==e&&null!==(t=e.media)&&void 0!==t&&null!==(n=t[0].gif)&&void 0!==n&&n.url&&(I((t=>{var n,r;return{...t,images:[...t.images,null===e||void 0===e||null===(n=e.media)||void 0===n||null===(r=n[0].gif)||void 0===r?void 0:r.url]}})),a([...r,null===e||void 0===e||null===(o=e.media)||void 0===o||null===(i=o[0].gif)||void 0===i?void 0:i.url]));P(!1)}}),(0,f.jsx)(u.$,{label:F,disabled:R,onClick:z,isLoading:B,large:!0,className:"shrink-0 px-2 py-1 text-xs md:px-6 md:py-2 md:text-sm"})]})}},76136:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var r=n(20975),o=n(83789),i=n(72613),s=n(62391);const a=function(e){let{images:t=[],setImages:n=(()=>{}),onDelete:o=(e=>{}),uploadedMedia:i,setUploadedMedia:a=(()=>{}),setRemovedMediaUploadsOnEdit:c=(()=>{})}=e;const d=r.useMemo((()=>t&&0!==t.length?(0,s.jsx)(l,{images:t,setImages:n,onDelete:o,uploadedMedia:i,setUploadedMedia:a,setRemovedMediaUploadsOnEdit:c}):(0,s.jsx)(s.Fragment,{})),[null===t||void 0===t?void 0:t.length]);return t&&0!==t.length?(0,s.jsx)("div",{className:"SelectedImagesPreview",children:d}):(0,s.jsx)(s.Fragment,{})},l=r.memo((function(e){let{images:t=[],setImages:n=(()=>{}),onDelete:r=(e=>{}),uploadedMedia:a,setUploadedMedia:l=(()=>{}),setRemovedMediaUploadsOnEdit:c=(()=>{})}=e;return(0,s.jsx)(i.f,{images:t.map((e=>"string"!==typeof e?URL.createObjectURL(e):e)),onDelete:e=>{const i=[...a.images],s=i[e],d=i.filter(((t,n)=>n!==e));n(d),l((e=>({...e,images:d}))),c((e=>[...e,{mediaItem:s,type:o.A.IMAGE}])),r(t[e])}})}))},97482:(e,t,n)=>{"use strict";n.d(t,{Xb:()=>$,Ay:()=>Y});var r=n(5564),o=n.n(r),i=n(41745),s=n(72006),a=n.n(s),l=n(20975),c=n(73159),d=n.n(c),u=n(71214),p=n(89449),h=n(16478),m=n(65186),f=n(62270),g=n(9175),b=n(83789),v=n(38545),y=n(43039),k=n(6714),w=n(2155),x=n(76224),_=n(53871),A=n(44139),C=n(23184),S=n(21788),j=n(90559),E=n(91900),N=n(22393),P=n(62144),D=n(63624),M=n(15102),T=n(3622),I=n(62391);function O(e){const{isPollVisible:t,errors:n,isQuestion:r,setIsQuestion:o,isQuiz:i,setIsQuiz:s,isPoll:a,setIsPoll:l,quizTitle:c,setQuizTitle:d,quizDuration:u,setQuizDuration:p,quizInstruction:h,setQuizInstruction:m,quizQuestions:f,setQuizQuestions:g,endTime:b,setEndTime:v}=e;return(0,I.jsx)(M.y,{IsDisplay:t,transition:"scale",children:(0,I.jsx)("div",{className:"mb-2 rounded border border-border bg-background p-4",children:(0,I.jsx)(T.Q,{errors:n&&n.poll?n.poll:null,isQuestion:r,setIsQuestion:o,isQuiz:i,isPoll:a,setIsQuiz:e=>{s(!0),l(!1)},quizTitle:c,setQuizTitle:d,quizDuration:u,setQuizDuration:p,quizInstruction:h,setQuizInstruction:m,quizQuestions:f,setQuizQuestions:g,endTime:b,setEndTime:v})})})}var L=n(34689),R=n(6949),B=n(76136),z=n(21143),F=n(68133),U=n(76653),V=n(66104),G=n(66530),H=n(31894);const W=l.lazy((()=>n.e(630).then(n.bind(n,54630)))),q=new u.A,K={statement:"",options:["","","",""],answer:""};function Y(e){var t,n;let{community:r,user:s,group:c,groups:u,sectionId:g,setActive:E=(e=>{}),addPost:M=(e=>{}),addToast:T,isModalFullScreen:Y,setIsModalFullScreen:Z=(e=>{}),isAdvanceSettingsOpen:J=!1,setIsAdvanceSettingsOpen:X=(e=>{}),closePrompt:ee}=e;const{analyticsService:te}=(0,m.W)(),{post:ne,topics:re}=(0,h.G)((e=>({post:e.post,topics:e.communityTopics.topics}))),[oe,ie]=(0,l.useState)([]),[se,ae]=(0,l.useState)(""),[le,ce]=(0,l.useState)(""),[de,ue]=(0,l.useState)([]),[pe,he]=(0,l.useState)([]),[me,fe]=(0,l.useState)([]),[ge,be]=(0,l.useState)(null),[ve,ye]=(0,l.useState)(!1),[ke,we]=(0,l.useState)(""),[xe,_e]=(0,l.useState)(""),[Ae,Ce]=(0,l.useState)(!1),[Se,je]=(0,l.useState)(!1),[Ee,Ne]=(0,l.useState)(!1),[Pe,De]=(0,l.useState)(""),[Me,Te]=(0,l.useState)(10),[Ie,Oe]=(0,l.useState)([K]),[Le,Re]=(0,l.useState)(""),[Be,ze]=(0,l.useState)(!0),[Fe,Ue]=(0,l.useState)(!1),[Ve,Ge]=(0,l.useState)(a()().add(12,"h")),[He,We]=(0,l.useState)(!1),[qe,Ke]=(0,l.useState)([{label:"",url:"",position:"top"}]),[Ye,$e]=(0,l.useState)(!1),[Qe,Ze]=(0,l.useState)(null),[Je,Xe]=(0,l.useState)(null),[et,tt]=(0,l.useState)(null),[nt,rt]=(0,l.useState)(null),[ot,it]=(0,l.useState)(null),[st,at]=(0,l.useState)(null),[lt,ct]=(0,l.useState)(null),[dt,ut]=(0,l.useState)(!1),[pt,ht]=(0,l.useState)(!1),[mt,ft]=(0,l.useState)(!1),[gt,bt]=(0,l.useState)(!1),[vt,yt]=(0,l.useState)(!1),[kt,wt]=(0,l.useState)(),[xt,_t]=(0,l.useState)(!1),[At,Ct]=(0,l.useState)(!1),[St,jt]=(0,l.useState)({images:[],videos:[],document:[],banner:[]}),[Et,Nt]=(0,l.useState)(null),[Pt,Dt]=(0,l.useState)(!0),[Mt,Tt]=(0,l.useState)(!0),[It,Ot]=(0,l.useState)(!0),[Lt,Rt]=(0,l.useState)(!0),[Bt,zt]=(0,l.useState)(!1),[Ft,Ut]=(0,l.useState)(!1),[Vt,Gt]=(0,l.useState)(!1),[Ht,Wt]=(0,l.useState)([]),qt=null===re||void 0===re?void 0:re.filter((e=>"ACTIVE"===e.status)),Kt=(0,f.A)(),Yt=null===r||void 0===r||null===(t=r.configurables)||void 0===t?void 0:t.COMMUNITY_DEFAULT_POST_SECTION,[$t,Qt]=(0,l.useMemo)((()=>{try{const e=u.find((e=>e.tabs.find((e=>e.id===Yt)))),t=null===e||void 0===e?void 0:e.tabs.find((e=>e.id===Yt));return[e,t]}catch(e){return[null,null]}}),[u,Yt]),[Zt,Jt]=(0,l.useState)(null!==c&&void 0!==c?c:$t),[Xt,en]=(0,l.useState)(null!==(n=Zt&&Zt.tabs.find((e=>e.id==g)))&&void 0!==n?n:Qt),tn=((e,t,n,r)=>{if(ne.postTimerLimit){const e=(new Date).getTime()-(ne.lastPostCreatedTime&&new Date(ne.lastPostCreatedTime).getTime()||0)>1e3*ne.postTimerLimit;if(!["admin","moderator"].includes(null===c||void 0===c?void 0:c.myRole)&&!e)return!1}const o=!Se||!!(Be||Fe||Ee)&&(0===Pe.length&&0===(null===(e=Ie[0])||void 0===e||null===(t=e.statement)||void 0===t?void 0:t.length)&&0===(null===(n=Ie[0])||void 0===n?void 0:n.answer.length));return!0!==Et&&!((0===(null===se||void 0===se?void 0:se.length)||0===(null===se||void 0===se||null===(r=se.trim())||void 0===r?void 0:r.length))&&0===(null===le||void 0===le?void 0:le.length)&&o&&0===de.length&&0===pe.length&&0===me.length)})();(0,l.useEffect)((()=>{(async()=>{try{if(ne.postTimerLimit||k.M.dispatch((0,w.m5)()),!ne.lastPostCreatedTime){const{lastPostCreatedTime:e}=await y.BE.getLastPostCreatedTimeInCommunity(r.id);k.M.dispatch((0,w.Em)(e))}}catch(e){T("Couldn't fetch last post created time for the user","",p.lm.danger),console.error("Couldn't fetch last post created time for the user: ",e)}})()}),[ne.lastPostCreatedTime,ne.postTimerLimit]),(0,l.useEffect)((()=>{if(g){const e=c.tabs.find((e=>e.id===g));e&&(Tt(e.emailNotificationOnNewPost),Dt(e.pushNotificationOnNewPost))}}),[c,g]);(0,l.useEffect)((()=>{ee.displayClosePrompt&&(nn(!0),ee.setDisplayClosePrompt(!1))}),[ee.displayClosePrompt]);const nn=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&tn&&!window.confirm(Kt.trans("Are you sure you want to discard current post?"))||(ae(""),ce(""),we(""),_e(""),ze(!1),Ue(!1),Ne(!1),De(""),Oe([K]),ue([]),he([]),fe([]),be(null),ct(null),E(!1),rn())};function rn(){Ze(null),rt(null),it(null),at(null),Xe(null),tt(null)}const[on,sn]=l.useState(!1);return(0,I.jsx)("div",{children:J?(0,I.jsxs)("div",{className:"flex flex-col bg-card p-4 ".concat(Y&&"mx-auto h-[100vw] max-w-[50%]"),children:[(0,I.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,I.jsxs)("div",{className:"flex items-center bg-card p-4",children:[(0,I.jsx)(j.A,{icon:"arrow-left",solid:!0,className:"mt-0.5",size:"xs",onClick:()=>{X(!1)}}),(0,I.jsx)("h3",{className:"ml-2.5 text-base font-bold",children:(0,I.jsx)(_.A,{children:"Settings"})})]}),(0,I.jsx)(A.$,{onClick:()=>{X(!1)},label:"Done",className:"h-10 w-40 text-sm font-semibold",large:!0})]}),(0,I.jsxs)("div",{className:"flex flex-col px-5 py-5",children:[(0,I.jsxs)("span",{className:"flex items-center space-x-2 text-xs font-bold hover:cursor-pointer",onClick:()=>{Ot(!It)},children:[(0,I.jsx)(_.A,{children:"POST CUSTOMIZATION"}),(0,I.jsx)("span",{children:(0,I.jsx)(P.A,{icon:"caret-down",size:"xs",className:"ml-1"})})]}),It&&(0,I.jsx)("div",{className:"my-1 mb-5 flex flex-col space-y-3 rounded bg-card",children:(0,I.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{bt(!gt)},children:[(0,I.jsx)(N.A,{selectedOption:gt,setSelectedOption:bt}),(0,I.jsx)(_.A,{children:"Hide Likes from the post"})]}),(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{ft(!mt)},children:[(0,I.jsx)(N.A,{selectedOption:mt,setSelectedOption:ft}),(0,I.jsx)(_.A,{children:"Hide Comment from the post"})]}),(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{yt(!vt)},children:[(0,I.jsx)(N.A,{selectedOption:vt,setSelectedOption:yt}),(0,I.jsx)(_.A,{children:"Hide profile detail from the post"})]}),(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{vt||_t(!xt)},children:[(0,I.jsx)(N.A,{selectedOption:xt,setSelectedOption:_t,disabled:vt}),(0,I.jsx)("span",{className:o()("",{"text-secondary-foreground/70":vt}),children:(0,I.jsx)(_.A,{children:"Hide date & time from the post"})})]}),(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{Ct(!At)},children:[(0,I.jsx)(N.A,{selectedOption:At,setSelectedOption:Ct}),(0,I.jsx)("span",{children:(0,I.jsx)(_.A,{children:"Custom date for post"})})]}),At&&(0,I.jsxs)("div",{className:"flex w-52 cursor-pointer items-center rounded border border-border bg-background bg-card px-2 py-2 outline-none",children:[(0,I.jsx)(d(),{className:"w-24 outline-none",selected:kt,maxDate:new Date,onChange:e=>{wt(new Date(e))},shouldCloseOnSelect:!0,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,timeCaption:"time",placeholderText:"Select date",dateFormat:"dd - MM - yyyy"}),(0,I.jsx)("div",{className:"mr-1 h-4 w-1 border-r border-border"}),(0,I.jsx)("div",{className:"select-none rounded",children:(0,I.jsxs)("div",{className:"text-center text-secondary-foreground/85",children:[kt&&(0,i.default)(kt," h:mm a"),!kt&&(0,I.jsx)("h4",{className:"p-0 text-secondary-foreground/70",children:(0,I.jsx)(_.A,{children:"time"})})]})})]})]})}),(0,I.jsxs)("div",{className:"mt-4",children:[(0,I.jsxs)("span",{className:"flex items-center space-x-2 text-xs font-bold hover:cursor-pointer",onClick:()=>{Rt(!Lt)},children:[(0,I.jsx)(_.A,{children:"NOTIFICATIONS"}),(0,I.jsx)("span",{children:(0,I.jsx)(P.A,{icon:"caret-down",size:"xs",className:"ml-1"})})]}),Lt&&(0,I.jsxs)("div",{className:"mt-4",children:[Tt&&(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{Tt(!Mt)},children:[(0,I.jsx)(N.A,{selectedOption:Mt,setSelectedOption:Tt}),(0,I.jsx)(_.A,{children:"Send Email Notification"})]}),Dt&&(0,I.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{Dt(!Pt)},children:[(0,I.jsx)(N.A,{selectedOption:Pt,setSelectedOption:Dt}),(0,I.jsx)(_.A,{children:"Send Push Notification"})]})]})]}),(0,I.jsx)(S.jX,{community:r,active:Ye,setActive:$e,slug:null===Qe?(0,S.xx)(se):Qe,slugPrefix:"p",setSlug:Ze,title:null===Je?se:Je,setTitle:Xe,description:null===et?q.turndown(le):et,setDescription:tt,OGTitle:null===nt?se:nt,setOGTitle:rt,OGDescription:null===ot?q.turndown(le):ot,setOGDescription:it,OGImage:st,setOGImage:at,OgImageSubtitle:"By default it will take up the image uploaded with the post",isSEOSettingsInputsVisible:Bt,setIsSEOSettingsInputsVisible:zt,isOpenGraphInputsVisible:Ft,setIsOpenGraphInputsVisible:Ut,clearSlugMeta:rn})]})]}):(0,I.jsx)("div",{children:(0,I.jsxs)("div",{className:"CreatePostCard flex flex-col rounded-[20px] bg-card p-4 ".concat(Y&&"min-h-[100vh]"),children:[(0,I.jsx)(l.Suspense,{fallback:(0,I.jsx)("div",{className:"h-[50.5px] w-full"}),children:(0,I.jsx)(W,{setActive:E,selectedGroup:Zt,setSelectedGroup:Jt,selectedTab:Xt,setSelectedTab:en,groups:u,isModalFullScreen:Y,setIsModalFullScreen:Z,setIsAdvanceSettingsOpen:X,activeModal:on,setActiveModal:sn,areFilesUploading:Et})}),(0,I.jsxs)("div",{className:"flex flex-col px-4 lg:mx-auto ".concat(Y?"lg:min-w-[50vw] lg:max-w-[50vw]":"w-full"),children:[(0,I.jsx)(D.u,{user:s,community:r,coverPicture:ge,setCoverPicture:be,setAreFilesUploading:Nt,setUploadedMedia:jt,uploadedMedia:St}),(0,I.jsx)(G.t,{title:se,setTitle:ae,description:le,errors:lt,setErrors:ct}),(0,I.jsx)(B.f,{images:de,setImages:ue,uploadedMedia:St,setUploadedMedia:jt}),(0,I.jsx)(H.d,{videos:pe,setVideos:he,setUploadedMedia:jt,areFilesUploading:Et}),(0,I.jsx)("div",{className:"mb-3 border-b border-border"}),(0,I.jsx)(U.g,{description:le,setDescription:ce,user:s,community:r,isModalFullScreen:Y,isPollVisible:Se}),(0,I.jsxs)("div",{className:"flex h-fit w-full flex-wrap items-center p-0.5",children:[null===Ht||void 0===Ht?void 0:Ht.map((e=>(0,I.jsxs)("div",{className:"mx-1 my-1 flex justify-center gap-2 rounded-2xl px-4 py-0.5 hover:cursor-pointer",style:{backgroundColor:e.bgColor,color:e.textColor},children:[(0,I.jsx)("span",{children:e.name}),(0,I.jsx)("span",{onClick:()=>{Wt((t=>{if(t.includes(e))return t.filter((t=>t!==e))}))},children:(0,I.jsx)(P.A,{icon:"cross",size:"xxs",className:"mt-0.5"})})]}))),(null===qt||void 0===qt?void 0:qt.length)>0&&(0,I.jsxs)("h3",{className:"my-1.5 flex w-fit min-w-28 items-center rounded bg-accent px-1.5 py-0.5 text-sm hover:cursor-pointer",onClick:()=>{Gt(!0)},children:[(0,I.jsx)("span",{className:"text-xs font-semibold text-secondary-foreground",children:"Select Topic"}),(0,I.jsx)(P.A,{icon:"caret-down",size:"text-sm",className:"ml-1 mt-0.5"}),(0,I.jsx)($,{active:Vt,setActive:Gt,availableTopics:qt,selectedTopics:Ht,setSelectedTopics:Wt,isPostCreateSelectTopic:!0})]})]}),(0,I.jsx)(F.A,{documents:me,setDocument:fe,setUploadedMedia:jt,areFilesUploading:Et}),(0,I.jsx)(O,{isPollVisible:Se,errors:lt,isQuestion:Fe,setIsQuestion:Ue,isQuiz:Ee,setIsQuiz:e=>{Ne(!0),ze(!1)},isPoll:Be,setIsPoll:ze,quizTitle:Pe,setQuizTitle:De,quizDuration:Me,setQuizDuration:Te,quizInstruction:Le,setQuizInstruction:Re,quizQuestions:Ie,setQuizQuestions:Oe,endTime:Ve,setEndTime:Ge}),(0,I.jsx)(V.A,{isEmbedEditorVisible:ve,embedCode:ke,setEmbedCode:we,embedCodeHeight:xe,setEmbedCodeHeight:_e,isVisible:!(!Zt||!["admin","moderator"].includes(Zt.myRole))}),He?(0,I.jsx)(L.S,{buttons:qe,setButtons:Ke}):(0,I.jsx)(I.Fragment,{}),(0,I.jsx)(z.A,{isRecorderVisible:Ae,setIsRecorderVisible:Ce,setRecording:e=>{(async e=>{Nt(!0);const t=await y.u1.uploadMedia(s,r.id,[e],b.A.DOCUMENT);jt((e=>({...e,document:[...t.publicUrls]}))),Nt(!1)})(e),fe([e])}})]}),(0,I.jsx)(Q,{lastPostCreatedTime:ne.lastPostCreatedTime,postTimeLimitConfigurable:ne.postTimerLimit}),(0,I.jsx)(R.A,{community:r,user:s,images:de,setImages:ue,videos:pe,setVideos:he,documents:me,setDocument:fe,isEmbedEditorVisible:ve,setIsEmbedEditorVisible:Zt&&["admin","moderator"].includes(Zt.myRole)?ye:null,isModalFullScreen:Y,setAreFilesUploading:Nt,isPollVisible:Se,setIsPollVisibleVisible:e=>{e||(De(""),Oe([K])),je(e)},isGifPickerVisible:pt,setIsGifPickerVisible:ht,isButtonsSectionVisible:He,setIsButtonsSectionVisible:We,isRecorderVisible:Ae,setIsRecorderVisible:Ce,uploadedMedia:St,setUploadedMedia:jt,selectedTopics:Ht,addToast:T,disableSubmit:!tn,isSavingPost:dt,onSubmitPost:async e=>{if(c||Zt)try{var t,n;const e=await(0,x.A)(le+se);if(e.length>0)return void ie(e);const o=le.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 "),i=null!==r&&void 0!==r&&null!==(t=r.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?le:q.turndown(o),l={title:se,description:i,groupId:Zt.id,embedCode:ke,embedCodeHeight:xe,tabId:null!==(n=null===Xt||void 0===Xt?void 0:Xt.id)&&void 0!==n?n:g,sendEmailNotification:Mt,sendPushNotification:Pt,topics:Ht.map((e=>e.id)),preferences:{hideComment:mt,hideLikes:gt,hideCreator:vt,hideDate:xt},createdAt:kt||null,meta:{slug:(0,S.xx)(null===Qe?(0,S.xx)(se):Qe),title:(0,S.cT)(null===Je?se:Je),description:(0,S.cT)(null===et?i:et),openGraphTitle:(0,S.cT)(null===nt?se:nt),openGraphDescription:(0,S.cT)(null===ot?i:ot),openGraphImage:st}};Se&&(Ee&&(l.poll={isQuiz:!0,isQuestion:!1,title:Pe,questions:Ie,duration:Me,endTime:a()().add(1,"month")}),Be&&(l.poll={isQuiz:!1,isQuestion:Fe,title:Pe,questions:Ie,duration:Me,endTime:Ve})),He&&(l.buttons=qe.filter((e=>{let{label:t,url:n}=e;return t&&n})));["images","videos","banner","document"].forEach((e=>{St[e]&&St[e].length>0&&(l[e]=St[e])}));const c=(0,C.T$)(l,de,pe,me);if(ct(c),c)return void console.log("errors",c);ut(!0);let d=await y.K$.createPost(s,l);M(d.post),k.M.dispatch((0,w.Em)(new Date)),te.track("create-post",{userType:r.myRole,groupName:Zt.name,sectionName:null===Xt||void 0===Xt?void 0:Xt.name,postType:Ee?"quiz":Be?"poll":me?"attachment":"none",postUrl:window.location.origin+(0,v.createPostDetailPageRouteFromSlug)(l)}),ut(!1),T("Post added successfully!"),nn()}catch(o){ut(!1),console.error({error:o}),o&&o.response&&o.response.data.errors&&o.response.data.errors.title&&ct({title:o.response.data.errors.title[0]}),T("Failed to create post. Please check post content and retry again.","",p.lm.danger)}else sn(!0)}})]})})})}function $(e){let{active:t,setActive:n,availableTopics:r,selectedTopics:o,setSelectedTopics:i=null,isPostCreateSelectTopic:s=!1,setSelectedFilteredTopic:a}=e;const{addToast:l}=(0,g.d)();return(0,I.jsx)(E.a,{active:t,setActive:n,overflow:"",padding:!1,width:"300px",children:(0,I.jsxs)("div",{className:"flex flex-col justify-end bg-card",children:[(0,I.jsxs)("div",{className:"mx-2 flex items-center justify-between border-b border-border px-4 py-2 text-sm",children:[(0,I.jsxs)("p",{className:"text-md font-bold",children:[(0,I.jsx)(_.A,{children:"Select Topic"})," "]}),(0,I.jsx)(j.A,{icon:"cross",hoverable:!0,size:"md",onClick:()=>{n(!1)}})]}),(0,I.jsx)("div",{children:null===r||void 0===r?void 0:r.map((e=>(0,I.jsx)("div",{className:"flex flex-col justify-center bg-card align-middle",children:(0,I.jsxs)("div",{className:"flex flex-row items-center",children:[(0,I.jsx)("div",{className:"mx-2 my-2 w-fit justify-center rounded-2xl px-4 py-0.5 hover:cursor-pointer",style:{backgroundColor:e.bgColor,color:e.textColor},onClick:()=>{s?(e=>{i((t=>t.includes(e)?null===t||void 0===t?void 0:t.filter((t=>t!==e)):o.length<3?(n(!1),[...t,e]):(l("You can only select up to 3 topics","",p.lm.danger),[...t])))})(e):(e=>{a({key:e.id,label:e.name,icon:"",bgColor:e.bgColor,textColor:e.textColor,isCommunityTopic:!0}),n(!1)})(e)},children:e.name}),s&&(null===o||void 0===o?void 0:o.includes(e))&&(0,I.jsx)(P.A,{icon:"check",className:"text-primary"})]})})))})]})})}const Q=e=>{let{lastPostCreatedTime:t,postTimeLimitConfigurable:n}=e;const r=()=>{const e=((new Date).getTime()-new Date(t).getTime())/1e3;return Math.floor(n-e)},[o,i]=(0,l.useState)(r());(0,l.useEffect)((()=>{if(o>0){const e=setTimeout((()=>{const e=r();e<=0?(i(0),k.M.dispatch((0,w.Em)(null))):i(e)}),1e3);return()=>clearTimeout(e)}}),[o,t,n]);return o>0&&(0,I.jsx)("div",{className:"theme-bg-disable mx-auto flex w-full justify-center rounded-t-[20px] border-l border-r border-t transition-transform duration-300 hover:cursor-pointer md:w-1/2",children:(0,I.jsxs)("p",{className:"text-sm font-normal",children:["You can create next post in:",(0,I.jsxs)("span",{className:"font-semibold text-primary",children:[" ",(e=>{const t=Math.floor(e/60),n=e%60;return"".concat(t,"m ").concat(n<10?"0":"").concat(n,"s")})(o)]})]})})}},68133:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(83789),o=n(36357),i=n(62144),s=n(62391);function a(e){var t,n,a;let{documents:l=null,setDocument:c=(e=>{}),setUploadedMedia:d=(()=>{}),setRemovedMediaUploadsOnEdit:u=(()=>{}),areFilesUploading:p=!1}=e;if(!l||0===l.length)return null;"object"!==typeof l&&(l=[l]);const h=l[0];return h?(0,s.jsxs)("div",{className:"SelectedDocumentPreview relative my-0.5",children:[["wav","mp3","aac","amr"].includes(h.name.split(".").pop())?(0,s.jsx)("div",{className:"flex items-center space-x-2 rounded-md pb-2",children:(0,s.jsx)("audio",{className:"m-0 w-full rounded-md",controls:!0,controlsList:"nodownload",children:(0,s.jsx)("source",{src:URL.createObjectURL(h)})})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold",children:[(0,s.jsx)(i.A,{icon:"document",className:"h-9 text-3xl"}),(0,s.jsxs)("div",{className:"flex flex-grow flex-col justify-between",children:[(0,s.jsx)("div",{children:(0,o.Bu)(h.name,60,!1)}),(0,s.jsx)("div",{className:"text-xs uppercase",children:null!==(t=null===h||void 0===h||null===(n=h.name)||void 0===n||null===(a=n.split("."))||void 0===a?void 0:a.pop())&&void 0!==t?t:"file"})]})]}),(0,s.jsx)("div",{onClick:e=>{c([]),console.log(h),u((e=>[...e,{mediaItem:h,type:r.A.DOCUMENT}])),d((e=>({...e,document:[]})))},className:"".concat(p?"hidden":"remove"),children:"\xd7"})]}):(0,s.jsx)(s.Fragment,{})}},76653:(e,t,n)=>{"use strict";n.d(t,{g:()=>l});var r=n(20975),o=n(34268),i=n(62391);const s=r.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),a=r.lazy((()=>Promise.all([n.e(439),n.e(972)]).then(n.bind(n,22972)))),l=(0,r.memo)((e=>{var t;let{user:n,community:l,description:d,setDescription:u,isModalFullScreen:p,isPollVisible:h}=e;return null!==l&&void 0!==l&&null!==(t=l.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?(0,i.jsx)(r.Suspense,{fallback:(0,i.jsx)(i.Fragment,{}),children:(0,i.jsx)(a,{text:d,setText:u,getMentionsFeed:async e=>{const t=(await o.w.searchInCommunity(n,l.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return t}})}):(0,i.jsx)("div",{className:"CreatePostEditor mb-4 text-secondary-foreground ".concat(p?h?"min-h-[30vh] overflow-y-auto":"min-h-[80vh] overflow-y-auto":""),children:(0,i.jsx)(r.Suspense,{fallback:(0,i.jsx)("div",{className:"h-[200px] w-full cursor-progress rounded",children:(0,i.jsx)("p",{style:{fontSize:"medium",fontWeight:400},className:"text-[#c6c6c6]",children:"Write here..."})}),children:(0,i.jsx)(s,{className:"noBorder placeholder:font-md overflow-auto placeholder:text-secondary-foreground/70 ".concat(p?"":"overflow-auto"),text:d,setText:u,getMentionsFeed:c(n,l),placeholder:"Write here..."})})})}));function c(e,t){return async n=>{const r=(await o.w.searchInCommunity(e,t.id,n)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return r}}},66104:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(15102),o=n(54617),i=n(62391);function s(e){let{isEmbedEditorVisible:t,embedCode:n,setEmbedCode:s,embedCodeHeight:a,setEmbedCodeHeight:l,isVisible:c}=e;return c?(0,i.jsx)(r.y,{IsDisplay:t,children:(0,i.jsxs)("div",{className:"PostEmbedCode pt-4",children:[(0,i.jsx)("div",{className:"mb-1 text-secondary-foreground/80",children:"Write embeddable code"}),(0,i.jsx)("textarea",{rows:4,type:"text",value:n,onChange:e=>{s(e.target.value)},placeholder:"Paste your embed code here!",className:"mt-2 w-full flex-grow rounded border border-border bg-background p-2 focus:outline-none"}),(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"mb-1 pr-2 text-secondary-foreground/80",children:"Embed code height"}),(0,i.jsx)(o.k,{containerClassName:"flex items-center",defaultValue:a,validator:e=>{if(!e.match(/\d/g))return"Height should be numerical"},onChange:e=>{l(e)},postfix:(0,i.jsx)("span",{className:"pr-2",children:"px"})})]})]})}):null}},66530:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});var r=n(71986),o=n(54617),i=n(62391);function s(e){let{title:t,setTitle:n,errors:s,setErrors:a}=e;return(0,i.jsxs)("div",{className:"pb-1 pt-2",children:[(0,i.jsx)(o.k,{noMargin:!0,defaultValue:t,onChange:e=>{n(e),e.length>180?a({title:"Title must be less than 180 characters."}):a({title:void 0})},placeholder:"Heading (optional)",className:"px-0 text-secondary-foreground placeholder:text-xl placeholder:font-semibold placeholder:text-secondary-foreground/70",inputHolderClassName:"border-none text-xl"}),(0,i.jsx)(r.j,{error:null===s||void 0===s?void 0:s.title,padding0:!0})]})}},3622:(e,t,n)=>{"use strict";n.d(t,{Q:()=>b});var r=n(5564),o=n.n(r),i=n(72006),s=n.n(i),a=n(7711),l=n(62270),c=n(10515),d=n(13629),u=n(32922),p=n(54790),h=n(1796),m=n(53871),f=n(71986),g=n(62391);function b(e){let{errors:t,isQuestion:n=!1,setIsQuestion:r=(()=>{}),isQuiz:o=!1,setIsQuiz:i=(e=>{}),quizTitle:l="",setQuizTitle:d=(()=>{}),quizDuration:u=10,setQuizDuration:p=(()=>{}),quizInstruction:b="",setQuizInstruction:k=(()=>{}),quizQuestions:w=[],setQuizQuestions:x=(()=>{}),endTime:_=null,setEndTime:A=(()=>{})}=e;const C=(e,t)=>{const n=[...w];n.splice(e,1,t),x(n)};return(0,g.jsxs)("div",{className:"CreatePostQuiz mt-5",children:[(0,g.jsx)("div",{className:"bg-card p-4",style:{margin:"1rem -1rem"},children:(0,g.jsx)(h.A,{className:"",options:[{label:"Question",value:!1,name:"question"},{label:"Poll",value:!0,name:"poll"}],value:{label:n?"Question":"Poll",value:n},onChange:e=>{if(n){const e={...w[0]};x([e])}else{const e={...w[0]};for(e.options.length>4&&(e.options.length=4);e.options.length<4;)e.options.push("");x([e])}r(!n)}})}),n?(0,g.jsx)(g.Fragment,{}):(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:(0,g.jsx)(m.A,{children:"Poll expire time"})}),(0,g.jsx)("div",{className:"mt-2",children:(0,g.jsx)(a.Ay,{className:"w-full cursor-pointer rounded border-border bg-card text-secondary-foreground/85 outline-none",styles:{control:(e,t)=>({...e,borderColor:"hsl(var(--border))",color:"hsl(var(--secondary-foreground))",backgroundColor:"hsl(var(--card))",cursor:"pointer"}),placeholder:(e,t)=>({...e,color:"hsl(var(--secondary-foreground))"}),menu:(e,t)=>({...e,color:"hsl(var(--secondary-foreground))"}),menuList:(e,t)=>({...e,backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"}),option:(e,t)=>{let{data:n,isDisabled:r,isFocused:o,isSelected:i}=t;return{fontFamily:n.label,padding:"5px 10px",...e,backgroundColor:"hsl(var(--card))",cursor:"pointer",color:"hsl(var(--secondary-foreground))",":hover":{backgroundColor:"hsl(var(--background))",color:"hsl(var(--secondary-foreground))"}}},singleValue:(e,t)=>({...e,color:"hsl(var(--secondary-foreground))"})},options:[{value:12,label:"12 Hours"},{value:24,label:"1 Day"},{value:48,label:"2 Days"},{value:168,label:"1 Week"},{value:336,label:"2 Weeks"},{value:87600,label:"Unlimited"}],placeholder:"Enter Test Title here",onChange:e=>{A(s()().add(e.value,"h"))}})})]}),w.map(((e,r)=>(0,g.jsxs)("div",{className:"my-5",children:[(0,g.jsx)(v,{isQuestion:n,index:r,question:e,updateQuestion:C}),(0,g.jsx)(f.j,{error:t&&t.questions&&t.questions[r]&&t.questions[r].statement}),(0,g.jsx)(y,{index:r,question:e,isQuestion:n,errors:t&&t.questions&&t.questions[r]&&t.questions[r].options,updateQuestion:C}),(0,g.jsx)(f.j,{error:t&&t.questions&&t.questions[r]&&t.questions[r].answer}),n?(0,g.jsx)(g.Fragment,{}):(0,g.jsx)("div",{className:"my-5",children:(0,g.jsxs)("button",{className:"flex items-center justify-center text-xs font-semibold focus:outline-none",onClick:t=>{const n={...e};n.options.push(""),C(0,n)},children:[(0,g.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full border border-border",children:(0,g.jsx)("img",{src:c.A,alt:"Add Option",width:"12px"})}),(0,g.jsx)("span",{className:"px-2",children:(0,g.jsx)(m.A,{children:"Add Option"})})]})})]},r)))]})}function v(e){let{index:t,question:n,isQuestion:r,updateQuestion:o}=e,i=n.statement.split("\n").length;i=i>0?i:1;const s=(0,l.A)();return(0,g.jsxs)("div",{className:"QuizQuestion",children:[(0,g.jsx)("div",{className:"mb-4 flex",children:(0,g.jsx)("span",{className:"font-semibold text-secondary-foreground/85",children:r?(0,g.jsx)(m.A,{children:"Question"}):(0,g.jsx)(m.A,{children:"Poll question"})})}),(0,g.jsx)("textarea",{type:"text",value:n.statement,onChange:e=>{o(t,{...n,statement:e.target.value}),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"block w-full rounded-lg border border-border bg-card px-4 py-3 hover:shadow focus:outline-none",rows:i,placeholder:s.trans("Enter Question")})]})}function y(e){let{index:t,question:n,isQuestion:r,errors:i,updateQuestion:s}=e;const a=(0,l.A)();return(0,g.jsxs)("div",{className:"QuizOptions my-2",children:[(0,g.jsx)("span",{className:"font-semibold text-secondary-foreground/85",children:(0,g.jsx)(m.A,{children:"Options"})}),n.options.map(((e,l)=>(0,g.jsxs)("div",{className:"QuizOption my-2",children:[(0,g.jsxs)("div",{className:"flex",children:[r?(0,g.jsx)("img",{src:e&&n.answer===e?d.A:u.A,width:"20px",alt:"Quiz Option",className:"cursor-pointer",onClick:r=>{s(t,{...n,answer:e})}}):(0,g.jsx)(g.Fragment,{}),(0,g.jsx)("input",{type:"text",placeholder:a.trans("Option")+" "+(l+1),className:o()("block w-full rounded-lg border border-border bg-card px-4 py-3 hover:shadow focus:outline-none",{"ml-3":r,"mr-3":!r}),value:e,onChange:e=>{const r=[...n.options];r.splice(l,1,e.target.value),s(t,{...n,options:r})}}),r||l<2?(0,g.jsx)(g.Fragment,{}):(0,g.jsx)("img",{src:p.A,width:"20px",alt:"Remove option",className:"mx-2 cursor-pointer",onClick:e=>{const t={...n},{options:r}=t;r.splice(l,1),t.options=r,s(0,t)}})]}),(0,g.jsx)(f.j,{error:i&&i[l]&&i[l]})]},l)))]})}},86789:(e,t,n)=>{"use strict";n.d(t,{A:()=>B});var r=n(5564),o=n.n(r),i=n(41745),s=n(20975),a=n(73159),l=n.n(a),c=n(31305),d=n(89449),u=n(53871),p=n(44139),h=n(21788),m=n(90559),f=n(91900),g=n(22393),b=n(62144),v=n(34067),y=n(71214),k=n(65186),w=n(83789),x=n(38545),_=n(43039),A=n(23184),C=n(63624),S=n(34689),j=n(6949),E=n(76136),N=n(21143),P=n(68133),D=n(76653),M=n(66104),T=n(66530),I=n(31894),O=n(62391);const L=s.lazy((()=>n.e(630).then(n.bind(n,54630))));function R(e){var t,n,r,o,i,a,l,c,d;let{community:u,user:p,postToUpdate:m,updatePost:f=(e=>{}),addToast:g,setActive:b,activeGroup:R,isModalFullScreen:B,setIsModalFullScreen:z,setIsAdvanceSettingsOpen:F,slugModalActive:U,setSlugModalActive:V,slug:G,slugTitle:H,setSlugTitle:W,slugDescription:q,setSlugDescription:K,setSlug:Y,OGTitle:$,setOGTitle:Q,OGDescription:Z,setOGDescription:J,OGImage:X,hideLike:ee,setHideLike:te,hideComment:ne,setHideComment:re,hideCreator:oe,setHideCreator:ie,hideDate:se,setHideDate:ae,customDate:le,setCustomDate:ce,setOGImage:de}=e;const{analyticsService:ue}=(0,k.W)(),pe=new v.F,he=new y.A,me=m&&m.group?m.group.id:null,fe=m?m.tabId:null,[ge,be]=(0,s.useState)(m.title?m.title:""),[ve,ye]=(0,s.useState)(m.description?null!==u&&void 0!==u&&null!==(t=u.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?m.description:pe.render(m.description):""),[ke,we]=(0,s.useState)(m.embedCode?m.embedCode:""),[xe,_e]=(0,s.useState)(m.embedCodeHeight?m.embedCodeHeight:""),[Ae,Ce]=(0,s.useState)(null!==(n=m.images)&&void 0!==n?n:[]),[Se,je]=(0,s.useState)(null!==(r=m.videos)&&void 0!==r?r:[]),[Ee,Ne]=(0,s.useState)(null!==(o=m.document)&&void 0!==o?o:[]),[Pe,De]=(0,s.useState)(null!==(i=m.banner)&&void 0!==i?i:null),[Me,Te]=(0,s.useState)({images:null!==(a=m.images)&&void 0!==a?a:[],videos:null!==(l=m.videos)&&void 0!==l?l:[],document:m.document?[m.document]:[],banner:m.banner?[m.banner]:[]}),[Ie,Oe]=(0,s.useState)(null),[Le,Re]=(0,s.useState)(!1),[Be,ze]=(0,s.useState)(null===m||void 0===m||null===(c=m.buttons)||void 0===c?void 0:c.length),[Fe,Ue]=(0,s.useState)(null!==m&&void 0!==m&&null!==(d=m.buttons)&&void 0!==d&&d.length?null===m||void 0===m?void 0:m.buttons:[{label:"",url:"",position:"top"}]),[Ve,Ge]=(0,s.useState)(!!m.embedCode),[He,We]=(0,s.useState)(!1),[qe,Ke]=(0,s.useState)(null),[Ye,$e]=(0,s.useState)([]),Qe=!Ie&&[ge,ke,ve,Ae,Se,Ee].some((e=>e.length>0));return(0,O.jsxs)("div",{className:"CreatePostCard flex flex-col bg-card",children:[(0,O.jsx)(s.Suspense,{fallback:(0,O.jsx)(O.Fragment,{}),children:(0,O.jsx)(L,{isEditEnabled:!0,setActive:b,community:u,slugModalActive:U,setSlugModalActive:V,isModalFullScreen:B,setIsModalFullScreen:z,setIsAdvanceSettingsOpen:F,group:R,selectedGroup:R,disablePostInAnotherGroup:!0,areFilesUploading:Ie})}),(0,O.jsxs)("div",{className:"flex flex-col overflow-y-scroll px-4 lg:mx-auto ".concat(B?"lg:min-w-[50vw] lg:max-w-[50vw]":"w-full"),children:[(0,O.jsx)(C.u,{user:p,community:u,coverPicture:Pe,setCoverPicture:De,setAreFilesUploading:Oe,setUploadedMedia:Te,uploadedMedia:Me,setRemovedMediaUploadsOnEdit:$e,isCoverPictureEdit:!0}),(0,O.jsx)(T.t,{title:ge,setTitle:be,description:ve,errors:qe,setErrors:Ke}),(0,O.jsx)(E.f,{images:Ae,setImages:Ce,uploadedMedia:Me,setUploadedMedia:Te,setRemovedMediaUploadsOnEdit:$e}),(0,O.jsx)(I.d,{videos:Se,setVideos:je,uploadedMedia:Me,setUploadedMedia:Te,areFilesUploading:Ie,setRemovedMediaUploadsOnEdit:$e}),(0,O.jsx)("div",{className:"mb-3 border-b border-border"}),(0,O.jsx)(D.g,{description:ve,setDescription:ye,user:p,community:u,isModalFullScreen:B}),(0,O.jsx)(P.A,{documents:Ee,setDocument:Ne,setUploadedMedia:Te,areFilesUploading:Ie,setRemovedMediaUploadsOnEdit:$e}),(0,O.jsx)(M.A,{isEmbedEditorVisible:Ve,embedCode:ke,setEmbedCode:we,embedCodeHeight:xe,setEmbedCodeHeight:_e,isVisible:!0}),Be?(0,O.jsx)(S.S,{buttons:Fe,setButtons:Ue}):(0,O.jsx)(O.Fragment,{}),(0,O.jsx)(N.A,{isRecorderVisible:Le,setIsRecorderVisible:Re,setRecording:e=>{(async e=>{Oe(!0);const t=await _.u1.uploadMedia(p,u.id,[e],w.A.DOCUMENT);Te((e=>({...e,document:[...t.publicUrls]}))),Oe(!1)})(e),Ne([e])}})]}),(0,O.jsx)(j.A,{user:p,community:u,images:Ae,setImages:Ce,videos:Se,setVideos:je,documents:Ee,setDocument:Ne,isEmbedEditorVisible:Ve,isModalFullScreen:B,areFilesUploading:Ie,setAreFilesUploading:Oe,setUploadedMedia:Te,removedMediaUploadsOnEdit:Ye,setRemovedMediaUploadsOnEdit:$e,uploadedMedia:Me,setIsEmbedEditorVisible:m.embedCode?Ge:null,isRecorderVisible:Le,setIsRecorderVisible:Re,isPollVisible:!1,setIsPollVisibleVisible:null,addToast:g,disableSubmit:!Qe,isSavingPost:He,onSubmitPost:async e=>{try{var t;const e=ve.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 "),n=null!==u&&void 0!==u&&null!==(t=u.configuration)&&void 0!==t&&t.useMdEditorForCreatePostDescription?ve:he.turndown(e),r={title:ge,description:n,groupId:me,embedCode:ke,embedCodeHeight:xe,tabId:fe,images:Ae,videos:Se,document:document,meta:{slug:(0,h.xx)(G),title:H,description:q,openGraphTitle:$,openGraphDescription:Z,openGraphImage:X},preferences:{hideComment:ne,hideLikes:ee,hideCreator:oe,hideDate:se},createdAt:le||null};["images","videos","banner","document"].forEach((e=>{r[e]=Me[e]})),Be&&(r.buttons=Fe);const o=(0,A.T$)(r,Ae,Se,Ee);if(Ke(o),o)return;We(!0);let i=await _.K$.updatePost(p,r,Ye,m.id);f(i.post),ue.track("edit-post",{groupName:m.group.name,sectionName:m.tab.name,postUrl:window.location.origin+(0,x.createPostDetailPageRouteFromSlug)(r)}),We(!1),g("Post updated successfully!"),Ke({}),b(!1)}catch(n){We(!1),n&&n.response&&n.response.data.errors?n.response.data.errors.title&&Ke({title:n.response.data.errors.title[0]}):Ke("Something went wrong!")}},isButtonsSectionVisible:Be,setIsButtonsSectionVisible:ze,submitButtonLabel:"Update"})]})}const B=(0,d.wj)((0,c.Ng)((e=>({community:e.community,user:e.auth,activeGroup:e.activeGroup})))((function(e){var t,n,r,a,c,d,v,y,k,w;let{community:x,user:_,postToUpdate:A,updatePost:C=(e=>{}),addToast:S,active:j,setActive:E,activeGroup:N}=e;const[P,D]=(0,s.useState)(!1),[M,T]=(0,s.useState)(!1),[I,L]=(0,s.useState)(),[B,z]=(0,s.useState)(null===A||void 0===A||null===(t=A.meta)||void 0===t?void 0:t.slug),[F,U]=(0,s.useState)(null===A||void 0===A||null===(n=A.meta)||void 0===n?void 0:n.title),[V,G]=(0,s.useState)(null===A||void 0===A||null===(r=A.meta)||void 0===r?void 0:r.description),[H,W]=(0,s.useState)(null===A||void 0===A||null===(a=A.meta)||void 0===a?void 0:a.openGraphTitle),[q,K]=(0,s.useState)(null===A||void 0===A||null===(c=A.meta)||void 0===c?void 0:c.openGraphDescription),[Y,$]=(0,s.useState)(null===A||void 0===A||null===(d=A.meta)||void 0===d?void 0:d.openGraphImage),[Q,Z]=(0,s.useState)(null===A||void 0===A||null===(v=A.preferences)||void 0===v?void 0:v.hideComment),[J,X]=(0,s.useState)(null===A||void 0===A||null===(y=A.preferences)||void 0===y?void 0:y.hideLikes),[ee,te]=(0,s.useState)(null===A||void 0===A||null===(k=A.preferences)||void 0===k?void 0:k.hideCreator),[ne,re]=(0,s.useState)(),[oe,ie]=(0,s.useState)(null===A||void 0===A||null===(w=A.preferences)||void 0===w?void 0:w.hideDate),[se,ae]=(0,s.useState)(!1),[le,ce]=(0,s.useState)(!0),[de,ue]=(0,s.useState)(!1),[pe,he]=(0,s.useState)(!1);function me(){z(null),W(null),K(null),$(null),U(null),G(null)}return(0,O.jsx)(f.a,{active:j,setActive:E,padding:!1,overflow:"auto",isModalFullScreen:P,width:P?"100%":"670px",children:(0,O.jsx)("div",{className:"CreatePost flex flex-col space-y-2 rounded-[20px] bg-card",children:M?(0,O.jsxs)("div",{className:"flex flex-col bg-card p-4",children:[(0,O.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,O.jsxs)("div",{className:"flex items-center bg-card p-4",children:[(0,O.jsx)(m.A,{icon:"arrow-left",solid:!0,className:"mt-0.5",size:"xs",onClick:()=>{T(!1)}}),(0,O.jsx)("h3",{className:"ml-2.5 text-base font-bold",children:(0,O.jsx)(u.A,{children:"Settings"})})]}),(0,O.jsx)(p.$,{onClick:()=>{T(!1)},label:"Done",className:"h-10 w-40 text-sm font-semibold",large:!0})]}),(0,O.jsxs)("div",{className:"flex flex-col px-5 py-5",children:[(0,O.jsxs)("span",{className:"flex items-center space-x-2 text-xs font-bold hover:cursor-pointer",onClick:()=>{ce(!le)},children:[(0,O.jsx)(u.A,{children:"POST CUSTOMIZATION"}),(0,O.jsx)("span",{children:(0,O.jsx)(b.A,{icon:"caret-down",size:"xs",className:"ml-1"})})]}),le&&(0,O.jsx)("div",{className:"my-1 mb-5 flex flex-col space-y-3 rounded bg-card",children:(0,O.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,O.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{X(!J)},children:[(0,O.jsx)(g.A,{selectedOption:J,setSelectedOption:X}),(0,O.jsx)(u.A,{children:"Hide Likes from the post"})]}),(0,O.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{Z(!Q)},children:[(0,O.jsx)(g.A,{selectedOption:Q,setSelectedOption:Z}),(0,O.jsx)(u.A,{children:"Hide Comment from the post"})]}),(0,O.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{te(!ee)},children:[(0,O.jsx)(g.A,{selectedOption:ee,setSelectedOption:te}),(0,O.jsx)(u.A,{children:"Hide profile detail from the post"})]}),(0,O.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{ee||ie(!oe)},children:[(0,O.jsx)(g.A,{selectedOption:oe,setSelectedOption:ie,disabled:ee}),(0,O.jsx)("span",{className:o()("",{"text-secondary-foreground/70":ee}),children:(0,O.jsx)(u.A,{children:"Hide date & time from the post"})})]}),(0,O.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{ae(!se)},children:[(0,O.jsx)(g.A,{selectedOption:se,setSelectedOption:ae}),(0,O.jsx)("span",{children:(0,O.jsx)(u.A,{children:"Custom date for post"})})]}),se&&(0,O.jsxs)("div",{className:"flex w-52 cursor-pointer items-center rounded border border-border bg-background bg-card px-2 py-2 outline-none",children:[(0,O.jsx)(l(),{className:"w-24 outline-none",selected:ne,maxDate:new Date,onChange:e=>{re(new Date(e))},shouldCloseOnSelect:!0,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,timeCaption:"time",placeholderText:"Select date",dateFormat:"dd - MM - yyyy"}),(0,O.jsx)("div",{className:"mr-1 h-4 w-1 border-r border-border"}),(0,O.jsx)("div",{className:"select-none rounded",children:(0,O.jsxs)("div",{className:"text-center text-secondary-foreground/85",children:[ne&&(0,i.default)(ne," h:mm a"),!ne&&(0,O.jsx)("h4",{className:"p-0 text-secondary-foreground/70",children:(0,O.jsx)(u.A,{children:"time"})})]})})]})]})}),(0,O.jsx)(h.jX,{community:x,active:I,setActive:L,slug:B,slugPrefix:"p",setSlug:z,title:F,setTitle:U,description:V,setDescription:G,OGTitle:H,setOGTitle:W,OGDescription:q,setOGDescription:K,OGImage:Y,setOGImage:$,OgImageSubtitle:"By default it will take up the image uploaded with the post",isSEOSettingsInputsVisible:de,setIsSEOSettingsInputsVisible:ue,isOpenGraphInputsVisible:pe,setIsOpenGraphInputsVisible:he,clearSlugMeta:me})]})]}):(0,O.jsx)(R,{setActive:E,user:_,community:x,postToUpdate:A,updatePost:C,addToast:S,activeGroup:N,isModalFullScreen:P,setIsModalFullScreen:D,setIsAdvanceSettingsOpen:T,slugModalActive:I,setSlugModalActive:L,slug:B,setSlug:z,slugTitle:F,setSlugTitle:U,slugDescription:V,setSlugDescription:G,OGTitle:H,setOGTitle:W,OGDescription:q,setOGDescription:K,OGImage:Y,setOGImage:$,hideLike:J,setHideLike:X,hideComment:Q,setHideComment:Z,hideCreator:ee,setHideCreator:te,hideDate:oe,setHideDate:ie,customDate:ne,setCustomDate:re,clearSlugMeta:me})})})})))},93092:(e,t,n)=>{"use strict";n.d(t,{RK:()=>_e,BP:()=>Ee,gy:()=>Ue,WE:()=>Fe,YN:()=>Pe,io:()=>We,Wv:()=>Te,pD:()=>Ie});var r=n(5564),o=n.n(r),i=n(40474),s=n(72006),a=n.n(s),l=n(20975),c=n(31305),d=n(77826),u=n(34067),p=n(89449),h=n(16478),m=n(65186),f=n(55049),g=n(9175),b=n(78220),v=n(16118),y=n(18228),k=n(79957),w=n(38545),x=n(65350),_=n(43039),A=n(3766),C=n(52041);function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;if(!e)return"";if(e.length<=t)return e;const n=e.indexOf("://"),r=e.substring(0,n),o=e.substring(n),i=o.lastIndexOf("/");let s=o.substring(i);t<=r.length+s.length&&(s=s.substring(s.length-t/2));const a=t-r.length-s.length;if(a<=0)return"".concat(r,"/.../").concat(s);const l=o.substring(0,a);return"".concat(r).concat(l,"/.../").concat(s)}var j=n(31696),E=n(97843),N=n(60553),P=n(53871),D=n(85947),M=n(1689),T=n(58157),I=n(8934),O=n(44139),L=n(84983),R=n(54479),B=n(2016),z=n(25715),F=n(19328),U=(n(12014),n(62391));function V(e){let{className:t="",src:n="",style:r={}}=e;return(0,U.jsx)("div",{className:o()("RImage",t),style:{...r,backgroundImage:"url('".concat(n,"')"),backgroundSize:"cover",content:"",backgroundPosition:"center center"}})}var G=n(57731),H=n(82993),W=n(10515),q=n(1334),K=n(91900),Y=n(51926),$=n(6560);const Q=(0,p.wj)((0,c.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups})),(e=>(0,H.zH)({},e)))((function(e){let{heading:t="",text:n="",active:r=!1,setActive:i=(e=>{}),onClose:s=(e=>{}),groups:a,user:c,addToast:d,post:u}=e;const[h,m]=(0,l.useState)([]),[f,g]=(0,l.useState)(!1),[b,v]=(0,l.useState)("");if(!r)return null;const y=void 0!==a?a.filter((e=>["admin","moderator","user"].includes(e.myRole)&&"joined"===e.joinStatus)):void 0;return(0,U.jsxs)(K.a,{className:"SharePostModal",active:r,setActive:i,padding:!1,children:[(0,U.jsxs)("div",{className:"flex items-center justify-between space-x-2 bg-card p-1 pl-4",children:[(0,U.jsx)("span",{className:"font-semibold",children:t}),(0,U.jsx)(B.A,{icon:W.A,rotate:45,onClick:s})]}),(0,U.jsxs)("div",{className:"flex flex-col space-y-2 px-4 py-2",children:[(0,U.jsx)("div",{className:"font-semibold",children:(0,U.jsx)(P.A,{children:"Share via URL"})}),(0,U.jsx)(Y.A,{text:n,className:"bg-card"})]}),(0,U.jsx)($.A,{text:n}),(0,U.jsxs)("div",{className:"flex flex-col space-y-2 px-4 py-2",children:[(0,U.jsx)("div",{className:"font-semibold",children:(0,U.jsx)(P.A,{children:"Reshare in other channels"})}),(0,U.jsx)("div",{className:"",children:(0,U.jsx)("div",{className:"h-80 overflow-scroll bg-card",children:y&&y.length>0?a.map(((e,t)=>(0,U.jsxs)("div",{className:"rounded bg-card px-4 py-1",children:[(0,U.jsx)("div",{className:"text-sm font-semibold text-secondary-foreground",children:e.name}),e.tabs.map(((t,n)=>{const r="closed"===e.groupType&&"joined"!==e.joinStatus||"realtime"===t.sectionType;return(0,U.jsx)(l.Fragment,{children:["admin","moderator"].includes(e.myRole)||null!==t&&void 0!==t&&t.isJoined||null===t||void 0===t||!t.isPrivate?(0,U.jsx)("div",{className:"mt-1",children:(0,U.jsx)(q.s,{className:"my-2 mr-5 ".concat(r?"disabled cursor-not-allowed":""),selected:h.includes(t.id),onClick:()=>{r||(h.includes(t.id)?(m([]),v("")):(m([t.id]),v(e.id)))},children:(0,U.jsxs)("div",{className:"flex items-center ".concat(r?"text-secondary-foreground/70":""),children:[(0,U.jsx)("div",{className:o()("emoji",{hash:!t.emoji||"#"===t.emoji}),children:t.emoji?t.emoji:"#"}),(0,U.jsx)("span",{className:" pl-3",children:t.name})]})})},n):null},null===t||void 0===t?void 0:t.id)}))]},null===e||void 0===e?void 0:e.id))):null})})]}),(0,U.jsxs)("div",{className:"flex justify-between p-4",children:[(0,U.jsx)("button",{label:"Cancel",onClick:()=>{i(!1)},children:(0,U.jsx)(P.A,{children:"Cancel"})}),(0,U.jsx)(O.$,{label:"Save",disabled:0===h.length,onClick:()=>{!function(){var e;g(!0);const t={sharedId:u.id,groupId:b,tabId:h.length>0?h[0]:"",title:null!==(e=u.title)&&void 0!==e?e:""};_.K$.createPost(c,t).then((e=>{d("Post shared successfully","",p.lm.success),i(!1)})).catch((e=>{console.log("Error creating post: ",e)})).finally((()=>{g(!1)}))}()},isLoading:f})]})]})})));var Z=n(62144),J=n(63133),X=n(85306),ee=n(63360),te=n(84003),ne=n(91341);function re(e){var t;let{post:n,setDisplayStatics:r=(()=>{})}=e;const o=E.A.hasValue(n.shared)?null===n||void 0===n||null===(t=n.shared)||void 0===t?void 0:t.poll:n.poll;if(!o)return null;const i=o&&o.answers&&o.answers.map((e=>({pollOption:e.submissions[0],user:e.user}))),s=i&&i.reduce(((e,t)=>{const n=t.pollOption.option;return e[n]||(e[n]=[]),e[n].push(t.user),{...e,[n]:e[n]}}),{});return(0,U.jsxs)("div",{className:"PollResult gpa-2 flex flex-col bg-background",children:[(0,U.jsxs)("div",{className:"flex items-center px-4 py-2",children:[(0,U.jsx)(ne.A,{size:"h3",variant:"t1",translate:!0,className:"flex-1",children:"Poll Result"}),(0,U.jsx)(ee.J,{onClick:()=>{r(!1)}})]}),(0,U.jsxs)("div",{className:"flex w-full flex-col gap-1",children:[(0,U.jsx)(ne.A,{size:"h3",variant:"t2",className:"px-4",children:o.questions[0].statement}),(0,U.jsxs)("div",{className:"flex w-full flex-col gap-1 bg-card p-2",children:[(0,U.jsxs)(ne.A,{variant:"t2",className:"p-2 px-4",children:[o.voteCount," votes"]}),(0,U.jsx)(te.u,{items:o.questions[0].options,className:"PollOptions flex w-full flex-col gap-3 px-4",renderItem:(e,t)=>(0,U.jsx)(a,{poll:o,option:e,users:s&&s[e],index:t})})]})]})]});function a(e){let{poll:t,option:n,index:r,users:o}=e;const[i,s]=(0,l.useState)(!0),{profileModelState:{setShowProfileModel:a,setIdToViewProfile:c}}=(0,f.A)();return(0,U.jsxs)("div",{className:"rounded border border-border",children:[(0,U.jsxs)("div",{className:"flex w-full cursor-pointer items-center rounded bg-background p-3 hover:bg-card",onClick:()=>{s(!i)},children:[(0,U.jsxs)(ne.A,{variant:"t2",children:[r+1,".\xa0\xa0"]}),(0,U.jsx)(ne.A,{className:"flex-1",children:n}),(0,U.jsxs)(ne.A,{variant:"t2",children:[Math.floor(t.votes[n]*t.voteCount)," \xa0 Members"]})]}),i&&(0,U.jsx)(te.u,{items:o,className:"flex w-full cursor-pointer flex-col gap-1 divide-y divide-[var(--theme-border-color)]",renderItem:e=>(0,U.jsx)("div",{className:"p-2",children:(0,U.jsx)(I.eu,{user:e,onClick:()=>{c(e.id),a(!0)},extraInfo:void 0})})})]})}}function oe(e){let{value:t=0,max:n=100,className:r}=e;return(0,U.jsx)("div",{className:(0,O.cn)("h-1 w-full overflow-hidden rounded-full bg-secondary-foreground/20",r),children:(0,U.jsx)("div",{style:{width:t&&n?t/n*100+"%":"0%",animation:"progress 1s ease-in-out"},className:o()("h-full rounded-full bg-info transition-all duration-150 ease-in-expo")})})}function ie(e){var t;let{post:n,user:r,updatePost:i,displayPollResult:s}=e;const[a,c]=(0,l.useState)(),d=E.A.hasValue(n.shared),[u,p]=(0,l.useState)(),[h,m]=(0,l.useState)(),f=d?null===n||void 0===n||null===(t=n.shared)||void 0===t?void 0:t.poll:n.poll,b=f&&new Date(f.endTime){f&&f.isAnsweredByMe&&c(f.myAnswer[0].option)}),[f]),v?(0,U.jsxs)("div",{className:"PostQuestion my-4 rounded-xl bg-secondary/40 p-4 text-sm",children:[(0,U.jsx)("p",{className:"mb-2.5 scroll-m-20 font-semibold tracking-tight text-secondary-foreground",children:v.statement}),v.options.map(((e,t)=>{var s;return(0,U.jsxs)("div",{onClick:()=>{r?b?y("Voting has ended","","warning"):f.myAnswer||(m(!0),_.K$.voteOnPoll(r,d?n.sharedId:n.id,e).then((e=>{i(e.post)})).finally((()=>{m(!1)}))):y("Please login to vote","","warning")},className:(0,O.cn)(o()("my-2 flex cursor-pointer flex-col gap-2 rounded-md border border-border bg-card p-2 text-xs transition-all duration-150 ease-in-expo hover:bg-accent",{"border-info bg-info/10":a&&a===e,"hover:scale-[1.01]":!b,"cursor-default hover:scale-100 hover:bg-card":b||!r||a})),children:[(0,U.jsxs)("div",{className:"flex w-full flex-row items-center gap-3",children:[(0,U.jsx)("span",{className:o()("flex h-6 w-6 place-content-center items-center rounded-full border border-border text-xs text-secondary-foreground",{"border-info":a&&a===e}),children:String.fromCharCode(65+t)}),(0,U.jsx)("div",{className:"flex-1",children:(0,U.jsx)("p",{className:"font-light text-card-foreground",children:e})}),(a||n.isByMe)&&(0,U.jsxs)("div",{className:"text-secondary-foreground/90",children:[f.voteCount>0?(100*f.votes[e]).toFixed(2):0,"%",n.isByMe&&(0,U.jsxs)(U.Fragment,{children:["\xa0 | \xa0",Math.floor(f.votes[e]*f.voteCount)]})]})]}),(a||n.isByMe)&&(0,U.jsx)(oe,{max:100,value:null!==(s=100*f.votes[e])&&void 0!==s?s:0})]},t)})),s&&n.canDelete&&(0,U.jsx)(T.A,{label:"View Result",className:"text-xs",onClick:()=>{p(!0)}}),(0,U.jsx)(We,{isProcessing:h}),(0,U.jsx)(G.A,{active:u,setActive:p,width:700,children:(0,U.jsx)(re,{post:n,setDisplayStatics:p})})]}):(0,U.jsx)(U.Fragment,{})}var se=n(62270),ae=n(74345),le=n(30725),ce=n(86789);const de=n.p+"static/media/live-icon-2.372e463636b1536af4c662a4c8856670.svg";const ue=n.p+"static/media/live-white-icon-2.1c6f75cb83dec565788d1e6dc409a4ad.svg";const pe=function(e){let{onClick:t,className:n,ended:r}=e;return(0,U.jsxs)("div",{onClick:e=>{null==t||r||t()},className:o()("flex h-6 select-none place-content-center items-center space-x-1 rounded px-2 text-xs ".concat(n),{"theme-bg-disable cursor-not-allowed text-secondary-foreground/70":r,"theme-bg-danger cursor-pointer text-white hover:shadow":!r}),children:[(0,U.jsx)("span",{children:(0,U.jsx)("img",{src:r?de:ue,className:"h-full w-full",alt:""})}),(0,U.jsx)("span",{children:(0,U.jsx)(P.A,{children:"Live"})})]})};function he(e){let{post:t,user:n}=e;const r=null!=t.shared&&void 0!=t.shared,{liveCall:o,scheduledTime:i}=r?t.shared:t;if(!o||i&&new Date(i)>new Date)return(0,U.jsx)(U.Fragment,{});const{meetingId:s}=o;return o.isLive?(0,U.jsx)("a",{className:"text-primary-foreground",href:n?(0,y.cs)(s,n.token):null,onClick:e=>{e.preventDefault(),n&&window.open((0,y.Hm)(s,n.token))},target:"_blank",rel:"noreferrer",children:(0,U.jsx)(pe,{})}):(0,U.jsx)(pe,{ended:!0})}const me=(0,c.Ng)((e=>({community:e.community,highlightedPostIds:e.highlightedPosts.postIds})),{highlightPost:A.rp,unHighlightPost:A.uE,addSectionPinnedPost:C.DG,removeSectionPinnedPosts:C.ty})((function(e){let{community:t,post:n,updatePost:r,deletePost:o,user:i,group:s,setEmbedModalVisible:a,setIsProcessing:c,addToast:d,highlightedPostIds:u,highlightPost:h,unHighlightPost:f,addSectionPinnedPost:g,removeSectionPinnedPosts:b}=e;const[v,y]=(0,l.useState)(!1),{analyticsService:k}=(0,m.W)(),x=void 0!=n.sharedId&&null!=n.sharedId,{id:A,isBookmarkedByMe:C,isPinned:S}=x?n.shared:n,[j,E]=(0,l.useState)(!1),P=x?n.shared.description:n.description,D=null===u||void 0===u?void 0:u.includes(n.id),M=(0,se.A)(),[T,I]=(0,l.useState)(!1),[O,L]=(0,l.useState)(!1),[R,F]=(0,l.useState)(!1),[V,G]=(0,l.useState)(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"PostMenuActions flex flex-1 place-content-end items-center text-secondary-foreground",children:[S?(0,U.jsx)(B.A,{icon:"img",img:"/assets/vectors/pin-light-icon.svg",small:!0,className:"h-8 w-8 bg-primary",onClick:e=>{s&&["admin","moderator"].includes(s.myRole)&&(c(!0),_.K$.unpinPost(i,A).then((e=>{let{post:t}=e;c(!1),r(t),b(t)})).catch((e=>{c(!1),console.log({err:e})})))}}):(0,U.jsx)(U.Fragment,{}),(0,U.jsx)(he,{post:n,user:i}),i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(le.A,{reportType:V?"Post Report":"User Profile Report",contentLink:V?window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(n):window.location.origin+"/user/"+n.createdBy.id,community:t,addToast:d,activeProps:{isReportModalVisible:R,setReportModalVisible:F},displayProps:{displayClosePrompt:O,setDisplayClosePrompt:L},content:V?"post: title: "+n.title+" description: "+P:"user-profile"}),(0,U.jsx)(z.A,{dropdownClassName:"",icon:"menu-dots-vertical",hideOnEmpty:!0,actions:[{icon:"bookmark",solidIcon:C,label:C?"Remove Bookmark":"Bookmark",onClick:()=>{(C?_.K$.removeBookmark(i,A):_.K$.bookmarkPost(i,A)).then((()=>{!C&&k.track("bookmark-post",{postUrl:window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(n)}),r({...n,isBookmarkedByMe:!C}),d(C?"Bookmark removed":"Bookmark added!","",C?p.lm.info:p.lm.success)})).catch((e=>{alert(M.trans("Failed performing action!"))}))}},{icon:i.id!==n.createdBy.id?"user":"",label:i.id!==n.createdBy.id?n.createdBy.isFollowedByMe?"Unfollow User":"Follow User":"",onClick:()=>{var e,o;(n.createdBy.isFollowedByMe?_.DL.unfollowUser(null===n||void 0===n||null===(o=n.createdBy)||void 0===o?void 0:o.id,null===t||void 0===t?void 0:t.id):_.DL.followUser(null===n||void 0===n||null===(e=n.createdBy)||void 0===e?void 0:e.id,null===t||void 0===t?void 0:t.id)).then((()=>{r({...n,createdBy:{...n.createdBy,isFollowedByMe:!n.createdBy.isFollowedByMe}}),d(n.createdBy.isFollowedByMe?"User Unfollowed!":"User Followed!","",n.createdBy.isFollowedByMe?p.lm.info:p.lm.success)})).catch((e=>{alert(M.trans("Failed performing action!"))}))}},{icon:"thumbtack",solidIcon:n.isPinned,label:s&&["admin","moderator"].includes(s.myRole)?n.isPinned?"Remove Pin":"Pin Post":"",onClick:e=>{c(!0),(n.isPinned?_.K$.unpinPost(i,n.id):_.K$.pinPost(i,n.id)).then((e=>{let{post:t}=e;c(!1),t.isPinned?g(t):b(t),r(t)})).catch((e=>{c(!1),console.log({err:e})}))}},{icon:"thumbtack",solidIcon:D,label:"admin"===(null===t||void 0===t?void 0:t.myRole)?D?"Remove from featured post":"Add to featured post":"",onClick:e=>{c(!0),D?f(n.id,(e=>{e||(c(!1),d("Post removed from featured!"))})):h(n.id,(e=>{e||(c(!1),d("Post set as featured!"))}))}},{icon:"edit",label:!x&&(i&&n.createdBy.id===i.id||n.canEdit)?"Edit":"",onClick:e=>{y(!0)}},{icon:"globe",label:x?"":"Embed Post",onClick:()=>{a(!0)}},{icon:"flag",label:n.createdBy.id!==i.id?"Report Post":"",onClick:()=>{G(!0),F(!0)}},{icon:"flag",label:n.createdBy.id!==i.id?"Report User":"",onClick:()=>{G(!1),F(!0)}},{icon:"trash",label:!x&&n.canDelete?"Delete":"",actionType:z.X.alert,onClick:()=>{E(!0)}},{icon:"ban",label:i.id!==n.createdBy.id?"Block":"",onClick:()=>{I(!0)},actionType:"alert"}]})]}):(0,U.jsx)(U.Fragment,{}),(0,U.jsx)(ae.A,{community:t,addToast:d,activeProps:{active:T,setActive:I},displayProps:{displayClosePrompt:O,setDisplayClosePrompt:L},createdById:n.createdBy.id,blockCallback:()=>{}}),(0,U.jsx)(N.c,{active:j,header:"Delete Post",title:"Are you sure you want to delete the post?",setActive:E,onSubmit:()=>{c(!0),_.K$.deletePost(i,n.id).then((e=>{c(!1),o(e.post),k.track("delete-post",{groupName:null===n||void 0===n?void 0:n.group.name,sectionName:null===n||void 0===n?void 0:n.tab.name,postUrl:window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(n)})})).catch((e=>{c(!1)}))}})]}),v?(0,U.jsx)(ce.A,{postToUpdate:n,active:v,setActive:e=>{y(!1)},user:i,updatePost:r}):(0,U.jsx)(U.Fragment,{})]})}));function fe(e){var t;let{post:n,updatePost:r,deletePost:o,user:i,group:s,setEmbedModalVisible:l,setIsProcessing:c,addToast:d,isCommunityPost:u}=e;const p=a().duration(a()(new Date).diff(a()(n.createdAt))).asDays(),h=void 0!==n.sharedId&&null!=n.sharedId,{createdAt:m,createdBy:g,groupRole:b}=h?n.shared:n,{hideCreator:v,hideDate:y}=null!==(t=n.preferences)&&void 0!==t?t:{},{profileModelState:{setShowProfileModel:k,setIdToViewProfile:w}}=(0,f.A)();return(0,U.jsxs)("div",{className:"PostHeader flex items-center justify-between",children:[u&&!v?(0,U.jsx)(I.Lw,{user:g,post:n,size:42,className:"cursor-pointer",tag:"admin"===b?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-primary-foreground px-1 font-semibold text-primary",children:(0,U.jsx)(P.A,{children:"Admin"})}):"moderator"===b?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,U.jsx)(P.A,{children:"Moderator"})}):(0,U.jsx)(U.Fragment,{}),onClick:e=>{w(g.id),k(!0)}}):!v&&(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(I.eu,{user:g,extraInfo:(0,U.jsx)("span",{children:y?"":p<1?a()(m).fromNow():a()(m).format("DD MMM YYYY")}),size:42,className:"cursor-pointer",tag:(0,U.jsx)("span",{className:"flex items-center gap-2",children:"admin"===b?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-primary-foreground px-1 font-semibold text-primary",children:(0,U.jsx)(P.A,{children:"Admin"})}):"moderator"===b?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,U.jsx)(P.A,{children:"Moderator"})}):"user"===b?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)("div",{})}),showSubtitle:null===g||void 0===g?void 0:g.shortBio,onClick:e=>{w(g.id),k(!0)}})}),!v&&(0,U.jsx)(me,{addToast:d,deletePost:o,group:s,post:n,setEmbedModalVisible:l,setIsProcessing:c,updatePost:r,user:i})]})}function ge(e){var t;let{post:n,user:r,updatePost:i}=e;const[s,a]=(0,l.useState)(),[c,d]=(0,l.useState)(),u=E.A.hasValue(n.shared),p=u?null===n||void 0===n||null===(t=n.shared)||void 0===t?void 0:t.poll:n.poll,{addToast:h}=(0,g.d)(),m=p&&p.isQuestion&&p.questions[0];return(0,l.useEffect)((()=>{p&&p.isAnsweredByMe&&a(p.myAnswer[0].option)}),[p,n]),m?(0,U.jsxs)("div",{className:"my-4 rounded-xl bg-secondary/40 p-4 text-sm text-card-foreground",children:[(0,U.jsx)("p",{className:"mb-2.5 scroll-m-20 font-semibold tracking-tight text-secondary-foreground",children:m.statement}),m.options.map(((e,t)=>{const a=s&&e===m.answer,l=s&&m.answer!==s&&s===e;return(0,U.jsx)("div",{onClick:()=>{r?a||l||p.myAnswer||(d(!0),_.K$.voteOnPoll(r,u?n.sharedId:n.id,e).then((e=>{i(e.post)})).finally((()=>{d(!1)}))):h("Please login to record your response","","warning")},className:(0,O.cn)(o()("my-2 flex cursor-pointer flex-col gap-2 rounded-md border border-border bg-card p-2 text-xs transition-all duration-150 ease-in-expo hover:bg-accent",{"bg-success text-success-foreground hover:bg-success":a,"bg-alert text-alert-foreground hover:bg-alert":l,"cursor-default hover:scale-100":s,"hover:scale-[1.01]":!s})),children:(0,U.jsxs)("div",{className:"flex w-full flex-row items-center gap-3",children:[(0,U.jsx)("span",{className:o()("flex h-6 w-6 place-content-center items-center rounded-full border border-border text-xs text-secondary-foreground"),children:String.fromCharCode(65+t)}),(0,U.jsx)("div",{className:"flex-1",children:(0,U.jsx)("p",{className:"font-light",children:e})}),n.isByMe&&(0,U.jsxs)("div",{className:o()("",{"text-success-foreground":a,"text-alert-foreground":l}),children:[p.voteCount>0?(100*p.votes[e]).toFixed(2):0,"%",n.canDelete&&(0,U.jsxs)(U.Fragment,{children:["\xa0 | \xa0",Math.floor(p.votes[e]*p.voteCount)]})]})]})},t)})),(0,U.jsx)(We,{isProcessing:c})]}):(0,U.jsx)(U.Fragment,{})}var be=n(45322);const ve=()=>{const[e,t]=(0,l.useState)({});function n(n,r){const o=localStorage.getItem("meta");if(o){const e=JSON.parse(o),t=Object.assign(e,{[n]:r});localStorage.setItem("meta",JSON.stringify(t))}else{const e=Object.assign({},{[n]:r});localStorage.setItem("meta",JSON.stringify(e))}t(e)}return{getMetaMap:async function(t){if(!t)return Promise.resolve(null);if(ye.some((e=>t.includes(e))))return Promise.resolve(null);if(!t.match(/^(ftp|http|https|www):\/\/[^ "]+$/))return Promise.resolve(null);if(e[t])return Promise.resolve(e[t]);const r=localStorage.getItem("meta");if(r){const e=JSON.parse(r);if(e&&e[t])return Promise.resolve(e[t])}const o=await(async e=>{try{return(await be.e.getLinkMetaData(e)).result}catch(t){return void console.error(t)}})(t);return o?(n(t,o),Promise.resolve(o)):(n(t,null),Promise.resolve(null))}}},ye=["www.google.com","api.whatsapp.com","api.pensil.in","livemeeting.pro","pensil-social.s3","googleusercontent.com",".png",".jpg",".jpeg",".gif",".bmp",".svg",".ico",".tif",".tiff",".psd",".ai",".eps",".doc",".docx",".pdf",".ppt",".pptx",".xls",".xlsx",".csv",".txt",".zip",".rar",".tar",".gz",".7z",".mp3",".mp4",".avi",".wmv",".mov",".mkv",".flv",".wav",".ogg",".ogv",".oga",".webm",".m4a",".m4v",".mpg",".mpeg",".m2v",".mpg",".mpeg",".m2v"],ke=e=>{let{url:t,type:n="small",className:r}=e;const[i,s]=(0,l.useState)({}),[a,c]=(0,l.useState)(""),[d,u]=(0,l.useState)(""),[p,h]=(0,l.useState)(""),[m,f]=(0,l.useState)(""),[g,b]=(0,l.useState)(!1),[v,y]=(0,l.useState)(!0),k=l.useRef(null),w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{root:null,rootMargin:"0px",threshold:.5};const[n,r]=(0,l.useState)(!1),[o,i]=(0,l.useState)(null);return(0,l.useEffect)((()=>{const n=e=>{r(e[0].isIntersecting)};if(e.current){const r=new IntersectionObserver(n,t);r.observe(e.current),i(r)}return()=>{null===o||void 0===o||o.disconnect()}}),[e.current,t.root,t.rootMargin,t.threshold]),n}(k),{getMetaMap:x}=ve(),_=E.A.hasValue(i)&&E.A.hasValue(a)&&E.A.hasValue(d)&&E.A.hasValue(m);return(0,l.useEffect)((()=>{var e;t&&w&&(y(!0),b(!1),null===(e=x(t))||void 0===e||e.then((e=>{if(!e)return b(!0),void y(!1);const t=e["og:description"]||"";if(t.toLowerCase().includes("something went wrong")||t.toLowerCase().includes("error"))return b(!0),void y(!1);s(e),e["og:image"]&&c(e["og:image"]),e["og:title"]?u(e["og:title"]):e.title&&u(e.title),e["og:description"]&&f(e["og:description"]),e["og:site_name"]&&h(e["og:site_name"]);e["og:image"]||e["og:title"]||e.title||b(!0),y(!1)})).catch((e=>{b(!0),y(!1)})))}),[t,w]),(0,U.jsx)("div",{ref:k,children:_?(0,U.jsxs)("div",{className:o()("cursor-pointer overflow-hidden border border-border",r,{flex:"small"===n}),onClick:()=>{window.open(t,"_blank")},children:[a&&(0,U.jsx)(M.A,{src:a,alt:"Preview",className:o()("w-full border-b border-border object-cover blur-0",{"max-w-[150px]":"small"===n,"h-[250px]":"large"===n})}),(0,U.jsxs)("div",{className:"grid flex-grow gap-1 bg-background p-3",children:[p&&(0,U.jsx)("p",{className:"text-[0.8rem] uppercase text-secondary-foreground",children:p}),d&&(0,U.jsx)("h3",{className:"text-secondary-foreground/85 truncate font-semibold",children:d}),m&&(0,U.jsx)("p",{className:"line-clamp-2 text-sm text-secondary-foreground/80",children:m.substring(0,100)})]})]}):null})};var we=n(90559);const xe=(0,p.wj)((0,c.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community})))((function(e){let{addToast:t,post:n,user:r,group:o,community:i,isUpvotingUsersListVisible:s,setIsUpvotingUsersListVisible:a}=e;const[c,d]=(0,l.useState)([]),[u,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)(!1),{profileModelState:{setShowProfileModel:g,setIdToViewProfile:b}}=(0,f.A)();return(0,l.useEffect)((()=>{r&&s&&!h&&(p(!0),_.K$.getPostLikes(r,n.id).then((e=>{let{users:t}=e;d(t),m(!0)})).catch((e=>{console.log({err:e}),t("Likes could not be loaded!")})).finally((e=>{p(!1)})))}),[r,n,s,h]),(0,U.jsxs)("div",{className:"",children:[(0,U.jsxs)("div",{style:{marginLeft:n.likes<3?24+10*n.likes+"px":"54px"},className:"text-xs",children:[n.latestLikes[0].name," ",n.likes>1?" & ".concat(n.likes-1," other").concat(n.likes>2?"s":""):""," ","liked"]}),(0,U.jsxs)(K.a,{setActive:a,active:s,padding:!1,children:[(0,U.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,U.jsx)("span",{className:"font-bold text-secondary-foreground/80",children:u?(0,U.jsx)("div",{className:"p-1",children:(0,U.jsx)(F.a,{})}):(0,U.jsxs)(U.Fragment,{children:[c.length," Upvote",1===c.length?"":"s"]})}),(0,U.jsx)(we.A,{icon:"cross",size:"sm",onClick:()=>{a(!1)}})]}),(0,U.jsx)("div",{className:"p-5 pb-24 text-secondary-foreground/80",children:c.map((e=>(0,U.jsx)("div",{className:"m-3 flex cursor-pointer items-center justify-between",children:(0,U.jsx)("div",{className:"flex items-center justify-center",children:(0,U.jsx)(I.eu,{user:e,onClick:()=>{g(!0),b(e.id)},tag:"admin"===e.groupRole?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-blue-500",children:"Admin"}):"moderator"===e.groupRole?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(0,U.jsx)(U.Fragment,{}),extraInfo:[e.mobile,e.email].filter((e=>e)).join(" \xb7 ")})})},e.id)))})]})]})})));function _e(e){let{post:t,updatePost:n=(e=>{}),deletePost:r=(e=>{}),onTopicSelect:i=(e=>{}),noMargin:s=!1,showFullPost:a=!1,isCommunityPost:c=!1,displayPollResult:d=!1}=e;const u=void 0!==t.sharedId,[m,b]=(0,l.useState)(!1),{addToast:v}=(0,g.d)(),{user:y,group:k}=(0,h.G)((e=>({user:e.auth,group:e.activeGroup}))),{profileModelState:{setShowProfileModel:w,setIdToViewProfile:x}}=(0,f.A)();function A(){b(!0),_.K$.deletePost(y,t.id).then((()=>{v("Post deleted"),r(t)})).catch((e=>{console.log(e),v(e.message,p.lm.error),j.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")})).finally((()=>{b(!1)}))}return(0,U.jsx)(R.A,{children:(0,U.jsxs)("div",{className:o()("PostCard mb-3",{shadow:u,"mb-3":!u}),children:[u&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("div",{className:"mt-2 flex cursor-pointer items-center justify-between px-2 pb-1 pt-2",children:[(0,U.jsxs)("div",{className:"flex",children:[(0,U.jsx)(I.eu,{user:t.createdBy,size:20,bold:!0,onClick:e=>{w(!0),x(t.createdBy.id)}})," ",(0,U.jsx)("span",{children:"\xa0 shared"})]}),t.canDelete&&(0,U.jsx)("button",{onClick:A,className:"text-xs text-alert",children:(0,U.jsx)(P.A,{children:"Delete"})})]}),(0,U.jsx)(We,{isProcessing:m})]}),(0,U.jsx)(Ae,{post:t,user:y,group:k,onTopicSelect:i,deletePostHandler:A,updatePost:e=>{t.sharedId===e.id?n({...t,shared:e}):n(e)},deletePost:e=>{t.sharedId===e.id?n({...t,shared:null}):r(t),v("Post deleted")},noMargin:s,showFullPost:a,isCommunityPost:c,addToast:v,isSharedPost:u,displayPollResult:d})]})})}function Ae(e){var t,n,r,i;let{post:s,user:a,group:c,updatePost:d=(e=>{}),deletePost:u=(e=>{}),onTopicSelect:p=(e=>{}),noMargin:h=!1,showFullPost:m=!1,isCommunityPost:f=!1,addToast:g,deletePostHandler:b,isSharedPost:v=!1,displayPollResult:y}=e;const{hideComment:k}=null!==(t=s.preferences)&&void 0!==t?t:{},[w,x]=(0,l.useState)(!1),[_,A]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[j,E]=(0,l.useState)(!1),[N,D]=(0,l.useState)(null);if((0,l.useEffect)((()=>{const e=e=>{D(e.target.src)};return document.querySelectorAll("#PostCard-".concat(s.id," .PostImages img")).forEach((t=>{t.addEventListener("click",e)})),document.querySelectorAll("#PostCard-".concat(s.id," .PostDescription img")).forEach((t=>{t.addEventListener("click",e)})),()=>{document.querySelectorAll("#PostCard-".concat(s.id," .PostImages img")).forEach((t=>{t.removeEventListener("click",e)})),document.querySelectorAll("#PostCard-".concat(s.id," .PostDescription img")).forEach((t=>{t.removeEventListener("click",e)}))}}),[null===s||void 0===s?void 0:s.id]),null===s||v&&null===s.shared)return(0,U.jsx)("div",{className:"theme-bg-disable mt-2 rounded border p-4 text-xs text-secondary-foreground/70",children:(0,U.jsx)(P.A,{children:"Post not available. It may have been deleted."})});const T=null!==(n=null===s||void 0===s?void 0:s.banner)&&void 0!==n?n:null===s||void 0===s||null===(r=s.shared)||void 0===r?void 0:r.banner;return(0,U.jsxs)("div",{id:"PostCard-"+s.id,className:o()("PostCard rounded-xl bg-card",{"sm:my-3":!h&&!v,shadow:!v,"pt-[1px]":!s.banner&&!(null!==s&&void 0!==s&&null!==(i=s.preferences)&&void 0!==i&&i.hideCreator)}),children:[(0,U.jsx)("div",{className:"PostImages",children:(0,U.jsx)(Fe,{image:T,className:"w-full rounded-t-xl object-contain object-center",wrapperClassName:""})}),(0,U.jsxs)("div",{className:"px-7 pt-7",children:[N&&["png","jpg","jpeg","gif"].includes(N.split(".").pop())?(0,U.jsx)("div",{className:"PostImageFullPreview",onClick:e=>{D(null)},children:(0,U.jsxs)("div",{className:"holder",children:[(0,U.jsx)(M.A,{src:N,alt:"Preview"}),(0,U.jsx)(B.A,{icon:"plus",rotate:45,className:"close-button",onClick:e=>{D(null)}})]})}):(0,U.jsx)(U.Fragment,{}),v&&s.shared.event||s.event?(0,U.jsx)(Ce,{event:v?s.shared.event:s.event,user:a,deletePostHandler:b,setIsProcessing:x,post:s,addToast:g,group:c,updatePost:d}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(fe,{post:s,user:a,group:c,addToast:g,updatePost:d,deletePost:u,setEmbedModalVisible:E,isCommunityPost:f,setIsProcessing:x}),(0,U.jsx)(je,{post:s,user:a,group:c,addToast:g,updatePost:d,deletePost:u,setEmbedModalVisible:E,isCommunityPost:f,setIsProcessing:x}),(0,U.jsx)(ze,{post:s}),(0,U.jsx)(Le,{post:s}),s.liveCall||v&&s.shared.liveCall?(0,U.jsx)(Se,{post:s,user:a,addToast:g}):"",(0,U.jsx)(De,{post:s,show:"top"}),(0,U.jsx)(Ee,{post:s,user:a,showFullPost:m,addToast:g}),(0,U.jsx)(Ne,{post:s,onTopicSelect:p}),(0,U.jsx)(De,{post:s,show:"bottom"}),(0,U.jsx)(Me,{post:s,user:a}),(0,U.jsx)(Oe,{post:s}),(0,U.jsx)(ge,{post:s,user:a,updatePost:d}),(0,U.jsx)(ie,{post:s,user:a,updatePost:d,displayPollResult:y}),(0,U.jsx)(Ue,{post:s}),(0,U.jsx)(Re,{post:s}),(0,U.jsx)(Be,{post:s})]}),(0,U.jsx)(Pe,{post:s}),(0,U.jsx)(Ve,{post:s,areCommentsLoading:_,setCommentsLoading:A,setDisplayCreateCommentField:S,updatePost:d}),(0,U.jsx)(Ge,{post:s,updatePost:d,areCommentsLoading:_,setCommentsLoading:A,setDisplayCreateCommentField:S}),!k&&(C||m)&&(0,U.jsx)(X.A,{post:s,user:a,updatePost:d}),(0,U.jsx)(He,{user:a,post:s,group:c,updatePost:d,areCommentsLoading:_,setCommentsLoading:A,addToast:g}),(0,U.jsx)(We,{isProcessing:w}),(0,U.jsx)(L.A,{link:"http://embed.pensil.com"+(window.location.port?":"+window.location.port:"")+"/post/"+s.id,active:j,setActive:E})]})]})}const Ce=(0,c.Ng)((e=>({community:e.community,highlightedPostIds:e.highlightedPosts.postIds})))((e=>{let{event:t,user:n,community:r,highlightedPostIds:o,deletePostHandler:i,setIsProcessing:s,post:u,addToast:p,group:h,updatePost:m}=e;const{profileModelState:{setShowProfileModel:g,setIdToViewProfile:v}}=(0,f.A)();if(null==t)return null;const y=(0,c.wA)(),w=null===o||void 0===o?void 0:o.includes(u.id),x=a().duration(a()(new Date).diff(a()(t.createdAt))).asDays(),[S,j]=(0,l.useState)(!1);return(0,U.jsxs)("div",{children:[t.banner&&(0,U.jsx)("div",{className:"theme-bg-disable w-full",children:(0,U.jsx)("img",{src:t.banner,className:"w-full object-contain",alt:"",loading:"lazy",style:{aspectRatio:"16/9"}})}),(0,U.jsxs)("div",{className:"PostHeader mt-2 flex items-center justify-between",children:[(0,U.jsx)(I.eu,{user:t.createdBy,extraInfo:x<1?a()(t.createdAt).fromNow():a()(t.createdAt).format("DD MMM YYYY"),size:42,className:"cursor-pointer",tag:"admin"===t.createdBy.groupRole?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-primary-foreground px-1 font-semibold text-primary",children:(0,U.jsx)(P.A,{children:"Admin"})}):"moderator"===t.createdBy.groupRole?(0,U.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,U.jsx)(P.A,{children:"Moderator"})}):(t.createdBy.groupRole,(0,U.jsx)(U.Fragment,{})),onClick:e=>{g(!0),v(t.createdBy.id)}}),(0,U.jsxs)("div",{className:"flex items-center",children:[null!==u&&void 0!==u&&u.isPinned?(0,U.jsx)(B.A,{icon:"img",img:"/assets/vectors/pin-light-icon.svg",small:!0,className:"h-8 w-8 bg-primary",onClick:e=>{h&&["admin","moderator"].includes(h.myRole)&&(s(!0),_.K$.unpinPost(n,u.id).then((e=>{let{post:t}=e;s(!1),m(t),y((0,C.ty)(t))})).catch((e=>{s(!1),console.log({err:e})})))}}):(0,U.jsx)(U.Fragment,{}),n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(z.A,{dropdownClassName:t.isBookmarkedByMe||w?"w-56":"w-48",icon:"menu-dots-vertical",hideOnEmpty:!0,actions:[{icon:"",solidIcon:t.isBookmarkedByMe,label:"Go to event",onClick:()=>{b.b6.push((0,k.createEventDetailSlugPageRoute)(t))}},{icon:"",solidIcon:w,label:"admin"===(null===r||void 0===r?void 0:r.myRole)?w?"Remove from featured post":"Add to featured post":"",onClick:e=>{s(!0),y(w?(0,A.uE)(u.id,(e=>{e||(s(!1),p("Post removed from featured!"))})):(0,A.rp)(u.id,(e=>{e||(s(!1),p("Post set as featured!"))})))}},{icon:"",solidIcon:u.isPinned,label:h&&["admin","moderator"].includes(h.myRole)?u.isPinned?"Remove Pin":"Pin Post":"",onClick:e=>{console.log(u),s(!0),(u.isPinned?_.K$.unpinPost(n,u.id):_.K$.pinPost(n,u.id)).then((e=>{let{post:t}=e;s(!1),t.isPinned?y((0,C.DG)(t)):y((0,C.ty)(t)),m(t)})).catch((e=>{s(!1),console.log({err:e})}))}},{icon:"",solidIcon:t.isBookmarkedByMe,label:(0,U.jsx)("div",{className:"text-alert",children:"Remove"}),onClick:()=>{j(!0)}}]}),(0,U.jsx)(N.c,{active:S,onSubmit:i,setActive:j,header:"Remove event",title:"Are you sure you want to remove event from here ?"})]}):(0,U.jsx)(U.Fragment,{})]})]}),(0,U.jsx)("div",{className:"PostTitle my-4 w-full cursor-pointer break-words text-xl font-semibold focus:outline-none",onClick:e=>{b.b6.push((0,k.createEventDetailSlugPageRoute)(t))},children:t.title?t.title:""}),(0,U.jsxs)("div",{className:"flex",children:[(0,U.jsx)("i",{className:"fi fi-rr-calendar pr-2 text-sm font-semibold"}),(0,U.jsx)("div",{className:"font-semibold",children:(0,k.formatEventTime)(t.startTime,t.endTime)})]}),r&&r.timezone&&(0,U.jsxs)("div",{className:"py-2 text-xs text-secondary-foreground/85",children:[(0,U.jsxs)("span",{className:"font-semibold",children:[(0,U.jsx)(P.A,{children:"Timezone"}),":\xa0"]}),(0,U.jsx)("span",{children:r.timezone})]}),(0,U.jsx)(Ee,{post:t,user:n,isEvent:!0}),(0,U.jsx)("div",{className:"mb-2 mt-4 flex flex-row items-center",children:n?(0,U.jsx)(d.N_,{className:"flex justify-center rounded bg-primary px-4 py-2",to:n?(0,k.createEventDetailSlugPageRoute)(t):void 0,children:(0,U.jsx)("p",{className:"text-sm text-primary-foreground",children:(0,U.jsx)(P.A,{children:"View this event"})})}):(0,U.jsxs)("span",{className:"flex h-4 w-14 justify-center space-x-1 rounded bg-indigo-400 px-2 text-xs",to:n?(0,k.createEventDetailSlugPageRoute)(t):void 0,children:[(0,U.jsx)("img",{className:"inline",src:"/assets/vectors/calender-outlined-icon.svg",alt:"event",loading:"lazy"}),(0,U.jsx)("p",{className:"text-xs text-primary-foreground",children:(0,U.jsx)(P.A,{children:"Event"})})]})}),(0,U.jsx)(Re,{post:{event:t}})]})}));function Se(e){let{post:t,user:n,addToast:r}=e;const o=E.A.hasValue(t.shared),{liveCall:s,scheduledTime:l}=o?t.shared:t,c=l;!!c&&(0,i.default)(new Date(l),Date.now());return s.isLive&&!s.isEnded?(0,U.jsx)(U.Fragment,{children:!c||s.isLive||s.isEnded?(0,U.jsx)("div",{className:"PostDescriptionLive my-1 flex flex-col items-start space-y-2",children:(0,U.jsx)(O.$,{label:"Join Meeting",onClick:()=>{let e=n?(0,y.Hm)(s.meetingId,n.token):null;e&&window.open(e)}})}):(0,U.jsxs)("div",{className:"mb-5",children:[a()(l).format("ddd D, MMM Y [at] h:mm a"),(0,U.jsx)("div",{className:"my-2",children:(0,U.jsx)(O.$,{label:"Join Meeting",className:"mt-2",onClick:()=>{let e=n?(0,y.Hm)(s.meetingId,n.token):null;e&&window.open(e)}})})]})}):(0,U.jsx)("div",{className:"PostDescription my-4 rounded bg-background p-4 text-secondary-foreground/70",children:(0,U.jsx)(P.A,{children:"The live meeting has ended"})})}function je(e){var t;let{post:n,user:r,addToast:o,deletePost:i,group:s,setEmbedModalVisible:a,setIsProcessing:l,updatePost:c}=e;const d=E.A.hasValue(n.shared);let{title:u}=d?n.shared:n;const{hideCreator:p}=null!==(t=n.preferences)&&void 0!==t?t:{},{analyticsService:h}=(0,m.W)();return(0,U.jsxs)("div",{className:"flex items-start justify-between",children:[u&&(0,U.jsx)("h1",{className:"my-2 cursor-pointer scroll-m-20 text-base font-semibold tracking-tight text-secondary-foreground focus:outline-none break-words",style:{overflowWrap:"anywhere"},onClick:e=>{b.b6.push((0,w.createPostDetailPageRouteFromSlug)(d?n.shared:n)),h.track("post-clicked",{groupName:null===n||void 0===n?void 0:n.group.name,sectionName:null===n||void 0===n?void 0:n.tab.name,postUrl:window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(n)})},children:u}),p&&(0,U.jsx)(me,{addToast:o,deletePost:i,group:s,post:n,setEmbedModalVisible:a,setIsProcessing:l,updatePost:c,user:r})]})}function Ee(e){let{post:t,user:n,addToast:r=(e=>{}),showFullPost:i,isEvent:s=!1}=e;const a=E.A.hasValue(t.shared),[c,d]=(0,l.useState)(!1);let{description:p}=a?t.shared:null!==t&&void 0!==t?t:"";const h=p.split("\n").length>9,m=new u.F,f=Te(p),g=m.render(f);let b=g;try{b=g.replace(/\B\@([\w\-]+)/gim,(e=>''.concat(e,"")))}catch(k){}const v=Ie(b.replace(/{if(E.A.hasValue(p))try{if(y){document.querySelectorAll("#".concat(y," pre>code")).forEach((e=>{const t=e.parentElement;t.style.position="relative";const n=document.createElement("span");n.style.position="absolute",n.style.top="0px",n.style.right="5px",n.style.cursor="pointer",n.innerText="Copy",n.onclick=async()=>{try{return void await navigator.clipboard.writeText(e.innerText)}catch(k){console.error("Cannot copy to clipboard, trying legacy")}const t=document.createElement("textarea");t.value=e.innerText,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),r("Copied to clipboard")},t.appendChild(n)}))}}catch(k){console.error("PostDescription",k)}}),[r,p,v,y]),p?(0,U.jsxs)("div",{id:y,className:o()("PostDescription text-secondary-foreground",{"has-more":h&&!c&&!i,"mb-4":!s}),children:[(0,U.jsx)("div",{className:"NL2BR headings text-xs",dangerouslySetInnerHTML:{__html:v}}),!h||c||i?h&&c&&!i?(0,U.jsx)("span",{onClick:()=>{d(!1)},className:"read-more text-primary-default cursor-pointer text-sm font-bold uppercase",children:(0,U.jsx)(P.A,{children:"show less"})}):(0,U.jsx)(U.Fragment,{}):(0,U.jsx)("span",{onClick:()=>{d(!0)},className:"read-more text-primary-default text-xs font-bold uppercase",children:(0,U.jsx)(P.A,{children:"read more..."})})]}):(0,U.jsx)(U.Fragment,{})}function Ne(e){var t;let{post:n,onTopicSelect:r=(e=>{})}=e;return(0,U.jsx)("div",{className:"flex h-fit w-full flex-wrap items-center p-0.5",children:null===n||void 0===n||null===(t=n.topics)||void 0===t?void 0:t.map((e=>(0,U.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e)},className:"my-1 mr-1 flex justify-center rounded-2xl px-4 py-0.5 hover:cursor-pointer",style:{backgroundColor:e.bgColor,color:e.textColor},children:(0,U.jsx)("span",{children:e.name})},e.id)))})}function Pe(e){let{post:t}=e;const n=E.A.hasValue(t.shared)?t.shared.description:t.description;if(!E.A.hasValue(n))return(0,U.jsx)(U.Fragment,{});const r=n.match(/\[(.*?)\]\((.*?)\)/gim);if(!E.A.hasValue(r))return null;const o=r[0].replace(/.*\((.*)\)/,"$1");return!E.A.hasValue(o)||(e=>new RegExp("^(https?://)?(www.youtube.com|youtu.?be)(?!/shorts|/channel)/.+$").test(e))(o)?null:(0,U.jsx)(ke,{url:o,className:"mb-2"})}function De(e){let{post:t,show:n="top"}=e;const r=E.A.hasValue(t.shared);let{buttons:o}=r?t.shared:null!==t&&void 0!==t?t:[];if(!E.A.hasValue(o))return(0,U.jsx)(U.Fragment,{});const i=o.filter((e=>e.position===n));return E.A.hasValue(i)?(0,U.jsx)("div",{className:"PostCustomButtons my-4 break-all",children:i.map(((e,t)=>{var n;return(0,U.jsx)(O.$,{label:null!==(n=e.label)&&void 0!==n?n:"Click here",onClick:()=>{window.open(e.url,"_blank")}},t)}))}):(0,U.jsx)(U.Fragment,{})}function Me(e){let{post:t,user:n}=e;const r=E.A.hasValue(t.shared);let{tags:o}=r?t.shared:t;return 0===o.length?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)("div",{className:"tags-container items-center",children:o.map(((e,t)=>(0,U.jsx)("div",{className:"theme-bg-disable tag-body ml-2 flex cursor-pointer border border-border text-xs hover:bg-primary-light",onClick:t=>{b.b6.push((0,x.showTagPageRoute)(e))},children:(0,U.jsx)("span",{className:"tag-title",children:e.length>30?e.substr(0,30)+"...":e})},t)))})}function Te(e){return e.replace(/(\[.*?\]\()?(https?:\/\/)?(www\.)?youtu(be\.com|\.be)\/(?!.*channel|short|playlist)(?:watch\?v=)?([a-zA-Z0-9\-_]+)([^\s]*?)?\)/g,"https://youtube.com/watch?v=$5")}function Ie(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.replace(/(()[\] \n]+)([^"]+)(">)([^<]+)(<\/a>)/g,'

');return t=e.replace(/(?:(?:http:|https:)(?:\/\/))?(?:www\.)?(?:youtube.com|youtu.be)\/(?!.*channel|short|playlist)(?:watch)?(?:\?v=)?([^&<">()[\] \n]+)([^" \n]+)/g,'

'),t=t.replace(/(?:[^"'https://])(?:(?:http:|https:)(?:\/\/))?(?:www\.)?(?:player\.)?(?:vimeo.com)\/(?:video\/)?([^<">()[\] \n]+)/g,'

'),t}function Oe(e){let{post:t}=e;const n=E.A.hasValue(t.shared)?t.shared.poll:t.poll;return n&&n.isQuiz?(0,U.jsx)("div",{className:"my-4 text-sm text-yellow-600",children:(0,U.jsx)(P.A,{children:"Quiz can be only viewed and attempted from mobile device right now!"})}):(0,U.jsx)(U.Fragment,{})}function Le(e){var t;let{post:n}=e;const r=E.A.hasValue(n.shared)?null===(t=n.shared)||void 0===t?void 0:t.videos:n.videos;return r&&r.length>0?(0,U.jsx)("div",{className:"my-4 text-sm text-yellow-600",children:r.map(((e,t)=>(0,U.jsx)("div",{className:"mb-2 h-80 w-full",children:(0,U.jsx)("video",{src:e,controls:!0,controlsList:"nodownload",className:"h-full w-full bg-black",onContextMenu:e=>{e.preventDefault()}},t)},t)))}):(0,U.jsx)(U.Fragment,{})}function Re(e){var t,n,r;let{post:o}=e;const i=null!==(t=o.event)&&void 0!==t&&t.liveCall?o.event.liveCall:o.shared?(null===(n=o.shared)||void 0===n?void 0:n.liveCall)||(null===(r=o.shared)||void 0===r?void 0:r.liveCall):o.liveCall||o.liveCall;if(!o||!i||!i.recordings||!Array.isArray(i.recordings))return(0,U.jsx)(U.Fragment,{});const{recordings:s}=i;return(0,U.jsx)("div",{children:null===s||void 0===s?void 0:s.map(((e,t)=>(0,U.jsx)("video",{src:e,controls:!0,controlsList:"nodownload"},t)))})}function Be(e){var t,n;let{post:r}=e;const o=E.A.hasValue(r.shared),i=o?null===(t=r.shared)||void 0===t?void 0:t.embedCode:r.embedCode,s=o?null===(n=r.shared)||void 0===n?void 0:n.embedCodeHeight:r.embedCodeHeight;return i?(0,U.jsx)("iframe",{srcDoc:i,title:o?r.shared.title:r.title,className:"PostEmbedCodeViewer",style:s?{height:s+"px"}:{minHeight:"340px"}}):(0,U.jsx)(U.Fragment,{})}function ze(e){let{post:t}=e;const n=E.A.hasValue(t.shared)?t.shared.images:t.images;return!Array.isArray(n)||n.length<1?(0,U.jsx)(U.Fragment,{}):1===n.length?(0,U.jsx)("div",{className:"PostImages align-center my-2 flex justify-center",children:(0,U.jsx)(Fe,{image:n[0],className:"w-full rounded object-contain object-center",wrapperClassName:"p-0"})}):2===n.length?(0,U.jsx)("div",{className:"PostImages my-4 flex justify-between",children:n.map((e=>(0,U.jsx)(Fe,{image:e,className:"object-cover object-center"},e)))}):3===n.length?(0,U.jsxs)("div",{className:"PostImages my-4",children:[(0,U.jsx)(Fe,{className:"flex h-full w-full justify-center object-cover object-center",image:n[0]}),(0,U.jsxs)("div",{className:"mt-2 flex",children:[(0,U.jsx)(Fe,{className:"w-full object-cover object-center",image:n[1]}),(0,U.jsx)(Fe,{className:"w-full object-cover object-center",image:n[2]})]})]}):4===n.length?(0,U.jsxs)("div",{className:"PostImages my-4",children:[(0,U.jsx)(Fe,{className:"flex h-full w-full justify-center object-cover object-center",image:n[0]}),(0,U.jsxs)("div",{className:"mt-2 flex",children:[(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[1]}),(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[2]}),(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[3]})]})]}):n.length>=5?(0,U.jsxs)("div",{className:"PostImages my-4",children:[(0,U.jsxs)("div",{className:"flex",children:[(0,U.jsx)(Fe,{className:"flex h-full w-full justify-center object-cover object-center",image:n[0]}),(0,U.jsx)(Fe,{className:"h-full w-full object-cover object-center",image:n[1]})]}),(0,U.jsxs)("div",{className:"mt-2 flex",children:[(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[2]}),(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[3]}),(0,U.jsx)(Fe,{className:"h-52 w-full object-cover object-center",image:n[4],more:n.length-5})]})]}):void 0}function Fe(e){let{image:t,more:n=0,className:r="",wrapperClassName:i="p-1"}=e;return t?(0,U.jsxs)("div",{className:"PostImage relative "+i,children:[n>0?(0,U.jsx)("div",{className:"more h-full rounded-md",children:(0,U.jsxs)("span",{children:["+",n]})}):(0,U.jsx)(U.Fragment,{}),(0,U.jsx)(M.A,{src:t,className:o()("h-full max-h-[70vh] w-full border border-border",r),alt:"PostImage"})]}):(0,U.jsx)(U.Fragment,{})}function Ue(e){var t,n;let{post:r,smallMargin:i=!1}=e;const s=E.A.hasValue(r.shared),a=s?null===(t=r.shared)||void 0===t?void 0:t.document:r.document,l=s?null===(n=r.shared)||void 0===n?void 0:n.documentName:r.documentName;return a&&["mp4","mov","webm","ogg"].includes(a.split(".").pop())?(0,U.jsx)("div",{className:o()("relative",{"my-8":!i,"my-2":i}),children:(0,U.jsx)("div",{className:"mr-3 mt-2 py-1",children:(0,U.jsx)("video",{className:"m-0 rounded-md",controls:!0,controlsList:"nodownload",children:(0,U.jsx)("source",{src:a})})})}):a&&["wav","mp3","aac","amr"].includes(a.split(".").pop())?(0,U.jsx)("div",{className:o()("relative",{"my-8":!i,"my-2":i}),children:(0,U.jsx)("div",{className:"mr-3 mt-2 py-1",children:(0,U.jsx)("audio",{className:"m-0 w-full rounded-md",controls:!0,controlsList:"nodownload",children:(0,U.jsx)("source",{src:a})})})}):a&&["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(a.split(".").pop())?(0,U.jsx)(ze,{post:{images:[a],shared:void 0}}):a?(0,U.jsx)("div",{className:o()("relative",{"my-8":!i,"my-2":i}),children:(0,U.jsxs)("a",{download:!0,target:"_blank",rel:"noreferrer",href:a,title:"Open file",className:"flex items-center space-x-2 rounded border-2 border-border px-4 py-2 font-semibold text-secondary-foreground/80",children:[(0,U.jsx)(Z.A,{icon:"document",className:"h-9 text-3xl"}),(0,U.jsxs)("div",{className:"flex flex-grow items-center justify-between space-x-4",children:[(0,U.jsxs)("div",{className:"items-center",children:[(0,U.jsx)("div",{children:l||S(r.document)}),(0,U.jsx)("div",{className:"text-xs uppercase",children:(l||r.document).split(".").pop()})]}),(0,U.jsx)("span",{className:"flex-none",children:(0,U.jsx)(Z.A,{icon:"download",className:"text-xl"})})]})]})}):(0,U.jsx)(U.Fragment,{})}function Ve(e){let{post:t,updatePost:n=(e=>{}),areCommentsLoading:r=!1,setCommentsLoading:o=(e=>{}),setDisplayCreateCommentField:i=(e=>{})}=e;const{latestLikes:s}=t,[a,c]=(0,l.useState)(!1),{user:d,community:u}=(0,h.G)((e=>({community:e.community,user:e.auth})));return(0,U.jsx)("div",{className:"PostLikesPreview text-xs text-secondary-foreground/70",children:(0,U.jsxs)("div",{className:"relative mb-1 flex h-8 w-full items-center justify-between",children:[Array.isArray(s)&&s.length>0&&(0,U.jsxs)("div",{className:"flex cursor-pointer items-center",onClick:e=>{c(!0)},children:[null===s||void 0===s?void 0:s.map(((e,t)=>(0,U.jsx)(V,{src:e.picture,className:"absolute h-6 w-6 rounded-full border border-border",style:{left:10*t+"px"}},t))),(0,U.jsx)(xe,{post:t,isUpvotingUsersListVisible:a,setIsUpvotingUsersListVisible:c})]}),t.commentCount>0&&r&&(0,U.jsx)(F.a,{}),t.commentCount>0&&!r&&(0,U.jsx)("div",{className:"flex-end cursor-pointer",onClick:()=>{if(!d)return window.alert("Hey, there! You need to log in to add comment."),(0,v.D4)(u);i(!0),t.comments||r||(o(!0),_.K$.getPostDetail(d,t.id).then((e=>{n(e.post),o(!1)})).catch((e=>{console.log({err:e}),o(!1)})))},children:1===t.commentCount?"1 Comment":"".concat(t.commentCount," Comments")})]})})}const Ge=(0,c.Ng)((e=>({user:e.auth,community:e.community})))((e=>{var t;let{post:n,user:r,community:i,updatePost:s=(e=>{}),areCommentsLoading:a=!1,setCommentsLoading:c=(e=>{}),setDisplayCreateCommentField:d=(e=>{})}=e;const[u,p]=(0,l.useState)(!1),{hideLikes:h,hideComment:f,hideDate:b}=null!==(t=n.preferences)&&void 0!==t?t:{},[y,k]=(0,l.useState)(!1),{addToast:x}=(0,g.d)(),{analyticsService:A}=(0,m.W)();return(0,U.jsxs)("div",{className:o()("flex items-center justify-around text-xs text-secondary-foreground",{"border-t border-border":!(f&&h)}),children:[(0,U.jsx)("div",{className:o()("px-5 py-2",{hidden:h,"mr-2":!h}),children:(0,U.jsxs)("button",{className:"flex items-center ".concat(n.isLikedByMe?"text-primary":""),onClick:()=>{if(!u)return r?void(n.isLikedByMe?(p(!0),_.K$.dislikePost(r,n.id).then((e=>{let{post:t}=e;s(t)})).catch((e=>{console.error({err:e}),j.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")})).finally((()=>{p(!1)}))):(p(!0),_.K$.likePost(r,n.id).then((e=>{var t,n;let{post:r}=e;s(r),A.track("like-post",{userType:i.myRole,postId:r.id,groupName:null===r||void 0===r||null===(t=r.group)||void 0===t?void 0:t.name,sectionName:null===r||void 0===r||null===(n=r.tab)||void 0===n?void 0:n.name,postUrl:window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(r)})})).catch((e=>{console.error({err:e}),j.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")})).finally((()=>{p(!1)})))):(window.alert("Hey, there! You need to log in to like posts."),(0,v.D4)(i))},children:[(0,U.jsx)(D.$,{fill:n.isLikedByMe?"":"none",className:o()("flex items-center text-base",{"text-primary":n.isLikedByMe,hidden:h})}),(0,U.jsx)("span",{className:"".concat(n.isLikedByMe&&"text-primary"," ml-2"),children:"Like"})]})}),(0,U.jsx)("div",{className:"px-5 py-2",children:a?(0,U.jsx)(F.a,{}):(0,U.jsx)("div",{className:"flex items-center",children:(0,U.jsxs)("button",{className:o()("flex items-center",{invisible:f}),onClick:()=>{if(!r)return window.alert("Hey, there! You need to log in to add comment."),(0,v.D4)(i);d(!0),n.comments||a||(c(!0),_.K$.getPostDetail(r,n.id).then((e=>{s(e.post),c(!1)})).catch((e=>{console.log({err:e}),c(!1)})))},children:[(0,U.jsx)(Z.A,{icon:"comment-alt",size:"sm",className:"".concat(n.isCommentedOnByMe&&"text-primary"," mt-1"),solid:n.isCommentedOnByMe}),(0,U.jsx)("span",{className:"".concat(n.isCommentedOnByMe&&"text-primary"," ml-2.5"),children:"Comment"})]})})}),(0,U.jsx)("div",{className:o()("px-5 py-2",{invisible:f}),children:r&&!n.sharedId&&(0,U.jsxs)("button",{className:"items",onClick:e=>{k(!0)},children:[(0,U.jsx)(Z.A,{icon:"redo",size:"sm",className:"mt-1"}),(0,U.jsx)("span",{className:"ml-2.5",children:"Share"})]})}),!n.sharedId&&(0,U.jsx)(Q,{post:n,heading:"Share",text:window.location.origin+(0,w.createPostDetailPageRouteFromSlug)(n),active:y,setActive:k,onClose:()=>{k(!1)}})]})}));function He(e){var t;let{user:n,post:r,group:o,updatePost:i,areCommentsLoading:s=!1,setCommentsLoading:a=(e=>{}),addToast:l=(e=>{})}=e;const{hideComment:c}=null!==(t=r.preferences)&&void 0!==t?t:{};if(c)return(0,U.jsx)(U.Fragment,{});const d=function(e){if(E.A.hasValue(r.comments)){const t=[...r.comments],n=t.findIndex((t=>t.id===e.id));n>-1&&(t[n]=e,i({...r,comments:t}))}else i({...r,latestComment:e})};return!E.A.hasValue(r.comments)&&r.latestComment?(0,U.jsxs)("div",{className:"PostComments border-t border-border pb-2 text-secondary-foreground",children:[(0,U.jsx)(J.I,{post:r,group:o,user:n,postId:r.id,comment:r.latestComment,isLatestComment:!0,updatePost:i,updateComment:e=>{d(e,!0)},addToast:l},r.latestComment.id),r.commentCount>1?(0,U.jsx)("div",{className:"my-2",children:(0,U.jsx)("span",{className:"cursor-pointer text-xs text-primary",onClick:e=>{E.A.hasValue(r.comments)||s||(a(!0),_.K$.getPostDetail(n,r.id).then((e=>{i(e.post),a(!1)})).catch((e=>{a(!1)})))},children:(0,U.jsx)(P.A,{children:"Load more comments"})})}):(0,U.jsx)(U.Fragment,{})]}):r.comments&&0!==r.comments.length?(0,U.jsx)("div",{className:"mt-1 pb-3",children:r.comments.map(((e,t)=>(0,U.jsx)(J.I,{post:r,user:n,postId:r.id,comment:e,updatePost:i,updateComment:d,addToast:l},e.id)))}):(0,U.jsx)(U.Fragment,{})}function We(e){let{isProcessing:t}=e;return t?(0,U.jsx)("div",{className:"PostProcessing",children:(0,U.jsx)(F.a,{})}):(0,U.jsx)(U.Fragment,{})}},72613:(e,t,n)=>{"use strict";n.d(t,{f:()=>i});var r=n(1689),o=n(62391);function i(e){let{images:t=[],onDelete:n=null,truncate:r=!1}=e;return!Array.isArray(t)||t.length<1?(0,o.jsx)(o.Fragment,{}):1===t.length?(0,o.jsx)("div",{className:"PostImages align-center my-4 flex justify-center",children:(0,o.jsx)(s,{className:"flex h-full w-full justify-center object-contain object-center",onDelete:n,image:t[0],index:0})}):2===t.length?(0,o.jsx)("div",{className:"PostImages my-4 flex justify-between",children:t.map(((e,t)=>(0,o.jsx)(s,{onDelete:n,index:t,image:e,className:"h-52 w-full object-cover object-center"},e)))}):3===t.length?(0,o.jsxs)("div",{className:"PostImages my-4",children:[(0,o.jsx)(s,{className:"flex h-full w-full justify-center object-cover object-center",onDelete:n,image:t[0],index:0}),(0,o.jsxs)("div",{className:"mt-2 flex",children:[(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[1],index:1}),(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[2],index:2})]})]}):4===t.length?(0,o.jsxs)("div",{className:"PostImages my-4",children:[(0,o.jsx)(s,{className:"h-full w-full object-cover object-center",onDelete:n,image:t[0],index:0}),(0,o.jsxs)("div",{className:"mt-2 flex",children:[(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[1],index:1}),(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[2],index:2}),(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[3],index:3})]})]}):t.length>=5?(0,o.jsxs)("div",{className:"PostImages my-4",children:[(0,o.jsxs)("div",{className:"flex",children:[(0,o.jsx)(s,{className:"flex h-full w-full justify-center object-cover object-center",onDelete:n,image:t[0],index:0}),(0,o.jsx)(s,{className:"h-full w-full object-cover object-center",onDelete:n,image:t[1],index:1})]}),(0,o.jsxs)("div",{className:"mt-2 flex",children:[(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[2],index:2}),(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[3],index:3}),(0,o.jsx)(s,{className:"h-52 w-full object-cover object-center",onDelete:n,image:t[4],index:4,more:t.length-5})]})]}):void 0}function s(e){let{image:t,single:n=!1,index:i,onDelete:s,more:a=0,className:l=""}=e;return(0,o.jsxs)("div",{className:"PostImage relative w-full p-1 ",children:[(0,o.jsx)(r.A,{src:t,alt:"PostImage",className:"h-full max-h-[70vh] w-full "+l}),a>0?(0,o.jsx)("div",{className:"more h-full",children:(0,o.jsxs)("span",{children:["+",a]})}):s?(0,o.jsx)("div",{className:"delete",onClick:e=>{s(i)},children:"\xd7"}):(0,o.jsx)(o.Fragment,{})]})}},82256:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{R:()=>ProfileUpdate});var classnames__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5564),classnames__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__),lodash__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(31012),lodash__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(20975),react_redux__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(31305),redux__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(82993),remarkable__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(34067),turndown__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(71214),_contexts_toastr_context__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(89449),_hooks_use_app_service__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(65186),_assets_vectors_behance_svg__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(67787),_assets_vectors_dribbble_svg__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(55227),_assets_vectors_facebook_svg__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(64125),_assets_vectors_globe_icon_svg__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(16442),_assets_vectors_instagram_svg__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(71703),_assets_vectors_linkedin_svg__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(89859),_assets_vectors_pinterest_svg__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(86285),_assets_vectors_twitter_svg__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(38298),_assets_vectors_youtube_svg__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(92704),_config_constants_config__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(50963),_constants_mediaType__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(83789),_service__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(43039),_service_analytics_service__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(87573),_store_actions_auth_actions__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(77255),_utils_main_util__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(31696),_activity_close_button_component__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(63360),_atoms_i18__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(53871),_button_component__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(44139),_error_component__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(32679),_form_controls_file_input__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(69302),_form_controls_tick_component__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(5673),_icon_button_2_component__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(90559),_image_crop_image_crop_modal__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(81107),_loader_component__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(19328),_molecule_listview_component__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(84003),_text_input_component__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(54617),_uicon_component__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(62144),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(62391);const RichTextEditor=react__WEBPACK_IMPORTED_MODULE_2__.lazy((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,94503)))),tds=new turndown__WEBPACK_IMPORTED_MODULE_5__.A;function ProfileUpdateComponent(_ref){let{user:user,community:community,setUser:setUser,visible:visible=!1,isFullScreen:isFullScreen=!0,setVisible:setVisible=(e=>{}),addToast:addToast=(e=>{})}=_ref;const isUserNotNew="New User"!==(null===user||void 0===user?void 0:user.name),{analyticsService:analyticsService}=(0,_hooks_use_app_service__WEBPACK_IMPORTED_MODULE_7__.W)(),[isFormSubmittable,setIsFormSubmittable]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!!isUserNotNew),[name,setName]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[shortBio,setShortBio]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[userId,setUserId]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[bio,setBio]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[instagramLink,setInstagramLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[linkedinLink,setLinkedinLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[youtubeLink,setYoutubeLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[twitterLink,setTwitterLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[facebookLink,setFacebookLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[pintrestLink,setPintrestLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[dribbbleLink,setDribbbleLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[behanceLink,setBehanceLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[webLink,setWebsiteLink]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[picture,setPicture]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[errorMessage,setErrorMessage]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(""),[isLoading,setIsLoading]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),[isCheckingForAvailability,setIsCheckingForAvailability]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),[userIdAvailable,setUserIdAvailable]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!0),[fetchingUserProfile,setFetchingUserProfile]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),[isSocialDropdownVisible,setIsSocialDropdownVisible]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),[defaultSocialMedia,setDefaultSocialMedia]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]),[isUpdateProfileDisabled,setIsUpdateProfileDisabled]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),md=new remarkable__WEBPACK_IMPORTED_MODULE_4__.F,[customSocialMedia,setCustomSocialMedia]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([{name:"Instagram",icon:_assets_vectors_instagram_svg__WEBPACK_IMPORTED_MODULE_12__.A,isAvailable:!1,setValue:"instagramLink"},{name:"Linkedin",icon:_assets_vectors_linkedin_svg__WEBPACK_IMPORTED_MODULE_13__.A,isAvailable:!1,setValue:"linkedinLink"},{name:"Youtube",icon:_assets_vectors_youtube_svg__WEBPACK_IMPORTED_MODULE_16__.A,isAvailable:!1,setValue:"youtubeLink"},{name:"Twitter",icon:_assets_vectors_twitter_svg__WEBPACK_IMPORTED_MODULE_15__.A,isAvailable:!1,setValue:"twitterLink"},{name:"Facebook",icon:_assets_vectors_facebook_svg__WEBPACK_IMPORTED_MODULE_10__.A,isAvailable:!1,setValue:"facebookLink"},{name:"Pintrest",icon:_assets_vectors_pinterest_svg__WEBPACK_IMPORTED_MODULE_14__.A,isAvailable:!1,setValue:"pintrestLink"},{name:"Dribbble",icon:_assets_vectors_dribbble_svg__WEBPACK_IMPORTED_MODULE_9__.A,isAvailable:!1,setValue:"dribbbleLink"},{name:"Behance",icon:_assets_vectors_behance_svg__WEBPACK_IMPORTED_MODULE_8__.A,isAvailable:!1,setValue:"behanceLink"},{name:"Website",icon:_assets_vectors_globe_icon_svg__WEBPACK_IMPORTED_MODULE_11__.A,isAvailable:!1,setValue:"webLink"}]),setIsProfileUpdateDisabledForUsers=async()=>{var e;if(null===community||void 0===community||!community.id)return;const t=await _service__WEBPACK_IMPORTED_MODULE_19__.BE.getConfigurable(community.id,_config_constants_config__WEBPACK_IMPORTED_MODULE_17__.A.COMMUNITY_PREVENT_USER_PROFILE_UPDATE);setIsUpdateProfileDisabled("true"===(null===t||void 0===t||null===(e=t.configurable)||void 0===e?void 0:e.configurableValue))};(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)((()=>{if(!isSocialDropdownVisible)return;const e=e=>{setIsSocialDropdownVisible(!0)};return window.document.body.addEventListener("click",e),()=>{window.document.body.removeEventListener("click",e)}}),[isSocialDropdownVisible]),(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)((()=>{(isUserNotNew||visible)&&(setFetchingUserProfile(!0),_service__WEBPACK_IMPORTED_MODULE_19__.DL.getUserProfile(user).then((e=>{let{user:t}=e;const n={...t,token:user.token,email:t.email,mobile:t.mobile};setUser(n),localStorage.setItem("pensil.user",JSON.stringify(n)),setFetchingUserProfile(!1)})).catch((e=>{setFetchingUserProfile(!1),setErrorMessage(e.message),_utils_main_util__WEBPACK_IMPORTED_MODULE_21__.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")})),setIsProfileUpdateDisabledForUsers())}),[isUserNotNew,visible,null===community||void 0===community?void 0:community.id]),(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)((()=>{setName(isUserNotNew?user.name:""),setShortBio(isUserNotNew?user.shortBio:""),setUserId(user.userId?user.userId:""),setUserIdAvailable(user.userId),setBio(user.bio?md.render(user.bio):""),setPicture(user.picture),setInstagramLink(user.instagramLink?user.instagramLink:""),setLinkedinLink(user.linkedinLink?user.linkedinLink:""),setYoutubeLink(user.youtubeLink?user.youtubeLink:""),setTwitterLink(user.twitterLink?user.twitterLink:""),setFacebookLink(user.facebookLink?user.facebookLink:""),setPintrestLink(user.pintrestLink?user.pintrestLink:""),setDribbbleLink(user.dribbbleLink?user.dribbbleLink:""),setBehanceLink(user.behanceLink?user.behanceLink:""),setWebsiteLink(user.webLink?user.webLink:""),updateSocial()}),[user,isUserNotNew,visible]);const updateSocial=()=>{if(customSocialMedia.forEach((element=>{eval(element.setValue).length>=1&&!element.isAvailable?(element.isAvailable=!0,setDefaultSocialMedia([...defaultSocialMedia,element])):eval(element.setValue).length<=0&&element.isAvailable&&(element.isAvailable=!1,setDefaultSocialMedia([...defaultSocialMedia,element]))})),customSocialMedia.length>0){let e=customSocialMedia.filter((e=>e.isAvailable));setDefaultSocialMedia(e)}},checkForAddressAvailability=(0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)((0,lodash__WEBPACK_IMPORTED_MODULE_1__.debounce)((e=>{/^[A-Za-z0-9_.]{3,63}$/.test(e)&&(setIsCheckingForAvailability(!0),_service__WEBPACK_IMPORTED_MODULE_19__.DL.checkForUserIdAvailability(e,user).then((e=>{let{userIdAvailable:t}=e;setUserIdAvailable(t),setIsCheckingForAvailability(!1)})).catch((e=>{console.log({error:e}),setUserIdAvailable(!1),setIsCheckingForAvailability(!1)})))}),1e3),[]);return isUserNotNew&&!visible?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.Fragment,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_0___default()("ProfileUpdate bg-card",{"flex items-center justify-center overflow-scroll":isFullScreen}),style:{position:isFullScreen?"fixed":"",top:0,bottom:0,left:0,right:0,zIndex:900},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"flex items-center justify-center",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"w-96 p-4 sm:p-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:"py-6",children:[isUserNotNew?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.Fragment,{children:isFullScreen&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"flex justify-end",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_icon_button_2_component__WEBPACK_IMPORTED_MODULE_28__.A,{hoverable:!0,icon:"cross",size:"md",onClick:()=>{setVisible(!1)}})})}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"flex justify-center text-lg font-semibold text-secondary-foreground/85",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_atoms_i18__WEBPACK_IMPORTED_MODULE_23__.A,{children:"Hi, tell us a little bit about yourself?"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(PictureUpdate,{picture:picture,setPicture:setPicture,isUserNotNew:isUserNotNew,name:name}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"mt-4 font-semibold text-secondary-foreground/85",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{children:"Your name"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_text_input_component__WEBPACK_IMPORTED_MODULE_32__.k,{placeholder:"Name",validator:e=>e.length<2?(setIsFormSubmittable(!1),"Name invalid!"):e.length>50?(setIsFormSubmittable(!1),"Name should be less than 50 characters"):void setIsFormSubmittable(!0),defaultValue:name,noBorder:!0,className:"mb-1 border border-border bg-background py-2 focus:outline-none",onChange:e=>{setName(e)},disabled:isUserNotNew&&isUpdateProfileDisabled&&!("admin"===community.myRole)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:"mt-4 flex items-end gap-2",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{className:"font-semibold text-secondary-foreground/85",children:"Subtitle"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{className:"text-xxs font-normal text-secondary-foreground/80",children:"(Max char 60)"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_text_input_component__WEBPACK_IMPORTED_MODULE_32__.k,{placeholder:"Subtitle",validator:e=>e.length<2?(setIsFormSubmittable(!1),"Subtitle should be more than 2 characters"):e.length>60?(setIsFormSubmittable(!1),"Subtitle should be less than 60 characters"):void setIsFormSubmittable(!0),defaultValue:shortBio,noBorder:!0,className:"mb-1 border border-border bg-background py-2 focus:outline-none",onChange:e=>{setShortBio(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:"mt-4 flex items-center font-semibold text-secondary-foreground/85",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_atoms_i18__WEBPACK_IMPORTED_MODULE_23__.A,{children:"User Id"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"ml-4 flex items-center",children:isCheckingForAvailability?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_loader_component__WEBPACK_IMPORTED_MODULE_30__.a,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{className:"py-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_form_controls_tick_component__WEBPACK_IMPORTED_MODULE_27__.g,{success:userIdAvailable})})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_text_input_component__WEBPACK_IMPORTED_MODULE_32__.k,{placeholder:"User Id (Username)",validator:e=>{if(e.length<5)return setIsFormSubmittable(!1),"User id invalid!";setIsFormSubmittable(!0)},noBorder:!0,defaultValue:userId,className:"border border-border bg-background py-2 focus:outline-none",inputHolderClassName:classnames__WEBPACK_IMPORTED_MODULE_0___default()({" border-red-500":!userIdAvailable," border-green-500":userIdAvailable}),onChange:e=>{setUserId(e),e.length>2?isCheckingForAvailability||setIsCheckingForAvailability(!0):setIsCheckingForAvailability(!1),checkForAddressAvailability(e)},disabled:isUserNotNew&&isUpdateProfileDisabled&&!("admin"===community.myRole)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"mt-4 font-semibold text-secondary-foreground/85",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_atoms_i18__WEBPACK_IMPORTED_MODULE_23__.A,{children:"Short Bio"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react__WEBPACK_IMPORTED_MODULE_2__.Suspense,{fallback:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.Fragment,{}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(RichTextEditor,{text:bio,setText:setBio,uploadImage:!1,insertTable:!1,className:"bg-background"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:"mb-1 mt-4 font-semibold text-secondary-foreground/85",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_atoms_i18__WEBPACK_IMPORTED_MODULE_23__.A,{children:"Link your social account"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"text-xs text-secondary-foreground/70",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_atoms_i18__WEBPACK_IMPORTED_MODULE_23__.A,{children:"This will be displayed on your profile"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{style:{position:"relative"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"text-primary",onClick:()=>{defaultSocialMedia.length<9&&setIsSocialDropdownVisible(!isSocialDropdownVisible)},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("span",{className:"cursor-pointer",children:"+ Add social handles"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:isSocialDropdownVisible?"dropdown visible relative left-0 my-2 w-1/2 border border-border bg-card py-2 shadow":"dropdown my-2 hidden w-1/2 bg-background py-2 shadow-lg",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_molecule_listview_component__WEBPACK_IMPORTED_MODULE_31__.u,{items:customSocialMedia,renderItem:(e,t)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_0___default()("dropdown-button flex cursor-pointer items-center p-1 text-secondary-foreground/90 hover:bg-background transition-transform duration-300 ease-in-out hover:scale-105"),onClick:()=>{e.isAvailable=!e.isAvailable,setDefaultSocialMedia([...defaultSocialMedia,e]),setIsSocialDropdownVisible(!isSocialDropdownVisible)},style:{display:e.isAvailable?"none":"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"flex-shrink-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("img",{src:e.icon,className:"ml-2",width:"25",alt:""})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"px-2",children:e.name})]},t)})})]}),defaultSocialMedia.map(((dfs,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_text_input_component__WEBPACK_IMPORTED_MODULE_32__.k,{prefix:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("img",{src:dfs.icon,className:"ml-2",width:"25",alt:""}),noPrefixSeparator:!0,postfix:eval("".concat(dfs.setValue))&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_activity_close_button_component__WEBPACK_IMPORTED_MODULE_22__.J,{size:"sm",className:"mr-1",onClick:()=>{eval("set".concat(dfs.name,'Link("")'))}}),placeholder:"".concat(dfs.name," Url"),noBorder:!0,validator:e=>{if(!e.startsWith("http://")&&!e.startsWith("https://")&&0!==e.length)return setIsFormSubmittable(!1),"".concat(dfs.name," Url invalid!");setIsFormSubmittable(!0)},validationOutsideBox:!0,noMargin:!0,defaultValue:eval("".concat(dfs.setValue)),containerClassName:"py-2 focus:outline-none border border-border bg-background rounded mt-4",onChange:value=>{let functionName="set".concat(dfs.name,'Link("').concat(value,'")');console.log({functionName:functionName}),0==value.length&&(dfs.isAvailable=!1),eval(functionName)}},index)}))),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"mt-4",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_button_component__WEBPACK_IMPORTED_MODULE_24__.$,{disabled:!isFormSubmittable,className:"w-full items-center py-2",onClick:async()=>{setIsLoading(!0);const e=await bio.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");let t=await tds.turndown(e);_service__WEBPACK_IMPORTED_MODULE_19__.DL.updateProfile(user,{name:name,shortBio:shortBio,userId:userId,bio:t,instagramLink:instagramLink,linkedinLink:linkedinLink,youtubeLink:youtubeLink,twitterLink:twitterLink,facebookLink:facebookLink,pintrestLink:pintrestLink,dribbbleLink:dribbbleLink,behanceLink:behanceLink,webLink:webLink}).then((e=>{picture&&"string"===typeof picture&&picture.startsWith("http")?(setIsLoading(!1),setUser({...user,name:name,bio:bio,shortBio:shortBio,instagramLink:instagramLink,linkedinLink:linkedinLink,youtubeLink:youtubeLink,twitterLink:twitterLink,facebookLink:facebookLink,pintrestLink:pintrestLink,dribbbleLink:dribbbleLink,behanceLink:behanceLink,webLink:webLink}),localStorage.setItem("pensil.user",JSON.stringify({...user,name:name})),isUserNotNew&&setVisible(!1),addToast("Profile Updated!"),isUserNotNew||_service_analytics_service__WEBPACK_IMPORTED_MODULE_20__.A.logEvent(_service_analytics_service__WEBPACK_IMPORTED_MODULE_20__.B.User.name,_service_analytics_service__WEBPACK_IMPORTED_MODULE_20__.B.User.create),console.log(analyticsService.track("profile-details",{profilePic:picture,bio:bio,name:name,socialhandles:JSON.stringify({instagramLink:instagramLink,linkedinLink:linkedinLink,youtubeLink:youtubeLink,twitterLink:twitterLink,facebookLink:facebookLink,pintrestLink:pintrestLink,dribbbleLink:dribbbleLink,behanceLink:behanceLink})}))):picture?_service__WEBPACK_IMPORTED_MODULE_19__.DL.updatePicture(user,picture).then((e=>{setIsLoading(!1),setUser({...user,name:name,bio:bio,shortBio:shortBio}),localStorage.setItem("pensil.user",JSON.stringify({...user,name:name,picture:e.user.picture})),isUserNotNew&&setVisible(!1),analyticsService.track("profile-details",{profilePic:picture,bio:bio,name:name,socialhandles:JSON.stringify({instagramLink:instagramLink,linkedinLink:linkedinLink,youtubeLink:youtubeLink,twitterLink:twitterLink,facebookLink:facebookLink,pintrestLink:pintrestLink,dribbbleLink:dribbbleLink,behanceLink:behanceLink})})})).catch((e=>{e&&e.response&&e.response.data.message&&setErrorMessage(e.response.data.errors.file[0]),setIsLoading(!1),analyticsService.track("profile-details",{profilePic:picture,bio:bio,socialhandles:JSON.stringify({instagramLink:instagramLink,linkedinLink:linkedinLink,youtubeLink:youtubeLink,twitterLink:twitterLink,facebookLink:facebookLink,pintrestLink:pintrestLink,dribbbleLink:dribbbleLink,behanceLink:behanceLink})})})):_service__WEBPACK_IMPORTED_MODULE_19__.DL.deleteProfilePicture(user).then((e=>{setIsLoading(!1),setUser({...user,name:name,bio:bio,shortBio:shortBio}),setPicture(e.user.picture),localStorage.setItem("pensil.user",JSON.stringify({...user,name:name,picture:e.user.picture})),window.location.reload()})).catch((e=>{console.log(e)}))})).catch((e=>{e&&e.response&&e.response.data.message&&(e.response.data.errors.name&&setErrorMessage(e.response.data.errors.name[0]),e.response.data.errors.userId&&(setErrorMessage(e.response.data.errors.userId[0]),setUserIdAvailable(!1))),setIsLoading(!1)}))},isLoading:isLoading,label:isUserNotNew?"Update":"Proceed"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_error_component__WEBPACK_IMPORTED_MODULE_25__.S,{error:errorMessage})]})})})})})}const ProfileUpdate=(0,_contexts_toastr_context__WEBPACK_IMPORTED_MODULE_6__.wj)((0,react_redux__WEBPACK_IMPORTED_MODULE_3__.Ng)((e=>({user:e.auth,community:e.community})),(e=>(0,redux__WEBPACK_IMPORTED_MODULE_35__.zH)({setUser:_store_actions_auth_actions__WEBPACK_IMPORTED_MODULE_36__.jw},e)))(ProfileUpdateComponent));function PictureUpdate(e){let{picture:t=null,setPicture:n=(()=>{}),name:r,isUserNotNew:o}=e;const[i,s]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!1),[a,l]=(0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);let c="";try{c=t&&"string"===typeof t&&t.startsWith("http")?t:URL.createObjectURL(t)}catch(u){c=t}const d=async e=>{if(e){let t=await URL.createObjectURL(e);l(t)}else l(null);s(!0)};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{className:"PictureUpdate",children:[a&&i&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_image_crop_image_crop_modal__WEBPACK_IMPORTED_MODULE_29__.A,{src:a,setPicture:e=>{n(e)},activeCrop:i,setActiveCrop:s,aspectRatio:1,cropRatioMessage:"Picture ratio - 1:1"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{onClick:()=>n(_constants_mediaType__WEBPACK_IMPORTED_MODULE_18__.G+r),children:o&&!("string"===typeof t&&"string"===typeof c)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"flex flex-col items-end",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_uicon_component__WEBPACK_IMPORTED_MODULE_33__.A,{icon:"cross",size:"xs",className:"text-secondary-foreground"})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_form_controls_file_input__WEBPACK_IMPORTED_MODULE_26__.z,{accept:"image/*",onChange:d,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"preview-control ".concat(o?"":"flex place-content-center items-center border border-border"),children:!o&&c.includes("seed")?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_uicon_component__WEBPACK_IMPORTED_MODULE_33__.A,{icon:"user",size:"3xl",className:"text-secondary-foreground"}):o&&"string"===typeof t&&"string"===typeof c?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("img",{className:"h-full w-full",src:t,alt:""}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("img",{src:c,alt:""})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)(_form_controls_file_input__WEBPACK_IMPORTED_MODULE_26__.z,{accept:"image/*",onChange:d,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_34__.jsx)("div",{className:"pt-2 text-center text-sm font-semibold text-primary",children:"Set Profile Picture"})})]})]})}},55267:(e,t,n)=>{"use strict";n.d(t,{Cj:()=>q,q1:()=>Y});var r=n(5564),o=n.n(r),i=n(72006),s=n.n(i),a=n(20975),l=n(31305),c=n(34067),d=n(55049),u=n(24881),p=n(54608),h=n(53871),m=n(8934),f=n(84983),g=n(91900),b=n(62391);const v=a.lazy((()=>n.e(636).then(n.bind(n,25636))));function y(e){let{setEmoji:t,visible:n=!1,setVisible:r=(e=>{})}=e;const[o,i]=a.useState("light");return(0,a.useEffect)((()=>{const e=localStorage.getItem("pensil.theme");i(null!==e&&void 0!==e?e:"light")}),[]),(0,b.jsx)(g.a,{className:"picker-container cursor-pointer select-none",width:"278px",padding:!1,active:n,setActive:e=>{r(!1)},children:(0,b.jsx)("div",{className:"relative",children:(0,b.jsx)(a.Suspense,{fallback:(0,b.jsx)(b.Fragment,{}),children:(0,b.jsx)(v,{onEmojiClick:(e,n)=>{t(e.emoji),r(!1)},disableAutoFocus:!0,theme:o,groupNames:{smileys_people:"PEOPLE"},native:!0})})})})}var k=n(25715),w=n(19328),x=n(34458);function _(e){let{imageUrl:t,imageAlt:n="",isPopupVisible:r=!1,setIsPopupVisible:o=(()=>{})}=e;if(!r)return(0,b.jsx)(b.Fragment,{});const i=document.createElement("div");return i.setAttribute("id","PopupImageViewer"),document.body.insertBefore(i,document.body.firstChild),x.createPortal((0,b.jsx)("div",{className:"PopupImageViewer overflow-y-auto",onClick:()=>{o(!1)},children:(0,b.jsxs)("div",{className:"holder",onClick:e=>{e.stopPropagation()},children:[(0,b.jsx)("div",{onClick:()=>o(!1),children:r&&(0,b.jsx)("img",{src:t,alt:n})}),(0,b.jsx)("div",{className:"close-button",onClick:e=>{o(!1)},children:"\xd7"})]})}),i)}var A=n(93092);function C(e){let{reactions:t,unreact:n=(e=>{}),react:r=(e=>{})}=e;return(0,b.jsx)("div",{className:"flex",children:t.details.map(((e,t)=>{var i;return(0,b.jsxs)("button",{className:o()("mr-2 flex items-center rounded px-1 text-xs text-secondary-foreground",{"bg-primary-light":e.isByMe,"bg-muted-foreground":!e.isByMe}),style:{height:"21px"},onClick:t=>{e.isByMe?n():r(e.emoji)},title:"Reacted by "+(null===(i=e.users)||void 0===i?void 0:i.map((e=>e.name)).join(", ")),children:[(0,b.jsx)("span",{className:"pr-1",children:e.emoji}),(0,b.jsx)("span",{className:"pl-1",children:e.count})]},e.emoji)}))})}var S=n(62144),j=n(71214),E=n(89449),N=n(30881),P=n(90559),D=n(2016);const M=a.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),T=new c.F,I=new j.A;const O=(0,E.wj)((0,l.Ng)((e=>({user:e.auth})))((function(e){let{message:t,user:n,onUpdate:r=(e=>{}),cancelUpdate:o=(()=>{}),addToast:i,smoothScrollToBottom:s=(()=>{})}=e;const[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(t.description?T.render(t.description):""),[h,m]=(0,a.useState)(null),f=async e=>{try{const o=function(e){const t={};e.description||e.attachments.length||(t.description="Description is required!");if(0===Object.keys(t).length)return null;return t}({description:d}),i=await d.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");let s=await I.turndown(i);if(m(o),!o&&d&&d.trim().length>0){c(!0);let o=t.sender?await u.b.editDirectMessage(n,{...t,description:s}):await u.b.editMessage(n,{...t,description:s});r(o.message),p(""),e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px",c(!1)}}catch(o){c(!1),console.log({error:o})}};let g=d.split("\n").length;g=g>0?g:1;const v=()=>l?(0,b.jsxs)("div",{className:"mx-3 my-1",children:[" ",(0,b.jsx)(w.a,{})]}):(0,b.jsxs)("div",{className:"ml-2 flex gap-3",children:[(0,b.jsx)(P.A,{icon:"cross",size:"md",iconClass:"text-secondary-foreground/70 mt-6",onClick:o}),(0,b.jsx)(D.A,{icon:N.A,onClick:f,iconSmall:!0,title:"Save"})]});return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{className:"RealtimeCreatePostCard px-4 py-2",children:(0,b.jsxs)("div",{className:"flex items-start justify-between rounded border border-border bg-background pr-1 text-secondary-foreground",children:[(0,b.jsx)(a.Suspense,{fallback:(0,b.jsx)(b.Fragment,{}),children:(0,b.jsx)(M,{className:"RichEditorComment minHeightDefault noBorder w-full px-2",text:d,setText:p})}),(0,b.jsx)(v,{})]})})})})));var L,R=n(46420),B=n(25289),z=n(19681),F=n(42017);function U(e){let{user:t,replies:n,isUserAllowedToPost:r,group:o,activeTabModel:i,showReplies:s,message:l}=e;const[c,d]=(0,a.useState)([]);return(0,b.jsx)(V,{children:s?(0,b.jsxs)(b.Fragment,{children:[n?(0,b.jsx)(F.g,{messages:n,deleteMessage:e=>u.b.deleteMessage(t,e),hideUserDetails:!0}):(0,b.jsx)(b.Fragment,{}),r?(0,b.jsx)("div",{className:"p-3",children:(0,b.jsx)(z.A,{community:o.community,user:t,groupId:o.id,group:o,tabId:i.id,parentMessage:l,attachments:c,setAttachments:d,updateMessage:e=>{}})}):(0,b.jsx)(b.Fragment,{})]}):(0,b.jsx)(b.Fragment,{})})}const V=B.Ay.div(L||(L=(0,R.A)(["\n padding-left: 56px;\n"])));function G(e){var t;let{message:n,showReplies:r,setShowReplies:i}=e;const s=null===(t=n.replies)||void 0===t?void 0:t.length;return s?(0,b.jsxs)("button",{onClick:()=>{i(!r)},className:"flex w-fit cursor-pointer items-center gap-2 rounded bg-accent/80 px-2 py-1 text-xs font-light text-secondary-foreground/80 hover:bg-accent hover:text-secondary-foreground hover:shadow-sm",children:[s||""," ",s<2?(0,b.jsx)(h.A,{children:"Reply"}):(0,b.jsx)(h.A,{children:"Replies"}),(0,b.jsx)(S.A,{icon:"angle-right",size:"xxs",className:o()("transition-all delay-150 ease-in-out",{"rotate-90 transform":r})})]}):(0,b.jsx)(b.Fragment,{})}const H=(0,l.Ng)((e=>({user:e.auth,community:e.community})))((e=>{let{post:t,activeTabModel:n,user:r,group:o,community:i,updatePost:s=(e=>{}),deletePost:a=(e=>{}),areCommentsLoading:l=!1,isBeingEdit:c=!1,setCommentsLoading:d=(e=>{}),setEmbedModalVisible:u=(e=>{}),setIsBeingEdit:h=(e=>{}),setIsProcessing:m=(e=>{}),showReplies:f=!1,setShowReplies:g=(e=>{}),isEmojiPickerVisible:v=!1,setIsEmojiPickerVisible:y=(e=>{})}=e;return(0,b.jsxs)("div",{className:"flex items-center justify-start rounded bg-card",children:[n&&(0,b.jsxs)("div",{className:"flex space-x-2 pl-2",children:[!t.parent&&(0,b.jsx)("span",{className:"cursor-pointer",onClick:()=>{g(!f)},children:(0,b.jsx)(S.A,{size:"lg",icon:"comment",className:"text-secondary-foreground/80"})}),(0,b.jsx)("span",{className:"cursor-pointer",onClick:()=>{y(!v)},children:(0,b.jsx)(S.A,{size:"lg",icon:"grin-alt",className:"text-secondary-foreground/80"})})]}),(0,b.jsx)(k.A,{className:"text-secondary-foreground",hideOnEmpty:!0,iconButtonSmall:!0,actions:[void 0!==n&&(t.createdBy.id===r.id||"admin"===i.myRole)&&{label:"Edit",onClick:e=>{h(!0)}},void 0!==n&&{label:"Reply",icon:"redo",onClick:()=>{g(!f)}},void 0!==n&&"admin"===i.myRole&&{label:"Pin message",icon:"thumbtack",onClick:()=>{(async e=>{try{await p.v.pinRealtimeSectionMessage(e)}catch(t){console.error(t)}})(t.id)}},{label:t.createdBy.id===r.id||o&&["admin","moderator"].includes(o.myRole)?"Delete":"",icon:"delete",onClick:()=>{m(!0),a(t)}}]})]})}));function W(e){let{isProcessing:t}=e;return t?(0,b.jsx)("div",{className:"PostProcessing",children:(0,b.jsx)(w.a,{})}):(0,b.jsx)(b.Fragment,{})}function q(e){let{message:t,removeAttachment:n=null}=e;const{attachments:r}=t;return r&&0!==r.length?(0,b.jsx)("div",{className:"MessageAttachments rounded p-1",children:r.map(((e,t)=>(0,b.jsx)(K,{removeAttachment:n?e=>{n(t)}:null,attachment:e},t)))}):(0,b.jsx)(b.Fragment,{})}function K(e){let{attachment:t,removeAttachment:n=null}=e,{mimeType:r,url:o,name:i,size:s,thumbnailUrl:l}=n?{}:t;n&&t&&(o=URL.createObjectURL(t),r=t.type,i=t.name,s=t.size);const c=r?r.split("/")[0]:"",[d,u]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1);return o?(0,b.jsxs)("div",{className:"MessageAttachmentHolder relative flex",children:[(0,b.jsx)("div",{onClick:e=>{h(!0)},className:"MessageAttachment cursor-pointer "+c,children:(0,b.jsx)("img",{src:o,alt:"",className:"MessageAttachment",loading:"lazy"})}),(0,b.jsx)(_,{imageUrl:o,isPopupVisible:p,setIsPopupVisible:()=>h(!1)}),n?(0,b.jsx)("span",{className:"remove-attachment-button",onClick:n,children:"\xd7"}):null]}):(0,b.jsx)(b.Fragment,{})}const Y=(0,l.Ng)((e=>({user:e.auth,group:e.activeGroup})))((function(e){var t,n;let{highlightsPinned:r,message:i,activeTabModel:l,user:p,group:g,updateMessage:v=(e=>{}),deleteMessage:k=(e=>{}),noMargin:w=!1,hideUserDetails:x=!1,nextMessageIsBySameUser:_=!1,isOnSameDay:j=!1,isNotContinued:E=!1,isUserAllowedToPost:N=!1}=e;const P=new c.F,[D,M]=(0,a.useState)(!1),[T,I]=(0,a.useState)(!1),[L,R]=(0,a.useState)(!1),[B,z]=(0,a.useState)(!1),[F,V]=(0,a.useState)(!1),[K,Y]=(0,a.useState)(!1),{profileModelState:{setShowProfileModel:$,setIdToViewProfile:Q}}=(0,d.A)(),Z=e=>{e.preventDefault(),Q(i.createdBy.id),$(!0)};return(0,b.jsxs)(b.Fragment,{children:[j?null:(0,b.jsxs)("div",{className:"date-divider flex",children:[(0,b.jsx)("div",{className:"w-full bg-accent p-[1px]"}),(0,b.jsx)("div",{className:"bg-accent px-2 py-1",style:{minWidth:"96px"},children:(0,b.jsx)("div",{className:"text-xxs ml-1.5 text-secondary-foreground",children:s()(i.createdAt).format("MMM DD, YYYY")})}),(0,b.jsx)("div",{className:"w-full bg-accent p-[1px]"})]}),(0,b.jsxs)("div",{className:o()("RealtimePostCard flex items-start px-3 pt-1 hover:bg-accent/70",{"bg-background":r===i.id,"my-3":!w&&!x&&!j,"mb-0":_,"gap-2":E}),children:[!j||F||E||!x?(0,b.jsx)(m.eu,{onClick:Z,className:"w-10 min-w-[40px] max-w-[40px] cursor-pointer",noName:!0,user:{...i.createdBy}}):(0,b.jsx)("span",{className:"w-12 flex-shrink-0",children:(0,b.jsx)("span",{className:"text-xxs msg-time text-secondary-foreground/70",children:s()(i.createdAt).format("HH:mm")})}),(0,b.jsxs)("div",{className:"flex flex-grow flex-col",children:[(0,b.jsx)("div",{className:"flex items-center justify-between",children:x&&j&&!E?(0,b.jsx)(b.Fragment,{}):(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("div",{onClick:Z,className:"cursor-pointer font-semibold text-secondary-foreground",children:i.createdBy.name}),(0,b.jsx)("span",{className:"text-xxs ml-2 text-secondary-foreground/80",children:s()(i.createdAt).format("HH:mm")})]})}),(0,b.jsxs)("div",{className:"relative",children:[B?(0,b.jsx)(O,{message:i,onUpdate:e=>{z(!1),v(e)},cancelUpdate:()=>{z(!1)}}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"NL2BR headings break-words text-secondary-foreground",dangerouslySetInnerHTML:{__html:P.render(i.description)}}),i.isEdited?(0,b.jsx)("span",{className:"pl-2 text-secondary-foreground/70",children:(0,b.jsx)(h.A,{children:"(edited)"})}):(0,b.jsx)(b.Fragment,{})]}),B?(0,b.jsx)(b.Fragment,{}):(0,b.jsx)("div",{className:o()("realtimepost-options cursor-pointer rounded border border-border",{hideUserDetails:x}),children:(0,b.jsx)(H,{post:i,activeTabModel:l,group:g,updatePost:v,deletePost:k,areCommentsLoading:T,setCommentsLoading:I,setEmbedModalVisible:R,isBeingEdit:B,setIsBeingEdit:z,setIsProcessing:M,showReplies:F,setShowReplies:V,isEmojiPickerVisible:K,setIsEmojiPickerVisible:Y})})]}),(0,b.jsx)(q,{message:i}),(0,b.jsx)(A.YN,{post:i}),(0,b.jsx)(W,{isProcessing:D}),(0,b.jsx)(f.A,{link:"http://embed.pensil.com"+(window.location.port?":"+window.location.port:"")+"/post/"+i.id,active:L,setActive:R})]})]}),(0,b.jsxs)("div",{className:"my-2 mb-4 ml-[60px] flex flex-col gap-1",children:[null!==(t=i.reactions)&&void 0!==t&&t.total?(0,b.jsxs)("div",{className:"mt-2 flex items-center",children:[null!==(n=i.reactions)&&void 0!==n&&n.total?(0,b.jsx)("span",{className:"flex h-8 w-8 cursor-pointer place-content-center items-center rounded-full text-xs font-light text-secondary-foreground/70 hover:bg-accent hover:text-secondary-foreground hover:shadow-sm",onClick:()=>{Y(!K)},children:(0,b.jsx)(S.A,{icon:"grin-alt",className:"text-secondary-foreground/70"})}):(0,b.jsx)(b.Fragment,{}),i.reactions?(0,b.jsx)(C,{reactions:i.reactions,react:e=>{u.b.reactToMessage(i,e)},unreact:()=>{u.b.unreactToMessage(i)}}):(0,b.jsx)(b.Fragment,{})]}):(0,b.jsx)(b.Fragment,{}),(0,b.jsx)(y,{emoji:null,hidePlaceholder:!0,setEmoji:e=>{u.b.reactToMessage(i,e),Y(!1)},visible:K,setVisible:Y}),(0,b.jsx)(G,{message:i,showReplies:F,setShowReplies:V})]}),i.parent?(0,b.jsx)(b.Fragment,{}):(0,b.jsx)(U,{user:p,replies:i.replies,setReplies:e=>{v({...i,replies:e})},group:g,activeTabModel:l,isUserAllowedToPost:N,showReplies:F,setShowReplies:V,message:i})]})}))},42017:(e,t,n)=>{"use strict";n.d(t,{g:()=>l});var r=n(72006),o=n.n(r),i=n(84003),s=n(55267),a=n(62391);function l(e){let{messages:t,setMessages:n,updateMessage:r,deleteMessage:l,highlightsPinned:c,hideUserDetails:d=!1,group:u,activeTabModel:p,isUserAllowedToPost:h=!1}=e;return(0,a.jsx)("div",{className:"flex w-full flex-1 flex-col justify-end pb-4",children:(0,a.jsx)(i.u,{items:t,renderItem:(e,i)=>(0,a.jsx)(s.q1,{highlightsPinned:c,message:e,updateMessage:r,setMessages:e=>{const r=t.findIndex((t=>t.id===e.id)),o=[...t];o.splice(r,1),n(o)},deleteMessage:l,hideUserDetails:i>0&&t[i-1].createdBy.id===e.createdBy.id&&o()(e.createdAt).diff(t[i-1].createdAt,"minutes")<1,nextMessageIsBySameUser:i0&&o()(t[i-1].createdAt).isSame(e.createdAt,"day")||d,isNotContinued:0===i||o()(t[i-1].createdAt).add(1,"minute").isBefore(o()(e.createdAt)),group:u,activeTabModel:p,isUserAllowedToPost:h},i)})})}},30725:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(20975),o=n(89449),i=n(62270),s=n(43039),a=n(44139),l=n(94503),c=n(86129),d=n(62391);function u(e){let{community:t="",contentLink:n="",reportType:u="",addToast:p=null,activeProps:h=null,displayProps:m=null,content:f=null}=e;const g=(0,i.A)(),{isReportModalVisible:b,setReportModalVisible:v}=h,{displayClosePrompt:y,setDisplayClosePrompt:k}=m,[w,x]=(0,r.useState)(""),_=async()=>{try{const e=await s.BE.reportPost({reportType:u,reasonOfReporting:w,communityId:t.id.toString(),contentLink:n,content:f});if(null===e)throw new Error("Reporting failed - Contact admin"+e.message);p("Reported successfully","",o.lm.success),x(""),v(!1)}catch(e){console.error("reporting-error",e),p("Reporting failed - Contact admin","",o.lm.danger)}};return(0,r.useEffect)((()=>{y&&((""===w||window.confirm(g.trans("Are you sure you want to discard Report?")))&&(x(""),v(!1)),k(!1))}),[y]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(c.A,{visible:b,setVisible:v,hideHeader:!0,className:"CreatePost flex max-h-[95vh] w-full max-w-[720px] flex-col rounded bg-card p-5",children:[(0,d.jsxs)("div",{className:"align-center mb-3 flex flex-col justify-center",children:[(0,d.jsx)("p",{className:"flex justify-center",children:"Why are you reporting this?"}),(0,d.jsx)("p",{className:"flex justify-center",children:"Please provide a brief description of the issue."})]}),(0,d.jsx)(l.default,{text:w,setText:x,onSubmit:_,className:"border-border"}),(0,d.jsxs)("div",{className:"flex justify-around",children:[(0,d.jsx)(a.$,{className:"my-4 mr-2 flex-grow",label:"Cancel",onClick:()=>{k(!0)},large:!0}),(0,d.jsx)(a.$,{className:"theme-bg-danger my-4 ml-2 flex-grow border-border",label:"Send Report",onClick:()=>{(""!==w||window.confirm("Are you sure you want to report without description?"))&&_()}})]})]})})}},57731:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(5564),o=n.n(r),i=n(20975),s=n(34458);const a="undefined"!==typeof window?i.useLayoutEffect:i.useEffect;const l=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"___gatsby";const[n,r]=(0,i.useState)(e);return a((()=>{if(!n)return;const e=document.body.style.overflow,r=document.body.style.paddingRight,o=document.getElementById(t),i=o?o.offsetWidth-o.scrollWidth:0;return i&&(document.body.style.paddingRight="".concat(i,"px")),()=>{document.body.style.overflow=e,i&&(document.body.style.paddingRight=r)}}),[n]),(0,i.useEffect)((()=>{n!==e&&r(e)}),[e]),[n,r]};var c=n(44139),d=n(62391);function u(e){let{active:t,setActive:n,children:r,className:a="",...u}=e;const p=document.body,[h,m]=l(!1,"root");return(0,i.useEffect)((()=>{m(t)}),[t,m]),t?s.createPortal((0,d.jsxs)("div",{className:"RightSideModalComponent",children:[(0,d.jsx)("div",{style:{overflow:"auto",zIndex:1e3},className:(0,c.cn)(o()("fixed inset-0 inset-x-auto right-0 w-full overflow-y-auto overflow-x-hidden md:w-3/5 lg:w-[38%]"),a),children:(0,d.jsx)("div",{className:"z-10 mx-auto h-full bg-card text-secondary-foreground/90",...u,style:{height:"100"},children:t&&r})}),(0,d.jsx)("div",{onClick:e=>{e.stopPropagation(),e.preventDefault(),n(!1)},style:{zIndex:999},className:o()("fixed inset-0 z-40 bg-black/30 backdrop-blur-sm")})]}),p):null}},64373:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(62391);const o=function(){return(0,r.jsx)("div",{className:"Header animate-pulse border-b border-border bg-card py-1",style:{height:"73px"},children:(0,r.jsxs)("div",{className:"header-container mg:px-6 px-6 pb-2 pt-3 sm:px-0 xl:px-0",children:[(0,r.jsxs)("div",{className:"flex w-full items-center space-x-2",children:[(0,r.jsx)("p",{className:"h-10 w-10 rounded bg-gray-300"}),(0,r.jsx)("p",{className:"h-4 w-12 rounded bg-gray-300"})]}),(0,r.jsxs)("div",{className:"OtherOptions flex place-content-end items-center space-x-2",children:[(0,r.jsx)("p",{className:"h-6 w-6 rounded bg-gray-300"}),(0,r.jsx)("p",{className:"h-6 w-6 rounded bg-gray-300"}),(0,r.jsx)("p",{className:"h-6 w-6 rounded bg-gray-300"}),(0,r.jsx)("p",{className:"h-10 w-10 rounded-full bg-gray-300"})]})]})})}},24608:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(44524),o=n(62391);const i=function(e){let{length:t}=e;const n=[];for(let s=0;null===(i=s{"use strict";n.d(t,{A:()=>o});var r=n(62391);const o=function(){return(0,r.jsxs)("div",{className:"my-3 flex",children:[(0,r.jsx)("p",{className:"h-8 w-8 rounded-full bg-gray-300"}),(0,r.jsxs)("div",{className:"ml-2 w-max space-y-1",children:[(0,r.jsx)("p",{className:"h-2 w-64 rounded bg-gray-300"}),(0,r.jsx)("div",{className:"mt-2 h-2 w-6/12 rounded bg-gray-300"}),(0,r.jsx)("div",{className:"mt-2 h-2 w-8/12 rounded bg-gray-300"})]})]})}},36646:(e,t,n)=>{"use strict";n.d(t,{A:()=>i,D:()=>r.D});var r=n(19678),o=n(62391);const i=function(e){let{length:t,type:n=r.D.compact,className:i=""}=e;const s=[];for(let l=0;null===(a=l{"use strict";n.d(t,{A:()=>l,D:()=>a});var r=n(5564),o=n.n(r),i=n(44139),s=n(62391);const a={default:0,comfortable:1,compact:2,expanded:3};const l=function(e){let t,n,{type:r=a.default,className:l=""}=e,c=!0;switch(r){case a.default:t="my-3",n="p-4";break;case a.comfortable:t="my-2",n="p-3";break;case a.compact:t="my-1",n="p-2",c=!1;break;default:t="my-3",n="p-4"}return r===a.expanded?(0,s.jsx)(d,{}):(0,s.jsxs)("div",{id:r,className:(0,i.cn)(o()(t,"rounded",n),l),children:[(0,s.jsxs)("div",{className:"flex place-items-center",children:[(0,s.jsx)("p",{className:"h-8 w-8 rounded-full bg-muted/80"}),(0,s.jsxs)("div",{className:"ml-2 w-max space-y-1",children:[(0,s.jsx)("p",{className:"h-2 w-16 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-8 rounded bg-muted/80"})]})]}),(0,s.jsx)("div",{className:"mt-3 h-2 w-[64%] rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-[32%] rounded bg-muted/80"}),c?(0,s.jsx)("div",{className:"mt-4 h-2 w-[48%] rounded bg-muted/80"}):null,(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mt-3 h-0.5 w-full rounded bg-gray-100"}),(0,s.jsxs)("div",{className:"flex place-items-center",children:[(0,s.jsx)("div",{className:"mt-2 h-4 w-4 rounded border-2 border-border bg-gray-200"}),(0,s.jsx)("div",{className:"m-l-2 ml-2 mt-2 h-3 w-12 rounded bg-gray-200"}),(0,s.jsx)("div",{className:"ml-6 mt-2 h-4 w-4 rounded bg-gray-200"}),(0,s.jsx)("div",{className:"m-l-2 ml-2 mt-2 h-3 w-12 rounded bg-gray-200"})]})]})]});function d(e){let{className:t=""}=e;return(0,s.jsxs)("div",{className:(0,i.cn)(o()("my-3 rounded px-6 pt-4",t)),children:[(0,s.jsxs)("div",{className:"flex place-items-center",children:[(0,s.jsx)("p",{className:"h-8 w-8 rounded-full bg-muted/80"}),(0,s.jsxs)("div",{className:"ml-2 w-max space-y-1",children:[(0,s.jsx)("p",{className:"h-2 w-16 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-8 rounded bg-muted/80"})]})]}),(0,s.jsx)("div",{className:"my-6"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-1/3 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-1/2 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-4 h-2 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"h-5"}),(0,s.jsxs)("div",{className:"flex space-x-4",children:[(0,s.jsx)("div",{className:"mt-2 h-2 w-16 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"mt-2 h-2 w-16 rounded bg-muted/80"})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"border0border my-4 flex place-items-center border-t py-2",children:[(0,s.jsx)("div",{className:"mt-2 h-4 w-4 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"m-l-2 ml-2 mt-2 h-3 w-12 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"ml-6 mt-2 h-4 w-4 rounded bg-muted/80"}),(0,s.jsx)("div",{className:"m-l-2 ml-2 mt-2 h-3 w-12 rounded bg-muted/80"})]})})]})}}},23277:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(62391);function o(){return(0,r.jsx)("div",{className:"h-screen w-full animate-pulse rounded",children:(0,r.jsx)("div",{className:"flex h-screen w-full flex-col space-y-6 bg-card p-8"})})}},70326:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(62391);function o(){const e=[];for(let n=0;null===(t=n<3)||void 0===t||t;n++){var t;e.push((0,r.jsx)("div",{className:"ml-2 mt-2 h-4 w-5/6 rounded bg-gray-300"},n))}return(0,r.jsxs)("div",{className:"container mb-2 flex flex-grow animate-pulse flex-col py-2 pt-0",children:[(0,r.jsx)("div",{className:"h-6 w-3/6 rounded bg-gray-300"}),e]})}const i=function(){return(0,r.jsxs)("div",{className:"animate-pulse pt-0",children:[(0,r.jsx)(o,{}),(0,r.jsx)(o,{}),(0,r.jsx)(o,{})]})}},54617:(e,t,n)=>{"use strict";n.d(t,{k:()=>d});var r=n(5564),o=n.n(r),i=n(20975),s=n(62270),a=n(44139),l=n(71986),c=n(62391);function d(e){let{name:t="",placeholder:n="",readOnly:r=!1,disabled:d=!1,noBorder:u=!1,inputPattern:p=RegExp(""),prefix:h=null,noPrefixSeparator:m=!1,postfix:f=null,defaultValue:g="",noMargin:b=!1,large:v=!1,type:y="text",minLength:k=0,required:w=!1,inputHolderClassName:x="",containerClassName:_="",className:A="",errors:C=[],validator:S=(e=>{}),validationOutsideBox:j=!1,onChange:E=(e=>{}),onFocus:N=(e=>{})}=e;const[P,D]=(0,i.useState)(g),[M,T]=(0,i.useState)(null),I=(0,s.A)();return(0,i.useEffect)((()=>{D(g)}),[g]),(0,i.useEffect)((()=>{C&&C.length>0&&T(C[0])}),[C]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:(0,a.cn)(o()("TextInput",{"my-3":!b,"w-full":u},_)),children:[(0,c.jsxs)("div",{className:(0,a.cn)(o()("",{"flex items-center rounded border border-border":!u,"flex items-center":u},x)),children:[h?(0,c.jsxs)(c.Fragment,{children:[h," ",m?"":"|"]}):(0,c.jsx)(c.Fragment,{}),(0,c.jsx)("input",{name:t,type:y,disabled:d,minLength:k,onChange:e=>{T(I.trans(S(e.target.value))),p&&!p.test(e.target.value)||D(e.target.value),E(e.target.value)},onFocus:e=>{N(e.target.value)},placeholder:I.trans(n),value:P,readOnly:r,required:w,className:(0,a.cn)(o()("w-full rounded bg-transparent focus:outline-none",{"px-2 py-2":v,"px-2 py-1":!v},A))}),f||(0,c.jsx)(c.Fragment,{})]}),j?(0,c.jsx)(c.Fragment,{}):(0,c.jsx)(l.j,{error:M})]}),j?(0,c.jsx)(l.j,{error:M}):(0,c.jsx)(c.Fragment,{})]})}},22375:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var r=n(62391);function o(e){let{text:t}=e;return(0,r.jsx)("div",{className:"font-semibold text-secondary-foreground",children:t})}},60478:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{percentComplete:t=0,className:n=""}=e;return 0===t?(0,i.jsx)(i.Fragment,{}):(0,i.jsx)("div",{className:o()("UploadProgressBar",n),children:(0,i.jsx)("div",{className:"upload-progress",style:{width:t+"%"}})})}},50963:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={COMMUNITY_DEFAULT_COUNTRY_CODE:"COMMUNITY_DEFAULT_COUNTRY_CODE",COMMUNITY_DEFAULT_LANGUAGE:"COMMUNITY_DEFAULT_LANGUAGE",COMMUNITY_DEFAULT_FONT_LINK:"COMMUNITY_DEFAULT_FONT_LINK",COMMUNITY_DEFAULT_FONT_NAME:"COMMUNITY_DEFAULT_FONT_NAME",COMMUNITY_PREVENT_USER_PROFILE_UPDATE:"COMMUNITY_PREVENT_USER_PROFILE_UPDATE",COMMUNITY_POST_TIMER_LIMIT:"COMMUNITY_POST_TIMER_LIMIT",COMMUNITY_REPORT_EMAIL:"COMMUNITY_REPORT_EMAIL",COMMUNITY_SHOW_ONBOARDING_LIST:"COMMUNITY_SHOW_ONBOARDING_LIST"}},96621:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,P:()=>r});let r="https://stocomoapi.motilaloswal.com/api/",o="https://stocomosocket.motilaloswal.com/socket.io/";["tech.pensil.in","newstudy.pensil.in","aol.pensil.in"].includes(window.location.hostname)&&(r="https://api-server.pensil.in/api/",o="https://socket-server.pensil.in")},16118:(e,t,n)=>{"use strict";n.d(t,{D4:()=>d,IT:()=>o,OT:()=>c,k0:()=>i,m$:()=>l,mZ:()=>a,pD:()=>r,ut:()=>s});const r=".pensil.com";function o(e){return e.address+r}"app.".concat(r);async function i(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t||!document.getElementById(t))return new Promise((n=>{const o=document.createElement("script");o.id=t,r?o.src=e:o.innerHTML=e,o.onload=()=>{console.log("script loaded: "+(t||e)),n(o)},o.onerror=()=>{n(!1),console.log("script load failed: "+(t||e))},document.body.appendChild(o)}))}function s(){var e;const t=JSON.parse(localStorage.getItem("pensil.user"));return null!==(e=null===t||void 0===t?void 0:t.token)&&void 0!==e?e:null}function a(){var e;const t=JSON.parse(localStorage.getItem("pensil.user"));return null!==(e=null===t||void 0===t?void 0:t.id)&&void 0!==e?e:null}function l(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}function c(e){let t="/login";if(e&&e.authRedirectUrl){t=e.authRedirectUrl;let n="communityId="+e.id;t=t.includes("?")?t+"&"+n:t+"?"+n}return t}function d(e){window.location.href=c(e)}},6292:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});const r=(0,n(25943).zR)()},78220:(e,t,n)=>{"use strict";n.d(t,{vZ:()=>X,V2:()=>ne,q7:()=>te,b6:()=>ee.b});var r=n(96621);const o=r.P,i={loginWithOTP:o+"login/otp",loginWithEmailOTP:o+"auth/email/otp",verifyOTP:o+"verify-otp",googleLoginV2:o+"auth/google/v2",facebookLogin:o+"auth/facebook",web3Login:o+"auth/web3"},s=r.P,a={getRemainingMailCount:e=>"".concat(s,"/community/").concat(e,"/get-remaining-mail-count")},l=r.P,c={create:l+"community",getSubscribedCommunities:l+"community/joined",updateCommunity:e=>l+"community/"+e,updateCommunityWelcomeMessages:e=>l+"community/"+e+"/welcome-messages",updateCommunityBannerDetails:e=>l+"community/"+e+"/banner-details",updateCommunityBanner:e=>l+"community/"+e+"/update-banner",removeCommunityBanner:e=>l+"community/"+e+"/remove-banner",addressAvailability:e=>l+"community/address-availability/"+e,updateLogo:(e,t)=>l+"community/"+e+"/update-logo/"+t,updateFavicon:e=>l+"community/"+e+"/update-favicon",getCommunity:e=>l+"community/"+e,getCommunityById:e=>l+"community-by-id/"+e,verifyThirdPartyToken:e=>l+"community/"+e+"/verify-user-token",verifyUserByAdmin:(e,t)=>l+"community/"+e+"/user/"+t+"/verify",joinCommunity:e=>l+"community/join/"+e,leaveCommunity:e=>l+"community/leave/"+e,getUserPosts:(e,t,n)=>l+"community/".concat(e,"/user/").concat(t,"/posts?page=").concat(n),getCommunityPostDirectory:(e,t,n)=>l+"post/directory/".concat(e,"?sort=").concat(t,"&page=").concat(n),getUserActivities:(e,t,n)=>l+"community/".concat(e,"/user/").concat(t,"/activities?page=").concat(n),groups:e=>l+"community/"+e+"/groups",sortGroups:e=>l+"community/"+e+"/groups/sort",sortGroupTabs:(e,t)=>l+"community/"+e+"/group/"+t+"/sort",subscribers:(e,t)=>l+"community/"+e+"/subscribers?group="+t,subscribersPaginated:(e,t,n,r,o)=>l+"community/"+e+"/subscribers/paginated?limit="+t+"&page="+n+"&search="+r+"&group="+o,markSubscribersAsViewed:e=>l+"community/".concat(e,"/subscribers/mark-viewed"),makeUserModeratorInAllGroup:(e,t,n)=>l+"community/"+e+"/group/"+t+"/user/"+n+"/make-moderator",links:e=>l+"community/"+e+"/links",addNewLink:e=>l+"community/"+e+"/links",editLink:(e,t)=>l+"community/"+e+"/links/"+t,deleteLink:(e,t)=>l+"community/"+e+"/links/"+t,getMyLeaderboardScore:e=>l+"/leaderboard/community/"+e+"/my",getLeaderboard:(e,t,n,r)=>l+"/leaderboard/community/"+e+"/paginated?groupId="+t+"&page=".concat(n,"&limit=").concat(r),getLeaderboardV2Paginated:(e,t,n,r)=>l+"leaderboard/community/"+e+"/paginated/v2?page=".concat(t)+"&limit=".concat(n)+"&search=".concat(r),getMyKarmaPoints:e=>l+"leaderboard/community/"+e+"/my/v2",getCommunityKarmaPoints:e=>l+"/community/"+e+"/karma-points",sectionMessageNotificationBadges:e=>l+"/community/"+e+"/section-message-badges",sectionMessageNotificationMarkAsRead:(e,t)=>l+"community/"+e+"/section-message-mark-read/"+t,notificationPreference:e=>l+"community/"+e+"/notification-preferences",updateTabNotificationPreference:e=>l+"community/"+e+"/notification-preferences/tab",updateNotificationPreference:e=>l+"community/"+e+"/notification-preferences",getLastPostCreatedTimeInCommunity:e=>l+"community/"+e+"/last-post-time",roles:{makeAdminOfWholeCommunity:(e,t)=>l+"community/"+e+"/user/"+t+"/make-admin",removeUserAsAdminOfWholeCommunity:(e,t)=>l+"community/"+e+"/user/"+t+"/remove-as-admin",removeUserFromCommunity:(e,t)=>l+"community/"+e+"/user/"+t+"/remove-from-community",makeAdminOfSelectedGroups:function(e,t){return l+"community/"+e+"/user/"+t+"/update-role/groups"},updateRole:e=>l+"community/"+e+"/update-role",getRole:(e,t)=>l+"community/"+e+"/get-role/"+t},subscription:{getPlansList:e=>l+"checkout/community/"+e+"/plans",getCheckoutURLForCommunityPlan:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.origin;return l+"checkout/community/"+e+"/"+t+"?communityURL="+n},cancelCommunitySubscription:e=>l+"cancel-plan/community/"+e},theme:{communityThemeData:e=>l+"community-theme-data/"+e,communityThemeDataToggle:e=>l+"community-theme-data/"+e+"/toggle",communityThemeDataToggleForUser:(e,t)=>l+"community-theme-data/"+e+"/"+t+"/toggle"},deals:{getDeals:l+"community-deals",redeemDeal:e=>l+"community-deals/"+e+"/redeem"},settings:{toggleCommunityLoginRequirement:e=>l+"community/"+e+"/toggle-login-requirement",updateConfig:e=>l+"community/"+e+"/update-config",updateConfigV2:e=>l+"community/"+e+"/update-config/v2"},configurable:(e,t)=>l+"community/".concat(e,"/configurable/").concat(t),analytics:{getAnalyticsLink:e=>l+"community/"+e+"/analytics"},invite:{inviteViaEmail:e=>l+"community/"+e+"/invite",inviteViaCsv:e=>l+"community/"+e+"/invite/csv",getInvitesList:(e,t,n)=>l+"community/"+e+"/invites/paginated?search="+t+"&page="+n,configureMailTemplates:e=>l+"community/"+e+"/configurable/COMMUNITY_INVITE_MAIL_BODY_KEY",batchReInvite:e=>l+"community/"+e+"/invite/batch-reinvite",cancelBatchInvite:e=>l+"community/"+e+"/invite/batch-cancel"},bulkEmail:{send:e=>l+"community/"+e+"/bulk-email",getBulkEmailLogList:(e,t,n)=>l+"community/".concat(e,"/bulk-email/log?search=").concat(t,"&page=").concat(n)},additionalConfiguration:{getConfiguration:e=>l+"community/"+e+"/additional-configuration",saveDefaultJoinGroups:e=>l+"community/"+e+"/additional-configuration/default-join-groups"},reportPeer:e=>l+"community/"+e+"/report-peer",block:{blockUser:(e,t)=>l+"community/"+e+"/blocked-users/"+t,listBlockedUsers:e=>l+"community/"+e+"/blocked-users",unBlockUser:(e,t)=>l+"community/"+e+"/blocked-users/"+t},topics:{createTopic:e=>l+"community/"+e+"/topic",getAllTopics:e=>l+"community/"+e+"/topics",editTopic:(e,t)=>l+"community/"+e+"/topic/"+t+"/edit",archiveTopic:(e,t)=>l+"community/"+e+"/topic/"+t+"/archive",deleteTopic:(e,t)=>l+"community/"+e+"/topic/"+t+"/delete"},onboardingChecklist:{setOnboardingChecklist:e=>l+"community/"+e+"/onboarding-list-config",getOnboardingChecklist:e=>l+"community/"+e+"/onboarding-list-config"}},d=r.P,u={createCourse:(e,t)=>d+(t?"community/".concat(e,"/courses/").concat(t):"community/".concat(e,"/courses")),uploadCourseBanner:(e,t)=>d+"community/".concat(e,"/courses/").concat(t,"/banner"),getAll:e=>d+"community/".concat(e,"/courses"),getCourseDetails:(e,t)=>d+"community/".concat(e,"/courses/").concat(t),deleteCourse:(e,t)=>d+"community/".concat(e,"/courses/").concat(t),paginatedMembers:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return d+"community/".concat(e,"/courses/").concat(t,"/members/paginated?")+"page=".concat(n,"&limit=").concat(r)},addMember:(e,t,n)=>d+"community/".concat(e,"/courses/").concat(t,"/accept/").concat(n),removeMember:(e,t,n)=>d+"community/".concat(e,"/courses/").concat(t,"/reject/").concat(n),joinCourse:(e,t)=>d+"community/".concat(e,"/courses/").concat(t,"/join"),sections:{createSection:(e,t,n)=>d+(n?"community/".concat(e,"/courses/").concat(t,"/section/").concat(n):"community/".concat(e,"/courses/").concat(t,"/section")),getAll:(e,t)=>d+"community/".concat(e,"/courses/").concat(t,"/sections"),deleteSection:(e,t,n)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n),getSectionDetails:(e,t,n)=>d+"community/".concat(e,"/courses/").concat(t,"/sections/").concat(n),lesson:{createLesson:(e,t,n,r)=>d+(r?"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r):"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons")),getLessonDetails:(e,t,n,r)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r),deleteLesson:(e,t,n,r)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r),updateLessonCover:(e,t,n,r)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r,"/cover"),markLessonComplete:(e,t,n,r)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r,"/mark-complete"),markIncomplete:(e,t,n,r)=>d+"community/".concat(e,"/courses/").concat(t,"/section/").concat(n,"/lessons/").concat(r,"/mark-incomplete")}}},p=r.P,h={sendCustomPush:e=>p+"community/".concat(e,"/custom-push"),getCustomPushLog:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return p+"community/".concat(e,"/custom-push/log?page=")+t}},m=r.P,f={getAllRequests:e=>"".concat(m,"community/").concat(e,"/custom-domain"),createRequest:e=>"".concat(m,"community/").concat(e,"/custom-domain"),deleteRequest:(e,t)=>"".concat(m,"community/").concat(e,"/custom-domain/").concat(t)},g=r.P,b={sendDirectMessage:e=>g+"chats/direct/"+e+"/send-message",editDirectMessage:e=>g+"chats/direct/edit-message/"+e,deleteDirectMessage:e=>g+"chats/direct/delete-message/"+e,uploadAttachments:e=>g+"chats/direct/"+e+"/upload-attachment",markAllMessageAsRead:e=>g+"chats/direct/"+e+"/mark-all-read",chats:g+"chats/direct",userChat:function(e){return g+"chats/direct/"+e+"?lastId="+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}},v={unsubscribe:r.P+"unsubscribe"},y=r.P,k={getAllEmbeddedSections:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return y+"community/".concat(e,"/embedded-sections?showAll=").concat(t)},getEmbeddedSectionDetailBySlug:(e,t)=>y+"community/".concat(e,"/embedded-sections/").concat(t),changeVisibilityEmbeddedSectionInCommunity:(e,t)=>y+"community/".concat(e,"/embedded-sections/").concat(t,"/change-visibility"),createEmbeddedSection:e=>y+"community/".concat(e,"/embedded-sections"),updateEmbeddedSection:(e,t)=>y+"community/".concat(e,"/embedded-sections/").concat(t),updateEmbeddedSectionSortOrder:e=>y+"community/".concat(e,"/embedded-sections/update-sort"),getEMbeddedSectionDetailByIdForAdmin:(e,t)=>y+"community/".concat(e,"/embedded-sections/").concat(t,"/admin")},w=r.P,x={getAllEvents:(e,t)=>w+"community/".concat(e,"/events/").concat(t),getEventDetail:(e,t)=>w+"community/".concat(e,"/event/").concat(t),getEventDetailBySlug:(e,t)=>w+"community/".concat(e,"/event/slug/").concat(t),updateEvent:(e,t,n,r)=>w+"community/".concat(e,"/event/").concat(t,"?notifyUser=").concat(n,"&deleteAll=").concat(r),acceptInvitation:(e,t)=>w+"community/".concat(e,"/event/").concat(t,"/accept-invitation"),updateEventBanner:(e,t)=>w+"community/".concat(e,"/event/").concat(t,"/banner"),createEvent:e=>w+"community/".concat(e,"/event"),createRecurringEvent:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return w+"community/".concat(e,"/event/recurring?recurringType=").concat(t,"&recurringCount=").concat(n,"&recurringEndDate=").concat(r)},updateRSVP:(e,t)=>w+"community/".concat(e,"/event/").concat(t,"/update-rsvp"),inviteSections:(e,t)=>w+"community/".concat(e,"/event/").concat(t,"/invite"),upcomingEvents:(e,t)=>w+"community/".concat(e,"/upcoming-events?timestamp=").concat(t),latestGroupEvents:(e,t)=>w+"community/".concat(e,"/latest-events/").concat(t),previousEvents:(e,t)=>w+"community/".concat(e,"/previous-events?timestamp=").concat(t),getMeetingAttendance:(e,t)=>w+"meeting/".concat(e,"/attendance?communityId=").concat(t),exportAttendanceCSV:(e,t)=>w+"meeting/".concat(e,"/attendance/export?communityId=").concat(t)},_=r.P,A={all:_+"group",my:_+"group/my",byMe:_+"group/by-me",getGroupFromSlug:(e,t)=>_+"community/"+e+"/groups/"+t,updateGroup:e=>_+"group/"+e,deleteGroup:e=>_+"group/"+e,uploadBanner:e=>_+"group/"+e+"/banner",addTab:e=>_+"group/"+e+"/tab",editTab:(e,t)=>_+"group/"+e+"/tab/"+t,deleteTab:(e,t)=>_+"group/"+e+"/tab/"+t,goLive:e=>_+"dyte/start-meeting/"+e,members:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _+"group/"+e+"/members"+(t?"?tabId="+t:"")},membersPaginated:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _+"group/"+e+"/members/paginated"+(t?"?tabId="+t+"&":"?")+"page="+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)+"&limit="+(arguments.length>3&&void 0!==arguments[3]?arguments[3]:20)+"&query="+(arguments.length>4&&void 0!==arguments[4]?arguments[4]:"")},closedSectionMembers:function(e){return _+"group/"+e+"/closed-tab/"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)+"/members"},closedSectionMembersPaginated:function(e){return _+"group/"+e+"/closed-tab/"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)+"/members/paginated?page="+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)+"&limit="+(arguments.length>3&&void 0!==arguments[3]?arguments[3]:20)+"&query="+(arguments.length>4&&void 0!==arguments[4]?arguments[4]:"")},personalGroup:_+"group/personal",getLeaderboardV2Paginated:(e,t,n)=>_+"leaderboard/group/"+e+"/paginated/v2?page=".concat(t)+"&limit=".concat(n),updateRole:(e,t)=>_+"group/"+e+"/members/"+t+"/update-role",removeUser:(e,t)=>_+"group/"+e+"/remove-user/"+t,posts:e=>_+"group/"+e+"/posts",sectionPostsPaginated:function(e,t){return _+"group/"+e+"/section/"+t+"/posts?page="+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)+"&sort="+(arguments.length>3?arguments[3]:void 0)},sectionPostsPinned:(e,t)=>_+"group/"+e+"/section/"+t+"/posts/pinned",sectionMessagesPaginated:function(e,t){return _+"group/"+e+"/section/"+t+"/messages?page="+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)},sectionMessagesTimestampPaginated:(e,t,n)=>_+"group/"+e+"/section/"+t+"/messages/timestamped?lastId="+n,trendingPosts:e=>_+"group/"+e+"/trending-posts",acceptInvitation:e=>_+"group/"+e+"/accept-invite",join:e=>_+"group/"+e+"/join",leave:e=>_+"group/"+e+"/leave",acceptJoinRequest:(e,t)=>_+"group/"+e+"/join-request/"+t+"/accept",rejectJoinRequest:(e,t)=>_+"group/"+e+"/join-request/"+t+"/reject",verifyCouponCode:(e,t)=>_+"payment/group/"+e+"/verify-coupon/"+t,createOrder:e=>_+"payment/group/"+e+"/create-order",verifyPayment:(e,t)=>_+"payment/group/"+e+"/verify-payment/"+t,joinClosedSection:(e,t)=>_+"group/"+e+"/section/"+t+"/join",acceptJoinClosedSectionRequest:(e,t,n)=>_+"group/"+e+"/section/"+t+"/join-request/"+n+"/accept",rejectJoinClosedSectionRequest:(e,t,n)=>_+"group/"+e+"/section/"+t+"/join-request/"+n+"/reject"},C=r.P,S={addCustomPoints:(e,t)=>"".concat(C,"leaderboard/community/")+"".concat(e,"/user/").concat(t,"/add-custom-point")},j=r.P,E={getAllByCommunity:e=>j+"community/".concat(e,"/live-call"),createLiveCall:e=>j+"community/".concat(e,"/live-call")},N=r.P,P={uploadMedia:(e,t)=>N+"community/".concat(e,"/")+"media/upload?attachmentType=".concat(t)},D=r.P,M={searchInCommunity:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return D+"mentions/search-community/".concat(e,"?query=").concat(t)}},T=r.P,I={create:T+"message",delete:e=>T+"message/"+e,getPinnedMessage:(e,t)=>T+"group/"+e+"/section/"+t+"/messages/pinned",pinned:e=>T+"message/"+e+"/pin",unpinned:e=>T+"message/"+e+"/pin",edit:e=>T+"message/"+e,react:e=>T+"message/"+e+"/react",unreact:e=>T+"message/"+e+"/unreact",uploadAttachment:T+"message/upload-attachment"},O=r.P,L={uploadImage:O+"upload-image",search:e=>O+"community/"+e+"/search",defaultImageFromBackendUrl:O.split("/api/")[0]+"/default_pictures/user_0.jpg"},R=r.P,B={getMyNFTs:R+"profile/nfts",getUserNFTs:e=>R+"user/".concat(e,"/nfts"),checkForGatedGroupAccess:e=>R+"community/".concat(e,"/check-for-gated-group-access")},z=r.P,F={getPost:e=>z+"open/post/"+e,getPostList:(e,t)=>z+"open/group/"+e+"/feed/"+t+"/posts",getFontData:z+"/font-data"},U=r.P,V={getPaymentPreference:e=>"".concat(U,"community/").concat(e,"/payment-preference"),updatePaymentPreference:e=>"".concat(U,"community/").concat(e,"/payment-preference"),getInvoicePreference:e=>"".concat(U,"community/").concat(e,"/invoice-preference"),updateInvoicePreference:e=>"".concat(U,"community/").concat(e,"/invoice-preference")},G=r.P,H={getHighlightedPosts:e=>G+"community/".concat(e,"/highlighted-posts"),highlightPost:(e,t)=>G+"community/".concat(e,"/highlighted-posts/").concat(t),updateHighlightedPostsSortOrder:e=>G+"community/".concat(e,"/highlighted-posts/sort")},W=r.P,q={create:W+"post",searchTag:(e,t)=>W+"tag/search?query="+e+"&community="+t,getPostByTag:(e,t,n,r,o)=>W+"/post/explore-by-tag-paginated/community/".concat(e,"?page=").concat(t,"&tags[]=").concat(n,"&groupId=").concat(o,"&tabId=").concat(r),update:e=>W+"post/"+e,uploadImage:e=>W+"post/"+e+"/images",uploadVideo:e=>W+"post/"+e+"/videos",uploadDocument:e=>W+"post/"+e+"/document",uploadBanner:e=>W+"post/"+e+"/banner",paginated:e=>W+"post-paginated?page="+e,popularPaginated:e=>W+"post/explore-paginated?page="+e,detail:e=>W+"post/"+e,detailFromSlug:(e,t)=>W+"community/"+e+"/post/"+t,likes:e=>W+"post/"+e+"/likes",pin:e=>W+"post/"+e+"/pin",unpin:e=>W+"post/"+e+"/unpin",getBookmarks:W+"bookmark",bookmark:e=>W+"post/"+e+"/bookmark",removeBookmark:e=>W+"post/"+e+"/bookmark",addComment:e=>W+"post/"+e+"/comment",addCommentReply:(e,t)=>W+"post/"+e+"/comment/"+t+"/reply",addCommentReaction:(e,t)=>W+"post/"+e+"/comment/"+t+"/like",removeCommentReaction:(e,t)=>W+"post/"+e+"/comment/"+t+"/dislike",addCommentReplyReaction:(e,t,n)=>W+"post/"+e+"/comment/"+t+"/reply/"+n+"/like",removeCommentReplyReaction:(e,t,n)=>W+"post/"+e+"/comment/"+t+"/reply/"+n+"/dislike",uploadImagesToComment:(e,t)=>W+"post/"+e+"/comment/"+t+"/images",uploadDocumentToComment:(e,t)=>W+"post/"+e+"/comment/"+t+"/document",uploadDocumentToCommentReply:(e,t,n)=>W+"post/"+e+"/comment/"+t+"/reply/"+n+"/documents?documents[]",deleteComment:(e,t)=>W+"post/"+e+"/comment/"+t,deleteSubComment:(e,t,n)=>W+"post/"+e+"/comment/"+t+"/reply/"+n,like:e=>W+"post/"+e+"/like",vote:e=>W+"post/"+e+"/vote",dislike:e=>W+"post/"+e+"/dislike",delete:e=>W+"post/"+e,getMeetingData:e=>W+"dyte/join-meeting/"+e+"/json",toggleMeetingRecording:(e,t)=>W+"dyte/meeting/"+e+"/toggle-recording/"+t,endMeeting:(e,t)=>W+"dyte/meeting/"+e+"/end/"+t},K=r.P,Y={createSubscription:e=>"".concat(K,"community/").concat(e,"/subscription"),updateSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t),deleteSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t),cancelSubscription:e=>"".concat(K,"community/").concat(e,"/subscription/my"),getAllSubscriptions:e=>"".concat(K,"community/").concat(e,"/subscriptions"),getSubscriptionDetails:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t),getAllSubscriptionMembers:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/members"),getMySubscription:e=>"".concat(K,"community/").concat(e,"/subscription/my"),getAllSubscriptionsAdmin:e=>"".concat(K,"community/").concat(e,"/subscriptions/admin"),getAllMembershipSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/members"),getActiveSubscriptionsForSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/active-subscriptions"),getPreviousSubscriptionsForSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/previous-subscriptions"),initiateSubscription:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/initiate-subscription"),freeSubscribe:(e,t)=>"".concat(K,"community/").concat(e,"/subscription/").concat(t,"/free-subscribe"),resendInvoice:(e,t)=>"".concat(K,"community/").concat(e,"/invoice-resend/").concat(t),editInvoice:(e,t)=>"".concat(K,"community/").concat(e,"/invoice-edit/").concat(t)},$=r.P,Q={syncOneSignalWebUserId:$+"user/save-one-signal-web-user-id",profile:$+"profile",checkProfileAvailability:e=>$+"profile/username-availability/"+e,profileById:e=>$+"user/"+e,updateProfile:$+"profile",updateWalletAddress:$+"profile/wallet-address",updatePicture:$+"profile/picture",deleteProfilePicture:$+"profile/picture",getAllUsers:$+"user",followUser:(e,t)=>$+"community/"+t+"/user/"+e+"/follow",unfollowUser:(e,t)=>$+"community/"+t+"/user/"+e+"/unfollow",followFollowingCount:(e,t)=>$+"community/"+t+"/user/"+e+"/follow-following-count",followersList:(e,t)=>$+"community/"+t+"/user/"+e+"/followers",followedList:(e,t)=>$+"community/"+t+"/user/"+e+"/followeds",notifications:$+"user/notifications",markNotificationAsViewed:e=>$+"user/notifications/"+e+"/mark-as-read",markNotificationsAsReceived:$+"user/notifications/mark-as-received",markSelectedNotificationsAsReceived:(e,t)=>$+"user/notifications/mark-selected-as-received?group=".concat(e,"&tab=").concat(t),markNotificationsAsViewed:$+"user/notifications/mark-as-read",counters:$+"user/counters",apiKeys:{get:$+"user/api-key",delete:e=>$+"user/api-key/"+e},verify:{emailSendOtp:$+"verify/email/send-otp",emailVerifyOtp:$+"verify/email/verify-otp",mobileSendOtp:$+"verify/mobile/send-otp",mobileVerifyOtp:$+"verify/mobile/verify-otp",checkExistingMobile:$+"verify/mobile/already-existing",checkExistingEmail:$+"verify/email/already-existing"},account:{unlinkMobileOrEmail:$+"account/unlink-mobile-or-email"},block:{blockPeer:(e,t)=>$+"community/"+t+"/block-peer/"+e,unblockPeer:(e,t)=>$+"community/"+t+"/unblock-peer/"+e,listBlockedPeers:e=>$+"community/"+e+"/blocked-peers"}},Z=r.P,J={getGroupWidget:(e,t)=>Z+"community/".concat(e,"/widgets?groupId=").concat(t),createCustomWidget:e=>Z+"community/".concat(e,"/widgets"),uploadCustomCustomWidgetPicture:(e,t)=>Z+"community/".concat(e,"/widgets/").concat(t,"/upload-picture"),updateSortOrder:e=>Z+"community/".concat(e,"/widgets/sort"),updateWidget:(e,t)=>Z+"community/".concat(e,"/widgets/").concat(t),deleteCustomWidget:(e,t)=>Z+"community/".concat(e,"/widgets/").concat(t)},X={auth:i,goLive:r.P+"dyte/go-live",community:c,group:A,directMessages:b,post:q,message:I,user:Q,misc:L,open:F,mentions:M,media:P,event:x,emailSubscription:v,embeddedSections:k,widget:J,customSubdomain:f,leaderboard:S,communityPlanAccess:a,course:u,customPush:h,postHighlight:H,nft:B,subscription:Y,paymentPreference:V,liveCall:E};var ee=n(6292);const te={clientId:"91297253397-0eu6455cgepsl04vdpj0ggpj5ddoiph3.apps.googleusercontent.com"},ne={appId:"583284253212809"}},26914:(e,t,n)=>{"use strict";n.d(t,{r:()=>a});var r=n(48220),o=n.n(r);var i={"hopes.pensil.so":"1e931974dd683091fe7762831cbbf918","webveda.pensil.in":"48a22588b57fa763c042e8c79f37c6dc","epicrew.pensil.in":"6b7a489a26de8e5cf0fa41ff9e15e448","community.webveda.com":"48a22588b57fa763c042e8c79f37c6dc","theundivided.pensil.in":"7b3322b847fa7aed8f50d95bd82fca3d","design.toprankers.com":"52c2a4036b0163d2e15df1be334eb65f","management.toprankers.com":"52c2a4036b0163d2e15df1be334eb65f","cuet.toprankers.com":"52c2a4036b0163d2e15df1be334eb65f","udaan.toprankers.com":"52c2a4036b0163d2e15df1be334eb65f","law.toprankers.com":"52c2a4036b0163d2e15df1be334eb65f","www.cuet.com":"52c2a4036b0163d2e15df1be334eb65f","fyndacademy.pensil.in":"d76a235fae6cbe13a8691df369ba67b7","theforexfunda.pensil.in":"efb89ec238d18ec50bdfb9eae1c85646"}[window.location.hostname];i||(i="139968c47b75a54e4e33df5563ea588d"),o().init(i);let s={identify:e=>{o().identify(e)},alias:e=>{o().alias(e)},track:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};return o().track("WEBAPP."+e,t,n,r)},people:{set:e=>{o().people.set(e)}},reset:()=>{o().reset()}},a=s},83789:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,G:()=>r});const r="https://api.dicebear.com/8.x/initials/svg?fontSize=40&size=40&seed=",o={IMAGE:"image",VIDEO:"video",DOCUMENT:"document",BANNER:"banner"}},45913:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COMMUNITY_HOMEPAGE_ROUTE:()=>Ne,default:()=>Te});var r=n(20975),o=n(31305),i=n(82993),s=n(47760),a=n(89449),l=n(25968),c=n(34067),d=n(51772),u=n(78220),p=n(97843),h=n(91900),m=n(33740),f=n(62391);const g=(0,a.wj)((function(e){let{user:t=null,community:n}=e;const[o,i]=(0,r.useState)(!1),[s,a]=(0,r.useState)([]),[l,g]=(0,r.useState)(0);(0,r.useEffect)((()=>{var e,r;if(!n||s.length>0)return;const o=localStorage.getItem("pensil.tour-completed");if(n&&(0===(null===(e=n.welcomeMessages)||void 0===e?void 0:e.length)||1===(null===(r=n.welcomeMessages)||void 0===r?void 0:r.length)&&""===n.welcomeMessages[0])||o||!t)return void i(!1);const l=n.welcomeMessages;if(p.A.hasValue(n.welcomeMessages)){let e=[];const t=new c.F;for(let r=0;r<(null===l||void 0===l?void 0:l.length);r++){let o=null===n||void 0===n?void 0:n.welcomeMessages[r];if(o){o=(0,d.Wv)(o);const n=t.render(o),r=(0,d.pD)(null!==n&&void 0!==n?n:"");e.push(r)}}a(e)}i(null==o)}),[n,t,s.length]);const b=()=>{u.b6.replace({search:""}),localStorage.setItem("pensil.tour-completed","true"),i(!1),g(0)};return o?(0,f.jsx)("div",{className:"CommunityWelcomeMessages",children:(0,f.jsxs)(h.a,{active:o,setActive:b,padding:!1,children:[(0,f.jsxs)("div",{className:"flex flex-col items-center border-b border-border bg-card py-6",children:[(0,f.jsx)(m.A,{community:n,height:148,maxSize:!0}),(0,f.jsx)("div",{className:"mb-1 mt-3 text-xs font-semibold",children:"Welcome to"}),(0,f.jsx)("div",{className:"text-lg font-bold",children:n.name})]}),(0,f.jsx)("div",{className:"px-3 py-4",children:(0,f.jsx)("div",{className:"NL2BR headings break-all",dangerouslySetInnerHTML:{__html:s[l]}})}),(0,f.jsx)("div",{className:"flex justify-center pb-4 pt-2",children:s.map(((e,t)=>(0,f.jsx)("span",{className:"pageicon "+(t===l?"active":"")},t)))}),(0,f.jsxs)("div",{className:"flex items-center justify-between bg-card px-4 py-2",children:[0===l?(0,f.jsx)("div",{className:"cursor-pointer p-2 text-secondary-foreground/80",onClick:b,children:"Close"}):(0,f.jsx)(d.$n,{label:"Back",onClick:e=>{g(l-1)}}),(0,f.jsx)(d.$n,{label:l+1===s.length?"Finish":"Next",onClick:e=>{l+1===s.length?b():g(l+1)}})]})]})}):(0,f.jsx)(f.Fragment,{})}));var b=n(21708),v=n(57731),y=n(43039),k=n(42414),w=n(93668),x=n(16478),_=n(67992);const A=e=>{let{name:t,posts:n,setPosts:r,buttonLabel:o,isCreatePostButton:i,onClick:s}=e;const{user:a,community:l}=(0,x.G)((e=>({user:e.auth,community:e.community})));return(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{className:"flex h-16 w-screen items-center justify-between border-b border-border bg-card px-5 py-3 md:w-auto",children:[(0,f.jsx)("div",{className:"text-base font-semibold text-secondary-foreground",children:t}),p.A.hasValue(a)&&i?(0,f.jsx)(_.A,{user:a,group:void 0,groups:void 0,addPost:e=>{r([e,...n])},sectionId:void 0,community:l}):o&&p.A.hasValue(a)&&(0,f.jsx)(d.$n,{className:"",label:o,onClick:s})]})})};var C=n(5564),S=n.n(C);const j=n.p+"static/media/edit-gray-icon.2c099a51eaa1eb9c62a1cc9209cf8dba.svg";var E=n(53871),N=n(12014),P=n(23293);const D=function(e){let{community:t,setCommunity:n,user:o,addToast:i}=e;const[s,a]=(0,r.useState)(!1);return t.banner||t.bannerTitle||t.bannerDescription?(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{className:S()("CommunityInfo group relative border-border",{"border-b bg-card":t.banner||t.bannerTitle||t.bannerDescription,"border border-dashed":!(t.banner||t.bannerTitle||t.bannerDescription)}),children:[(0,f.jsxs)("div",{className:"flex flex-col justify-center",children:[t.banner&&(0,f.jsx)("img",{style:{aspectRatio:16/6},src:t.banner,alt:"img",className:"w-full object-cover"}),(0,f.jsx)("div",{className:"flex-grow",children:(0,f.jsxs)("div",{className:S()("",{"px-5 py-3":t.bannerTitle||t.bannerDescription}),children:[t.bannerTitle&&(0,f.jsx)("div",{className:"text-base font-bold",children:t.bannerTitle}),t.bannerDescription&&(0,f.jsx)("div",{className:"pt-2 text-sm font-semibold",children:(0,f.jsx)(N.F,{text:t.bannerDescription})})]})})]}),"admin"===t.myRole&&(0,f.jsx)("div",{className:"invisible absolute bottom-2 right-2 rounded bg-background p-2 group-hover:visible",children:(0,f.jsxs)("div",{className:"flex cursor-pointer items-center rounded text-xs text-secondary-foreground/80",onClick:e=>{a(!0)},children:[(0,f.jsx)("img",{src:j,alt:"",className:"pr-2"})," ",(0,f.jsx)("span",{children:(0,f.jsx)(E.A,{children:"Edit Banner"})})]})}),"admin"===t.myRole&&(0,f.jsx)(h.a,{width:"640px",padding:!1,active:s,setActive:a,children:(0,f.jsx)(P.CommunityBannerSettingsComponent,{addToast:i,community:t,user:o,setCommunity:n,setIsCommunityBannerEditModalVisible:a})})]})}):null};var M=n(84003),T=n(65186),I=n(1689),O=n(62144),L=n(89431),R=n(48672),B=n(54916);function z(e){let{group:t,setGroup:n,user:o}=e;const{analyticsService:i}=(0,T.W)(),s=(0,x.G)((e=>e.subscriptionsPlan)),a=(0,r.useMemo)((()=>{var e;return L.F.filterSubscriptionsForGroup(null!==(e=null===t||void 0===t?void 0:t.id)&&void 0!==e?e:"",s)}),[s,null===t||void 0===t?void 0:t.id]),l=L.F.hasPaidSubscription(a);return(0,f.jsxs)("div",{onClick:e=>{i.track("group-clicked-in-explore-groups",{joinStatus:t.joinStatus}),u.b6.push((0,R.DZ)(t))},className:"flex aspect-square h-full w-full flex-grow flex-col rounded-lg bg-card text-secondary-foreground",children:[(0,f.jsx)("div",{className:"aspect-video w-full overflow-hidden rounded-t-lg bg-primary-light",children:t.banner&&(0,f.jsx)(I.A,{src:t.banner,alt:"Group Banner",className:"aspect-video h-full w-full rounded-t object-cover",width:325,height:180})}),(0,f.jsxs)("div",{className:"flex flex-grow flex-col place-content-around gap-1.5 p-4",children:[(0,f.jsx)("h2",{className:"line-clamp-1 w-full text-ellipsis text-sm font-semibold tracking-tight",children:t.name}),(0,f.jsxs)("div",{className:"flex w-full items-center justify-between py-1",children:[(0,f.jsxs)("span",{className:"text-sec mt-1 flex items-center gap-2 rounded bg-accent px-3 py-0.5 text-xs",children:[(0,f.jsx)(O.A,{icon:"user",className:"text-secondary-foreground/70"}),(0,f.jsx)("span",{className:"font-semibold text-secondary-foreground",children:null===t||void 0===t?void 0:t.userCount})]}),(0,f.jsxs)("span",{className:"text-sec mt-1 flex items-center gap-2 rounded bg-accent px-3 py-0.5 text-xs",children:["open"!==t.groupType&&(0,f.jsx)(O.A,{icon:"lock",className:"text-secondary-foreground/70"}),(0,f.jsx)("span",{className:"font-semibold text-secondary-foreground",children:["open"===t.groupType?"Open":l?"Paid Group":"Private Group"]})]})]}),(0,f.jsx)("div",{className:"flex w-full flex-col",children:(0,f.jsx)(B.A,{group:t,setGroup:n,user:o,openGroupOnJoined:!0})})]})]},t.id)}const F=function(e){let{user:t,groups:n=[],setGroup:r=(e=>{}),isLoadingGroups:o=!1}=e;return(0,f.jsx)(M.u,{items:n,loading:o,className:"m-4 grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",renderItem:(e,n)=>(0,f.jsx)(z,{group:e,setGroup:r,user:t},n),placeholder:(0,f.jsx)("div",{className:"m-4 grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:Array.from({length:12}).map(((e,t)=>(0,f.jsx)("div",{className:"flex aspect-square h-full w-full flex-grow animate-pulse flex-col rounded-lg bg-card",children:(0,f.jsxs)("div",{className:"",children:[(0,f.jsx)("div",{className:"aspect-video w-full overflow-hidden rounded-t bg-primary-light",children:(0,f.jsx)("div",{className:"aspect-video rounded-t object-cover"})}),(0,f.jsxs)("div",{className:"flex flex-col gap-2 p-4",children:[(0,f.jsx)("div",{className:"h-4 w-full rounded bg-accent"}),(0,f.jsxs)("div",{className:"flex w-full place-content-between items-center",children:[(0,f.jsx)("div",{className:"h-4 w-10 rounded bg-accent"}),(0,f.jsx)("div",{className:"h-4 w-10 rounded bg-accent"})]}),(0,f.jsx)("div",{className:"mt-4 h-6 w-full rounded border border-border bg-accent"})]})]})},t)))}),noItemsElement:(0,f.jsxs)("div",{className:"no-post my-10 p-2 text-center",style:{minWidth:"476px"},children:[(0,f.jsx)("div",{className:"my-3 font-bold",children:(0,f.jsx)(E.A,{children:"Its empty here"})}),(0,f.jsx)("div",{children:(0,f.jsx)(E.A,{children:"Create a group if you are admin, or wait for a group to be added."})})]})})};var U=n(9175),V=n(8934),G=n(46420),H=n(30762),W=n.n(H),q=n(25289),K=n(38545),Y=n(3766),$=n(90945),Q=n(63360),Z=n(44139);const J=e=>{let{highlightedPosts:t,setOpenFeaturedPostsRightSideModal:n}=e;const{community:o}=(0,x.G)((e=>({community:e.community}))),i=(0,x.j)(),{addToast:s}=(0,U.d)(),[l,c]=(0,r.useState)(),[d,u]=(0,r.useState)(!1),[p,h]=(0,r.useState)(t);return(0,f.jsxs)("div",{className:"h-max bg-card",children:[(0,f.jsx)("div",{className:"sticky top-0 flex-col border-b border-border bg-card px-4 py-2",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:"text-sm font-bold text-secondary-foreground/80",children:"EDIT ORDER OF FEATURED POSTS"}),(0,f.jsx)(Q.J,{onClick:()=>{n(!1)}})]})}),(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsx)(E.A,{children:"Note: Drag the Post to change the order."}),(0,f.jsx)("div",{className:"flex flex-wrap justify-around gap-y-4 mt-4 mb-20",children:p&&p.map(((e,t)=>(0,f.jsx)("div",{className:"mb-2",onDrop:e=>{try{const e=p.map((e=>e));console.log(e);const n=e[t].sortOrder;e[t].sortOrder=e[l].sortOrder,e[l].sortOrder=n,e.sort(((e,t)=>e.sortOrder-t.sortOrder)),h(e)}catch(e){console.error(e)}},children:(0,f.jsx)(ie,{post:e.postData,onDragStart:()=>{c(t)}},e.postData.id)},t)))})]}),(0,f.jsx)("div",{className:"fixed bottom-0 w-full border-t border-border bg-card p-4 md:w-3/5 lg:w-[38%]",children:(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)(Z.$,{className:"w-36 px-0 text-sm",isCancelType:!0,label:"Cancel",onClick:()=>n(!1)}),(0,f.jsx)(Z.$,{onClick:async()=>{const e=p.map(((e,t)=>({sortOrder:t,postId:e.postData.id})));u(!0);try{await $.g.updateHighlightedPostsSortOrder(o.id,{sortOrder:e});i((0,Y.Ls)(p)),s("Featured posts order updated successfully","",a.lm.success),u(!1),n(!1)}catch(t){console.error(t),u(!1)}},className:"text-sm",isLoading:d,label:"Update Order"})]})})]})};var X,ee,te;function ne(e){let{icon:t="right",position:n="end",margin:r="right",onClick:o=(()=>{})}=e;const i="start"===n?"start-0":"end-0",s="left"===r?"ml-2":"mr-2";return(0,f.jsx)(re,{className:"top-[50%] h-7 w-7 border ".concat(i," ").concat(s," absolute my-auto flex cursor-pointer justify-between rounded-full border border-border bg-card shadow-md transition-all duration-200 hover:scale-110 hover:border-border active:scale-95 active:border-primary"),onClick:o,children:(0,f.jsx)(O.A,{icon:"caret-"+t,className:"text-secondary-foreground/70 hover:text-secondary-foreground/85"})})}const re=q.Ay.button(X||(X=(0,G.A)(["\n padding: 2px 6px;\n"]))),oe=q.Ay.div(ee||(ee=(0,G.A)(["\n width: 100%;\n overflow: scroll;\n"])));function ie(e){var t;let{post:n,onDragStart:r,onDrop:o=(e=>{})}=e;const{analyticsService:i}=(0,T.W)(),s=null!==n&&void 0!==n&&n.banner?null===n||void 0===n?void 0:n.banner:null!==n&&void 0!==n&&null!==(t=n.images)&&void 0!==t&&t.length?null===n||void 0===n?void 0:n.images[0]:null,{title:a,description:l,createdBy:c}=(null===n||void 0===n||n.banner,n),d=s?40:115,p=(null===a||void 0===a?void 0:a.length)>40?a.slice(0,37)+"...":a,h=(null===l||void 0===l?void 0:l.length)>d?W()(l).slice(0,d-4)+"...":W()(l);return(0,f.jsx)("div",{draggable:!0,onDragStart:r,onDragOver:e=>{e.preventDefault()},onDrop:o,children:(0,f.jsx)(se,{className:"overflow-hidden min-w-[210px] rounded-lg bg-card",onClick:()=>{u.b6.push((0,K.createPostDetailPageRouteFromSlug)(n)),i.track("featured-post-clicked",{postUrl:window.location.origin+(0,K.createPostDetailPageRouteFromSlug)(n)})},children:(0,f.jsxs)("div",{className:"flex flex-col h-full",children:[s&&(0,f.jsx)("div",{className:"w-full aspect-video flex-shrink-0",children:(0,f.jsx)("img",{src:s,className:"w-full h-full object-cover rounded-t-lg",alt:"banner"})}),(0,f.jsxs)("div",{className:"flex-1 flex flex-col p-3 min-h-0",children:[(0,f.jsxs)("div",{children:[p&&(0,f.jsx)("div",{className:"text-xs font-semibold mb-1 line-clamp-2",children:p}),h&&(0,f.jsx)("p",{className:"text-xxs text-secondary-foreground/70 line-clamp-2",children:h})]}),(0,f.jsx)("div",{className:"mt-auto pt-2 flex-shrink-0",children:(0,f.jsx)(V.eu,{user:c})})]})]})})})}const se=q.Ay.div(te||(te=(0,G.A)(["\n width: ","px;\n height: ","px;\n display: flex;\n flex-direction: column;\n cursor: pointer;\n\n box-shadow:\n 0 0px 15px 0px rgb(0 0 0 / 0.1),\n 0 0px 15px 0px rgb(0 0 0 / 0.1);\n box-shadow:\n 0 0px 15px 0px rgb(136, 136, 136, 0.32),\n 0 0px 15px 0px rgb(136, 136, 136, 0.32);\n"])),210,240),ae=(0,o.Ng)((e=>({user:e.auth,community:e.community,highlightedPosts:e.highlightedPosts})),{getHighlightedPosts:Y.hz})((function(e){let{highlightedPosts:t}=e;const{posts:n}=t,{community:o,user:i}=(0,x.G)((e=>({user:e.auth,community:e.community}))),s=r.createRef(),[a,l]=(0,r.useState)(!1);return n&&0!==n.length?(0,f.jsxs)("div",{className:"relative mb-4 w-screen rounded-xl bg-card md:max-w-[640px]",children:[(0,f.jsxs)("div",{className:"flex px-5 pt-5 justify-between items-center",children:[(0,f.jsx)("div",{className:"font-bold text-secondary-foreground",children:"FEATURED POSTS"}),i&&"admin"===(null===o||void 0===o?void 0:o.myRole)&&(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"text-primary font-semibold uppercase hover:bg-primary-light py-0.5 px-1 text-xs cursor-pointer rounded",onClick:()=>{l(!0)},children:"Edit Order"}),a&&(0,f.jsx)(v.A,{width:570,setActive:l,active:a,children:(0,f.jsx)(J,{highlightedPosts:n,setOpenFeaturedPostsRightSideModal:l})})]})]}),(0,f.jsx)(ne,{icon:"left",position:"start",margin:"left",onClick:()=>{const e=s.current.getBoundingClientRect().width,t=s.current.scrollLeft,n=s.current.scrollWidth;let r=0;0===t?r=n:t-e>0&&(r=t-e),s.current.scrollTo({top:0,left:r,behavior:"smooth"})}}),(0,f.jsx)(ne,{icon:"right",onClick:()=>{const e=s.current.getBoundingClientRect().width,t=s.current.scrollLeft;let n=0;t+e{var t;return(0,f.jsx)(ie,{post:null===e||void 0===e?void 0:e.postData},null===e||void 0===e||null===(t=e.postData)||void 0===t?void 0:t.id)}))})]}):(0,f.jsx)(f.Fragment,{})}));var le=n(68491),ce=n(97844),de=n(64447),ue=n(97482),pe=n(36646),he=n(79036),me=n(17357),fe=n(31012),ge=n(55049),be=n(58157),ve=n(90559),ye=n(19328);function ke(e){let{community:t,user:n,memberPreviewLimit:o=5}=e;const[i,s]=(0,r.useState)(!1),[a,l]=(0,r.useState)(""),[c,d]=(0,r.useState)([]),[u,p]=(0,r.useState)([]),[m,g]=(0,r.useState)(0),[b,v]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[x,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(1),{profileModelState:{setShowProfileModel:S,setIdToViewProfile:j}}=(0,ge.A)(),N=(0,r.useRef)();(0,r.useEffect)((()=>{s(!0),y.BE.getCommunitySubscribersPaginated(n,t.id,10,1,a,"").then((e=>{let{users:t,total:n}=e;p(t),d(t),g(n),s(!1)})).catch((e=>{console.error({error:e}),s(!1)}))}),[n,t.id]);const P=r.useCallback((0,fe.debounce)((e=>{["admin"].includes(t.myRole)&&(s(!0),y.BE.getCommunitySubscribersPaginated(n,t.id,10,1,e,"").then((e=>{let{users:t,total:n}=e;p(t),g(n),s(!1),_(!1)})).catch((e=>{console.error({error:e}),s(!1)})))}),1e3),[t.myRole]),D=r.useCallback((()=>{if(N.current){const{scrollTop:e,scrollHeight:r,clientHeight:o}=N.current;if(e+o===r&&!k&&!x){const e=A+1;w(!0),y.BE.getCommunitySubscribersPaginated(n,t.id,10,e,a,"").then((t=>{0===t.users.length?_(!0):(p([...u,...t.users]),C(e)),w(!1)})).catch((e=>{console.error({error:e}),s(!1)}))}}}),[k,x,A,a,u]),M=u;return(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)("div",{className:"rounded-2xl bg-card p-5",children:[(0,f.jsx)("h4",{className:"cursor-pointer select-none border-b border-border pb-5 font-bold uppercase text-secondary-foreground",children:(0,f.jsx)(E.A,{children:"Community Members"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"GroupMemberList",children:c.slice(0,o).map((e=>(0,f.jsx)("div",{className:"group-member-list-item my-3 flex cursor-pointer items-center justify-between",children:(0,f.jsx)(V.eu,{user:e,size:30,onClick:()=>{S(!0),j(e.id)},tag:"admin"===e.groupRole?(0,f.jsx)("div",{className:"text-xxs mx-2 rounded bg-primary-foreground px-1 font-semibold text-primary",children:(0,f.jsx)(E.A,{children:"Admin"})}):"moderator"===e.groupRole?(0,f.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,f.jsx)(E.A,{children:"Moderator"})}):(e.groupRole,(0,f.jsx)(f.Fragment,{})),extraInfo:void 0})},e.id)))}),(0,f.jsx)("div",{className:"text-xxs",children:(0,f.jsx)(be.A,{label:"View all",onClick:e=>{v(!0)}})}),(0,f.jsxs)(h.a,{className:"bg-card",setActive:v,active:b,padding:!1,children:[(0,f.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,f.jsxs)("span",{className:"font-bold text-secondary-foreground",children:[t.name," - ",m," ",(0,f.jsx)(E.A,{children:"Subscribers"})]}),(0,f.jsx)(ve.A,{hoverable:!0,icon:"cross",size:"xs",iconClass:"text-secondary-foreground/70 text-xs",onClick:()=>{v(!1)}})]}),(0,f.jsxs)("div",{className:"bg-background p-5 pb-10 text-secondary-foreground",children:[(0,f.jsxs)("div",{className:"mb-4 flex items-center rounded border border-border bg-background bg-card px-4 py-1",children:[(0,f.jsx)(O.A,{icon:"search",className:"text-xs text-secondary-foreground/70"}),(0,f.jsx)("input",{type:"text",placeholder:"Search",value:a,onChange:e=>{s(!0),l(e.target.value),P(e.target.value)},className:"flex-grow bg-transparent px-4 py-1 focus:outline-none"}),a.length>0?(0,f.jsx)("i",{onClick:()=>{s(!0),l(""),P("")},className:"fi fi-rr-cross cursor-pointer pr-1 text-sm text-secondary-foreground/85"}):null]}),i?(0,f.jsx)("div",{className:"p-1",children:(0,f.jsx)(ye.a,{})}):(0,f.jsx)(f.Fragment,{}),(0,f.jsx)("div",{onScroll:D,ref:N,className:"h-96 overflow-y-scroll",children:M.map((e=>(0,f.jsx)("div",{className:"m-3 flex cursor-pointer items-center justify-between",children:(0,f.jsx)("div",{className:"flex items-center justify-center",children:(0,f.jsx)(V.eu,{user:e,onClick:()=>{S(!0),j(e.id)},tag:(0,f.jsxs)(f.Fragment,{children:["admin"===e.communityRole?(0,f.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,f.jsx)(E.A,{children:"Community Admin"})}):(0,f.jsx)(f.Fragment,{}),"admin"===e.groupRole?(0,f.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,f.jsx)(E.A,{children:"Admin"})}):"moderator"===e.groupRole?(0,f.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,f.jsx)(E.A,{children:"Moderator"})}):(0,f.jsx)(f.Fragment,{})]})})})},e.id)))}),k?(0,f.jsx)("div",{className:"p-1",children:(0,f.jsx)(ye.a,{})}):null]})]})]})]})})}var we=n(75972),xe=n(79957),_e=n(85324),Ae=n(39740),Ce=n(42498);function Se(e){var t;let{event:n}=e;const{analyticsService:r}=(0,T.W)(),{monthAbbreviation:o,dayOfMonth:i}=(0,_e.j1)(n.startTime);return(0,f.jsx)("div",{onClick:e=>{r.track("event-selected-from-widget"),u.b6.push((0,xe.createEventDetailSlugPageRoute)(n))},className:"cursor-pointer space-y-2 pb-2 pt-4",children:(0,f.jsxs)("div",{className:"flex space-x-2",children:[(0,f.jsxs)("div",{className:"flex-col",children:[(0,f.jsx)("div",{className:"text-xxs rounded-t-md bg-primary px-2.5 py-0.5 text-primary-foreground",children:o}),(0,f.jsx)("div",{className:"text-xxs items-center rounded-b-md border border-border px-2.5 py-1.5 text-secondary-foreground drop-shadow-md",children:(0,f.jsx)("span",{className:"ml-0.5",children:i})})]}),(0,f.jsxs)("div",{className:"flex-col",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-secondary-foreground",children:(0,_e.cA)(n.startTime)}),(0,f.jsxs)("div",{className:"text-xxs flex items-center font-semibold text-secondary-foreground",children:[(0,f.jsxs)("span",{children:[(0,_e.mf)(n.startTime),"-"]}),(0,f.jsx)("span",{children:(0,_e.mf)(n.endTime)})]}),(0,f.jsx)("div",{className:"truncate-two-lines my-1 text-xs font-normal text-secondary-foreground",children:n.title}),(0,f.jsx)("div",{className:"flex items-center",children:(0,f.jsx)(V.eu,{user:null!==(t=n.host)&&void 0!==t?t:n.createdBy,className:"",extraInfo:void 0,size:25})})]})]})})}const je=function(e){let{user:t,community:n,group:o,isCommunityEvent:i=!1}=e;const[s,a]=(0,r.useState)([]),[l,c]=(0,r.useState)(!1);(0,r.useEffect)((()=>{i&&0===s.length?d():i||0!==s.length||p()}),[n]);const d=()=>{let e=[];c(!0),Ce.U.upcomingEvents(t,n.id,"").then((t=>{t.events&&t.events.map((t=>{const n={title:t.title&&t.title.length>15?t.title.substring(0,14)+"...":t.title,start:new Date(t.startTime),end:new Date(t.endTime),...t};e.length<5&&e.push(n)})),a(e),c(!1)})).catch((e=>{console.log(e),c(!1)}))},p=()=>{let e=[];c(!0),Ce.U.latestGroupEvent(t,n.id,null===o||void 0===o?void 0:o.id).then((t=>{t.events&&t.events.map((t=>{const n={title:t.title&&t.title.length>15?t.title.substring(0,14)+"...":t.title,start:new Date(t.startTime),end:new Date(t.endTime),...t};e.length<5&&e.push(n)})),a(e),c(!1)})).catch((e=>{console.log(e),c(!1)}))};return!l&&void 0===s||0==s.length?(0,f.jsx)(f.Fragment,{}):(0,f.jsxs)("div",{className:"w-full rounded-xl bg-card p-5",style:{maxWidth:"100%"},children:[(0,f.jsx)("h4",{className:"border-b border-border pb-5 text-sm font-bold uppercase text-secondary-foreground",children:i?(0,f.jsx)(E.A,{children:"Upcoming Events"}):(0,f.jsx)(E.A,{children:"Group Events"})}),l?(0,f.jsx)(ye.a,{}):(0,f.jsxs)(f.Fragment,{children:[s&&s.slice(0,2).map(((e,t)=>(0,f.jsx)(Se,{event:e},t))),(null===s||void 0===s?void 0:s.length)>2&&(0,f.jsx)(be.A,{label:"View All",className:"text-xxs",onClick:e=>{u.b6.push("".concat(Ae.COMMUNITY_EVENTS_PAGE_ROUTE))}})]})]})};function Ee(e){var t;let{community:n,posts:o=[],setPosts:i,user:s,widgets:a,hasMorePost:l,onWidgetListUpdate:c=(e=>{}),isLoadingPosts:u=!1,isLoadingMorePosts:h=!1,sortOrder:m="recent",setSortOrder:g=(e=>{})}=e;const[b,y]=(0,r.useState)(!1),k=["admin","moderator"].includes(null!==(t=null===n||void 0===n?void 0:n.myRole)&&void 0!==t?t:""),{analyticsService:w}=(0,T.W)(),{addToast:A}=(0,U.d)(),{topics:C}=(0,x.G)((e=>({topics:e.communityTopics.topics}))),[j,N]=(0,r.useState)(!1),[P,D]=(0,r.useState)(null),[I,L]=(0,r.useState)([{label:"Recent",key:"recent",icon:"clock"},{label:"Top Posts",key:"top",icon:"arrow-from-bottom"},{label:"Trending",key:"trending",icon:"trophy"},{label:"Following",key:"following",icon:"following"}]),R=Array.isArray(C)?null===C||void 0===C?void 0:C.filter((e=>e.postCount>0&&"ACTIVE"===e.status)):[];return(0,r.useEffect)((()=>{if(P){const e=I.filter((e=>!e.isCommunityTopic));L([...e,P]),g(P.key)}}),[P]),(0,f.jsx)("div",{className:S()("CommunityPostTab my-6 flex w-screen flex-col p-0 md:w-auto lg:px-2"),children:(0,f.jsxs)("div",{className:"flex justify-around md:mx-auto lg:mx-1",children:[(0,f.jsxs)("div",{className:S()({"":n&&!n.expandPostDirectory}),children:[(0,f.jsx)(ae,{}),p.A.hasValue(s)&&(0,f.jsx)(_.A,{user:s,group:void 0,groups:void 0,sectionId:void 0,addPost:e=>{i([e,...o])},addToast:A,community:n,inlineDivComponent:(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{className:"PostList mb-3 w-screen cursor-pointer rounded-xl bg-card p-3 shadow-sm md:w-auto md:min-w-[640px]",children:(0,f.jsx)("div",{className:"flex items-center justify-between",children:(0,f.jsxs)("div",{className:"flex w-full items-center",children:[(0,f.jsx)(V.eu,{user:s,noName:!0,className:"flex-none",size:45,extraInfo:void 0}),(0,f.jsxs)("div",{className:"flex w-full flex-grow justify-between rounded-full border border-border bg-background px-5 py-2 font-semibold text-secondary-foreground/80",onClick:()=>{w.track("create-post-input-box-on-homefeed")},children:[(0,f.jsx)(E.A,{children:"What's on your mind"}),","," ",s.name.split(" ")[0],"?",(0,f.jsx)(O.A,{icon:"pencil"})]})]})})})})}),(0,f.jsxs)("div",{className:"mb-3 flex w-screen items-center overflow-x-auto px-0.5 md:w-auto md:min-w-[640px]",children:[(0,f.jsx)(le.A,{selectedOption:m,setSelectedOption:e=>{if(m){if(R.length>0){if(I.find((t=>t.key===e))){const e=I.filter((e=>!e.isCommunityTopic));L(e),D(null)}}g(e)}},options:I,removeSelectedCommunityTopicFilter:()=>{if(P){const e=I.filter((e=>e.key!==P.key));L(e)}g(I[0].key),D(null)}}),(null===R||void 0===R?void 0:R.length)>0&&!P&&(0,f.jsxs)("span",{className:"my-1.5 ml-2.5 flex w-fit min-w-28 items-center rounded-full border border-border bg-accent px-2 py-1 text-xs hover:cursor-pointer",onClick:()=>{N(!0)},children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-secondary-foreground",children:"Select Topic"}),(0,f.jsx)(O.A,{icon:"caret-down",className:"ml-1 mt-0.5"}),(0,f.jsx)(ue.Xb,{active:j,setActive:N,availableTopics:R,selectedTopics:[],setSelectedFilteredTopic:D})]})]}),(0,f.jsx)(M.u,{items:o,loading:u,className:S()("PostList flex w-screen flex-col md:w-auto md:min-w-[640px] md:max-w-[640px]",{"pensil-card my-2":n&&!n.expandPostDirectory}),renderItem:function(e,t){var r,a;return n&&n.expandPostDirectory?(0,f.jsx)(d.RK,{isCommunityPost:!0,post:e,noMargin:!0,onTopicSelect:e=>{for(let t=0;t<(null===R||void 0===R?void 0:R.length);t++)if(R[t].id===(null===e||void 0===e?void 0:e.id)){D({key:R[t].id,label:R[t].name,bgColor:R[t].bgColor,textColor:R[t].textColor,isCommunityTopic:!0}),g(R[t].id);break}},updatePost:e=>{const t=o.findIndex((t=>t.id===e.id)),n=[...o];n.splice(t,1,e),i(n)},showFullPost:1===o.length,deletePost:e=>{const t=o.findIndex((t=>t.id===e.id)),n=[...o];n.splice(t,1),i(n)}},e.id):(0,f.jsx)(de.z,{post:e,user:s,updatePost:e=>{const t=o.findIndex((t=>t.id===e.id)),n=[...o];n.splice(t,1,e),i(n)},showFullPost:1===o.length,deletePost:e=>{const t=o.findIndex((t=>t.id===e.id)),n=[...o];n.splice(t,1),i(n)},displayLikeCommentIcons:!(null!==(r=e.preferences)&&void 0!==r&&r.hideLikes&&null!==(a=e.preferences)&&void 0!==a&&a.hideComment)},e.id)},placeholder:(0,f.jsx)("div",{className:"PostList my-2 rounded bg-card p-2 md:min-w-[640px] md:max-w-[640px]",children:(0,f.jsx)(pe.A,{length:6,type:pe.D.compact})}),noItemsElement:(0,f.jsxs)("div",{className:"no-post my-10 p-2 text-center",children:[(0,f.jsx)("div",{className:"my-3 font-bold",children:(0,f.jsx)(E.A,{children:"Looks like nothing available here right now."})}),(0,f.jsx)("div",{children:(0,f.jsx)(E.A,{children:"Try exploring other tabs"})})]}),footerElement:(0,f.jsxs)("div",{children:[h&&(0,f.jsx)("div",{className:"PostList my-2 rounded bg-card p-2 md:min-w-[640px] md:max-w-[640px]",children:(0,f.jsx)(pe.A,{length:3,type:pe.D.compact})}),l&&(0,f.jsx)("div",{className:"flex h-32 place-content-center items-center text-xs text-secondary-foreground/80",children:(0,f.jsx)(E.A,{children:"Looks like you have reached the end of the list, No more post to display"})})]})})]}),s&&n&&(0,f.jsxs)("div",{className:"HomeWidget flex flex-grow flex-col space-y-3",children:[a&&a.length>0&&(0,f.jsx)(f.Fragment,{children:a.map(((e,t)=>{if(!s||!e.isVisible&&["user",void 0].includes(n.myRole))return null;if(k&&!e.isVisibleToAdmin)return null;switch(e.type){case"custom":return(0,f.jsx)(he.A,{widget:e},t);case"community-members":return(0,f.jsx)(ke,{user:s,community:n,memberPreviewLimit:5},t);case"top-posts":return(0,f.jsx)("div",{className:"",children:(0,f.jsx)(we.A,{isCommunityPosts:!0})},t);case"upcoming-events":return(0,f.jsx)("div",{children:(0,f.jsx)(je,{user:s,community:n,isCommunityEvent:!0,group:void 0})},t);case"community-leaderboard":return(0,f.jsx)(me.A,{memberPreviewLimit:4,isCommunityLeaderBoard:!0,group:void 0},t);default:return null}}))}),k&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{onClick:()=>{w.track("click-select-widget",{location:"home"}),y(!0)},className:"flex w-full cursor-pointer place-content-center gap-1 rounded-lg border border-dashed border-border p-3 text-secondary-foreground",children:(0,f.jsx)(E.A,{children:"Select Widgets"})}),(0,f.jsx)(v.A,{width:570,setActive:y,active:b,children:(0,f.jsx)(ce.A,{widgets:a,setActive:y,onWidgetListUpdate:c})})]})]})]})})}const Ne="/",Pe=["Posts","Groups"];function De(e){let{tab:t,user:n,groups:r,community:o,posts:i,setPosts:s,addToast:a,widgets:l,setWidgets:c,isLoadingPosts:d=!1,isLoadingGroups:u=!1,hasMorePost:p=!1,isLoadingMorePosts:h=!1,updateGroup:m=(e=>{}),sortOrder:g="recent",setSortOrder:b=(e=>{})}=e;switch(t){case"Posts":return(0,f.jsx)(Ee,{community:o,user:n,groups:r,widgets:l,isLoadingMorePosts:h,posts:i,setPosts:s,isLoadingPosts:d,sortOrder:g,setSortOrder:b,addToast:a,onWidgetListUpdate:e=>{c(e)},hasMorePost:p});case"Groups":return(0,f.jsx)("div",{className:"min-h-screen",children:(0,f.jsx)(F,{user:n,groups:r,setGroup:m,isLoadingGroups:u})});default:return(0,f.jsx)(Me,{})}}function Me(e){let{tab:t}=e;return(0,f.jsxs)("div",{className:"no-post my-10 p-2 text-center",style:{minWidth:"476px"},children:[(0,f.jsx)("div",{className:"my-3 font-bold",children:"Looks like this resource is not available."}),(0,f.jsx)("div",{children:"Try exploring other tabs"})]})}const Te=(0,a.wj)((0,o.Ng)((e=>({user:e.auth,groups:e.groups,isLoadingGroups:e.isLoadingGroups,community:e.community})),(e=>(0,i.zH)({setGroups:w.$Y,setCommunity:k.Km},e)))((function(e){let{community:t,setCommunity:n,user:o,addToast:i,groups:a=[],isLoadingGroups:c=!1,setGroups:d=(e=>{}),provider:p,getWeb3Accounts:h=(()=>{})}=e;const[m,k]=(0,r.useState)(Pe[0]),[w,x]=(0,r.useState)(!0),[_,C]=(0,r.useState)(1),[S,j]=(0,r.useState)([]),[E,N]=(0,r.useState)("recent"),[P,M]=(0,r.useState)(!1),[T,I]=(0,r.useState)(!1),O=o?o.token:null,[L,R]=(0,r.useState)(),[B,z]=(0,r.useState)(!1),F=["admin","moderator"].includes(null===t||void 0===t?void 0:t.myRole);return(0,r.useEffect)((()=>{p&&(async()=>{console.log("Wallet address: ",await h())})()}),[p]),(0,r.useEffect)((()=>{const e=u.b6.listen(((e,t)=>{e.pathname===Ne&&k("Posts")}));return k(window.location.pathname===Ne?"Posts":m),()=>{e()}}),[]),(0,r.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get("tab");Pe.includes(e)?k(e):"Posts"!==m&&k("Posts");const t=u.b6.listen(((e,t)=>{const n=new URLSearchParams(window.location.search).get("tab");Pe.includes(n)?k(n):"Posts"!==m&&k("Posts")}));return()=>{t()}}),[]),(0,r.useEffect)((()=>{var e;!O&&null!==t&&void 0!==t&&null!==(e=t.configuration)&&void 0!==e&&e.setExploreGroupsAsLandingPageForNonLoggedinUsers&&u.b6.push("/?tab=Groups")}),[O,t]),(0,r.useEffect)((()=>{t.id&&(x(!0),y.BE.getCommunityPostDirectoryById({token:O},t.id,E).then((e=>{let{posts:t,page:n}=e;j(t),C(n)})).finally((()=>{x(!1)})))}),[O,t.id,E]),(0,r.useEffect)((()=>{const e=e=>{const n=e.currentTarget;let r=n.scrollY,o=document.body.scrollHeight,i=n.innerHeight;(r+i===o||r+i+2>o)&&(w||P||T||"Posts"!==m||(M(!0),y.BE.getCommunityPostDirectoryById({token:O},t.id,E,_+1).then((e=>{if(0===e.posts.length)I(!0);else{const t=S;for(let n of e.posts)-1===t.findIndex((e=>e.id===n.id))&&t.push(n);j(t),C(e.page)}})).finally((()=>{M(!1)}))))};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[P,w,O,_,S,T,E,t.id,m]),(0,r.useEffect)((()=>{null!==t&&void 0!==t&&t.id&&y.Cq.getWidgets(t.id,"").then((e=>{let t,{widgets:n}=e;void 0!==n&&(t=n.filter((e=>"members"!==e.type&&"leaderboard"!==e.type))),R(t)})).catch((e=>{console.log(e)}))}),[null===t||void 0===t?void 0:t.id]),(0,f.jsx)(l.l,{layout:s.DQ.TWO_COLUMN,children:(0,f.jsxs)("div",{className:"CommunityHomePage flex",children:[(0,f.jsxs)("div",{className:"main-content",children:[(0,f.jsx)(D,{selectedTab:m,setSelectedTab:k,community:t,availableCommunityTabs:Pe,user:o,addToast:i,setCommunity:n}),"Posts"===m&&(0,f.jsx)("div",{className:"sticky top-[47px] z-[2]",children:(0,f.jsx)(A,{name:"Home",posts:S,setPosts:j,isCreatePostButton:!0})}),"Groups"===m&&(0,f.jsx)("div",{className:"sticky top-[47px] z-[2]",children:(0,f.jsx)(A,{name:"Explore Groups",buttonLabel:F&&"Create Group",onClick:()=>{z(!B)}})}),(0,f.jsx)(v.A,{width:570,setActive:z,active:B,children:(0,f.jsx)(b.A,{isEditGroupModalVisible:B,setIsEditGroupModalVisible:z})}),(0,f.jsx)("div",{className:"main",children:(0,f.jsx)(De,{user:o,tab:m,groups:a,isLoadingGroups:c,community:t,posts:S,setPosts:j,isLoadingPosts:w,isLoadingMorePosts:P,updateGroup:e=>{const t=[...a],n=t.findIndex((t=>t.id===e.id));n>-1&&(t.splice(n,1,e),d(t))},sortOrder:E,setSortOrder:N,addToast:i,widgets:L,setWidgets:R,hasMorePost:T})}),(0,f.jsx)("div",{className:"secondary-sidebar pr-5"})]}),(0,f.jsx)(g,{user:o,community:t})]})})})))},21784:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var r=n(5564),o=n.n(r),i=n(20975),s=n(77826),a=n(9175),l=n(51772),c=n(60553),d=n(58157),u=n(15102),p=n(25715),h=n(86129),m=n(61649),f=n(84003),g=n(62391);function b(e){let{className:t}=e;return(0,g.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:o()("h-5 w-5",t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5","aria-labelledby":"title-06 desc-06",children:[(0,g.jsx)("title",{id:"title-06",children:"Circle Checkmark"}),(0,g.jsx)("desc",{id:"desc-06",children:"Checkmark in circle"}),(0,g.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})]})}var v=n(62144),y=n(43039),k=n(36357),w=n(97843),x=n(53484),_=n(15902);function A(e){let{course:t,setCourse:n,section:r,community:l,className:A,hasWritePermission:S,onSectionUpdate:j=(e=>{}),onSectionDelete:E=(e=>{}),onLessonAdded:N=(e=>{}),onLessonDelete:P=(e=>{})}=e;const D=t.id,[M,T]=i.useState(!0),[I,O]=i.useState(!1),[L,R]=i.useState(!1),[B,z]=i.useState(!1),[F,U]=i.useState(),[V,G]=i.useState(!1),{addToast:H,ToastTypes:W}=(0,a.d)();return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:o()("mb-2 select-none rounded",A),children:[(0,g.jsxs)("div",{className:"flex cursor-pointer place-content-between px-2",onClick:()=>{T(!M)},children:[(0,g.jsxs)("div",{className:o()("flex select-none items-center space-x-2",{"py-2":!S}),children:[(0,g.jsx)(v.A,{icon:M?"caret-down":"caret-right",className:"h-5"}),(0,g.jsxs)("span",{className:"flex items-center space-x-2 font-semibold text-secondary-foreground",children:[(0,g.jsx)("span",{className:"",children:r.emoji}),(0,g.jsx)("span",{children:r.name})]})]}),S&&(0,g.jsx)("div",{className:"flex items-center space-x-2",children:(0,g.jsx)(p.A,{actions:[{icon:"edit",onClick:()=>O(!0),label:"Edit",actionType:p.X.default},{icon:"trash",onClick:()=>R(!0),label:"Delete",actionType:p.X.alert}]})})]}),(0,g.jsx)("div",{className:"flex flex-col rounded-b bg-card",children:(0,g.jsx)(u.y,{IsDisplay:M,children:(0,g.jsx)(f.u,{items:r.lessons,className:"space-y-1 first:mt-1 last:mb-1",footerElement:(0,g.jsx)(g.Fragment,{children:S&&(0,g.jsx)("div",{className:"FooterAdd",children:w.A.hasValue(r.lessons)&&(0,g.jsx)(K,{})})}),noItemsElement:(0,g.jsx)(g.Fragment,{children:(0,g.jsx)("div",{className:"mt-1 px-2 py-3",children:S?(0,g.jsx)("div",{className:"NoItem",children:(0,g.jsx)(K,{})}):(0,g.jsx)(m.A,{className:"shadow-inner",title:"No lesson added to this channel",message:"Lessons will display here once added"})})}),renderItem:e=>(0,g.jsx)(q,{lesson:e})})})})]}),(0,g.jsx)(h.A,{title:"Update section",className:"w-full sm:w-2/3 md:w-2/4 lg:w-1/3",visible:I,setVisible:O,children:(0,g.jsx)(_.A,{community:l,course:t,setCourse:e=>{n(e),O(!1)},section:r,setVisible:O})}),(0,g.jsx)(c.c,{header:"Confirm ?",title:"Are you sure you want to delete ".concat(r.name),onSubmit:()=>{z(!0),y.fk.deleteSection(l.id,D,r.id).then((e=>{let{course:t}=e;H("Success","Channel deleted successfully",W.success),E(r),z(!1)})).catch((e=>{console.error(e),H("Error","Unable to delete channel",W.danger)})).finally((()=>{z(!1)}))},isLoading:B,active:L,setActive:R}),(0,g.jsx)(c.c,{header:"Confirm ?",title:"Are you sure you want to delete ".concat(null===F||void 0===F?void 0:F.title),onSubmit:()=>{G(!0),y.fk.deleteLesson(l.id,D,r.id,F.id).then((e=>{let{lesson:t}=e;H("Success","Lesson deleted successfully",W.success),P(t),U(void 0)})).catch((e=>{console.error(e),H("Error","Unable to delete lesson",W.danger)})).finally((()=>{G(!1)}))},isLoading:V,active:F,setActive:U})]});function q(e){let{lesson:t}=e;const[n,a]=i.useState(!1),l=t.state===x.LessonState.published;return(0,g.jsx)("div",{children:n?(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(K,{lessonToUpdate:t,setIsEditVisible:a})}):(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(s.k2,{className:e=>o()("Lesson group flex flex-col place-content-between rounded",{"hover:bg-background":!e}),activeClassName:"bg-primary-light ",isActive:(e,n)=>new URLSearchParams(n.search).get("lesson")===t.id,to:(0,x.createLessonViewPageRoute)(D,r.id,t.id),children:(0,g.jsxs)("div",{className:"flex place-content-between items-center px-2 py-1",children:[(0,g.jsxs)("div",{className:"flex flex-grow gap-2 text-secondary-foreground/85",children:[(0,g.jsx)("div",{className:"flex-none rounded-full",children:(0,g.jsx)(k.av,{value:S,ifPresent:e=>(0,g.jsx)(v.A,{icon:l?"file-check":"file"}),ifAbsent:()=>(0,g.jsx)(g.Fragment,{children:t.isCompleted?(0,g.jsx)("span",{className:"text-primary",children:(0,g.jsx)(b,{})}):(0,g.jsx)(v.A,{icon:"circle",className:"ml-1"})})})}),(0,g.jsx)("span",{className:"",children:t.title})]}),(0,g.jsx)(k.av,{value:S,ifPresent:()=>(0,g.jsxs)("div",{className:o()("flex flex-none",{hidden:!S}),children:[(0,g.jsx)(d.A,{label:"Edit",className:"invisible group-hover:visible",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(!0)}}),(0,g.jsx)(d.A,{label:"Delete",className:"hover:theme-bg-danger hover:theme-text-background invisible text-alert group-hover:visible",onClick:e=>{e.preventDefault(),e.stopPropagation(),U(t)}})]})})]})})})})}function K(e){let{lessonToUpdate:t,setIsEditVisible:n=(e=>{})}=e;return(0,g.jsx)(C,{communityId:l.id,courseId:D,sectionId:r.id,lesson:t,setIsEditVisible:n,onLessonUpdate:e=>{const t=r.lessons.map((t=>t.id===e.id?e:t));j({...r,lessons:t})},onLessonCreate:e=>{N(e)}})}}function C(e){let{communityId:t,courseId:n,sectionId:r,lesson:o,onLessonCreate:s=(e=>{}),onLessonUpdate:c=(e=>{}),setIsEditVisible:u=(e=>{})}=e;const[p,h]=(0,i.useState)(o),[m,f]=(0,i.useState)(!1),[b,k]=(0,i.useState)({}),[w,x]=(0,i.useState)(o&&o.title),{addToast:_,ToastTypes:A}=(0,a.d)(),C=i.useRef(null);i.useEffect((()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&(h(!1),u(!1))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[C]);const S=e=>{var i;if(e.preventDefault(),m)return;if(!w)return void k({title:"Name is required"});const a={...o,title:w,index:null!==(i=null===o||void 0===o?void 0:o.index)&&void 0!==i?i:100};f(!0),y.fk.createLesson(t,n,r,a,null===o||void 0===o?void 0:o.id).then((e=>{let{lesson:t}=e;h(!1),o?(c(t),_("Success","Lesson updated",A.success)):(s(t),_("Success","Lesson created successfully",A.success))})).catch((e=>{let{errors:t}=e;null!==t&&void 0!==t&&t.name&&Array.isArray(t.name)&&k({name:t.name[0]}),_("Error","Unable to create lesson",A.danger),console.log(t)})).finally((()=>{f(!1)}))};return(0,g.jsx)(g.Fragment,{children:p?(0,g.jsxs)("div",{className:"w-full",children:[(0,g.jsxs)("form",{onSubmit:S,ref:C,className:"flex w-full items-center space-x-2",children:[(0,g.jsx)(l.ks,{placeholder:"Add lesson",defaultValue:w,onChange:e=>{x(e),k({})},noMargin:!0,required:!0,containerClassName:"border border-primary rounded flex-grow"}),(0,g.jsx)(d.A,{className:"flex-grow-0",onClick:S,label:o?"Update":"Add",isLoading:m})]}),(0,g.jsx)(l.jQ,{error:b.title})]}):(0,g.jsxs)("div",{className:"hover:theme-border-subtitle-2 flex h-8 w-full cursor-pointer items-center space-x-2 rounded border border-dashed border-transparent px-2 hover:bg-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!0)},children:[(0,g.jsx)(v.A,{icon:"plus",size:"xs"}),(0,g.jsx)("p",{children:"Add lesson"})]})})}},15902:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(20975),o=n(9175),i=n(51772),s=n(68150),a=n(53871),l=n(43039),c=n(62391);const d=r.lazy((()=>n.e(636).then(n.bind(n,25636))));function u(e){let{community:t,course:n,setCourse:u=(()=>{}),section:p,setVisible:h=(()=>{})}=e;const[m,f]=(0,r.useState)((null===p||void 0===p?void 0:p.name)||void 0),[g,b]=(0,r.useState)((null===p||void 0===p?void 0:p.emoji)||"#"),[v,y]=(0,r.useState)({}),[k,w]=(0,r.useState)(!1),[x,_]=(0,r.useState)(!1),{addToast:A,ToastTypes:C}=(0,o.d)(),S=e=>{if(e.preventDefault(),!n)return void console.error("Course is not available");if(!m||0===m.length)return void y({name:"Section name is required"});const r={name:m,emoji:g};w(!0),l.fk.createSection(t.id,n.id,r,null===p||void 0===p?void 0:p.id).then((e=>{let{section:t}=e;if(p){t={...t,lessons:p.lessons};const e=n.sections.map((e=>e.id===t.id?t:e));u({...n,sections:e}),A("Section created successfully")}else t={...t,lessons:[]},u({...n,sections:[...n.sections,t]}),A("Section updated successfully")})).catch((e=>{var t,n;const r=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.errors;r&&null!==r&&void 0!==r&&r.name&&Array.isArray(r.name)?y({name:r.name[0]}):console.log(e),A("Unable to create section","Please try again in some time!!",C.danger)})).finally((()=>{w(!1)}))};return(0,c.jsx)("div",{className:"min-w-full max-w-lg",children:(0,c.jsxs)("div",{id:"content-4a",className:"flex flex-col space-y-12",children:[(0,c.jsxs)("form",{className:"flex flex-col space-y-2",onSubmit:S,children:[(0,c.jsx)("h3",{className:"after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,c.jsx)(a.A,{children:"Section Name"})}),(0,c.jsx)(i.ks,{placeholder:"Enter section name",className:"bg-background",containerClassName:"bg-background",required:!0,prefix:(0,c.jsx)("div",{className:"bg-background px-2",children:(0,c.jsx)(s.A,{alignment:"left-1",button:(0,c.jsx)("span",{onClick:()=>_(!0),className:"h-6 bg-background p-1 hover:scale-110",children:g||"#"}),children:x&&(0,c.jsx)(r.Suspense,{fallback:(0,c.jsx)(c.Fragment,{}),children:(0,c.jsx)(d,{onEmojiClick:(e,t)=>{b(e.emoji),_(!1)}})})})}),defaultValue:m,onChange:e=>{f(e),y({...v,name:""})},large:!0,noMargin:!0}),(0,c.jsx)(i.jQ,{error:v.name})]}),(0,c.jsxs)("div",{className:"flex place-content-between",children:[(0,c.jsx)(i.$n,{label:"Cancel",flat:!0,onClick:e=>{e.preventDefault(),h(!1)}}),(0,c.jsx)(i.$n,{label:p?"Update":"Create",onClick:S,disabled:v.name||v.description,isLoading:k})]})]})})}},53484:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COURSE_VIEW_PAGE_ROUTE:()=>H,LessonState:()=>q,createLessonViewPageRoute:()=>W,default:()=>Q});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(77826),l=n(98020),c=n(82993),d=n(9175),u=n(51772),p=n(63360),h=n(25968),m=n(1689),f=n(58157),g=n(29646),b=n(86129),v=n(61649),y=n(84003),k=n(70326),w=n(62144),x=n(78220),_=n(43039),A=n(36357),C=n(97843),S=n(21784),j=n(4252),E=n(15902),N=n(62391);function P(e){let{children:t,rightSidebar:n,leftSidebar:r,visible:i=!0}=e;return(0,N.jsx)("div",{style:{zIndex:1},className:o()("relative hidden w-72",{"lg:block":r&&i,"xl:block":n&&i}),children:(0,N.jsx)("div",{className:"fixed bottom-[10px] top-[75px] w-72 overflow-y-auto rounded bg-card",children:t})})}function D(e){let{children:t}=e;return(0,N.jsx)("div",{className:"mt-5 flex max-w-[740px] flex-1",children:(0,N.jsx)("div",{className:"w-full lg:px-2",children:t})})}const M=e=>{let{children:t}=e;return(0,N.jsx)("div",{className:"fixed left-0 right-0 top-0 z-0 h-[54px] bg-card",children:(0,N.jsx)("div",{className:"flex h-full items-center",children:(0,N.jsx)("div",{className:"mx-auto w-full max-w-[1340px] px-2",children:t})})})};function T(e){let{children:t,className:n}=e;return(0,N.jsx)("footer",{className:o()("fixed bottom-0 left-0 right-0 z-0 h-[54px] shadow-2xl",n),children:(0,N.jsx)("div",{className:"mx-auto flex h-full w-full max-w-[1040px] items-center px-2 lg:px-2",children:(0,N.jsx)("div",{className:"flex h-full w-full place-content-between items-center border-t border-border bg-card px-4 shadow-2xl",children:t})})})}var I=n(34067),O=n(71214),L=n(53871),R=n(69302),B=n(91341),z=n(60478);n(90663);n(13362);const F=i.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),U=new O.A;function V(e){let{community:t,course:n,section:r,lesson:s,updateSection:a,isLoading:l}=e;const{addToast:c,ToastTypes:h}=(0,d.d)(),[m,g]=(0,i.useState)(!1),[b,y]=(0,i.useState)(!1),[k,x]=(0,i.useState)(0),[A,S]=(0,i.useState)(),[j,E]=(0,i.useState)(),[P,D]=(0,i.useState)(),[M,T]=(0,i.useState)(),[O,V]=(0,i.useState)(),[G,H]=(0,i.useState)(""),W=(null===s||void 0===s?void 0:s.state)===q.published;(0,i.useEffect)((()=>{s.coverMedia?(V(s.coverMedia),E(s.coverMedia)):(V(null),E(null));const e=new I.F;H(e.render(s.description)),D(null),S(null)}),[s]);const K=e=>{const o=function(e){if(!e)return"";const t=e.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");return U.turndown(t)}(e);g(!0);const i={...s,description:o};_.fk.createLesson(t.id,n.id,r.id,i,s.id).then((async e=>{let{lesson:o}=e;await async function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{};P?_.fk.uploadLessonCoverMedia(t.id,n.id,r.id,e.id,P,(e=>{x(e)})).then((e=>{let{lesson:t}=e;o(t)})).catch((e=>{console.error(e),c("Error","Lesson cover media could not be uploaded!",h.danger)})).then((()=>{x(0)})):e.coverMedia&&null==O?_.fk.uploadLessonCoverMedia(t.id,n.id,r.id,e.id,void 0,(e=>{x(e)})).then((e=>{let{lesson:t}=e;o(t)})).catch((e=>{console.error(e),c("Error","Lesson cover media could not be uploaded!",h.danger)})).then((()=>{x(0)})):o(e)}(o,(e=>{Y(e),c("Success","Lesson updated successfully!",h.success)}))})).catch((e=>{console.error(e),c("Error","Lesson could not be updated!",h.danger)})).then((()=>{g(!1)}))};function Y(e){if(e)if(r){const t=r.lessons.map((t=>t.id===e.id?e:t));a({...r,lessons:t})}else console.error("Section is not defined");else console.error("Lesson is not defined")}return l?(0,N.jsx)("div",{className:"h-full flex-col space-y-2 rounded bg-card px-4 py-2",children:(0,N.jsx)(u.aH,{})}):C.A.hasValue(s)?(0,N.jsxs)("div",{className:"flex h-full flex-col space-y-2 rounded bg-card px-4 py-2",children:[(0,N.jsxs)("div",{className:"flex place-content-between items-center",children:[(0,N.jsx)(B.A,{size:"h3",variant:"t2",children:s.title}),(0,N.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,N.jsx)(f.A,{label:"Save",isLoading:m,onClick:e=>{K(G)}}),!W&&(0,N.jsx)(u.$n,{label:"Publish",flat:!0,onClick:e=>{y(!0);const o={...s,state:W?q.draft:q.published};_.fk.createLesson(t.id,n.id,r.id,o,s.id).then((e=>{let{lesson:t}=e;Y(t),c("Success","Lesson published successfully!",h.success)})).catch((e=>{console.error(e),c("Error","Lesson could not be published!",h.danger)})).then((()=>{y(!1)}))},isLoading:b})]})]}),(0,N.jsx)($,{}),(0,N.jsx)(i.Suspense,{fallback:(0,N.jsx)(N.Fragment,{}),children:(0,N.jsx)(F,{className:"noBorder maxHeightInfinite w-full px-2",text:G,placeholder:"Write lesson details here ...",setText:H})})]}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(v.A,{error:!0,title:"No lesson found",message:"Please select a lesson from the left panel.",className:"bg-card"})});function $(){return(0,N.jsxs)("div",{className:"z-0 flex flex-col",children:[(0,N.jsx)("div",{className:"w-full",children:P?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"flex max-h-80 w-full flex-col items-center justify-center rounded bg-background",children:k&&k>0?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("div",{className:"flex h-64 flex-col place-content-center items-center",children:(0,N.jsxs)("p",{children:["Uploading video ",k,"%"]})})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("video",{className:"max-h-80 w-full cursor-pointer",controls:!0,src:URL.createObjectURL(P),controlsList:"nodownload"})})}),(0,N.jsxs)("div",{className:"mt-2 flex h-12 w-full place-content-between items-center space-x-1 rounded border bg-background px-2",children:[(0,N.jsx)("div",{className:"flex items-center",children:(0,N.jsxs)("div",{className:"flex items-center space-x-2 text-secondary-foreground/80",children:[(0,N.jsx)(w.A,{icon:"play-alt",className:"mt-1"}),(0,N.jsx)("p",{className:"word-breaker",children:P.name}),(0,N.jsxs)("p",{className:"theme-bg-disable word-breaker rounded border px-1 text-secondary-foreground/80",children:[Math.round(P.size/1024/1024*10)/10," MB"]})]})}),(0,N.jsx)(p.J,{hoverable:!0,className:"bg-primary-light",type:"primary",onClick:e=>{D(null)}})]})]}):O?(0,N.jsxs)("div",{className:"group relative z-0 mt-4 w-full",children:[(0,N.jsx)("video",{className:"max-h-80 w-full cursor-pointer rounded bg-background",controls:!0,controlsList:"nodownload",src:O}),(0,N.jsx)("div",{className:"absolute -right-4 -top-4 opacity-0 transition-opacity duration-150 ease-linear group-hover:opacity-100",children:(0,N.jsx)(p.J,{hoverable:!0,type:"primary",className:"bg-primary-light",onClick:e=>{V(null)}})})]}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(R.z,{accept:"video/*",onChange:e=>{D(e)},children:(0,N.jsx)("div",{style:{aspectRatio:16/9},className:o()("z-0 flex h-[204px] place-content-center items-center rounded","theme-border-subtitle-2 border border-dashed","text-smg text-secondary-foreground/70","mx-auto lg:w-3/5"),children:(0,N.jsx)(L.A,{children:"Upload video lecture"})})})})}),(0,N.jsx)(z.A,{percentComplete:k})]})}}function G(e){let{lesson:t,isLoading:n}=e;const[r,o]=(0,i.useState)(),[s,a]=(0,i.useState)("");return(0,i.useEffect)((()=>{if(t.coverMedia?o(t.coverMedia):o(null),t.description){const e=new I.F,n=(0,u.Wv)(t.description),r=e.render(n),o=(0,u.pD)(null!==r&&void 0!==r?r:"");a(null!==o&&void 0!==o?o:"")}}),[t]),n?(0,N.jsxs)("div",{className:"h-(calc(100%-900px)) flex animate-pulse flex-col place-content-center gap-3 rounded bg-card p-4 py-2 pt-4",children:[(0,N.jsx)("div",{className:"flex place-content-between items-center",children:(0,N.jsx)("div",{className:"h-8 w-5/12 bg-background"})}),(0,N.jsx)("div",{className:"mt-4 h-32 w-7/12 bg-background"}),(0,N.jsx)("div",{className:"h-96 bg-background"}),(0,N.jsx)("div",{className:"bg-background"})]}):t&&0!==Object.keys(t).length?(0,N.jsxs)("div",{className:"flex h-full flex-col space-y-2 rounded bg-card px-4 py-2",children:[(0,N.jsx)("div",{className:"flex place-content-between items-center",children:(0,N.jsx)(B.A,{size:"h3",variant:"t2",children:t.title})}),(0,N.jsx)("div",{className:"flex flex-col",children:(0,N.jsx)("div",{className:"w-full",children:r?(0,N.jsx)("div",{className:"group mt-4 h-80 w-full",children:(0,N.jsx)("video",{className:"aspect-video h-full w-full cursor-pointer rounded bg-background",controls:!0,src:r,controlsList:"nodownload"})}):(0,N.jsx)(N.Fragment,{})})}),(0,N.jsx)("div",{className:"NL2BR headings",dangerouslySetInnerHTML:{__html:s}})]}):(0,N.jsx)(v.A,{error:!0,title:"No lesson found",message:"Please select a lesson from the left panel.",className:"bg-card"})}const H="/course/view/:id";function W(e,t,n){return e&&t&&n?"/course/view/".concat(e,"?section=").concat(t,"&lesson=").concat(n):e&&t?"/course/view/".concat(e,"?section=").concat(t):"/course/view/".concat(e)}const q=Object.freeze({published:"published",draft:"draft"});function K(e){let{community:t,course:n,sectionId:r,lesson:s,onLessonUpdate:l}=e;const[c,p]=(0,i.useState)(!1),[h,m]=(0,i.useState)({}),[f,g]=(0,i.useState)({}),[b,v]=(0,i.useState)({}),[y,k]=(0,i.useState)({}),[A,S]=(0,i.useState)(!1),[j,E]=(0,i.useState)(!1),{addToast:P,ToastTypes:D}=(0,d.d)();return(0,i.useEffect)((()=>{if(!C.A.hasValue(n)||!C.A.hasValue(n.sections))return;const e=s&&s.id,t=n.sections.find((e=>e.id===r));if(t){const r=t.lessons.find((t=>t.id===e));if(r){const e=t.lessons.indexOf(r),o=n.sections.indexOf(t);e0?(E(!0),v(t),k(t.lessons[e-1])):o>0?(E(!0),v(n.sections[o-1]),k(n.sections[o-1].lessons[n.sections[o-1].lessons.length-1])):E(!1)}}}),[n,r,s]),(0,i.useEffect)((()=>{if(C.A.hasValue(n))return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)};function e(e){"ArrowRight"===e.key?A&&x.b6.push(W(n.id,h.id,f.id)):"ArrowLeft"===e.key&&j&&x.b6.push(W(n.id,b.id,y.id))}}),[A,j,n,h,f,b,y]),C.A.hasValue(n)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"flex place-content-center items-center gap-2",children:[(0,N.jsx)(M,{icon:"angle-left",prevButton:!0,to:W(null===n||void 0===n?void 0:n.id,null===b||void 0===b?void 0:b.id,null===y||void 0===y?void 0:y.id)}),(0,N.jsx)(M,{icon:"angle-right",nextButton:!0,to:W(n.id,null===h||void 0===h?void 0:h.id,null===f||void 0===f?void 0:f.id)})]}),(0,N.jsx)(u.$n,{label:s&&s.isCompleted?"Mark incomplete":"Mark Complete",isLoading:c,outlined:s.isCompleted,onClick:()=>{s?(p(!0),c||(s.isCompleted?_.fk.markLessonInComplete(t.id,n.id,r,s.id).then((e=>{let{lesson:t}=e;l({...t,isCompleted:!1}),P("Success","Lesson marked as incomplete",D.success)})).catch((e=>{let{response:t}=e;console.error(t),P("Error","Unable to mark lesson as incomplete",D.danger)})).finally((()=>{p(!1)})):_.fk.markLessonComplete(t.id,n.id,r,s.id).then((e=>{let{lesson:t}=e;l({...t,isCompleted:!0}),P("Success","Lesson marked as complete",D.success)})).catch((e=>{let{response:t}=e;console.error(t),P("Error","Unable to mark lesson as complete",D.danger)})).finally((()=>{p(!1)})))):console.error("No lesson found")}})]}):(0,N.jsx)("div",{});function M(e){let{icon:t,to:n,nextButton:r,prevButton:i}=e;return(0,N.jsx)(a.N_,{to:n,className:o()("flex h-8 w-8 place-content-center items-center rounded border border-primary p-4","hover:shadow-xl",{"cursor-not-allowed opacity-30":!A&&r},{"cursor-not-allowed opacity-30":!j&&i}),children:(0,N.jsx)(w.A,{icon:t,size:"",className:"h-5 text-primary"})})}}function Y(e){let{community:t,course:n,isLoading:r,setCourse:o,onLessonDelete:s=(()=>{}),hasWritePermission:a}=e;const[l,c]=i.useState(!1);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("div",{className:"flex flex-col space-y-2 bg-card p-1",children:[(0,N.jsx)(y.u,{items:null===n||void 0===n?void 0:n.sections,loading:r,placeholder:(0,N.jsxs)("div",{className:"flex flex-col gap-2 overflow-y-auto py-4 pl-2",children:[(0,N.jsx)("div",{className:"w-10/12",children:(0,N.jsx)(k.A,{})}),(0,N.jsx)(k.A,{})]}),noItemsElement:a?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(v.A,{warning:!0,title:"No content added",message:"Start adding section by clicking on below button"})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(v.A,{warning:!0,title:"No content available",message:"Looks like course author has not added any content yet."})}),renderItem:(e,r)=>(0,N.jsx)(S.A,{course:n,setCourse:o,onSectionUpdate:e=>{const t=n.sections;t[r]=e,o({...n,sections:t})},onSectionDelete:e=>{const t=n.sections.filter((t=>t.id!==e.id));o({...n,sections:t})},onLessonDelete:e=>{const t=n.sections;t[r].lessons=t[r].lessons.filter((t=>t.id!==e.id)),o({...n,sections:t}),s(e)},onLessonAdded:e=>{var t;const i=n.sections,s=null!==(t=i[r].lessons)&&void 0!==t?t:[];s.push(e),i[r].lessons=s,o({...n,sections:i})},section:e,community:t,hasWritePermission:a,className:"bg-card"},e.id)}),a&&(0,N.jsx)(b.A,{title:"Add new section",className:"w-full sm:w-2/3 md:w-2/4 lg:w-1/3",visible:l,setVisible:c,button:(0,N.jsx)(f.A,{label:"Add section",className:"mx-2 w-11/12 outline-dashed outline-1",onClick:()=>c(!0)}),children:(0,N.jsx)(E.A,{community:t,course:n,setCourse:e=>{o(e),c(!1)},setVisible:c})})]})})}function $(e){let{course:t}=e;return(0,N.jsx)("div",{className:"mx-auto flex h-screen w-full max-w-3xl flex-col items-center",children:(0,N.jsxs)("div",{className:"mt-20 flex flex-col items-center justify-center gap-4",children:[(0,N.jsxs)("div",{className:"rounded border border-border bg-card",children:[(0,N.jsx)("div",{className:"w-full max-w-3xl bg-primary object-cover",style:{backgroundColor:"var(--theme-primary-light-color)",aspectRatio:"16/6"},children:null!==t&&void 0!==t&&t.banner?(0,N.jsx)(m.A,{src:null===t||void 0===t?void 0:t.banner,className:"rounded-t",alt:"banner"}):(0,N.jsx)("div",{className:"w-full"})}),(0,N.jsx)("div",{className:"flex flex-col space-y-2 p-2",children:(0,N.jsx)("h3",{className:"font-semibold text-secondary-foreground",children:t.title})})]}),(0,N.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4",children:[(0,N.jsx)("p",{className:"text-center",children:"You need to join the course to view the content."}),(0,N.jsx)(a.N_,{to:"/course/".concat(null===t||void 0===t?void 0:t.id),className:"rounded-full bg-background px-4 py-2",children:"Join Course"})]})]})})}const Q=(0,l.y)((0,s.Ng)((e=>({community:e.community})),(e=>(0,c.zH)({},e)))((function(e){let{community:t,location:n}=e;const r=new URLSearchParams(n.search),s=r.get("section"),l=r.get("lesson"),c=window.location.pathname.split("/").filter((e=>""!==e));let u;Array.isArray(c)&&c.length>1&&(u=c[2]);const[m,f]=(0,i.useState)(!1),[b,v]=(0,i.useState)(),[y,k]=(0,i.useState)({}),[x,S]=(0,i.useState)({}),[E,I]=(0,i.useState)(!1),[O,L]=(0,i.useState)(!0),[R,B]=(0,i.useState)(!1),[z,F]=(0,i.useState)(!0),{addToast:U,ToastTypes:H}=(0,d.d)();function q(e){if(e.sections&&e.sections.length>0){const t=e.sections.find((e=>e.id===s));if(t&&(k(t),t&&t.lessons&&t.lessons.length>0)){const e=t.lessons.find((e=>e.id===l));e&&S(e)}}}function Q(e){if(!e)return void console.error("Section is not defined");const t=b.sections.map((t=>t.id===e.id?e:t));v({...b,sections:t}),q({...b,sections:t})}return(0,i.useEffect)((()=>{l&&s&&b&&q(b)}),[l,s]),(0,i.useEffect)((()=>{u&&(B(!0),_.fk.getCourseDetails(t.id,u).then((e=>{let{course:t,isAdmin:n}=e;!n&&C.A.hasValue(t.sections)&&(t.sections=t.sections.filter((e=>e.lessons&&e.lessons.length>0))),v(t),q(t),I(n),n&&L(!1)})).catch((e=>{console.error(e),U("Error","Course could not be fetched!",H.danger)})).finally((()=>{B(!1)})))}),[u]),b&&b.state===j.CourseStateType["closed-free"]&&!E&&(null===b||void 0===b?void 0:b.joinStatus)!==(null===j.CourseJoinStatus||void 0===j.CourseJoinStatus?void 0:j.CourseJoinStatus.joined)?(0,N.jsx)($,{course:b}):(0,N.jsxs)(h.l,{layout:"one-column",children:[(0,N.jsxs)(P,{leftSidebar:!0,visible:z,children:[(0,N.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-3 shadow",children:[(0,N.jsx)(w.A,{icon:"list"}),(0,N.jsx)("h2",{className:"flex-1 text-base font-bold",children:"Table of Content"})]}),(0,N.jsx)(Y,{community:t,course:b,isLoading:R,setCourse:v,hasWritePermission:E,onLessonDelete:e=>{x&&e.id===x.id&&(window.location.href=W(b.id,y.id))}})]}),(0,N.jsxs)("div",{className:"min-h-[100vh]",children:[(0,N.jsx)(M,{children:(0,N.jsxs)("div",{className:"flex items-center gap-2 text-xl font-bold text-secondary-foreground",children:[(0,N.jsx)(a.N_,{to:"/course",children:(0,N.jsx)(p.J,{})}),(0,N.jsx)("h1",{className:"word-breaker flex-1",children:b&&b.title}),(0,N.jsx)(g.A,{label:"Toggle sidebar",align:"bottom",className:"hidden rounded p-2 hover:bg-background lg:block",children:(0,N.jsx)("div",{className:"flex h-4 w-4 cursor-pointer rounded-[2px] border border-secondary-foreground",onClick:()=>{F(!z)},children:(0,N.jsx)("div",{className:o()("w-[5px] border-r border-secondary-foreground",{"theme-bg-heading-1":z,"":!z})})})})]})}),(0,N.jsx)("main",{className:"CourseViewPage mt-[55px] flex h-[calc(100%-84px)] place-content-center px-2 pb-[100px] lg:px-6 xl:px-2",children:(0,N.jsx)(D,{children:(0,N.jsx)(A.av,{value:O,ifPresent:()=>(0,N.jsx)(G,{isLoading:R,community:t,course:b,setCourse:v,section:y,lesson:x,hasWritePermission:E,updateSection:Q}),ifAbsent:()=>(0,N.jsx)(V,{community:t,isLoading:R,course:b,setCourse:v,section:y,lesson:x,hasWritePermission:E,updateSection:Q})})})}),(0,N.jsx)(T,{className:o()("",{hidden:E||!C.A.hasValue(b)}),children:!E&&(0,N.jsx)(K,{community:t,course:b,sectionId:s,lesson:x,onLessonUpdate:e=>{!function(e,t){if(!e)return void console.error("Lesson is not defined");const n=b.sections.find((e=>e.id===t));if(n){const t=n.lessons.map((t=>t.id===e.id?e:t));Q({...n,lessons:t})}}(e,s)}})})]})]})})))},93274:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(20975),o=n(65186),i=n(9175),s=n(51772),a=n(53871),l=n(54859),c=n(60478),d=n(43039),u=n(62391);function p(e){let{course:t,community:n,setVisible:p=(()=>{}),onCourseCreated:h=(e=>{}),onCourseUpdated:m=(e=>{})}=e;const{analyticsService:f}=(0,o.W)(),[g,b]=(0,r.useState)((null===t||void 0===t?void 0:t.title)||void 0),[v,y]=(0,r.useState)({}),[k,w]=(0,r.useState)(!1),{addToast:x,ToastTypes:_}=(0,i.d)(),[A,C]=(0,r.useState)((null===t||void 0===t?void 0:t.banner)||void 0),[S,j]=(0,r.useState)(0),[E,N]=(0,r.useState)(!1),P=e=>{if(e.preventDefault(),!g||0===g.length)return void y({title:"Course title is required"});const r={title:g};w(!0),console.log("payload",r),d.fk.createCourse(n.id,r,null===t||void 0===t?void 0:t.id).then((async e=>{let{course:n}=e;t?(await D(n,(e=>m(e))),x("Course updated successfully")):(await D(n,(e=>h(e))),x("Course created successfully"))})).catch((e=>{var t;null!==e&&void 0!==e&&null!==(t=e.errors)&&void 0!==t&&t.title&&Array.isArray(e.errors.title)&&y({title:e.errors.title[0]}),x("Error creating course","",_.danger),console.log(e)})).finally((()=>{w(!1)}))};async function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{};A&&"string"!==typeof A||E?d.fk.uploadCourseBanner(n.id,e.id,A,(e=>{j(e)})).then((e=>{let{course:n}=e;t(n)})).catch((e=>{let{errors:t}=e;x("Error","Unable to upload banner",_.danger),console.log(t)})):t(e)}return(0,u.jsx)("div",{className:"min-w-full max-w-lg",children:(0,u.jsxs)("div",{id:"content-4a",className:"flex flex-col space-y-12",children:[(0,u.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,u.jsx)(l.A,{picture:A,setPicture:C,aspectRatio:16/6,recommendedRatio:"16:6",setIsPictureRemoved:N,cropRatioMessage:"Picture ratio: 16:6",displayUnsplashSearch:!0,initialPhotoSearchQuery:"Course"}),(0,u.jsx)(c.A,{percentComplete:S}),(0,u.jsxs)("form",{onSubmit:P,className:"flex flex-col space-y-1",children:[(0,u.jsx)("h3",{className:"pt-5 after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,u.jsx)(a.A,{children:"Course Name"})}),(0,u.jsx)(s.ks,{placeholder:"Enter course name",className:"bg-background",containerClassName:"bg-background",defaultValue:g,required:!0,onChange:e=>{b(e),e.length>60?y({...v,title:"Course title should be less then 80 characters"}):y({...v,title:""})},large:!0,noMargin:!0}),(0,u.jsx)(s.jQ,{error:v.title})]})]}),(0,u.jsxs)("div",{className:"flex place-content-between",children:[(0,u.jsx)(s.$n,{label:"Cancel",flat:!0,onClick:e=>{e.preventDefault(),p(!1)}}),(0,u.jsx)(s.$n,{label:t?"Update":"Create",onClick:e=>{f.track("new-course-created"),P(e)},disabled:v.title||v.description,isLoading:k})]})]})})}},7058:(e,t,n)=>{"use strict";n.d(t,{A:()=>z});var r=n(20975),o=n(31305),i=n(77826),s=n(82993),a=n(89449),l=n(16478),c=n(55049),d=n(9175),u=n(63360),p=n(74645),h=n(8934),m=n(19328),f=n(5564),g=n.n(f),b=n(71214),v=n(65186),y=n(34268),k=n(24881),w=n(53871),x=n(29646),_=n(69302),A=n(43532),C=n(16120),S=n(68108),j=n(62144),E=n(55267),N=n(62391);const P=r.lazy((()=>Promise.resolve().then(n.bind(n,94503)))),D=new b.A;const M=(0,a.wj)((0,o.Ng)((e=>({user:e.auth,community:e.community})))((function(e){let{groupId:t=null,group:n=null,tabId:o=null,parentMessage:i=null,user:s,community:a,otherUserId:l=null,addPost:c=(e=>{}),addToast:d,attachments:u=[],setAttachments:p=null,smoothScrollToBottom:h=(()=>{})}=e;const[m,f]=(0,r.useState)(!1),{analyticsService:b}=(0,v.W)();(0,r.useEffect)((()=>{const e=document.createElement("style");return e.appendChild(document.createTextNode("\n .ck.ck-balloon-panel.ck-balloon-panel_toolbar_west.ck-balloon-panel_visible {\n display: none;\n }\n")),document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]);const[M,T]=(0,r.useState)(""),[I,O]=(0,r.useState)(!1),[L,R]=(0,r.useState)(null),B=async e=>{try{const n=await M.replace(/(?:
^\[^\]]+)(?:"><\/oembed><\/figure>)/g," $1 ");const r={description:await D.turndown(n),groupId:t,tabId:o,attachments:u,parentId:null===i||void 0===i?void 0:i.id},a=function(e){const t={};e.description||e.attachments.length||(t.description="Description is required!");if(0===Object.keys(t).length)return null;return t}(r);if(R(a),!a&&M&&M.trim().length>0){f(!0);let t=l?await k.b.sendDirectMessage(s,r.description,l):await k.b.sendMessage(s,r);c(t.message),T(""),e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px",f(!1)}}catch(n){f(!1),console.log({error:n})}try{if(u.length){f(!0);const e=l?await k.b.uploadDirectAttachments(s,u,l):await k.b.uploadAttachments(s,{groupId:t,tabId:o,parentId:null===i||void 0===i?void 0:i.id},u);c(e.message),f(!1),p([])}}catch(n){f(!1),console.log({error:n})}b.track("send-dm")};let z=M.split("\n").length;z=z>0?z:1;const F=()=>(0,N.jsx)(A.J,{onClick:B,disabled:!M,isLoading:m,className:"disabled:bg-secondary-foreground/20 disabled:text-secondary-foreground/70"});return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("div",{className:"RealtimeCreatePostCard rounded bg-card px-4 py-2",children:[(0,N.jsx)("div",{className:"px-4",children:(0,N.jsx)(E.Cj,{message:{attachments:u},removeAttachment:e=>{p&&p(u.filter(((t,n)=>n!==e)))}})}),(0,N.jsxs)("div",{className:g()("flex flex-row items-center rounded border border-border bg-background px-2"),children:[(0,N.jsxs)("div",{className:"Toolbar flex items-center gap-4",children:[(0,N.jsx)(x.A,{label:"Attachment",children:(0,N.jsx)(_.z,{accept:"*",disabled:u.length>3,onChange:e=>{p([...u,e])},children:(0,N.jsx)("div",{className:g()("cursor-pointe theme-bg-disable ml-1 flex h-6 w-6 place-content-center items-center rounded-full text-secondary-foreground/85 hover:scale-110",{"cursor-not-allowed text-secondary-foreground/70":u.length>3}),children:(0,N.jsx)(j.A,{size:"xs",icon:"plus"})})})}),(0,N.jsx)(x.A,{label:"Gif",className:!O&&"hidden",children:(0,N.jsx)("button",{className:"p-.05 hover:scale-110",onClick:()=>{O(!I)},children:(0,N.jsx)("span",{className:"rounded border border-secondary-foreground px-2 text-xs",children:(0,N.jsx)(w.A,{children:"Gif"})})})}),(0,N.jsx)(C.A,{openPortal:I,children:(0,N.jsx)(S.A,{active:I,setActive:O,initialSearchQuery:"",onGifSelect:async e=>{O(!1),p([e.blobData])}})})]}),(0,N.jsx)(r.Suspense,{fallback:(0,N.jsx)("div",{className:"h-14 w-full rounded border border-border px-2"}),children:(0,N.jsx)(P,{className:"noBorder minHeightDefault w-full max-w-[70vh] overflow-y-auto px-2",text:M,setText:T,onSubmit:B,placeholder:"Write here...",getMentionsFeed:async e=>{const t=(await y.w.searchInCommunity(s,a.id,e)).users.map(((e,t)=>{const n=e.id;return e.id="@"+e.userId,e.userId=n,e}));return t}})}),(0,N.jsx)(F,{})]})]})})})));var T=n(42017),I=n(24608),O=n(41374),L=n(88614),R=n(35964);function B(){const e=document.getElementById("direct-chat-page");e&&(e.scrollTop=e.scrollHeight)}const z=(0,o.Ng)((e=>({user:e.auth,socket:e.socket,isDirectChatListInitialLoadComplete:e.directMessages.isInitialLoadComplete,userCounters:e.notifications})),(e=>(0,s.zH)({markChatAsRead:O.uF,addChatIfNeeded:O.Mj},e)))((function(e){let{user:t=null,socket:n=null,isDirectChatListInitialLoadComplete:o=!1,markChatAsRead:s,addChatIfNeeded:f,userCounters:g,userId:b}=e;const[v,y]=(0,r.useState)(!1),{DirectMessageModelState:w,messageListModelState:x}=(0,c.A)();(0,r.useEffect)((()=>{const e=()=>{y(window.innerWidth<1201)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const{addToast:_}=(0,d.d)(),A=(0,l.j)(),[C,S]=(0,r.useState)([]),[j,P]=(0,r.useState)(!1),[D,O]=(0,r.useState)([]),[z,F]=(0,r.useState)(!1),[U,V]=(0,r.useState)(!1),[G,H]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(A((0,L.dA)(g.unreadNotificationsCount,0,g.unreadSectionNotificationsCount)),n){const e=e=>{console.log("Socket: message received listener called!",e),e.message.createdBy=e.message.sender,e.message.description=e.message.message,S([...C,e.message]),B(),k.b.markAllMessagesInChatAsRead(t,b).then((()=>{s({id:b}),A((0,L.dA)(g.unreadNotificationsCount,0,g.unreadSectionNotificationsCount)),console.log("calling mark chat as read",{id:b})})).catch((e=>{console.log("could not mark user chat as read",e)}))},r=e=>{const t=C.filter((t=>t.id!==e.messageId));S(t)},o=e=>{console.log("Socket: message edited listener called!",e);const t=[...C],n=t.findIndex((t=>t.id===e.message.id));n>-1&&(t[n]=e.message,t[n].createdBy=e.message.sender,t[n].description=e.message.message,console.log({newMessages:t}),S(t),B())};return n.on("direct-message:".concat(b,":message-received"),e),n.on("direct-message:".concat(b,":message-deleted"),r),n.on("direct-message:".concat(b,":message-edited"),o),()=>{n.off("direct-message:".concat(b,":message-received"),e)}}}),[n,b,C]),(0,r.useEffect)((()=>{b&&(P(!0),k.b.getUserChatTimestampPaginated(t,b).then((e=>{let{messages:t,otherUser:n}=e;S(t.map((e=>(e.createdBy=e.sender,e.description=e.message,e))).reverse()),s({id:b}),F(n),P(!1),t.length<10&&H(!0),B()})).catch((e=>{console.log({error:e}),P(!1),_("Messages Could not be loaded!","",a.lm.danger)})))}),[t,b]),(0,r.useEffect)((()=>{z&&o&&f(z)}),[z,o]),j?(0,N.jsx)(I.A,{length:6}):(0,N.jsxs)("div",{children:[(0,N.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card px-4 py-2",children:[(0,N.jsx)("span",{className:"flex items-center gap-2 font-bold",children:(0,N.jsxs)("div",{className:"group flex cursor-pointer flex-row items-center gap-1 font-semibold",onClick:()=>{x.setShowMessageListModel(!0),w.setIdToViewMessage(""),w.setShowDirectMessageModel(!1)},children:[(0,N.jsx)(p.K,{className:"transition-all group-hover:-translate-x-1"}),z&&(0,N.jsx)(i.N_,{to:(0,R.mB)(z.id),className:"font-semibold text-secondary-foreground",children:(0,N.jsx)(h.eu,{user:z,size:24,textClassName:"hover:text-primary-foreground"})})]})}),(0,N.jsx)(u.J,{onClick:()=>w.setShowDirectMessageModel(!1),type:"primary"})]}),(0,N.jsxs)("div",{id:"direct-chat-page",className:"relative flex h-[calc(100vh-110px)] flex-col overflow-y-auto rounded border border-border bg-card pt-14",children:[U?(0,N.jsx)("div",{className:"m-3 flex justify-center",children:(0,N.jsx)(m.a,{})}):G?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)("div",{className:"m-3 flex justify-center",children:(0,N.jsx)("button",{onClick:()=>{U||G||(V(!0),k.b.getUserChatTimestampPaginated(t,b,C.length>0?C[0].id:null).then((e=>{0===e.message.length?H(!0):(e.messages.length<10&&H(!0),S([...e.messages.map((e=>(e.createdBy=e.sender,e.description=e.message,e))).reverse(),...C])),V(!1)})))},className:"rounded-xl border border-border px-4 py-1 text-secondary-foreground/85",children:"Load more"})}),j||0!==C.length?j?(0,N.jsx)("div",{className:"my-10 flex flex-grow justify-center",children:(0,N.jsx)(m.a,{})}):(0,N.jsx)("div",{className:"flex flex-grow flex-col justify-end pb-14",children:(0,N.jsx)(T.g,{messages:C,setMessages:e=>{S(e)},updateMessage:e=>{const t=C.findIndex((t=>t.id===e.id)),n=[...C];e.description=e.message,e.createdBy=e.sender,n.splice(t,1,e),S(n)},deleteMessage:e=>k.b.deleteDirectMessage(t,e).then((e=>{let{message:t}=e;const n=C.filter((e=>e.id!==t.id));S(n)}))})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"no-post flex flex-grow flex-col items-center justify-center py-2 text-center",children:(0,N.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,N.jsx)("span",{className:"mb-3 font-semibold",children:"Chat with"}),(0,N.jsx)("span",{className:"text-xl font-semibold",children:z?z.name:"this user"})]})}),(0,N.jsx)(E.q1,{message:{description:"This is a new conversation",createdAt:new Date,createdBy:t.name}})]}),(0,N.jsx)(M,{groupId:null,group:null,tabId:null,otherUserId:b,attachments:D,setAttachments:O,smoothScrollToBottom:B,addPost:e=>{e&&(e.createdBy=e.sender,e.description=e.message,S([...C,e]),B())}})]})]})}))},79957:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EVENTS_DETAIL_PAGE_ROUTE:()=>I,EVENTS_DETAIL_SLUG_PAGE_ROUTE:()=>O,createEventDetailPageRoute:()=>L,createEventDetailSlugPageRoute:()=>R,createPostDetailPageUrl:()=>B,default:()=>U,formatEventTime:()=>F});var r=n(5564),o=n.n(r),i=n(41745),s=n(40474),a=n(72761),l=n(20975),c=(n(61592),n(31305)),d=n(98020),u=n(34067),p=n(89449),h=n(65186),m=n(62270),f=n(51772),g=n(11052),b=n(60553),v=n(53871),y=n(8934),k=n(57032),w=n(18228),x=n(85324),_=n(42498),A=n(62391);function C(e){return(0,A.jsxs)("svg",{width:"18",height:"20",viewBox:"0 0 16 16",fill:"none",...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,A.jsxs)("g",{clipPath:"url(#clip0_11085_6302)",children:[(0,A.jsx)("path",{d:"M5.37233 3.81757C7.07962 3.81601 8.06381 3.8168 8.6411 3.82301C8.9306 3.82613 9.11122 3.83055 9.22706 3.83629C9.33028 3.84141 9.36118 3.8469 9.36121 3.8467C9.7769 3.95266 10.1241 4.28393 10.2593 4.72624L10.2594 4.72624C10.2594 4.72642 10.2595 4.72661 10.2596 4.72681C10.2634 4.73772 10.2784 4.7804 10.2856 5.22342C10.2929 5.67134 10.2937 6.47769 10.2937 8.00195V11.1573L10.2438 11.3112C10.1076 11.718 9.7724 12.0388 9.37816 12.1516C9.36439 12.1527 9.34475 12.154 9.31832 12.1554C9.25387 12.1588 9.16288 12.1622 9.04698 12.1655C8.81597 12.1719 8.49778 12.1773 8.1199 12.1817C7.36477 12.1905 6.37902 12.1951 5.39248 12.1953C4.40592 12.1955 3.42042 12.1913 2.66578 12.1826C2.28812 12.1782 1.97032 12.1728 1.7398 12.1662C1.62412 12.1629 1.53354 12.1595 1.46958 12.1559C1.4442 12.1545 1.42531 12.1532 1.41203 12.1521C0.983794 12.027 0.628718 11.649 0.535288 11.2312C0.535075 11.2277 0.533164 11.2099 0.530732 11.1701C0.527385 11.1154 0.524076 11.0398 0.520919 10.9442C0.514627 10.7536 0.509309 10.4952 0.505029 10.19C0.496479 9.58007 0.492188 8.79154 0.492188 8.00195C0.492188 7.21236 0.496479 6.42383 0.505029 5.81394C0.509309 5.50866 0.514627 5.2503 0.520919 5.05972C0.524076 4.96411 0.527385 4.88847 0.530732 4.83376C0.533206 4.79332 0.53514 4.77557 0.535298 4.77254C0.626751 4.35959 0.987589 3.97295 1.41232 3.8483C1.41737 3.84838 1.456 3.84402 1.55695 3.84003C1.68762 3.83487 1.88757 3.83082 2.18877 3.8277C2.78984 3.82148 3.77473 3.81913 5.37233 3.81757ZM5.37233 3.81757L5.37187 3.31757L5.37233 3.81757ZM9.39774 12.1497C9.39767 12.1497 9.39627 12.1498 9.39378 12.1502C9.39657 12.1499 9.39782 12.1497 9.39774 12.1497ZM1.39185 12.1501C1.39176 12.1501 1.39319 12.1504 1.39644 12.1507C1.39357 12.1503 1.39194 12.1501 1.39185 12.1501Z",stroke:"currentColor"}),(0,A.jsx)("path",{d:"M13.3466 5.57396L13.3466 5.57398L12.1884 6.24168L12.1937 7.99164L12.1937 7.9924L12.2018 9.74709L13.3266 10.3913L13.3272 10.3916C13.7036 10.6079 14.0596 10.8091 14.3294 10.9596C14.4644 11.0348 14.5769 11.0968 14.6592 11.1414C14.7073 11.1674 14.7377 11.1834 14.7546 11.1923C14.7669 11.1988 14.7719 11.2014 14.7713 11.2014C14.8851 11.2453 14.9577 11.2472 15.0575 11.222C15.2404 11.1747 15.3854 11.0541 15.4624 10.8925C15.4671 10.8563 15.473 10.7772 15.4775 10.5952C15.4867 10.2237 15.4891 9.51355 15.4938 8.07995C15.4938 8.07989 15.4938 8.07984 15.4938 8.07979L15.4941 7.96166C15.4986 6.45154 15.5008 5.72599 15.48 5.33989C15.4693 5.1404 15.4539 5.07731 15.448 5.05908C15.448 5.0589 15.4481 5.05889 15.4482 5.05888C15.4488 5.0588 15.4501 5.05866 15.401 4.9873C15.2879 4.8236 15.1494 4.74972 14.9364 4.75324L14.9364 4.75331H14.9281C14.8883 4.75331 14.8413 4.75645 14.8002 4.76142C14.7916 4.76246 14.7839 4.7635 14.7772 4.76449C14.7564 4.77552 14.7293 4.79019 14.6959 4.8085C14.6147 4.85299 14.5023 4.91561 14.3663 4.99215C14.0947 5.14505 13.7329 5.35121 13.3466 5.57396Z",stroke:"currentColor"})]}),(0,A.jsx)("defs",{children:(0,A.jsx)("clipPath",{id:"clip0_11085_6302",children:(0,A.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})}var S=n(44139),j=n(62144);const E=(0,c.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community})))((0,p.wj)((function(e){let{community:t,joinScheduledPersonalMeeting:n,joinScheduledMeeting:r,event:o,addToast:i,onAttendeeClick:s=(()=>{}),getEventDetails:a=(()=>{}),user:c}=e;const[d,u]=(0,l.useState)(!1),[m,f]=(0,l.useState)(!1),{monthAbbreviation:g,dayOfMonth:b}=(0,x.j1)(o.startTime),y="going"!==o.myRSVPStatus&&"maybe"!==o.myRSVPStatus&&o.maximumRegistrations-o.participantCount===0&&m,k=(0,l.useRef)(null);var E;E=k,(0,l.useEffect)((()=>{function e(e){E.current&&E.current.contains(e.target)}return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[E]);const{analyticsService:N}=(0,h.W)(),P=e=>{u(!0),N.track("rsvp-selected",{rsvpType:e}),_.U.updateRSVP(c,o.community,o.id,e).then((t=>{a(),i("going"===e?"Successfully registered to event!":"Successfully unregistered from event!","",p.lm.success)})).catch((e=>{console.log(e),i("Error in accepting invitation","",p.lm.danger)}))};return(0,A.jsxs)("div",{className:"w-full flex-col justify-center md:mx-auto md:max-w-[670px] lg:min-w-[364px] xl:max-w-[364px]",children:[(0,A.jsxs)("div",{className:"rounded-xl bg-card p-5",children:[(0,A.jsx)("div",{className:"border-b border-border pb-4 font-bold text-secondary-foreground",children:(0,A.jsx)(v.A,{children:"TIME & LOCATION"})}),(0,A.jsxs)("div",{className:"mt-5 flex space-x-2",children:[(0,A.jsxs)("div",{className:"flex-col",children:[(0,A.jsx)("div",{className:"text-xxs rounded-t-md bg-primary px-2.5 py-0.5 text-primary-foreground",children:g}),(0,A.jsx)("div",{className:"text-xxs items-center rounded-b-md border border-border px-2.5 py-1.5 text-secondary-foreground drop-shadow-md",children:(0,A.jsx)("span",{className:"ml-0.5",children:b})})]}),(0,A.jsxs)("div",{className:"flex-col text-secondary-foreground",children:[(0,A.jsx)("div",{className:"text-sm font-semibold",children:(0,x.cA)(o.startTime)}),(0,A.jsxs)("div",{className:"flex items-center text-sm font-semibold",children:[(0,A.jsxs)("span",{children:[(0,x.mf)(o.startTime),"-"]}),(0,A.jsx)("span",{children:(0,x.mf)(o.endTime)})]})]})]}),(0,A.jsxs)("div",{className:"mt-7 flex space-x-2",children:[(0,A.jsx)("div",{className:"flex items-center rounded-md border border-border p-2",children:(0,A.jsx)(C,{className:"text-secondary-foreground"})}),(0,A.jsxs)("div",{className:"flex-col text-secondary-foreground",children:[(0,A.jsx)("div",{className:"text-sm font-semibold",children:null!==o&&void 0!==o&&o.webURL?"Online Event":"Location"}),null!==o&&void 0!==o&&o.webURL&&null===(null===o||void 0===o?void 0:o.liveMeeting)?(0,A.jsx)(S.$,{disabled:new Date(o.startTime)>new Date,onClick:n,className:"w-full rounded-lg border border-border p-1.5 text-center text-xs",label:new Date(o.startTime)>new Date?"Join in: ".concat((0,x.Wi)(o.startTime)):"Join Event"}):(0,A.jsx)("div",{className:"flex items-center text-sm font-semibold",children:(0,A.jsx)("span",{children:(null===o||void 0===o?void 0:o.location)||"-"})})]})]})]}),new Date(o.startTime)>new Date&&(0,A.jsx)("div",{children:"going"===o.myRSVPStatus?(0,A.jsxs)("div",{className:"my-2.5 rounded-xl bg-card p-5 text-secondary-foreground",children:[(0,A.jsx)("div",{className:"border-b border-border pb-4 font-bold",children:(0,A.jsx)(v.A,{children:"REGISTER"})}),(0,A.jsx)("div",{className:"mt-5",children:(0,A.jsxs)("div",{className:"flex-col text-sm font-semibold",children:[(0,A.jsx)("div",{children:"YOU'RE IN"}),(0,A.jsxs)("div",{className:"mt-2.5",children:["A confirmation email has been sent to ",c.email]}),(0,A.jsxs)("div",{className:"mt-5 w-full rounded-lg border border-border p-2.5 text-center text-xs",children:["Event will start in:"," ",(0,x.Wi)(o.startTime)]}),(0,A.jsxs)("div",{className:"flex items-center justify-center gap-2 text-xs",children:[(0,A.jsx)("div",{className:"mt-5 w-full rounded-lg border border-primary px-2.5 py-1.5 text-primary",children:(0,A.jsxs)("button",{className:"mx-auto flex cursor-pointer items-center gap-2",onClick:()=>{const e=new Date(o.startTime).toISOString().replace(/[:-]/g,""),n=new Date(o.endTime).toISOString().replace(/[:-]/g,""),r=encodeURIComponent(o.title);let i="";o.liveMeeting&&(i=(0,w.Hm)(o.liveMeeting.meetingId,c.token));const s=o.webURL||i,a=encodeURIComponent("".concat(o.description,"\n\n").concat(s?'Join here: ').concat(s,""):"")),l=t.timezone,d=o.location,u="https://www.google.com/calendar/render?action=TEMPLATE&dates=".concat(e,"/").concat(n,"&text=").concat(r,"&details=").concat(a,"&ctz=").concat(l,"&location=").concat(d);window.open(u)},children:[(0,A.jsx)(j.A,{icon:"calendar"}),(0,A.jsx)(v.A,{className:"mt-1",children:"Add to Calender"})]})}),(0,A.jsx)("button",{className:"mt-5 w-full cursor-pointer rounded-lg border border-border px-2.5 py-1.5",onClick:()=>{P("not-going")},children:"Cancel Registration"})]})]})})]}):(0,A.jsxs)("div",{className:"mt-2.5 rounded-xl bg-card p-5","text-secondary-foreground":!0,children:[(0,A.jsx)("div",{className:"border-b border-border pb-4 font-bold text-secondary-foreground",children:(0,A.jsx)(v.A,{children:"REGISTER"})}),(0,A.jsx)("div",{className:"my-5 text-sm font-semibold text-secondary-foreground",children:(0,A.jsx)(v.A,{children:"Welcome! To join the event, please register below"})}),(0,A.jsx)(S.$,{disabled:y,className:"w-full cursor-pointer",label:"Register",large:!0,onClick:()=>{P("going")}})]})})]})})));var N=n(25715),P=n(36646);const D=e=>(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"mx-auto w-full animate-pulse pt-0",children:(0,A.jsxs)("div",{className:"flex justify-between rounded-md border-b bg-white p-6",children:[(0,A.jsx)("div",{className:"h-6 w-12 rounded bg-gray-300"}),(0,A.jsx)("div",{className:"h-6 w-12 rounded bg-gray-300"})]})}),(0,A.jsxs)("div",{className:"flex flex-col lg:flex-row",children:[(0,A.jsxs)("div",{className:"mx-auto my-2 h-fit w-full rounded bg-card p-2 md:min-w-[670px] md:max-w-[670px]",children:[(0,A.jsx)("div",{className:"theme-bg-disable h-64 w-full rounded-xl"}),(0,A.jsxs)("div",{className:"my-3 rounded px-6 pt-4",children:[(0,A.jsxs)("div",{className:"flex place-items-center",children:[(0,A.jsx)("p",{className:"theme-bg-disable h-8 w-8 rounded-full"}),(0,A.jsx)("div",{className:"ml-2 w-max space-y-1 rounded-xl",children:(0,A.jsx)("p",{className:"theme-bg-disable h-2 w-28"})})]}),(0,A.jsx)("div",{className:"my-6"}),(0,A.jsx)("div",{className:"theme-bg-disable mt-2 h-2 w-1/2 rounded-xl"}),(0,A.jsx)("div",{className:"theme-bg-disable mt-2 h-16 w-full rounded-xl"})]})]}),(0,A.jsx)("div",{className:"PostList my-2 h-fit w-full rounded bg-card p-2 md:mx-auto md:min-w-[670px] md:max-w-[670px] lg:mr-6 lg:block lg:min-w-[364px] lg:max-w-[364px]",children:(0,A.jsx)(P.A,{length:3,type:P.D.compact})})]})]});var M=n(78220),T=n(42088);const I="/event/:id",O="/e/:slug",L=e=>"/event/"+e;function R(e){return void 0!=e.meta&&null!=e.meta&&null!=e.meta.slug?"/e/"+e.meta.slug:L(e.id)}function B(e){return window.location.origin+R(e)}function z(e){let{event:t,user:n}=e;const[r,i]=(0,l.useState)(!1);let{description:s}=t;if(!s)return(0,A.jsx)(A.Fragment,{});const a=(new u.F).render(s);let c=a;try{c=a.replace(/\B\@([\w\-]+)/gim,(e=>''.concat(e,"")))}catch(p){}const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.replace(/(\(\)\[\] \n]+)([^"]+)(">)([^<]+)(<\/a>)/g,'

');return t=e.replace(/(?:(?:http:|https:)(?:\/\/))?(?:www\.)?(?:youtube.com|youtu.be)\/(?:watch)?(?:\?v=)?([^&<"\>\(\)\[\] \n]+)([^" \n]+)/g,'

'),t=t.replace(/(?:[^"'https:\/\/])(?:(?:http:|https:)(?:\/\/))?(?:www\.)?(?:player\.)?(?:vimeo.com)\/(?:video\/)?([^<"\>\(\)\[\] \n]+)/g,'

'),t}(c);return(0,A.jsx)("div",{className:o()("my-4 break-words"),children:(0,A.jsx)("div",{className:"NL2BR headings",dangerouslySetInnerHTML:{__html:d}})})}function F(e,t){const n=new Date(e),r=new Date(t);return n.getTime()===r.getTime()||n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()?(0,i.default)(n,"dd MMMM yyyy, p"):n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()?"".concat((0,i.default)(n,"dd MMM, p")," - ").concat((0,i.default)(r,"dd MMM yyyy, p")):n.getFullYear()===r.getFullYear()?"".concat((0,i.default)(n,"dd MMM, p")," - ").concat((0,i.default)(r,"dd MMM yyyy, p")):"".concat((0,i.default)(n,"dd MMM, yyyy, p")," - ").concat((0,i.default)(r,"dd MMM yyyy, p"))}const U=(0,p.wj)((0,c.Ng)((e=>({user:e.auth,community:e.community})))((function(e){var t;let{user:n,community:r,addToast:c}=e;const[u,w]=(0,l.useState)((0,i.default)(new Date,"yyyy-MM-dd")),[x,C]=(0,l.useState)(!1),[S,P]=(0,l.useState)(!1),[I,O]=(0,l.useState)(!1),[L,B]=(0,l.useState)(),{id:F,slug:U}=(0,d.g)(),[V,G]=(0,l.useState)(!1),[H,W]=(0,l.useState)(!1),[q,K]=(0,l.useState)(!1),[Y,$]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(!1),[J,X]=(0,l.useState)(!1),[ee,te]=(0,l.useState)(!1),{analyticsService:ne}=(0,h.W)(),re=(0,m.A)();l.useEffect((()=>{C(!0),oe()}),[F,U]),l.useEffect((()=>{Q&&ie()}),[Q]);const oe=()=>{F?_.U.getEventDetail(n,r.id,F).then((e=>{B(e.event),C(!1)})).catch((e=>{c("Events could not be fetched!","",p.lm.danger),C(!1)})):U&&_.U.getEventDetailBySlug(n,r.id,U).then((e=>{B(e.event),C(!1)})).catch((e=>{c("Events could not be fetched!","",p.lm.danger),C(!1)}))},ie=()=>{P(!0),W(!0),_.U.deleteEvent(n,r.id,L.id,Q,ee).then((e=>{ne.track("event-delete"),c("Event deleted!"),M.b6.push("/events")})).catch((e=>{console.log(e),W(!0),c("Event could not be deleted!","","danger")})).finally((()=>{P(!1),W(!1)}))},se=()=>{X(!1),ie()};if(void 0===L||null===L)return(0,A.jsx)("div",{className:"loading flex-col items-center justify-center",children:(0,A.jsx)(D,{})});const ae=L.startTime,le=(!!ae&&(0,s.default)(new Date(L.startTime),Date.now()),!!ae&&(0,a.default)(Date.now(),new Date(L.endTime))),ce=()=>{if(!ae)return!0;const e=new Date,t=new Date(L.startTime),n=new Date(L.endTime);return e>=new Date(t.getTime()-3e5)&&e<=n},de=e=>{e.preventDefault(),n&&(le?le&&c("Event over","",p.lm.info):(window.open((0,T.Hm)(L.liveCall.meetingId,n.token)),ne.track("join-event-button-clicked",{eventURL:L.liveCall.meetingId})))},ue=e=>{e.preventDefault(),ne.track("join-event-button-clicked",{eventURL:L.webURL}),window.open(L.webURL)};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"max-w-screen lg:max-w-auto min-h-screen lg:min-w-[670px]",children:[L?(0,A.jsx)("div",{className:"mb-2 flex w-full items-center justify-between border-b border-border bg-card px-4 py-3 lg:w-[calc(100vw-300px)]",children:(0,A.jsxs)("div",{className:"flex cursor-pointer gap-2 text-sm font-semibold text-secondary-foreground",onClick:()=>M.b6.push("/events"),children:[(0,A.jsx)(j.A,{icon:"arrow-small-left"}),(0,A.jsx)(v.A,{children:"Back to Events"})]})}):(0,A.jsx)(A.Fragment,{}),(0,A.jsx)("div",{className:"mx-auto flex max-w-[670px] flex-col space-y-4",children:(0,A.jsxs)("div",{className:"w-full border border-border bg-card md:rounded-lg",children:[L.banner&&(0,A.jsx)("div",{className:"theme-bg-disable w-full rounded-t",children:(0,A.jsx)("img",{src:L.banner,className:"w-full rounded-t object-contain",alt:"",style:{aspectRatio:"16/9"}})}),(0,A.jsxs)("div",{className:"mx-4 rounded-xl p-7 md:mx-0",children:[(0,A.jsxs)("div",{className:"flex flex-row justify-between",children:[(0,A.jsx)("p",{className:"my-2 text-lg font-semibold text-secondary-foreground",children:L.title}),(0,A.jsx)("div",{className:"flex",children:n&&"admin"===L.myCommunityRole&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{onClick:()=>($(!0),void G(!0)),className:"mr-2 mt-2.5 cursor-pointer text-sm font-normal text-secondary-foreground",children:(0,A.jsx)(v.A,{children:"Share"})}),(0,A.jsx)(N.A,{icon:"menu-dots-vertical",actions:[(0,a.default)(new Date(L.startTime),Date.now())&&{icon:"edit",label:"Edit",onClick:e=>{G(!0)}},{icon:"trash",label:"Delete",labelClass:"text-alert",onClick:()=>{W(!0)},actionType:"alert"},{icon:"trash",label:"Delete Subsequent Events",labelClass:"text-alert",onClick:()=>{te(!0),W(!0)},actionType:"alert"}]})]})})]}),(0,A.jsxs)("div",{className:"mt-2.5 flex items-center",children:[(0,A.jsx)(y.eu,{user:L.host,noName:!0}),(0,A.jsxs)("span",{className:"text-xs font-semibold text-secondary-foreground",children:["Hosted By ",null===L||void 0===L||null===(t=L.host)||void 0===t?void 0:t.name]})]}),!n||"going"!==L.myRSVPStatus&&n.id!==L.host.id&&"admin"!==L.myCommunityRole?null:(0,A.jsxs)("div",{className:"mt-2.5",children:[null!==L.liveCall?(0,A.jsx)(f.$n,{disabled:!ce(),onClick:de,className:"mr-2",label:"Join Event",large:!0}):null,L.webURL&&null===L.liveCall?(0,A.jsx)(f.$n,{disabled:!ce(),onClick:ue,className:"mr-2",label:"Join Event",large:!0}):null]})]})]})}),L.description&&(0,A.jsx)("div",{className:"mx-auto mb-8 mt-2.5 flex max-w-[670px] flex-col",children:(0,A.jsxs)("div",{className:"w-full border border-border bg-card p-7 text-secondary-foreground md:rounded-lg",children:[(0,A.jsx)("p",{className:"text-xs font-semibold",children:"DETAILS"}),L.description&&(0,A.jsx)(z,{event:L,user:n})]})}),(0,A.jsx)(k.u,{active:V,user:n,community:r,eventToUpdate:L,onUpdateEvent:e=>{B(e),M.b6.push(R(e))},onNewEventAdded:e=>{},isShowAttendee:q,setIsShowAttendee:K,isShowInvite:Y,setIsShowInvite:$,openModel:e=>{G(e)}}),(0,A.jsx)(b.c,{active:H,setActive:W,onSubmit:()=>{(0,a.default)(Date.now(),new Date(L.endTime))?se():(W(!1),X(!0))},header:"Delete Event",title:"Are you sure you want to delete the event?",isLoading:S,btnColor:"red"}),(0,A.jsx)(g.c,{active:J,setActive:X,onSubmit:()=>{Z(!0),X(!1)},onCancelSubmit:se,labelCancel:"No, its okay",labelSubmit:"Yes, Notify them",title:"Do you wish to notify that event is cancelled?",subTitle:"".concat(L.participantCount>0?"".concat(L.participantCount," ").concat(re.trans("users wants to attend this event")):""," "),isLoading:x,large:!0,btnColor:"theme-bg-disabled"})]}),(0,A.jsx)("style",{jsx:!0,children:"\n @media (min-width: 990px) and (max-width: 1200px) {\n .margin-left-300 {\n margin-left: 300px;\n min-width: 670px;\n }\n }\n "}),(0,A.jsx)("div",{className:o()("mt-0 mt-2.5 flex lg:mr-8 lg:mt-14","margin-left-300"),children:(0,A.jsx)(E,{event:L,addToast:c,user:n,joinScheduledMeeting:de,joinScheduledPersonalMeeting:ue,onAttendeeClick:()=>{K(!0),G(!0)},getEventDetails:oe})})]})})))},85324:(e,t,n)=>{"use strict";function r(e){const t=new Date(e),n=t.getHours(),r=t.getMinutes(),o=n<12?"am":"pm",i=(r<10?"0":"")+r;return"".concat(n%12||12,":").concat(i," ").concat(o)}function o(e){const t=new Date(e),n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t.getDay()],r=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],o=t.getDate();return"".concat(n,", ").concat(r," ").concat(o)}function i(e){const t=new Date(e);return{monthAbbreviation:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],dayOfMonth:t.getDate()}}function s(e){const t=new Date(e),n=new Date;let r=n-t;r<0&&(r=t-n);const o=Math.floor(r/6e4),i=Math.floor(o/60),s=Math.floor(i/24),a=i%24,l=o%60;return"".concat(s,"d ").concat(a,"h ").concat(l,"m")}n.d(t,{Wi:()=>s,cA:()=>o,j1:()=>i,mf:()=>r})},39740:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COMMUNITY_EVENTS_PAGE_ROUTE:()=>wc,default:()=>_c});var r=n(5564),o=n.n(r),i=n(41745),s=n(72006),a=n.n(s),l=n(20975),c=n(64180),d=n(86887),u=n(81463),p=n(35481),h=n.n(p),m=n(8672),f=n.n(m),g=function(){};function b(e,t){return void 0!==e[t]}function v(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function y(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function k(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function w(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}y.__suppressDeprecationWarning=!0,k.__suppressDeprecationWarning=!0,w.__suppressDeprecationWarning=!0;function x(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt})),H=ie((function(e,t){return e>=t})),W=ie((function(e,t){return e=t&&o.getHours()-n.getHours()o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r-1&&e%1==0&&e<=9007199254740991};const Se=function(e){return null!=e&&Ce(e.length)&&!Ae(e)};var je=/^(?:0|[1-9]\d*)$/;const Ee=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&je.test(e))&&e>-1&&e%1==0&&e-1};const wt=function(e,t){var n=this.__data__,r=gt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ta))return!1;var c=i.get(e),d=i.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,h=2&n?new fn:void 0;for(i.set(e,t),i.set(t,e);++u1?t-1:0),r=1;r0&&r(l)?n>1?e(l,n-1,r,o,i):Cn(i,l):o||(i[i.length]=l)}return i};const mi=function(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===n(i[l],l,i))break}return t}}();const fi=function(e,t){return e&&mi(e,t,ar)};const gi=function(e,t){return function(n,r){if(null==n)return n;if(!Se(n))return e(n,r);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++it||i&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!i&&!c&&e=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index};const wi=function(e,t,n){t=t.length?Ro(t,(function(e){return Sn(e)?function(t){return Ho(t,1===e.length?e[0]:e)}:e})):[Qo];var r=-1;t=Ro(t,qn(ei));var o=bi(e,(function(e,n,o){return{criteria:Ro(t,(function(t){return t(e)})),index:++r,value:e}}));return vi(o,(function(e,t){return ki(e,t,n)}))};const xi=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var _i=Math.max;const Ai=function(e,t,n){return t=_i(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=_i(r.length-t,0),s=Array(i);++o0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ji);const Pi=function(e,t){return Ni(Ai(e,t,Qo),e+"")};const Di=Pi((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ne(e,t[0],t[1])?t=[]:n>2&&Ne(t[0],t[1],t[2])&&(t=[t[0]]),wi(e,hi(t,1),[])}));function Mi(e,t){var n=tt(e);return n?n.innerWidth:t?e.clientWidth:it(e).width}var Ti;function Ii(e){if((!Ti&&0!==Ti||e)&<){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Ti=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ti}function Oi(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Li=function(e,t){for(var n=-1,r=null==e?0:e.length;++n1),t})),Fi(e,rs(e),n),r&&(n=Es(n,7,Bs));for(var o=t.length;o--;)Ds(n,t[o]);return n}));var Us=Object.prototype,Vs=Us.hasOwnProperty;const Gs=Pi((function(e,t){e=Object(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&Ne(t[0],t[1],o)&&(r=1);++n2?n-2:0),o=2;o1,D=g.eventProp(r,E,j,o),M=l.createElement("div",{className:"rbc-event-content",title:S||void 0},y?l.createElement(y,{event:r,continuesPrior:h,continuesAfter:m,title:C,isAllDay:N,localizer:p,slotStart:w,slotEnd:x}):C);return l.createElement(k,(0,c.A)({},this.props,{type:"date"}),l.createElement("div",(0,c.A)({},A,{tabIndex:0,style:(0,c.A)({},D.style,t),className:_("rbc-event",n,D.className,{"rbc-selected":o,"rbc-event-allday":P,"rbc-event-continues-prior":h,"rbc-event-continues-after":m}),onClick:function(e){return s&&s(r,e)},onDoubleClick:function(e){return a&&a(r,e)},onKeyPress:function(e){return u&&u(r,e)}}),"function"===typeof b?b(M):M))},t}(l.Component);function Sa(e,t){return!(!e||null==t)&&Tr(e,t)}function ja(e,t){return(e.right-e.left)/t}function Ea(e,t,n,r){var o=ja(e,r);return n?r-1-Math.floor((t-e.left)/o):Math.floor((t-e.left)/o)}Ca.propTypes={};var Na=function(e){function t(){return e.apply(this,arguments)||this}(0,u.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){var e,t,n=this.props,r=n.popupOffset,o=void 0===r?5:r,i=it(n.popperRef.current),s=i.top,a=i.left,l=i.width,c=i.height,d=window.innerHeight+ot(window),u=window.innerWidth+rt(window),p=s+c,h=a+l;(p>d||h>u)&&(p>d&&(e=p-d+(o.y||+o||0)),h>u&&(t=h-u+(o.x||+o||0)),this.setState({topOffset:e,leftOffset:t}))},n.render=function(){var e=this,t=this.props,n=t.events,r=t.selected,o=t.getters,i=t.accessors,s=t.components,a=t.onSelect,d=t.onDoubleClick,u=t.onKeyPress,p=t.slotStart,h=t.slotEnd,m=t.localizer,f=t.popperRef,g=this.props.position.width,b={top:-((this.state||{}).topOffset||0),left:-((this.state||{}).leftOffset||0),minWidth:g+g/2};return l.createElement("div",{style:(0,c.A)({},this.props.style,b),className:"rbc-overlay",ref:f},l.createElement("div",{className:"rbc-overlay-header"},m.format(p,"dayHeaderFormat")),n.map((function(t,n){return l.createElement(Ca,{key:n,type:"popup",localizer:m,event:t,getters:o,onSelect:a,accessors:i,components:s,onDoubleClick:d,onKeyPress:u,continuesPrior:m.lt(i.end(t),p,"day"),continuesAfter:m.gte(i.start(t),h,"day"),slotStart:p,slotEnd:h,selected:Sa(t,r),draggable:!0,onDragStart:function(){return e.props.handleDragStart(t)},onDragEnd:function(){return e.props.show()}})})))},t}(l.Component);Na.propTypes={};var Pa=l.forwardRef((function(e,t){return l.createElement(Na,(0,c.A)({popperRef:t},e))}));function Da(e,t,n){return void 0===n&&(n=document),oo(n,e,t,{passive:!1})}function Ma(e,t){var n=t.clientX,r=t.clientY;return function(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(xo(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}(document.elementFromPoint(n,r),".rbc-event",e)}function Ta(e,t){return!!Ma(e,t)}function Ia(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var Oa=function(){function e(e,t){var n=void 0===t?{}:t,r=n.global,o=void 0!==r&&r,i=n.longPressThreshold,s=void 0===i?250:i;this.isDetached=!1,this.container=e,this.globalMouse=!e||o,this.longPressThreshold=s,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=Da("touchmove",(function(){}),window),this._removeKeyDownListener=Da("keydown",this._keyListener),this._removeKeyUpListener=Da("keyup",this._keyListener),this._removeDropFromOutsideListener=Da("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=Da("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}var t=e.prototype;return t.on=function(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);return n.push(t),{remove:function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},t.emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r(void 0===f?u:f)||a-nm)}function Ra(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+Ba("left"),r=t.top+Ba("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function Ba(e){return"left"===e?window.pageXOffset||document.body.scrollLeft||0:"top"===e?window.pageYOffset||document.body.scrollTop||0:void 0}var za=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).state={selecting:!1},r}(0,u.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.selectable&&this._selectable()},n.componentWillUnmount=function(){this._teardownSelectable()},n.UNSAFE_componentWillReceiveProps=function(e){e.selectable&&!this.props.selectable&&this._selectable(),!e.selectable&&this.props.selectable&&this._teardownSelectable()},n.render=function(){var e=this.props,t=e.range,n=e.getNow,r=e.getters,o=e.date,i=e.components.dateCellWrapper,s=e.localizer,a=this.state,c=a.selecting,d=a.startIdx,u=a.endIdx,p=n();return l.createElement("div",{className:"rbc-row-bg"},t.map((function(e,n){var a=c&&n>=d&&n<=u,h=r.dayProp(e),m=h.className,f=h.style;return l.createElement(i,{key:n,value:e,range:t},l.createElement("div",{style:f,className:_("rbc-day-bg",m,a&&"rbc-selected-cell",s.isSameDate(e,p)&&"rbc-today",o&&s.neq(o,e,"month")&&"rbc-off-range-bg")}))})))},n._selectable=function(){var e=this,t=(0,ae.findDOMNode)(this),n=this._selector=new Oa(this.props.container,{longPressThreshold:this.props.longPressThreshold}),r=function(n,r){if(!Ta((0,ae.findDOMNode)(e),n)){var o=Ra(t),i=e.props,s=i.range,a=i.rtl;if(function(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}(o,n)){var l=Ea(o,n.x,a,s.length);e._selectSlot({startIdx:l,endIdx:l,action:r,box:n})}}e._initial={},e.setState({selecting:!1})};n.on("selecting",(function(r){var o=e.props,i=o.range,s=o.rtl,a=-1,l=-1;if(e.state.selecting||(Xs(e.props.onSelectStart,[r]),e._initial={x:r.x,y:r.y}),n.isSelected(t)){var c=Ra(t),d=function(e,t,n,r,o){var i=-1,s=-1,a=r-1,l=ja(t,r),c=Ea(t,n.x,o,r),d=t.topn.y,u=t.tope.y,p=e.y>t.bottom,h=t.top>e.y;return n.topt.bottom&&(i=0,s=a),d&&(h?(i=0,s=c):p&&(i=c,s=a)),u&&(i=s=o?a-Math.floor((e.x-t.left)/l):Math.floor((e.x-t.left)/l),d?c=t?s.push(o):(i[r]||(i[r]=[])).push(o)}for(n=0;n=e.left}))}function Ya(e,t,n,r){var o={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},i={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:o,evtB:i})}Ga.propTypes={},Ga.defaultProps=(0,c.A)({},Fa);var $a=function(e,t){return e.left<=t&&e.right>=t},Qa=function(e,t){return e.filter((function(e){return $a(e,t)})).length},Za=function(e){function t(){return e.apply(this,arguments)||this}(0,u.A)(t,e);var n=t.prototype;return n.render=function(){for(var e=this.props,t=e.segments,n=e.slotMetrics.slots,r=Wa(t).levels[0],o=1,i=1,s=[];o<=n;){var a="_lvl_"+o,c=r.filter((function(e){return $a(e,o)}))[0]||{},d=c.event,u=c.left,p=c.right,h=c.span;if(d){var m=Math.max(0,u-i);if(this.canRenderSlotEvent(u,h)){var f=Ua(this.props,d);m&&s.push(Va(n,m,a+"_gap")),s.push(Va(n,h,a,f)),i=o=p+1}else m&&s.push(Va(n,m,a+"_gap")),s.push(Va(n,1,a,this.renderShowMore(t,o))),i=o+=1}else o++}return l.createElement("div",{className:"rbc-row"},s)},n.canRenderSlotEvent=function(e,t){var n=this.props.segments;return si(e,e+t).every((function(e){return 1===Qa(n,e)}))},n.renderShowMore=function(e,t){var n=this,r=this.props.localizer,o=Qa(e,t);return!!o&&l.createElement("a",{key:"sm_"+t,href:"#",className:"rbc-show-more",onClick:function(e){return n.showMore(t,e)}},r.messages.showMore(o))},n.showMore=function(e,t){t.preventDefault(),t.stopPropagation(),this.props.onShowMore(e,t.target)},t}(l.Component);Za.propTypes={},Za.defaultProps=(0,c.A)({},Fa);var Ja=function(e){var t=e.children;return l.createElement("div",{className:"rbc-row-content-scroll-container"},t)},Xa=function(e,t){return e[0].range===t[0].range&&e[0].events===t[0].events};function el(){return ci((function(e){for(var t=e.range,n=e.events,r=e.maxRows,o=e.minRows,i=e.accessors,s=e.localizer,a=Ha({dateRange:t,localizer:s}),l=a.first,d=a.last,u=n.map((function(e){return function(e,t,n,r){var o=Ha({dateRange:t,localizer:r}),i=o.first,s=o.last,a=r.diff(i,s,"day"),l=r.max(r.startOf(n.start(e),"day"),i),c=r.min(r.ceil(n.end(e),"day"),s),d=ni(t,(function(e){return r.isSameDate(e,l)})),u=r.diff(l,c,"day");return u=Math.min(u,a),{event:e,span:u=Math.max(u-r.segmentOffset,1),left:d+1,right:Math.max(d+u,1)}}(e,t,i,s)})),p=Wa(u,Math.max(r-1,1)),h=p.levels,m=p.extra;h.length=t}(t,e)})).map((function(e){return e.event}))},continuesPrior:function(e){return s.continuesPrior(i.start(e),l)},continuesAfter:function(e){var t=i.start(e),n=i.end(e);return s.continuesAfter(t,n,d)}}}),Xa)}var tl=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;or*d&&!i.eq(n,o)?(l-r)/(r*d)*100:l/(r*d)*100;return{top:u,height:c/(r*d)*100-u,start:v(e),startDate:e,end:v(o),endDate:o}},getCurrentTimePosition:function(e){return v(e)/(r*d)*100}}}var ll=function(){function e(e,t){var n=t.accessors,r=t.slotMetrics.getRange(n.start(e),n.end(e)),o=r.start,i=r.startDate,s=r.end,a=r.endDate,l=r.top,c=r.height;this.start=o,this.end=s,this.startMs=+i,this.endMs=+a,this.top=l,this.height=c,this.data=e}return(0,di.A)(e,[{key:"_width",get:function(){if(this.rows){var e=this.rows.reduce((function(e,t){return Math.max(e,t.leaves.length+1)}),0)+1;return 100/e}var t=100-this.container._width;return this.leaves?t/(this.leaves.length+1):this.row._width}},{key:"width",get:function(){var e=this._width,t=Math.min(100,1.7*this._width);if(this.rows)return t;if(this.leaves)return this.leaves.length>0?t:e;var n=this.row.leaves;return n.indexOf(this)===n.length-1?e:t}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var e=this.row,t=e.leaves,n=e.xOffset,r=e._width;return n+(t.indexOf(this)+1)*r}}]),e}();function cl(e,t,n){return Math.abs(t.start-e.start)e.start&&t.start0;){var r=t.shift();n.push(r);for(var o=0;oi.startMs)){if(o>0){var s=t.splice(o,1)[0];n.push(s)}break}}}return n}(t.map((function(e){return new ll(e,{slotMetrics:r,accessors:o})}))),s=[],a=function(e){var t=i[e],r=s.find((function(e){return e.end>t.start||Math.abs(t.start-e.start)=0;a--)cl(r.rows[a],t,n)&&(o=r.rows[a]);o?(o.leaves.push(t),t.row=o):(t.leaves=[],r.rows.push(t))},l=0;l-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var o=ul(e.friends[r],t,n);t=t>o?t:o}return t}var pl={overlap:dl,"no-overlap":function(e){var t=dl({events:e.events,minimumStartDifference:e.minimumStartDifference,slotMetrics:e.slotMetrics,accessors:e.accessors});t.sort((function(e,t){return e=e.style,t=t.style,e.top!==t.top?e.top>t.top?1:-1:e.top+e.heightA?x:A}x<=w.idx&&(w.size=100-w.idx*w.size);var C=0===w.idx?0:3;w.style.width="calc("+w.size+"% - "+C+"px)",w.style.height="calc("+w.style.height+"% - 2px)",w.style.xOffset="calc("+w.style.left+"% + "+C+"px)"}return t}};var hl=function(e){function t(){return e.apply(this,arguments)||this}return(0,u.A)(t,e),t.prototype.render=function(){var e=this.props,t=e.renderSlot,n=e.resource,r=e.group,o=e.getters,i=e.components,s=(i=void 0===i?{}:i).timeSlotWrapper,a=void 0===s?qs:s,d=o?o.slotGroupProp():{};return l.createElement("div",(0,c.A)({className:"rbc-timeslot-group"},d),r.map((function(e,r){var i=o?o.slotProp(e,n):{};return l.createElement(a,{key:r,value:e,resource:n},l.createElement("div",(0,c.A)({},i,{className:_("rbc-time-slot",i.className)}),t&&t(e,r)))})))},t}(l.Component);function ml(e){return"string"===typeof e?e:e+"%"}function fl(e){var t,n,r=e.style,o=e.className,i=e.event,s=e.accessors,a=e.rtl,d=e.selected,u=e.label,p=e.continuesPrior,h=e.continuesAfter,m=e.getters,f=e.onClick,g=e.onDoubleClick,b=e.isBackgroundEvent,v=e.onKeyPress,y=e.components,k=y.event,w=y.eventWrapper,x=s.title(i),A=s.tooltip(i),C=s.end(i),S=s.start(i),j=m.eventProp(i,S,C,d),E=r.height,N=r.top,P=r.width,D=r.xOffset,M=[l.createElement("div",{key:"1",className:"rbc-event-label"},u),l.createElement("div",{key:"2",className:"rbc-event-content"},k?l.createElement(k,{event:i,title:x}):x)],T=b?(0,c.A)({},j.style,((t={top:ml(N),height:ml(E),width:"calc("+P+" + 10px)"})[a?"right":"left"]=ml(Math.max(0,D)),t)):(0,c.A)({},j.style,((n={top:ml(N),width:ml(P),height:ml(E)})[a?"right":"left"]=ml(D),n));return l.createElement(w,(0,c.A)({type:"time"},e),l.createElement("div",{onClick:f,onDoubleClick:g,style:T,onKeyPress:v,title:A?("string"===typeof u?u+": ":"")+A:void 0,className:_(b?"rbc-background-event":"rbc-event",o,j.className,{"rbc-selected":d,"rbc-event-continues-earlier":p,"rbc-event-continues-later":h})},M))}hl.propTypes={};var gl=function(e){var t=e.children,n=e.className,r=e.style;return l.createElement("div",{className:n,style:r},t)},bl=["dayProp"],vl=["eventContainerWrapper"],yl=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=t&&r<=n){var o=this.slotMetrics.getCurrentTimePosition(r);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:o})}else this.clearTimeIndicatorInterval()},n.render=function(){var e=this.props,t=e.date,n=e.max,r=e.rtl,o=e.isNow,i=e.resource,s=e.accessors,a=e.localizer,c=e.getters,u=c.dayProp,p=(0,d.A)(c,bl),h=e.components,m=h.eventContainerWrapper,f=(0,d.A)(h,vl),g=this.slotMetrics,b=this.state,v=b.selecting,y=b.top,k=b.height,w={start:b.startDate,end:b.endDate},x=u(n),A=x.className,C=x.style,S=f.dayColumnWrapper||gl;return l.createElement(S,{date:t,style:C,className:_(A,"rbc-day-slot","rbc-time-column",o&&"rbc-now",o&&"rbc-today",v&&"rbc-slot-selecting")},g.groups.map((function(e,t){return l.createElement(hl,{key:t,group:e,resource:i,getters:p,components:f})})),l.createElement(m,{localizer:a,resource:i,accessors:s,getters:p,components:f,slotMetrics:g},l.createElement("div",{className:_("rbc-events-container",r&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),v&&l.createElement("div",{className:"rbc-slot-selection",style:{top:y,height:k}},l.createElement("span",null,a.format(w,"selectRangeFormat"))),o&&this.intervalTriggered&&l.createElement("div",{className:"rbc-current-time-indicator",style:{top:this.state.timeIndicatorPosition+"%"}}))},t}(l.Component);function kl(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}yl.propTypes={},yl.defaultProps={dragThroughEvents:!0,timeslots:2};var wl=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.clientHeight;n.state.isOverflowing!==t&&(n._updatingOverflow=!0,n.setState({isOverflowing:t},(function(){n._updatingOverflow=!1})))}},n.memoizedResources=ci((function(e,t){return function(e,t){return{map:function(n){return e?e.map((function(e,r){return n([t.resourceId(e),e],r)})):[n([Al,null],0)]},groupEvents:function(n){var r=new Map;return e?(n.forEach((function(e){var n=t.resource(e)||Al,o=r.get(n)||[];o.push(e),r.set(n,o)})),r):(r.set(Al,n),r)}}}(e,t)})),n.state={gutterWidth:void 0,isOverflowing:null},n.scrollRef=l.createRef(),n.contentRef=l.createRef(),n._scrollRatio=null,n}(0,u.A)(t,e);var n=t.prototype;return n.UNSAFE_componentWillMount=function(){this.calculateScroll()},n.componentDidMount=function(){this.checkOverflow(),null==this.props.width&&this.measureGutter(),this.applyScroll(),window.addEventListener("resize",this.handleResize)},n.componentWillUnmount=function(){window.removeEventListener("resize",this.handleResize),ht(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)},n.componentDidUpdate=function(){null==this.props.width&&this.measureGutter(),this.applyScroll()},n.UNSAFE_componentWillReceiveProps=function(e){var t=this.props,n=t.range,r=t.scrollToTime,o=t.localizer;(o.neq(e.range[0],n[0],"minutes")||o.neq(e.scrollToTime,r,"minutes"))&&this.calculateScroll(e)},n.renderEvents=function(e,t,n,r){var o=this,i=this.props,s=i.min,a=i.max,d=i.components,u=i.accessors,p=i.localizer,h=i.dayLayoutAlgorithm,m=this.memoizedResources(this.props.resources,u),f=m.groupEvents(t),g=m.groupEvents(n);return m.map((function(t,n){var i=t[0],m=t[1];return e.map((function(e,t){var b=(f.get(i)||[]).filter((function(t){return p.inRange(e,u.start(t),u.end(t),"day")})),v=(g.get(i)||[]).filter((function(t){return p.inRange(e,u.start(t),u.end(t),"day")}));return l.createElement(yl,(0,c.A)({},o.props,{localizer:p,min:p.merge(e,s),max:p.merge(e,a),resource:m&&i,components:d,isNow:p.isSameDate(e,r),key:n+"-"+t,date:e,events:b,backgroundEvents:v,dayLayoutAlgorithm:h}))}))}))},n.render=function(){var e=this.props,t=e.events,n=e.backgroundEvents,r=e.range,o=e.width,i=e.rtl,s=e.selected,a=e.getNow,c=e.resources,d=e.components,u=e.accessors,p=e.getters,h=e.localizer,m=e.min,f=e.max,g=e.showMultiDayTimes,b=e.longPressThreshold,v=e.resizable;o=o||this.state.gutterWidth;var y=r[0],k=r[r.length-1];this.slots=r.length;var w=[],x=[],A=[];return t.forEach((function(e){if(qa(e,y,k,u,h)){var t=u.start(e),n=u.end(e);u.allDay(e)||h.startAndEndAreDateOnly(t,n)||!g&&!h.isSameDate(t,n)?w.push(e):x.push(e)}})),n.forEach((function(e){qa(e,y,k,u,h)&&A.push(e)})),w.sort((function(e,t){return Ya(e,t,u,h)})),l.createElement("div",{className:_("rbc-time-view",c&&"rbc-time-view-resources")},l.createElement(_l,{range:r,events:w,width:o,rtl:i,getNow:a,localizer:h,selected:s,resources:this.memoizedResources(c,u),selectable:this.props.selectable,accessors:u,getters:p,components:d,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:b,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectAlldayEvent,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:v}),l.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},l.createElement(wl,{date:y,ref:this.gutterRef,localizer:h,min:h.merge(y,m),max:h.merge(y,f),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:d,className:"rbc-time-gutter",getters:p}),this.renderEvents(r,x,A,a())))},n.clearSelection=function(){clearTimeout(this._selectTimer),this._pendingSelection=[]},n.measureGutter=function(){var e=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame((function(){var t=Mi(e.gutter);t&&e.state.gutterWidth!==t&&e.setState({gutterWidth:t})}))},n.applyScroll=function(){if(null!=this._scrollRatio){var e=this.contentRef.current;e.scrollTop=e.scrollHeight*this._scrollRatio,this._scrollRatio=null}},n.calculateScroll=function(e){void 0===e&&(e=this.props);var t=e,n=t.min,r=t.max,o=t.scrollToTime,i=t.localizer,s=o-i.startOf(o,"day"),a=i.diff(n,r,"milliseconds");this._scrollRatio=s/a},t}(l.Component);Cl.propTypes={},Cl.defaultProps={step:30,timeslots:2};var Sl=["date","localizer","min","max","scrollToTime"],jl=function(e){function t(){return e.apply(this,arguments)||this}return(0,u.A)(t,e),t.prototype.render=function(){var e=this.props,n=e.date,r=e.localizer,o=e.min,i=void 0===o?r.startOf(new Date,"day"):o,s=e.max,a=void 0===s?r.endOf(new Date,"day"):s,u=e.scrollToTime,p=void 0===u?r.startOf(new Date,"day"):u,h=(0,d.A)(e,Sl),m=t.range(n,{localizer:r});return l.createElement(Cl,(0,c.A)({},h,{range:m,eventOffset:10,localizer:r,min:i,max:a,scrollToTime:p}))},t}(l.Component);jl.propTypes={},jl.range=function(e,t){return[t.localizer.startOf(e,"day")]},jl.navigate=function(e,t,n){var r=n.localizer;switch(t){case Ks:return r.add(e,-1,"day");case Ys:return r.add(e,1,"day");default:return e}},jl.title=function(e,t){return t.localizer.format(e,"dayHeaderFormat")};var El=["date","localizer","min","max","scrollToTime"],Nl=function(e){function t(){return e.apply(this,arguments)||this}return(0,u.A)(t,e),t.prototype.render=function(){var e=this.props,n=e.date,r=e.localizer,o=e.min,i=void 0===o?r.startOf(new Date,"day"):o,s=e.max,a=void 0===s?r.endOf(new Date,"day"):s,u=e.scrollToTime,p=void 0===u?r.startOf(new Date,"day"):u,h=(0,d.A)(e,El),m=t.range(n,this.props);return l.createElement(Cl,(0,c.A)({},h,{range:m,eventOffset:15,localizer:r,min:i,max:a,scrollToTime:p}))},t}(l.Component);Nl.propTypes={},Nl.defaultProps=Cl.defaultProps,Nl.navigate=function(e,t,n){var r=n.localizer;switch(t){case Ks:return r.add(e,-1,"week");case Ys:return r.add(e,1,"week");default:return e}},Nl.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),o=n.startOf(e,"week",r),i=n.endOf(e,"week",r);return n.range(o,i)},Nl.title=function(e,t){var n=t.localizer,r=Nl.range(e,{localizer:n}),o=r[0],i=r.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")};var Pl=["date","localizer","min","max","scrollToTime"];function Dl(e,t){return Nl.range(e,t).filter((function(e){return-1===[6,0].indexOf(e.getDay())}))}var Ml,Tl=function(e){function t(){return e.apply(this,arguments)||this}return(0,u.A)(t,e),t.prototype.render=function(){var e=this.props,t=e.date,n=e.localizer,r=e.min,o=void 0===r?n.startOf(new Date,"day"):r,i=e.max,s=void 0===i?n.endOf(new Date,"day"):i,a=e.scrollToTime,u=void 0===a?n.startOf(new Date,"day"):a,p=(0,d.A)(e,Pl),h=Dl(t,this.props);return l.createElement(Cl,(0,c.A)({},p,{range:h,eventOffset:15,localizer:n,min:o,max:s,scrollToTime:u}))},t}(l.Component);function Il(e){var t=e.accessors,n=e.components,r=e.date,o=e.events,i=e.getters,s=e.length,a=e.localizer,c=e.onDoubleClickEvent,d=e.onSelectEvent,u=e.selected,p=(0,l.useRef)(null),h=(0,l.useRef)(null),m=(0,l.useRef)(null),f=(0,l.useRef)(null),g=(0,l.useRef)(null);(0,l.useEffect)((function(){v()}));var b=function(e,r){var o="",i=n.time,s=a.messages.allDay,c=t.end(r),d=t.start(r);return t.allDay(r)||(a.eq(d,c)?s=a.format(d,"agendaTimeFormat"):a.isSameDate(d,c)?s=a.format({start:d,end:c},"agendaTimeRangeFormat"):a.isSameDate(e,d)?s=a.format(d,"agendaTimeFormat"):a.isSameDate(e,c)&&(s=a.format(c,"agendaTimeFormat"))),a.gt(e,d,"day")&&(o="rbc-continues-prior"),a.lt(e,c,"day")&&(o+=" rbc-continues-after"),l.createElement("span",{className:o.trim()},i?l.createElement(i,{event:r,day:e,label:s}):s)},v=function(){if(g.current){var e=p.current,t=g.current.firstChild;if(t){var n,r,o=f.current.scrollHeight>f.current.clientHeight,i=[],s=i;i=[Mi(t.children[0]),Mi(t.children[1])],s[0]===i[0]&&s[1]===i[1]||(h.current.style.width=i[0]+"px",m.current.style.width=i[1]+"px"),o?(r="rbc-header-overflowing",(n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"===typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),e.style.marginRight=Ii()+"px"):function(e,t){e.classList?e.classList.remove(t):"string"===typeof e.className?e.className=Oi(e.className,t):e.setAttribute("class",Oi(e.className&&e.className.baseVal||"",t))}(e,"rbc-header-overflowing")}}},y=a.messages,k=a.add(r,s,"day"),w=a.range(r,k,"day");return(o=o.filter((function(e){return qa(e,a.startOf(r,"day"),a.endOf(k,"day"),t,a)}))).sort((function(e,n){return+t.start(e)-+t.start(n)})),l.createElement("div",{className:"rbc-agenda-view"},0!==o.length?l.createElement(l.Fragment,null,l.createElement("table",{ref:p,className:"rbc-agenda-table"},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{className:"rbc-header",ref:h},y.date),l.createElement("th",{className:"rbc-header",ref:m},y.time),l.createElement("th",{className:"rbc-header"},y.event)))),l.createElement("div",{className:"rbc-agenda-content",ref:f},l.createElement("table",{className:"rbc-agenda-table"},l.createElement("tbody",{ref:g},w.map((function(e,r){return function(e,r,o){var s=n.event,p=n.date;return(r=r.filter((function(n){return qa(n,a.startOf(e,"day"),a.endOf(e,"day"),t,a)}))).map((function(n,h){var m=t.title(n),f=t.end(n),g=t.start(n),v=i.eventProp(n,g,f,Sa(n,u)),y=0===h&&a.format(e,"agendaDateFormat"),k=0===h&&l.createElement("td",{rowSpan:r.length,className:"rbc-agenda-date-cell"},p?l.createElement(p,{day:e,label:y}):y);return l.createElement("tr",{key:o+"_"+h,className:v.className,style:v.style},k,l.createElement("td",{className:"rbc-agenda-time-cell"},b(e,n)),l.createElement("td",{className:"rbc-agenda-event-cell",onClick:function(e){return d&&d(n,e)},onDoubleClick:function(e){return c&&c(n,e)}},s?l.createElement(s,{event:n,title:m}):m))}),[])}(e,o,r)})))))):l.createElement("span",{className:"rbc-agenda-empty"},y.noEventsInRange))}Tl.propTypes={},Tl.defaultProps=Cl.defaultProps,Tl.range=Dl,Tl.navigate=Nl.navigate,Tl.title=function(e,t){var n=t.localizer,r=Dl(e,{localizer:n}),o=r[0],i=r.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")},Il.propTypes={},Il.defaultProps={length:30},Il.range=function(e,t){var n=t.length,r=void 0===n?Il.defaultProps.length:n;return{start:e,end:t.localizer.add(e,r,"day")}},Il.navigate=function(e,t,n){var r=n.length,o=void 0===r?Il.defaultProps.length:r,i=n.localizer;switch(t){case Ks:return i.add(e,-o,"day");case Ys:return i.add(e,o,"day");default:return e}},Il.title=function(e,t){var n=t.length,r=void 0===n?Il.defaultProps.length:n,o=t.localizer,i=o.add(e,r,"day");return o.format({start:e,end:i},"agendaHeaderFormat")};var Ol=((Ml={})[Zs.MONTH]=il,Ml[Zs.WEEK]=Nl,Ml[Zs.WORK_WEEK]=Tl,Ml[Zs.DAY]=jl,Ml[Zs.AGENDA]=Il,Ml),Ll=["action","date","today"];var Rl=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o1)return n.map((function(n){return l.createElement("button",{type:"button",key:n,className:_({"rbc-active":r===n}),onClick:t.view.bind(null,n)},e[n])}))},t}(l.Component);Rl.propTypes={};var Bl=function(e){return function(t){return function(e,t){var n=null;return"function"===typeof t?n=t(e):"string"===typeof t&&"object"===typeof e&&null!=e&&t in e&&(n=e[t]),n}(t,e)}},zl=["view","date","getNow","onNavigate"],Fl=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function Ul(e){return Array.isArray(e)?e:Object.keys(e)}var Vl=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o1?i-1:0),a=1;ao?1:0}})}n(61592);var Yl=n(31305),$l=n(98020),Ql=n(47760),Zl=n(89449),Jl=n(65186),Xl=n(25968),ec=n(53871),tc=n(44139),nc=n(57032),rc=n(40474),oc=n(72761),ic=n(78220),sc=n(79957),ac=n(42498),lc=n(11052),cc=n(60553),dc=n(1689),uc=n(8934),pc=n(25715),hc=n(19328),mc=n(13362),fc=n(62391);const gc=Object.freeze({upcoming:1,past:2});function bc(e){let{index:t,event:n,community:r,setEvent:o=(e=>{}),upcomingEventsList:i,user:s,setIsShowInvite:l=(e=>{}),setActiveModel:c=(e=>{}),setIsDeleteModalVisible:d=(e=>{}),setIsDeleteAllRecurringEvents:u=(e=>{})}=e,p="",h="";if(t>0){let e=i[t-1];p=a()(e.startTime).format("MMMM-YYYY")}h=a()(n.startTime).format("MMMM-YYYY");a()(n.startTime).isSame(a()(n.endTime),"day");const{analyticsService:m}=(0,Jl.W)();return(0,fc.jsxs)("div",{className:"mt-2 rounded",children:[p!==h?(0,fc.jsx)("div",{className:"mx-4 py-2 pl-1 font-bold text-secondary-foreground",children:a()(n.startTime).format("MMMM YYYY")}):null,(0,fc.jsx)("div",{className:" ".concat(p===h?"mt-3":""," mx-4 cursor-pointer rounded border border-border"),onClick:()=>{m.track("event-selected",{eventStatus:"upcoming"}),ic.b6.push((0,sc.createEventDetailSlugPageRoute)(n))},children:(0,fc.jsxs)("div",{className:"flex justify-between rounded bg-card",children:[(0,fc.jsxs)("div",{className:"flex items-center",children:[n.banner?(0,fc.jsx)("div",{className:"theme-bg-disable flex w-24 sm:w-48 flex-shrink-0",children:(0,fc.jsx)("img",{src:n.banner,alt:"",className:"w-full rounded-l object-contain",style:{aspectRatio:"16/9"}})}):null,(0,fc.jsxs)("div",{className:"self-center px-3 py-2 font-semibold text-secondary-foreground",children:[(0,fc.jsx)("div",{className:"self-center whitespace-nowrap text-lg font-bold",children:n.title&&n.title.length>70?n.title.substring(0,67)+"...":n.title}),(0,fc.jsx)("div",{className:"flex",children:(0,sc.formatEventTime)(n.startTime,n.endTime)}),(0,fc.jsxs)("span",{className:"font-semibold",children:[(0,fc.jsx)(ec.A,{children:"Timezone :"}),"\xa0"]}),(0,fc.jsx)("span",{className:"text-xs",children:r.timezone?r.timezone:"Asia/Kolkata"}),(0,fc.jsx)("div",{className:"pt-2",children:(0,fc.jsx)(uc.eu,{user:n.host,size:"30"})})]})]}),(0,fc.jsx)("div",{className:"flex",children:(0,fc.jsx)("div",{children:s&&("admin"===n.myCommunityRole||n.createdBy.id===s.id)&&(0,oc.default)(new Date(n.startTime),Date.now())&&(0,fc.jsx)(fc.Fragment,{children:(0,fc.jsx)(pc.A,{icon:"menu-dots",actions:[{icon:"share",label:"Share",onClick:e=>{o(n),setTimeout((()=>{l(!0),c(!0)}),100)}},{icon:"edit",label:"Edit",onClick:e=>{o(n),setTimeout((()=>{c(!0)}),100)}},{icon:"trash",label:"Delete",labelClass:"text-alert",onClick:()=>{o(n),setTimeout((()=>{d(!0)}),100)},actionType:"alert"},{icon:"trash",label:"Delete Subsequent Events",labelClass:"text-alert",onClick:()=>{o(n),u(!0),setTimeout((()=>{d(!0)}),100)},actionType:"alert"}]})})})})]})})]},t)}const vc=(0,Yl.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community})))((0,Zl.wj)((function(e){let{user:t,addToast:n,community:r,isEventAdded:o}=e;const[i,s]=(0,l.useState)(gc.upcoming),[c,d]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[h,m]=(0,l.useState)(!1),[f,g]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),[y,k]=(0,l.useState)(!1),[w,x]=(0,l.useState)(!1),[_,A]=(0,l.useState)(!1),[C,S]=(0,l.useState)(),[j,E]=(0,l.useState)(!1),[N,P]=(0,l.useState)(!1),[D,M]=(0,l.useState)(!1),[T,I]=(0,l.useState)(!1),[O,L]=(0,l.useState)(!1),[R,B]=(0,l.useState)(!1),[z,F]=(0,l.useState)(!1),U=(0,l.useRef)(),V=(0,l.useRef)(),{analyticsService:G}=(0,Jl.W)();(0,l.useEffect)((()=>{H(""),W("")}),[o]),(0,l.useEffect)((()=>{T&&q(!1)}),[T]);const H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.id&&(m(!0),ac.U.upcomingEvents(t,r.id,e).then((e=>{d(e.events),m(!1)})).catch((e=>{m(!1),n("Error getting upcoming events",e),n("Events could not be fetched!","",Zl.lm.danger)})))},W=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.id&&(m(!0),ac.U.previousEvents(t,r.id,e).then((e=>{p(e.events),m(!1)})).catch((e=>{m(!1),n("Error getting previous events",e),n("Events could not be fetched!","",Zl.lm.danger)})))},q=e=>{ac.U.deleteEvent(t,r.id,C.id,T,R).then((async t=>{let r=c,o=u;if(!0===e){let e=await o.findIndex((e=>e.id===C.id));o.splice(e,1),await p(o)}else{const e=t.eventIds;r=r.filter((t=>!e.includes(t.id))),await d(r)}G.track("event-delete"),n("Event deleted!"),M(!1),L(!1)})).catch((e=>{M(!1),L(!1),n("Event could not be deleted!","","danger")}))},K=function(){q(arguments.length>0&&void 0!==arguments[0]&&arguments[0])};return(0,fc.jsxs)(fc.Fragment,{children:[(0,fc.jsx)("div",{className:"flex cursor-pointer items-center rounded-t border-border bg-card",children:(0,fc.jsxs)("div",{className:"tab-holder flex w-full items-center rounded-t border-b border-border bg-card px-4 shadow",children:[(0,fc.jsx)("div",{className:"items-center",children:(0,fc.jsx)(mc.A,{onClick:e=>{i!==gc.upcoming&&(g(!1),v(!1),s(gc.upcoming))},tab:"UPCOMING",selected:i===gc.upcoming,className:"pb-3 pt-2 text-center"})}),(0,fc.jsx)("div",{className:"px-4",children:(0,fc.jsx)(mc.A,{onClick:e=>{i!==gc.past&&(x(!1),k(!1),s(gc.past))},tab:"PAST",selected:i===gc.past,className:"pb-3 pt-2 text-center"})})]})}),h?(0,fc.jsx)("div",{className:"my-10 flex justify-center",children:(0,fc.jsx)(hc.a,{})}):null,h||0!==c.length||i!==gc.upcoming?null:(0,fc.jsx)("div",{className:"no-post my-10 p-2 text-center",children:(0,fc.jsx)("div",{className:"my-3 font-bold text-secondary-foreground",children:"No upcoming events"})}),i===gc.upcoming?(0,fc.jsxs)("div",{onScroll:()=>{if(U.current){const{scrollTop:e,scrollHeight:o,clientHeight:i}=U.current;if(e+i===o&&!f&&!b){let e=c[c.length-1].startTime;g(!0),ac.U.upcomingEvents(t,r.id,e).then((e=>{0===e.events.length?v(!0):d([...c,...e.events]),g(!1)})).catch((e=>{n("Events could not be fetched!","",Zl.lm.danger)}))}}},ref:U,className:"event-content-list mt-4",children:[c.length>0?c.map(((e,n)=>(0,fc.jsx)(bc,{event:e,setEvent:S,user:t,community:r,setIsShowInvite:P,setActiveModel:A,setIsDeleteModalVisible:M,upcomingEventsList:c,setIsDeleteAllRecurringEvents:B},n))):null,f?(0,fc.jsx)("div",{className:"align-center flex justify-center py-5",children:(0,fc.jsx)(hc.a,{})}):null]}):null,h||0!==u.length||i!==gc.past?null:(0,fc.jsx)("div",{className:"no-post my-10 p-2 text-center",children:(0,fc.jsx)("div",{className:"my-3 font-bold",children:"No past events"})}),i===gc.past?(0,fc.jsxs)("div",{onScroll:()=>{if(V.current){const{scrollTop:e,scrollHeight:o,clientHeight:i}=V.current;if(e+i===o&&!y&&!w){let e=u[u.length-1].startTime;k(!0),ac.U.previousEvents(t,r.id,e).then((e=>{0===e.events.length?x(!0):p([...u,...e.events]),k(!1)})).catch((e=>{n("Events could not be fetched!","",Zl.lm.danger)}))}}},ref:V,className:"event-content-list mt-4",children:[u.length>0?u.map(((e,n)=>{let r="",o="";if(n>0){let e=u[n-1];r=a()(e.startTime).format("MMMM-YYYY")}return o=a()(e.startTime).format("MMMM-YYYY"),(0,fc.jsxs)("div",{className:"mt-2",children:[r!==o?(0,fc.jsx)("div",{className:"mx-4 py-2 pl-1 font-bold text-secondary-foreground",children:a()(e.startTime).format("MMMM YYYY")}):null,(0,fc.jsx)("div",{className:" ".concat(r===o?"mt-3":""," mx-4 cursor-pointer rounded border border-border"),onClick:()=>{G.track("event-selected",{eventStatus:"past"}),ic.b6.push((0,sc.createEventDetailSlugPageRoute)(e))},children:(0,fc.jsxs)("div",{className:"flex justify-between rounded bg-card",children:[(0,fc.jsxs)("div",{className:"flex items-center",children:[e.banner?(0,fc.jsx)("div",{className:"theme-bg-disable flex w-24 sm:w-48 flex-shrink-0",children:(0,fc.jsx)(dc.A,{src:e.banner,alt:"",className:"w-full rounded-l object-contain",style:{aspectRatio:"16/9"}})}):null,(0,fc.jsxs)("div",{className:"mt-1 self-center px-3 py-1 py-2 font-semibold text-secondary-foreground",children:[(0,fc.jsx)("div",{className:"flex",children:(0,sc.formatEventTime)(e.startTime,e.endTime)}),(0,fc.jsx)("div",{className:"self-center overflow-auto whitespace-nowrap py-1 font-semibold",children:e.title&&e.title.length>70?e.title.substring(0,67)+"...":e.title}),(0,fc.jsx)("div",{className:"pt-2",children:(0,fc.jsx)(uc.eu,{user:e.host,size:"30"})})]})]}),(0,fc.jsx)("div",{className:"flex",children:(0,fc.jsx)("div",{className:"",children:t&&"admin"===e.myCommunityRole&&(0,rc.default)(new Date(e.endTime),Date.now())&&(0,fc.jsx)(fc.Fragment,{children:(0,fc.jsx)(pc.A,{dropdownClassName:"w-56",icon:"menu-dots",actions:[{icon:"share",label:"Share",onClick:t=>{S(e),setTimeout((()=>{P(!0),A(!0),F(!0)}),100)}},{icon:"trash",label:"Delete",labelClass:"text-alert",onClick:()=>{S(e),setTimeout((()=>{M(!0)}),100)},actionType:"alert"},{icon:"eye",label:"Show Attendees",onClick:()=>{S(e),setTimeout((()=>{E(!0),A(!0)}),100)}}]})})})})]})})]},n)})):null,y?(0,fc.jsx)("div",{className:"align-center flex justify-center py-5",children:(0,fc.jsx)(hc.a,{})}):null]}):null,(0,fc.jsx)(nc.u,{active:_,user:t,isPastEventModal:z,community:r,eventToUpdate:C,onUpdateEvent:e=>{let t=c,n=t.findIndex((t=>t.id===e.id));t[n]=e},isShowAttendee:j,setIsShowAttendee:E,isShowInvite:N,setIsShowInvite:P,openModel:e=>{A(e)}}),(0,fc.jsx)(cc.c,{active:D,setActive:M,onSubmit:()=>{(0,oc.default)(Date.now(),new Date(C.endTime))?K(!0):(M(!1),L(!0))},header:"Delete Event",title:"Are you sure you want to delete the event?",isLoading:h,btnColor:"red"}),(0,fc.jsx)(lc.c,{active:O,setActive:L,onSubmit:()=>{I(!0)},onCancelSubmit:K,labelCancel:"No, its okay",labelSubmit:"Yes, Notify them",title:"Do you wish to notify that event is cancelled?",isLoading:h,large:!0,btnColor:"theme-bg-disabled"})]})}))),yc=vc;var kc=n(90559);const wc="/events",xc=Object.freeze({List:1,Calendar:2});const _c=(0,Zl.wj)((0,Yl.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups})))((function(e){var t,n;let{user:r,groups:s,community:c,addToast:d}=e;const u=Kl(a()),[p,h]=(0,l.useState)([]),[m,f]=(0,l.useState)([]),[g,b]=(0,l.useState)({}),[v,y]=(0,l.useState)((0,i.default)(new Date,"yyyy-MM-dd")),[k,w]=(0,l.useState)(!1),[x,_]=(0,l.useState)(!1),[A,C]=l.useState(xc.List),[S,j]=(0,l.useState)(!1),[E,N]=(0,l.useState)(new Date),P=null===c||void 0===c||null===(t=c.configuration)||void 0===t?void 0:t.anyoneCanCreateEvent,{analyticsService:D}=(0,Jl.W)();l.useEffect((()=>{w(!0),c.id&&M()}),[c.id,v,r]);const M=()=>{let e=[];ac.U.getAllEvents(r,c.id,v).then((t=>{t.events&&t.events.map(((t,n)=>{const r={id:t.id,title:t.title&&t.title.length>15?t.title.substring(0,14)+"...":t.title,allDay:!0,start:new Date(t.startTime),end:new Date(t.endTime)};e.push(r)})),h(e),w(!1)})).catch((e=>{d("Error getting events",e),d("Events could not be fetched!","",Zl.lm.danger),w(!1)}))};return l.useEffect((()=>{if(null!==s&&void 0!==s&&s.length>0){let e=s.some((e=>["admin","moderator"].includes(e.myRole)))||P;_(e)}}),[s]),null!==c&&void 0!==c&&null!==(n=c.configuration)&&void 0!==n&&n.isEventsTabDisabled?(0,fc.jsx)($l.rd,{to:"/"}):(0,fc.jsx)(Xl.l,{layout:Ql.DQ.TWO_COLUMN,children:(0,fc.jsxs)("div",{className:"EventPage Card flex min-h-screen flex-col rounded border border-border bg-card",children:[(0,fc.jsx)("div",{className:"rounded py-4 pl-4 pr-2 shadow",children:(0,fc.jsxs)("div",{className:"flex items-center justify-between",children:[(0,fc.jsxs)("div",{className:"flex items-center space-x-4 font-bold text-secondary-foreground/85",children:[(0,fc.jsx)(ec.A,{children:" Events"}),(0,fc.jsx)(kc.A,{className:"ml-1.5",icon:"".concat(A===xc.List?"list":"calendar"),onClick:()=>{if(A===xc.List)D.track("event-view",{viewType:"Calendar"}),C(xc.Calendar);else D.track("event-view",{viewType:"List"}),C(xc.List)},hoverable:!0})]}),r&&x?(0,fc.jsx)(tc.$,{className:"mr-2",label:"New Event",onClick:()=>{D.track("new-event-button-clicked"),j(!0)}}):(0,fc.jsx)(fc.Fragment,{})]})}),A===xc.List?(0,fc.jsx)(fc.Fragment,{}):(0,fc.jsx)(fc.Fragment,{children:(0,fc.jsx)("div",{className:"",style:{height:"500px"},children:(0,fc.jsx)(Gl,{events:p,step:60,max:new Date(230,12,30),defaultDate:Date.now(),onSelectEvent:e=>{ic.b6.push((0,sc.createEventDetailSlugPageRoute)(e))},popup:!0,components:{toolbar:e=>(0,fc.jsxs)("div",{className:"my-2 flex flex-row items-center justify-center",children:[(0,fc.jsx)("button",{className:"h-8 w-8 rounded text-primary",onClick:()=>{let t=new Date(e.date),n=new Date(t.getFullYear(),t.getMonth()-1,1);e.onNavigate("prev",n),y((0,i.default)(n,"yyyy-MM-dd"))},children:"<"}),(0,fc.jsx)("label",{className:"px-4 font-bold",children:e.label}),(0,fc.jsx)("button",{className:"h-8 w-8 rounded text-primary",onClick:()=>{let t=new Date(e.date),n=new Date(t.getFullYear(),t.getMonth()+1,1);e.onNavigate("next",n),y((0,i.default)(n,"yyyy-MM-dd"))},children:">"})]}),month:{dateHeader:e=>{let{label:t,date:n}=e;const r=n{r||(N(new Date(n)),j(!0))},children:t})}}},selectable:!1,localizer:u})})}),(0,fc.jsx)(fc.Fragment,{children:(0,fc.jsx)("div",{className:"event-list-container",children:(0,fc.jsx)(yc,{user:r,addToast:d,isEventAdded:m})})}),(0,fc.jsx)(nc.u,{active:S,user:r,community:c,onClearModal:e=>{b({})},eventToUpdate:g,onNewEventAdded:e=>{b(e),f(!m)},openModel:e=>{j(e)},startDate:E})]})})})))},54916:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var r=n(20975),o=n(31305),i=n(82993),s=n(48672),a=n(65186),l=n(51772),c=n(53871),d=n(10515),u=n(43039),p=n(44139),h=n(90559),m=n(2016),f=n(19328),g=n(91900),b=n(16118),v=n(62391);function y(e){let{group:t,coupon:n,onError:o=(e=>{}),onSuccess:i=(e=>{}),onCancel:s=(e=>{}),user:a}=e;const[l,c]=(0,r.useState)(null);return(0,r.useEffect)((()=>{window.Razorpay||(0,b.k0)("https://checkout.razorpay.com/v1/checkout.js").then((async e=>{if(!e)return alert("Could not load razorpay!");c(e)}))}),[a]),(0,r.useEffect)((()=>{(l||window.Razorpay)&&async function(e,t,n,r,o,i){const{order:s}=await u.Bd.createOrder(e,t.id,n?n.code:void 0),a={key:"rzp_test_oGF6bmuu9cUOHH",amount:s.amount.toString(),currency:s.currency,name:"Pensil Social",description:s.receipt,image:"https://app.".concat(b.pD,"/assets/main-logo.png"),order_id:s.id,modal:{ondismiss:i},handler:async function(n){try{s.id,n.razorpay_payment_id,n.razorpay_order_id,n.razorpay_signature;const{group:o}=await u.Bd.verifyPayment(e,t.id,n.razorpay_payment_id);r(o)}catch(i){o(i)}},prefill:{name:e.name,email:e.email,contact:e.mobile},notes:s.notes,theme:{color:"#0445FE"}},l=new window.Razorpay(a);l.open(),l.on("payment.failed",o)}(a,t,n,i,o,s)}),[l,t,a,n,i,o,s]),(0,v.jsx)(v.Fragment,{})}var k=n(54617);function w(e){let{active:t,setActive:n,group:o,user:i,setGroup:s}=e;const[a,l]=(0,r.useState)(!1),[c,b]=(0,r.useState)(""),[w,x]=(0,r.useState)(null),[_,A]=(0,r.useState)(""),[C,S]=(0,r.useState)(!1),[j,E]=(0,r.useState)(!1);return(0,v.jsxs)(g.a,{active:t,setActive:n,padding:!1,width:"390px",className:"GroupPaymentPopup text-left text-secondary-foreground/85",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,v.jsxs)("span",{className:"font-bold text-secondary-foreground/80",children:["Access to ",o.name]}),(0,v.jsx)(h.A,{icon:"cross",size:"md",onClick:()=>{n(!1)}})]}),(0,v.jsxs)("div",{className:"p-5",children:[w?(0,v.jsxs)("div",{className:"theme-bg-disable mb-10 rounded-xl text-right",children:[(0,v.jsxs)("div",{className:"px-5 py-3",children:[(0,v.jsxs)("div",{className:"flex items-center justify-end",children:[(0,v.jsx)("div",{className:"pr-3 text-lg font-semibold text-secondary-foreground/80",children:"Total Payable"}),(0,v.jsxs)("div",{className:"text-xl font-bold text-secondary-foreground/85",children:[o.currency?o.currency:"\u20b9"," ",new Intl.NumberFormat("en-IN",{maximumSignificatDigits:3}).format(o.price?o.price/100:0)]})]}),(0,v.jsxs)("div",{className:"my-2 flex items-center justify-end",children:[(0,v.jsxs)("div",{className:"pr-3 font-semibold text-secondary-foreground/80",children:["(CODE: ",w.code,")"]}),(0,v.jsxs)("div",{className:"text-xl font-bold text-secondary-foreground/85",children:["- ",o.currency?o.currency:"\u20b9"," ",new Intl.NumberFormat("en-IN",{maximumSignificatDigits:3}).format(w.discount/100)]})]})]}),(0,v.jsxs)("div",{className:"flex items-center justify-end border-t-4 border-border px-5 py-3",children:[(0,v.jsx)("div",{className:"pr-3 text-lg font-semibold text-secondary-foreground/80",children:"Net Payable"}),(0,v.jsxs)("div",{className:"text-xl font-bold text-secondary-foreground/85",children:[o.currency?o.currency:"\u20b9"," ",new Intl.NumberFormat("en-IN",{maximumSignificatDigits:3}).format((o.price-w.discount)/100)]})]})]}):(0,v.jsxs)("div",{className:"theme-bg-disable mb-10 rounded-xl px-5 py-3 text-left",children:[(0,v.jsx)("div",{className:"mb-2 text-secondary-foreground/80",children:"Total Payable"}),(0,v.jsxs)("div",{className:"text-2xl font-bold text-secondary-foreground/85",children:[o.currency?o.currency:"\u20b9"," ",new Intl.NumberFormat("en-IN",{maximumSignificatDigits:3}).format(o.price?o.price/100:0)]})]}),a?(0,v.jsxs)("div",{className:"mb-10 flex flex-col",children:[(0,v.jsx)("div",{children:"Enter Coupon Code"}),(0,v.jsxs)("div",{className:"flex w-full items-center",children:[(0,v.jsx)(k.k,{placeholder:"Coupon Code",className:"py-3",defaultValue:c,onChange:e=>{_&&A(""),b(e)},containerClassName:"flex-grow bg-background",validator:e=>/^([a-zA-Z0-9])+$/.test(e)?"":"Coupon invalid!",postfix:C?(0,v.jsxs)("div",{className:"mr-3",children:[" ",(0,v.jsx)(f.a,{})]}):(0,v.jsx)("div",{className:"mr-3 cursor-pointer",onClick:e=>{/^([a-zA-Z0-9])+$/.test(c)&&(S(!0),u.Bd.verifyToken(i,o.id,c).then((e=>{let{coupon:t}=e;o.price-t.discount>99?(x(t),A("")):A("Coupon not applicable here!"),S(!1)})).catch((e=>{e&&e.response&&e.response.data&&e.response.data.message?A(e.response.data.message):A("Could not apply coupon"),x(null),S(!1)})))},children:"Apply"})}),(0,v.jsx)(m.A,{icon:d.A,rotate:45,className:"ml-2",onClick:()=>{l(!1),x(null),b("")}})]}),w?(0,v.jsx)("div",{className:"text-xs font-normal text-green-500",children:"Coupon applied!"}):(0,v.jsx)(v.Fragment,{}),(0,v.jsx)("div",{className:"text-xs font-normal text-alert",children:_})]}):(0,v.jsx)(v.Fragment,{}),j?(0,v.jsx)("div",{className:"flex justify-center",children:(0,v.jsx)(f.a,{})}):(0,v.jsx)(p.$,{onClick:e=>{E(!0)},className:"w-full",label:"Proceed",large:!0}),a?(0,v.jsx)(v.Fragment,{}):(0,v.jsx)("div",{className:"mb-3 mt-5 cursor-pointer text-primary",onClick:e=>{l(!0)},children:"Have a coupon?"}),j?(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(y,{group:o,coupon:w,user:i,onCancel:e=>{E(!1)},onError:e=>{console.log({error:e}),E(!1)},onSuccess:e=>{E(!1),s(e)}})}):(0,v.jsx)(v.Fragment,{})]})]})}var x=n(78220),_=n(87573),A=n(89431),C=n(10701);const S=(0,o.Ng)((e=>({community:e.community,socket:e.socket,mySubscription:e.mySubscription,subscriptionsPlan:e.subscriptionsPlan})),(e=>(0,i.zH)({},e)))((function(e){let{community:t,user:n,socket:o,group:i,setGroup:d,mySubscription:p,subscriptionsPlan:h,openGroupOnJoined:m=!1,sectionAuth:f="",sectionType:g=""}=e;const[b,y]=(0,r.useState)(!1),[k,S]=(0,r.useState)(!1),[j,E]=(0,r.useState)(!1),N=(0,r.useMemo)((()=>A.F.filterSubscriptionsForGroup(i.id,h)),[h,i.id]),{analyticsService:P}=(0,a.W)(),D=e=>{P.track("button-on-group-card-in-explore-group",{joinStatus:e})},M=A.F.hasPaidSubscription(N,i.id);return t?n?"joined"===i.joinStatus?(0,v.jsx)("button",{className:"rounded border border-border bg-card px-5 py-1 font-semibold focus:outline-none",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(i.joinStatus),m&&x.b6.push((0,s.DZ)(i))},children:(0,v.jsx)(c.A,{children:"Joined"})}):"requested"===i.joinStatus?(0,v.jsx)(l.$n,{label:"Requested",outlined:!0,disabled:!0,className:"min-w-[90px]",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(i.joinStatus)}}):"invited"===i.joinStatus?(0,v.jsx)(l.$n,{label:"Accept Invitation",outlined:!0,isLoading:b,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!0),D(i.joinStatus),u.Bd.acceptInvitation(n,i.id).then((e=>{d(e.group),y(!1)})).catch((e=>{y(!1)}))}}):"closed-free"===i.groupType&&M?(0,v.jsxs)("div",{className:"flex flex-col",children:[(0,v.jsx)(l.$n,{isLoading:k,label:"Buy Now",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(i.joinStatus),E(!0)},outlined:!0,btnColor:"red"}),(0,v.jsx)(w,{group:i,setGroup:d,active:k,setActive:S,user:n}),(0,v.jsx)(C.U,{group:i,community:t,user:n,plans:N,header:null===i||void 0===i?void 0:i.name,setActive:E,active:j,mySubscription:p,socket:o})]}):"closed-free"!==i.groupType||M?"declined"===i.joinStatus?(0,v.jsx)(l.$n,{label:" ",outlined:!0,disabled:!0,btnColor:"red",onClick:e=>{e.preventDefault(),e.stopPropagation(),D(i.joinStatus)}}):(0,v.jsx)(l.$n,{label:"Join",isLoading:b,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!0),D(i.joinStatus),""===g&&""===f||P.track("join-section",{sectionAuth:f,sectionType:g}),u.Bd.joinGroup(n,i.id).then((e=>{d(e.group),y(!1),_.A.logEvent(_.B.Group.name,_.B.Group.join),P.track("join-group",{userType:null===t||void 0===t?void 0:t.myRole,groupName:i.name,description:i.description,groupType:i.groupType,status:i.joinStatus,groupUrl:(0,s.p$)(i)})})).catch((e=>{y(!1)}))}}):(0,v.jsx)(l.$n,{label:"Request Access",className:"min-w-[120px]",isLoading:b,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!0),D(i.joinStatus),u.Bd.joinGroup(n,i.id).then((e=>{d(e.group),y(!1),_.A.logEvent(_.B.Group.name,_.B.Group.join),P.track("join-group",{userType:null===t||void 0===t?void 0:t.myRole,groupName:i.name,description:i.description,groupType:i.groupType,status:i.joinStatus,groupUrl:(0,s.p$)(i)})})).catch((e=>{y(!1)}))}}):(0,v.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),D(i.joinStatus),window.location.href="/login"},className:"rounded border bg-primary px-5 py-1 font-semibold text-primary-foreground focus:outline-none",children:(0,v.jsx)(c.A,{children:"Join"})}):(0,v.jsx)(v.Fragment,{})}))},48672:(e,t,n)=>{"use strict";n.d(t,{C7:()=>r.getSectionPageRoute,DZ:()=>r.getGroupPageRouteFromSlug,nf:()=>r.SECTIONPAGE_SLUG_ROUTE,p$:()=>r.createGroupPageUrlFromSlug,tm:()=>r.GROUPPAGE_SLUG_ROUTE,vV:()=>r.GROUPPAGE_ROUTE,wE:()=>r.getGroupPageRoute,x6:()=>r.getSectionPageRouteFromSlug});var r=n(62220)},18228:(e,t,n)=>{"use strict";n.d(t,{DZ:()=>r.DZ,Hm:()=>i.Hm,S0:()=>o.LOGIN_ROUTE,T$:()=>o.REGISTER_EMAIL_ROUTE,aZ:()=>o.REGISTER_ROUTE,cs:()=>i.cs,nf:()=>r.nf,p$:()=>r.p$,pP:()=>o.LOGIN_EMAIL_ROUTE,tm:()=>r.tm,vV:()=>r.vV,wE:()=>r.wE,x6:()=>r.x6});var r=n(48672),o=n(25446),i=n(42088)},25446:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LOGIN_EMAIL_ROUTE:()=>G,LOGIN_ROUTE:()=>U,REGISTER_EMAIL_ROUTE:()=>H,REGISTER_ROUTE:()=>V,default:()=>W});var r=n(20975),o=n(31305),i=n(82993),s=n(28836),a=n(51772),l=n(55854),c=n(16118),d=n(43039),u=n(77255),p=(n(91965),n(38723)),h=n.n(p),m=n(65071),f=n.n(m),g=n(77826),b=n(91341),v=n(62144),y=n(78220),k=n(26914),w=n(62391);function x(e){var t,n;let{community:r,communityDetail:o,redirectSubdomain:i,redirectURL:s,isRegister:a,setUser:l,isLoading:c=!1,setIsLoading:d=(e=>{}),setErrorMessage:u=(e=>{}),setAuthType:p=(e=>{})}=e;const h=new URLSearchParams(window.location.search),m=h.get("action")===C,f=h.get("action")===_,v=(null===r||void 0===r?void 0:r.configuration.disableMobileLogin)||["app.pensil.com","app.pensil.in","app.pensil.so"].includes(window.location.hostname)||a;return m&&s?(0,w.jsx)(j,{setErrorMessage:u,isLoading:c,setIsLoading:d,redirect:s,communityDetail:o,redirectSubdomain:i}):f&&s?(0,w.jsx)(N,{setErrorMessage:u,isLoading:c,setIsLoading:d,redirect:s,communityDetail:o,redirectSubdomain:i}):(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)("div",{children:[(0,w.jsxs)("div",{className:"card bg-card",children:[o&&o.logo?(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:o.logo,alt:""})}):i?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:"/assets/vectors/main-logo-square-blue.svg",alt:""})}),(0,w.jsxs)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:[(0,w.jsx)(b.A,{children:"Welcome to "}),(0,w.jsx)(b.A,{children:null!==(t=null===r||void 0===r?void 0:r.name)&&void 0!==t?t:"Pensil"})]}),null!==r&&void 0!==r&&r.configuration.disableEmailLogin&&null!==r&&void 0!==r&&r.configuration.disableMobileLogin&&null!==r&&void 0!==r&&r.configuration.disableGoogleLogin&&null!==r&&void 0!==r&&r.configuration.disableFacebookLogin?(0,w.jsxs)("div",{className:"text-center",children:[(0,w.jsxs)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:[a?"Register":"Login"," is disabled"]}),(0,w.jsx)("div",{className:"text-center text-gray-500",children:(0,w.jsx)("div",{className:"pb-4 text-center text-secondary-foreground/85",children:"Please contact your community administrator"})})]}):(0,w.jsx)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:a?"Register":"Login"}),!v&&(0,w.jsx)(D,{className:"mb-3",icon:"call-outgoing",label:"Continue with Mobile",onClick:e=>{p("mobile")}}),null!==r&&void 0!==r&&r.configuration.disableEmailLogin?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)(D,{className:"mb-3",icon:"envelope",label:"Continue with Email",onClick:e=>{p("email")}}),null!==r&&void 0!==r&&r.configuration.disableGoogleLogin?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)(S,{setUser:l,isLoading:c,setIsLoading:d,setErrorMessage:u}),null!==r&&void 0!==r&&r.configuration.disableFacebookLogin?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)(A,{setUser:l,isLoading:c,setIsLoading:d,setErrorMessage:u}),null!==r&&void 0!==r&&r.configuration.disableEmailLogin&&null!==r&&void 0!==r&&r.configuration.disableMobileLogin&&null!==r&&void 0!==r&&r.configuration.disableGoogleLogin&&null!==r&&void 0!==r&&null!==(n=r.configuration)&&void 0!==n&&n.disableFacebookLogin?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)(w.Fragment,{children:a?(0,w.jsxs)("div",{className:"mt-2",children:["Already have an account?"," ",(0,w.jsx)(g.N_,{to:U+(s?"?redirect="+s:""),children:"Login"})]}):(0,w.jsxs)("div",{className:"mt-2",children:["Don't have an account?"," ",(0,w.jsx)(g.N_,{to:V+(s?"?redirect="+s:""),children:"Register now"})]})})]}),(0,w.jsx)("div",{className:"pt-6",children:(0,w.jsx)("div",{className:"flex justify-between pb-4 text-center text-xs text-secondary-foreground/85",children:(0,w.jsxs)("span",{children:["By clicking \u201cContinue with Email/Start with Google/Start with Facebook\u201d above, you acknowledge that you have read and understood, and agree to our\xa0",(0,w.jsx)("span",{children:(0,w.jsx)("a",{href:o&&o.termsAndConditionsLink?o.termsAndConditionsLink:"https://www.pensil.in/terms-conditions",children:"Terms & Conditions"})}),"\xa0and\xa0",(0,w.jsx)("span",{children:(0,w.jsx)("a",{href:o&&o.privacyPolicyLink?o.privacyPolicyLink:"https://www.pensil.in/privacy-policy",children:"Privacy Policy"})})]})})})]},"1")})}const _="facebook-login";function A(e){let{setIsLoading:t=(e=>{}),setErrorMessage:n=(e=>{}),setUser:r=(e=>{})}=e;return window.location.hostname.startsWith("app.pensil")?(0,w.jsx)(P,{setErrorMessage:n,setIsLoading:t,setUser:r}):(0,w.jsxs)("a",{href:"http://app.pensil.com"+(window.location.port?":"+window.location.port:"")+"?redirect="+window.location.protocol+"//"+window.location.host+window.location.pathname+"&action=".concat(_),className:"login-with-google mb-3 rounded border-border py-2 text-secondary-foreground hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/facebook-logo.svg",width:"20px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Start with Facebook"})]})}const C="google-login";function S(e){let{setIsLoading:t=(e=>{}),setErrorMessage:n=(e=>{}),setUser:r=(e=>{})}=e;return window.location.hostname.startsWith("app.pensil")?(0,w.jsx)(E,{setErrorMessage:n,setIsLoading:t,setUser:r}):(0,w.jsxs)("a",{href:"http://app.pensil.com"+(window.location.port?":"+window.location.port:"")+"?redirect="+window.location.protocol+"//"+window.location.host+window.location.pathname+"&action=".concat(C),className:"login-with-google mb-3 rounded border-border py-2 text-secondary-foreground hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/google-logo.svg",width:"15px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Start with Google"})]})}function j(e){let{redirect:t=null,communityDetail:n=null,redirectSubdomain:r=null,isLoading:o=!1,setIsLoading:i=(e=>{}),setErrorMessage:s=(e=>{})}=e;const{signIn:l,loaded:c}=(0,m.useGoogleLogin)({onSuccess:e=>{i(!0),console.log("Silent success response",{response:e});const{accessToken:n}=e;d.uR.googleLoginV2(n).then((e=>{localStorage.setItem("pensil.user",JSON.stringify(e.user)),k.r.track("login",{name:e.user?e.user.name:null,email:e.user?e.user.email:null,mobile:e.user?e.user.mobile:null,googlelogin:!0}),window.location.href=t+"?token="+e.user.token})).catch((e=>{console.log({SilentError:e}),e&&e.response&&e.response.data.message&&(e.response.data.errors.mobile&&s(e.response.data.errors.mobile[0]),e.response.data.errors.otp&&s(e.response.data.errors.otp[0])),i(!1),window.location.href=t+"?error=Google+Login+Failed!"}))},onFailure:e=>{console.log({SilentError:JSON.stringify(e,null,2),errorResponse:e}),window.location.href=t+"?error=Google+Login+Failed!"},onAutoLoadFinished:e=>{console.log("auto load finished",e)},clientId:y.q7.clientId});return(0,w.jsx)("div",{children:(0,w.jsxs)("div",{className:"card bg-card",children:[n&&n.logo?(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:n.logo,alt:""})}):r?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:"/assets/vectors/main-logo-square-blue.svg",alt:""})}),(0,w.jsx)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:"Login"}),(0,w.jsxs)("div",{onClick:l,className:"login-with-google mb-3 rounded border-border py-2 hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/google-logo.svg",width:"25px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Click here for Google Login"})]}),(0,w.jsx)("div",{children:"For security reasons, you have to manually initiate google login, Click the button above!"}),(0,w.jsxs)("div",{className:"mt-5",children:["Want to use different method?"," ",(0,w.jsx)("a",{href:t||U,children:"Go back"})]}),o?(0,w.jsx)(a.aH,{}):(0,w.jsx)(w.Fragment,{})]})},"1")}function E(e){let{setUser:t=(e=>{}),setErrorMessage:n=(e=>{}),setIsLoading:r=(e=>{})}=e;return(0,w.jsx)(f(),{clientId:y.q7.clientId,render:e=>(0,w.jsxs)("div",{...e,className:"login-with-google mb-3 rounded border-border py-2 hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/google-logo.svg",width:"15px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Start with Google"})]}),onSuccess:async e=>{const{accessToken:o}=e;r(!0);try{const e=await d.uR.googleLoginV2(o);localStorage.setItem("pensil.user",JSON.stringify(e.user)),k.r.track("login",{name:e.user?e.user.name:null,email:e.user?e.user.email:null,mobile:e.user?e.user.mobile:null,googlelogin:!0}),t(e.user)}catch(i){console.log({error:i}),i&&i.response&&i.response.data.message&&(i.response.data.errors.mobile&&n(i.response.data.errors.mobile[0]),i.response.data.errors.otp&&n(i.response.data.errors.otp[0])),r(!1)}},onFailure:e=>{console.log({errorResponse:e})}})}function N(e){let{redirect:t=null,communityDetail:n=null,redirectSubdomain:r=null,isLoading:o=!1,setIsLoading:i=(e=>{}),setErrorMessage:s=(e=>{})}=e;return(0,w.jsx)("div",{children:(0,w.jsxs)("div",{className:"card bg-card",children:[n&&n.logo?(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:n.logo,alt:""})}):r?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:"/assets/vectors/main-logo-square-blue.svg",alt:""})}),(0,w.jsx)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:"Login"}),(0,w.jsx)(h(),{appId:y.V2.appId,fields:"name,email,picture,mobile",render:e=>(0,w.jsxs)("div",{...e,className:"login-with-google mb-3 rounded border-border py-2 hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/facebook-logo.svg",width:"25px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Click here for Facebook Login"})]}),callback:async e=>{const{accessToken:n}=e;i(!0);try{const e=await d.uR.facebookLogin(n);localStorage.setItem("pensil.user",JSON.stringify(e.user)),k.r.track("login",{name:e.user?e.user.name:null,email:e.user?e.user.email:null,mobile:e.user?e.user.mobile:null,facebookLogin:!0}),window.location.href=t+"?token="+e.user.token}catch(r){console.log({error:r}),r&&r.response&&r.response.data.message&&(r.response.data.errors.mobile&&s(r.response.data.errors.mobile[0]),r.response.data.errors.otp&&s(r.response.data.errors.otp[0])),i(!1),window.location.href=t+"?error=Facebook+Login+Failed!"}}}),(0,w.jsx)("div",{children:"For security reasons, you have to manually initiate google login, Click the button above!"}),(0,w.jsxs)("div",{className:"mt-5",children:["Want to use different method?"," ",(0,w.jsx)("a",{href:t||U,children:"Go back"})]}),o?(0,w.jsx)(a.aH,{}):(0,w.jsx)(w.Fragment,{})]})},"1")}function P(e){let{setUser:t=(e=>{}),setErrorMessage:n=(e=>{}),setIsLoading:r=(e=>{})}=e;return(0,w.jsx)(h(),{appId:y.V2.appId,fields:"name,email,picture,mobile",render:e=>(0,w.jsxs)("div",{...e,className:"login-with-google mb-3 rounded border-border py-2 hover:bg-background",children:[(0,w.jsx)("img",{src:"/assets/vectors/facebook-logo.svg",width:"20px",alt:""}),(0,w.jsx)("span",{className:"ml-3",children:"Start with Facebook"})]}),callback:async e=>{const{accessToken:o}=e;r(!0);try{const e=await d.uR.facebookLogin(o);localStorage.setItem("pensil.user",JSON.stringify(e.user)),k.r.track("login",{name:e.user?e.user.name:null,email:e.user?e.user.email:null,mobile:e.user?e.user.mobile:null,facebookLogin:!0}),t(e.user)}catch(i){console.log({error:i}),i&&i.response&&i.response.data.message&&(i.response.data.errors.mobile&&n(i.response.data.errors.mobile[0]),i.response.data.errors.otp&&n(i.response.data.errors.otp[0])),r(!1)}}})}function D(e){let{label:t="Click Here",icon:n=null,className:r="",onClick:o=(e=>{}),...i}=e;return(0,w.jsxs)("div",{...i,className:"flex cursor-pointer place-content-center rounded border border-border py-2 hover:bg-background "+r,onClick:o,children:[n?(0,w.jsx)(v.A,{icon:n}):(0,w.jsx)(w.Fragment,{}),(0,w.jsx)("span",{className:"ml-3",children:t})]})}var M=n(5564),T=n.n(M),I=n(65186),O=n(44139),L=n(68536);function R(e){let{community:t,communityDetail:n,setUser:o,isRegister:i=!1,redirectSubdomain:s="",errorMessage:a="",setErrorMessage:l=(e=>{}),redirectURL:d="",setAuthType:u=(e=>{})}=e;const[p,h]=(0,r.useState)(1),[m,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(""),[v,y]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[_,A]=(0,r.useState)(""),[C,S]=(0,r.useState)(""),[j,E]=(0,r.useState)(!1),N=new URLSearchParams(window.location.search).get("email"),[P,D]=(0,r.useState)(""),M=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(N);(0,r.useEffect)((()=>{M&&(b(N),f(!0))}),[]);const T=()=>{if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*$/.test(g))return D("Email is not valid");f(!0),E(!0),L.u.requestEmailOTP(g,t?t.id:null).then((e=>{h(2),E(!1)})).catch((e=>{e&&e.response&&e.response.data.message&&(e&&e.response&&e.response.data&&e.response.data.errors&&e.response.data.errors.email?l(e.response.data.errors.email[0]):l(e.response.data.message)),E(!1)}))};return t&&t.authRedirectUrl&&(0,c.D4)(t),(0,w.jsx)("div",{children:1===p?(0,w.jsx)(B,{communityDetail:n,email:g,emailfromUrl:N,isValidEmailFromUrl:M,setEmail:b,setStep:h,error:P,setError:D,isLoading:j,setUser:o,setIsLoading:E,isFormSubmitable:m,setIsFormSubmitable:f,setErrorMessage:l,redirectSubdomain:s,redirectURL:d,sendOTP:T,isRegister:i,setAuthType:u}):(0,w.jsx)(z,{communityDetail:n,isFormSubmitable:m,setIsFormSubmitable:f,email:g,otp1:v,otp2:k,otp3:_,otp4:C,isLoading:j,setIsLoading:E,setOtp1:y,setOtp2:x,setOtp3:A,setOtp4:S,setUser:o,setErrorMessage:l,setStep:h,sendOTP:T,isRegister:i})})}function B(e){let{communityDetail:t=null,setCountryCode:n=(e=>{}),email:r="",emailfromUrl:o="",isValidEmailFromUrl:i=!1,setEmail:s=(e=>{}),setStep:l=(e=>{}),error:c,isLoading:d=!1,setIsLoading:u=(e=>{}),setUser:p=(e=>{}),isFormSubmitable:h=!1,setIsFormSubmitable:m=(e=>{}),setErrorMessage:f=(e=>{}),redirectSubdomain:b=null,redirectURL:v=null,sendOTP:y=(()=>{}),setError:k,isRegister:x=!1,setAuthType:_=(e=>{})}=e;return(0,w.jsxs)("div",{children:[(0,w.jsxs)("div",{className:"card bg-card",children:[t&&t.logo?(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:t.logo,alt:""})}):b?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:"/assets/vectors/main-logo-square-blue.svg",alt:""})}),(0,w.jsx)("div",{className:"pb-4 text-center text-lg font-semibold text-secondary-foreground/85",children:x?"Register":"Login"}),(0,w.jsx)("span",{className:"block text-center font-semibold text-secondary-foreground/85",children:"Continue with your email"}),(0,w.jsx)("div",{className:"flex w-full items-center",children:(0,w.jsx)(a.ks,{placeholder:"Enter Email",readOnly:i,defaultValue:i?o:"",containerClassName:"flex-grow block",className:T()("py-2",{"text-secondary-foreground/80":i}),onChange:e=>{s(e),m(!0),k("")}})}),(0,w.jsx)(a.jQ,{error:c}),(0,w.jsx)("div",{className:"flex justify-center",children:(0,w.jsx)(O.$,{disabled:!h,onClick:y,className:"w-full py-2",isLoading:d,label:x?"Get Started":"Login"})}),(0,w.jsxs)("div",{className:"or flex items-center justify-center",children:[(0,w.jsx)("span",{className:"line"}),(0,w.jsx)("span",{className:"text",children:"or"}),(0,w.jsx)("span",{className:"line"})]}),(0,w.jsxs)("div",{className:"mt-2",children:["Want to use different method?"," ",(0,w.jsx)(g.N_,{to:U+(v?"?redirect="+v:""),onClick:e=>{e.preventDefault(),_(null)},children:"Login"})]})]}),(0,w.jsx)("div",{className:"pt-6",children:(0,w.jsx)("div",{className:"flex justify-between pb-4 text-center text-xs text-secondary-foreground/85",children:(0,w.jsxs)("span",{children:["By clicking \u201cContinue with Email/Start with Google/Start with Facebook\u201d above, you acknowledge that you have read and understood, and agree to our\xa0",(0,w.jsx)("span",{children:(0,w.jsx)("a",{href:t&&t.termsAndConditionsLink?t.termsAndConditionsLink:"https://www.pensil.in/terms-conditions",children:"Terms & Conditions"})}),"\xa0and\xa0",(0,w.jsx)("span",{children:(0,w.jsx)("a",{href:t&&t.privacyPolicyLink?t.privacyPolicyLink:"https://www.pensil.in/privacy-policy",children:"Privacy Policy"})})]})})})]},"1")}function z(e){let{communityDetail:t=null,countryCode:n="",email:o="",isLoading:i=!1,setIsLoading:s=(e=>{}),setUser:a=(e=>{}),setStep:l=(e=>{}),setErrorMessage:u=(e=>{}),sendOTP:p=(()=>{}),isRegister:h=!1}=e;const[m,f]=(0,r.useState)(""),{analyticsService:g}=(0,I.W)(),[b,y]=(0,r.useState)(!1);return(0,w.jsxs)("div",{className:"card bg-card",style:{paddingTop:"1rem"},children:[t&&t.logo?(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:t.logo,alt:""})}):(0,w.jsx)("div",{className:"pensil-logo",children:(0,w.jsx)("img",{src:"/assets/vectors/main-logo-white.svg",alt:""})}),(0,w.jsxs)("div",{className:"my-2 flex cursor-pointer items-center space-x-4 pb-8",onClick:e=>{l(1)},children:[(0,w.jsx)(v.A,{icon:"angle-left"}),(0,w.jsx)("span",{className:"font-semibold text-secondary-foreground/85",children:"Confirm Email"})]}),(0,w.jsxs)("span",{className:"font-semibold text-secondary-foreground/85",children:["Please Enter the magic code sent on ",n,o]}),(0,w.jsx)("div",{className:"mt-2 rounded border border-border focus:outline-none",children:(0,w.jsx)("input",{type:"text",maxLength:4,className:"flex w-full rounded bg-transparent py-3 text-center text-xl focus:outline-none",value:m,onChange:e=>{/^[0-9]*$/.test(e.target.value)&&f(e.target.value),4===e.target.value.length?y(!0):y(!1)}})}),(0,w.jsx)("div",{className:"mb-10 text-right",children:(0,w.jsx)("span",{onClick:p,className:"cursor-pointer px-1 text-xs font-semibold text-primary",children:"Re-Send Code"})}),(0,w.jsx)("div",{className:"flex justify-center",children:(0,w.jsx)(O.$,{disabled:!b,onClick:async()=>{s(!0);try{const r=await L.u.verifyEmailOTP(n,o,parseInt(m)),{user:i}=r;localStorage.setItem("pensil.user",JSON.stringify(r.user));let s=null;if(t){try{const e=await d.BE.getCommunityById(i,t.id);e&&!e.joined&&(await d.BE.joinCommunity(i,e.id),g.track("subscribe-community",{communityPlan:e.plan?e.plan.planType:"free"}))}catch(e){console.log({error:e,message:"Loading community by id failed!"})}s=(0,c.IT)(t)}const l=h?{email:o}:{email:o,userName:null===i||void 0===i?void 0:i.name};g.track(h?"signup":"login",l),a(r.user)}catch(e){e&&e.response&&e.response.data.message&&(e.response.data.errors.email&&u(e.response.data.errors.email[0]),e.response.data.errors.otp&&u(e.response.data.errors.otp[0])),s(!1)}},className:"w-full py-2",isLoading:i,label:"Confirm"})})]},"2")}const F=r.lazy((()=>Promise.all([n.e(867),n.e(220)]).then(n.bind(n,26220)))),U="/login",V="/register",G="/login-email",H="/register-email";const W=(0,o.Ng)((e=>({community:e.community})),(e=>(0,i.zH)({setUser:u.jw},e)))((function(e){let{community:t,setUser:n,isRegister:o=!1}=e;const[i,u]=(0,r.useState)(null),[p,h]=(0,r.useState)(""),[m,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)([G,H].includes(window.location.pathname)?"email":null),v=new URLSearchParams(window.location.search),y=v.get("redirect"),k=v.get("error");let _=null;const A=window.location.origin;try{_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"stocomo-community";const t=new URL(e),n=e.replace(/http(s)?(:\/\/)/g,"").split(".")[0];return(t.hostname.endsWith("pensil.in")||t.hostname.endsWith("pensil.com")||t.hostname.endsWith("pensil.so"))&&"app"!==n&&"embed"!==n?n:t.hostname.startsWith("app.pensil.")?"":t.hostname}(y||A)}catch(S){}if((0,r.useEffect)((()=>{k&&h(k)}),[k]),(0,r.useEffect)((()=>{_&&d.BE.getCommunity(_).then((e=>{let{community:t}=e;u(t)})).catch((e=>{console.log({error:e})}))}),[_]),t&&t.authRedirectUrl)return(0,c.D4)(t),(0,w.jsxs)("div",{className:"bg-default flex h-screen flex-col items-center justify-center",children:[(0,w.jsx)(s.B,{community:t}),(0,w.jsx)(l.A,{}),(0,w.jsx)("span",{className:"text-gray-500",children:"Please wait while we are redirecting you..."})]});const C=e=>{n(e)};return(0,w.jsx)("div",{style:{},className:"LoginPage",children:(0,w.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,w.jsxs)("div",{className:"relative w-96",children:[(0,w.jsx)(a.Sm,{error:p}),g?"email"===g?(0,w.jsx)(R,{community:t,communityDetail:i,redirectSubdomain:_,redirectURL:y,isRegister:o,setUser:C,isLoading:m,setIsLoading:f,setErrorMessage:h,setAuthType:b}):(0,w.jsx)(r.Suspense,{fallback:(0,w.jsx)(w.Fragment,{}),children:(0,w.jsx)(F,{community:t,communityDetail:i,redirectSubdomain:_,redirectURL:y,isRegister:o,setUser:C,isLoading:m,setIsLoading:f,setErrorMessage:h,setAuthType:b})}):(0,w.jsx)(x,{community:t,communityDetail:i,redirectSubdomain:_,redirectURL:y,isRegister:o,setUser:C,isLoading:m,setIsLoading:f,setErrorMessage:h,setAuthType:b})]})})})}))},42088:(e,t,n)=>{"use strict";n.d(t,{Hm:()=>o,cs:()=>r});const r=e=>"https://stocomomeeting.motilaloswal.com/"+e,o=(e,t)=>"https://stocomomeeting.motilaloswal.com/join/"+e+"?token="+t},65350:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TAG_PAGE_ROUTE:()=>b,default:()=>y,showTagPageRoute:()=>v});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(98020),l=n(82993),c=n(89449),d=n(62270),u=n(8233),p=n(53871),h=n(19328),m=n(18040),f=n(70924),g=n(62391);const b="/tagged",v=e=>"/tagged?tag="+e;const y=(0,c.wj)((0,s.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups})),(e=>(0,l.zH)({},e)))((function(e){let{user:t,community:n,groups:r,updateGroups:s}=e;const[l,c]=(0,i.useState)(!1),[b,v]=(0,i.useState)(""),[y,k]=(0,i.useState)(!1),[w,x]=(0,i.useState)(!1),[_,A]=(0,i.useState)("All Groups"),[C,S]=(0,i.useState)("All Channels"),[j,E]=(0,i.useState)(""),[N,P]=(0,i.useState)(""),[D,M]=(0,i.useState)([]),[T,I]=(0,i.useState)(1),O=(0,d.A)(),[L,R]=(0,i.useState)(!1),[B,z]=(0,i.useState)(!1),[F,U]=(0,i.useState)([]),V=(0,i.useRef)(),G=(0,a.zy)();(0,i.useEffect)((()=>{const e=e=>{y?k(!1):w&&x(!1)};return window.document.body.addEventListener("click",e),()=>{window.document.body.removeEventListener("click",e)}}),[y,w]),(0,i.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get("tag");void 0!==e&&""!==e?(v("#".concat(e)),H(t,n.id,1,e,"","")):V&&V.current&&V.current.focus()}),[t,n,G]);const H=async(e,t,n,r,o,i)=>{R(!0);let s=await f.K.getPostByTagSearch(e,t,n,r,o,i);await U(s.posts),R(!1)},W=async(e,o)=>{let i=[];A(e),I(1),i=r.filter((t=>t.name===e)),i.length>0?M(i[0].tabs):M([]),S("All Channel"),H(t,n.id,1,b.slice(1),"",o),P(o),z(!1)},q=async(e,r)=>{await S(e),I(1),await H(t,n.id,1,b.slice(1),r,N),await E(r),z(!1)};return(0,i.useEffect)((()=>{const e=()=>{window.innerHeight+window.scrollY+100>=document.body.offsetHeight&&(L||B||(R(!0),f.K.getPostByTagSearch(t,n.id,T+1,b.slice(1),j,N).then((e=>{0===e.posts.length?z(!0):(U([...F,...e.posts]),I(e.page)),R(!1)}))))};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[L,t,T,F,B,n.id]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"TagPage",children:[(0,g.jsxs)("div",{className:"GroupInfo mb-4 rounded bg-card px-3 py-2",children:[(0,g.jsx)("div",{className:"flex items-center justify-between",children:(0,g.jsx)("div",{className:o()("w-full overflow-ellipsis p-4 pb-3 font-bold text-secondary-foreground/85"),children:(0,g.jsxs)("div",{className:"mb-4 flex items-center rounded border border-border bg-background px-4 py-1",children:[(0,g.jsx)("input",{type:"text",ref:V,placeholder:O.trans("Search for tags"),value:b,onChange:e=>{v(e.target.value)},className:"flex-grow bg-transparent px-4 py-1 font-bold text-secondary-foreground/80 focus:outline-none"}),(0,g.jsx)("img",{onClick:()=>H(t,n.id,T,b.slice(1),""),src:u.A,alt:"",className:"search-tag-icon cursor-pointer",style:{filter:"opacity(0.5)",width:"18px"}})]})})}),(0,g.jsxs)("div",{className:"flex",children:[(0,g.jsx)("div",{className:"pl-4",children:(0,g.jsxs)("div",{className:"dropdown relative inline-block",children:[(0,g.jsxs)("button",{onClick:e=>k(!y),className:"inline-flex items-center rounded bg-primary px-4 py-2 font-semibold text-primary-foreground",children:[(0,g.jsx)("span",{className:"mr-1",children:_}),(0,g.jsxs)("svg",{className:"h-4 w-4 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:[(0,g.jsx)("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})," "]})]}),y?(0,g.jsxs)("ul",{className:"absolute z-10 block p-0 pt-1 text-secondary-foreground/85",children:[(0,g.jsx)("li",{onClick:()=>W("All Groups",""),className:"cursor-pointer list-none",children:(0,g.jsx)("span",{className:"theme-bg-disable whitespace-no-wrap block rounded-t px-4 py-2 hover:bg-background",children:(0,g.jsx)(p.A,{children:"All Groups"})})}),r?r.map(((e,t)=>(0,g.jsx)("li",{onClick:()=>W(e.name,e.id),className:"cursor-pointer list-none",children:(0,g.jsx)("span",{className:"theme-bg-disable whitespace-no-wrap block rounded-t px-4 py-2 hover:bg-background",children:e.name})},t))):null]}):null]})}),(0,g.jsx)("div",{className:"pl-4",children:"All Groups"!==_?(0,g.jsxs)("div",{className:"dropdown relative inline-block",children:[(0,g.jsxs)("button",{onClick:e=>x(!w),className:"inline-flex items-center rounded bg-primary px-4 py-2 font-semibold text-primary-foreground",children:[(0,g.jsx)("span",{className:"mr-1",children:C}),(0,g.jsxs)("svg",{className:"h-4 w-4 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:[(0,g.jsx)("path",{d:"M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"})," "]})]}),w?(0,g.jsxs)("ul",{className:"absolute z-10 block p-0 pt-1 text-secondary-foreground/85",children:[(0,g.jsx)("li",{onClick:()=>q("All Channel",""),className:"cursor-pointer list-none",children:(0,g.jsx)("span",{className:"theme-bg-disable whitespace-no-wrap block rounded-t px-4 py-2 hover:bg-background",children:(0,g.jsx)(p.A,{children:"All Channel"})})}),D?D.map(((e,t)=>(0,g.jsx)("li",{onClick:()=>q(e.name,e.id),className:"cursor-pointer list-none",children:(0,g.jsx)("span",{className:"theme-bg-disable whitespace-no-wrap block rounded-t px-4 py-2 hover:bg-background",children:e.name})},t))):null]}):null]}):null})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{className:"pl-2",children:(0,g.jsx)("span",{className:"font-bold text-secondary-foreground/70",children:(0,g.jsx)(p.A,{children:"SEARCH RESULT"})})}),!L&&F.length>0?(0,g.jsx)(m.B,{posts:F,allPosts:F,setPosts:U}):(0,g.jsx)(g.Fragment,{}),L?(0,g.jsx)("div",{className:"align-center flex justify-center py-5",children:(0,g.jsx)(h.a,{})}):0===F.length?(0,g.jsx)("div",{className:"text-center font-semibold text-secondary-foreground/70",children:(0,g.jsx)(p.A,{children:"No posts found for selected hashtag"})}):(0,g.jsx)(g.Fragment,{})]})]}),(0,g.jsx)("div",{className:"secondary-sidebar pr-5"})]})})))},92139:(e,t,n)=>{"use strict";n.d(t,{A:()=>h,C:()=>f});var r=n(72006),o=n.n(r),i=n(20975),s=n(89449),a=n(51772),l=n(15102),c=n(25715),d=n(799),u=n(43039),p=n(62391);function h(e){let{user:t,community:n,groups:r,invites:o,setInvites:c=(e=>{}),setTotalInvites:h=(e=>{}),totalInvites:g,isLoading:b,page:v,setPage:y=(e=>{}),addToast:k}=e;const[w,x]=(0,i.useState)([]),[_,A]=(0,i.useState)(!1),[C,S]=(0,i.useState)(!1),j=e=>{-1===w.findIndex((t=>t.id===e.id))?x([...w,e]):x(w.filter((t=>t.id!==e.id)))};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"w-full",children:[(0,p.jsx)(l.y,{IsDisplay:w.length>0,transition:"scale",className:"flex justify-end",children:(0,p.jsxs)("div",{className:"flex",children:[(0,p.jsx)(a.$n,{label:"Resend Invites",className:"m-2 mr-2",onClick:function(){if(w&&w.length<1)return;A(!0);const e=w.map((e=>e.id));u._N.resendBulkMail(t,n.id,e).then((e=>{k("Invite sent successfully"),x([])})).catch((e=>{console.log(e),k("Error sending invite","",s.lm.danger)})).then((()=>{A(!1)}))},isLoading:_,disabled:C}),(0,p.jsx)(a.$n,{label:"Cancel Invites",className:"m-2",onClick:function(){if(w&&w.length<1)return;if(!window.confirm("Are you sure you want to cancel ".concat(w.length).concat(w.length>1?" invites":" invite","?")))return;S(!0);const e=w.map((e=>e.id));u._N.cancelBulkMail(t,n.id,e).then((t=>{k("Invite cancelled successfully");const n=o.filter((t=>!e.includes(t.id)));c(n),h(g-w.length),x([])})).catch((e=>{console.log(e),k("Error cancelling invite","",s.lm.danger)})).then((()=>{S(!1)}))},isLoading:C,disabled:_})]})}),(0,p.jsxs)("table",{className:"w-full min-w-full table-auto rounded border border-border text-sm text-secondary-foreground/80",children:[(0,p.jsx)("thead",{className:"bg-background text-left text-xs uppercase text-secondary-foreground",children:(0,p.jsxs)("tr",{children:[(0,p.jsx)("th",{scope:"col",className:"px-1 py-3"}),(0,p.jsx)("th",{scope:"col",className:"px-3 py-3",children:"Name"}),(0,p.jsx)("th",{scope:"col",className:"px-1 py-3",children:"Email"}),(0,p.jsx)("th",{scope:"col",className:"px-1 py-3 pr-16",children:"Invited"}),(0,p.jsx)("th",{scope:"col",className:"px-1 py-3",children:"Status"}),(0,p.jsx)("th",{scope:"col",className:"px-1 py-3",children:"Invited To"}),(0,p.jsx)("th",{scope:"col",className:"px-1 py-3"})]})}),(0,p.jsx)("tbody",{children:b?[...Array(10)].map(((e,t)=>(0,p.jsx)(f,{},t))):(0,p.jsx)(p.Fragment,{children:o.length>0?o.map(((e,i)=>(0,p.jsx)(m,{invitedUser:e,user:t,community:n,groups:r,onUserSelected:j,isSelected:-1!==w.findIndex((t=>t.id===e.id)),onInviteCancel:e=>{const t=o.filter((t=>t.id!==e.id));c(t),h(g-1)},addToast:k},i))):(0,p.jsxs)("tr",{className:"h-32 w-full place-content-center items-center justify-center text-center",colSpan:"5",children:[(0,p.jsx)("td",{}),(0,p.jsx)("td",{}),(0,p.jsx)("td",{}),(0,p.jsx)("td",{className:"text-secondary-foreground/70",children:"No invite sent"}),(0,p.jsx)("td",{}),(0,p.jsx)("td",{})]})})})]})]}),(0,p.jsx)("div",{children:(0,p.jsx)(d.A,{className:"pagination-bar justify-center",currentPage:v,totalCount:g,pageSize:10,onPageChange:y})})]})}function m(e){let{index:t,invitedUser:n,user:r,groups:l,community:d,onInviteCancel:h=(e=>{}),addToast:m,onUserSelected:f,isSelected:g}=e;const[b,v]=(0,i.useState)();return(0,p.jsxs)("tr",{className:"border-b border-border bg-card hover:bg-background",children:[(0,p.jsx)("td",{className:"flex place-content-center py-3 pl-1",children:(0,p.jsx)("input",{type:"checkbox",disabled:n.isAccepted,checked:g,onChange:()=>f(n),className:"ml-1 ".concat(n.isAccepted?"cursor-not-allowed disabled:opacity-75":"cursor-pointer")})}),(0,p.jsx)("td",{className:"px-3 py-2 font-medium text-secondary-foreground",children:n.name&&n.name.length>0?n.name:"-"}),(0,p.jsx)("td",{className:"px-1 py-2 text-secondary-foreground/80",children:n.email&&n.email.length>0?n.email:"-"}),(0,p.jsx)("td",{className:"px-1 py-2 text-secondary-foreground/80",children:o()(n.createdAt).fromNow()}),(0,p.jsxs)("td",{className:"flex items-center px-1 py-2",children:[n.isAccepted?(0,p.jsx)("div",{className:"mr-1 h-2 w-2 rounded-full bg-green-500"}):(0,p.jsx)("div",{className:"mr-1 h-2 w-2 rounded-full bg-warning"}),n.isAccepted?"Joined":"Pending"]}),(0,p.jsx)("td",{className:"px-1 py-2 text-secondary-foreground/80",children:null==n.group?d.name:function(e){let t="-";return e?(l.forEach((n=>{n.id===e&&(t=n.name)})),t):t}(n.group)}),(0,p.jsx)("td",{className:"w-8",children:b?(0,p.jsx)(a.aH,{}):(0,p.jsx)(c.A,{actions:[!n.isAccepted&&{icon:"paper-plane",label:"Resend Invite",onClick:()=>{v(!0);const e={groupId:n.group?n.group:null,additionalMessage:"",memberData:[{email:n.email,name:n.name}]};u._N.inviteByEmail(r,d.id,e).then((e=>{m("Invite sent successfully")})).catch((e=>{console.log(e),m("Error sending invite","",s.lm.danger)})).finally((()=>{v(!1)}))}},!n.isAccepted&&{icon:"cross",label:"Cancel Invite",actionType:c.X.alert,onClick:()=>{v(!0),u._N.cancelBulkMail(r,d.id,[n.id]).then((e=>{m("Invite cancelled successfully"),h(n)})).catch((e=>{console.log(e),m("Error cancelling invite","",s.lm.danger)})).then((()=>{v(!1)}))}}]})})]},t)}function f(){return(0,p.jsxs)("tr",{className:"my-2 w-full animate-pulse border-b border-border bg-card py-2 hover:bg-background",children:[(0,p.jsx)("td",{className:"pl-1",children:(0,p.jsx)("div",{className:"mx-1 my-2 bg-background py-3"})}),(0,p.jsx)("td",{className:" ",children:(0,p.jsx)("div",{className:"my-2 mr-6 bg-background py-3"})}),(0,p.jsx)("td",{className:" ",children:(0,p.jsx)("div",{className:"my-2 mr-6 bg-background py-3"})}),(0,p.jsx)("td",{className:" ",children:(0,p.jsx)("div",{className:"my-2 mr-6 bg-background py-3"})}),(0,p.jsx)("td",{className:" ",children:(0,p.jsx)("div",{className:"my-2 mr-6 bg-background py-3"})}),(0,p.jsx)("td",{className:" ",children:(0,p.jsx)("div",{className:"my-2 mr-6 bg-background py-3"})})]})}},87573:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,B:()=>r});const r=Object.freeze({Post:{name:"Post",create:"Create",update:"Update",delete:"Delete",like:"Like",unlike:"Unlike",share:"Share",comment:{name:"Comment",create:"Create",update:"Update",delete:"Delete",reply:{name:"Reply",create:"Create",update:"Update",delete:"Delete"}}},User:{name:"User",create:"Create",update:"Update",login:"Login",logout:"Logout"},Group:{name:"Group",join:"Join",leave:"Leave"}});class o{static logEvent(e,t){if(window.umami&&null!==window.umami)try{window.umami.trackEvent(t,e),console.log("track",e,t)}catch(n){console.log(n)}else console.warn("AnalyticsService: Analytics is not initialized.")}static logPageView(e){if(window.umami&&null!==window.umami)try{window.umami.trackView(e),console.log("trackView",e)}catch(t){console.log(t)}else console.warn("AnalyticsService: Analytics is not initialized.")}}},68536:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});var r=n(44427),o=n(78220);class i{static async requestOTP(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return r.A.post(o.vZ.auth.loginWithOTP,{countryCode:e,mobile:t,communityId:n,captchaToken:i}).then((e=>e.data))}static async requestEmailOTP(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.A.post(o.vZ.auth.loginWithEmailOTP,{email:e,communityId:t}).then((e=>e.data))}static async verifyOTP(e,t,n){return r.A.post(o.vZ.auth.verifyOTP,{countryCode:e,mobile:t,otp:n}).then((e=>e.data))}static async verifyEmailOTP(e,t,n){return r.A.post(o.vZ.auth.verifyOTP,{countryCode:e,email:t,otp:n}).then((e=>e.data))}static async googleLoginV2(e){return r.A.post(o.vZ.auth.googleLoginV2,{},{headers:{Authorization:"Bearer "+e}}).then((e=>e.data))}static async facebookLogin(e){return r.A.post(o.vZ.auth.facebookLogin,{},{headers:{Authorization:"Bearer "+e}}).then((e=>e.data))}static async web3Login(e){return r.A.post(o.vZ.auth.web3Login,{},{headers:{Authorization:"Bearer "+e}}).then((e=>e.data))}}},42498:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(44427),o=n(78220);class i{static async getAllEvents(e,t,n){return r.A.get(o.vZ.event.getAllEvents(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async updateEventBanner(e,t,n,i){const s=new FormData;return s.append("banner",i,"banner.jpg"),r.A.post(o.vZ.event.updateEventBanner(t,n),s,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async createEvent(e,t,n,i,s,a,l,c,d,u,p,h,m,f,g,b,v){let y;return y=null!=m||null!=f?r.A.post(o.vZ.event.createRecurringEvent(t,h,m,f),{startTime:n,endTime:i,isPrivate:s,title:a,description:l,callType:c,location:d,webURL:u,maximumRegistrations:p,eventHost:g,createMeeting:b,meta:v},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data)):r.A.post(o.vZ.event.createEvent(t),{startTime:n,endTime:i,isPrivate:s,title:a,description:l,callType:c,location:d,webURL:u,maximumRegistrations:p,eventHost:g,createMeeting:b,meta:v},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data)),y}static async updateEvent(e,t,n,i,s,a,l,c,d,u,p,h,m,f,g){return r.A.post(o.vZ.event.updateEvent(t,n,i),{startTime:s,endTime:a,isPrivate:l,title:c,description:d,location:u,webURL:p,maximumRegistrations:h,eventHost:m,createMeeting:f,meta:g},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getEventDetail(e,t,n){return r.A.get(o.vZ.event.getEventDetail(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async getEventDetailBySlug(e,t,n){return r.A.get(o.vZ.event.getEventDetailBySlug(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async acceptInvitation(e,t,n){return r.A.post(o.vZ.event.acceptInvitation(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteEvent(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return r.A.delete(o.vZ.event.updateEvent(t,n,i,s),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateRSVP(e,t,n,i){return r.A.post(o.vZ.event.updateRSVP(t,n),{status:i},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async upcomingEvents(e,t,n){return r.A.get(o.vZ.event.upcomingEvents(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async latestGroupEvent(e,t,n){return r.A.get(o.vZ.event.latestGroupEvents(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async previousEvents(e,t,n){return r.A.get(o.vZ.event.previousEvents(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async inviteSections(e,t,n,i){return r.A.post(o.vZ.event.inviteSections(t,n),{groups:i},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getMeetingAttendance(e,t,n){return r.A.get(o.vZ.event.getMeetingAttendance(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async exportAttendanceCSV(e,t,n){return r.A.get(o.vZ.event.exportAttendanceCSV(t,n),{headers:{Authorization:"Bearer "+e.token},responseType:"blob"}).then((async e=>{const t=(await e.data.text()).split("\n"),n=t[0].split(",").map((e=>e.trim().toLowerCase().replace(/"/g,""))).findIndex((e=>"joinedat"===e||"joined at"===e||"joined_at"===e)),r=t.map(((e,t)=>{if(0===t||!e.trim())return e;const r=e.split(",");if(-1!==n&&r[n]){const e=r[n].replace(/"/g,"").trim(),t=new Date(e);isNaN(t)||(r[n]='"'.concat(t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),'"'))}return r.join(",")})),o=new Blob([r.join("\n")],{type:"text/csv"}),i=window.URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download="attendance.csv",s.click(),window.URL.revokeObjectURL(i)}))}}},43039:(e,t,n)=>{"use strict";n.d(t,{cu:()=>s,uR:()=>a.u,BE:()=>u,fk:()=>p,_N:()=>h,Bd:()=>m,u1:()=>f.u,SP:()=>g,To:()=>b,K$:()=>v.K,d4:()=>y,nC:()=>k.n,DL:()=>w,Cq:()=>x});var r=n(26914),o=n(36357);const i={"menu-click":"menu_click","destination-click":"destination_click","name-pop-up-shown":"name_pop_up_shown","name-submitted":"name_submitted",template:"template","widget-groupmember":"widget-groupmember","widget-leaderboard":"widget-leaderboard",search:"search","searched-result-clicked":"searched-result-clicked","quick-links-clicked":"quick-links-clicked","home-pressed":"home-pressed","embedded-channel-clicked":"embedded-channel-clicked","dm-clicked":"dm-clicked","calendar-clicked":"calendar-clicked","course-clicked":"course-clicked","see-notification":"see-notification","notification-clicked":"notification-clicked","create-post":"create-post","like-post":"like-post","like-clicked":"like-clicked","share-clicked":"share-clicked","post-clicked":"post-clicked","image-clicked":"image-clicked","post-comment":"post-comment","comment-clicked":"comment-clicked","post-reply":"post-reply","edit-post":"edit-post","delete-post":"delete-post","post-filter":"post-filter","featured-post-clicked":"featured-post-clicked","user-profile-clicked":"user-profile-clicked","user-profile-edit":"user-profile-edit","notification-clicked":"notification-clicked","edit-profile":"edit-profile","edit-profile-clicked-on-profile":"edit-profile-clicked-on-profile","dm-icon-clicked-on-profile":"dm-icon-clicked-on-profile",login:"login",signup:"signup",logout:"logout","profile-details":"profile-details","mobile-register-attempt":"mobile-register-attempt","mobile-register-attempt-redirect-email":"mobile-register-attempt-redirect-email","create-group":"create-group","join-group":"join-group","create-section":"create-section","join-section":"join-section","group-message":"group-message","explore-group-clicked":"explore-group-clicked","group-clicked-in-explore-groups":"group-clicked-in-explore-groups","click-select-widget":"click-select-widget","join-community":"join-community","subscribe-community":"subscribe-community","create-community":"create-community","select-community":"select-community","load-community":"load-community","community-banner-update":"community-banner-update","onboarding-message-update":"onboarding-message-update","onboard-add-new-message":"onboard-add-new-message","currency-updated":"currency-updated","bank-account-connect-request":"bank-account-connect-request","bank-account-disconnect-request":"bank-account-disconnect-request","invoice-details-updated":"invoice-details-updated","update-base-points":"update-base-points","create-new-embed-channel-button-clicked":"create-new-embed-channel-button-clicked","theme-updated":"theme-updated","notification-preference-updated":"notification-preference-updated","course-published":"course-published","make-community-private":"make-community-private","custom-domain-updated":"custom-domain-updated","custom-domain-removed":"custom-domain-removed","compare-plans-clicked":"compare-plans-clicked","cancel-plan":"cancel-plan","post-selected-from-widgets":"post-selected-from-widgets","event-selected-from-widget":"event-selected-from-widget","custom-widget-button-clicked":"custom-widget-button-clicked","country-code":"country-code","support-icon-clicked":"support-icon-clicked","create-new-chat":"create-new-chat"};class s{constructor(e){let{communityId:t,communityName:n,user:r,communityUrl:i}=e;this.communityId=void 0,this.sessionid=void 0,this.user=void 0,this.communityName=void 0,this.communityUrl=void 0,this.communityId=null!==t&&void 0!==t?t:"",this.communityName=null!==n&&void 0!==n?n:"",this.user=r,this.sessionid=(0,o.gZ)(),this.communityUrl=null!==i&&void 0!==i?i:window.location.href}updateValues(e){let{communityId:t,communityName:n,user:r,communityUrl:o}=e;t&&(this.communityId=t),n&&(this.communityName=n),r&&(this.user=r),o&&(this.communityUrl=o)}static Instance(e){let{communityId:t,communityName:n,user:r,communityUrl:o}=e;return s.instance||(s.instance=new s({communityId:t,communityName:n,user:r,communityUrl:null!==o&&void 0!==o?o:window.location.href})),s.instance.updateValues({communityId:t,communityName:n,user:r,communityUrl:null!==o&&void 0!==o?o:window.location.href}),s.instance}track(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const s=window.gtag||(()=>{});t.impressionId||(t.impressionId=(0,o.gZ)()),t.date=(new Date).toISOString().split("T")[0],t.communityId=this.communityId,t.communityName=this.communityName,this.user&&(t.user=this.user),t.sessionid=this.sessionid,t.communityUrl=this.communityUrl,n&&(t={...t,...n}),t={...t,event:i[e]},s("event",e,t),r.r.track(e,t),window.umami&&window.umami.trackEvent(t,e)}}s.instance=void 0;var a=n(68536),l=n(44427),c=n(78220),d=n(16118);class u{static async checkForAddressAvailability(e,t){return l.A.get(c.vZ.community.addressAvailability(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async createCommunity(e,t){return l.A.post(c.vZ.community.create,{name:e,address:t,selectedType:"paid"},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>(r.r.track("create-community",{communityname:e.data.community.name,communityurl:(0,d.IT)(e.data.community),logo:!!e.data.community.logo,typeSelection:e.data.community.typeSelection}),e.data)))}static async updateCommunity(e,t,n){let r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Asia/Kolkata",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",a=arguments.length>8?arguments[8]:void 0;return l.A.post(c.vZ.community.updateCommunity(e),{name:t,address:n,timezone:o,privacyPolicyLink:i,termsAndConditionsLink:s,meta:a},{headers:{Authorization:"Bearer "+r.token}}).then((e=>e.data))}static async updateCommunityWelcomeMessages(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return l.A.put(c.vZ.community.updateCommunityWelcomeMessages(e),{welcomeMessages:t},{headers:{Authorization:"Bearer "+n.token}}).then((e=>e.data))}static async updateCommunityBannerDetails(e,t,n,r){return l.A.post(c.vZ.community.updateCommunityBannerDetails(e),{bannerTitle:t,bannerDescription:n},{headers:{Authorization:"Bearer "+r.token}}).then((e=>e.data))}static async updateLogo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"light";const r=new FormData;return r.append("logo",t,t.fileName),l.A.post(c.vZ.community.updateLogo(e,n),r,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateCommunityBanner(e,t,n){const r=new FormData;return r.append("banner",n,n.fileName),l.A.post(c.vZ.community.updateCommunityBanner(e),r,{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}static async removeCommunityBanner(e,t){return l.A.delete(c.vZ.community.removeCommunityBanner(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateFavicon(e,t,n){const r=new FormData;return r.append("favicon",n,n.fileName),l.A.post(c.vZ.community.updateFavicon(e),r,{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}static async getCommunityGroups(e,t){return l.A.get(c.vZ.community.groups(e),{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}static async getMyLeaderboardScore(e){return l.A.get(c.vZ.community.getMyLeaderboardScore(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getLeaderboard(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10;return l.A.get(c.vZ.community.getLeaderboard(t,n,r,o),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getLeaderboardV2Paginated(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return l.A.get(c.vZ.community.getLeaderboardV2Paginated(e,t,n,r),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getMyKarmaPoints(e){return l.A.get(c.vZ.community.getMyKarmaPoints(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data)).catch((e=>e.response.data))}static async getCommunityKarmaPoints(e){return l.A.get(c.vZ.community.getCommunityKarmaPoints(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateCommunityKarmaPoints(e,t){return l.A.post(c.vZ.community.getCommunityKarmaPoints(e),{karmaPoints:t},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getSubscribedCommunity(e){return l.A.get(c.vZ.community.getSubscribedCommunities,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sortCommunityGroups(e,t,n){return l.A.post(c.vZ.community.sortGroups(t),{sortOrder:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sortCommunityGroupTabs(e,t,n,r){return l.A.post(c.vZ.community.sortGroupTabs(t,n),{sortOrder:r},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getCommunitySubscribers(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return l.A.get(c.vZ.community.subscribers(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getCommunitySubscribersPaginated(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";return l.A.get(c.vZ.community.subscribersPaginated(t,n,r,o,i),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async markSubscribersAsViewed(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return l.A.post(c.vZ.community.markSubscribersAsViewed(e),{userIds:t},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async makeUserModeratorInAllGroups(e,t,n,r){return l.A.post(c.vZ.community.makeUserModeratorInAllGroup(t,n,r),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getCommunity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return l.A.get(c.vZ.community.getCommunity(e),{}).then((e=>e.data))}static async getCommunityById(e,t){return l.A.get(c.vZ.community.getCommunityById(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getUserPostsInCommunityById(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return l.A.get(c.vZ.community.getUserPosts(e,t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getCommunityPostDirectoryById(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return l.A.get(c.vZ.community.getCommunityPostDirectory(t,n,r),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async getUserActivitiesInCommunityById(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return l.A.get(c.vZ.community.getUserActivities(e,t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async joinCommunity(e,t){return l.A.post(c.vZ.community.joinCommunity(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((t=>(r.r.track("subscribe-community",{communityname:t.data.community.name,communityurl:(0,d.IT)(t.data.community),communityPlan:t.data.community.plan?t.data.community.plan.planType:"free",user:e.name,mobile:e.mobile,email:e.email}),t.data)))}static async verifyUserByAdmin(e,t,n){return l.A.post(c.vZ.community.verifyUserByAdmin(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async leaveCommunity(e,t){return l.A.post(c.vZ.community.leaveCommunity(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getCommunityLinks(e){return l.A.get(c.vZ.community.addNewLink(e),{}).then((e=>e.data))}static async addCommunityLink(e,t,n){return l.A.post(c.vZ.community.addNewLink(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async editCommunityLink(e,t,n){return l.A.post(c.vZ.community.editLink(t,n.id),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteCommunityLink(e,t,n){return l.A.delete(c.vZ.community.editLink(t,n.id),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyThirdPartyToken(e,t){return l.A.post(c.vZ.community.verifyThirdPartyToken(e),{token:t}).then((e=>e.data))}static async makeAdminOfWholeCommunity(e,t,n){return l.A.post(c.vZ.community.roles.makeAdminOfWholeCommunity(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeUserAsAdminOfWholeCommunity(e,t,n){return l.A.post(c.vZ.community.roles.removeUserAsAdminOfWholeCommunity(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeUserFromCommunity(e,t,n){return l.A.post(c.vZ.community.roles.removeUserFromCommunity(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async blockUser(e,t){return l.A.post(c.vZ.community.block.blockUser(e,t),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async listBlockedUsers(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return l.A.get(c.vZ.community.block.listBlockedUsers(e,t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async unBlockUser(e,t){return l.A.delete(c.vZ.community.block.unBlockUser(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async createCommunityTopic(e,t,n,r,o){return l.A.post(c.vZ.community.topics.createTopic(t),{name:n,bgColor:r,textColor:o},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getAllCommunityTopics(e){return l.A.get(c.vZ.community.topics.getAllTopics(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async editCommunityTopic(e,t,n,r,o,i){return l.A.patch(c.vZ.community.topics.editTopic(t,n),{name:r,bgColor:o,textColor:i},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async handleCommunityTopicArchive(e,t,n){return l.A.patch(c.vZ.community.topics.archiveTopic(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteCommunityTopic(e,t,n){return l.A.patch(c.vZ.community.topics.deleteTopic(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async makeAdminOfSelectedGroups(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"admin";return l.A.post(c.vZ.community.roles.makeAdminOfSelectedGroups(t,n),{groupIds:r,role:o},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getPlansList(e){return l.A.get(c.vZ.community.subscription.getPlansList(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getCheckoutURLForCommunityPlan(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"advance",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window.location.origin;return l.A.get(c.vZ.community.subscription.getCheckoutURLForCommunityPlan(t,n,r),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static checkIfCommunityActionShouldBeDisabled(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?!(!e||"paid"!==e.selectedType||!e.isPlanExpired):!(!e||"admin"!==e.myRole||"paid"!==e.selectedType||!e.isPlanExpired)}static async cancelCommunitySubscription(e,t){return l.A.post(c.vZ.community.subscription.cancelCommunitySubscription(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getCommunityThemeData(e){return l.A.get(c.vZ.community.theme.communityThemeData(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateCommunityThemeData(e,t,n){return l.A.post(c.vZ.community.theme.communityThemeData(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async toggleCommunityThemeData(e,t){return l.A.post(c.vZ.community.theme.communityThemeDataToggle(e),t,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async toggleCommunityThemeDataForUser(e,t,n){return l.A.post(c.vZ.community.theme.communityThemeDataToggleForUser(t,e.id),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getDeals(){return l.A.get(c.vZ.community.deals.getDeals,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async redeemDeal(e,t,n){return l.A.post(c.vZ.community.deals.redeemDeal(t.id),{communityPlanType:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async toggleCommunityLoginRequirement(e,t,n){return l.A.put(c.vZ.community.settings.toggleCommunityLoginRequirement(t),{loginRequired:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateConfig(e,t,n,r){return l.A.put(c.vZ.community.settings.updateConfig(t),{configKey:n,configValue:r},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateConfigV2(e,t,n,r){return l.A.put(c.vZ.community.settings.updateConfigV2(t),{configKey:n,configValue:r},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getConfigurable(e,t){return l.A.get(c.vZ.community.configurable(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateConfigurable(e,t,n){return l.A.post(c.vZ.community.configurable(e,t),{configurableValue:n},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getLastPostCreatedTimeInCommunity(e){return l.A.get(c.vZ.community.getLastPostCreatedTimeInCommunity(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getAnalyticsLink(e){return l.A.get(c.vZ.community.analytics.getAnalyticsLink(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getAdditionalConfiguration(e){return l.A.get(c.vZ.community.additionalConfiguration.getConfiguration(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async saveAdditionalConfigurationDefaultJoinGroups(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return l.A.post(c.vZ.community.additionalConfiguration.saveDefaultJoinGroups(e),{groupIds:t},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async reportPost(e){let{communityId:t,reportType:n,reasonOfReporting:r,contentLink:o,content:i}=e;return l.A.post(c.vZ.community.reportPeer(t.toString()),{reasonOfReporting:r,reportType:n,contentLink:o||"",content:o?i:"Invalid content link"},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data)).catch((()=>null))}static async setCommunityOnboardingChecklistDetails(e,t){return l.A.post(c.vZ.community.onboardingChecklist.setOnboardingChecklist(e),{onboardingChecklist:t},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getCommunityOnboardingListData(e){return l.A.get(c.vZ.community.onboardingChecklist.getOnboardingChecklist(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}class p{static async getAllCourses(e){return l.A.get(c.vZ.course.getAll(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async createCourse(e,t,n){return l.A.post(c.vZ.course.createCourse(e,n),t,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async uploadCourseBanner(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};const o=new FormData;return o.append("banner",n),l.A.post(c.vZ.course.uploadCourseBanner(e,t),o,{headers:{Authorization:"Bearer "+(0,d.ut)()},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);r(t)}}).then((e=>e.data))}static async getCourseDetails(e,t){return l.A.get(c.vZ.course.getCourseDetails(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async deleteCourse(e,t){return l.A.delete(c.vZ.course.deleteCourse(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getCourseMembers(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return l.A.get(c.vZ.course.paginatedMembers(e,t,n,r),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async addMember(e,t,n){return l.A.post(c.vZ.course.addMember(e,t,n),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async joinCourse(e,t){return l.A.post(c.vZ.course.joinCourse(e,t),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async removeMember(e,t,n){return l.A.post(c.vZ.course.removeMember(e,t,n),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async createSection(e,t,n,r){return l.A.post(c.vZ.course.sections.createSection(e,t,r),n,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async deleteSection(e,t,n){return l.A.delete(c.vZ.course.sections.deleteSection(e,t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async createLesson(e,t,n,r,o){return l.A.post(c.vZ.course.sections.lesson.createLesson(e,t,n,o),r,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getLesson(e,t,n,r){return l.A.get(c.vZ.course.sections.lesson.getLessonDetails(e,t,n,r),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async deleteLesson(e,t,n,r){return l.A.delete(c.vZ.course.sections.lesson.deleteLesson(e,t,n,r),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async uploadLessonCoverMedia(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e=>{};const s=new FormData;return s.append("coverMedia",o),l.A.post(c.vZ.course.sections.lesson.updateLessonCover(e,t,n,r),s,{headers:{Authorization:"Bearer "+(0,d.ut)()},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);i(t)}}).then((e=>e.data))}static async markLessonComplete(e,t,n,r,o){return l.A.post(c.vZ.course.sections.lesson.markLessonComplete(e,t,n,r,o),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async markLessonInComplete(e,t,n,r,o){return l.A.post(c.vZ.course.sections.lesson.markIncomplete(e,t,n,r,o),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}class h{static async inviteByEmail(e,t,n){return l.A.post(c.vZ.community.invite.inviteViaEmail(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async inviteByCSV(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e=>{};const i=new FormData;return i.append("groupId",n.groupId),i.append("additionalMessage",n.additionalMessage),i.append("memberDataCSV",r),l.A.post(c.vZ.community.invite.inviteViaCsv(t),i,{headers:{Authorization:"Bearer "+e.token,"Content-Type":"multipart/form-data"},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);o(t)}}).then((e=>e.data))}static async getInvitesList(e,t,n,r){return l.A.get(c.vZ.community.invite.getInvitesList(t,n,r),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async saveMailTemplate(e,t,n){return l.A.post(c.vZ.community.invite.configureMailTemplates(t),{configurableValue:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getMailTemplate(e,t){return l.A.get(c.vZ.community.invite.configureMailTemplates(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sendBulkMail(e,t,n){return l.A.post(c.vZ.community.bulkEmail.send(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getBulkMailList(e,t,n,r){return l.A.get(c.vZ.community.bulkEmail.getBulkEmailLogList(t,n,r),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async resendBulkMail(e,t,n){return l.A.post(c.vZ.community.invite.batchReInvite(t),{inviteIds:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async cancelBulkMail(e,t,n){return l.A.post(c.vZ.community.invite.cancelBatchInvite(t),{inviteIds:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}class m{static async createGroup(e,t){return l.A.post(c.vZ.group.all,t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateGroup(e,t,n){return l.A.post(c.vZ.group.updateGroup(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteGroup(e,t){return l.A.delete(c.vZ.group.deleteGroup(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadBanner(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;const r=new FormData;return r.append("banner",n),l.A.post(c.vZ.group.uploadBanner(t),r,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async createGroupTab(e,t,n){return l.A.post(c.vZ.group.addTab(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async editGroupTab(e,t,n,r){return l.A.post(c.vZ.group.editTab(t,n),r,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteGroupTab(e,t,n){return l.A.delete(c.vZ.group.deleteTab(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getAllGroups(e){return l.A.get(c.vZ.group.all,{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async groupsByMe(e){return l.A.get(c.vZ.group.byMe,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getPersonalGroup(e){return l.A.get(c.vZ.group.personalGroup,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async groupDetail(e){return l.A.get(c.vZ.group.all+"/"+e,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async groupDetailFromSlug(e,t){return l.A.get(c.vZ.group.getGroupFromSlug(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async groupMembers(e,t,n){return l.A.get(c.vZ.group.members(t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()},signal:e.signal}).then((e=>e.data))}static async groupMembersPaginated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return l.A.get(c.vZ.group.membersPaginated(e,t,n,r,o),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async groupClosedSectionMembers(e,t,n){return l.A.get(c.vZ.group.closedSectionMembers(t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()},signal:e.signal}).then((e=>e.data))}static async groupClosedSectionMembersPaginated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return l.A.get(c.vZ.group.closedSectionMembersPaginated(e,t,n,r,o),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getLeaderboardV2Paginated(e,t,n){return l.A.get(c.vZ.group.getLeaderboardV2Paginated(e,t,n),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateUserRole(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"user";return l.A.post(c.vZ.group.updateRole(t,n),{role:r},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeUser(e,t,n){return l.A.post(c.vZ.group.removeUser(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async groupPosts(e,t){return l.A.get(c.vZ.group.posts(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sectionPostsPaginated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return l.A.get(c.vZ.group.sectionPostsPaginated(e,t,n,r),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async sectionPostsPinned(e,t){return l.A.get(c.vZ.group.sectionPostsPinned(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async sectionMessagesPaginated(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return l.A.get(c.vZ.group.sectionMessagesPaginated(t,n,r),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sectionMessagesTimestampPaginated(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return l.A.get(c.vZ.group.sectionMessagesTimestampPaginated(t,n,r),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async acceptInvitation(e,t){return l.A.post(c.vZ.group.acceptInvitation(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async acceptUserRequest(e,t,n){return l.A.post(c.vZ.group.acceptJoinRequest(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async rejectJoinRequest(e,t,n){return l.A.post(c.vZ.group.rejectJoinRequest(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async joinGroup(e,t){return l.A.post(c.vZ.group.join(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async leaveGroup(e,t){return l.A.post(c.vZ.group.leave(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyToken(e,t,n){return l.A.get(c.vZ.group.verifyCouponCode(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async createOrder(e,t,n){return l.A.post(c.vZ.group.createOrder(t),{code:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyPayment(e,t,n){return l.A.post(c.vZ.group.verifyPayment(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async joinClosedSection(e,t,n){return l.A.post(c.vZ.group.joinClosedSection(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async acceptJoinClosedSectionRequest(e,t,n,r){return l.A.post(c.vZ.group.acceptJoinClosedSectionRequest(t,n,r),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async rejectJoinClosedSectionRequest(e,t,n,r){return l.A.post(c.vZ.group.rejectJoinClosedSectionRequest(t,n,r),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static getTrendingPosts(e){return l.A.get(c.vZ.group.trendingPosts(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}var f=n(53322);class g{static async getMyNFTs(){return l.A.get(c.vZ.nft.getMyNFTs,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getUserNFTs(e){return l.A.get(c.vZ.nft.getUserNFTs(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async checkForGatedGroupAccess(e){return l.A.post(c.vZ.nft.checkForGatedGroupAccess(e),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}class b{static async updatePreference(e,t){return l.A.post(c.vZ.paymentPreference.updatePaymentPreference(e),t,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getPreference(e){return l.A.get(c.vZ.paymentPreference.getPaymentPreference(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updateInvoicePreference(e,t){return l.A.post(c.vZ.paymentPreference.updateInvoicePreference(e),t,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getInvoicePreference(e){return l.A.get(c.vZ.paymentPreference.getInvoicePreference(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}var v=n(70924);class y{static async getSectionMessageNotificationBadge(e){return l.A.get(c.vZ.community.sectionMessageNotificationBadges(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getSectionMessageNotificationMarkAsRead(e,t){return l.A.get(c.vZ.community.sectionMessageNotificationMarkAsRead(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}var k=n(81475);class w{static async updateProfile(e,t){return l.A.post(c.vZ.user.updateProfile,t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateWalletAddress(e){return l.A.post(c.vZ.user.updateWalletAddress,{walletAddress:e},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async updatePicture(e,t){const n=new FormData;return n.append("picture",t,t.fileName),l.A.post(c.vZ.user.updatePicture,n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteProfilePicture(e){return l.A.delete(c.vZ.user.updatePicture,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async syncOneSignalWebUserId(e,t){return l.A.post(c.vZ.user.syncOneSignalWebUserId,{userId:t},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getUserProfile(e){return l.A.get(c.vZ.user.profile,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async checkForUserIdAvailability(e,t){return l.A.get(c.vZ.user.checkProfileAvailability(e),{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}static async getUserProfileById(e){return l.A.get(c.vZ.user.profileById(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getAllUsers(e){return l.A.get(c.vZ.user.getAllUsers,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async followUser(e,t){return l.A.get(c.vZ.user.followUser(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async unfollowUser(e,t){return l.A.get(c.vZ.user.unfollowUser(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getFollowFollowingCount(e,t){return l.A.get(c.vZ.user.followFollowingCount(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getFollowersList(e,t){return l.A.get(c.vZ.user.followersList(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getFollowedList(e,t){return l.A.get(c.vZ.user.followedList(e,t),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async verifyMobileSendOTP(e,t,n){return l.A.post(c.vZ.user.verify.mobileSendOtp,{countryCode:t,mobile:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyMobileVerifyOTP(e,t,n){return l.A.post(c.vZ.user.verify.mobileVerifyOtp,{mobile:t,otp:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyEmailSendOTP(e,t){return l.A.post(c.vZ.user.verify.emailSendOtp,{email:t},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async verifyEmailVerifyOTP(e,t,n){return l.A.post(c.vZ.user.verify.emailVerifyOtp,{email:t,otp:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async unlinkEmailOrMobile(e){return l.A.post(c.vZ.user.account.unlinkMobileOrEmail,{unlinkType:e},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getUserCounters(){return l.A.get(c.vZ.user.counters,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async blockPeer(e,t){return l.A.post(c.vZ.user.block.blockPeer(t,e),{},{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static unblockPeer(e,t){return l.A.delete(c.vZ.user.block.unblockPeer(t,e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}static async getBlockedUsersList(e){return l.A.get(c.vZ.user.block.listBlockedPeers(e),{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}class x{static async getWidgets(e,t){return l.A.get(c.vZ.widget.getGroupWidget(e,t)).then((e=>e.data))}static async createCustomWidget(e,t,n){return l.A.post(c.vZ.widget.createCustomWidget(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadCustomCustomWidgetPicture(e,t,n,r){const o=new FormData;return o.append("picture",r),l.A.post(c.vZ.widget.uploadCustomCustomWidgetPicture(t,n),o,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateSortOrder(e,t,n){return l.A.post(c.vZ.widget.updateSortOrder(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updateWidget(e,t,n,r){return l.A.post(c.vZ.widget.updateWidget(t,n),r,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteWidget(e,t,n){return l.A.delete(c.vZ.widget.updateWidget(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}},34268:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});var r=n(44427),o=n(78220);class i{static async searchInCommunity(e,t,n){return r.A.get(o.vZ.mentions.searchInCommunity(t,n),{headers:{Authorization:"Bearer ".concat(e.token)}}).then((e=>e.data))}}},24881:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async sendMessage(e,t){return r.A.post(o.vZ.message.create,t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async editMessage(e,t){return r.A.put(o.vZ.message.edit(t.id),t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteMessage(e,t){return r.A.delete(o.vZ.message.delete(t.id),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async reactToMessage(e,t){return r.A.post(o.vZ.message.react(e.id),{emoji:t},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async unreactToMessage(e,t){return r.A.post(o.vZ.message.unreact(e.id),{emoji:t},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async uploadAttachments(e,t,n){const i=new FormData;return n.forEach((e=>{i.append("attachments",e)})),i.append("groupId",t.groupId),i.append("tabId",t.tabId),t.parentId&&i.append("parentId",t.parentId),r.A.post(o.vZ.message.uploadAttachment,i,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async sendDirectMessage(e,t,n){return r.A.post(o.vZ.directMessages.sendDirectMessage(n),{message:t},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadDirectAttachments(e,t,n){const i=new FormData;return t.forEach((e=>{i.append("attachments",e)})),r.A.post(o.vZ.directMessages.uploadAttachments(n),i,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async editDirectMessage(e,t){return r.A.post(o.vZ.directMessages.editDirectMessage(t.id),{message:t.description},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteDirectMessage(e,t){return r.A.delete(o.vZ.directMessages.deleteDirectMessage(t.id),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async markAllMessagesInChatAsRead(e,t){return r.A.post(o.vZ.directMessages.markAllMessageAsRead(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getDirectChats(e){return r.A.get(o.vZ.directMessages.chats,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getUserChatTimestampPaginated(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return r.A.get(o.vZ.directMessages.userChat(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}},73248:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(44427),o=n(78220);class i{static async getNotificationPreference(e,t){return r.A.get(o.vZ.community.notificationPreference(e),{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}static async updateNotificationPreference(e,t,n){return r.A.post(o.vZ.community.updateNotificationPreference(e),n,{headers:{Authorization:"Bearer "+t.token}}).then((e=>e.data))}}},45322:(e,t,n)=>{"use strict";n.d(t,{e:()=>i});var r=n(44427),o=n(78220);class i{static async getFontData(){return r.A.get(o.vZ.open.getFontData,{}).then((e=>e.data))}static async getLinkMetaData(e){return r.A.get("https://web-scrapper-coral.vercel.app/api/meta/pensil?url=".concat(e),{headers:{"Access-Control-Allow-Origin":"*"}}).then((e=>e.data))}}},90945:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async getHighlightedPostsInCommunity(e){return r.A.get(o.vZ.postHighlight.getHighlightedPosts(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async highlightCommunityPost(e,t){return r.A.post(o.vZ.postHighlight.highlightPost(e,t),{},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async unHighlightCommunityPost(e,t){return r.A.delete(o.vZ.postHighlight.highlightPost(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async updateHighlightedPostsSortOrder(e,t){return console.log(t),r.A.post(o.vZ.postHighlight.updateHighlightedPostsSortOrder(e),t,{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}}},70924:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async getPostsPaginated(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return r.A.get(o.vZ.post.paginated(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getPostsToExplorePaginated(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return r.A.get(o.vZ.post.popularPaginated(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getPostDetail(e,t){return r.A.get(o.vZ.post.detail(t),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async getPostDetailFromSlug(e,t,n){return r.A.get(o.vZ.post.detailFromSlug(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async getPostLikes(e,t){return r.A.get(o.vZ.post.likes(t),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async createPost(e,t){return r.A.post(o.vZ.post.create,t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getTagsBySearch(e,t,n){return r.A.get(o.vZ.post.searchTag(t,n),{headers:{Authorization:"Bearer "+(e?e.token:null)}}).then((e=>e.data))}static async getPostByTagSearch(e,t,n,i,s,a){return r.A.get(o.vZ.post.getPostByTag(t,n,i,s,a),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async updatePost(e,t,n,i){return t.removedMediaUploadsOnEdit=n,r.A.post(o.vZ.post.update(i),t,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadImages(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};const s=new FormData;return n.forEach((e=>{s.append("images[]",e,e.fileName)})),r.A.post(o.vZ.post.uploadImage(t),s,{headers:{Authorization:"Bearer "+e.token},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);i(t)}}).then((e=>e.data))}static async deleteImages(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r.A.delete(o.vZ.post.uploadImage(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadVideos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};const s=new FormData;return n.forEach((e=>{s.append("videos[]",e,e.fileName)})),r.A.post(o.vZ.post.uploadVideo(t),s,{headers:{Authorization:"Bearer "+e.token},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);i(t)}}).then((e=>e.data))}static async deleteVideos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new FormData;return n.append("videos[]",[]),r.A.post(o.vZ.post.uploadVideo(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadDocument(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};const s=new FormData;return s.append("document",n,n.fileName),r.A.post(o.vZ.post.uploadDocument(t),s,{headers:{Authorization:"Bearer "+e.token},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);i(t)}}).then((e=>e.data))}static async uploadCoverPicture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{};const s=new FormData;return s.append("banner",n,n.fileName),r.A.post(o.vZ.post.uploadBanner(t),s,{headers:{Authorization:"Bearer "+e.token},onUploadProgress:function(e){const t=Math.round(100*e.loaded/e.total);i(t)}}).then((e=>e.data))}static async pinPost(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r.A.post(o.vZ.post.pin(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async unpinPost(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r.A.post(o.vZ.post.unpin(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async bookmarkPost(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r.A.post(o.vZ.post.bookmark(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeBookmark(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r.A.delete(o.vZ.post.removeBookmark(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async getBookmarks(){return r.A.get(o.vZ.post.getBookmarks,{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async voteOnPoll(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return r.A.post(o.vZ.post.vote(t),{option:n},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async likePost(e,t){return r.A.post(o.vZ.post.like(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async dislikePost(e,t){return r.A.post(o.vZ.post.dislike(t),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async addComment(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{description:""};return r.A.post(o.vZ.post.addComment(t),n,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadImagesToComment(e,t,n,i){const s=new FormData;return i.forEach((e=>{s.append("images[]",e,e.fileName)})),r.A.post(o.vZ.post.uploadImagesToComment(t,n),s,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadDocumentToComment(e,t,n,i){const s=new FormData;return s.append("document",i,i.fileName),r.A.post(o.vZ.post.uploadDocumentToComment(t,n),s,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async uploadDocumentToCommentReply(e,t,n,i,s){const a=new FormData;return s.forEach((e=>{a.append("documents[]",e,e.fileName)})),r.A.post(o.vZ.post.uploadDocumentToCommentReply(t,n,i),a,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteComment(e,t,n){return r.A.delete(o.vZ.post.deleteComment(t,n),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deleteSubComment(e,t,n,i){return r.A.delete(o.vZ.post.deleteSubComment(t,n,i),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async deletePost(e,t){return r.A.delete(o.vZ.post.delete(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async addCommentReply(e,t,n,i){return r.A.post(o.vZ.post.addCommentReply(t,n),i,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async addCommentReaction(e,t,n,i){return r.A.post(o.vZ.post.addCommentReaction(t,n),{emoji:i},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeCommentReaction(e,t,n){return r.A.post(o.vZ.post.removeCommentReaction(t,n),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async addCommentReplyReaction(e,t,n,i,s){return r.A.post(o.vZ.post.addCommentReplyReaction(t,n,i),{emoji:s},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async removeCommentReplyReaction(e,t,n,i){return r.A.post(o.vZ.post.removeCommentReplyReaction(t,n,i),{},{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}},77255:(e,t,n)=>{"use strict";n.d(t,{A2:()=>r,jw:()=>i,qj:()=>o});const r="CREATE_SESSION",o="DESTROY_SESSION";function i(e){return{type:r,user:e}}},42414:(e,t,n)=>{"use strict";n.d(t,{Km:()=>a,Yn:()=>l,hQ:()=>s});var r=n(26914),o=n(43039),i=n(93668);const s="SET_COMMUNITY";function a(){return{type:s,community:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}}function l(){return(e,t)=>{const{auth:n,community:s}=t();o.BE.getCommunityGroups(s.id,n||{token:null}).then((t=>{let{groups:o}=t;if(e((0,i.$Y)(o)),e((0,i.JK)(!1)),n&&o&&o.length>0){const e=o.map(((e,t)=>({["GR - ".concat(e.name)]:e.myRole}))).reduce(((e,t)=>Object.assign(e,t,{})));e&&n&&r.r.people.set(e)}})).catch((t=>{e((0,i.JK)(!1)),console.log("getCommunityGroups Redux failed",{err:t})}))}}},41153:(e,t,n)=>{"use strict";n.d(t,{c:()=>o,u:()=>r});const r="SET_COMMUNITY_PAC";function o(){return{type:r,pac:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}}},41374:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>s,Fy:()=>o,J0:()=>r,Mj:()=>c,OX:()=>u,RN:()=>l,TP:()=>a,u6:()=>i,uF:()=>d});const r="GET_ALL_DIRECT_CHATS",o="GET_ALL_DIRECT_CHATS_SUCCESS",i="GET_ALL_DIRECT_CHATS_FAILURE",s="ADD_CHAT_IF_NEEDED",a="MARK_CHAT_AS_READ";function l(e){return{type:o,users:e}}function c(e){return{type:s,user:e}}function d(e){return{type:a,chat:e}}function u(){return(e,t)=>{e({type:r});const{auth:n}=t()}}},93668:(e,t,n)=>{"use strict";n.d(t,{$Y:()=>s,JK:()=>u,Wk:()=>a,eP:()=>c,qj:()=>o,qk:()=>i,tg:()=>l,yI:()=>r});n(43039);const r="SET_GROUPS",o="SET_ACTIVE_GROUP",i="SET_IS_LOADING_GROUPS";function s(){return{type:r,groups:arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]}}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(t,n)=>{if(e){const{groups:r}=n(),o=[...r],i=o.findIndex((t=>t.id===e.id));o.splice(i,1,e),t(s(o))}t(d(e))}}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>!0;return(r,o)=>{if(null!==e&&void 0!==e&&e.length){const{groups:i,activeGroup:a}=o();r(s([...i].map((e=>n(e)?{...e,...t}:e)))),e.includes(null===a||void 0===a?void 0:a.id)&&n(a)&&r(d({...a,...t}))}}}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(t,n)=>{let r;if(e){const{groups:o}=n();r=[...o];const i=r.findIndex((t=>t.id===e.id));r.splice(i,1),t(s(r))}}}function d(){return{type:o,group:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}}function u(){return{type:i,loading:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}}},92082:(e,t,n)=>{"use strict";n.d(t,{J$:()=>i,Mn:()=>d,T:()=>s,vx:()=>c,wA:()=>a,zo:()=>l});var r=n(89449),o=n(73248);const i="SET_NOTIFICATION_CENTRE",s="SAVING_NOTIFICATION_CENTRE",a="SET_NOTIFICATION_CENTRE_ERROR";function l(e){return{type:i,preferences:e}}function c(){return(e,t)=>{const{auth:n,community:r}=t();n&&r&&o.W.getNotificationPreference(r.id,n).then((t=>{let{preferences:n}=t;e(l(n))})).catch((e=>{console.log(e)}))}}function d(e,t){return(n,i)=>{var c;const{notificationCentre:d}=i();let u=d.preferences;u||(u={tabs:[]});let p=null!==(c=u.tabs)&&void 0!==c?c:[],h=p.findIndex((t=>t.id===e.id));-1===h?p.push(e):p[h]=e,u.tabs=p,n(function(e,t){return(n,i)=>{const{auth:c,community:d}=i();n({type:s}),o.W.updateNotificationPreference(d.id,c,e).then((e=>{let{preferences:r}=e;n(l(r)),t("Notification preferences updated successfully")})).catch((e=>{console.log(e),t("Error updating notification preferences","",r.lm.danger),n({type:a,error:e})}))}}(u,t))}}},88614:(e,t,n)=>{"use strict";n.d(t,{R8:()=>s,dA:()=>i,nh:()=>o});var r=n(43039);const o="SET_USER_COUNTERS";function i(){return{type:o,unreadNotificationsCount:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,unreadMessagesCount:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,unreadSectionNotificationsCount:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}}function s(){return(e,t)=>{r.DL.getUserCounters().then((t=>{e(i(t.unreadNotificationsCount,t.unreadMessagesCount,t.unreadSectionNotificationsCount))}))}}},5607:(e,t,n)=>{"use strict";n.d(t,{I8:()=>s,Yj:()=>o,iz:()=>i});var r=n(43039);const o="SET_PERSONAL_GROUP";function i(){return{type:o,group:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}function s(){return(e,t)=>{const{auth:n}=t();r.Bd.getPersonalGroup(n).then((t=>{let{group:n}=t;e(i(n))})).catch((e=>{}))}}},83380:(e,t,n)=>{"use strict";n.d(t,{P:()=>r,q:()=>o});const r="SET_SOCKET";function o(){return{type:r,socket:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}}},62856:(e,t,n)=>{"use strict";n.d(t,{Di:()=>i,Vs:()=>a});const r="GET_COMMUNITY_LINKS",o="SET_COMMUNITY_LINKS";function i(e){return{type:o,links:e}}const s={isLoadingList:!1,links:[],errorMessage:null,updatingLinkId:null};function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case r:return{...e,isLoadingList:!0,links:[],errorMessage:null,updatingLinkId:null};case o:return{...e,isLoadingList:!0,links:t.links,errorMessage:null,updatingLinkId:null};default:return e}}},3766:(e,t,n)=>{"use strict";n.d(t,{H0:()=>m,Ls:()=>c,hz:()=>d,rp:()=>u,uE:()=>p});var r=n(90945);const o="GET_HIGHLIGHTED_POSTS",i="SET_HIGHLIGHTED_POSTS",s="ADD_HIGHLIGHTED_POST",a="ADD_HIGHLIGHTED_POST_SUCCESS",l="REMOVE_HIGHLIGHTED_POST";function c(e){return{type:i,posts:e}}function d(e){return t=>{t({type:o}),r.g.getHighlightedPostsInCommunity(e).then((e=>{const{highlightedPosts:n}=e,{posts:r}=n;t(c(r))}))}}function u(e,t){return(n,o)=>{const{community:i}=o();n(function(e){return{type:s,postId:e}}(e)),r.g.highlightCommunityPost(null===i||void 0===i?void 0:i.id,e).then((r=>{const{highlightedPosts:o}=r,{posts:i}=o;n(c(i)),n(function(e){return{type:a,postId:e}}(e)),t()}))}}function p(e,t){return(n,o)=>{const{community:i}=o();n(function(e){return{type:l,postId:e}}(e)),r.g.unHighlightCommunityPost(null===i||void 0===i?void 0:i.id,e).then((e=>{const{highlightedPosts:r}=e,{posts:o}=r;n(c(o)),t()}))}}const h={isLoadingList:!1,posts:[],postIds:[],errorMessage:null,updatingPostId:null};function m(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case o:return{...t,isLoadingList:!0,posts:[],postIds:[],errorMessage:null};case i:return{...t,isLoadingList:!1,posts:n.posts,postIds:null===(e=n.posts)||void 0===e?void 0:e.map((e=>{var t;return null===(t=e.postData)||void 0===t?void 0:t.id})),errorMessage:null};case s:return{...t,updatingPostId:n.postId};case a:return{...t,updatingPostId:null};default:return t}}},47669:(e,t,n)=>{"use strict";n.d(t,{B1:()=>p,Cv:()=>m,Ll:()=>h,P_:()=>g,Ys:()=>d,sc:()=>u});var r=n(43039);const o="ADD_SECTION_MESSAGE",i="UPDATE_SECTION_MESSAGE",s="REMOVE_SECTION_MESSAGE",a="UPDATE_SECTION_MESSAGE_REACTION",l="SET_SECTION_MESSAGES_SUCCESS",c="SET_SECTION_MESSAGES_LOADING";function d(e){return{type:o,message:e}}function u(e){return{type:i,message:e}}function p(e){return{type:s,messageId:e}}function h(e,t){let{messageId:n,emoji:r,status:o,user:i}=e;return{type:a,messageId:n,emoji:r,status:o,user:i,authUser:t}}function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(o,i)=>{const{sectionMessages:s,auth:a}=i(),{messages:d}=s,u=!n&&d.length>0?d[0].id:null;o(function(){return{type:c,isLoading:!(arguments.length>0&&void 0!==arguments[0])||arguments[0],clear:arguments.length>1&&void 0!==arguments[1]&&arguments[1]}}(!0,n)),r.Bd.sectionMessagesTimestampPaginated(a,e,t,u).then((e=>{o(function(e,t){return{type:l,messages:e,clear:t}}(e.messages,n))}))}}const f={messages:[],noMoreMessages:!1,isLoading:!1,isFirstLoading:!1};function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case c:return{...e,isLoading:t.isLoading,messages:t.clear?[]:e.messages,isFirstLoading:!!t.clear||e.isFirstLoading,...t.clear?{noMoreMessages:!1}:{},error:null};case l:{let n=!1;return(0===t.messages.length||t.messages.length<10)&&(n=!0),{...e,messages:[...t.messages.reverse(),...t.clear?[]:e.messages],noMoreMessages:n,isFirstLoading:!1,error:null,isLoading:!1}}case o:{const{message:n}=t,{messages:r}=e;let o=[...r];if(n.parent){d(n);const e=r.findIndex((e=>e.id===n.parent));e>-1&&(o=[...r],o[e].replies?o[e].replies.push(n):o[e].replies=[n])}else o=[...r,n];return{...e,messages:o}}case i:{const{message:n}=t,{messages:r}=e;let o=[...r];const i=r.findIndex((e=>e.id===n.id));return i>-1?o[i]={...n,reactions:o[i].reactions}:o=o.map((e=>(e.replies&&(e.replies=e.replies.map((t=>t.id===e.id?{...e,reactions:t.reactions}:t))),e))),{...e,messages:o}}case s:{const{messageId:n}=t,{messages:r}=e;let o=[...r];return o=-1===r.findIndex((e=>e.id===n))?o.map((e=>(e.replies&&(e.replies=e.replies.filter((e=>e.id!==n))),e))):r.filter((e=>e.id!==n)),{...e,messages:o}}case a:{const{messageId:n,emoji:r,status:o,user:i,authUser:s}=t,{messages:a}=e,l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,r=[...e];const o=e.findIndex((e=>e.id===t));r=-1===o?r.map((e=>(e.replies&&(e.replies=e.replies.map((e=>e.id===t?n(e):e))),e))):e.map((e=>e.id===t?n(e):e));return r}(a,n,(e=>{const{total:t,details:n}=e.reactions;let a=!1,l=!1;const c=[...n],d=n.findIndex((e=>e.emoji===r));if(d<0)"updated"===o&&(c.push({emoji:r,count:1,users:[i],isByMe:s.id===i.id}),a=!0);else if("updated"===o){c[d].users.findIndex((e=>e.id===i.id))<0&&(c[d].users.push(i),c[d].count=c[d].count+1,c[d].isByMe=i.id===s.id,a=!0)}const u=c.findIndex((e=>e.emoji===r));let p=!1;for(let r=0;re.id===i.id));e>-1&&(c[r].users.splice(e,1),c[r].count=c[r].count-1,c[r].false=i.id===s.id,c[r].isByMe=!1,a||(l=!0),a=!1,p=!c[r].users.length&&r)}return!1!==p&&c.splice(p,1),e.reactions={total:a?t+1:l?t-1:t,details:c},e}));return{...e,messages:l}}default:return e}}},37081:(e,t,n)=>{"use strict";n.d(t,{Ei:()=>g,UJ:()=>h,gg:()=>m,zM:()=>p});var r=n(16118),o=n(43039);const i="GET_POST_DETAIL_ACTION",s="GET_POST_DETAIL_SUCCESS",a="GET_POST_DETAIL_ERROR",l="UPDATE_POST_DETAIL";function c(){return{type:i}}const d=e=>({type:s,post:e}),u=(e,t)=>({type:a,error:e,statusCode:t}),p=e=>({type:l,post:e});function h(e){return async t=>{t(c());const n=(0,r.ut)();try{const{post:r}=await o.K$.getPostDetail({token:n},e);t(d(r))}catch(i){t(u("Post could not be fetched!",i.response.status))}}}function m(e){return async(t,n)=>{const{community:i}=n();t(c());const s=(0,r.ut)();try{const{post:n}=await o.K$.getPostDetailFromSlug({token:s},i.id,e);t(d(n))}catch(a){t(u("Post could not be fetched!",a.response.status))}}}const f={post:null,isLoading:!1,error:null};function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i:return{...e,isLoading:!0,post:null,error:null};case s:return{...e,isLoading:!1,post:t.post,error:null};case a:return{...e,isLoading:!1,post:null,error:t.error,statusCode:t.statusCode};case l:return{...e,isLoading:!1,post:t.post,error:null};default:return e}}},34944:(e,t,n)=>{"use strict";n.d(t,{p5:()=>d,JT:()=>p});var r=n(44427),o=n(78220),i=n(16118);class s{static async search(e){const t=encodeURIComponent(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"");return r.A.get(o.vZ.misc.search(e)+"?search="+t,{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getMeetingData(e,t){return r.A.get(o.vZ.post.getMeetingData(t),{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}static async toggleMeetingRecording(e,t){return r.A.post(o.vZ.post.toggleMeetingRecording(e,t),{},{}).then((e=>e.data))}static async endTheMeeting(e,t){return r.A.get(o.vZ.post.endMeeting(e,t),{}).then((e=>e.data))}}const a="SET_SEARCH_REQUEST_LOADING",l="SEARCH_REQUEST_SUCCESS";function c(e){return{type:l,results:e}}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(t,n)=>{if(!e)return t(c({}));const{community:r}=n();t({type:a,isLoading:!0}),s.search(null===r||void 0===r?void 0:r.id,e).then((e=>{t(c(e))}))}}const u={results:null,isLoading:!1};function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a:return{...e,isLoading:!0,results:null};case l:return{...e,isLoading:!1,results:t.results};default:return e}}},52041:(e,t,n)=>{"use strict";n.d(t,{$8:()=>w,DG:()=>y,F9:()=>v,IY:()=>b,Q2:()=>_,ZA:()=>C,f8:()=>A,ty:()=>k,vq:()=>N,x:()=>g});var r=n(43039),o=n(51822);const i="ACTIVATE_SECTION",s="INCREASE_NEW_POST_COUNT",a="RESET_NEW_POST_COUNT",l="GET_SECTION_PINNED_POSTS",c="SET_SECTION_PINNED_POSTS",d="ADD_SECTION_PINNED_POST",u="REMOVE_SECTION_PINNED_POST",p="UPDATE_SECTION_PINNED_POST",h="GET_SECTION_POSTS",m="SET_SECTION_POSTS",f="SET_CURRENT_SECTION_POSTS";function g(e){return{type:i,section:e}}function b(e,t){return{type:s,sectionId:e,postId:t}}function v(e){return{type:a,sectionId:e}}function y(e){return{type:d,post:e}}function k(e){return{type:u,post:e}}function w(e){return{type:p,post:e}}function x(e,t,n){return t&&(t=t.map((e=>{var t;return{...e,comments:null!==(t=e.comments)&&void 0!==t?t:[]}}))),{type:m,posts:t,sectionId:e,pageNo:n}}function _(e){return{type:f,posts:e}}function A(e,t){return async n=>{n(function(e){return{type:l,sectionId:e}}(t));const{posts:o}=await r.Bd.sectionPostsPinned(e,t);n(function(e,t){return{type:c,posts:t,sectionId:e}}(t,o))}}function C(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return async(i,s)=>{const{sections:a}=s();if(!a.sections[t].isLoadingMorePosts){i(function(e,t){return{type:h,sectionId:e,pageNo:t}}(t,o));try{const{posts:s,page:a}=await r.Bd.sectionPostsPaginated(e,t,o,n);i(x(t,s,a))}catch(l){i(x(t,[],o))}}}}const S={activeSectionId:null,sections:{}},j={isLoadingPinnedList:!1,pinnedPosts:[],pinnedErrorMessage:null,isLoadingPosts:!1,posts:[],currentPage:1,newPostCount:0,errorMessage:null,isLoadingMorePosts:!1,noMorePosts:!1},E=10;function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i:{const{section:n}=t;if(n){const t={...e};return n.id in e.sections?t.sections[n.id]={...t.sections[n.id],...n}:t.sections[n.id]={...j,...n},t.activeSectionId=n.id,t}return{...e,activeSectionId:null}}case s:{const{sectionId:n,postId:r}=t,o={...e};return o.sections[n].posts.find((e=>e.id===r))||o.sections[n].pinnedPosts.find((e=>e.id===r))||(o.sections[n]={...j,...o.sections[n],newPostCount:o.sections[n].newPostCount+1}),o}case a:{const{sectionId:n}=t,r={...e};return r.sections[n]={...j,...r.sections[n],newPostCount:0},r}case l:{const{sectionId:n}=t,r={...e};return r.sections[n]={...j,...r.sections[n],isLoadingPinnedList:!0,pinnedPosts:[],pinnedErrorMessage:null},r}case c:{const{posts:n,sectionId:r}=t,o={...e};return o.sections[r]={...j,...o.sections[r],isLoadingPinnedList:!1,pinnedPosts:n,pinnedErrorMessage:null},o}case d:{const{post:n}=t,r={...e},{id:o,tabId:i}=n,s=[...r.sections[i].pinnedPosts];return s.find((e=>e.id===o))?e:(r.sections[i]={...j,...r.sections[i],pinnedPosts:[...s,n]},r)}case u:{const{post:n}=t,r={...e},{id:o,tabId:i}=n,s=[...r.sections[i].pinnedPosts],a=s.findIndex((e=>e.id===o));return-1===a?e:(s.splice(a,1),r.sections[i]={...j,...r.sections[i],pinnedPosts:s},r)}case p:{const{post:n}=t,r={...e},{id:o,tabId:i}=n,s=[...r.sections[i].pinnedPosts],a=s.findIndex((e=>e.id===o));return-1===a?e:(s.splice(a,1,n),r.sections[i]={...j,...r.sections[i],pinnedPosts:s},r)}case h:{const{sectionId:n,pageNo:r}=t,o={...e};return o.sections[n]={...j,...o.sections[n],isLoadingPosts:1===r,postsLoadingState:1===r?"":null,posts:r&&1!==r?o.sections[n].posts:[],noMorePosts:!1,errorMessage:null,isLoadingMorePosts:!(!r||1===r)},o}case m:{const{posts:n,sectionId:r,pageNo:o}=t,i={...e};return i.sections[r]={...j,...i.sections[r],isLoadingPosts:!1,currentPage:o,posts:o&&1!==o?[...i.sections[r].posts,...n]:n,errorMessage:null,noMorePosts:!(null!==n&&void 0!==n&&n.length)||(null===n||void 0===n?void 0:n.length){"use strict";n.d(t,{BS:()=>m,F9:()=>h,Im:()=>d,Lj:()=>g,Q6:()=>u,b:()=>l,bo:()=>s,cG:()=>v,fs:()=>b,qH:()=>a,xr:()=>c,yg:()=>p,z3:()=>f});var r=n(31012),o=n.n(r),i=n(16118);const s="SECTION_POST_LIKE_REALTIME_INCREMENT";function a(e){return{type:s,socketPayload:e}}const l=(e,t)=>function(e,t){const{user:n,increment:r,postId:o,sectionId:s,groupId:a}=t;if((0,i.mZ)()===(null===n||void 0===n?void 0:n.id))return e;return y(e,{id:o,tab:s},(e=>{const t={...e};return t.likes+=r,t.likeCount+=r,t}))}(Object.assign({},e),t.socketPayload),c="SECTION_POST_COMMENT_REALTIME_ADD";function d(e){return{type:c,socketPayload:e}}const u=(e,t)=>function(e,t){const{postId:n,sectionId:r,groupId:o,postCommentId:s,comment:a}=t,{createdBy:l}=a;if((0,i.mZ)()===(null===l||void 0===l?void 0:l.id))return e;return y(e,{id:n,tab:r},(e=>{const t={...e};return t.commentCount=e.commentCount+1,t.latestComment=a,Array.isArray(t.comments)&&t.comments.unshift(a),t}))}(Object.assign({},e),t.socketPayload),p="SECTION_POST_COMMENT_REALTIME_REMOVE";function h(e){return{type:p,socketPayload:e}}const m=(e,t)=>function(e,t){const{postId:n,sectionId:r,groupId:o,postCommentId:i}=t;return y(e,{id:n,tab:r},(e=>{var t,n;const r={...e};(null===(t=r.latestComment)||void 0===t?void 0:t.id)===i&&(r.latestComment=null);return(null===(n=r.comments)||void 0===n?void 0:n.find((e=>e.id===i)))&&(r.commentCount=e.commentCount-1,r.comments=r.comments.filter((e=>e.id!==i))),r}))}(Object.assign({},e),t.socketPayload),f="SECTION_POST_COMMENT_REALTIME_REACTION_UPDATE";function g(e){return{type:f,socketPayload:e}}const b=(e,t)=>function(e,t){const{postId:n,sectionId:r,groupId:o,postCommentId:s,reaction:a,user:l}=t;if((0,i.mZ)()===(null===l||void 0===l?void 0:l.id))return e;return y(e,{id:n,tab:r},(e=>{var t,n;const r={...e};(null===(t=r.latestComment)||void 0===t?void 0:t.id)===s&&(r.latestComment=v(r.latestComment,a,l));const o=null===(n=r.comments)||void 0===n?void 0:n.findIndex((e=>e.id===s));return o>-1&&(r.comments[o]=v(r.comments[o],a,l)),r}))}(Object.assign({},e),t.socketPayload);function v(e,t,n){for(let r=0;re.id===n.id))>-1&&(e.reactions.details[r].users=e.reactions.details[r].users.filter((e=>e.id!==n.id)),e.reactions.details[r].count-=1,e.reactions.details[r].count<1&&e.reactions.details.splice(r,1),e.reactions.total-=1)}if(t){const r=e.reactions.details.findIndex((e=>e.emoji===t));-1===r?e.reactions.details.push({count:1,isByMe:!1,emoji:t,users:[n]}):(e.reactions.details[r].count+=1,e.reactions.details[r].users.push(n)),e.reactions.total+=1}return e}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>{};const r=t.tab,i=t.id,s=o().cloneDeep(e);return s.sections[r]?(s.sections[r].posts=s.sections[r].posts.map((e=>e.id===i?n(e):e)),s.sections[r].pinnedPosts=s.sections[r].pinnedPosts.map((e=>e.id===i?n(e):e)),s):e}},52853:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,L:()=>s});var r=n(20975),o=n(62391);const i=r.createContext(null),s=e=>t=>(0,o.jsx)(i.Consumer,{children:n=>(0,o.jsx)(e,{...n,...t})})},89449:(e,t,n)=>{"use strict";n.d(t,{$o:()=>l,lm:()=>c,q5:()=>p,tE:()=>d,wj:()=>u});var r=n(5564),o=n.n(r),i=n(20975),s=n(62270),a=n(62391);const l=i.createContext(null),c={danger:"danger",success:"success",warning:"warning",info:"info"},d=e=>{const[t,n]=(0,i.useState)([]),r=(0,s.A)(),o=e=>{const r=[...t];r.splice(r.find((t=>t.timestamp===e.timestamp)),1),n(r)};return(0,a.jsx)(l.Provider,{value:{toasts:t,addToast:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;e=r.trans(e),i=r.trans(i);const l={title:e,message:i,type:s,timestamp:(new Date).getTime()};n([...t,l]),setTimeout((()=>{t.findIndex((e=>e.timestamp===l.timestamp))&&o(l)}),a)},addToastWithAction:e=>{let{title:r="",message:i="",type:s="",time:a=3e3,onClick:l=(()=>{})}=e;const c={title:r,message:i,type:s,timestamp:(new Date).getTime(),onClick:l};n([...t,c]),setTimeout((()=>{t.findIndex((e=>e.timestamp===c.timestamp))&&o(c)}),a)},removeToast:o},children:e.children})},u=e=>t=>(0,a.jsx)(l.Consumer,{children:n=>(0,a.jsx)(e,{...n,...t})}),p=u((e=>{let{toasts:t,removeToast:n}=e;const r=e=>{switch(e){case"danger":return"bg-red-300 text-white";case"success":default:return"bg-green-300 text-green-900";case"info":return"bg-blue-300 text-blue-900";case"warning":return"bg-orange-300 text-orange-900"}};return(0,a.jsx)("div",{className:"ToastNotifier",children:t.map((e=>(0,a.jsxs)("div",{className:o()("toast mt-2 flex rounded px-4 py-2",r(e.type),{"cursor-pointer":e.onClick}),onClick:t=>{e.onClick&&e.onClick((t=>{n(e)}))},children:[(0,a.jsxs)("div",{className:"toast-body flex-grow",children:[(0,a.jsx)("div",{className:"toast-title",children:e.title}),(0,a.jsx)("div",{className:"toast-message",children:e.message})]}),(0,a.jsx)("div",{className:"toast-delete flex-shrink-0",onClick:()=>{n(e)},children:"\xd7"})]},e.timestamp)))})}))},62270:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(20975),o=n(52853);function i(){const{lang:e}=(0,r.useContext)(o.B);return e}},9175:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(20975),o=n(89449);const i=()=>{const{addToast:e}=(0,r.useContext)(o.$o);return{addToast:e,ToastTypes:o.lm}}},56467:(e,t,n)=>{"use strict";n.d(t,{i:()=>d});var r=n(5564),o=n.n(r),i=(n(20975),n(53871)),s=n(44139),a=n(91900),l=n(91341),c=n(62391);const d=e=>{let{onSubmit:t=(()=>{}),onCancelSubmit:n=(()=>{}),title:r,subTitle:d="",header:u,width:p=390,isLoading:h,active:m=!1,labelCancel:f="Cancel",labelSubmit:g="Yes, Go Ahead",btnColor:b,disabled:v=!1,setActive:y=(()=>{}),large:k=!1,className:w="",children:x}=e;return(0,c.jsx)(a.a,{className:"CreateGroupModal",active:m,width:"".concat(p,"px"),padding:!1,setActive:y,children:(0,c.jsxs)("div",{className:"bg-card px-5 py-8 font-bold",children:[(0,c.jsx)("div",{className:"text-center font-bold",children:(0,c.jsx)(l.A,{variant:"t1",children:r})}),d&&(0,c.jsx)("div",{className:"mt-2 text-center text-xs font-semibold text-primary",children:d}),x,(0,c.jsx)("div",{className:"mt-5",children:(0,c.jsx)("div",{className:"mx-auto",children:(0,c.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,c.jsx)("button",{disabled:v,className:o()("theme-bg-disable w-full border-2 border-border font-semibold focus:outline-none",w,{"rounded px-6 py-2":k,"rounded px-3 py-1":!k}),onClick:n,children:(0,c.jsx)(i.A,{children:f})}),(0,c.jsx)(s.$,{onClick:t,isLoading:h,className:"w-full",label:g,disabled:v,btnColor:b})]})})})]})})}},63360:(e,t,n)=>{"use strict";n.d(t,{J:()=>a});var r=n(5564),o=n.n(r),i=n(44139),s=n(62391);function a(e){let{onClick:t=(e=>{}),className:n,size:r="md",type:a="general"}=e;return(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),t&&t(e)},className:(0,i.cn)(o()("group inline-flex items-center justify-center gap-2 justify-self-center rounded-full","transition duration-300 focus-visible:outline-none active:scale-95",{"h-4 w-4":"xs"===r,"h-6 w-6":"sm"===r,"h-10 w-10":"md"===r,"h-14 w-14":"lg"===r},{"text-primary hover:bg-primary-light":"primary"===a,"text-secondary-foreground/85 hover:bg-background":"general"===a},n)),"aria-label":"close dialog",children:(0,s.jsx)("span",{className:"relative only:-mx-5",children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:o()("",{"h-3 w-3":"xs"===r,"h-4 w-4":"sm"===r,"h-5 w-5":"md"===r,"h-7 w-7":"lg"===r}),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",role:"img","aria-labelledby":"title-79 desc-79",children:[(0,s.jsx)("title",{id:"title-79",children:"Icon title"}),(0,s.jsx)("desc",{id:"desc-79",children:"A more detailed description of the icon"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})]})})})}},25968:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(20975),o=n(47760),i=n(62391);function s(e){let{children:t,layout:n}=e;const{baseColumnClass:s,setAppLayout:a}=(0,r.useContext)(o.h6);return(0,r.useEffect)((()=>{a(n)}),[s,n,a]),(0,i.jsx)("div",{id:"AppLayoutWrapper",children:t})}},68150:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(5564),o=n.n(r),i=n(20975),s=n(44139),a=n(62391);function l(e){let{button:t=(0,a.jsx)("h3",{children:"Drop Down"}),className:n="",dropdownClassName:r="",children:l=(0,a.jsx)(a.Fragment,{}),disabled:c=!1,alignment:d="right-1"}=e;const u=i.useRef(null);return(0,a.jsxs)("div",{ref:u,tabIndex:0,className:(0,s.cn)("customDropdown relative z-[1] text-left ".concat(n)),children:[(0,a.jsx)("button",{className:o()("inline-flex w-full items-center justify-between space-x-1 rounded-md text-sm font-medium leading-5 transition duration-150 ease-in-out",{"theme-bg-disable cursor-not-allowed text-secondary-foreground/80":c,"focus:shadow-outline-blue text-secondary-foreground hover:text-secondary-foreground/85 focus:border-primary focus:outline-none":!c}),type:"button",disabled:c,"aria-haspopup":"true","aria-expanded":"true",children:t}),(0,a.jsx)("div",{className:o()("dropdown-menu invisible -translate-y-2 scale-95 transform opacity-0 transition-all duration-300",{"right-0 top-0 origin-top-right":"right-1"===d,"left-0 top-0 origin-top-left":"left-1"===d}),children:(0,a.jsx)("div",{className:(0,s.cn)(o()("absolute z-50 mt-2 w-max origin-top-right divide-y divide-[var(--theme-border-color)] rounded-md border border-border bg-card shadow-lg outline-none",{"right-1":"right-1"===d,"left-1":"left-1"===d}),r),onClick:()=>{var e;null===(e=u.current)||void 0===e||e.blur()},role:"menu",children:l})})]})}},74645:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var r=n(62391);function o(e){return(0,r.jsx)("svg",{width:"9",height:"7",viewBox:"0 0 9 7",fill:"none",stroke:"100",className:"fill-current ".concat(e.className),...e,xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M8.08333 2.91713H2.25L4.16917 0.997961C4.22384 0.943733 4.26724 0.879216 4.29685 0.808131C4.32647 0.737047 4.34172 0.660802 4.34172 0.583795C4.34172 0.506788 4.32647 0.430543 4.29685 0.359459C4.26724 0.288374 4.22384 0.223857 4.16917 0.169629C4.05987 0.0609825 3.91203 0 3.75792 0C3.60381 0 3.45596 0.0609825 3.34667 0.169629L0.844167 2.67796C0.625074 2.89575 0.501302 3.19154 0.5 3.50046C0.502839 3.80735 0.626493 4.10077 0.844167 4.31712L3.34667 6.82545C3.40106 6.87946 3.46555 6.92222 3.53647 6.95131C3.60738 6.98039 3.68333 6.99522 3.75998 6.99495C3.83663 6.99467 3.91247 6.97931 3.98318 6.94973C4.05389 6.92015 4.11808 6.87693 4.17208 6.82254C4.22609 6.76815 4.26885 6.70365 4.29794 6.63274C4.32702 6.56182 4.34185 6.48587 4.34157 6.40922C4.3413 6.33258 4.32594 6.25674 4.29636 6.18603C4.26678 6.11532 4.22356 6.05113 4.16917 5.99712L2.25 4.08379H8.08333C8.23804 4.08379 8.38642 4.02233 8.49581 3.91294C8.60521 3.80354 8.66667 3.65517 8.66667 3.50046C8.66667 3.34575 8.60521 3.19738 8.49581 3.08798C8.38642 2.97858 8.23804 2.91713 8.08333 2.91713Z",fill:"currentColor"})})}},26464:(e,t,n)=>{"use strict";n.d(t,{ik:()=>o,ky:()=>i,b1:()=>s,hZ:()=>a,Fi:()=>l,Y4:()=>c});n(74645);var r=n(62391);function o(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M17 2h-3a5 5 0 0 0-5 5v3H6v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"})})}function i(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 1.25a2.75 2.75 0 1 0 0 5.5a2.75 2.75 0 0 0 0-5.5M3.75 4a1.25 1.25 0 1 1 2.5 0a1.25 1.25 0 0 1-2.5 0m-1.5 4A.75.75 0 0 1 3 7.25h4a.75.75 0 0 1 .75.75v13a.75.75 0 0 1-.75.75H3a.75.75 0 0 1-.75-.75zm1.5.75v11.5h2.5V8.75zM9.25 8a.75.75 0 0 1 .75-.75h4a.75.75 0 0 1 .75.75v.434l.435-.187a7.792 7.792 0 0 1 2.358-.595C20.318 7.4 22.75 9.58 22.75 12.38V21a.75.75 0 0 1-.75.75h-4a.75.75 0 0 1-.75-.75v-7a1.25 1.25 0 0 0-2.5 0v7a.75.75 0 0 1-.75.75h-4a.75.75 0 0 1-.75-.75zm1.5.75v11.5h2.5V14a2.75 2.75 0 1 1 5.5 0v6.25h2.5v-7.87c0-1.904-1.661-3.408-3.57-3.234a6.31 6.31 0 0 0-1.904.48l-1.48.635a.75.75 0 0 1-1.046-.69V8.75z",clipRule:"evenodd"})})}function s(e){return(0,r.jsxs)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",className:"fill-current ".concat(e.className),...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_11056_4514)",children:[(0,r.jsx)("path",{d:"M13.3333 0.5H2.66667C1.95942 0.5 1.28115 0.780952 0.781049 1.28105C0.280952 1.78115 0 2.45942 0 3.16667L0 11.1667C0 11.8739 0.280952 12.5522 0.781049 13.0523C1.28115 13.5524 1.95942 13.8333 2.66667 13.8333H4.6L7.56733 16.342C7.68771 16.4439 7.8403 16.4998 7.998 16.4998C8.1557 16.4998 8.30829 16.4439 8.42867 16.342L11.4 13.8333H13.3333C14.0406 13.8333 14.7189 13.5524 15.219 13.0523C15.719 12.5522 16 11.8739 16 11.1667V3.16667C16 2.45942 15.719 1.78115 15.219 1.28105C14.7189 0.780952 14.0406 0.5 13.3333 0.5V0.5ZM14.6667 11.1667C14.6667 11.5203 14.5262 11.8594 14.2761 12.1095C14.0261 12.3595 13.687 12.5 13.3333 12.5H11.4C11.0849 12.5001 10.7799 12.6118 10.5393 12.8153L8 14.96L5.462 12.8153C5.22104 12.6115 4.9156 12.4998 4.6 12.5H2.66667C2.31304 12.5 1.97391 12.3595 1.72386 12.1095C1.47381 11.8594 1.33333 11.5203 1.33333 11.1667V3.16667C1.33333 2.81304 1.47381 2.47391 1.72386 2.22386C1.97391 1.97381 2.31304 1.83333 2.66667 1.83333H13.3333C13.687 1.83333 14.0261 1.97381 14.2761 2.22386C14.5262 2.47391 14.6667 2.81304 14.6667 3.16667V11.1667Z",fill:"#374957"}),(0,r.jsx)("path",{d:"M4.66667 5.16732H8C8.17681 5.16732 8.34638 5.09708 8.4714 4.97205C8.59643 4.84703 8.66667 4.67746 8.66667 4.50065C8.66667 4.32384 8.59643 4.15427 8.4714 4.02925C8.34638 3.90422 8.17681 3.83398 8 3.83398H4.66667C4.48986 3.83398 4.32029 3.90422 4.19526 4.02925C4.07024 4.15427 4 4.32384 4 4.50065C4 4.67746 4.07024 4.84703 4.19526 4.97205C4.32029 5.09708 4.48986 5.16732 4.66667 5.16732Z",fill:"#374957"}),(0,r.jsx)("path",{d:"M11.3333 6.5H4.66667C4.48986 6.5 4.32029 6.57024 4.19526 6.69526C4.07024 6.82029 4 6.98985 4 7.16667C4 7.34348 4.07024 7.51304 4.19526 7.63807C4.32029 7.76309 4.48986 7.83333 4.66667 7.83333H11.3333C11.5101 7.83333 11.6797 7.76309 11.8047 7.63807C11.9298 7.51304 12 7.34348 12 7.16667C12 6.98985 11.9298 6.82029 11.8047 6.69526C11.6797 6.57024 11.5101 6.5 11.3333 6.5Z",fill:"#374957"}),(0,r.jsx)("path",{d:"M11.3333 9.16602H4.66667C4.48986 9.16602 4.32029 9.23625 4.19526 9.36128C4.07024 9.4863 4 9.65587 4 9.83269C4 10.0095 4.07024 10.1791 4.19526 10.3041C4.32029 10.4291 4.48986 10.4994 4.66667 10.4994H11.3333C11.5101 10.4994 11.6797 10.4291 11.8047 10.3041C11.9298 10.1791 12 10.0095 12 9.83269C12 9.65587 11.9298 9.4863 11.8047 9.36128C11.6797 9.23625 11.5101 9.16602 11.3333 9.16602Z",fill:"#374957"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_11056_4514",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"})})})]})}n(98208);function a(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21.945 2.765a1.552 1.552 0 0 0-1.572-.244L2.456 9.754a1.543 1.543 0 0 0 .078 2.884L6.4 13.98l2.095 6.926c.004.014.017.023.023.036a.486.486 0 0 0 .093.15a.49.49 0 0 0 .226.143c.01.004.017.013.027.015h.006l.003.001a.448.448 0 0 0 .233-.012c.008-.002.016-.002.025-.005a.495.495 0 0 0 .191-.122c.006-.007.016-.008.022-.014l3.013-3.326l4.397 3.405c.267.209.596.322.935.322c.734 0 1.367-.514 1.518-1.231L22.469 4.25a1.533 1.533 0 0 0-.524-1.486M9.588 15.295l-.707 3.437l-1.475-4.878l7.315-3.81l-4.997 4.998a.498.498 0 0 0-.136.253m8.639 4.772a.54.54 0 0 1-.347.399a.525.525 0 0 1-.514-.078l-4.763-3.689a.5.5 0 0 0-.676.06L9.83 19.07l.706-3.427l7.189-7.19a.5.5 0 0 0-.584-.797L6.778 13.054l-3.917-1.362A.526.526 0 0 1 2.5 11.2a.532.532 0 0 1 .334-.518l17.914-7.233a.536.536 0 0 1 .558.086a.523.523 0 0 1 .182.518z"})})}n(85947);function l(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}n(71883);function c(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M16.6 14c-.2-.1-1.5-.7-1.7-.8c-.2-.1-.4-.1-.6.1c-.2.2-.6.8-.8 1c-.1.2-.3.2-.5.1c-.7-.3-1.4-.7-2-1.2c-.5-.5-1-1.1-1.4-1.7c-.1-.2 0-.4.1-.5c.1-.1.2-.3.4-.4c.1-.1.2-.3.2-.4c.1-.1.1-.3 0-.4c-.1-.1-.6-1.3-.8-1.8c-.1-.7-.3-.7-.5-.7h-.5c-.2 0-.5.2-.6.3c-.6.6-.9 1.3-.9 2.1c.1.9.4 1.8 1 2.6c1.1 1.6 2.5 2.9 4.2 3.7c.5.2.9.4 1.4.5c.5.2 1 .2 1.6.1c.7-.1 1.3-.6 1.7-1.2c.2-.4.2-.8.1-1.2zm2.5-9.1C15.2 1 8.9 1 5 4.9c-3.2 3.2-3.8 8.1-1.6 12L2 22l5.3-1.4c1.5.8 3.1 1.2 4.7 1.2c5.5 0 9.9-4.4 9.9-9.9c.1-2.6-1-5.1-2.8-7m-2.7 14c-1.3.8-2.8 1.3-4.4 1.3c-1.5 0-2.9-.4-4.2-1.1l-.3-.2l-3.1.8l.8-3l-.2-.3c-2.4-4-1.2-9 2.7-11.5S16.6 3.7 19 7.5c2.4 3.9 1.3 9-2.6 11.4"})})}},98208:(e,t,n)=>{"use strict";n.d(t,{q:()=>o});var r=n(62391);function o(e){return(0,r.jsxs)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",className:"fill-current ".concat(e.className),...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("g",{clipPath:"url(#clip0_12855_11372)",children:(0,r.jsx)("path",{d:"M8.74216 8.2963C8.62653 8.31505 8.54528 8.38693 8.51559 8.49786C8.47653 8.64318 8.42028 8.5588 9.75934 10.3447L11 11.9994L9.75934 13.6541C8.40778 15.4557 8.47341 15.3588 8.51403 15.5104C8.53434 15.5838 8.63122 15.6807 8.69841 15.6963C8.72341 15.701 8.75153 15.7088 8.76403 15.7119C8.77497 15.7151 8.81403 15.7104 8.84841 15.701C8.91091 15.6838 16.139 12.3541 16.3203 12.2604C16.3734 12.2322 16.4281 12.1885 16.4468 12.1588C16.5234 12.0447 16.5062 11.8885 16.4078 11.7979C16.3656 11.7588 15.4 11.3072 12.6172 10.0229C10.564 9.07599 8.86559 8.29786 8.84372 8.29318C8.82184 8.28849 8.77653 8.29005 8.74216 8.2963Z",fill:"currentColor"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_12855_11372",children:(0,r.jsx)("rect",{width:"8",height:"8",fill:"currentColor",transform:"translate(8.5 8)"})})})]})}},85947:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var r=n(62391);function o(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",...e,children:(0,r.jsx)("path",{fill:e.fill||"currentColor",d:"M2 9h3v12H2a1 1 0 0 1-1-1V10a1 1 0 0 1 1-1m5.293-1.293l6.4-6.4a.5.5 0 0 1 .654-.047l.853.64a1.5 1.5 0 0 1 .553 1.57L14.6 8H21a2 2 0 0 1 2 2v2.104a2 2 0 0 1-.15.762l-3.095 7.515a1 1 0 0 1-.925.619H8a1 1 0 0 1-1-1V8.414a1 1 0 0 1 .293-.707"})})}},71883:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(62391);function o(e){return(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_14343_14582)",children:[(0,r.jsx)("path",{d:"M1.62695 4.1997C0.861328 4.41064 0.220703 5.08642 0.0605469 5.84814C-0.0253906 6.24267 -0.0253906 13.7583 0.0605469 14.1528C0.224609 14.9263 0.865234 15.5942 1.64258 15.8013C1.97461 15.8911 11.5176 15.8872 11.8535 15.8013C12.5723 15.6138 13.166 15.0474 13.4043 14.3325L13.498 14.0434V10.0005C13.498 6.19579 13.4941 5.94189 13.4277 5.72314C13.1973 4.96923 12.5996 4.3872 11.8574 4.1997C11.6582 4.14892 10.9863 4.1411 6.7207 4.14501C2.72852 4.14892 1.7832 4.15673 1.62695 4.1997Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M18.2578 5.36448C18.1875 5.39183 17.3398 5.86839 16.3711 6.42698L14.6094 7.44261L14.6172 9.99339L14.6289 12.5481L16.3477 13.5325C17.293 14.0754 18.1367 14.5442 18.2227 14.5793C18.4883 14.6848 18.7148 14.7004 18.9766 14.634C19.3867 14.5285 19.7227 14.2512 19.8984 13.8723C19.9805 13.6926 19.9805 13.677 19.9922 10.1028C20.0039 6.15355 20.0078 6.23167 19.7656 5.88011C19.5039 5.5012 19.1328 5.3098 18.6602 5.31761C18.5039 5.31761 18.3242 5.34105 18.2578 5.36448Z",fill:"currentColor"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_14343_14582",children:(0,r.jsx)("rect",{width:"20",height:"20",fill:"currentColor"})})})]})}},1689:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=n(20975),s=n(62391);const a=e=>{let{id:t,src:n,alt:r,height:a,width:l,className:c,onClick:d=(()=>{}),style:u}=e;const p=(0,i.useRef)(null),[h,m]=(0,i.useState)(!1),f={filter:"blur(".concat(h?0:10,"px)"),transition:"opacity 300ms ease-out 0.3s",opacity:h?1:0,...u};return(0,i.useEffect)((()=>{const e=new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting&&(p.current&&(p.current.src=null!==n&&void 0!==n?n:""),t.unobserve(e.target))}))}));p.current&&e.observe(p.current);const t=p.current;return()=>{t&&e.unobserve(t)}}),[n]),(0,s.jsx)("img",{id:t,ref:p,height:a,width:l,style:f,alt:null!==r&&void 0!==r?r:"picture",onLoadStart:e=>{e.currentTarget.style.filter="blur(10px)"},onLoad:e=>{e.currentTarget.style.filter="none",m(!0)},onError:e=>{e.currentTarget.style.filter="none"},onAbort:e=>{e.currentTarget.style.filter="none"},className:o()("LazyImage",c),decoding:"async",loading:"lazy",onClick:d})}},58157:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(5564),o=n.n(r),i=n(44139),s=n(53871),a=n(62391);function l(e){let{label:t,onClick:n,className:r,prefix:l,suffix:c,isLoading:d=!1,disabled:u=!1,hoverable:p=!0}=e;return(0,a.jsxs)("button",{className:(0,i.cn)(o()("select-none rounded p-1",{"cursor-not-allowed text-secondary-foreground/70":!n||u,"cursor-pointer text-primary":n,"cursor-wait":d,"hover:bg-primary-light":p,"hover:bg-muted":p&&(!n||u)},r)),onClick:e=>{!n||d||u||n(e)},children:[l,(0,a.jsx)(s.A,{children:t}),c]})}},29646:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(5564),o=n.n(r),i=n(62144),s=n(53871),a=n(62391);const l=function(e){let{children:t,label:n,align:r="top",className:l=""}=e;return(0,a.jsxs)("div",{className:"tooltip relative transition duration-150 ease-in-out ".concat(l),children:[(0,a.jsx)("div",{className:"transition duration-150 ease-in-out","aria-haspopup":"true","aria-expanded":"true",children:t}),(0,a.jsx)("div",{className:o()("label invisible absolute flex transform flex-col items-center opacity-0 transition-all duration-700",{"bottom-0 left-0 right-0 mb-10 -translate-y-2":"top"===r,"left-0 right-0 top-0 mt-10 -translate-y-0":"bottom"===r,"-translate-x-24 -translate-y-9":"left"===r,"-translate-x-0":"right"===r}),children:(0,a.jsxs)("span",{className:"theme-bg-heading-1 theme-text-background whitespace-no-wrap relative z-10 m-2 min-w-max rounded p-2 text-xs leading-none shadow-md delay-1000 ease-linear",children:[(0,a.jsx)(s.A,{children:n}),(0,a.jsx)("div",{className:o()("absolute flex w-full items-center",{"-top-2 left-0 place-content-center":"bottom"===r,"-bottom-2 left-0 place-content-center":"top"===r,"-left-1.5 top-0 h-full place-content-start":"right"===r,"top-0 h-full place-content-end":"left"===r}),children:(0,a.jsx)("div",{style:{transform:"".concat({left:"rotate(360deg)",right:"rotate(180deg)",top:"rotate(90deg)",bottom:"rotate(272deg)"}[r])},children:(0,a.jsx)(i.A,{icon:"play",solid:!0,className:"text-secondary-foreground"})})})]})})]})}},44139:(e,t,n)=>{"use strict";n.d(t,{$:()=>Q,cn:()=>$});var r=n(5564),o=n.n(r),i="-";function s(e){var t=function(e){var t=e.theme,n=e.prefix,r={nextPart:new Map,validators:[]},o=function(e,t){if(!t)return e;return e.map((function(e){return[e[0],e[1].map((function(e){return"string"===typeof e?t+e:"object"===typeof e?Object.fromEntries(Object.entries(e).map((function(e){var n=e[0],r=e[1];return[t+n,r]}))):e}))]}))}(Object.entries(e.classGroups),n);return o.forEach((function(e){var n=e[0];c(e[1],r,n,t)})),r}(e),n=e.conflictingClassGroups,r=e.conflictingClassGroupModifiers,o=void 0===r?{}:r;return{getClassGroupId:function(e){var n=e.split(i);return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||function(e){if(l.test(e)){var t=l.exec(e)[1],n=null===t||void 0===t?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}(e)},getConflictingClassGroupIds:function(e,t){var r=n[e]||[];return t&&o[e]?[].concat(r,o[e]):r}}}function a(e,t){var n;if(0===e.length)return t.classGroupId;var r=e[0],o=t.nextPart.get(r),s=o?a(e.slice(1),o):void 0;if(s)return s;if(0!==t.validators.length){var l=e.join(i);return null===(n=t.validators.find((function(e){return(0,e.validator)(l)})))||void 0===n?void 0:n.classGroupId}}var l=/^\[(.+)\]$/;function c(e,t,n,r){e.forEach((function(e){if("string"!==typeof e){if("function"===typeof e)return e.isThemeGetter?void c(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((function(e){var o=e[0];c(e[1],d(t,o),n,r)}))}else{(""===e?t:d(t,e)).classGroupId=n}}))}function d(e,t){var n=e;return t.split(i).forEach((function(e){n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n}function u(e){if(e<1)return{get:function(){},set:function(){}};var t=0,n=new Map,r=new Map;function o(o,i){n.set(o,i),++t>e&&(t=0,r=n,n=new Map)}return{get:function(e){var t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set:function(e,t){n.has(e)?n.set(e,t):o(e,t)}}}var p="!";function h(e){var t=e.separator||":",n=1===t.length,r=t[0],o=t.length;return function(e){for(var i,s=[],a=0,l=0,c=0;cl?i-l:void 0}}}var m=/\s+/;function f(){for(var e,t,n=0,r="";n{})}=e,m="bg-primary border border-primary text-primary-foreground";return d&&(m="border border-border text-primary hover:border-primary"),"red"===u&&(m="bg-alert border-alert text-alert-foreground hover:bg-alert-hover"),c&&(m="bg-card border-border border"),(0,Y.jsx)("button",{type:p,disabled:r,className:$(o()("word-breaker select-none border border-border font-semibold hover:shadow focus:outline-none",{"cursor-not-allowed border-primary text-primary hover:shadow-none":r&&s,"border-primary text-primary":!r&&s,"theme-bg-disable cursor-not-allowed text-secondary-foreground/70 hover:shadow-none":r&&!s,[m]:!r&&!s,"rounded px-3 py-1":!a,"rounded px-6 py-2":a,"px-4 py-2":c,"cursor-progress":i&&!r}),l),onClick:e=>{if(i||r)return null;h(e)},children:(0,Y.jsxs)("span",{className:"flex place-content-center items-center whitespace-normal",children:[i?(0,Y.jsx)("span",{className:"mr-1",children:(0,Y.jsx)(K.a,{spinnerColor:"var(--theme-on-primary-color)",size:20})}):null,t&&(0,Y.jsx)("span",{className:"mr-2",children:t}),(0,Y.jsx)("span",{children:(0,Y.jsx)(q.A,{children:n})})]})})}},15102:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,y:()=>a});var r=n(5564),o=n.n(r),i=(n(20975),n(62391));function s(e){let{child1:t,child2:n,isActiveFirst:r=!0,duration:s=300,transition:a="fade",className:l=""}=e;return(0,i.jsxs)("div",{className:"relative ".concat(l),children:[(0,i.jsx)("div",{className:o()("Child-1 absolute inset-0 transform transition duration-".concat(s," ease-linear"),{"z-10 opacity-100":r&&"fade"===a,"pointer-events-none z-0 opacity-0":!r&&"fade"===a},{"z-10 translate-x-0 opacity-100":r&&"slide"===a,"pointer-events-none z-0 translate-x-full opacity-0":!r&&"slide"===a},{"z-10 translate-x-0 opacity-100":r&&"slideFromRight"===a,"pointer-events-none z-0 translate-x-full opacity-0":!r&&"slideFromRight"===a},{"z-10 translate-x-0 opacity-100":r&&"slideFromLeft"===a,"pointer-events-none z-0 -translate-x-full opacity-0":!r&&"slideFromLeft"===a},{"z-10 translate-x-0 opacity-100":r&&"LeftInRightOut"===a,"pointer-events-none z-0 -translate-x-full opacity-0":!r&&"LeftInRightOut"===a},{"z-10 -translate-x-0 opacity-100":r&&"RightInLeftOut"===a,"pointer-events-none z-0 translate-x-full opacity-0":!r&&"RightInLeftOut"===a}),children:t}),(0,i.jsx)("div",{className:o()("Child-2 absolute inset-0 transform transition duration-".concat(s," ease-linear"),{"z-10 opacity-100":!r&&"fade"===a,"pointer-events-none z-0 opacity-0":r&&"fade"===a},{"z-10 translate-x-0 opacity-100":!r&&"slide"===a,"pointer-events-none z-0 translate-x-full opacity-0":r&&"slide"===a},{"z-10 opacity-100":!r&&"slideFromRight"===a,"pointer-events-none z-0 opacity-0":r&&"slideFromRight"===a},{"z-10 opacity-100":!r&&"slideFromLeft"===a,"pointer-events-none z-0 opacity-0":r&&"slideFromLeft"===a},{"z-10 translate-x-0 opacity-100":!r&&"LeftInRightOut"===a,"pointer-events-none z-0 translate-x-full opacity-0":r&&"LeftInRightOut"===a},{"z-10 translate-x-0 opacity-100":!r&&"RightInLeftOut"===a,"pointer-events-none z-0 -translate-x-full opacity-0":r&&"RightInLeftOut"===a}),children:n})]})}function a(e){let{children:t,IsDisplay:n=!0,duration:r=300,transition:s="fade",className:a=""}=e;return(0,i.jsx)("div",{className:o()(a),children:(0,i.jsx)("div",{className:o()("inset-0 transform transition duration-".concat(r," ease-linear"),{"z-10 opacity-100":n&&"fade"===s,"pointer-events-none z-0 h-0 w-0 opacity-0":!n&&"fade"===s},{"z-10 translate-x-0 opacity-100":n&&"slide"===s,"pointer-events-none z-0 h-0 w-0 translate-x-full opacity-0":!n&&"slide"===s},{"z-10 translate-x-0 opacity-100":n&&"slideFromRight"===s,"pointer-events-none z-0 h-0 w-0 translate-x-full opacity-0":!n&&"slideFromRight"===s},{"z-10 translate-x-0 opacity-100":n&&"slideFromLeft"===s,"pointer-events-none z-0 h-0 w-0 -translate-x-full opacity-0":!n&&"slideFromLeft"===s},{"z-10 scale-100 opacity-100":n&&"scale"===s,"pointer-events-none z-0 scale-0 opacity-0":!n&&"scale"===s}),children:n&&t})})}},90663:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=(n(20975),n(53871)),s=n(62391);function a(e){let{label:t,list:n,value:r,className:a,required:l,selectClassName:c,placeholder:d="Select",onStateChange:u}=e;return(0,s.jsxs)("div",{className:a,children:[(0,s.jsx)("div",{className:o()("mb-1 font-semibold",{hidden:!t}),children:(0,s.jsx)(i.A,{children:t})}),(0,s.jsx)("div",{className:o()("cursor-pointer rounded border border-border px-2 py-2",c),children:(0,s.jsxs)("select",{className:"w-full bg-transparent focus:outline-none",value:r,required:l,onChange:e=>{u(e.target.value)},children:[(0,s.jsx)("option",{value:"",children:d}),n.map((e=>(0,s.jsx)("option",{value:e,children:e},e)))]})})]})}},21788:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>h,cT:()=>p,jX:()=>m,xx:()=>u});var r=n(5564),o=n.n(r),i=n(53871),s=n(44139),a=n(90559),l=n(91900),c=n(62144),d=n(62391);function u(e){return void 0===e||null===e||""===e?"":e=(e=(e=(e=(e=(e=(e=e.substring(0,255)).replace(/\s+/g,"-")).replace(/[^\w\-]+/g,"")).replace(/[\s-]+/g,"-")).replace(/^-+/,"")).toLowerCase()).replace(/^\s+|\s+$/g,"")}function p(e){return void 0!==e&&null!==e&&e.length>255?e.substring(0,255):e}function h(e){let{community:t,active:n,setActive:r,slug:o,slugPrefix:c,setSlug:u,title:p,setTitle:h,description:f,setDescription:g,OGTitle:b,setOGTitle:v,OGDescription:y,setOGDescription:k,OGImage:w,OgImageSubtitle:x,setOGImage:_,isSEOSettingsInputsVisible:A,setIsSEOSettingsInputsVisible:C,isOpenGraphInputsVisible:S,setIsOpenGraphInputsVisible:j,hideCreateSlug:E=!1,clearSlugMeta:N}=e;return n?(0,d.jsx)(l.a,{className:"",active:n,width:"540px",padding:!1,setActive:r,children:(0,d.jsxs)("div",{className:"flex flex-col bg-card px-4 py-4 pb-8",children:[(0,d.jsxs)("div",{className:"mb-4 flex place-content-between items-center",children:[(0,d.jsxs)("span",{className:"flex items-center font-semibold",children:[(0,d.jsx)(a.A,{hoverable:!0,size:"sm",icon:"cross",solid:!0,onClick:()=>{N&&N(),r(!1)}}),(0,d.jsx)(i.A,{children:"Post Settings"})]}),(0,d.jsx)(s.$,{label:"Done",onClick:()=>r(!1),btnColor:void 0})]}),(0,d.jsx)(m,{hideCreateSlug:E,community:t,setActive:r,slug:o,slugPrefix:c,setSlug:u,title:p,setTitle:h,description:f,setDescription:g,OGTitle:b,setOGTitle:v,OGDescription:y,setOGDescription:k,OGImage:w,setOGImage:_,OgImageSubtitle:x,isSEOSettingsInputsVisible:A,setIsSEOSettingsInputsVisible:C,isOpenGraphInputsVisible:S,setIsOpenGraphInputsVisible:j,clearSlugMeta:N})]})}):null}function m(e){let{community:t,slug:n,setSlug:r,title:s,slugPrefix:a,setTitle:l,description:p,setDescription:h,OGTitle:m,setOGTitle:f,OGDescription:g,setOGDescription:b,OGImage:v,OgImageSubtitle:y,setOGImage:k,isSEOSettingsInputsVisible:w=!1,setIsSEOSettingsInputsVisible:x,isOpenGraphInputsVisible:_=!1,setIsOpenGraphInputsVisible:A,hideCreateSlug:C=!1}=e;function S(e){return void 0!==e&&null!==e&&e.length>255?e.substring(0,255):e}let j=void 0!==p?p.split("\n").length:1;j=j>3?j:3;void 0!==g&&g.split("\n").length;return j=j>3?j:3,(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"mt-5 flex items-center space-x-2 text-base font-bold hover:cursor-pointer",onClick:()=>{x(!w)},children:[(0,d.jsx)(i.A,{children:"SEO Settings"}),(0,d.jsx)("span",{children:(0,d.jsx)(c.A,{icon:w?"caret-down":"caret-right",size:"xs",className:o()("ml-1")})})]}),w&&(0,d.jsxs)("div",{children:[!C&&(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"font-bold",children:(0,d.jsx)(i.A,{children:"Custom URL"})}),(0,d.jsx)("span",{className:"my-1 text-xs text-secondary-foreground/70",children:"https://".concat(window.location.hostname,"/").concat(a,"/").concat(""===n?"{title}":n)}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("input",{className:"flex-grow rounded bg-background py-1 focus:outline-none md:px-2",onChange:e=>{r(u(e.target.value))},value:null!==n&&void 0!==n?n:""})})]})}),(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"mt-2 font-bold text-xs",children:(0,d.jsx)(i.A,{children:"Meta Title"})}),(0,d.jsx)("div",{className:"text-xxs mb-2 italic text-secondary-foreground/70",children:(0,d.jsx)(i.A,{children:"Maximum length of 255 characters allowed"})}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("input",{className:"flex-grow bg-card rounded py-2 focus:outline-none md:px-2",onChange:e=>{l(S(e.target.value))},value:null!==s&&void 0!==s?s:""})})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"mt-2 font-bold text-xs",children:(0,d.jsx)(i.A,{children:"Meta Description"})}),(0,d.jsx)("div",{className:"text-xxs mb-2 italic text-secondary-foreground/70",children:(0,d.jsx)(i.A,{children:"Maximum length of 255 characters allowed"})}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("textarea",{value:null!==p&&void 0!==p?p:"",onChange:e=>{h(S(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"block w-full flex-grow rounded px-2 py-2 bg-card focus:outline-none",rows:j})})]})]}),(0,d.jsxs)("span",{className:"mt-5 flex items-center space-x-2 text-base font-bold hover:cursor-pointer",onClick:()=>{A(!_)},children:[(0,d.jsx)(i.A,{children:"Open Graph Details"}),(0,d.jsx)("span",{children:(0,d.jsx)(c.A,{icon:_?"caret-down":"caret-right",size:"xs",className:"ml-1"})})]}),_&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"mt-2 font-bold text-xs",children:(0,d.jsx)(i.A,{children:"Open Graph Title"})}),(0,d.jsx)("div",{className:"text-xxs mb-2 italic text-secondary-foreground/70",children:(0,d.jsx)(i.A,{children:"Maximum length of 255 characters allowed"})}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("input",{className:"flex-grow rounded py-2 bg-card focus:outline-none md:px-2",onChange:e=>{f(S(e.target.value))},value:null!==m&&void 0!==m?m:""})})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"mt-2 font-bold text-xs",children:(0,d.jsx)(i.A,{children:"Open Graph Description"})}),(0,d.jsx)("div",{className:"text-xxs mb-2 italic text-secondary-foreground/70",children:(0,d.jsx)(i.A,{children:"Maximum length of 255 characters allowed"})}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("textarea",{value:null!==g&&void 0!==g?g:"",onChange:e=>{b(S(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"block flex-grow rounded py-2 bg-card focus:outline-none md:px-2",rows:j})})]}),t.configuration.isWhiteLabel?(0,d.jsx)(d.Fragment,{}):(0,d.jsxs)("div",{className:"mt-2 flex flex-col",children:[(0,d.jsx)("h4",{className:"font-bold text-xs",children:(0,d.jsx)(i.A,{children:"Open Graph Image"})}),(0,d.jsxs)("div",{className:"my-1 text-xs text-secondary-foreground/70",children:[(0,d.jsx)("div",{children:(0,d.jsx)(i.A,{children:"Recommended dimensions: 1200px by 630px with a 1.91:1 aspect ratio."})}),y&&(0,d.jsx)(i.A,{children:y})]}),(0,d.jsx)("div",{className:"flex rounded border border-border",children:(0,d.jsx)("input",{className:"flex-grow rounded py-2 bg-card focus:outline-none md:px-2",onChange:e=>{k(e.target.value)},placeholder:"https://example.com/image.jpg",value:null!==v&&void 0!==v?v:""})})]})]})]})}},68491:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(5564),o=n.n(r),i=(n(20975),n(65186)),s=n(53871),a=n(62144),l=n(62391);const c=e=>{let{selectedOption:t,setSelectedOption:n,options:r,removeSelectedCommunityTopicFilter:c}=e;const{analyticsService:d}=(0,i.W)();return(0,l.jsx)("div",{className:"flex gap-2.5 overflow-x-auto w-fit",style:{scrollbarWidth:"none"},children:r.map((e=>(0,l.jsxs)("button",{className:o()("flex cursor-pointer items-center justify-center gap-1.5 rounded-full border border-border px-2 py-1 text-xs transition-all duration-200 ease-in-out",{"cursor-pointer bg-primary text-primary-foreground":t===e.key,"text-secondary-foreground/70 focus-within:scale-[.95] hover:border-secondary-foreground/50 hover:bg-accent/90 hover:text-secondary-foreground/90":t!==e.key}),style:{minWidth:"112px",backgroundColor:e.bgColor,color:e.textColor},onClick:()=>{t!==e.key&&(n(e.key),d.track("post-filter",{filterName:e.key}))},children:[e.icon&&(0,l.jsx)(a.A,{icon:e.icon,className:"mr-1"}),(0,l.jsx)(s.A,{children:e.label}),e.isCommunityTopic&&(0,l.jsx)("div",{onClick:c,children:(0,l.jsx)(a.A,{icon:"cross",className:"ml-2"})})," "]},e.key)))})}},41146:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{children:t=(0,i.jsx)(i.Fragment,{}),className:n="",selected:r=!1,onClick:s=(()=>{}),disabled:a=!1,semiSelected:l=!1}=e;return(0,i.jsx)("div",{onClick:()=>{a||s()},className:o()("Checkbox cursor-pointer transition-all duration-300 ease-linear",n,{selected:r&&!a,"disabled-selected cursor-not-allowed":r&&a,"disabled cursor-not-allowed":!r&&a,semiSelected:!r&&l}),children:t})}},76786:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(20975),o=n(49724),i=n(68652),s=n(62144),a=n(62391);const l=e=>{var t;let{selectorTypeLabel:n=" ",setSelectedOption:l,selectedOption:c,options:d=[]}=e;const[u,p]=(0,r.useState)(c),[h,m]=(0,r.useState)(d.some((e=>"CHANNEL"===e.origin)));return(0,r.useEffect)((()=>{let e;if(e=h?Object.entries(i.A.CHANNEL_TOOLTIPS).find((e=>{let[t,{id:n}]=e;return c===n})):Object.entries(i.A.GROUP_TOOLTIPS).find((e=>{let[t,{id:n}]=e;return c===n})),d.some((e=>"SESSION_TYPE"===e.origin))&&(e=Object.entries(o.A.SESSION_TOOLTIPS).find((e=>{let[t,{id:n}]=e;return c===n}))),e){const[t,n]=e;p(n)}}),[c,l]),(0,a.jsxs)("div",{className:"flex-col",children:[(0,a.jsx)("div",{className:"mt-4 text-xs font-bold",style:{minHeight:"16px"},children:n}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-4",children:d.map((e=>(0,a.jsx)("div",{className:"flex-col",children:(0,a.jsx)("div",{className:"cursor-pointer items-center hover:bg-accent ".concat(e.id===c&&"bg-accent"),onClick:()=>{l&&l(e.id);const t=h?Object.entries(i.A.CHANNEL_TOOLTIPS).find((t=>{let[n,{id:r}]=t;return e.id===r})):Object.entries(i.A.GROUP_TOOLTIPS).find((t=>{let[n,{id:r}]=t;return e.id===r}));if(t){const[e,n]=t;p(n)}},children:(0,a.jsx)("button",{type:"button",className:"h-10 rounded border border-border px-5",style:{minWidth:"160px"},children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[e.iconName&&(0,a.jsx)(s.A,{icon:e.iconName}),e.selectorName&&(0,a.jsx)("span",{children:e.selectorName})]})})},e.id)},e.id)))}),u&&(null===(t=u.tooltips)||void 0===t?void 0:t.length)&&(0,a.jsx)("div",{className:"flex-col px-4 py-2",children:u.tooltips.map((e=>(0,a.jsxs)("div",{className:"flex gap-1 text-xs text-[#8C8C8C]",children:[(0,a.jsx)("p",{className:"font-bold",children:e.label}),(0,a.jsxs)("p",{children:[": ",e.description]})]},e.label)))})]})}},69302:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var r=n(20975);class o{static getFileSizeInMB(e){return e&&e.size?e.size/1048576:null}static sizeGreaterThan(e,t){const n=this.getFileSizeInMB(e);return null!==n&&n>t}static sizeLessThan(e,t){const n=this.getFileSizeInMB(e);return null!==n&&n{}),children:a,className:l="",disabled:c=!1,multiple:d=!1,maxFiles:u,maxFileSize:p}=e;const h=r.useRef(null),m=async e=>{if(e&&null!==e&&e.target&&e.target.files)if(e.stopPropagation(),e.preventDefault(),e.target.files.length>0){if(!function(){var e;if(!u)return!0;const t=null===(e=h.current)||void 0===e?void 0:e.files;if(i.A.hasValue(t)&&t.length>u)return alert("You can only select ".concat(u," files")),!1;return!0}())return;if(!function(){var e;if(!p)return!0;const t=null===(e=h.current)||void 0===e?void 0:e.files;if(i.A.hasValue(t))for(let n=0;n{var e;c||(null===(e=h.current)||void 0===e||e.click())},children:[(0,s.jsx)("input",{className:"hidden",accept:t,disabled:c,type:"file",ref:h,multiple:d,onChange:e=>{m(e)}}),a]})}},21708:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var r=n(20975),o=n(98020),i=n(16478),s=n(65186),a=n(56072),l=n(68652),c=n(62220),d=n(43039),u=n(93668),p=n(63360),h=n(53871),m=n(44139),f=n(21788),g=n(76786),b=n(69302),v=n(81107),y=n(54617),k=n(62144),w=n(62391);const x=e=>{var t,n,x,_,A,C;let{group:S,isEditGroupModalVisible:j,setIsEditGroupModalVisible:E,updateGroup:N,setIsCreateGroupModalVisible:P}=e;const[D,M]=(0,r.useState)(a.A.BASIC),[T,I]=(0,r.useState)(j?null===S||void 0===S?void 0:S.name:""),[O,L]=(0,r.useState)(j?null===S||void 0===S?void 0:S.description:"");console.log(null===S||void 0===S?void 0:S.groupType);const[R,B]=(0,r.useState)(j?S.isOnlyVisibleToMembers?l.A.GROUP.PRIVATE:null===S||void 0===S?void 0:S.groupType:l.A.GROUP.OPEN),[z,F]=(0,r.useState)(!0),[U,V]=(0,r.useState)(!0),[G,H]=(0,r.useState)(j?null===S||void 0===S||null===(t=S.meta)||void 0===t?void 0:t.slug:""),[W,q]=(0,r.useState)(j?null===S||void 0===S||null===(n=S.meta)||void 0===n?void 0:n.title:""),[K,Y]=(0,r.useState)(j?null===S||void 0===S||null===(x=S.meta)||void 0===x?void 0:x.description:""),[$,Q]=(0,r.useState)(j?null===S||void 0===S||null===(_=S.meta)||void 0===_?void 0:_.openGraphTitle:""),[Z,J]=(0,r.useState)(j?null===S||void 0===S||null===(A=S.meta)||void 0===A?void 0:A.openGraphDescription:""),[X,ee]=(0,r.useState)(j?null===S||void 0===S||null===(C=S.meta)||void 0===C?void 0:C.openGraphImage:""),[te,ne]=(0,r.useState)(j?null===S||void 0===S?void 0:S.color:""),[re,oe]=(0,r.useState)(j?null===S||void 0===S?void 0:S.banner:null),[ie,se]=(0,r.useState)(j?null===S||void 0===S?void 0:S.groupBanner:""),[ae,le]=(0,r.useState)(!1),[ce,de]=(0,r.useState)(!!j&&(null===S||void 0===S?void 0:S.isOnlyVisibleToMembers)),[ue,pe]=(0,r.useState)(S&&S.price?S.price/100:0),[he,me]=(0,r.useState)((null===S||void 0===S?void 0:S.currency)||"INR"),[fe,ge]=(0,r.useState)(!!S),[be,ve]=(0,r.useState)((null===S||void 0===S?void 0:S.gatedTokenAddress)||""),[ye,ke]=(0,r.useState)(!1),[we,xe]=(0,r.useState)(""),[_e,Ae]=(0,r.useState)(!1),Ce=(0,r.useRef)(null),{analyticsService:Se}=(0,s.W)(),je=(0,i.j)(),Ee=(0,o.W6)(),{groups:Ne,community:Pe,user:De}=(0,i.G)((e=>({groups:e.groups,user:e.auth,community:e.community}))),Me=e=>{je((0,u.$Y)([...Ne,e]))},Te=e=>{N(e)},Ie=(e,t)=>{d.Bd.createGroup(e,t).then((t=>{let{group:n}=t;re?d.Bd.uploadBanner(e,n.id,re).then((e=>{le(!1),Me(e.group),Le(),E(!1),Se.track("create-group",{userType:Pe.myRole,groupName:n.name,description:n.description,groupType:R,groupUrl:n.url})})).catch((e=>{le(!1)})):(le(!1),Me(n),Le(),Se.track("create-group",{userType:Pe.myRole,groupName:n.name,description:n.description,groupType:R,groupUrl:(0,c.createGroupPageUrlFromSlug)(n)})),E(!1),Ee.push((0,c.getGroupPageRouteFromSlug)(n))})).catch((e=>{console.log(e),le(!1)}))},Oe=(e,t)=>{d.Bd.updateGroup(e,S.id,t).then((t=>{re?d.Bd.uploadBanner(e,t.group.id,re).then((e=>{le(!1),Le(),Te(e.group)})).catch((e=>{le(!1)})):(le(!1),Le(),Te(t.group))})).catch((e=>{le(!1)}))},Le=()=>{oe(null),I(""),pe(0),me("INR"),L(""),B(""),ge(!1),E&&E(!1),P&&P(!1),xe(""),ke(!0),H(""),q(""),Y(""),Q(""),J(""),ee(""),ne(""),ve(""),se("")};let Re=null===O||void 0===O?void 0:O.split("\n").length;function Be(e){return void 0!==e&&null!==e&&e.length>255?e.substring(0,255):e}return Re=Re>3?Re:3,(0,w.jsxs)("div",{className:"h-fit bg-card text-secondary-foreground",children:[(0,w.jsx)("div",{className:"sticky top-0 flex-col border-b border-border bg-card p-4",children:(0,w.jsxs)("div",{className:"flex-col items-center",children:[(0,w.jsxs)("div",{className:"flex justify-between",children:[(0,w.jsx)("span",{className:"text-base font-bold text-secondary-foreground/80",children:j?(0,w.jsx)(h.A,{children:"Edit Group"}):(0,w.jsx)(h.A,{children:"Create Group"})}),(0,w.jsx)(p.J,{onClick:Le})]}),(0,w.jsxs)("div",{className:"flex items-center gap-2",children:[(0,w.jsx)("span",{className:"".concat(D===a.A.BASIC?"cursor-pointer rounded bg-accent px-4 py-1 text-primary":"cursor-pointer px-4 py-1 text-secondary-foreground"),onClick:()=>M(a.A.BASIC),children:"Basic Details"}),(0,w.jsx)("span",{className:"".concat(D===a.A.ADVANCED?"cursor-pointer rounded bg-accent px-4 py-1 text-primary":"cursor-pointer px-4 py-1 text-secondary-foreground"),onClick:()=>M(a.A.ADVANCED),children:"Advance Details"})]})]})}),D===a.A.BASIC&&(0,w.jsxs)("div",{className:"h-fit px-4 py-6",children:[(0,w.jsx)("div",{className:"mb-1 text-xs font-bold after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,w.jsx)(h.A,{children:"Group Name"})}),(0,w.jsx)(y.k,{placeholder:"Enter Group name",className:"bg-card",containerClassName:"bg-card",defaultValue:T,validator:e=>e&&e.length>2?null:"Valid channel name required!",onChange:e=>{I(e)},large:!0}),(0,w.jsxs)("div",{children:[(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Group Description"})}),(0,w.jsx)("textarea",{ref:Ce,value:O,onChange:e=>{L(e.target.value),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"block flex w-full flex-grow rounded border border-border bg-card px-2 py-1 focus:outline-none",rows:Re,placeholder:"Enter description here"})]}),(0,w.jsx)("div",{className:"mt-1 flex gap-4",children:(0,w.jsx)(g.A,{selectorTypeLabel:"Group Access",setSelectedOption:B,selectedOption:R,options:[{id:l.A.GROUP.OPEN,iconName:"unlock",selectorName:"Open",tooltips:l.A.GROUP_TOOLTIPS.OPEN.tooltips},{id:l.A.GROUP.CLOSED,iconName:"lock",selectorName:"Closed",tooltips:l.A.GROUP_TOOLTIPS.CLOSED.tooltips},{id:l.A.GROUP.PRIVATE,iconName:"eye-crossed",selectorName:"Private",tooltips:l.A.GROUP_TOOLTIPS.PRIVATE.tooltips}]})}),(0,w.jsx)("div",{className:"mb-2 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Cover Picture"})}),(0,w.jsxs)("div",{className:"mb-20 w-full flex-col",children:[re?(0,w.jsx)("div",{className:"group-color-preview-holder h-80 w-full rounded",children:(0,w.jsx)("div",{className:"group-color-preview relative h-full w-full rounded",style:{backgroundImage:re&&"url(".concat(j&&S.banner&&"string"===typeof re?re:URL.createObjectURL(re),")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"},children:(0,w.jsx)("div",{className:"absolute bottom-1 right-1",children:(0,w.jsxs)("div",{className:"relative mx-auto flex items-center justify-between",children:[(0,w.jsx)(b.z,{accept:"image/*",maxFileSize:10,onChange:e=>{ke(!0);let t=URL.createObjectURL(e);xe(t),Ae(!1)},children:(0,w.jsx)(m.$,{onClick:e=>{e.preventDefault()},className:"mr-2",label:"Change Cover"})}),(0,w.jsx)(m.$,{onClick:e=>{e.stopPropagation(),oe(null)},className:"mr-2",label:"Remove"})]})})})}):(0,w.jsxs)("div",{className:"flex items-center justify-center gap-1 rounded-md border border-dashed border-border py-2 text-center hover:cursor-pointer",children:[(0,w.jsx)("div",{className:"flex items-center",children:(0,w.jsx)(k.A,{icon:"plus-small",className:"select-none text-sm"})}),(0,w.jsx)(b.z,{accept:"image/*",onChange:e=>{ke(!0);let t=URL.createObjectURL(e);xe(t),Ae(!1)},children:(0,w.jsx)("div",{className:"color-selector banner"+(re?"selected":""),children:(0,w.jsx)("div",{className:"theme-primary-text-color text-sm font-semibold leading-[19px] tracking-[0.01em] text-secondary-foreground",children:(0,w.jsx)(h.A,{children:"Upload Group Thumbnail"})})})})]}),(0,w.jsx)("span",{className:"mt-2 text-xs text-[#8C8C8C]",children:"Size: 16:9 or 1600 by 900px"})]})]}),D===a.A.ADVANCED&&(0,w.jsxs)("div",{className:"px-4 py-6",children:[(0,w.jsxs)("div",{className:"mb-4 mt-2 flex items-center gap-2",children:[(0,w.jsx)("span",{className:"text-xs font-bold uppercase",children:"SEO Settings"}),(0,w.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),F(!z)},children:(0,w.jsx)(k.A,{icon:"".concat(z?"caret-down":"caret-right"),className:"text-sm"})})]}),z&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Slug"})}),(0,w.jsx)(y.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:G,onChange:e=>{H(e)},large:!0}),(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Meta Title"})}),(0,w.jsx)(y.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:W,onChange:e=>{q(e)},large:!0}),(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Description"})}),(0,w.jsx)("div",{className:"flex rounded border border-border",children:(0,w.jsx)("textarea",{className:"block w-full flex-grow rounded bg-card px-2 py-1 focus:outline-none",value:null!==K&&void 0!==K?K:"",onChange:e=>{Y(Be(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)}})})]}),(0,w.jsxs)("div",{className:"mb-4 mt-6 flex items-center gap-2",children:[(0,w.jsx)("span",{className:"text-xs font-bold uppercase",children:"Open Graph Details"}),(0,w.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),V(!U)},children:(0,w.jsx)(k.A,{icon:"".concat(U?"caret-down":"caret-right"),className:"text-sm"})})]}),U&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Open Graph Title"})}),(0,w.jsx)(y.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:$,onChange:e=>{Q(e)},large:!0}),(0,w.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Open Graph Description"})}),(0,w.jsx)("div",{className:"flex rounded border border-border",children:(0,w.jsx)("textarea",{className:"block w-full flex-grow rounded bg-card px-2 py-1 focus:outline-none",value:null!==Z&&void 0!==Z?Z:"",onChange:e=>{J(Be(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)}})}),(0,w.jsxs)("div",{className:"mb-14",children:[(0,w.jsx)("div",{className:"mb-1 mt-2 text-xs font-bold",children:(0,w.jsx)(h.A,{children:"Open Graph Image"})}),(0,w.jsx)(y.k,{placeholder:"Enter Image URL",className:"bg-card",containerClassName:"bg-card",defaultValue:X,onChange:e=>{ee(e)},large:!0}),(0,w.jsx)("p",{className:"px-4 text-xs text-[#8C8C8C]",children:"It will take group thumbnail as image by default. Recommended size - 1200 X 630 px or 1.9:1 aspect ratio"})]})]})]}),(0,w.jsx)("div",{className:"fixed bottom-0 w-full border-t border-border bg-card p-4 md:w-3/5 lg:w-[38%]",children:(0,w.jsxs)("div",{className:"flex justify-between",children:[(0,w.jsx)(m.$,{className:"w-36 px-0 text-sm",isCancelType:!0,label:"Cancel",onClick:()=>Le()}),(0,w.jsx)(m.$,{onClick:()=>{le(!0);const e={slug:(0,f.xx)(null===G?T:G),title:null===W?T:W,description:null===K?O:K,openGraphTitle:null===$?T:$,openGraphDescription:null===Z?O:Z,openGraphImage:X};if(j&&S&&Object.keys(S).length){let t="";S.banner&&"string"===typeof re&&(t=re),Oe(De,{name:T,color:te,description:O,banner:t,groupType:R===l.A.GROUP.PRIVATE?l.A.GROUP.CLOSED:R,isOnlyVisibleToMembers:R===l.A.GROUP.PRIVATE,price:100*ue,currency:he,meta:e,gatedTokenAddress:be})}else Ie(De,{name:T,description:O,color:te,groupType:R===l.A.GROUP.PRIVATE?l.A.GROUP.CLOSED:R,isOnlyVisibleToMembers:R===l.A.GROUP.PRIVATE,price:100*ue,currency:he,postLevel:"admin",defaultTabName:"General",defaultTabEmoji:"#",communityId:Pe?Pe.id:null,meta:e,gatedTokenAddress:be})},className:"text-sm",label:j?"Update Group":"Create Group",isLoading:ae})]})}),we&&ye?(0,w.jsx)(v.A,{src:we,setPicture:oe,activeCrop:ye,setActiveCrop:ke,aspectRatio:16/9,cropRatioMessage:"Banner ratio - 16:9"}):null]})}},41317:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var r=n(20975),o=n(16478),i=n(65186);const s={POST:"generic",GROUP_CHAT:"realtime"},a={LATEST_FIRST:"latest",OLDEST_FIRST:"oldest"},l={LIST:"list",GRID:"grid",COMPACT:"compact"},c={ALL:"all",ANYONE:"anyone",ADMIN_ONLY:"admin",NONE:"none"};var d=n(56072),u=n(68652),p=n(43039),h=n(52041),m=n(63360),f=n(53871),g=n(41146),b=n(62391);const v=e=>{let{checkboxLabel:t,selectedOption:n,setSelectedOption:r}=e;return(0,b.jsx)("button",{className:"h-10 justify-center rounded border border-border px-5 lg:min-w-40",style:{minWidth:"160px"},onClick:()=>{r(!n)},children:(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)(g.S,{className:"-mt-4",selected:n}),(0,b.jsx)(f.A,{children:t})]})})};var y=n(44139),k=n(21788),w=n(76786),x=n(27376),_=n(54617),A=n(22393),C=n(62144);const S=e=>{let{updateActiveGroup:t,selectedTabToEdit:n,isEditingTabActive:g,setIsCreateSectionModalVisible:S}=e;const{analyticsService:j}=(0,i.W)(),E=(0,o.j)(),[N,P]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1),[T,I]=(0,r.useState)(d.A.BASIC),[O,L]=(0,r.useState)({isAppearanceTabExpanded:!0,isNotificationTabExpanded:!0,isSEOSettingsTabExpanded:!0,isOpenGraphDetailsTabExpanded:!0}),R=n&&n.isClosed,B=n&&n.isPrivate,[z,F]=(0,r.useState)(n?n.emoji:null),[U,V]=(0,r.useState)(n?n.name:""),[G,H]=(0,r.useState)(n?n.sectionType:s.POST),[W,q]=(0,r.useState)(B?u.A.CHANNEL.PRIVATE:R?u.A.CHANNEL.CLOSED:u.A.CHANNEL.OPEN),[K,Y]=(0,r.useState)(!!n&&n.postLevel===c.ANYONE),[$,Q]=(0,r.useState)(n?n.sortBy:a.LATEST_FIRST),[Z,J]=(0,r.useState)(n?n.sectionView:l.LIST),[X,ee]=(0,r.useState)(n?n.defaultNotificationLevel:c.ALL),[te,ne]=(0,r.useState)(!n||n.emailNotificationOnNewPost),[re,oe]=(0,r.useState)(!n||n.pushNotificationOnNewPost),[ie,se]=(0,r.useState)(n&&n.meta&&n.meta.slug?n.meta.slug:null),[ae,le]=(0,r.useState)(n&&n.meta&&n.meta.title?n.meta.title:null),[ce,de]=(0,r.useState)(n&&n.meta&&n.meta.description?n.meta.description:null),[ue,pe]=(0,r.useState)(n&&n.meta&&n.meta.openGraphTitle?n.meta.openGraphTitle:null),[he,me]=(0,r.useState)(n&&n.meta&&n.meta.openGraphDescription?n.meta.openGraphDescription:null),[fe,ge]=(0,r.useState)(n&&n.meta&&n.meta.openGraphImage?n.meta.openGraphImage:null),{user:be,community:ve,activeGroup:ye}=(0,o.G)((e=>({user:e.auth,community:e.community,activeGroup:e.activeGroup})));function ke(e){return void 0!==e&&null!==e&&e.length>255?e.substring(0,255):e}const we=()=>{F(""),V(""),H(s.POST),q(u.A.CHANNEL.OPEN),Y(!1),Q(a.LATEST_FIRST),J(l.LIST),ee(c.ALL),ne(!0),oe(!0),se(""),le(""),de(""),pe(""),me(""),ge(""),S(!1)};return(0,b.jsxs)("div",{className:"h-max bg-card text-secondary-foreground",children:[(0,b.jsx)("div",{className:"sticky top-0 flex-col border-b border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex-col items-center",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{className:"text-base font-bold text-secondary-foreground/80",children:n?(0,b.jsx)(f.A,{children:"Edit Channel"}):(0,b.jsx)(f.A,{children:"Create Channel"})}),(0,b.jsx)(m.J,{onClick:()=>{we()}})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"".concat(T===d.A.BASIC?"cursor-pointer rounded bg-accent px-4 py-1 text-primary":"cursor-pointer px-4 py-1 text-secondary-foreground"),onClick:()=>I(d.A.BASIC),children:"Basic Details"}),(0,b.jsx)("span",{className:"".concat(T===d.A.ADVANCED?"cursor-pointer rounded bg-accent px-4 py-1 text-primary":"cursor-pointer px-4 py-1 text-secondary-foreground"),onClick:()=>I(d.A.ADVANCED),children:"Advance Details"})]})]})}),T===d.A.BASIC&&(0,b.jsxs)("div",{className:"h-screen px-4 py-6",children:[(0,b.jsx)("div",{className:"mb-1 text-xs font-bold after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,b.jsx)(f.A,{children:"Channel Name"})}),(0,b.jsx)(_.k,{placeholder:"Enter channel name",className:"bg-card",containerClassName:"bg-card",prefix:(0,b.jsx)("div",{className:"bg-card",children:(0,b.jsx)(x.A,{emoji:z,setEmoji:e=>{F(e),P(!1)},visible:N,setVisible:P})}),defaultValue:U,validator:e=>e&&e.length>2?null:"Valid channel name required!",onChange:e=>{V(e)},large:!0}),!n&&(0,b.jsx)("div",{className:"mt-1 flex gap-4",children:(0,b.jsx)(w.A,{selectorTypeLabel:"Channel Type",selectedOption:G,setSelectedOption:H,options:[{id:s.POST,iconName:"edit",selectorName:"Post"},{id:s.GROUP_CHAT,iconName:"comments",selectorName:"Group Chat"}]})}),(0,b.jsx)("div",{className:"mt-1 flex gap-4",children:(0,b.jsx)(w.A,{selectorTypeLabel:"Channel Access",selectedOption:W,setSelectedOption:q,options:[{id:u.A.CHANNEL.OPEN,iconName:"unlock",selectorName:"Open",origin:"CHANNEL",tooltips:u.A.CHANNEL_TOOLTIPS.OPEN.tooltips},{id:u.A.CHANNEL.CLOSED,iconName:"lock",selectorName:"Closed",origin:"CHANNEL",tooltips:u.A.CHANNEL_TOOLTIPS.CLOSED.tooltips},{id:u.A.CHANNEL.PRIVATE,iconName:"eye-crossed",selectorName:"Private",origin:"CHANNEL",tooltips:u.A.CHANNEL_TOOLTIPS.PRIVATE.tooltips}]})}),(0,b.jsxs)("div",{className:"mt-4 flex cursor-pointer items-center gap-2",onClick:()=>{Y(!K)},children:[(0,b.jsx)(A.A,{selectedOption:K,setSelectedOption:Y}),(0,b.jsx)(f.A,{children:"Allow users to Post in this channel"})]})]}),T===d.A.ADVANCED&&(0,b.jsxs)("div",{className:"px-4 py-6",children:[G===s.POST&&(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase",children:"Appearance"}),(0,b.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),L((e=>({...e,isAppearanceTabExpanded:!e.isAppearanceTabExpanded})))},children:(0,b.jsx)(C.A,{icon:"".concat(O.isAppearanceTabExpanded?"caret-down":"caret-right"),className:"text-sm"})})]}),O.isAppearanceTabExpanded&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.A,{selectorTypeLabel:"Sorting Order of the Posts",selectedOption:$,setSelectedOption:Q,options:[{id:a.LATEST_FIRST,iconName:"arrow-from-bottom",selectorName:"Latest First"},{id:a.OLDEST_FIRST,iconName:"arrow-from-bottom",selectorName:"Oldest First"}]}),(0,b.jsx)(w.A,{selectorTypeLabel:"Sorting Order of the Posts",selectedOption:Z,setSelectedOption:J,options:[{id:l.LIST,iconName:"menu-burger",selectorName:"List View"},{id:l.GRID,iconName:"apps",selectorName:"Grid View"},{id:l.COMPACT,iconName:"list",selectorName:"Compact View"}]})]})]}),G===s.POST&&(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase",children:"Notification"}),(0,b.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),L((e=>({...e,isNotificationTabExpanded:!e.isNotificationTabExpanded})))},children:(0,b.jsx)(C.A,{icon:"".concat(O.isNotificationTabExpanded?"caret-down":"caret-right"),className:"text-sm"})})]}),O.isNotificationTabExpanded&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.A,{selectorTypeLabel:"Default Notification preference for users when they join",selectedOption:X,setSelectedOption:ee,options:[{id:c.ALL,selectorName:"All Posts"},{id:c.ADMIN_ONLY,selectorName:"Admin Posts Only"},{id:c.NONE,selectorName:"None"}]}),(0,b.jsxs)("div",{className:"flex-col",children:[(0,b.jsx)("div",{className:"mt-4 text-xs font-bold",children:"Send Notification on"}),(0,b.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,b.jsx)(v,{checkboxLabel:"Email",selectedOption:te,setSelectedOption:ne}),(0,b.jsx)(v,{checkboxLabel:"Mobile Push",selectedOption:re,setSelectedOption:oe})]})]})]})]}),(0,b.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase",children:"SEO Settings"}),(0,b.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),L((e=>({...e,isSEOSettingsTabExpanded:!e.isSEOSettingsTabExpanded})))},children:(0,b.jsx)(C.A,{icon:"".concat(O.isSEOSettingsTabExpanded?"caret-down":"caret-right"),className:"text-sm"})})]}),O.isSEOSettingsTabExpanded&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Slug"})}),(0,b.jsx)(_.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:ie,onChange:e=>{se(e)},large:!0}),(0,b.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Meta Title"})}),(0,b.jsx)(_.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:ae,onChange:e=>{ae(e)},large:!0}),(0,b.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Description"})}),(0,b.jsx)("div",{className:"flex rounded border border-border",children:(0,b.jsx)("textarea",{className:"block w-full flex-grow rounded bg-card px-2 py-1 focus:outline-none",value:null!==ce&&void 0!==ce?ce:"",onChange:e=>{de(ke(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)}})})]}),(0,b.jsxs)("div",{className:"mb-4 mt-6 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase",children:"Open Graph Details"}),(0,b.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),e.preventDefault(),L((e=>({...e,isOpenGraphDetailsTabExpanded:!e.isOpenGraphDetailsTabExpanded})))},children:(0,b.jsx)(C.A,{icon:"".concat(O.isOpenGraphDetailsTabExpanded?"caret-down":"caret-right"),className:"text-sm"})})]}),O.isOpenGraphDetailsTabExpanded&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Open Graph Title"})}),(0,b.jsx)(_.k,{placeholder:"general-info",className:"bg-card",containerClassName:"bg-card",defaultValue:ue,onChange:e=>{pe(e)},large:!0}),(0,b.jsx)("div",{className:"mb-1 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Open Graph Description"})}),(0,b.jsx)("div",{className:"flex rounded border border-border",children:(0,b.jsx)("textarea",{className:"block w-full flex-grow rounded bg-card px-2 py-1 focus:outline-none",value:null!==he&&void 0!==he?he:"",onChange:e=>{me(ke(e.target.value)),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)}})}),(0,b.jsxs)("div",{className:"mb-14",children:[(0,b.jsx)("div",{className:"mb-1 mt-2 text-xs font-bold",children:(0,b.jsx)(f.A,{children:"Open Graph Image"})}),(0,b.jsx)(_.k,{placeholder:"Enter Image URL",className:"bg-card",containerClassName:"bg-card",defaultValue:fe,onChange:e=>{ge(e)},large:!0}),(0,b.jsx)("p",{className:"px-4 text-xs text-[#8C8C8C]",children:"It will take group thumbnail as image by default. Recommended size - 1200 X 630 px or 1.9:1 aspect ratio"})]})]})]}),(0,b.jsx)("div",{className:"fixed bottom-0 w-full border-t border-border bg-card p-4 md:w-3/5 lg:w-[38%]",children:(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)(y.$,{className:"w-36 px-0 text-sm",isCancelType:!0,label:"Cancel",onClick:()=>we()}),(0,b.jsx)(y.$,{onClick:()=>{const e={name:U,emoji:z,sectionType:G,sectionView:Z,postLevel:K?c.ANYONE:c.ADMIN_ONLY,defaultNotificationLevel:X,pushNotificationOnNewPost:re,emailNotificationOnNewPost:te,isClosed:W===u.A.CHANNEL.CLOSED,isPrivate:W===u.A.CHANNEL.PRIVATE,sortBy:$,meta:{slug:(0,k.xx)(null===ie?U:ie),title:null===ae?U:ae,description:null===ce?U:ce,openGraphTitle:null===ue?U:ue,openGraphDescription:null===he?U:he,openGraphImage:fe}};M(!0),n?p.Bd.editGroupTab(be,ye.id,n.id,e).then((e=>{let{group:r}=e;M(!1),we(),t(r);const o=null===r||void 0===r?void 0:r.tabs.find((e=>e.id===n.id));o&&E((0,h.x)(o))})).catch((e=>{M(!1)})):p.Bd.createGroupTab(be,ye.id,e).then((e=>{let{group:n}=e;M(!1),we(),t(n),j.track("create-section",{userType:ve.myRole,groupName:n.name,sectionName:U,sectionType:G,sectionAuth:c.ANYONE}),G===s.GROUP_CHAT&&window.location.reload()})).catch((e=>{M(!1)}))},className:"text-sm",isLoading:D,label:n?"Save Changes":"Create Channel"})]})})]})}},97844:(e,t,n)=>{"use strict";n.d(t,{A:()=>E});var r=n(5564),o=n.n(r),i=n(20975),s=n(89449),a=n(16478),l=n(65186),c=n(9175),d=n(43039),u=n(60553),p=n(63360),h=n(53871),m=n(44139),f=n(41146),g=n(25715),b=n(19328),v=n(62391);const y=e=>{let{buttonName:t,disabled:n,buttonType:r,onClick:o,isLoading:i}=e;return(0,v.jsx)("button",{className:"flex min-w-[140px] max-w-[140px] cursor-pointer justify-center rounded border border-border px-4 py-2 ".concat("success"===r&&"bg-primary text-[#ffffff]"," ").concat("cancel"===r&&"bg-card"),onClick:o,children:(0,v.jsxs)("span",{className:"flex place-content-center items-center space-x-1 whitespace-normal",children:[(0,v.jsx)("span",{children:i?(0,v.jsx)(b.a,{spinnerColor:"var(--theme-on-primary-color)",size:20}):null}),(0,v.jsx)("span",{children:(0,v.jsx)(h.A,{children:t})})]})})};var k=n(62270),w=n(16118),x=n(90559),_=n(54859),A=n(91900),C=n(54617);function S(e){let{widgetToEdit:t,user:n,community:r,group:o,active:s,forCommunity:a,setActive:c=(e=>{}),onWidgetCreate:u=(e=>{}),onWidgetUpdated:p=(e=>{})}=e;const f=void 0!==t,[g,y]=(0,i.useState)(f?t.details.title:null),[S,j]=(0,i.useState)(f?t.details.buttonURL:null),[E,N]=(0,i.useState)(!1),[P,D]=(0,i.useState)(f?t.details.title:null),[M,T]=(0,i.useState)(f?t.details.description:""),[I,O]=(0,i.useState)(f?t.details.picture:null),[L,R]=(0,i.useState)(!1),{analyticsService:B}=(0,l.W)(),z=(0,k.A)();(0,i.useEffect)((()=>{f&&(y(t.details.buttonLabel),j(t.details.buttonURL),D(t.details.title),T(t.details.description),O(t.details.picture))}),[t]);let F=void 0!==M?M.split("\n").length:1;function U(){if(!P)return void alert(z.trans("Please enter a title"));if(!S)return void alert(z.trans("Please enter a url link"));if(!g)return void alert(z.trans("Please enter button title"));if(g&&g.length>20)alert(z.trans("Button label must be at least 20 characters"));else if(!(0,w.m$)(S))return void alert(z.trans("Please enter valid url"));if(f)return void function(){const e={...t,details:{title:P,description:M,buttonURL:S,buttonLabel:g,communityId:r.id}};N(!0),d.Cq.updateWidget(n,r.id,t.id,e).then((async e=>{await V(e.widget,(t=>{console.log("Picture uploaded successfully"),D(null),T(""),j(null),O(null),p(null!==t&&void 0!==t?t:e.widget)}),(t=>{console.log("Widget upload picture failed: ",t),D(null),T(""),j(null),O(null),p(e.widget)}))})).catch((e=>{console.log("Error",e)})).finally((()=>{N(!1)}))}();const e={groupId:o?o.id:null,details:{title:P,description:M,buttonURL:S,buttonLabel:g,communityId:r.id},isVisible:!0};N(!0),d.Cq.createCustomWidget(n,r.id,e).then((async e=>{await V(e.widget,(t=>{console.log("Picture uploaded successfully"),D(null),T(""),y(null),j(null),O(null);const{title:n,description:r,buttonLabel:o,buttonURL:i,picture:s}=e.widget.details,a={heading:!!n,description:!!r,ctaName:!!o,ctaURL:!!i,picture:!!s};B.track("custom-widget-created",a),u(null!==t&&void 0!==t?t:e.widget)}),(t=>{console.log("Widget upload picture failed: ",t),D(null),T(""),j(null),O(null),u(e.widget)}))})).catch((e=>{console.log("Error",e)})).finally((()=>{N(!1)}))}async function V(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>{};I&&"string"!==typeof I?d.Cq.uploadCustomCustomWidgetPicture(n,r.id,e.id,I).then((e=>{t(e.widget)})).catch((e=>{console.log(e),o(e)})):t()}return F=F>3?F:3,(0,v.jsxs)(A.a,{className:"CreateWidgetModal",active:s,width:"490px",padding:!1,setActive:c,children:[(0,v.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,v.jsxs)("span",{className:"font-bold",children:[(0,v.jsx)(h.A,{children:"Add widget to"})," ",a?(0,v.jsx)(h.A,{children:"home feed"}):o.name," "]}),(0,v.jsx)(x.A,{hoverable:!0,icon:"cross",size:"sm",rotate:45,onClick:()=>{c(!1)}})]}),(0,v.jsxs)("div",{className:"select-none p-5",children:[(0,v.jsx)("div",{className:"group-color-preview-holder w-full rounded border-primary"}),(0,v.jsx)("div",{className:"m-auto w-1/2",children:(0,v.jsx)(_.A,{picture:I,setPicture:O,setPictureSelected:R,aspectRatio:1,recommendedRatio:"1:1",cropRatioMessage:"Picture ratio: 1:1"})}),(0,v.jsxs)("div",{className:"my-2 flex flex-col space-y-2",children:[(0,v.jsx)("h4",{className:"text-sm font-bold",children:(0,v.jsx)(h.A,{children:"Card Title"})}),(0,v.jsx)(C.k,{defaultValue:null!==P&&void 0!==P?P:"",onChange:e=>{D(e)},className:"p-2",placeholder:"Enter widget name"})]}),(0,v.jsxs)("div",{className:"my-2 flex flex-col space-y-2",children:[(0,v.jsx)("h4",{className:"text-sm font-bold",children:(0,v.jsx)(h.A,{children:"Small Description (try to keep it under 50 words)"})}),(0,v.jsx)("div",{className:"flex rounded border border-border",children:(0,v.jsx)("textarea",{placeholder:z.trans("Enter description"),value:M,onChange:e=>{T(e.target.value),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"block w-full flex-grow bg-background px-2 py-1",rows:F})})]}),(0,v.jsxs)("div",{className:"my-2 flex flex-col space-y-2",children:[(0,v.jsx)("h4",{className:"text-sm font-bold",children:(0,v.jsx)(h.A,{children:"Button Title"})}),(0,v.jsx)(C.k,{defaultValue:null!==g&&void 0!==g?g:"",onChange:e=>{y(e)},className:"p-2",placeholder:"Enter widget name"}),(0,v.jsx)("span",{className:"text-xs text-secondary-foreground/70",children:(0,v.jsx)(h.A,{children:"Suggestions: Know more, Join, Apply..."})})]}),(0,v.jsxs)("div",{className:"my-2 flex flex-col space-y-2",children:[(0,v.jsx)("h4",{className:"text-sm font-bold",children:(0,v.jsx)(h.A,{children:"URL"})}),(0,v.jsx)(C.k,{defaultValue:null!==S&&void 0!==S?S:"",onChange:e=>{j(e)},className:"p-2",placeholder:"https://"})]}),(0,v.jsxs)("div",{className:"mt-14 flex justify-between",children:[(0,v.jsx)("button",{className:"text-secondary-foreground",onClick:()=>{c(!1)},children:(0,v.jsx)(h.A,{children:"Cancel"})}),(0,v.jsx)("div",{className:"justify-between",children:E?(0,v.jsx)("div",{className:"flex justify-center",children:(0,v.jsx)(b.a,{})}):(0,v.jsx)(m.$,{onClick:e=>{U()},className:"w-full",label:f?"Update Widget":"Create Custom Widget",large:!0})})]})]})]})}function j(e){let{widget:t,forCommunity:n=!0,setWidgetToEdit:r=(e=>{}),onUpdateWidget:l=(e=>{}),onDeleteWidget:p=(e=>{}),onDragStart:m=(e=>{}),onDrop:b=(e=>{})}=e;const{addToast:y}=(0,c.d)(),{user:k,community:w}=(0,a.G)((e=>({user:e.auth,community:e.community}))),x="custom"===t.type,[_,A]=(0,i.useState)(!1),[C,S]=(0,i.useState)(!1);function j(){var e;switch(t.type){case"custom":return null===(e=t.details)||void 0===e?void 0:e.title;case"upcoming-events":return n?"Community Events":"Group Events";case"community-upcoming-event":return"Community Event";case"top-posts":return"Trending Posts";case"members":return n?"Community Members":"Group Members";case"community-leaderboard":return"Community Leaderboard";case"community-members":return"Community Members";default:return t.type}}return(0,v.jsxs)("div",{draggable:!0,onDragStart:m,onDragOver:e=>{e.preventDefault()},onDrop:b,children:[(0,v.jsxs)("div",{className:o()("mt-4 border border-border bg-card",{"pl-3":x,"p-3":!x}),children:[(0,v.jsxs)("div",{className:"flex items-center justify-between",children:[(0,v.jsx)("span",{className:"text-md font-semibold text-secondary-foreground",children:"custom"===t.type?(0,v.jsx)("div",{children:(0,v.jsxs)("span",{children:[(0,v.jsx)(h.A,{children:j()}),(0,v.jsx)("span",{className:"theme-bg-disable mx-2 rounded px-2 py-1 text-xs text-primary",children:(0,v.jsx)(h.A,{children:"custom"})})]})}):(0,v.jsx)("span",{children:(0,v.jsx)(h.A,{children:j()})})}),(0,v.jsx)("div",{className:"flex items-center",children:"custom"===t.type?(0,v.jsx)(g.A,{className:"",hoverable:!1,actions:[{icon:"edit",label:"Edit",onClick:e=>{r(t)}},{icon:"trash",label:"Delete",actionType:g.X.alert,onClick:e=>{A(!0)}}]}):null})]}),(0,v.jsxs)("div",{className:"mb-4 mr-3 mt-2 flex justify-evenly border border-border bg-accent p-2",children:[(0,v.jsxs)("div",{className:"flex space-x-2 text-xs text-secondary-foreground/70",children:[(0,v.jsx)("div",{children:(0,v.jsx)(h.A,{children:"Visible to user"})}),(0,v.jsx)(f.S,{className:"ml-2",onClick:()=>{const e={...t,isVisible:!t.isVisible};l(e)},selected:t.isVisible})]}),(0,v.jsxs)("div",{className:"flex space-x-2 text-xs text-secondary-foreground/70",children:[(0,v.jsx)("div",{children:(0,v.jsx)(h.A,{children:"Visible to admin"})}),(0,v.jsx)(f.S,{className:"ml-2",onClick:()=>{const e={...t,isVisibleToAdmin:!t.isVisibleToAdmin};l(e)},selected:t.isVisibleToAdmin})]})]})]}),(0,v.jsx)(u.c,{active:_,setActive:A,onSubmit:function(){S(!0),d.Cq.deleteWidget(k,w.id,t.id).then((()=>{y("Widget deleted successfully"),p(t)})).catch((e=>{console.error(e),y("Error in deleting widget","",s.lm.danger)})).finally((()=>{A(!1),S(!1)}))},header:"Delete Widget",btnColor:"red",children:null,title:"Are you sure you want to delete this widget?",isLoading:C})]})}const E=e=>{let{widgets:t,setActive:n,onWidgetListUpdate:r}=e;const[o,u]=(0,i.useState)(null!==t&&void 0!==t?t:[]),[f,g]=(0,i.useState)(),[b,k]=(0,i.useState)(),[w,x]=(0,i.useState)(!1),[_,A]=(0,i.useState)(!1),{analyticsService:C}=(0,l.W)(),{addToast:E}=(0,c.d)();(0,i.useEffect)((()=>{x(!!b)}),[b]);const{user:N,community:P,group:D}=(0,a.G)((e=>({user:e.auth,community:e.community,group:e.activeGroup})));return(0,v.jsxs)("div",{className:"bg-card",children:[(0,v.jsx)("div",{className:"sticky top-0 flex-col border-b border-border bg-card px-4 pb-2 pt-4",children:(0,v.jsx)("div",{className:"flex-col items-center",children:(0,v.jsxs)("div",{className:"flex items-center justify-between",children:[(0,v.jsx)("span",{className:"text-base font-bold text-secondary-foreground/80",children:(0,v.jsx)(h.A,{children:"Customize Widgets"})}),(0,v.jsx)(p.J,{onClick:()=>{n(!1)}})]})})}),(0,v.jsxs)("div",{className:"h-fit px-4 py-6 text-secondary-foreground",children:[(0,v.jsx)(h.A,{children:"Note: Widget will not be visible if there is no data available"}),o&&o.map(((e,t)=>(0,v.jsx)("div",{className:"mb-2",onDrop:e=>{try{const e=o.map(((e,t)=>({...e,sortOrder:t+1}))),n=e[t].sortOrder;e[t].sortOrder=e[f].sortOrder,e[f].sortOrder=n,e.sort(((e,t)=>e.sortOrder-t.sortOrder)),u(e)}catch(e){console.error(e)}},children:(0,v.jsx)(j,{widget:e,forCommunity:!D,setWidgetToEdit:k,onDeleteWidget:e=>{const t=o.filter((t=>t.id!==e.id));u(t)},onUpdateWidget:e=>{const t=o.findIndex((t=>t.id===e.id)),n=[...o];n.splice(t,1,e),u(n)},onDragStart:e=>{g(t)}})},t))),(0,v.jsx)("div",{className:"mb-32 mt-8",children:(0,v.jsx)(m.$,{onClick:e=>{C.track("add-custom-widget-clicked"),x(!0)},outlined:!0,label:"Add Custom"})}),(0,v.jsx)("div",{className:"fixed bottom-0 right-0 w-full border-t border-border bg-card p-4 md:w-3/5 lg:w-[38%]",children:(0,v.jsxs)("div",{className:"flex justify-between",children:[(0,v.jsx)(y,{buttonName:"Cancel",onClick:()=>{n(!1)}}),(0,v.jsx)(y,{buttonName:"Save Widgets",buttonType:"success",onClick:function(){const e=o.map(((e,t)=>({widgetId:e.id,sortOrder:t,isVisible:e.isVisible,isVisibleToAdmin:e.isVisibleToAdmin}))),t=o.filter((e=>"custom"===e.type)).length,i=o.filter((e=>"custom"!==e.type)).reduce(((e,t)=>(e[t.type]=t.isVisible,e)),{});C.track("save-widget-clicked",{noOfCustomWidgets:t,...i}),A(!0),d.Cq.updateSortOrder(N,P.id,{sortOrder:e,groupId:D?D.id:""}).then((e=>{n(!1),E("Widgets saved successfully"),r(o)})).catch((e=>{console.log(e),E("Error in saving widgets","",s.lm.danger)})).finally((()=>{A(!1)}))}})]})})]}),(0,v.jsx)(S,{widgetToEdit:b,community:P,user:N,group:D,active:w,setActive:e=>{x(e),k(void 0)},forCommunity:!D,onWidgetCreate:e=>{E("Custom widget created successfully");const t=[...o,e];u(t),x(!1),console.log("Widgets added to list successfully",o)},onWidgetUpdated:e=>{E("Custom widget updated successfully");const t=[...o],n=t.findIndex((t=>t.id===e.id));t[n]=e,u(t),x(!1)}})]})}},90559:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=n(62144),s=n(62391);const a=function(e){let{icon:t,onClick:n,className:r,iconClass:a="",label:l,solid:c=!1,hoverable:d,size:u="xl",unreadCount:p=0}=e;return(0,s.jsxs)("div",{onClick:e=>{null!=n&&n(e)},className:o()("relative flex h-4 cursor-pointer place-content-center items-center rounded-full ".concat(r),{"hover:shadow":d}),children:[(0,s.jsx)(i.A,{icon:t,className:" ".concat(a," "),solid:c,size:u}),l&&(0,s.jsx)("span",{className:"ml-1 text-xs",children:l}),p>0&&(0,s.jsx)("span",{className:"absolute -top-[10px] left-[9px] flex h-[15px] w-[15px] place-content-center items-center rounded-full bg-primary p-[3px] text-[10px] text-primary-foreground",children:p})]})}},25715:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,X:()=>c});var r=n(5564),o=n.n(r),i=n(20975),s=n(53871),a=n(62144),l=n(62391);const c=Object.freeze({default:"default",primary:"primary",alert:"alert"});function d(e){let{action:t,setActive:n}=e;return null==t||void 0===t||void 0===t.label||null===t.label||""===t.label?null:(0,l.jsxs)("button",{onClick:e=>{t.onClick&&t.onClick(e),n(!1)},className:o()("ActionButton mx-2 flex items-center space-x-2 rounded p-2 px-4 transition-all duration-200 ease-linear hover:bg-accent",{"text-secondary-foreground":t.actionType===c.default,"text-primary":t.actionType===c.primary,"text-alert":t.actionType===c.alert}),children:[(0,l.jsx)(a.A,{icon:t.icon,solid:t.solidIcon}),(0,l.jsx)("div",{className:"items-start",children:(0,l.jsx)("span",{className:"word-breaker font-medium",children:(0,l.jsx)(s.A,{children:t.label})})})]})}const u=function(e){let{icon:t,onClick:n,solid:r=!1,className:s,hideOnEmpty:c,actions:u,dropdownClassName:p}=e;const[h,m]=(0,i.useState)(!1),f=(0,i.useRef)(null),g=e=>{f.current&&!f.current.contains(e.target)&&m(!1)};(0,i.useEffect)((()=>(document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)})),[]);const b=u.filter((e=>null===e||void 0===e?void 0:e.label));return(0,i.useEffect)((()=>{if(0===b.length&&c||!h)return;const e=async e=>{m(!1)};return window.document.body.addEventListener("click",e),()=>{window.document.body.removeEventListener("click",e)}}),[b.length,c,h]),0===b.length&&c?(0,l.jsx)(l.Fragment,{}):(0,l.jsx)("div",{ref:f,className:o()("IconMenu",{active:h}),onClick:e=>{e.stopPropagation(),null!=n&&n(e)},children:(0,l.jsx)("div",{className:"flex place-content-center items-center",children:(0,l.jsxs)("span",{className:o()({"cursor-not-allowed":0===b.length}),onClick:e=>{e.preventDefault(),0!==b.length&&m(!h)},children:[(0,l.jsx)(a.A,{icon:null!==t&&void 0!==t?t:"menu-dots-vertical",solid:r,className:o()("flex h-10 w-10 cursor-pointer place-content-center items-center rounded-full hover:bg-accent",s,{"cursor-not-allowed":0===b.length})}),0===b.length?(0,l.jsx)("div",{className:"dropdown rounded border border-border bg-card py-2 shadow",children:(0,l.jsx)("div",{className:"cursor-not-allowed text-secondary-foreground/70",children:"No actions available"})}):(0,l.jsx)("div",{className:o()("dropdown rounded border border-border bg-popover py-2 shadow",p),children:(0,l.jsx)("div",{className:"flex flex-col",children:u.map(((e,t)=>(0,l.jsx)(d,{action:e,setActive:m},t)))})})]})})})}},54859:(e,t,n)=>{"use strict";n.d(t,{A:()=>ye});var r=n(20975),o=n(53871),i=n(58157),s=n(44139),a=n(69302),l=n(62144),c=n(90559),d=n(19328),u=n(57731),p=n(8180);function h(){return h=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var f=b((function(e){return"string"===typeof e?e:null})),g=function(e){return null!==e&&void 0!==e};function b(e){return function(t){return g(e(t))}}var v=function(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return h({},t,g(o)?((r={})[n]=o,r):{})}),{})};function y(){for(var e=arguments.length,t=new Array(e),n=0;n0?e:null})),A=b((function(e){return x(e)&&"errors"in e&&_(e.errors)?{errors:e.errors}:null})),C=function(e){this.message=e},S=function(e){if(function(e){var t=e.headers.get("content-type");return g(t)&&"application/json"===(0,p.q)(t).type}(e))return e.json().catch((function(e){throw new C("unable to parse JSON response.")}));throw new C("expected JSON response from server.")},j=function(e){return function(t){return(t.ok?e({response:t}).then((function(e){return{type:"success",status:t.status,response:e,originalResponse:t}})):S(t).then((function(e){return h({type:"error",status:t.status},function(e){return A(e)?{errors:e.errors,source:"api"}:{errors:["Responded with a status code outside the 2xx range, and the response body is not recognisable."],source:"decoding"}}(e),{originalResponse:t})}))).catch((function(e){if(e instanceof C)return{type:"error",source:"decoding",status:t.status,originalResponse:t,errors:[e.message]};throw e}))}},E=function(){return function(e){var t=e.response;return S(t)}},N=function(e){var t=e.pathname,n=e.query;return function(e){var r=new URL(e);return function(e){return function(t){"/"===t.pathname?t.pathname=e:t.pathname+=e}}(t)(r),function(e){return function(t){Object.keys(e).forEach((function(n){return t.searchParams.set(n,e[n].toString())}))}}(n)(r),r.toString()}},P=function(e){return function(t,n){void 0===n&&(n={});var r=e(t),o=r.headers,i=r.query;return h({},m(r,["headers","query"]),n,{query:i,headers:h({},o,n.headers)})}},D=function(e){return e},M=function(e){var t=e.accessKey,n=e.apiVersion,r=void 0===n?"v1":n,o=e.apiUrl,i=void 0===o?"https://api.unsplash.com":o,s=e.headers,a=e.fetch,l=m(e,["accessKey","apiVersion","apiUrl","headers","fetch"]);return function(e){var n=e.handleResponse;return y(e.handleRequest,(function(e){var o=e.pathname,c=e.query,d=e.method,u=void 0===d?"GET":d,p=e.headers,m=e.body,f=e.signal,b=N({pathname:o,query:c})(i),v=h({method:u,headers:h({},s,p,{"Accept-Version":r},g(t)?{Authorization:"Client-ID "+t}:{}),body:m,signal:f},l);return(null!=a?a:fetch)(b,v).then(j(n))}))}},T="x-total",I=function(e){var t=e.headers.get(T);if(g(t)){var n=parseInt(t);if(Number.isInteger(n))return n;throw new C("expected "+T+" header to be valid integer.")}throw new C("expected "+T+" header to exist.")},O=function(){return function(e){var t=e.response;return E()({response:t}).then((function(e){return{results:e,total:I(t)}}))}},L=function(e){return g(e)?{collections:e.join()}:{}},R=function(e){return g(e)?{topics:e.join()}:{}},B=function(e){var t=e.page,n=e.perPage,r=e.orderBy;return v({per_page:n,order_by:r,page:t})},z="/collections",F=function(){var e=function(e){var t=e.collectionId;return z+"/"+t+"/photos"};return{getPathname:e,handleRequest:P((function(t){var n=t.collectionId,r=t.orientation,o=m(t,["collectionId","orientation"]);return{pathname:e({collectionId:n}),query:v(h({},B(o),{orientation:r}))}})),handleResponse:O()}}(),U=function(){var e=function(e){var t=e.collectionId;return z+"/"+t};return{getPathname:e,handleRequest:P((function(t){var n=t.collectionId;return{pathname:e({collectionId:n}),query:{}}})),handleResponse:E()}}(),V=function(){var e=function(){return z};return{getPathname:e,handleRequest:P((function(t){return void 0===t&&(t={}),{pathname:e(),query:B(t)}})),handleResponse:O()}}(),G=function(){var e=function(e){var t=e.collectionId;return z+"/"+t+"/related"};return{getPathname:e,handleRequest:P((function(t){var n=t.collectionId;return{pathname:e({collectionId:n}),query:{}}})),handleResponse:E()}}(),H="/photos",W=function(){return{getPathname:function(e){return H},handleRequest:P((function(e){return void 0===e&&(e={}),{pathname:H,query:v(B(e))}})),handleResponse:O()}}(),q=function(){var e=function(e){var t=e.photoId;return H+"/"+t};return{getPathname:e,handleRequest:P((function(t){var n=t.photoId;return{pathname:e({photoId:n}),query:{}}})),handleResponse:E()}}(),K=function(){var e=function(e){var t=e.photoId;return H+"/"+t+"/statistics"};return{getPathname:e,handleRequest:P((function(t){var n=t.photoId;return{pathname:e({photoId:n}),query:{}}})),handleResponse:E()}}(),Y=function(){var e=function(){return H+"/random"};return{getPathname:e,handleRequest:P((function(t){var n=void 0===t?{}:t,r=n.collectionIds,o=n.contentFilter,i=n.topicIds,s=m(n,["collectionIds","contentFilter","topicIds"]);return{pathname:e(),query:v(h({},s,{content_filter:o},L(r),R(i))),headers:{"cache-control":"no-cache"}}})),handleResponse:E()}}(),$={handleRequest:P((function(e){var t=function(e){var t=new URL(e),n=t.pathname,r=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(t.searchParams);return{query:r,pathname:"/"===n?void 0:n}}(e.downloadLocation),n=t.pathname,r=t.query;if(!g(n))throw new Error("Could not parse pathname from url.");return{pathname:n,query:v(r)}})),handleResponse:E()},Q="/search",Z=function(){var e=function(){return Q+"/photos"};return{getPathname:function(t){return e()},handleRequest:P((function(t){var n=t.query,r=t.page,o=t.perPage,i=t.orderBy,s=t.collectionIds,a=t.lang,l=t.contentFilter,c=m(t,["query","page","perPage","orderBy","collectionIds","lang","contentFilter"]);return{pathname:e(),query:v(h({query:n,content_filter:l,lang:a,order_by:i},B({page:r,perPage:o}),L(s),c))}})),handleResponse:E()}}(),J=function(){var e=function(){return Q+"/collections"};return{getPathname:function(t){return e()},handleRequest:P((function(t){var n=t.query,r=m(t,["query"]);return{pathname:e(),query:h({query:n},B(r))}})),handleResponse:E()}}(),X=function(){var e=function(){return Q+"/users"};return{getPathname:function(t){return e()},handleRequest:P((function(t){var n=t.query,r=m(t,["query"]);return{pathname:e(),query:h({query:n},B(r))}})),handleResponse:E()}}(),ee="/users",te=function(){var e=function(e){var t=e.username;return ee+"/"+t};return{getPathname:e,handleRequest:P((function(t){var n=t.username;return{pathname:e({username:n}),query:{}}})),handleResponse:E()}}(),ne=function(){var e=function(e){var t=e.username;return ee+"/"+t+"/photos"};return{getPathname:e,handleRequest:P((function(t){var n=t.username,r=t.stats,o=t.orientation,i=m(t,["username","stats","orientation"]);return{pathname:e({username:n}),query:v(h({},B(i),{orientation:o,stats:r}))}})),handleResponse:O()}}(),re=function(){var e=function(e){var t=e.username;return ee+"/"+t+"/likes"};return{getPathname:e,handleRequest:P((function(t){var n=t.username,r=t.orientation,o=m(t,["username","orientation"]);return{pathname:e({username:n}),query:v(h({},B(o),{orientation:r}))}})),handleResponse:O()}}(),oe=function(){var e=function(e){var t=e.username;return ee+"/"+t+"/collections"};return{getPathname:e,handleRequest:P((function(t){var n=t.username,r=m(t,["username"]);return{pathname:e({username:n}),query:B(r)}})),handleResponse:O()}}(),ie="/topics",se=function(e){var t=e.topicIdOrSlug;return ie+"/"+t},ae=D({getPathname:se,handleRequest:function(e){var t=e.page,n=e.perPage,r=e.orderBy,o=e.topicIdsOrSlugs;return{pathname:ie,query:v(h({},B({page:t,perPage:n}),{ids:null==o?void 0:o.join(","),order_by:r}))}},handleResponse:O()}),le=D({getPathname:se,handleRequest:function(e){var t=e.topicIdOrSlug;return{pathname:se({topicIdOrSlug:t}),query:{}}},handleResponse:E()}),ce=function(){var e=y(se,(function(e){return e+"/photos"}));return{getPathname:e,handleRequest:function(t){var n=t.topicIdOrSlug,r=t.orientation,o=m(t,["topicIdOrSlug","orientation"]);return{pathname:e({topicIdOrSlug:n}),query:v(h({},B(o),{orientation:r}))}},handleResponse:O()}}();!function(e){e.Afrikaans="af",e.Amharic="am",e.Arabic="ar",e.Azerbaijani="az",e.Belarusian="be",e.Bulgarian="bg",e.Bengali="bn",e.Bosnian="bs",e.Catalan="ca",e.Cebuano="ceb",e.Corsican="co",e.Czech="cs",e.Welsh="cy",e.Danish="da",e.German="de",e.Greek="el",e.English="en",e.Esperanto="eo",e.Spanish="es",e.Estonian="et",e.Basque="eu",e.Persian="fa",e.Finnish="fi",e.French="fr",e.Frisian="fy",e.Irish="ga",e.ScotsGaelic="gd",e.Galician="gl",e.Gujarati="gu",e.Hausa="ha",e.Hawaiian="haw",e.Hindi="hi",e.Hmong="hmn",e.Croatian="hr",e.HaitianCreole="ht",e.Hungarian="hu",e.Armenian="hy",e.Indonesian="id",e.Igbo="ig",e.Icelandic="is",e.Italian="it",e.Hebrew="iw",e.Japanese="ja",e.Javanese="jw",e.Georgian="ka",e.Kazakh="kk",e.Khmer="km",e.Kannada="kn",e.Korean="ko",e.Kurdish="ku",e.Kyrgyz="ky",e.Latin="la",e.Luxembourgish="lb",e.Lao="lo",e.Lithuanian="lt",e.Latvian="lv",e.Malagasy="mg",e.Maori="mi",e.Macedonian="mk",e.Malayalam="ml",e.Mongolian="mn",e.Marathi="mr",e.Malay="ms",e.Maltese="mt",e.Myanmar="my",e.Nepali="ne",e.Dutch="nl",e.Norwegian="no",e.Nyanja="ny",e.Oriya="or",e.Punjabi="pa",e.Polish="pl",e.Pashto="ps",e.Portuguese="pt",e.Romanian="ro",e.Russian="ru",e.Kinyarwanda="rw",e.Sindhi="sd",e.Sinhala="si",e.Slovak="sk",e.Slovenian="sl",e.Samoan="sm",e.Shona="sn",e.Somali="so",e.Albanian="sq",e.Serbian="sr",e.Sesotho="st",e.Sundanese="su",e.Swedish="sv",e.Swahili="sw",e.Tamil="ta",e.Telugu="te",e.Tajik="tg",e.Thai="th",e.Turkmen="tk",e.Filipino="tl",e.Turkish="tr",e.Tatar="tt",e.Uighur="ug",e.Ukrainian="uk",e.Urdu="ur",e.Uzbek="uz",e.Vietnamese="vi",e.Xhosa="xh",e.Yiddish="yi",e.Yoruba="yo",e.ChineseSimplified="zh",e.ChineseTraditional="zh-TW",e.Zulu="zu"}(k||(k={})),function(e){e.LATEST="latest",e.POPULAR="popular",e.VIEWS="views",e.DOWNLOADS="downloads",e.OLDEST="oldest"}(w||(w={}));const de=y(M,(function(e){return{photos:{get:e(q),list:e(W),getStats:e(K),getRandom:e(Y),trackDownload:e($)},users:{getPhotos:e(ne),getCollections:e(oe),getLikes:e(re),get:e(te)},search:{getCollections:e(J),getPhotos:e(Z),getUsers:e(X)},collections:{getPhotos:e(F),get:e(U),list:e(V),getRelated:e(G)},topics:{list:e(ae),get:e(le),getPhotos:e(ce)}}}))({accessKey:"dTUBUnPASfrsKOWYzVpAwvkr9Ks2MuY3i5YCvSqAxWQ"});var ue=n(1689),pe=n(62391);function he(e){let{photo:t,onPhotoSelect:n=(e=>{})}=e;const[o,i]=r.useState(!1);return(0,pe.jsxs)("div",{className:"group relative h-60 w-full cursor-pointer place-items-center border border-border object-cover sm:h-44 md:h-32",onClick:()=>n(t),children:[(0,pe.jsx)(ue.A,{className:"card-img h-full w-full place-items-center rounded object-cover",src:t.urls.thumb,alt:t.alt_description}),(0,pe.jsx)("div",{className:"invisible absolute bottom-0 left-0 right-0 top-0 group-hover:visible group-hover:bg-black/20",style:{color:"white"},children:(0,pe.jsx)("div",{className:"m-2 flex place-content-center items-center justify-between space-x-1",children:(0,pe.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,pe.jsx)(ue.A,{className:"h-6 w-6 rounded-full",src:t.user.profile_image.small,alt:t.user.username}),(0,pe.jsx)("h6",{className:"word-breaker text-xs",children:t.user.name})]})})})]},t.id)}function me(){return(0,pe.jsxs)("svg",{className:"text-blue -ml-1 mr-3 h-5 w-5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,pe.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,pe.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}const fe=function(e){let{isLoading:t=!1,isLoadingMore:n=!1,photoList:i,total:s,onPhotoSelect:a,loadMore:l}=e;const c=r.useMemo((()=>r.createRef()),[]);return(0,pe.jsxs)("div",{className:"Body",children:[t?(0,pe.jsx)("div",{className:"flex h-96 items-center justify-center",children:(0,pe.jsx)(me,{})}):(0,pe.jsxs)(pe.Fragment,{children:[Array.isArray(i)&&i.length>0&&(0,pe.jsx)("div",{className:"PhotoList grid grid-cols-1 gap-2 overflow-y-auto p-4 sm:grid-cols-2 md:grid-cols-3",style:{maxHeight:"calc(100vh - 125px)"},ref:c,onScroll:()=>{if(c.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=c.current;t-(e+n)<20&&l()}},children:i.map((e=>(0,pe.jsx)(he,{photo:e,onPhotoSelect:a},e.id)))}),Array.isArray(i)&&0===i.length&&0===s&&(0,pe.jsx)("div",{className:"flex h-96 items-center justify-center",children:(0,pe.jsx)(o.A,{children:"No photos found"})})]}),n&&(0,pe.jsx)("div",{className:"my-4 flex justify-center",children:(0,pe.jsx)(me,{})})]})};var ge=n(78450);function be(e){let{active:t=!1,initialPhotoSearchQuery:n="",setActive:i=(e=>{}),onPhotoSelect:s=(e=>{})}=e;const[a,l]=r.useState([]),[p,h]=r.useState(),[m,f]=r.useState(""),[g,b]=r.useState(!1),[v,y]=r.useState(!1),[k,w]=r.useState(1),[x,_]=r.useState(!1);r.useEffect((()=>{""!==n&&t&&(f(n),A(1,n))}),[n,t]);const A=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];g||v||(1===e?b(!0):y(!0),w(e),de.search.getPhotos({page:e,perPage:30,query:t,orientation:"landscape"}).then((e=>{var t;const r=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.results;if(r){let t=r;n||(t=[...a,...r]),l(t),h(e.response.total)}b(!1),y(!1)})))};return t?(0,pe.jsx)("div",{className:"UnsplashImagePicker rounded bg-card",children:(0,pe.jsxs)(u.A,{active:t,setActive:i,width:"540px",children:[(0,pe.jsxs)("div",{className:"relative h-full",children:[(0,pe.jsxs)("div",{className:"flex items-center justify-between bg-card px-4 pt-4",children:[(0,pe.jsx)("span",{className:"text-lg font-bold",children:(0,pe.jsx)(o.A,{children:"Search image"})}),(0,pe.jsx)(c.A,{hoverable:!0,icon:"cross",size:"md",iconClass:"text-secondary-foreground/70",onClick:()=>i(!1)})]}),(0,pe.jsx)("div",{className:"bg-card p-4 shadow",children:(0,pe.jsx)("div",{className:"",children:(0,pe.jsx)(ge.A,{onSearch:e=>{l([]),A(1,e,!0)},placeholder:"Search for an image",query:m,setQuery:f})})}),(0,pe.jsx)(fe,{total:p,photoList:a,isLoading:g,isLoadingMore:v,loadMore:()=>{A(k+1,m)},onPhotoSelect:async e=>{try{_(!0);let t=await fetch(e.urls.full).then((e=>e.blob())),n=await URL.createObjectURL(t);_(!1),s({...e,blobData:n})}catch(t){console.log(t),_(!1)}}})]}),g||x&&(0,pe.jsx)("div",{className:"absolute bottom-0 left-0 right-0 top-0",children:(0,pe.jsx)("div",{className:"flex h-full place-content-center items-center bg-slate-600/70",children:(0,pe.jsx)("div",{className:"opacity-100",children:(0,pe.jsx)(d.a,{})})})})]})}):null}var ve=n(81107);const ye=function(e){let{picture:t,setPicture:n=(()=>{}),setPictureSelected:c=(()=>{}),setIsPictureRemoved:d=(e=>{}),setIsPictureChanged:u=(e=>{}),aspectRatio:p=16/9,recommendedRatio:h="16:9",cropRatioMessage:m,selectPictureComponent:f,displayUnsplashSearch:g=!1,initialPhotoSearchQuery:b="Community"}=e;const[v,y]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[x,_]=(0,r.useState)(null);let A="";if(!v)try{A=t&&"string"===typeof t&&t.startsWith("http")?t:URL.createObjectURL(t)}catch(S){A=t}const C=async e=>{if(e){let t=URL.createObjectURL(e);_(t)}else _(null);y(!0)};return(0,pe.jsxs)(pe.Fragment,{children:[x&&v?(0,pe.jsx)(ve.A,{src:x,setPicture:e=>{n(e),d(!1)},cropRatioMessage:m,setPictureSelected:c,activeCrop:v,setActiveCrop:y,aspectRatio:p}):null,(0,pe.jsx)("div",{className:"relative cursor-pointer overflow-hidden rounded bg-card",onClick:e=>{e.stopPropagation()},children:t&&!v?(0,pe.jsxs)("div",{className:"theme-bg-disable relative m-auto flex flex-col place-content-center",children:[(0,pe.jsx)("div",{className:"",style:{aspectRatio:"".concat(p)},children:(0,pe.jsx)("img",{src:A,alt:""})}),(0,pe.jsx)("div",{className:"absolute bottom-0 right-0 mx-2 my-2",children:(0,pe.jsxs)("div",{className:"mx-auto flex items-center justify-between",children:[g&&(0,pe.jsx)(s.$,{onClick:e=>{w(!0),e.stopPropagation()},className:"mr-2",label:"Search"}),(0,pe.jsx)(a.z,{accept:"image/*",maxFileSize:10,onChange:e=>{C(e)},children:(0,pe.jsx)(s.$,{onClick:e=>{e.preventDefault(),u(!0)},className:"mr-2",label:"Change Cover"})}),(0,pe.jsx)(s.$,{onClick:e=>{e.stopPropagation(),A="",n(null),d(!0)},className:"",label:"Remove"})]})})]}):f?(0,pe.jsx)(a.z,{accept:"image/*",onChange:e=>{C(e)},maxFileSize:10,children:f}):(0,pe.jsxs)("div",{style:{aspectRatio:"".concat(p)},className:"relative flex place-content-center items-center rounded border border-dashed border-border",children:[(0,pe.jsx)(a.z,{className:"mx-auto",accept:"image/*",onChange:e=>{C(e)},maxFileSize:10,children:(0,pe.jsxs)("div",{className:"m-auto",children:[(0,pe.jsx)("div",{className:"set-logo flex justify-center text-sm font-semibold text-secondary-foreground opacity-100",children:(0,pe.jsx)(o.A,{children:"Upload cover picture"})}),(0,pe.jsxs)("p",{className:"mt-4 text-center text-xs text-secondary-foreground/70",children:[h," ",(0,pe.jsx)(o.A,{children:"Aspect ratio (recommended)"})]})]})}),(0,pe.jsx)("div",{className:"absolute bottom-1 right-0",children:g&&(0,pe.jsx)(i.A,{onClick:e=>{e.stopPropagation(),e.preventDefault(),w(!0)},className:"mr-2 flex items-center space-x-4 p-2",prefix:(0,pe.jsx)(l.A,{icon:"search",size:"xs",className:"mr-1"}),label:"Search image"})})]})}),g&&(0,pe.jsx)(be,{active:k,setActive:w,initialPhotoSearchQuery:b,onPhotoSelect:async e=>{w(!1),_(e.blobData),y(!0)}})]})}},81107:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(20975),o=n(53871),i=n(44139),s=n(90559),a=n(91900),l=n(81430),c=n.n(l);const d=Math.PI/180;var u=n(62391);function p(e){let{imgSrc:t,previewCanvasRef:n,aspectRatio:o=16/9}=e;const i=(0,r.useRef)(null),[s,a]=(0,r.useState)(),[p,h]=(0,r.useState)();var m,f,g;return m=async()=>{null!==p&&void 0!==p&&p.width&&null!==p&&void 0!==p&&p.height&&i.current&&n.current&&async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const i=t.getContext("2d");if(!i)throw new Error("No 2d context");const s=e.naturalWidth/e.width,a=e.naturalHeight/e.height,l=window.devicePixelRatio;t.width=Math.floor(n.width*s*l),t.height=Math.floor(n.height*a*l),i.scale(l,l),i.imageSmoothingQuality="high";const c=n.x*s,u=n.y*a,p=o*d,h=e.naturalWidth/2,m=e.naturalHeight/2;i.save(),i.translate(-c,-u),i.translate(h,m),i.rotate(p),i.scale(r,r),i.translate(-h,-m),i.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),i.restore()}(i.current,n.current,p,1,0)},f=100,g=[p,1,0],(0,r.useEffect)((()=>{const e=setTimeout((()=>{m.apply(void 0,g)}),f);return()=>{clearTimeout(e)}}),g),(0,u.jsxs)("div",{children:[!!t&&(0,u.jsx)(c(),{crop:s,onChange:(e,t)=>a(t),onComplete:e=>h(e),aspect:o,children:(0,u.jsx)("img",{ref:i,alt:"Crop me",src:t,style:{transform:"scale(".concat(1,") rotate(").concat(0,"deg)")},onLoad:function(e){if(o){const{width:i,height:s}=e.currentTarget;a((t=i,n=s,r=o,(0,l.centerCrop)((0,l.makeAspectCrop)({unit:"%",width:90},r,t,n),t,n)))}var t,n,r}})}),!!p&&(0,u.jsx)("div",{className:"hidden",children:(0,u.jsx)("canvas",{ref:n,style:{objectFit:"contain",width:p.width,height:p.height}})})]})}const h=function(e){let{src:t,setPicture:n=(()=>{}),aspectRatio:l=16/9,setPictureSelected:c=(()=>{}),cropRatioMessage:d,activeCrop:h=!1,setActiveCrop:m=(()=>{})}=e;const[f,g]=(0,r.useState)(null),[b,v]=r.useState({aspect:l,unit:"%",width:100,height:100}),[y,k]=r.useState(1),w=(0,r.useRef)(null),[x,_]=(0,r.useState)();function A(e){let t=atob(e.split(",")[1]),n=(e.split(",")[0].split(":")[1].split(";")[0],new ArrayBuffer(t.length)),r=new Uint8Array(n);for(let o=0;o{m(!1),g(null)}})]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:"flex max-h-[calc(80vh)] justify-center overflow-y-auto border-y border-border bg-background px-5 py-5 sm:max-h-max",children:(0,u.jsx)(p,{imgSrc:t,previewCanvasRef:w,aspectRatio:l})}),(0,u.jsxs)("div",{className:"flex items-center justify-between px-5 py-3",children:[d?(0,u.jsx)("p",{className:"theme-heading-2 font-semibold",children:(0,u.jsx)(o.A,{children:d})}):(0,u.jsx)("div",{}),(0,u.jsx)(i.$,{type:"button",onClick:e=>{!function(){if(w.current)try{const e=A(w.current.toDataURL("image/jpeg"));n(e),c(!0),m(!1),g(null)}catch(e){w.current.toBlob((e=>{e?(n(e),c(!0),m(!1),g(null)):console.error("Failed to create blob")}))}else console.error("Crop canvas does not exist")}()},label:"Crop Image"})]})]})]})})})}},22163:(e,t,n)=>{"use strict";n.d(t,{s:()=>C,A:()=>_});var r=n(20975),o=n(89449),i=n(62270),s=n(55049),a=n(43039),l=n(44427),c=n(78220),d=n(16118);class u{static async addCustomPoints(e,t,n){return l.A.post(c.vZ.leaderboard.addCustomPoints(e,n),t,{headers:{Authorization:"Bearer "+(0,d.ut)()}}).then((e=>e.data))}}var p=n(36357),h=n(31696),m=n(53871),f=n(8934),g=n(44139),b=n(90559),v=n(25715),y=n(19328),k=n(91900),w=n(54617),x=n(62391);function _(e){let{community:t,group:n,user:o,addToast:i,contributors:s,onUpdateContributors:l,isCommunityLeaderBoard:c=!0}=e;const[d,u]=(0,r.useState)(!1),[f,g]=(0,r.useState)(),[b,v]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[_,C]=(0,r.useState)(1),S=r.createRef(),j=null===t||void 0===t?void 0:t.id,E=null===n||void 0===n?void 0:n.id;(0,r.useEffect)((()=>{if(c&&j){u(!0);(async()=>{try{const e=await a.BE.getLeaderboardV2Paginated(j,_,25);if(e){const t=e.leaderboard.map(((e,t)=>({rank:t<9?"0".concat(t+1):t+1,id:e.user.id,user:e.user,karmaPoints:e.karmaPoints})));g(t)}u(!1)}catch(e){console.log({err:e}),u(!0)}})()}if(!c&&E){u(!0);(async()=>{try{const e=await a.Bd.getLeaderboardV2Paginated(E,_,25);if(e){const t=e.leaderboard.map(((e,t)=>({rank:t<9?"0".concat(t+1):t+1,id:e.user.id,user:e.user,karmaPoints:e.karmaPoints})));g(t)}u(!1)}catch(e){console.log({err:e}),u(!1),h.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")}})(),u(!1)}}),[j,E,c]);const N=async()=>{if(S.current){const{scrollTop:r,scrollHeight:o,clientHeight:i}=S.current;if(r+i===o&&!b&&!k){const r=_+1;v(!0);try{let n;if(n=c?await a.BE.getLeaderboardV2Paginated(j,r,25):await a.Bd.getLeaderboardV2Paginated(E,_,25),0===n.leaderboard.length)w(!0);else{let o=n.leaderboard.map(((e,t)=>({rank:t<9?"0".concat(t+1):t+1,id:e.user.id,user:e.user,karmaPoints:e.karmaPoints})));e=f,t=o,o=[...e,...t].map(((e,t)=>({...e,rank:t<9?"0".concat(t+1):t+1}))),g(o),C(r),v(!1)}}catch(n){console.error({error:n}),console.log(n),u(!1)}}}var e,t};return(0,x.jsxs)("div",{className:"LeaderBoardComponent flex flex-col bg-background",style:{height:"100%"},children:[(0,x.jsx)("div",{className:"flex flex-none items-center bg-card px-4 font-bold",style:{height:"53px"},children:c?(0,x.jsxs)("span",{children:["".concat(t.name," "),(0,x.jsx)(m.A,{children:"Leaderboard"})]}):(0,x.jsxs)("span",{children:["".concat(n.name," ")," ",(0,x.jsx)(m.A,{children:"Leaderboard"})]})}),(0,x.jsx)(p.av,{value:d,ifPresent:()=>(0,x.jsx)("div",{className:"flex h-96 flex-col place-content-center items-center",children:(0,x.jsx)(y.a,{})}),ifAbsent:()=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"flex-grow overflow-y-auto",style:{height:"calc(100%-53px)"},ref:S,onScroll:N,children:f&&f.map(((e,r)=>(0,x.jsx)(A,{community:t,group:n,user:o,contributor:e,index:r,addToast:i,onUpdateActivity:e=>{const t=[...s],n=t.findIndex((t=>t.user.id===e.user.id));n>=0&&(t[n]=e,t.sort(((e,t)=>t.grandTotal-e.grandTotal)),l(t));const r=[...f],o=r.findIndex((t=>t.user.id===e.user.id));if(o>=0){r[o]=e;let t=f.map(((e,t)=>{var n;return t===o?{...e,rank:t<9?"0".concat(t+1):t+1,karmaPoints:{...e.karmaPoints,grandTotal:null===(n=r[o].karmaPoints)||void 0===n?void 0:n.grandTotal,"admin-assigned":r[o].karmaPoints["admin-assigned"]}}:{...e,rank:t<9?"0".concat(t+1):t+1}}));t.sort(((e,t)=>t.karmaPoints.grandTotal-e.karmaPoints.grandTotal)),i=t,t=[...i].map(((e,t)=>({...e,rank:t<9?"0".concat(t+1):t+1}))),g(t)}var i}},r)))}),b&&(0,x.jsx)(y.a,{})]})})]})}function A(e){var t,n;let{community:o,group:i,user:a,contributor:l,index:c,addToast:d,onUpdateActivity:u}=e;const[p,h]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!0),{profileModelState:{setShowProfileModel:y,setIdToViewProfile:k}}=(0,s.A)();return(0,x.jsxs)("div",{className:"Contributor group my-3 flex cursor-pointer items-center justify-between px-6 font-semibold hover:bg-primary-light",children:[(0,x.jsx)("div",{onClick:()=>{y(!0),k(l.user.id)},children:(0,x.jsxs)("div",{className:"flex justify-between",children:[(0,x.jsxs)("span",{className:"pr-2 font-bold",children:["#",l.rank]}),(0,x.jsx)("div",{className:"flex flex-row gap-8",children:(0,x.jsx)(f.eu,{user:l.user,extraInfo:void 0,size:25})})]})}),(0,x.jsxs)("span",{className:"flex items-center font-bold",children:[((null===(t=l.karmaPoints)||void 0===t?void 0:t.grandTotal)||0)+(null===o||void 0===o||null===(n=o.configurables)||void 0===n?void 0:n.COMMUNITY_BASE_POINT_KEY)||0," ",(0,x.jsx)(m.A,{children:"points"}),["admin"].includes(o.myRole)&&(0,x.jsx)(v.A,{dropdownClassName:"w-72",actions:[{icon:"plus",label:"Add custom points",onClick:e=>{b(!0),h(!0)}},{icon:"minus",label:"Subtract custom points",onClick:e=>{b(!1),h(!0)}}],hideOnEmpty:!1,onClick:void 0})]}),(0,x.jsx)(C,{addToast:d,active:p,setActive:h,contributor:l,isAddPoints:g,community:o,group:i,onUpdateActivity:u})]})}function C(e){var t,n;let{group:s,community:a,active:l,setActive:c,contributor:d,isAddPoints:p=!0,addToast:h,onUpdateActivity:v=(e=>{})}=e;const[y,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(),S=(0,i.A)();return l?(0,x.jsx)(k.a,{className:"AlterCustomPointsModal bg-background",padding:!1,active:l,width:"450px",setActive:e=>{C(void 0),c(!1)},children:(0,x.jsxs)("div",{className:"",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,x.jsx)("span",{className:"font-bold text-secondary-foreground",children:p?(0,x.jsx)(m.A,{children:"Add custom karma points"}):(0,x.jsx)(m.A,{children:"Minus custom karma points"})}),(0,x.jsx)(b.A,{hoverable:!0,icon:"cross",size:"xs",iconClass:"text-secondary-foreground/70 text-xs",onClick:()=>{c(!1)}})]}),(0,x.jsxs)("div",{className:"p-4",children:[(0,x.jsxs)("div",{className:"space-y-2 rounded bg-card p-6",children:[(0,x.jsx)(f.eu,{user:d.user,extraInfo:void 0,size:35}),(0,x.jsxs)("div",{className:"text-sm font-bold",children:[(0,x.jsx)(m.A,{children:"Total custom karma points:"})," ",(null===(t=d.karmaPoints)||void 0===t?void 0:t["admin-assigned"])||0," ",(0,x.jsx)(m.A,{children:"points"})]})]}),(0,x.jsxs)("div",{className:"my-3",children:[(0,x.jsx)("h3",{className:"float-none font-bold",children:(0,x.jsx)(m.A,{children:"Add custom karma points"})}),(0,x.jsxs)("div",{className:"flex items-center justify-between space-x-3",children:[(0,x.jsxs)("span",{className:"font-bold",children:[(null===(n=d.karmaPoints)||void 0===n?void 0:n["admin-assigned"])||0," \xa0"," ",p?"+":"-"," "]}),(0,x.jsx)(w.k,{containerClassName:"flex-grow p-2",placeholder:"Enter no. of karma points",noMargin:!0,type:"number",inputHolderClassName:"p-2",onChange:e=>{C(e)}})]})]}),(0,x.jsxs)("div",{className:"flex justify-between",children:[(0,x.jsx)(g.$,{label:"Cancel",onClick:()=>{c(!1)},flat:!0}),(0,x.jsx)(g.$,{label:p?"Add points":"Minus Points",onClick:function(){var e;if(A&&isNaN(Number(A)))return void alert(S.trans("Please enter a valid number"));if(A&&A.indexOf(".")>-1)return void alert(S.trans("Point cannot be a decimal point"));if(A&&A<0)return void alert(S.trans("Point cannot be a negative value"));if(!p&&A>(null===(e=d.karmaPoints)||void 0===e?void 0:e.grandTotal))return void alert(S.trans("Points cannot be greater than current total points"));const t={groupId:s?s.id:null,points:A*(p?1:-1)};_(!0),u.addCustomPoints(a.id,t,d.user.id).then((e=>{var t,n,r,o,i;v({...d,grandTotal:d.grandTotal+parseInt(null===e||void 0===e||null===(t=e.userPoint)||void 0===t?void 0:t.points),customPoints:d.customPoints+parseInt(null===e||void 0===e||null===(n=e.userPoint)||void 0===n?void 0:n.points),karmaPoints:{...d.karmaPoints,grandTotal:(d.karmaPoints.grandTotal||0)+parseInt(null===e||void 0===e||null===(r=e.userPoint)||void 0===r?void 0:r.points),"admin-assigned":((null===(o=d.karmaPoints)||void 0===o?void 0:o["admin-assigned"])||0)+parseInt(null===e||void 0===e||null===(i=e.userPoint)||void 0===i?void 0:i.points)}}),h("Karma points updated successfully")})).catch((e=>{console.log(e),h("Error in updating karma points","",o.lm.danger)})).finally((()=>{_(!1),c(!1),C(void 0)}))},isLoading:y,disabled:!A})]})]})]})}):null}},93591:(e,t,n)=>{"use strict";n.d(t,{g:()=>i});var r=n(44139),o=n(62391);function i(e){let{children:t,className:n}=e;return(0,o.jsx)("div",{className:(0,r.cn)("MaxWrapper mx-auto flex w-full max-w-[1920px] flex-col px-0",n),children:t})}},64447:(e,t,n)=>{"use strict";n.d(t,{z:()=>w});var r=n(5564),o=n.n(r),i=n(78220),s=n(38545),a=n(8934),l=n(90559),c=n(72006),d=n.n(c),u=n(20975),p=n(30762),h=n.n(p),m=n(65186),f=n(55049),g=n(18228),b=n(43039),v=n(87573),y=n(85947),k=n(62391);function w(e){var t;let{post:n,user:r,showChannelName:c=!0,addToast:p=(e=>{}),updatePost:w=(e=>{}),displayLikeCommentIcons:_=!1}=e;const{title:A,description:C}=n,[S,j]=(0,u.useState)(!1),{analyticsService:E}=(0,m.W)(),[N,P]=(0,u.useState)(!1),[D,M]=(0,u.useState)(!1),{hideLikes:T,hideComment:I,hideCreator:O,hideDate:L}=(window.location.origin,(0,s.createPostDetailPageRouteFromSlug)(n),n.community,n.title,null!==(t=n.preferences)&&void 0!==t?t:{}),{profileModelState:{setShowProfileModel:R,setIdToViewProfile:B}}=(0,f.A)();function z(){if(A&&A.trim().length>0)return A;if(C){let e=h()(C);return e.length>60&&(e=e.substring(0,60)+" ..."),h()(e)}}return(0,k.jsxs)("div",{className:"flex w-screen cursor-pointer items-start items-center border-b border-border bg-card p-4 md:w-auto",children:[!O&&(0,k.jsx)(a.eu,{onClick:e=>{B(n.createdBy.id),R(!0)},user:{...n.createdBy,name:""},extraInfo:void 0,size:44}),(0,k.jsxs)("div",{className:"flex-grow",children:[(0,k.jsx)("div",{onClick:e=>{i.b6.push((0,s.createPostDetailPageRouteFromSlug)(n))},className:"max-w-screen line-clamp-1 text-sm font-semibold text-secondary-foreground",children:z()?z():(0,k.jsx)("div",{className:"text-secondary-foreground/70",children:"No visible description"})}),(0,k.jsx)(x,{post:n}),c&&(0,k.jsxs)("div",{className:"text-secondary-foreground",children:[n.createdBy.name," posted in "," ",(0,k.jsxs)("span",{onClick:()=>i.b6.push((0,g.x6)(n.group,n.tab)),className:"font-semibold text-primary",children:[n.group.name," ",n.tab?" - "+n.tab.name:""," "]})]}),(0,k.jsxs)("div",{className:"mt-2.5 flex flex-row items-center gap-1.5",children:[(0,k.jsx)("p",{className:"text-xs font-semibold text-secondary-foreground",children:n.createdBy.name}),(0,k.jsxs)("div",{className:o()("flex flex-row items-center text-xs font-semibold text-secondary-foreground",{hidden:L}),children:[(0,k.jsx)("div",{className:"mx-1.5 inline-block h-1 w-1 rounded-full bg-muted"}),d().duration(d()(new Date).diff(d()(n.createdAt))).asDays()<1?d()(n.createdAt).fromNow():""+d()(n.createdAt).format("DD MMM YYYY")]}),(0,k.jsx)("div",{className:"mx-1.5 inline-block h-1 w-1 rounded-full bg-muted"}),_&&(0,k.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,k.jsx)("div",{className:o()("flex items-center",{hidden:T}),children:(0,k.jsxs)("button",{className:"flex items-center ".concat(n.isLikedByMe?"text-primary":"text-secondary-foreground").concat(T?"hidden":""),onClick:()=>{if(S||!r)return;j(!0);(n.isLikedByMe?b.K$.dislikePost(r,n.id):b.K$.likePost(r,n.id)).then((e=>{let{post:t}=e;if(w(t),!t.isLikedByMe){b.cu.logEvent(v.B.Post.name,Number(v.B.Post.like));const e={userType:t.community.myRole,groupName:null===t||void 0===t?void 0:t.group.name,sectionName:null===t||void 0===t?void 0:t.tab.name,postUrl:window.location.origin+(0,s.createPostDetailPageRouteFromSlug)(t)};E.track("like-post",e)}})).catch((e=>{console.error({err:e})})).finally((()=>{j(!1)}))},children:[(0,k.jsx)(y.$,{fill:n.isLikedByMe?"false":"none",className:o()("flex items-center fill-current text-xs",{"text-primary":n.isLikedByMe,"text-secondary-foreground":!n.isLikedByMe,hidden:T})}),(0,k.jsxs)("span",{className:"text-xxs",children:["\xa0",n.likeCount>0?1===n.likeCount?"1":n.likeCount:""]})]})}),(0,k.jsx)("div",{className:o()("flex items-center",{hidden:I}),children:(0,k.jsx)(l.A,{onClick:e=>{i.b6.push((0,s.createPostDetailPageRouteFromSlug)(n))},icon:"comment-alt",className:"mt-1 text-secondary-foreground",label:"".concat(n.commentCount),size:"xs"})})]})]})]})]},n.id)}function x(e){let{post:t}=e;return t.poll?(0,k.jsxs)("div",{className:"theme-text-background mr-2 flex max-w-max flex-shrink-0 items-center rounded text-xs font-semibold",style:{backgroundColor:"#FFE27B",padding:"3px 8px 3px 3px"},children:[(0,k.jsx)("img",{src:"assets/vectors/poll-small-icon.svg",alt:"",style:{width:"16px"},className:"mr-1"}),t.poll.isQuiz?"Quiz":"Poll"]}):(0,k.jsx)(k.Fragment,{})}},86129:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(5564),o=n.n(r),i=n(20975),s=n(34458),a=n(44139),l=n(62391);function c(e){let{children:t,childrenClassName:n,footer:r,button:c,title:d,className:u="",visible:p,hideHeader:h=!1,headerBgDefault:m,setVisible:f}=e;const g=(0,i.useRef)(null);return(0,i.useEffect)((()=>{function e(e){g.current&&!g.current.contains(e.target)&&27===e.keyCode&&(console.log("esc",e.keyCode),f(!1))}return document.addEventListener("mousedown",e),()=>{let t=document.querySelector("html");t&&(t.style.overflowY="auto"),document.removeEventListener("mousedown",e)}}),[f,g]),(0,i.useEffect)((()=>{let e=document.querySelector("html");if(e)if(p&&e){e.style.overflowY="hidden";const t='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',n=document.querySelector("#modal");if(!n)return;const r=n.querySelectorAll(t)[1],o=n.querySelectorAll(t),i=o[o.length-1];document.addEventListener("keydown",(function(e){27===e.keyCode&&f(!1),("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===r&&e.preventDefault():document.activeElement===i&&e.preventDefault())}))}else e.style.overflowY="visible"}),[f,p]),(0,l.jsxs)(l.Fragment,{children:[c?(0,l.jsx)("div",{onClick:()=>f(!0),children:c}):(0,l.jsx)(l.Fragment,{}),p&&"undefined"!==typeof document?s.createPortal((0,l.jsxs)("div",{className:"fixed left-0 top-0 flex h-screen w-screen items-center justify-center","aria-labelledby":"header-4a content-4a footer-4a","aria-modal":"true",tabIndex:-1,role:"dialog",style:{zIndex:1e3},children:[(0,l.jsx)("div",{className:"absolute z-0 h-screen w-screen cursor-pointer bg-slate-300/20 backdrop-blur-sm",onClick:()=>f(!1)}),(0,l.jsxs)("div",{className:o()("z-10 flex max-h-screen max-w-7xl flex-col rounded bg-card text-secondary-foreground shadow-xl shadow-slate-700/10",u),id:"modal",role:"document",children:[(0,l.jsxs)("header",{id:"header-4a",className:o()("flex items-center pl-4 pr-2 pt-1",{hidden:h,"bg-background":m}),children:[(0,l.jsx)("h3",{className:"flex-1 text-lg font-semibold text-secondary-foreground",children:d}),(0,l.jsx)("button",{onClick:()=>f(!1),className:"inline-flex h-10 items-center justify-center gap-2 justify-self-center whitespace-nowrap rounded-full px-5 text-sm font-medium tracking-wide text-primary transition duration-300 hover:bg-primary-light focus-visible:outline-none","aria-label":"close dialog",children:(0,l.jsx)("span",{className:"relative only:-mx-5",children:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",role:"img","aria-labelledby":"title-79 desc-79",children:[(0,l.jsx)("title",{id:"title-79",children:"Icon title"}),(0,l.jsx)("desc",{id:"desc-79",children:"A more detailed description of the icon"}),(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})]})})})]}),(0,l.jsx)("div",{id:"content-4a",className:(0,a.cn)(o()("p-6",n)),children:t}),r&&(0,l.jsx)("footer",{id:"footer-4a",className:"px-4 pb-4",children:r})]})]}),document.body):null]})}},61649:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(5564),o=n.n(r),i=n(62391);function s(e){let{title:t,message:n,className:r,warning:s,error:a,success:l,info:c}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:o()("flex w-full items-start gap-4 rounded border-l-4 px-4 py-3 text-sm",{"theme-border-warning":s},{"theme-border-danger":a},{"theme-border-success":l},{"theme-border-info":c},r),role:"alert",children:[(0,i.jsx)(d,{error:a,warning:s,success:l,info:c}),(0,i.jsxs)("div",{children:[t&&(0,i.jsx)("h3",{className:"font-md mb-2 font-semibold text-secondary-foreground",children:t}),n&&(0,i.jsx)("p",{className:"text-sm text-secondary-foreground/80",children:n})]})]})});function d(e){let{error:t,warning:n,success:r,info:s}=e;const a=(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5","aria-labelledby":"title-09 desc-09",children:[(0,i.jsx)("title",{id:"title-09",children:"Icon title"}),(0,i.jsx)("desc",{id:"desc-09",children:"A more detailed description of the icon"}),(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),l=(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5","aria-labelledby":"title-06 desc-06",children:[(0,i.jsx)("title",{id:"title-06",children:"Icon title"}),(0,i.jsx)("desc",{id:"desc-06",children:"A more detailed description of the icon"}),(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})]}),c=(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5","aria-labelledby":"title-07 desc-07",children:[(0,i.jsx)("title",{id:"title-07",children:"Icon title"}),(0,i.jsx)("desc",{id:"desc-07",children:"A more detailed description of the icon"}),(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})]}),d=(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5","aria-labelledby":"title-08 desc-08",children:[(0,i.jsx)("title",{id:"title-08",children:"Icon title"}),(0,i.jsx)("desc",{id:"desc-08",children:"A more detailed description of the icon"}),(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})]});return(0,i.jsxs)("div",{className:o()("",{"theme-text-warning":n,"text-alert":t,"theme-text-success":r,"theme-text-info":s}),children:[r&&l,t&&a,n&&c,s&&d]})}}},51926:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(20975),o=n(58157),i=n(62144),s=n(62391);const a=function(e){let{text:t,className:n}=e;const[a,l]=(0,r.useState)();return(0,s.jsxs)("div",{className:"flex items-center justify-between rounded p-2 ".concat(n),children:[(0,s.jsx)("span",{className:"break-all",children:t}),(0,s.jsx)(o.A,{className:"flex items-center gap-[2px] space-x-2",outline:!0,label:a?"Copied":"copy",suffix:(0,s.jsx)(i.A,{icon:a?"check":"copy",size:"xs",className:"mt-0.5"}),onClick:e=>{e.preventDefault(),e.stopPropagation();const n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),l(!0),setTimeout((()=>{l(!1)}),2e3)}})]})}},84003:(e,t,n)=>{"use strict";n.d(t,{B:()=>a,u:()=>s});var r=n(5564),o=n.n(r),i=(n(20975),n(62391));const s=e=>{let{items:t,reversedOrder:n=!1,renderItem:r,noItemsElement:s,footerElement:a,placeholder:l,className:c,loading:d=!1,sortBy:u,onScroll:p,ref:h,style:m={}}=e;return d?l?(0,i.jsx)(i.Fragment,{children:l}):null:t&&null!==t&&0!==t.length?(u&&t&&t.length>0&&t.sort(u),(0,i.jsxs)("div",{ref:h,style:m,className:o()("ListView",(null===t||void 0===t?void 0:t.length)>0?c:""),onScroll:p,children:[(n?[...t].reverse():t).map(((e,t)=>(0,i.jsx)("div",{children:r(e,t)},t))),a&&a]})):s?(0,i.jsxs)(i.Fragment,{children:[s,a&&a]}):null},a=e=>{let{items:t,renderItem:n,noItemsElement:r,footerElement:o,placeholder:s,className:a,loading:l=!1}=e;return l?s&&(0,i.jsx)(i.Fragment,{children:s}):t&&null!==t&&0!==t.length&&null!==t&&Array.isArray(t)&&0!==t.length?t.map(((e,t)=>n(e,t))):(0,i.jsx)(i.Fragment,{children:r&&r})}},43532:(e,t,n)=>{"use strict";n.d(t,{J:()=>c});var r=n(5564),o=n.n(r),i=n(98208),s=n(44139),a=n(19328),l=n(62391);function c(e){return(0,l.jsx)("button",{...e,onClick:t=>{e.disabled||e.isLoading||e.onClick&&e.onClick(t)},className:(0,s.cn)(o()("group peer rounded-full border border-border bg-primary text-primary-foreground transition-all duration-200 ease-in-out active:scale-95","disabled:scale-100 disabled:cursor-not-allowed disabled:border-transparent disabled:bg-secondary-foreground/20 disabled:text-secondary-foreground/60 disabled:hover:scale-100",{"border-primary text-primary-foreground":e.disabled,"text-primary-foreground":!e.disabled,"animate-spin":e.isLoading}),e.className),children:e.isLoading?(0,l.jsx)(a.a,{spinnerColor:"var(--theme-on-primary-color)",size:20}):(0,l.jsx)(i.q,{className:o()("transition-all duration-200 ease-in-out group-hover:scale-125 group-active:scale-95","group-disabled:hover:scale-100",{"animate-spin":e.isLoading})})})}},6560:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(53871),o=n(26464),i=n(29646),s=n(62144),a=n(62391);function l(e){let{text:t,className:n}=e;const l=[{name:"Twitter",icon:o.Fi,onClick:e=>{window.open("https://twitter.com/intent/tweet?text=".concat(t))}},{name:"Facebook",icon:o.ik,onClick:e=>{window.open("https://www.facebook.com/sharer/sharer.php?u=".concat(t))}},{name:"LinkedIn",icon:o.ky,onClick:e=>{window.open("https://www.linkedin.com/sharing/share-offsite/?url=".concat(t))}},{name:"WhatsApp",icon:o.Y4,onClick:e=>{window.open("https://wa.me/?text=".concat(t))}},{name:"Telegram",icon:o.hZ,onClick:e=>{window.open("https://telegram.me/share/url?url=".concat(t))}}];return(0,a.jsxs)("div",{className:"flex flex-col space-y-2 px-4 py-2 ".concat(n),children:[(0,a.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:(0,a.jsx)(r.A,{children:"Share on social media"})}),(0,a.jsxs)("div",{className:"flex place-content-center items-center gap-4 bg-card px-8 py-2 text-secondary-foreground/80",children:[l.map(((e,t)=>(0,a.jsx)(i.A,{label:e.name,children:(0,a.jsx)("button",{onClick:e.onClick,className:"rounded-full border border-border p-2 transition-all duration-150 ease-in-expo hover:scale-105 hover:border-secondary-foreground hover:bg-accent hover:fill-current hover:text-secondary-foreground",children:(0,a.jsx)(e.icon,{className:"h-4 w-4"})})},t))),(0,a.jsx)(i.A,{label:"Share on mail",children:(0,a.jsx)("button",{onClick:e=>{window.open("mailto:?body=".concat(t))},className:"rounded-full border border-border p-2 transition-all duration-150 ease-in-expo focus-within:scale-[.95] hover:scale-105 hover:border-secondary-foreground hover:bg-accent hover:fill-current hover:text-secondary-foreground",children:(0,a.jsx)("span",{className:"flex h-4 w-4 items-center justify-center",children:(0,a.jsx)(s.A,{icon:"envelope",className:"h-4 w-4"})})})})]})]})}},63624:(e,t,n)=>{"use strict";n.d(t,{u:()=>d});var r=n(20975),o=n(83789),i=n(53322),s=n(53871),a=n(54859),l=n(62144),c=n(62391);const d=e=>{let{user:t,community:n,coverPicture:d,setCoverPicture:u,setAreFilesUploading:p,setUploadedMedia:h,uploadedMedia:m,setRemovedMediaUploadsOnEdit:f,isCoverPictureEdit:g=!1}=e;const[b,v]=(0,r.useState)(null),[y,k]=(0,r.useState)(null);return(0,r.useEffect)((()=>{g&&(b||y)&&(f((e=>{var t;return[...e,{mediaItem:null===m||void 0===m||null===(t=m.banner)||void 0===t?void 0:t[0],type:o.A.BANNER}]})),h((e=>({...e,banner:[]}))));(async()=>{if(n&&!g&&d&&0===m.banner.length||g&&!1===b){p(!0);const e=await i.u.uploadMedia(t,n.id,[d],o.A.BANNER);p(!1),h((t=>({...t,banner:[...t.banner,...e.publicUrls]})))}})()}),[d]),(0,c.jsx)(a.A,{picture:d,setPicture:u,setIsPictureRemoved:v,setIsPictureChanged:k,aspectRatio:16/9,recommendedRatio:"16:9",cropRatioMessage:"Picture ratio: 16:9",selectPictureComponent:(0,c.jsxs)("div",{className:"flex cursor-pointer select-none items-center space-x-3 py-2",children:[(0,c.jsx)(l.A,{icon:"picture",className:"text-secondary-foreground",size:"xs"}),(0,c.jsx)("span",{className:"text-sm font-semibold text-secondary-foreground",children:(0,c.jsx)(s.A,{children:"Add Cover Picture"})})]})})}},21143:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(5564),o=n.n(r),i=n(20975);const s=()=>{const[e,t]=(0,i.useState)(""),[n,r]=(0,i.useState)({}),[o,s]=(0,i.useState)(!1),[a,l]=(0,i.useState)(null);(0,i.useEffect)((()=>{if(null===a)return void(o&&async function(){const e=await navigator.mediaDevices.getUserMedia({audio:!0});return new MediaRecorder(e)}().then(l,console.error));o?a.start():"recording"===a.state&&a.stop();const e=e=>{t(URL.createObjectURL(e.data)),r({blob:e.data,url:URL.createObjectURL(e.data),name:"audio",type:e.data.type,size:e.data.size})};return a.addEventListener("dataavailable",e),()=>a.removeEventListener("dataavailable",e)}),[a,o]);return{audioURL:e,isRecording:o,startRecording:()=>{s(!0)},stopRecording:()=>{s(!1)},resetRecording:()=>{t(""),s(!1)}}};function a(e,t){t=t||{};var n=e.numberOfChannels,r=e.sampleRate,o=t.float32?3:1,i=3===o?32:16;return function(e,t,n,r,o){var i=o/8,s=r*i,a=new ArrayBuffer(44+e.length*i),c=new DataView(a);l(c,0,"RIFF"),c.setUint32(4,36+e.length*i,!0),l(c,8,"WAVE"),l(c,12,"fmt "),c.setUint32(16,16,!0),c.setUint16(20,t,!0),c.setUint16(22,r,!0),c.setUint32(24,n,!0),c.setUint32(28,n*s,!0),c.setUint16(32,s,!0),c.setUint16(34,o,!0),l(c,36,"data"),c.setUint32(40,e.length*i,!0),1===t?function(e,t,n){for(var r=0;rPromise.all([n.e(561),n.e(58)]).then(n.bind(n,60058)))),g=e=>{let{isRecorderVisible:t,setIsRecorderVisible:n,setRecording:r=(()=>{})}=e,{audioURL:l,isRecording:g,startRecording:b,stopRecording:v,resetRecording:y}=s();if(!t)return(0,m.jsx)(m.Fragment,{});const k=new window.AudioContext;function w(){c.A.hasValue(l)&&(!async function(e){const t="recording-".concat(Date.now(),".mp3");await fetch(e).then((e=>{e.ok&&e.arrayBuffer().then((e=>{k.decodeAudioData(e,(e=>{const n=a(e);r(new File([new DataView(n)],t,{type:"audio/wav",lastModified:Date.now()}))}),(e=>{console.log(e)}))}))})).catch((e=>{console.log(e)}))}(l),n(!1)),y()}return(0,m.jsx)(p.A,{visible:t,setVisible:n,title:"Record",className:"rounded-2xl",footer:(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)("div",{className:"flex flex-row place-content-end gap-2 bg-card p-3",children:[(0,m.jsx)(d.A,{label:"Cancel",onClick:()=>{b(),y(),n(!1)}}),(0,m.jsx)(u.$,{label:"Confirm",onClick:()=>{w()},disabled:g||!c.A.hasValue(l)})]})}),children:(0,m.jsx)("div",{className:"AudioRecorder",children:(0,m.jsxs)("section",{className:o()("relative my-3 flex flex-col gap-2 rounded border-border p-4"),children:[(0,m.jsx)("audio",{src:l,controls:!0,className:o()("my-6 w-full rounded-full py-1",{hidden:g||!c.A.hasValue(l)})}),(0,m.jsx)(i.Suspense,{fallback:(0,m.jsx)(m.Fragment,{}),children:(0,m.jsx)(f,{src:"https://assets9.lottiefiles.com/packages/lf20_pzrstZ.json",autoplay:!0,loop:!0,controlVisible:!1,className:o()("mx-auto h-32 w-full scale-x-150",{hidden:!g})})}),(0,m.jsxs)("div",{className:o()("flex flex-col place-content-between gap-2 sm:flex-row"),children:[(0,m.jsx)(d.A,{label:"start recording",className:(0,u.cn)(o()("flex max-w-fit items-center gap-2 rounded-full px-2 outline outline-1",{"cursor-not-allowed text-secondary-foreground/70":g||c.A.hasValue(l),"cursor-pointer text-primary":!g&&!c.A.hasValue(l)})),onClick:b,disabled:g||c.A.hasValue(l),prefix:(0,m.jsx)(h.A,{icon:"play",solid:!0,className:"h-4"})}),(0,m.jsx)(d.A,{label:"Stop recording",onClick:v,disabled:!g,className:o()("flex max-w-fit items-center gap-2 rounded-full px-2 outline outline-1",{"cursor-not-allowed text-secondary-foreground/70":!g,"cursor-pointer text-alert":g&&!c.A.hasValue(l)}),prefix:(0,m.jsx)(h.A,{icon:"stop",solid:!0,className:"h-4"})}),(0,m.jsx)(d.A,{label:"Reset recording",onClick:()=>{y()},disabled:g||!c.A.hasValue(l),className:o()("flex max-w-fit items-center gap-2 rounded-full px-2 outline outline-1",{"cursor-not-allowed text-secondary-foreground/70":g||!c.A.hasValue(l),"cursor-pointer text-primary":!g&&c.A.hasValue(l)}),prefix:(0,m.jsx)(h.A,{icon:"cross-circle",solid:!0,className:"h-4"})})]})]})})})}},31894:(e,t,n)=>{"use strict";n.d(t,{d:()=>s});var r=n(20975),o=n(83789),i=n(62391);function s(e){let{videos:t=[],setVideos:n=(()=>{}),setUploadedMedia:s=(()=>{}),onDelete:a=(e=>{}),setRemovedMediaUploadsOnEdit:l=(()=>{}),areFilesUploading:c}=e;const d=(0,r.useMemo)((()=>(0,i.jsx)(i.Fragment,{children:(null===t||void 0===t?void 0:t.length)>0&&(0,i.jsx)("div",{className:"SelectedVideo w-full",children:(0,i.jsx)("div",{className:"my-2 flex flex-wrap gap-4",children:t.map(((e,r)=>(0,i.jsx)("div",{className:"",children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("video",{src:"string"===typeof e?e:URL.createObjectURL(e),style:{width:"100%",objectFit:"cover"}}),(0,i.jsx)("div",{className:"".concat(c?"hidden":"remove"),onClick:e=>{const i=[...t];l((e=>[...e,{mediaItem:t[0],type:o.A.VIDEO}])),i.splice(r,1),n(i),a(t[r]),s((e=>({...e,videos:i})))},children:"\xd7"})]})},r)))})})})),[t.length,c]);return t&&0!==t.length?(0,i.jsx)("div",{className:"SelectedVideoPreview",children:d}):null}},67992:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(20975),o=n(31305),i=n(89449),s=n(44139),a=n(86129),l=n(97482),c=n(62391);const d=(0,i.wj)((0,o.Ng)((e=>({user:e.auth,groups:e.groups,community:e.community})))((function(e){let{community:t,user:n,group:o,groups:i,sectionId:d,addPost:u=(e=>{}),addToast:p,inlineButtonComponent:h,inlineDivComponent:m}=e;const[f,g]=(0,r.useState)(o),[b,v]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[w,x]=(0,r.useState)(!1),[_,A]=(0,r.useState)(!1);return b||m?(0,c.jsxs)(c.Fragment,{children:[m&&(0,c.jsx)("div",{onClick:()=>{v(!0)},children:m}),(0,c.jsx)(a.A,{visible:b,setVisible:()=>{A(!0)},className:"CreatePost flex w-full flex-col overflow-auto bg-card ".concat(y?"max-h-[100vh] max-w-full":"max-h-[95vh] max-w-[670px]"),hideHeader:!0,childrenClassName:"p-0",children:(0,c.jsx)(l.Ay,{community:t,setActive:v,user:n,group:o,groups:i,sectionId:d,addPost:u,addToast:p,isModalFullScreen:y,setIsModalFullScreen:k,isAdvanceSettingsOpen:w,setIsAdvanceSettingsOpen:x,closePrompt:{displayClosePrompt:_,setDisplayClosePrompt:A}})})]}):h?(0,c.jsx)("button",{onClick:()=>{v(!0)},children:h}):(0,c.jsx)(s.$,{label:"Create Post",onClick:()=>{window.innerWidth<480&&k(!0),v(!0)}})})))},18040:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});var r=n(84003),o=n(93092),i=n(62391);function s(e){let{posts:t,allPosts:n,placeholder:s,footerElement:a,noItemsElement:l,isLoading:c,isCommunityPost:d,onPostUpdate:u,onTopicSelect:p}=e;return(0,i.jsx)(r.u,{items:t,loading:c,placeholder:s,footerElement:a,noItemsElement:l,renderItem:e=>(0,i.jsx)(o.RK,{post:e,isCommunityPost:d,onTopicSelect:e=>{p&&p(e)},updatePost:e=>{if(!n)return;const t=n.findIndex((t=>t.id===e.id));if(-1===t)return void u(e,void 0);const r=[...n];r.splice(t,1,e),u(e,r)},showFullPost:1===t.length,deletePost:e=>{if(!n)return;const t=n.findIndex((t=>t.id===e.id));if(-1===t)return;const r=[...n];r.splice(t,1),u(e,r)}},e.id)})}},56726:(e,t,n)=>{"use strict";n.d(t,{R:()=>P});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(82993),l=n(65186),c=n(55049),d=n(78220),u=n(24881),p=n(41374),h=n(5607),m=n(36357),f=n(53871),g=n(8934),b=n(31012),v=n(62270),y=n(10515),k=n(8233),w=n(43039),x=n(2016),_=n(19328),A=n(91900),C=n(31696),S=n(62391);const j=(0,s.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community})))((function(e){let{user:t,community:n,isSubscriberListVisible:r=!1,setIsSubscriberListVisible:o=(e=>{})}=e;const[s,a]=(0,i.useState)([]),[l,d]=(0,i.useState)(!1),[u,p]=(0,i.useState)(!1),[h,m]=(0,i.useState)(!1),[j,E]=(0,i.useState)(1),[N,P]=(0,i.useState)(""),D=(0,i.useRef)(),M=(0,v.A)(),{DirectMessageModelState:T}=(0,c.A)();(0,i.useEffect)((()=>{d(!0),w.BE.getCommunitySubscribersPaginated(t,n.id,10,1,N).then((e=>{let{users:n}=e;a(n.filter((e=>e.id!==t.id))),d(!1)})).catch((e=>{console.error({error:e}),d(!1),C.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")}))}),[t,n.id]);const I=i.useCallback((0,b.debounce)((e=>{d(!0),w.BE.getCommunitySubscribersPaginated(t,n.id,10,1,e).then((e=>{let{users:n}=e;a(n.filter((e=>e.id!==t.id))),d(!1),m(!1)})).catch((e=>{console.error({error:e}),d(!1)}))}),1e3),[n.myRole]),O=N?s.filter((e=>(e.name+"").toLowerCase().includes(N.toLowerCase()))):s,L=i.useCallback((()=>{if(D.current){const{scrollTop:e,scrollHeight:r,clientHeight:o}=D.current;if(e+o===r&&!u&&!h){const e=j+1;p(!0),w.BE.getCommunitySubscribersPaginated(t,n.id,10,e,N).then((t=>{0===t.users.length?m(!0):(a([...s,...t.users]),E(e)),p(!1)})).catch((e=>{console.error({error:e}),d(!1)}))}}}),[u,h,j,N,s]);return(0,S.jsxs)(A.a,{setActive:o,active:r,className:"CommunityChatMemberList",padding:!1,children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,S.jsxs)("span",{className:"font-bold text-secondary-foreground/85",children:[n.name," - ",s.length," ",(0,S.jsx)(f.A,{children:"Subscribers"})]}),(0,S.jsx)(x.A,{icon:y.A,rotate:45,onClick:()=>{o(!1)}})]}),(0,S.jsxs)("div",{className:"p-5 pb-24 text-secondary-foreground/85",children:[(0,S.jsxs)("div",{className:"mb-4 flex items-center rounded border border-border bg-card px-4 py-1",children:[(0,S.jsx)("img",{src:k.A,alt:"",style:{filter:"opacity(0.5)",width:"18px"}}),(0,S.jsx)("input",{type:"text",placeholder:M.trans("Search"),value:N,onChange:e=>{d(!0),P(e.target.value),I(e.target.value)},className:"flex-grow bg-transparent px-4 py-1 focus:outline-none"}),N.length>0?(0,S.jsx)("i",{onClick:()=>{d(!0),P(""),I("")},className:"fi fi-rr-cross cursor-pointer pr-1 text-sm text-secondary-foreground/85"}):null]}),l?(0,S.jsx)("div",{className:"p-1",children:(0,S.jsx)(_.a,{})}):(0,S.jsx)(S.Fragment,{}),(0,S.jsx)("div",{onScroll:L,ref:D,className:"h-96 overflow-y-scroll",children:O.map((e=>(0,S.jsx)("div",{className:"m-3 flex cursor-pointer items-center justify-between",children:(0,S.jsx)("div",{className:"flex items-center justify-center",children:(0,S.jsx)(g.eu,{user:e,onClick:()=>{o(!1),T.setIdToViewMessage(e.id),T.setShowDirectMessageModel(!0)},tag:(0,S.jsxs)(S.Fragment,{children:["admin"===e.communityRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-blue-500",children:(0,S.jsx)(f.A,{children:"Community Admin"})}):(0,S.jsx)(S.Fragment,{}),"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-blue-500",children:(0,S.jsx)(f.A,{children:"Admin"})}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,S.jsx)(f.A,{children:"Moderator"})}):(0,S.jsx)(S.Fragment,{})]})})})},e.id)))})]})]})}));var E=n(84003),N=n(62144);const P=(0,s.Ng)((e=>({user:e.auth,community:e.community,personalGroup:e.personalGroup,socket:e.socket,chats:e.directMessages.users,isLoading:e.directMessages.isLoading,error:e.directMessages.error})),(e=>(0,a.zH)({setPersonalGroup:h.iz,setChats:p.RN,getAllDirectChats:p.OX},e)))((function(e){let{user:t,community:n,chats:r,setChats:s,isLoading:a,error:p}=e;const[h,b]=(0,i.useState)(!1),[v,y]=(0,i.useState)(window.location.pathname.split("/")[2]),{analyticsService:k}=(0,l.W)(),{messageListModelState:{setShowMessageListModel:w},DirectMessageModelState:{setIdToViewMessage:x,setShowDirectMessageModel:_}}=(0,c.A)();return(0,i.useEffect)((()=>{const e=d.b6.listen((e=>{y(e.pathname.split("/")[2])}));return()=>{e()}})),(0,i.useEffect)((()=>{u.b.getDirectChats(t).then((e=>{let{users:t}=e;s(t)})).catch((e=>{e.response&&e.response.data&&e.response.data.message?console.log(e.response.data.message):console.log("Something went wrong!")}))}),[]),(0,S.jsxs)("div",{className:"",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between p-2 px-4 shadow-sm",children:[(0,S.jsx)("div",{className:"sidebar-heading font-semibold capitalize text-secondary-foreground/85",children:(0,S.jsx)(f.A,{children:"Inbox"})}),(0,S.jsx)("button",{className:"group rounded p-1 px-2 hover:bg-background",onClick:e=>{k.track("create-new-chat"),b(!0)},children:(0,S.jsx)(N.A,{icon:"plus",solid:!0,size:"xs",className:"scale-100 transition-all duration-150 group-active:scale-95"})})]}),(0,S.jsx)(E.u,{items:r,loading:a,className:"px-2",renderItem:(e,n)=>e&&(0,S.jsxs)("div",{onClick:()=>{_(!0),x(e.id),w(!1),u.b.markAllMessagesInChatAsRead(t,e.id).then((()=>{r.find((t=>t.id===e.id)).unreadMessageCount=0})).catch((e=>{console.log("could not mark user chat as read",e)}))},className:o()("flex cursor-pointer place-content-between items-center rounded py-0.5 hover:bg-accent hover:text-accent-foreground",{"bg-primary text-primary-foreground":v===e.id,"text-secondary-foreground/80":v!==e.id}),children:[(0,S.jsx)(g.eu,{user:e,size:35,className:o()("my-2 rounded px-2 hover:text-primary-foreground",{"bg-primary":v===e.id,"theme-text-title-1":v!==e.id}),extraInfo:void 0}),e.unreadMessageCount&&e.unreadMessageCount>0?(0,S.jsx)("div",{className:"flex aspect-square h-6 w-6 place-content-center items-center rounded-full bg-primary text-center text-primary-light",children:(0,S.jsx)("p",{className:"text-xs",children:(0,m.ZV)(e.unreadMessageCount)})}):(0,S.jsx)(S.Fragment,{})]},n),noItemsElement:(0,S.jsx)("div",{className:"flex h-52 flex-col place-content-center items-center text-center text-secondary-foreground/70",children:(0,S.jsx)(f.A,{children:"No chats found"})}),placeholder:(0,S.jsx)("div",{className:"flex flex-col gap-4 p-2",children:Array.from({length:20},((e,t)=>(0,S.jsxs)("div",{className:"flex animate-pulse flex-row items-center gap-4",children:[(0,S.jsx)("div",{className:"h-8 w-8 rounded-full border border-border bg-accent"}),(0,S.jsx)("div",{className:"h-4 w-2/4 rounded bg-accent"})]},t)))})}),(0,S.jsx)(j,{community:n,user:t,isSubscriberListVisible:h,setIsSubscriberListVisible:b})]})}))},13362:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=(n(20975),n(53871)),s=n(62391);const a=function(e){let{tab:t,selected:n,onClick:r,className:a,disabled:l=!1}=e;return(0,s.jsx)("div",{className:o()({"cursor-not-allowed":l}),children:(0,s.jsx)("div",{className:o()("tab cursor-pointer select-none rounded-t px-4 py-1 font-semibold text-primary transition duration-500 ease-in-out hover:border-b-2 hover:border-primary hover:bg-primary-light"+a,{"border-b-2 border-primary":n},{"pointer-events-none":l}),onClick:r,children:(0,s.jsx)(i.A,{children:t})},t)})}},68108:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(20975),o=n(63360),i=n(53871),s=n(19328),a=n(57731),l=n(78450);const c=async function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e=>{},o="LIVDSRZULELA",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,s=t;e=t&&0!==t.length?"https://g.tenor.com/v1/search?q="+s+"&key="+o+"&limit="+i+"&pos="+n:"https://g.tenor.com/v1/trending?key="+o+"&limit="+i+"&pos="+n,function(e,t){let n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&200==n.status&&t(n.responseText)},n.open("GET",e,!0),n.send(null)}(e,(e=>{let t=JSON.parse(e);r(t)}))};var d=n(1689),u=n(62391);function p(e){let{photo:t,onGifSelect:n=(e=>{})}=e;const[o,i]=r.useState(!1);return(0,u.jsx)("div",{className:"group relative h-60 w-full cursor-pointer place-items-center border border-border object-cover sm:h-44 md:h-32",onClick:()=>n(t),children:(0,u.jsx)(d.A,{className:"card-img h-full w-full place-items-center rounded object-cover",src:t.media[0].tinygif.url,alt:t.content_description})},t.id)}function h(e){let{isLoading:t=!1,isLoadingMore:n=!1,photoList:o,total:s,onGifSelect:a,loadMore:l}=e;const c=r.useMemo((()=>r.createRef()),[]);return(0,u.jsxs)("div",{className:"Body",children:[t?(0,u.jsx)("div",{className:"flex h-96 items-center justify-center",children:(0,u.jsx)(m,{})}):(0,u.jsxs)(u.Fragment,{children:[Array.isArray(o)&&o.length>0&&(0,u.jsx)("div",{className:"TenorGifList grid grid-cols-1 gap-2 overflow-y-auto p-4 sm:grid-cols-2 md:grid-cols-3",style:{maxHeight:"calc(100vh - 125px)"},ref:c,onScroll:()=>{if(c.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=c.current;t-(e+n)<20&&l()}},children:o.map((e=>(0,u.jsx)(p,{photo:e,onGifSelect:a},e.id)))}),Array.isArray(o)&&0===o.length&&0===s&&(0,u.jsx)("div",{className:"flex h-96 items-center justify-center",children:(0,u.jsx)(i.A,{children:"No photos found"})})]}),n&&(0,u.jsx)("div",{className:"my-4 flex justify-center",children:(0,u.jsx)(m,{})})]})}function m(){return(0,u.jsxs)("svg",{className:"text-blue -ml-1 mr-3 h-5 w-5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,u.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,u.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function f(e){let{active:t=!1,initialSearchQuery:n="",setActive:d=(e=>{}),onGifSelect:p=(e=>{})}=e;const[m,f]=r.useState([]),[g,b]=r.useState(),[v,y]=r.useState(!0),[k,w]=r.useState(""),[x,_]=r.useState(!1),[A,C]=r.useState(!1),[S,j]=r.useState(""),[E,N]=r.useState(!1);r.useEffect((()=>{t&&(w(n),P("",n))}),[t,n]);const P=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];x||A||!v||(""===e?_(!0):C(!0),c(t,e,30,(e=>{const t=e.results;if(j(e.next),"0"===e.next||0===e.results.length)y(!1);else if(t){let e=t;n||(e=[...m,...t]),f(e),b(t.length),y(!0)}C(!1),_(!1)})))};return t?(0,u.jsx)("div",{style:{zIndex:"auto"},className:"TenorGifPicker",children:(0,u.jsxs)(a.A,{active:t,setActive:d,width:"540px",className:"bg-card",children:[(0,u.jsxs)("div",{className:"h-full",children:[(0,u.jsxs)("div",{className:"flex place-content-between items-start bg-card px-4 pt-2 text-lg font-bold",children:[(0,u.jsx)(i.A,{children:"Search Gif"}),(0,u.jsx)(o.J,{onClick:()=>{d(!1)}})]}),(0,u.jsx)("div",{className:"bg-card p-4 shadow",children:(0,u.jsx)("div",{className:"",children:(0,u.jsx)(l.A,{placeholder:"Search Tenor",onSearch:e=>{f([]),y(!0),P("",e,!0)},query:k,setQuery:w})})}),(0,u.jsx)(h,{total:g,photoList:m,isLoading:x,isLoadingMore:A,loadMore:()=>{P(S+1,k)},onGifSelect:async e=>{try{N(!0);let t=await fetch(e.media[0].tinygif.url).then((e=>e.blob())),n=new File([t],e.media[0].tinygif.url.split("/").pop(),{type:"image/gif"});N(!1),p({...e,blobData:n})}catch(t){console.log(t),N(!1)}}})]}),x||E&&(0,u.jsx)("div",{className:"absolute bottom-0 left-0 right-0 top-0",children:(0,u.jsx)("div",{className:"flex h-full place-content-center items-center bg-slate-600/70",children:(0,u.jsx)("div",{className:"opacity-100",children:(0,u.jsx)(s.a,{})})})})]})}):null}},22393:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(62391);const o=e=>{let{selectedOption:t,setSelectedOption:n,disabled:o=!1}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{disabled:o,className:"flex w-10 cursor-pointer rounded-2xl p-0.5 text-primary ".concat(t?"place-content-end bg-primary":"place-content-start bg-muted"),onClick:()=>{n(!t)},children:(0,r.jsx)("div",{className:"flex h-4 w-4 place-content-center items-center rounded-full bg-[#ffffff]"})})})}},91341:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(5564),o=n.n(r),i=(n(20975),n(62270)),s=n(53871),a=n(62391);const l=e=>{let{className:t,size:n="body",variant:r,children:l,translate:c}=e;const d=(0,i.A)();return(0,a.jsx)("span",{className:o()("",t,{"text-2xl":"h1"===n,"text-xl":"h2"===n,"text-lg":"h3"===n,"text-base":"body1"===n,"text-sm":"body"===n,"text-xs":"caption"===n,"text-[11px]":"small"===n},{"font-bold text-secondary-foreground":"t1"===r,"font-semibold text-secondary-foreground/90":"t2"===r,"text-secondary-foreground/80":"s1"===r,"text-secondary-foreground/70":"s2"===r,"font-light":"cap"===r}),children:c?(0,a.jsx)(s.A,{lang:d,children:l}):l})},c=l},62144:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5564),o=n.n(r),i=(n(20975),n(44139)),s=n(62391);const a=function(e){let{icon:t,className:n="",solid:r=!1,size:a="md"}=e;return(0,s.jsx)("i",{className:(0,i.cn)(o()("",{["fi-rr-".concat(t)]:!r,["fi-sr-".concat(t)]:r,["text-".concat(a)]:a}),n)})}},78450:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(62270),o=n(44139),i=n(62391);const s=function(e){let{setQuery:t,query:n,placeholder:s="Search",onSearch:a}=e;const l=async e=>{e.preventDefault(),a(n)},c=(0,r.A)();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{children:(0,i.jsxs)("form",{onSubmit:l,className:"flex items-center space-x-2",children:[(0,i.jsx)("input",{className:"w-full rounded-md border border-border bg-background py-2 pl-3 pr-3 placeholder:italic placeholder:text-secondary-foreground/80 focus:border-primary focus:outline-none focus:ring-1 sm:text-sm",placeholder:c.trans(s),type:"text",name:"search",value:n,onChange:e=>t(e.target.value)}),(0,i.jsx)(o.$,{label:"Search",onClick:l,className:"word-breaker"})]})})})}},79036:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(65186),o=n(62391);function i(e){let{prop:t}=e;const{widget:n}=t,{analyticsService:i}=(0,r.W)();return(0,o.jsx)("div",{className:"",children:(0,o.jsxs)("div",{className:"",children:[n.details.picture&&(0,o.jsx)("img",{className:"w-full rounded-t-xl",src:n.details.picture,alt:"event",loading:"lazy"}),(0,o.jsxs)("div",{className:"flex-col p-5 text-secondary-foreground",children:[(0,o.jsx)("div",{className:"text-sm font-bold",children:n.details.title}),(0,o.jsx)("div",{className:"mt-2.5 text-xs",children:n.details.description}),(0,o.jsx)("div",{className:"mt-2.5",children:(0,o.jsx)("button",{className:"rounded border-2 border-primary bg-primary px-5 py-1 text-xs font-semibold text-primary-foreground focus:outline-none",onClick:e=>{e.preventDefault(),i.track("custom-widget-button-clicked"),window.open(n.details.buttonURL)},children:(0,o.jsx)("span",{children:"".concat(n.details.buttonLabel&&null!==n.details.buttonLabel?n.details.buttonLabel:"Click Here")})})})]})]})})}const s=function(e){return(0,o.jsx)("div",{className:"rounded-xl bg-card",children:(0,o.jsx)(i,{prop:e})})}},17357:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var r=n(20975),o=n(16478),i=n(65186),s=n(55049),a=n(9175);const l=n.p+"static/media/bronze-star.3b83a6751a73c67232775504c3458735.svg";const c=n.p+"static/media/gold-star.3eb155ae933f7c98b307046735bb4d80.svg";const d=n.p+"static/media/silver-star.eaf70a884ed11b67f6d3449584f327f4.svg";var u=n(43039),p=n(36357),h=n(53871),m=n(58157),f=n(8934),g=n(22163),b=n(57731),v=n(31696),y=n(62391);function k(e){let{group:t,memberPreviewLimit:n=5,isCommunityLeaderBoard:k=!0}=e;const{analyticsService:w}=(0,i.W)(),[x,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(),[S,j]=(0,r.useState)(),[E,N]=(0,r.useState)(!1),{profileModelState:{setShowProfileModel:P,setIdToViewProfile:D}}=(0,s.A)(),{addToast:M}=(0,a.d)(),{community:T,user:I}=(0,o.G)((e=>({community:e.community,user:e.auth}))),O=null===T||void 0===T?void 0:T.id,L=null===t||void 0===t?void 0:t.id;return(0,r.useEffect)((()=>{if(O)try{_(!0),(async e=>{const t=await u.BE.getLeaderboardV2Paginated(e,1,n);C(t.leaderboard)})(O),_(!1)}catch(e){console.log({error:e}),_(!1)}if(L)try{_(!0),(async e=>{const t=await u.Bd.getLeaderboardV2Paginated(e,1,n);j(t.leaderboard)})(L),_(!1)}catch(e){console.log({error:e}),_(!1),v.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")}}),[O,L,k]),x||void 0!==A&&0!==A.length?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"rounded-xl bg-card p-5",children:[(0,y.jsx)("button",{className:"flex w-full cursor-pointer select-none border-b border-border pb-5 text-secondary-foreground",onClick:()=>{N(!0),w.track("widget-leaderboard",{clickOn:"header",widgetType:"leaderboard"})},children:(0,y.jsx)("h4",{className:"text-sm font-bold uppercase",children:k?(0,y.jsx)(h.A,{children:"Top Members"}):(0,y.jsx)(h.A,{children:"Group Top Contributors"})})}),(0,y.jsxs)("div",{className:"",children:[!k&&S&&(0,y.jsx)("div",{className:"",children:S.slice(0,n).map(((e,t)=>{var n,r;return(0,y.jsxs)("div",{onClick:()=>{w.track("widget-leaderboard",{clickOn:"user",widgetType:"leaderboard"}),P(!0),D(e.user.id)},className:"flex cursor-pointer items-center justify-between pt-4 text-secondary-foreground",children:[(0,y.jsxs)("div",{className:"flex items-center space-x-1",style:{maxWidth:"calc(100% - 75px)"},children:[(0,y.jsxs)("div",{className:"flex items-center gap-2.5",children:[0===t&&(0,y.jsx)("img",{src:c}),1===t&&(0,y.jsx)("img",{src:d}),2===t&&(0,y.jsx)("img",{src:l}),t>=3&&(0,y.jsxs)("span",{className:"w-6 text-xs font-semibold",children:["#",t<10?0:"",t+1]}),(0,y.jsx)(f.eu,{user:e.user,noName:!0,size:30,className:"w-8",extraInfo:void 0})]}),(0,y.jsx)("span",{className:"word-breaker text-xs font-semibold",children:e.user.name})]}),(0,y.jsxs)("span",{className:"text-xxs rounded bg-accent px-1.5 py-1 text-secondary-foreground",children:[(0,p.ZV)((null===(n=e.karmaPoints)||void 0===n?void 0:n.grandTotal)||0)+((null===T||void 0===T||null===(r=T.configurables)||void 0===r?void 0:r.COMMUNITY_BASE_POINT_KEY)||0)," ",(0,y.jsx)(h.A,{children:"points"})]})]},t)}))}),k&&A&&(0,y.jsx)("div",{className:"",children:A.slice(0,n).map(((e,t)=>{var n,r;return(0,y.jsxs)("div",{onClick:()=>{w.track("widget-leaderboard",{clickOn:"user",widgetType:"leaderboard"}),P(!0),D(e.user.id)},className:"flex cursor-pointer items-center justify-between pt-4 text-secondary-foreground",children:[(0,y.jsxs)("div",{className:"flex items-center space-x-1",style:{maxWidth:"calc(100% - 75px)"},children:[(0,y.jsxs)("div",{className:"flex items-center gap-2.5",children:[0===t&&(0,y.jsx)("img",{src:c}),1===t&&(0,y.jsx)("img",{src:d}),2===t&&(0,y.jsx)("img",{src:l}),t>=3&&(0,y.jsxs)("span",{className:"w-6 text-xs font-semibold",children:["#",t<10?0:"",t+1]}),(0,y.jsx)(f.eu,{user:e.user,noName:!0,size:30,className:"w-8",extraInfo:void 0})]}),(0,y.jsx)("span",{className:"word-breaker text-xs font-semibold",children:e.user.name})]}),(0,y.jsxs)("span",{className:"text-xxs rounded bg-accent px-1.5 py-1",children:[(0,p.ZV)(((null===(n=e.karmaPoints)||void 0===n?void 0:n.grandTotal)||0)+((null===T||void 0===T||null===(r=T.configurables)||void 0===r?void 0:r.COMMUNITY_BASE_POINT_KEY)||0))," ",(0,y.jsx)(h.A,{children:"points"})]})]},t)}))}),(0,y.jsx)("div",{className:"text-xxs pt-4",children:(0,y.jsx)(m.A,{label:"View All",onClick:e=>{N(!0);w.track("widget-leaderboard",{clickOn:"show-all",widgetType:"leaderboard"})}})}),(0,y.jsx)(b.A,{active:E,setActive:N,width:500,children:(0,y.jsx)(g.A,{addToast:M,user:I,community:T,contributors:k?A:S,group:t,isCommunityLeaderBoard:k,onUpdateContributors:function(e){C(e)}})})]})]})}):(0,y.jsx)(y.Fragment,{})}},75972:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var r=n(20975),o=n(30762),i=n.n(o),s=n(78220),a=n(38545),l=n(43039),c=n(8934),d=n(16478),u=n(65186),p=n(97843),h=n(53871),m=n(1689),f=n(84003),g=n(36646),b=n(62391);function v(e){let{post:t}=e;const{title:n,description:r}=t,{analyticsService:o}=(0,u.W)();function l(){if(n&&n.trim().length>0)return n;if(r){let e=i()(r);return e.length>60&&(e=e.substring(0,60)+" ..."),i()(e)}}return(0,b.jsx)("div",{className:"cursor-pointer items-start bg-card pt-4 text-secondary-foreground",onClick:e=>{o.track("post-selected-from-widgets"),s.b6.push((0,a.createPostDetailPageRouteFromSlug)(t))},children:(0,b.jsx)("span",{className:"mt-1 flex w-full",children:(0,b.jsxs)("div",{className:"flex",children:[(0,b.jsx)(c.eu,{user:{...t.createdBy,name:""},size:40,extraInfo:void 0}),(0,b.jsxs)("div",{className:"flex-col text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"word-breaker max-w-64 font-semibold",style:{maxWidth:"250px"},children:l()?l():(0,b.jsx)("div",{className:"text-secondary-foreground/70",children:(0,b.jsx)(h.A,{children:"No visible description"})})}),(0,b.jsx)("div",{className:"text-xxs flex space-x-1 font-semibold",children:(0,b.jsx)(y,{post:t})})]}),(0,b.jsx)("span",{className:"word-breaker flex-grow overflow-hidden font-light",children:t.createdBy.name})]})]})})})}function y(e){let{post:t}=e;return t.poll?(0,b.jsxs)("div",{className:"text-xxs flex flex-shrink-0 items-center rounded font-semibold",style:{backgroundColor:"#FFE27B",padding:"1px 1px 2px 2px"},children:[(0,b.jsx)(m.A,{src:"assets/vectors/poll-small-icon.svg",alt:"",style:{width:"12px"},className:"mr-1"}),t.poll.isQuiz?"Quiz":"Poll"]}):(0,b.jsx)(b.Fragment,{})}const k=function(e){let{group:t,isCommunityPosts:n=!1}=e;const[o,i]=(0,r.useState)(),[s,a]=(0,r.useState)(!1),{community:{id:c},user:u}=(0,d.G)((e=>({community:e.community,user:e.auth})));(0,r.useEffect)((()=>{n&&!p.A.hasValue(o)?m():n||void 0!==o&&0!==o.length||y()}),[null===t||void 0===t?void 0:t.id,n]);const m=()=>{s||(a(!0),l.BE.getCommunityPostDirectoryById(u,c,"trending",1).then((e=>{0!==e.posts.length&&i(e.posts)})).catch((e=>{console.log(e)})).finally((()=>{a(!1)})))},y=()=>{s||(a(!0),l.Bd.getTrendingPosts(null===t||void 0===t?void 0:t.id).then((e=>{0===e.posts.length?console.log("No posts"):i(e.posts),a(!1)})).catch((e=>{console.log(e)})).finally((()=>{a(!1)})))};return s||void 0!==o&&0!==o.length?(0,b.jsxs)("div",{className:"rounded-xl bg-card p-5",children:[(0,b.jsx)("h4",{className:"border-b border-border pb-5 text-sm font-bold uppercase text-secondary-foreground",children:(null===o||void 0===o?void 0:o.length)>1?(0,b.jsx)(h.A,{children:"Trending Posts"}):(0,b.jsx)(h.A,{children:"Trending Post"})}),(0,b.jsx)(f.u,{items:null===o||void 0===o?void 0:o.slice(0,5),loading:s,className:"",renderItem:function(e,t){return(0,b.jsx)(v,{post:e,displayLikeCommentIcons:!1},t)},placeholder:(0,b.jsx)(g.A,{length:4,type:g.D.compact})})]}):(0,b.jsx)(b.Fragment,{})}},56072:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={BASIC:"basic-details",ADVANCED:"advance-details"}},49724:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r={VIDEO_CALL:"meeting",WEBINAR:"webinar",AUDIO_ROOM:"audio"},o={SESSION_TYPE:r,SESSION_TOOLTIPS:{VIDEO_CALL:{id:r.VIDEO_CALL,tooltips:[{label:"Participation",description:" Everyone can switch on their mic and camera"}]},WEBINAR:{id:r.WEBINAR,tooltips:[{label:"Participation",description:" Only host can present. Members invited to stage can present"}]},AUDIO_ROOM:{id:r.AUDIO_ROOM,tooltips:[{label:"Participation",description:"Everyone can switch on mic and speak"}]}},CALL_TYPE:{RIGHT_NOW:"right-now",SCHEDULE_LATER:"schedule-later"}}},68652:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const r={OPEN:"open",CLOSED:"closed",PRIVATE:"private"},o={OPEN:"open",CLOSED:"closed-free",PRIVATE:"closed-private"},i={CHANNEL:r,GROUP:o,GROUP_TOOLTIPS:{OPEN:{id:o.OPEN,tooltips:[{label:"Visibility",description:"All user can see this group"},{label:"Access",description:"Any user can join this group"}]},CLOSED:{id:o.CLOSED,tooltips:[{label:"Visibility",description:"All user can see this group"},{label:"Access",description:"They will have to send a request to join the group. Or Add them manually. Or Add this to paid subscription"}]},PRIVATE:{id:o.PRIVATE,tooltips:[{label:"Visibility",description:"Only members of the group can see this group."},{label:"Access",description:"Invite or Add user manually. Or Add this to paid subscription"}]}},CHANNEL_TOOLTIPS:{OPEN:{id:r.OPEN,tooltips:[{label:"Visibility",description:"All group members can see this channel"},{label:"Access",description:"All group member will be auto added to this channel"}]},CLOSED:{id:r.CLOSED,tooltips:[{label:"Visibility",description:"All user can see this channel"},{label:"Access",description:"They will have to send a request to join the channel."}]},PRIVATE:{id:r.PRIVATE,tooltips:[{label:"Visibility",description:"Only members of the channel can see this channel."},{label:"Access",description:"Invite or Add user manually."}]}}}},23293:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COMMUNITY_BANNER_SETTINGS_PAGE_ROUTE:()=>x,CommunityBannerSettingsComponent:()=>_,default:()=>A});var r=n(5564),o=n.n(r),i=n(20975),s=n(31305),a=n(82993),l=n(47760),c=n(89449),d=n(65186),u=n(51772),p=n(25968),h=n(53871),m=n(76786),f=n(90559),g=n(54859),b=n(93591),v=n(12014),y=n(43039),k=n(42414),w=n(62391);const x="/settings/homepage";function _(e){var t;let{addToast:n,community:r,setCommunity:s,user:a,setIsCommunityBannerEditModalVisible:l}=e;const[p,b]=(0,i.useState)(null),[k,x]=(0,i.useState)(null===r||void 0===r?void 0:r.banner),[_,A]=(0,i.useState)(r&&r.bannerTitle),[C,S]=(0,i.useState)(!1),[j,E]=(0,i.useState)(null!==(t=r&&r.bannerDescription)&&void 0!==t?t:""),[N,P]=(0,i.useState)(null!==r&&void 0!==r&&r.expandPostDirectory?"list":"compact"),{analyticsService:D}=(0,d.W)(),[M,T]=(0,i.useState)(!1),I=!!l,O=(0,i.useRef)(null);let L=j.split("\n").length;L=L>3?L:3;const[R,B]=(0,i.useState)(!0),z=()=>{var e,t;I&&l(!1),b(null),A(null!==(e=r.bannerTitle)&&void 0!==e?e:""),E(null!==(t=r.bannerDescription)&&void 0!==t?t:"")};(0,i.useEffect)((()=>{var e,t;r&&(A(null!==(e=r.bannerTitle)&&void 0!==e?e:""),E(null!==(t=r.bannerDescription)&&void 0!==t?t:""))}),[r]);return r?(0,w.jsxs)("div",{className:"CommunityBannerSettingsComponent rounded-xl bg-card shadow",children:[(0,w.jsxs)("div",{className:"flex items-center justify-between rounded-2xl bg-card py-2 pl-4 pr-2",children:[(0,w.jsx)("span",{className:"flex flex-row items-center gap-0.5 font-bold text-secondary-foreground/85",children:(0,w.jsx)("span",{children:(0,w.jsx)(h.A,{children:"Community Banner"})})}),I?(0,w.jsx)(f.A,{icon:"cross",size:"md",onClick:()=>{l(!1)}}):(0,w.jsx)("div",{className:"h-10"})]}),(0,w.jsxs)("div",{className:"mx-4 mb-4 flex flex-col rounded-xl bg-background px-5 pb-8 pt-5",children:[(0,w.jsx)("div",{className:"banner-selector-holder overflow-scroll rounded",children:(0,w.jsx)("div",{className:o()("banner-selector cursor-pointer",{selected:k||r.banner,"items-center justify-center":!p&&!r.banner}),children:(0,w.jsxs)("div",{className:"flex w-full flex-col",children:[(0,w.jsx)(g.A,{picture:k,setPicture:x,setPictureSelected:e=>b(e),setIsPictureRemoved:S,aspectRatio:16/6,recommendedRatio:"16:6",cropRatioMessage:"Banner Ratio - 16:6",displayUnsplashSearch:!0}),(0,w.jsx)("div",{className:"mt-2 px-4 text-lg font-semibold",children:_||""}),(0,w.jsx)("div",{className:"px-4",children:(0,w.jsx)(v.F,{text:j})})]})})}),(0,w.jsx)("div",{className:"mt-4 font-semibold text-secondary-foreground/85",children:(0,w.jsx)(h.A,{children:"Banner Title"})}),(0,w.jsx)(u.ks,{placeholder:"Enter here",validator:e=>{},defaultValue:_,className:"bg-card pt-2 focus:outline-none",onChange:e=>{A(e)}}),(0,w.jsx)("div",{className:"text-xs font-light text-secondary-foreground/70",children:(0,w.jsx)(h.A,{children:"Suggestions: Welcome to my community etc"})}),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:"mt-4 font-semibold text-secondary-foreground/85",children:(0,w.jsx)(h.A,{children:"Banner Description"})}),(0,w.jsx)("textarea",{ref:O,value:j,onChange:e=>{E(e.target.value),window.setTimeout((()=>{e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"}),0)},className:"my-3 block w-full flex-grow rounded border border-border bg-card px-4 py-2 focus:outline-none",rows:L,placeholder:"Enter Banner Description"})]})]}),(0,w.jsx)("div",{className:o()("mx-4 flex gap-4",{"mb-4":I}),children:(0,w.jsx)(m.A,{selectorTypeLabel:"Homefeed Layout",selectedOption:N,setSelectedOption:P,options:[{id:"list",iconName:"menu-burger",selectorName:"List View",origin:"",tooltips:[]},{id:"compact",iconName:"list",selectorName:"Compact View",origin:"",tooltips:[]}]})}),(0,w.jsx)("div",{className:o()("px-4 py-3",{"border-t border-border":I}),children:(0,w.jsxs)("div",{className:o()("mx-auto flex items-center",{"justify-between":I,"justify-end":!I}),children:[I&&(0,w.jsx)(u.$n,{onClick:e=>{z()},flat:!0,className:"border-primary",label:"Cancel",large:!0}),(0,w.jsx)(u.$n,{disabled:!R,onClick:async e=>{T(!0),r.expandPostDirectory!==("list"===N)&&await async function(){y.BE.updateConfig(a,r.id,"expandPostDirectory","list"===N).then((e=>{let{community:t}=e;s(t),T(!1),D.track("default-expanded-post",{checkboxSelected:"expandPostDirectory"})})).catch((e=>{n("Failed to do so.","",c.lm.danger),T(!1)}))}(),y.BE.updateCommunityBannerDetails(r.id,_,j,a).then((e=>{let{community:t}=e;k&&"string"!==typeof k?y.BE.updateCommunityBanner(t.id,a,k).then((e=>{let{community:t}=e;n("Banner details updated!","Refresh if changes are not visible!"),z(),s(t),T(!1)})).catch((e=>{n("Banner details could not be updated!","",c.lm.danger),console.log("error occurred!",{error:e}),T(!1)})):C?y.BE.removeCommunityBanner(a,t.id).then((e=>{let{community:t}=e;n("Banner details updated!","Refresh if changes are not visible!"),z(),s(t),T(!1)})).catch((e=>{n("Banner details could not be updated!","",c.lm.danger),console.log("error occurred!",{error:e}),T(!1)})):(n("Banner details updated!","Refresh if changes are not visible!"),z(),T(!1),s(t)),D.track("community-banner-update",{...""!==t.bannerTitle&&{bannerTitle:t.bannerTitle},...""!==t.bannerDescription&&{bannerDescription:t.bannerDescription},...""!==t.banner&&{banner:t.banner}})})).catch((e=>{n("Banner details could not be updated!","",c.lm.danger),console.log("error occurred!",{error:e}),T(!1)}))},label:"Save",large:!0,isLoading:M})]})})]}):null}const A=(0,c.wj)((0,s.Ng)((e=>({user:e.auth,community:e.community,communityPac:e.communityPac,setCommunity:e.updateCommunity})),(e=>(0,a.zH)({setCommunity:k.Km},e)))((function(e){let{addToast:t,community:n,user:r,setCommunity:o}=e;return(0,w.jsx)(p.l,{layout:l.DQ.TWO_COLUMN,children:(0,w.jsx)(b.g,{className:"max-w-screen-md",children:(0,w.jsx)("div",{className:"CommunityBannerSettings mx-4 min-h-screen px-4 pt-4",children:(0,w.jsx)(_,{addToast:t,community:n,setCommunity:o,user:r})})})})})))},62731:(e,t,n)=>{"use strict";n.d(t,{s:()=>y,A:()=>k});var r=n(20975),o=n(89449),i=n(16478),s=n(65186),a=n(9175),l=n(51772),c=n(60553),d=n(43039),u=n(42414);const p=[{key:"basic",name:"Basic",rank:1,keys:{monthly:"basic",yearly:"basicAnnual"},pricing:{monthly:90,yearly:972},limits:{members:1e3,liveSession:10,sso:!1,apiAccess:!1,transactionFees:"7.5%"}},{key:"pro",name:"pro",rank:2,keys:{monthly:"pro",yearly:"proAnnual"},pricing:{monthly:200,yearly:2040},limits:{members:1e4,liveSession:10,sso:!0,apiAccess:!1,transactionFees:"3%"}},{key:"business",name:"Business",rank:3,keys:{monthly:"business",yearly:"businessAnnual"},pricing:{monthly:350,yearly:3360},limits:{members:25e3,liveSession:10,sso:!0,apiAccess:!0,transactionFees:"0%"}},{key:"enterprise",name:"Enterprise",tagline:"Self hosting, custom features development, with SDKs.",limits:{members:"Unlimited",liveSession:"Unlimited",sso:!0,apiAccess:"Custom API",transactionFees:"Custom Payment Gateway"}}];function h(e){if(e){return p.find((t=>{var n,r;return[t.key,null===(n=t.keys)||void 0===n?void 0:n.monthly,null===(r=t.keys)||void 0===r?void 0:r.yearly].includes(e)}))}}function m(e){const t=h(e);return null===t||void 0===t?void 0:t.name}function f(e){var t;const n=h(e);return(null===n||void 0===n||null===(t=n.keys)||void 0===t?void 0:t.monthly)===e?"monthly":"annually"}var g=n(62391);const b=e=>{let{label:t,values:n}=e;return(0,g.jsx)("div",{className:"mt-2.5 min-w-[1000px] border-b border-border",children:(0,g.jsxs)("div",{className:"flex justify-between",children:[(0,g.jsx)("div",{className:"font-bold min-w-36",children:t}),n.map(((e,t)=>(0,g.jsx)("div",{className:"text-left w-36",children:e},t)))]})})},v=()=>(0,g.jsx)("div",{className:"mt-5 w-full",children:[{label:"Members",key:"members"},{label:"Live Session",key:"liveSession"},{label:"Transaction Fees",key:"transactionFees"},{label:"SSO",key:"sso",formatter:e=>e?"\u2714\ufe0f":"-"},{label:"API Access",key:"apiAccess",formatter:e=>"string"===typeof e?e:e?"\u2714\ufe0f":"-"}].map((e=>{let{label:t,key:n,formatter:r}=e;return(0,g.jsx)(b,{label:t,values:p.map((e=>r?r(e.limits[n]):e.limits[n]))},n)}))}),y="/settings/subscription",k=()=>{var e,t;const{user:n,community:b}=(0,i.G)((e=>({user:e.auth,community:e.community}))),y=null===b||void 0===b?void 0:b.id,k=null===b||void 0===b?void 0:b.planType,{analyticsService:w}=(0,s.W)(),x=(0,i.j)(),{addToast:_}=(0,a.d)(),[A,C]=(0,r.useState)("monthly"),[S,j]=(0,r.useState)(""),[E,N]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[M,T]=(0,r.useState)(!1),[I,O]=(0,r.useState)();(0,r.useEffect)((()=>{if(y&&k){const e=h(k);O(e),C(f(k))}}),[y,k]);const L=e=>{var t,n,r,o;if(!b.planType||null!==b&&void 0!==b&&b.isPlanExpired)return"Select";if(!I||void 0===I.rank)return"Select";const i="annually"===f(null===b||void 0===b?void 0:b.planType),s="monthly"===f(null===b||void 0===b?void 0:b.planType),a=i?null===(t=I.pricing)||void 0===t?void 0:t.yearly:null===(n=I.pricing)||void 0===n?void 0:n.monthly,l=i?null===(r=e.pricing)||void 0===r?void 0:r.yearly:null===(o=e.pricing)||void 0===o?void 0:o.monthly;if(a&&l){if(al)return"Downgrade";if(a===l){if("monthly"===A&&s)return"Cancel";if("annually"===A&&s)return"Upgrade";if("annually"===A&&i)return"Cancel";if("monthly"===A&&i)return"Downgrade"}}};return(0,g.jsxs)("div",{className:"CommunitySubscriptionPage min-h-screen",children:[null!==(null===b||void 0===b?void 0:b.planType)&&(0,g.jsx)("div",{className:'lg:right-0" sticky top-[48px] z-[2] mb-4 flex w-full items-center border-b border-border bg-card px-5 py-3 md:h-16 lg:left-[300px] lg:w-auto',children:(0,g.jsx)("div",{className:"text-base font-semibold",children:"Billing"})}),(0,g.jsxs)("div",{className:"".concat(null===(null===b||void 0===b?void 0:b.planType)?"m-24":"m-5"," rounded-md bg-card p-5"),children:[(0,g.jsx)("div",{className:"text-base font-bold",children:"Your Plan"}),(null===b||void 0===b?void 0:b.planExpiryDate)&&(0,g.jsx)("div",{className:"mt-5 text-sm",children:null!==b&&void 0!==b&&b.isPlanExpired?(0,g.jsxs)("p",{className:"text-red-500",children:["Plan expired on"," ",new Date(null===b||void 0===b?void 0:b.planExpiryDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]}):(0,g.jsxs)("p",{children:["Your Plan will renew on"," ",(0,g.jsx)("span",{className:"font-bold",children:new Date(null===b||void 0===b?void 0:b.planExpiryDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})}),(0,g.jsx)("div",{className:"pb-10",children:null===(null===b||void 0===b?void 0:b.planType)?(0,g.jsxs)("div",{className:"flex flex-col",children:[(0,g.jsx)("p",{className:"my-2 font-bold",children:"Your free trial has ended"}),(0,g.jsxs)("p",{children:["To access ",b.name,", you'll have to upgrade your community to a paid Pensil plan.\xa0If you have any questions, please reach out to\xa0support@pensil.in or\xa0book a call\xa0with a member of our team today."]})]}):(0,g.jsxs)("div",{className:"mt-2.5 flex flex-col border-l-2 border-border pl-5",children:[(0,g.jsxs)("p",{children:["Your community is on"," ",(0,g.jsx)("span",{className:"font-bold",children:m(null===b||void 0===b?void 0:b.planType)})," ","plan, billed"," ",(0,g.jsx)("span",{className:"font-bold",children:f(null===b||void 0===b?void 0:b.planType)})," ","for"," ",(0,g.jsxs)("span",{className:"font-bold",children:["$","monthly"===f(null===b||void 0===b?void 0:b.planType)?null===I||void 0===I||null===(e=I.pricing)||void 0===e?void 0:e.monthly:null===I||void 0===I||null===(t=I.pricing)||void 0===t?void 0:t.yearly]})]}),(0,g.jsx)("span",{className:"text-bold cursor-pointer text-primary",onClick:()=>{D(!0)},children:"Cancel"})]})}),"enterprise"!==(null===I||void 0===I?void 0:I.key)&&(0,g.jsx)("div",{className:"border-t border-border pt-10",children:(0,g.jsxs)("div",{className:"flex w-full flex-col",children:[(0,g.jsxs)("div",{className:"flex",children:[(0,g.jsxs)("div",{className:"flex flex-col",children:[(0,g.jsx)("div",{className:"text-sm font-semibold",children:"Billing Cycle"}),(0,g.jsx)("div",{className:"mt-5 rounded bg-background p-1.5",children:(0,g.jsxs)("div",{className:"flex cursor-pointer gap-2",children:[(0,g.jsx)("div",{className:"rounded px-2.5 py-0.5 text-xs ".concat("monthly"===A&&"bg-primary text-primary-foreground"),onClick:()=>C("monthly"),children:"Monthly"}),(0,g.jsx)("div",{className:"rounded px-2.5 py-0.5 text-xs ".concat("annually"===A&&"bg-primary text-primary-foreground"),onClick:()=>C("annually"),children:"Annually"})]})})]}),(0,g.jsx)("div",{className:"flex w-full justify-around",children:p.map(((e,t)=>{var r;return(0,g.jsxs)("div",{className:"flex max-w-36 flex-col",children:[(0,g.jsx)("div",{className:"text-xs font-semibold",children:e.name}),(null===(r=e.pricing)||void 0===r?void 0:r.monthly)&&(0,g.jsxs)("div",{className:"my-5 flex flex-col",children:[(0,g.jsxs)("div",{className:"text-xl font-bold",children:["$","monthly"===A?e.pricing.monthly:e.pricing.yearly,(0,g.jsxs)("sup",{className:"font-semibold",children:["/","monthly"===A?"mo":"yr"]})]}),(0,g.jsx)("div",{className:"text-xxs font-semibold",children:"monthly"===A?"Billed monthly":"Billed annually"})]}),e.tagline&&(0,g.jsxs)("div",{className:"text-xxs my-5 font-semibold",children:[e.tagline," "]}),M?(0,g.jsx)("div",{className:"mt-3 flex items-center justify-start",children:(0,g.jsx)(l.aH,{})}):(0,g.jsx)(l.$n,{label:"Enterprise"===e.name?"Contact Us":L(e),outlined:"Enterprise"!==e.name&&"Cancel"===L(e),className:"min-w-36",onClick:()=>{(e=>{const t=L(e);if(console.log({buttonLabel:t,plan:e}),"enterprise"!==e.key){var r,i,s,a,l;if(w.track("start-".concat(e.key,"-pressed"),{},{operationType:t}),"Upgrade"===t||"Downgrade"===t)return N(!0),void j(null!==(r="monthly"===A?null===(i=e.keys)||void 0===i?void 0:i.monthly:null===(s=e.keys)||void 0===s?void 0:s.yearly)&&void 0!==r?r:"");"Cancel"!==t?"Select"===t&&(console.table({plan:e.key}),d.BE.getCheckoutURLForCommunityPlan(n,b.id,"monthly"===A?null===(a=e.keys)||void 0===a?void 0:a.monthly:null===(l=e.keys)||void 0===l?void 0:l.yearly,window.location.origin).then((e=>{let{redirectUrl:t}=e;window.location.href=t})).catch((e=>{console.log({err:e});let t="";e&&e.isAxiosError&&e.response&&e.response.data&&e.response.data.message&&(t=e.response.data.message),_(t||"Could not create checkout session!","Please try again after refreshing or contact pensil support!",o.lm.danger)})).finally((()=>{T(!1)}))):D(!0)}else window.location.href="https://pensil.in/contact"})(e)}})]},t)}))})]}),(0,g.jsx)(v,{})]})})]}),(0,g.jsx)(c.c,{active:P,setActive:D,onSubmit:e=>{T(!0),D(!1),d.BE.cancelCommunitySubscription(n,b.id).then((e=>{let{selectedType:t,planType:n,planExpiryDate:r,isPlanExpired:i,isPaidFor:s}=e;_("Subscription cancelled successfully!","",o.lm.success),x((0,u.Km)({...b,selectedType:t,planType:null,planExpiryDate:r,isPlanExpired:i,isPaidFor:s}))})).catch((e=>{console.log({err:e}),_("Could not cancel subscription!","Please try again after refreshing or contact pensil support!",o.lm.danger)})).finally((()=>{T(!1)}))},header:"Cancel Subscription",btnColor:"red",title:"Are you sure you want to cancel the subscription?",isLoading:void 0,children:void 0}),(0,g.jsx)(c.c,{active:E,setActive:N,onSubmit:e=>{N(!1),T(!0),d.BE.getCheckoutURLForCommunityPlan(n,b.id,S,window.location.origin).then((e=>{let{redirectUrl:t}=e;window.location.href=t})).catch((e=>{console.log({err:e});let t="";e&&e.isAxiosError&&e.response&&e.response.data&&e.response.data.message&&(t=e.response.data.message),_(t||"Could not create checkout session!","Please try again after refreshing or contact pensil support!",o.lm.danger)})).finally((()=>{T(!1)}))},header:"Change Plan to "+S,title:"Are you sure you want to change your plan?",isLoading:void 0,btnColor:void 0,children:void 0})]})}},97676:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NOTIFICATION_CENTRE_PAGE_ROUTE:()=>v,NotificationLevel:()=>y,default:()=>C});var r=n(20975),o=n(31305),i=n(89449),s=n(65186),a=n(51772),l=n(44139),c=n(41146),d=n(1334),u=n(93591),p=n(62144),h=n(73248),m=n(42414),f=n(92082),g=n(97843),b=n(62391);const v="/settings/notification",y=Object.freeze({ALL:"all",ADMIN:"admin",NONE:"none"});function k(e){let{community:t,user:n,preferences:o,setPreference:i,addToast:a,onNotificationCentreUpdate:d}=e;const{analyticsService:u}=(0,s.W)(),[p,m]=(0,r.useState)(),[f,g]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[x,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),[S,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{m(!0),o&&(m(!1),g(o.commentReaction),y(o.commentReply),w(o.directMessage),_(o.postComment),C(o.postLike),j(o.replyReaction),N(o.mention))}),[o]),(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("div",{className:"px-4 pb-2 pt-4 font-bold text-secondary-foreground",children:"Manage your personal account notification preferences"}),(0,b.jsx)("div",{className:"mx-2 rounded bg-background",children:(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"theme-bg-subtitle-2 theme-text-background h-8",children:[(0,b.jsx)("th",{className:"flex h-8 items-center px-4",children:"Preferences"}),(0,b.jsx)("th",{children:"Email notification"})]})}),(0,b.jsxs)("tbody",{children:[(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about comment on my posts"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:x,onClick:()=>{_(!x)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about replies on my comment"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:v,onClick:()=>{y(!v)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about upvote on my post"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:A,onClick:()=>{C(!A)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about reaction to my comment"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:f,onClick:()=>{g(!f)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about reaction on my reply"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:S,onClick:()=>{j(!S)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about direct message"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:k,onClick:()=>{w(!k)}})})]}),(0,b.jsxs)("tr",{className:"border-b border-border",children:[(0,b.jsx)("td",{className:"h-10 px-4",children:"Notify me about mentions"}),(0,b.jsx)("td",{className:"flex h-5 items-center justify-center",children:(0,b.jsx)(c.S,{className:"justify-self-center",selected:E,onClick:()=>{N(!E)}})})]})]})]})}),(0,b.jsx)("div",{className:"flex justify-end px-4 pt-4",children:(0,b.jsx)(l.$,{isLoading:p,label:"Save",className:"px-6",onClick:()=>{!function(){var e;m(!0);const r={commentReaction:f,commentReply:v,directMessage:k,postComment:x,postLike:A,replyReaction:S,mention:E},o=null!==(e=null===t||void 0===t?void 0:t.id)&&void 0!==e?e:"";h.W.updateNotificationPreference(o,n,r).then((e=>{i(e.preferences),d(e.preferences),m(!1),a("Notification preference updated successfully")})).catch((e=>{m(!1),a(e.message)})),u.track("notification-preference-updated")}()}})})]})}function w(e){let{community:t,groups:n,user:o,preferences:s,setPreference:a,addToast:c,onNotificationCentreUpdate:d}=e;const u=n.filter((e=>"joined"===e.joinStatus&&e.tabs&&e.tabs.some((e=>e.isJoined||!e.isClosed)))),[p,m]=(0,r.useState)([]),[f,g]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{s&&m(s.tabs)}),[s]),(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"theme px-4 pb-2 pt-6 font-bold",children:[(0,b.jsx)("div",{className:"text-secondary-foreground",children:"Notification for new posts"}),(0,b.jsx)("div",{className:"font-normal text-secondary-foreground/80",children:"Only groups and channel available which you are part of. You can also control notification"})]}),(0,b.jsxs)("div",{className:"mx-2",children:[(0,b.jsxs)("div",{className:"theme-bg-subtitle-2 theme-text-background grid grid-cols-5 gap-y-4 border border-border text-xs font-bold",children:[(0,b.jsx)("div",{className:"col-span-2 p-2",children:"Group & Channels"}),(0,b.jsx)("div",{className:"col-span-1 justify-self-center p-2",children:"All Activity"}),(0,b.jsx)("div",{className:"col-span-1 justify-self-center p-2",children:"Post by admin"}),(0,b.jsx)("div",{className:"col-span-1 justify-self-center p-2",children:"No Notification"})]}),u&&(0,b.jsx)(b.Fragment,{children:u.length>0?u.map(((e,t)=>(0,b.jsx)(x,{group:e,preferences:s,addToast:c,onGroupPreferencesChange:t=>{let n=[];p&&p.length>0&&(n=p.filter((t=>t.groupId!==e.id))),Array.isArray(t)&&t.length>0&&t.map((e=>n.push(e))),m(n)}},t))):(0,b.jsx)("div",{className:"mb-4 bg-background px-4 py-2 text-center text-secondary-foreground/70",children:"You haven't joined any group yet. Please join a group to enable notification."})})]}),u&&u.length>0&&(0,b.jsx)("div",{className:"flex justify-end px-4 py-4",children:(0,b.jsx)(l.$,{label:"Save",className:"px-6",onClick:()=>function(){g(!0);const e={...s,tabs:p};t&&t.id&&h.W.updateNotificationPreference(t.id,o,e).then((e=>{c("Notification preference updated successfully"),g(!1),d(e.preferences)})).catch((e=>{g(!1),c(e.message,"",i.lm.danger)}))}(),isLoading:f})})]})}function x(e){let{group:t,preferences:n,addToast:o,onGroupPreferencesChange:i}=e;const[s,a]=(0,r.useState)(!1),[l,u]=(0,r.useState)([]);if((0,r.useEffect)((()=>{if(g.A.hasValue(n)&&g.A.hasValue(null===n||void 0===n?void 0:n.tabs)){var e;const r=null===n||void 0===n?void 0:n.tabs.filter((e=>e.groupId===(null===t||void 0===t?void 0:t.id))),o=null===t||void 0===t||null===(e=t.tabs)||void 0===e?void 0:e.map((e=>{const t=null===r||void 0===r?void 0:r.find((t=>t.tabId===e.id));return t?{id:e.id,type:t.notificationLevel}:{id:e.id,type:y.ALL}}));u(o||[])}else if(n&&n.tabs&&0===n.tabs.length){var r;u((null===t||void 0===t||null===(r=t.tabs)||void 0===r?void 0:r.map((e=>({id:e.id,type:y.ALL}))))||[])}}),[n,t]),void 0===t||null===t)return null;if(!Array.isArray(t.tabs)||0===t.tabs.length)return null;const h=t.tabs.filter((e=>e.isJoined||!e.isClosed));if(h&&0===h.length)return(0,b.jsx)("div",{className:"my-1 border border-border bg-background p-1 text-sm text-secondary-foreground/70",children:(0,b.jsxs)("span",{children:["You are not part of any channel of",(0,b.jsxs)("span",{className:"text-bold text-secondary-foreground",children:["\xa0 ",t.name," \xa0"]}),"group"]})});function m(e,t){const n=e.id,r=t;return l.some((e=>e.id===n&&e.type===r))}return(0,b.jsxs)("div",{className:"my-1 border border-border",children:[(0,b.jsxs)("div",{className:"grid grid-cols-5 border-b border-t border-border bg-background px-4 py-2",children:[(0,b.jsx)("div",{className:"col-span-2 cursor-pointer font-bold text-secondary-foreground/85",onClick:()=>a(!s),children:t.name}),(0,b.jsx)(f,{type:y.ALL}),(0,b.jsx)(f,{type:y.ADMIN}),(0,b.jsxs)("div",{className:"flex w-full justify-end justify-self-center",children:[(0,b.jsx)(f,{type:y.NONE}),(0,b.jsx)("button",{className:"w-12",onClick:()=>a(!s),children:(0,b.jsx)(p.A,{icon:s?"angle-small-up":"angle-small-down",className:"h-4 text-secondary-foreground/80"})})]})]}),s&&h.map(((e,t)=>{var n;return(0,b.jsxs)("div",{className:"grid grid-cols-5 justify-items-center border-b border-border px-4 py-1",children:[(0,b.jsxs)("div",{className:"col-span-2 w-full text-secondary-foreground/80",children:[null!==(n=e.emoji)&&void 0!==n?n:"#","\xa0",e.name]}),(0,b.jsx)(v,{tab:e,type:y.ALL}),(0,b.jsx)(v,{tab:e,type:y.ADMIN}),(0,b.jsx)(v,{tab:e,type:y.NONE})]},t)}))]});function f(e){let{type:n}=e;const r=function(e){return(!h||!l||0!==l.length)&&l.length===h.length&&l.every((t=>t.type===e))}(n),o=function(e){return!(!h||l&&0===l.length)&&l.some((t=>t.type===e))}(n);return(0,b.jsx)(c.S,{className:"justify-self-center",selected:r,semiSelected:o,onClick:()=>{if(r)u([]),i([]);else{const e=h.map((e=>({id:e.id,type:n})));u(e),i(null===e||void 0===e?void 0:e.map((e=>({groupId:(null===t||void 0===t?void 0:t.id)||"",tabId:e.id,notificationLevel:e.type}))))}a(!0)}})}function v(e){let{tab:n,type:r}=e;return(0,b.jsx)(d.s,{className:"justify-self-center",selected:m(n,r),onClick:()=>{let e;const o={id:n.id,type:r};l.some((e=>e.id===n.id&&e.type!==r))?(e=l.filter((e=>e.id!==n.id)),e.push(o),u(e)):l.some((e=>e.id===n.id))?(e=l,u(e)):(e=[...l,o],u(e)),i(e.map((e=>({groupId:(null===t||void 0===t?void 0:t.id)||"",tabId:e.id,notificationLevel:e.type}))))},children:void 0})}}const _={onCommunityUpdate:m.Km,onNotificationCentreUpdate:f.zo},A=(0,o.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups,notificationCentre:e.notificationCentre})),_),C=(0,i.wj)(A((function(e){let{user:t,community:n,groups:o,notificationCentre:i,addToast:s,onNotificationCentreUpdate:l}=e;const[c,d]=(0,r.useState)(i.isLoading),[p,h]=(0,r.useState)(i.preferences);return(0,r.useEffect)((()=>{d(i.isLoading),h(i.preferences)}),[i,i.preferences]),(0,b.jsx)(u.g,{className:"min-h-screen max-w-screen-md",children:(0,b.jsxs)("div",{className:"CommunityThemeSelector Card mx-4 rounded bg-card text-secondary-foreground shadow",children:[(0,b.jsx)("div",{className:"flex items-center justify-between border-b border-border py-4 pl-4 pr-2",children:(0,b.jsx)("span",{className:"font-bold text-secondary-foreground",children:"Notification Centre"})}),!c&&o?(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)(k,{user:t,addToast:s,community:n,preferences:p,setPreference:h,onNotificationCentreUpdate:l}),(0,b.jsx)(w,{user:t,groups:o,addToast:s,community:n,preferences:p,setPreference:h,onNotificationCentreUpdate:l})]})}):(0,b.jsx)("div",{className:"h-96 p-12",children:(0,b.jsx)(a.aH,{})})]})})})))},7702:(e,t,n)=>{"use strict";n.r(t),n.d(t,{USER_PROFILE_UPDATE_PAGE_ROUTE:()=>d,default:()=>u});var r=n(31305),o=n(20975),i=n(89449),s=n(65186),a=n(93591),l=n(82256),c=n(62391);const d="/settings/profile";const u=(0,i.wj)((0,r.Ng)((e=>({user:e.auth,community:e.community})))((function(e){let{addToast:t,community:n,user:r}=e;const{analyticsService:i}=(0,s.W)();return(0,o.useEffect)((()=>{const e={};["instagramLink","linkedinLink","youtubeLink","twitterLink","facebookLink","pintrestLink","dribbbleLink","behanceLink","webLink"].forEach((t=>{if(r&&r[t]){const n=t.replace("Link","");e[n]=r[t]}}));const t={bio:null===r||void 0===r?void 0:r.bio,profilePic:null===r||void 0===r?void 0:r.picture,name:null===r||void 0===r?void 0:r.name,subTitle:null===r||void 0===r?void 0:r.shortBio,socialHandles:e};i.track("edit-profile",t)}),[i,r]),(0,c.jsx)(a.g,{className:"min-h-screen max-w-screen-md",children:(0,c.jsx)("div",{className:"UserProfileUpdatePage pensil-card mx-4 rounded bg-card text-secondary-foreground shadow",children:(0,c.jsx)("div",{className:"main-content",children:(0,c.jsx)(l.R,{isFullScreen:!1,community:n,addToast:t,visible:!0,setVisible:e=>{window.location.reload()}})})})})})))},4252:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COURSE_DETAIL_PAGE_ROUTE:()=>U,CourseJoinStatus:()=>H,CourseStateType:()=>G,default:()=>W,getCoursePageRoute:()=>V});var r=n(20975),o=n(31305),i=n(98020),s=n(47760),a=n(81896),l=n(9175),c=n(51772),d=n(60553),u=n(68466),p=n(53558),h=n(58157),m=n(25715),f=n(93591),g=n(86129),b=n(61649),v=n(77826),y=n(62144),k=n(62391);const w=e=>{let{items:t}=e;return(0,k.jsx)("div",{className:"Breadcrumb",children:(0,k.jsx)("div",{className:"flex items-center font-medium",children:(0,k.jsx)("ul",{style:{padding:"0"},className:"flex items-center font-medium",children:t.map(((e,n)=>(0,k.jsxs)("li",{className:"flex items-center font-medium",children:[(0,k.jsx)(v.N_,{to:e.link,className:"text-primary hover:underline",children:e.label}),n===t.length-1?(0,k.jsx)(k.Fragment,{}):(0,k.jsx)(y.A,{icon:"angle-right",size:"xs",className:"px-2 pt-1"})]},n)))})})})};var x=n(43039),_=n(36357),A=n(89431),C=n(10701),S=n(93274),j=n(84003),E=n(15902),N=n(21784);function P(e){let{community:t,hasWritePermission:n,course:o,setCourse:i}=e;const[s,a]=r.useState(!1);return n||o.state!==G["closed-free"]||o.joinStatus===H.joined?(0,k.jsx)("div",{className:"mb-20 flex flex-col space-y-2 px-2 sm:px-0",children:(0,k.jsxs)("div",{className:"flex flex-col space-y-4 pt-3",children:[n&&(0,k.jsx)("div",{className:"flex",children:(0,k.jsx)(g.A,{title:"Add new section",className:"w-full sm:w-2/3 md:w-2/4 lg:w-1/3",visible:s,setVisible:a,button:(0,k.jsx)(h.A,{label:"Add content",className:"outline outline-1",onClick:()=>a(!0)}),children:(0,k.jsx)(E.A,{community:t,course:o,setCourse:e=>{i(e),a(!1)},setVisible:a,onCourseUpdated:e=>{i(e),a(!1)}})})}),(0,k.jsx)(j.u,{items:o.sections,noItemsElement:n?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(b.A,{className:"bg-card",warning:!0,title:"No content added to this course",message:"Add content to this course by clicking on the button above"})}):(0,k.jsx)("div",{className:"flex flex-col gap-2",children:(0,k.jsx)(b.A,{className:"bg-card",info:!0,title:"No content available",message:"Content will be available once the course starts"})}),renderItem:(e,r)=>(0,k.jsx)(N.A,{course:o,setCourse:i,onSectionUpdate:e=>{const t=o.sections;t[r]=e,i({...o,sections:t})},onSectionDelete:e=>{const t=o.sections.filter((t=>t.id!==e.id));i({...o,sections:t})},onLessonDelete:e=>{const t=o.sections;t[r].lessons=t[r].lessons.filter((t=>t.id!==e.id)),i({...o,sections:t})},onLessonAdded:e=>{var t;const n=o.sections,s=null!==(t=n[r].lessons)&&void 0!==t?t:[];s.push(e),n[r].lessons=s,i({...o,sections:n})},section:e,community:t,hasWritePermission:n,className:"border border-border bg-primary-light"},e.id)})]})}):(0,k.jsx)("div",{className:"pt-4",children:(0,k.jsx)(b.A,{warning:!0,className:"bg-card",title:"You have not enrolled in this course.",message:"Course content will be automatically unlocked once you enrolled in\r the course"})})}var D=n(55049),M=n(8934),T=n(799);function I(e){let{community:t,isLoading:n,course:r,members:o,totalMembers:i,setMembers:s=(e=>{}),currentMemberPage:a,setCurrentMemberPage:l}=e;return r.state==G.draft?(0,k.jsx)("div",{className:"mt-4",children:(0,k.jsx)(b.A,{className:"mt-4 bg-card",warning:!0,title:"Course is in draft.",message:"Members will be able to join once the course is published."})}):(0,k.jsx)("div",{className:"MembersBody mt-4 flex flex-col rounded bg-card px-4 pb-4",children:(0,k.jsx)("div",{className:"flex flex-col space-y-4 divide-y divide-[var(--theme-border-color)]",children:(0,k.jsxs)("div",{className:"mt-2 overflow-x-auto",children:[(0,k.jsxs)("table",{className:"w-full whitespace-nowrap",children:[(0,k.jsx)("thead",{children:(0,k.jsxs)("tr",{className:"text-sm font-semibold leading-none",children:[(0,k.jsx)("th",{className:"px-1 py-3 text-left",children:"Name"}),(0,k.jsx)("th",{className:"px-1 py-3 text-left",children:"Status"}),(0,k.jsx)("th",{className:"px-1 text-left"})]})}),(0,k.jsx)("tbody",{children:(0,k.jsx)(j.B,{items:o,renderItem:(e,n)=>(0,k.jsx)(O,{communityId:t.id,courseId:r.id,member:e,index:n,setMember:e=>{let t=o.map((t=>t.id===e.id?e:t));s(t)},onMemberRemove:e=>{let t=o.filter((t=>t.id!==e.id));s(t)}}),isLoading:n,placeholder:(0,k.jsx)("tr",{children:(0,k.jsx)("td",{className:"px-4 pt-6 text-center",colSpan:3,children:"No Member joined this course"})}),noItemsElement:(0,k.jsx)("tr",{children:(0,k.jsx)("td",{className:"px-4 pt-6 text-center",colSpan:3,children:"No Member joined this course"})})})})]}),(0,k.jsx)(T.A,{className:"pagination-bar justify-center",currentPage:a,totalCount:i,pageSize:10,onPageChange:e=>{l(e)}})]})})})}function O(e){let{communityId:t,courseId:n,member:o,setMember:i,onMemberRemove:s=(()=>{})}=e;const[a,d]=(0,r.useState)(!1),{addToast:u,ToastTypes:p}=(0,l.d)(),{profileModelState:{setShowProfileModel:h,setIdToViewProfile:f}}=(0,D.A)();function g(){d(!0),x.fk.removeMember(t,n,o.id).then((e=>{let{member:t}=e;u("Success","Member removed",p.success),s(t)})).catch((e=>{let{response:t}=e;console.error("Error removing member",t.data),u("Error","Error removing member",p.danger)})).finally((()=>{d(!1)}))}return(0,k.jsxs)("tr",{className:"",children:[(0,k.jsxs)("td",{className:"mb-2 flex items-center py-2",children:[(0,k.jsx)("div",{className:"flex items-center justify-center",children:(0,k.jsx)(M.eu,{className:"cursor-pointer",user:o,noName:!0,onClick:e=>{f(o.id),h(!0)},extraInfo:void 0})}),(0,k.jsx)("div",{className:"flex items-center",children:(0,k.jsxs)("div",{className:"",children:[(0,k.jsx)("div",{className:"text-sm font-medium text-secondary-foreground",children:o.name}),(0,k.jsx)("div",{className:"text-xs text-secondary-foreground/80",children:o.email&&o.mobile?(0,k.jsxs)("span",{children:[" ",o.email,"\xa0 | \xa0 ",o.countryCode," \xa0",o.mobile," "]}):o.email?(0,k.jsx)("span",{children:o.email}):o.mobile?(0,k.jsxs)("span",{children:[o.countryCode,"\xa0",o.mobile]}):(0,k.jsx)(k.Fragment,{})})]})})]}),(0,k.jsx)("td",{children:(0,k.jsx)("div",{className:"px-1 text-sm text-secondary-foreground",children:"requested"===o.courseStatus?"Requested":"Joined"})}),(0,k.jsx)("td",{children:"requested"===o.courseStatus?(0,k.jsx)(k.Fragment,{children:a?(0,k.jsx)(c.aH,{}):(0,k.jsx)("div",{className:"flex w-full place-content-end",children:(0,k.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,k.jsx)("div",{className:"flex h-5 w-5 cursor-pointer place-content-center items-center rounded bg-red-500 hover:scale-125 hover:shadow-lg",onClick:g,children:(0,k.jsx)(y.A,{icon:"cross",size:"xxs",className:"text-white"})}),(0,k.jsx)("div",{className:"flex h-5 w-5 cursor-pointer place-content-center items-center rounded bg-green-500 hover:scale-125 hover:shadow-lg",onClick:function(){d(!0),x.fk.addMember(t,n,o.id).then((e=>{let{member:t}=e;u("Success","Member accepted",p.success),i(t)})).catch((e=>{let{response:t}=e;console.error("Error accepting member",t.data),u("Error","Error accepting member",p.danger)})).finally((()=>{d(!1)}))},children:(0,k.jsx)(y.A,{icon:"check",size:"xxs",className:"text-white"})})]})})}):(0,k.jsx)(k.Fragment,{children:a?(0,k.jsx)(c.aH,{}):(0,k.jsx)(m.A,{actions:[{label:"Remove",onClick:()=>{g()}}]})})})]})}var L=n(5564),R=n.n(L),B=n(65186),z=n(1334);function F(e){let{community:t,course:n,setCourse:o}=e;const i={[G.draft]:"Draft",[G.published]:"Open",[G["closed-free"]]:"Closed"},[s,a]=(0,r.useState)(n.state?G[n.state]:G.draft),[d,u]=(0,r.useState)(!1),[p,h]=(0,r.useState)(n.visibleToNonMembers),{addToast:m,ToastTypes:f}=(0,l.d)(),g=n.state===G.draft,{analyticsService:v}=(0,B.W)();return(0,k.jsxs)("div",{className:"mt-4 flex flex-col space-y-4",children:[(0,k.jsx)(_.av,{value:g,ifPresent:()=>(0,k.jsx)(b.A,{className:"mt-4 bg-card",warning:!0,title:"Course is in draft. Only you can see it",message:"Select access level setting and publish the course to make it live"})}),(0,k.jsx)("div",{className:"mt-2 flex flex-col space-y-4 rounded bg-card p-4",children:(0,k.jsxs)("div",{className:"Access flex flex-col space-y-2",children:[(0,k.jsxs)("div",{className:"flex place-content-between",children:[(0,k.jsx)("h2",{className:"font-semibold text-secondary-foreground",children:"Access"}),(0,k.jsx)(c.$n,{label:g?"Publish":"Save",disabled:![G["closed-free"],G.published].includes(s),onClick:()=>{v.track("course-published",{isInDraft:g,courseState:i[s]}),function(){const e={...n,visibleToNonMembers:p,state:s};u(!0),x.fk.createCourse(t.id,e,n.id).then((e=>{let{course:t}=e;o(t),m("Success","Course settings updated",f.success)})).catch((e=>{console.error(e),m("Error","Unable to update course settings",f.danger)})).finally((()=>{u(!1)}))}()},isLoading:d})]}),[G.published,G["closed-free"]].map(((e,t)=>(0,k.jsxs)("div",{onClick:()=>a(e),className:R()("mb-2 flex flex-col space-y-2 rounded border p-2","hover:border-primary-light hover:bg-primary-light",{"border-primary":i[s]===e,"border-border":i[s]!==e}),children:[(0,k.jsx)(z.s,{selected:G[s]===e,onClick:()=>{a(e)},children:(0,k.jsx)("p",{className:"font-bold",children:i[e]})}),(0,k.jsxs)("p",{className:"ml-6",children:[e===G.published&&"Anyone can see and enroll into this course",e===G["closed-free"]&&"Either the user can request to enroll in this course OR the user will have to make a payment to subscribe to this course via membership"]})]},t)))]})})]})}const U="/course/:id";function V(e){return"/course/".concat(e)}const G=Object.freeze({draft:"draft",published:"published","closed-free":"closed-free"}),H=Object.freeze({"not-joined":"not-joined",requested:"requested",joined:"joined"});const W=(0,o.Ng)((e=>({user:e.auth,community:e.community,mySubscription:e.mySubscription,subscriptionsPlan:e.subscriptionsPlan,socket:e.socket})))((function(e){var t,n;let{user:o,community:v,subscriptionsPlan:y,mySubscription:j,socket:E}=e;const N=(0,i.g)(),D=(null===N||void 0===N?void 0:N.id)||"",M=null===v||void 0===v?void 0:v.id,[T,O]=(0,r.useState)(),[L,R]=(0,r.useState)(!1),[B,z]=(0,r.useState)(!1),[U,V]=r.useState(!1),[W,q]=r.useState(!1),[K,Y]=r.useState(!1),[$,Q]=(0,r.useState)(null),[Z,J]=(0,r.useState)(),[X,ee]=(0,r.useState)(!1),[te,ne]=(0,r.useState)(!1),[re,oe]=(0,r.useState)([]),[ie,se]=(0,r.useState)(1),[ae,le]=(0,r.useState)(0),[ce,de]=(0,r.useState)(!1),{cache:ue,saveCache:pe}=(0,a.A)({}),{addToast:he,ToastTypes:me}=(0,l.d)(),{setBaseLayout:fe}=(0,r.useContext)(s.h6);fe();const ge=Object.freeze({Lesson:"Lesson",Settings:"Settings",Members:"Members"}),[be,ve]=(0,r.useState)(ge.Lesson),ye=(0,r.useMemo)((()=>A.F.filterSubscriptionsForCourse(D,y)),[y,D]),ke=A.F.hasPaidSubscription(ye),we=A.F.isSubscriptionPurchasedByCourse(j,D);return(0,r.useEffect)((()=>{M&&D&&(R(!0),x.fk.getCourseDetails(M,D).then((e=>{let{course:t,isAdmin:n}=e;O(t),J(t.joinStatus),z(n)})).catch((e=>{let{response:t}=e;console.error(t.data.errors),Q(t.data.errors),he("Error","Unable to get course",me.danger)})).finally((()=>{R(!1)})))}),[M,D]),(0,r.useEffect)((()=>{!M||!D||(null===T||void 0===T?void 0:T.state)===G.draft||be!==ge.Members||(ue["course-members-".concat(D).concat(ie)]?oe(ue["course-members-".concat(D).concat(ie)]):(ne(!0),x.fk.getCourseMembers(v.id,D,ie,10).then((e=>{let{members:t,total:n}=e;pe("course-members-".concat(D).concat(ie),t),oe(t),le(n)})).catch((e=>{let{response:t}=e;console.error(t.data.errors),he("Error","Unable to get course members",me.danger)})).finally((()=>{ne(!1)}))))}),[T,M,D,ie,be]),L?(0,k.jsx)("div",{className:"m-3 flex justify-center",children:(0,k.jsx)(c.aH,{})}):T&&0!==Object.keys(T).length?$?(0,k.jsx)("div",{className:"m-3 flex justify-center",children:"Unable to fetch course details"}):(0,k.jsxs)("div",{className:"CourseDetailPage mb-20 flex h-full min-h-screen flex-col gap-2 px-2 sm:px-0",children:[(0,k.jsx)("div",{className:"flex-none",children:(0,k.jsx)(w,{items:[{label:"Course",link:"/course"},{label:(null===T||void 0===T||null===(t=T.meta)||void 0===t?void 0:t.slug)||D,link:(null===T||void 0===T||null===(n=T.meta)||void 0===n?void 0:n.slug)||D}]})}),(0,k.jsxs)("div",{className:"flex flex-none flex-col rounded bg-card shadow",children:[(0,k.jsx)(_.av,{value:T.banner,ifPresent:e=>(0,k.jsx)("div",{children:(0,k.jsx)("div",{className:"bg-primary object-cover",style:{backgroundColor:"var(--theme-primary-light-color)",aspectRatio:"16/6"},children:(0,k.jsx)("img",{src:e,className:"rounded-t",alt:"banner"})})})}),(0,k.jsxs)("div",{className:"flex items-center justify-between pl-4 pr-2",children:[(0,k.jsx)("div",{className:"flex items-center space-x-4 py-2 font-bold text-secondary-foreground/85",children:T.title}),B?(0,k.jsx)(m.A,{actions:[{icon:"edit",onClick:()=>V(!0),label:"Edit",actionType:m.X.default},{icon:"trash",onClick:()=>q(!0),label:"Delete",actionType:m.X.alert}]}):(0,k.jsx)(k.Fragment,{children:Z===H["not-joined"]?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(h.A,{className:"my-3 outline outline-1",label:T.state===G["closed-free"]?we?"Send Request to enroll":ke?"Buy Now":"Send Request to enroll":"Enroll Now",onClick:()=>{ke&&!we?de(!0):T?(ee(!0),x.fk.joinCourse(v.id,T.id).then((()=>{T.state===G["closed-free"]?(he("Success","Course join requested sent successfully",me.success),J(H.requested)):(he("Success","Course joined successfully",me.success),J(H.joined))})).catch((e=>{console.error(e),he("Error","Unable to join course",me.danger)})).finally((()=>{ee(!1)}))):console.error("Course not found")},isLoading:X})}):Z===H.requested?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(h.A,{className:"my-3 outline-1",label:"Request Sent",disabled:!0})}):Z===H.joined&&(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(h.A,{className:"my-3 cursor-not-allowed",label:"Enrolled",onClick:()=>{}})})})]}),(0,k.jsx)(_.av,{value:B,ifPresent:e=>(0,k.jsx)("div",{className:"flex justify-start",children:(0,k.jsx)(p.s,{selectedTab:be,setSelectedTab:ve,tabs:[{label:ge.Lesson,key:ge.Lesson},{label:ge.Settings,key:ge.Settings},{label:ge.Members,key:ge.Members}]})})})]}),(0,k.jsx)(f.g,{className:"max-w-4xl",children:(0,k.jsx)(u.G,{selectedTab:be,components:{[ge.Lesson]:(0,k.jsx)(P,{community:v,course:T,setCourse:O,hasWritePermission:B}),[ge.Settings]:(0,k.jsx)(F,{community:v,course:T,setCourse:O}),[ge.Members]:(0,k.jsx)(I,{community:v,course:T,members:re,setMembers:e=>{pe("course-members-".concat(D).concat(ie),e),oe(e)},isLoading:te,currentMemberPage:ie,totalMembers:ae,setCurrentMemberPage:se})}})}),B&&(0,k.jsx)(g.A,{title:"Edit Course",className:"w-full sm:w-2/3 md:w-2/4 lg:w-1/3",visible:U,setVisible:V,children:(0,k.jsx)(S.A,{course:T,community:v,setVisible:V,onCourseUpdated:e=>{O(e),V(!1)}})}),(0,k.jsx)(d.c,{header:"Are you sure you want to delete?",title:"Note: All the course content and student progress will be lost.",onSubmit:()=>{T?(Y(!0),x.fk.deleteCourse(v.id,T.id).then((()=>{he("Success","Course deleted successfully",me.success),O(void 0),Y(!1)})).catch((e=>{console.error(e),he("Error","Unable to delete course",me.danger)})).finally((()=>{Y(!1)}))):console.error("Course not found")},isLoading:K,active:W,setActive:q,btnColor:void 0,children:void 0}),(0,k.jsx)(C.U,{community:v,user:o,plans:ye,header:"Buy Course",setActive:de,active:ce,mySubscription:j,socket:E})]}):(0,k.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,k.jsx)(w,{items:[{label:"Course",link:"/course"},{label:(null===T||void 0===T||null===(xe=T.meta)||void 0===xe?void 0:xe.slug)||D,link:(null===T||void 0===T||null===(_e=T.meta)||void 0===_e?void 0:_e.slug)||D}]}),(0,k.jsx)(b.A,{className:"mt-4 bg-card",error:!0,title:"Course not found",message:"The course you are looking for does not exist."})]});var xe,_e}))},10701:(e,t,n)=>{"use strict";n.d(t,{U:()=>R});var r=n(20975);const o=JSON.parse('{"nm":"AppCheck-Blue","ddd":0,"h":1080,"w":1080,"meta":{"g":"LottieFiles AE "},"layers":[{"ty":4,"nm":"Output lines","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[54.142,13.5,0],"ix":1},"s":{"a":0,"k":[692.288,1266.667,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[233.968,602.25,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[{"ty":0,"mn":"ADBE Fill","nm":"Fill","ix":1,"en":1,"ef":[{"ty":10,"mn":"ADBE Fill-0001","nm":"Fill Mask","ix":1,"v":{"a":0,"k":0,"ix":1}},{"ty":7,"mn":"ADBE Fill-0007","nm":"All Masks","ix":2,"v":{"a":0,"k":0,"ix":2}},{"ty":2,"mn":"ADBE Fill-0002","nm":"Color","ix":3,"v":{"a":0,"k":[0,0.3137,0.7294],"ix":3}},{"ty":7,"mn":"ADBE Fill-0006","nm":"Invert","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":0,"mn":"ADBE Fill-0003","nm":"Horizontal Feather","ix":5,"v":{"a":0,"k":0,"ix":5}},{"ty":0,"mn":"ADBE Fill-0004","nm":"Vertical Feather","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"mn":"ADBE Fill-0005","nm":"Opacity","ix":7,"v":{"a":0,"k":1,"ix":7}}]}],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Line","ix":1,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 28","ix":1,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 5","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[63.621,14.5],[48.454,14.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":10,"ix":1}},{"nm":"gap","n":"g","v":{"a":0,"k":5,"ix":2}},{"nm":"offset","n":"o","v":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[-45],"t":150}],"ix":7}}],"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 6","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[46.454,14.5],[45.454,14.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[50.954,14.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50.954,14.5],"t":0,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[48.954,14.5],"t":37.5,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50.954,14.5],"t":75,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[48.954,14.5],"t":112.5,"ti":[0,0],"to":[0,0]},{"s":[50.954,14.5],"t":150}],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 29","ix":2,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 7","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[44.662,12.5],[60.454,12.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":15,"ix":1}},{"nm":"gap","n":"g","v":{"a":0,"k":8,"ix":2}},{"nm":"offset","n":"o","v":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[-46],"t":0},{"s":[0],"t":150}],"ix":7}}],"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 8","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[62.454,12.5],[63.454,12.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[57.954,12.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[57.954,12.5],"t":0,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[60.954,12.5],"t":37.5,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[57.954,12.5],"t":75,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[60.954,12.5],"t":112.5,"ti":[0,0],"to":[0,0]},{"s":[57.954,12.5],"t":150}],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[54.454,13.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[54.454,13.5],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"InputLine ","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[54.142,13.5,0],"ix":1},"s":{"a":0,"k":[692.288,1266.667,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[848.968,431.25,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[{"ty":0,"mn":"ADBE Fill","nm":"Fill","ix":1,"en":1,"ef":[{"ty":10,"mn":"ADBE Fill-0001","nm":"Fill Mask","ix":1,"v":{"a":0,"k":0,"ix":1}},{"ty":7,"mn":"ADBE Fill-0007","nm":"All Masks","ix":2,"v":{"a":0,"k":0,"ix":2}},{"ty":2,"mn":"ADBE Fill-0002","nm":"Color","ix":3,"v":{"a":0,"k":[0,0.3137,0.7294],"ix":3}},{"ty":7,"mn":"ADBE Fill-0006","nm":"Invert","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":0,"mn":"ADBE Fill-0003","nm":"Horizontal Feather","ix":5,"v":{"a":0,"k":0,"ix":5}},{"ty":0,"mn":"ADBE Fill-0004","nm":"Vertical Feather","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"mn":"ADBE Fill-0005","nm":"Opacity","ix":7,"v":{"a":0,"k":1,"ix":7}}]}],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Line","ix":1,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 28","ix":1,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 5","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[63.621,14.5],[48.454,14.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":10,"ix":1}},{"nm":"gap","n":"g","v":{"a":0,"k":5,"ix":2}},{"nm":"offset","n":"o","v":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[-45],"t":150}],"ix":7}}],"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 6","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[46.454,14.5],[45.454,14.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[50.954,14.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50.954,14.5],"t":0,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[48.954,14.5],"t":37.5,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50.954,14.5],"t":75,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[48.954,14.5],"t":112.5,"ti":[0,0],"to":[0,0]},{"s":[50.954,14.5],"t":150}],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 29","ix":2,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 7","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[44.662,12.5],[60.454,12.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":15,"ix":1}},{"nm":"gap","n":"g","v":{"a":0,"k":8,"ix":2}},{"nm":"offset","n":"o","v":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[-46],"t":150}],"ix":7}}],"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 8","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[62.454,12.5],[63.454,12.5]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"c":{"a":0,"k":[0.149,0.1961,0.2196],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[57.954,12.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[57.954,12.5],"t":0,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[60.954,12.5],"t":37.5,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[57.954,12.5],"t":75,"ti":[0,0],"to":[0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[60.954,12.5],"t":112.5,"ti":[0,0],"to":[0,0]},{"s":[57.954,12.5],"t":150}],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[54.454,13.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[54.454,13.5],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Line Blue 2","sr":1,"st":93,"op":243,"ip":93,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,540,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[{"ty":0,"mn":"ADBE Fill","nm":"Fill","ix":1,"en":1,"ef":[{"ty":10,"mn":"ADBE Fill-0001","nm":"Fill Mask","ix":1,"v":{"a":0,"k":0,"ix":1}},{"ty":7,"mn":"ADBE Fill-0007","nm":"All Masks","ix":2,"v":{"a":0,"k":0,"ix":2}},{"ty":2,"mn":"ADBE Fill-0002","nm":"Color","ix":3,"v":{"a":0,"k":[0,0.3137,0.7294],"ix":3}},{"ty":7,"mn":"ADBE Fill-0006","nm":"Invert","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":0,"mn":"ADBE Fill-0003","nm":"Horizontal Feather","ix":5,"v":{"a":0,"k":0,"ix":5}},{"ty":0,"mn":"ADBE Fill-0004","nm":"Vertical Feather","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"mn":"ADBE Fill-0005","nm":"Opacity","ix":7,"v":{"a":0,"k":1,"ix":7}}]}],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[5.107,0],[4.659,2.087],[52.729,38.17],[18.732,23.903],[0,33.543],[0,0],[-15.346,4.603],[0,0],[-3.507,0],[-3.359,-1.009],[0,0],[0.002,-16.024],[0,0],[25.908,-33.062],[31.873,-23.072],[2.184,-0.976]],"o":[[-5.103,0],[-2.173,-0.972],[-31.874,-23.071],[-25.907,-33.063],[0,0],[0,-16.022],[0,0],[3.357,-1.008],[3.509,0],[0,0],[15.346,4.602],[0,0],[0,33.544],[-18.731,23.903],[-52.731,38.171],[-4.641,2.081]],"v":[[0.001,277],[-14.71,273.855],[-121.524,211.338],[-197.789,140.544],[-236.832,40.166],[-236.832,-180.75],[-211.175,-215.232],[-10.342,-275.481],[0.003,-277],[10.353,-275.479],[211.178,-215.231],[236.832,-180.747],[236.832,40.166],[197.788,140.544],[121.526,211.338],[14.701,273.86]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":0,"ix":1}}],"c":{"a":0,"k":[0.5412,0.702,0.0353],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim In Out Path","ix":2,"e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.5,"y":1},"s":[0],"t":93},{"s":[100],"t":150}],"ix":2},"o":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":93},{"s":[180],"t":150}],"ix":3},"s":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":121.5},{"s":[100],"t":150}],"ix":1},"m":1}],"ind":3},{"ty":4,"nm":"Line Green","sr":1,"st":46,"op":121,"ip":46,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,540,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[{"ty":0,"mn":"ADBE Fill","nm":"Fill","ix":1,"en":1,"ef":[{"ty":10,"mn":"ADBE Fill-0001","nm":"Fill Mask","ix":1,"v":{"a":0,"k":0,"ix":1}},{"ty":7,"mn":"ADBE Fill-0007","nm":"All Masks","ix":2,"v":{"a":0,"k":0,"ix":2}},{"ty":2,"mn":"ADBE Fill-0002","nm":"Color","ix":3,"v":{"a":0,"k":[0,0.3137,0.7294],"ix":3}},{"ty":7,"mn":"ADBE Fill-0006","nm":"Invert","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":0,"mn":"ADBE Fill-0003","nm":"Horizontal Feather","ix":5,"v":{"a":0,"k":0,"ix":5}},{"ty":0,"mn":"ADBE Fill-0004","nm":"Vertical Feather","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"mn":"ADBE Fill-0005","nm":"Opacity","ix":7,"v":{"a":0,"k":1,"ix":7}}]}],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[5.107,0],[4.659,2.087],[52.729,38.17],[18.732,23.903],[0,33.543],[0,0],[-15.346,4.603],[0,0],[-3.507,0],[-3.359,-1.009],[0,0],[0.002,-16.024],[0,0],[25.908,-33.062],[31.873,-23.072],[2.184,-0.976]],"o":[[-5.103,0],[-2.173,-0.972],[-31.874,-23.071],[-25.907,-33.063],[0,0],[0,-16.022],[0,0],[3.357,-1.008],[3.509,0],[0,0],[15.346,4.602],[0,0],[0,33.544],[-18.731,23.903],[-52.731,38.171],[-4.641,2.081]],"v":[[0.001,277],[-14.71,273.855],[-121.524,211.338],[-197.789,140.544],[-236.832,40.166],[-236.832,-180.75],[-211.175,-215.232],[-10.342,-275.481],[0.003,-277],[10.353,-275.479],[211.178,-215.231],[236.832,-180.747],[236.832,40.166],[197.788,140.544],[121.526,211.338],[14.701,273.86]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":0,"ix":1}}],"c":{"a":0,"k":[0.5412,0.702,0.0353],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim In Out Path","ix":2,"e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.5,"y":1},"s":[0],"t":46},{"s":[100],"t":94}],"ix":2},"o":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":46},{"s":[180],"t":94}],"ix":3},"s":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":72},{"s":[100],"t":94}],"ix":1},"m":1}],"ind":4},{"ty":4,"nm":"Line Blue","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,540,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[{"ty":0,"mn":"ADBE Fill","nm":"Fill","ix":1,"en":1,"ef":[{"ty":10,"mn":"ADBE Fill-0001","nm":"Fill Mask","ix":1,"v":{"a":0,"k":0,"ix":1}},{"ty":7,"mn":"ADBE Fill-0007","nm":"All Masks","ix":2,"v":{"a":0,"k":0,"ix":2}},{"ty":2,"mn":"ADBE Fill-0002","nm":"Color","ix":3,"v":{"a":0,"k":[0,0.3137,0.7294],"ix":3}},{"ty":7,"mn":"ADBE Fill-0006","nm":"Invert","ix":4,"v":{"a":0,"k":0,"ix":4}},{"ty":0,"mn":"ADBE Fill-0003","nm":"Horizontal Feather","ix":5,"v":{"a":0,"k":0,"ix":5}},{"ty":0,"mn":"ADBE Fill-0004","nm":"Vertical Feather","ix":6,"v":{"a":0,"k":0,"ix":6}},{"ty":0,"mn":"ADBE Fill-0005","nm":"Opacity","ix":7,"v":{"a":0,"k":1,"ix":7}}]}],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[5.107,0],[4.659,2.087],[52.729,38.17],[18.732,23.903],[0,33.543],[0,0],[-15.346,4.603],[0,0],[-3.507,0],[-3.359,-1.009],[0,0],[0.002,-16.024],[0,0],[25.908,-33.062],[31.873,-23.072],[2.184,-0.976]],"o":[[-5.103,0],[-2.173,-0.972],[-31.874,-23.071],[-25.907,-33.063],[0,0],[0,-16.022],[0,0],[3.357,-1.008],[3.509,0],[0,0],[15.346,4.602],[0,0],[0,33.544],[-18.731,23.903],[-52.731,38.171],[-4.641,2.081]],"v":[[0.001,277],[-14.71,273.855],[-121.524,211.338],[-197.789,140.544],[-236.832,40.166],[-236.832,-180.75],[-211.175,-215.232],[-10.342,-275.481],[0.003,-277],[10.353,-275.479],[211.178,-215.231],[236.832,-180.747],[236.832,40.166],[197.788,140.544],[121.526,211.338],[14.701,273.86]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":2,"ml":1,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13,"ix":5},"d":[{"nm":"dash","n":"d","v":{"a":0,"k":0,"ix":1}}],"c":{"a":0,"k":[0.5412,0.702,0.0353],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim In Out Path","ix":2,"e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.5,"y":1},"s":[0],"t":0},{"s":[100],"t":47}],"ix":2},"o":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[180],"t":47}],"ix":3},"s":{"a":1,"k":[{"o":{"x":0.5,"y":0},"i":{"x":0.833,"y":0.833},"s":[0],"t":23.5},{"s":[100],"t":47}],"ix":1},"m":1}],"ind":5},{"ty":4,"nm":"Shield 15","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-1159.166,-111.036,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":25},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[90,100,100],"t":35},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":40},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":105},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[88,100,100],"t":110},{"s":[100,100,100],"t":120}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,540,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":1,"it":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[42.803,-31.047],[14.714,-7.095],[38.374,27.833],[0,50.852],[0,0],[0,0],[0,0]],"o":[[0,50.852],[-38.374,27.833],[-14.714,-7.095],[-42.804,-31.047],[0,0],[0,0],[0,0],[0,0]],"v":[[185.833,40.166],[92.007,169.747],[0.002,224.425],[-92.004,169.747],[-185.832,40.166],[-185.832,-169.59],[0.001,-225.34],[185.833,-169.59]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[6.345,1.903],[0,0],[2.812,-0.844],[0,0],[0,-6.624],[0,0],[-22.941,-29.277],[-30.286,-21.923],[-2.108,-0.943],[-2.09,0],[-1.95,0.874],[-50.877,36.828],[-17.522,22.36],[0,28.735],[0,0]],"o":[[0,0],[-2.809,-0.844],[0,0],[-6.345,1.903],[0,0],[0,28.734],[17.522,22.36],[50.877,36.828],[1.95,0.873],[2.089,0],[2.108,-0.943],[30.285,-21.923],[22.941,-29.276],[0,0],[0.001,-6.624]],"v":[[205.144,-195.117],[4.312,-255.367],[-4.308,-255.367],[-205.142,-195.117],[-215.832,-180.75],[-215.832,40.166],[-181.259,127.591],[-109.211,194.327],[-6.128,254.69],[0.001,256],[6.13,254.69],[109.212,194.327],[181.259,127.591],[215.832,40.166],[215.832,-180.75]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0,0.3137,0.7294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-1159.166,-111.036],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":6},{"ty":4,"nm":"Chip","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[-1159.165,-122.62,0],"ix":1},"s":{"a":0,"k":[88.561,88.561,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0,"y":1},"s":[1337,534,0],"t":21,"ti":[132.833,0,0],"to":[-132.833,0,0]},{"o":{"x":1,"y":1},"i":{"x":0,"y":0},"s":[540,534,0],"t":44,"ti":[0,0,0],"to":[0,0,0]},{"o":{"x":1,"y":0},"i":{"x":0.667,"y":1},"s":[540,534,0],"t":97,"ti":[126.833,0,0],"to":[-126.833,0,0]},{"s":[-221,534,0],"t":121.7041015625}],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":1,"y":0},"i":{"x":0,"y":1},"s":[0],"t":30},{"o":{"x":0.167,"y":0},"i":{"x":0.833,"y":1},"s":[100],"t":34},{"o":{"x":0.167,"y":0},"i":{"x":0.833,"y":1},"s":[100],"t":106},{"s":[0],"t":110}],"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,6.122],[0,0],[-6.122,0.028],[0,0],[0,-6.142],[0,0],[6.142,0]],"o":[[-6.122,-0.028],[0,0],[0,-6.122],[0,0],[6.142,0],[0,0],[0,6.142],[0,0]],"v":[[-91.837,102.958],[-102.907,91.837],[-102.907,-91.837],[-91.837,-102.958],[91.837,-102.958],[102.958,-91.837],[102.958,91.837],[91.837,102.958]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0.154],[0,0],[0,2.83],[2.83,0],[0,0],[3.194,1.887],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[1.853,-3.185],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[-3.148,-1.867],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[-1.873,3.187],[0,0],[0,2.83],[2.83,0],[0,0],[0,0.41],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0]],"o":[[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[-1.845,-3.218],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[0,0],[0,0],[0,-2.83],[-2.83,0],[0,0],[-3.185,1.853],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[0,0],[0,0],[-2.83,0],[0,2.83],[0,0],[1.825,3.172],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[0,0],[0,0],[0,2.83],[2.83,0],[0,0],[3.2,-1.852],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0],[2.83,0],[0,-2.83],[0,0],[0,0],[0,0]],"v":[[143.496,-64.419],[148.621,-69.544],[143.496,-74.669],[113.208,-74.669],[113.208,-91.837],[113.208,-92.247],[143.496,-92.247],[148.621,-97.372],[143.496,-102.497],[110.184,-102.497],[102.497,-110.287],[102.497,-143.496],[97.372,-148.621],[92.247,-143.496],[92.247,-113.157],[74.618,-113.157],[74.618,-143.496],[69.493,-148.621],[64.368,-143.496],[64.368,-113.208],[46.79,-113.208],[46.79,-143.496],[41.665,-148.621],[36.54,-143.496],[36.54,-113.208],[18.962,-113.208],[18.962,-143.496],[13.837,-148.621],[8.712,-143.496],[8.712,-113.208],[-8.815,-113.208],[-8.815,-143.496],[-13.94,-148.621],[-19.064,-143.496],[-19.064,-113.208],[-36.643,-113.208],[-36.643,-143.496],[-41.768,-148.621],[-46.892,-143.496],[-46.892,-113.208],[-64.471,-113.208],[-64.471,-143.496],[-69.595,-148.621],[-74.72,-143.496],[-74.72,-113.208],[-92.247,-113.208],[-92.247,-143.496],[-97.372,-148.621],[-102.497,-143.496],[-102.497,-110.184],[-110.184,-102.497],[-143.496,-102.497],[-148.621,-97.372],[-143.496,-92.247],[-113.157,-92.247],[-113.157,-74.669],[-143.496,-74.669],[-148.621,-69.544],[-143.496,-64.419],[-113.157,-64.419],[-113.157,-46.841],[-143.496,-46.841],[-148.621,-41.716],[-143.496,-36.591],[-113.157,-36.591],[-113.157,-19.013],[-143.496,-19.013],[-148.621,-13.888],[-143.496,-8.763],[-113.157,-8.763],[-113.157,8.764],[-143.496,8.764],[-148.621,13.888],[-143.496,19.013],[-113.157,19.013],[-113.157,36.591],[-143.496,36.591],[-148.621,41.716],[-143.496,46.841],[-113.157,46.841],[-113.157,64.419],[-143.496,64.419],[-148.621,69.544],[-143.496,74.669],[-113.157,74.669],[-113.157,92.247],[-143.496,92.247],[-148.621,97.372],[-143.496,102.497],[-110.082,102.497],[-102.497,110.184],[-102.497,143.496],[-97.372,148.621],[-92.247,143.496],[-92.247,113.157],[-74.669,113.157],[-74.669,143.496],[-69.544,148.621],[-64.419,143.496],[-64.419,113.208],[-46.841,113.208],[-46.841,143.496],[-41.716,148.621],[-36.591,143.496],[-36.591,113.208],[-19.013,113.208],[-19.013,143.496],[-13.888,148.621],[-8.763,143.496],[-8.763,113.208],[8.712,113.208],[8.712,143.496],[13.837,148.621],[18.962,143.496],[18.962,113.208],[36.54,113.208],[36.54,143.496],[41.665,148.621],[46.79,143.496],[46.79,113.208],[64.368,113.208],[64.368,143.496],[69.493,148.621],[74.618,143.496],[74.618,113.208],[92.247,113.208],[92.247,143.496],[97.372,148.621],[102.497,143.496],[102.497,110.184],[110.235,102.497],[143.496,102.497],[148.621,97.372],[143.496,92.247],[113.157,92.247],[113.157,91.837],[113.157,74.669],[143.496,74.669],[148.621,69.544],[143.496,64.419],[113.208,64.419],[113.208,46.841],[143.496,46.841],[148.621,41.716],[143.496,36.591],[113.208,36.591],[113.208,19.013],[143.496,19.013],[148.621,13.888],[143.496,8.764],[113.208,8.764],[113.208,-8.763],[143.496,-8.763],[148.621,-13.888],[143.496,-19.013],[113.208,-19.013],[113.208,-36.591],[143.496,-36.591],[148.621,-41.716],[143.496,-46.841],[113.208,-46.841],[113.208,-64.419]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0,0.3137,0.7294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-1159.165,-122.62],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 2","ix":2,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[76.488,76.514],[76.488,76.514],[-76.591,76.514],[-76.591,-76.514],[76.437,-76.514]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0.034,0],[0,0],[0,-5.661],[0,0],[0,0],[-5.661,0],[0,0],[0,5.661],[0,0],[5.66,0.057]],"o":[[0,0],[-5.661,0],[0,0],[0,0],[0,5.661],[0,0],[5.661,0],[0,0],[0.057,-5.66],[-0.034,0]],"v":[[76.488,-86.764],[-76.489,-86.764],[-86.738,-76.514],[-86.738,-76.514],[-86.738,76.514],[-76.489,86.764],[76.488,86.764],[86.738,76.514],[86.738,-76.411],[76.591,-86.763]]},"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0,0.3137,0.7294],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-1159.139,-122.671],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":7}],"v":"4.8.0","fr":30,"op":150,"ip":0,"assets":[]}'),i=JSON.parse('{"nm":"ui-sucess","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/toolkit-js 0.26.1"},"layers":[{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":59},{"s":[100],"t":61}],"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Shape 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-100,0],[-26,60],[109,-70]]},"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":26,"ix":5},"c":{"a":0,"k":[1,1,1],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":1,"y":0.034},"i":{"x":0,"y":1.002},"s":[0],"t":61},{"s":[100],"t":85}],"ix":1},"m":1}],"ind":1},{"ty":4,"nm":"Ellipse 2","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 2","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[384,384],"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13,"ix":5},"c":{"a":0,"k":[0.1961,0.7961,0.6549],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.582,"y":0.005},"i":{"x":0.35,"y":0.988},"s":[100],"t":8},{"s":[0],"t":53.2890625}],"ix":1},"m":1}],"ind":2},{"ty":4,"nm":"Ellipse 1","sr":1,"st":0,"op":3600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":1,"y":-0.001},"i":{"x":0,"y":0.986},"s":[0,0,100],"t":48},{"s":[100,100,100],"t":74}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[384,384],"ix":2}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.1961,0.7961,0.6549],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":0,"k":0,"ix":1},"m":1}],"ind":3}],"v":"5.6.7","fr":45,"op":112,"ip":0,"assets":[]}');var s=n(86129),a=n(91341),l=n(5564),c=n.n(l),d=n(51772),u=n(53871),p=n(91900),h=n(84003),m=n(62391);const f=function(e){let{tab:t,selected:n,onClick:r,className:o,disabled:i=!1}=e;return(0,m.jsx)("div",{className:c()({"cursor-not-allowed":i}),children:(0,m.jsx)("div",{className:c()("tab cursor-pointer select-none rounded-t bg-accent px-4 py-1.5 text-xs font-semibold text-primary transition duration-500 ease-in-out"+o,{"bg-[#F4F5F7]":n},{"pointer-events-none":i}),onClick:r,children:(0,m.jsx)(u.A,{children:t})},t)})};var g=n(62144),b=n(16118),v=n(68652),y=n(43039);class k{static initiateOneTimePayment(e,t,n,r){var o;const i={key:"rzp_test_oGF6bmuu9cUOHH",amount:t.amount.toString(),currency:t.currency,name:e.name,image:null!==(o=e.logo)&&void 0!==o?o:"https://app.".concat(b.pD,"/assets/main-logo.png"),description:t.receipt,order_id:t.id,handler:function(e){console.log("[Razor Pay]","Handler success",e),r(e)},prefill:{name:n.name,email:n.email,contact:n.mobile},notes:t.notes,theme:{color:"#0445FE"}},s=JSON.stringify(i),a=window.btoa(s);return"".concat("https://payments.pensil.in","/razorpay/").concat(a)}static initiateRecurringPayment(e,t,n,r){var o;console.log("[Razor Pay]","Initiate recurring payment",t);var i={key:"rzp_test_oGF6bmuu9cUOHH",subscription_id:t.id,name:e.name,image:null!==(o=e.logo)&&void 0!==o?o:"https://app.".concat(b.pD,"/assets/main-logo.png"),handler:function(e){console.log("[Razor Pay]","Handler success",e),r(e)},prefill:{name:n.name,email:n.email,contact:n.mobile},notes:t.notes,theme:{color:"#0445FE"}};const s=JSON.stringify(i),a=window.btoa(s);return"".concat("https://payments.pensil.in","/razorpay/").concat(a)}}var w=n(36357),x=n(89431),_=n(58157),A=n(90663),C=n(1334);const S=["Afghanistan","\xc5land Islands","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahrain","Bahamas","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia, Plurinational State of","Bonaire, Sint Eustatius and Saba","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos(Keeling) Islands","Colombia","Comoros","Congo","Congo, the Democratic Republic of the","Cook Islands","Costa Rica","C\xf4te d'Ivoire","Croatia","Cuba","Cura\xe7ao","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Falkland Islands(Malvinas)","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea - Bissau","Guyana","Haiti","Heard Island and McDonald Islands","Holy See(Vatican City State)","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran, Islamic Republic of","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait","Kyrgyzstan","Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macao","Macedonia, the Former Yugoslav Republic of","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia, Federated States of","Moldova, Republic of","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine, State of","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn","Poland","Portugal","Puerto Rico","Qatar","R\xe9union","Romania","Russian Federation","Rwanda","Saint Barth\xe9lemy","Saint Helena, Ascension and Tristan da Cunha","Saint Kitts and Nevis","Saint Lucia","Saint Martin(French part)","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten(Dutch part)","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen","Swaziland","Sweden","Switzerland","Syrian Arab Republic","Taiwan, Province of China","Tajikistan","Tanzania, United Republic of","Thailand","Timor - Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela, Bolivarian Republic of","Viet Nam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe"],j=["Andhra Pradesh","Arunachal Pradesh","Assam","Bihar","Chhattisgarh","Goa","Gujarat","Haryana","Himachal Pradesh","Jharkhand","Karnataka","Kerala","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Nagaland","Odisha","Punjab","Rajasthan","Sikkim","Tamil Nadu","Telangana","Tripura","Uttar Pradesh","Uttarakhand","West Bengal","Andaman and Nicobar","Chandigarh","Dadra and Nagar Haveli and Daman and Diu","Delhi","Jammu and Kashmir","Lakshadweep","Ladakh","Puducherry"],E=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"];var N=n(52090);function P(e){let{plan:t,user:n,community:o,existingBillingAddress:i,onProceed:s}=e;const[l,c]=r.useState(""),[u,p]=r.useState(""),[h,f]=r.useState(""),[g,b]=r.useState(""),[v,y]=r.useState(""),[k,x]=r.useState(""),[_,C]=r.useState("");return(0,r.useEffect)((()=>{var e,t,r,o,s,a,l;if(i&&Object.keys(i).length)c(null!==(e=i.email)&&void 0!==e?e:""),p(null!==(t=i.fullName)&&void 0!==t?t:""),f(null!==(r=i.mobile)&&void 0!==r?r:""),b(null!==(o=i.addressLine1)&&void 0!==o?o:""),y(null!==(s=i.addressLine2)&&void 0!==s?s:""),x(null!==(a=i.state)&&void 0!==a?a:""),C(null!==(l=i.country)&&void 0!==l?l:"");else if(n){var d,u,h;c(null!==(d=n.email)&&void 0!==d?d:""),p(null!==(u=n.name)&&void 0!==u?u:""),f(null!==(h=n.mobile)&&void 0!==h?h:"")}}),[i,n]),(0,m.jsxs)("form",{onSubmit:e=>{e.preventDefault();s({email:l,fullName:u,mobile:h,addressLine1:g,addressLine2:v,state:k,country:_})},className:"flex w-full flex-col gap-4 bg-card p-4",children:[(0,m.jsx)(a.A,{variant:"t1",size:"body1",children:"Billing Details"}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Email Id"}),(0,m.jsx)(d.ks,{type:"email",required:!0,defaultValue:l,noMargin:!0,placeholder:"Enter email address",onChange:e=>c(e)})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Full Name"}),(0,m.jsx)(d.ks,{type:"text",noMargin:!0,required:!0,defaultValue:u,placeholder:"Enter full name",onChange:e=>p(e)})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Mobile no."}),(0,m.jsx)(d.ks,{type:"text",noMargin:!0,required:!0,defaultValue:h,placeholder:"Enter mobile number",onChange:e=>f(e)})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Country"}),(0,m.jsx)(A.A,{list:S,value:_,required:!0,placeholder:"Select country",selectClassName:"pl-0 pr-2",onStateChange:e=>{C(e),x("")}})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Address Line 1"}),(0,m.jsx)(d.ks,{type:"text",noMargin:!0,required:!0,defaultValue:g,placeholder:"Enter address line 1",onChange:e=>b(e)})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"Address Line 2"}),(0,m.jsx)(d.ks,{type:"text",noMargin:!0,defaultValue:v,placeholder:"Enter address line 2",onChange:e=>y(e)})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(a.A,{variant:"t1",children:"State"}),(0,m.jsx)(w.av,{value:["India","United States"].includes(_),ifPresent:()=>(0,m.jsx)(A.A,{list:"India"===_?j:E,value:k,required:!0,selectClassName:"pl-0 pr-2",placeholder:"Select state",onStateChange:e=>{x(e)}}),ifAbsent:()=>(0,m.jsx)(d.ks,{type:"text",noMargin:!0,defaultValue:k,required:!0,placeholder:"Enter state",onChange:e=>x(e)})})]}),(0,m.jsx)(d.$n,{label:"Proceed",onClick:()=>{}})]})}function D(e){let{community:t,user:n,plan:r,isVisible:o,existingBillingAddress:i,setIsVisible:l,onProceed:c=(e=>{})}=e;return t&&o?(0,m.jsx)(s.A,{hideHeader:!0,visible:o,setVisible:l,childrenClassName:"AddressCheckout p-0",className:"m-4 max-h-[80vh] w-full max-w-xl overflow-y-auto bg-background md:max-w-6xl",children:(0,m.jsxs)("div",{className:"flex min-w-full flex-col place-content-center items-center gap-2 rounded bg-background p-4 py-10 md:flex-row md:items-start",children:[(0,m.jsxs)("section",{className:"flex w-full flex-col gap-2 md:w-1/2",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(w.av,{value:t.logo,ifPresent:()=>(0,m.jsx)("img",{src:t.logo,alt:"Logo",className:"h-14"}),ifAbsent:()=>(0,m.jsx)("div",{className:"flex place-content-center items-center rounded bg-primary p-2 text-sm text-primary-foreground",children:t.name.split(" ").map((e=>e[0])).join("")})}),(0,m.jsx)(a.A,{variant:"t1",children:t.name})]}),(0,m.jsx)("div",{className:"mt-10",children:(0,m.jsx)(_.A,{label:"Go Back",className:"flex items-center gap-2",prefix:(0,m.jsx)(g.A,{icon:"arrow-left"}),onClick:()=>{l(!1)}})}),(0,m.jsx)(M,{plan:r,selected:!0})]}),(0,m.jsx)("section",{className:"w-full max-w-md",children:(0,m.jsx)(P,{plan:r,user:n,community:t,onProceed:c,existingBillingAddress:i})})]})}):null}function M(e){var t,n,r,o;let{plan:i,mySubscription:s,selected:l=!1,onSelect:d}=e;const p=x.F.convertAmount(i.subscriptionAmount),h=p*((null!==(t=i.taxPercentage)&&void 0!==t?t:0)/100),f=N.I[i.currency]||i.currency,g=x.F.calculateSubscriptionTotal(i);return(0,m.jsxs)("div",{className:c()("flex flex-col gap-4 rounded border border-border px-4 py-3 hover:bg-background",{"border-primary":l,"cursor-pointer":Boolean(d)}),onClick:()=>{d&&d(i)},children:[(0,m.jsxs)("div",{className:"flex",children:[(0,m.jsx)(C.s,{selected:l,className:c()("",{hidden:!d}),children:void 0}),(0,m.jsxs)("div",{className:"ml-2 flex-grow",children:[(0,m.jsxs)("div",{className:"flex place-content-between",children:[(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[(0,m.jsx)(a.A,{variant:"t1",children:i.name}),(0,m.jsx)(w.av,{value:null!==(n=(null===s||void 0===s||null===(r=s.subscriptionPlan)||void 0===r?void 0:r._id)===i.id)&&void 0!==n&&n,ifPresent:()=>(0,m.jsx)("span",{className:"rounded bg-primary px-2 py-0.5 text-xs text-primary-foreground",children:(0,m.jsx)(u.A,{children:"Current Plan"})})})]}),(0,m.jsx)("span",{children:p?(0,m.jsxs)("span",{className:"whitespace-nowrap",children:[(0,m.jsxs)(a.A,{children:[f,p," "]}),(0,m.jsx)(a.A,{variant:"s1",children:(null!==(o=null===i||void 0===i?void 0:i.recurringInterval)&&void 0!==o?o:0)>0&&"per ".concat(null===i||void 0===i?void 0:i.recurringInterval," month")})]}):(0,m.jsx)(a.A,{translate:!0,variant:"t1",children:"Free"})})]}),(0,m.jsx)("div",{className:"flex flex-row justify-between",children:i.description&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i.description},className:"NL2BR headings mt-2 max-h-96 overflow-y-auto"})})]})]}),i.taxPercentage&&i.taxPercentage>0?(0,m.jsxs)("div",{className:"Amount theme-bg-disable flex flex-col gap-4 rounded p-4",children:[(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsx)(a.A,{children:i.name}),(0,m.jsxs)(a.A,{children:[f,"\xa0",p]})]}),(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsxs)(a.A,{children:["Tax at ",i.taxPercentage,"%"]}),(0,m.jsxs)(a.A,{children:[f,"\xa0",h]})]}),(0,m.jsx)("hr",{}),(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsx)(a.A,{translate:!0,children:"Total"}),(0,m.jsxs)(a.A,{children:[f,"\xa0",g]})]})]}):null]})}const T=e=>{var t,n,o,i,l;let{group:d,community:u,user:w,plans:x,header:_,active:A=!1,labelCancel:C="Cancel",labelSubmit:S="Yes, Go Ahead",btnColor:j,mySubscription:E,disabled:N=!1,onPaymentSuccess:P=(e=>{}),setActive:M=(e=>{})}=e;const[T,L]=(0,r.useState)(null),[R,B]=(0,r.useState)("Monthly"),[z,F]=(0,r.useState)("idle"),[U,V]=(0,r.useState)(),[G,H]=(0,r.useState)(!1);var W=Array();function q(){var e,t,n,r,o;switch(R){case"Monthly":return null!==(e=x.oneMonthlySubscriptions)&&void 0!==e?e:[];case"Quaterly":return null!==(t=x.threeMonthlySubscriptions)&&void 0!==t?t:[];case"Half Yearly":return null!==(n=x.sixMonthlySubscriptions)&&void 0!==n?n:[];case"Yearly":return null!==(r=x.twelveMonthlySubscriptions)&&void 0!==r?r:[];case"One Time":return null!==(o=x.oneTimeSubscriptions)&&void 0!==o?o:[];default:return[]}}null!==(t=x.oneMonthlySubscriptions)&&void 0!==t&&t.length&&W.push("Monthly"),null!==(n=x.threeMonthlySubscriptions)&&void 0!==n&&n.length&&W.push("Quaterly"),null!==(o=x.sixMonthlySubscriptions)&&void 0!==o&&o.length&&W.push("Half Yearly"),null!==(i=x.twelveMonthlySubscriptions)&&void 0!==i&&i.length&&W.push("Yearly"),null!==(l=x.oneTimeSubscriptions)&&void 0!==l&&l.length&&W.push("One Time"),(0,r.useEffect)((()=>{var e,t,n,r,o;null!==(e=x.oneMonthlySubscriptions)&&void 0!==e&&e.length?B("Monthly"):null!==(t=x.threeMonthlySubscriptions)&&void 0!==t&&t.length?B("Quaterly"):null!==(n=x.sixMonthlySubscriptions)&&void 0!==n&&n.length?B("Half Yearly"):null!==(r=x.twelveMonthlySubscriptions)&&void 0!==r&&r.length?B("Yearly"):null!==(o=x.oneTimeSubscriptions)&&void 0!==o&&o.length&&B("One Time")}),[x,E]),(0,r.useEffect)((()=>{window.Razorpay||(0,b.k0)("https://checkout.razorpay.com/v1/checkout.js").then((async e=>{if(!e)return alert("Could not load razorpay!");console.log("razorpay loaded")}))}),[]);const K=e=>{e&&(F("loading"),y.nC.subscribeToFreePlan(u.id,e).then((e=>{let{subscription:t}=e;F("success"),P(t)})).catch((e=>{F("error"),console.log(e)})))},Y=(e,t,n)=>{if(!n||t)if(n||e)if(n){const e=k.initiateRecurringPayment(u,t,w,$);V(e)}else{const t=k.initiateOneTimePayment(u,e,w,$);V(t)}else console.error("Order details not found");else console.error("Order details not found")};function $(e){P(e),M(!1),V(void 0)}return U?(0,m.jsx)(s.A,{visible:void 0!==U,setVisible:()=>{window.confirm("Are you sure you want to cancel the payment?")&&V(void 0)},hideHeader:!0,childrenClassName:"p-0 h-full border border-border bg-transparent w-full rounded",className:"flex h-full max-h-screen w-full max-w-full place-content-center items-center overflow-y-auto bg-transparent sm:m-4 sm:max-h-[90vh] sm:max-w-[412px]",children:(0,m.jsx)("iframe",{src:U,className:"h-full w-full rounded",title:"Checkout"})}):(0,m.jsxs)(p.a,{className:"SubscriptionCheckoutModel backdrop-blur-md",active:A,setActive:M,width:"720px",padding:!1,children:[(0,m.jsxs)("div",{className:"flex flex-col items-center justify-between space-x-2 rounded-[20px] bg-card",children:[(0,m.jsxs)("div",{className:"flex justify-center px-6 pb-2.5 pt-5",children:[(0,m.jsx)(a.A,{variant:"t1",className:"text-base font-bold",children:_}),(0,m.jsx)("div",{className:"text-xxs ml-2.5 rounded bg-accent px-2.5 py-0.5 text-secondary-foreground",children:(null===d||void 0===d?void 0:d.groupType)===v.A.GROUP.CLOSED?(0,m.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,m.jsx)(g.A,{icon:"lock",size:"xxs"}),(0,m.jsx)("span",{children:"Closed"})]}):(null===d||void 0===d?void 0:d.groupType)===v.A.GROUP.CLOSED&&null!==d&&void 0!==d&&d.isOnlyVisibleToMembers?(0,m.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,m.jsx)(g.A,{icon:"eye-crossed",size:"xxs"}),(0,m.jsx)("span",{children:"Private"})]}):(0,m.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,m.jsx)(g.A,{icon:"unlock",size:"xxs"}),(0,m.jsx)("span",{children:"Open"})]})})]}),(0,m.jsx)("p",{className:"px-6 pb-5 text-xs font-semibold text-secondary-foreground/70",children:null===d||void 0===d?void 0:d.description})]}),(0,m.jsx)("div",{className:"bg-card",children:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"flex justify-center whitespace-nowrap border-b border-t border-border bg-card py-2.5",children:W.map(((e,t)=>(0,m.jsx)(f,{tab:e,selected:R===e,onClick:()=>{B(e),L(void 0)}},t)))}),(0,m.jsx)(h.u,{className:"mx-4 mt-6 flex min-h-[60px] flex-col items-start gap-4 rounded p-5 lg:flex-row ".concat(q().length<=1?"lg:justify-center":"lg:justify-around"," overflow-y-auto overflow-x-scroll"),items:q(),renderItem:function(e){return(0,m.jsx)("div",{children:(0,m.jsx)(I,{plan:e,mySubscription:E,selected:(null===T||void 0===T?void 0:T.id)===e.id,handleFreeSubscriptions:K,setIsDisplayAddressCheckout:H,setSelectedSubscription:L})},e.id)},noItemsElement:(0,m.jsx)("div",{className:"py-20 text-center",children:(0,m.jsx)(a.A,{variant:"s1",children:"No plans available"})}),footerElement:(0,m.jsx)("div",{className:c()("",{"h-20":q().length<3})})})]})}),(0,m.jsx)(O,{mySubscription:E}),(0,m.jsx)(D,{plan:T,user:w,community:u,existingBillingAddress:null===E||void 0===E?void 0:E.billingDetails,isVisible:G,setIsVisible:H,onProceed:e=>{var t,n;Boolean(e)&&(H(!1),n=e,(t=T)&&t.id&&(F("loading"),y.nC.initiateSubscription(u.id,t.id,n).then((e=>{let{orderDetails:n,subscriptionDetails:r,paymentGateway:o}=e;var i;F("success"),"razorpay"===o&&Y(n,r,null!==(i=t.isRecurring)&&void 0!==i&&i)})).catch((e=>{F("error"),console.log(e)}))))}})]})};function I(e){var t,n,r,o;let{plan:i,mySubscription:s,selected:l=!1,handleFreeSubscriptions:p,setIsDisplayAddressCheckout:h,onSelect:f,setSelectedSubscription:g}=e;const b=x.F.convertAmount(null===i||void 0===i?void 0:i.subscriptionAmount),v=(t=null===i||void 0===i?void 0:i.taxPercentage,N.I[null===i||void 0===i?void 0:i.currency]||(null===i||void 0===i?void 0:i.currency));x.F.calculateSubscriptionTotal(i);return(0,m.jsx)("div",{className:c()("flex min-w-[220px] max-w-[280px] flex-wrap gap-4 break-words rounded border border-border p-5 hover:bg-background",{"border-primary":l,"cursor-pointer":Boolean(f)}),children:(0,m.jsxs)("div",{className:"ml-2 flex-grow",children:[(0,m.jsxs)("div",{className:"flex flex-col place-content-between",children:[(0,m.jsxs)("span",{className:"mb-2.5 flex items-center text-sm font-semibold text-secondary-foreground",children:[null===i||void 0===i?void 0:i.name,(0,m.jsx)(w.av,{value:null!==(n=(null===s||void 0===s||null===(r=s.subscriptionPlan)||void 0===r?void 0:r._id)===(null===i||void 0===i?void 0:i.id))&&void 0!==n&&n,ifPresent:()=>(0,m.jsx)("span",{className:"rounded bg-primary px-2 py-0.5 text-xs text-primary-foreground",children:(0,m.jsx)(u.A,{children:"Current Plan"})})})]}),(0,m.jsx)("span",{children:b?(0,m.jsxs)("div",{className:"flex items-center gap-2.5 text-xs font-semibold",children:[(0,m.jsxs)("span",{className:"whitespace-nowrap text-2xl text-secondary-foreground",children:[v,b]}),(0,m.jsx)("span",{children:(null!==(o=null===i||void 0===i?void 0:i.recurringInterval)&&void 0!==o?o:0)>0&&(0,m.jsxs)("div",{className:"flex flex-col items-start text-secondary-foreground",children:[(0,m.jsx)("span",{children:"per"}),(0,m.jsx)("span",{children:"month"})]})})]}):(0,m.jsx)(a.A,{translate:!0,variant:"t1",children:"Free"})})]}),(0,m.jsx)("div",{className:"flex justify-start",children:(0,m.jsx)(d.$n,{onClick:()=>{i&&(0!==(null===i||void 0===i?void 0:i.subscriptionAmount)?(g&&g(i),h&&h(!0)):p&&p(i.id))},className:"mt-3 h-8 w-full text-xs font-semibold",label:"Subscribe"})}),(0,m.jsx)("div",{className:"flex flex-row justify-center text-secondary-foreground",children:(null===i||void 0===i?void 0:i.description)&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:null===i||void 0===i?void 0:i.description},className:"NL2BR headings mt-2 max-h-96 overflow-y-auto"})})]})})}function O(e){var t,n,r,o,i,s,l,d;let{mySubscription:u}=e;if(!u||null===u||void 0===u||!u.isActive)return null;const p=x.F.convertAmount(null===u||void 0===u||null===(t=u.subscriptionPlan)||void 0===t?void 0:t.subscriptionAmount),h=null!==(n=null===u||void 0===u||null===(r=u.subscriptionPlan)||void 0===r?void 0:r.currency)&&void 0!==n?n:"USD",f=null===u||void 0===u||null===(o=u.subscriptionPlan)||void 0===o?void 0:o.isRecurring;return(0,m.jsx)("div",{className:"p-4",children:(0,m.jsxs)("details",{className:"group",children:[(0,m.jsxs)("summary",{className:"mt-2 flex cursor-pointer list-none items-center justify-between font-medium",children:[(0,m.jsx)(a.A,{size:"body1",variant:"t1",children:"Current Plan"}),(0,m.jsx)("span",{className:"transition group-open:rotate-180",children:(0,m.jsx)(g.A,{icon:"angle-down"})})]}),(0,m.jsxs)("div",{className:"select-none",children:[(0,m.jsxs)("div",{className:"my-2 flex flex-col gap-1 rounded border border-primary px-4 py-2",children:[(0,m.jsx)(a.A,{variant:"t2",className:"text-primary-500",children:null===u||void 0===u||null===(i=u.subscriptionPlan)||void 0===i?void 0:i.name}),p?(0,m.jsxs)("span",{className:"flex items-start gap-2 whitespace-nowrap",children:[(0,m.jsxs)(a.A,{children:[h,p," "]}),(0,m.jsx)(a.A,{variant:"s1",children:(null!==(s=null===(l=u.subscriptionPlan)||void 0===l?void 0:l.recurringInterval)&&void 0!==s?s:0)>0&&"per ".concat(null===(d=u.subscriptionPlan)||void 0===d?void 0:d.recurringInterval," month")})]}):(0,m.jsx)(a.A,{translate:!0,variant:"t1",children:"Free"})]}),(0,m.jsx)("div",{className:c()("flex items-center justify-between",{hidden:!f}),children:(0,m.jsx)(a.A,{variant:"s1",children:"If you change your plan, your current subscription will be canceled and a new subscription will be created."})})]})]})})}const L=(0,r.lazy)((()=>Promise.all([n.e(561),n.e(58)]).then(n.bind(n,60058)))),R=e=>{let{group:t,community:n,header:l,user:c,active:d,setActive:u,mySubscription:p,socket:h,plans:f}=e;const[g,b]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(h)return h.on("SUBSCRIPTION_UPDATED",(e=>{console.log("SUBSCRIPTION_UPDATED",e),b(!1),y(!0)})),()=>{h.off("SUBSCRIPTION_UPDATED")}}),[h]),f?(0,m.jsxs)("div",{children:[(0,m.jsx)(T,{group:t,community:n,user:c,plans:f,header:l,setActive:u,active:d,labelSubmit:"Checkout",mySubscription:p,onPaymentSuccess:e=>{console.log("[Group Join]","",e),b(!0)}}),(0,m.jsx)(s.A,{title:"Add new course",className:"GroupSubscriptionCheckoutModel w-80",visible:g,hideHeader:!0,setVisible:b,children:(0,m.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,m.jsx)(a.A,{size:"body1",className:"text-center",children:"Please wait while we are processing your payment"}),(0,m.jsx)(r.Suspense,{fallback:(0,m.jsx)(m.Fragment,{}),children:(0,m.jsx)(L,{src:o,loop:!0,className:"h-36",onEvent:e=>{},controlVisible:!1})})]})}),(0,m.jsx)(s.A,{title:"Add new course",className:"GroupSubscriptionCheckoutModel first-letter:w-80",visible:v,hideHeader:!0,setVisible:y,children:(0,m.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,m.jsx)(a.A,{size:"body1",className:"text-center",children:"Your payment is successful"}),(0,m.jsx)(r.Suspense,{fallback:(0,m.jsx)(m.Fragment,{}),children:(0,m.jsx)(L,{src:i,className:"h-36",onEvent:e=>{"complete"===e&&setTimeout((()=>{window.location.reload()}),1e3)},controlVisible:!1})})]})})]}):(0,m.jsx)(m.Fragment,{})}},62220:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GROUPPAGE_ROUTE:()=>jt,GROUPPAGE_SLUG_ROUTE:()=>Et,SECTIONPAGE_SLUG_ROUTE:()=>Nt,createGroupPageUrl:()=>It,createGroupPageUrlFromSlug:()=>Ot,createGroupSectionPageUrl:()=>Lt,default:()=>Bt,getGroupPageRoute:()=>Pt,getGroupPageRouteFromSlug:()=>Dt,getSectionPageRoute:()=>Tt,getSectionPageRouteFromSlug:()=>Mt});var r=n(20975),o=n(31305),i=n(98020),s=n(77826),a=n(82993),l=n(47760),c=n(89449),d=n(60553),u=n(53871),p=n(5564),h=n.n(p),m=n(16478),f=n(78220),g=n(97676),b=n(54916),v=n(43039),y=n(54608),k=n(6714),w=n(52041),x=n(92082),_=n(5607),A=n(44139),C=n(41317),S=n(62391);function j(e){let{activeTabModel:t,user:n,group:o,updateActiveGroup:i,setGroup:s,addToast:a}=e;const[l,c]=r.useState(!1);return t.isPrivate?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(A.$,{label:"Request Access",onClick:()=>{c(!0),v.Bd.joinClosedSection(n,o.id,t.id).then((e=>{let{group:t}=e;i(t),s(t),a("Request sent!","","success")})).catch((e=>{console.log({error:e}),a("Unable to send request!","","danger")})).finally((()=>{c(!1)}))},isLoading:l,className:"CloseSectionRequestButton"})}var E=n(93668),N=n(84983),P=n(57731),D=n(91341),M=n(62144),T=n(21708);const I=(e,t)=>"joined"===e.joinStatus&&(!t||"admin"!==t.postLevel||("admin"===e.myRole||"moderator"===e.myRole));const O=(0,c.wj)((0,o.Ng)((e=>({user:e.auth,activeGroup:e.activeGroup,groups:e.groups,community:e.community,communityPac:e.communityPac,personalGroup:e.personalGroup,notificationCentre:e.notificationCentre,activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null})),(e=>(0,a.zH)({updateGroups:E.$Y,updateActiveGroup:E.Wk,setPersonalGroup:_.iz},e)))((function(e){let{group:t,setGroup:n,user:o,activeTabModel:i,addToast:s=(e=>{})}=e;const[a,l]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1);let u=I(t,i);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"flex flex-col",children:o&&!u&&"user"===t.myRole&&"admin"===i.postLevel&&(0,S.jsxs)("div",{className:"mx-2 mb-2 flex gap-2 rounded border border-border p-2 sm:mx-0 sm:mb-0",children:[(0,S.jsx)(M.A,{icon:"info",size:"sm"}),(0,S.jsx)(D.A,{size:"body",variant:"s1",translate:!0,children:"Only admin can post here."})]})}),(0,S.jsx)(P.A,{width:570,setActive:l,active:a,children:(0,S.jsx)(T.A,{group:t,isEditGroupModalVisible:a,setIsEditGroupModalVisible:l,setIsCreateGroupModalVisible:l,updateGroup:e=>{s("Group updated!","","success"),n(e)}})}),(0,S.jsx)(N.A,{link:"http://embed.pensil.com"+(window.location.port?":"+window.location.port:"")+"/group/"+t.id+"/feed/"+i.id,active:c,setActive:d})]})})));var L=n(25715),R=n(19328),B=n(67992),z=n(72006),F=n.n(z),U=n(63360),V=n(84003);function G(e){let{community:t,pinnedDetails:n,index:r,totalItems:o,selectedPinnedMessageId:i,setSelectedPinnedMessageId:s,isOnlyItem:a}=e;const l=n.attachments,c=r===o-1;return(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:h()("flex justify-between",{"border-b-2":!c},{"mx-0 bg-background px-2":n.id===i},"mx-2 cursor-pointer break-all border-border"),children:[(0,S.jsxs)("div",{className:"flex w-full px-3 py-4",onClick:e=>{e.preventDefault(),s(null===n||void 0===n?void 0:n.id)},children:[(0,S.jsx)("div",{className:"mr-3 h-9 w-9 flex-shrink-0 rounded-full bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url('".concat(n.createdBy.picture,"')")}}),(0,S.jsxs)("div",{className:"w-full",children:[(0,S.jsx)("div",{}),(0,S.jsxs)("div",{className:"flex gap-2",children:[(0,S.jsx)(D.A,{variant:"t1",size:"caption",children:n.createdBy.name}),(0,S.jsx)(D.A,{size:"caption",children:F()(n.createdAt).fromNow()})]}),(0,S.jsx)(D.A,{size:"caption",children:n.description}),l.map(((e,t)=>e.mimeType.startsWith("image")?(0,S.jsx)("img",{src:e.url,alt:"pinned",className:"mt-2",loading:"lazy"},t):e.mimeType.startsWith("video")?(0,S.jsx)("video",{className:"mt-2 w-full",controls:!0,controlsList:"nodownload",src:e.url},t):e.mimeType.startsWith("audio")?(0,S.jsx)("audio",{className:"mt-2 w-full",controls:!0,controlsList:"nodownload",src:e.url},t):null))]})]}),(0,S.jsx)("div",{className:"p-1",children:"admin"===t.myRole&&(0,S.jsx)(H,{isLastItem:c,unPinSectionMessage:async()=>{try{await y.v.unpinRealtimeSectionMessage(n.id)}catch(e){console.error("Error fetching pinned message:",e)}},isOnlyItem:a})})]})})}function H(e){let{isLastItem:t,unPinSectionMessage:n,isOnlyItem:o}=e;const i=(0,r.useRef)(null),[s,a]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{i.current&&!i.current.contains(e.target)&&a(!1)};return s&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[s]),(0,S.jsxs)("div",{ref:i,className:"relative py-1",children:[(0,S.jsx)("div",{onClick:()=>{a(!s)},className:"flex h-10 w-10 cursor-pointer place-content-center items-center rounded-full hover:shadow",children:(0,S.jsx)(M.A,{icon:"menu-dots-vertical",solid:!0})}),(0,S.jsx)("div",{children:s&&(0,S.jsx)("div",{className:h()("theme-bg-border absolute right-0 z-10 mt-1 block w-44 rounded border bg-card",{"bottom-12":t&&!o}),children:(0,S.jsxs)("div",{className:"flex items-center justify-center gap-2 p-3",onClick:()=>{n(),a(!s)},children:[(0,S.jsx)(M.A,{icon:"thumbtack"}),(0,S.jsx)(u.A,{children:"Unpin message"})]})})})]})}const W=function(e){let{community:t,pinnedMessages:n}=e;const[o,i]=(0,r.useState)(!1),[s,a]=(0,r.useState)(null),l=()=>{i(!o)},c=1===(null===n||void 0===n?void 0:n.length);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{onClick:l,className:"IconButton2 flex cursor-pointer place-content-center items-center gap-1 rounded px-1 text-secondary-foreground ".concat(o&&"bg-background"),children:[(0,S.jsx)(M.A,{icon:"thumbtack",solid:(null===n||void 0===n?void 0:n.length)>0,className:"mt-1",size:"base"}),(null===n||void 0===n?void 0:n.length)>0&&(0,S.jsx)(D.A,{variant:"t1",children:null===n||void 0===n?void 0:n.length})]}),o&&(0,S.jsx)("div",{className:"absolute -left-2 right-4 top-[7.5vh] z-50 justify-center md:ml-40 md:mr-80",children:(0,S.jsxs)("div",{className:"my-2 flex flex-col gap-1 rounded border border-border bg-card",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-background px-2",children:[(0,S.jsxs)(D.A,{variant:"t1",className:"p-3",children:[null===n||void 0===n?void 0:n.length," Pinned message"]}),(0,S.jsx)(U.J,{onClick:l})]}),(0,S.jsx)(V.u,{className:h()("max-h-[60vh]",{"overflow-y-auto":!c}),noItemsElement:(0,S.jsx)("div",{className:"mx-4 flex min-h-[20vh] justify-center bg-card p-4",children:(0,S.jsx)(D.A,{className:"flex items-center justify-center",children:"No pinned message available"})}),items:n,renderItem:(e,r)=>(0,S.jsx)(G,{community:t,pinnedDetails:e,index:r,totalItems:null===n||void 0===n?void 0:n.length,selectedPinnedMessageId:s,setSelectedPinnedMessageId:a,isOnlyItem:c})})]})})]})};var q=n(10515),K=n(2016),Y=n(91900),$=n(51926),Q=n(6560);const Z=(0,c.wj)((0,o.Ng)((e=>({user:e.auth,community:e.community,groups:e.groups})),(e=>(0,a.zH)({},e)))((function(e){let{heading:t="",text:n="",active:r=!1,setActive:o=(e=>{}),onClose:i=(e=>{})}=e;return r?(0,S.jsx)(Y.a,{className:"ShareTextModal",active:r,setActive:o,padding:!1,children:(0,S.jsxs)("div",{className:"pb-4",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between space-x-2 bg-card p-1 pl-4",children:[(0,S.jsx)("span",{className:"my-2 font-semibold",children:t}),(0,S.jsx)(K.A,{icon:q.A,rotate:45,onClick:i})]}),(0,S.jsx)("div",{className:"my-2 px-4 font-semibold text-secondary-foreground/85",children:(0,S.jsx)(u.A,{children:"Share via link"})}),(0,S.jsx)($.A,{text:n,className:"mx-3 bg-card"}),(0,S.jsx)(Q.A,{text:n,className:"mt-4"})]})}):null}))),J=e=>{let{closedSectionMembersCount:t,group:n,setGroup:o,addToast:i,setShowShareModal:s,updateActiveGroup:a,showShareModal:l,joinedMembers:c}=e;const[u,p]=(0,r.useState)(g.NotificationLevel.NONE),[E,N]=(0,r.useState)(!1),[D,T]=(0,r.useState)(!1),[O,z]=(0,r.useState)(!1),[F,U]=(0,r.useState)([]),{community:V,user:G,section:H,personalGroup:q,notificationCentre:K,activeTabModel:Y,socket:$}=(0,m.G)((e=>({user:e.auth,community:e.community,socket:e.socket,section:e.sections.sections,personalGroup:e.personalGroup,notificationCentre:e.notificationCentre,activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null})));(0,r.useEffect)((()=>{(async()=>{try{const e=await y.v.getPinnedSectionMessages(null===n||void 0===n?void 0:n.id,null===Y||void 0===Y?void 0:Y.id);U(e)}catch(e){console.error("Error fetching pinned message:",e)}})()}),[null===n||void 0===n?void 0:n.id,null===Y||void 0===Y?void 0:Y.id]),(0,r.useEffect)((()=>{const e=e=>{U((t=>{const n=[e.message,...t.pinnedMessages];return{...t,pinnedMessages:n}}))},t=e=>{U((t=>{const n=t.pinnedMessages.filter((t=>t.id!==e.message.id));return{...t,pinnedMessages:n}}))};return $.on("section:".concat(Y.id,":message-pinned"),e),$.on("section:".concat(Y.id,":message-unpinned"),t),()=>{$.off("section:".concat(Y.id,":message-pinned"),e),$.off("section:".concat(Y.id,":message-unpinned"),t)}}),[$,Y.id]);const Q=null===F||void 0===F?void 0:F.pinnedMessages;let J=!("joined"===n.joinStatus&&Y.isClosed&&!Y.isJoined)||["admin","moderator"].includes(n.myRole);(0,r.useEffect)((()=>{if(K.preferences&&Y){const e=K.preferences;if(e.tabs&&e.tabs.length>0){const t=e.tabs.find((e=>e.tabId===Y.id));p(t?t.notificationLevel:g.NotificationLevel.ALL)}else p(g.NotificationLevel.ALL)}}),[K]);const X="realtime"!==Y.sectionType;let ee=I(n,Y);return(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:"flex ".concat(X?"flex-col":"flex-row"," items-stretch justify-between sm:flex-row"),children:[(0,S.jsxs)("div",{className:"mt-1.5 flex items-center ".concat(X?"gap-4":"gap-2"),children:[(0,S.jsx)("div",{className:"word-breaker text-base font-semibold text-secondary-foreground",children:Y.emoji+" "+Y.name}),(0,S.jsx)("div",{children:X&&(0,S.jsx)("div",{className:"text-xxs rounded bg-accent px-2.5 py-0.5 text-secondary-foreground",children:Y.isPrivate?(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"eye-crossed",size:"xxs"}),(0,S.jsx)("span",{children:"Private"})]}):Y.isClosed?(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"lock",size:"xxs"}),(0,S.jsx)("span",{children:"Closed"})]}):(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"unlock",size:"xxs"}),(0,S.jsx)("span",{children:"Open"})]})})}),(0,S.jsx)("div",{className:"rounded bg-accent px-2.5 py-0.5 text-secondary-foreground",children:(0,S.jsxs)("div",{className:"text-xxs flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"user",size:"xxs"}),(0,S.jsx)("span",{children:null!==t&&void 0!==t?t:n.userCount})]})}),J&&"joined"===n.joinStatus&&!X&&(0,S.jsx)(W,{community:V,pinnedMessages:Q,activeTabId:"",socket:void 0})]}),(0,S.jsxs)("div",{className:"flex items-center gap-1 md:gap-0",children:[(0,S.jsx)("div",{className:"order-last md:order-none",children:"joined"===n.joinStatus?(0,S.jsx)(S.Fragment,{children:Y.isClosed&&!Y.isJoined?"requested"===Y.status?(0,S.jsx)(A.$,{onClick:()=>{},label:"Requested",disabled:!0}):(0,S.jsx)(j,{activeTabModel:Y,user:G,group:n,updateActiveGroup:o,setGroup:o,addToast:i}):(0,S.jsx)(L.A,{icon:"bell",solid:u!==g.NotificationLevel.NONE,className:h()("",{"text-primary":u!==g.NotificationLevel.NONE}),actions:[{label:"All posts",onClick:()=>{let e={tabId:Y.id,groupId:n.id,notificationLevel:g.NotificationLevel.ALL};k.M.dispatch((0,x.Mn)(e,i))},actionType:u===g.NotificationLevel.ALL?L.X.primary:L.X.default},{label:"Admin posts only",onClick:()=>{let e={tabId:Y.id,groupId:n.id,notificationLevel:g.NotificationLevel.ADMIN};k.M.dispatch((0,x.Mn)(e,i))},actionType:u===g.NotificationLevel.ADMIN?L.X.primary:L.X.default},{label:"None",onClick:()=>{let e={tabId:Y.id,groupId:n.id,notificationLevel:g.NotificationLevel.NONE};k.M.dispatch((0,x.Mn)(e,i))},actionType:u===g.NotificationLevel.NONE?L.X.primary:L.X.default}]})}):!Y.isPrivate&&(0,S.jsx)(S.Fragment,{children:"closed-free"!==n.groupType&&!Y.isClosed&&(0,S.jsx)(b.A,{group:n,setGroup:o,user:G,sectionAuth:Y.postLevel,sectionType:Y.sectionType})})}),"joined"===n.joinStatus?(0,S.jsx)("div",{className:"flex order-last md:order-none",children:(0,S.jsx)(L.A,{className:"text-secondary-foreground",dropdownClassName:"w-52",icon:"settings",actions:[{icon:"share",label:"Share",onClick:()=>{s(!0)}},{icon:"edit",label:Y&&"admin"===n.myRole?"Edit Channel":null,onClick:()=>{N(!0)}},{icon:"trash",label:Y&&"admin"===n.myRole?"Delete Channel":null,onClick:()=>{T(!0)},actionType:"alert"}]})}):(0,S.jsx)(S.Fragment,{}),ee&&X&&(!Y.isClosed||Y.isJoined)?(0,S.jsx)(B.A,{group:n,sectionId:Y.id,addPost:e=>{var t,n;e&&e.tab&&(null===(t=e.tab)||void 0===t?void 0:t.id)===(null===Y||void 0===Y?void 0:Y.id)&&k.M.dispatch((0,w.Q2)([e,...null===(n=H[Y.id])||void 0===n?void 0:n.posts]))}}):(0,S.jsx)(S.Fragment,{}),(0,S.jsx)(P.A,{width:570,setActive:N,active:E,children:(0,S.jsx)(C.A,{isEditingTabActive:E,setIsCreateSectionModalVisible:N,updateActiveGroup:o,selectedTabToEdit:Y})}),(0,S.jsx)(d.c,{active:D,setActive:T,onSubmit:e=>{z(!0),v.Bd.deleteGroupTab(G,q&&q.id===n.id?q.id:n.id,Y.id).then((e=>{let{group:t}=e;z(!1),T(!1),q&&q.id===t.id?((0,_.iz)(t),f.b6.push("/personal-space?tab=".concat(q.tabs[0].id))):a(t)})).catch((e=>{console.log({error:e}),z(!1)}))},header:"Delete Channel",title:"Are you sure you want to delete the channel?",isLoading:O,btnColor:"red",children:void 0}),(0,S.jsx)(Z,{heading:"Share",text:Lt(n,Y),moreInfo:"Share this link with your members for them to join this group.",active:l,setActive:s,onClose:e=>{s(!1)}}),O?(0,S.jsx)(R.a,{}):(0,S.jsx)(S.Fragment,{})]})]})})};var X=n(9175),ee=n(68652),te=n(18228),ne=n(10701),re=n(87573),oe=n(98130),ie=n(36357),se=n(89431),ae=n(97843),le=n(56467),ce=n(1689),de=n(12014),ue=n(58157),pe=n(90559),he=n(54617);const me=function(e){let{active:t=!1,setActive:n=(e=>{}),onClose:o=(()=>{}),user:i,group:s,community:a}=e;const{addToast:l}=(0,X.d)();return(0,S.jsx)(Y.a,{className:"GroupInviteModal",active:t,setActive:n,padding:!1,children:(0,S.jsxs)("div",{className:"bg-background",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between py-1 pl-4",children:[(0,S.jsxs)("span",{className:"text-lg font-bold text-secondary-foreground",children:[(0,S.jsx)(u.A,{children:"Invite to"})," ",s.name]}),(0,S.jsx)(pe.A,{icon:"cross-small",solid:!0,hoverable:!0,size:"2xl",onClick:()=>{n(!1)}})]}),(0,S.jsxs)("div",{className:"bg-card px-4 pt-4",children:[(0,S.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,S.jsx)(M.A,{icon:"link"}),(0,S.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:(0,S.jsx)(u.A,{children:"Invite via link"})})]}),(0,S.jsx)($.A,{className:"mt-2 bg-background text-secondary-foreground/80",text:(0,te.p$)(s)}),(0,S.jsx)(d,{})]})]})});function d(){const e=s.id,[t,d]=(0,r.useState)(!1),[p,h]=(0,r.useState)([{email:"",name:""}]);return(0,S.jsxs)("div",{className:"mt-2 bg-card pb-4 pt-4",children:[(0,S.jsx)("div",{className:"font-semibold text-secondary-foreground/85",children:(0,S.jsx)(u.A,{children:"Invite Members Individually"})}),(0,S.jsx)("div",{className:"",children:p.map(((e,t)=>(0,S.jsxs)("div",{className:"mt-2 flex items-start justify-between space-x-1",children:[(0,S.jsx)(he.k,{placeholder:"Name",noPrefixSeparator:!0,noMargin:!0,large:!0,defaultValue:e.name,inputHolderClassName:"bg-background",containerClassName:"focus:outline-none bg-card rounded",onChange:e=>{const n=[...p];n[t].name=e,h(n)}}),(0,S.jsx)(he.k,{placeholder:"Email Id",type:"email",noPrefixSeparator:!0,validator:e=>{if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*$/.test(e))return"Email is not valid!"},noMargin:!0,large:!0,defaultValue:e.email,inputHolderClassName:"bg-background",containerClassName:"focus:outline-none bg-card rounded ml-2 md:ml-0 flex-grow",onChange:e=>{const n=[...p];n[t].email=e,h(n)}}),(0,S.jsx)(pe.A,{icon:"cross",size:"sm",hoverable:!0,onClick:()=>{const e=[...p];e.splice(t,1),h(e)}})]},t)))}),Array.isArray(p)&&p.length<5&&(0,S.jsx)(ue.A,{prefix:(0,S.jsx)(M.A,{icon:"plus-small"}),className:"mt-1 flex items-center",label:"Add more",onClick:()=>{h([...p,{name:"",email:""}])}}),(0,S.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,S.jsx)(ue.A,{label:"Close",onClick:()=>{n(!1),o()}}),(0,S.jsx)(A.$,{disabled:!p.length||!p.every((e=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*$/.test(e.email))),onClick:t=>{p.length>0&&function(){try{p.filter((e=>e.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))).length!==p.length&&l("Please enter a valid email address","",c.lm.danger);const t={groupId:e==document.location.origin?null:e,additionalMessage:"",memberData:p};d(!0),v._N.inviteByEmail(i,a.id,t).then((()=>{l("Invitation sent successfully","",c.lm.success),n(!1),o()})).catch((e=>{l("Error sending invitation","",c.lm.danger),console.log(e)})).finally((()=>{d(!1)}))}catch(t){console.log(t),d(!1)}}()},label:"Send Invite",large:!0,type:"submit",isLoading:t})]})]})}};var fe=n(55049),ge=n(8934);function be(e){var t;let{active:n,setActive:o,groupId:i,heading:s}=e;const[a,l]=r.useState({}),c=(0,r.useMemo)((()=>new AbortController),[i]),{profileModelState:{setShowProfileModel:d,setIdToViewProfile:u}}=(0,fe.A)();return(0,r.useEffect)((()=>{if(i&&n)return async function(e){try{const t=await v.Bd.groupMembers(c,e,void 0);l(t)}catch(t){console.log(t)}}(i),()=>{c.abort()}}),[c,i,n]),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Y.a,{active:n,setActive:o,padding:!1,children:(0,S.jsxs)("div",{className:"pb-4",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between space-x-2 bg-card p-1 pl-4",children:[(0,S.jsx)("span",{className:"my-2 font-semibold",children:s}),(0,S.jsx)(pe.A,{icon:"cross-small",solid:!0,hoverable:!0,size:"2xl",onClick:()=>{o(!1)}})]}),(0,S.jsx)("div",{className:"my-2 px-4 font-semibold text-secondary-foreground/85",children:(0,S.jsxs)("div",{className:"max-h-[50vh] overflow-y-auto",children:[!(null!==a&&void 0!==a&&a.groupMembers)&&(0,S.jsx)(R.a,{}),null===a||void 0===a||null===(t=a.groupMembers)||void 0===t?void 0:t.map((e=>(0,S.jsx)("div",{className:"my-4",children:(0,S.jsx)(ge.eu,{user:e,extraInfo:e.userId?"@"+e.userId:"",className:"cursor-pointer",onClick:()=>{d(!0),u(e.id)},tag:"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-primary-foreground px-1 font-semibold text-primary",children:"Admin"}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(e.groupRole,(0,S.jsx)(S.Fragment,{}))})},e.id)))]})})]})})})}const ve=(0,o.Ng)((e=>({user:e.auth,activeGroup:e.activeGroup,groups:e.groups,community:e.community,mySubscription:e.mySubscription,subscriptionsPlan:e.subscriptionsPlan,socket:e.socket})),(e=>(0,a.zH)({cancelMySubscription:oe.mU,updateGroups:E.$Y,updateActiveGroup:E.eP},e)))((function(e){var t,n;let{group:o,setGroup:i,user:a,activeTab:l,socket:p,community:m,showShareModal:g,subscriptionsPlan:y,setShowShareModal:k,mySubscription:w,cancelMySubscription:x=(()=>{}),updateActiveGroup:_=(e=>{})}=e;const[A,j]=(0,r.useState)({}),[E,D]=(0,r.useState)(!1),[I,O]=(0,r.useState)(!1),[B,z]=(0,r.useState)(!1),[F,U]=(0,r.useState)(!1),[V,G]=(0,r.useState)(!1),[H,W]=(0,r.useState)(!1),[q,K]=(0,r.useState)(!1),[Y,$]=(0,r.useState)(!1),[Q,J]=(0,r.useState)(!1),[oe,ue]=(0,r.useState)(!1),[pe,he]=(0,r.useState)(!1),fe=null===o||void 0===o||null===(t=o.tabs)||void 0===t?void 0:t.find((e=>e.id===l)),{addToast:ge}=(0,X.d)(),ve=(0,r.useMemo)((()=>se.F.filterSubscriptionsForGroup(o.id,y)),[y,o.id]),ye=se.F.isSubscriptionPurchasedByGroup(w,o.id);return(0,r.useEffect)((()=>{const e=()=>{D(window.innerWidth<1201)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,S.jsxs)(S.Fragment,{children:[fe?(0,S.jsx)(s.N_,{to:(0,te.wE)(o.id),className:"my-2 block font-semibold",children:o.name}):(0,S.jsx)(S.Fragment,{}),(0,S.jsxs)("div",{className:"GroupInfo mb-4 bg-card lg:-mx-10",children:[o.banner&&!o.color?(0,S.jsx)("div",{className:"GroupBanner relative left-0 top-0 overflow-hidden",children:(0,S.jsx)(ce.A,{src:o.banner,alt:"Group Banner",className:"absolute left-0 top-0 h-full w-full object-cover"})}):(0,S.jsx)(S.Fragment,{}),(0,S.jsxs)("div",{className:"flex items-stretch justify-between px-5 pb-2.5 pt-5 text-secondary-foreground",children:[(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("div",{className:h()("overflow-ellipsis text-base font-bold text-secondary-foreground"),children:fe?fe.emoji+" "+fe.name:o.name}),(0,S.jsx)("div",{className:"rounded bg-accent px-2.5 py-0.5",children:(0,S.jsxs)("div",{className:"text-xxs flex items-center gap-1.5",children:[o.groupType===ee.A.GROUP.CLOSED&&!o.isOnlyVisibleToMembers&&(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"lock",size:"xxs"}),(0,S.jsx)("span",{children:"Closed"})]})," ",o.groupType===ee.A.GROUP.OPEN&&(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"unlock",size:"xxs"}),(0,S.jsx)("span",{children:"Open"})]})," ",o.isOnlyVisibleToMembers&&(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"eye-crossed",size:"xxs"}),(0,S.jsx)("span",{children:"Private"})]})]})}),(0,S.jsx)("div",{className:"w-fit rounded bg-accent px-2.5 py-0.5",children:(0,S.jsxs)("div",{className:"text-xxs flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"user",size:"xxs"}),(0,S.jsx)("span",{children:o.userCount})]})})]}),(0,S.jsxs)("div",{className:"flex items-center",children:[(0,S.jsx)("div",{className:"mx-2",children:"joined"===o.joinStatus&&["admin","moderator"].includes(null!==(n=o.myRole)&&void 0!==n?n:"")?fe?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)("button",{onClick:e=>{J(!0)},className:"rounded border border-primary px-2.5 py-1 font-semibold text-primary focus:outline-none",children:(0,S.jsx)(u.A,{children:"Invite Members"})}):"joined"===o.joinStatus?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(b.A,{group:o,setGroup:i,user:a})}),"joined"===o.joinStatus?(0,S.jsx)("div",{className:"flex flex-1 place-content-end",children:(0,S.jsx)(ie.av,{value:"admin"===o.myRole,ifPresent:()=>(0,S.jsx)(L.A,{icon:"settings",actions:[E&&{icon:"user",label:"Group members",onClick:()=>{U(!0)}},{icon:"share",label:"Share",onClick:()=>{k(!0)}},{icon:"globe",label:fe?"Embed Channel":null,onClick:()=>{z(!0)}},{icon:"edit",label:fe?"Edit Channel":null,onClick:()=>{K(!0)}},{icon:"trash",label:fe?"Delete Channel":null,onClick:()=>{window.confirm("Are you sure you want to delete the channel?")&&($(!0),v.Bd.deleteGroupTab(a,o.id,null===fe||void 0===fe?void 0:fe.id).then((e=>{let{group:t}=e;$(!1),i(t)})).catch((e=>{console.log({error:e}),alert("Something went wrong!"),$(!1)})))},actionType:"alert"},{icon:"edit",label:fe?null:"Edit group",onClick:()=>{O(!0)}},{icon:"trash",label:fe?null:"Delete group",onClick:()=>{G(!0)},actionType:"alert"},{icon:"sign-out",label:"admin"!==o.myRole?"Leave":null,onClick:e=>{W(!0)},actionType:"alert"}]}),ifAbsent:()=>(0,S.jsx)(L.A,{actions:[E&&{icon:"user",label:"Group members",onClick:()=>{U(!0)}},{icon:"share",label:"Share",onClick:()=>{k(!0)}},{label:ye?"Change Plan":null,onClick:e=>{ue(!0)}},{label:ye?"Cancel subscription plan":null,onClick:e=>{he(!0)},actionType:"alert"},{icon:"sign-out",label:ye?null:"Leave",onClick:e=>{W(!0)},actionType:"alert"}]})})}):(0,S.jsx)(S.Fragment,{}),(0,S.jsx)(P.A,{width:570,setActive:K,active:q,children:(0,S.jsx)(C.A,{isEditingTabActive:q,setIsCreateSectionModalVisible:K,updateActiveGroup:i,selectedTabToEdit:fe})}),(0,S.jsx)(d.c,{active:"admin"!==o.myRole?H:V,setActive:"admin"!==o.myRole?W:G,onSubmit:"admin"!==o.myRole?()=>{$(!0),v.Bd.leaveGroup(a,o.id).then((e=>{i(e.group),$(!1),W(!1),ge("Group left!","","success"),re.A.logEvent(re.B.Group.name,re.B.Group.leave)})).catch((e=>{$(!1),W(!1),console.log(e),ge("Unable to leave group.","","danger")}))}:()=>{$(!0),v.Bd.deleteGroup(a,o.id).then((e=>{i(e.group),ge("Group deleted!"),_(e.group),G(!1),f.b6.push("/")})).catch((e=>{console.log(e),G(!1),ge("Group could not be deleted!","","danger")})).finally((()=>{$(!1)}))},header:"".concat("admin"!==o.myRole?"Leave":"Delete"," Group"),title:"Are you sure you want to ".concat("admin"!==o.myRole?"leave":"delete"," the group?"),isLoading:Y,btnColor:"red"}),(0,S.jsx)(Z,{heading:"Share Group",text:(0,te.p$)(o),active:g,setActive:k,onClose:e=>{k(!1)}}),(0,S.jsx)(be,{setActive:U,heading:"Group members",active:F,groupId:o.id}),(0,S.jsx)(me,{group:o,active:Q,setActive:J,community:m,user:a}),(0,S.jsx)(ne.U,{group:o,community:m,user:a,plans:ve,header:null===o||void 0===o?void 0:o.name,setActive:ue,active:oe,mySubscription:w,socket:p}),(0,S.jsx)(le.i,{title:"Are you sure you want to cancel your subscription?",active:pe,setActive:he,btnColor:"red",onCancelSubmit:()=>{he(!1)},onSubmit:()=>{$(!0),x({onSuccess:()=>{$(!1),he(!1),ge("Subscription cancelled successfully",""),setTimeout((()=>{window.location.reload()}),2e3)},onError:e=>{console.log(e),$(!1),he(!1),ge("Failed to cancel subscription","",c.lm.danger)}})},header:"Cancel Subscription",isLoading:Y,width:400,labelCancel:"No, keep my subscription",labelSubmit:"Cancel my subscription",subTitle:"You will lose access to all the premium features of the subscription plan."}),Y?(0,S.jsx)(R.a,{}):(0,S.jsx)(S.Fragment,{})]})]}),fe?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)("div",{className:h()("px-5 pb-2.5 text-secondary-foreground",{hidden:!ae.A.hasValue(o.description)}),children:(0,S.jsx)(de.F,{text:o.description})})]}),(0,S.jsx)(P.A,{width:570,setActive:O,active:I,children:(0,S.jsx)(T.A,{group:o,isEditGroupModalVisible:I,setIsEditGroupModalVisible:O,setIsCreateGroupModalVisible:O,updateGroup:e=>{ge("Group updated!","","success"),i(e)}})}),fe?(0,S.jsx)(N.A,{link:"http://embed.pensil.com"+(window.location.port?":"+window.location.port:"")+"/group/"+o.id+"/feed/"+fe.id,active:B,setActive:z}):(0,S.jsx)(S.Fragment,{})]})}));var ye=n(24881),ke=n(47669),we=n(46997),xe=n(55267),_e=n(42017);const Ae=(0,c.wj)((0,o.Ng)((e=>({notificationCentre:e.notificationCentre,community:e.community,socket:e.socket})))((function(e){let{group:t,setGroup:n,user:o,activeTabModel:i,activeTab:s,showShareModal:a,setShowShareModal:l,notificationCentre:c,community:u,socket:p,addToast:h=(e=>{})}=e;const[m,f]=(0,r.useState)(!1),[b,k]=(0,r.useState)(!1),[w,x]=(0,r.useState)(!1),[_,A]=(0,r.useState)(!1),[C,j]=(0,r.useState)(!1),[E,D]=(0,r.useState)(!1),[M,I]=(0,r.useState)([]),[O,L]=(0,r.useState)(g.NotificationLevel.NONE);return!("joined"===t.joinStatus&&i.isClosed&&!i.isJoined)||["admin","moderator"].includes(t.myRole),(0,r.useEffect)((()=>{(async()=>{try{const e=await y.v.getPinnedSectionMessages(null===t||void 0===t?void 0:t.id,null===i||void 0===i?void 0:i.id);I(e)}catch(e){console.error("Error fetching pinned message:",e)}})()}),[null===t||void 0===t?void 0:t.id,null===i||void 0===i?void 0:i.id]),(0,r.useEffect)((()=>{const e=e=>{I((t=>{const n=[e.message,...t.pinnedMessages];return{...t,pinnedMessages:n}}))},t=e=>{I((t=>{const n=t.pinnedMessages.filter((t=>t.id!==e.message.id));return{...t,pinnedMessages:n}}))};return p.on("section:".concat(i.id,":message-pinned"),e),p.on("section:".concat(i.id,":message-unpinned"),t),()=>{p.off("section:".concat(i.id,":message-pinned"),e),p.off("section:".concat(i.id,":message-unpinned"),t)}}),[p,i.id]),null===M||void 0===M||M.pinnedMessages,(0,r.useEffect)((()=>{if(c.preferences&&i){const e=c.preferences;if(e.tabs&&e.tabs.length>0){const t=e.tabs.find((e=>e.tabId===i.id));L(t?t.notificationLevel:g.NotificationLevel.ALL)}else L(g.NotificationLevel.ALL)}}),[c,s]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(P.A,{width:570,setActive:f,active:m,children:(0,S.jsx)(T.A,{group:t,isEditGroupModalVisible:m,setIsEditGroupModalVisible:f,setIsCreateGroupModalVisible:f,updateGroup:e=>{h("Group updated!","","success"),n(e)}})}),i&&(0,S.jsx)(N.A,{link:"http://embed.pensil.com"+(window.location.port?":"+window.location.port:"")+"/group/"+t.id+"/feed/"+i.id,active:b,setActive:k}),(0,S.jsx)(d.c,{active:E||C,setActive:E?D:j,onSubmit:E?()=>{A(!0),v.Bd.leaveGroup(o,t.id).then((e=>{n(e.group),A(!1),D(!1),re.A.logEvent(re.B.Group.name,re.B.Group.leave)})).catch((e=>{A(!1),D(!1)}))}:()=>{A(!0),v.Bd.deleteGroupTab(o,t.id,i.id).then((e=>{let{group:t}=e;A(!1),n(t),j(!1)})).catch((e=>{console.log({error:e}),alert("Something went wrong!"),A(!1),j(!1)}))},header:"".concat(E?"Leave":"Delete"," Channel"),btnColor:"red",title:"Are you sure you want to ".concat(E?"leave":"delete"," the Channel?")})]})})));var Ce=n(24608),Se=n(19681);function je(e){let{group:t,setGroup:n,user:r}=e;return(0,S.jsx)("div",{className:"no-post my-16 p-2 text-center",children:"open"===t.groupType||"joined"===t.joinStatus?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"my-3 font-bold",children:(0,S.jsx)(u.A,{children:"Looks like it's lonely here."})}),(0,S.jsx)("div",{children:(0,S.jsx)(u.A,{children:"Try exploring other Channels and groups."})})]}):"closed-paid"===t.groupType?(0,S.jsxs)("div",{className:"flex flex-col items-center space-y-6",children:[(0,S.jsx)("div",{className:"my-3 font-bold",children:"Please proceed with the payment or contact admin to gain access to this group."}),(0,S.jsx)(b.A,{group:t,setGroup:n,user:r})]}):(0,S.jsxs)("div",{className:"flex flex-col items-center space-y-6",children:[(0,S.jsx)("div",{className:"my-3 font-bold",children:(0,S.jsx)(u.A,{children:"This is a closed group You'll need access to this group."})}),(0,S.jsx)("div",{className:"my-4",children:(0,S.jsx)(b.A,{group:t,setGroup:n,user:r})})]})})}var Ee=n(29646);function Ne(e){let{group:t,activeTabModel:n,setGroup:r,user:o}=e;return(0,S.jsx)("div",{className:"no-post my-10 p-2 text-center",children:["closed-free","closed-paid"].includes(t.groupType)&&"joined"!==t.joinStatus&&!n.isPrivate?(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(je,{user:o,group:t,setGroup:r})}):(0,S.jsxs)(S.Fragment,{children:[null===n.status&&n.isClosed&&n.isPrivate&&(0,S.jsxs)("div",{className:"my-3",children:[(0,S.jsx)("p",{className:"font-bold",children:"This is a private channel"}),(0,S.jsx)("p",{children:"You'll need access to this channel"})]})||n.isClosed&&!n.isJoined&&"requested"!==n.status&&(0,S.jsx)("div",{children:(0,S.jsxs)("div",{className:"no-post my-3 flex flex-col items-center",children:[(0,S.jsx)("p",{className:"font-bold",children:"This is a closed channel"}),(0,S.jsx)("p",{className:"mb-10",children:"You'll need access to this channel"}),"joined"!==t.joinStatus&&(0,S.jsx)(Ee.A,{label:"Join group",children:(0,S.jsx)(b.A,{group:t,setGroup:r,user:o})})]})}),"requested"===n.status&&(0,S.jsxs)("div",{className:"no-post my-3 text-secondary-foreground",children:[(0,S.jsx)("p",{className:"font-bold",children:"Your request is waiting approval."}),(0,S.jsx)("p",{children:"Once your request is approved, you will be able to interact here."})]})]})})}function Pe(){const e=document.getElementById("realtime-section-detail");e.scrollTop=e.scrollHeight}const De=(0,o.Ng)((e=>({socket:e.socket,sectionMessages:e.sectionMessages,community:e.community})),(e=>(0,a.zH)({getSectionMessages:ke.Cv,addSectionMessage:ke.Ys,updateSectionMessage:ke.sc,removeSectionMessage:ke.B1,updateSectionMessageReaction:ke.Ll},e)))((0,c.wj)((function(e){let{user:t=null,group:n=null,socket:o=null,community:i,activeTabModel:s=null,addToast:a=(e=>{}),setGroup:l=(e=>{}),sectionMessages:c,showShareModal:d,setShowShareModal:u,addSectionMessage:p,removeSectionMessage:h,updateSectionMessage:m,getSectionMessages:f,updateSectionMessageReaction:g}=e;const b=s.id;(0,r.useEffect)((()=>{k.M.dispatch((0,we.$G)(b))}),[b]);const[v,y]=(0,r.useState)([]),{messages:w,isLoading:x,isFirstLoading:_,error:C,noMoreMessages:j}=c,E="admin"===(null===i||void 0===i?void 0:i.myRole),N=["admin","moderator"].includes(n.myRole);(0,r.useEffect)((()=>{const e=e=>{p(e.message),e.message.parent||Pe()},t=e=>{h(e.messageId)},n=e=>{m(e.message)},r=e=>{g(e,JSON.parse(localStorage.getItem("pensil.user")))};return o.on("section:".concat(b,":message-received"),e),o.on("section:".concat(b,":message-deleted"),t),o.on("section:".concat(b,":message-edited"),n),o.on("section:".concat(b,":message-edited"),n),o.on("section:".concat(b,":message-reaction"),r),()=>{o.off("section:".concat(b,":message-received"),e),o.off("section:".concat(b,":message-deleted"),t),o.off("section:".concat(b,":message-edited"),n),o.off("section:".concat(b,":message-reaction"),r)}}),[o,b]),(0,r.useEffect)((()=>{_||Pe()}),[_]),(0,r.useEffect)((()=>{!b||"joined"!==n.joinStatus||s.isClosed&&!s.isJoined||f(n.id,b,!0)}),[t,n.id,b]);let P="joined"===n.joinStatus&&(!s||!(s.isClosed&&!s.isJoined)&&("admin"!==s.postLevel||!!["admin","moderator"].includes(n.myRole)));const D=()=>{x||j||f(n.id,b)};return _?(0,S.jsx)("div",{className:"order border-border bg-card",children:(0,S.jsx)(Ce.A,{length:6})}):(0,S.jsxs)("div",{className:"RealtimeSectionDetailComponent flex flex-col",children:[(0,S.jsx)(Ae,{group:n,setGroup:l,messages:c,user:t,activeTabModel:s,showShareModal:d,setShowShareModal:u}),(0,S.jsxs)("div",{id:"realtime-section-detail",className:"relative flex h-[calc(100vh-110px)] flex-col overflow-y-auto border-t border-border bg-card",children:[(0,S.jsx)(ie.av,{value:!x||null,ifPresent:()=>(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(ie.av,{value:!(j||!(E||N||t&&s.isClosed&&s.isJoined)),ifPresent:()=>(0,S.jsx)("div",{className:"m-3 flex justify-center",children:(0,S.jsx)(A.$,{flat:!0,label:"Load more",onClick:D})}),ifAbsent:()=>(0,S.jsx)(S.Fragment,{})})}),ifAbsent:()=>(0,S.jsx)("div",{className:"m-3 flex justify-center",children:(0,S.jsx)(R.a,{})})}),_||0!==w.length?_?(0,S.jsx)("div",{className:"my-10 flex justify-center",children:(0,S.jsx)(R.a,{})}):(0,S.jsx)(_e.g,{messages:w,group:n,activeTabModel:s,isUserAllowedToPost:!0,setMessages:e=>{},deleteMessage:e=>ye.b.deleteMessage(t,e)}):s.isClosed&&!s.isJoined?(0,S.jsx)(Ne,{user:t,group:n,setGroup:l,activeTabModel:s}):P?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"no-post flex flex-grow flex-col items-center justify-center py-2 text-center",children:(0,S.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,S.jsx)("span",{className:"mb-3 font-semibold",children:"Welcome to"}),(0,S.jsxs)("span",{className:"text-xl font-semibold",children:[s.emoji," ",s.name]})]})}),(0,S.jsx)(xe.q1,{message:{description:"Created this channel",createdAt:n.createdAt,createdBy:n.createdBy},activeTabModel:s})]}):(0,S.jsx)(je,{user:t,group:n,setGroup:l}),P&&(0,S.jsx)("div",{className:"RealtimeCreatePostCard absolute bg-card px-5 py-2.5",children:(0,S.jsx)(Se.A,{community:i,user:t,groupId:n.id,group:n,activeTab:s,tabId:null!==b&&void 0!==b?b:s.id,attachments:v,setAttachments:y,updateMessage:e=>{m(e)}})})]})]})})));var Me,Te=n(65186),Ie=n(16118),Oe=n(68491),Le=n(93591),Re=n(97482),Be=n(46420);function ze(e){let{onClick:t,newPostCount:n}=e;return n?(0,S.jsx)(Fe,{onClick:t,children:(0,S.jsxs)("div",{className:"-mt-5 rounded-full bg-primary px-10 py-2 text-white",children:[n," new posts"]})}):(0,S.jsx)(S.Fragment,{})}const Fe=n(25289).Ay.div(Me||(Me=(0,Be.A)(["\n cursor: pointer;\n position: fixed;\n left: calc(50% - 100px);\n top: 8rem;\n width: 200px;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n"])));var Ue=n(64447),Ve=n(36646),Ge=n(30762),He=n.n(Ge),We=n(38545),qe=n(35084),Ke=n(85947),Ye=n(86789),$e=n(93092);const Qe=function(e){var t;let{post:n,user:o,addToast:i,updatePost:s=(e=>{}),deletePost:a=(e=>{})}=e;const[l,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),{analyticsService:b}=(0,Te.W)(),{hideLikes:y,hideComment:k,hideCreator:w,hideDate:x}=null!==(t=n.preferences)&&void 0!==t?t:{},_=n.title?A(n.title):n.description?A(He()(n.description)):void 0;function A(e){return e.length>55?e.substring(0,70)+"...":e}return(0,S.jsxs)("div",{className:"SquarePostCard h-full cursor-pointer bg-card",children:[(0,S.jsxs)("div",{className:"group flex h-full flex-col",onClick:()=>{f.b6.push((0,We.createPostDetailPageRouteFromSlug)(n))},children:[n.banner?(0,S.jsx)("div",{className:"relative",children:(0,S.jsx)(ce.A,{src:n.banner,className:"flex-none",alt:"banner"})}):n.images&&n.images.length>0?(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(ce.A,{src:n.images[0],style:{aspectRatio:"16/9",minHeight:"176px",maxHeight:"176px"},className:"flex-none object-cover",alt:"banner"})}):(0,S.jsx)("div",{className:"bg-primary",style:{minHeight:"176px",maxHeight:"176px"}}),(0,S.jsxs)("div",{className:"flex h-full flex-grow flex-col p-4",children:[_?(0,S.jsx)("div",{className:"flex-none break-words text-sm font-semibold text-secondary-foreground",children:_}):(0,S.jsx)("div",{className:"text-sm text-secondary-foreground/70",children:"No Caption Available"}),(0,S.jsxs)("div",{className:"mt-4 flex justify-between",children:[w?(0,S.jsx)("div",{}):(0,S.jsxs)("div",{className:"flex gap-2.5",children:[(0,S.jsx)("img",{src:n.createdBy.picture,alt:"",className:"h-9 w-9 rounded-full"}),(0,S.jsxs)("div",{className:"flex flex-col",children:[(0,S.jsxs)("div",{className:"text-xxs flex gap-1.5 font-semibold text-secondary-foreground",children:[(0,S.jsx)("span",{children:n.createdBy.name}),(0,S.jsx)("span",{className:"".concat(x&&"hidden"),children:(0,qe.Y)(n.createdAt)})]}),(0,S.jsxs)("div",{className:"mt-2.5 flex items-center gap-2.5",children:[(0,S.jsx)("div",{className:h()("mr-1 flex items-center",{hidden:y}),children:(0,S.jsxs)("button",{className:h()("flex h-4 items-center",{"text-primary":n.isLikedByMe,hidden:y,"mr-2":!y}),onClick:()=>{if(m||!o)return;g(!0);(n.isLikedByMe?v.K$.dislikePost(o,n.id):v.K$.likePost(o,n.id)).then((e=>{let{post:t}=e;if(s(t),!t.isLikedByMe){re.A.logEvent(re.B.Post.name,Number(re.B.Post.like));const e={userType:t.community.myRole,groupName:null===t||void 0===t?void 0:t.group.name,sectionName:null===t||void 0===t?void 0:t.tab.name,postUrl:window.location.origin+(0,We.createPostDetailPageRouteFromSlug)(t)};b.track("like-post",e)}})).catch((e=>{console.error({err:e})})).finally((()=>{g(!1)}))},children:[(0,S.jsx)(Ke.$,{fill:n.isLikedByMe?"":"none",className:h()("mb-1 flex items-center text-xs",{"text-primary":n.isLikedByMe,"text-secondary-foreground":!n.isLikedByMe,hidden:y}),stroke:n.isLikedByMe?"none":"currentColor"}),(0,S.jsxs)("span",{className:"-mt-1 text-xs text-secondary-foreground",children:["\xa0",n.likeCount>0?1===n.likeCount?"1":n.likeCount:""]})]})}),(0,S.jsx)("div",{className:h()("flex items-center",{hidden:k}),children:(0,S.jsx)(pe.A,{onClick:e=>{f.b6.push((0,We.createPostDetailPageRouteFromSlug)(n))},icon:"comment-alt",className:"-mt-0.5 text-secondary-foreground",label:"".concat(n.commentCount),size:"xs"})})]})]})]}),(0,S.jsx)(C,{})]}),(0,S.jsx)("div",{className:"flex-grow bg-card"})]})]}),(0,S.jsx)($e.io,{isProcessing:u})]});function C(){if(!o)return null;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(L.A,{className:"text-secondary-foreground",hideOnEmpty:!0,dropdownClassName:n.isBookmarkedByMe?"w-56":"w-40",actions:[{label:o&&n.createdBy.id===o.id?"Edit":"",icon:"edit",onClick:()=>d(!0)},{label:n.canDelete?"Delete":"",icon:"trash",onClick:()=>(p(!0),void v.K$.deletePost(o,n.id).then((()=>{i("Post deleted"),a(n)})).catch((e=>{console.log(e),i(e.message,"",c.lm.error)})).finally((()=>{p(!1)}))),actionType:L.X.alert},{icon:"bookmark",solidIcon:n.isBookmarkedByMe,label:n.isBookmarkedByMe?"Remove Bookmark":"Bookmark",onClick:()=>{(n.isBookmarkedByMe?v.K$.removeBookmark(o,n.id):v.K$.bookmarkPost(o,n.id)).then((()=>{s({...n,isBookmarkedByMe:!n.isBookmarkedByMe}),i(n.isBookmarkedByMe?"Bookmark removed":"Bookmark added!","",n.isBookmarkedByMe?c.lm.info:c.lm.success)})).catch((e=>{i(e.message,"",c.lm.error)}))}}]}),l?(0,S.jsx)(Ye.A,{postToUpdate:n,active:l,setActive:d,updatePost:s}):(0,S.jsx)(S.Fragment,{})]})}},Ze=(0,c.wj)(Qe);function Je(e){let{posts:t,user:n,isLoading:r,footerElement:o}=e;const i=(0,m.j)();return(0,S.jsx)(V.u,{items:t,className:"mt-2 grid grid-cols-1 gap-3 px-2 sm:grid-cols-2 sm:px-0",renderItem:(e,r)=>(0,S.jsx)(Ze,{post:e,user:n,updatePost:e=>{const n=t.findIndex((t=>t.id===e.id)),r=[...t];r.splice(n,1,e),i((0,w.Q2)(r))},deletePost:e=>{const n=t.findIndex((t=>t.id===e.id)),r=[...t];r.splice(n,1),i((0,w.Q2)(r))}},e.id),loading:r,footerElement:o,noItemsElement:(0,S.jsx)("div",{className:"mt-20 text-center font-black text-secondary-foreground",children:(0,S.jsx)(u.A,{children:"Start a discussion"})}),placeholder:(0,S.jsx)("div",{className:"PostList my-2 grid grid-cols-1 gap-4 rounded p-2 px-2 sm:grid-cols-2 sm:px-0",children:Array.from({length:6}).map(((e,t)=>(0,S.jsx)(Ve.A,{length:1,type:Ve.D.compact,className:"rounded-md bg-card"},t)))})})}var Xe=n(18040);function et(e){let{user:t,activeTabModel:n,posts:r,setPosts:o,pinnedPosts:i,noMorePosts:s=!1,onTopicSelect:a,isLoadingPosts:l=!1,isLoadingMorePosts:c=!1}=e;const d=(0,m.j)();return"grid"===n.sectionView?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Je,{user:t,isLoading:l,posts:r}),(0,S.jsx)(S.Fragment,{children:c?(0,S.jsx)("div",{className:"PostList my-2 grid grid-cols-1 gap-4 rounded p-2 px-2 sm:grid-cols-2 sm:px-0",children:Array.from({length:6}).map(((e,t)=>(0,S.jsx)(Ve.A,{length:1,type:Ve.D.compact,className:"rounded-md bg-card"},t)))}):(0,S.jsx)("div",{className:"h-96"})})]}):"compact"===n.sectionView?(0,S.jsx)(S.Fragment,{children:null===r||void 0===r?void 0:r.map((e=>{var n,i;return(0,S.jsx)(Ue.z,{post:e,user:t,showChannelName:!1,updatePost:e=>{const t=r.findIndex((t=>t.id===e.id)),n=[...r];n.splice(t,1,e),o(n)},showFullPost:1===r.length,deletePost:e=>{const t=r.findIndex((t=>t.id===e.id)),n=[...r];n.splice(t,1),o(n)},displayLikeCommentIcons:!(null!==(n=e.preferences)&&void 0!==n&&n.hideLikes&&null!==(i=e.preferences)&&void 0!==i&&i.hideComment)},e.id)}))}):(0,S.jsxs)("div",{children:[(0,S.jsx)(Xe.B,{posts:i,allPosts:r,onTopicSelect:a,onPostUpdate:(e,t)=>{e.isPinned&&d((0,w.$8)(e)),t&&d((0,w.Q2)(t))}}),(0,S.jsx)(Xe.B,{posts:r.filter((e=>!e.isPinned)),allPosts:r,isLoading:l,onTopicSelect:a,placeholder:(0,S.jsx)(Ve.A,{length:6,type:Ve.D.comfortable,className:"rounded-md bg-card"}),footerElement:(0,S.jsxs)(S.Fragment,{children:[c&&(0,S.jsx)("div",{className:"PostList my-2 rounded bg-card p-2",children:(0,S.jsx)(Ve.A,{length:3,type:Ve.D.compact,className:"rounded-md bg-card"})}),s&&(0,S.jsx)("div",{className:"flex h-32 place-content-center items-center text-xs text-secondary-foreground/80",children:(0,S.jsx)(u.A,{children:"Looks like you have reached the end of the list, No more post to display"})})]}),onPostUpdate:(e,t)=>{e.isPinned&&d((0,w.$8)(e)),t&&d((0,w.Q2)(t))}})]})}function tt(e){let{group:t,sectionId:n,posts:r,isUserAllowedToPost:o,setShowShareModal:i=(e=>{})}=e;const s=(0,m.j)();return(0,S.jsx)("div",{children:(0,S.jsxs)("div",{className:"no-post my-10 p-2 text-center text-secondary-foreground",children:[(0,S.jsx)("div",{className:"my-3 font-bold",children:(0,S.jsx)(u.A,{children:"Start a discussion"})}),(0,S.jsxs)("div",{children:[o&&(0,S.jsx)("span",{className:"select-none text-left",children:(0,S.jsx)(B.A,{group:t,sectionId:n,addPost:e=>{var t;e&&e.tab&&(null===(t=e.tab)||void 0===t?void 0:t.id)===n&&s((0,w.Q2)([e,...r]))},inlineButtonComponent:(0,S.jsx)("span",{className:"cursor-pointer text-primary",children:(0,S.jsx)(u.A,{children:"Post something"})})})}),(0,S.jsx)("span",{className:"px-2",children:(0,S.jsx)(u.A,{children:"or"})}),(0,S.jsx)("span",{onClick:e=>{i(!0)},className:"cursor-pointer select-none text-primary",children:(0,S.jsx)(u.A,{children:"Invite your audience"})})]})]})})}const nt={getSectionPinnedPosts:w.f8,setPosts:w.Q2,resetNewPostCount:w.F9},rt=(0,o.Ng)((e=>({section:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null,community:e.community})),nt)((0,c.wj)((function(e){let{user:t=null,group:n=null,community:o,setGroup:i=(e=>{}),activeTabModel:s=null,showShareModal:a=!1,setShowShareModal:l=(e=>{}),addToast:c=(e=>{}),updateActiveGroup:d=(e=>{}),section:p,setPosts:h,getSectionPinnedPosts:f,resetNewPostCount:g}=e;const{pinnedPosts:b,posts:v,currentPage:y,isLoadingPosts:k,isLoadingMorePosts:x,noMorePosts:_,newPostCount:A}=p,C=(0,r.useRef)(),j=(0,m.j)(),{analyticsService:E}=(0,Te.W)(),[N,P]=(0,r.useState)(""),{topics:D}=(0,m.G)((e=>({topics:e.communityTopics.topics}))),[T,I]=(0,r.useState)(!1),[L,R]=(0,r.useState)(null),[z,F]=(0,r.useState)([{label:"All",key:"",icon:""}]),[U,V]=(0,r.useState)([]),G=()=>{if(L){const e=z.filter((e=>e.key!==L.key));F(e)}R(null),P(z[0].key)};(0,r.useEffect)((()=>{if(L){const e=z.filter((e=>!e.isCommunityTopic));F([...e,L]),P(L.key)}}),[L]),(0,r.useEffect)((()=>{s&&s.id&&("open"!==n.groupType&&"joined"!==n.joinStatus||s.isClosed&&!s.isJoined||(V(s.topics),j((0,w.ZA)(n.id,s.id,N))))}),[t,null===n||void 0===n?void 0:n.id,N,null===s||void 0===s?void 0:s.id]);const H=null===n||void 0===n?void 0:n.id,W=null===s||void 0===s?void 0:s.id,q=("open"===n.groupType||"joined"===n.joinStatus)&&(!s.isClosed||s.isJoined);(0,r.useEffect)((()=>{W&&q&&f(H,W)}),[H,q,W]);let K="joined"===n.joinStatus&&(!s||!(s.isClosed&&!s.isJoined)&&("admin"!==s.postLevel||("admin"===n.myRole||"moderator"===n.myRole)));if((0,r.useEffect)((()=>{const e=()=>{window.innerHeight+window.scrollY+100>=document.body.offsetHeight&&(x||_||s&&s.id&&j((0,w.ZA)(n.id,s.id,N,y+1)))};if(C.current=e,("open"===n.groupType||"joined"===n.joinStatus)&&(!s.isClosed||s.isJoined))return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[x,t,y,v,n,_,s]),s.isClosed&&!s.isJoined)return(0,S.jsx)(Ne,{user:t,group:n,setGroup:i,activeTabModel:s});const Y=null===D||void 0===D?void 0:D.filter((e=>e.postCount>0&&"ACTIVE"===e.status&&(null===U||void 0===U?void 0:U.includes(e.id))));return(0,S.jsxs)("main",{className:"SectionDetail",children:[(0,S.jsx)(O,{group:n,setGroup:i,user:t,sectionId:s.id,showShareModal:a,setShowShareModal:l,addPost:e=>{e&&h([e,...v])},updateActiveGroup:d}),(0,S.jsxs)(Le.g,{className:"SectionDetail relative max-w-[640px]",children:[t&&s&&K&&(0,S.jsx)(B.A,{user:t,group:n,groups:void 0,sectionId:s.id,addPost:e=>{h([e,...v])},addToast:c,community:o,inlineDivComponent:(0,S.jsx)(S.Fragment,{children:(0,S.jsx)("div",{className:"PostList mb-3 w-full cursor-pointer rounded-xl bg-card p-3 shadow-sm",children:(0,S.jsx)("div",{className:"flex items-center justify-between",children:(0,S.jsxs)("div",{className:"flex w-full items-center",children:[(0,S.jsx)(ge.eu,{user:t,noName:!0,className:"flex-none",size:45,extraInfo:null}),(0,S.jsxs)("div",{className:"flex w-full flex-grow justify-between rounded-full border border-border bg-background px-5 py-2 font-semibold text-secondary-foreground/80",onClick:()=>{E.track("create-post-input-box-on-homefeed")},children:[(0,S.jsx)(u.A,{children:"What's on your mind"}),","," ",t.name.split(" ")[0],"?",(0,S.jsx)(M.A,{icon:"pencil"})]})]})})})})}),(0,S.jsx)(ze,{newPostCount:A,onClick:()=>{window.removeEventListener("scroll",C.current),setTimeout((()=>{window.scrollTo({top:0}),setTimeout((()=>{f(H,W),(0,w.ZA)(n.id,s.id,N),g(s.id)}),[500])}),[500])}}),(0,S.jsx)(ie.av,{value:k||ae.A.hasValue(v),ifPresent:()=>(0,S.jsxs)("div",{className:"",children:[(0,S.jsxs)("div",{className:"mb-2 flex items-center gap-2.5 overflow-x-auto md:min-w-[640px] md:max-w-[640px]",children:[(null===Y||void 0===Y?void 0:Y.length)>0&&(0,S.jsx)(Oe.A,{selectedOption:N,setSelectedOption:P,options:z,removeSelectedCommunityTopicFilter:G}),(null===Y||void 0===Y?void 0:Y.length)>0&&!L&&(0,S.jsxs)("span",{className:"my-1.5 flex w-fit items-center rounded-full border border-border bg-accent px-2 py-1 text-xs hover:cursor-pointer",onClick:()=>{I(!0)},children:[(0,S.jsx)("span",{className:"text-xs font-semibold text-secondary-foreground",children:"Select Topic"}),(0,S.jsx)(M.A,{icon:"caret-down",className:"ml-1 mt-0.5"}),(0,S.jsx)(Re.Xb,{active:T,setActive:I,availableTopics:Y,selectedTopics:[],setSelectedFilteredTopic:R})]})]}),(0,S.jsx)(et,{user:t,activeTabModel:s,pinnedPosts:b,posts:v,setPosts:h,sortOrder:N,setSortOrder:P,isLoadingPosts:k,isLoadingMorePosts:x,noMorePosts:_,onTopicSelect:e=>{for(let t=0;t<(null===Y||void 0===Y?void 0:Y.length);t++)if(Y[t].id===(null===e||void 0===e?void 0:e.id)){R({key:Y[t].id,label:Y[t].name,bgColor:Y[t].bgColor,textColor:Y[t].textColor,isCommunityTopic:!0}),P(Y[t].id);break}}})]}),ifAbsent:()=>t?(0,S.jsx)(S.Fragment,{children:s.isClosed&&!s.isJoined?(0,S.jsx)(Ne,{user:t,group:n,setGroup:i,activeTabModel:s}):K?(0,S.jsx)(tt,{isUserAllowedToPost:K,user:t,group:n,sectionId:s.id,posts:v,setShowShareModal:l}):(0,S.jsx)(je,{user:t,group:n,setGroup:i})}):["closed-free","closed-paid"].includes(n.groupType)?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"mt-6 flex flex-col items-center gap-6",children:[(0,S.jsx)("div",{className:"font-bold",children:(0,S.jsx)(u.A,{children:"Login to view this section"})}),(0,S.jsx)(ue.A,{label:"Login",onClick:()=>{(0,Ie.D4)(o)}})]})," "]}):(0,S.jsx)(je,{user:t,group:n,setGroup:i})})]})]})})));const ot=function(e){let{length:t}=e;return(0,S.jsxs)("div",{className:"mx-auto flex w-full animate-pulse flex-col gap-4 pt-0",children:[(0,S.jsxs)("div",{className:"flex justify-between rounded-md border-b bg-card p-6",children:[(0,S.jsx)("div",{className:"h-6 w-12 rounded bg-muted/70"}),(0,S.jsx)("div",{className:"h-6 w-12 rounded bg-muted/70"})]}),(0,S.jsx)(Ve.A,{length:t,type:Ve.D.comfortable,className:"rounded-md bg-card"})]})};var it=n(45913),st=n(31012),at=n(51772),lt=n(41146);const ct=(0,c.wj)((0,o.Ng)((e=>({user:e.auth,groups:e.groups,community:e.community})))((function(e){let{activeGroup:t=null,addToast:n=(e=>{}),user:o=null,groups:i=[],active:s=!1,community:a=null,setActive:l=(e=>{}),selectedUser:d=null,updateGroupMember:u=(e=>{}),updateSubscriber:p=null}=e;const[m,f]=(0,r.useState)(null),[g,b]=(0,r.useState)([]),[y,k]=(0,r.useState)(""),w=()=>{l(!1)};return d?(0,S.jsxs)(Y.a,{className:"MakeAdminModal",active:s,setActive:l,padding:!1,children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,S.jsxs)("span",{className:"font-bold text-secondary-foreground",children:["Make ",d.name," admin"]}),(0,S.jsx)(pe.A,{hoverable:!0,icon:"cross",size:"sm",onClick:()=>{w()}})]}),(0,S.jsxs)("div",{className:"p-4",children:[(0,S.jsx)("div",{className:"bg-background",children:(0,S.jsx)(ge.Yp,{noBG:!0,loggedInUser:o,user:d,size:50,showDetailsOnHover:!0})}),(0,S.jsxs)("div",{className:"my-5",children:[(0,S.jsxs)("div",{className:h()("my-2 flex cursor-pointer rounded border border-border p-2",{"border-primary":1===m,"border-border":1!==m,"hover:border-border":1!==m}),onClick:e=>{f(1)},children:[(0,S.jsx)(lt.S,{selected:1===m}),(0,S.jsxs)("div",{className:"px-1",children:[(0,S.jsx)("div",{className:"font-semibold text-secondary-foreground",children:"For whole community"}),(0,S.jsx)("div",{className:"text-xs text-secondary-foreground/70",children:"Admin of community can create, edit or delete groups and channel. Create post in any group or channel."})]})]}),(0,S.jsxs)("div",{className:h()("my-2 cursor-pointer rounded border p-2",{"border-primary":2===m,"border-border":2!==m,"hover:border-border":2!==m}),onClick:e=>{f(2)},children:[(0,S.jsxs)("div",{className:"flex",children:[(0,S.jsx)(lt.S,{selected:2===m}),(0,S.jsxs)("div",{className:"px-1",children:[(0,S.jsx)("div",{className:"font-semibold text-secondary-foreground",children:"For selected groups"}),(0,S.jsx)("div",{className:"text-xs text-secondary-foreground/70",children:"Admin of selected group can edit the group information and create, edit or delete channel under selected groups."})]})]}),2===m?(0,S.jsx)("div",{className:"mt-3 border-t border-border px-4",children:i.map((e=>(0,S.jsxs)("div",{className:"my-3 flex text-xs",onClick:t=>{const n=g.indexOf(e.id);b(-1===n?[...g,e.id]:g.filter((t=>t!==e.id)))},children:[(0,S.jsx)(lt.S,{selected:g.includes(e.id)}),(0,S.jsx)("div",{className:"mt-1 font-semibold text-secondary-foreground/80",children:e.name})]},e.id)))}):(0,S.jsx)(S.Fragment,{})]})]}),y?(0,S.jsx)("div",{className:"text-alert",children:y}):(0,S.jsx)(S.Fragment,{}),(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"cursor-pointer p-2 text-secondary-foreground/80 hover:border hover:border-primary",onClick:w,children:"Cancel"}),(0,S.jsx)(at.$n,{label:"Update",onClick:e=>{1===m?v.BE.makeAdminOfWholeCommunity(o,a.id,d.id).then((e=>{n("Role successfully updated","",c.lm.success),u({...d,groupRole:"admin"}),p&&p({...d,groupRole:"admin",communityRole:"admin"}),w()})).catch((e=>{n(e.message,"",c.lm.danger)})):2===m&&v.BE.makeAdminOfWholeCommunity(o,a.id,d.id,g).then((e=>{n("Role successfully updated","",c.lm.success),g.includes(t.id)&&u({...d,groupRole:"admin"}),w()})).catch((e=>{n(e.message,"",c.lm.danger)}))},disabled:!m||2===m&&0===g.length})]})]})]}):null})));var dt=n(64451);const ut=(0,o.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community})))((0,c.wj)((function(e){let{user:t,group:n,community:o,addGroupMember:i,updateGroupMember:s,removeGroupMember:a,updateSubscriberRef:l=null,addToast:d}=e;const[p,h]=(0,r.useState)([]),[m,f]=(0,r.useState)(0),[g,b]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[w,x]=(0,r.useState)(1),[_,A]=(0,r.useState)(!1),[C,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(!1),[P,D]=(0,r.useState)(null),[T,I]=(0,r.useState)(!1),O=(0,r.useRef)(),{profileModelState:{setShowProfileModel:B,setIdToViewProfile:z}}=(0,fe.A)(),[F,U]=(0,r.useState)("");(0,r.useEffect)((()=>{["admin"].includes(o.myRole)&&(A(!0),v.BE.getCommunitySubscribersPaginated(t,o.id,10,1,F,n.id).then((e=>{let{users:t,total:n}=e;h(t),f(n),A(!1)})).catch((e=>{console.error({error:e}),A(!1)})))}),[t,o.id,o.myRole]);const V=r.useCallback((0,st.debounce)((e=>{["admin"].includes(o.myRole)&&(A(!0),v.BE.getCommunitySubscribersPaginated(t,o.id,10,1,e,n.id).then((e=>{let{users:t,total:n}=e;h(t),f(n),A(!1),k(!1)})).catch((e=>{console.error({error:e}),A(!1)})))}),1e3),[o.myRole]),G=p,H=e=>{const t=[...p],n=t.findIndex((t=>t.id===e.id));t.splice(n,1,e),h(t)};l&&(l.current=H);const W=r.useCallback((()=>{if(O.current){const{scrollTop:e,scrollHeight:r,clientHeight:i}=O.current;if(e+i===r&&!g&&!y){const e=w+1;b(!0),v.BE.getCommunitySubscribersPaginated(t,o.id,10,e,F,n.id).then((t=>{0===t.users.length?k(!0):(h([...p,...t.users]),x(e)),b(!1)})).catch((e=>{console.error({error:e}),A(!1)}))}}}),[g,y,w,F,p]);return"admin"!==o.myRole?(0,S.jsx)(S.Fragment,{}):(0,S.jsxs)("div",{className:"rounded bg-card",children:[(0,S.jsxs)(Y.a,{className:"bg-card",setActive:j,active:C,padding:!1,children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,S.jsxs)("span",{className:"font-bold text-secondary-foreground",children:[o.name," - ",m," ",(0,S.jsx)(u.A,{children:"Subscribers"})]}),(0,S.jsx)(pe.A,{hoverable:!0,icon:"cross",size:"xs",iconClass:"text-secondary-foreground/70 text-xs",onClick:()=>{j(!1)}})]}),(0,S.jsxs)("div",{className:"bg-background p-5 pb-10 text-secondary-foreground",children:[(0,S.jsxs)("div",{className:"mb-4 flex items-center rounded border border-border bg-background bg-card px-4 py-1",children:[(0,S.jsx)(M.A,{icon:"search",className:"text-xs text-secondary-foreground/70"}),(0,S.jsx)("input",{type:"text",placeholder:"Search",value:F,onChange:e=>{A(!0),U(e.target.value),V(e.target.value)},className:"flex-grow bg-transparent px-4 py-1 focus:outline-none"}),F.length>0?(0,S.jsx)("i",{onClick:()=>{A(!0),U(""),V("")},className:"fi fi-rr-cross cursor-pointer pr-1 text-sm text-secondary-foreground/85"}):null]}),_?(0,S.jsx)("div",{className:"p-1",children:(0,S.jsx)(R.a,{})}):(0,S.jsx)(S.Fragment,{}),(0,S.jsx)("div",{onScroll:W,ref:O,className:"h-96 overflow-y-scroll",children:G.map((e=>(0,S.jsxs)("div",{className:"m-3 flex cursor-pointer items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center justify-center",children:(0,S.jsx)(ge.eu,{user:e,onClick:()=>{z(e.id),B(!0)},tag:(0,S.jsxs)(S.Fragment,{children:["admin"===e.communityRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,S.jsx)(u.A,{children:"Community Admin"})}):(0,S.jsx)(S.Fragment,{}),"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-primary",children:(0,S.jsx)(u.A,{children:"Admin"})}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:(0,S.jsx)(u.A,{children:"Moderator"})}):(0,S.jsx)(S.Fragment,{})]}),extraInfo:[e.mobile,e.email].filter((e=>e)).join(" \xb7 ")})}),"admin"===o.myRole&&o.needsAdminVerification&&"admin"!==e.communityRole&&!e.communityAdminVerified?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded border border-green-500 bg-green-50 px-2 py-1 font-semibold text-green-500",onClick:n=>{v.BE.verifyUserByAdmin(t,o.id,e.id).then((()=>{H({...e,communityAdminVerified:!0})})).catch((e=>{console.error({error:e})}))},children:(0,S.jsx)(u.A,{children:"Accept"})}):(0,S.jsx)(S.Fragment,{}),"admin"===o.myRole?(0,S.jsx)("div",{children:(0,S.jsx)(L.A,{dropdownClassName:"w-56",hideOnEmpty:!0,actions:[{icon:"edit",label:"Change Role",onClick:()=>{D(e),I(!0)}},{icon:"user-add",label:""!==e.groupRole?"":"Add to group",onClick:r=>{v.Bd.updateUserRole(t,n.id,e.id,"user").then((t=>{let{group:n}=t;i(e),H({...e,groupRole:"user"}),d("".concat(e.name," is now part of")+n.name,"",c.lm.success)})).catch((e=>{console.log({message:"Error while updating the group member role",err:e}),d("Error while updating the group member role","",c.lm.error)}))}},{icon:"user-delete",label:["admin",""].includes(e.groupRole)?"":"Remove from group",onClick:r=>{v.Bd.removeUser(t,n.id,e.id).then((()=>{a(e),H({...e,groupRole:""}),d("".concat(e.name," is removed from")+n.name,"",c.lm.success)})).catch((e=>{console.log({err:e}),d("Error while removing the group member","",c.lm.error)}))},actionType:"alert"},{icon:"cross",label:e.id!==t.id?"Kick from community":"",onClick:n=>{v.BE.removeUserFromCommunity(t,o.id,e.id).then((t=>{(e=>{const t=[...p],n=t.findIndex((t=>t.id===e.id));t.splice(n,1),h(t)})(e),d("".concat(e.name," is removed from")+o.name,"",c.lm.success)})).catch((e=>{console.log("some error occurred",{err:e}),d("Error while removing the community member","",c.lm.error)}))},actionType:"alert"}]})}):(0,S.jsx)(S.Fragment,{})]},e.id)))}),g?(0,S.jsx)("div",{className:"p-1",children:(0,S.jsx)(R.a,{})}):null]}),(0,S.jsx)(ct,{activeGroup:n,active:E,setActive:N,updateGroupMember:s,updateSubscriber:H,selectedUser:P})]}),(0,S.jsx)(dt.A,{selectedUser:T&&P,activeGroup:n,updateGroupMember:s,updateSubscriber:H,unselectUser:e=>{I(!1),D(null)}})]})})));var pt=n(97844),ht=n(79036),mt=n(17357),ft=n(75972);const gt=(0,c.wj)((0,o.Ng)((e=>({user:e.auth,groups:e.groups,community:e.community})))((function(e){let{activeGroup:t=null,addToast:n=(e=>{}),role:o="user",user:i=null,active:s=!1,community:a=null,setActive:l=(e=>{}),selectedUser:d=null,updateGroupMember:u=(e=>{})}=e;const[p,m]=(0,r.useState)(null),f=()=>{l(!1)};return d?(0,S.jsxs)(Y.a,{className:"UpdateUserRoleModal",active:s,setActive:l,padding:!1,children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,S.jsxs)("span",{className:"font-bold text-secondary-foreground/85",children:["Make ",d.name," ",o]}),(0,S.jsx)(K.A,{icon:q.A,rotate:45,onClick:()=>{f()}})]}),(0,S.jsxs)("div",{className:"p-4",children:[(0,S.jsx)("div",{className:"bg-background",children:(0,S.jsx)(ge.Yp,{noBG:!0,loggedInUser:i,user:d,size:50,showDetailsOnHover:!0})}),(0,S.jsx)("div",{className:"my-5",children:(0,S.jsxs)("div",{className:h()("my-2 flex cursor-pointer rounded border p-2",{"border-primary":p===t.id,"border-border":p!==t.id,"hover:border-border":p!==t.id}),onClick:e=>{m(t.id)},children:[(0,S.jsx)(lt.S,{selected:p===t.id}),(0,S.jsxs)("div",{className:"px-1",children:[(0,S.jsxs)("div",{className:"flex font-semibold text-secondary-foreground/85",children:[(0,S.jsxs)("span",{className:"capitalize",children:[o+" ","\xa0 "]}),"for ",t.name]}),(0,S.jsxs)("div",{className:"text-xs text-secondary-foreground/70",children:["moderator"===o?"Moderator for this group can create, edit or delete post in this group.":"","user"===o?"A standard user account.":""]})]})]})}),(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"cursor-pointer p-2 text-secondary-foreground/80",onClick:f,children:"Cancel"}),(0,S.jsx)(at.$n,{label:"Update",onClick:e=>{p&&v.Bd.updateUserRole(i,t.id,d.id,"moderator"===d.groupRole?"user":"moderator").then((e=>{let{group:t}=e;u({...d,groupRole:"moderator"===d.groupRole?"user":"moderator"}),n("User role updated!","",c.lm.success),f()})).catch((e=>{n("Could not update user role!","",c.lm.danger),console.log({message:"Error while updating the group memeber role",err:e})}))},disabled:!p})]})]})]}):null})));const bt=function(e){let{className:t}=e;return(0,S.jsxs)("div",{className:(0,A.cn)(h()("UserTileShimmer my-3 flex items-center",t)),children:[(0,S.jsx)("p",{className:"h-8 w-8 rounded-full bg-gray-300"}),(0,S.jsxs)("div",{className:"ml-2 w-max flex-grow space-y-1",children:[(0,S.jsx)("div",{className:"mt-2 h-2 w-8/12 rounded bg-gray-300"}),(0,S.jsx)("p",{className:"h-2 w-32 rounded bg-gray-300"})]}),(0,S.jsx)(M.A,{icon:"menu-dots-vertical",className:"text-secondary-foreground/70"})]})};const vt=function(e){let{length:t,className:n,tileClassName:r}=e;const o=[];for(let i=0;i<(null!==t&&void 0!==t?t:1);i++)o.push((0,S.jsx)(bt,{className:r},i));return(0,S.jsx)("div",{className:(0,A.cn)(h()("mx-auto w-full animate-pulse pt-0",n)),children:(0,S.jsx)("div",{className:"UserListShimmer flex flex-grow flex-col justify-end py-2",children:o})})};function yt(e){let{member:t,groupId:n,activeTabId:r,user:o,updateGroupMember:i=(e=>{})}=e;return"requested"===t.tabStatus?(0,S.jsxs)("div",{className:"AcceptRejectSectionMember flex items-center",children:[(0,S.jsx)("span",{onClick:e=>{v.Bd.acceptJoinClosedSectionRequest(o,n,r,t.id).then((e=>{let{group:n}=e;i({...t,tabStatus:"joined"})}))},className:"px-1 text-xs text-primary",children:"Accept"}),(0,S.jsx)("span",{onClick:e=>{v.Bd.rejectJoinClosedSectionRequest(o,n,r,t.id).then((e=>{let{group:n}=e;i({...t,tabStatus:null})}))},className:"px-1 text-xs text-alert",children:"Reject"})]}):(0,S.jsx)(S.Fragment,{})}function kt(e){let{user:t=null,group:n=null,memberCount:o,activeTabModel:i=null,updateGroupMember:s=(e=>{}),updateClosedSectionMember:a=(e=>{}),removeGroupMember:l=(e=>{}),setActive:c=(e=>{}),displayOnlyJoinedMembers:d=!1}=e;const[u,p]=(0,r.useState)("idle"),[h,m]=(0,r.useState)(0),[f,g]=(0,r.useState)([]),{profileModelState:{setShowProfileModel:b,setIdToViewProfile:y}}=(0,fe.A)(),k=r.useRef(null),w=(new AbortController,r.useCallback((0,st.debounce)((e=>{g([]),p("loading"),O(h,f,u,e)}),600),[h,f,u,O])),[x,_]=(0,r.useState)(!1),[A,C]=(0,r.useState)(null),[j,E]=(0,r.useState)("user"),[N,P]=(0,r.useState)(!1),[T,I]=(0,r.useState)(!1);(0,r.useEffect)((()=>{"idle"===u&&(p((e=>"loading")),O(h,f,u))}),[u]);function O(e,t,r,o){const s=o;if(["loadingMore","noMore"].includes(r)&&t.length>1)return p("noMore"),void m(1);if("loading"!==r){var a,l;if(ae.A.hasValue(o)&&g([]),null!==i&&void 0!==i&&i.isClosed&&d)a=v.Bd.groupClosedSectionMembersPaginated(n.id,i.id,s?1:e,20,o);else a=v.Bd.groupMembersPaginated(null!==(l=null===n||void 0===n?void 0:n.id)&&void 0!==l?l:"",null===i||void 0===i?void 0:i.id,s?1:e,20,o);a.then((e=>{let{groupMembers:n,members:r,page:o}=e;const i=null!==n&&void 0!==n?n:r;g(s?i:[...t,...i]),m(s?1:o+1),null===i||void 0===i||!i.length||i.length<20?p("noMore"):p("success")})).catch((e=>{console.log({error:e}),p("error")}))}}function R(e){const t=(0,ie.I1)(f,"id",e.id,e);g(t),s&&s(e),a&&a(e)}return(0,S.jsxs)("div",{className:"GroupMembersComponent flex h-full flex-col",children:[(0,S.jsxs)("div",{className:"flex items-center justify-between bg-card py-2 pl-4 pr-2",children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"font-bold text-secondary-foreground",children:[o||n.userCount," Members"]}),(0,S.jsxs)("div",{className:"text-xs text-secondary-foreground/80",children:[n.name,i&&i.isClosed?" - "+i.name:(0,S.jsx)(S.Fragment,{})]})]}),(0,S.jsx)(pe.A,{hoverable:!0,icon:"cross",size:"xs",className:"text-xs text-secondary-foreground/70",onClick:()=>{c(!1)}})]}),(0,S.jsxs)("div",{className:"h-[calc(100%-56px)] overflow-auto bg-background py-5 pb-24 text-secondary-foreground",ref:k,onScroll:()=>{if(k.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=k.current;e+n===t&&(p("loadingMore"),O(h,f,u,void 0))}},children:[t&&(0,S.jsxs)("div",{className:"mx-5 mb-4 flex items-center rounded border border-border bg-card px-4 py-1",children:[(0,S.jsx)(M.A,{icon:"search",className:"text-secondary-foreground/80"}),(0,S.jsx)("input",{type:"text",placeholder:"Search by name".concat(["admin","moderator"].includes(n.myRole)?", mobile, email":""),onChange:e=>{w(e.target.value)},className:"flex-grow bg-transparent px-4 py-1 focus:outline-none"})]}),(0,S.jsx)(V.u,{items:f,renderItem:(e,r)=>(0,S.jsxs)("div",{className:"group-member-list-item mx-2 my-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 hover:bg-primary-light",children:[(0,S.jsx)("div",{className:"flex items-center justify-center",children:(0,S.jsx)(ge.eu,{user:e,onClick:()=>{y(e.id),b(!0)},tag:(0,S.jsx)(S.Fragment,{children:"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-blue-50 px-1 font-semibold text-blue-500",children:"Admin"}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(e.groupRole,(0,S.jsx)(S.Fragment,{}))}),extraInfo:[e.userId?"@"+e.userId:"",e.mobile,e.email].filter((e=>e)).join(" \xb7 ")})}),i&&i.isClosed?(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(wt,{activeTabModel:i,member:e,user:t,group:n,updateGroupMember:R})}):t&&"admin"===n.myRole?(0,S.jsxs)("div",{className:"flex items-center",children:["requested"===e.groupStatus?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("span",{onClick:r=>{v.Bd.acceptUserRequest(t,n.id,e.id).then((t=>{let{group:n}=t;R({...e,groupStatus:"joined"})}))},className:"px-1 text-primary",children:"Accept"}),(0,S.jsx)("span",{onClick:r=>{v.Bd.rejectJoinRequest(t,n.id,e.id).then((t=>{let{group:n}=t;const r=(0,ie.E6)(f,"id",e.id);g(r),l(e)}))},className:"px-1 text-alert",children:"Reject"})]}):null,"requested"===e.tabStatus&&(0,S.jsx)(yt,{member:e,activeTabId:i?i.id:null,groupId:n.id,user:t,updateGroupMember:R}),(0,S.jsx)(L.A,{hideOnEmpty:!0,dropdownClassName:"w-52",actions:[{icon:"edit",label:"Change Role",onClick:()=>{C(e),I(!0)}},{icon:"user-delete",label:"admin"===e.groupRole?"":"Remove from group",onClick:r=>{window.confirm("Are you sure you want to remove the user?")&&v.Bd.removeUser(t,n.id,e.id).then((()=>{const t=(0,ie.E6)(f,"id",e.id);g(t),l(e)})).catch((e=>{console.log({err:e})}))},actionType:"alert"}]})]}):(0,S.jsx)(S.Fragment,{})]},r),loading:["loading","idle"].includes(u),placeholder:(0,S.jsx)(vt,{length:10,className:"px-4"}),footerElement:"loadingMore"===u&&(0,S.jsx)(vt,{length:6,className:"px-4"}),noItemsElement:(0,S.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,S.jsx)(D.A,{variant:"s2",className:"mt-4",children:"No member found"})})})]}),(0,S.jsx)(dt.A,{selectedUser:T&&A,activeGroup:n,updateGroupMember:R,unselectUser:e=>{I(!1),C(null)}}),(0,S.jsx)(ct,{activeGroup:n,active:x,setActive:_,updateGroupMember:R,selectedUser:A}),A?(0,S.jsx)(gt,{role:j,activeGroup:n,active:N,setActive:P,updateGroupMember:R,selectedUser:A}):(0,S.jsx)(S.Fragment,{})]})}const wt=e=>{let{activeTabModel:t,member:n,user:r,group:o,updateGroupMember:i}=e;return o&&"admin"===o.myRole?(0,S.jsx)("div",{className:"ClosedSectionOperations",children:t&&t.isClosed?"requested"===n.tabStatus?(0,S.jsx)(yt,{member:n,activeTabId:t?t.id:null,groupId:o.id,user:r,updateGroupMember:i}):"joined"!==n.tabStatus?(0,S.jsx)("span",{onClick:e=>{v.Bd.acceptJoinClosedSectionRequest(r,o.id,t.id,n.id).then((()=>{i({...n,tabStatus:"joined"})}))},className:"px-1 text-xs text-primary",children:"Add to channel"}):(0,S.jsxs)("div",{className:"flex",children:[(0,S.jsx)("span",{className:"cursor-pointer text-xs text-green-300",children:"joined"}),"admin"!==n.groupRole?(0,S.jsx)("span",{onClick:e=>{v.Bd.rejectJoinClosedSectionRequest(r,o.id,t.id,n.id).then((()=>{i({...n,tabStatus:null})}))},className:"px-1 text-xs text-alert",children:n.id!==r.id?"Remove":"Leave"}):(0,S.jsx)(S.Fragment,{})]}):(0,S.jsx)(S.Fragment,{})}):(0,S.jsx)(S.Fragment,{})};function xt(e){let{members:t=[],onLazyLoad:n=(e=>{}),onLazyLoadClosedSection:o=(e=>{}),addMembersVisible:i,setAddMembersVisible:s,joinedMembers:a,closedSectionMembersCount:l,user:c,group:d,updateGroupMember:u,updateClosedSectionMember:p,removeGroupMember:m,removeClosedSectionMember:f,activeTabModel:g,memberPreviewLimit:b=5}=e;const{analyticsService:y}=(0,Te.W)(),k=b0?t:a,D=(0,X.d)();return(null===N||void 0===N?void 0:N.length)>0?(0,S.jsxs)("div",{className:"mt-1 rounded-xl bg-card p-5",children:[(0,S.jsxs)("div",{className:h()("flex items-center justify-between rounded border-b border-border pb-5",{"cursor-pointer":!C}),onClick:e=>{c&&(C||s(!0),s(!0),y.track("widget-groupmember",{clickOn:"header",widgetType:"group-member"}))},children:[(0,S.jsxs)("h4",{className:"font-bold",children:[null!==l&&void 0!==l?l:d.userCount," Members"]}),C&&(0,S.jsx)(Ee.A,{label:"Add members",children:(0,S.jsx)(pe.A,{icon:"user-add",size:"lg",hoverable:!0,onClick:e=>{s(!0),y.track("widget-groupmember",{clickOn:"header",widgetType:"group-member"})}})})]}),(0,S.jsxs)("div",{className:"pt-5",children:[(0,S.jsx)("div",{className:"GroupMemberList",children:a.slice(0,b).map((e=>(0,S.jsxs)("div",{className:"group-member-list-item mb-2.5 flex h-10 cursor-pointer items-center justify-between",onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:[(0,S.jsx)(ge.eu,{user:e,extraInfo:e.userId?"@"+e.userId:"",onClick:()=>{E(e.id),j(!0),y.track("widget-groupmember",{clickOn:"user",widgetType:"group-member"})},tag:"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-accent px-1 font-semibold text-primary",children:"Admin"}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(e.groupRole,(0,S.jsx)(S.Fragment,{}))}),g&&g.isClosed?g&&g.isClosed&&c&&"admin"===d.myRole&&(0,S.jsx)(yt,{member:e,groupId:d.id,activeTabId:g?g.id:null,user:c,updateGroupMember:p}):c&&"admin"===d.myRole?(0,S.jsxs)("div",{className:"flex items-center",children:["requested"===e.groupStatus&&(0,S.jsxs)("div",{className:"flex items-center",children:[(0,S.jsx)("span",{onClick:t=>{v.Bd.acceptUserRequest(c,d.id,e.id).then((t=>{let{group:n}=t;u({...e,groupStatus:"joined"}),D.addToast("User added to group")}))},className:"px-1 text-primary hover:scale-105",children:"Accept"}),(0,S.jsx)("span",{onClick:t=>{v.Bd.rejectJoinRequest(c,d.id,e.id).then((t=>{let{group:n}=t;m(e),D.addToast("User's join request removed from the group")}))},className:"px-1 text-alert hover:scale-105",children:"Reject"})]}),(0,S.jsx)(ie.av,{value:"joined"===e.groupStatus||["admin","moderator"].includes(e.groupRole),ifPresent:()=>(0,S.jsx)(L.A,{dropdownClassName:"w-56",className:"".concat(!_&&"hidden"),actions:[{icon:"edit",label:"admin"===e.groupRole?"":"moderator"===e.groupRole?"Make User":"Make Moderator",onClick:(t,n)=>{v.Bd.updateUserRole(c,d.id,e.id,"moderator"===e.groupRole?"user":"moderator").then((t=>{let{group:r}=t;u({...e,groupRole:"moderator"===e.groupRole?"user":"moderator"}),n()})).catch((e=>{console.log({message:"Error while updating the group memeber role",err:e})}))}},{icon:"cross-circle",label:"admin"===e.groupRole?"":"Remove from group",onClick:t=>{window.confirm("Are you sure you want to remove the user?")&&v.Bd.removeUser(c,d.id,e.id).then((()=>{m(e)})).catch((e=>{console.log({err:e})}))},actionType:"alert"}],hideOnEmpty:!0})})]}):(0,S.jsx)(S.Fragment,{})]},e.id)))}),k&&c&&(0,S.jsx)("div",{className:"text-xxs",children:(0,S.jsx)(ue.A,{label:"View all members",onClick:e=>{x(!0),y.track("widget-groupmember",{widgetType:"group-member",clickOn:"show-all"})}})}),(0,S.jsx)(P.A,{active:i,width:"400px",setActive:s,children:(0,S.jsx)(kt,{user:c,group:d,displayOnlyJoinedMembers:!1,activeTabModel:g,updateGroupMember:u,updateClosedSectionMember:p,removeGroupMember:m,setActive:s})}),(0,S.jsx)(P.A,{active:w,width:"400px",setActive:x,children:(0,S.jsx)(kt,{user:c,group:d,displayOnlyJoinedMembers:!0,memberCount:l,activeTabModel:g,updateGroupMember:u,updateClosedSectionMember:p,removeGroupMember:m,removeClosedSectionMember:f,setActive:x,onLazyLoad:null!==g&&void 0!==g&&g.isClosed?o:n})})]})]}):null}function _t(e){var t,n;let{widgets:o,addGroupMember:i=(e=>{}),updateGroupMember:s=(e=>{}),updateClosedSectionMember:a=(e=>{}),removeGroupMember:l=(e=>{}),removeClosedSectionMember:c=(e=>{}),onWidgetListUpdate:d=(e=>{}),closedSectionMembers:p,closedSectionMembersCount:h,members:f}=e;const{user:g,group:b,community:v,activeTabModel:y}=(0,m.G)((e=>({user:e.auth,group:e.activeGroup,community:e.community,activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null}))),[k,w]=(0,r.useState)(!1),[x,_]=(0,r.useState)(!1),A=["admin","moderator"].includes(null!==(t=null===b||void 0===b?void 0:b.myRole)&&void 0!==t?t:""),C=y&&y.isClosed?p.filter((e=>"joined"===e.tabStatus||"requested"===e.tabStatus)):f.filter((e=>"joined"===e.groupStatus||"requested"===e.groupStatus)),{analyticsService:j}=(0,Te.W)();return(0,S.jsx)("div",{className:"secondary-sidebar",children:(0,S.jsxs)("div",{className:"secondary-sidebar-content mr-16",children:[null!==v&&void 0!==v&&null!==(n=v.configuration)&&void 0!==n&&n.hideCommunitySubscribersList?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(ut,{addGroupMember:i,updateGroupMember:s,removeGroupMember:l}),ae.A.hasValue(o)&&(0,S.jsx)("div",{className:"flex flex-col gap-2",children:o.map(((e,t)=>{if(!b)return null;if(!g||!e.isVisible&&["user"].includes(b.myRole))return null;if(A&&!e.isVisibleToAdmin)return null;switch(e.type){case"custom":return(0,S.jsx)(ht.A,{widget:e},t);case"members":return(0,S.jsx)(xt,{members:f,addMembersVisible:k,setAddMembersVisible:w,joinedMembers:C,closedSectionMembersCount:h,user:g,group:b,updateGroupMember:s,updateClosedSectionMember:a,removeGroupMember:l,removeClosedSectionMember:c,activeTabModel:y},t);case"top-posts":return"realtime"===(null===y||void 0===y?void 0:y.sectionType)?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(ft.A,{group:b,isCommunityPosts:void 0},t);case"leaderboard":return(0,S.jsx)(mt.A,{memberPreviewLimit:4,group:b,isCommunityLeaderBoard:!1},t);case"community-leaderboard":return(0,S.jsx)(mt.A,{memberPreviewLimit:4,isCommunityLeaderBoard:!0,group:void 0},t);default:return null}}))}),A&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{onClick:()=>{j.track("click-select-widget",{location:"group"}),_(!0)},className:"my-2 flex w-full cursor-pointer place-content-center rounded-lg border border-dashed border-border p-3 text-secondary-foreground",children:(0,S.jsx)(u.A,{children:"Select Widgets"})}),(0,S.jsx)(P.A,{width:570,setActive:_,active:x,children:(0,S.jsx)(pt.A,{widgets:o,setActive:_,onWidgetListUpdate:d})})]})]})})}var At=n(48672);const Ct=function(e){let{onSubmit:t,group:n,user:o,tab:i,updateGroup:s=(e=>{}),addToast:a=(e=>{})}=e;const[l,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(!1);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{onClick:()=>f.b6.push((0,At.x6)(n,i)),className:"GroupSection tab my-2 flex cursor-pointer items-center justify-between rounded-xl bg-card px-4 py-4",children:[(0,S.jsxs)("div",{className:"flex-col justify-center",children:[(0,S.jsxs)("div",{className:"mb-2.5 flex flex-grow items-center text-sm font-semibold text-secondary-foreground",children:[""!==i.emoji&&"#"!==i.emoji?i.emoji:"#\ufe0f\u20e3",(0,S.jsx)("div",{className:"px-1 pl-1",children:i.name})]}),(0,S.jsxs)("div",{className:"flex items-center gap-2 text-secondary-foreground",children:[(0,S.jsx)("div",{className:"text-xxs flex w-fit rounded bg-accent px-2.5 py-0.5",children:i.isPrivate?(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"eye-crossed",size:"xxs"}),(0,S.jsx)("span",{children:"Private"})]}):i.isClosed?(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"lock",size:"xxs"}),(0,S.jsx)("span",{children:"Close"})]}):(0,S.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"unlock",size:"xxs"}),(0,S.jsx)("span",{children:"Open"})]})}),(0,S.jsx)("div",{className:"inline-block h-1 w-1 rounded-full bg-gray-400"}),(0,S.jsx)("div",{className:"w-fit rounded bg-accent px-2.5 py-0.5",children:(0,S.jsxs)("div",{className:"text-xxs flex items-center gap-1.5",children:[(0,S.jsx)(M.A,{icon:"user",size:"xxs"}),(0,S.jsx)("span",{children:i.isClosed?i.userCount:n.userCount})]})})]})]}),(0,S.jsxs)("div",{className:"flex items-center",children:[["admin","moderator"].includes(n.myRole)?(0,S.jsx)(L.A,{className:l?"hidden":"text-secondary-foreground",actions:[{icon:"edit",label:"Edit",onClick:e=>{e.preventDefault(),u(!0)}},{icon:"trash",label:"Delete",labelClass:"text-alert",onClick:e=>{e.preventDefault(),t(i.id)},actionType:"alert"}]}):(0,S.jsx)(S.Fragment,{}),l?(0,S.jsx)("div",{className:"loader",children:(0,S.jsx)(at.aH,{})}):(0,S.jsx)(S.Fragment,{})]})]}),(0,S.jsx)(P.A,{width:570,setActive:u,active:d,children:(0,S.jsx)(C.A,{isEditingTabActive:d,setIsCreateSectionModalVisible:u,updateActiveGroup:s,selectedTabToEdit:i})})]})},St=e=>{let{group:t,updateGroupMember:n=(e=>{}),removeGroupMember:o=(e=>{}),updateClosedSectionMember:i=(e=>{}),removeClosedSectionMember:s,closedSectionMembersCount:a,closedSectionMembers:l,members:c}=e;const[d,u]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),{profileModelState:{setShowProfileModel:f,setIdToViewProfile:g}}=(0,fe.A)(),b=(0,X.d)(),{user:y,activeTabModel:k,community:w}=(0,m.G)((e=>({user:e.auth,community:e.community,activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null}))),{analyticsService:x}=(0,Te.W)(),_=k&&k.isClosed?l.filter((e=>"joined"===e.tabStatus||"requested"===e.tabStatus)):c.filter((e=>"joined"===e.groupStatus||"requested"===e.groupStatus));return(0,S.jsxs)("div",{className:"secondary-sidebar h-full border border-border bg-card p-5",style:{minWidth:"320px"},children:[(0,S.jsxs)("div",{className:"flex items-center justify-between border-b border-border pb-5 text-secondary-foreground",children:[(0,S.jsxs)("h4",{className:"text-sm font-bold uppercase",children:[null!==a&&void 0!==a?a:t.userCount," Members"]}),(0,S.jsxs)("div",{className:"flex items-center",children:[y&&("admin"===(null===t||void 0===t?void 0:t.myRole)||"admin"===(null===w||void 0===w?void 0:w.myRole))&&(k.isClosed||k.isPrivate)&&(0,S.jsx)("div",{className:"mr-3 cursor-pointer",onClick:e=>{u(!0),h(!1),x.track("widget-groupmember",{widgetType:"group-member"})},children:(0,S.jsx)(M.A,{icon:"user-add"})}),(0,S.jsx)("div",{className:"cursor-pointer",onClick:e=>{u(!0),h(!0),x.track("widget-groupmember",{widgetType:"group-member"})},children:(0,S.jsx)(M.A,{icon:"search"})})]})]}),(0,S.jsxs)("div",{className:"absolute h-full w-[90%] overflow-y-auto pt-5",children:[(0,S.jsxs)("div",{className:"GroupMemberList",children:[null===_||void 0===_?void 0:_.map((e=>(0,S.jsxs)("div",{className:"group-member-list-item mb-2.5 flex cursor-pointer items-center justify-between",children:[(0,S.jsx)(ge.eu,{user:e,extraInfo:e.userId?"@"+e.userId:"",onClick:()=>{f(!0),g(e.id),x.track("widget-groupmember",{clickOn:"user",widgetType:"group-member"})},tag:"admin"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-accent px-1 font-semibold text-primary",children:"Admin"}):"moderator"===e.groupRole?(0,S.jsx)("div",{className:"text-xxs mx-2 rounded bg-green-50 px-1 font-semibold text-green-500",children:"Moderator"}):(e.groupRole,(0,S.jsx)(S.Fragment,{}))}),k&&k.isClosed?k&&k.isClosed&&(0,S.jsx)(yt,{member:e,groupId:t.id,activeTabId:k?k.id:null,user:y,updateGroupMember:i}):y&&"admin"===t.myRole?(0,S.jsxs)("div",{className:"flex items-center",children:["requested"===e.groupStatus&&(0,S.jsxs)("div",{className:"flex items-center",children:[(0,S.jsx)("span",{onClick:r=>{v.Bd.acceptUserRequest(y,t.id,e.id).then((t=>{let{group:r}=t;n({...e,groupStatus:"joined"}),b.addToast("User added to group")}))},className:"px-1 text-primary hover:scale-105",children:"Accept"}),(0,S.jsx)("span",{onClick:n=>{v.Bd.rejectJoinRequest(y,t.id,e.id).then((t=>{let{group:n}=t;o(e),b.addToast("User's join request removed from the group")}))},className:"px-1 text-alert hover:scale-105",children:"Reject"})]}),(0,S.jsx)(ie.av,{value:"joined"===e.groupStatus||["admin","moderator"].includes(e.groupRole),ifPresent:()=>(0,S.jsx)(L.A,{dropdownClassName:"w-56",actions:[{icon:"edit",label:"admin"===e.groupRole?"":"moderator"===e.groupRole?"Make User":"Make Moderator",onClick:(r,o)=>{v.Bd.updateUserRole(y,t.id,e.id,"moderator"===e.groupRole?"user":"moderator").then((t=>{let{group:r}=t;n({...e,groupRole:"moderator"===e.groupRole?"user":"moderator"}),o()})).catch((e=>{console.log({message:"Error while updating the group memeber role",err:e})}))}},{icon:"cross-circle",label:"admin"===e.groupRole?"":"Remove from group",onClick:n=>{window.confirm("Are you sure you want to remove the user?")&&v.Bd.removeUser(y,t.id,e.id).then((()=>{o(e)})).catch((e=>{console.log({err:e})}))},actionType:"alert"}],hideOnEmpty:!0})})]}):(0,S.jsx)(S.Fragment,{})]},e.id))),(a||t.userCount)>15&&(0,S.jsx)("div",{className:"text-xxs mb-2",children:(0,S.jsx)(ue.A,{label:"View All",onClick:e=>{u(!0),h(!0),x.track("widget-groupmember",{widgetType:"group-member"})}})})]}),(0,S.jsx)(P.A,{active:d,width:"400px",setActive:u,children:(0,S.jsx)(kt,{user:y,group:t,displayOnlyJoinedMembers:p,memberCount:a,activeTabModel:k,updateGroupMember:n,updateClosedSectionMember:i,removeGroupMember:o,removeClosedSectionMember:s,setActive:u})})]})]})},jt="/group/:id",Et="/g/:slug",Nt="/g/:slug/s/:activeTabSlug",Pt=e=>"/group/"+e,Dt=e=>{var t;return ae.A.hasValue(e.meta)&&null!=(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.slug)?"/g/"+e.meta.slug:"/group/"+e.id},Mt=(e,t)=>{var n;return ae.A.hasValue(e.meta)&&null!=(null===e||void 0===e||null===(n=e.meta)||void 0===n?void 0:n.slug)&&ae.A.hasValue(t.meta)&&null!=t.meta.slug?Dt(e)+"/s/"+t.meta.slug:Pt(e.id)+"?tab="+t.id},Tt=(e,t)=>"/group/"+e+"?tab="+t,It=e=>window.location.origin+Pt(e),Ot=e=>window.location.origin+Dt(e);function Lt(e,t){return window.location.origin+Mt(e,t)}function Rt(e){let{user:t,group:n,setGroup:r,activeTabModel:o,showShareModal:i,setShowShareModal:s}=e;return"realtime"===(null===o||void 0===o?void 0:o.sectionType)?(0,S.jsx)(De,{user:t,group:n,activeTabModel:o,setGroup:r,showShareModal:i,setShowShareModal:s}):(0,S.jsx)(rt,{user:t,group:n,activeTabModel:o,sectionId:o.id,setGroup:r,showShareModal:i,setShowShareModal:s,updateActiveGroup:r})}const Bt=(0,c.wj)((0,o.Ng)((e=>({user:e.auth,group:e.activeGroup,community:e.community,activeTabModel:e.sections.activeSectionId?e.sections.sections[e.sections.activeSectionId]:null})),(e=>(0,a.zH)({setGroup:E.Wk,setActiveTabModel:w.x},e)))((function(e){var t;let{user:n,group:o,community:a,setGroup:c,addToast:p,setIsCreateSectionModalVisible:h,setIsPersonalSpace:m,activeTabModel:g,setActiveTabModel:b}=e;const{id:y,slug:k,activeTabSlug:w}=(0,i.g)(),x=new URLSearchParams(window.location.search).get("tab"),[_,A]=(0,r.useState)(!1),[C,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(!1),[P,D]=(0,r.useState)([]),[T,I]=(0,r.useState)(1),[O,L]=(0,r.useState)([]),[R,B]=(0,r.useState)(void 0),[z,F]=(0,r.useState)(),[U,G]=(0,r.useState)(!1),[H,W]=(0,r.useState)(!1),[q,K]=(0,r.useState)(!1),[Y,$]=(0,r.useState)(),Q=(0,r.useMemo)((()=>new AbortController),[]),{setBaseLayout:Z}=(0,r.useContext)(l.h6);function X(e){if(null!=e.tabs){let t;w&&null!==w?t=e.tabs.find((e=>e.meta&&e.meta.slug===w)):x&&null!==x&&(t=e.tabs.find((e=>e.id===x))),b(t)}}Z(),(0,r.useEffect)((()=>{var e,t;if(o&&ae.A.hasValue(y)&&o.id!==y)return;if(o&&ae.A.hasValue(k)&&(null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.slug)!==k)return;const n=o&&(null===(t=o.tabs)||void 0===t?void 0:t.find((e=>(null===e||void 0===e?void 0:e.id)===x||w&&e.meta&&e.meta.slug===w)));b(n||null)}),[x,w]),(0,r.useEffect)((()=>{var e;(o&&y&&null!==y&&o.id===y||o&&k&&null!==k&&(null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.slug)===k)&&X(o)}),[null===o||void 0===o?void 0:o.tabs]),(0,r.useEffect)((()=>{if(null!==y&&void 0!==y){var e;if(o&&y&&o.id===y)return;if(o&&k&&(null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.slug)===k)return;b(null),A(!0),v.Bd.groupDetail(y).then((e=>{let{groups:t}=e;X(t),c(t)})).catch((e=>{console.log({error:e})})).finally((()=>{A(!1)}))}else if(null!==k&&void 0!==k){var t;if(o&&(o.id===y||(null===(t=o.meta)||void 0===t?void 0:t.slug)===k))return;b(null),A(!0),v.Bd.groupDetailFromSlug(a.id,k).then((e=>{let{groups:t}=e;X(t),c(t)})).catch((e=>{console.log({error:e})})).finally((()=>{A(!1)}))}}),[y,k,null===n||void 0===n?void 0:n.id,x,w]),(0,r.useEffect)((()=>{try{o&&!_&&(console.log("group",{group:o}),"open"!==o.groupType&&"joined"!==o.joinStatus||(j(!0),v.Bd.groupMembersPaginated(o.id,null===g||void 0===g?void 0:g.id).then((e=>{let{groupMembers:t,page:n}=e;D(t),j(!1),I(1)})).catch((e=>{console.log({error:e}),j(!1),console.error("Error",e)}))),g&&g.isClosed&&"joined"===g.status&&("open"===o.groupType||"joined"===o.joinStatus)?(N(!0),v.Bd.groupClosedSectionMembersPaginated(o.id,g.id,1,15).then((e=>{let{members:t,joinedUserCount:n}=e;L(t),N(!1),B(n)})).catch((e=>{console.log({error:e}),N(!1)}))):(L([]),B(void 0)))}catch(e){console.log("Error while loading",e)}}),[null===g||void 0===g?void 0:g.id,null===o||void 0===o?void 0:o.id,_]),(0,r.useEffect)((()=>{o&&o.id&&v.Cq.getWidgets(a.id,o.id).then((e=>{let{widgets:t}=e,n=[];t&&(n=t.filter((e=>"community-members"!==e.type))),F(n)})).catch((e=>{console.log(e)}))}),[null===o||void 0===o?void 0:o.id]),(0,r.useEffect)((()=>()=>{Q.abort()}),[y,k,x,w,Q]);const ee=e=>{const t=[...P],n=t.findIndex((t=>(null===t||void 0===t?void 0:t.id)===e.id));n>-1?t.splice(n,1,{...P[n],...e}):t.push(e),D(t)},te=e=>{const t=[...O],n=t.findIndex((t=>t.id===e.id));n>-1?t.splice(n,1,{...P[n],...e}):t.push(e),L(t)},ne=e=>{const t=[...P],n=t.findIndex((t=>t.id===e.id));t.splice(n,1),D(t)},re=e=>{const t=[...O],n=t.findIndex((t=>t.id===e.id));t.splice(n,1),L(t),B(null!==R&&void 0!==R?R:0)};if(!_&&!o)return(0,S.jsxs)("div",{className:"GroupPage w-full py-20 text-center",children:[(0,S.jsxs)("div",{className:"my-2",children:[(0,S.jsx)(u.A,{children:" The resource you are looking for could not be found,"})," ",(0,S.jsx)("br",{})," ",(0,S.jsx)(u.A,{children:"it may have been removed by admin!"})]}),(0,S.jsx)(s.N_,{to:it.COMMUNITY_HOMEPAGE_ROUTE,children:(0,S.jsx)(u.A,{children:"Go back to home"})})]});if(_||!o||o.id!==y&&(null===(t=o.meta)||void 0===t?void 0:t.slug)!==k)return(0,S.jsx)(Le.g,{className:"max-w-[640px]",children:(0,S.jsx)(ot,{length:10})});const oe=e=>{W(!0),$(e)},se=g&&g.isClosed?O.filter((e=>"joined"===e.tabStatus||"requested"===e.tabStatus)):P.filter((e=>"joined"===e.groupStatus||"requested"===e.groupStatus));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"flex flex-col md:grow",children:[g&&(0,S.jsx)("div",{className:"sticky top-[48px] z-[2] w-full border-b border-border bg-card px-5 py-3 md:h-16 lg:w-auto ".concat("realtime"!==(null===g||void 0===g?void 0:g.sectionType)&&"mb-4 lg:left-[300px] lg:right-0"," "),children:(0,S.jsx)(J,{closedSectionMembersCount:R,group:o,setGroup:c,addToast:p,setShowShareModal:G,updateActiveGroup:c,showShareModal:U,joinedMembers:se})}),(0,S.jsxs)("div",{className:"mx-auto ".concat("realtime"!==(null===g||void 0===g?void 0:g.sectionType)&&"min-h-screen"," flex w-full gap-0"),children:[(0,S.jsx)("div",{className:"GroupPage ".concat("realtime"!==(null===g||void 0===g?void 0:g.sectionType)?"mx-auto w-full lg:mx-10":"w-full lg:w-auto lg:grow"," "),children:(0,S.jsx)("div",{className:"flex w-full flex-col",children:(0,S.jsx)(ie.av,{value:g,ifPresent:()=>(0,S.jsx)(Rt,{user:n,group:o,activeTabModel:g,setGroup:c,showShareModal:U,setShowShareModal:G}),ifAbsent:()=>{var e,t;return(0,S.jsxs)("div",{className:"",children:[(0,S.jsx)(ve,{group:o,setGroup:e=>{c(e),f.b6.push(Dt(e))},activeTab:x,activeTabModel:g,showShareModal:U,setShowShareModal:G}),(0,S.jsx)(Le.g,{className:"max-w-4xl pb-40",children:(0,S.jsx)(V.u,{items:null===o||void 0===o?void 0:o.tabs,renderItem:(e,t)=>(0,S.jsx)(S.Fragment,{children:["admin","moderator"].includes(o.myRole||"")||null!==e&&void 0!==e&&e.isJoined||null===e||void 0===e||!e.isPrivate?(0,S.jsx)(Ct,{onSubmit:oe,user:n,updateGroup:c,addToast:p,tab:e,group:o},t):null}),noItemsElement:(0,S.jsx)(S.Fragment,{children:o&&["admin"].includes(null!==(e=o.myRole)&&void 0!==e?e:"")?(0,S.jsxs)("div",{onClick:()=>{h(!0),m(!1)},className:"my-4 flex cursor-pointer items-center justify-center rounded-xl border border-dashed border-primary py-3",children:[(0,S.jsx)(M.A,{icon:"plus",className:"text-primary"}),(0,S.jsx)("div",{className:"bg-primary pl-2 text-xs uppercase text-primary",children:(0,S.jsx)(u.A,{children:"Create new channel"})})]}):(0,S.jsx)("div",{className:"no-post my-10 p-2 text-center font-bold",children:(0,S.jsx)(u.A,{children:" Looks like it's lonely here."})})}),footerElement:(0,S.jsx)(S.Fragment,{children:o&&["admin"].includes(null!==(t=o.myRole)&&void 0!==t?t:"")&&(0,S.jsxs)("div",{onClick:()=>{h(!0),m(!1)},className:"my-4 flex cursor-pointer items-center justify-center rounded-xl border border-dashed border-primary bg-card py-3",children:[(0,S.jsx)(M.A,{icon:"plus",className:"text-primary"}),(0,S.jsxs)("div",{className:"pl-2 text-xs uppercase text-primary",children:[" ",(0,S.jsx)(u.A,{children:"Create new channel"})]})]})})})})]})}})})}),"generic"===(null===g||void 0===g?void 0:g.sectionType)&&(0,S.jsx)("div",{className:"mx-auto flex justify-center xl:mr-10 xl:w-[35%]",children:"open"!==o.groupType&&"joined"!==o.joinStatus?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(_t,{widgets:z,onWidgetListUpdate:e=>{F(e)},addGroupMember:e=>{const t=[...P];t.push(e),D(t)},updateGroupMember:ee,updateClosedSectionMember:te,removeGroupMember:ne,removeClosedSectionMember:re,closedSectionMembers:O,closedSectionMembersCount:R,members:P})}),"realtime"===(null===g||void 0===g?void 0:g.sectionType)&&(0,S.jsx)("div",{className:"flex justify-end lg:mr-1",children:(0,S.jsx)(St,{group:o,updateGroupMember:ee,removeGroupMember:ne,updateClosedSectionMember:te,removeClosedSectionMember:re,closedSectionMembers:O,closedSectionMembersCount:R,members:P})})]})]}),(0,S.jsx)(d.c,{active:H,setActive:W,onSubmit:()=>{if(!Y)return p("Unable to delete channel!","","danger"),void console.error("sectionToDeleteId is not available");K(!0),v.Bd.deleteGroupTab(n,o.id,Y).then((e=>{let{group:t}=e;p("Channel deleted!","","success"),c(t),$(void 0)})).catch((e=>{console.log({error:e}),p("Unable to delete channel!","","danger")})).finally((()=>{W(!1),K(!1)}))},header:"Delete Channel",btnColor:"red",title:"Are you sure you want to delete the channel?",isLoading:q,children:void 0})]})})))},38545:(e,t,n)=>{"use strict";n.r(t),n.d(t,{POST_DETAIL_PAGE_ROUTE:()=>g,POST_DETAIL_SLUG_PAGE_ROUTE:()=>b,createPostDetailPageRoute:()=>v,createPostDetailPageRouteFromSlug:()=>y,createPostDetailPageUrl:()=>k,default:()=>x});var r=n(20975),o=n(31305),i=n(98020),s=n(89449),a=n(51772),l=n(93591),c=n(19678),d=n(91341),u=n(62144),p=n(78220),h=n(37081),m=n(48672),f=n(62391);const g="/post/:id",b="/p/:slug",v=e=>"/post/"+e,y=e=>{const t=null!==e.shared&&void 0!==e.shared,n=t?e.sharedId:e.id,r=t?e.shared.meta:e.meta;return void 0!==r&&void 0!==r.slug?"/p/"+e.meta.slug:"/post/"+n};function k(e){return window.location.origin+v(e)}const w={getPostDetailBySlug:h.gg,getPostDetailById:h.UJ,setPost:h.zM},x=(0,s.wj)((0,o.Ng)((e=>({user:e.auth,postDetail:e.postDetail})),w)((function(e){let{user:t,postDetail:n,getPostDetailBySlug:o,getPostDetailById:s,setPost:h}=e;const{post:g,isLoading:b,statusCode:v}=n,{id:k,slug:w}=(0,i.g)();return(0,r.useEffect)((()=>{void 0!==k&&s(k)}),[s,k]),(0,r.useEffect)((()=>{void 0!==w&&o(w)}),[t,w,o]),t||b||403!==v?(0,f.jsxs)("div",{className:"min-h-screen",children:[g?(0,f.jsx)("div",{className:"sticky top-[48px] z-[1] w-full bg-card px-5 py-3",children:(0,f.jsxs)("div",{className:"group flex cursor-pointer flex-row items-center font-semibold",onClick:()=>p.b6.push((0,m.C7)(g.group.id,g.tabId)),children:[(0,f.jsx)(u.A,{icon:"arrow-left",className:"transition-all group-hover:-translate-x-1"})," ","\xa0",g.tab.name?g.tab.name:""]})}):b?(0,f.jsx)("div",{className:"sticky top-[48px] z-[1] w-full animate-pulse bg-card px-5 py-3",children:(0,f.jsx)("div",{className:"group flex cursor-pointer flex-row items-center font-semibold",children:(0,f.jsx)("span",{className:"h-4 w-28 rounded bg-gray-200"})})}):(0,f.jsx)(f.Fragment,{}),(0,f.jsx)(l.g,{className:"max-w-2xl pb-10",children:b?(0,f.jsx)("div",{className:"m-6 flex animate-pulse",children:(0,f.jsx)("div",{className:"PostCard w-full rounded border border-border bg-card",children:(0,f.jsx)(c.A,{type:c.D.expanded})})}):g?(0,f.jsx)("div",{className:"flex flex-col justify-center p-3",children:(0,f.jsx)(a.RK,{noMargin:!0,showFullPost:!0,post:g,updatePost:e=>{h(e),p.b6.push(y(e))},deletePost:()=>{h(null)},displayPollResult:!0})}):(0,f.jsxs)("div",{className:"my-10 flex w-full flex-col items-center",children:[404===v&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.A,{variant:"t2",size:"h2",children:"This post was not found"}),(0,f.jsx)(d.A,{variant:"s1",children:"The post may have been removed or does not exist"})]}),403===v&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.A,{variant:"t2",size:"h2",children:"This is a private post"}),(0,f.jsx)(d.A,{variant:"s1",children:"You don't have the permission to view this post"})]})]})})]}):(0,f.jsx)("div",{className:"flex h-full w-full flex-col items-center justify-center",children:(0,f.jsx)(d.A,{className:"text-center",children:"You need to be logged in to view this post."})})})))},52090:(e,t,n)=>{"use strict";n.d(t,{I:()=>b,A:()=>v});var r=n(20975),o=n(89449),i=n(9175),s=n(51772),a=n(58157),l=n(25715),c=n(86129),d=n(91341),u=n(62144),p=n(43039),h=n(89431),m=n(50816),f=n(62391);function g(e){let{children:t,hoverableComponent:n,className:r=""}=e;return(0,f.jsxs)("div",{className:"tooltip ".concat(r," transition duration-75 ease-in-out"),children:[(0,f.jsx)("div",{className:"label invisible absolute right-8 z-50 mt-6 flex flex-col items-center opacity-0 transition-all",children:n&&(0,f.jsx)("div",{className:"z-0 text-xs text-secondary-foreground",children:n})}),(0,f.jsx)("div",{children:t})]})}const b=Object.freeze({USD:"$",INR:"\u20b9",EUR:"\u20ac",GBP:"\xa3",AUD:"A$",CAD:"C$",SGD:"S$",JPY:"\xa5",CNY:"\xa5",NZD:"NZ$",CHF:"CHF",SEK:"kr",DKK:"kr",NOK:"kr",MXN:"MX$",BRL:"R$",ZAR:"R",HKD:"HK$",TWD:"NT$",TRY:"\u20ba",RUB:"\u20bd",ILS:"\u20aa",KRW:"\u20a9",MYR:"RM"}),v=e=>{var t,n;let{communityId:v,groups:y,courses:k,subscription:w,onSelect:x=(e=>{}),onSubscriptionUpdate:_}=e;const[A,C]=(0,r.useState)(!1),[S,j]=(0,r.useState)("idle"),E=h.F.convertAmount(w.subscriptionAmount),N=h.F.calculateSubscriptionTotal(w),P=w.createdAt&&new Date(w.createdAt),D=b[w.currency]||w.currency,M=(0,i.d)();return(0,f.jsxs)("tr",{onClick:()=>{x(w)},className:"cursor-pointer rounded-b-none border border-border text-secondary-foreground/80 hover:bg-background",children:[(0,f.jsx)("td",{className:"p-1 md:px-4",children:w.name}),(0,f.jsx)("td",{className:"p-1 md:px-4",children:N>0?"".concat(D," ").concat(N):"Free"}),(0,f.jsx)("td",{className:"p-1 md:px-4",children:(0,f.jsx)("span",{children:null===P||void 0===P?void 0:P.toLocaleString("en-US",{day:"numeric",month:"short",year:"numeric"})})}),(0,f.jsx)("td",{className:"p-1 md:px-4",children:(null===w||void 0===w?void 0:w.memberCount)>1?"".concat(w.memberCount," Members"):(w.memberCount,"".concat(w.memberCount," Member"))}),(0,f.jsx)("td",{className:"relative p-1 md:px-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-1",children:[(0,f.jsxs)("div",{children:[null===w||void 0===w||null===(t=w.accessibleGroups)||void 0===t?void 0:t.length," groups,"," ",null===w||void 0===w||null===(n=w.accessibleCourses)||void 0===n?void 0:n.length," courses"]}),(0,f.jsx)(g,{children:(0,f.jsx)(u.A,{icon:"info",size:"xs",className:"ml-1 mt-1"}),hoverableComponent:(0,f.jsx)("div",{className:"w-full min-w-max max-w-md",children:(0,f.jsx)(m.R,{subscription:w,groups:y,courses:k})})})]})}),(0,f.jsx)("td",{className:"p-1 md:px-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[w.isDeleted?(0,f.jsx)("div",{className:"mr-1 h-2 w-2 rounded-full bg-warning"}):(0,f.jsx)("div",{className:"mr-1 h-2 w-2 rounded-full bg-green-500"}),w.isDeleted?"Inactive":"Active"]})}),(0,f.jsx)("td",{className:"p-1",children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.A,{icon:"menu-dots-vertical",dropdownClassName:" w-40 ",actions:[{label:"Deactivate",icon:"trash",actionType:l.X.alert,onClick:e=>{C(!0),console.log("delete",A)}}],hideOnEmpty:!1,onClick:void 0}),(0,f.jsx)(c.A,{visible:A,hideHeader:!0,className:"w-full max-w-sm",setVisible:C,children:(0,f.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,f.jsx)(d.A,{size:"body1",variant:"t1",translate:!0,className:"my-2 text-center",children:"Are you sure you want to Deactivate?"}),(0,f.jsxs)(d.A,{className:"text-xs text-alert",children:[null===w||void 0===w?void 0:w.name," of ",E," per month"]}),(0,f.jsx)("div",{className:"mt-4 h-24 w-11/12 border border-border bg-background",children:A&&(0,f.jsx)(d.A,{variant:"s1",className:"flex justify-center p-3 text-center text-xs font-normal",children:"Note: There are users subscribed to this membership so this will deactivate the membership until their next renewal cycle. And will be not be visible to new users"})}),(0,f.jsxs)("div",{className:"mt-6 flex w-full flex-col items-center justify-between gap-4 px-4 sm:flex-row",children:[(0,f.jsx)(a.A,{label:"Cancel",className:"flex-1 outline outline-1",onClick:e=>{e.preventDefault(),e.stopPropagation(),C(!1)}}),(0,f.jsx)(s.$n,{label:"Yes, deactivate it",className:"flex-1",btnColor:"red",isLoading:"loading"===S,onClick:e=>{e.preventDefault(),e.stopPropagation(),j("loading"),p.nC.deleteSubscription(v,w.id).then((e=>{let{subscription:t}=e;_(t),j("success"),M.addToast("Subscription deleted successfully"),j("success"),C(!1)})).catch((e=>{console.error("error",e),j("error"),M.addToast("Error deleting subscription","",o.lm.danger)}))}})]})]})})]})})]},w.id)}},50816:(e,t,n)=>{"use strict";n.d(t,{R:()=>R,t:()=>O});var r=n(20975),o=n(91341),i=n(77826),s=n(68466),a=n(53558),l=n(84003),c=n(62144),d=n(43039),u=n(6714),p=n(24452),h=n(36357),m=n(89431),f=n(4252),g=n(62220),b=n(52090),v=n(92139),y=n(5564),k=n.n(y),w=n(89449),x=n(9175),_=n(51772),A=n(25715),C=n(86129),S=n(96621),j=n(97843),E=n(62391);function N(e){let{communityId:t,userSubscriptionId:n,invoiceNumber:i,invoicePrefix:s,setVisible:a=(()=>{}),onPlanUpdate:l=(()=>{})}=e;const[c,u]=(0,r.useState)(s),[p,h]=(0,r.useState)(i),[m,f]=(0,r.useState)({invoiceNumber:"",invoicePrefix:""}),[g,b]=(0,r.useState)(!1),{addToast:v,ToastTypes:y}=(0,x.d)();return(0,E.jsx)("div",{className:"min-w-full max-w-lg",children:(0,E.jsxs)("form",{id:"content-4a",className:"flex flex-col gap-4",onSubmit:e=>{if(e.preventDefault(),!n)return void console.error("userSubscriptionId is required");const r={invoicePrefix:c,invoiceNumber:p};b(!0),d.nC.editInvoice(t,n,r).then((e=>{let{subscription:t}=e;v("Invoice updated successfully"),l(t),a(!1)})).catch((e=>{var t,n;const r=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.errors;r&&null!==r&&void 0!==r&&r.invoicePrefix&&Array.isArray(r.invoicePrefix)?f((e=>({...e,invoicePrefix:r.invoicePrefix[0]}))):r&&null!==r&&void 0!==r&&r.invoiceNumber&&Array.isArray(r.invoiceNumber)?f((e=>({...e,invoiceNumber:r.invoiceNumber[0]}))):console.log(e),v("Unable to update invoice.","",y.danger)})).finally((()=>{b(!1)}))},children:[(0,E.jsxs)("div",{className:"flex flex-col",children:[(0,E.jsx)("h3",{className:"after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,E.jsx)(o.A,{variant:"t2",children:"Update Invoice Prefix"})}),(0,E.jsx)(_.ks,{placeholder:"Enter invoice prefix",className:"bg-background",containerClassName:"bg-background",required:!0,defaultValue:s,onChange:e=>{u(e),f({...m,invoicePrefix:""})},large:!0,noMargin:!0}),(0,E.jsx)(_.jQ,{error:m.invoicePrefix})]}),(0,E.jsxs)("div",{className:"flex flex-col",children:[(0,E.jsx)("h3",{className:"after:ml-0.5 after:text-red-500 after:content-['*']",children:(0,E.jsx)(o.A,{variant:"t2",children:"Update Invoice number"})}),(0,E.jsx)(_.ks,{placeholder:"Enter invoice number",className:"bg-background",containerClassName:"bg-background",required:!0,defaultValue:i,onChange:e=>{h(e),f({...m,invoiceNumber:""})},large:!0,noMargin:!0}),(0,E.jsx)(_.jQ,{error:m.invoiceNumber})]}),(0,E.jsx)("div",{className:"mt-4 flex justify-end",children:(0,E.jsx)(_.$n,{label:"Update",onClick:()=>{},disabled:j.A.hasValue(m.invoiceNumber)||j.A.hasValue(m.invoicePrefix),isLoading:g})})]})})}function P(e){var t,n,i,s,a,l;let{plan:c,subscription:u,communityId:p,onPlanUpdate:m}=e;const f=c.user,g=c.billingDetails,b=u.isRecurring,v=new Date(c.createdAt),y=u.recurringInterval,[j,P]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1);var T=new Date(v);b&&y&&T.setMonth(T.getMonth()+y);const I=null!==(t=(0,r.useMemo)((()=>void 0!==navigator.languages?navigator.languages[0]:navigator.language),[]))&&void 0!==t?t:"en-US",O=(0,x.d)();return(0,E.jsxs)("tr",{className:"cursor-pointer border border-border text-sm text-secondary-foreground/80 hover:bg-background",children:[(0,E.jsxs)("td",{className:"p-1 py-6 md:px-4",children:[c.invoiceDetails.invoicePrefix,c.invoiceDetails.invoiceNumber]}),(0,E.jsxs)("td",{className:"p-1 md:px-4",children:[(0,E.jsx)(o.A,{variant:"t1",children:null!==(n=f.name)&&void 0!==n?n:"N/A"}),(0,E.jsx)("br",{}),(0,E.jsx)(o.A,{size:"caption",className:k()("",{hidden:!f.email&&!f.mobile}),children:"".concat(f.email," | ").concat(f.mobile)})]}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:null!==(i=g.state)&&void 0!==i?i:"N/A"}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:null!==(s=g.country)&&void 0!==s?s:"N/A"}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:v?v.toLocaleDateString(I,{year:"numeric",month:"short",day:"numeric"}):"N/A"}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:u.isRecurring?(0,E.jsx)(E.Fragment,{children:T.toLocaleDateString(I,{year:"numeric",month:"short",day:"numeric"})}):"N/A"}),(0,E.jsx)("td",{className:"p-1",children:(0,E.jsx)(h.av,{value:!j,ifPresent:()=>(0,E.jsx)(A.A,{actions:[{label:"Download Invoice",icon:"download",onClick:()=>{window.open("".concat(S.P,"community/").concat(p,"/invoice-download/").concat(c.id),"_blank")}},{label:"Edit Invoice no.",icon:"edit",onClick:()=>{M(!0)}},{label:"Send Invoice",icon:"paper-plane",onClick:()=>(P(!0),void d.nC.resendInvoice(p,c.id).then((e=>{console.log(e),P(!1),O.addToast("Invoice sent successfully","")})).catch((e=>{console.log(e),P(!1),O.addToast("Unable to resend invoice","",w.lm.danger)})))}]}),ifAbsent:()=>(0,E.jsx)(_.aH,{})})}),(0,E.jsx)(C.A,{title:"Update Invoice no.",className:"w-full max-w-sm",childrenClassName:"px-6 py-2 pb-6 ",visible:D,setVisible:M,children:(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(N,{communityId:p,userSubscriptionId:c.id,invoiceNumber:"".concat(null!==(a=c.invoiceDetails.invoiceNumber)&&void 0!==a?a:""),invoicePrefix:"".concat(null!==(l=c.invoiceDetails.invoicePrefix)&&void 0!==l?l:""),setVisible:M,onPlanUpdate:m})})})]})}function D(e){var t,n,i,s;let{plan:a,subscription:l,communityId:c}=e;const u=a.user,p=a.billingDetails,m=l.isRecurring,f=new Date(a.createdAt),g=l.recurringInterval,[b,v]=(0,r.useState)(!1),y=(0,x.d)();var C=new Date(f);m&&g&&C.setMonth(C.getMonth()+g);const j=null!==(t=(0,r.useMemo)((()=>void 0!==navigator.languages?navigator.languages[0]:navigator.language),[]))&&void 0!==t?t:"en-US";return(0,E.jsxs)("tr",{className:"cursor-pointer border border-border text-sm text-secondary-foreground/80 hover:bg-background",children:[(0,E.jsxs)("td",{className:"p-1 py-6 md:px-4",children:[a.invoiceDetails.invoicePrefix,a.invoiceDetails.invoiceNumber]}),(0,E.jsxs)("td",{className:"p-1 md:px-4",children:[(0,E.jsx)(o.A,{variant:"t1",children:null!==(n=u.name)&&void 0!==n?n:"N/A"}),(0,E.jsx)("br",{}),(0,E.jsx)(o.A,{size:"caption",className:k()("",{hidden:!u.email&&!u.mobile}),children:"".concat(u.email," | ").concat(u.mobile)})]}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:null!==(i=p.state)&&void 0!==i?i:"N/A"}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:null!==(s=p.country)&&void 0!==s?s:"N/A"}),(0,E.jsx)("td",{className:"p-1 md:px-4",children:f?f.toLocaleDateString(j,{year:"numeric",month:"2-digit",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}):"N/A"}),(0,E.jsx)("td",{className:"p-1",children:(0,E.jsx)(h.av,{value:!b,ifPresent:()=>(0,E.jsx)(A.A,{actions:[{label:"Download Invoice",icon:"download",onClick:()=>{window.open("".concat(S.P,"community/").concat(c,"/invoice-download/").concat(a.id),"_blank")}},{label:"Re send Invoice",icon:"paper-plane",onClick:()=>(v(!0),void d.nC.resendInvoice(c,a.id).then((e=>{console.log(e),v(!1),y.addToast("Invoice sent successfully","")})).catch((e=>{console.log(e),v(!1),y.addToast("Unable to resend invoice","",w.lm.danger)})))}]}),ifAbsent:()=>(0,E.jsx)(_.aH,{})})})]})}function M(e){let{headers:t}=e;return(0,E.jsx)("thead",{className:"border text-right text-xs text-secondary-foreground",children:(0,E.jsx)("tr",{children:t.map((e=>(0,E.jsx)("th",{className:"p-1 py-3 text-left md:px-4",children:(0,E.jsx)(o.A,{variant:"t1",children:e})},e)))})})}function T(e){let{subscription:t,logs:n,communityId:r}=e;return(0,E.jsx)("div",{className:"mx-4",children:(0,E.jsxs)("table",{className:"w-full table-auto rounded border bg-card text-sm text-secondary-foreground/80",children:[(0,E.jsx)(M,{headers:["Invoice","Member","State","Country","Payment on"]}),(0,E.jsx)("tbody",{children:(0,E.jsx)(l.B,{items:n,renderItem:(e,n)=>(0,E.jsx)(D,{subscription:t,plan:e,communityId:r,onPlanUpdate:()=>{}},n),noItemsElement:(0,E.jsx)("tr",{children:(0,E.jsx)("td",{colSpan:6,className:"h-96 px-4 py-3 text-center",children:(0,E.jsx)(o.A,{variant:"s1",children:"No Logs Available"})})}),placeholder:[...Array(10)].map(((e,t)=>(0,E.jsx)(v.C,{},t)))})})]})})}function I(e){let{activeMembers:t,subscription:n,status:r,communityId:i,onPlanUpdate:s}=e;return(0,E.jsx)("div",{className:"ActiveSubscriptionMembers mx-4 rounded",children:(0,E.jsxs)("table",{className:"theme-default-border w-full table-auto rounded border bg-card text-sm text-secondary-foreground/80",children:[(0,E.jsx)(M,{headers:["Invoice","Member","State","Country","Started on","Next renewal on"]}),(0,E.jsx)("tbody",{children:(0,E.jsx)(l.B,{items:t,loading:"loading"===r,renderItem:(e,t)=>(0,E.jsx)(P,{subscription:n,plan:e,communityId:i,onPlanUpdate:s},t),noItemsElement:(0,E.jsx)("tr",{children:(0,E.jsx)("td",{colSpan:6,className:"h-96 text-center",children:(0,E.jsx)(o.A,{variant:"s1",children:"No Active members"})})}),placeholder:[...Array(10)].map(((e,t)=>(0,E.jsx)(v.C,{},t)))})})]})})}function O(e){var t;let{subscription:n,communityId:i,groups:l,courses:c}=e;const h=Object.freeze({activeMembers:"Active Members",accessTo:"Access to",details:"Details",logs:"Logs"}),[f,g]=(0,r.useState)(h.activeMembers),[v,y]=(0,r.useState)(),[k,w]=(0,r.useState)(),[x,_]=(0,r.useState)("loading"),[A,C]=(0,r.useState)("loading");if((0,r.useEffect)((()=>{i&&n&&(_("loading"),d.nC.getActiveSubscriptionsForSubscription(i,n.id).then((e=>{let{userSubscriptions:t}=e;y(t),_("success")})).catch((e=>{console.error("error",e),_("error")})),C("loading"),d.nC.getAllMembershipSubscription(i,n.id).then((e=>{let{subscriptions:t}=e;w(t),C("success")})).catch((e=>{console.error("error",e),C("error")})),"idle"===c.status&&u.M.dispatch((0,p.OM)()))}),[i,n,c]),!Boolean(n))return null;const S=m.F.calculateSubscriptionTotal(n),j=b.I[n.currency]||n.currency;return(0,E.jsxs)("div",{className:"SubscriptionDetail flex flex-col border border-border pb-4",children:[(0,E.jsx)("div",{className:"flex h-full flex-col justify-center bg-background px-9 pb-4 pt-10",children:(0,E.jsxs)("div",{className:"flex items-center gap-12",children:[(0,E.jsx)(o.A,{size:"body1",variant:"t1",children:n.name}),(0,E.jsxs)("div",{className:"flex items-center gap-1",children:[(0,E.jsx)(o.A,{size:"h3",variant:"t1",children:S>0?"".concat(j," ").concat(S):"Free"}),(0,E.jsx)(o.A,{variant:"t1",size:"caption",children:(null!==(t=null===n||void 0===n?void 0:n.recurringInterval)&&void 0!==t?t:0)>0&&"per ".concat(null===n||void 0===n?void 0:n.recurringInterval," month")})]})]})}),(0,E.jsx)(a.s,{className:"flex w-full px-4",selectedTab:f,setSelectedTab:e=>{g(e)},tabs:[{label:"Active Members",key:h.activeMembers},{label:"Access to",key:h.accessTo},{label:"Details",key:h.details},{label:"Logs",key:h.logs}]}),(0,E.jsx)(s.G,{selectedTab:f,components:{[h.activeMembers]:(0,E.jsx)(I,{activeMembers:v,status:x,subscription:n,communityId:i,onPlanUpdate:e=>{y((t=>t?t.map((t=>t.id===e.id?e:t)):t))}}),[h.accessTo]:(0,E.jsx)(R,{subscription:n,groups:l,courses:c}),[h.details]:(0,E.jsx)(L,{subscription:n}),[h.logs]:(0,E.jsx)(T,{subscription:n,status:A,logs:k,communityId:i})}})]})}function L(e){let{subscription:t}=e;return(0,E.jsx)("div",{className:"DetailsView theme-default-border mx-4 rounded border bg-card px-4",children:(0,E.jsx)("div",{children:t.description?(0,E.jsx)("div",{dangerouslySetInnerHTML:{__html:t.description},className:"NL2BR headings my-2 min-h-[24rem]"}):(0,E.jsx)("div",{className:"flex h-96 items-center justify-center",children:(0,E.jsx)(o.A,{variant:"s1",children:"No description available"})})},t.id)})}function R(e){let{subscription:t,groups:n,courses:r}=e;return n&&t?(0,E.jsx)("div",{className:"theme-default-border mx-4 border bg-card px-4 py-4",children:(0,E.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,E.jsxs)("div",{className:"flex flex-col gap-2 rounded border border-border bg-background px-4 py-2",children:[(0,E.jsx)(o.A,{size:"body1",variant:"t1",children:"Groups"}),(0,E.jsx)(l.u,{items:t.accessibleGroups,className:"pl-4",renderItem:function(e,t){const r=n&&n.find((t=>t.id===e));return(0,E.jsx)("div",{className:"pb-2",children:(0,E.jsx)(h.av,{value:r,ifPresent:e=>(0,E.jsx)(i.N_,{to:(0,g.getGroupPageRouteFromSlug)(e),className:"text-start text-secondary-foreground/80 hover:underline",children:(0,E.jsxs)("span",{className:"flex items-center gap-1",children:[(0,E.jsx)(c.A,{icon:"rec",solid:!0,size:"xxs",className:"scale-50"}),e.name]})}),ifAbsent:()=>(0,E.jsx)(o.A,{variant:"t2",size:"small",className:"text-start",children:"Group not found (May be removed)"})})})}})]}),(0,E.jsxs)("div",{className:"flex flex-col gap-2 rounded border border-border bg-background px-4 py-2",children:[(0,E.jsx)(o.A,{size:"body1",variant:"t1",children:"Courses"}),(0,E.jsx)(l.u,{items:t.accessibleCourses,className:"pl-4",renderItem:function(e,t){const n=r.list&&r.list.find((t=>t.id===e));return(0,E.jsx)("div",{className:"pb-2",children:(0,E.jsx)(h.av,{value:n,ifPresent:e=>(0,E.jsx)(i.N_,{to:(0,f.getCoursePageRoute)(e.id),className:"text-start text-secondary-foreground/80 hover:underline",children:(0,E.jsxs)("span",{className:"flex items-center gap-1",children:[(0,E.jsx)(c.A,{icon:"rec",solid:!0,size:"xxs",className:"scale-50"}),e.title]})}),ifAbsent:()=>(0,E.jsx)(o.A,{variant:"t2",size:"small",className:"text-start",children:"Course not found (May be removed)"})})})},noItemsElement:(0,E.jsx)(o.A,{variant:"s1",size:"caption",children:"No course linked to this subscription"})})]})]},t.id)}):null}},35964:(e,t,n)=>{"use strict";n.d(t,{gh:()=>_e,zv:()=>ye,mB:()=>ke,Ay:()=>xe});var r=n(5564),o=n.n(r),i=n(20975),s=n(98020),a=n(89449),l=n(16478),c=n(62270),d=n(9175),u=n(51772),p=n(60553),h=n(72006),m=n.n(h),f=n(31305),g=n(34067),b=n(78220),v=n(38545),y=n(53871),k=n(8934),w=n(19328),x=n(63133),_=n(62391);const A=new g.F;function C(e){let t,{post:n,comment:r,user:o,activityType:i}=e;return t="post-comment"===i?n.title:null!==r?r.description:"",t?(0,_.jsx)("div",{className:"mx-4",children:(0,_.jsx)("span",{className:"flex cursor-pointer border-b border-border p-2 text-sm focus:outline-none",children:"post-comment"===i?(0,_.jsxs)("span",{className:"line-clamp-1 break-words",children:["\ud83d\udcac \xa0 ",(0,_.jsx)(y.A,{children:"Commented on"}),(0,_.jsx)("span",{className:"ml-1 text-sm font-semibold",children:t})]}):(0,_.jsxs)("span",{children:["\ud83d\udcac \xa0",(0,_.jsx)(y.A,{children:"Replied to"}),(0,_.jsx)("span",{dangerouslySetInnerHTML:{__html:A.render(t&&t.length>50?t.substring(0,48)+"...":t)},className:"ml-1 line-clamp-1 break-words text-sm font-semibold"})]})})}):(0,_.jsx)(_.Fragment,{})}function S(e){let{post:t,user:n,comment:r,postId:o,activityType:s}=e;const[a,l]=(0,i.useState)(!1),c=m().duration(m()(new Date).diff(m()(r.createdAt))).asDays();return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("div",{className:"PostComment my-4 pb-1 pl-4 pt-2",children:[(0,_.jsx)("div",{className:"flex items-center justify-between",children:(0,_.jsx)("div",{className:"text-sm",children:(0,_.jsx)(k.eu,{user:r.createdBy,extraInfo:c<1?m()(r.createdAt).fromNow():m()(r.createdAt).format("DD MMM YYYY"),size:36,activityAvatar:!0,className:"cursor-pointer"})})}),(0,_.jsx)("div",{className:"py-1 pl-12 text-sm font-light",children:(0,_.jsx)("div",{className:"NL2BR headings",dangerouslySetInnerHTML:{__html:A.render(r.description)}})}),(0,_.jsx)(x.L,{reply:r,activityType:s,isActivity:!0}),a?(0,_.jsx)("div",{className:"processing",children:(0,_.jsx)(w.a,{})}):(0,_.jsx)(_.Fragment,{})]},r.id)})}function j(e){let{isProcessing:t}=e;return t?(0,_.jsx)("div",{className:"PostProcessing",children:(0,_.jsx)(w.a,{})}):(0,_.jsx)(_.Fragment,{})}const E=(0,f.Ng)((e=>({user:e.auth,group:e.activeGroup})))((function(e){let{post:t,comment:n,reply:r,user:s,group:a,noMargin:l=!1,activityType:c}=e;const[d,u]=(0,i.useState)(!1),[p,h]=(0,i.useState)(!1),[m,f]=(0,i.useState)(!1),[g,y]=(0,i.useState)(null);return t?(0,_.jsxs)("div",{id:"PostCard-"+t.id,className:o()("PostCard my-3 rounded-2xl bg-card shadow",{"my-3":!l,"cursor-pointer":null!==n}),onClick:e=>{null!==n&&b.b6.push((0,v.createPostDetailPageRouteFromSlug)(t))},children:[(0,_.jsx)(C,{post:t,comment:n,user:s,activityType:c}),null!==n?(0,_.jsx)(S,{user:s,post:t,comment:"post-comment"===c?n:r,areCommentsLoading:p,setCommentsLoading:h,setAreCommentsLoading:h,activityType:c}):null,(0,_.jsx)(j,{isProcessing:d})]}):(0,_.jsx)(_.Fragment,{})}));var N=n(84003),P=n(93092),D=n(36646);function M(e){let{isProhibited:t,isProhibitedUserUnblockable:n,isLoadingPosts:r,activities:o,updatePost:i,isLoadingMorePosts:s}=e;return(0,_.jsx)(N.u,{items:o,loading:!t&&r,renderItem:e=>"post-create"===e.activityType?e.post?(0,_.jsx)(P.RK,{post:e.post,updatePost:t=>{if(t){const n={...e,post:t};i(n)}},showFullPost:1===o.length,deletePost:t=>{if(t){const t={...e,post:void 0};i(t)}}},e.id):(0,_.jsx)(_.Fragment,{}):(0,_.jsx)(E,{activityType:e.activityType,post:e.post,comment:e.comment,reply:e.reply},e.id),noItemsElement:(0,_.jsxs)("div",{className:"no-post my-10 p-2 text-center",children:[(0,_.jsx)("div",{className:"my-3 font-bold",children:(0,_.jsx)(y.A,{children:"Looks like it's lonely here."})}),(0,_.jsx)("div",{children:n&&(0,_.jsx)(_.Fragment,{children:t?(0,_.jsx)(y.A,{children:"Unblock user to continue"}):(0,_.jsx)(y.A,{children:"No activity to show."})})})]}),placeholder:(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:!t&&(0,_.jsx)(D.A,{length:7})}),footerElement:(0,_.jsx)(_.Fragment,{children:!t&&s&&(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:(0,_.jsx)(D.A,{length:2})})})})}var T=n(63360),I=n(93591),O=n(16118),L=n(43039),R=n(42414),B=n(31696),z=n(77826),F=n(62144);function U(e){let{isMyProfile:t,isLoading:n}=e;const r=(0,s.zy)().search,i=new URLSearchParams(r),a=i.get("profile-tab"),l=[{label:"Profile",key:"profile",icon:"user"},{label:"Posts",key:"posts",icon:"edit"},{label:"Activities",key:"activity",icon:"pulse"}];return t&&l.push({label:"Bookmark",key:"bookmark",icon:"bookmark"}),n?(0,_.jsxs)("div",{className:"flex place-content-center items-center gap-2",children:[(0,_.jsx)("div",{className:"h-5 w-16 rounded-full bg-gray-200"}),(0,_.jsx)("div",{className:"h-5 w-16 rounded-full bg-gray-200"}),(0,_.jsx)("div",{className:"h-5 w-16 rounded-full bg-gray-200"}),t&&(0,_.jsx)("div",{className:"h-5 w-16 rounded-full bg-gray-200"})]}):(console.log({activeTab:a,urlParams:i}),(0,_.jsx)("div",{className:"",children:(0,_.jsx)("div",{className:"flex w-full place-content-center items-center gap-2 sm:gap-4",children:l.map((e=>(0,_.jsxs)(z.N_,{to:V(e.key),className:(0,u.cn)(o()("hover:bg-primary-light flex cursor-pointer items-center gap-2 rounded-full border border-border px-2 py-1 text-xs font-medium sm:px-4",{"bg-primary text-primary-foreground hover:border-primary hover:text-primary":e.key===a,"text-secondary-foreground/80 hover:border-secondary-foreground/50":e.key!==a})),onClick:()=>{},children:[(0,_.jsx)(F.A,{icon:e.icon}),e.label]},e.key)))})}))}function V(e){const t=new URLSearchParams(window.location.search);return t.set("profile-tab",e),window.location.pathname+"?"+t.toString()}var G=n(65186),H=n(55049),W=n(26464),q=n(1689),K=n(58157),Y=n(74345),$=n(25715),Q=n(30725),Z=n(57731),J=n(7702);const X=e=>{let{blockedUsersList:t,blockedUsersCount:n,blockedUsersListVisibility:r,onClose:o,onUnblockUser:i}=e;return(0,_.jsxs)("div",{className:"absolute left-0 right-0 z-10 mx-auto -mt-12 max-h-[40vh] w-[360px] overflow-y-auto rounded-md bg-background shadow-lg",children:[(0,_.jsxs)("div",{className:"theme-default-text-color flex justify-between gap-1 p-2 px-5 py-4 text-sm font-extrabold",children:[(0,_.jsx)("span",{className:"".concat(r?"visible":"hidden"),children:"".concat(n>0?n:"NO"," BLOCKED ").concat(n>1?"USERS":"USER")}),(0,_.jsx)("button",{onClick:o,children:(0,_.jsx)(F.A,{icon:"cross",className:"cursor-pointer","w-12":!0})})]}),(0,_.jsx)("div",{className:"h-px w-full bg-zinc-800"}),t.map((e=>(0,_.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,_.jsx)("div",{className:"flex items-center justify-center",children:(0,_.jsx)(k.eu,{className:"cursor-pointer",user:e,noName:!0,extraInfo:"",onClick:e=>{}})}),(0,_.jsx)("div",{className:"flex items-center",children:(0,_.jsx)("p",{className:"theme-default-text-color text-sm font-bold",children:e.name})}),(0,_.jsx)("div",{className:"flex flex-1 place-content-end",children:(0,_.jsx)("button",{className:"text-alert",onClick:()=>{i(e.id)},children:"Unblock"})})]})))]})},ee=e=>{let{followersList:t,followedList:n,userDetails:r,toggleFollowFollowingList:o,onClose:i}=e;return(0,_.jsxs)("div",{className:"absolute z-10 rounded-md h-full overflow-y-auto left-0 right-0 mx-auto",children:[(0,_.jsxs)("div",{className:"py-1-4 sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card px-4 font-bold text-secondary-foreground/80",children:[(0,_.jsxs)("span",{className:"".concat("follower"===o?"visible":"hidden"),children:["follower"===o&&r.followersCount," ",1===r.followersCount?"FOLLOWER":"FOLLOWERS"]}),(0,_.jsxs)("span",{className:"".concat("followed"===o?"visible":"hidden"),children:["followed"===o&&r.followingCount," ","FOLLOWING"]}),(0,_.jsx)(T.J,{onClick:()=>i(),type:"primary"})]}),"follower"===o&&(null===t||void 0===t?void 0:t.map((e=>(0,_.jsxs)("div",{className:"flex items-center px-4 py-3 gap-2 hover:cursor-pointer",onClick:()=>{window.open(ke(e.id,"activity"))},children:[(0,_.jsx)("div",{className:"flex items-center justify-center",children:(0,_.jsx)(k.eu,{className:"cursor-pointer",user:e,noName:!0,extraInfo:"",onClick:e=>{}})}),(0,_.jsx)("div",{className:"flex items-center",children:(0,_.jsx)("p",{className:"text-sm font-bold text-secondary-foreground",children:e.name})})]})))),"followed"===o&&(null===n||void 0===n?void 0:n.map((e=>(0,_.jsxs)("div",{className:"flex items-center px-4 py-3 gap-2 hover:cursor-pointer",onClick:()=>{window.open(ke(e.id,"activity"))},children:[(0,_.jsx)("div",{className:"flex items-center justify-center",children:(0,_.jsx)(k.eu,{className:"cursor-pointer",user:e,noName:!0,extraInfo:"",onClick:e=>{}})}),(0,_.jsx)("div",{className:"flex items-center",children:(0,_.jsx)("p",{className:"text-sm font-bold text-secondary-foreground",children:e.name})})]}))))]})};function te(){return(0,_.jsx)("div",{className:"animate-pulse rounded-2xl bg-card",children:(0,_.jsxs)("div",{className:"flex place-items-center p-4",children:[(0,_.jsx)("p",{className:"h-[75px] w-[75px] flex-shrink-0 rounded-full border bg-background bg-gray-300 object-cover"}),(0,_.jsxs)("div",{className:"ml-2 w-max space-y-3",children:[(0,_.jsx)("p",{className:"h-2 w-28 rounded bg-gray-300"}),(0,_.jsx)("p",{className:"mt-2 h-2 w-24 rounded bg-gray-300"}),(0,_.jsx)("p",{className:"mt-2 h-2 w-20 rounded bg-gray-300"})]})]})})}function ne(e){let{userDetail:t,isLoading:n,isMyProfile:r,displayedInModel:o,userId:s,followersCount:a,followedsCount:c,setFollowersCount:p,setToggleFollowFollowingList:h,toggleFollowFollowingList:m,setUserDetail:f,blockedUsersList:g,blockedUsersCount:b,onUnblockUser:v}=e;const{analyticsService:y}=(0,G.W)(),{user:k,community:w}=(0,l.G)((e=>({community:e.community,user:e.auth}))),x=null===w||void 0===w?void 0:w.id,[A,C]=(0,i.useState)([]),[S,j]=(0,i.useState)([]),[E,N]=(0,i.useState)(!1),[P,D]=(0,i.useState)(!1),[M,T]=(0,i.useState)(!1),[I,O]=(0,i.useState)(!1),[R,B]=(0,i.useState)(!1),[U,V]=(0,i.useState)(!1),ne=async()=>{try{const e=(await L.DL.getFollowersList(s,x)).followers;C(e),h("follower")}catch(e){console.log(e)}},re=async()=>{try{const e=(await L.DL.getFollowedList(s,x)).followings;j(e),h("followed")}catch(e){console.log(e)}},{DirectMessageModelState:{setIdToViewMessage:oe,setShowDirectMessageModel:ie}}=(0,H.A)(),{profileModelState:{setIdToViewProfile:se,setShowProfileModel:ae}}=(0,H.A)(),{addToast:le}=(0,d.d)(),ce=async()=>{try{N(!0);await L.DL.followUser(s,x);p(a+1),f((e=>({...e,isFollowedByMe:!0}))),N(!1)}catch(e){console.log(e),N(!1)}},de=async()=>{try{N(!0);await L.DL.unfollowUser(s,x);p(a-1),f((e=>({...e,isFollowedByMe:!1}))),N(!1)}catch(e){console.log(e),N(!1)}},ue={reportType:"User Profile Report",contentLink:window.location.origin+"/user/".concat(null===t||void 0===t?void 0:t.id),community:w,addToast:le,activeProps:{isReportModalVisible:P,setReportModalVisible:D},displayProps:{displayClosePrompt:M,setDisplayClosePrompt:T},content:"user-profile"};return(0,_.jsxs)("div",{className:"h-full",children:[n?(0,_.jsx)(te,{}):(0,_.jsx)("div",{className:"ProfilePageHeader rounded-2xl bg-card",children:(0,_.jsxs)("div",{className:"flex flex-col justify-between gap-2 sm:flex-row",children:[(0,_.jsxs)("div",{className:"flex w-full flex-row items-center justify-between gap-2 p-2 sm:flex-grow md:p-4",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[null!==t&&void 0!==t&&t.isProhibited?(0,_.jsx)(F.A,{icon:"ban",size:"6xl"}):(0,_.jsx)(q.A,{id:"userProfilePicture",src:t.picture,alt:"",className:"h-[75px] w-[75px] flex-shrink-0 rounded-full border bg-background object-cover"}),(0,_.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,_.jsxs)("span",{className:"flex items-center gap-2",children:[(0,_.jsx)("p",{className:"text-[16px] font-bold text-secondary-foreground",children:null!==t&&void 0!==t&&t.isProhibited?"Blocked User":t.name}),o&&(0,_.jsx)(z.N_,{to:ke(t.id),className:"-rotate-45 pt-1.5 text-secondary-foreground/70",onClick:()=>{se(""),ae(!1)},children:(0,_.jsx)(F.A,{icon:"arrow-small-right"})})]}),!(null!==t&&void 0!==t&&t.isProhibited)&&(0,_.jsxs)("p",{className:"text-[12px] font-normal text-secondary-foreground/70",children:["@",t.userId]}),(0,_.jsx)("p",{className:"mt-1 text-[12px] font-semibold text-secondary-foreground/90",children:null===t||void 0===t?void 0:t.shortBio})]})]}),(0,_.jsx)("div",{className:"flex flex-grow items-center justify-end gap-4 sm:hidden",children:(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[!r&&!(null!==t&&void 0!==t&&t.isProhibited)&&(0,_.jsxs)("div",{className:"flex items-center gap-2",children:[(0,_.jsx)(u.$n,{isLoading:E,icon:(0,_.jsx)(F.A,{icon:"user-add"}),label:t.isFollowedByMe?"Following":"Follow",onClick:t.isFollowedByMe?de:ce,outlined:!0===t.isFollowedByMe,className:"h-fit w-[82px] rounded-md px-2.5 py-1 text-xs font-semibold ".concat(!t.isFollowedByMe&&"bg-primary text-primary-foreground")}),!w.isDirectMessageDisabled&&(0,_.jsx)("div",{onClick:e=>{y.track("dm-icon-clicked-on-profile"),oe(t.id),ie(!0)},children:(0,_.jsx)(W.b1,{})}),(0,_.jsx)($.A,{icon:"menu-dots-vertical",className:"h-8 w-8",actions:[{icon:"flag",label:"Report",onClick:()=>{D(!0)}},{icon:"ban",label:"Block",onClick:()=>{O(!0)}}]})]}),r&&(0,_.jsxs)("div",{className:"flex",children:[(0,_.jsx)(z.N_,{to:J.USER_PROFILE_UPDATE_PAGE_ROUTE,onClick:()=>{y.track("edit-profile-clicked-on-profile")},children:(0,_.jsx)("div",{className:"text-sm font-normal",children:"Edit Profile"})}),(0,_.jsx)($.A,{icon:"menu-dots-vertical",className:"h-8 w-8",hideOnEmpty:!0,actions:[{icon:"list",label:b>0?"Show Blocked Users":"",onClick:()=>{B(!0)}}]})]}),!(null!==t&&void 0!==t&&t.isProhibited)&&(0,_.jsx)("div",{className:"mt-4 flex items-center justify-between",children:(0,_.jsxs)("div",{className:"flex gap-2.5 text-xs",children:[(0,_.jsxs)("div",{className:"flex gap-1 text-secondary-foreground ".concat(0!==a?"cursor-pointer":"cursor-not-allowed"," "),onClick:()=>{a>0&&ne()},children:[(0,_.jsx)("span",{className:"font-bold",children:a}),(0,_.jsx)("span",{className:"font-semibold",children:"Followers"})]}),(0,_.jsxs)("div",{className:"flex gap-1 text-secondary-foreground ".concat(0!==c?"cursor-pointer":"cursor-not-allowed"," "),onClick:()=>{c>0&&re()},children:[(0,_.jsx)("span",{className:"font-bold",children:c}),(0,_.jsx)("span",{className:"font-semibold",children:"Following"})]})]})})]})})]}),(0,_.jsx)("div",{className:"hidden pr-2 pt-4 sm:flex",children:(0,_.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[!r&&!(null!==t&&void 0!==t&&t.isProhibited)&&(0,_.jsxs)("div",{className:"flex gap-2",children:[(0,_.jsx)(u.$n,{isLoading:E,icon:(0,_.jsx)(F.A,{icon:"user-add"}),label:t.isFollowedByMe?"Following":"Follow",onClick:t.isFollowedByMe?de:ce,outlined:!0===t.isFollowedByMe,className:"h-fit w-[82px] rounded-md px-2.5 py-1 text-xs font-semibold ".concat(!t.isFollowedByMe&&"bg-primary text-primary-foreground")}),!w.isDirectMessageDisabled&&(0,_.jsx)("div",{className:"-mt-0.5 h-4 p-2 transition-transform duration-300 ease-in-out hover:scale-105",onClick:e=>{y.track("dm-icon-clicked-on-profile"),oe(t.id),ie(!0)},children:(0,_.jsx)(W.b1,{})}),(0,_.jsx)($.A,{icon:"menu-dots-vertical",className:"h-8 w-8",actions:[{icon:"flag",label:"Report",onClick:()=>{D(!0)}},{icon:"ban",label:"Block",onClick:()=>{O(!0)}}]})]}),r&&(0,_.jsxs)("div",{className:"flex",children:[(0,_.jsx)(z.N_,{to:J.USER_PROFILE_UPDATE_PAGE_ROUTE,children:(0,_.jsx)(K.A,{className:"mt-1.5 w-[90px]",label:"Edit Profile",onClick:()=>{y.track("edit-profile-clicked-on-profile")}})}),(0,_.jsx)($.A,{icon:"menu-dots-vertical",className:"h-8 w-8",hideOnEmpty:!0,actions:[{icon:"list",label:b>0?"Show Blocked Users":"",onClick:()=>{B(!0)}}]})]}),!(null!==t&&void 0!==t&&t.isProhibited)&&(0,_.jsx)("div",{className:"mt-4 flex justify-between",children:(0,_.jsxs)("div",{className:"flex gap-2.5 text-xs",children:[(0,_.jsxs)("div",{className:"flex gap-1 text-secondary-foreground ".concat(0!==a?"cursor-pointer":"cursor-not-allowed"," "),onClick:()=>{a>0&&ne()},children:[(0,_.jsx)("span",{className:"font-bold",children:a}),(0,_.jsx)("span",{className:"font-semibold",children:"Followers"})]}),(0,_.jsxs)("div",{className:"flex gap-1 text-secondary-foreground ".concat(0!==c?"cursor-pointer":"cursor-not-allowed"," "),onClick:()=>{c>0&&re()},children:[(0,_.jsx)("span",{className:"font-bold",children:c}),(0,_.jsx)("span",{className:"font-semibold",children:"Following"})]})]})})]})})]})}),k&&!r&&(0,_.jsx)(Q.A,{...ue}),k&&("follower"===m||"followed"===m)&&(0,_.jsx)(Z.A,{width:570,className:"mt-2 max-w-2xl rounded-t-2xl bg-card md:mt-0 md:rounded-l-2xl md:rounded-tr-none",setActive:h,active:m,children:(0,_.jsx)(ee,{followersList:A,followedList:S,userDetails:t,toggleFollowFollowingList:m,onClose:()=>{h("")}})}),I&&(0,_.jsx)(Y.A,{community:w.id.toString(),addToast:le,activeProps:{active:I,setActive:O},displayProps:{displayClosePrompt:M,setDisplayClosePrompt:T},createdById:s,blockCallback:()=>{V(!0)}}),R&&b>0&&(0,_.jsx)(X,{blockedUsersList:g,blockedUsersListVisibility:R,blockedUsersCount:b,onUnblockUser:v,onClose:()=>B(!1)})]})}function re(e){let{userDetails:t}=e;const{additionalMetaDetails:n}=t;return null!==n&&void 0!==n&&n.length?(0,_.jsx)("div",{className:"UserAdditionalMetaDetails",children:n.map((e=>(0,_.jsxs)("div",{className:"mb-2 grid grid-cols-2",children:[(0,_.jsxs)("div",{className:"font-semibold",children:[e.label,":"]}),(0,_.jsx)("div",{children:e.value})]},e._id)))}):(0,_.jsx)(_.Fragment,{})}var oe=n(67787),ie=n(55227),se=n(64125),ae=n(16442),le=n(71703),ce=n(89859),de=n(86285),ue=n(38298),pe=n(92704);const he=e=>{let{userDetails:t}=e;const n=[{link:"instagramLink",icon:le.A},{link:"facebookLink",icon:se.A},{link:"linkedinLink",icon:ce.A},{link:"youtubeLink",icon:pe.A},{link:"twitterLink",icon:ue.A},{link:"pintrestLink",icon:de.A},{link:"dribbbleLink",icon:ie.A},{link:"behanceLink",icon:oe.A},{link:"webLink",icon:ae.A}].filter((e=>t[e.link]));return 0===n.length?(0,_.jsx)(_.Fragment,{children:" "}):(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-[12px]",children:"SOCIAL HANDLES"}),(0,_.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:n.map(((e,n)=>(0,_.jsx)("a",{href:t[e.link],target:"_blank",rel:"noopener noreferrer",className:"transition-transform duration-150 ease-in-out hover:scale-105",children:(0,_.jsx)("img",{src:e.icon,className:"cursor-pointer",width:"20",height:20,alt:""})},n)))})]})};function me(e){let{isLoading:t,userDetail:n}=e;const r=new g.F;return t?(0,_.jsx)("div",{className:"flex h-96 flex-col gap-4 rounded-2xl bg-card p-4 shadow-md"}):n?(0,_.jsxs)("div",{className:"flex flex-col gap-4 rounded-2xl bg-card p-[30px] text-[14px] shadow-md",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("label",{className:"text-[12px] font-medium",children:(0,_.jsx)(y.A,{children:"Bio"})}),n.bio?(0,_.jsx)("p",{className:"NL2BR headings md:max-w-[550px]",dangerouslySetInnerHTML:{__html:r.render(n.bio)}}):(0,_.jsx)("div",{className:"mt-1 rounded-md border-l-4 border-border bg-background px-4 py-4 text-sm text-secondary-foreground/70",children:(0,_.jsx)(y.A,{children:"No Bio available"})})]}),(0,_.jsx)(re,{userDetails:n}),(0,_.jsx)(he,{userDetails:n})]}):(0,_.jsx)(_.Fragment,{})}var fe=n(91341),ge=n(89431),be=n(52090);function ve(e){var t;let{subscription:n}=e;if(!n||!n.subscriptionPlan)return(0,_.jsx)(_.Fragment,{});const r=ge.F.calculateSubscriptionTotal(n.subscriptionPlan),o=be.I[n.subscriptionPlan.currency]||n.subscriptionPlan.currency,s=n.subscriptionPlan.isRecurring,a=n.subscriptionPlan.createdAt,l=n.subscriptionPlan.recurringInterval;var c=new Date(a);s&&l&&c.setMonth(c.getMonth()+l);const d=null!==(t=(0,i.useMemo)((()=>void 0!==navigator.languages?navigator.languages[0]:navigator.language),[]))&&void 0!==t?t:"en-US";return(0,_.jsx)("div",{className:"relative",children:(0,_.jsxs)("div",{className:"absolute top-0 w-full rounded border bg-card text-sm",children:[(0,_.jsx)("div",{className:"border-b p-4",children:(0,_.jsx)(fe.A,{variant:"t1",translate:!0,children:"CURRENT MEMBERSHIP"})}),(0,_.jsxs)("div",{className:"flex flex-col p-4",children:[(0,_.jsx)(fe.A,{size:"body1",variant:"t1",children:n.subscriptionPlan.name}),(0,_.jsx)("div",{className:"NL2BR headings",dangerouslySetInnerHTML:{__html:n.subscriptionPlan.description}}),(0,_.jsxs)(fe.A,{variant:"t1",size:"body1",className:"mt-5",children:[r>0&&"".concat(o," ").concat(r," per month"),n.subscriptionPlan.isRecurring&&" ".concat(o," per ").concat(n.subscriptionPlan.recurringInterval)+" month"]}),n.subscriptionPlan.isRecurring&&(0,_.jsxs)(_.Fragment,{children:["renew on"," ",c.toLocaleDateString(d,{year:"numeric",month:"long",day:"numeric"})]})]})]})})}const ye="/user/:userId";function ke(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we.profile;return"/user/".concat(e,"?profile-tab=")+t}const we=Object.freeze({profile:"profile",activity:"activity",post:"posts",bookmark:"bookmark"});function xe(){const{userId:e}=(0,s.g)();return(0,_.jsx)(_e,{userId:e,displayedInModel:!1})}function _e(e){var t,n;let{userId:r,displayedInModel:s=!0}=e;const{user:h,community:m,mySubscription:f}=(0,l.G)((e=>({community:e.community,user:e.auth,mySubscription:e.mySubscription}))),g=(0,c.A)(),b=(0,l.j)(),[v,k]=(0,i.useState)(null),[w,x]=(0,i.useState)(!0),[A,C]=(0,i.useState)(!1),S=null!==(t=new URLSearchParams(window.location.search).get("profile-tab"))&&void 0!==t?t:"profile",[j,E]=(0,i.useState)(!0),[N,P]=(0,i.useState)(!0),[z,F]=(0,i.useState)(1),[V,G]=(0,i.useState)(1),[H,W]=(0,i.useState)([]),[q,K]=(0,i.useState)([]),[Y,$]=(0,i.useState)([]),[Q,Z]=(0,i.useState)(!1),[J,X]=(0,i.useState)(!1),[ee,te]=(0,i.useState)(!0),[re,oe]=(0,i.useState)(!1),[ie,se]=(0,i.useState)(!1),[ae,le]=(0,i.useState)(null),[ce,de]=(0,i.useState)(""),[ue,pe]=(0,i.useState)(0),[he,fe]=(0,i.useState)(0),[ge,be]=(0,i.useState)(""),[ye,ke]=(0,i.useState)([]),[xe,_e]=(0,i.useState)(0),Ae=(null===v||void 0===v?void 0:v.id)===(null===h||void 0===h?void 0:h.id),Ce=null===m||void 0===m?void 0:m.id,Se=i.createRef(),{addToast:je}=(0,d.d)();(0,i.useEffect)((()=>{r&&Ce&&(L.BE.getUserPostsInCommunityById(Ce,r).then((e=>{let{posts:t,page:n}=e;t&&t.length>0&&(t=t.map((e=>{var t;return{...e,comments:null!==(t=e.comments)&&void 0!==t?t:[]}}))),W(t),E(!1)})),L.BE.getUserActivitiesInCommunityById(Ce,r).then((e=>{let{userActivities:t,page:n}=e;K(t),P(!1)})).catch((e=>{console.log({error:e}),se(!0),P(!1)})))}),[Ce,r]);const Ee=async()=>{try{const e=await L.DL.getBlockedUsersList(Ce);ke(e.blockedUser),_e(e.blockedUser.length)}catch(e){console.log(e)}};(0,i.useEffect)((()=>{r&&(L.DL.getUserProfileById(r).then((e=>{k(e.user),x(!1)})).catch((e=>{B.A.checkIfBlocked(e)&&console.log("[Block] Unauthorize error ")})),(async()=>{try{const e=await L.DL.getFollowFollowingCount(r,Ce),t=e.followersCount,n=e.followingCount;pe(t),fe(n)}catch(e){console.log(e)}})(),Ee())}),[r]),(0,i.useEffect)((()=>{Ae&&(Z(!0),L.K$.getBookmarks().then((e=>{let{posts:t}=e;$(t),Z(!1)})))}),[Ae]);function Ne(){!J&&ee&&S===we.post&&(X(!0),L.BE.getUserPostsInCommunityById(Ce,r,z+1).then((e=>{if(0===e.posts.length||e.posts.length<10)te(!1);else{let t=e.posts;t&&t.length>0&&(t=t.map((e=>{var t;return{...e,comments:null!==(t=e.comments)&&void 0!==t?t:[]}}))),W([...H,...t]),F(e.page)}X(!1)}))),re||ie||S!==we.activity||(oe(!0),L.BE.getUserActivitiesInCommunityById(Ce,r,V+1).then((e=>{0===e.userActivities.length?se(!0):(K([...q,...e.userActivities]),G(e.page),oe(!1)),oe(!1)})))}(0,i.useEffect)((()=>{const e=()=>{window.innerHeight+window.scrollY+100>=document.body.offsetHeight&&Ne()};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[J,re,z,H,q,ee,r,Ce,S,ie,V]),(0,i.useEffect)((()=>{const e=e=>{le(e.target.src)};return document.querySelectorAll("#userProfilePicture").forEach((t=>{t.addEventListener("click",e)})),()=>{document.querySelectorAll("#userProfilePicture").forEach((t=>{t.removeEventListener("click",e)}))}}),[H]);return(0,i.useEffect)((()=>{Ce&&Ae&&L.BE.getMyLeaderboardScore(Ce).then((e=>{de(e.score)})).catch((e=>{console.log({err:e})}))}),[Ce,Ae]),h?(0,_.jsxs)("div",{ref:Se,onScroll:async()=>{if(Se.current){const{scrollTop:e,scrollHeight:t,clientHeight:n}=Se.current;console.log("scrollTop + clientHeight === scrollHeight",e+n===t,{height:e+t,scrollHeight:t}),e+n+100>=t&&Ne()}},className:o()("UserWallPage min-h-screen overflow-y-auto py-1 md:py-3",{"gap-2 xl:grid-cols-3":f}),children:[(0,_.jsx)(I.g,{className:"max-w-2xl grid-cols-2 px-4 sm:px-0",children:(0,_.jsxs)("div",{className:"flex flex-col gap-4",children:[ae&&(0,_.jsx)("div",{className:"UserProfilePicFullPreview",onClick:e=>{le(null)},children:(0,_.jsxs)("div",{className:"holder",children:[(0,_.jsx)("img",{src:ae,alt:"Preview"}),(0,_.jsx)(T.J,{className:"close-button",onClick:e=>{le(null)}})]})}),(0,_.jsx)(ne,{isLoading:w,isMyProfile:Ae,userDetail:v,setUserDetail:k,displayedInModel:s,userId:r,followersCount:ue,followedsCount:he,setFollowersCount:pe,toggleFollowFollowingList:ge,setToggleFollowFollowingList:be,blockedUsersList:ye,blockedUsersCount:xe,onUnblockUser:async e=>{try{await L.DL.unblockPeer(m,e),Ee()}catch(t){je({type:"error",message:"Unable to block; Contact admin"})}}}),(0,_.jsx)("div",{className:o()("",{"border-y border-border py-2":s}),children:(0,_.jsx)(U,{isMyProfile:Ae,isLoading:w})}),S===we.profile&&(0,_.jsx)("div",{className:o()("",{"mx-3":s}),children:(0,_.jsx)(me,{userDetail:v,isLoading:j})}),S===we.activity&&(0,_.jsx)("div",{className:o()("-mt-3",{"mx-3":s}),children:(0,_.jsx)(M,{isLoadingPosts:N,isLoadingMorePosts:re,activities:q,updatePost:e=>{const t=q.findIndex((t=>t.id===e.id));if(-1!==t){const n=[...q];n[t]=e,K(n)}},isProhibited:null!==(n=null===v||void 0===v?void 0:v.isProhibited)&&void 0!==n&&n,isProhibitedUserUnblockable:null===v||void 0===v?void 0:v.isProhibitedUserUnblockable})}),S===we.post&&(0,_.jsx)("div",{className:o()("-mt-3",{"mx-3":s}),children:(0,_.jsx)(u.Bs,{posts:H,allPosts:H,isCommunityPost:!0,isLoading:j,onPostUpdate:(e,t)=>{t&&W(t)},placeholder:(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:(0,_.jsx)(D.A,{length:7})}),footerElement:(0,_.jsxs)(_.Fragment,{children:[J&&(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:(0,_.jsx)(D.A,{length:7})}),!ee&&(0,_.jsx)("div",{className:"flex h-32 place-content-center items-center text-xs text-secondary-foreground/80",children:(0,_.jsx)(y.A,{children:"Looks like you have reached the end of the list, No more post to display"})})]}),noItemsElement:(0,_.jsxs)("div",{className:"no-post my-10 p-2 text-center",children:[(0,_.jsx)("div",{className:"my-3 font-bold",children:(0,_.jsx)(y.A,{children:"Looks like it's lonely here."})}),(0,_.jsx)("div",{children:(0,_.jsx)(y.A,{children:"The user hasn't posted anything yet publicly."})})]})})}),S===we.bookmark&&Ae&&(0,_.jsx)("div",{className:o()("-mt-3",{"mx-3":s}),children:(0,_.jsx)(u.Bs,{posts:Y.filter((e=>e.isBookmarkedByMe)),allPosts:Y,isCommunityPost:!0,isLoading:Q,onPostUpdate:(e,t)=>{t&&$(t)},placeholder:(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:(0,_.jsx)(D.A,{length:7})}),footerElement:J&&(0,_.jsx)("div",{className:"mt-2 rounded bg-card",children:(0,_.jsx)(D.A,{length:7})}),noItemsElement:(0,_.jsxs)("div",{className:"no-post my-10 p-2 text-center",children:[(0,_.jsx)("div",{className:"my-3 font-bold",children:(0,_.jsx)(y.A,{children:"Looks like it's lonely here."})}),(0,_.jsx)("div",{children:(0,_.jsx)(y.A,{children:"You have no bookmarks right now."})})]})})}),(0,_.jsx)(p.c,{active:A,setActive:C,onSubmit:()=>{L.BE.leaveCommunity(h,m.id).then((e=>{let{community:t}=e;b((0,R.Km)(t)),C(!1),je(g.trans("Unsubscribed from")+" "+t.name)})).catch((e=>{console.log({error:e,message:"Subscribe to community failed!"}),je(g.trans("Could not unsubscribe from")+" "+m.name,"",a.lm.danger)}))},btnColor:"red",header:"Unsubscribe",title:"Are you sure you want to unsubscribe the community?",isLoading:void 0,children:void 0})]})}),f&&!s&&(0,_.jsx)(I.g,{className:"hidden h-full max-w-[320px] xl:block",children:(0,_.jsx)("div",{className:"sticky top-20",children:(0,_.jsx)(ve,{subscription:f})})})]}):(0,_.jsxs)("div",{className:"PostCard flex flex-col items-center justify-center",children:[(0,_.jsx)("div",{className:"my-5 text-center",children:(0,_.jsx)(y.A,{children:"Login to view this page"})}),(0,_.jsx)(u.$n,{label:"Login",onClick:e=>{(0,O.D4)(m)}})]})}},50520:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(44427),o=n(78220),i=n(16118);const s={getLiveCallsByCommunity:async e=>(await r.A.get(o.vZ.liveCall.getAllByCommunity(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}})).data,createLiveCall:async(e,t,n,s,a,l,c)=>{const d=new FormData;d.append("name",t),d.append("type",n),d.append("description",s),d.append("invitedSections",JSON.stringify(a)),d.append("scheduledTime",l),c&&d.append("banner",c);return(await r.A.post(o.vZ.liveCall.createLiveCall(e),d,{headers:{Authorization:"Bearer "+(0,i.ut)(),"Content-Type":"multipart/form-data"}})).data}}},53322:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});var r=n(44427),o=n(78220);class i{static async uploadMedia(e,t,n,i){const s=new FormData;return null===n||void 0===n||n.forEach((e=>{s.append("".concat(i,"s[]"),e,e.fileName)})),r.A.post(o.vZ.media.uploadMedia(t,i),s,{headers:{Authorization:"Bearer "+e.token}}).then((e=>e.data))}}},54608:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async pinRealtimeSectionMessage(e){try{return(await r.A.post(o.vZ.message.pinned(e),{},{headers:{Authorization:"Bearer "+(0,i.ut)()}})).data}catch(t){throw console.error(t),t}}static async unpinRealtimeSectionMessage(e){try{return(await r.A.delete(o.vZ.message.pinned(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}})).data}catch(t){throw console.error(t),t}}static async getPinnedSectionMessages(e,t){try{return(await r.A.get(o.vZ.message.getPinnedMessage(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}})).data}catch(n){throw console.error(n),n}}}},48514:(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async getRole(e,t){return r.A.get(o.vZ.community.roles.getRole(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async updateRole(e,t,n,s){return r.A.post(o.vZ.community.roles.updateRole(e),{userId:t,role:n,groups:s},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}}},81475:(e,t,n)=>{"use strict";n.d(t,{n:()=>s});var r=n(44427),o=n(78220),i=n(16118);class s{static async createSubscription(e,t){return r.A.post(o.vZ.subscription.createSubscription(e),t,{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async updateSubscription(e,t,n){return r.A.post(o.vZ.subscription.updateSubscription(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async cancelSubscription(e){return r.A.delete(o.vZ.subscription.cancelSubscription(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async deleteSubscription(e,t){return r.A.delete(o.vZ.subscription.deleteSubscription(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getAllSubscriptions(e){return r.A.get(o.vZ.subscription.getAllSubscriptions(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getMySubscription(e){return r.A.get(o.vZ.subscription.getMySubscription(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getAllSubscriptionsAdmin(e){return r.A.get(o.vZ.subscription.getAllSubscriptionsAdmin(e),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getActiveSubscriptionsForSubscription(e,t){return r.A.get(o.vZ.subscription.getActiveSubscriptionsForSubscription(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getPreviousSubscriptionsForSubscription(e,t){return r.A.get(o.vZ.subscription.getPreviousSubscriptionsForSubscription(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getSubscriptionDetails(e,t){return r.A.get(o.vZ.subscription.getSubscriptionDetails(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getAllSubscriptionMembers(e,t){return r.A.get(o.vZ.subscription.getAllSubscriptionMembers(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async getAllMembershipSubscription(e,t){return r.A.get(o.vZ.subscription.getAllMembershipSubscription(e,t),{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async subscribeToFreePlan(e,t){return r.A.post(o.vZ.subscription.freeSubscribe(e,t),{},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async initiateSubscription(e,t,n){return r.A.post(o.vZ.subscription.initiateSubscription(e,t),{billingDetails:n},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async resendInvoice(e,t){return r.A.post(o.vZ.subscription.resendInvoice(e,t),{},{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}static async editInvoice(e,t,n){return r.A.post(o.vZ.subscription.editInvoice(e,t),n,{headers:{Authorization:"Bearer "+(0,i.ut)()}}).then((e=>e.data))}}},2155:(e,t,n)=>{"use strict";n.d(t,{Em:()=>a,Ks:()=>s,_n:()=>i,m5:()=>l});var r=n(50963),o=n(43039);const i="SET_COMMUNITY_POST_TIMER_LIMIT",s="SET_LAST_POST_CREATED_TIME";function a(e){return{type:s,lastPostCreatedTime:e}}function l(){return async(e,t)=>{try{var n;const{auth:s,community:a,post:l}=t();if(!s||!a)return;const c=await o.BE.getConfigurable(a.id,r.A.COMMUNITY_POST_TIMER_LIMIT),d=Number(null===c||void 0===c||null===(n=c.configurable)||void 0===n?void 0:n.configurableValue)||0;console.log({postTimeLimit:d}),e({type:i,postTimerLimit:d})}catch(s){console.log(s)}}}},30493:(e,t,n)=>{"use strict";n.d(t,{AL:()=>a,E:()=>o,Jv:()=>i,_K:()=>l});var r=n(43039);const o="SET_KARMA_POINT",i="ADD_KARMA_POINT",s=e=>({type:o,obj:e}),a=(e,t)=>({type:i,points:e,activityType:t});function l(){return async(e,t)=>{try{const{auth:n,community:o}=t();if(!n||!o)return;r.BE.getMyLeaderboardScore(o.id).then((t=>{e(s(t))})).catch((e=>{console.log({err:e})}))}catch(n){console.log(n)}}}},57405:(e,t,n)=>{"use strict";n.d(t,{A8:()=>p,AA:()=>u,I2:()=>l,L4:()=>h,Ll:()=>s,Ml:()=>i,OE:()=>m,R4:()=>a,Up:()=>o,x_:()=>d});var r=n(43039);const o="SET_TOPICS",i="ADD_TOPIC",s="EDIT_TOPIC",a="ARCHIVE_TOPIC",l="DELETE_TOPIC",c=e=>({type:o,obj:e}),d=e=>({type:i,topic:e}),u=e=>({type:s,topic:e}),p=e=>({type:a,topicId:e}),h=e=>({type:l,topicId:e});function m(){return async(e,t)=>{try{const{auth:n,community:o}=t();if(!n||!o)return;r.BE.getAllCommunityTopics(o.id).then((t=>{e(c(t.topics))})).catch((e=>{console.log({err:e})}))}catch(n){console.log(n)}}}},1071:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(24452);const o={list:[],status:"idle"};function i(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case r.at:return console.log("coursesReducer",n),{list:n.courses,status:null!==(e=n.status)&&void 0!==e?e:t.status};case r.pG:return{...t,status:n.status};default:return t}}},24452:(e,t,n)=>{"use strict";n.d(t,{OM:()=>a,at:()=>o,pG:()=>i});var r=n(43039);const o="SET_COURSES",i="SET_COURSE_LOADING_STATUS";function s(e){return{type:i,status:e}}function a(){return async(e,t)=>{try{const{community:n}=t();if(!n)return;e(s("loading")),r.fk.getAllCourses(n.id).then((t=>{let{courses:n}=t;e(function(e,t){return console.log("coursesReducer",e),{type:o,courses:e,status:t}}(n,"success"))})).catch((t=>{console.log(t),e(s("error"))}))}catch(n){console.log(n)}}}},6714:(e,t,n)=>{"use strict";n.d(t,{M:()=>K});var r=n(82993);function o(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var i=o();i.withExtraArgument=o;const s=i;var a=n(30493);const l={breakdown:null,communityBasePoints:0,addedPoints:0};var c=n(62856),d=n(1071),u=n(3766),p=n(16653);const h={liveCalls:null};var m=n(47669),f=n(37081),g=n(9888);const b={paymentPreference:{preference:{integrationStatus:"not-set",bankAccount:{bankAccountNumber:void 0,beneficiaryName:void 0,ifscCode:void 0,businessName:void 0,businessType:void 0},paymentMethod:"not-set",razorpay:{razorpayId:void 0}},status:"idle"},invoicePreference:{preference:{integrationStatus:"not-set"},status:"idle"}};var v=n(46997);const y={count:{}};var k=n(34944),w=n(52041),x=n(98130);const _={};var A=n(94714);const C={subscriptions:[]};var S=n(77255);var j=n(42414);var E=n(41153);const N={liveSession:!0,paidGroup:!0,sso:!0,analytics:!0,customDomain:!0,embedSection:!0,welcomeMessage:!0,leaderboard:!0,communityCustomization:!0,zapierIntegration:!0,hidePoweredByPensil:!0,favicon:!0,whiteLabelMobileApp:!0,linkPaymentGateway:!0,moderation:!0,bulkEmailing:!0,bulkImport:!0,bulkExport:!0,apiKeysAccess:!0,customCodeSnippets:!0};var P=n(41374);const D={isLoading:!1,isInitialLoadComplete:!1,error:null,users:[]};var M=n(93668);var T=n(92082);const I={isLoading:!0,isUpdating:!1,preferences:void 0,error:void 0};var O=n(88614);var L=n(5607);var R=n(83380);var B=n(2155);const z={postTimerLimit:null,lastPostCreatedTime:null};var F=n(57405);const U={topics:[]};var V=n(21419);const G=(0,r.HY)({auth:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case S.A2:return t.user;case S.qj:return null;default:return e}},groups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t.type===M.yI?t.groups:e},isLoadingGroups:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===M.qk?t.loading:e},activeGroup:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===M.qj?t.group:e},community:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===j.hQ?t.community:e},notifications:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(t.type===O.nh){const n=t.unreadMessagesCount,r=t.unreadNotificationsCount,o=t.unreadSectionNotificationsCount;return{...e,unreadMessagesCount:n,unreadNotificationsCount:r,unreadSectionNotificationsCount:o}}return e},personalGroup:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===L.Yj?t.group:e},post:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case B._n:return{...e,postTimerLimit:t.postTimerLimit};case B.Ks:return{...e,lastPostCreatedTime:t.lastPostCreatedTime};default:return e}},socket:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===R.P?t.socket:e},directMessages:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case P.J0:return{...e,isLoading:!0,isInitialLoadComplete:!0,error:null,users:[]};case P.Fy:return{...e,isLoading:!1,error:null,users:t.users};case P.u6:return{...e,isLoading:!1,error:t.error,users:[]};case P.Bs:{let n=e.users.find((e=>void 0!==e&&e.id===t.user.id));return{...e,users:void 0!==n?e.users:[...e.users,t.user]}}case P.TP:return{...e,users:e.users.map((e=>e.id===t.chat.id?{...e,unreadMessageCount:0}:e))};default:return e}},notificationCentre:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case T.J$:return{isLoading:!1,isUpdating:!1,error:void 0,preferences:t.preferences};case T.T:return{...e,error:void 0,isUpdating:!0};case T.wA:return{...e,error:t.error,isUpdating:!1};default:return e}},communityPac:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,t=arguments.length>1?arguments[1]:void 0;return t.type===E.u?t.pac:e},sectionMessages:m.P_,search:k.JT,highlightedPosts:u.H0,liveCall:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case p.kz:return{liveCalls:n.payload};case p.Yh:return(null===(e=t.liveCalls)||void 0===e?void 0:e.some((e=>e.id===n.payload.id)))?{...t}:{...t,liveCalls:t.liveCalls?[...t.liveCalls,n.payload]:[n.payload]};case p.IU:return{...t,liveCalls:t.liveCalls?t.liveCalls.filter((e=>e.id!==n.payload.id)):t.liveCalls};default:return t}},sections:w.vq,postDetail:f.Ei,communityKarmaPoints:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case a.E:return t.obj;case a.Jv:return{...e,addedPoints:t.points,activityType:t.activityType};default:return e}},onboardingChecklist:V.st,communityTopics:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case F.Up:return{...e,topics:t.obj};case F.Ml:return{...e,topics:[...e.topics,t.topic]};case F.Ll:return{topics:e.topics.map((e=>e.id===t.topic.id?{...e,...t.topic}:e))};case F.R4:case F.R4:const n=e.topics.find((e=>e.id.toString()===t.topicId.toString()));if(n){n.status="ARCHIVED"===n.status?"ACTIVE":"ARCHIVED";const r=e.topics.filter((e=>e.id.toString()!==t.topicId.toString())).concat(n).sort(((e,t)=>"ACTIVE"===e.status&&"ARCHIVED"===t.status?-1:"ARCHIVED"===e.status&&"ACTIVE"===t.status?1:t.postCount-e.postCount));return{...e,topics:r}}return e;case F.I2:return{topics:e.topics?e.topics.filter((e=>{var n,r;return(null===(n=e.id)||void 0===n?void 0:n.toString())!==(null===(r=t.topicId)||void 0===r?void 0:r.toString())})):e.topics};default:return e}},subscriptionsPlan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C,t=arguments.length>1?arguments[1]:void 0;return t.type===A.jn?t.subscriptions:e},mySubscription:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;return t.type===x.UP?t.mySubscription:e},realTimeSectionCountReducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;return t.type===v.t6?{...e,realtimeSectionNotificationCount:t.payload}:e},courses:d.F,preferenceReducer:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case g.Kt:return{...n,paymentPreference:{preference:r.paymentPreference,status:null!==(e=r.status)&&void 0!==e?e:n.paymentPreference.status}};case g.Ax:return{...n,paymentPreference:{preference:n.paymentPreference.preference,status:r.status}};case g.$7:return{...n,invoicePreference:{preference:r.invoicePreference,status:null!==(t=r.status)&&void 0!==t?t:n.invoicePreference.status}};case g.li:return{...n,invoicePreference:{preference:n.invoicePreference.preference,status:r.status}};default:return n}},communityLinks:c.Vs}),H={auth:JSON.parse(localStorage.getItem("pensil.user"))};let W;const q=[s];W=r.Zz;const K=(0,r.y$)(G,H,W((0,r.Tw)(...q)))},16653:(e,t,n)=>{"use strict";n.d(t,{F_:()=>c,IU:()=>i,Yf:()=>l,Yh:()=>o,c2:()=>a,kz:()=>s});var r=n(50520);const o="ADD_LIVE_CALL",i="END_LIVE_CALL",s="SET_LIVE_CALLS",a=e=>({type:o,payload:e}),l=e=>({type:i,payload:e}),c=()=>async(e,t)=>{try{const{auth:o,community:i}=t();if(!o||!i)return;const a=await r.c.getLiveCallsByCommunity(i.id);a&&e((n=a.liveCalls,{type:s,payload:n}))}catch(o){console.log(o)}var n}},68709:(e,t,n)=>{"use strict";n.d(t,{GT:()=>h,Pq:()=>l,UH:()=>u,_O:()=>p,kI:()=>c,n0:()=>a,wG:()=>s,xW:()=>i});var r=n(50963),o=n(43039);const i="SET_ONBOARDING_CHECKLIST_DISMISS",s="SET_SELECTED_PARENT_ONBOARDING_SECTION",a="SET_ONBOARDING_CHECKLIST_DETAILS",l=e=>({type:i,isDismiss:e}),c=e=>({type:s,sectionKey:e}),d=e=>{for(const t in e)if("object"===typeof e[t]){if(!d(e[t]))return!1}else if(!0!==e[t])return!1;return!0},u=e=>{const t=d(e);return{type:a,details:e,allTrue:t}};function p(){return async(e,t)=>{try{const{auth:n,community:i}=t();if(!n||!i)return;const s=await o.BE.getConfigurable(i.id,r.A.COMMUNITY_SHOW_ONBOARDING_LIST),a="true"===s.configurable.configurableValue||!0===s.configurable.configurableValue;e(l(a))}catch(n){console.log(n)}}}function h(){return async(e,t)=>{try{const{auth:n,community:r}=t();if(!n||!r)return;const i=await o.BE.getCommunityOnboardingListData(r.id);e(u(i.onboardingChecklist))}catch(n){console.log(n)}}}},21419:(e,t,n)=>{"use strict";n.d(t,{Qz:()=>o,st:()=>a});var r=n(68709);const o=[{key:"customiseCommunity",label:"Customise Community"},{key:"setGroupsAndChannels",label:"Set Up Groups & Channels"},{key:"inviteUsers",label:"Invite Users"}],i={[o[0].key]:[{communityLogo:!1},{communityTheme:!1},{communityFont:!1},{communityBanner:!1}],[o[1].key]:[{createGroup:!1},{createChannel:!1},{createQuickLinks:!1}],[o[2].key]:[{inviteUsersWithCustomMail:!1}]},s={showOnboardingList:null,selectedOnboardingSection:o[0].key,onboardingChecklistDetails:i,showAllDonePopup:!1};function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case r.xW:return{...e,showOnboardingList:t.isDismiss};case r.wG:return{...e,selectedOnboardingSection:t.sectionKey};case r.n0:return{...e,onboardingChecklistDetails:t.details,showAllDonePopup:t.allTrue};default:return e}}},9888:(e,t,n)=>{"use strict";n.d(t,{$7:()=>s,Ax:()=>i,Cb:()=>p,Kt:()=>o,fQ:()=>m,jk:()=>h,li:()=>a,sE:()=>f});var r=n(43039);const o="SET_PAYMENT_PREFERENCE",i="SET_PAYMENT_PREFERENCE_LOADING_STATUS",s="SET_INVOICE_PREFERENCE",a="SET_INVOICE_PREFERENCE_LOADING_STATUS";function l(e,t){return{type:o,paymentPreference:e,status:t}}function c(e,t){return{type:s,invoicePreference:e,status:t}}function d(e){return{type:i,status:e}}function u(e){return{type:a,status:e}}function p(){return async(e,t)=>{try{const{community:n}=t();if(!n)return;e(d("loading")),r.To.getPreference(n.id).then((t=>{let{paymentPreference:n}=t;if(!n)return console.log("No payment preference found"),void e(d("success"));e(l(n,"success"))})).catch((t=>{console.error(t),e(d("error"))}))}catch(n){console.log(n),e(d("error"))}}}function h(){return async(e,t)=>{try{const{community:n}=t();if(!n)return;e(u("loading")),r.To.getInvoicePreference(n.id).then((t=>{let{invoicePreference:n}=t;if(!n)return console.log("No invoice preference found"),void e(u("success"));e(c(n,"success"))})).catch((t=>{console.error(t),e(u("error"))}))}catch(n){console.log(n),e(u("error"))}}}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>{};return async(o,i)=>{const{community:s}=i();s&&(o(d("loading")),r.To.updatePreference(s.id,e).then((e=>{let{paymentPreference:n}=e;t(n),o(l(n,"success"))})).catch((e=>{console.error(e),n(e),o(d("error")),console.log("Error in update payment preference",e)})))}}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>{};return async(o,i)=>{try{const{community:s}=i();if(!s)return;o(u("loading")),r.To.updateInvoicePreference(s.id,e).then((e=>{let{invoicePreference:n}=e;t(n),o(c(n,"success"))})).catch((e=>{console.error(e),o(u("error")),n(e)}))}catch(s){console.log(s),o(u("error"))}}}},46997:(e,t,n)=>{"use strict";n.d(t,{$G:()=>a,BU:()=>s,sn:()=>l,t6:()=>o});var r=n(43039);const o="SET_REALTIME_SECTION_NOTIFICATION_COUNT",i=e=>({type:o,payload:e});function s(){return async(e,t)=>{try{const{auth:n,community:o}=t();if(!n||!o)return;const s=await r.d4.getSectionMessageNotificationBadge(o.id);e(i(s))}catch(n){console.error("ERROR",n)}}}function a(e){return async(t,n)=>{try{const{auth:o,community:s,realTimeSectionCountReducer:a}=n();if(!o||!s)return;const{realtimeSectionNotificationCount:l}=a;if(!Object.keys(l.count).includes(e))return;await r.d4.getSectionMessageNotificationMarkAsRead(s.id,e).then((n=>{const r=l.count;delete r[e],t(i({count:r}))}))}catch(o){console.error(o)}}}function l(e){return(t,n)=>{try{const{auth:r,community:o,realTimeSectionCountReducer:s}=n();if(!r||!o)return;const{realtimeSectionNotificationCount:a}=s;if(!Object.keys(a.count).includes(e))return void t(i({count:{...a.count,[e]:1}}));const l=a.count;l[e]+=1,t(i({count:l}))}catch(r){console.error(r)}}}},98130:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>s,UP:()=>o,mU:()=>a});var r=n(81475);const o="SET_MY_SUBSCRIPTION_PLAN";function i(e){return{type:o,mySubscription:e}}function s(){return async(e,t)=>{try{const{auth:n,community:o}=t();if(!n||!o)return;r.n.getMySubscription(o.id).then((t=>{let{subscription:n}=t;e(i(n))})).catch((e=>{console.log(e)}))}catch(n){console.log(n)}}}function a(e){let{onSuccess:t=(()=>{}),onError:n=(()=>{})}=e;return async(e,o)=>{try{const{auth:s,community:a}=o();if(!s||!a)return;r.n.cancelSubscription(a.id).then((n=>{let{subscription:r}=n;t(r),e(i({}))})).catch((e=>{let{err:t}=e;console.log(t),n(t)}))}catch(s){console.log(s),n(s)}}}},94714:(e,t,n)=>{"use strict";n.d(t,{X4:()=>i,jn:()=>o});var r=n(43039);const o="SET_SUBSCRIPTION_PLAN";function i(){return async(e,t)=>{try{const{auth:n,community:i}=t();if(!n||!i)return;r.nC.getAllSubscriptions(i.id).then((t=>{let{subscriptions:n}=t;e(function(e){return{type:o,subscriptions:e}}(n))})).catch((e=>{console.log(e)}))}catch(n){console.log(n)}}}},36357:(e,t,n)=>{"use strict";n.d(t,{Bu:()=>a,E6:()=>i,I1:()=>s,ZV:()=>l,av:()=>r,gZ:()=>o});const r=e=>{let{value:t,ifPresent:n,ifAbsent:r}=e;var o;return t&&null!=t?n(t):null!==(o=null===r||void 0===r?void 0:r())&&void 0!==o?o:null};function o(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:n?3:8).toString(16)}))}function i(e,t,n){if(!e||null===e)return e;return e.filter((e=>e[t]!==n))}function s(e,t,n,r){if(!e||null===e)return e;return e.map((e=>e[t]===n?r:e))}function a(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return e;if(!t)return e;if(e.length<=t)return e;if(n)return e.slice(0,t)+"...";return e.slice(0,t/2-1)+"[...]"+e.slice(e.length-t/2+2)}const l=e=>e>=1e9?"".concat((e/1e9).toFixed(1),"B"):e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e},35084:(e,t,n)=>{"use strict";n.d(t,{Y:()=>s,f:()=>i});var r=n(72006),o=n.n(r);const i=e=>{const t=o()(),n=o()(e),r=t.diff(n,"seconds"),i=t.diff(n,"minutes"),s=t.diff(n,"hours"),a=t.diff(n,"days"),l=t.diff(n,"weeks"),c=t.diff(n,"months"),d=t.diff(n,"years");return d>=1?"".concat(d,"y ago"):c>=1?"".concat(c,"mo ago"):l>=1?"".concat(l,"w ago"):a>=1?"".concat(a,"d ago"):s>=1?"".concat(s,"h ago"):i>=1?"".concat(i,"m ago"):"".concat(r,"s ago")};function s(e){return e?o()(e).fromNow().replace(" days ago","d ago").replace("an hour ago","1h ago").replace(" hours ago","h ago").replace(" weeks ago","w ago").replace(" minutes ago","m ago").replace("a minute ago","1m ago").replace(" seconds ago","s ago").replace(" months ago","mo ago").replace(" years ago","y ago"):""}},31696:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(78220),o=n(26914);const i={logout:async(e,t)=>{o.r.reset(),localStorage.removeItem("pensil.user"),o.r.reset(),t&&await t(),window.location.reload()},checkIfBlocked:e=>{var t,n,i;if(401===(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)&&"User blocked!"===(null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.message))return o.r.reset(),localStorage.removeItem("pensil.user"),r.b6.push("/login"),window.location.reload(),!0}}},76224:(e,t,n)=>{"use strict";async function r(e){if(!e)return[];const t=[];console.log("checking for profanity",(new Date).toLocaleDateString("en-us",{minute:"2-digit",second:"2-digit"}));const r=await new Promise(((e,t)=>{n.e(934).then(n.t.bind(n,52934,19)).then((t=>{e(null===t||void 0===t?void 0:t.words)}))}));if(!r||!1===Array.isArray(r))return console.error("BadWords is not an array"),[];for(let n=0;nr})},89431:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(97843);class o{static isSubscriptionPurchasedByGroup(e,t){var n,r,o;return!(!e||!e.isActive)&&(null!==(n=null===(r=e.subscriptionPlan)||void 0===r||null===(o=r.accessibleGroups)||void 0===o?void 0:o.some((e=>e===t)))&&void 0!==n&&n)}static isSubscriptionPurchasedByCourse(e,t){var n,r,o;return!(!e||!e.isActive)&&(null!==(n=null===(r=e.subscriptionPlan)||void 0===r||null===(o=r.accessibleCourses)||void 0===o?void 0:o.some((e=>e===t)))&&void 0!==n&&n)}static hasPaidSubscription(e){return e.oneMonthlySubscriptions.length>0||e.threeMonthlySubscriptions.length>0||e.sixMonthlySubscriptions.length>0||e.twelveMonthlySubscriptions.length>0||e.oneTimeSubscriptions.length>0}static filterSubscriptionsForGroup(e,t){var n={oneMonthlySubscriptions:[],threeMonthlySubscriptions:[],sixMonthlySubscriptions:[],twelveMonthlySubscriptions:[],oneTimeSubscriptions:[]};function o(e,t){return e.isRecurring&&e.recurringInterval===t&&!e.isDeleted}const i=t=>{var n;return null===t||void 0===t||null===(n=t.accessibleGroups)||void 0===n?void 0:n.includes(e)};if(!e)return n;if(!r.A.hasValue(t)||!Array.isArray(t))return n;for(var s=0;s{var n;return null===t||void 0===t||null===(n=t.accessibleCourses)||void 0===n?void 0:n.includes(e)};if(!e)return n;if(!r.A.hasValue(t)||!Array.isArray(t))return n;for(var s=0;s{"use strict";n.d(t,{A:()=>r});class r{static hasValue(e){return null!==e&&void 0!==e&&("object"===typeof e?Array.isArray(e)?e.length>0:Object.keys(e).length>0:Array.isArray(e)?e.length>0:"string"!==typeof e||e.length>0)}}},49852:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,G:()=>l});var r=n(20975),o=n(16478),i=n(16118),s=n(43039),a=n(62391);const l=(0,r.createContext)(null);l.displayName="AppServiceContext";const c=e=>{let{children:t}=e;const{user:n,community:r}=(0,o.G)((e=>({user:e.auth,community:e.community}))),c=s.cu.Instance({communityId:null===r||void 0===r?void 0:r.id,communityName:null===r||void 0===r?void 0:r.name,user:{name:null===n||void 0===n?void 0:n.name,email:null===n||void 0===n?void 0:n.email,mobile:null===n||void 0===n?void 0:n.mobile},communityUrl:r&&(0,i.IT)(r)});return(0,a.jsx)(l.Provider,{value:{analyticsService:c},children:t})}},47760:(e,t,n)=>{"use strict";n.d(t,{$M:()=>l,DQ:()=>a,h6:()=>s});var r=n(20975),o=n(16478),i=n(62391);const s=(0,r.createContext)(null),a=Object.freeze({ONE_COLUMN:"one-column",TWO_COLUMN:"two-column",NO_TOP_PADDING:"noTopPadding",THREE_COLUMN_WITH_COMMUNITY_SWITCHER:"three-column-with-community-switcher"}),l=e=>{let{children:t}=e;const[n,l]=(0,r.useState)(""),c=(0,o.G)((e=>e.community)),d=c?c.isCommunitySwitcherDisabled:void 0,u=(0,o.G)((e=>e.auth));return(0,i.jsx)(s.Provider,{value:{baseColumnClass:n,setAppLayout:e=>{let t=e;u&&!d&&(t+=" "+a.THREE_COLUMN_WITH_COMMUNITY_SWITCHER),l(t)},setBaseLayout:()=>{l(u&&!d?a.THREE_COLUMN_WITH_COMMUNITY_SWITCHER:"")}},children:t})}},23541:(e,t,n)=>{"use strict";n.d(t,{V:()=>p,A:()=>h});var r=n(20975),o=n(7058),i=n(57731),s=n(62391);var a=n(63360),l=n(53871),c=n(26464),d=n(56726);var u=n(35964);const p=(0,r.createContext)({profileModelState:{setShowProfileModel:()=>{},setIdToViewProfile:()=>{}},messageListModelState:{setShowMessageListModel:()=>{}},DirectMessageModelState:{setShowDirectMessageModel:()=>{},setIdToViewMessage:()=>{}}});function h(e){let{children:t}=e;const{profileModelState:n,ProfileSidebarModel:h}=function(){const[e,t]=(0,r.useState)(!1),[n,o]=(0,r.useState)(""),c=(0,r.useCallback)((()=>e&&!n?(console.error("User Id is required to show user profile sidebar"),t(!1),(0,s.jsx)(s.Fragment,{})):(0,s.jsxs)(i.A,{active:e,setActive:t,className:"mt-2 max-w-2xl rounded-t-2xl bg-card md:mt-0 md:rounded-l-2xl md:rounded-tr-none",children:[(0,s.jsxs)("div",{className:"py-1-4 sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card px-4",children:[(0,s.jsx)("span",{className:"font-bold text-secondary-foreground/80",children:(0,s.jsx)(l.A,{children:"Profile"})}),(0,s.jsx)(a.J,{onClick:()=>t(!1),type:"primary"})]}),(0,s.jsx)("div",{className:"h-full flex-1 bg-card",children:(0,s.jsx)(u.gh,{userId:n,displayedInModel:!0})})]})),[n,e,t]);return(0,r.useMemo)((()=>({profileModelState:{setShowProfileModel:t,setIdToViewProfile:o},ProfileSidebarModel:c,setIdToViewProfile:o})),[t,c])}(),{messageListModelState:m,MessageListSidebarModel:f}=function(){const[e,t]=(0,r.useState)(!1),n=(0,r.useCallback)((()=>(0,s.jsxs)(i.A,{active:e,setActive:t,className:"mt-2 max-w-2xl rounded-t-2xl bg-card md:mt-0 md:rounded-l-2xl md:rounded-tr-none",children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card px-4 py-2",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 font-bold",children:[(0,s.jsx)(c.b1,{}),(0,s.jsx)(l.A,{children:"Direct Message"})]}),(0,s.jsx)(a.J,{onClick:()=>t(!1),type:"primary"})]}),(0,s.jsx)("div",{className:"h-full flex-1 bg-card",children:(0,s.jsx)(d.R,{})})]})),[e,t]);return(0,r.useMemo)((()=>({messageListModelState:{setShowMessageListModel:t},MessageListSidebarModel:n})),[t,n])}(),{DirectMessageSidebarModel:g,directMessageModelState:b}=function(){const[e,t]=(0,r.useState)(!1),[n,a]=(0,r.useState)(""),l=(0,r.useCallback)((()=>e&&!n?(console.error("User Id is required to view user dm"),t(!1),(0,s.jsx)(s.Fragment,{})):(0,s.jsx)(i.A,{active:e,setActive:t,className:"mt-2 max-w-2xl rounded-t-2xl bg-card md:mt-0 md:rounded-l-2xl md:rounded-tr-none",children:(0,s.jsx)("div",{className:"h-full flex-1 bg-card",children:(0,s.jsx)(o.A,{userId:n})})})),[n,e,t]);return(0,r.useMemo)((()=>({directMessageModelState:{setShowDirectMessageModel:t,setIdToViewMessage:a},DirectMessageSidebarModel:l,setIdToViewMessage:a})),[t,l])}();return(0,s.jsxs)(p.Provider,{value:{profileModelState:n,messageListModelState:m,DirectMessageModelState:b},children:[(0,s.jsx)(h,{}),(0,s.jsx)(f,{}),(0,s.jsx)(g,{}),t]})}},16478:(e,t,n)=>{"use strict";n.d(t,{G:()=>i,j:()=>o});var r=n(31305);const o=r.wA,i=r.d4},65186:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(20975),o=n(49852);function i(){return{analyticsService:(0,r.useContext)(o.G).analyticsService}}},81896:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(20975);function o(e){const[t,n]=(0,r.useState)(null!==e&&void 0!==e?e:{});return{cache:t,saveCache:function(e,r){n({...t,[e]:r})}}}},55049:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(20975),o=n(23541);function i(){return(0,r.useContext)(o.V)}},82086:(e,t)=>{!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table",Italic:"Italic","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Table toolbar":"Table toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on",Turquoise:"Turquoise",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=63)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));class r extends Error{constructor(e,t,n){super("".concat(e).concat(n?" ".concat(JSON.stringify(n)):"").concat(i(e))),this.name="CKEditorError",this.context=t,this.data=n}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new r(e.message,t);throw n.stack=e.stack,n}}function o(e,t){console.warn(...s(e,t))}function i(e){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-".concat(e)}function s(e,t){const n=i(e);return t?[e,t,n]:[e,n]}},function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),s=[];function a(e){for(var t=-1,n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n