PageSourceSearch

https://travelfeed.com/_next/static/chunks/pages/dashboard/preview/[id]-4f75cc9ed37ae5ab.js

js travelfeed.com collected 2026-10-02 10:35:12 UTC 17,440 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8034,5878],{56234:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/preview/[id]",function(){return n(95459)}])},51588:function(t,e,n){"use strict";n.d(e,{Q:function(){return i},e:function(){return o}});var a=n(84131);let o=[{icon:a.J9Y,title:"feed"},{icon:a.Wx7,title:"map"},{icon:a.GTN,title:"destinations"}],i=["/explore","/map","/destinations"]},43631:function(t,e,n){"use strict";n.d(e,{Z:function(){return S}});var a=n(85893),o=n(67294),i=n(5152),r=n.n(i),c=n(11163),l=n.n(c),s=n(88953),d=n(71287),u=n(28839),m=n(18376),p=n(30436),h=n(23761),g=n(52885),f=n(51588),w=n(42779),v=n(42251),b=n(81545),y=n(89361),x=n(74393);let j=r()(()=>n.e(8999).then(n.bind(n,48999)),{loadableGenerated:{webpack:()=>[48999]}});var S=t=>{let e,n,i,r,c,S,k,T,_,I,E,P,C,N,F,O,$,D,Z,q,U,A,R,{post:B,recommendedPosts:J,isAmp:L,isSimpleCover:G}=t,M=0,W="",X={},Q=[],{permlink:z,title:H,thumb:K,createdAt:V}=B;X.username=B.author,B&&B.permlink&&(E=B.app,e=B.tags,n=B.smiles,i=B.totalSmiles,r=B._id,M=B.comments,X=B.author,z=B.permlink,H=B.title,W=B.body,K=B.thumb,O=B.cover,$=B.youtubeId,V=B.createdAt,c=B.json,S=B.updatedAt,T=B.excerpt,P=B.location,C=B.wordCount,N=B.readTime,F=B.c
1ommunity,D=B.blacklist,Z=B.seo,q=B.images,U=B.faq,A=B.seo?B.seo.hostingUrl:void 0,R=B.isUgcLinks,P&&(_=(0,d.slugFromCC)(P.countryCode),I=(0,d.nameFromCC)(P.countryCode)),P&&(P.countryCode&&Q.push({position:1,name:I,item:"https://travelfeed.com/destinations/".concat(_)}),P.subdivision&&Q.push({position:2,name:P.subdivision,item:"https://travelfeed.com/destinations/".concat(_,"/").concat(P.subdivision)}),P.city&&Q.push({position:3,name:P.city,item:"https://travelfeed.com/destinations/".concat(_,"/").concat(P.subdivision,"/").concat(P.city)})));let Y="travelfeed"===E||"truvvl"===E,tt="https://og.travelfeed.com/api/post?title=".concat(encodeURIComponent(H),"&user=").concat(encodeURIComponent(X.username),"&image=").concat(encodeURIComponent(K?K.url:void 0)),[te,tn]=(0,o.useState)(M),[ta,to]=(0,o.useState)(n),[ti,tr]=(0,o.useState)(i),[tc,tl]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(0,h.PR)()&&tl(!0)},[]);let ts=(0,s.Z)("(max-width: 991px)");(0,y.a)(x.GW,{variables:{author:X.username,permlink:z},onCompleted:function(t){t&&t.post&&(tn(t.post.comments),to(t.post.smiles),tr(t.post.totalSmiles))},ssr:!1,fetchPolicy:"no-cache"});let{mode:td}=function(t){let e,{cover:n,thumb:a,images:o,youtubeId:i,isSimpleCover:r}=t;
1if(n&&n.url&&(e=n),!e&&a&&a.url&&(e=a),r||i||!e)return{mode:"none",coverImage:e};let{width:c,height:l}=e;if((!c||!l)&&o){let t=(0,g.findImageFromList)(e.url,o);t&&t.width&&t.height&&({width:c,height:l}=t)}return{mode:"number"==typeof c&&"number"==typeof l&&l>0&&c>=1100&&c/l>=1.3?"cinematic":"journal",coverImage:e}}({cover:O,thumb:K,images:q,youtubeId:$,isSimpleCover:G}),tu="cinematic"===td,tm={location:P,title:H,thumb:K,cover:O,heroMode:td,youtubeId:$,excerpt:T,createdAt:V,tags:e,author:X,isTf:Y,permlink:z,_id:r,body:W,comments:te,totalSmiles:ti,smiles:ta,json:c,hasData:B,schema:k,wordCount:C,readTime:N,slug:_,community:F,updatedAt:S,blacklist:D,allImgDetails:q,isUgcLinks:R};return K&&K.url&&(tm.thumbnail=K.url),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{seo:Z,shorttitle:H,language:F?F.lang:void 0,image:tt,description:T,post:B,breadcrumbs:Q,noIndex:D&&D.isUnlisted||D&&D.isNoindex,noFollow:D&&D.isNoindex,isAmp:L,type:"article",faq:U,isNotFree:!W&&D&&D.isMembersOnly}),L?(0,a.jsx)(j,{post:tm,recommendedPosts:J}):(0,a.jsxs)(a.Fragment,{children:[tc?(0,a.jsx)(p.Z,{active:"post",isScrollingNav:tu,noSpacer:tu,socialShare:{author:X.username,permlink:z,tags:e,title:H,thumbnail:K?K.url:void 0}}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.Z,{overPhoto:tu}),ts&&(0,a.jsx)(v.Z,{navItems:f.e,value:!1,handleChange:(t,e)=>l().push({pathname:f.Q[e]})})]}),(0,a.jsx)(b.Z,{post:tm,hostingUrl:A,isSimpleCover:G}),(0,a.jsx)(u.Z,{})]})]})}},64906:function(t,e,n){"use strict";n.d(e,{wE:function(){return S},$P:function(){return y},kq:function(){return w}});var a=n(45843),o=n.n(a),i=n(91036),r=n.n(i),c=n(989),l=n.n(c),s=n(91133),d=n(81523),u=n(94919),m=n(50529),p=n(35233),h=n(76289);async function g(t,e){try{let n;let a=await fetch("https://api.mapbox.com/geocoding/v5/mapbox.places/".concat(e,",").concat(t,".json?types=country,region,place&language=en-GB&access_token=").concat(h.MAPBOX_TOKEN)),o=await a.json();if(!o||!o.features)return;let i={};if(o.features.forEach(t=>{let e=t.place_type||[];!n&&t.bbox&&(n=t.bbox),-1!==e.indexOf("country")&&t.properties&&t.properties.short_code&&(i.countryCode=t.properties.short_code.toLowerCase()),-1!==e.indexOf("region")&&(i.subdivision=t.text),-1!==e.indexOf("place")&&(i.city=t.text)}),!i.countryCode)return;return i.city&&i.city===i.subdivision&&delete i.subdivision,n&&(i.bbox=n),i}catch(t){return}}let f=t=>"tf-preview-".concat(t),w=t=>{for(let t=localStorage.length-1;t>=0;t-=1){let e=localStorage.key(t);if(e&&0===e.indexOf("tf-preview-")){let t;try{t=JSON.parse(localStorage.getItem(e))}catch(e){t=void 0}(!t||!t.savedAt||Date.now()-t.savedAt>864e5)&&localStorage.removeItem(e)}}localStorage.setItem(f(t.id),JSON.stringify(t))},v=t=>{let e=Error(t);return e.code=t,e},b=t=>!!(t&&t.latitude>=-90&&t.latitude<=90&&t.longitude>=-180&&t.longitude<=180),y=async(t,e)=>{let n,a;try{n=JSON.parse(localStorage.getItem(f(t)))}catch(t){n=void 0}if(n&&1===n.v&&n.id===t&&n.username===e||(n=void 0),n&&((n.body||"").trim()||n.youtubeId))return n;try{let e=await (0,m.default)(d.h1,{id:t});a=e&&e.draft}catch(t){a=void 0}if(!a){if(n)return n;throw v("not_found")}let o={};try{a.json&&"undefined"!==a.json&&(o=JSON.parse(a.json))}catch(t){o={}}return{title:a.title,body:!1===a.isCodeEditor&&a.body?(0,p.Z)(JSON.parse(a.body)):a.body||"",tags:o.tags,location:b(o.location)?{latitude:o.location.latitude,longitude:o.location.longitude}:void 0,coverImage:o.coverImage,featuredImage:o.featuredImage,permlink:o.permlink,youtubeId:o.youtubeId,seo:o.seo}},x=t=>new Promise(e=>{let n=new window.Image,a=setTimeout(()=>e(void 0),5e3);n.onload=()=>{clearTimeout(a),e({url:t,width:n.naturalWidth,height:n.naturalHeight})},n.onerror=()=>{clearTimeout(a),e(void 0)},n.src=t}),j=async t=>{let e=new window.DOMParser().parseFromString(t,"text/html"),n=[];return e.querySelectorAll("img").forEach(t=>{let e=t.getAttribute("src");e&&-1===n.indexOf(e)&&n.push(e)}),(await Promise.all(n.slice(0,50).map(x))).filter(Boolean)},S=async(t,e,n)=>{let a=(0,s.parseBody)(t.body||"",{}),i=r()(a,{allowedTags:[]});if(!i.trim()&&!t.youtubeId)throw v("empty");let c=o()(i),d=i.replace(/\s+/g," ").trim().slice(0,250),[p,h,f]=await Promise.allSettled([(0,m.default)(u.jt,{username:e}),t.location?g(t.location.latitude,t.location.longitude):Promise.resolve(void 0),j(a)]),w="fulfilled"===p.status&&p.value&&p.value.profile&&p.value.profile.author||{username:e},b="fulfilled"===h.status?h.value:void 0,y="fulfilled"===f.status?f.value:[];return{_id:"preview-".concat(n),author:w,title:t.title||"Untitled",body:a,permlink:t.permlink||l()(t.title||"")||"preview",createdAt:new Date(Date.now()-12e4).toISOString(),updatedAt:void 0,excerpt:d,tags:t.tags||[],location:t.location?{coordinates:{co
1ordinates:[t.location.longitude,t.location.latitude]},...b||{}}:void 0,wordCount:c.words,readTime:c.minutes,community:void 0,cover:t.coverImage?{url:t.coverImage}:void 0,thumb:t.featuredImage?{url:t.featuredImage}:void 0,youtubeId:t.youtubeId,blacklist:{isNoindex:!0},seo:t.seo,app:"travelfeed",images:y,comments:0,totalSmiles:0,smiles:[],isUgcLinks:!1,truvvl:void 0,faq:void 0,json:void 0}}},81523:function(t,e,n){"use strict";n.d(e,{Eg:function(){return u},dL:function(){return m},gh:function(){return d},h1:function(){return p}});var a=n(36971),o=n(15098);function i(){let t=(0,a._)(["\n  mutation addDraft($draft: DraftInput!) {\n    addDraft(draft: $draft) {\n      success\n      message\n    }\n  }\n"]);return i=function(){return t},t}function r(){let t=(0,a._)(["\n  mutation deleteDraft($id: String!) {\n    deleteDraft(id: $id) {\n      success\n      message\n    }\n  }\n"]);return r=function(){return t},t}function c(){let t=(0,a._)(["\n  query drafts(\n    $offset: Int\n    $limit: Int\n    $isScheduled: Boolean\n    $isPublished: Boolean\n  ) {\n    drafts(\n      offset: $offset\n      limit: $limit\n      isScheduled: $isScheduled\n      isPublished: $isPublished\n    ) {\n      id\n      savedate\n      title\n      snapshot\n      scheduledDate\n      publishedDate\n      isScheduleFailed\n    }\n  }\n"]);return c=function(){return t},t}function l(){let t=(0,a._)(["\n  query draft($id: String!) {\n    draft(id: $id) {\n      title\n      body\n      json\n      isCodeEditor\n    }\n  }\n"]);return l=function(){return t},t}function s(){let t=(0,a._)(["\n  query draft($id: String!) {\n    draft(id: $id) {\n      title\n    }\n  }\n"]);return s=function(){return t},t}let d=(0,o.Ps)(i()),u=(0,o.Ps)(r()),m=(0,o.Ps)(c()),p=(0,o.Ps)(l());(0,o.Ps)(s())},35233:function(t,e,n){"use strict";var a=n(91036),o=n.n(a),i=n(71287);function r(t){return JSON.stringify(t).replace(/"/g,"&quot;")}e.Z=t=>{let e="";return t&&t.blocks?(t.blocks.forEach(n=>{if("tableOfContents"===n.type){let a=[];t.blocks.forEach(t=>{if("header"===t.type&&(1===t.data.level||2===t.data.level||3===t.data.level||4===t.data.level)&&t.data.text){let{level:e}=t.data,n={title:(0,i.escapeString)("".concat(t.data.text.replace(/\n/g," ")," ")),subheadings:[]};if((1===e||2===e)&&a.push(n),3===e&&a&&a[a.length-1]&&a[a.length-1].subheadings.push(n),4===e&&a[a.length-1]){let t=a[a.length-1].subheadings;t&&t[t.length-1]&&t[t.length-1].subheadings.push(n)}}}),n.data={headings:a},e+='\n\n<div json="'.concat(r(n),'"><h2>Table of contents</h2>').concat(a&&a.length>0?"<ol>".concat(a.map(t=>"<li>".concat(t.title).concat(t.subheadings.length>0?"<ol>".concat(t.subheadings.map(t=>"<li>".concat(t.title).concat(t.subheadings.length>0?"<ol>".concat(t.subheadings.map(t=>"<li>".concat(t.title,"</li>")).join(""),"</ol>"):"","</li>")).join(""),"</ol>"):"","</li>")).join(""),"</ol>"):"","</div>\n\n")}else if("paragraph"===n.type&&n.data.text){if(n.tunes&&n.tunes.alignmentTune&&n.tunes.alignmentTune.alignment&&"left"!==n.tunes.alignmentTune.alignment){let t="";"center"===n.tunes.alignmentTune.alignment&&(t="text-center"),"right"===n.tunes.alignmentTune.alignment&&(t="text-right"),e+='<div class="'.concat(t,'">').concat(n.data.text.replace(/\n/g," "),"</div>")}else e+="".concat(n.data.text.replace(/\n/g," "),"\n\n")}else"code"===n.type?e+="".concat(n.data.html,"\n\n"):"header"===n.type?n.tunes&&n.tunes.alignmentTune&&n.tunes.alignmentTune.alignment&&"left"!==n.tunes.alignmentTune.alignment?("center"===n.tunes.alignmentTune.alignment&&(e+="<center><h".concat(n.data.level,">").concat(n.data.text.replace(/\n/g," "),"</h").concat(n.data.level,"></center>\n\n")),"right"===n.tunes.alignmentTune.alignment&&(e+="<h".concat(n.data.level,' class="text-right">').concat(n.data.text.replace(/\n/g," "),"</h").concat(n.data.level,">\n\n"))):e+="<h".concat(n.data.level,">").concat(n.data.text.replace(/\n/g," "),"</h").concat(n.data.level,">\n\n"):"list"===n.type?("ordered"===n.data.style?n.data.items.forEach((t,n)=>{e+="".concat(n+1,". ").concat(t.replace(/\n/g," "),"\n")}):n.data.items.forEach(t=>{e+="- ".concat(t.replace(/\n/g," "),"\n")}),e+="\n\n"):"image"===n.type?e+="<figure><img ".concat(n.data.caption?'alt="'.concat((0,i.escapeString)(o()("".concat(n.data.caption.replace(/\n/g," ")," "),{allowedTags:[]})),'" '):"",'src="').concat(n.data.file.url,'" ').concat(n.data.file.width?'width="'.concat(n.data.file.width,'"'):""," ").concat(n.data.file.height?'height="'.concat(n.data.file.height,'"'):""," />").concat(n.data.caption?"<figcaption>
1".concat(n.data.caption.replace(/\n/g," "),"</figcaption>"):"","</figure>\n\n"):"imageUrl"===n.type?e+="<figure><img ".concat(n.data.caption?'alt="'.concat((0,i.escapeString)(o()("".concat(n.data.caption," "),{allowedTags:[]})),'" '):"",'src="').concat(n.data.url,'"').concat(n.data.width?' width="'.concat(n.data.width,'"'):"").concat(n.data.height?' height="'.concat(n.data.height,'"'):""," />").concat(n.data.caption||n.data.unsplash?"<figcaption>".concat(n.data.caption?"".concat(n.data.caption):"").concat(n.data.caption&&n.data.unsplash?" - ":"").concat(n.data.unsplash?'Photo by <a href="'.concat(n.data.unsplash.profileLink,'?utm_source=TravelFeed&utm_medium=referral">').concat(n.data.unsplash.author,'</a> on <a href="https://unsplash.com/?utm_source=TravelFeed&utm_medium=referral">Unsplash</a>'):"","</figcaption>"):"","</figure>\n\n"):"quote"===n.type?e+="> ".concat(n.data.text.replace(/\n/g," "),"\n\n"):"delimiter"===n.type?e+="<hr/>\n\n":"embed"===n.type?e+="".concat(n.data.source,"\n\n"):"table"===n.type?(n.data.content.forEach((t,n)=>{e+="| ",0===n?(t.forEach(t=>{e+="".concat(t," |")}),e+="\n|",t.forEach(()=>{e+=" --- |"})):t.forEach(t=>{e+="".concat(t," |")}),e+="\n"}),e+="\n\n"):"linkTool"===n.type&&n.data.meta?"itinerary"===n.data.meta.type?e+='\n\n<div json="'.concat(r(n),'"><img src="https://travelfeed.com/api/map?author=').concat(n.data.meta.author,"&permlink=").concat(n.data.meta.permlink,"\" /><p>\n        View <a href='").concat(n.data.link,"'>").concat(n.data.meta.title," Itinerary</a> on TravelFeed</p></div>\n\n"):e+='\n\n<div json="'.concat(r(n),"\"><a href='").concat(n.data.link,"'><center><img src='").concat(n.data.meta.image,"' alt='").concat(n.data.meta.title,"'/><h3>Read \"").concat(n.data.meta.title,'" on TravelFeed</h3></center></a></div>\n\n'):"imageGallery"===n.type&&n.data.images?(n.data.images.forEach((t,e)=>{t&&t.caption&&(n.data.images[e].caption=(0,i.escapeString)(o()("".concat(t.caption.replace(/\n/g," ")," "),{allowedTags:[]})))}),e+='\n\n<div json="'.concat(r(n),'">').concat(n.data&&n.data.images&&n.data.images.length>0?n.data.images.map(t=>{let{url:e,caption:n}=t;return'<center><img src="'.concat(e,'"').concat(n?' alt="'.concat((0,i.escapeString)(o()("".concat(n.replace(/\n/g," ")," "),{allowedTags:[]})),'"'):""," /></center>")}).join(""):"","</div>\n\n")):"button"===n.type&&n.data&&n.data.link&&n.data.text?e+='\n\n<div json="'.concat(r(n),"\"><a href='").concat(n.data.link,"'><center>").concat((0,i.escapeString)(o()("".concat(n.data.text," "),{allowedTags:[]})),"</center></a></div>\n\n"):"spoiler"===n.type&&n.data&&n.data.title&&(e+="\n\n<details><summary>".concat(n.data.title,"</summary><p>").concat(n.data.message,"</p></details>\n\n"))}),e):""}},95459:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return v}});var a=n(85893),o=n(42796),i=n(9008),r=n.n(i),c=n(41664),l=n.n(c),s=n(11163),d=n(67294),u=()=>{let[t,e]=(0,d.useState)(!1);return t?null:(0,a.jsx)("div",{className:"tw-fixed tw-left-4 tw-z-[1300] tw-bottom-24 sm:tw-bottom-4",children:(0,a.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2 tw-rounded-full tw-border tw-border-solid tw-border-[rgba(255,255,255,0.15)] tw-bg-[rgba(29,45,40,0.92)] tw-px-4 tw-py-2 tw-font-mono tw-text-[11px] tw-font-semibold tw-uppercase tw-tracking-[0.12em] tw-text-white tw-shadow-lg dark:tw-border-[rgba(29,45,40,0.2)] dark:tw-bg-[rgba(235,230,217,0.95)] dark:tw-text-[#1D2D28]",children:[(0,a.jsx)("span",{className:"tw-h-2 tw-w-2 tw-rounded-full tw-bg-amber-400"}),(0,a.jsx)("span",{children:"Preview \xb7 not published"}),(0,a.jsx)("button",{type:"button","aria-label":"Dismiss preview notice",onClick:()=>e(!0),className:"tw-ml-1 tw-cursor-pointer tw-border-0 tw-bg-transparent tw-p-0 tw-text-base tw-leading-none tw-text-inherit hover:tw-opacity-70",children:"\xd7"})]})})},m=n(56844),p=n(43631),h=n(64906),g=n(23761),f=n(70365);let w={not_found:"This preview has expired or the draft could not be found. Reopen it from the editor's Preview button.",empty:"There is nothing to preview yet. Start writing first."};var v=(0,f.Z)(()=>{let t=(0,s.useRouter)(),{id:e}=t.query,[n,i]=(0,d.useState)(void 0),[c,f]=(0,d.useState)(void 0),[v,b]=(0,d.useState)(!1);return(0,d.useEffect)(()=>
1{if(!t.isReady||!e)return;let n=(0,g.PR)();if(!n){b(!0);return}(0,h.$P)(e,n).then(t=>(0,h.wE)(t,n,e)).then(i).catch(t=>f(t&&t.code||"not_found"))},[t.isReady,e]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r(),{children:[(0,a.jsx)("title",{children:"Preview | TravelFeed"}),(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),v?(0,a.jsx)(m.Z,{statusCode:"logged_out"}):n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Z,{post:n}),(0,a.jsx)(u,{})]}):c?(0,a.jsx)("div",{className:"tw-flex tw-min-h-screen tw-items-center tw-justify-center tw-px-4",children:(0,a.jsxs)("div",{className:"tw-max-w-md tw-rounded-2xl tw-border tw-border-solid tw-border-[#E7E0CF] tw-bg-white tw-p-8 tw-text-center dark:tw-border-[#26382F] dark:tw-bg-[#333F45]",children:[(0,a.jsx)("p",{className:"tw-mb-6 tw-mt-0 tw-text-base",children:w[c]||w.not_found}),(0,a.jsx)(l(),{href:"/dashboard/drafts",className:"tw-font-medium tw-text-primary-600 tw-no-underline hover:tw-underline dark:tw-text-primary-300",children:"Back to drafts"})]})}):(0,a.jsx)(o.Z,{color:"primary"})]})})},5696:function(){},59688:function(){},22868:function(){},14777:function(){},99830:function(){},70209:function(){}},function(t){t.O(0,[4976,7948,8693,5098,8687,3927,1586,8764,1287,7491,650,7693,8446,5724,5620,8084,9539,9810,7324,7323,7130,2231,7955,6156,2163,4641,3726,1036,8826,1133,79,300,5133,2735,687,3899,7616,1545,2888,9774,179],function(){return t(t.s=56234)}),_N_E=t.O()}]);
2//# sourceMappingURL=[id]-4f75cc9ed37ae5ab.js.map

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.