1"use strict";(self.webpackChunkzawya_glide_deliver=self.webpackChunkzawya_glide_deliver||[]).push([[6381],{"O+Gr"(a,n,e){e.r(n),e.d(n,{default:()=>m,onLoad:()=>y});var i=e("nKUr"),l=e("q1tI"),o=e("EbEg"),t=e("00a5"),s=e("Hxum");const c=a=>{var n,o;const[c,d]=(0,l.useState)("my-zawya"),[y,m]=(0,l.useState)((null==a?void 0:a.followedTopics)||[]),[r,w]=(0,l.useState)(null),[h,u]=(0,l.useState)(!!(null==(n=null==a?void 0:a.myZawyaComponents)?void 0:n.length)),p=t.MyZawyaListingTranslation[(null==a?void 0:a.locale)||s.y3.EN]||t.MyZawyaListingTranslation[s.y3.EN];(0,l.useEffect)(()=>{"my-topics"===new URLSearchParams(window.location.search).get("tab")&&d("my-topics")},[]),(0,l.useEffect)(()=>{var n;"my-zawya"===c&&(null==(n=null==a?void 0:a.myZawyaComponents)?void 0:n.length)&&(u(!0),setTimeout(async()=>{const{onLoad:a}=await e.e(182).then(e.bind(e,"77BJ")),{onLoad:n}=await e.e(3602).then(e.bind(e,"cRbG")),{onLoad:i}=await Promise.all([e.e(198),e.e(4081)]).then(e.bind(e,"lK7D")),{onLoad:l}=await e.e(3794).then(e.bind(e,"a6Tq")),{onLoad:o}=await e.e(1544).then(e.bind(e,"5yZn")),{onLoad:t}=await e.e(6341).then(e.bind(e,"oyv/")),{onLoad:s}=await e.e(1713).then(e.bind(e,"Zoy6")),{onLoad:c}=await e.e(9355).then(e.bind(e,"tJWE")),{onLoad:d}=await e.e(3974).then(e.bind(e,"IENv")),{onLoad:y}=await Promise.all([e.e(6235),e.e(198),e.e(7573)]).then(e.bind(e,"+G2d")),{onLoad:m}=await Promise.all([e.e(3633),e.e(6452),e.e(718),e.e(4228),e.e(6873)]).then(e.bind(e,"aYTk"));a(),n(),i(),l(),o(),t(),s(),c(),d(),y(),m(),u(!1)},200))},[c,null==a?void 0:a.myZawyaComponents]);return(0,i.jsxs)("div",{className:"my-zawya-listing__inner-wrapper",children:[(0,i.jsxs)("div",{className:"my-zawya-listing__tabs",children:[(0,i.jsx)("button",{className:"my-zawya-listing__tab "+("my-zawya"===c?"active":""),onClick:()=>d("my-zawya"),children:p.myZawyaTab}),(0,i.jsx)("button",{className:"my-zawya-listing__tab "+("my-topics"===c?"active":""),onClick:()=>d("my-topics"),children:p.myTopicsTab})]}),"my-zawya"===c&&(0,i.jsxs)("div",{className:"my-zawya-listing__content",children:[h&&(0,i.jsx)("div",{className:"my-zawya-listing__loader",children:"Loading..."}),(null==(o=null==a?void 0:a.myZawyaComponents)?void 0:o.length)?a.myZawyaComponents.map((a,n)=>(0,i.jsx)("div",{className:"my-zawya-listing__component",dangerouslySetInnerHTML:{__html:a}},n)):(0,i.jsx)("div",{className:"my-zawya-listing__no-content-wrapper",children:(0,i.jsxs)("div",{className:"my-zawya-listing__no-content",children:[(0,i.jsx)("div",{className:"my-zawya-listing__no-content-text",children:p.noMyZawyaContent}),(0,i.jsx)("a",{className:"my-zawya-listing-no-content-link",href:`/${a.locale||s.y3.EN}`,children:p.exploreTopNews})]})})]}),"my-topics"===c&&(0,i.jsx)("div",{className:"my-zawya-listing__topics",children:(null==y?void 0:y.length)?(0,i.jsx)("ul",{className:"my-zawya-listing__topics-list",children:y.map(a=>(0,i.jsxs)("li",{className:"my-zawya-listing__topics-item",children:[(0,i.jsx)("a",{href:a.url,children:a.name}),(0,i.jsx)("button",{className:"my-zawya-listing__topics-unfollow",onClick:()=>(async a=>{if(window.nexa){w(a.id);try{await window.nexa.profile.interactions.delete(a.id),m(n=>n.filter(n=>n.id!==a.id))}catch(a){console.error("[MyZawya] Failed to unfollow topic:",a)}finally{w(null)}}})(a),disabled:r===a.id,"aria-label":`${p.unfollow} ${a.name}`,children:r===a.id?p.removing:p.unfollow})]},a.id))}):(0,i.jsx)("div",{className:"my-zawya-listing__no-content-wrapper",children:(0,i.jsxs)("div",{className:"my-zawya-listing__no-content",children:[(0,i.jsx)("div",{className:"my-zawya-listing__no-content-text",children:p.noFollowedTopics}),(0,i.jsx)("a",{className:"my-zawya-listing-no-content-link",href:`/${a.locale||s.y3.EN}`,children:p.exploreTopNews})]})})})]})};let d=0;function y(){d++;try{document.querySelectorAll(".my-zawya-listing").forEach(a=>{const n=null==a?void 0:a.getAttribute("data-configuration");if(n){const{myZawyaComponents:e=[],locale:l,followedTopics:t=[]}=JSON.parse(n)||{};a.innerHTML="",(0,o.H)(a).render((0,i.jsx)(c,{myZawyaComponents:e,locale:l,followedTopics:t}))}})}catch(a){console.log("ERROR: Couldn't render My ZAWYA listing component -> ",a),d<100&&setTimeout(()=>{y()},500)}}const m=c}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.