(this["webpackJsonp6th-street"]=this["webpackJsonp6th-street"]||[]).push([[141],{1378:function(t,n,e){},1568:function(t,n,e){"use strict";var o=e(1),r=e.n(o),c=e(21),a=(e(1378),e(113)),s=e(180),u=e(14),i=e(11);const l="https://blog.aivi.com",f=new URL(l).pathname.replace(/\/$/,""),d="".concat(l,"/wp-json/astra/v1/post-translation"),h="".concat(l,"/wp-json/wp/v2/categories"),g={},p={en:{landing:"/en/blog/",list:"/en/blog-list/"},ar:{landing:"/ar/\u0645\u062f\u0648\u0646\u0629/",list:"/ar/\u0623\u0631\u0634\u064a\u0641-\u0627\u0644\u0645\u062f\u0648\u0646\u0629/"}};function b(t,n){g[t]=n;try{sessionStorage.setItem(t,n)}catch{}}function m(t,n){const e=function(t){if(void 0!==g[t])return g[t];try{const n=sessionStorage.getItem(t);if(null!==n)return g[t]=n,n}catch{}return null}(t);return"NOT_FOUND"===e?{slug:n,found:!1}:e?{slug:e,found:!0}:null}function O(t){return/[\u0600-\u06FF]/.test(decodeURIComponent(t))}function w(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"landing";return p[t][n]}function v(t,n,e){return"".concat(t,"_").concat(n,"_").concat(e)}async function R(t){const n=await fetch(t,{credentials:"omit"});if(!n.ok)throw new Error("HTTP ".concat(n.status));return n.json()}async function E(t,n,e){if(n===e)return{slug:t,found:!0};const o=v("post",e,t),r=m(o,t);if(r)return r;try{var c;const r="".concat(d)+"?slug=".concat(encodeURIComponent(t))+"&lang=".concat(encodeURIComponent(n)),a=await fetch(r,{credentials:"omit"});if(404===a.status)return b(o,"NOT_FOUND"),{slug:t,found:!1,networkError:!1};if(!a.ok)throw new Error("HTTP ".concat(a.status));const s=null===(c=(await a.json()).translations)||void 0===c?void 0:c[e];return(null===s||void 0===s?void 0:s.slug)?(b(o,s.slug),{slug:s.slug,found:!0,networkError:!1}):(b(o,"NOT_FOUND"),{slug:t,found:!1,networkError:!1})}catch{return{slug:t,found:!0,networkError:!0}}}async function S(t,n,e){if(n===e)return{slug:t,found:!0};const o=v("category",e,t),r=m(o,t);if(r)return r;try{var c;const r="".concat(h)+"?slug=".concat(encodeURIComponent(t))+"&lang=".concat(encodeURIComponent(n)),a=await R(r);if(!(null===a||void 0===a?void 0:a.length))return b(o,"NOT_FOUND"),{slug:t,found:!1};const s=null===(c=a[0].translations)||void 0===c?void 0:c[e];if(!s)return b(o,"NOT_FOUND"),{slug:t,found:!1};const u=(await R("".concat(h,"/").concat(s))).slug||t;return b(o,u),{slug:u,found:!0}}catch{return b(o,"NOT_FOUND"),{slug:t,found:!1}}}function y(t,n){return{path:w(t,"landing"),search:n,notFound:!1}}function F(t,n){const e=new URLSearchParams(n).get("category");if(!e)return Promise.resolve({path:w(t,"list"),search:n,notFound:!1});const o=O(e)?"ar":"en";return o===t?Promise.resolve({path:w(t,"list"),search:n,notFound:!1}):async function(t,n,e){if(!t||n===e)return t;const o=new URLSearchParams(t),r=o.get("category");if(!r)return t;const{slug:c,found:a}=await S(r,n,e);a?o.set("category",c):o.delete("category");const s=o.toString();return s?"?".concat(s):""}(n,o,t).then(n=>({path:w(t,"list"),search:n,notFound:!1}))}async function T(t,n,e){const o=decodeURIComponent(t);if("/blog"===o||"/blog/"===o)return y(e,n);if("/blog-list"===o||"/blog-list/"===o)return F(e,n);if(o.startsWith("/blog/")){const t=o.replace(/^\/blog\/?/,"").replace(/\/$/,"");return t?async function(t,n){const e=O(t);if("ar"===n&&e||"en"===n&&!e)return{path:"/".concat(n,"/").concat(t,"/"),search:"",notFound:!1};if("en"===n&&e)return{path:"",search:"",notFound:!0};const o=await E(t,"en","ar");return o.found||o.networkError?{path:"/ar/".concat(o.slug,"/"),search:"",notFound:!1}:{path:"",search:"",notFound:!0}}(t,e):y(e,"")}return y(e,n)}var U=e(13).checkBEMProps;n.a=Object(u.b)(null,null)((function(t){let{loadingText:n}=t;const e=Object(c.h)(),u=Object(c.g)(),d=function(){try{const t=window.location.hostname.match(/^(en|ar)-[a-z]{2}\./);if(t)return t[1]}catch{}return Object(i.h)()?"ar":"en"}(),h=Object(o.useRef)(null),g=Object(o.useRef)(0),[p,b]=Object(o.useState)(!1),[m,w]=Object(o.useState)(!0),[v,R]=Object(o.useState)("auto"),[y,F]=Object(o.useState)(null);if(Object(o.useEffect)(()=>{const t=++g.current;w(!0),R("auto"),b(!1),F(null),T(e.pathname,e.search,d).then(n=>{let{path:e,search:o,notFound:r}=n;g.current===t&&(r?(F("NOT_FOUND"),w(!1)):F(l+e+(o||"")))})},[e.pathname,e.search,d]),Object(o.useEffect)(()=>{document.documentElement.setAttribute("dir","ar"===d?"rtl":"ltr")},[d]),Object(o.useEffect)(()=>{function t(t){const n=t.data||{},{type:o}=n;if("WORDPRESS_FILTER_OPEN"===o)return R("auto"),void b(!0);if("WORDPRESS_FILTER_CLOSE"===o){const t=Number(n.height);return b(!1),void(t>100&&R(t+"px"))}if("WORDPRESS_IFRAME_HEIGHT"===o){const t=Number(n.height);return void(t>100&&R(t+"px"))}if("WORDPRESS_STOREFRONT_URL"===o){const{pathname:t="",search:e=""}=n;return void(t&&(window.location.href="".concat(window.location.origin).concat(t).concat(e)))}if("WORDPRESS_ARTICLE_URL"!==o)return;n.postInfo&&(h.current=n.postInfo);const r=n.pathname,c=n.search||"";if(!r)return;const a=(s=r,f&&s.startsWith(f)?s.slice(f.length)||"/":s);var s;const i=decodeURIComponent(a.replace(/^\/(en|ar)(?=\/|$)/,"")||"/"),l=e.pathname+e.search;if("/blog-list"===i||"/blog-list/"===i||"/\u0623\u0631\u0634\u064a\u0641-\u0627\u0644\u0645\u062f\u0648\u0646\u0629"===i||"/\u0623\u0631\u0634\u064a\u0641-\u0627\u0644\u0645\u062f\u0648\u0646\u0629/"===i){const t=new URLSearchParams(c),n=t.get("category");if(n){S(n,O(n)?"ar":"en",d).then(n=>{let{slug:e,found:o}=n;o?t.set("category",e):t.delete("category");const r=t.toString()?"?"+t.toString():"",c="/blog-list/".concat(r);l!==c&&u.push(c)})}else{const t="/blog-list/".concat(c);l!==t&&u.push(t)}return}if(function(t){return["/blog","/blog/","/\u0645\u062f\u0648\u0646\u0629","/\u0645\u062f\u0648\u0646\u0629/"].includes(t)}(i)){const t="/blog".concat(c);return void(l!==t&&u.push(t))}const g=decodeURIComponent(i.replace(/^\//,"").replace(/\/$/,""));if(!g)return;const p=O(g);if("ar"===d&&p)E(g,"ar","en").then(t=>{let{slug:n,found:e}=t;const o="/blog/".concat(e?n:g,"/").concat(c);l!==o&&u.push(o)});else if("ar"!==d||p){const t="/blog/".concat(g,"/").concat(c);l!==t&&u.push(t)}else{const t="/blog/".concat(g,"/").concat(c);l!==t&&u.push(t)}}return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[u,e.pathname,e.search,d]),"NOT_FOUND"===y)return U(r.a,s.default,null);const I=null!==y;return U(r.a,"div",{block:"WordPressIframe",elem:"Wrapper",mods:{isArabic:"ar"===d}},U(r.a,a.a,{isLoading:m||!I}),I&&U(r.a,"iframe",{key:y,id:"blogIframe",src:y,onLoad:()=>w(!1),block:"WordPressIframe",elem:"Iframe",className:p?"popup-open":"",style:{width:"100%",height:v,minHeight:"100vh",border:"none",display:"block",overflow:"hidden"}}))}))},2867:function(t,n,e){"use strict";e.r(n),function(t,o){e.d(n,"BreadcrumbsDispatcher",(function(){return s})),e.d(n,"mapStateToProps",(function(){return u})),e.d(n,"mapDispatchToProps",(function(){return i}));var r=e(14),c=e(1),a=e(1568);const s=e.e(5).then(e.bind(null,444)),u=t=>({}),i=(t,n)=>({});var l=e(13).checkBEMProps;n.default=Object(r.b)(u,i)((function(){const n=Object(r.c)();return Object(c.useEffect)(()=>{(()=>{const e=[{url:"/blogs",name:t("Blog")},{url:"/",name:t("Home")}];s.then(t=>{let{default:o}=t;return o.update(e,n)})})()},[]),l(o,a.a,{wordpressPath:"/blog/",loadingText:"Loading..."})}))}.call(this,e(28),e(1))}}]);