PF
Pranto FH
Connecting… · সংযোগ হচ্ছে…
Taking a little longer — check your internet connection. · একটু বেশি সময় লাগছে — ইন্টারনেট সংযোগ দেখুন।
Try again · আবার চেষ্টা
']]; while(i < lo.length){ var b = lo.indexOf('= 0 && p < b && (ks < 0 || p < ks)){ ks = p; k = j; } } if(k < 0){ if(/[\s>\/]/.test(lo.charAt(b + 5))){ var e = lo.indexOf('>', b); return e < 0 ? -1 : e + 1; } i = b + 5; continue; } var se = lo.indexOf(SK[k][1], ks + SK[k][0].length); if(se < 0) return -1; i = se + SK[k][1].length; } return -1; } var TPL_CACHE = 'nx-template-v1'; function tplSha(u){ return fetch(u + '/sha.json', {cache:'no-store'}).then(function(r){ return r.ok ? r.json() : null; }) .then(function(h){ return (typeof h === 'string' && /^[0-9a-f]{64}$/.test(h)) ? h : null; }).catch(function(){ return null; }); } function tplCached(u){ try{ if(!W.caches || !W.caches.open) return Promise.resolve(null); return W.caches.open(TPL_CACHE).then(function(c){ return c.match(u + '/source.json'); }) .then(function(r){ return r ? r.json() : null; }) .then(function(e){ if(!e || typeof e.src !== 'string' || !e.src || !e.sha) return null; return tplSha(u).then(function(h){ return (h && h === e.sha) ? e.src : null; }); }).catch(function(){ return null; }); }catch(e){ return Promise.resolve(null); } } function tplSave(u, sha, src){ try{ if(!sha || !W.caches || !W.caches.open || !W.Response) return; var key = u + '/source.json'; W.caches.open(TPL_CACHE).then(function(c){ return c.put(key, new W.Response(JSON.stringify({sha: sha, src: src, at: Date.now()}), {headers: {'content-type': 'application/json'}})) .then(function(){ return c.keys(); }) .then(function(ks){ ks = ks.filter(function(k){ return k.url !== key; }); ks.slice(0, Math.max(0, ks.length - 2)).forEach(function(k){ c['delete'](k); }); }); // keep this + 2 more (websites sharing one domain) }).catch(function(){}); }catch(e){} } function preImages(){ try{ if(L.role === 'admin' || !L.siteUid) return; var h = JSON.parse(W.localStorage.getItem('nx_preimg_v1:' + L.siteUid) || 'null'); if(!h || !h.u || !h.u.slice || Date.now() - (Number(h.t) || 0) > 30 * 864e5) return; h.u.slice(0, 6).forEach(function(u){ if(typeof u !== 'string' || u.length > 600 || !/^https:\/\/[^\s"'<>\\]+$/.test(u)) return; fetch(u, {mode:'no-cors', credentials:'include'}).then(function(r){ return r.blob(); }).catch(function(){}); }); }catch(e){} } function hintOrigin(u){ try{ var m = /^https:\/\/[^\/\s"'<>]+/.exec(String(u || '')); if(!m || !D.head) return; var l = D.createElement('link'); l.rel = 'preconnect'; l.href = m[0]; D.head.appendChild(l); }catch(e){} } var preDone = false; function start(){ var my = ++run; if(!preDone){ preDone = true; preImages(); } var box = $('nx-ld-fail'); if(box){ box.hidden = true; box.innerHTML = ''; } clearTimeout(slowT); slow(false); slowT = setTimeout(function(){ if(my === run && !done) slow(true); }, 8000); if(!base || !L.siteUid){ fail('config', 'Missing site configuration.'); return; } if(W.navigator && W.navigator.onLine === false){ fail('offline'); return; } step('connect'); fetch(base + '/siteRuntime/' + encodeURIComponent(L.siteUid) + '.json', {cache:'no-store'}) .then(function(r){ if(!r.ok) throw err('server', 'Registry HTTP ' + r.status); return r.json(); }) .then(function(rec){ if(my !== run) return; if(!rec || !rec.runtime || !rec.templateVersionId) throw err('unpublished', 'This website is not published yet.'); hintOrigin(rec.runtime.firebaseConfig && rec.runtime.firebaseConfig.databaseURL); var p = rec.runtime.platform, by = $('nx-ld-by'); if(by && p && p.name) by.textContent = 'Powered by ' + String(p.name).slice(0, 60); step('fetch'); var tplUrl = base + '/templateCode/' + encodeURIComponent(rec.templateVersionId); return tplCached(tplUrl).then(function(hit){ if(hit) return hit; var shaP = tplSha(tplUrl); return fetch(tplUrl + '/source.json', {cache:'no-store'}) .then(function(r){ if(!r.ok) throw err(r.status >= 500 || r.status === 0 ? 'server' : 'template', 'Template HTTP ' + r.status); return r.json(); }) .then(function(src){ if(typeof src === 'string' && src) shaP.then(function(h){ tplSave(tplUrl, h, src); }); return src; }); }) .then(function(src){ if(my !== run) return; if(typeof src !== 'string' || !src) throw err('template', 'Template code is missing for this version.'); step('build'); var rt = rec.runtime; rt.status = rec.status || rt.status; rt.statusMessage = rec.statusMessage || ''; rt.statusReason = rec.statusReason || ''; rt.billing = rec.billing || rt.billing; rt.builtAt = Date.now(); var html = NX_BUILD(src, rt, L.role, '(' + NX_BOOT_SRC + ')();', {min:false}); done = true; clearTimeout(slowT); html = handoff(html); document.open(); document.write(html); document.close(); }); }).catch(function(e){ if(my === run) fail(kindOf(e), (e && e.message) || e); }); } var again = $('nx-ld-retry'); if(again) again.onclick = start; W.addEventListener('offline', function(){ if(!done) fail('offline'); }); W.addEventListener('online', function(){ if(!done) start(); }); start(); })();