@amityco/ulta-ui-kit 1.0.0-beta.25 → 1.0.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -102,7 +102,7 @@ as for instance in your render method then you may be running into this limitati
102
102
 
103
103
  `,17:`CSSStyleSheet could not be found on HTMLStyleElement.
104
104
  Has styled-components' style tag been unmounted or altered by another script?
105
- `,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function bO(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=e[0],r=[],n=1,i=e.length;n<i;n+=1)r.push(e[n]);return r.forEach(function(a){o=o.replace(/%[a-z]/,a);}),o}function sr(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(bO.apply(void 0,Pa([xO[e]],t,!1)).trim())}var IO=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t;}return e.prototype.indexOfGroup=function(t){for(var o=0,r=0;r<t;r++)o+=this.groupSizes[r];return o},e.prototype.insertRules=function(t,o){if(t>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;t>=i;)if((i<<=1)<0)throw sr(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0;}for(var s=this.indexOfGroup(t+1),l=(a=0,o.length);a<l;a++)this.tag.insertRule(s,o[a])&&(this.groupSizes[t]++,s++);},e.prototype.clearGroup=function(t){if(t<this.length){var o=this.groupSizes[t],r=this.indexOfGroup(t),n=r+o;this.groupSizes[t]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r);}},e.prototype.getGroup=function(t){var o="";if(t>=this.length||this.groupSizes[t]===0)return o;for(var r=this.groupSizes[t],n=this.indexOfGroup(t),i=n+r,a=n;a<i;a++)o+="".concat(this.tag.getRule(a)).concat(Ru);return o},e}(),wO=1<<30,Qd=new Map,Kd=new Map,Wd=1,jd=function(e){if(Qd.has(e))return Qd.get(e);for(;Kd.has(Wd);)Wd++;var t=Wd++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>wO))throw sr(16,"".concat(t));return Qd.set(e,t),Kd.set(t,e),t},MO=function(e,t){Wd=t+1,Qd.set(e,t),Kd.set(t,e);},PO="style[".concat(Di,"][").concat(qd,'="').concat(W1,'"]'),_O=new RegExp("^".concat(Di,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),TO=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i<a;i++)(r=n[i])&&e.registerName(t,r);},kO=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(Ru),n=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var l=s.match(_O);if(l){var d=0|parseInt(l[1],10),p=l[2];d!==0&&(MO(p,d),TO(e,p,l[3]),e.getTag().insertRules(d,n)),n.length=0;}else n.push(s);}}};function qu(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var xy=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(s){var l=Array.from(s.querySelectorAll("style[".concat(Di,"]")));return l[l.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(Di,dy),r.setAttribute(qd,W1);var a=qu();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},SO=function(){function e(t){this.element=xy(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var r=document.styleSheets,n=0,i=r.length;n<i;n++){var a=r[n];if(a.ownerNode===o)return a}throw sr(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(t,o){try{return this.sheet.insertRule(o,t),this.length++,!0}catch(r){return !1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--;},e.prototype.getRule=function(t){var o=this.sheet.cssRules[t];return o&&o.cssText?o.cssText:""},e}(),NO=function(){function e(t){this.element=xy(t),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(t,o){if(t<=this.length&&t>=0){var r=document.createTextNode(o);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),EO=function(){function e(t){this.rules=[],this.length=0;}return e.prototype.insertRule=function(t,o){return t<=this.length&&(this.rules.splice(t,0,o),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),iy=Xd,BO={isServer:!Xd,useCSSOMInjection:!aO},h2=function(){function e(t,o,r){t===void 0&&(t=q1),o===void 0&&(o={});var n=this;this.options=ro(ro({},BO),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Xd&&iy&&(iy=!1,function(i){for(var a=document.querySelectorAll(PO),s=0,l=a.length;s<l;s++){var d=a[s];d&&d.getAttribute(Di)!==dy&&(kO(i,d),d.parentNode&&d.parentNode.removeChild(d));}}(this)),t4(this,function(){return function(i){for(var a=i.getTag(),s=a.length,l="",d=function(u){var g=function(h){return Kd.get(h)}(u);if(g===void 0)return "continue";var f=i.names.get(g),y=a.getGroup(u);if(f===void 0||y.length===0)return "continue";var v="".concat(Di,".g").concat(u,'[id="').concat(g,'"]'),C="";f!==void 0&&f.forEach(function(h){h.length>0&&(C+="".concat(h,","));}),l+="".concat(y).concat(v,'{content:"').concat(C,'"}').concat(Ru);},p=0;p<s;p++)d(p);return l}(n)});}return e.registerId=function(t){return jd(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(ro(ro({},this.options),t),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(o){var r=o.useCSSOMInjection,n=o.target;return o.isServer?new EO(n):r?new SO(n):new NO(n)}(this.options),new IO(t)));var t;},e.prototype.hasNameForId=function(t,o){return this.names.has(t)&&this.names.get(t).has(o)},e.prototype.registerName=function(t,o){if(jd(t),this.names.has(t))this.names.get(t).add(o);else {var r=new Set;r.add(o),this.names.set(t,r);}},e.prototype.insertRules=function(t,o,r){this.registerName(t,o),this.getTag().insertRules(jd(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(jd(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),LO=/&/g,AO=/^\s*\/\/.*$/gm;function by(e,t){return e.map(function(o){return o.type==="rule"&&(o.value="".concat(t," ").concat(o.value),o.value=o.value.replaceAll(",",",".concat(t," ")),o.props=o.props.map(function(r){return "".concat(t," ").concat(r)})),Array.isArray(o.children)&&o.type!=="@keyframes"&&(o.children=by(o.children,t)),o})}function Iy(e){var t,o,r,n=q1,i=n.options,a=i===void 0?q1:i,s=n.plugins,l=s===void 0?Yd:s,d=function(g,f,y){return y.startsWith(o)&&y.endsWith(o)&&y.replaceAll(o,"").length>0?".".concat(t):g},p=l.slice();p.push(function(g){g.type===lr.RULESET&&g.value.includes("&")&&(g.props[0]=g.props[0].replace(LO,o).replace(r,d));}),a.prefix&&p.push(lr.prefixer),p.push(lr.stringify);var u=function(g,f,y,v){f===void 0&&(f=""),y===void 0&&(y=""),v===void 0&&(v="&"),t=v,o=f,r=new RegExp("\\".concat(o,"\\b"),"g");var C=g.replace(AO,""),h=lr.compile(y||f?"".concat(y," ").concat(f," { ").concat(C," }"):C);a.namespace&&(h=by(h,a.namespace));var x=[];return lr.serialize(h,lr.middleware(p.concat(lr.rulesheet(function(b){return x.push(b)})))),x};return u.hash=l.length?l.reduce(function(g,f){return f.name||sr(15),Es(g,f.name)},py).toString():"",u}var DO=new h2,Ku=Iy(),o4=R.createContext({shouldForwardProp:void 0,styleSheet:DO,stylis:Ku});o4.Consumer;R.createContext(void 0);function Ju(){return useContext(o4)}var Xu=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=Ku);var a=r.name+i.hash;n.hasNameForId(r.id,a)||n.insertRules(r.id,a,i(r.rules,a,"@keyframes"));},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=o,t4(this,function(){throw sr(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=Ku),this.name+t.hash},e}(),OO=function(e){return e>="A"&&e<="Z"};function ay(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;OO(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var wy=function(e){return e==null||e===!1||e===""},My=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!wy(i)&&(Array.isArray(i)&&i.isCss||Ls(i)?r.push("".concat(ay(n),":"),i,";"):K1(i)?r.push.apply(r,Pa(Pa(["".concat(n," {")],My(i),!1),["}"],!1)):r.push("".concat(ay(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in X9||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function _a(e,t,o,r){if(wy(e))return [];if(e4(e))return [".".concat(e.styledComponentId)];if(Ls(e)){if(!Ls(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return [e];var n=e(t);return process.env.NODE_ENV==="production"||typeof n!="object"||Array.isArray(n)||n instanceof Xu||K1(n)||n===null||console.error("".concat(fy(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),_a(n,t,o,r)}var i;return e instanceof Xu?o?(e.inject(o,r),[e.getName(r)]):[e]:K1(e)?My(e):Array.isArray(e)?Array.prototype.concat.apply(Yd,e.map(function(a){return _a(a,t,o,r)})):[e.toString()]}function Py(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(Ls(o)&&!e4(o))return !1}return !0}var zO=uy(W1),UO=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Py(t),this.componentId=o,this.baseHash=Es(zO,o),this.baseStyle=r,h2.registerId(o);}return e.prototype.generateAndInjectStyles=function(t,o,r){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,o,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&o.hasNameForId(this.componentId,this.staticRulesId))n=Bs(n,this.staticRulesId);else {var i=y2(_a(this.rules,t,o,r)),a=Qu(Es(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var s=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,s);}n=Bs(n,a),this.staticRulesId=a;}else {for(var l=Es(this.baseHash,r.hash),d="",p=0;p<this.rules.length;p++){var u=this.rules[p];if(typeof u=="string")d+=u,process.env.NODE_ENV!=="production"&&(l=Es(l,u));else if(u){var g=y2(_a(u,t,o,r));l=Es(l,g+p),d+=g;}}if(d){var f=Qu(l>>>0);o.hasNameForId(this.componentId,f)||o.insertRules(this.componentId,f,r(d,".".concat(f),void 0,this.componentId)),n=Bs(n,f);}}return n},e}(),Jd=R.createContext(void 0);Jd.Consumer;function _y(e){var t=R.useContext(Jd),o=useMemo(function(){return function(r,n){if(!r)throw sr(14);if(Ls(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw sr(7);return i}if(Array.isArray(r)||typeof r!="object")throw sr(8);return n?ro(ro({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?R.createElement(Jd.Provider,{value:o},e.children):null}var Gu={},sy=new Set;function $O(e,t,o){var r=e4(e),n=e,i=!ju(e),a=t.attrs,s=a===void 0?Yd:a,l=t.componentId,d=l===void 0?function(M,I){var w=typeof M!="string"?"sc":ey(M);Gu[w]=(Gu[w]||0)+1;var N="".concat(w,"-").concat(gy(W1+w+Gu[w]));return I?"".concat(I,"-").concat(N):N}(t.displayName,t.parentComponentId):l,p=t.displayName,u=p===void 0?function(M){return ju(M)?"styled.".concat(M):"Styled(".concat(fy(M),")")}(e):p,g=t.displayName&&t.componentId?"".concat(ey(t.displayName),"-").concat(t.componentId):t.componentId||d,f=r&&n.attrs?n.attrs.concat(s).filter(Boolean):s,y=t.shouldForwardProp;if(r&&n.shouldForwardProp){var v=n.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;y=function(M,I){return v(M,I)&&C(M,I)};}else y=v;}var h=new UO(o,g,r?n.componentStyle:void 0);function x(M,I){return function(w,N,T){var L=w.attrs,D=w.componentStyle,U=w.defaultProps,Z=w.foldedComponentIds,B=w.styledComponentId,$=w.target,G=R.useContext(Jd),q=Ju(),z=w.shouldForwardProp||q.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue(B);var H=lO(N,G,U)||q1,F=function(oe,be,pe){for(var We,vt=ro(ro({},be),{className:void 0,theme:pe}),eo=0;eo<oe.length;eo+=1){var Vt=Ls(We=oe[eo])?We(vt):We;for(var De in Vt)vt[De]=De==="className"?Bs(vt[De],Vt[De]):De==="style"?ro(ro({},vt[De]),Vt[De]):Vt[De];}return be.className&&(vt.className=Bs(vt.className,be.className)),vt}(L,N,H),j=F.as||$,Q={};for(var k in F)F[k]===void 0||k[0]==="$"||k==="as"||k==="theme"&&F.theme===H||(k==="forwardedAs"?Q.as=F.forwardedAs:z&&!z(k,j)||(Q[k]=F[k],z||process.env.NODE_ENV!=="development"||q9(k)||sy.has(k)||!Zu.has(j)||(sy.add(k),console.warn('styled-components: it looks like an unknown prop "'.concat(k,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var V=function(oe,be){var pe=Ju(),We=oe.generateAndInjectStyles(be,pe.styleSheet,pe.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(We),We}(D,F);process.env.NODE_ENV!=="production"&&w.warnTooManyClasses&&w.warnTooManyClasses(V);var ae=Bs(Z,B);return V&&(ae+=" "+V),F.className&&(ae+=" "+F.className),Q[ju(j)&&!Zu.has(j)?"class":"className"]=ae,Q.ref=T,createElement(j,Q)}(b,M,I)}x.displayName=u;var b=R.forwardRef(x);return b.attrs=f,b.componentStyle=h,b.displayName=u,b.shouldForwardProp=y,b.foldedComponentIds=r?Bs(n.foldedComponentIds,n.styledComponentId):"",b.styledComponentId=g,b.target=r?n.target:e,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(M){this._foldedDefaultProps=r?function(I){for(var w=[],N=1;N<arguments.length;N++)w[N-1]=arguments[N];for(var T=0,L=w;T<L.length;T++)Wu(I,L[T],!0);return I}({},n.defaultProps,M):M;}}),process.env.NODE_ENV!=="production"&&(sO(u,g),b.warnTooManyClasses=function(M,I){var w={},N=!1;return function(T){if(!N&&(w[T]=!0,Object.keys(w).length>=200)){var L=I?' with the id of "'.concat(I,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(M).concat(L,`.
105
+ `,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function bO(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=e[0],r=[],n=1,i=e.length;n<i;n+=1)r.push(e[n]);return r.forEach(function(a){o=o.replace(/%[a-z]/,a);}),o}function sr(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(bO.apply(void 0,Pa([xO[e]],t,!1)).trim())}var IO=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t;}return e.prototype.indexOfGroup=function(t){for(var o=0,r=0;r<t;r++)o+=this.groupSizes[r];return o},e.prototype.insertRules=function(t,o){if(t>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;t>=i;)if((i<<=1)<0)throw sr(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0;}for(var s=this.indexOfGroup(t+1),l=(a=0,o.length);a<l;a++)this.tag.insertRule(s,o[a])&&(this.groupSizes[t]++,s++);},e.prototype.clearGroup=function(t){if(t<this.length){var o=this.groupSizes[t],r=this.indexOfGroup(t),n=r+o;this.groupSizes[t]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r);}},e.prototype.getGroup=function(t){var o="";if(t>=this.length||this.groupSizes[t]===0)return o;for(var r=this.groupSizes[t],n=this.indexOfGroup(t),i=n+r,a=n;a<i;a++)o+="".concat(this.tag.getRule(a)).concat(Ru);return o},e}(),wO=1<<30,Qd=new Map,Kd=new Map,Wd=1,jd=function(e){if(Qd.has(e))return Qd.get(e);for(;Kd.has(Wd);)Wd++;var t=Wd++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>wO))throw sr(16,"".concat(t));return Qd.set(e,t),Kd.set(t,e),t},MO=function(e,t){Wd=t+1,Qd.set(e,t),Kd.set(t,e);},PO="style[".concat(Di,"][").concat(qd,'="').concat(W1,'"]'),_O=new RegExp("^".concat(Di,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),TO=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i<a;i++)(r=n[i])&&e.registerName(t,r);},kO=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(Ru),n=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var l=s.match(_O);if(l){var d=0|parseInt(l[1],10),p=l[2];d!==0&&(MO(p,d),TO(e,p,l[3]),e.getTag().insertRules(d,n)),n.length=0;}else n.push(s);}}};function qu(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var xy=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(s){var l=Array.from(s.querySelectorAll("style[".concat(Di,"]")));return l[l.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(Di,dy),r.setAttribute(qd,W1);var a=qu();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},SO=function(){function e(t){this.element=xy(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var r=document.styleSheets,n=0,i=r.length;n<i;n++){var a=r[n];if(a.ownerNode===o)return a}throw sr(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(t,o){try{return this.sheet.insertRule(o,t),this.length++,!0}catch(r){return !1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--;},e.prototype.getRule=function(t){var o=this.sheet.cssRules[t];return o&&o.cssText?o.cssText:""},e}(),NO=function(){function e(t){this.element=xy(t),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(t,o){if(t<=this.length&&t>=0){var r=document.createTextNode(o);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),EO=function(){function e(t){this.rules=[],this.length=0;}return e.prototype.insertRule=function(t,o){return t<=this.length&&(this.rules.splice(t,0,o),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),iy=Xd,BO={isServer:!Xd,useCSSOMInjection:!aO},h2=function(){function e(t,o,r){t===void 0&&(t=q1),o===void 0&&(o={});var n=this;this.options=ro(ro({},BO),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Xd&&iy&&(iy=!1,function(i){for(var a=document.querySelectorAll(PO),s=0,l=a.length;s<l;s++){var d=a[s];d&&d.getAttribute(Di)!==dy&&(kO(i,d),d.parentNode&&d.parentNode.removeChild(d));}}(this)),t4(this,function(){return function(i){for(var a=i.getTag(),s=a.length,l="",d=function(u){var g=function(h){return Kd.get(h)}(u);if(g===void 0)return "continue";var f=i.names.get(g),y=a.getGroup(u);if(f===void 0||y.length===0)return "continue";var v="".concat(Di,".g").concat(u,'[id="').concat(g,'"]'),C="";f!==void 0&&f.forEach(function(h){h.length>0&&(C+="".concat(h,","));}),l+="".concat(y).concat(v,'{content:"').concat(C,'"}').concat(Ru);},p=0;p<s;p++)d(p);return l}(n)});}return e.registerId=function(t){return jd(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(ro(ro({},this.options),t),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(o){var r=o.useCSSOMInjection,n=o.target;return o.isServer?new EO(n):r?new SO(n):new NO(n)}(this.options),new IO(t)));var t;},e.prototype.hasNameForId=function(t,o){return this.names.has(t)&&this.names.get(t).has(o)},e.prototype.registerName=function(t,o){if(jd(t),this.names.has(t))this.names.get(t).add(o);else {var r=new Set;r.add(o),this.names.set(t,r);}},e.prototype.insertRules=function(t,o,r){this.registerName(t,o),this.getTag().insertRules(jd(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(jd(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),LO=/&/g,AO=/^\s*\/\/.*$/gm;function by(e,t){return e.map(function(o){return o.type==="rule"&&(o.value="".concat(t," ").concat(o.value),o.value=o.value.replaceAll(",",",".concat(t," ")),o.props=o.props.map(function(r){return "".concat(t," ").concat(r)})),Array.isArray(o.children)&&o.type!=="@keyframes"&&(o.children=by(o.children,t)),o})}function Iy(e){var t,o,r,n=q1,i=n.options,a=i===void 0?q1:i,s=n.plugins,l=s===void 0?Yd:s,d=function(g,f,y){return y.startsWith(o)&&y.endsWith(o)&&y.replaceAll(o,"").length>0?".".concat(t):g},p=l.slice();p.push(function(g){g.type===lr.RULESET&&g.value.includes("&")&&(g.props[0]=g.props[0].replace(LO,o).replace(r,d));}),a.prefix&&p.push(lr.prefixer),p.push(lr.stringify);var u=function(g,f,y,v){f===void 0&&(f=""),y===void 0&&(y=""),v===void 0&&(v="&"),t=v,o=f,r=new RegExp("\\".concat(o,"\\b"),"g");var C=g.replace(AO,""),h=lr.compile(y||f?"".concat(y," ").concat(f," { ").concat(C," }"):C);a.namespace&&(h=by(h,a.namespace));var x=[];return lr.serialize(h,lr.middleware(p.concat(lr.rulesheet(function(b){return x.push(b)})))),x};return u.hash=l.length?l.reduce(function(g,f){return f.name||sr(15),Es(g,f.name)},py).toString():"",u}var DO=new h2,Ku=Iy(),o4=R.createContext({shouldForwardProp:void 0,styleSheet:DO,stylis:Ku});o4.Consumer;R.createContext(void 0);function Ju(){return useContext(o4)}var Xu=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=Ku);var a=r.name+i.hash;n.hasNameForId(r.id,a)||n.insertRules(r.id,a,i(r.rules,a,"@keyframes"));},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=o,t4(this,function(){throw sr(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=Ku),this.name+t.hash},e}(),OO=function(e){return e>="A"&&e<="Z"};function ay(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;OO(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var wy=function(e){return e==null||e===!1||e===""},My=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!wy(i)&&(Array.isArray(i)&&i.isCss||Ls(i)?r.push("".concat(ay(n),":"),i,";"):K1(i)?r.push.apply(r,Pa(Pa(["".concat(n," {")],My(i),!1),["}"],!1)):r.push("".concat(ay(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in X9||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function _a(e,t,o,r){if(wy(e))return [];if(e4(e))return [".".concat(e.styledComponentId)];if(Ls(e)){if(!Ls(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return [e];var n=e(t);return process.env.NODE_ENV==="production"||typeof n!="object"||Array.isArray(n)||n instanceof Xu||K1(n)||n===null||console.error("".concat(fy(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),_a(n,t,o,r)}var i;return e instanceof Xu?o?(e.inject(o,r),[e.getName(r)]):[e]:K1(e)?My(e):Array.isArray(e)?Array.prototype.concat.apply(Yd,e.map(function(a){return _a(a,t,o,r)})):[e.toString()]}function Py(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(Ls(o)&&!e4(o))return !1}return !0}var zO=uy(W1),UO=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Py(t),this.componentId=o,this.baseHash=Es(zO,o),this.baseStyle=r,h2.registerId(o);}return e.prototype.generateAndInjectStyles=function(t,o,r){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,o,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&o.hasNameForId(this.componentId,this.staticRulesId))n=Bs(n,this.staticRulesId);else {var i=y2(_a(this.rules,t,o,r)),a=Qu(Es(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var s=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,s);}n=Bs(n,a),this.staticRulesId=a;}else {for(var l=Es(this.baseHash,r.hash),d="",p=0;p<this.rules.length;p++){var u=this.rules[p];if(typeof u=="string")d+=u,process.env.NODE_ENV!=="production"&&(l=Es(l,u));else if(u){var g=y2(_a(u,t,o,r));l=Es(l,g+p),d+=g;}}if(d){var f=Qu(l>>>0);o.hasNameForId(this.componentId,f)||o.insertRules(this.componentId,f,r(d,".".concat(f),void 0,this.componentId)),n=Bs(n,f);}}return n},e}(),Jd=R.createContext(void 0);Jd.Consumer;function _y(e){var t=R.useContext(Jd),o=useMemo(function(){return function(r,n){if(!r)throw sr(14);if(Ls(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw sr(7);return i}if(Array.isArray(r)||typeof r!="object")throw sr(8);return n?ro(ro({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?R.createElement(Jd.Provider,{value:o},e.children):null}var Gu={},sy=new Set;function $O(e,t,o){var r=e4(e),n=e,i=!ju(e),a=t.attrs,s=a===void 0?Yd:a,l=t.componentId,d=l===void 0?function(M,I){var w=typeof M!="string"?"sc":ey(M);Gu[w]=(Gu[w]||0)+1;var N="".concat(w,"-").concat(gy(W1+w+Gu[w]));return I?"".concat(I,"-").concat(N):N}(t.displayName,t.parentComponentId):l,p=t.displayName,u=p===void 0?function(M){return ju(M)?"styled.".concat(M):"Styled(".concat(fy(M),")")}(e):p,g=t.displayName&&t.componentId?"".concat(ey(t.displayName),"-").concat(t.componentId):t.componentId||d,f=r&&n.attrs?n.attrs.concat(s).filter(Boolean):s,y=t.shouldForwardProp;if(r&&n.shouldForwardProp){var v=n.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;y=function(M,I){return v(M,I)&&C(M,I)};}else y=v;}var h=new UO(o,g,r?n.componentStyle:void 0);function x(M,I){return function(w,N,T){var L=w.attrs,D=w.componentStyle,U=w.defaultProps,Z=w.foldedComponentIds,B=w.styledComponentId,$=w.target,G=R.useContext(Jd),q=Ju(),z=w.shouldForwardProp||q.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue(B);var H=lO(N,G,U)||q1,F=function(oe,be,pe){for(var We,vt=ro(ro({},be),{className:void 0,theme:pe}),Vt=0;Vt<oe.length;Vt+=1){var jt=Ls(We=oe[Vt])?We(vt):We;for(var De in jt)vt[De]=De==="className"?Bs(vt[De],jt[De]):De==="style"?ro(ro({},vt[De]),jt[De]):jt[De];}return be.className&&(vt.className=Bs(vt.className,be.className)),vt}(L,N,H),j=F.as||$,Q={};for(var k in F)F[k]===void 0||k[0]==="$"||k==="as"||k==="theme"&&F.theme===H||(k==="forwardedAs"?Q.as=F.forwardedAs:z&&!z(k,j)||(Q[k]=F[k],z||process.env.NODE_ENV!=="development"||q9(k)||sy.has(k)||!Zu.has(j)||(sy.add(k),console.warn('styled-components: it looks like an unknown prop "'.concat(k,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var V=function(oe,be){var pe=Ju(),We=oe.generateAndInjectStyles(be,pe.styleSheet,pe.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(We),We}(D,F);process.env.NODE_ENV!=="production"&&w.warnTooManyClasses&&w.warnTooManyClasses(V);var ae=Bs(Z,B);return V&&(ae+=" "+V),F.className&&(ae+=" "+F.className),Q[ju(j)&&!Zu.has(j)?"class":"className"]=ae,Q.ref=T,createElement(j,Q)}(b,M,I)}x.displayName=u;var b=R.forwardRef(x);return b.attrs=f,b.componentStyle=h,b.displayName=u,b.shouldForwardProp=y,b.foldedComponentIds=r?Bs(n.foldedComponentIds,n.styledComponentId):"",b.styledComponentId=g,b.target=r?n.target:e,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(M){this._foldedDefaultProps=r?function(I){for(var w=[],N=1;N<arguments.length;N++)w[N-1]=arguments[N];for(var T=0,L=w;T<L.length;T++)Wu(I,L[T],!0);return I}({},n.defaultProps,M):M;}}),process.env.NODE_ENV!=="production"&&(sO(u,g),b.warnTooManyClasses=function(M,I){var w={},N=!1;return function(T){if(!N&&(w[T]=!0,Object.keys(w).length>=200)){var L=I?' with the id of "'.concat(I,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(M).concat(L,`.
106
106
  `)+`Consider using the attrs method, together with a style object for frequently changed styles.
107
107
  Example:
108
108
  const Component = styled.div.attrs(props => ({
@@ -177,7 +177,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
177
177
  52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4
178
178
  256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160
179
179
  303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34
180
- 0-22.58L207.6 256z`})),jt=Hz;var Fz=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 576 512",fill:"currentColor"},e),R.createElement("path",{d:`M561.938 190.06L385.94 14.107C355.79-16.043 304 5.327 304 48.047v80.703C166.04 132.9 0
180
+ 0-22.58L207.6 256z`})),Gt=Hz;var Fz=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 576 512",fill:"currentColor"},e),R.createElement("path",{d:`M561.938 190.06L385.94 14.107C355.79-16.043 304 5.327 304 48.047v80.703C166.04 132.9 0
181
181
  159.68 0 330.05c0 73.75 38.02 134.719 97.63 173.949 37.12 24.43 85.84-10.9
182
182
  72.19-54.46C145.47 371.859 157.41 330.2 304 321.66v78.28c0 42.64 51.73 64.15 81.94
183
183
  33.94l175.997-175.94c18.751-18.74 18.751-49.14.001-67.88zM352 400V272.09c-164.521
@@ -225,7 +225,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
225
225
  42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42zm-81.37-211.401l6.8 136c.319 6.387
226
226
  5.591 11.401 11.985 11.401h41.17c6.394 0 11.666-5.014
227
227
  11.985-11.401l6.8-136c.343-6.854-5.122-12.599-11.985-12.599h-54.77c-6.863 0-12.328
228
- 5.745-11.985 12.599z`})),Gt=Kz;var Jz=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 496 512",fill:"currentColor"},e),R.createElement("path",{d:`M248 8C111.04 8 0 119.03 0 256s111.04 248 248 248 248-111.03 248-248S384.96 8 248 8zm0
228
+ 5.745-11.985 12.599z`})),Zt=Kz;var Jz=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 496 512",fill:"currentColor"},e),R.createElement("path",{d:`M248 8C111.04 8 0 119.03 0 256s111.04 248 248 248 248-111.03 248-248S384.96 8 248 8zm0
229
229
  448c-110.28 0-200-89.72-200-200S137.72 56 248 56c10.92 0 21.55 1.12 32 2.81v21.7c0 8.56-6.94
230
230
  15.5-15.5 15.5h-24.21c-5.18 0-10.02 2.59-12.89 6.9l-8.08 12.11c-2.14 3.21-5.4 5.5-9.14
231
231
  6.44l-14.45 3.61a15.492 15.492 0 0 0-11.74 15.04v4.4c0 8.56 6.94 15.5 15.5 15.5h90.09c4.11
@@ -263,15 +263,15 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
263
263
  128c-22.056 0-40-17.944-40-40s17.944-40 40-40 40 17.944 40 40-17.944 40-40 40z`})),V4=eU;var tU=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 320 512",fill:"currentColor"},e),R.createElement("path",{d:`M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9
264
264
  0L24 329c-15.1-15.1-4.4-41 17-41z`})),j4=tU;var aU=m(P2).attrs({width:18,height:18})`
265
265
  margin-right: 8px;
266
- `,sU=m(Gt).attrs({width:18,height:18})`
266
+ `,sU=m(Zt).attrs({width:18,height:18})`
267
267
  margin-right: 8px;
268
- `,lU=m(jt).attrs({width:18,height:18})`
268
+ `,lU=m(Gt).attrs({width:18,height:18})`
269
269
  margin-right: 8px;
270
270
  `,G4=createContext({notifications:[],notificationFunction:{success:()=>{},info:()=>{},error:()=>{},show:()=>{}}}),mU=3e3,Dh=({children:e})=>{let[t,o]=useState([]),r=i=>o&&o(a=>a.filter(s=>s.id!==i)),n=i=>{let a=Date.now();o(s=>[...s,c({id:a},i)]),setTimeout(()=>{r(a);},(i==null?void 0:i.duration)||mU);};return R.createElement(G4.Provider,{value:{notifications:t,notificationFunction:{success:i=>n(E(c({},i),{icon:R.createElement(aU,null)})),info:i=>n(E(c({},i),{icon:R.createElement(sU,null)})),error:i=>n(E(c({},i),{icon:R.createElement(lU,null)})),show:i=>n(i)}}},e)},Hh=()=>{let{notifications:e}=useContext(G4);return e},Ce=()=>{let{notificationFunction:e}=useContext(G4);return e};var Sa=({children:e})=>createPortal(e,document.body);m(P2).attrs({width:18,height:18})`
271
271
  margin-right: 8px;
272
- `;m(Gt).attrs({width:18,height:18})`
272
+ `;m(Zt).attrs({width:18,height:18})`
273
273
  margin-right: 8px;
274
- `;m(jt).attrs({width:18,height:18})`
274
+ `;m(Gt).attrs({width:18,height:18})`
275
275
  margin-right: 8px;
276
276
  `;var Fh=m.div`
277
277
  position: fixed;
@@ -1310,7 +1310,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1310
1310
  &:hover {
1311
1311
  color: ${({theme:e})=>e.palette.neutral.shade4};
1312
1312
  }
1313
- `,Y6=e=>R.createElement(X6,c({rel:"left"},e),R.createElement(zr,{height:"24px"})),R6=e=>R.createElement(X6,c({rel:"right"},e),R.createElement(Hi,{height:"24px"})),CW=e=>R.createElement(X6,c({rel:"close"},e),R.createElement(jt,{height:"20px"})),e7=m(CW)`
1313
+ `,Y6=e=>R.createElement(X6,c({rel:"left"},e),R.createElement(zr,{height:"24px"})),R6=e=>R.createElement(X6,c({rel:"right"},e),R.createElement(Hi,{height:"24px"})),CW=e=>R.createElement(X6,c({rel:"close"},e),R.createElement(Gt,{height:"20px"})),e7=m(CW)`
1314
1314
  background: rgba(0, 0, 0, 0.3);
1315
1315
  height: 43px;
1316
1316
  width: 43px;
@@ -1349,11 +1349,11 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1349
1349
  display: flex;
1350
1350
  align-items: center;
1351
1351
  justify-content: center;
1352
- `,ep=()=>R.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return R.createElement(MW,null,R.createElement(we,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),PW=m(jt).attrs({width:24,height:24})``,vb=m(Y).attrs({variant:"secondary",children:R.createElement(PW,null)})`
1352
+ `,ep=()=>R.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return R.createElement(MW,null,R.createElement(we,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),PW=m(Gt).attrs({width:24,height:24})``,vb=m(Y).attrs({variant:"secondary",children:R.createElement(PW,null)})`
1353
1353
  position: absolute;
1354
1354
  top: 0.5em;
1355
1355
  right: 0.5em;
1356
- `,_W=m(Gt).attrs({width:24,height:24})`
1356
+ `,_W=m(Zt).attrs({width:24,height:24})`
1357
1357
  z-index: 2;
1358
1358
  opacity: 0.7;
1359
1359
  `,xb=m(Y).attrs({variant:"secondary",children:R.createElement(_W,null)})`
@@ -1408,11 +1408,11 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1408
1408
  display: flex;
1409
1409
  align-items: center;
1410
1410
  justify-content: center;
1411
- `,Sb=()=>R.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return R.createElement(HW,null,R.createElement(we,{height:t,width:t,style:{display:"block"}}))}),FW=m(jt).attrs({width:24,height:24})``,Nb=m(Y).attrs({variant:"secondary",children:R.createElement(FW,null)})`
1411
+ `,Sb=()=>R.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return R.createElement(HW,null,R.createElement(we,{height:t,width:t,style:{display:"block"}}))}),FW=m(Gt).attrs({width:24,height:24})``,Nb=m(Y).attrs({variant:"secondary",children:R.createElement(FW,null)})`
1412
1412
  position: absolute;
1413
1413
  top: 0.5em;
1414
1414
  right: 0.5em;
1415
- `,OW=m(Gt).attrs({width:24,height:24})`
1415
+ `,OW=m(Zt).attrs({width:24,height:24})`
1416
1416
  z-index: 2;
1417
1417
  opacity: 0.7;
1418
1418
  `,Eb=m(Y).attrs({variant:"secondary",icon:OW})`
@@ -1433,7 +1433,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1433
1433
  position: absolute;
1434
1434
  top: 1rem;
1435
1435
  left: 1rem;
1436
- `;var $W=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:s,autoPlay:l,isLive:d})=>{let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),n&&n();},[n]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&$2.isSupported()){let y=new $2;return y.loadSource(e),y.attachMedia(g),y.on($2.Events.ERROR,(v,C)=>{if(C.fatal)switch(C.type){case $2.ErrorTypes.NETWORK_ERROR:y.startLoad();break;case $2.ErrorTypes.MEDIA_ERROR:y.recoverMediaError();break;}}),()=>y.destroy()}},[g,d,e]),R.createElement($i,{border:!r},R.createElement(_b,null,e?R.createElement(kb,{key:e,ref:y=>f(y),className:i?"darken":void 0,mediaFit:o,mimeType:s,src:e,autoPlay:l}):R.createElement(Sb,null),R.createElement(Bb,null,d&&R.createElement(Lb,null),!!i&&R.createElement(Eb,{onClick:u}),!!n&&R.createElement(Nb,{onClick:p}))),!Number.isNaN(t)&&R.createElement(Pl,{progress:(t||0)*100}))},_l=$W;var jW=o=>{var r=o,{file:e}=r,t=P(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return R.createElement(_l,c({url:n},t))},Db=jW;var ZW=o=>{var r=o,{fileId:e}=r,t=P(r,["fileId"]);let n=Dt(e);if(n==null)return null;let i=(()=>{if(n.status===_0.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return R.createElement(_l,c({url:i,mimeType:ev},t))},Hb=ZW;function ji(e){return "fileId"in e?R.createElement(Hb,c({},e)):"file"in e?R.createElement(Db,c({},e)):null}var Ub=m(Y).attrs({variant:"secondary",children:R.createElement(jt,null)})`
1436
+ `;var $W=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:s,autoPlay:l,isLive:d})=>{let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),n&&n();},[n]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&$2.isSupported()){let y=new $2;return y.loadSource(e),y.attachMedia(g),y.on($2.Events.ERROR,(v,C)=>{if(C.fatal)switch(C.type){case $2.ErrorTypes.NETWORK_ERROR:y.startLoad();break;case $2.ErrorTypes.MEDIA_ERROR:y.recoverMediaError();break;}}),()=>y.destroy()}},[g,d,e]),R.createElement($i,{border:!r},R.createElement(_b,null,e?R.createElement(kb,{key:e,ref:y=>f(y),className:i?"darken":void 0,mediaFit:o,mimeType:s,src:e,autoPlay:l}):R.createElement(Sb,null),R.createElement(Bb,null,d&&R.createElement(Lb,null),!!i&&R.createElement(Eb,{onClick:u}),!!n&&R.createElement(Nb,{onClick:p}))),!Number.isNaN(t)&&R.createElement(Pl,{progress:(t||0)*100}))},_l=$W;var jW=o=>{var r=o,{file:e}=r,t=P(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return R.createElement(_l,c({url:n},t))},Db=jW;var ZW=o=>{var r=o,{fileId:e}=r,t=P(r,["fileId"]);let n=Dt(e);if(n==null)return null;let i=(()=>{if(n.status===_0.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return R.createElement(_l,c({url:i,mimeType:ev},t))},Hb=ZW;function ji(e){return "fileId"in e?R.createElement(Hb,c({},e)):"file"in e?R.createElement(Db,c({},e)):null}var Ub=m(Y).attrs({variant:"secondary",children:R.createElement(Gt,null)})`
1437
1437
  position: absolute;
1438
1438
  top: 0.5em;
1439
1439
  right: 0.5em;
@@ -1492,7 +1492,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1492
1492
  transform: translateY(-50%);
1493
1493
  color: #fff;
1494
1494
  }
1495
- `,$b=({children:e,className:t,onRemove:o})=>R.createElement($i,{className:t},R.createElement($a,null,e),R.createElement(U2,null,!!o&&R.createElement(Ub,{onClick:r=>{r.preventDefault(),r.stopPropagation(),o();}})));var qs=({item:e,showPlayIcon:t,showVideoDuration:o})=>R.createElement(rp,{fileId:e==null?void 0:e.data.thumbnailFileId,showPlayIcon:t,videoFileId:o&&(e==null?void 0:e.data.videoFileId.original)}),r7=({item:e})=>{let t=(e==null?void 0:e.data.videoFileId.high)||(e==null?void 0:e.data.videoFileId.medium)||(e==null?void 0:e.data.videoFileId.low)||(e==null?void 0:e.data.videoFileId.original);return t?R.createElement(ji,{fileId:t,mediaFit:"contain",noBorder:!0}):R.createElement($i,null,R.createElement(j2,null,R.createElement($a,null,R.createElement(FormattedMessage,{id:"video.notReady"}))))};var oq=e=>{let[t,o]=useState(null);return useEffect(()=>{function r(){return _(this,null,function*(){if(e==null)return;let n=yield StreamRepository.getStream(e);o(n.data);})}r();},[e]),t},G2=oq;var jb=m(Gt)`
1495
+ `,$b=({children:e,className:t,onRemove:o})=>R.createElement($i,{className:t},R.createElement($a,null,e),R.createElement(U2,null,!!o&&R.createElement(Ub,{onClick:r=>{r.preventDefault(),r.stopPropagation(),o();}})));var qs=({item:e,showPlayIcon:t,showVideoDuration:o})=>R.createElement(rp,{fileId:e==null?void 0:e.data.thumbnailFileId,showPlayIcon:t,videoFileId:o&&(e==null?void 0:e.data.videoFileId.original)}),r7=({item:e})=>{let t=(e==null?void 0:e.data.videoFileId.high)||(e==null?void 0:e.data.videoFileId.medium)||(e==null?void 0:e.data.videoFileId.low)||(e==null?void 0:e.data.videoFileId.original);return t?R.createElement(ji,{fileId:t,mediaFit:"contain",noBorder:!0}):R.createElement($i,null,R.createElement(j2,null,R.createElement($a,null,R.createElement(FormattedMessage,{id:"video.notReady"}))))};var oq=e=>{let[t,o]=useState(null);return useEffect(()=>{function r(){return _(this,null,function*(){if(e==null)return;let n=yield StreamRepository.getStream(e);o(n.data);})}r();},[e]),t},G2=oq;var jb=m(Zt)`
1496
1496
  && {
1497
1497
  font-size: 24px;
1498
1498
  }
@@ -1559,7 +1559,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1559
1559
  border-radius: 4px;
1560
1560
  `,cI=m(aI)`
1561
1561
  grid-area: icon;
1562
- `,fq=m(Gt).attrs({width:14,height:14})`
1562
+ `,fq=m(Zt).attrs({width:14,height:14})`
1563
1563
  fill: ${({theme:e})=>e.palette.alert.main};
1564
1564
  z-index: 2;
1565
1565
  `,dI=e=>R.createElement(Y,E(c({},e),{variant:"secondary"}),R.createElement(R.Fragment,null,R.createElement(fq,null)," ",R.createElement(FormattedMessage,{id:"file.reUpload"}))),pI=m.div`
@@ -1573,7 +1573,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1573
1573
  grid-area: size;
1574
1574
  ${({theme:e})=>e.typography.caption};
1575
1575
  color: ${({theme:e})=>e.palette.base.shade1};
1576
- `,yq=m(jt)`
1576
+ `,yq=m(Gt)`
1577
1577
  grid-area: remove;
1578
1578
  z-index: 2;
1579
1579
  `,gI=e=>R.createElement(Y,E(c({},e),{variant:"secondary"}),R.createElement(yq,{width:14,height:14})),fI=m.div`
@@ -1912,7 +1912,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
1912
1912
  padding-top: 8px;
1913
1913
  `,kJ=m(no)`
1914
1914
  width: min(80dvw, 720px);
1915
- `,SJ=e=>{var Vt,De,ir,Dr;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:d}=useIntl(),[p,u]=useState(!1),g=()=>u(!0),f=()=>u(!1),{info:y,confirm:v}=Pe(),C=Ce(),[h,x]=useState(!1),[b,M]=fl(),[I,w]=useState(!1),[N,T]=useState(!1),[L,D]=useState(!1),U=()=>x(qe=>!qe);useEffect(()=>(h?document.addEventListener("click",U):document.removeEventListener("click",U),()=>{document.removeEventListener("click",U);}),[h]);function Z(qe){if(qe instanceof Error)if(qe.message.includes(MJ))y({title:R.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:R.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw qe}let B=s==null?void 0:s.targetId,$=Tt(B),{isAnonymousUser:G,isNoNicknameUser:q}=Ee(),{openNicknameModal:z}=To(),{triggerAnonymousNeedsLogin:H}=gr(),{canReview:F,isPostUnderReview:j}=Rs({community:$,post:s,childrenPosts:t}),Q=()=>_(void 0,null,function*(){try{w(!0),yield r==null?void 0:r(),C.success({content:R.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(qe){Z(qe);}finally{w(!1);}}),k=()=>_(void 0,null,function*(){try{T(!0),yield n==null?void 0:n(),C.success({content:R.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(qe){Z(qe);}finally{T(!1);}}),V=t.length>0,ae=V?wJ:IJ,oe=t.find(qe=>qe.dataType==="liveStream"),be=()=>{L?v({title:R.createElement(FormattedMessage,{id:"post.editDiscard.title"}),content:R.createElement(FormattedMessage,{id:"post.editDiscard.content"}),okText:R.createElement(FormattedMessage,{id:"general.action.discard"}),cancelText:R.createElement(FormattedMessage,{id:"post.editDiscard.cancel"}),onOk:()=>{u(!1);}}):u(!1);},pe=()=>D(!0),{newsCommunityId:We,faqCommunityId:vt}=Cr(),eo=($==null?void 0:$.communityId)===We||($==null?void 0:$.communityId)===vt;return R.createElement("div",{style:{marginTop:8}},R.createElement(K2,{"data-qa-anchor":"post",className:o},R.createElement(kw,null,R.createElement(Cw,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&R.createElement(_w,null,R.createElement("div",{ref:b},!eo&&R.createElement(xl,{onClick:qe=>{qe.stopPropagation(),q?z():G?H():U();},className:o},R.createElement(vl,null))),h&&R.createElement(PJ,E(c({},e),{onApprove:Q,onDecline:k,onClose:U,onEditPostClick:()=>g(),buttonContainerHeight:M})))),l?R.createElement(Nw,null):R.createElement(R.Fragment,null,(Vt=s==null?void 0:s.data)!=null&&Vt.text?R.createElement(_J,null,R.createElement(Pw,{data:(De=oe==null?void 0:oe.data)!=null?De:s==null?void 0:s.data,dataType:(ir=oe==null?void 0:oe.dataType)!=null?ir:s==null?void 0:s.dataType,postMaxLines:ae,mentionees:(Dr=s==null?void 0:s.metadata)==null?void 0:Dr.mentioned})):null,V&&R.createElement(TJ,null,R.createElement(HI,{contents:t})),!j&&R.createElement(Z6,{readonly:a,post:s}),j&&F&&R.createElement(Sw,{"data-qa-anchor":"post-review"},R.createElement(fe,{"data-qa-anchor":"post-review-accept-button",disabled:I||N,onClick:Q},R.createElement(FormattedMessage,{id:"general.action.accept"})),R.createElement(Y,{"data-qa-anchor":"post-review-decline-button",disabled:I||N,onClick:k},R.createElement(FormattedMessage,{id:"general.action.decline"}))),p&&R.createElement(kJ,{"data-qa-anchor":"post-editor-modal",title:d({id:"post.editPost"}),onCancel:()=>be()},R.createElement(tw,{postId:s==null?void 0:s.postId,onSave:f,onChangeText:pe,hasChanged:L})))))},vr=R.memo(SJ);var Lw=m.div`
1915
+ `,SJ=e=>{var jt,De,ir,Dr;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:d}=useIntl(),[p,u]=useState(!1),g=()=>u(!0),f=()=>u(!1),{info:y,confirm:v}=Pe(),C=Ce(),[h,x]=useState(!1),[b,M]=fl(),[I,w]=useState(!1),[N,T]=useState(!1),[L,D]=useState(!1),U=()=>x(qe=>!qe);useEffect(()=>(h?document.addEventListener("click",U):document.removeEventListener("click",U),()=>{document.removeEventListener("click",U);}),[h]);function Z(qe){if(qe instanceof Error)if(qe.message.includes(MJ))y({title:R.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:R.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw qe}let B=s==null?void 0:s.targetId,$=Tt(B),{isAnonymousUser:G,isNoNicknameUser:q}=Ee(),{openNicknameModal:z}=To(),{triggerAnonymousNeedsLogin:H}=gr(),{canReview:F,isPostUnderReview:j}=Rs({community:$,post:s,childrenPosts:t}),Q=()=>_(void 0,null,function*(){try{w(!0),yield r==null?void 0:r(),C.success({content:R.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(qe){Z(qe);}finally{w(!1);}}),k=()=>_(void 0,null,function*(){try{T(!0),yield n==null?void 0:n(),C.success({content:R.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(qe){Z(qe);}finally{T(!1);}}),V=t.length>0,ae=V?wJ:IJ,oe=t.find(qe=>qe.dataType==="liveStream"),be=()=>{L?v({title:R.createElement(FormattedMessage,{id:"post.editDiscard.title"}),content:R.createElement(FormattedMessage,{id:"post.editDiscard.content"}),okText:R.createElement(FormattedMessage,{id:"general.action.discard"}),cancelText:R.createElement(FormattedMessage,{id:"post.editDiscard.cancel"}),onOk:()=>{u(!1);}}):u(!1);},pe=()=>D(!0),{newsCommunityId:We,faqCommunityId:vt}=Cr(),Vt=($==null?void 0:$.communityId)===We||($==null?void 0:$.communityId)===vt;return R.createElement("div",{style:{marginTop:8}},R.createElement(K2,{"data-qa-anchor":"post",className:o},R.createElement(kw,null,R.createElement(Cw,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&R.createElement(_w,null,R.createElement("div",{ref:b},!Vt&&R.createElement(xl,{onClick:qe=>{qe.stopPropagation(),q?z():G?H():U();},className:o},R.createElement(vl,null))),h&&R.createElement(PJ,E(c({},e),{onApprove:Q,onDecline:k,onClose:U,onEditPostClick:()=>g(),buttonContainerHeight:M})))),l?R.createElement(Nw,null):R.createElement(R.Fragment,null,(jt=s==null?void 0:s.data)!=null&&jt.text?R.createElement(_J,null,R.createElement(Pw,{data:(De=oe==null?void 0:oe.data)!=null?De:s==null?void 0:s.data,dataType:(ir=oe==null?void 0:oe.dataType)!=null?ir:s==null?void 0:s.dataType,postMaxLines:ae,mentionees:(Dr=s==null?void 0:s.metadata)==null?void 0:Dr.mentioned})):null,V&&R.createElement(TJ,null,R.createElement(HI,{contents:t})),!j&&R.createElement(Z6,{readonly:a,post:s,isClientCommunity:Vt}),j&&F&&R.createElement(Sw,{"data-qa-anchor":"post-review"},R.createElement(fe,{"data-qa-anchor":"post-review-accept-button",disabled:I||N,onClick:Q},R.createElement(FormattedMessage,{id:"general.action.accept"})),R.createElement(Y,{"data-qa-anchor":"post-review-decline-button",disabled:I||N,onClick:k},R.createElement(FormattedMessage,{id:"general.action.decline"}))),p&&R.createElement(kJ,{"data-qa-anchor":"post-editor-modal",title:d({id:"post.editPost"}),onCancel:()=>be()},R.createElement(tw,{postId:s==null?void 0:s.postId,onSave:f,onChangeText:pe,hasChanged:L})))))},vr=R.memo(SJ);var Lw=m.div`
1916
1916
  color: ${({theme:e})=>e.palette.base.shade3};
1917
1917
  display: flex;
1918
1918
  align-items: center;
@@ -2338,7 +2338,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
2338
2338
  cursor: pointer;
2339
2339
  `,gM=m.span`
2340
2340
  margin: 0 0.5rem;
2341
- `,fM=m(jt).attrs({width:18,height:18})`
2341
+ `,fM=m(Gt).attrs({width:18,height:18})`
2342
2342
  fill: #000;
2343
2343
  `,yM=m(Y)`
2344
2344
  border: none;
@@ -2450,7 +2450,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gd]+=1);var Rd=`url("data:ima
2450
2450
  cursor: pointer;
2451
2451
  `,ZM=m.span`
2452
2452
  margin: 0 0.5rem;
2453
- `,QM=m(jt).attrs({width:12,height:12})`
2453
+ `,QM=m(Gt).attrs({width:12,height:12})`
2454
2454
  fill: ${({theme:e})=>e.palette.base.shade1};
2455
2455
  `,WM=m(Y)`
2456
2456
  padding: 0.4rem 0.55rem;
@@ -2992,7 +2992,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),R.cre
2992
2992
  background: none;
2993
2993
  border: none;
2994
2994
  padding: 0;
2995
- `;m(u4)``;var fR=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},yR=10,hR=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:d=yR})=>{var wa,rt,In,Ke,to;let{currentUserId:p,client:u}=J(),{setNavigationBlocker:g}=X(),f=re(p),{info:y}=Pe(),v=Ce(),[C,h]=useState(null);(t==="global"||t==="myFeed")&&(t="user",o=p||"");let [x,b]=useState({targetType:t,targetId:o}),{user:M,community:I}=fR({targetId:x.targetId,targetType:x.targetType});Wi(I==null?void 0:I.communityId);Rs({post:C,community:I}),useEffect(()=>{b({targetType:t,targetId:o});},[t,o]);se({fileId:(wa=f==null?void 0:f.avatar)==null?void 0:wa.fileUrl});let [L,D]=useState([]),[U,Z]=useState([]),[B,$]=useState([]),[G,q]=useState([]),[z,H]=useState([]),[F,j]=useState([]),[Q,k]=useState(!1),[V]=PP(),ae=useRef(null),[oe,be]=useState(!1),pe=()=>{y({title:R.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:R.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:R.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"});},We=useRef(null),vt=()=>{var Je;(Je=ae.current)==null||Je.dispatchCommand(CLEAR_EDITOR_COMMAND,void 0),ir({text:"",mentioned:[],mentionees:[]});};function eo(Je){return _(this,null,function*(){var oo,Ai;if(x.targetId)try{be(!0);let Ns=(yield PostRepository.createPost(Je)).data;if(l==null||l(Ns),vt(),D([]),Z([]),$([]),q([]),H([]),j([]),I){let jF=(oo=u==null?void 0:u.hasPermission(dr.ReviewCommunityPost).community(I.communityId))!=null?oo:!1;I.postSetting===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&!jF&&v.success({content:R.createElement(FormattedMessage,{id:"post.success.submittedToReview"})});}}catch(ar){ar instanceof Error&&(ar.message===uo.CONTAIN_BLOCKED_WORD?v.error({content:R.createElement(FormattedMessage,{id:"notification.error.blockedWord"})}):ar.message===uo.NOT_INCLUDE_WHITELIST_LINK?v.error({content:R.createElement(FormattedMessage,{id:"notification.error.whitelistLink"})}):v.error({content:((Ai=ar.message.split(":"))==null?void 0:Ai[1])||ar.message}));}finally{be(!1);}})}let Vt=useRef(null),[De,ir]=useState({text:"",mentioned:[],mentionees:[]});function Dr(){return _(this,null,function*(){var ar;if(!x.targetId)return;let Je={},oo=[];if(De.text&&(Je.text=De.text),L.length&&oo.push(...L.map(Ns=>({fileId:Ns.fileId,type:FileType.IMAGE}))),U.length&&oo.push(...U.map(Ns=>({fileId:Ns.fileId,type:FileType.VIDEO}))),B.length&&oo.push(...B.map(Ns=>({fileId:Ns.fileId,type:FileType.FILE}))),(ar=Je.text)!=null&&ar.length&&Je.text.length>5e4){pe();return}let Ai={targetId:x.targetId,targetType:x.targetType,data:Je,dataType:"text",attachments:oo,metadata:{mentioned:De.mentioned},mentionees:De.mentionees};return eo(Ai)})}let qe=()=>{v.info({content:R.createElement(FormattedMessage,{id:"upload.attachmentLimit",values:{maxFiles:d}})});},Rr=()=>{v.info({content:R.createElement(FormattedMessage,{id:"upload.fileSizeLimit"})});},bn=x.targetType==="community"?mr:Se,Hr=R.createElement(T_,{avatar:(In=(rt=f==null?void 0:f.avatar)==null?void 0:rt.fileUrl)!=null?In:void 0,backgroundImage:bn}),en=!De.text&&L.length===0&&U.length===0&&B.length===0||Q||oe,ce=!(!De.text&&L.length===0&&U.length===0&&B.length===0),ue=Je=>{ir(oo=>E(c({},oo),{mentioned:Je.mentioned,text:Je.text,mentionees:Je.mentionees}));};useEffect(()=>{ce?g==null||g({title:R.createElement(FormattedMessage,{id:"post.discard.title"}),content:R.createElement(FormattedMessage,{id:"post.discard.content"}),okText:R.createElement(FormattedMessage,{id:"general.action.discard"}),onOk:()=>{vt(),D([]),Z([]),$([]),q([]),H([]),j([]),g==null||g(null);}}):g==null||g(null);},[ce,g]);let [tn,Uo]=useState(!1),Bi=(Ke=x==null?void 0:x.targetType)!=null?Ke:t,Li=(to=x==null?void 0:x.targetId)!=null?to:o;return R.createElement(k_,{className:cr("postComposeBar",e)},tn&&R.createElement(b_,{targetId:Li||void 0,targetType:Bi,onCreatePoll:(Je,oo,Ai,ar)=>_(void 0,null,function*(){Li&&eo({targetId:Li,targetType:Bi,data:{pollId:Je,text:oo},dataType:"poll",mentionees:Ai,metadata:ar});}),onClose:()=>Uo(!1)}),r&&f?R.createElement(P_,{user:f,communities:n,hasMoreCommunities:a,loadMoreCommunities:s,currentTargetId:x.targetId,onChange:b},Hr):Hr,R.createElement(N_,null,R.createElement(L_,null,R.createElement(A_,{ref:Vt},R.createElement(B_,null,R.createElement(Qi,{editorRef:ae,placeholder:"What's going on...",communityId:t==="community"?o:void 0,onChange:ue,mentionContainer:Vt.current,dataValue:{data:{text:De.text},metadata:{mentioned:De.mentioned},mentionees:De.mentionees}})),R.createElement(B7,null,R.createElement(E7,{files:G,uploadedFiles:L,uploadLoading:Q,onLoadingChange:k,onChange:({uploaded:Je,uploading:oo})=>{D(Je),q(oo);},onError:V,fileInputRef:We})),R.createElement(__,{imageUploadDisabled:B.length>0||U.length>0||Q,videoUploadDisabled:B.length>0||L.length>0||Q,fileUploadDisabled:L.length>0||U.length>0||Q,fileLimitRemaining:d-B.length-L.length-U.length,uploadLoading:Q,onChangeImages:Je=>q(Je),onChangeVideos:H,onChangeFiles:j,onMaxFilesLimit:qe,onFileSizeLimit:Rr,fileInputRef:We})),G.length>0||L.length>0?R.createElement(B7,null,R.createElement(E7,{files:G,uploadedFiles:L,uploadLoading:Q,onLoadingChange:k,onChange:({uploaded:Je,uploading:oo})=>{D(Je),q(oo);},onError:V,fileInputRef:We})):null),R.createElement(S_,{"data-qa-anchor":"post-creator-footer"},R.createElement(E_,{disabled:en,"data-qa-anchor":"post-creator-post-button",onClick:Dr},R.createElement(FormattedMessage,{id:"post"})))))},ac=memo(hR);var xR=({post:e,className:t,hidePostTarget:o,readonly:r,onDeleted:n})=>{var x;let i=re(e==null?void 0:e.postedUserId),a=se({fileId:i==null?void 0:i.avatarFileId,imageSize:"small"}),s=Va(e==null?void 0:e.children),{userRoles:l}=J(),d=zw(e==null?void 0:e.dataType),{currentUserId:p}=J(),u=(s||[]).find(b=>b.dataType==="poll"),g=sp((x=u==null?void 0:u.data)==null?void 0:x.pollId),f=(g==null?void 0:g.status)==="closed",y=()=>_(void 0,null,function*(){g!=null&&(yield PollRepository.closePoll(g.pollId));}),v=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.deletePost(e.postId),n==null||n(e.postId));}),C=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.approvePost(e.postId));}),h=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.declinePost(e.postId));});return e==null||d==null?R.createElement(vr,{loading:!0}):R.createElement(R.Fragment,null,d({childrenPosts:s||[],handleClosePoll:y,isPollClosed:f,avatarFileUrl:a,user:i,poll:g,className:t,currentUserId:p||void 0,hidePostTarget:o,post:e,userRoles:l,readonly:r,handleApprovePost:C,handleDeclinePost:h,handleDeletePost:v}))},qa=memo(e=>{let t=W("Post");return t?t(e):R.createElement(xR,c({},e))});function bR(e){return R.createElement("svg",c({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M14.3672 9.66406C17.5312 9.10156 20.8359 10.1562 23.1562 12.4766L23.9297 13.25L24.7734 12.4766C27.0938 10.1562 30.3984 9.10156 33.5625 9.66406C38.4141 10.4375 42 14.6562 42 19.5781V19.9297C42 22.8828 40.7344 25.6953 38.625 27.6641L25.8984 39.5469C25.4062 40.0391 24.7031 40.25 24 40.25C23.2266 40.25 22.5234 40.0391 22.0312 39.5469L9.30469 27.6641C7.19531 25.6953 6 22.8828 6 19.9297V19.5781C6 14.6562 9.51562 10.4375 14.3672 9.66406ZM23.9297 38C24.1406 38 24.2812 38 24.3516 37.8594L37.0781 25.9766C38.7656 24.4297 39.75 22.25 39.75 19.9297V19.5781C39.75 15.7109 36.9375 12.4766 33.2109 11.8438C30.6797 11.4219 28.1484 12.2656 26.3906 14.0234L25.5469 14.8672C25.4766 14.9375 25.4766 14.9375 25.4062 15.0078L28.2188 18.1719C28.4297 18.4531 28.5 18.7344 28.4297 19.0859C28.3594 19.4375 28.2188 19.7188 27.8672 19.8594L21.1875 23.7266L25.9688 29.4219C26.3203 29.9141 26.3203 30.6172 25.8281 31.0391C25.3359 31.3906 24.6328 31.3203 24.2109 30.8984L18.5859 24.1484C18.375 23.8672 18.3047 23.5156 18.375 23.2344C18.4453 22.8828 18.5859 22.6016 18.9375 22.4609L25.6172 18.5938L21.9609 14.5156H22.0312L21.5391 14.0234C19.7812 12.2656 17.25 11.4219 14.7188 11.8438C10.9922 12.4766 8.17969 15.7109 8.17969 19.5781V19.9297C8.17969 22.25 9.16406 24.4297 10.8516 25.9766L23.5781 37.8594C23.6484 38 23.7891 38 23.9297 38Z",fill:"#6E6E6E"}))}var H_=bR;var IR=m(Y)`
2995
+ `;m(u4)``;var fR=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},yR=10,hR=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:d=yR})=>{var wa,rt,In,Ke,to;let{currentUserId:p,client:u}=J(),{setNavigationBlocker:g}=X(),f=re(p),{info:y}=Pe(),v=Ce(),[C,h]=useState(null);(t==="global"||t==="myFeed")&&(t="user",o=p||"");let [x,b]=useState({targetType:t,targetId:o}),{user:M,community:I}=fR({targetId:x.targetId,targetType:x.targetType});Wi(I==null?void 0:I.communityId);Rs({post:C,community:I}),useEffect(()=>{b({targetType:t,targetId:o});},[t,o]);se({fileId:(wa=f==null?void 0:f.avatar)==null?void 0:wa.fileUrl});let [L,D]=useState([]),[U,Z]=useState([]),[B,$]=useState([]),[G,q]=useState([]),[z,H]=useState([]),[F,j]=useState([]),[Q,k]=useState(!1),[V]=PP(),ae=useRef(null),[oe,be]=useState(!1),pe=()=>{y({title:R.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:R.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:R.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"});},We=useRef(null),vt=()=>{var Je;(Je=ae.current)==null||Je.dispatchCommand(CLEAR_EDITOR_COMMAND,void 0),ir({text:"",mentioned:[],mentionees:[]});};function Vt(Je){return _(this,null,function*(){var oo,Ai;if(x.targetId)try{be(!0);let Ns=(yield PostRepository.createPost(Je)).data;if(l==null||l(Ns),vt(),D([]),Z([]),$([]),q([]),H([]),j([]),I){let jF=(oo=u==null?void 0:u.hasPermission(dr.ReviewCommunityPost).community(I.communityId))!=null?oo:!1;I.postSetting===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&!jF&&v.success({content:R.createElement(FormattedMessage,{id:"post.success.submittedToReview"})});}}catch(ar){ar instanceof Error&&(ar.message===uo.CONTAIN_BLOCKED_WORD?v.error({content:R.createElement(FormattedMessage,{id:"notification.error.blockedWord"})}):ar.message===uo.NOT_INCLUDE_WHITELIST_LINK?v.error({content:R.createElement(FormattedMessage,{id:"notification.error.whitelistLink"})}):v.error({content:((Ai=ar.message.split(":"))==null?void 0:Ai[1])||ar.message}));}finally{be(!1);}})}let jt=useRef(null),[De,ir]=useState({text:"",mentioned:[],mentionees:[]});function Dr(){return _(this,null,function*(){var ar;if(!x.targetId)return;let Je={},oo=[];if(De.text&&(Je.text=De.text),L.length&&oo.push(...L.map(Ns=>({fileId:Ns.fileId,type:FileType.IMAGE}))),U.length&&oo.push(...U.map(Ns=>({fileId:Ns.fileId,type:FileType.VIDEO}))),B.length&&oo.push(...B.map(Ns=>({fileId:Ns.fileId,type:FileType.FILE}))),(ar=Je.text)!=null&&ar.length&&Je.text.length>5e4){pe();return}let Ai={targetId:x.targetId,targetType:x.targetType,data:Je,dataType:"text",attachments:oo,metadata:{mentioned:De.mentioned},mentionees:De.mentionees};return Vt(Ai)})}let qe=()=>{v.info({content:R.createElement(FormattedMessage,{id:"upload.attachmentLimit",values:{maxFiles:d}})});},Rr=()=>{v.info({content:R.createElement(FormattedMessage,{id:"upload.fileSizeLimit"})});},bn=x.targetType==="community"?mr:Se,Hr=R.createElement(T_,{avatar:(In=(rt=f==null?void 0:f.avatar)==null?void 0:rt.fileUrl)!=null?In:void 0,backgroundImage:bn}),en=!De.text&&L.length===0&&U.length===0&&B.length===0||Q||oe,ce=!(!De.text&&L.length===0&&U.length===0&&B.length===0),ue=Je=>{ir(oo=>E(c({},oo),{mentioned:Je.mentioned,text:Je.text,mentionees:Je.mentionees}));};useEffect(()=>{ce?g==null||g({title:R.createElement(FormattedMessage,{id:"post.discard.title"}),content:R.createElement(FormattedMessage,{id:"post.discard.content"}),okText:R.createElement(FormattedMessage,{id:"general.action.discard"}),onOk:()=>{vt(),D([]),Z([]),$([]),q([]),H([]),j([]),g==null||g(null);}}):g==null||g(null);},[ce,g]);let [tn,Uo]=useState(!1),Bi=(Ke=x==null?void 0:x.targetType)!=null?Ke:t,Li=(to=x==null?void 0:x.targetId)!=null?to:o;return R.createElement(k_,{className:cr("postComposeBar",e)},tn&&R.createElement(b_,{targetId:Li||void 0,targetType:Bi,onCreatePoll:(Je,oo,Ai,ar)=>_(void 0,null,function*(){Li&&Vt({targetId:Li,targetType:Bi,data:{pollId:Je,text:oo},dataType:"poll",mentionees:Ai,metadata:ar});}),onClose:()=>Uo(!1)}),r&&f?R.createElement(P_,{user:f,communities:n,hasMoreCommunities:a,loadMoreCommunities:s,currentTargetId:x.targetId,onChange:b},Hr):Hr,R.createElement(N_,null,R.createElement(L_,null,R.createElement(A_,{ref:jt},R.createElement(B_,null,R.createElement(Qi,{editorRef:ae,placeholder:"What's going on...",communityId:t==="community"?o:void 0,onChange:ue,mentionContainer:jt.current,dataValue:{data:{text:De.text},metadata:{mentioned:De.mentioned},mentionees:De.mentionees}})),R.createElement(B7,null,R.createElement(E7,{files:G,uploadedFiles:L,uploadLoading:Q,onLoadingChange:k,onChange:({uploaded:Je,uploading:oo})=>{D(Je),q(oo);},onError:V,fileInputRef:We})),R.createElement(__,{imageUploadDisabled:B.length>0||U.length>0||Q,videoUploadDisabled:B.length>0||L.length>0||Q,fileUploadDisabled:L.length>0||U.length>0||Q,fileLimitRemaining:d-B.length-L.length-U.length,uploadLoading:Q,onChangeImages:Je=>q(Je),onChangeVideos:H,onChangeFiles:j,onMaxFilesLimit:qe,onFileSizeLimit:Rr,fileInputRef:We})),G.length>0||L.length>0?R.createElement(B7,null,R.createElement(E7,{files:G,uploadedFiles:L,uploadLoading:Q,onLoadingChange:k,onChange:({uploaded:Je,uploading:oo})=>{D(Je),q(oo);},onError:V,fileInputRef:We})):null),R.createElement(S_,{"data-qa-anchor":"post-creator-footer"},R.createElement(E_,{disabled:en,"data-qa-anchor":"post-creator-post-button",onClick:Dr},R.createElement(FormattedMessage,{id:"post"})))))},ac=memo(hR);var xR=({post:e,className:t,hidePostTarget:o,readonly:r,onDeleted:n})=>{var x;let i=re(e==null?void 0:e.postedUserId),a=se({fileId:i==null?void 0:i.avatarFileId,imageSize:"small"}),s=Va(e==null?void 0:e.children),{userRoles:l}=J(),d=zw(e==null?void 0:e.dataType),{currentUserId:p}=J(),u=(s||[]).find(b=>b.dataType==="poll"),g=sp((x=u==null?void 0:u.data)==null?void 0:x.pollId),f=(g==null?void 0:g.status)==="closed",y=()=>_(void 0,null,function*(){g!=null&&(yield PollRepository.closePoll(g.pollId));}),v=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.deletePost(e.postId),n==null||n(e.postId));}),C=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.approvePost(e.postId));}),h=()=>_(void 0,null,function*(){e!=null&&(yield PostRepository.declinePost(e.postId));});return e==null||d==null?R.createElement(vr,{loading:!0}):R.createElement(R.Fragment,null,d({childrenPosts:s||[],handleClosePoll:y,isPollClosed:f,avatarFileUrl:a,user:i,poll:g,className:t,currentUserId:p||void 0,hidePostTarget:o,post:e,userRoles:l,readonly:r,handleApprovePost:C,handleDeclinePost:h,handleDeletePost:v}))},qa=memo(e=>{let t=W("Post");return t?t(e):R.createElement(xR,c({},e))});function bR(e){return R.createElement("svg",c({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M14.3672 9.66406C17.5312 9.10156 20.8359 10.1562 23.1562 12.4766L23.9297 13.25L24.7734 12.4766C27.0938 10.1562 30.3984 9.10156 33.5625 9.66406C38.4141 10.4375 42 14.6562 42 19.5781V19.9297C42 22.8828 40.7344 25.6953 38.625 27.6641L25.8984 39.5469C25.4062 40.0391 24.7031 40.25 24 40.25C23.2266 40.25 22.5234 40.0391 22.0312 39.5469L9.30469 27.6641C7.19531 25.6953 6 22.8828 6 19.9297V19.5781C6 14.6562 9.51562 10.4375 14.3672 9.66406ZM23.9297 38C24.1406 38 24.2812 38 24.3516 37.8594L37.0781 25.9766C38.7656 24.4297 39.75 22.25 39.75 19.9297V19.5781C39.75 15.7109 36.9375 12.4766 33.2109 11.8438C30.6797 11.4219 28.1484 12.2656 26.3906 14.0234L25.5469 14.8672C25.4766 14.9375 25.4766 14.9375 25.4062 15.0078L28.2188 18.1719C28.4297 18.4531 28.5 18.7344 28.4297 19.0859C28.3594 19.4375 28.2188 19.7188 27.8672 19.8594L21.1875 23.7266L25.9688 29.4219C26.3203 29.9141 26.3203 30.6172 25.8281 31.0391C25.3359 31.3906 24.6328 31.3203 24.2109 30.8984L18.5859 24.1484C18.375 23.8672 18.3047 23.5156 18.375 23.2344C18.4453 22.8828 18.5859 22.6016 18.9375 22.4609L25.6172 18.5938L21.9609 14.5156H22.0312L21.5391 14.0234C19.7812 12.2656 17.25 11.4219 14.7188 11.8438C10.9922 12.4766 8.17969 15.7109 8.17969 19.5781V19.9297C8.17969 22.25 9.16406 24.4297 10.8516 25.9766L23.5781 37.8594C23.6484 38 23.7891 38 23.9297 38Z",fill:"#6E6E6E"}))}var H_=bR;var IR=m(Y)`
2996
2996
  font-size: 14px;
2997
2997
  margin-top: 24px;
2998
2998
  border-radius: 100px;
@@ -4739,7 +4739,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),R.cre
4739
4739
  }
4740
4740
  `,NB=m.svg`
4741
4741
  animation: ${tme} 2s linear infinite;
4742
- `;var ga=e=>R.createElement(NB,c({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"}));function ime(e){return e.fileId!==void 0}function td({files:e=[],uploadedFiles:t=[],onChange:o=i=>{},onLoadingChange:r=i=>{},onError:n=i=>{}}){let[i,a]=useState([]),s=useMemo(()=>Array.isArray(e)?e:Array.from(e),[e]),l=useCallback(()=>{o({uploaded:[],uploading:[]});},[o]),d=useCallback(()=>{a([]);},[]),p=useCallback((g,f)=>{if(ime(g)){let y=t.filter(v=>v.fileId!==g.fileId);o({uploaded:y,uploading:s});}else if(f!==void 0){let y=t.filter((v,C)=>C!==f);o({uploaded:y,uploading:s});}else {let y=s.filter(v=>v.name!==g.name);o({uploaded:t,uploading:y});}},[o,t,s]);return useEffect(()=>{if(!s.length)return;function g(){return _(this,null,function*(){r(!0);try{let f=yield Promise.all(s.map(v=>_(this,null,function*(){let C=new FormData;C.append("files",v);let h=yield _(this,null,function*(){if(v.type.includes(FileType.IMAGE))return FileRepository.createImage(C);if(v.type.includes(FileType.VIDEO))return FileRepository.createVideo(C)});return h&&h.data.length>0?h.data[0]:null}))),y=[...t,...f].filter(Fe);o({uploaded:y,uploading:[]}),a([]);}catch(f){a(s.map(y=>y.name)),n(!0);}finally{r(!1);}})}g();},[s]),{allFiles:[...t,...s],uploading:s,uploaded:t,removeFile:p,reset:l,rejected:i,retry:d}}function Ig({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,isErrorUpload:a}){let s=td({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:l,removeFile:d}=s;return l.length===0?null:l&&R.createElement("div",{"data-images-amount":Math.min(l.length,3),className:L1.thumbnail__container},l==null?void 0:l.map((p,u)=>{var g;return R.createElement("div",{key:u,"data-images-height":l.length>2,className:L1.thumbnail__wrapper},n?R.createElement("div",{className:L1.icon__status},R.createElement(ga,null)):a?R.createElement("div",{className:L1.icon__status},R.createElement(Gt,null)):R.createElement(R.Fragment,null,R.createElement("img",{className:L1.thumbnail,src:FileRepository.fileUrlWithSize(p==null?void 0:p.fileUrl,"medium"),alt:(g=p.attributes)==null?void 0:g.name}),R.createElement("button",{type:"reset",onClick:()=>d(p)},R.createElement(Po,{className:L1.closeIcon}))))}))}var fa={thumbnail__container:"f",thumbnail__wrapper:"Cd",thumbnail__wrapper_item_3:"Ad",thumbnail:"Md",closeIcon:"Sd",icon__status:"Ed",playIcon:"Fd"};var wg=({files:e,uploadedFiles:t,onLoadingChange:o,onChange:r,uploadLoading:n,onError:i,videoThumbnail:a,removeThumbnail:s,isErrorUpload:l})=>{let d=td({files:e,uploadedFiles:t,onChange:r,onLoadingChange:o,onError:i}),{allFiles:p,removeFile:u}=d;if(p.length===0)return null;let g=(f,y)=>{u(f,y),s(y);};return a?R.createElement("div",{"data-images-amount":Math.min(a.length,3),className:fa.thumbnail__container},a==null?void 0:a.map((f,y)=>R.createElement("div",{key:f.videoUrl,className:cr(fa.thumbnail__wrapper,a.length>2&&fa.thumbnail__wrapper_item_3)},n?R.createElement("div",{className:fa.icon__status},R.createElement(ga,null)):l?R.createElement("div",{className:fa.icon__status},R.createElement(Gt,null)):R.createElement(R.Fragment,null,R.createElement("img",{className:fa.thumbnail,src:f.thumbnail}),R.createElement("button",{type:"reset",onClick:()=>{g(f.file,y);}},R.createElement(Po,{className:fa.closeIcon})),R.createElement("div",{className:fa.playIcon},R.createElement(Mo,null)))))):null};var ume=({ref:e})=>{let[t,o]=useState(void 0);return useEffect(()=>{if(e.current==null)return;let r=new ResizeObserver(n=>{for(let i of n)o(i.target.clientHeight);});return e.current&&r.observe(e.current),()=>{r.disconnect();}},[e.current]),t};function _g({community:e,targetType:t,targetId:o}){let r="post_composer_page",{themeStyles:n}=Ye({pageId:r}),i="6.75rem",a="8.5rem",s="11rem",l="14.5rem",{AmityPostComposerPageBehavior:d}=bt(),{confirm:p}=Re(),[u,g]=useState(i),[f]=useState(!0),y=useRef(null),v=useRef(null),{prependItem:C}=bs(),h=ume({ref:v}),{handleSubmit:x}=useForm(),[b,M]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[I,w]=useState([]),[N,T]=useState([]),[L,D]=useState([]),[U,Z]=useState([]),[B,$]=useState(!1),[G,q]=useState([]),[z,H]=useState(!1),[F,j]=useState(!0),[Q,k]=useState(!0),[V,ae]=useState(!1),[oe,be]=useState([]),pe=useRef(null),We=()=>useMutation({mutationFn:ce=>_(this,null,function*(){return PostRepository.createPost(ce)}),onSuccess:ce=>{var ue;(ue=d==null?void 0:d.goToSocialHomePage)==null||ue.call(d),C(ce.data);},onError:ce=>{console.error("Failed to create post",ce);}}),{mutateAsync:vt,isPending:eo,isError:Vt}=We(),De=()=>{let ce=I.map(Uo=>({type:"image",fileId:Uo.fileId})),ue=N.map(Uo=>({type:"video",fileId:Uo.fileId})),tn=[...ce,...ue];vt({targetId:o,targetType:t,data:{text:b.text},dataType:"text",metadata:{mentioned:b.mentioned},mentionees:b.mentionees,attachments:tn});},ir=ce=>{M(ue=>E(c({},ue),{mentioned:ce.mentioned,text:ce.text,mentionees:ce.mentionees}));},Dr=ce=>{u===i&&ce==="0px"||g(ce);},qe=()=>{p({pageId:r,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var ce;(ce=d==null?void 0:d.goToSocialHomePage)==null||ce.call(d);},okText:"Discard",cancelText:"Keep editing"});};useEffect(()=>{I.length>0?(j(!0),k(!1)):N.length>0&&oe.length>0?(j(!1),k(!0)):(I.length==0||oe.length==0)&&(j(!0),k(!0));},[I,N,F,Q,oe]),useEffect(()=>{TB()?H(!0):H(!1);},[]),useEffect(()=>{g(!z&&F&&Q||z&&F&&!Q||z&&!F&&Q?s:!z&&F&&!Q||!z&&!F&&Q?a:l);},[z,F,Q]);let Rr=ce=>{be(ue=>ue.filter((tn,Uo)=>Uo!==ce));},bn=ce=>{if(ce.length+G.length>10){p({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ",okText:"Close"});return}ce.length>0&&(q(ue=>[...ue,...ce]),D(ce));},Hr=ce=>_(this,null,function*(){let ue=oe?oe.length:0;if(ce.length+ue>10){p({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ",okText:"Close"});return}if(ce.length>0){Z==null||Z(ce);let tn=ce.map(Fr=>({file:Fr,videoUrl:URL.createObjectURL(Fr),thumbnail:void 0})),Uo=yield Promise.all(tn.map(Fr=>_(this,null,function*(){let Bi=yield kB(Fr.file);return E(c({},Fr),{thumbnail:Bi})})));be(Fr=>[...Fr,...Uo]);}}),en=u==a||u==s||u==l;return R.createElement("div",{className:Un.createPost,style:n},R.createElement("form",{onSubmit:x(De),"data-from-media":u==i,className:Un.createPost__formMediaAttachment},R.createElement("div",{className:Un.createPost__topBar},R.createElement(kr,{pageId:r,onPress:qe}),R.createElement(da,{pageId:r,community:e}),R.createElement(vg,{pageId:r,onSubmit:x(De),isValid:b.text.length>0||I.length>0||N.length>0})),R.createElement(Qi,{onChange:ir,communityId:o,mentionContainer:pe.current,dataValue:{data:{text:b.text}}}),R.createElement(Ig,{files:L,uploadedFiles:I,uploadLoading:B,onLoadingChange:$,onChange:({uploaded:ce,uploading:ue})=>{w(ce),D(ue);},onError:ae,isErrorUpload:V}),R.createElement(wg,{files:U,uploadedFiles:N,uploadLoading:B,onLoadingChange:$,onChange:({uploaded:ce,uploading:ue})=>{T(ce),Z(ue);},onError:ae,isErrorUpload:V,videoThumbnail:oe,removeThumbnail:Rr}),R.createElement("div",{ref:pe,style:{"--asc-mention-bottom":`${h!=null?h:0}px`},className:Un.mentionTextInput_item})),R.createElement("div",{ref:y}),y.current?Rv.createPortal(R.createElement(Drawer.Root,{snapPoints:[i,a,s,l],activeSnapPoint:u,setActiveSnapPoint:ce=>{typeof ce=="string"&&Dr(ce);},open:f,modal:!1},R.createElement(Drawer.Portal,{container:y.current},R.createElement(Drawer.Content,{className:Un.drawer__content},R.createElement("div",{"data-item-position":u===i,className:Un.createPost__notiWrap},eo&&R.createElement(Os,{content:"Posting...",icon:R.createElement(ga,null),className:Un.createPost__status}),Vt&&R.createElement(Os,{content:"Failed to create post",icon:R.createElement(Y1,{className:Un.createPost_infoIcon}),className:Un.createPost__status,duration:3e3})),R.createElement("div",{ref:v,className:Un.drawerContentContainer,"data-show-detail-media-attachment":en},en?R.createElement(h5,{pageId:r,isVisibleCamera:z,isVisibleImage:F,isVisibleVideo:Q,onVideoFileChange:Hr,onImageFileChange:bn}):R.createElement(y5,{pageId:r,isVisibleCamera:z,isVisibleImage:F,isVisibleVideo:Q,onVideoFileChange:Hr,onImageFileChange:bn}))))),y.current):null)}var ya={editPost:"Id",editPost__topBar:"Rd",editPost__status:"Ud",editPost_infoIcon:"Bd",editPost__notiWrap:"Dd",editPost__formMediaAttachment:"Ke",drawer__content:"Hd",mentionTextInput_item:"Ne"};var LB={editPostButton:"Oe"};function Tg(r){var n=r,{pageId:e="*",componentId:t="*"}=n,o=P(n,["pageId","componentId"]);let i="edit_post_button",{config:a,isExcluded:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:i});return s?null:R.createElement(O,c({style:l,className:LB.editPostButton},o),a.text)}var AB={editPostTitle:"Ld"};function kg({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:n,themeStyles:i}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement("div",{style:i,className:AB.editPostTitle},r.text)}var Ime=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return _(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},DB=Ime;var A1={thumbnail__container:"b",thumbnail__wrapper:"Pe",thumbnail:"Td",thumbnail__closeButton:"Vd",thumbnail__closeIcon:"qd",icon__status:"Gd",playIcon:"Jd"};var Mme=({fieldId:e,onRemove:t,type:o})=>{let r=nt({fileId:e});return r?R.createElement(R.Fragment,null,R.createElement("img",{className:A1.thumbnail,src:r,alt:"thumbnail"}),R.createElement(O,{type:"reset",onPress:()=>t(),className:A1.thumbnail__closeButton},R.createElement(Po,{className:A1.thumbnail__closeIcon})),o===PostContentType.VIDEO&&R.createElement("div",{className:A1.playIcon,"data-image":"test"},R.createElement(Mo,null))):null},Ng=({postMedia:e,onRemove:t})=>e.length==0?null:R.createElement("div",{"data-images-amount":Math.min(e.length,3),className:A1.thumbnail__container},e==null?void 0:e.map((o,r)=>R.createElement("div",{key:r,"data-images-height":e.length>2,className:A1.thumbnail__wrapper},R.createElement(Mme,{type:o.dataType,key:r,fieldId:o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.thumbnailFileId,onRemove:()=>t(o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.videoFileId.original)}))));var Eg=(e,t)=>{if(e.length!==t.length)return !1;let o=[...e].sort(),r=[...t].sort();for(let n=0;n<o.length;n++)if(o[n]!==r[n])return !1;return !0};function Bg({post:e}){var $,G,q;let t="post_composer_page",{themeStyles:o}=Ye({pageId:t}),{onBack:r}=Be(),{confirm:n}=Re(),{updateItem:i}=bs(),[a,s]=useState({text:($=e.data.text)!=null?$:"",mentioned:((G=e.metadata)==null?void 0:G.mentioned)||[],mentionees:e.mentionees,attachments:[{fileId:"",type:"image"}]}),[l,d]=useState([]),[p,u]=useState([]),[g,f]=useState([]),[y,v]=useState([]),C=useRef(null),h=()=>useMutation({mutationFn:z=>_(this,null,function*(){return yield PostRepository.editPost(e.postId,z)}),onSuccess:z=>{r(),i(z.data);},onError:z=>{console.error("Failed to edit post",z);}}),{mutateAsync:x,isPending:b,isError:M}=h(),{handleSubmit:I}=useForm(),w=DB((e==null?void 0:e.children)||[]);useEffect(()=>{let z=w.filter(F=>F.dataType==="image");f(z),d(z);let H=w.filter(F=>F.dataType==="video");v(H),u(H);},[w]);let N=z=>{d(H=>H.filter(F=>F.data.fileId!==z));},T=z=>{u(H=>H.filter(F=>F.data.videoFileId.original!==z));},L=()=>{var j,Q;let z=l.map(k=>({fileId:k.data.fileId,type:PostContentType.IMAGE})),H=p.map(k=>({fileId:k.data.videoFileId.original,type:"video"})),F=[...z,...H];a&&x({data:{text:a.text},metadata:{mentioned:(j=a.mentioned)!=null?j:[]},mentionees:(Q=a.mentionees)!=null?Q:[],attachments:F});},D=z=>{s(H=>E(c({},H),{mentioned:z.mentioned,text:z.text,mentionees:z.mentionees}));},U=()=>{n({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{r();},okText:"Discard",cancelText:"Keep editing"});},Z=!Eg(g,l),B=!Eg(y,p);return R.createElement("div",{className:ya.editPost,style:o},R.createElement("form",{onSubmit:I(L),className:ya.editPost__formMediaAttachment},R.createElement("div",{className:ya.editPost__topBar},R.createElement(kr,{pageId:t,onPress:U}),R.createElement(kg,{pageId:t}),R.createElement(Tg,{pageId:t,type:"submit",onPress:()=>I(L),isDisabled:e.data.text==a.text&&!Z&&!B||!(a.text.length>0||l.length>0||p.length>0)})),R.createElement(Qi,{communityId:e.targetType==="community"?e.targetId:void 0,onChange:D,mentionContainer:C.current,dataValue:{data:{text:e.data.text},metadata:{mentioned:((q=e.metadata)==null?void 0:q.mentioned)||[]},mentionees:e.mentionees}}),R.createElement(Ng,{postMedia:l,onRemove:N}),R.createElement(Ng,{postMedia:p,onRemove:T}),R.createElement("div",{ref:C,className:ya.mentionTextInput_item}),R.createElement("div",{className:ya.editPost__notiWrap},b&&R.createElement(Os,{content:"Posting...",icon:R.createElement(ga,null),className:ya.editPost__status}),M&&R.createElement(Os,{content:"Failed to edit post",icon:R.createElement(Gt,{className:ya.editPost_infoIcon}),className:ya.editPost__status,duration:3e3}))))}var Eme=e=>e.mode==="create";function Lg(e){if(Eme(e)){let{targetId:t,targetType:o,community:r}=e;return R.createElement(_g,{mode:"create",targetId:t,targetType:o,community:r})}else {let{post:t}=e;return R.createElement(Bg,{mode:"edit",post:t})}}var Ame=e=>R.createElement("svg",c({width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M18.3804 2.25391C19.2593 3.13281 19.2593 4.53906 18.3804 5.41797L15.7437 8.05469L14.5483 9.25L5.97021 17.8281L1.9624 18.25C1.92725 18.25 1.89209 18.25 1.85693 18.25C1.36475 18.25 0.978027 17.8281 1.04834 17.3359L1.47021 13.3281L10.0483 4.75L11.2437 3.55469L13.8804 0.917969C14.3022 0.496094 14.8999 0.25 15.4624 0.25C16.0249 0.25 16.6226 0.496094 17.0444 0.917969L18.3804 2.25391ZM5.19678 16.2109L13.353 8.08984L14.4429 7L12.2983 4.85547L11.2085 5.94531L3.0874 14.1016L2.84131 16.457L5.19678 16.2109ZM17.1851 4.22266C17.396 4.01172 17.396 3.66016 17.1851 3.44922L15.8491 2.11328C15.7085 1.97266 15.5327 1.9375 15.4624 1.9375C15.3921 1.9375 15.2163 1.97266 15.0757 2.11328L13.4937 3.66016L15.6382 5.80469L17.1851 4.22266Z"})),Dme=e=>R.createElement("svg",c({width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M15.3608 3.0625C15.6421 3.0625 15.9233 3.34375 15.9233 3.625V4.1875C15.9233 4.50391 15.6421 4.75 15.3608 4.75H14.7983L14.0249 16.668C13.9897 17.5469 13.2163 18.25 12.3374 18.25H3.72412C2.84521 18.25 2.07178 17.5469 2.03662 16.668L1.29834 4.75H0.73584C0.419434 4.75 0.17334 4.50391 0.17334 4.1875V3.625C0.17334 3.34375 0.419434 3.0625 0.73584 3.0625H3.61865L4.81396 1.09375C5.09521 0.636719 5.72803 0.25 6.25537 0.25H9.80615C10.3335 0.25 10.9663 0.636719 11.2476 1.09375L12.4429 3.0625H15.3608ZM6.25537 1.9375L5.5874 3.0625H10.4741L9.80615 1.9375H6.25537ZM12.3374 16.5625L13.0757 4.75H2.98584L3.72412 16.5625H12.3374Z"})),Hme=e=>R.createElement("svg",c({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M12.3125 3.0625C13.543 3.0625 14.8789 2.64062 16.1445 2.07812C17.2344 1.62109 18.5 2.42969 18.5 3.625V12.0625C18.5 12.6602 18.1836 13.1875 17.7266 13.5039C16.7773 14.1016 15.2656 14.875 13.1914 14.875C10.8008 14.875 9.21875 13.75 7.49609 13.75C5.52734 13.75 4.33203 14.1719 3.03125 14.7695V17.6875C3.03125 18.0039 2.75 18.25 2.46875 18.25H1.90625C1.58984 18.25 1.34375 18.0039 1.34375 17.6875V3.41406C0.816406 3.13281 0.5 2.57031 0.5 1.9375C0.5 0.988281 1.30859 0.214844 2.29297 0.285156C3.10156 0.320312 3.76953 0.953125 3.83984 1.76172C3.83984 1.79688 3.875 1.90234 3.875 1.9375C3.875 2.11328 3.80469 2.35938 3.76953 2.5C4.54297 2.18359 5.49219 1.9375 6.61719 1.9375C9.00781 1.9375 10.5898 3.0625 12.3125 3.0625ZM16.8125 12.0625V3.625C15.6875 4.15234 13.8242 4.75 12.3125 4.75C10.2031 4.75 8.72656 3.625 6.61719 3.625C5.14062 3.625 3.76953 4.22266 3.03125 4.75V12.9062C4.12109 12.4141 5.98438 12.0625 7.49609 12.0625C9.60547 12.0625 11.082 13.1875 13.1914 13.1875C14.668 13.1875 16.0391 12.625 16.8125 12.0625Z"})),S5=({post:e,pageId:t="*",componentId:o="*",elementId:r="*",onCloseMenu:n,onPostDeleted:i})=>{let{success:a,error:s}=_o(),l=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:d}=Pt({communityId:e==null?void 0:e.targetId,shouldCall:l}),{isCommunityModerator:p,isOwner:u}=MB({post:e,community:d}),{AmityPostContentComponentBehavior:g}=bt(),{removeDrawerData:f}=Wm(),{showEditPostButton:y,showDeletePostButton:v,showReportPostButton:C}=useMemo(()=>p?u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[p,u]),{isFlaggedByMe:h,isLoading:x,mutateReportPost:b,mutateUnReportPost:M}=_B({post:e,isFlaggable:C,onReportSuccess:()=>{a({content:"Post reported."});},onReportError:()=>{s({content:"Failed to report post."});},onUnreportSuccess:()=>{a({content:"Post unreported."});},onUnreportError:()=>{s({content:"Failed to unreport post."});}}),{confirm:I}=Re(),{mutateAsync:w}=useMutation({mutationFn:()=>_(void 0,null,function*(){return n(),PostRepository.hardDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted."}),i==null||i(e);},onError:()=>{s({content:"Failed to delete post."});}}),N=()=>{n(),I({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>w(),pageId:t,componentId:o});};return R.createElement("div",{className:zn.postMenu},C&&!x?R.createElement(O,{className:zn.postMenu__item,onPress:()=>{h?M():b(),f();}},R.createElement(Hme,{className:zn.postMenu__reportPost__icon}),R.createElement(S.Title,{className:zn.postMenu__reportPost__text},h?"Unreport post":"Report post")):null,y?R.createElement(O,{className:zn.postMenu__item,onPress:()=>{var T;f(),(T=g==null?void 0:g.goToPostComposerPage)==null||T.call(g,{mode:"edit",post:e});}},R.createElement(Ame,{className:zn.postMenu__editPost__icon}),R.createElement(S.Title,{className:zn.postMenu__editPost__text},"Edit post")):null,v?R.createElement(O,{className:zn.postMenu__item,onPress:()=>N()},R.createElement(Dme,{className:zn.postMenu__deletePost__icon}),R.createElement(S.Title,{className:zn.postMenu__deletePost__text},"Delete post")):null)};var UB=({post:e,community:t})=>{let{currentUserId:o}=Ae(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:n}=nm({communityId:t==null?void 0:t.communityId,shouldCall:r}),i=useMemo(()=>r?n.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[n,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:i,isOwner:a}};var $B=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let n=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return n.observe(t.current),()=>{n.disconnect();}},[e,t]),{isVisible:o}};var VB={announcementBadge:"Kd"};var Ag={featuredIcon__background:"Nd",featuredIcon__textColor:"Od"};var jB=r=>{var n=r,{backgroundColor:e,textColor:t}=n,o=P(n,["backgroundColor","textColor"]);return R.createElement("svg",c({width:"73",height:"26",viewBox:"0 0 73 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),R.createElement("path",{d:"M0 0H69C71.2091 0 73 1.79086 73 4V22C73 24.2091 71.2091 26 69 26H0V0Z",className:Ag.featuredIcon__background,fill:e}),R.createElement("path",{d:"M9.12988 18V8.84033H14.9697V10.2178H10.7676V12.9282H14.6079V14.2612H10.7676V18H9.12988ZM19.5108 18.1396C17.4478 18.1396 16.1973 16.7559 16.1973 14.5469V14.5405C16.1973 12.3569 17.4605 10.9287 19.4346 10.9287C21.4088 10.9287 22.6275 12.3125 22.6275 14.4072V14.9277H17.7779C17.797 16.1719 18.4698 16.8955 19.5426 16.8955C20.3995 16.8955 20.8883 16.4639 21.0406 16.1465L21.0596 16.1021H22.564L22.545 16.1592C22.3228 17.0542 21.3961 18.1396 19.5108 18.1396ZM19.4537 12.1665C18.5714 12.1665 17.9112 12.7632 17.7906 13.8677H21.085C20.9771 12.7314 20.336 12.1665 19.4537 12.1665ZM26.0197 18.1143C24.6994 18.1143 23.7409 17.3018 23.7409 16.0386V16.0259C23.7409 14.7881 24.6867 14.0645 26.3752 13.9629L28.1588 13.855V13.2583C28.1588 12.5664 27.7082 12.1855 26.8576 12.1855C26.1339 12.1855 25.6642 12.4458 25.5055 12.9028L25.4992 12.9282H24.0075L24.0138 12.8711C24.1662 11.7031 25.2834 10.9287 26.9338 10.9287C28.7174 10.9287 29.7204 11.792 29.7204 13.2583V18H28.1588V17.0479H28.0509C27.6701 17.7207 26.9338 18.1143 26.0197 18.1143ZM25.3024 15.9624C25.3024 16.5527 25.8039 16.9019 26.5021 16.9019C27.4543 16.9019 28.1588 16.2798 28.1588 15.4546V14.896L26.5973 14.9976C25.715 15.0547 25.3024 15.3784 25.3024 15.9497V15.9624ZM34.2678 18.0317C32.6746 18.0317 32.0207 17.4985 32.0207 16.1592V12.2871H30.9416V11.062H32.0207V9.36084H33.6267V11.062H35.093V12.2871H33.6267V15.7847C33.6267 16.4766 33.8996 16.7686 34.5598 16.7686C34.782 16.7686 34.9026 16.7622 35.093 16.7432V17.9619C34.8645 18.0063 34.5725 18.0317 34.2678 18.0317ZM38.8851 18.1396C37.3236 18.1396 36.5238 17.2002 36.5238 15.5498V11.062H38.1043V15.188C38.1043 16.2607 38.5042 16.8066 39.4564 16.8066C40.4783 16.8066 41.0242 16.1465 41.0242 15.1055V11.062H42.6048V18H41.0242V16.9463H40.9163C40.5926 17.689 39.888 18.1396 38.8851 18.1396ZM44.4545 18V11.062H46.0351V12.1284H46.143C46.3778 11.3857 47.0126 10.9478 47.9267 10.9478C48.1679 10.9478 48.4154 10.9795 48.5678 11.0239V12.4395C48.3139 12.3887 48.0536 12.3506 47.7807 12.3506C46.727 12.3506 46.0351 12.979 46.0351 13.9692V18H44.4545ZM52.5757 18.1396C50.5127 18.1396 49.2622 16.7559 49.2622 14.5469V14.5405C49.2622 12.3569 50.5254 10.9287 52.4995 10.9287C54.4736 10.9287 55.6924 12.3125 55.6924 14.4072V14.9277H50.8428C50.8618 16.1719 51.5346 16.8955 52.6074 16.8955C53.4643 16.8955 53.9531 16.4639 54.1054 16.1465L54.1245 16.1021H55.6289L55.6098 16.1592C55.3877 17.0542 54.4609 18.1396 52.5757 18.1396ZM52.5185 12.1665C51.6362 12.1665 50.9761 12.7632 50.8554 13.8677H54.1499C54.042 12.7314 53.4009 12.1665 52.5185 12.1665ZM59.6939 18.1143C57.9546 18.1143 56.8502 16.7368 56.8502 14.5405V14.5278C56.8502 12.3188 57.9356 10.9478 59.6939 10.9478C60.6461 10.9478 61.4395 11.4175 61.8013 12.1665H61.9092V8.37695H63.4962V18H61.9092V16.9146H61.8013C61.4205 17.6699 60.6714 18.1143 59.6939 18.1143ZM60.189 16.7812C61.2681 16.7812 61.9346 15.9307 61.9346 14.5405V14.5278C61.9346 13.1377 61.2618 12.2808 60.189 12.2808C59.1163 12.2808 58.4561 13.1313 58.4561 14.5278V14.5405C58.4561 15.937 59.1099 16.7812 60.189 16.7812Z",className:Ag.featuredIcon__textColor,fill:t}))};var Fg=({pageId:e="*",componentId:t="*"})=>{let o="announcement_badge",{config:r,isExcluded:n,accessibilityId:i,uiReference:a,defaultConfig:s}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement(ee,{"data-qa-anchor":i,defaultIcon:()=>R.createElement(jB,{className:VB.announcementBadge}),imgIcon:()=>R.createElement("img",{src:r.icon,alt:a}),configIconName:r.icon,defaultIconName:s.icon})};var GB={pinBadge__icon:"Pd"};var QB=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"29",height:"30",fill:"none",viewBox:"0 0 29 30"},e),R.createElement("path",{fill:e.fill,d:"M18.106 16.436c.575 1.547.53 3.27-.596 4.398a.74.74 0 01-1.06 0l-3.006-3.005-2.32 2.32c-.022.022-.067.022-.089.044l-1.59.53c-.2.067-.398-.132-.332-.331l.53-1.591.066-.066 2.32-2.32-3.005-3.006a.722.722 0 010-1.06c1.105-1.105 2.829-1.194 4.376-.62l2.917-2.342-.929-.928a.722.722 0 010-1.06l1.061-1.06a.74.74 0 011.06 0l6.011 6.01a.76.76 0 010 1.06l-1.06 1.06a.74.74 0 01-1.061 0l-.95-.95-2.343 2.917z"}));var zg=({pageId:e,componentId:t})=>{let o="pin_badge",{config:r,isExcluded:n,accessibilityId:i,uiReference:a,defaultConfig:s}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement(ee,{"data-qa-anchor":i,defaultIcon:()=>R.createElement(QB,{className:GB.pinBadge__icon}),imgIcon:()=>R.createElement("img",{src:r.icon,alt:a}),defaultIconName:s.icon,configIconName:r.icon})};var Zme=({pageId:e,post:t,hideTarget:o})=>{var s;let r=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:n}=Pt({communityId:t==null?void 0:t.targetId,shouldCall:r}),{goToCommunityProfilePage:i,onClickUser:a}=Be();return n?R.createElement("div",{className:ye.postTitle},t.creator&&R.createElement("div",{className:ye.postTitle__user__container},R.createElement(S.BodyBold,{className:ye.postTitle__text},R.createElement(O,{onPress:()=>a(t.creator.userId)},"aensuthasneuthasnetusantheusnatheusnthasenuthasnteuhsanteuhsnatehusntaheusntaheu")),t.creator.isBrand?null:R.createElement(Zc,{className:ye.postTitle__brandIcon}),n?R.createElement(Yc,{className:ye.postTitle__icon}):null),n&&!o&&R.createElement(R.Fragment,null,R.createElement(O,{onPress:()=>{i(n.communityId);}},R.createElement(S.BodyBold,{className:ye.postTitle__text},n.displayName)))):R.createElement("div",{className:ye.postTitle__user__container},R.createElement(O,{onPress:()=>t.creator&&a(t.creator.userId)},R.createElement(S.BodyBold,{className:ye.postTitle__text},(s=t.creator)==null?void 0:s.displayName)),t.creator.isBrand?null:R.createElement(Zc,{className:ye.postTitle__brandIcon}))};var Qme=({post:e,onImageClick:t,onVideoClick:o})=>R.createElement(R.Fragment,null,R.createElement(yg,{post:e,onImageClick:t}),R.createElement(hg,{post:e,onVideoClick:o})),fn=({pageId:e="*",post:t,onClick:o,onPostDeleted:r,category:n,hideMenu:i=!1,hideTarget:a=!1,style:s})=>{var Dr,qe,Rr,bn,Hr,en,ce;let l="post_content",{themeStyles:d}=te({pageId:e,componentId:l}),{post:p}=Ii(t==null?void 0:t.postId),{setDrawerData:u,removeDrawerData:g}=Wm(),[f,y]=useState(!1),[v,C]=useState(!1),[h,x]=useState(!1),[b,M]=useState(null),[I,w]=useState(null),[N,T]=useState(null),[L,D]=useState(0),{page:U}=Be(),Z=useRef(null),B=useMemo(()=>{if(t!=null&&p!=null)return dn(t==null?void 0:t.updatedAt).unix()>dn(p==null?void 0:p.updatedAt).unix()?t:p;if(p!=null)return p;if(t!=null)return t},[t,p]);Ac({postId:B==null?void 0:B.postId,level:SubscriptionLevels.POST,shouldSubscribe:f});let $=useMemo(()=>(B==null?void 0:B.targetType)==="community",[B==null?void 0:B.targetType]),{community:G}=Pt({communityId:B==null?void 0:B.targetId,shouldCall:$}),{isCommunityModerator:q}=UB({post:B,community:G});useEffect(()=>{var ue;B!=null&&T(((ue=B.myReactions)==null?void 0:ue[0])||null);},[B==null?void 0:B.myReactions]),useEffect(()=>{B!=null&&D((B==null?void 0:B.reactionsCount)||0);},[B==null?void 0:B.reactionsCount]);let {mutateAsync:z}=useMutation({mutationFn:ue=>_(void 0,null,function*(){if(N&&N!==ue)try{yield ReactionRepository.removeReaction("post",B==null?void 0:B.postId,N);}catch(tn){console.log();}return ReactionRepository.addReaction("post",B==null?void 0:B.postId,ue)}),onMutate:ue=>{y(!0),D(L+1),T(ue);}}),{mutateAsync:H}=useMutation({mutationFn:ue=>_(void 0,null,function*(){return ReactionRepository.removeReaction("post",B==null?void 0:B.postId,ue)}),onMutate:()=>{y(!0),D(Math.max(0,L-1)),T(null);}}),F=ue=>{N?H(N):z(ue);},j=ue=>{C(!0),M(ue);},Q=()=>{C(!1),M(null);},k=ue=>{x(!0),w(ue);},V=()=>{x(!1),w(null);},pe=((Dr=B==null?void 0:B.reactions)==null?void 0:Dr.like)>0,We=((qe=B==null?void 0:B.reactions)==null?void 0:qe.love)>0,vt=((Rr=B==null?void 0:B.reactions)==null?void 0:Rr.fire)>0,eo=((bn=B==null?void 0:B.reactions)==null?void 0:bn.happy)>0,Vt=((Hr=B==null?void 0:B.reactions)==null?void 0:Hr.crying)>0,De=pe||We||vt||eo||Vt,{isVisible:ir}=$B({threshold:.6,elementRef:Z});return useEffect(()=>{var ue;U.type!=="PostDetailPage"&&ir&&((ue=B.analytics)==null||ue.markAsViewed());},[B,ir,U.type]),R.createElement("div",{ref:Z,className:ye.postContent,style:d},(n==="announcement"||n==="pin_and_announcement")&&R.createElement(Fg,{pageId:e,componentId:l}),R.createElement("div",{className:ye.postContent__bar,"data-type":s},R.createElement("div",{className:ye.postContent__bar__userAvatar},R.createElement(jo,{userId:B==null?void 0:B.postedUserId})),R.createElement("div",{className:ye.postContent__bar__detail},R.createElement("div",null,R.createElement(Zme,{post:B,hideTarget:a})),R.createElement("div",{className:ye.postContent__bar__information__subtitle},q?R.createElement("div",{className:ye.postContent__bar__information__subtitle__moderator},R.createElement(w1,{pageId:e,componentId:l}),R.createElement("span",{className:ye.postContent__bar__information__subtitle__separator},"\u2022")):null,R.createElement(M1,{timestamp:B.createdAt}),B.createdAt!==B.editedAt&&R.createElement(S.Caption,{className:ye.postContent__bar__information__editedTag},"(edited)"))),R.createElement("div",{className:ye.postContent__wrapRightMenu},(n==="pin"||n==="pin_and_announcement")&&R.createElement(zg,{pageId:e,componentId:l}),s==="feed"?R.createElement("div",{className:ye.postContent__bar__actionButton},!i&&R.createElement(Xc,{pageId:e,componentId:l,onClick:()=>u({content:R.createElement(S5,{post:B,onCloseMenu:()=>g(),pageId:e,componentId:l,onPostDeleted:r})})})):null)),R.createElement("div",{className:ye.postContent__content_and_reactions},R.createElement("div",{className:ye.postContent__content},R.createElement(fg,{text:(en=B==null?void 0:B.data)==null?void 0:en.text,mentioned:(ce=B==null?void 0:B.metadata)==null?void 0:ce.mentioned,mentionees:B==null?void 0:B.mentioness}),B.children.length>0?R.createElement(Qme,{post:B,onImageClick:j,onVideoClick:k}):null),s==="detail"?R.createElement("div",{className:ye.postContent__reactions_and_comments},R.createElement("div",{className:ye.postContent__reactionsBar,onClick:()=>u({content:R.createElement(Fm,{pageId:e,referenceId:B.postId,referenceType:"post"})})},De?R.createElement("div",{className:ye.postContent__reactionsBar__reactions},Vt&&R.createElement(dB,{className:ye.postContent__reactionsBar__reactions__icon}),eo&&R.createElement(pB,{className:ye.postContent__reactionsBar__reactions__icon}),vt&&R.createElement(uB,{className:ye.postContent__reactionsBar__reactions__icon}),We&&R.createElement(gB,{className:ye.postContent__reactionsBar__reactions__icon}),pe&&R.createElement(fB,{className:ye.postContent__reactionsBar__reactions__icon})):null,R.createElement(S.Caption,{className:ye.postContent__reactionsBar__reactions__count},`${ib((B==null?void 0:B.reactionsCount)||0)} ${(B==null?void 0:B.reactionsCount)===1?"like":"likes"}`)),R.createElement(S.Caption,{className:ye.postContent__commentsCount},`${(B==null?void 0:B.commentsCount)||0} ${(B==null?void 0:B.commentsCount)===1?"comment":"comments"}`)):null,!(G!=null&&G.isJoined)&&U.type==="CommunityProfilePage"?R.createElement(R.Fragment,null,R.createElement(S.Body,{className:ye.postContent__notMember},"Join community to interact with all posts")):!(G!=null&&G.isJoined)&&U.type==="PostDetailPage"?null:R.createElement(R.Fragment,null,R.createElement("div",{className:ye.postContent__divider}),R.createElement("div",{className:ye.postContent__reactionBar},R.createElement("div",{className:ye.postContent__reactionBar__leftPane},R.createElement(U3,{pageId:e,componentId:l,reactionsCount:s==="feed"?L:void 0,myReaction:N,defaultIconClassName:ye.postContent__reactionBar__leftPane__icon,imgIconClassName:ye.postContent__reactionBar__leftPane__iconImg,onReactionClick:F}),R.createElement(dg,{pageId:e,componentId:l,commentsCount:s==="feed"?B.commentsCount:void 0,defaultIconClassName:ye.postContent__reactionBar__leftPane__icon,imgIconClassName:ye.postContent__reactionBar__leftPane__iconImg,onPress:()=>o==null?void 0:o()})),R.createElement("div",{className:ye.postContent__reactionBar__rightPane},R.createElement(cg,{pageId:e,componentId:l}))))),v&&typeof b=="number"?R.createElement(xB,{post:B,onClose:Q,initialImageIndex:b}):null,h&&typeof I=="number"?R.createElement(IB,{post:B,onClose:V,initialVideoIndex:I}):null)};var Nt={postContentSkeleton:"Qd",postContentSkeleton__bar:"Wd",postContentSkeleton__bar__information:"Zd",postContentSkeleton__content:"_d",postContentSkeleton__animation:"e0","skeleton-pulse":"Qe",postContentSkeleton__bar__userAvatar:"r0",postContentSkeleton__bar__information__title:"a0",postContentSkeleton__bar__information__subtitle:"o0",postContentSkeleton__content__bar1:"t0",postContentSkeleton__content__bar2:"i0",postContentSkeleton__content__bar3:"l0"};var rd=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return R.createElement("div",{"data-qa-anchor":o,style:s,className:cr(Nt.postContentSkeleton,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__userAvatar,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information__title,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information__subtitle,Nt.postContentSkeleton__animation)}))),R.createElement("div",{className:cr(Nt.postContentSkeleton__content,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar1,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar2,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar3,Nt.postContentSkeleton__animation)})))};function H1({queryParams:e,shouldCall:t=!0}){let n=dt({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=P(n,["items"]);return c({communities:o},r)}var KB={myCommunitiesList:"s0"};var N5=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=te({pageId:e,componentId:t}),{communities:r,hasMore:n,loadMore:i,isLoading:a}=H1({queryParams:{sortBy:"displayName",limit:20,membership:"member"}});return R.createElement("div",{style:o,className:KB.myCommunitiesList},R.createElement(hs,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{n&&a===!1&&i();}}))};var Jme=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},R.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),R.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),R.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),R.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),R.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),R.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),R.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Xme=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},R.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),R.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),jg=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:d}=A({pageId:e,componentId:t,elementId:o});return s?null:R.createElement(ee,{defaultIconName:a.icon,configIconName:i.icon,imgIcon:()=>R.createElement("img",{src:i.icon,alt:l,"data-qa-anchor":n}),defaultIcon:()=>R.createElement("div",{"data-qa-anchor":n},r==="light"?R.createElement(Xme,null):R.createElement(Jme,null))})};var XB={description:"c0"};function Gg({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement(S.Caption,{className:XB.description,style:l,"data-qa-anchor":r},n.text)}var YB={title:"n0"};function F1({pageId:e="*",componentId:t="*",titleClassName:o}){let r="title",{accessibilityId:n,config:i,isExcluded:a,themeStyles:s}=A({pageId:e,componentId:t,elementId:r});return a?null:R.createElement(S.Title,{className:cr(YB.title,o),style:s,"data-qa-anchor":n},i.text)}var E5={exploreCommunitiesButton:"d0",exploreCommunitiesButton__icon:"m0",exploreCommunitiesButton__text:"p0"};var n2e=e=>R.createElement("svg",c({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function Zg({pageId:e="*",componentId:t="*"}){let o="explore_communities_button",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement("div",{className:E5.exploreCommunitiesButton,"data-qa-anchor":r,style:l},R.createElement(n2e,{className:E5.exploreCommunitiesButton__icon}),R.createElement(S.BodyBold,{className:E5.exploreCommunitiesButton__text},n.text))}var RB={createCommunityButton:"g0"};function Qg({pageId:e="*",componentId:t="*",onClick:o}){let r="create_community_button",{accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:d}=A({pageId:e,componentId:t,elementId:r});return s?null:R.createElement("div",{className:RB.createCommunityButton,onClick:()=>o(),"data-qa-anchor":n,style:d},R.createElement(ee,{defaultIcon:()=>R.createElement(R.Fragment,null),imgIcon:()=>R.createElement("img",{src:i.icon,alt:l}),configIconName:i.icon,defaultIconName:a.icon}),R.createElement(S.Body,null,i.text))}var Wg={emptyNewsfeed:"h0",emptyNewsfeed__text:"f0"};function Jm({pageId:e="*"}){let t="empty_newsfeed",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return i?null:R.createElement("div",{className:Wg.emptyNewsfeed},R.createElement(jg,{pageId:e,componentId:t}),R.createElement("div",{className:Wg.emptyNewsfeed__text},R.createElement(F1,{pageId:e,componentId:t}),R.createElement(Gg,{pageId:e,componentId:t})),R.createElement(Zg,{pageId:e,componentId:t}),R.createElement(Qg,{pageId:e,componentId:t,onClick:()=>{}}))}var z1={global_feed:"b0",global_feed__postContainer:"u0",global_feed__postSkeletonContainer:"v0",global_feed__pullToRefresh:"x0",global_feed__post__reactionBar__leftPane__icon:"w0",global_feed__post__reactionBar__leftPane__iconImg:"y0",global_feed__pullToRefresh__spinner:"k0",spin:"We",global_feed__divider:"j0",global_feed__post__divider:"z0",global_feed__post__reactionBar:"X0",global_feed__post__reactionBar__leftPane:"Y0",global_feed__post__reactionBar__rightPane:"C0",global_feed__intersection:"A0",global_feed__commentContainer:"M0"};var Kt={container:"S0",innerContainer:"E0",header:"F0",header__title:"I0",header__avatar:"R0",header__detail:"U0",content__text:"B0",content__imageContainer:"D0",content__image:"H0",footer:"Ze",footer__content__description:"L0",footer__content__headline:"T0",footer__left:"V0",footer__right:"q0",footer__content__button:"G0",footer__content__button__text:"J0",infoIcon__button:"K0",infoIcon:"N0"};var tL=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:n})=>{var l;let[i,a]=useState(!1),s=()=>{n==null||n(e.callToActionUrl);};return R.createElement("div",{className:Kt.container,style:r},R.createElement("div",{className:Kt.innerContainer},R.createElement("div",{className:Kt.header},R.createElement("div",{className:Kt.header__avatar},R.createElement(xt,{avatarUrl:t,defaultImage:R.createElement(Lm,null)})),R.createElement("div",{className:Kt.header__detail},R.createElement(S.BodyBold,{className:Kt.header__title},(l=e.advertiser)==null?void 0:l.name),R.createElement(Bm,null))),R.createElement("div",null,R.createElement(S.Body,{className:Kt.content__text},e.body),R.createElement("div",{className:Kt.content__imageContainer},R.createElement("img",{className:Kt.content__image,src:o})))),R.createElement(O,{className:Kt.infoIcon__button,onPress:()=>a(!0)},R.createElement(pn,{className:Kt.infoIcon})),R.createElement(O,{className:Kt.footer,"data-has-url":!!e.callToActionUrl,onPress:s},R.createElement("div",{className:Kt.footer__left},R.createElement(S.Body,{renderer:({typoClassName:d})=>R.createElement("div",{className:cr(d,Kt.footer__content__description)},e.description)}),R.createElement(S.BodyBold,{className:Kt.footer__content__headline},e.headline)),e.callToActionUrl?R.createElement("div",{className:Kt.footer__right},R.createElement(O,{className:Kt.footer__content__button,onPress:s},R.createElement(S.CaptionBold,{renderer:({typoClassName:d})=>R.createElement("div",{className:cr(d,Kt.footer__content__button__text)},e.callToAction)}))):null),R.createElement(R3,{ad:e,isOpen:i,onOpenChange:d=>a(d)}))};var oL=({pageId:e="*",ad:t})=>{var d,p,u,g,f,y;let o="post_content",{themeStyles:r}=te({pageId:e,componentId:o}),i=nt({fileId:(p=(d=t.advertiser)==null?void 0:d.avatar)==null?void 0:p.fileId})||((g=(u=t.advertiser)==null?void 0:u.avatar)==null?void 0:g.fileUrl)||"",s=nt({fileId:(f=t.image1_1)==null?void 0:f.fileId})||((y=t.image1_1)==null?void 0:y.fileUrl)||"";return R.createElement(tL,{themeStyles:r,avatarUrl:i,adImageUrl:s,ad:t,onCallToActionClick:v=>{window==null||window.open(v,"_blank");}})};var qg=e=>(e==null?void 0:e.adId)!==void 0,B5=({pageId:e="*",componentId:t="*",items:o,isLoading:r,onFeedReachBottom:n,onPostDeleted:i})=>{let{accessibilityId:a,themeStyles:s}=te({pageId:e,componentId:t}),[l,d]=useState(null),{AmityGlobalFeedComponentBehavior:p}=bt();if(So({node:l,onIntersect:()=>{n();}}),o.length===0&&!r)return R.createElement(Jm,{pageId:e});let u=(g,f)=>qg(g)?f&&qg(f)?`${f.adId}-${g.adId}`:`${f.postId}-${g.adId}`:g.postId;return R.createElement("div",{className:z1.global_feed,style:s,"data-qa-anchor":a},o.map((g,f)=>R.createElement("div",{key:u(g,o[Math.max(0,f-1)])},f!==0?R.createElement("div",{className:z1.global_feed__divider}):null,qg(g)?R.createElement(oL,{ad:g}):R.createElement(O,{className:z1.global_feed__postContainer,onPress:()=>{var y;return (y=p==null?void 0:p.goToPostDetailPage)==null?void 0:y.call(p,{postId:g.postId})}},R.createElement(fn,{pageId:e,post:g,category:"general",style:"feed",onClick:()=>{var y;(y=p==null?void 0:p.goToPostDetailPage)==null||y.call(p,{postId:g.postId});},onPostDeleted:i})))),r?Array.from({length:2}).map((g,f)=>R.createElement("div",{key:f},R.createElement("div",{className:z1.global_feed__divider}),R.createElement("div",{className:z1.global_feed__postSkeletonContainer},R.createElement(rd,null)))):null,!r&&R.createElement("div",{ref:g=>d(g),className:z1.global_feed__intersection}))};var Xm={newsfeed:"O0",newsfeed__postList:"P0",newsfeed__postContainer:"Q0",newsfeed__pullToRefresh:"W0",newsfeed__post__reactionBar__leftPane__icon:"Z0",newsfeed__post__reactionBar__leftPane__iconImg:"_0",newsfeed__pullToRefresh__spinner:"em",spin:"_e",newsfeed__divider:"rm",newsfeed__post__divider:"am",newsfeed__post__reactionBar:"om",newsfeed__post__reactionBar__leftPane:"tm",newsfeed__post__reactionBar__rightPane:"im",newsfeed__intersection:"lm"};var y2e=e=>R.createElement("div",{className:Xm.newsfeed__pullToRefresh__spinner},R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),R.createElement("defs",null,R.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},R.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),R.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"}))))),L5=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=te({pageId:e,componentId:t}),r=useRef(0),[n,i]=useState(0),{itemWithAds:a,hasMore:s,isLoading:l,loadMore:d,fetch:p,refetch:u,removeItem:g}=bs();useEffect(()=>{p();},[]);let f=()=>{s&&!l&&d();};return a.length===0&&!l?R.createElement(Jm,{pageId:e}):R.createElement("div",{className:Xm.newsfeed,style:o,onDrag:y=>y.stopPropagation(),onTouchStart:y=>{r.current=y.touches[0].clientY;},onTouchMove:y=>{let v=y.touches[0].clientY;r.current>v||i(Math.min(v-r.current,100));},onTouchEnd:y=>{r.current=0,n>=75&&u(),i(0);}},R.createElement("div",{style:{"--asc-pull-to-refresh-height":`${n}px`},className:Xm.newsfeed__pullToRefresh},R.createElement(y2e,null)),R.createElement("div",{className:Xm.newsfeed__divider}),R.createElement(Um,{type:"globalFeed",pageId:e}),a.length>0&&R.createElement("div",{className:Xm.newsfeed__divider}),R.createElement(B5,{isLoading:l,items:a,pageId:e,componentId:t,onFeedReachBottom:()=>f(),onPostDeleted:y=>g(y.postId)}))};var A5={postCreationButton:"sm",postCreationButton__icon:"cm"};var C2e=e=>R.createElement("svg",c({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function Xg({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:n}){let i="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(ee,{defaultIcon:()=>R.createElement(O,{style:u,className:A5.postCreationButton,onPress:n,"data-qa-anchor":a},R.createElement(C2e,{className:cr(A5.postCreationButton__icon,o)})),imgIcon:()=>R.createElement("img",{src:s.icon,alt:p,className:cr(A5.postCreationButton,r),onClick:n,"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon})}var id={globalSearchButton:"nm",globalSearchButton__icon:"dm",globalSearchButton__svg:"mm"};var x2e=e=>R.createElement("svg",c({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function Yg({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n}){let i="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{style:u,"data-qa-anchor":a,className:id.globalSearchButton,onPress:n},R.createElement(ee,{defaultIcon:()=>R.createElement("div",{className:id.globalSearchButton__icon},R.createElement(x2e,{className:cr(id.globalSearchButton__svg,o)})),imgIcon:()=>R.createElement("img",{style:u,src:s.icon,alt:p,className:cr(id.globalSearchButton__icon,r),"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon}))}var iL={headerLabel:"pm"};function Rg({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement(S.Heading,{className:iL.headerLabel,style:l,"data-qa-anchor":r},n.text)}var D5={topNavigation:"gm",topNavigationLeftPane:"hm",topNavigationRightPane:"fm"};var $1={socialHomePage:"bm",socialHomePage__topBar:"um",socialHomePage__topNavigation:"vm",socialHomePage__tabs:"er",socialHomePage__contents:"rr",socialHomePage__createPostMenu:"xm"};function ef({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="newsfeed_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}function tf({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="explore_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r(),"data-qa-anchor":i},a.text)}function of({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="my_communities_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}var H5=(r=>(r.Newsfeed="Newsfeed",r.Explore="Explore",r.MyCommunities="My communities",r))(H5||{});function rf(){let e="social_home_page",{themeStyles:t}=Ye({pageId:e}),{scrollPosition:o,onScroll:r}=bs(),[n,i]=useState("Newsfeed"),[a,s]=useState(!1),l=useRef(null),d=useRef(!0);useEffect(()=>{l.current&&(l.current.scrollTop=o,setTimeout(()=>{d.current=!1;},100));},[l.current]);let p=()=>{s(g=>!g);},u=g=>{d.current||r(g);};return useEffect(()=>{let g=()=>{a&&s(!1);};a?document.addEventListener("mousedown",g):document.removeEventListener("mousedown",g);},[a]),R.createElement("div",{className:$1.socialHomePage,style:t},R.createElement("div",{className:$1.socialHomePage__topBar},R.createElement("div",{className:$1.socialHomePage__topNavigation},R.createElement(F5,{pageId:e,selectedTab:n,onClickPostCreationButton:p})),R.createElement("div",{className:$1.socialHomePage__tabs},R.createElement(ef,{pageId:e,isActive:n==="Newsfeed",onClick:()=>i("Newsfeed")}),R.createElement(tf,{pageId:e,isActive:n==="Explore",onClick:()=>i("Explore")}),R.createElement(of,{pageId:e,isActive:n==="My communities",onClick:()=>i("My communities")}))),R.createElement("div",{className:$1.socialHomePage__contents,ref:l,onScroll:u},n==="Newsfeed"&&R.createElement(L5,{pageId:e}),n==="Explore"&&R.createElement(wc,{isOpen:!1,toggleOpen:()=>{},hideSideMenu:!0}),n==="My communities"&&R.createElement(N5,{pageId:e})),a&&R.createElement("div",{className:$1.socialHomePage__createPostMenu},R.createElement(p5,{pageId:e})))}function F5({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:n,goToMyCommunitiesSearchPage:i}=Be(),{isExcluded:a,themeStyles:s}=te({pageId:e,componentId:r}),l=()=>{switch(t){case"Newsfeed":n();break;case"Explore":break;case"My communities":i();break}};return a?null:R.createElement("div",{className:D5.topNavigation,style:s},R.createElement("div",{className:D5.topNavigationLeftPane},R.createElement(Rg,{pageId:e,componentId:r})),R.createElement("div",{className:D5.topNavigationRightPane},R.createElement(Yg,{pageId:e,componentId:r,onPress:l}),t!=="Explore"&&R.createElement(Xg,{pageId:e,componentId:r,onClick:o})))}var ha={container:"wm",headerImageContainer:"ym",headerImage:"km",backButton:"ar",moreButton:"or",content:"jm",name:"zm",description:"Xm",communityProfile__communityInfo__container:"Ym",divider:"Cm",statCount:"Am",statTitle:"Mm",menuButton:"Sm",communityProfile__joinButton__container:"Em",communityProfile__joinButton:"Fm",communityProfile__pendingPost__container:"Im",communityProfile__menuItem:"Rm",communityProfile__privateIcon:"Um",communityProfile__divider:"Bm"};var O5={communityTabs__container:"Dm",communityTabs__tab:"tr"};var cL=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",fill:"none",viewBox:"0 0 25 24"},R.createElement("path",{fill:"currentColor",d:"M9.219 14.5c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h7.312c.457 0 .844.387.844.844a.833.833 0 01-.844.844H9.22zm0 3.375c-.492 0-.844-.352-.844-.844 0-.457.352-.843.844-.843h3.937c.457 0 .844.386.844.843a.833.833 0 01-.844.844H9.22zm0-6.75c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h7.312c.457 0 .844.387.844.844a.833.833 0 01-.844.844H9.22zM18.5 3.25c1.23 0 2.25 1.02 2.25 2.25V19c0 1.266-1.02 2.25-2.25 2.25H7.25A2.221 2.221 0 015 19V5.5c0-1.23.984-2.25 2.25-2.25H18.5zM19.063 19V7.75H6.688V19c0 .316.246.563.562.563H18.5a.578.578 0 00.563-.563z"}));var pL=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"35",height:"34",fill:"none",viewBox:"0 0 35 34"},R.createElement("path",{fill:"currentColor",d:"M21.998 18.295c.372 2.014-.15 4.027-1.567 5.444a.833.833 0 01-1.193 0l-3.58-3.58-2.585 2.586c-.025.025-.074.025-.1.05l-1.59.795c-.224.125-.497-.149-.373-.373l.795-1.59.075-.075 2.585-2.585-3.58-3.58c-.348-.348-.348-.845 0-1.194 1.418-1.416 3.406-1.963 5.42-1.59l1.218-.92-.671-.671c-.348-.348-.348-.846 0-1.194l2.386-2.386a.833.833 0 011.194 0l6.761 6.761a.856.856 0 010 1.194l-2.386 2.386a.833.833 0 01-1.194 0l-.696-.696-.92 1.218zm-9.273-3.455l7.035 7.035c.746-1.143.845-2.635.398-3.928l2.61-3.405 1.442 1.441 1.193-1.193-5.568-5.568-1.193 1.193 1.442 1.442-3.406 2.61c-1.318-.472-2.81-.373-3.953.373z"}));var nf=({pageId:e,componentId:t="*",activeTab:o,onTabChange:r})=>{let n="community_profile_tab",{isExcluded:i,accessibilityId:a,themeStyles:s}=A({pageId:e,componentId:t,elementId:n});return i?null:R.createElement("div",{"data-qa-anchor":a,style:s,className:O5.communityTabs__container},R.createElement(O,{"data-is-active":o==="community_feed",onPress:()=>r("community_feed"),className:O5.communityTabs__tab},R.createElement(cL,null)),R.createElement(O,{"data-is-active":o==="community_pin",onPress:()=>r("community_pin"),className:O5.communityTabs__tab},R.createElement(pL,null)))};var sd={communityCover__container:"ir",communityCover__topBar:"Hm",communityCover__backButton:"Lm",communityCover__menuButton:"Tm"};var uL={menuButton:"Vm"};function af({pageId:e="*",componentId:t="*",onClick:o,className:r,defaultClassName:n}){let i="menu_button",{isExcluded:a,accessibilityId:s,themeStyles:l,config:d,defaultConfig:p,uiReference:u}=A({pageId:e,componentId:t,elementId:i});return a?null:R.createElement(O,{className:r,onPress:o,"data-qa-anchor":s},R.createElement(ee,{defaultIcon:()=>R.createElement(w5,{className:cr(uL.menuButton,n),style:l}),imgIcon:()=>R.createElement("img",{src:d.icon,alt:u}),defaultIconName:p.icon,configIconName:d.icon}))}var sf=({pageId:e="*",componentId:t="*",image:o,onBack:r,onClickMenu:n})=>{let i="community_cover",{isExcluded:a,accessibilityId:s,themeStyles:l,config:d}=A({pageId:e,componentId:t,elementId:i}),p=o?{backgroundImage:`url(${o})`}:{background:"linear-gradient(180deg, #a5a9b5 0%, #636878 100%)"};return a?null:R.createElement("div",{className:sd.communityCover__container,"data-qa-anchor":s,style:c(c({},l),p)},R.createElement("div",{style:c({},p)}),R.createElement("div",{className:sd.communityCover__topBar},R.createElement(wm,{defaultClassName:sd.communityCover__backButton,onPress:r}),R.createElement(af,{className:sd.communityCover__menuButton,onClick:n})))};var lf={communityJoinButton:"qm",joinButton:"Gm"};var fL=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 384 512",fill:"currentColor"},e),R.createElement("path",{d:`M368 224H224V80c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v144H16c-8.84 0-16 7.16-16
4742
+ `;var ga=e=>R.createElement(NB,c({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"}));function ime(e){return e.fileId!==void 0}function td({files:e=[],uploadedFiles:t=[],onChange:o=i=>{},onLoadingChange:r=i=>{},onError:n=i=>{}}){let[i,a]=useState([]),s=useMemo(()=>Array.isArray(e)?e:Array.from(e),[e]),l=useCallback(()=>{o({uploaded:[],uploading:[]});},[o]),d=useCallback(()=>{a([]);},[]),p=useCallback((g,f)=>{if(ime(g)){let y=t.filter(v=>v.fileId!==g.fileId);o({uploaded:y,uploading:s});}else if(f!==void 0){let y=t.filter((v,C)=>C!==f);o({uploaded:y,uploading:s});}else {let y=s.filter(v=>v.name!==g.name);o({uploaded:t,uploading:y});}},[o,t,s]);return useEffect(()=>{if(!s.length)return;function g(){return _(this,null,function*(){r(!0);try{let f=yield Promise.all(s.map(v=>_(this,null,function*(){let C=new FormData;C.append("files",v);let h=yield _(this,null,function*(){if(v.type.includes(FileType.IMAGE))return FileRepository.createImage(C);if(v.type.includes(FileType.VIDEO))return FileRepository.createVideo(C)});return h&&h.data.length>0?h.data[0]:null}))),y=[...t,...f].filter(Fe);o({uploaded:y,uploading:[]}),a([]);}catch(f){a(s.map(y=>y.name)),n(!0);}finally{r(!1);}})}g();},[s]),{allFiles:[...t,...s],uploading:s,uploaded:t,removeFile:p,reset:l,rejected:i,retry:d}}function Ig({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,isErrorUpload:a}){let s=td({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:l,removeFile:d}=s;return l.length===0?null:l&&R.createElement("div",{"data-images-amount":Math.min(l.length,3),className:L1.thumbnail__container},l==null?void 0:l.map((p,u)=>{var g;return R.createElement("div",{key:u,"data-images-height":l.length>2,className:L1.thumbnail__wrapper},n?R.createElement("div",{className:L1.icon__status},R.createElement(ga,null)):a?R.createElement("div",{className:L1.icon__status},R.createElement(Zt,null)):R.createElement(R.Fragment,null,R.createElement("img",{className:L1.thumbnail,src:FileRepository.fileUrlWithSize(p==null?void 0:p.fileUrl,"medium"),alt:(g=p.attributes)==null?void 0:g.name}),R.createElement("button",{type:"reset",onClick:()=>d(p)},R.createElement(Po,{className:L1.closeIcon}))))}))}var fa={thumbnail__container:"f",thumbnail__wrapper:"Cd",thumbnail__wrapper_item_3:"Ad",thumbnail:"Md",closeIcon:"Sd",icon__status:"Ed",playIcon:"Fd"};var wg=({files:e,uploadedFiles:t,onLoadingChange:o,onChange:r,uploadLoading:n,onError:i,videoThumbnail:a,removeThumbnail:s,isErrorUpload:l})=>{let d=td({files:e,uploadedFiles:t,onChange:r,onLoadingChange:o,onError:i}),{allFiles:p,removeFile:u}=d;if(p.length===0)return null;let g=(f,y)=>{u(f,y),s(y);};return a?R.createElement("div",{"data-images-amount":Math.min(a.length,3),className:fa.thumbnail__container},a==null?void 0:a.map((f,y)=>R.createElement("div",{key:f.videoUrl,className:cr(fa.thumbnail__wrapper,a.length>2&&fa.thumbnail__wrapper_item_3)},n?R.createElement("div",{className:fa.icon__status},R.createElement(ga,null)):l?R.createElement("div",{className:fa.icon__status},R.createElement(Zt,null)):R.createElement(R.Fragment,null,R.createElement("img",{className:fa.thumbnail,src:f.thumbnail}),R.createElement("button",{type:"reset",onClick:()=>{g(f.file,y);}},R.createElement(Po,{className:fa.closeIcon})),R.createElement("div",{className:fa.playIcon},R.createElement(Mo,null)))))):null};var ume=({ref:e})=>{let[t,o]=useState(void 0);return useEffect(()=>{if(e.current==null)return;let r=new ResizeObserver(n=>{for(let i of n)o(i.target.clientHeight);});return e.current&&r.observe(e.current),()=>{r.disconnect();}},[e.current]),t};function _g({community:e,targetType:t,targetId:o}){let r="post_composer_page",{themeStyles:n}=Ye({pageId:r}),i="6.75rem",a="8.5rem",s="11rem",l="14.5rem",{AmityPostComposerPageBehavior:d}=bt(),{confirm:p}=Re(),[u,g]=useState(i),[f]=useState(!0),y=useRef(null),v=useRef(null),{prependItem:C}=bs(),h=ume({ref:v}),{handleSubmit:x}=useForm(),[b,M]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[I,w]=useState([]),[N,T]=useState([]),[L,D]=useState([]),[U,Z]=useState([]),[B,$]=useState(!1),[G,q]=useState([]),[z,H]=useState(!1),[F,j]=useState(!0),[Q,k]=useState(!0),[V,ae]=useState(!1),[oe,be]=useState([]),pe=useRef(null),We=()=>useMutation({mutationFn:ce=>_(this,null,function*(){return PostRepository.createPost(ce)}),onSuccess:ce=>{var ue;(ue=d==null?void 0:d.goToSocialHomePage)==null||ue.call(d),C(ce.data);},onError:ce=>{console.error("Failed to create post",ce);}}),{mutateAsync:vt,isPending:Vt,isError:jt}=We(),De=()=>{let ce=I.map(Uo=>({type:"image",fileId:Uo.fileId})),ue=N.map(Uo=>({type:"video",fileId:Uo.fileId})),tn=[...ce,...ue];vt({targetId:o,targetType:t,data:{text:b.text},dataType:"text",metadata:{mentioned:b.mentioned},mentionees:b.mentionees,attachments:tn});},ir=ce=>{M(ue=>E(c({},ue),{mentioned:ce.mentioned,text:ce.text,mentionees:ce.mentionees}));},Dr=ce=>{u===i&&ce==="0px"||g(ce);},qe=()=>{p({pageId:r,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var ce;(ce=d==null?void 0:d.goToSocialHomePage)==null||ce.call(d);},okText:"Discard",cancelText:"Keep editing"});};useEffect(()=>{I.length>0?(j(!0),k(!1)):N.length>0&&oe.length>0?(j(!1),k(!0)):(I.length==0||oe.length==0)&&(j(!0),k(!0));},[I,N,F,Q,oe]),useEffect(()=>{TB()?H(!0):H(!1);},[]),useEffect(()=>{g(!z&&F&&Q||z&&F&&!Q||z&&!F&&Q?s:!z&&F&&!Q||!z&&!F&&Q?a:l);},[z,F,Q]);let Rr=ce=>{be(ue=>ue.filter((tn,Uo)=>Uo!==ce));},bn=ce=>{if(ce.length+G.length>10){p({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ",okText:"Close"});return}ce.length>0&&(q(ue=>[...ue,...ce]),D(ce));},Hr=ce=>_(this,null,function*(){let ue=oe?oe.length:0;if(ce.length+ue>10){p({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ",okText:"Close"});return}if(ce.length>0){Z==null||Z(ce);let tn=ce.map(Fr=>({file:Fr,videoUrl:URL.createObjectURL(Fr),thumbnail:void 0})),Uo=yield Promise.all(tn.map(Fr=>_(this,null,function*(){let Bi=yield kB(Fr.file);return E(c({},Fr),{thumbnail:Bi})})));be(Fr=>[...Fr,...Uo]);}}),en=u==a||u==s||u==l;return R.createElement("div",{className:Un.createPost,style:n},R.createElement("form",{onSubmit:x(De),"data-from-media":u==i,className:Un.createPost__formMediaAttachment},R.createElement("div",{className:Un.createPost__topBar},R.createElement(kr,{pageId:r,onPress:qe}),R.createElement(da,{pageId:r,community:e}),R.createElement(vg,{pageId:r,onSubmit:x(De),isValid:b.text.length>0||I.length>0||N.length>0})),R.createElement(Qi,{onChange:ir,communityId:o,mentionContainer:pe.current,dataValue:{data:{text:b.text}}}),R.createElement(Ig,{files:L,uploadedFiles:I,uploadLoading:B,onLoadingChange:$,onChange:({uploaded:ce,uploading:ue})=>{w(ce),D(ue);},onError:ae,isErrorUpload:V}),R.createElement(wg,{files:U,uploadedFiles:N,uploadLoading:B,onLoadingChange:$,onChange:({uploaded:ce,uploading:ue})=>{T(ce),Z(ue);},onError:ae,isErrorUpload:V,videoThumbnail:oe,removeThumbnail:Rr}),R.createElement("div",{ref:pe,style:{"--asc-mention-bottom":`${h!=null?h:0}px`},className:Un.mentionTextInput_item})),R.createElement("div",{ref:y}),y.current?Rv.createPortal(R.createElement(Drawer.Root,{snapPoints:[i,a,s,l],activeSnapPoint:u,setActiveSnapPoint:ce=>{typeof ce=="string"&&Dr(ce);},open:f,modal:!1},R.createElement(Drawer.Portal,{container:y.current},R.createElement(Drawer.Content,{className:Un.drawer__content},R.createElement("div",{"data-item-position":u===i,className:Un.createPost__notiWrap},Vt&&R.createElement(Os,{content:"Posting...",icon:R.createElement(ga,null),className:Un.createPost__status}),jt&&R.createElement(Os,{content:"Failed to create post",icon:R.createElement(Y1,{className:Un.createPost_infoIcon}),className:Un.createPost__status,duration:3e3})),R.createElement("div",{ref:v,className:Un.drawerContentContainer,"data-show-detail-media-attachment":en},en?R.createElement(h5,{pageId:r,isVisibleCamera:z,isVisibleImage:F,isVisibleVideo:Q,onVideoFileChange:Hr,onImageFileChange:bn}):R.createElement(y5,{pageId:r,isVisibleCamera:z,isVisibleImage:F,isVisibleVideo:Q,onVideoFileChange:Hr,onImageFileChange:bn}))))),y.current):null)}var ya={editPost:"Id",editPost__topBar:"Rd",editPost__status:"Ud",editPost_infoIcon:"Bd",editPost__notiWrap:"Dd",editPost__formMediaAttachment:"Ke",drawer__content:"Hd",mentionTextInput_item:"Ne"};var LB={editPostButton:"Oe"};function Tg(r){var n=r,{pageId:e="*",componentId:t="*"}=n,o=P(n,["pageId","componentId"]);let i="edit_post_button",{config:a,isExcluded:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:i});return s?null:R.createElement(O,c({style:l,className:LB.editPostButton},o),a.text)}var AB={editPostTitle:"Ld"};function kg({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:n,themeStyles:i}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement("div",{style:i,className:AB.editPostTitle},r.text)}var Ime=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return _(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},DB=Ime;var A1={thumbnail__container:"b",thumbnail__wrapper:"Pe",thumbnail:"Td",thumbnail__closeButton:"Vd",thumbnail__closeIcon:"qd",icon__status:"Gd",playIcon:"Jd"};var Mme=({fieldId:e,onRemove:t,type:o})=>{let r=nt({fileId:e});return r?R.createElement(R.Fragment,null,R.createElement("img",{className:A1.thumbnail,src:r,alt:"thumbnail"}),R.createElement(O,{type:"reset",onPress:()=>t(),className:A1.thumbnail__closeButton},R.createElement(Po,{className:A1.thumbnail__closeIcon})),o===PostContentType.VIDEO&&R.createElement("div",{className:A1.playIcon,"data-image":"test"},R.createElement(Mo,null))):null},Ng=({postMedia:e,onRemove:t})=>e.length==0?null:R.createElement("div",{"data-images-amount":Math.min(e.length,3),className:A1.thumbnail__container},e==null?void 0:e.map((o,r)=>R.createElement("div",{key:r,"data-images-height":e.length>2,className:A1.thumbnail__wrapper},R.createElement(Mme,{type:o.dataType,key:r,fieldId:o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.thumbnailFileId,onRemove:()=>t(o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.videoFileId.original)}))));var Eg=(e,t)=>{if(e.length!==t.length)return !1;let o=[...e].sort(),r=[...t].sort();for(let n=0;n<o.length;n++)if(o[n]!==r[n])return !1;return !0};function Bg({post:e}){var $,G,q;let t="post_composer_page",{themeStyles:o}=Ye({pageId:t}),{onBack:r}=Be(),{confirm:n}=Re(),{updateItem:i}=bs(),[a,s]=useState({text:($=e.data.text)!=null?$:"",mentioned:((G=e.metadata)==null?void 0:G.mentioned)||[],mentionees:e.mentionees,attachments:[{fileId:"",type:"image"}]}),[l,d]=useState([]),[p,u]=useState([]),[g,f]=useState([]),[y,v]=useState([]),C=useRef(null),h=()=>useMutation({mutationFn:z=>_(this,null,function*(){return yield PostRepository.editPost(e.postId,z)}),onSuccess:z=>{r(),i(z.data);},onError:z=>{console.error("Failed to edit post",z);}}),{mutateAsync:x,isPending:b,isError:M}=h(),{handleSubmit:I}=useForm(),w=DB((e==null?void 0:e.children)||[]);useEffect(()=>{let z=w.filter(F=>F.dataType==="image");f(z),d(z);let H=w.filter(F=>F.dataType==="video");v(H),u(H);},[w]);let N=z=>{d(H=>H.filter(F=>F.data.fileId!==z));},T=z=>{u(H=>H.filter(F=>F.data.videoFileId.original!==z));},L=()=>{var j,Q;let z=l.map(k=>({fileId:k.data.fileId,type:PostContentType.IMAGE})),H=p.map(k=>({fileId:k.data.videoFileId.original,type:"video"})),F=[...z,...H];a&&x({data:{text:a.text},metadata:{mentioned:(j=a.mentioned)!=null?j:[]},mentionees:(Q=a.mentionees)!=null?Q:[],attachments:F});},D=z=>{s(H=>E(c({},H),{mentioned:z.mentioned,text:z.text,mentionees:z.mentionees}));},U=()=>{n({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{r();},okText:"Discard",cancelText:"Keep editing"});},Z=!Eg(g,l),B=!Eg(y,p);return R.createElement("div",{className:ya.editPost,style:o},R.createElement("form",{onSubmit:I(L),className:ya.editPost__formMediaAttachment},R.createElement("div",{className:ya.editPost__topBar},R.createElement(kr,{pageId:t,onPress:U}),R.createElement(kg,{pageId:t}),R.createElement(Tg,{pageId:t,type:"submit",onPress:()=>I(L),isDisabled:e.data.text==a.text&&!Z&&!B||!(a.text.length>0||l.length>0||p.length>0)})),R.createElement(Qi,{communityId:e.targetType==="community"?e.targetId:void 0,onChange:D,mentionContainer:C.current,dataValue:{data:{text:e.data.text},metadata:{mentioned:((q=e.metadata)==null?void 0:q.mentioned)||[]},mentionees:e.mentionees}}),R.createElement(Ng,{postMedia:l,onRemove:N}),R.createElement(Ng,{postMedia:p,onRemove:T}),R.createElement("div",{ref:C,className:ya.mentionTextInput_item}),R.createElement("div",{className:ya.editPost__notiWrap},b&&R.createElement(Os,{content:"Posting...",icon:R.createElement(ga,null),className:ya.editPost__status}),M&&R.createElement(Os,{content:"Failed to edit post",icon:R.createElement(Zt,{className:ya.editPost_infoIcon}),className:ya.editPost__status,duration:3e3}))))}var Eme=e=>e.mode==="create";function Lg(e){if(Eme(e)){let{targetId:t,targetType:o,community:r}=e;return R.createElement(_g,{mode:"create",targetId:t,targetType:o,community:r})}else {let{post:t}=e;return R.createElement(Bg,{mode:"edit",post:t})}}var Ame=e=>R.createElement("svg",c({width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M18.3804 2.25391C19.2593 3.13281 19.2593 4.53906 18.3804 5.41797L15.7437 8.05469L14.5483 9.25L5.97021 17.8281L1.9624 18.25C1.92725 18.25 1.89209 18.25 1.85693 18.25C1.36475 18.25 0.978027 17.8281 1.04834 17.3359L1.47021 13.3281L10.0483 4.75L11.2437 3.55469L13.8804 0.917969C14.3022 0.496094 14.8999 0.25 15.4624 0.25C16.0249 0.25 16.6226 0.496094 17.0444 0.917969L18.3804 2.25391ZM5.19678 16.2109L13.353 8.08984L14.4429 7L12.2983 4.85547L11.2085 5.94531L3.0874 14.1016L2.84131 16.457L5.19678 16.2109ZM17.1851 4.22266C17.396 4.01172 17.396 3.66016 17.1851 3.44922L15.8491 2.11328C15.7085 1.97266 15.5327 1.9375 15.4624 1.9375C15.3921 1.9375 15.2163 1.97266 15.0757 2.11328L13.4937 3.66016L15.6382 5.80469L17.1851 4.22266Z"})),Dme=e=>R.createElement("svg",c({width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M15.3608 3.0625C15.6421 3.0625 15.9233 3.34375 15.9233 3.625V4.1875C15.9233 4.50391 15.6421 4.75 15.3608 4.75H14.7983L14.0249 16.668C13.9897 17.5469 13.2163 18.25 12.3374 18.25H3.72412C2.84521 18.25 2.07178 17.5469 2.03662 16.668L1.29834 4.75H0.73584C0.419434 4.75 0.17334 4.50391 0.17334 4.1875V3.625C0.17334 3.34375 0.419434 3.0625 0.73584 3.0625H3.61865L4.81396 1.09375C5.09521 0.636719 5.72803 0.25 6.25537 0.25H9.80615C10.3335 0.25 10.9663 0.636719 11.2476 1.09375L12.4429 3.0625H15.3608ZM6.25537 1.9375L5.5874 3.0625H10.4741L9.80615 1.9375H6.25537ZM12.3374 16.5625L13.0757 4.75H2.98584L3.72412 16.5625H12.3374Z"})),Hme=e=>R.createElement("svg",c({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M12.3125 3.0625C13.543 3.0625 14.8789 2.64062 16.1445 2.07812C17.2344 1.62109 18.5 2.42969 18.5 3.625V12.0625C18.5 12.6602 18.1836 13.1875 17.7266 13.5039C16.7773 14.1016 15.2656 14.875 13.1914 14.875C10.8008 14.875 9.21875 13.75 7.49609 13.75C5.52734 13.75 4.33203 14.1719 3.03125 14.7695V17.6875C3.03125 18.0039 2.75 18.25 2.46875 18.25H1.90625C1.58984 18.25 1.34375 18.0039 1.34375 17.6875V3.41406C0.816406 3.13281 0.5 2.57031 0.5 1.9375C0.5 0.988281 1.30859 0.214844 2.29297 0.285156C3.10156 0.320312 3.76953 0.953125 3.83984 1.76172C3.83984 1.79688 3.875 1.90234 3.875 1.9375C3.875 2.11328 3.80469 2.35938 3.76953 2.5C4.54297 2.18359 5.49219 1.9375 6.61719 1.9375C9.00781 1.9375 10.5898 3.0625 12.3125 3.0625ZM16.8125 12.0625V3.625C15.6875 4.15234 13.8242 4.75 12.3125 4.75C10.2031 4.75 8.72656 3.625 6.61719 3.625C5.14062 3.625 3.76953 4.22266 3.03125 4.75V12.9062C4.12109 12.4141 5.98438 12.0625 7.49609 12.0625C9.60547 12.0625 11.082 13.1875 13.1914 13.1875C14.668 13.1875 16.0391 12.625 16.8125 12.0625Z"})),S5=({post:e,pageId:t="*",componentId:o="*",elementId:r="*",onCloseMenu:n,onPostDeleted:i})=>{let{success:a,error:s}=_o(),l=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:d}=Pt({communityId:e==null?void 0:e.targetId,shouldCall:l}),{isCommunityModerator:p,isOwner:u}=MB({post:e,community:d}),{AmityPostContentComponentBehavior:g}=bt(),{removeDrawerData:f}=Wm(),{showEditPostButton:y,showDeletePostButton:v,showReportPostButton:C}=useMemo(()=>p?u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[p,u]),{isFlaggedByMe:h,isLoading:x,mutateReportPost:b,mutateUnReportPost:M}=_B({post:e,isFlaggable:C,onReportSuccess:()=>{a({content:"Post reported."});},onReportError:()=>{s({content:"Failed to report post."});},onUnreportSuccess:()=>{a({content:"Post unreported."});},onUnreportError:()=>{s({content:"Failed to unreport post."});}}),{confirm:I}=Re(),{mutateAsync:w}=useMutation({mutationFn:()=>_(void 0,null,function*(){return n(),PostRepository.hardDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted."}),i==null||i(e);},onError:()=>{s({content:"Failed to delete post."});}}),N=()=>{n(),I({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>w(),pageId:t,componentId:o});};return R.createElement("div",{className:zn.postMenu},C&&!x?R.createElement(O,{className:zn.postMenu__item,onPress:()=>{h?M():b(),f();}},R.createElement(Hme,{className:zn.postMenu__reportPost__icon}),R.createElement(S.Title,{className:zn.postMenu__reportPost__text},h?"Unreport post":"Report post")):null,y?R.createElement(O,{className:zn.postMenu__item,onPress:()=>{var T;f(),(T=g==null?void 0:g.goToPostComposerPage)==null||T.call(g,{mode:"edit",post:e});}},R.createElement(Ame,{className:zn.postMenu__editPost__icon}),R.createElement(S.Title,{className:zn.postMenu__editPost__text},"Edit post")):null,v?R.createElement(O,{className:zn.postMenu__item,onPress:()=>N()},R.createElement(Dme,{className:zn.postMenu__deletePost__icon}),R.createElement(S.Title,{className:zn.postMenu__deletePost__text},"Delete post")):null)};var UB=({post:e,community:t})=>{let{currentUserId:o}=Ae(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:n}=nm({communityId:t==null?void 0:t.communityId,shouldCall:r}),i=useMemo(()=>r?n.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[n,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:i,isOwner:a}};var $B=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let n=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return n.observe(t.current),()=>{n.disconnect();}},[e,t]),{isVisible:o}};var VB={announcementBadge:"Kd"};var Ag={featuredIcon__background:"Nd",featuredIcon__textColor:"Od"};var jB=r=>{var n=r,{backgroundColor:e,textColor:t}=n,o=P(n,["backgroundColor","textColor"]);return R.createElement("svg",c({width:"73",height:"26",viewBox:"0 0 73 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),R.createElement("path",{d:"M0 0H69C71.2091 0 73 1.79086 73 4V22C73 24.2091 71.2091 26 69 26H0V0Z",className:Ag.featuredIcon__background,fill:e}),R.createElement("path",{d:"M9.12988 18V8.84033H14.9697V10.2178H10.7676V12.9282H14.6079V14.2612H10.7676V18H9.12988ZM19.5108 18.1396C17.4478 18.1396 16.1973 16.7559 16.1973 14.5469V14.5405C16.1973 12.3569 17.4605 10.9287 19.4346 10.9287C21.4088 10.9287 22.6275 12.3125 22.6275 14.4072V14.9277H17.7779C17.797 16.1719 18.4698 16.8955 19.5426 16.8955C20.3995 16.8955 20.8883 16.4639 21.0406 16.1465L21.0596 16.1021H22.564L22.545 16.1592C22.3228 17.0542 21.3961 18.1396 19.5108 18.1396ZM19.4537 12.1665C18.5714 12.1665 17.9112 12.7632 17.7906 13.8677H21.085C20.9771 12.7314 20.336 12.1665 19.4537 12.1665ZM26.0197 18.1143C24.6994 18.1143 23.7409 17.3018 23.7409 16.0386V16.0259C23.7409 14.7881 24.6867 14.0645 26.3752 13.9629L28.1588 13.855V13.2583C28.1588 12.5664 27.7082 12.1855 26.8576 12.1855C26.1339 12.1855 25.6642 12.4458 25.5055 12.9028L25.4992 12.9282H24.0075L24.0138 12.8711C24.1662 11.7031 25.2834 10.9287 26.9338 10.9287C28.7174 10.9287 29.7204 11.792 29.7204 13.2583V18H28.1588V17.0479H28.0509C27.6701 17.7207 26.9338 18.1143 26.0197 18.1143ZM25.3024 15.9624C25.3024 16.5527 25.8039 16.9019 26.5021 16.9019C27.4543 16.9019 28.1588 16.2798 28.1588 15.4546V14.896L26.5973 14.9976C25.715 15.0547 25.3024 15.3784 25.3024 15.9497V15.9624ZM34.2678 18.0317C32.6746 18.0317 32.0207 17.4985 32.0207 16.1592V12.2871H30.9416V11.062H32.0207V9.36084H33.6267V11.062H35.093V12.2871H33.6267V15.7847C33.6267 16.4766 33.8996 16.7686 34.5598 16.7686C34.782 16.7686 34.9026 16.7622 35.093 16.7432V17.9619C34.8645 18.0063 34.5725 18.0317 34.2678 18.0317ZM38.8851 18.1396C37.3236 18.1396 36.5238 17.2002 36.5238 15.5498V11.062H38.1043V15.188C38.1043 16.2607 38.5042 16.8066 39.4564 16.8066C40.4783 16.8066 41.0242 16.1465 41.0242 15.1055V11.062H42.6048V18H41.0242V16.9463H40.9163C40.5926 17.689 39.888 18.1396 38.8851 18.1396ZM44.4545 18V11.062H46.0351V12.1284H46.143C46.3778 11.3857 47.0126 10.9478 47.9267 10.9478C48.1679 10.9478 48.4154 10.9795 48.5678 11.0239V12.4395C48.3139 12.3887 48.0536 12.3506 47.7807 12.3506C46.727 12.3506 46.0351 12.979 46.0351 13.9692V18H44.4545ZM52.5757 18.1396C50.5127 18.1396 49.2622 16.7559 49.2622 14.5469V14.5405C49.2622 12.3569 50.5254 10.9287 52.4995 10.9287C54.4736 10.9287 55.6924 12.3125 55.6924 14.4072V14.9277H50.8428C50.8618 16.1719 51.5346 16.8955 52.6074 16.8955C53.4643 16.8955 53.9531 16.4639 54.1054 16.1465L54.1245 16.1021H55.6289L55.6098 16.1592C55.3877 17.0542 54.4609 18.1396 52.5757 18.1396ZM52.5185 12.1665C51.6362 12.1665 50.9761 12.7632 50.8554 13.8677H54.1499C54.042 12.7314 53.4009 12.1665 52.5185 12.1665ZM59.6939 18.1143C57.9546 18.1143 56.8502 16.7368 56.8502 14.5405V14.5278C56.8502 12.3188 57.9356 10.9478 59.6939 10.9478C60.6461 10.9478 61.4395 11.4175 61.8013 12.1665H61.9092V8.37695H63.4962V18H61.9092V16.9146H61.8013C61.4205 17.6699 60.6714 18.1143 59.6939 18.1143ZM60.189 16.7812C61.2681 16.7812 61.9346 15.9307 61.9346 14.5405V14.5278C61.9346 13.1377 61.2618 12.2808 60.189 12.2808C59.1163 12.2808 58.4561 13.1313 58.4561 14.5278V14.5405C58.4561 15.937 59.1099 16.7812 60.189 16.7812Z",className:Ag.featuredIcon__textColor,fill:t}))};var Fg=({pageId:e="*",componentId:t="*"})=>{let o="announcement_badge",{config:r,isExcluded:n,accessibilityId:i,uiReference:a,defaultConfig:s}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement(ee,{"data-qa-anchor":i,defaultIcon:()=>R.createElement(jB,{className:VB.announcementBadge}),imgIcon:()=>R.createElement("img",{src:r.icon,alt:a}),configIconName:r.icon,defaultIconName:s.icon})};var GB={pinBadge__icon:"Pd"};var QB=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"29",height:"30",fill:"none",viewBox:"0 0 29 30"},e),R.createElement("path",{fill:e.fill,d:"M18.106 16.436c.575 1.547.53 3.27-.596 4.398a.74.74 0 01-1.06 0l-3.006-3.005-2.32 2.32c-.022.022-.067.022-.089.044l-1.59.53c-.2.067-.398-.132-.332-.331l.53-1.591.066-.066 2.32-2.32-3.005-3.006a.722.722 0 010-1.06c1.105-1.105 2.829-1.194 4.376-.62l2.917-2.342-.929-.928a.722.722 0 010-1.06l1.061-1.06a.74.74 0 011.06 0l6.011 6.01a.76.76 0 010 1.06l-1.06 1.06a.74.74 0 01-1.061 0l-.95-.95-2.343 2.917z"}));var zg=({pageId:e,componentId:t})=>{let o="pin_badge",{config:r,isExcluded:n,accessibilityId:i,uiReference:a,defaultConfig:s}=A({pageId:e,componentId:t,elementId:o});return n?null:R.createElement(ee,{"data-qa-anchor":i,defaultIcon:()=>R.createElement(QB,{className:GB.pinBadge__icon}),imgIcon:()=>R.createElement("img",{src:r.icon,alt:a}),defaultIconName:s.icon,configIconName:r.icon})};var Zme=({pageId:e,post:t,hideTarget:o})=>{var s;let r=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:n}=Pt({communityId:t==null?void 0:t.targetId,shouldCall:r}),{goToCommunityProfilePage:i,onClickUser:a}=Be();return n?R.createElement("div",{className:ye.postTitle},t.creator&&R.createElement("div",{className:ye.postTitle__user__container},R.createElement(S.BodyBold,{className:ye.postTitle__text},R.createElement(O,{onPress:()=>a(t.creator.userId)},"aensuthasneuthasnetusantheusnatheusnthasenuthasnteuhsanteuhsnatehusntaheusntaheu")),t.creator.isBrand?null:R.createElement(Zc,{className:ye.postTitle__brandIcon}),n?R.createElement(Yc,{className:ye.postTitle__icon}):null),n&&!o&&R.createElement(R.Fragment,null,R.createElement(O,{onPress:()=>{i(n.communityId);}},R.createElement(S.BodyBold,{className:ye.postTitle__text},n.displayName)))):R.createElement("div",{className:ye.postTitle__user__container},R.createElement(O,{onPress:()=>t.creator&&a(t.creator.userId)},R.createElement(S.BodyBold,{className:ye.postTitle__text},(s=t.creator)==null?void 0:s.displayName)),t.creator.isBrand?null:R.createElement(Zc,{className:ye.postTitle__brandIcon}))};var Qme=({post:e,onImageClick:t,onVideoClick:o})=>R.createElement(R.Fragment,null,R.createElement(yg,{post:e,onImageClick:t}),R.createElement(hg,{post:e,onVideoClick:o})),fn=({pageId:e="*",post:t,onClick:o,onPostDeleted:r,category:n,hideMenu:i=!1,hideTarget:a=!1,style:s})=>{var Dr,qe,Rr,bn,Hr,en,ce;let l="post_content",{themeStyles:d}=te({pageId:e,componentId:l}),{post:p}=Ii(t==null?void 0:t.postId),{setDrawerData:u,removeDrawerData:g}=Wm(),[f,y]=useState(!1),[v,C]=useState(!1),[h,x]=useState(!1),[b,M]=useState(null),[I,w]=useState(null),[N,T]=useState(null),[L,D]=useState(0),{page:U}=Be(),Z=useRef(null),B=useMemo(()=>{if(t!=null&&p!=null)return dn(t==null?void 0:t.updatedAt).unix()>dn(p==null?void 0:p.updatedAt).unix()?t:p;if(p!=null)return p;if(t!=null)return t},[t,p]);Ac({postId:B==null?void 0:B.postId,level:SubscriptionLevels.POST,shouldSubscribe:f});let $=useMemo(()=>(B==null?void 0:B.targetType)==="community",[B==null?void 0:B.targetType]),{community:G}=Pt({communityId:B==null?void 0:B.targetId,shouldCall:$}),{isCommunityModerator:q}=UB({post:B,community:G});useEffect(()=>{var ue;B!=null&&T(((ue=B.myReactions)==null?void 0:ue[0])||null);},[B==null?void 0:B.myReactions]),useEffect(()=>{B!=null&&D((B==null?void 0:B.reactionsCount)||0);},[B==null?void 0:B.reactionsCount]);let {mutateAsync:z}=useMutation({mutationFn:ue=>_(void 0,null,function*(){if(N&&N!==ue)try{yield ReactionRepository.removeReaction("post",B==null?void 0:B.postId,N);}catch(tn){console.log();}return ReactionRepository.addReaction("post",B==null?void 0:B.postId,ue)}),onMutate:ue=>{y(!0),D(L+1),T(ue);}}),{mutateAsync:H}=useMutation({mutationFn:ue=>_(void 0,null,function*(){return ReactionRepository.removeReaction("post",B==null?void 0:B.postId,ue)}),onMutate:()=>{y(!0),D(Math.max(0,L-1)),T(null);}}),F=ue=>{N?H(N):z(ue);},j=ue=>{C(!0),M(ue);},Q=()=>{C(!1),M(null);},k=ue=>{x(!0),w(ue);},V=()=>{x(!1),w(null);},pe=((Dr=B==null?void 0:B.reactions)==null?void 0:Dr.like)>0,We=((qe=B==null?void 0:B.reactions)==null?void 0:qe.love)>0,vt=((Rr=B==null?void 0:B.reactions)==null?void 0:Rr.fire)>0,Vt=((bn=B==null?void 0:B.reactions)==null?void 0:bn.happy)>0,jt=((Hr=B==null?void 0:B.reactions)==null?void 0:Hr.crying)>0,De=pe||We||vt||Vt||jt,{isVisible:ir}=$B({threshold:.6,elementRef:Z});return useEffect(()=>{var ue;U.type!=="PostDetailPage"&&ir&&((ue=B.analytics)==null||ue.markAsViewed());},[B,ir,U.type]),R.createElement("div",{ref:Z,className:ye.postContent,style:d},(n==="announcement"||n==="pin_and_announcement")&&R.createElement(Fg,{pageId:e,componentId:l}),R.createElement("div",{className:ye.postContent__bar,"data-type":s},R.createElement("div",{className:ye.postContent__bar__userAvatar},R.createElement(jo,{userId:B==null?void 0:B.postedUserId})),R.createElement("div",{className:ye.postContent__bar__detail},R.createElement("div",null,R.createElement(Zme,{post:B,hideTarget:a})),R.createElement("div",{className:ye.postContent__bar__information__subtitle},q?R.createElement("div",{className:ye.postContent__bar__information__subtitle__moderator},R.createElement(w1,{pageId:e,componentId:l}),R.createElement("span",{className:ye.postContent__bar__information__subtitle__separator},"\u2022")):null,R.createElement(M1,{timestamp:B.createdAt}),B.createdAt!==B.editedAt&&R.createElement(S.Caption,{className:ye.postContent__bar__information__editedTag},"(edited)"))),R.createElement("div",{className:ye.postContent__wrapRightMenu},(n==="pin"||n==="pin_and_announcement")&&R.createElement(zg,{pageId:e,componentId:l}),s==="feed"?R.createElement("div",{className:ye.postContent__bar__actionButton},!i&&R.createElement(Xc,{pageId:e,componentId:l,onClick:()=>u({content:R.createElement(S5,{post:B,onCloseMenu:()=>g(),pageId:e,componentId:l,onPostDeleted:r})})})):null)),R.createElement("div",{className:ye.postContent__content_and_reactions},R.createElement("div",{className:ye.postContent__content},R.createElement(fg,{text:(en=B==null?void 0:B.data)==null?void 0:en.text,mentioned:(ce=B==null?void 0:B.metadata)==null?void 0:ce.mentioned,mentionees:B==null?void 0:B.mentioness}),B.children.length>0?R.createElement(Qme,{post:B,onImageClick:j,onVideoClick:k}):null),s==="detail"?R.createElement("div",{className:ye.postContent__reactions_and_comments},R.createElement("div",{className:ye.postContent__reactionsBar,onClick:()=>u({content:R.createElement(Fm,{pageId:e,referenceId:B.postId,referenceType:"post"})})},De?R.createElement("div",{className:ye.postContent__reactionsBar__reactions},jt&&R.createElement(dB,{className:ye.postContent__reactionsBar__reactions__icon}),Vt&&R.createElement(pB,{className:ye.postContent__reactionsBar__reactions__icon}),vt&&R.createElement(uB,{className:ye.postContent__reactionsBar__reactions__icon}),We&&R.createElement(gB,{className:ye.postContent__reactionsBar__reactions__icon}),pe&&R.createElement(fB,{className:ye.postContent__reactionsBar__reactions__icon})):null,R.createElement(S.Caption,{className:ye.postContent__reactionsBar__reactions__count},`${ib((B==null?void 0:B.reactionsCount)||0)} ${(B==null?void 0:B.reactionsCount)===1?"like":"likes"}`)),R.createElement(S.Caption,{className:ye.postContent__commentsCount},`${(B==null?void 0:B.commentsCount)||0} ${(B==null?void 0:B.commentsCount)===1?"comment":"comments"}`)):null,!(G!=null&&G.isJoined)&&U.type==="CommunityProfilePage"?R.createElement(R.Fragment,null,R.createElement(S.Body,{className:ye.postContent__notMember},"Join community to interact with all posts")):!(G!=null&&G.isJoined)&&U.type==="PostDetailPage"?null:R.createElement(R.Fragment,null,R.createElement("div",{className:ye.postContent__divider}),R.createElement("div",{className:ye.postContent__reactionBar},R.createElement("div",{className:ye.postContent__reactionBar__leftPane},R.createElement(U3,{pageId:e,componentId:l,reactionsCount:s==="feed"?L:void 0,myReaction:N,defaultIconClassName:ye.postContent__reactionBar__leftPane__icon,imgIconClassName:ye.postContent__reactionBar__leftPane__iconImg,onReactionClick:F}),R.createElement(dg,{pageId:e,componentId:l,commentsCount:s==="feed"?B.commentsCount:void 0,defaultIconClassName:ye.postContent__reactionBar__leftPane__icon,imgIconClassName:ye.postContent__reactionBar__leftPane__iconImg,onPress:()=>o==null?void 0:o()})),R.createElement("div",{className:ye.postContent__reactionBar__rightPane},R.createElement(cg,{pageId:e,componentId:l}))))),v&&typeof b=="number"?R.createElement(xB,{post:B,onClose:Q,initialImageIndex:b}):null,h&&typeof I=="number"?R.createElement(IB,{post:B,onClose:V,initialVideoIndex:I}):null)};var Nt={postContentSkeleton:"Qd",postContentSkeleton__bar:"Wd",postContentSkeleton__bar__information:"Zd",postContentSkeleton__content:"_d",postContentSkeleton__animation:"e0","skeleton-pulse":"Qe",postContentSkeleton__bar__userAvatar:"r0",postContentSkeleton__bar__information__title:"a0",postContentSkeleton__bar__information__subtitle:"o0",postContentSkeleton__content__bar1:"t0",postContentSkeleton__content__bar2:"i0",postContentSkeleton__content__bar3:"l0"};var rd=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return R.createElement("div",{"data-qa-anchor":o,style:s,className:cr(Nt.postContentSkeleton,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__userAvatar,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information__title,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__bar__information__subtitle,Nt.postContentSkeleton__animation)}))),R.createElement("div",{className:cr(Nt.postContentSkeleton__content,Nt.postContentSkeleton__animation)},R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar1,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar2,Nt.postContentSkeleton__animation)}),R.createElement("div",{className:cr(Nt.postContentSkeleton__content__bar3,Nt.postContentSkeleton__animation)})))};function H1({queryParams:e,shouldCall:t=!0}){let n=dt({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=P(n,["items"]);return c({communities:o},r)}var KB={myCommunitiesList:"s0"};var N5=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=te({pageId:e,componentId:t}),{communities:r,hasMore:n,loadMore:i,isLoading:a}=H1({queryParams:{sortBy:"displayName",limit:20,membership:"member"}});return R.createElement("div",{style:o,className:KB.myCommunitiesList},R.createElement(hs,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{n&&a===!1&&i();}}))};var Jme=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},R.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),R.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),R.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),R.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),R.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),R.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),R.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),R.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),R.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Xme=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},R.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),R.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),R.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),R.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),R.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),jg=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:d}=A({pageId:e,componentId:t,elementId:o});return s?null:R.createElement(ee,{defaultIconName:a.icon,configIconName:i.icon,imgIcon:()=>R.createElement("img",{src:i.icon,alt:l,"data-qa-anchor":n}),defaultIcon:()=>R.createElement("div",{"data-qa-anchor":n},r==="light"?R.createElement(Xme,null):R.createElement(Jme,null))})};var XB={description:"c0"};function Gg({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement(S.Caption,{className:XB.description,style:l,"data-qa-anchor":r},n.text)}var YB={title:"n0"};function F1({pageId:e="*",componentId:t="*",titleClassName:o}){let r="title",{accessibilityId:n,config:i,isExcluded:a,themeStyles:s}=A({pageId:e,componentId:t,elementId:r});return a?null:R.createElement(S.Title,{className:cr(YB.title,o),style:s,"data-qa-anchor":n},i.text)}var E5={exploreCommunitiesButton:"d0",exploreCommunitiesButton__icon:"m0",exploreCommunitiesButton__text:"p0"};var n2e=e=>R.createElement("svg",c({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function Zg({pageId:e="*",componentId:t="*"}){let o="explore_communities_button",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement("div",{className:E5.exploreCommunitiesButton,"data-qa-anchor":r,style:l},R.createElement(n2e,{className:E5.exploreCommunitiesButton__icon}),R.createElement(S.BodyBold,{className:E5.exploreCommunitiesButton__text},n.text))}var RB={createCommunityButton:"g0"};function Qg({pageId:e="*",componentId:t="*",onClick:o}){let r="create_community_button",{accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:d}=A({pageId:e,componentId:t,elementId:r});return s?null:R.createElement("div",{className:RB.createCommunityButton,onClick:()=>o(),"data-qa-anchor":n,style:d},R.createElement(ee,{defaultIcon:()=>R.createElement(R.Fragment,null),imgIcon:()=>R.createElement("img",{src:i.icon,alt:l}),configIconName:i.icon,defaultIconName:a.icon}),R.createElement(S.Body,null,i.text))}var Wg={emptyNewsfeed:"h0",emptyNewsfeed__text:"f0"};function Jm({pageId:e="*"}){let t="empty_newsfeed",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return i?null:R.createElement("div",{className:Wg.emptyNewsfeed},R.createElement(jg,{pageId:e,componentId:t}),R.createElement("div",{className:Wg.emptyNewsfeed__text},R.createElement(F1,{pageId:e,componentId:t}),R.createElement(Gg,{pageId:e,componentId:t})),R.createElement(Zg,{pageId:e,componentId:t}),R.createElement(Qg,{pageId:e,componentId:t,onClick:()=>{}}))}var z1={global_feed:"b0",global_feed__postContainer:"u0",global_feed__postSkeletonContainer:"v0",global_feed__pullToRefresh:"x0",global_feed__post__reactionBar__leftPane__icon:"w0",global_feed__post__reactionBar__leftPane__iconImg:"y0",global_feed__pullToRefresh__spinner:"k0",spin:"We",global_feed__divider:"j0",global_feed__post__divider:"z0",global_feed__post__reactionBar:"X0",global_feed__post__reactionBar__leftPane:"Y0",global_feed__post__reactionBar__rightPane:"C0",global_feed__intersection:"A0",global_feed__commentContainer:"M0"};var Jt={container:"S0",innerContainer:"E0",header:"F0",header__title:"I0",header__avatar:"R0",header__detail:"U0",content__text:"B0",content__imageContainer:"D0",content__image:"H0",footer:"Ze",footer__content__description:"L0",footer__content__headline:"T0",footer__left:"V0",footer__right:"q0",footer__content__button:"G0",footer__content__button__text:"J0",infoIcon__button:"K0",infoIcon:"N0"};var tL=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:n})=>{var l;let[i,a]=useState(!1),s=()=>{n==null||n(e.callToActionUrl);};return R.createElement("div",{className:Jt.container,style:r},R.createElement("div",{className:Jt.innerContainer},R.createElement("div",{className:Jt.header},R.createElement("div",{className:Jt.header__avatar},R.createElement(xt,{avatarUrl:t,defaultImage:R.createElement(Lm,null)})),R.createElement("div",{className:Jt.header__detail},R.createElement(S.BodyBold,{className:Jt.header__title},(l=e.advertiser)==null?void 0:l.name),R.createElement(Bm,null))),R.createElement("div",null,R.createElement(S.Body,{className:Jt.content__text},e.body),R.createElement("div",{className:Jt.content__imageContainer},R.createElement("img",{className:Jt.content__image,src:o})))),R.createElement(O,{className:Jt.infoIcon__button,onPress:()=>a(!0)},R.createElement(pn,{className:Jt.infoIcon})),R.createElement(O,{className:Jt.footer,"data-has-url":!!e.callToActionUrl,onPress:s},R.createElement("div",{className:Jt.footer__left},R.createElement(S.Body,{renderer:({typoClassName:d})=>R.createElement("div",{className:cr(d,Jt.footer__content__description)},e.description)}),R.createElement(S.BodyBold,{className:Jt.footer__content__headline},e.headline)),e.callToActionUrl?R.createElement("div",{className:Jt.footer__right},R.createElement(O,{className:Jt.footer__content__button,onPress:s},R.createElement(S.CaptionBold,{renderer:({typoClassName:d})=>R.createElement("div",{className:cr(d,Jt.footer__content__button__text)},e.callToAction)}))):null),R.createElement(R3,{ad:e,isOpen:i,onOpenChange:d=>a(d)}))};var oL=({pageId:e="*",ad:t})=>{var d,p,u,g,f,y;let o="post_content",{themeStyles:r}=te({pageId:e,componentId:o}),i=nt({fileId:(p=(d=t.advertiser)==null?void 0:d.avatar)==null?void 0:p.fileId})||((g=(u=t.advertiser)==null?void 0:u.avatar)==null?void 0:g.fileUrl)||"",s=nt({fileId:(f=t.image1_1)==null?void 0:f.fileId})||((y=t.image1_1)==null?void 0:y.fileUrl)||"";return R.createElement(tL,{themeStyles:r,avatarUrl:i,adImageUrl:s,ad:t,onCallToActionClick:v=>{window==null||window.open(v,"_blank");}})};var qg=e=>(e==null?void 0:e.adId)!==void 0,B5=({pageId:e="*",componentId:t="*",items:o,isLoading:r,onFeedReachBottom:n,onPostDeleted:i})=>{let{accessibilityId:a,themeStyles:s}=te({pageId:e,componentId:t}),[l,d]=useState(null),{AmityGlobalFeedComponentBehavior:p}=bt();if(So({node:l,onIntersect:()=>{n();}}),o.length===0&&!r)return R.createElement(Jm,{pageId:e});let u=(g,f)=>qg(g)?f&&qg(f)?`${f.adId}-${g.adId}`:`${f.postId}-${g.adId}`:g.postId;return R.createElement("div",{className:z1.global_feed,style:s,"data-qa-anchor":a},o.map((g,f)=>R.createElement("div",{key:u(g,o[Math.max(0,f-1)])},f!==0?R.createElement("div",{className:z1.global_feed__divider}):null,qg(g)?R.createElement(oL,{ad:g}):R.createElement(O,{className:z1.global_feed__postContainer,onPress:()=>{var y;return (y=p==null?void 0:p.goToPostDetailPage)==null?void 0:y.call(p,{postId:g.postId})}},R.createElement(fn,{pageId:e,post:g,category:"general",style:"feed",onClick:()=>{var y;(y=p==null?void 0:p.goToPostDetailPage)==null||y.call(p,{postId:g.postId});},onPostDeleted:i})))),r?Array.from({length:2}).map((g,f)=>R.createElement("div",{key:f},R.createElement("div",{className:z1.global_feed__divider}),R.createElement("div",{className:z1.global_feed__postSkeletonContainer},R.createElement(rd,null)))):null,!r&&R.createElement("div",{ref:g=>d(g),className:z1.global_feed__intersection}))};var Xm={newsfeed:"O0",newsfeed__postList:"P0",newsfeed__postContainer:"Q0",newsfeed__pullToRefresh:"W0",newsfeed__post__reactionBar__leftPane__icon:"Z0",newsfeed__post__reactionBar__leftPane__iconImg:"_0",newsfeed__pullToRefresh__spinner:"em",spin:"_e",newsfeed__divider:"rm",newsfeed__post__divider:"am",newsfeed__post__reactionBar:"om",newsfeed__post__reactionBar__leftPane:"tm",newsfeed__post__reactionBar__rightPane:"im",newsfeed__intersection:"lm"};var y2e=e=>R.createElement("div",{className:Xm.newsfeed__pullToRefresh__spinner},R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),R.createElement("defs",null,R.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},R.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),R.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"}))))),L5=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=te({pageId:e,componentId:t}),r=useRef(0),[n,i]=useState(0),{itemWithAds:a,hasMore:s,isLoading:l,loadMore:d,fetch:p,refetch:u,removeItem:g}=bs();useEffect(()=>{p();},[]);let f=()=>{s&&!l&&d();};return a.length===0&&!l?R.createElement(Jm,{pageId:e}):R.createElement("div",{className:Xm.newsfeed,style:o,onDrag:y=>y.stopPropagation(),onTouchStart:y=>{r.current=y.touches[0].clientY;},onTouchMove:y=>{let v=y.touches[0].clientY;r.current>v||i(Math.min(v-r.current,100));},onTouchEnd:y=>{r.current=0,n>=75&&u(),i(0);}},R.createElement("div",{style:{"--asc-pull-to-refresh-height":`${n}px`},className:Xm.newsfeed__pullToRefresh},R.createElement(y2e,null)),R.createElement("div",{className:Xm.newsfeed__divider}),R.createElement(Um,{type:"globalFeed",pageId:e}),a.length>0&&R.createElement("div",{className:Xm.newsfeed__divider}),R.createElement(B5,{isLoading:l,items:a,pageId:e,componentId:t,onFeedReachBottom:()=>f(),onPostDeleted:y=>g(y.postId)}))};var A5={postCreationButton:"sm",postCreationButton__icon:"cm"};var C2e=e=>R.createElement("svg",c({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function Xg({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:n}){let i="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(ee,{defaultIcon:()=>R.createElement(O,{style:u,className:A5.postCreationButton,onPress:n,"data-qa-anchor":a},R.createElement(C2e,{className:cr(A5.postCreationButton__icon,o)})),imgIcon:()=>R.createElement("img",{src:s.icon,alt:p,className:cr(A5.postCreationButton,r),onClick:n,"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon})}var id={globalSearchButton:"nm",globalSearchButton__icon:"dm",globalSearchButton__svg:"mm"};var x2e=e=>R.createElement("svg",c({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function Yg({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n}){let i="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{style:u,"data-qa-anchor":a,className:id.globalSearchButton,onPress:n},R.createElement(ee,{defaultIcon:()=>R.createElement("div",{className:id.globalSearchButton__icon},R.createElement(x2e,{className:cr(id.globalSearchButton__svg,o)})),imgIcon:()=>R.createElement("img",{style:u,src:s.icon,alt:p,className:cr(id.globalSearchButton__icon,r),"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon}))}var iL={headerLabel:"pm"};function Rg({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement(S.Heading,{className:iL.headerLabel,style:l,"data-qa-anchor":r},n.text)}var D5={topNavigation:"gm",topNavigationLeftPane:"hm",topNavigationRightPane:"fm"};var $1={socialHomePage:"bm",socialHomePage__topBar:"um",socialHomePage__topNavigation:"vm",socialHomePage__tabs:"er",socialHomePage__contents:"rr",socialHomePage__createPostMenu:"xm"};function ef({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="newsfeed_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}function tf({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="explore_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r(),"data-qa-anchor":i},a.text)}function of({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="my_communities_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:d,themeStyles:p}=A({pageId:e,componentId:t,elementId:n});return l?null:R.createElement(An,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}var H5=(r=>(r.Newsfeed="Newsfeed",r.Explore="Explore",r.MyCommunities="My communities",r))(H5||{});function rf(){let e="social_home_page",{themeStyles:t}=Ye({pageId:e}),{scrollPosition:o,onScroll:r}=bs(),[n,i]=useState("Newsfeed"),[a,s]=useState(!1),l=useRef(null),d=useRef(!0);useEffect(()=>{l.current&&(l.current.scrollTop=o,setTimeout(()=>{d.current=!1;},100));},[l.current]);let p=()=>{s(g=>!g);},u=g=>{d.current||r(g);};return useEffect(()=>{let g=()=>{a&&s(!1);};a?document.addEventListener("mousedown",g):document.removeEventListener("mousedown",g);},[a]),R.createElement("div",{className:$1.socialHomePage,style:t},R.createElement("div",{className:$1.socialHomePage__topBar},R.createElement("div",{className:$1.socialHomePage__topNavigation},R.createElement(F5,{pageId:e,selectedTab:n,onClickPostCreationButton:p})),R.createElement("div",{className:$1.socialHomePage__tabs},R.createElement(ef,{pageId:e,isActive:n==="Newsfeed",onClick:()=>i("Newsfeed")}),R.createElement(tf,{pageId:e,isActive:n==="Explore",onClick:()=>i("Explore")}),R.createElement(of,{pageId:e,isActive:n==="My communities",onClick:()=>i("My communities")}))),R.createElement("div",{className:$1.socialHomePage__contents,ref:l,onScroll:u},n==="Newsfeed"&&R.createElement(L5,{pageId:e}),n==="Explore"&&R.createElement(wc,{isOpen:!1,toggleOpen:()=>{},hideSideMenu:!0}),n==="My communities"&&R.createElement(N5,{pageId:e})),a&&R.createElement("div",{className:$1.socialHomePage__createPostMenu},R.createElement(p5,{pageId:e})))}function F5({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:n,goToMyCommunitiesSearchPage:i}=Be(),{isExcluded:a,themeStyles:s}=te({pageId:e,componentId:r}),l=()=>{switch(t){case"Newsfeed":n();break;case"Explore":break;case"My communities":i();break}};return a?null:R.createElement("div",{className:D5.topNavigation,style:s},R.createElement("div",{className:D5.topNavigationLeftPane},R.createElement(Rg,{pageId:e,componentId:r})),R.createElement("div",{className:D5.topNavigationRightPane},R.createElement(Yg,{pageId:e,componentId:r,onPress:l}),t!=="Explore"&&R.createElement(Xg,{pageId:e,componentId:r,onClick:o})))}var ha={container:"wm",headerImageContainer:"ym",headerImage:"km",backButton:"ar",moreButton:"or",content:"jm",name:"zm",description:"Xm",communityProfile__communityInfo__container:"Ym",divider:"Cm",statCount:"Am",statTitle:"Mm",menuButton:"Sm",communityProfile__joinButton__container:"Em",communityProfile__joinButton:"Fm",communityProfile__pendingPost__container:"Im",communityProfile__menuItem:"Rm",communityProfile__privateIcon:"Um",communityProfile__divider:"Bm"};var O5={communityTabs__container:"Dm",communityTabs__tab:"tr"};var cL=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",fill:"none",viewBox:"0 0 25 24"},R.createElement("path",{fill:"currentColor",d:"M9.219 14.5c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h7.312c.457 0 .844.387.844.844a.833.833 0 01-.844.844H9.22zm0 3.375c-.492 0-.844-.352-.844-.844 0-.457.352-.843.844-.843h3.937c.457 0 .844.386.844.843a.833.833 0 01-.844.844H9.22zm0-6.75c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h7.312c.457 0 .844.387.844.844a.833.833 0 01-.844.844H9.22zM18.5 3.25c1.23 0 2.25 1.02 2.25 2.25V19c0 1.266-1.02 2.25-2.25 2.25H7.25A2.221 2.221 0 015 19V5.5c0-1.23.984-2.25 2.25-2.25H18.5zM19.063 19V7.75H6.688V19c0 .316.246.563.562.563H18.5a.578.578 0 00.563-.563z"}));var pL=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"35",height:"34",fill:"none",viewBox:"0 0 35 34"},R.createElement("path",{fill:"currentColor",d:"M21.998 18.295c.372 2.014-.15 4.027-1.567 5.444a.833.833 0 01-1.193 0l-3.58-3.58-2.585 2.586c-.025.025-.074.025-.1.05l-1.59.795c-.224.125-.497-.149-.373-.373l.795-1.59.075-.075 2.585-2.585-3.58-3.58c-.348-.348-.348-.845 0-1.194 1.418-1.416 3.406-1.963 5.42-1.59l1.218-.92-.671-.671c-.348-.348-.348-.846 0-1.194l2.386-2.386a.833.833 0 011.194 0l6.761 6.761a.856.856 0 010 1.194l-2.386 2.386a.833.833 0 01-1.194 0l-.696-.696-.92 1.218zm-9.273-3.455l7.035 7.035c.746-1.143.845-2.635.398-3.928l2.61-3.405 1.442 1.441 1.193-1.193-5.568-5.568-1.193 1.193 1.442 1.442-3.406 2.61c-1.318-.472-2.81-.373-3.953.373z"}));var nf=({pageId:e,componentId:t="*",activeTab:o,onTabChange:r})=>{let n="community_profile_tab",{isExcluded:i,accessibilityId:a,themeStyles:s}=A({pageId:e,componentId:t,elementId:n});return i?null:R.createElement("div",{"data-qa-anchor":a,style:s,className:O5.communityTabs__container},R.createElement(O,{"data-is-active":o==="community_feed",onPress:()=>r("community_feed"),className:O5.communityTabs__tab},R.createElement(cL,null)),R.createElement(O,{"data-is-active":o==="community_pin",onPress:()=>r("community_pin"),className:O5.communityTabs__tab},R.createElement(pL,null)))};var sd={communityCover__container:"ir",communityCover__topBar:"Hm",communityCover__backButton:"Lm",communityCover__menuButton:"Tm"};var uL={menuButton:"Vm"};function af({pageId:e="*",componentId:t="*",onClick:o,className:r,defaultClassName:n}){let i="menu_button",{isExcluded:a,accessibilityId:s,themeStyles:l,config:d,defaultConfig:p,uiReference:u}=A({pageId:e,componentId:t,elementId:i});return a?null:R.createElement(O,{className:r,onPress:o,"data-qa-anchor":s},R.createElement(ee,{defaultIcon:()=>R.createElement(w5,{className:cr(uL.menuButton,n),style:l}),imgIcon:()=>R.createElement("img",{src:d.icon,alt:u}),defaultIconName:p.icon,configIconName:d.icon}))}var sf=({pageId:e="*",componentId:t="*",image:o,onBack:r,onClickMenu:n})=>{let i="community_cover",{isExcluded:a,accessibilityId:s,themeStyles:l,config:d}=A({pageId:e,componentId:t,elementId:i}),p=o?{backgroundImage:`url(${o})`}:{background:"linear-gradient(180deg, #a5a9b5 0%, #636878 100%)"};return a?null:R.createElement("div",{className:sd.communityCover__container,"data-qa-anchor":s,style:c(c({},l),p)},R.createElement("div",{style:c({},p)}),R.createElement("div",{className:sd.communityCover__topBar},R.createElement(wm,{defaultClassName:sd.communityCover__backButton,onPress:r}),R.createElement(af,{className:sd.communityCover__menuButton,onClick:n})))};var lf={communityJoinButton:"qm",joinButton:"Gm"};var fL=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 384 512",fill:"currentColor"},e),R.createElement("path",{d:`M368 224H224V80c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v144H16c-8.84 0-16 7.16-16
4743
4743
  16v32c0 8.84 7.16 16 16 16h144v144c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V288h144c8.84
4744
4744
  0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z`}));var mf=({pageId:e="*",componentId:t="*",onClick:o,className:r,defaultClassName:n})=>{let i="community_join_button",{config:a,themeStyles:s,accessibilityId:l,isExcluded:d,uiReference:p,defaultConfig:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{"data-qa-anchor":l,style:s,onPress:o,className:cr(lf.communityJoinButton,r)},R.createElement(ee,{defaultIcon:()=>R.createElement(fL,{className:cr(lf.joinButton,n)}),imgIcon:()=>R.createElement("img",{src:a.icon,alt:p}),defaultIconName:u.icon,configIconName:a.icon}),"Join")};var H2e=createContext({activeTab:"community_feed",setActiveTab:()=>{}}),$5=()=>useContext(H2e);var hL=()=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},R.createElement("circle",{cx:"9.88525",cy:"10",r:"5.5",fill:"white"}),R.createElement("path",{d:"M8.62899 17.3036C9.55401 18.2356 10.4373 18.2286 11.3693 17.3036L12.4125 16.2604C12.5099 16.163 12.5934 16.1352 12.7185 16.1352H14.193C15.5075 16.1352 16.1334 15.5092 16.1334 14.1947V12.7203C16.1334 12.5951 16.1682 12.5047 16.2586 12.4143L17.3019 11.3641C18.2339 10.439 18.2269 9.55575 17.3019 8.63073L16.2586 7.58748C16.1682 7.49011 16.1334 7.40665 16.1334 7.28146V5.807C16.1334 4.4925 15.5075 3.86655 14.193 3.86655H12.7185C12.5934 3.86655 12.5029 3.83178 12.4125 3.74136L11.3693 2.69811C10.4373 1.76614 9.55401 1.76614 8.62899 2.70507L7.58574 3.74136C7.49533 3.83178 7.40491 3.86655 7.27972 3.86655H5.80526C4.49076 3.86655 3.86481 4.47859 3.86481 5.807V7.28146C3.86481 7.40665 3.83004 7.49707 3.73962 7.58748L2.69637 8.63073C1.7644 9.55575 1.77136 10.439 2.69637 11.3641L3.73962 12.4143C3.83004 12.5047 3.86481 12.5951 3.86481 12.7203V14.1947C3.86481 15.5092 4.49076 16.1352 5.80526 16.1352H7.27972C7.40491 16.1352 7.48837 16.163 7.58574 16.2604L8.62899 17.3036ZM8.8446 13.5618C8.60117 13.5618 8.40643 13.4714 8.25342 13.3115L6.02782 10.8216C5.90959 10.6964 5.84699 10.5225 5.84699 10.3486C5.84699 9.93132 6.14606 9.63225 6.57727 9.63225C6.81374 9.63225 6.98761 9.70876 7.14062 9.87568L8.81678 11.7466L12.1691 6.96153C12.336 6.72506 12.5168 6.62769 12.795 6.62769C13.2263 6.62769 13.5323 6.92676 13.5323 7.33015C13.5323 7.46925 13.4766 7.64312 13.3723 7.78918L9.47055 13.2628C9.31059 13.4714 9.10194 13.5618 8.8446 13.5618Z",fill:"#1054DE"}));var pf=({pageId:e="*",componentId:t="*"})=>{let o="community_verify_badge",{config:r,themeStyles:n,accessibilityId:i,isExcluded:a,uiReference:s,defaultConfig:l}=A({pageId:e,componentId:t,elementId:o});return a?null:R.createElement(ee,{"data-qa-anchor":i,defaultIcon:()=>R.createElement(hL,null),imgIcon:()=>R.createElement("img",{src:r.icon,alt:s}),defaultIconName:l.icon,configIconName:r.icon})};var md={descriptionWrapper:"Jm",description:"lr",expanded:"Km",toggleButton:"Nm"};var uf=({pageId:e="*",componentId:t="*",description:o=""})=>{let[r,n]=useState(!1),[i,a]=useState(!1),s=useRef(null),l="community_description",{themeStyles:d,accessibilityId:p,isExcluded:u}=A({pageId:e,componentId:t,elementId:l}),g=180,f=o.length>g?o.slice(0,g):o;if(useEffect(()=>{s.current&&a(o.length>g);},[o]),u)return null;let y=()=>n(!0);return R.createElement("div",{"data-qa-anchor":p,style:d,className:md.descriptionWrapper},R.createElement("div",{ref:s,className:`${md.description} ${r?md.expanded:""}`},R.createElement(S.Body,null,r?o:f," ",i&&!r&&R.createElement(O,{onPress:y,className:md.toggleButton}," ","...See more"))))};var vL={communityName__truncate:"Om"};var gf=({pageId:e="*",componentId:t="*",name:o=""})=>{let r="community_name",{config:n,themeStyles:i,accessibilityId:a,isExcluded:s}=A({pageId:e,componentId:t,elementId:r});return s?null:R.createElement(S.Heading,{"data-qa-anchor":a,className:vL.communityName__truncate},o)};var cd={communityInfo__container:"Pm",communityInfo__wrapper:"Qm",communityInfo__count:"Wm",communityInfo__title:"Zm"};var G5=({pageId:e="*",componentId:t="*",count:o,text:r,onClick:n})=>{let i="community_info",{config:a,accessibilityId:s,themeStyles:l,isExcluded:d}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{onPress:n,className:cd.communityInfo__container},R.createElement("div",{className:cd.communityInfo__wrapper},R.createElement(S.BodyBold,{className:cd.communityInfo__count},ib(o)),R.createElement(S.Caption,{className:cd.communityInfo__title},r)))};var G2e=t=>{var e=P(t,[]);return R.createElement("svg",c({width:"61",height:"61",viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M33.0312 44.25C33.0312 45.7266 31.8711 46.7812 30.5 46.7812C29.0234 46.7812 27.9688 45.7266 27.9688 44.25V37.5C27.9688 36.1289 29.0234 34.9688 30.5 34.9688C31.8711 34.9688 33.0312 36.1289 33.0312 37.5V44.25ZM30.5 3.75C37.8828 3.75 44 9.86719 44 17.25V24H47.375C51.0664 24 54.125 27.0586 54.125 30.75V51C54.125 54.7969 51.0664 57.75 47.375 57.75H13.625C9.82812 57.75 6.875 54.7969 6.875 51V30.75C6.875 27.0586 9.82812 24 13.625 24H17V17.25C17 9.86719 23.0117 3.75 30.5 3.75ZM30.5 8.8125C25.7539 8.8125 22.0625 12.6094 22.0625 17.25V24H38.9375V17.25C38.9375 12.6094 35.1406 8.8125 30.5 8.8125ZM13.625 29.0625C12.6758 29.0625 11.9375 29.9062 11.9375 30.75V51C11.9375 51.9492 12.6758 52.6875 13.625 52.6875H47.375C48.2188 52.6875 49.0625 51.9492 49.0625 51V30.75C49.0625 29.9062 48.2188 29.0625 47.375 29.0625H13.625Z"}))},Z5=G2e;var Q5=({pageId:e="*",community:t})=>{let {onBack:o,onEditCommunity:r}=Be(),{activeTab:n,setActiveTab:i}=$5(),{communityCategories:a,avatarFileUrl:s,joinCommunity:l,pendingPostsCount:d,canReviewCommunityPosts:p}=yc(t.communityId),u=f=>{i(f);};t.isJoined&&t.postSetting&&p&&d>0;return R.createElement("div",{className:ha.container},R.createElement(sf,{pageId:e,image:s,onBack:o,onClickMenu:()=>r(t.communityId)}),R.createElement("div",{className:ha.content},R.createElement("div",{className:ha.name},!t.isPublic&&R.createElement(Z5,{className:ha.communityProfile__privateIcon}),R.createElement(gf,{pageId:e,name:t.displayName}),t.isOfficial&&R.createElement(pf,null)),R.createElement(Ln,{pageId:e,categories:a}),R.createElement(uf,{pageId:e,description:t.description||""}),R.createElement("div",{className:ha.communityProfile__communityInfo__container},R.createElement(G5,{count:t.postsCount,text:"posts"}),R.createElement("div",{className:ha.divider}),R.createElement(G5,{count:t.membersCount,text:"members",onClick:()=>r(t.communityId,"MEMBERS")})),!t.isJoined&&t.isPublic&&R.createElement("div",{className:ha.communityProfile__joinButton__container},R.createElement(mf,{onClick:l})),R.createElement("div",null,R.createElement(Um,{type:"communityFeed",communityId:t.communityId})),R.createElement(nf,{pageId:e,activeTab:n,onTabChange:u})),R.createElement("div",{className:ha.communityProfile__divider}))};var Q2e=10;function ff({targetType:e,targetId:t,feedType:o,limit:r=Q2e}){let a=dt({fetcher:PostRepository.getPosts,params:{targetType:e,targetId:t,feedType:o,limit:r},shouldCall:!!t&&!!e}),{items:n}=a,i=P(a,["items"]);return c({posts:n},i)}var lo={communityFeed__container:"_m",communityFeed__loadingIndicator:"ep",communityFeed__observerTarget:"rp",communityFeed__post:"ap",communityFeed__spinner:"op",spin:"sr",communityFeed__postContent:"tp",communityFeed__postSkeleton:"ip",communityFeed__postSkeletonHeader:"lp",communityFeed__postSkeletonAvatar:"cr",communityFeed__postSkeletonUserInfo:"sp",communityFeed__postSkeletonUsername:"nr",communityFeed__postSkeletonSubtitle:"dr",communityFeed__postSkeletonContent:"cp",communityFeed__postSkeletonLine:"s",pulse:"mr",communityFeed__emptyPost:"np",communityFeed__emptyPostIcon:"dp",communityFeed__emptyPostText:"mp",communityFeed__announcePost:"pp"};var q2e=t=>{var e=P(t,[]);return R.createElement("svg",c({width:"61",height:"41",viewBox:"0 0 61 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R.createElement("path",{d:"M58.3438 0.5C59.7148 0.5 60.875 1.66016 60.875 3.03125V38.4688C60.875 39.9453 59.7148 41 58.3438 41H5.1875C2.33984 41 0.125 38.7852 0.125 35.9375V6.40625C0.125 5.03516 1.17969 3.875 2.65625 3.875H6.875V3.03125C6.875 1.66016 7.92969 0.5 9.40625 0.5H58.3438ZM3.5 35.9375C3.5 36.8867 4.23828 37.625 5.1875 37.625C6.03125 37.625 6.875 36.8867 6.875 35.9375V7.25H3.5V35.9375ZM57.5 37.625V3.875H10.25V35.9375V36.043C10.25 36.4648 10.0391 37.2031 9.93359 37.625H57.5ZM14.8906 27.5C14.1523 27.5 13.625 26.9727 13.625 26.2344V8.51562C13.625 7.88281 14.1523 7.25 14.8906 7.25H32.6094C33.2422 7.25 33.875 7.88281 33.875 8.51562V26.2344C33.875 26.9727 33.2422 27.5 32.6094 27.5H14.8906ZM17 10.625V24.125H30.5V10.625H17ZM13.625 32.9844V32.1406C13.625 31.5078 14.1523 30.875 14.8906 30.875H32.6094C33.2422 30.875 33.875 31.5078 33.875 32.1406V32.9844C33.875 33.7227 33.2422 34.25 32.6094 34.25H14.8906C14.1523 34.25 13.625 33.7227 13.625 32.9844ZM37.25 32.9844V32.1406C37.25 31.5078 37.7773 30.875 38.5156 30.875H52.8594C53.4922 30.875 54.125 31.5078 54.125 32.1406V32.9844C54.125 33.7227 53.4922 34.25 52.8594 34.25H38.5156C37.7773 34.25 37.25 33.7227 37.25 32.9844ZM37.25 26.2344V25.3906C37.25 24.7578 37.7773 24.125 38.5156 24.125H52.8594C53.4922 24.125 54.125 24.7578 54.125 25.3906V26.2344C54.125 26.9727 53.4922 27.5 52.8594 27.5H38.5156C37.7773 27.5 37.25 26.9727 37.25 26.2344ZM37.25 12.7344V11.8906C37.25 11.2578 37.7773 10.625 38.5156 10.625H52.8594C53.4922 10.625 54.125 11.2578 54.125 11.8906V12.7344C54.125 13.4727 53.4922 14 52.8594 14H38.5156C37.7773 14 37.25 13.4727 37.25 12.7344ZM37.25 19.4844V18.6406C37.25 18.0078 37.7773 17.375 38.5156 17.375H52.8594C53.4922 17.375 54.125 18.0078 54.125 18.6406V19.4844C54.125 20.2227 53.4922 20.75 52.8594 20.75H38.5156C37.7773 20.75 37.25 20.2227 37.25 19.4844Z"}))},W5=q2e;var dd={lockPrivateContent__wrap:"gp",lockPrivateContent__lockIcon:"hp",lockPrivateContent__title:"fp",lockPrivateContent__body:"bp"};var pd=()=>R.createElement("div",{className:dd.lockPrivateContent__wrap},R.createElement(Z5,{className:dd.lockPrivateContent__lockIcon}),R.createElement(S.Title,{className:dd.lockPrivateContent__title},"This community is private"),R.createElement(S.Body,{className:dd.lockPrivateContent__body},"Only invited members can see the posts."));function ud({communityId:e,level:t,shouldSubscribe:o=!0,callback:r}){return ea({fetcher:CommunityRepository.getCommunity,params:e,callback:r,shouldSubscribe:!!e&&o,getSubscribedTopic:({data:n})=>getCommunityTopic(n,t)})}function gd({communityId:e,placement:t}){let n=dt({fetcher:PostRepository.getPinnedPosts,params:{communityId:e,placement:t,sortBy:"lastPinned"},shouldCall:!!e}),{items:o}=n,r=P(n,["items"]);return c({pinnedPost:o},r)}var fd=()=>R.createElement("div",{className:lo.communityFeed__postSkeleton},R.createElement("div",{className:lo.communityFeed__postSkeletonHeader},R.createElement("div",{className:lo.communityFeed__postSkeletonAvatar}),R.createElement("div",{className:lo.communityFeed__postSkeletonUserInfo},R.createElement("div",{className:lo.communityFeed__postSkeletonUsername}),R.createElement("div",{className:lo.communityFeed__postSkeletonSubtitle}))),R.createElement("div",{className:lo.communityFeed__postSkeletonContent},R.createElement("div",{className:lo.communityFeed__postSkeletonLine}),R.createElement("div",{className:lo.communityFeed__postSkeletonLine}),R.createElement("div",{className:lo.communityFeed__postSkeletonLine}))),K5=({pageId:e="*",communityId:t})=>{let o="community_feed_component",{isExcluded:r,accessibilityId:n,themeStyles:i}=te({pageId:e,componentId:o}),{community:a}=Pt({communityId:t,shouldCall:!!t}),s=(a==null?void 0:a.isJoined)&&!(a!=null&&a.isPublic),{posts:l,hasMore:d,loadMore:p,isLoading:u}=ff({feedType:"published",targetId:t,targetType:"community",limit:10}),{pinnedPost:g,isLoading:f,refresh:y}=gd({communityId:t,placement:"announcement"}),{AmityCommunityProfilePageBehavior:v}=bt();ud({communityId:t,level:SubscriptionLevels.POST});let C=useRef(null);if(useEffect(()=>{let b=new IntersectionObserver(M=>_(void 0,null,function*(){M[0].isIntersecting&&d&&p();}),{threshold:.5});return C.current&&b.observe(C.current),()=>{C.current&&b.unobserve(C.current);}},[d,p]),useEffect(()=>{y();},[]),r)return null;let h=()=>{let b=l.filter(M=>!g.some(I=>I.post.postId===M.postId));return R.createElement(R.Fragment,null,u?Array.from({length:2}).map((M,I)=>R.createElement(fd,{key:I})):b&&b.map(M=>R.createElement(O,{className:lo.communityFeed__postContent,onPress:()=>{var I;return (I=v==null?void 0:v.goToPostDetailPage)==null?void 0:I.call(v,{postId:M.postId,hideTarget:!0})}},R.createElement(fn,{key:M.postId,post:M,category:"general",style:"feed",hideTarget:!0,onClick:()=>{var I;return (I=v==null?void 0:v.goToPostDetailPage)==null?void 0:I.call(v,{postId:M.postId,hideTarget:!0})}}))),(l==null?void 0:l.length)===0&&!u&&R.createElement("div",{className:lo.communityFeed__emptyPost},R.createElement(W5,{className:lo.communityFeed__emptyPostIcon}),R.createElement("p",{className:lo.communityFeed__emptyPostText},"No post yet")),R.createElement("div",{ref:C,className:lo.communityFeed__observerTarget}))},x=()=>f?R.createElement(fd,null):g&&g.map(({post:b})=>R.createElement(O,{onPress:()=>{var M;(M=v==null?void 0:v.goToPostDetailPage)==null||M.call(v,{postId:b.postId,hideTarget:!0,category:"announcement"});},className:lo.communityFeed__announcePost},R.createElement(fn,{key:b.postId,post:b,category:"announcement",style:"feed",hideTarget:!0,onClick:()=>{var M;return (M=v==null?void 0:v.goToPostDetailPage)==null?void 0:M.call(v,{postId:b.postId,hideTarget:!0})},onPostDeleted:()=>y()})));return R.createElement("div",{"data-qa-anchor":n,className:lo.communityFeed__container,style:i},s||a!=null&&a.isPublic?R.createElement(R.Fragment,null,x(),h()):R.createElement(pd,null))};var wL=({communityId:e})=>R.createElement("div",null,"CommunityPinnedPost");var oce=Ta`
4745
4745
  from {
@@ -4750,7 +4750,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),R.cre
4750
4750
  }
4751
4751
  `,rce=m.svg`
4752
4752
  animation: ${oce} 2s linear infinite;
4753
- `,nce=e=>R.createElement(rce,c({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"})),J5=nce;var hf={storyCommentButton:"up",storyCommentIcon:"vp"};var sce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),R.createElement("path",{fill:"#A5A9B5",d:"M10 2.188c4.682 0 8.5 3.12 8.5 6.906C18.5 12.912 14.682 16 10 16c-1.295 0-2.49-.232-3.586-.63-.797.663-2.457 1.693-4.648 1.693-.133 0-.2-.034-.266-.133-.033-.1 0-.233.066-.3 0-.032 1.395-1.493 1.827-3.187-1.196-1.195-1.893-2.69-1.893-4.35 0-3.784 3.785-6.905 8.5-6.905z"})),ML=({pageId:e="*",componentId:t="*",onPress:o,commentsCount:r,imgClassName:n})=>{let i="story_comment_button",{isExcluded:a,accessibilityId:s,defaultConfig:l,config:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return a?null:R.createElement(O,{"data-qa-anchor":s,onPress:o,style:u,className:cr(hf.storyCommentButton)},R.createElement(ee,{defaultIconName:l.icon,configIconName:d.icon,imgIcon:()=>R.createElement("img",{src:d.icon,alt:p,className:cr(n),style:u}),defaultIcon:()=>R.createElement("div",{className:cr(hf.storyCommentIcon)},R.createElement(sce,null),R.createElement(S.BodyBold,null,ib(r)))}))};var vf={storyReactionButton:"xp",storyReactionIcon:"wp"};var cce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),R.createElement("path",{fill:"#A5A9B5",d:"M17.793 11.025c.148.854.037 1.67-.334 2.338a3.437 3.437 0 01-.668 2.487c-.037 2.078-1.299 3.525-4.156 3.525h-.854c-3.785 0-4.935-1.41-6.605-1.447-.112.482-.594.853-1.114.853H1.688c-.667 0-1.187-.52-1.187-1.187V8.687c0-.63.52-1.187 1.188-1.187h3.636c.705-.594 1.707-2.227 2.56-3.08.52-.52.372-4.045 2.673-4.045 2.115 0 3.525 1.188 3.525 3.896 0 .706-.148 1.262-.334 1.745h1.373c1.781 0 3.191 1.521 3.191 3.154 0 .705-.185 1.299-.519 1.855zm-2.3 2.004c.816-.742.704-1.892.185-2.449.37 0 .853-.705.853-1.373-.037-.705-.63-1.41-1.41-1.41h-3.86c0-1.41 1.04-2.078 1.04-3.526 0-.89 0-2.115-1.744-2.115-.705.705-.372 2.487-1.41 3.526-1.002 1.002-2.45 3.6-3.526 3.6H5.25v6.939c1.967 0 3.71 1.373 6.346 1.373h1.41c1.299 0 2.264-.631 1.967-2.412.556-.334 1.002-1.373.52-2.153zM3.765 16.406a.903.903 0 00-.891-.89.88.88 0 00-.89.89c0 .52.37.89.89.89a.88.88 0 00.89-.89z"})),dce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),R.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#paint0_linear_7702_34939)"}),R.createElement("path",{fill:"#fff",d:"M7.486 10.575H5.42a.611.611 0 00-.62.619v6.187c0 .361.258.619.62.619h2.066c.336 0 .62-.258.62-.619v-6.187a.628.628 0 00-.62-.62zm-1.033 6.394a.596.596 0 01-.62-.62c0-.334.258-.618.62-.618.336 0 .62.284.62.619 0 .36-.284.619-.62.619zm8.264-10.055c0-1.908-1.24-2.114-1.859-2.114-.542 0-.775 1.031-.878 1.495-.155.567-.284 1.134-.672 1.521-.826.851-1.265 1.908-2.298 2.913a.415.415 0 00-.078.232v5.518c0 .154.13.283.284.31.414 0 .956.231 1.37.412.826.36 1.833.799 3.073.799h.077c1.11 0 2.428 0 2.944-.748.233-.31.285-.696.155-1.16.44-.438.646-1.263.44-1.934.439-.593.49-1.443.232-2.036.31-.31.516-.8.49-1.264 0-.799-.67-1.52-1.523-1.52h-2.635c.207-.723.878-1.341.878-2.424z"}),R.createElement("defs",null,R.createElement("linearGradient",{id:"paint0_linear_7702_34939",x1:"9",x2:"19.8",y1:"2.4",y2:"29.4",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#5B9DFF"}),R.createElement("stop",{offset:"1",stopColor:"#0041BE"})))),PL=({myReactions:e=[],reactionsCount:t,pageId:o="*",componentId:r="*",defaultIconClassName:n,imgIconClassName:i,onPress:a})=>{let s="story_reaction_button",{isExcluded:l,accessibilityId:d,config:p,uiReference:u,themeStyles:g}=A({pageId:o,componentId:r,elementId:s}),f=e.length>0;return l?null:R.createElement(O,{"data-qa-anchor":d,className:cr(vf.storyReactionButton),onPress:a,style:g},R.createElement(ee,{defaultIcon:()=>R.createElement("div",{className:cr(vf.storyReactionIcon,n)},f?R.createElement(dce,null):R.createElement(cce,null),R.createElement(S.BodyBold,null,ib(t))),imgIcon:()=>R.createElement("img",{src:p.icon,alt:u,className:cr(i)})}))};var ws={viewStoryCompostBarContainer:"yp",viewStoryFailedCompostBarContainer:"kp",viewStoryFailedCompostBarWrapper:"jp",viewStoryUploadingWrapper:"zp",viewStoryCompostBarViewIconContainer:"Xp",viewStoryCompostBarEngagementContainer:"Yp",viewStoryCommentButton:"Cp",viewStoryCommentIcon:"Ap"};var uce=({pageId:e="*",syncState:t,reach:o,commentsCount:r,reactionsCount:n,isLiked:i,storyId:a,onClickComment:s,showImpression:l,isMember:d,myReactions:p})=>{let u=_o(),g=()=>_(void 0,null,function*(){try{if(!d){u.info({content:"Join community to interact with all stories"});return}i?yield ReactionRepository.removeReaction("story",a,ur):yield ReactionRepository.addReaction("story",a,ur);}catch(f){console.error("Can't toggle like",f);}});return t==="syncing"?R.createElement("div",{className:ws.viewStoryCompostBarContainer},R.createElement("div",{className:ws.viewStoryUploadingWrapper},R.createElement(J5,{width:20,height:20}),"Uploading...")):t==="error"?R.createElement("div",{className:ws.viewStoryFailedCompostBarContainer},R.createElement("div",{className:ws.viewStoryFailedCompostBarWrapper},R.createElement(y4,null),R.createElement("span",null,"Failed to upload")),R.createElement(ka,null)):R.createElement("div",{className:ws.viewStoryCompostBarContainer},R.createElement("div",null,l&&R.createElement("div",{className:ws.viewStoryCompostBarViewIconContainer},R.createElement(F3,{reach:o}))),R.createElement("div",{className:ws.viewStoryCompostBarEngagementContainer},R.createElement(ML,{pageId:e,commentsCount:r,onPress:s}),R.createElement(PL,{pageId:e,myReactions:p,reactionsCount:n,onPress:g})))},X5=uce;var Kr={iconButton:"Mp",rendererContainer:"Sp",storyVideo:"Ep",muteCircleIcon:"Fp",unmuteCircleIcon:"Ip",loadingOverlay:"Rp",storyImage:"Up",playStoryButton:"Bp",pauseStoryButton:"Dp",closeButton:"Hp",verifiedBadge:"Lp",dotsButton:"Tp",viewStoryInfoContainer:"Vp",viewStoryCompostBarContainer:"qp",viewStoryCompostBarViewIconContainer:"Gp",viewStoryCompostBarEngagementContainer:"Jp",viewStoryCompostBarEngagementIconContainer:"Kp",storyContent:"Np",header:"Op",viewStoryContainer:"Pp",viewStoryHeaderContainer:"Qp",avatarContainer:"Wp",addStoryButton:"pr",viewStoryHeaderListActionsContainer:"Zp",viewStoryHeadingInfoContainer:"_p",viewStoryHeading:"eg",viewStoryHeadingTitle:"rg",viewStorySubHeading:"ag"};var hce=({community:e,heading:t,subheading:o,isHaveActions:r,isOfficial:n,isPaused:i,onPlay:a,onPause:s,onAction:l,onClose:d,onClickCommunity:p,haveStoryPermission:u,addStoryButton:g})=>R.createElement("div",{className:Kr.viewStoryHeaderContainer},R.createElement("div",{className:Kr.viewStoryHeadingInfoContainer},R.createElement("div",{className:Kr.avatarContainer},R.createElement(jr,{pageId:"story_page",community:e}),u&&g),R.createElement("div",{className:Kr.viewStoryInfoContainer},R.createElement("div",{className:Kr.viewStoryHeading},R.createElement(pw,{lines:1},R.createElement("div",{className:Kr.viewStoryHeadingTitle,"data-qa-anchor":"community_display_name",onClick:p},t)),n&&R.createElement(p1,{className:Kr.verifiedBadge})),R.createElement("span",{className:Kr.viewStorySubHeading},o))),R.createElement("div",{className:Kr.viewStoryHeaderListActionsContainer},i?R.createElement(Mo,{className:Kr.playStoryButton,"data-qa-anchor":"play_button",onClick:a}):R.createElement(As,{className:Kr.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:s}),r&&R.createElement(O3,{pageId:"story_page",onPress:l}),R.createElement(kr,{defaultClassName:cr(Kr.closeButton),pageId:"story_page",onPress:d}))),Y5=hce;function yd({queryParams:e,shouldCall:t=!0}){let n=dt({fetcher:CommunityRepository.Membership.getMembers,params:E(c({},e),{includeDeleted:!1}),shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=n,r=P(n,["items"]);return c({members:o},r)}var vo={iconButton:"og",hyperLinkContainer:"gr",rendererContainer:"tg",storyVideo:"ig",muteCircleIcon:"lg",unmuteCircleIcon:"sg",loadingOverlay:"cg",storyImageContainer:"ng",storyImage:"dg",playStoryButton:"mg",pauseStoryButton:"pg",closeButton:"gg",verifiedBadge:"hg",dotsButton:"fg",viewStoryInfoContainer:"bg",viewStoryCompostBarContainer:"ug",viewStoryCompostBarViewIconContainer:"vg",viewStoryCompostBarEngagementContainer:"xg",viewStoryCompostBarEngagementIconContainer:"wg",header:"yg",viewStoryContainer:"kg",viewStoryHeaderContainer:"jg",avatarContainer:"zg",addStoryButton:"hr",viewStoryHeaderListActionsContainer:"Xg",viewStoryHeadingInfoContainer:"Yg",viewStoryHeading:"Cg",viewStoryHeadingTitle:"Ag",viewStorySubHeading:"Mg",story:"Sg",storyContent:"Eg",actionButton:"fr",navigationOverlay:"Fg",leftOverlay:"Ig",rightOverlay:"Rg",imageFit:"Ug",imageFill:"Bg"};var R5={progressBarContainer:"Dg",progressSegment:"Hg",progressBar:"Lg"};var e2=R.memo(({pageId:e="*",componentId:t="*",duration:o,currentIndex:r,storiesCount:n,isPaused:i,onComplete:a})=>{let s="progress_bar",{config:l,isExcluded:d}=A({pageId:e,componentId:t,elementId:s}),[p,u]=useState(new Array(n).fill(0)),[g,f]=useState(r),y=l==null?void 0:l.backgroundColor,v=l==null?void 0:l.progressColor;return useEffect(()=>{r<g&&u(C=>{let h=[...C];return h[r]=0,h}),f(r);},[r,g]),useEffect(()=>{let C;return i||(C=setInterval(()=>{u(h=>{let x=[...h];return x[r]<100&&(x[r]+=100/o*100,x[r]>=100&&(x[r]=100,a())),x});},100)),()=>{C&&clearInterval(C);}},[o,r,i,a]),d?null:R.createElement("div",{className:cr(R5.progressBarContainer),style:{backgroundColor:y}},p.map((C,h)=>R.createElement("div",{key:h,className:cr(R5.progressSegment),style:{width:`calc(${100/n}% - 4px)`}},R.createElement("div",{className:cr(R5.progressBar),style:{width:`${h<r?100:h===r?C:0}%`,backgroundColor:v}}))))});var Pce=({story:{actions:e,fileInputRef:t,addStoryButton:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l,url:d},action:p,config:u,onClose:g,onClickCommunity:f})=>{var Li,wa,rt,In;let{formatMessage:y}=useIntl(),[v,C]=useState(!1),[h,x]=useState(!1),[b,M]=useState(!1),[I,w]=useState(!1),{loader:N}=u,{client:T}=Ae(),[L,D]=useState(""),U=useRef(null),Z=!!(l&&l.myReactions&&l.myReactions.includes(On)),B=(l==null?void 0:l.reactionsCount)||0,{storyId:$,syncState:G,reach:q,commentsCount:z,createdAt:H,creator:F,community:j,myReactions:Q,data:k,items:V}=l,{members:ae}=yd({queryParams:{communityId:j==null?void 0:j.communityId},shouldCall:!!(j!=null&&j.communityId)}),be=(ae==null?void 0:ae.find(Ke=>Ke.userId===(T==null?void 0:T.userId)))!=null,{user:pe}=fr(T==null?void 0:T.userId),We=(j==null?void 0:j.isOfficial)||!1,vt=(F==null?void 0:F.userId)===(pe==null?void 0:pe.userId),eo=l5(pe==null?void 0:pe.roles),Vt=s5(pe==null?void 0:pe.roles),De=eo||Vt||us(T,j==null?void 0:j.communityId),ir=useMemo(()=>R.createElement("div",{"data-qa-anchor":"community_display_name"},j==null?void 0:j.displayName),[j==null?void 0:j.displayName]),Dr=useMemo(()=>H&&(F!=null&&F.displayName)?R.createElement("span",null,R.createElement("span",{"data-qa-anchor":"created_at"},m5(H))," \u2022 By"," ",R.createElement("span",{"data-qa-anchor":"creator_display_name"},F==null?void 0:F.displayName)):"",[H,F==null?void 0:F.displayName]),qe="asc-uikit-stories-viewer",Rr=useCallback(()=>{if(U.current&&U.current.complete){let to=new Mce().getPalette(U.current,2);if(to){let Je=`linear-gradient(to top, rgb(${to[0].join(",")}), rgb(${to[1].join(",")})`;D(Je);}}},[]),bn=useCallback(()=>{C(!0),I&&w(!1),p("play",!0),Rr();},[p,I,Rr]),Hr=()=>{p("play",!0),w(!1);},en=()=>{p("pause",!0),w(!0);},ce=()=>{p("pause",!0),x(!0);},ue=()=>{p("play",!0),x(!1);},tn=()=>{p("pause",!0),M(!0);},Uo=()=>{p("play",!0),M(!1);},Fr=()=>{g();},Bi=()=>{i();};return useEffect(()=>{U.current&&U.current.complete&&Rr();},[]),useEffect(()=>{if(t.current){let Ke=()=>{p("pause",!0),w(!0);},to=()=>{p("play",!0),w(!1);};return t.current.addEventListener("click",Ke),t.current.addEventListener("cancel",to),()=>{t.current&&(t.current.removeEventListener("cancel",to),t.current.removeEventListener("click",Ke));}}},[t]),useEffect(()=>{var Ke,to;if(s){let Je=()=>{p("pause",!0),w(!0);},oo=()=>{p("play",!0),w(!1);};return (Ke=s.current)==null||Ke.addEventListener("dragstart",Je),(to=s.current)==null||to.addEventListener("dragend",oo),()=>{var Ai,ar;(Ai=s.current)==null||Ai.removeEventListener("dragstart",Je),(ar=s.current)==null||ar.removeEventListener("dragend",oo);}}},[s]),R.createElement("div",{className:vo.rendererContainer,style:{background:L}},R.createElement(e2,{pageId:a,duration:5e3,currentIndex:r,storiesCount:n,isPaused:I||h||b,onComplete:Bi}),R.createElement(Y5,{community:j,heading:ir,subheading:Dr,isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:De,isOfficial:We,isPaused:I,onPlay:Hr,onPause:en,onAction:ce,onClickCommunity:()=>f==null?void 0:f(),onClose:Fr,addStoryButton:o}),R.createElement("div",{className:cr(vo.storyImageContainer,{[vo.imageFit]:k.imageDisplayMode==="fit",[vo.imageFill]:k.imageDisplayMode==="fill"})},R.createElement("img",{ref:U,className:cr(vo.storyImage,{[vo.imageFit]:k.imageDisplayMode==="fit",[vo.imageFill]:k.imageDisplayMode==="fill"}),"data-qa-anchor":"image_view",src:d!=null?d:l==null?void 0:l.data.fileData,onLoad:bn,alt:"Story Image",crossOrigin:"anonymous"})),!v&&R.createElement("div",{className:vo.loadingOverlay},N||R.createElement("div",null,"loading...")),R.createElement(Sr,{rootId:qe,isOpen:h,onClose:ue,mountPoint:document.getElementById(qe),detent:"content-height"},e==null?void 0:e.map(Ke=>R.createElement(O,{key:Ke.name,className:vo.actionButton,onPress:()=>Ke==null?void 0:Ke.action()},(Ke==null?void 0:Ke.icon)&&Ke.icon,R.createElement(S.BodyBold,null,Ke.name)))),R.createElement(Sr,{rootId:qe,isOpen:b,onClose:Uo,mountPoint:document.getElementById(qe),detent:"full-height",headerTitle:y({id:"storyViewer.commentSheet.title"})},R.createElement(Am,{referenceId:$,referenceType:"story",community:j,shouldAllowCreation:j==null?void 0:j.allowCommentInStory,shouldAllowInteraction:be})),((wa=(Li=V==null?void 0:V[0])==null?void 0:Li.data)==null?void 0:wa.url)&&R.createElement("div",{className:vo.hyperLinkContainer},R.createElement(fi,{href:V[0].data.url.startsWith("http")?V[0].data.url:`https://${V[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},R.createElement(pw,{lines:1},R.createElement("span",null,((In=(rt=V[0])==null?void 0:rt.data)==null?void 0:In.customText)||V[0].data.url.replace(/^https?:\/\//,""))))),R.createElement(X5,{pageId:a,storyId:$,syncState:G,reach:q,commentsCount:z,reactionsCount:B,isLiked:Z,myReactions:Q,onClickComment:tn,showImpression:vt||us(T,j==null?void 0:j.communityId),isMember:be}))},_ce=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&(!e.type||e.type==="image"),priority:2}},BL={renderer:Pce,tester:_ce};var Sce=()=>{let[e,t]=useState(!1),o=useCallback(()=>t(!0),[]),r=useCallback(()=>t(!1),[]);return {muted:e,mute:o,unmute:r}},Nce=e=>{let[t,o]=useState(!1),r=useCallback(()=>{e("play",!0),o(!1);},[e]),n=useCallback(()=>{e("pause",!0),o(!0);},[e]);return {isPaused:t,play:r,pause:n}},Ece=e=>{let[t,o]=useState(!1),[r,n]=useState(!1),i=useCallback(()=>{e("pause",!0),o(!0);},[e]),a=useCallback(()=>{e("play",!0),o(!1);},[e]),s=useCallback(()=>{e("pause",!0),n(!0);},[e]),l=useCallback(()=>{e("play",!0),n(!1);},[e]);return {isBottomSheetOpen:t,isOpenCommentSheet:r,openBottomSheet:i,closeBottomSheet:a,openCommentSheet:s,closeCommentSheet:l}},Bce=({story:{actions:e,addStoryButton:t,fileInputRef:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l},action:d,config:p,messageHandler:u,onClose:g,onClickCommunity:f})=>{var Hr,en,ce,ue,tn,Uo,Fr,Bi,Li,wa;let[y,v]=useState(!1),{loader:C}=p,{client:h}=Ae(),{user:x}=fr(h==null?void 0:h.userId),b=useRef(null),{muted:M,mute:I,unmute:w}=Sce(),{isPaused:N,play:T,pause:L}=Nce(d),{isBottomSheetOpen:D,isOpenCommentSheet:U,openBottomSheet:Z,closeBottomSheet:B,openCommentSheet:$,closeCommentSheet:G}=Ece(d),{storyId:q,syncState:z,reach:H,commentsCount:F,createdAt:j,creator:Q,community:k,myReactions:V,data:ae,items:oe}=l,be=(Hr=l==null?void 0:l.myReactions)==null?void 0:Hr.includes(On),pe=(l==null?void 0:l.reactions[On])||0,{members:We}=yd({queryParams:{communityId:k==null?void 0:k.communityId},shouldCall:!!(k!=null&&k.communityId)}),vt=We==null?void 0:We.some(rt=>rt.userId===(h==null?void 0:h.userId)),eo=(k==null?void 0:k.isOfficial)||!1,Vt=(Q==null?void 0:Q.userId)===(x==null?void 0:x.userId),De=l5(x==null?void 0:x.roles),ir=s5(x==null?void 0:x.roles),Dr=De||ir||us(h,k==null?void 0:k.communityId),qe=useCallback(()=>{var rt;u("UPDATE_VIDEO_DURATION",{duration:(rt=l==null?void 0:l.videoData)==null?void 0:rt.attributes.metadata.video.duration}),v(!0),d("play",!0);},[u,(en=l==null?void 0:l.videoData)==null?void 0:en.attributes.metadata.video.duration,d]),Rr=useCallback(()=>{r+1<n?i():g();},[r,n,i,g]);useEffect(()=>{b.current&&(N||D||U?(b.current.pause(),d("pause",!0)):(b.current.play(),d("play",!0)));},[N,D,U,d]),useEffect(()=>{if(o.current){let rt=()=>{d("pause",!0),L();},In=()=>{d("play",!0),T();};return o.current.addEventListener("click",rt),o.current.addEventListener("cancel",In),()=>{var Ke,to;(Ke=o.current)==null||Ke.removeEventListener("click",rt),(to=o.current)==null||to.removeEventListener("cancel",In);}}},[d,L,T]),useEffect(()=>{if(s!=null&&s.current){let rt=()=>{d("pause",!0),L();},In=()=>{d("play",!0),T();};return s.current.addEventListener("dragstart",rt),s.current.addEventListener("dragend",In),()=>{var Ke,to;(Ke=s.current)==null||Ke.removeEventListener("dragstart",rt),(to=s.current)==null||to.removeEventListener("dragend",In);}}},[d,L,T,s]);let bn=Math.round(((ce=l==null?void 0:l.videoData)==null?void 0:ce.attributes.metadata.video.duration)*1e3);return R.createElement("div",{className:cr(vo.rendererContainer)},R.createElement(e2,{pageId:a,duration:bn,currentIndex:r,storiesCount:n,isPaused:N||D||U,onComplete:Rr}),R.createElement(j3,{pageId:"story_page",componentId:"*",isMuted:M,onPress:M?w:I}),R.createElement(Y5,{community:k,heading:R.createElement("div",{"data-qa-anchor":"community_display_name"},k==null?void 0:k.displayName),subheading:j&&(Q!=null&&Q.displayName)?R.createElement("span",null,R.createElement("span",{"data-qa-anchor":"created_at"},m5(j))," \u2022 By"," ",R.createElement("span",{"data-qa-anchor":"creator_display_name"},Q==null?void 0:Q.displayName)):"",isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:Dr,isOfficial:eo,isPaused:N,onPlay:T,onPause:L,onMute:I,onUnmute:w,onAction:Z,onClickCommunity:()=>f==null?void 0:f(),onClose:g,addStoryButton:t}),R.createElement("video",{"data-qa-anchor":"video_view",ref:b,className:cr(vo.storyVideo),src:((ue=l==null?void 0:l.videoData)==null?void 0:ue.fileUrl)||((Uo=(tn=l==null?void 0:l.videoData)==null?void 0:tn.videoUrl)==null?void 0:Uo.original),controls:!1,onLoadedData:qe,playsInline:!0,onWaiting:()=>d("pause",!0),onPlaying:()=>d("play",!0),muted:M,autoPlay:!0}),!y&&R.createElement("div",{className:cr(vo.loadingOverlay)},C||R.createElement("div",null,"loading...")),R.createElement(Sr,{rootId:"asc-uikit-stories-viewer",isOpen:D,onClose:B,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"content-height"},e==null?void 0:e.map(rt=>R.createElement(O,{key:rt.name,className:cr(vo.actionButton),onPress:rt==null?void 0:rt.action},rt==null?void 0:rt.icon,R.createElement(S.BodyBold,null,rt.name)))),R.createElement(Sr,{rootId:"asc-uikit-stories-viewer",isOpen:U,onClose:G,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"full-height"},R.createElement(Am,{referenceId:q,referenceType:"story",community:k,shouldAllowCreation:k==null?void 0:k.allowCommentInStory,shouldAllowInteraction:vt})),((Bi=(Fr=oe==null?void 0:oe[0])==null?void 0:Fr.data)==null?void 0:Bi.url)&&R.createElement("div",{className:cr(vo.hyperLinkContainer)},R.createElement(fi,{href:oe[0].data.url.startsWith("http")?oe[0].data.url:`https://${oe[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},R.createElement(pw,{lines:1},R.createElement("span",null,((wa=(Li=oe[0])==null?void 0:Li.data)==null?void 0:wa.customText)||oe[0].data.url.replace(/^https?:\/\//,""))))),R.createElement(X5,{pageId:a,storyId:q,syncState:z,reach:H,commentsCount:F,reactionsCount:pe,isLiked:be,onClickComment:$,myReactions:V,showImpression:Vt||us(h,k==null?void 0:k.communityId),isMember:vt}))},Lce=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&e.type==="video",priority:2}},LL={renderer:Bce,tester:Lce};var Dce=({story:e,action:t})=>(useEffect(()=>{t("play");},[e]),R.createElement("div",{style:DL.storyContent},R.createElement("p",{style:DL.text},"This story could not be loaded."))),DL={storyContent:{width:"100%",maxHeight:"100%",margin:"auto"},text:{textAlign:"center",color:"white",width:"90%",margin:"auto"}},Hce=()=>({condition:!0,priority:1}),HL={renderer:Dce,tester:Hce};var zce=e=>{useEffect(()=>{e.action("play");},[e.story]);let t=e.story.originalContent;return R.createElement(t,c({},e))},Uce=e=>({condition:!!e.content,priority:2}),FL={renderer:zce,tester:Uce};var Xt={drawer__content:"br",drawer__innerContent:"Tg",drawer__placeholder:"Vg",drawer__overlay:"qg",drawer__title:"Gg",drawer__content__data:"Jg",drawer__content__data__title:"Kg",drawer__content__data__text:"Ng",drawer__content__data__caption:"Og",drawer__content__data__infoIcon:"Pg",drawer__content__emptySpace:"Qg",drawer__container:"Wg",drawer__innerContainer:"Zg"};var OL=({isOpen:e,onOpenChange:t,ad:o,targetRef:r})=>{var n;return R.createElement(Drawer.Root,{open:e,onOpenChange:t,onDrag:i=>{i.preventDefault(),i.stopPropagation();}},R.createElement(Drawer.Portal,{container:r==null?void 0:r.current},R.createElement("div",{className:Xt.drawer__container},R.createElement("div",{className:Xt.drawer__innerContainer},R.createElement(Drawer.Overlay,{className:Xt.drawer__overlay}),R.createElement(Drawer.Content,{className:Xt.drawer__content},R.createElement("div",{className:Xt.drawer__innerContent},R.createElement("div",{className:Xt.drawer__placeholder}),R.createElement(Drawer.Title,{className:Xt.drawer__title},R.createElement(S.Title,null,"About this advertisement")),R.createElement("div",{className:Xt.drawer__content__data},R.createElement(S.BodyBold,{className:Xt.drawer__content__data__title},"Why this advertisement?"),R.createElement("div",{className:Xt.drawer__content__data__text},R.createElement(pn,{className:Xt.drawer__content__data__infoIcon}),R.createElement(S.Caption,{className:Xt.drawer__content__data__caption},"You're seeing this advertisement because it was displayed to all users in the system."))),R.createElement("div",{className:Xt.drawer__content__data},R.createElement(S.BodyBold,{className:Xt.drawer__content__data__title},"About this advertiser"),R.createElement("div",{className:Xt.drawer__content__data__text},R.createElement(pn,{className:Xt.drawer__content__data__infoIcon}),R.createElement(S.Caption,{className:Xt.drawer__content__data__caption},"Advertiser name: ",(n=o.advertiser)==null?void 0:n.companyName)))),R.createElement("div",{className:Xt.drawer__content__emptySpace}))))))};var Yt={iconButton:"_g",hyperLinkContainer:"eh",hyperLink__text:"rh",rendererContainer:"ah",storyVideo:"oh",muteCircleIcon:"th",unmuteCircleIcon:"ih",loadingOverlay:"lh",storyImageContainer:"sh",storyImage:"ch",playStoryButton:"nh",pauseStoryButton:"dh",closeButton:"mh",verifiedBadge:"ph",dotsButton:"gh",viewStoryInfoContainer:"hh",viewStoryCompostBarContainer:"fh",viewStoryCompostBarViewIconContainer:"bh",viewStoryCompostBarEngagementContainer:"uh",viewStoryCompostBarEngagementIconContainer:"vh",header:"xh",viewStoryContainer:"wh",viewStoryHeaderContainer:"yh",avatarContainer:"kh",addStoryButton:"ur",viewStoryHeaderListActionsContainer:"jh",viewStoryHeadingInfoContainer:"zh",viewStoryHeading:"Xh",viewStoryHeadingTitle:"Yh",viewStorySubHeading:"Ch",story:"Ah",storyContent:"Mh",actionButton:"vr",navigationOverlay:"Sh",leftOverlay:"Eh",rightOverlay:"Fh",imageFit:"Ih",imageFill:"Rh",infoIcon__button:"Uh",infoIcon:"Bh",storyAd__main:"Dh",storyAd__topBar:"Hh",storyAd__topBar__left:"Lh",storyAd__topBar__avatar:"Th",storyAd__topBar__text:"Vh",storyAd__topBar__advertiserName:"qh",storyAd__topBar__right:"Gh",storyAd__closeButton:"Jh"};var $L=({pageId:e="*",ad:t,avatarUrl:o,adImageUrl:r,currentIndex:n,isPaused:i,storiesCount:a,renderLoader:s=()=>R.createElement("div",null,"loading..."),onComplete:l=()=>{},onPauseClick:d,onPlayClick:p,onClose:u,onImageLoaded:g,onAdvertisementInfoOpen:f,onAdvertisementInfoClose:y})=>{var T;let[v,C]=useState(!1),[h,x]=useState(!1),b=()=>{x(!0),f==null||f();},M=()=>{x(!1),y==null||y();},I=useRef(null),w=useRef(null),N=()=>{C(!0),g==null||g();};return R.createElement("div",{className:Yt.rendererContainer,ref:w},R.createElement("div",{className:Yt.storyAd__main},R.createElement(e2,{pageId:e,duration:5e3,currentIndex:n,storiesCount:a,isPaused:i,onComplete:l}),R.createElement("div",{className:Yt.storyAd__topBar},R.createElement("div",{className:Yt.storyAd__topBar__left},R.createElement("div",{className:Yt.storyAd__topBar__avatar},R.createElement(xt,{defaultImage:R.createElement(Lm,null),avatarUrl:o})),R.createElement("div",{className:Yt.storyAd__topBar__text},R.createElement(S.BodyBold,{className:Yt.storyAd__topBar__advertiserName},(T=t.advertiser)==null?void 0:T.name),R.createElement(Bm,null))),R.createElement("div",{className:Yt.storyAd__topBar__right},i?R.createElement(Mo,{className:Yt.playStoryButton,"data-qa-anchor":"play_button",onClick:()=>p==null?void 0:p()}):R.createElement(As,{className:Yt.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:()=>d==null?void 0:d()}),R.createElement(kr,{defaultClassName:cr(Yt.storyAd__closeButton),pageId:e,onPress:u}))),R.createElement("div",{className:cr(Yt.storyImageContainer)},R.createElement("img",{ref:I,className:cr(Yt.storyImage),"data-qa-anchor":"image_view",src:r,onLoad:N,alt:"Story Image",crossOrigin:"anonymous"})),!v&&R.createElement("div",{className:Yt.loadingOverlay},s()),t.callToActionUrl&&R.createElement("div",{className:Yt.hyperLinkContainer},R.createElement("a",{className:Yt.hyperLink__text,href:t.callToActionUrl,target:"_blank",rel:"noreferrer"},t.callToAction)),R.createElement(O,{className:Yt.infoIcon__button,onPress:()=>{b();}},R.createElement(pn,{className:Yt.infoIcon}))),R.createElement(OL,{ad:t,isOpen:h,targetRef:w,onOpenChange:L=>!L&&M()}))};var Wce=({story:e,action:t,config:o,onClose:r})=>{var N,T,L,D,U,Z;let[n,i]=useState(!1),{loader:a}=o,{ad:s,currentIndex:l,storiesCount:d,increaseIndex:p,pageId:u,dragEventTarget:g}=e,f=()=>{t("play",!0),i(!1);},y=()=>{t("pause",!0),i(!0);},C=nt({fileId:(T=(N=s==null?void 0:s.advertiser)==null?void 0:N.avatar)==null?void 0:T.fileId})||((D=(L=s==null?void 0:s.advertiser)==null?void 0:L.avatar)==null?void 0:D.fileUrl)||"",x=nt({fileId:(U=s==null?void 0:s.image9_16)==null?void 0:U.fileId})||((Z=s==null?void 0:s.image9_16)==null?void 0:Z.fileUrl)||"",b=useCallback(()=>{n&&i(!1),t("play",!0);},[t,n]),M=()=>{t("pause",!0);},I=()=>{t("play",!0);},w=()=>{p();};return useEffect(()=>{var B,$;if(g){let G=()=>{t("pause",!0),i(!0);},q=()=>{t("play",!0),i(!1);};return (B=g.current)==null||B.addEventListener("dragstart",G),($=g.current)==null||$.addEventListener("dragend",q),()=>{var z,H;(z=g.current)==null||z.removeEventListener("dragstart",G),(H=g.current)==null||H.removeEventListener("dragend",q);}}},[g]),s?R.createElement($L,{pageId:u,ad:s,adImageUrl:x,avatarUrl:C,currentIndex:l,isPaused:n,storiesCount:d,renderLoader:()=>a,onComplete:w,onPauseClick:y,onPlayClick:f,onClose:r,onImageLoaded:b,onAdvertisementInfoOpen:M,onAdvertisementInfoClose:I}):null},qce=e=>({condition:!!e.ad,priority:2}),VL={renderer:Wce,tester:qce};var t2=[BL,LL,VL,FL,HL];var Pf={storyButton:"xr",desktopOnly:"wr"};var Xce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),R.createElement("path",{d:"M12 23.91C5.578 23.91.375 18.709.375 12.287.375 5.864 5.578.66 12 .66s11.625 5.203 11.625 11.625S18.422 23.91 12 23.91zM6.656 13.084l6.328 6.375c.47.422 1.172.422 1.594 0l.797-.797c.422-.422.422-1.172 0-1.594l-4.781-4.781 4.781-4.735c.422-.468.422-1.171 0-1.593l-.797-.797c-.422-.422-1.172-.422-1.594 0l-6.328 6.328c-.468.469-.468 1.172 0 1.594z"})),bd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_left_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=A({pageId:e,componentId:t,elementId:r});return i?null:R.createElement("button",{"data-qa-anchor":n,className:cr(Pf.storyButton,Pf.desktopOnly),onClick:o,style:a},R.createElement(Xce,null))};var _f={storyButton:"yr",desktopOnly:"kr"};var ede=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),R.createElement("path",{d:"M12 .66c6.422 0 11.625 5.204 11.625 11.626S18.422 23.91 12 23.91.375 18.708.375 12.286 5.578.66 12 .66zm5.297 10.829L10.969 5.16c-.422-.422-1.172-.422-1.594 0l-.797.797c-.422.422-.422 1.172 0 1.593l4.781 4.735-4.78 4.781c-.423.422-.423 1.172 0 1.594l.796.797c.422.422 1.172.422 1.594 0l6.328-6.375c.469-.422.469-1.125 0-1.594z"})),Id=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_right_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=A({pageId:e,componentId:t,elementId:r});return i?null:R.createElement("button",{"data-qa-anchor":n,className:cr(_f.storyButton,_f.desktopOnly),onClick:o,style:a},R.createElement(ede,null))};var or={overlayLeft:"jr",overlayRight:"zr",viewStoryContent:"Kh",viewStoryOverlay:"Nh",hiddenInput:"Oh",viewStoryContainer:"Ph",storyWrapper:"Qh",deleteIcon:"Wh",arrowButton:"Zh"};var lde=7e3,Ms=e=>!!(e!=null&&e.storyId),ru=({pageId:e="*",communityId:t,onBack:o,onClose:r,onSwipeDown:n,onClickCommunity:i,goToDraftStoryPage:a})=>{var Q;let{accessibilityId:s}=Ye({pageId:e}),{confirm:l}=Re(),d=_o(),p=useMotionValue(0),u=useRef(null),g=useRef(new EventTarget),[f,y]=useState(!1),{stories:v}=Ri({targetId:t,targetType:"community",options:{orderBy:"asc",sortBy:"createdAt"}}),C=useMemo(()=>t2.map(({renderer:k,tester:V})=>({renderer:oe=>k(E(c({},oe),{onClose:()=>r(t),onClickCommunity:()=>i(t)})),tester:V})),[t2,r,i,t]),h=useRef(null),{client:x,currentUserId:b}=Ae(),[M,I]=useState(0),{file:w,setFile:N}=pi(),T=v[M],L=Ms(T)?((Q=T==null?void 0:T.creator)==null?void 0:Q.userId)===b:!1,D=Ms(T)?np(x,T==null?void 0:T.targetId):!1,U=()=>{if(M===v.length-1){o();return}I(M+1);},Z=()=>{M!==0&&I(M-1);},B=k=>{l({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You'll no longer to see and find this story.",okText:"Delete",onOk:()=>_(void 0,null,function*(){y(!1),yield StoryRepository.softDeleteStory(k),M===0?r(t):I(M-1),d.success({content:"Story deleted"});})});},$=k=>{B(k);},G=useCallback((k,V,ae,oe)=>_(void 0,null,function*(){var be;try{let pe=new FormData;pe.append("files",k),N(null),k!=null&&k.type.includes("image")&&b?yield StoryRepository.createImageStory("user",b,pe,ae,V,oe):b&&(yield StoryRepository.createVideoStory("user",b,pe,ae,oe)),d.success({content:"Successfully shared story"});}catch(pe){pe instanceof Error&&d.info({content:(be=pe.message)!=null?be:"Failed to share story"});}}),[b,d,N]),q=()=>{N(null);},z=R.createElement(FileTrigger,{ref:h,onSelect:k=>{let V=Array.from(k);N(V[0]);}},R.createElement(is,{pageId:e})),H=()=>{if(M===v.length-1){o();return}I(k=>k+1);},F=v==null?void 0:v.map(k=>{var V,ae,oe;if(Ms(k)){let be=(k==null?void 0:k.dataType)==="image",pe=be?(V=k==null?void 0:k.imageData)==null?void 0:V.fileUrl:(oe=(ae=k==null?void 0:k.videoData)==null?void 0:ae.videoUrl)==null?void 0:oe["720p"];return {story:k,url:pe,type:be?"image":"video",actions:[L||D?{name:"Delete",action:()=>$(k==null?void 0:k.storyId),icon:R.createElement(h4,{fill:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-default")})}:null].filter(on),onCreateStory:G,discardStory:q,addStoryButton:z,fileInputRef:h,currentIndex:M,storiesCount:v==null?void 0:v.length,increaseIndex:H,pageId:e,dragEventTarget:g.current,setIsBottomSheetOpen:y,isBottomSheetOpen:f}}else return {ad:k,actions:[],pageId:e,currentIndex:M,storiesCount:v==null?void 0:v.length,increaseIndex:H}}),j="asc-uikit-stories-viewer";return useEffect(()=>{let k=v[v.length-1];Ms(k)&&(k==null?void 0:k.syncState)==="syncing"&&I(v.length-1),T&&Ms(T)&&(T==null||T.analytics.markAsSeen());},[M,v]),useEffect(()=>{if(v.filter(Ms).every(V=>V==null?void 0:V.isSeen))return;let k=v.findIndex(V=>Ms(V)?!(V!=null&&V.isSeen):!1);k!==-1&&I(k);},[]),Xa({targetId:t,targetType:"community"}),w&&a(t,"community",w.type.includes("image")?{type:"image",url:URL.createObjectURL(w)}:{type:"video",url:URL.createObjectURL(w)},"communityFeed"),!v||v.length===0?null:R.createElement("div",{className:cr(or.storyWrapper)},R.createElement(bd,{onClick:Z}),R.createElement(motion.div,{id:j,ref:u,"data-qa-anchor":s,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{g.current.dispatchEvent(new Event("dragstart"));},onDrag:(k,V)=>{V.point.y<V.point.y-V.offset.y&&p.set(0);},onDragEnd:(k,V)=>{g.current.dispatchEvent(new Event("dragend")),V.offset.y>100?n(t):p.set(0);},className:cr(or.viewStoryContainer)},R.createElement("div",{className:cr(or.viewStoryContent)},R.createElement("div",{className:cr(or.overlayLeft),onClick:Z}),R.createElement("div",{className:cr(or.overlayRight),onClick:U}),R.createElement("div",{className:cr(or.viewStoryOverlay)}),R.createElement(nde,{key:v==null?void 0:v.length,progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:M,stories:F,renderers:C,defaultInterval:lde,onStoryStart:()=>Ms(T)&&(T==null?void 0:T.analytics.markAsSeen()),onStoryEnd:U,onNext:U,onPrevious:Z,onAllStoriesEnd:U}))),R.createElement(Id,{onClick:U}))};var fde=7e3,Ps=e=>!!(e!=null&&e.storyId),ZL=({pageId:e="*",targetId:t,targetIds:o,onChangePage:r,onClickStory:n,goToDraftStoryPage:i,onClose:a,onSwipeDown:s,onClickCommunity:l})=>{var Q;let{accessibilityId:d}=Ye({pageId:e}),{confirm:p}=Re(),u=_o(),{client:g,currentUserId:f}=Ae(),{file:y,setFile:v}=pi(),C=useMotionValue(0),h=useRef(null),x=useRef(new EventTarget),[b,M]=useState(0),I=useRef(null),{stories:w}=Ri({targetType:"community",targetId:t,options:{orderBy:"asc",sortBy:"createdAt"}}),N=useMemo(()=>t2.map(({renderer:k,tester:V})=>({renderer:oe=>k(E(c({},oe),{onClose:()=>a(t),onClickCommunity:()=>l(t)})),tester:V})),[t2,a,s,l,t]),T=w[b],L=Ps(T)?((Q=T==null?void 0:T.creator)==null?void 0:Q.userId)===f:!1,D=Ps(T)?np(g,T==null?void 0:T.targetId):!1,U=()=>{if(b===0){let V=o.indexOf(t)-1;if(V>=0){let ae=o[V];n(ae);}else r==null||r();M(0);return}M(k=>k-1);},Z=k=>{let V=b===w.length-1;p({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",okText:"Delete",onOk:()=>_(void 0,null,function*(){yield StoryRepository.softDeleteStory(k),u.success({content:"Story deleted"}),w.length===1?r==null||r():V?U():M(ae=>ae);})});},B=k=>{Z(k);},$=(k,V,ae,oe)=>_(void 0,null,function*(){var be;try{let pe=new FormData;if(pe.append("files",k),v(null),k!=null&&k.type.includes("image")&&f){let{data:We}=yield StoryRepository.createImageStory("user",f,pe,ae,V,oe);We&&u.success({content:"Successfully shared story"});}else if(f){let{data:We}=yield StoryRepository.createVideoStory("user",f,pe,ae,oe);We&&u.success({content:"Successfully shared story"});}}catch(pe){pe instanceof Error&&u.info({content:(be=pe.message)!=null?be:"Failed to share story"});}}),G=()=>{v(null);},q=R.createElement(FileTrigger,{ref:I,onSelect:k=>{let V=Array.from(k);v(V[0]);}},R.createElement(is,{pageId:e})),z=()=>{b!==w.length-1&&M(k=>k+1);},H=w==null?void 0:w.map(k=>{var V,ae,oe;if(Ps(k)){let be=(k==null?void 0:k.dataType)==="image",pe=be?(V=k==null?void 0:k.imageData)==null?void 0:V.fileUrl:(oe=(ae=k==null?void 0:k.videoData)==null?void 0:ae.videoUrl)==null?void 0:oe["720p"];return {story:k,url:pe,type:be?"image":"video",actions:[L||D?{name:"Delete",action:()=>B(k==null?void 0:k.storyId),icon:R.createElement(u1,{className:or.deleteIcon})}:null].filter(on),onCreateStory:$,discardStory:G,addStoryButton:q,fileInputRef:I,currentIndex:b,storiesCount:w==null?void 0:w.length,increaseIndex:z,pageId:e}}else return {ad:k,actions:[],pageId:e,currentIndex:b,storiesCount:w==null?void 0:w.length,increaseIndex:z}}),F=()=>{if(b===(H==null?void 0:H.length)-1){let V=o.indexOf(t)+1;if(V<o.length){let ae=o[V];n(ae);}else r==null||r();M(0);return}M(k=>k+1);},j="asc-uikit-stories-viewer";return useEffect(()=>{let k=w[w.length-1];Ps(k)&&(k==null?void 0:k.syncState)==="syncing"&&M(w.length-1),T&&Ps(T)&&(T==null||T.analytics.markAsSeen());},[T,w]),useEffect(()=>{if(w.filter(Ps).every(V=>V==null?void 0:V.isSeen))return;let k=w.findIndex(V=>Ps(V)?!(V!=null&&V.isSeen):!1);k!==-1&&M(k);},[]),useEffect(()=>{y&&i(t,"community",y.type.includes("image")?{type:"image",url:URL.createObjectURL(y)}:{type:"video",url:URL.createObjectURL(y)},"globalFeed");},[y,i,t]),Xa({targetId:t,targetType:"community"}),!w||w.length===0?null:R.createElement("div",{className:cr(or.storyWrapper),"data-qa-anchor":d},R.createElement(bd,{onClick:U}),R.createElement(motion.div,{id:j,ref:h,"data-qa-anchor":d,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{x.current.dispatchEvent(new Event("dragstart"));},onDrag:(k,V)=>{V.point.y<V.point.y-V.offset.y&&C.set(0);},onDragEnd:(k,V)=>{x.current.dispatchEvent(new Event("dragend")),V.offset.y>100?s(t):C.set(0);},className:cr(or.viewStoryContainer)},R.createElement("div",{className:cr(or.viewStoryContent)},R.createElement("div",{className:cr(or.overlayLeft),onClick:U}),R.createElement("div",{className:cr(or.overlayRight),onClick:F}),R.createElement("div",{className:cr(or.viewStoryOverlay)}),R.createElement(nde,{progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:b,stories:H,renderers:N,defaultInterval:fde,onStoryStart:()=>Ps(T)&&(T==null?void 0:T.analytics.markAsSeen()),onStoryEnd:z,onNext:F,onPrevious:U,onAllStoriesEnd:F}))),R.createElement(Id,{onClick:F}))};var nu=({pageId:e="*",targetId:t,onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})=>{let{stories:l}=c5({seenState:"smart",limit:10});return R.createElement(ZL,{pageId:e,targetId:t,targetIds:l.map(d=>d.targetId),onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})};var hde=({type:e,targetId:t})=>{let o="view_story_page",{onBack:r,goToDraftStoryPage:n,onClickCommunity:i,onChangePage:a,onClickStory:s}=X(),l=()=>{a("newsfeed");},d=p=>{i(p);};return e==="communityFeed"?R.createElement(ru,{pageId:o,communityId:t,onBack:r,onClose:d,onSwipeDown:d,onClickCommunity:d,goToDraftStoryPage:({targetId:p,targetType:u,mediaType:g,storyType:f})=>n(p,u,g,f)}):e==="globalFeed"?R.createElement(nu,{pageId:o,targetId:t,onChangePage:l,onClose:l,onSwipeDown:l,onClickStory:p=>s(p,"globalFeed"),goToDraftStoryPage:({targetId:p,targetType:u,mediaType:g,storyType:f})=>n(p,u,g,f),onClickCommunity:p=>i(p)}):null},WL=hde;var qL={roundedBackButton:"_h"};var vde=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),R.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),R.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),Bf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n})=>{let i="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{style:u,className:qL.roundedBackButton,onPress:n},R.createElement(ee,{"data-qa-anchor":a,defaultIcon:()=>R.createElement(vde,{className:o}),imgIcon:()=>R.createElement("img",{src:s.icon,alt:p,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var Vn={draftPageContainer:"Xr",headerContainer:"ef",storyWrapper:"rf",header:"af",topRightButtons:"of",mainContainer:"tf",previewImage:"if",footer:"lf",videoPreview:"sf",hyperLinkContainer:"cf",playPauseButton:"nf",progressBar:"df",progressFill:"mf",userInfo:"pf",name:"gf",description:"hf",storyPreview:"ff"};var Lf=({targetId:e,targetType:t,mediaType:o,goToCommunityPage:r,goToGlobalFeedPage:n,onDiscardCreateStory:i})=>{var G,q,z,H,F,j;let{page:a}=Be(),s="create_story_page",{accessibilityId:l,themeStyles:d}=Ye({pageId:s}),{file:p,setFile:u}=pi(),{community:g}=_3(e),[f,y]=useState(!1),{confirm:v}=Re(),C=_o(),[h,x]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),b=()=>{y(!1);},[M,I]=useState("fit"),[w,N]=useState([]),T=()=>{I(M==="fit"?"fill":"fit"),M==="fill"&&N([]);},L=(Q,k,V,ae)=>_(void 0,null,function*(){var oe;if(Q)try{let be=new FormData;be.append("files",Q),u(null),a.type==="DraftPage"&&a.context.storyType==="globalFeed"?n():r(e),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,be,V,k,ae):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,be,V,ae)),C.success({content:"Successfully shared story"});}catch(be){be instanceof Error&&C.info({content:(oe=be.message)!=null?oe:"Failed to share story"});}}),D=()=>{v({pageId:s,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",cancelText:"Cancel",okText:"Delete",onOk:()=>{u(null),i();}});},U=({url:Q,customText:k})=>{x([{data:{url:Q,customText:k||""},type:"hyperlink"}]),y(!1);},Z=()=>{x([{data:{url:"",customText:""},type:"hyperlink"}]);},B=()=>{var Q,k;if((k=(Q=h[0])==null?void 0:Q.data)!=null&&k.url){C.info({content:"Can\u2019t add more than one link to your story."});return}y(!0);},$=useCallback(Q=>_(void 0,null,function*(){let k=new Image;k.crossOrigin="Anonymous",k.src=Q,k.onload=()=>{let ae=new Mce().getPalette(k,2);ae&&N(ae.map(oe=>`rgb(${oe.join(",")})`));};}),[]);return useEffect(()=>{_(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(p){let k=URL.createObjectURL(p);yield $(k);}else o.url&&(yield $(o.url));});},[p,o,$]),R.createElement("div",{"data-qa-anchor":l,style:d,className:Vn.storyWrapper},R.createElement("div",{id:"asc-uikit-create-story",className:Vn.draftPageContainer},R.createElement("div",{className:Vn.headerContainer},R.createElement("div",{className:Vn.header},R.createElement(Bf,{pageId:s,onPress:D}),R.createElement("div",{className:Vn.topRightButtons},(o==null?void 0:o.type)==="image"&&R.createElement(N3,{pageId:s,onPress:T}),R.createElement(H3,{pageId:s,onPress:B})))),(o==null?void 0:o.type)==="image"?R.createElement("div",{className:Vn.mainContainer,style:{background:`linear-gradient(
4753
+ `,nce=e=>R.createElement(rce,c({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),R.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"})),J5=nce;var hf={storyCommentButton:"up",storyCommentIcon:"vp"};var sce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),R.createElement("path",{fill:"#A5A9B5",d:"M10 2.188c4.682 0 8.5 3.12 8.5 6.906C18.5 12.912 14.682 16 10 16c-1.295 0-2.49-.232-3.586-.63-.797.663-2.457 1.693-4.648 1.693-.133 0-.2-.034-.266-.133-.033-.1 0-.233.066-.3 0-.032 1.395-1.493 1.827-3.187-1.196-1.195-1.893-2.69-1.893-4.35 0-3.784 3.785-6.905 8.5-6.905z"})),ML=({pageId:e="*",componentId:t="*",onPress:o,commentsCount:r,imgClassName:n})=>{let i="story_comment_button",{isExcluded:a,accessibilityId:s,defaultConfig:l,config:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return a?null:R.createElement(O,{"data-qa-anchor":s,onPress:o,style:u,className:cr(hf.storyCommentButton)},R.createElement(ee,{defaultIconName:l.icon,configIconName:d.icon,imgIcon:()=>R.createElement("img",{src:d.icon,alt:p,className:cr(n),style:u}),defaultIcon:()=>R.createElement("div",{className:cr(hf.storyCommentIcon)},R.createElement(sce,null),R.createElement(S.BodyBold,null,ib(r)))}))};var vf={storyReactionButton:"xp",storyReactionIcon:"wp"};var cce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),R.createElement("path",{fill:"#A5A9B5",d:"M17.793 11.025c.148.854.037 1.67-.334 2.338a3.437 3.437 0 01-.668 2.487c-.037 2.078-1.299 3.525-4.156 3.525h-.854c-3.785 0-4.935-1.41-6.605-1.447-.112.482-.594.853-1.114.853H1.688c-.667 0-1.187-.52-1.187-1.187V8.687c0-.63.52-1.187 1.188-1.187h3.636c.705-.594 1.707-2.227 2.56-3.08.52-.52.372-4.045 2.673-4.045 2.115 0 3.525 1.188 3.525 3.896 0 .706-.148 1.262-.334 1.745h1.373c1.781 0 3.191 1.521 3.191 3.154 0 .705-.185 1.299-.519 1.855zm-2.3 2.004c.816-.742.704-1.892.185-2.449.37 0 .853-.705.853-1.373-.037-.705-.63-1.41-1.41-1.41h-3.86c0-1.41 1.04-2.078 1.04-3.526 0-.89 0-2.115-1.744-2.115-.705.705-.372 2.487-1.41 3.526-1.002 1.002-2.45 3.6-3.526 3.6H5.25v6.939c1.967 0 3.71 1.373 6.346 1.373h1.41c1.299 0 2.264-.631 1.967-2.412.556-.334 1.002-1.373.52-2.153zM3.765 16.406a.903.903 0 00-.891-.89.88.88 0 00-.89.89c0 .52.37.89.89.89a.88.88 0 00.89-.89z"})),dce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),R.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#paint0_linear_7702_34939)"}),R.createElement("path",{fill:"#fff",d:"M7.486 10.575H5.42a.611.611 0 00-.62.619v6.187c0 .361.258.619.62.619h2.066c.336 0 .62-.258.62-.619v-6.187a.628.628 0 00-.62-.62zm-1.033 6.394a.596.596 0 01-.62-.62c0-.334.258-.618.62-.618.336 0 .62.284.62.619 0 .36-.284.619-.62.619zm8.264-10.055c0-1.908-1.24-2.114-1.859-2.114-.542 0-.775 1.031-.878 1.495-.155.567-.284 1.134-.672 1.521-.826.851-1.265 1.908-2.298 2.913a.415.415 0 00-.078.232v5.518c0 .154.13.283.284.31.414 0 .956.231 1.37.412.826.36 1.833.799 3.073.799h.077c1.11 0 2.428 0 2.944-.748.233-.31.285-.696.155-1.16.44-.438.646-1.263.44-1.934.439-.593.49-1.443.232-2.036.31-.31.516-.8.49-1.264 0-.799-.67-1.52-1.523-1.52h-2.635c.207-.723.878-1.341.878-2.424z"}),R.createElement("defs",null,R.createElement("linearGradient",{id:"paint0_linear_7702_34939",x1:"9",x2:"19.8",y1:"2.4",y2:"29.4",gradientUnits:"userSpaceOnUse"},R.createElement("stop",{stopColor:"#5B9DFF"}),R.createElement("stop",{offset:"1",stopColor:"#0041BE"})))),PL=({myReactions:e=[],reactionsCount:t,pageId:o="*",componentId:r="*",defaultIconClassName:n,imgIconClassName:i,onPress:a})=>{let s="story_reaction_button",{isExcluded:l,accessibilityId:d,config:p,uiReference:u,themeStyles:g}=A({pageId:o,componentId:r,elementId:s}),f=e.length>0;return l?null:R.createElement(O,{"data-qa-anchor":d,className:cr(vf.storyReactionButton),onPress:a,style:g},R.createElement(ee,{defaultIcon:()=>R.createElement("div",{className:cr(vf.storyReactionIcon,n)},f?R.createElement(dce,null):R.createElement(cce,null),R.createElement(S.BodyBold,null,ib(t))),imgIcon:()=>R.createElement("img",{src:p.icon,alt:u,className:cr(i)})}))};var ws={viewStoryCompostBarContainer:"yp",viewStoryFailedCompostBarContainer:"kp",viewStoryFailedCompostBarWrapper:"jp",viewStoryUploadingWrapper:"zp",viewStoryCompostBarViewIconContainer:"Xp",viewStoryCompostBarEngagementContainer:"Yp",viewStoryCommentButton:"Cp",viewStoryCommentIcon:"Ap"};var uce=({pageId:e="*",syncState:t,reach:o,commentsCount:r,reactionsCount:n,isLiked:i,storyId:a,onClickComment:s,showImpression:l,isMember:d,myReactions:p})=>{let u=_o(),g=()=>_(void 0,null,function*(){try{if(!d){u.info({content:"Join community to interact with all stories"});return}i?yield ReactionRepository.removeReaction("story",a,ur):yield ReactionRepository.addReaction("story",a,ur);}catch(f){console.error("Can't toggle like",f);}});return t==="syncing"?R.createElement("div",{className:ws.viewStoryCompostBarContainer},R.createElement("div",{className:ws.viewStoryUploadingWrapper},R.createElement(J5,{width:20,height:20}),"Uploading...")):t==="error"?R.createElement("div",{className:ws.viewStoryFailedCompostBarContainer},R.createElement("div",{className:ws.viewStoryFailedCompostBarWrapper},R.createElement(y4,null),R.createElement("span",null,"Failed to upload")),R.createElement(ka,null)):R.createElement("div",{className:ws.viewStoryCompostBarContainer},R.createElement("div",null,l&&R.createElement("div",{className:ws.viewStoryCompostBarViewIconContainer},R.createElement(F3,{reach:o}))),R.createElement("div",{className:ws.viewStoryCompostBarEngagementContainer},R.createElement(ML,{pageId:e,commentsCount:r,onPress:s}),R.createElement(PL,{pageId:e,myReactions:p,reactionsCount:n,onPress:g})))},X5=uce;var Kr={iconButton:"Mp",rendererContainer:"Sp",storyVideo:"Ep",muteCircleIcon:"Fp",unmuteCircleIcon:"Ip",loadingOverlay:"Rp",storyImage:"Up",playStoryButton:"Bp",pauseStoryButton:"Dp",closeButton:"Hp",verifiedBadge:"Lp",dotsButton:"Tp",viewStoryInfoContainer:"Vp",viewStoryCompostBarContainer:"qp",viewStoryCompostBarViewIconContainer:"Gp",viewStoryCompostBarEngagementContainer:"Jp",viewStoryCompostBarEngagementIconContainer:"Kp",storyContent:"Np",header:"Op",viewStoryContainer:"Pp",viewStoryHeaderContainer:"Qp",avatarContainer:"Wp",addStoryButton:"pr",viewStoryHeaderListActionsContainer:"Zp",viewStoryHeadingInfoContainer:"_p",viewStoryHeading:"eg",viewStoryHeadingTitle:"rg",viewStorySubHeading:"ag"};var hce=({community:e,heading:t,subheading:o,isHaveActions:r,isOfficial:n,isPaused:i,onPlay:a,onPause:s,onAction:l,onClose:d,onClickCommunity:p,haveStoryPermission:u,addStoryButton:g})=>R.createElement("div",{className:Kr.viewStoryHeaderContainer},R.createElement("div",{className:Kr.viewStoryHeadingInfoContainer},R.createElement("div",{className:Kr.avatarContainer},R.createElement(jr,{pageId:"story_page",community:e}),u&&g),R.createElement("div",{className:Kr.viewStoryInfoContainer},R.createElement("div",{className:Kr.viewStoryHeading},R.createElement(pw,{lines:1},R.createElement("div",{className:Kr.viewStoryHeadingTitle,"data-qa-anchor":"community_display_name",onClick:p},t)),n&&R.createElement(p1,{className:Kr.verifiedBadge})),R.createElement("span",{className:Kr.viewStorySubHeading},o))),R.createElement("div",{className:Kr.viewStoryHeaderListActionsContainer},i?R.createElement(Mo,{className:Kr.playStoryButton,"data-qa-anchor":"play_button",onClick:a}):R.createElement(As,{className:Kr.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:s}),r&&R.createElement(O3,{pageId:"story_page",onPress:l}),R.createElement(kr,{defaultClassName:cr(Kr.closeButton),pageId:"story_page",onPress:d}))),Y5=hce;function yd({queryParams:e,shouldCall:t=!0}){let n=dt({fetcher:CommunityRepository.Membership.getMembers,params:E(c({},e),{includeDeleted:!1}),shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=n,r=P(n,["items"]);return c({members:o},r)}var vo={iconButton:"og",hyperLinkContainer:"gr",rendererContainer:"tg",storyVideo:"ig",muteCircleIcon:"lg",unmuteCircleIcon:"sg",loadingOverlay:"cg",storyImageContainer:"ng",storyImage:"dg",playStoryButton:"mg",pauseStoryButton:"pg",closeButton:"gg",verifiedBadge:"hg",dotsButton:"fg",viewStoryInfoContainer:"bg",viewStoryCompostBarContainer:"ug",viewStoryCompostBarViewIconContainer:"vg",viewStoryCompostBarEngagementContainer:"xg",viewStoryCompostBarEngagementIconContainer:"wg",header:"yg",viewStoryContainer:"kg",viewStoryHeaderContainer:"jg",avatarContainer:"zg",addStoryButton:"hr",viewStoryHeaderListActionsContainer:"Xg",viewStoryHeadingInfoContainer:"Yg",viewStoryHeading:"Cg",viewStoryHeadingTitle:"Ag",viewStorySubHeading:"Mg",story:"Sg",storyContent:"Eg",actionButton:"fr",navigationOverlay:"Fg",leftOverlay:"Ig",rightOverlay:"Rg",imageFit:"Ug",imageFill:"Bg"};var R5={progressBarContainer:"Dg",progressSegment:"Hg",progressBar:"Lg"};var e2=R.memo(({pageId:e="*",componentId:t="*",duration:o,currentIndex:r,storiesCount:n,isPaused:i,onComplete:a})=>{let s="progress_bar",{config:l,isExcluded:d}=A({pageId:e,componentId:t,elementId:s}),[p,u]=useState(new Array(n).fill(0)),[g,f]=useState(r),y=l==null?void 0:l.backgroundColor,v=l==null?void 0:l.progressColor;return useEffect(()=>{r<g&&u(C=>{let h=[...C];return h[r]=0,h}),f(r);},[r,g]),useEffect(()=>{let C;return i||(C=setInterval(()=>{u(h=>{let x=[...h];return x[r]<100&&(x[r]+=100/o*100,x[r]>=100&&(x[r]=100,a())),x});},100)),()=>{C&&clearInterval(C);}},[o,r,i,a]),d?null:R.createElement("div",{className:cr(R5.progressBarContainer),style:{backgroundColor:y}},p.map((C,h)=>R.createElement("div",{key:h,className:cr(R5.progressSegment),style:{width:`calc(${100/n}% - 4px)`}},R.createElement("div",{className:cr(R5.progressBar),style:{width:`${h<r?100:h===r?C:0}%`,backgroundColor:v}}))))});var Pce=({story:{actions:e,fileInputRef:t,addStoryButton:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l,url:d},action:p,config:u,onClose:g,onClickCommunity:f})=>{var Li,wa,rt,In;let{formatMessage:y}=useIntl(),[v,C]=useState(!1),[h,x]=useState(!1),[b,M]=useState(!1),[I,w]=useState(!1),{loader:N}=u,{client:T}=Ae(),[L,D]=useState(""),U=useRef(null),Z=!!(l&&l.myReactions&&l.myReactions.includes(On)),B=(l==null?void 0:l.reactionsCount)||0,{storyId:$,syncState:G,reach:q,commentsCount:z,createdAt:H,creator:F,community:j,myReactions:Q,data:k,items:V}=l,{members:ae}=yd({queryParams:{communityId:j==null?void 0:j.communityId},shouldCall:!!(j!=null&&j.communityId)}),be=(ae==null?void 0:ae.find(Ke=>Ke.userId===(T==null?void 0:T.userId)))!=null,{user:pe}=fr(T==null?void 0:T.userId),We=(j==null?void 0:j.isOfficial)||!1,vt=(F==null?void 0:F.userId)===(pe==null?void 0:pe.userId),Vt=l5(pe==null?void 0:pe.roles),jt=s5(pe==null?void 0:pe.roles),De=Vt||jt||us(T,j==null?void 0:j.communityId),ir=useMemo(()=>R.createElement("div",{"data-qa-anchor":"community_display_name"},j==null?void 0:j.displayName),[j==null?void 0:j.displayName]),Dr=useMemo(()=>H&&(F!=null&&F.displayName)?R.createElement("span",null,R.createElement("span",{"data-qa-anchor":"created_at"},m5(H))," \u2022 By"," ",R.createElement("span",{"data-qa-anchor":"creator_display_name"},F==null?void 0:F.displayName)):"",[H,F==null?void 0:F.displayName]),qe="asc-uikit-stories-viewer",Rr=useCallback(()=>{if(U.current&&U.current.complete){let to=new Mce().getPalette(U.current,2);if(to){let Je=`linear-gradient(to top, rgb(${to[0].join(",")}), rgb(${to[1].join(",")})`;D(Je);}}},[]),bn=useCallback(()=>{C(!0),I&&w(!1),p("play",!0),Rr();},[p,I,Rr]),Hr=()=>{p("play",!0),w(!1);},en=()=>{p("pause",!0),w(!0);},ce=()=>{p("pause",!0),x(!0);},ue=()=>{p("play",!0),x(!1);},tn=()=>{p("pause",!0),M(!0);},Uo=()=>{p("play",!0),M(!1);},Fr=()=>{g();},Bi=()=>{i();};return useEffect(()=>{U.current&&U.current.complete&&Rr();},[]),useEffect(()=>{if(t.current){let Ke=()=>{p("pause",!0),w(!0);},to=()=>{p("play",!0),w(!1);};return t.current.addEventListener("click",Ke),t.current.addEventListener("cancel",to),()=>{t.current&&(t.current.removeEventListener("cancel",to),t.current.removeEventListener("click",Ke));}}},[t]),useEffect(()=>{var Ke,to;if(s){let Je=()=>{p("pause",!0),w(!0);},oo=()=>{p("play",!0),w(!1);};return (Ke=s.current)==null||Ke.addEventListener("dragstart",Je),(to=s.current)==null||to.addEventListener("dragend",oo),()=>{var Ai,ar;(Ai=s.current)==null||Ai.removeEventListener("dragstart",Je),(ar=s.current)==null||ar.removeEventListener("dragend",oo);}}},[s]),R.createElement("div",{className:vo.rendererContainer,style:{background:L}},R.createElement(e2,{pageId:a,duration:5e3,currentIndex:r,storiesCount:n,isPaused:I||h||b,onComplete:Bi}),R.createElement(Y5,{community:j,heading:ir,subheading:Dr,isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:De,isOfficial:We,isPaused:I,onPlay:Hr,onPause:en,onAction:ce,onClickCommunity:()=>f==null?void 0:f(),onClose:Fr,addStoryButton:o}),R.createElement("div",{className:cr(vo.storyImageContainer,{[vo.imageFit]:k.imageDisplayMode==="fit",[vo.imageFill]:k.imageDisplayMode==="fill"})},R.createElement("img",{ref:U,className:cr(vo.storyImage,{[vo.imageFit]:k.imageDisplayMode==="fit",[vo.imageFill]:k.imageDisplayMode==="fill"}),"data-qa-anchor":"image_view",src:d!=null?d:l==null?void 0:l.data.fileData,onLoad:bn,alt:"Story Image",crossOrigin:"anonymous"})),!v&&R.createElement("div",{className:vo.loadingOverlay},N||R.createElement("div",null,"loading...")),R.createElement(Sr,{rootId:qe,isOpen:h,onClose:ue,mountPoint:document.getElementById(qe),detent:"content-height"},e==null?void 0:e.map(Ke=>R.createElement(O,{key:Ke.name,className:vo.actionButton,onPress:()=>Ke==null?void 0:Ke.action()},(Ke==null?void 0:Ke.icon)&&Ke.icon,R.createElement(S.BodyBold,null,Ke.name)))),R.createElement(Sr,{rootId:qe,isOpen:b,onClose:Uo,mountPoint:document.getElementById(qe),detent:"full-height",headerTitle:y({id:"storyViewer.commentSheet.title"})},R.createElement(Am,{referenceId:$,referenceType:"story",community:j,shouldAllowCreation:j==null?void 0:j.allowCommentInStory,shouldAllowInteraction:be})),((wa=(Li=V==null?void 0:V[0])==null?void 0:Li.data)==null?void 0:wa.url)&&R.createElement("div",{className:vo.hyperLinkContainer},R.createElement(fi,{href:V[0].data.url.startsWith("http")?V[0].data.url:`https://${V[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},R.createElement(pw,{lines:1},R.createElement("span",null,((In=(rt=V[0])==null?void 0:rt.data)==null?void 0:In.customText)||V[0].data.url.replace(/^https?:\/\//,""))))),R.createElement(X5,{pageId:a,storyId:$,syncState:G,reach:q,commentsCount:z,reactionsCount:B,isLiked:Z,myReactions:Q,onClickComment:tn,showImpression:vt||us(T,j==null?void 0:j.communityId),isMember:be}))},_ce=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&(!e.type||e.type==="image"),priority:2}},BL={renderer:Pce,tester:_ce};var Sce=()=>{let[e,t]=useState(!1),o=useCallback(()=>t(!0),[]),r=useCallback(()=>t(!1),[]);return {muted:e,mute:o,unmute:r}},Nce=e=>{let[t,o]=useState(!1),r=useCallback(()=>{e("play",!0),o(!1);},[e]),n=useCallback(()=>{e("pause",!0),o(!0);},[e]);return {isPaused:t,play:r,pause:n}},Ece=e=>{let[t,o]=useState(!1),[r,n]=useState(!1),i=useCallback(()=>{e("pause",!0),o(!0);},[e]),a=useCallback(()=>{e("play",!0),o(!1);},[e]),s=useCallback(()=>{e("pause",!0),n(!0);},[e]),l=useCallback(()=>{e("play",!0),n(!1);},[e]);return {isBottomSheetOpen:t,isOpenCommentSheet:r,openBottomSheet:i,closeBottomSheet:a,openCommentSheet:s,closeCommentSheet:l}},Bce=({story:{actions:e,addStoryButton:t,fileInputRef:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l},action:d,config:p,messageHandler:u,onClose:g,onClickCommunity:f})=>{var Hr,en,ce,ue,tn,Uo,Fr,Bi,Li,wa;let[y,v]=useState(!1),{loader:C}=p,{client:h}=Ae(),{user:x}=fr(h==null?void 0:h.userId),b=useRef(null),{muted:M,mute:I,unmute:w}=Sce(),{isPaused:N,play:T,pause:L}=Nce(d),{isBottomSheetOpen:D,isOpenCommentSheet:U,openBottomSheet:Z,closeBottomSheet:B,openCommentSheet:$,closeCommentSheet:G}=Ece(d),{storyId:q,syncState:z,reach:H,commentsCount:F,createdAt:j,creator:Q,community:k,myReactions:V,data:ae,items:oe}=l,be=(Hr=l==null?void 0:l.myReactions)==null?void 0:Hr.includes(On),pe=(l==null?void 0:l.reactions[On])||0,{members:We}=yd({queryParams:{communityId:k==null?void 0:k.communityId},shouldCall:!!(k!=null&&k.communityId)}),vt=We==null?void 0:We.some(rt=>rt.userId===(h==null?void 0:h.userId)),Vt=(k==null?void 0:k.isOfficial)||!1,jt=(Q==null?void 0:Q.userId)===(x==null?void 0:x.userId),De=l5(x==null?void 0:x.roles),ir=s5(x==null?void 0:x.roles),Dr=De||ir||us(h,k==null?void 0:k.communityId),qe=useCallback(()=>{var rt;u("UPDATE_VIDEO_DURATION",{duration:(rt=l==null?void 0:l.videoData)==null?void 0:rt.attributes.metadata.video.duration}),v(!0),d("play",!0);},[u,(en=l==null?void 0:l.videoData)==null?void 0:en.attributes.metadata.video.duration,d]),Rr=useCallback(()=>{r+1<n?i():g();},[r,n,i,g]);useEffect(()=>{b.current&&(N||D||U?(b.current.pause(),d("pause",!0)):(b.current.play(),d("play",!0)));},[N,D,U,d]),useEffect(()=>{if(o.current){let rt=()=>{d("pause",!0),L();},In=()=>{d("play",!0),T();};return o.current.addEventListener("click",rt),o.current.addEventListener("cancel",In),()=>{var Ke,to;(Ke=o.current)==null||Ke.removeEventListener("click",rt),(to=o.current)==null||to.removeEventListener("cancel",In);}}},[d,L,T]),useEffect(()=>{if(s!=null&&s.current){let rt=()=>{d("pause",!0),L();},In=()=>{d("play",!0),T();};return s.current.addEventListener("dragstart",rt),s.current.addEventListener("dragend",In),()=>{var Ke,to;(Ke=s.current)==null||Ke.removeEventListener("dragstart",rt),(to=s.current)==null||to.removeEventListener("dragend",In);}}},[d,L,T,s]);let bn=Math.round(((ce=l==null?void 0:l.videoData)==null?void 0:ce.attributes.metadata.video.duration)*1e3);return R.createElement("div",{className:cr(vo.rendererContainer)},R.createElement(e2,{pageId:a,duration:bn,currentIndex:r,storiesCount:n,isPaused:N||D||U,onComplete:Rr}),R.createElement(j3,{pageId:"story_page",componentId:"*",isMuted:M,onPress:M?w:I}),R.createElement(Y5,{community:k,heading:R.createElement("div",{"data-qa-anchor":"community_display_name"},k==null?void 0:k.displayName),subheading:j&&(Q!=null&&Q.displayName)?R.createElement("span",null,R.createElement("span",{"data-qa-anchor":"created_at"},m5(j))," \u2022 By"," ",R.createElement("span",{"data-qa-anchor":"creator_display_name"},Q==null?void 0:Q.displayName)):"",isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:Dr,isOfficial:Vt,isPaused:N,onPlay:T,onPause:L,onMute:I,onUnmute:w,onAction:Z,onClickCommunity:()=>f==null?void 0:f(),onClose:g,addStoryButton:t}),R.createElement("video",{"data-qa-anchor":"video_view",ref:b,className:cr(vo.storyVideo),src:((ue=l==null?void 0:l.videoData)==null?void 0:ue.fileUrl)||((Uo=(tn=l==null?void 0:l.videoData)==null?void 0:tn.videoUrl)==null?void 0:Uo.original),controls:!1,onLoadedData:qe,playsInline:!0,onWaiting:()=>d("pause",!0),onPlaying:()=>d("play",!0),muted:M,autoPlay:!0}),!y&&R.createElement("div",{className:cr(vo.loadingOverlay)},C||R.createElement("div",null,"loading...")),R.createElement(Sr,{rootId:"asc-uikit-stories-viewer",isOpen:D,onClose:B,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"content-height"},e==null?void 0:e.map(rt=>R.createElement(O,{key:rt.name,className:cr(vo.actionButton),onPress:rt==null?void 0:rt.action},rt==null?void 0:rt.icon,R.createElement(S.BodyBold,null,rt.name)))),R.createElement(Sr,{rootId:"asc-uikit-stories-viewer",isOpen:U,onClose:G,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"full-height"},R.createElement(Am,{referenceId:q,referenceType:"story",community:k,shouldAllowCreation:k==null?void 0:k.allowCommentInStory,shouldAllowInteraction:vt})),((Bi=(Fr=oe==null?void 0:oe[0])==null?void 0:Fr.data)==null?void 0:Bi.url)&&R.createElement("div",{className:cr(vo.hyperLinkContainer)},R.createElement(fi,{href:oe[0].data.url.startsWith("http")?oe[0].data.url:`https://${oe[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},R.createElement(pw,{lines:1},R.createElement("span",null,((wa=(Li=oe[0])==null?void 0:Li.data)==null?void 0:wa.customText)||oe[0].data.url.replace(/^https?:\/\//,""))))),R.createElement(X5,{pageId:a,storyId:q,syncState:z,reach:H,commentsCount:F,reactionsCount:pe,isLiked:be,onClickComment:$,myReactions:V,showImpression:jt||us(h,k==null?void 0:k.communityId),isMember:vt}))},Lce=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&e.type==="video",priority:2}},LL={renderer:Bce,tester:Lce};var Dce=({story:e,action:t})=>(useEffect(()=>{t("play");},[e]),R.createElement("div",{style:DL.storyContent},R.createElement("p",{style:DL.text},"This story could not be loaded."))),DL={storyContent:{width:"100%",maxHeight:"100%",margin:"auto"},text:{textAlign:"center",color:"white",width:"90%",margin:"auto"}},Hce=()=>({condition:!0,priority:1}),HL={renderer:Dce,tester:Hce};var zce=e=>{useEffect(()=>{e.action("play");},[e.story]);let t=e.story.originalContent;return R.createElement(t,c({},e))},Uce=e=>({condition:!!e.content,priority:2}),FL={renderer:zce,tester:Uce};var Yt={drawer__content:"br",drawer__innerContent:"Tg",drawer__placeholder:"Vg",drawer__overlay:"qg",drawer__title:"Gg",drawer__content__data:"Jg",drawer__content__data__title:"Kg",drawer__content__data__text:"Ng",drawer__content__data__caption:"Og",drawer__content__data__infoIcon:"Pg",drawer__content__emptySpace:"Qg",drawer__container:"Wg",drawer__innerContainer:"Zg"};var OL=({isOpen:e,onOpenChange:t,ad:o,targetRef:r})=>{var n;return R.createElement(Drawer.Root,{open:e,onOpenChange:t,onDrag:i=>{i.preventDefault(),i.stopPropagation();}},R.createElement(Drawer.Portal,{container:r==null?void 0:r.current},R.createElement("div",{className:Yt.drawer__container},R.createElement("div",{className:Yt.drawer__innerContainer},R.createElement(Drawer.Overlay,{className:Yt.drawer__overlay}),R.createElement(Drawer.Content,{className:Yt.drawer__content},R.createElement("div",{className:Yt.drawer__innerContent},R.createElement("div",{className:Yt.drawer__placeholder}),R.createElement(Drawer.Title,{className:Yt.drawer__title},R.createElement(S.Title,null,"About this advertisement")),R.createElement("div",{className:Yt.drawer__content__data},R.createElement(S.BodyBold,{className:Yt.drawer__content__data__title},"Why this advertisement?"),R.createElement("div",{className:Yt.drawer__content__data__text},R.createElement(pn,{className:Yt.drawer__content__data__infoIcon}),R.createElement(S.Caption,{className:Yt.drawer__content__data__caption},"You're seeing this advertisement because it was displayed to all users in the system."))),R.createElement("div",{className:Yt.drawer__content__data},R.createElement(S.BodyBold,{className:Yt.drawer__content__data__title},"About this advertiser"),R.createElement("div",{className:Yt.drawer__content__data__text},R.createElement(pn,{className:Yt.drawer__content__data__infoIcon}),R.createElement(S.Caption,{className:Yt.drawer__content__data__caption},"Advertiser name: ",(n=o.advertiser)==null?void 0:n.companyName)))),R.createElement("div",{className:Yt.drawer__content__emptySpace}))))))};var Rt={iconButton:"_g",hyperLinkContainer:"eh",hyperLink__text:"rh",rendererContainer:"ah",storyVideo:"oh",muteCircleIcon:"th",unmuteCircleIcon:"ih",loadingOverlay:"lh",storyImageContainer:"sh",storyImage:"ch",playStoryButton:"nh",pauseStoryButton:"dh",closeButton:"mh",verifiedBadge:"ph",dotsButton:"gh",viewStoryInfoContainer:"hh",viewStoryCompostBarContainer:"fh",viewStoryCompostBarViewIconContainer:"bh",viewStoryCompostBarEngagementContainer:"uh",viewStoryCompostBarEngagementIconContainer:"vh",header:"xh",viewStoryContainer:"wh",viewStoryHeaderContainer:"yh",avatarContainer:"kh",addStoryButton:"ur",viewStoryHeaderListActionsContainer:"jh",viewStoryHeadingInfoContainer:"zh",viewStoryHeading:"Xh",viewStoryHeadingTitle:"Yh",viewStorySubHeading:"Ch",story:"Ah",storyContent:"Mh",actionButton:"vr",navigationOverlay:"Sh",leftOverlay:"Eh",rightOverlay:"Fh",imageFit:"Ih",imageFill:"Rh",infoIcon__button:"Uh",infoIcon:"Bh",storyAd__main:"Dh",storyAd__topBar:"Hh",storyAd__topBar__left:"Lh",storyAd__topBar__avatar:"Th",storyAd__topBar__text:"Vh",storyAd__topBar__advertiserName:"qh",storyAd__topBar__right:"Gh",storyAd__closeButton:"Jh"};var $L=({pageId:e="*",ad:t,avatarUrl:o,adImageUrl:r,currentIndex:n,isPaused:i,storiesCount:a,renderLoader:s=()=>R.createElement("div",null,"loading..."),onComplete:l=()=>{},onPauseClick:d,onPlayClick:p,onClose:u,onImageLoaded:g,onAdvertisementInfoOpen:f,onAdvertisementInfoClose:y})=>{var T;let[v,C]=useState(!1),[h,x]=useState(!1),b=()=>{x(!0),f==null||f();},M=()=>{x(!1),y==null||y();},I=useRef(null),w=useRef(null),N=()=>{C(!0),g==null||g();};return R.createElement("div",{className:Rt.rendererContainer,ref:w},R.createElement("div",{className:Rt.storyAd__main},R.createElement(e2,{pageId:e,duration:5e3,currentIndex:n,storiesCount:a,isPaused:i,onComplete:l}),R.createElement("div",{className:Rt.storyAd__topBar},R.createElement("div",{className:Rt.storyAd__topBar__left},R.createElement("div",{className:Rt.storyAd__topBar__avatar},R.createElement(xt,{defaultImage:R.createElement(Lm,null),avatarUrl:o})),R.createElement("div",{className:Rt.storyAd__topBar__text},R.createElement(S.BodyBold,{className:Rt.storyAd__topBar__advertiserName},(T=t.advertiser)==null?void 0:T.name),R.createElement(Bm,null))),R.createElement("div",{className:Rt.storyAd__topBar__right},i?R.createElement(Mo,{className:Rt.playStoryButton,"data-qa-anchor":"play_button",onClick:()=>p==null?void 0:p()}):R.createElement(As,{className:Rt.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:()=>d==null?void 0:d()}),R.createElement(kr,{defaultClassName:cr(Rt.storyAd__closeButton),pageId:e,onPress:u}))),R.createElement("div",{className:cr(Rt.storyImageContainer)},R.createElement("img",{ref:I,className:cr(Rt.storyImage),"data-qa-anchor":"image_view",src:r,onLoad:N,alt:"Story Image",crossOrigin:"anonymous"})),!v&&R.createElement("div",{className:Rt.loadingOverlay},s()),t.callToActionUrl&&R.createElement("div",{className:Rt.hyperLinkContainer},R.createElement("a",{className:Rt.hyperLink__text,href:t.callToActionUrl,target:"_blank",rel:"noreferrer"},t.callToAction)),R.createElement(O,{className:Rt.infoIcon__button,onPress:()=>{b();}},R.createElement(pn,{className:Rt.infoIcon}))),R.createElement(OL,{ad:t,isOpen:h,targetRef:w,onOpenChange:L=>!L&&M()}))};var Wce=({story:e,action:t,config:o,onClose:r})=>{var N,T,L,D,U,Z;let[n,i]=useState(!1),{loader:a}=o,{ad:s,currentIndex:l,storiesCount:d,increaseIndex:p,pageId:u,dragEventTarget:g}=e,f=()=>{t("play",!0),i(!1);},y=()=>{t("pause",!0),i(!0);},C=nt({fileId:(T=(N=s==null?void 0:s.advertiser)==null?void 0:N.avatar)==null?void 0:T.fileId})||((D=(L=s==null?void 0:s.advertiser)==null?void 0:L.avatar)==null?void 0:D.fileUrl)||"",x=nt({fileId:(U=s==null?void 0:s.image9_16)==null?void 0:U.fileId})||((Z=s==null?void 0:s.image9_16)==null?void 0:Z.fileUrl)||"",b=useCallback(()=>{n&&i(!1),t("play",!0);},[t,n]),M=()=>{t("pause",!0);},I=()=>{t("play",!0);},w=()=>{p();};return useEffect(()=>{var B,$;if(g){let G=()=>{t("pause",!0),i(!0);},q=()=>{t("play",!0),i(!1);};return (B=g.current)==null||B.addEventListener("dragstart",G),($=g.current)==null||$.addEventListener("dragend",q),()=>{var z,H;(z=g.current)==null||z.removeEventListener("dragstart",G),(H=g.current)==null||H.removeEventListener("dragend",q);}}},[g]),s?R.createElement($L,{pageId:u,ad:s,adImageUrl:x,avatarUrl:C,currentIndex:l,isPaused:n,storiesCount:d,renderLoader:()=>a,onComplete:w,onPauseClick:y,onPlayClick:f,onClose:r,onImageLoaded:b,onAdvertisementInfoOpen:M,onAdvertisementInfoClose:I}):null},qce=e=>({condition:!!e.ad,priority:2}),VL={renderer:Wce,tester:qce};var t2=[BL,LL,VL,FL,HL];var Pf={storyButton:"xr",desktopOnly:"wr"};var Xce=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),R.createElement("path",{d:"M12 23.91C5.578 23.91.375 18.709.375 12.287.375 5.864 5.578.66 12 .66s11.625 5.203 11.625 11.625S18.422 23.91 12 23.91zM6.656 13.084l6.328 6.375c.47.422 1.172.422 1.594 0l.797-.797c.422-.422.422-1.172 0-1.594l-4.781-4.781 4.781-4.735c.422-.468.422-1.171 0-1.593l-.797-.797c-.422-.422-1.172-.422-1.594 0l-6.328 6.328c-.468.469-.468 1.172 0 1.594z"})),bd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_left_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=A({pageId:e,componentId:t,elementId:r});return i?null:R.createElement("button",{"data-qa-anchor":n,className:cr(Pf.storyButton,Pf.desktopOnly),onClick:o,style:a},R.createElement(Xce,null))};var _f={storyButton:"yr",desktopOnly:"kr"};var ede=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),R.createElement("path",{d:"M12 .66c6.422 0 11.625 5.204 11.625 11.626S18.422 23.91 12 23.91.375 18.708.375 12.286 5.578.66 12 .66zm5.297 10.829L10.969 5.16c-.422-.422-1.172-.422-1.594 0l-.797.797c-.422.422-.422 1.172 0 1.593l4.781 4.735-4.78 4.781c-.423.422-.423 1.172 0 1.594l.796.797c.422.422 1.172.422 1.594 0l6.328-6.375c.469-.422.469-1.125 0-1.594z"})),Id=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_right_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=A({pageId:e,componentId:t,elementId:r});return i?null:R.createElement("button",{"data-qa-anchor":n,className:cr(_f.storyButton,_f.desktopOnly),onClick:o,style:a},R.createElement(ede,null))};var or={overlayLeft:"jr",overlayRight:"zr",viewStoryContent:"Kh",viewStoryOverlay:"Nh",hiddenInput:"Oh",viewStoryContainer:"Ph",storyWrapper:"Qh",deleteIcon:"Wh",arrowButton:"Zh"};var lde=7e3,Ms=e=>!!(e!=null&&e.storyId),ru=({pageId:e="*",communityId:t,onBack:o,onClose:r,onSwipeDown:n,onClickCommunity:i,goToDraftStoryPage:a})=>{var Q;let{accessibilityId:s}=Ye({pageId:e}),{confirm:l}=Re(),d=_o(),p=useMotionValue(0),u=useRef(null),g=useRef(new EventTarget),[f,y]=useState(!1),{stories:v}=Ri({targetId:t,targetType:"community",options:{orderBy:"asc",sortBy:"createdAt"}}),C=useMemo(()=>t2.map(({renderer:k,tester:V})=>({renderer:oe=>k(E(c({},oe),{onClose:()=>r(t),onClickCommunity:()=>i(t)})),tester:V})),[t2,r,i,t]),h=useRef(null),{client:x,currentUserId:b}=Ae(),[M,I]=useState(0),{file:w,setFile:N}=pi(),T=v[M],L=Ms(T)?((Q=T==null?void 0:T.creator)==null?void 0:Q.userId)===b:!1,D=Ms(T)?np(x,T==null?void 0:T.targetId):!1,U=()=>{if(M===v.length-1){o();return}I(M+1);},Z=()=>{M!==0&&I(M-1);},B=k=>{l({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You'll no longer to see and find this story.",okText:"Delete",onOk:()=>_(void 0,null,function*(){y(!1),yield StoryRepository.softDeleteStory(k),M===0?r(t):I(M-1),d.success({content:"Story deleted"});})});},$=k=>{B(k);},G=useCallback((k,V,ae,oe)=>_(void 0,null,function*(){var be;try{let pe=new FormData;pe.append("files",k),N(null),k!=null&&k.type.includes("image")&&b?yield StoryRepository.createImageStory("user",b,pe,ae,V,oe):b&&(yield StoryRepository.createVideoStory("user",b,pe,ae,oe)),d.success({content:"Successfully shared story"});}catch(pe){pe instanceof Error&&d.info({content:(be=pe.message)!=null?be:"Failed to share story"});}}),[b,d,N]),q=()=>{N(null);},z=R.createElement(FileTrigger,{ref:h,onSelect:k=>{let V=Array.from(k);N(V[0]);}},R.createElement(is,{pageId:e})),H=()=>{if(M===v.length-1){o();return}I(k=>k+1);},F=v==null?void 0:v.map(k=>{var V,ae,oe;if(Ms(k)){let be=(k==null?void 0:k.dataType)==="image",pe=be?(V=k==null?void 0:k.imageData)==null?void 0:V.fileUrl:(oe=(ae=k==null?void 0:k.videoData)==null?void 0:ae.videoUrl)==null?void 0:oe["720p"];return {story:k,url:pe,type:be?"image":"video",actions:[L||D?{name:"Delete",action:()=>$(k==null?void 0:k.storyId),icon:R.createElement(h4,{fill:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-default")})}:null].filter(on),onCreateStory:G,discardStory:q,addStoryButton:z,fileInputRef:h,currentIndex:M,storiesCount:v==null?void 0:v.length,increaseIndex:H,pageId:e,dragEventTarget:g.current,setIsBottomSheetOpen:y,isBottomSheetOpen:f}}else return {ad:k,actions:[],pageId:e,currentIndex:M,storiesCount:v==null?void 0:v.length,increaseIndex:H}}),j="asc-uikit-stories-viewer";return useEffect(()=>{let k=v[v.length-1];Ms(k)&&(k==null?void 0:k.syncState)==="syncing"&&I(v.length-1),T&&Ms(T)&&(T==null||T.analytics.markAsSeen());},[M,v]),useEffect(()=>{if(v.filter(Ms).every(V=>V==null?void 0:V.isSeen))return;let k=v.findIndex(V=>Ms(V)?!(V!=null&&V.isSeen):!1);k!==-1&&I(k);},[]),Xa({targetId:t,targetType:"community"}),w&&a(t,"community",w.type.includes("image")?{type:"image",url:URL.createObjectURL(w)}:{type:"video",url:URL.createObjectURL(w)},"communityFeed"),!v||v.length===0?null:R.createElement("div",{className:cr(or.storyWrapper)},R.createElement(bd,{onClick:Z}),R.createElement(motion.div,{id:j,ref:u,"data-qa-anchor":s,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{g.current.dispatchEvent(new Event("dragstart"));},onDrag:(k,V)=>{V.point.y<V.point.y-V.offset.y&&p.set(0);},onDragEnd:(k,V)=>{g.current.dispatchEvent(new Event("dragend")),V.offset.y>100?n(t):p.set(0);},className:cr(or.viewStoryContainer)},R.createElement("div",{className:cr(or.viewStoryContent)},R.createElement("div",{className:cr(or.overlayLeft),onClick:Z}),R.createElement("div",{className:cr(or.overlayRight),onClick:U}),R.createElement("div",{className:cr(or.viewStoryOverlay)}),R.createElement(nde,{key:v==null?void 0:v.length,progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:M,stories:F,renderers:C,defaultInterval:lde,onStoryStart:()=>Ms(T)&&(T==null?void 0:T.analytics.markAsSeen()),onStoryEnd:U,onNext:U,onPrevious:Z,onAllStoriesEnd:U}))),R.createElement(Id,{onClick:U}))};var fde=7e3,Ps=e=>!!(e!=null&&e.storyId),ZL=({pageId:e="*",targetId:t,targetIds:o,onChangePage:r,onClickStory:n,goToDraftStoryPage:i,onClose:a,onSwipeDown:s,onClickCommunity:l})=>{var Q;let{accessibilityId:d}=Ye({pageId:e}),{confirm:p}=Re(),u=_o(),{client:g,currentUserId:f}=Ae(),{file:y,setFile:v}=pi(),C=useMotionValue(0),h=useRef(null),x=useRef(new EventTarget),[b,M]=useState(0),I=useRef(null),{stories:w}=Ri({targetType:"community",targetId:t,options:{orderBy:"asc",sortBy:"createdAt"}}),N=useMemo(()=>t2.map(({renderer:k,tester:V})=>({renderer:oe=>k(E(c({},oe),{onClose:()=>a(t),onClickCommunity:()=>l(t)})),tester:V})),[t2,a,s,l,t]),T=w[b],L=Ps(T)?((Q=T==null?void 0:T.creator)==null?void 0:Q.userId)===f:!1,D=Ps(T)?np(g,T==null?void 0:T.targetId):!1,U=()=>{if(b===0){let V=o.indexOf(t)-1;if(V>=0){let ae=o[V];n(ae);}else r==null||r();M(0);return}M(k=>k-1);},Z=k=>{let V=b===w.length-1;p({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",okText:"Delete",onOk:()=>_(void 0,null,function*(){yield StoryRepository.softDeleteStory(k),u.success({content:"Story deleted"}),w.length===1?r==null||r():V?U():M(ae=>ae);})});},B=k=>{Z(k);},$=(k,V,ae,oe)=>_(void 0,null,function*(){var be;try{let pe=new FormData;if(pe.append("files",k),v(null),k!=null&&k.type.includes("image")&&f){let{data:We}=yield StoryRepository.createImageStory("user",f,pe,ae,V,oe);We&&u.success({content:"Successfully shared story"});}else if(f){let{data:We}=yield StoryRepository.createVideoStory("user",f,pe,ae,oe);We&&u.success({content:"Successfully shared story"});}}catch(pe){pe instanceof Error&&u.info({content:(be=pe.message)!=null?be:"Failed to share story"});}}),G=()=>{v(null);},q=R.createElement(FileTrigger,{ref:I,onSelect:k=>{let V=Array.from(k);v(V[0]);}},R.createElement(is,{pageId:e})),z=()=>{b!==w.length-1&&M(k=>k+1);},H=w==null?void 0:w.map(k=>{var V,ae,oe;if(Ps(k)){let be=(k==null?void 0:k.dataType)==="image",pe=be?(V=k==null?void 0:k.imageData)==null?void 0:V.fileUrl:(oe=(ae=k==null?void 0:k.videoData)==null?void 0:ae.videoUrl)==null?void 0:oe["720p"];return {story:k,url:pe,type:be?"image":"video",actions:[L||D?{name:"Delete",action:()=>B(k==null?void 0:k.storyId),icon:R.createElement(u1,{className:or.deleteIcon})}:null].filter(on),onCreateStory:$,discardStory:G,addStoryButton:q,fileInputRef:I,currentIndex:b,storiesCount:w==null?void 0:w.length,increaseIndex:z,pageId:e}}else return {ad:k,actions:[],pageId:e,currentIndex:b,storiesCount:w==null?void 0:w.length,increaseIndex:z}}),F=()=>{if(b===(H==null?void 0:H.length)-1){let V=o.indexOf(t)+1;if(V<o.length){let ae=o[V];n(ae);}else r==null||r();M(0);return}M(k=>k+1);},j="asc-uikit-stories-viewer";return useEffect(()=>{let k=w[w.length-1];Ps(k)&&(k==null?void 0:k.syncState)==="syncing"&&M(w.length-1),T&&Ps(T)&&(T==null||T.analytics.markAsSeen());},[T,w]),useEffect(()=>{if(w.filter(Ps).every(V=>V==null?void 0:V.isSeen))return;let k=w.findIndex(V=>Ps(V)?!(V!=null&&V.isSeen):!1);k!==-1&&M(k);},[]),useEffect(()=>{y&&i(t,"community",y.type.includes("image")?{type:"image",url:URL.createObjectURL(y)}:{type:"video",url:URL.createObjectURL(y)},"globalFeed");},[y,i,t]),Xa({targetId:t,targetType:"community"}),!w||w.length===0?null:R.createElement("div",{className:cr(or.storyWrapper),"data-qa-anchor":d},R.createElement(bd,{onClick:U}),R.createElement(motion.div,{id:j,ref:h,"data-qa-anchor":d,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{x.current.dispatchEvent(new Event("dragstart"));},onDrag:(k,V)=>{V.point.y<V.point.y-V.offset.y&&C.set(0);},onDragEnd:(k,V)=>{x.current.dispatchEvent(new Event("dragend")),V.offset.y>100?s(t):C.set(0);},className:cr(or.viewStoryContainer)},R.createElement("div",{className:cr(or.viewStoryContent)},R.createElement("div",{className:cr(or.overlayLeft),onClick:U}),R.createElement("div",{className:cr(or.overlayRight),onClick:F}),R.createElement("div",{className:cr(or.viewStoryOverlay)}),R.createElement(nde,{progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:b,stories:H,renderers:N,defaultInterval:fde,onStoryStart:()=>Ps(T)&&(T==null?void 0:T.analytics.markAsSeen()),onStoryEnd:z,onNext:F,onPrevious:U,onAllStoriesEnd:F}))),R.createElement(Id,{onClick:F}))};var nu=({pageId:e="*",targetId:t,onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})=>{let{stories:l}=c5({seenState:"smart",limit:10});return R.createElement(ZL,{pageId:e,targetId:t,targetIds:l.map(d=>d.targetId),onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})};var hde=({type:e,targetId:t})=>{let o="view_story_page",{onBack:r,goToDraftStoryPage:n,onClickCommunity:i,onChangePage:a,onClickStory:s}=X(),l=()=>{a("newsfeed");},d=p=>{i(p);};return e==="communityFeed"?R.createElement(ru,{pageId:o,communityId:t,onBack:r,onClose:d,onSwipeDown:d,onClickCommunity:d,goToDraftStoryPage:({targetId:p,targetType:u,mediaType:g,storyType:f})=>n(p,u,g,f)}):e==="globalFeed"?R.createElement(nu,{pageId:o,targetId:t,onChangePage:l,onClose:l,onSwipeDown:l,onClickStory:p=>s(p,"globalFeed"),goToDraftStoryPage:({targetId:p,targetType:u,mediaType:g,storyType:f})=>n(p,u,g,f),onClickCommunity:p=>i(p)}):null},WL=hde;var qL={roundedBackButton:"_h"};var vde=e=>R.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),R.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),R.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),Bf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n})=>{let i="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:d,uiReference:p,themeStyles:u}=A({pageId:e,componentId:t,elementId:i});return d?null:R.createElement(O,{style:u,className:qL.roundedBackButton,onPress:n},R.createElement(ee,{"data-qa-anchor":a,defaultIcon:()=>R.createElement(vde,{className:o}),imgIcon:()=>R.createElement("img",{src:s.icon,alt:p,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var Vn={draftPageContainer:"Xr",headerContainer:"ef",storyWrapper:"rf",header:"af",topRightButtons:"of",mainContainer:"tf",previewImage:"if",footer:"lf",videoPreview:"sf",hyperLinkContainer:"cf",playPauseButton:"nf",progressBar:"df",progressFill:"mf",userInfo:"pf",name:"gf",description:"hf",storyPreview:"ff"};var Lf=({targetId:e,targetType:t,mediaType:o,goToCommunityPage:r,goToGlobalFeedPage:n,onDiscardCreateStory:i})=>{var G,q,z,H,F,j;let{page:a}=Be(),s="create_story_page",{accessibilityId:l,themeStyles:d}=Ye({pageId:s}),{file:p,setFile:u}=pi(),{community:g}=_3(e),[f,y]=useState(!1),{confirm:v}=Re(),C=_o(),[h,x]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),b=()=>{y(!1);},[M,I]=useState("fit"),[w,N]=useState([]),T=()=>{I(M==="fit"?"fill":"fit"),M==="fill"&&N([]);},L=(Q,k,V,ae)=>_(void 0,null,function*(){var oe;if(Q)try{let be=new FormData;be.append("files",Q),u(null),a.type==="DraftPage"&&a.context.storyType==="globalFeed"?n():r(e),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,be,V,k,ae):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,be,V,ae)),C.success({content:"Successfully shared story"});}catch(be){be instanceof Error&&C.info({content:(oe=be.message)!=null?oe:"Failed to share story"});}}),D=()=>{v({pageId:s,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",cancelText:"Cancel",okText:"Delete",onOk:()=>{u(null),i();}});},U=({url:Q,customText:k})=>{x([{data:{url:Q,customText:k||""},type:"hyperlink"}]),y(!1);},Z=()=>{x([{data:{url:"",customText:""},type:"hyperlink"}]);},B=()=>{var Q,k;if((k=(Q=h[0])==null?void 0:Q.data)!=null&&k.url){C.info({content:"Can\u2019t add more than one link to your story."});return}y(!0);},$=useCallback(Q=>_(void 0,null,function*(){let k=new Image;k.crossOrigin="Anonymous",k.src=Q,k.onload=()=>{let ae=new Mce().getPalette(k,2);ae&&N(ae.map(oe=>`rgb(${oe.join(",")})`));};}),[]);return useEffect(()=>{_(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(p){let k=URL.createObjectURL(p);yield $(k);}else o.url&&(yield $(o.url));});},[p,o,$]),R.createElement("div",{"data-qa-anchor":l,style:d,className:Vn.storyWrapper},R.createElement("div",{id:"asc-uikit-create-story",className:Vn.draftPageContainer},R.createElement("div",{className:Vn.headerContainer},R.createElement("div",{className:Vn.header},R.createElement(Bf,{pageId:s,onPress:D}),R.createElement("div",{className:Vn.topRightButtons},(o==null?void 0:o.type)==="image"&&R.createElement(N3,{pageId:s,onPress:T}),R.createElement(H3,{pageId:s,onPress:B})))),(o==null?void 0:o.type)==="image"?R.createElement("div",{className:Vn.mainContainer,style:{background:`linear-gradient(
4754
4754
  180deg,
4755
4755
  ${w[0]||"var(--asc-color-black)"} 0%,
4756
4756
  ${w[1]||"var(--asc-color-black)"} 100%