radames commited on
Commit
d0dadf4
1 Parent(s): 9d1ef4b

styling feed

Browse files
client/src/components/NewsBlock.svelte ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script>
2
+ export let feedEntry;
3
+ </script>
4
+
5
+ <div class="group flex">
6
+ {#if feedEntry.media_content}
7
+ <a target="_blank" href={feedEntry.link}>
8
+ <img src={feedEntry.media_content[0].url} />
9
+ </a>
10
+ {/if}
11
+ <b>{feedEntry.sentiment.toFixed(3)}</b>
12
+
13
+ <a target="_blank" href={feedEntry.link}>
14
+ <h2>{feedEntry.title}</h2>
15
+ <h4>{feedEntry.author}</h4>
16
+ <p>{feedEntry.summary}</p>
17
+ {#if feedEntry.tags}
18
+ {#each feedEntry.tags as tag}
19
+ <span>{tag.term}</span>
20
+ {/each}
21
+ {/if}
22
+ </a>
23
+ </div>
client/src/routes/index.svelte CHANGED
@@ -1,20 +1,42 @@
1
  <script>
2
- const fecthPredictions = fetch('news').then((d) => d.json());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  </script>
4
 
5
- <h1 class="text-3xl font-bold">
6
- The New York Times Homepage
7
- </h1>
 
 
 
 
 
8
 
9
- {#await fecthPredictions}
10
  <p>Loading and running sentiment analysis on the latest news...</p>
11
  {:then data}
12
  <ul>
13
- {#each data as entry, i}
14
  <li>
15
- <a target="_blank" href={entry.link}>
16
- {i + 1}: {entry.title}
17
- </a>
18
  </li>
19
  {/each}
20
  </ul>
 
1
  <script>
2
+ import NewsBlock from '../components/NewsBlock.svelte';
3
+
4
+ let predictions;
5
+ let positiveOrder = true;
6
+ async function fecthPredictions() {
7
+ try {
8
+ predictions = await fetch('news').then((d) => d.json());
9
+ } catch (e) {
10
+ predictions = await fetch('static/test.json').then((d) => d.json());
11
+ }
12
+ predictions = predictions.sort((a, b) => b.sentiment - a.sentiment);
13
+ console.log(predictions);
14
+ }
15
+
16
+ function toggleOrder() {
17
+ positiveOrder = !positiveOrder;
18
+ predictions = predictions
19
+ .slice()
20
+ .sort((a, b) => (positiveOrder ? b.sentiment - a.sentiment : a.sentiment - b.sentiment));
21
+ }
22
  </script>
23
 
24
+ <h1 class="text-3xl font-bold">The New York Times Homepage</h1>
25
+
26
+ <button
27
+ class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
28
+ on:click={toggleOrder}
29
+ >
30
+ Click me
31
+ </button>
32
 
33
+ {#await fecthPredictions()}
34
  <p>Loading and running sentiment analysis on the latest news...</p>
35
  {:then data}
36
  <ul>
37
+ {#each predictions as entry, i}
38
  <li>
39
+ <NewsBlock feedEntry={entry} />
 
 
40
  </li>
41
  {/each}
42
  </ul>
client/static/test.json ADDED
The diff for this file is too large to render. See raw diff
 
static/.gitignore DELETED
File without changes
static/_app/assets/pages/__layout.svelte-fb585879.css ADDED
@@ -0,0 +1 @@
 
 
1
+ *,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.text-3xl{font-size:1.875rem;line-height:2.25rem}.font-bold{font-weight:700}
static/_app/chunks/vendor-f86405dd.js ADDED
@@ -0,0 +1 @@
 
 
1
+ function y(){}function I(t,e){for(const n in e)t[n]=e[n];return t}function L(t){return t&&typeof t=="object"&&typeof t.then=="function"}function T(t){return t()}function q(){return Object.create(null)}function g(t){t.forEach(T)}function G(t){return typeof t=="function"}function J(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function K(t){return Object.keys(t).length===0}function at(t,e,n,c){if(t){const r=O(t,e,n,c);return t[0](r)}}function O(t,e,n,c){return t[1]&&c?I(n.ctx.slice(),t[1](c(e))):n.ctx}function ft(t,e,n,c){if(t[2]&&c){const r=t[2](c(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],u=Math.max(e.dirty.length,r.length);for(let s=0;s<u;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function dt(t,e,n,c,r,o){if(r){const u=O(e,n,c,o);t.p(u,r)}}function _t(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let c=0;c<n;c++)e[c]=-1;return e}return-1}let w=!1;function W(){w=!0}function Q(){w=!1}function R(t,e,n,c){for(;t<e;){const r=t+(e-t>>1);n(r)<=c?t=r+1:e=r}return t}function U(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){const i=[];for(let l=0;l<e.length;l++){const f=e[l];f.claim_order!==void 0&&i.push(f)}e=i}const n=new Int32Array(e.length+1),c=new Int32Array(e.length);n[0]=-1;let r=0;for(let i=0;i<e.length;i++){const l=e[i].claim_order,f=(r>0&&e[n[r]].claim_order<=l?r+1:R(1,r,_=>e[n[_]].claim_order,l))-1;c[i]=n[f]+1;const a=f+1;n[a]=i,r=Math.max(a,r)}const o=[],u=[];let s=e.length-1;for(let i=n[r]+1;i!=0;i=c[i-1]){for(o.push(e[i-1]);s>=i;s--)u.push(e[s]);s--}for(;s>=0;s--)u.push(e[s]);o.reverse(),u.sort((i,l)=>i.claim_order-l.claim_order);for(let i=0,l=0;i<u.length;i++){for(;l<o.length&&u[i].claim_order>=o[l].claim_order;)l++;const f=l<o.length?o[l]:null;t.insertBefore(u[i],f)}}function V(t,e){if(w){for(U(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentElement!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;e!==t.actual_end_child?(e.claim_order!==void 0||e.parentNode!==t)&&t.insertBefore(e,t.actual_end_child):t.actual_end_child=e.nextSibling}else(e.parentNode!==t||e.nextSibling!==null)&&t.appendChild(e)}function ht(t,e,n){w&&!n?V(t,e):(e.parentNode!==t||e.nextSibling!=n)&&t.insertBefore(e,n||null)}function X(t){t.parentNode.removeChild(t)}function mt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function Y(t){return document.createElement(t)}function A(t){return document.createTextNode(t)}function pt(){return A(" ")}function yt(){return A("")}function bt(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Z(t){return Array.from(t.childNodes)}function tt(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function P(t,e,n,c,r=!1){tt(t);const o=(()=>{for(let u=t.claim_info.last_index;u<t.length;u++){const s=t[u];if(e(s)){const i=n(s);return i===void 0?t.splice(u,1):t[u]=i,r||(t.claim_info.last_index=u),s}}for(let u=t.claim_info.last_index-1;u>=0;u--){const s=t[u];if(e(s)){const i=n(s);return i===void 0?t.splice(u,1):t[u]=i,r?i===void 0&&t.claim_info.last_index--:t.claim_info.last_index=u,s}}return c()})();return o.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,o}function et(t,e,n,c){return P(t,r=>r.nodeName===e,r=>{const o=[];for(let u=0;u<r.attributes.length;u++){const s=r.attributes[u];n[s.name]||o.push(s.name)}o.forEach(u=>r.removeAttribute(u))},()=>c(e))}function gt(t,e,n){return et(t,e,n,Y)}function nt(t,e){return P(t,n=>n.nodeType===3,n=>{const c=""+e;if(n.data.startsWith(c)){if(n.data.length!==c.length)return n.splitText(c.length)}else n.data=c},()=>A(e),!0)}function xt(t){return nt(t," ")}function kt(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function $t(t,e,n,c){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,c?"important":"")}let b;function d(t){b=t}function E(){if(!b)throw new Error("Function called outside component initialization");return b}function wt(t){E().$$.on_mount.push(t)}function Et(t){E().$$.after_update.push(t)}function jt(t,e){E().$$.context.set(t,e)}const p=[],z=[],k=[],B=[],D=Promise.resolve();let N=!1;function F(){N||(N=!0,D.then(C))}function Nt(){return F(),D}function S(t){k.push(t)}const j=new Set;let x=0;function C(){const t=b;do{for(;x<p.length;){const e=p[x];x++,d(e),ct(e.$$)}for(d(null),p.length=0,x=0;z.length;)z.pop()();for(let e=0;e<k.length;e+=1){const n=k[e];j.has(n)||(j.add(n),n())}k.length=0}while(p.length);for(;B.length;)B.pop()();N=!1,j.clear(),d(t)}function ct(t){if(t.fragment!==null){t.update(),g(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(S)}}const $=new Set;let h;function rt(){h={r:0,c:[],p:h}}function it(){h.r||g(h.c),h=h.p}function H(t,e){t&&t.i&&($.delete(t),t.i(e))}function lt(t,e,n,c){if(t&&t.o){if($.has(t))return;$.add(t),h.c.push(()=>{$.delete(t),c&&(n&&t.d(1),c())}),t.o(e)}}function St(t,e){const n=e.token={};function c(r,o,u,s){if(e.token!==n)return;e.resolved=s;let i=e.ctx;u!==void 0&&(i=i.slice(),i[u]=s);const l=r&&(e.current=r)(i);let f=!1;e.block&&(e.blocks?e.blocks.forEach((a,_)=>{_!==o&&a&&(rt(),lt(a,1,1,()=>{e.blocks[_]===a&&(e.blocks[_]=null)}),it())}):e.block.d(1),l.c(),H(l,1),l.m(e.mount(),e.anchor),f=!0),e.block=l,e.blocks&&(e.blocks[o]=l),f&&C()}if(L(t)){const r=E();if(t.then(o=>{d(r),c(e.then,1,e.value,o),d(null)},o=>{if(d(r),c(e.catch,2,e.error,o),d(null),!e.hasCatch)throw o}),e.current!==e.pending)return c(e.pending,0),!0}else{if(e.current!==e.then)return c(e.then,1,e.value,t),!0;e.resolved=t}}function At(t,e,n){const c=e.slice(),{resolved:r}=t;t.current===t.then&&(c[t.value]=r),t.current===t.catch&&(c[t.error]=r),t.block.p(c,n)}function Ct(t,e){const n={},c={},r={$$scope:1};let o=t.length;for(;o--;){const u=t[o],s=e[o];if(s){for(const i in u)i in s||(c[i]=1);for(const i in s)r[i]||(n[i]=s[i],r[i]=1);t[o]=s}else for(const i in u)r[i]=1}for(const u in c)u in n||(n[u]=void 0);return n}function vt(t){return typeof t=="object"&&t!==null?t:{}}function Mt(t){t&&t.c()}function qt(t,e){t&&t.l(e)}function ut(t,e,n,c){const{fragment:r,on_mount:o,on_destroy:u,after_update:s}=t.$$;r&&r.m(e,n),c||S(()=>{const i=o.map(T).filter(G);u?u.push(...i):g(i),t.$$.on_mount=[]}),s.forEach(S)}function st(t,e){const n=t.$$;n.fragment!==null&&(g(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ot(t,e){t.$$.dirty[0]===-1&&(p.push(t),F(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function zt(t,e,n,c,r,o,u,s=[-1]){const i=b;d(t);const l=t.$$={fragment:null,ctx:null,props:o,update:y,not_equal:r,bound:q(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(i?i.$$.context:[])),callbacks:q(),dirty:s,skip_bound:!1,root:e.target||i.$$.root};u&&u(l.root);let f=!1;if(l.ctx=n?n(t,e.props||{},(a,_,...v)=>{const M=v.length?v[0]:_;return l.ctx&&r(l.ctx[a],l.ctx[a]=M)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](M),f&&ot(t,a)),_}):[],l.update(),f=!0,g(l.before_update),l.fragment=c?c(l.ctx):!1,e.target){if(e.hydrate){W();const a=Z(e.target);l.fragment&&l.fragment.l(a),a.forEach(X)}else l.fragment&&l.fragment.c();e.intro&&H(t.$$.fragment),ut(t,e.target,e.anchor,e.customElement),Q(),C()}d(i)}class Bt{$destroy(){st(this,1),this.$destroy=y}$on(e,n){const c=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return c.push(n),()=>{const r=c.indexOf(n);r!==-1&&c.splice(r,1)}}$set(e){this.$$set&&!K(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const m=[];function Tt(t,e=y){let n;const c=new Set;function r(s){if(J(t,s)&&(t=s,n)){const i=!m.length;for(const l of c)l[1](),m.push(l,t);if(i){for(let l=0;l<m.length;l+=2)m[l][0](m[l+1]);m.length=0}}}function o(s){r(s(t))}function u(s,i=y){const l=[s,i];return c.add(l),c.size===1&&(n=e(r)||y),s(t),()=>{c.delete(l),c.size===0&&(n(),n=null)}}return{set:r,update:o,subscribe:u}}export{vt as A,st as B,I as C,Tt as D,Nt as E,at as F,dt as G,_t as H,ft as I,V as J,y as K,St as L,At as M,mt as N,Bt as S,Z as a,bt as b,gt as c,X as d,Y as e,$t as f,ht as g,nt as h,zt as i,kt as j,pt as k,yt as l,xt as m,rt as n,lt as o,it as p,H as q,jt as r,J as s,A as t,Et as u,wt as v,Mt as w,qt as x,ut as y,Ct as z};
static/_app/error.svelte-772b55a0.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as h,i as w,s as y,e as E,t as v,c as d,a as b,h as P,d as o,g as u,J as R,j as N,k as S,l as C,m as j,K as H}from"./chunks/vendor-f86405dd.js";function J(r){let l,t=r[1].frame+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].frame+"")&&N(a,t)},d(f){f&&o(l)}}}function K(r){let l,t=r[1].stack+"",a;return{c(){l=E("pre"),a=v(t)},l(f){l=d(f,"PRE",{});var s=b(l);a=P(s,t),s.forEach(o)},m(f,s){u(f,l,s),R(l,a)},p(f,s){s&2&&t!==(t=f[1].stack+"")&&N(a,t)},d(f){f&&o(l)}}}function z(r){let l,t,a,f,s=r[1].message+"",c,k,n,p,i=r[1].frame&&J(r),_=r[1].stack&&K(r);return{c(){l=E("h1"),t=v(r[0]),a=S(),f=E("pre"),c=v(s),k=S(),i&&i.c(),n=S(),_&&_.c(),p=C()},l(e){l=d(e,"H1",{});var m=b(l);t=P(m,r[0]),m.forEach(o),a=j(e),f=d(e,"PRE",{});var q=b(f);c=P(q,s),q.forEach(o),k=j(e),i&&i.l(e),n=j(e),_&&_.l(e),p=C()},m(e,m){u(e,l,m),R(l,t),u(e,a,m),u(e,f,m),R(f,c),u(e,k,m),i&&i.m(e,m),u(e,n,m),_&&_.m(e,m),u(e,p,m)},p(e,[m]){m&1&&N(t,e[0]),m&2&&s!==(s=e[1].message+"")&&N(c,s),e[1].frame?i?i.p(e,m):(i=J(e),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),e[1].stack?_?_.p(e,m):(_=K(e),_.c(),_.m(p.parentNode,p)):_&&(_.d(1),_=null)},i:H,o:H,d(e){e&&o(l),e&&o(a),e&&o(f),e&&o(k),i&&i.d(e),e&&o(n),_&&_.d(e),e&&o(p)}}}function D({error:r,status:l}){return{props:{error:r,status:l}}}function A(r,l,t){let{status:a}=l,{error:f}=l;return r.$$set=s=>{"status"in s&&t(0,a=s.status),"error"in s&&t(1,f=s.error)},[a,f]}class F extends h{constructor(l){super();w(this,l,A,z,y,{status:0,error:1})}}export{F as default,D as load};
static/_app/manifest.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ ".svelte-kit/runtime/client/start.js": {
3
+ "file": "start-99eb6447.js",
4
+ "src": ".svelte-kit/runtime/client/start.js",
5
+ "isEntry": true,
6
+ "imports": [
7
+ "_vendor-f86405dd.js"
8
+ ],
9
+ "dynamicImports": [
10
+ "src/routes/__layout.svelte",
11
+ ".svelte-kit/runtime/components/error.svelte",
12
+ "src/routes/index.svelte"
13
+ ]
14
+ },
15
+ "src/routes/__layout.svelte": {
16
+ "file": "pages/__layout.svelte-edc9d39c.js",
17
+ "src": "src/routes/__layout.svelte",
18
+ "isEntry": true,
19
+ "isDynamicEntry": true,
20
+ "imports": [
21
+ "_vendor-f86405dd.js"
22
+ ],
23
+ "css": [
24
+ "assets/pages/__layout.svelte-fb585879.css"
25
+ ]
26
+ },
27
+ ".svelte-kit/runtime/components/error.svelte": {
28
+ "file": "error.svelte-772b55a0.js",
29
+ "src": ".svelte-kit/runtime/components/error.svelte",
30
+ "isEntry": true,
31
+ "isDynamicEntry": true,
32
+ "imports": [
33
+ "_vendor-f86405dd.js"
34
+ ]
35
+ },
36
+ "src/routes/index.svelte": {
37
+ "file": "pages/index.svelte-9de47720.js",
38
+ "src": "src/routes/index.svelte",
39
+ "isEntry": true,
40
+ "isDynamicEntry": true,
41
+ "imports": [
42
+ "_vendor-f86405dd.js"
43
+ ]
44
+ },
45
+ "_vendor-f86405dd.js": {
46
+ "file": "chunks/vendor-f86405dd.js"
47
+ }
48
+ }
static/_app/pages/__layout.svelte-edc9d39c.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as o,i,s as r,F as u,G as f,H as _,I as c,q as p,o as d}from"../chunks/vendor-f86405dd.js";function m(l){let s;const n=l[1].default,e=u(n,l,l[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&f(e,n,t,t[0],s?c(n,t[0],a,null):_(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function $(l,s,n){let{$$slots:e={},$$scope:t}=s;return l.$$set=a=>{"$$scope"in a&&n(0,t=a.$$scope)},[t,e]}class h extends o{constructor(s){super();i(this,s,$,m,r,{})}}export{h as default};
static/_app/pages/index.svelte-9de47720.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{S as T,i as A,s as H,L as C,e as _,t as u,k as x,l as E,c as d,a as p,h as f,d as s,m as N,b as w,g as h,J as i,M as S,K as b,N as Y}from"../chunks/vendor-f86405dd.js";function y(o,e,a){const t=o.slice();return t[2]=e[a],t[4]=a,t}function $(o){let e,a;return{c(){e=_("p"),a=u("An error occurred!")},l(t){e=d(t,"P",{});var l=p(e);a=f(l,"An error occurred!"),l.forEach(s)},m(t,l){h(t,e,l),i(e,a)},p:b,d(t){t&&s(e)}}}function j(o){let e,a=o[1],t=[];for(let l=0;l<a.length;l+=1)t[l]=L(y(o,a,l));return{c(){e=_("ul");for(let l=0;l<t.length;l+=1)t[l].c()},l(l){e=d(l,"UL",{});var r=p(e);for(let n=0;n<t.length;n+=1)t[n].l(r);r.forEach(s)},m(l,r){h(l,e,r);for(let n=0;n<t.length;n+=1)t[n].m(e,null)},p(l,r){if(r&1){a=l[1];let n;for(n=0;n<a.length;n+=1){const c=y(l,a,n);t[n]?t[n].p(c,r):(t[n]=L(c),t[n].c(),t[n].m(e,null))}for(;n<t.length;n+=1)t[n].d(1);t.length=a.length}},d(l){l&&s(e),Y(t,l)}}}function L(o){let e,a,t=o[4]+1+"",l,r,n=o[2].title+"",c,P,v;return{c(){e=_("li"),a=_("a"),l=u(t),r=u(": "),c=u(n),v=x(),this.h()},l(m){e=d(m,"LI",{});var k=p(e);a=d(k,"A",{target:!0,href:!0});var g=p(a);l=f(g,t),r=f(g,": "),c=f(g,n),g.forEach(s),v=N(k),k.forEach(s),this.h()},h(){w(a,"target","_blank"),w(a,"href",P=o[2].link)},m(m,k){h(m,e,k),i(e,a),i(a,l),i(a,r),i(a,c),i(e,v)},p:b,d(m){m&&s(e)}}}function q(o){let e,a;return{c(){e=_("p"),a=u("Loading and running sentiment analysis on the latest news...")},l(t){e=d(t,"P",{});var l=p(e);a=f(l,"Loading and running sentiment analysis on the latest news..."),l.forEach(s)},m(t,l){h(t,e,l),i(e,a)},p:b,d(t){t&&s(e)}}}function I(o){let e,a,t,l,r={ctx:o,current:null,token:null,hasCatch:!0,pending:q,then:j,catch:$,value:1,error:5};return C(o[0],r),{c(){e=_("h1"),a=u("The New York Times Homepage"),t=x(),l=E(),r.block.c(),this.h()},l(n){e=d(n,"H1",{class:!0});var c=p(e);a=f(c,"The New York Times Homepage"),c.forEach(s),t=N(n),l=E(),r.block.l(n),this.h()},h(){w(e,"class","text-3xl font-bold")},m(n,c){h(n,e,c),i(e,a),h(n,t,c),h(n,l,c),r.block.m(n,r.anchor=c),r.mount=()=>l.parentNode,r.anchor=l},p(n,[c]){o=n,S(r,o,c)},i:b,o:b,d(n){n&&s(e),n&&s(t),n&&s(l),r.block.d(n),r.token=null,r=null}}}function J(o){return[fetch("news").then(a=>a.json())]}class M extends T{constructor(e){super();A(this,e,J,I,H,{})}}export{M as default};
static/_app/start-99eb6447.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var fe=Object.defineProperty,ue=Object.defineProperties;var he=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var H=(o,e,t)=>e in o?fe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(o,e)=>{for(var t in e||(e={}))Q.call(e,t)&&H(o,t,e[t]);if(B)for(var t of B(e))Z.call(e,t)&&H(o,t,e[t]);return o},K=(o,e)=>ue(o,he(e));var ee=(o,e)=>{var t={};for(var r in o)Q.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&B)for(var r of B(o))e.indexOf(r)<0&&Z.call(o,r)&&(t[r]=o[r]);return t};import{S as de,i as _e,s as pe,e as ge,c as me,a as we,d as $,b as z,f as N,g as S,t as be,h as ve,j as ye,k as ke,l as w,m as $e,n as P,o as b,p as x,q as v,r as Ee,u as Re,v as Y,w as L,x as j,y as U,z as V,A as I,B as A,C as D,D as J,E as te}from"./chunks/vendor-f86405dd.js";function Se(o){let e,t,r;const l=[o[1]||{}];var i=o[0][0];function a(s){let n={};for(let c=0;c<l.length;c+=1)n=D(n,l[c]);return{props:n}}return i&&(e=new i(a())),{c(){e&&L(e.$$.fragment),t=w()},l(s){e&&j(e.$$.fragment,s),t=w()},m(s,n){e&&U(e,s,n),S(s,t,n),r=!0},p(s,n){const c=n&2?V(l,[I(s[1]||{})]):{};if(i!==(i=s[0][0])){if(e){P();const f=e;b(f.$$.fragment,1,0,()=>{A(f,1)}),x()}i?(e=new i(a()),L(e.$$.fragment),v(e.$$.fragment,1),U(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&v(e.$$.fragment,s),r=!0)},o(s){e&&b(e.$$.fragment,s),r=!1},d(s){s&&$(t),e&&A(e,s)}}}function Le(o){let e,t,r;const l=[o[1]||{}];var i=o[0][0];function a(s){let n={$$slots:{default:[Te]},$$scope:{ctx:s}};for(let c=0;c<l.length;c+=1)n=D(n,l[c]);return{props:n}}return i&&(e=new i(a(o))),{c(){e&&L(e.$$.fragment),t=w()},l(s){e&&j(e.$$.fragment,s),t=w()},m(s,n){e&&U(e,s,n),S(s,t,n),r=!0},p(s,n){const c=n&2?V(l,[I(s[1]||{})]):{};if(n&525&&(c.$$scope={dirty:n,ctx:s}),i!==(i=s[0][0])){if(e){P();const f=e;b(f.$$.fragment,1,0,()=>{A(f,1)}),x()}i?(e=new i(a(s)),L(e.$$.fragment),v(e.$$.fragment,1),U(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&v(e.$$.fragment,s),r=!0)},o(s){e&&b(e.$$.fragment,s),r=!1},d(s){s&&$(t),e&&A(e,s)}}}function Ue(o){let e,t,r;const l=[o[2]||{}];var i=o[0][1];function a(s){let n={};for(let c=0;c<l.length;c+=1)n=D(n,l[c]);return{props:n}}return i&&(e=new i(a())),{c(){e&&L(e.$$.fragment),t=w()},l(s){e&&j(e.$$.fragment,s),t=w()},m(s,n){e&&U(e,s,n),S(s,t,n),r=!0},p(s,n){const c=n&4?V(l,[I(s[2]||{})]):{};if(i!==(i=s[0][1])){if(e){P();const f=e;b(f.$$.fragment,1,0,()=>{A(f,1)}),x()}i?(e=new i(a()),L(e.$$.fragment),v(e.$$.fragment,1),U(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&v(e.$$.fragment,s),r=!0)},o(s){e&&b(e.$$.fragment,s),r=!1},d(s){s&&$(t),e&&A(e,s)}}}function Ae(o){let e,t,r;const l=[o[2]||{}];var i=o[0][1];function a(s){let n={$$slots:{default:[Ne]},$$scope:{ctx:s}};for(let c=0;c<l.length;c+=1)n=D(n,l[c]);return{props:n}}return i&&(e=new i(a(o))),{c(){e&&L(e.$$.fragment),t=w()},l(s){e&&j(e.$$.fragment,s),t=w()},m(s,n){e&&U(e,s,n),S(s,t,n),r=!0},p(s,n){const c=n&4?V(l,[I(s[2]||{})]):{};if(n&521&&(c.$$scope={dirty:n,ctx:s}),i!==(i=s[0][1])){if(e){P();const f=e;b(f.$$.fragment,1,0,()=>{A(f,1)}),x()}i?(e=new i(a(s)),L(e.$$.fragment),v(e.$$.fragment,1),U(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&v(e.$$.fragment,s),r=!0)},o(s){e&&b(e.$$.fragment,s),r=!1},d(s){s&&$(t),e&&A(e,s)}}}function Ne(o){let e,t,r;const l=[o[3]||{}];var i=o[0][2];function a(s){let n={};for(let c=0;c<l.length;c+=1)n=D(n,l[c]);return{props:n}}return i&&(e=new i(a())),{c(){e&&L(e.$$.fragment),t=w()},l(s){e&&j(e.$$.fragment,s),t=w()},m(s,n){e&&U(e,s,n),S(s,t,n),r=!0},p(s,n){const c=n&8?V(l,[I(s[3]||{})]):{};if(i!==(i=s[0][2])){if(e){P();const f=e;b(f.$$.fragment,1,0,()=>{A(f,1)}),x()}i?(e=new i(a()),L(e.$$.fragment),v(e.$$.fragment,1),U(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&v(e.$$.fragment,s),r=!0)},o(s){e&&b(e.$$.fragment,s),r=!1},d(s){s&&$(t),e&&A(e,s)}}}function Te(o){let e,t,r,l;const i=[Ae,Ue],a=[];function s(n,c){return n[0][2]?0:1}return e=s(o),t=a[e]=i[e](o),{c(){t.c(),r=w()},l(n){t.l(n),r=w()},m(n,c){a[e].m(n,c),S(n,r,c),l=!0},p(n,c){let f=e;e=s(n),e===f?a[e].p(n,c):(P(),b(a[f],1,1,()=>{a[f]=null}),x(),t=a[e],t?t.p(n,c):(t=a[e]=i[e](n),t.c()),v(t,1),t.m(r.parentNode,r))},i(n){l||(v(t),l=!0)},o(n){b(t),l=!1},d(n){a[e].d(n),n&&$(r)}}}function se(o){let e,t=o[5]&&re(o);return{c(){e=ge("div"),t&&t.c(),this.h()},l(r){e=me(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var l=we(e);t&&t.l(l),l.forEach($),this.h()},h(){z(e,"id","svelte-announcer"),z(e,"aria-live","assertive"),z(e,"aria-atomic","true"),N(e,"position","absolute"),N(e,"left","0"),N(e,"top","0"),N(e,"clip","rect(0 0 0 0)"),N(e,"clip-path","inset(50%)"),N(e,"overflow","hidden"),N(e,"white-space","nowrap"),N(e,"width","1px"),N(e,"height","1px")},m(r,l){S(r,e,l),t&&t.m(e,null)},p(r,l){r[5]?t?t.p(r,l):(t=re(r),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(r){r&&$(e),t&&t.d()}}}function re(o){let e;return{c(){e=be(o[6])},l(t){e=ve(t,o[6])},m(t,r){S(t,e,r)},p(t,r){r&64&&ye(e,t[6])},d(t){t&&$(e)}}}function Oe(o){let e,t,r,l,i;const a=[Le,Se],s=[];function n(f,h){return f[0][1]?0:1}e=n(o),t=s[e]=a[e](o);let c=o[4]&&se(o);return{c(){t.c(),r=ke(),c&&c.c(),l=w()},l(f){t.l(f),r=$e(f),c&&c.l(f),l=w()},m(f,h){s[e].m(f,h),S(f,r,h),c&&c.m(f,h),S(f,l,h),i=!0},p(f,[h]){let u=e;e=n(f),e===u?s[e].p(f,h):(P(),b(s[u],1,1,()=>{s[u]=null}),x(),t=s[e],t?t.p(f,h):(t=s[e]=a[e](f),t.c()),v(t,1),t.m(r.parentNode,r)),f[4]?c?c.p(f,h):(c=se(f),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null)},i(f){i||(v(t),i=!0)},o(f){b(t),i=!1},d(f){s[e].d(f),f&&$(r),c&&c.d(f),f&&$(l)}}}function Pe(o,e,t){let{stores:r}=e,{page:l}=e,{components:i}=e,{props_0:a=null}=e,{props_1:s=null}=e,{props_2:n=null}=e;Ee("__svelte__",r),Re(r.page.notify);let c=!1,f=!1,h=null;return Y(()=>{const u=r.page.subscribe(()=>{c&&(t(5,f=!0),t(6,h=document.title||"untitled page"))});return t(4,c=!0),u}),o.$$set=u=>{"stores"in u&&t(7,r=u.stores),"page"in u&&t(8,l=u.page),"components"in u&&t(0,i=u.components),"props_0"in u&&t(1,a=u.props_0),"props_1"in u&&t(2,s=u.props_1),"props_2"in u&&t(3,n=u.props_2)},o.$$.update=()=>{o.$$.dirty&384&&r.page.set(l)},[i,a,s,n,c,f,h,r,l]}class xe extends de{constructor(e){super();_e(this,e,Pe,Oe,pe,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ce="modulepreload",ie={},je="/static/_app/",G=function(e,t){return!t||t.length===0?e():Promise.all(t.map(r=>{if(r=`${je}${r}`,r in ie)return;ie[r]=!0;const l=r.endsWith(".css"),i=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${i}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":Ce,l||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),l)return new Promise((s,n)=>{a.addEventListener("load",s),a.addEventListener("error",n)})})).then(()=>e())},C=[()=>G(()=>import("./pages/__layout.svelte-edc9d39c.js"),["pages/__layout.svelte-edc9d39c.js","assets/pages/__layout.svelte-fb585879.css","chunks/vendor-f86405dd.js"]),()=>G(()=>import("./error.svelte-772b55a0.js"),["error.svelte-772b55a0.js","chunks/vendor-f86405dd.js"]),()=>G(()=>import("./pages/index.svelte-9de47720.js"),["pages/index.svelte-9de47720.js","chunks/vendor-f86405dd.js"])],Ve=[[/^\/$/,[C[0],C[2]],[C[1]]]],Ie=[C[0](),C[1]()];function De(o){let e=o.baseURI;if(!e){const t=o.getElementsByTagName("base");e=t.length?t[0].href:o.URL}return e}let F="";function qe(o){F=o.base,o.assets}function M(){return{x:pageXOffset,y:pageYOffset}}function ne(o){return o.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function ae(o){return o instanceof SVGAElement?new URL(o.href.baseVal,document.baseURI):new URL(o.href)}class We{constructor({base:e,routes:t,trailing_slash:r,renderer:l}){var i,a;this.base=e,this.routes=t,this.trailing_slash=r,this.navigating=0,this.renderer=l,l.router=this,this.enabled=!0,document.body.setAttribute("tabindex","-1"),this.current_history_index=(a=(i=history.state)==null?void 0:i["sveltekit:index"])!=null?a:0,this.current_history_index===0&&history.replaceState(K(y({},history.state),{"sveltekit:index":0}),"",location.href),this.callbacks={before_navigate:[],after_navigate:[]}}init_listeners(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",i=>{let a=!1;const s={from:this.renderer.current.url,to:null,cancel:()=>a=!0};this.callbacks.before_navigate.forEach(n=>n(s)),a?(i.preventDefault(),i.returnValue=""):history.scrollRestoration="auto"}),addEventListener("load",()=>{history.scrollRestoration="manual"});let e;addEventListener("scroll",()=>{clearTimeout(e),e=setTimeout(()=>{const i=K(y({},history.state||{}),{"sveltekit:scroll":M()});history.replaceState(i,document.title,window.location.href)},200)});const t=i=>{const a=ne(i);a&&a.href&&a.hasAttribute("sveltekit:prefetch")&&this.prefetch(ae(a))};let r;const l=i=>{clearTimeout(r),r=setTimeout(()=>{var a;(a=i.target)==null||a.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",t),addEventListener("mousemove",l),addEventListener("sveltekit:trigger_prefetch",t),addEventListener("click",i=>{if(!this.enabled||i.button||i.which!==1||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.defaultPrevented)return;const a=ne(i);if(!a||!a.href)return;const s=ae(a);if(s.toString()===location.href){location.hash||i.preventDefault();return}const c=(a.getAttribute("rel")||"").split(/\s+/);if(a.hasAttribute("download")||c&&c.includes("external")||(a instanceof SVGAElement?a.target.baseVal:a.target))return;const[f,h]=s.href.split("#");if(h!==void 0&&f===location.href.split("#")[0]){setTimeout(()=>history.pushState({},"",s.href));const u=this.parse(s);return u?this.renderer.update(u,[],!1):void 0}this._navigate({url:s,scroll:a.hasAttribute("sveltekit:noscroll")?M():null,keepfocus:!1,chain:[],details:{state:{},replaceState:!1},accepted:()=>i.preventDefault(),blocked:()=>i.preventDefault()})}),addEventListener("popstate",i=>{if(i.state&&this.enabled){if(i.state["sveltekit:index"]===this.current_history_index)return;this._navigate({url:new URL(location.href),scroll:i.state["sveltekit:scroll"],keepfocus:!1,chain:[],details:null,accepted:()=>{this.current_history_index=i.state["sveltekit:index"]},blocked:()=>{const a=this.current_history_index-i.state["sveltekit:index"];history.go(a)}})}})}owns(e){return e.origin===location.origin&&e.pathname.startsWith(this.base)}parse(e){if(this.owns(e)){const t=decodeURI(e.pathname.slice(this.base.length)||"/");return{id:e.pathname+e.search,routes:this.routes.filter(([r])=>r.test(t)),url:e,path:t}}}async goto(e,{noscroll:t=!1,replaceState:r=!1,keepfocus:l=!1,state:i={}}={},a){const s=new URL(e,De(document));return this.enabled?this._navigate({url:s,scroll:t?M():null,keepfocus:l,chain:a,details:{state:i,replaceState:r},accepted:()=>{},blocked:()=>{}}):(location.href=s.href,new Promise(()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(e){const t=this.parse(e);if(!t)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(t)}after_navigate(e){Y(()=>(this.callbacks.after_navigate.push(e),()=>{const t=this.callbacks.after_navigate.indexOf(e);this.callbacks.after_navigate.splice(t,1)}))}before_navigate(e){Y(()=>(this.callbacks.before_navigate.push(e),()=>{const t=this.callbacks.before_navigate.indexOf(e);this.callbacks.before_navigate.splice(t,1)}))}async _navigate({url:e,scroll:t,keepfocus:r,chain:l,details:i,accepted:a,blocked:s}){const n=this.renderer.current.url;let c=!1;const f={from:n,to:e,cancel:()=>c=!0};if(this.callbacks.before_navigate.forEach(d=>d(f)),c){s();return}const h=this.parse(e);if(!h)return location.href=e.href,new Promise(()=>{});a(),this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-start")),this.navigating++;let{pathname:u}=e;if(this.trailing_slash==="never"?u!=="/"&&u.endsWith("/")&&(u=u.slice(0,-1)):this.trailing_slash==="always"&&!e.pathname.split("/").pop().includes(".")&&!u.endsWith("/")&&(u+="/"),h.url=new URL(e.origin+u+e.search+e.hash),i){const d=i.replaceState?0:1;i.state["sveltekit:index"]=this.current_history_index+=d,history[i.replaceState?"replaceState":"pushState"](i.state,"",h.url)}if(await this.renderer.handle_navigation(h,l,!1,{scroll:t,keepfocus:r}),this.navigating--,!this.navigating){dispatchEvent(new CustomEvent("sveltekit:navigation-end"));const d={from:n,to:e};this.callbacks.after_navigate.forEach(_=>_(d))}}}function oe(o){return o instanceof Error||o&&o.name&&o.message?o:new Error(JSON.stringify(o))}function Be(o){let e=5381,t=o.length;if(typeof o=="string")for(;t;)e=e*33^o.charCodeAt(--t);else for(;t;)e=e*33^o[--t];return(e>>>0).toString(36)}function le(o){const e=o.status&&o.status>=400&&o.status<=599&&!o.redirect;if(o.error||e){const t=o.status;if(!o.error&&e)return{status:t||500,error:new Error};const r=typeof o.error=="string"?new Error(o.error):o.error;return r instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:r}):{status:t,error:r}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof r}"`)}}if(o.redirect){if(!o.status||Math.floor(o.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof o.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(o.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return o}function ce(o){const e=J(o);let t=!0;function r(){t=!0,e.update(a=>a)}function l(a){t=!1,e.set(a)}function i(a){let s;return e.subscribe(n=>{(s===void 0||t&&n!==s)&&a(s=n)})}return{notify:r,set:l,subscribe:i}}function Je(){const{set:o,subscribe:e}=J(!1),t="1644810474077";let r;async function l(){clearTimeout(r);const a=await fetch(`${F}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(a.ok){const{version:s}=await a.json(),n=s!==t;return n&&(o(!0),clearTimeout(r)),n}else throw new Error(`Version check failed: ${a.status}`)}return{subscribe:e,check:l}}function Ke(o,e){const t=typeof o=="string"?o:o.url;let r=`script[data-type="svelte-data"][data-url=${JSON.stringify(t)}]`;e&&typeof e.body=="string"&&(r+=`[data-body="${Be(e.body)}"]`);const l=document.querySelector(r);if(l&&l.textContent){const i=JSON.parse(l.textContent),{body:a}=i,s=ee(i,["body"]);return Promise.resolve(new Response(a,s))}return fetch(o,e)}class ze{constructor({Root:e,fallback:t,target:r,session:l}){this.Root=e,this.fallback=t,this.router,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.autoscroll=!0,this.updating=!1,this.current={url:null,session_id:0,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={url:ce({}),page:ce({}),navigating:J(null),session:J(l),updated:Je()},this.$session=null,this.root=null;let i=!1;this.stores.session.subscribe(async a=>{if(this.$session=a,!i||!this.router)return;this.session_id+=1;const s=this.router.parse(new URL(location.href));s&&this.update(s,[],!0)}),i=!0}disable_scroll_handling(){(this.updating||!this.started)&&(this.autoscroll=!1)}async start({status:e,error:t,nodes:r,url:l,params:i}){const a=[];let s={},n,c;l.hash=window.location.hash;try{for(let f=0;f<r.length;f+=1){const h=f===r.length-1;let u;if(h){const _=document.querySelector('[data-type="svelte-props"]');_&&(u=JSON.parse(_.textContent))}const d=await this._load_node({module:await r[f],url:l,params:i,stuff:s,status:h?e:void 0,error:h?t:void 0,props:u});if(u&&d.uses.dependencies.add(l.href),a.push(d),d&&d.loaded)if(d.loaded.error){if(t)throw d.loaded.error;c={status:d.loaded.status,error:d.loaded.error,url:l}}else d.loaded.stuff&&(s=y(y({},s),d.loaded.stuff))}n=c?await this._load_error(c):await this._get_navigation_result_from_branch({url:l,params:i,stuff:s,branch:a,status:e,error:t})}catch(f){if(t)throw f;n=await this._load_error({status:500,error:oe(f),url:l})}if(n.redirect){location.href=new URL(n.redirect,location.href).href;return}this._init(n)}async handle_navigation(e,t,r,l){this.started&&this.stores.navigating.set({from:this.current.url,to:e.url}),await this.update(e,t,r,l)}async update(e,t,r,l){var n,c,f;const i=this.token={};let a=await this._get_navigation_result(e,r);if(i!==this.token)return;if(this.invalid.clear(),a.redirect)if(t.length>10||t.includes(e.url.pathname))a=await this._load_error({status:500,error:new Error("Redirect loop"),url:e.url});else{this.router?this.router.goto(new URL(a.redirect,e.url).href,{replaceState:!0},[...t,e.url.pathname]):location.href=new URL(a.redirect,location.href).href;return}else if(((c=(n=a.props)==null?void 0:n.page)==null?void 0:c.status)>=400&&await this.stores.updated.check()){location.href=e.url.href;return}if(this.updating=!0,this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null)):this._init(a),l){const{scroll:h,keepfocus:u}=l;if(u||((f=getSelection())==null||f.removeAllRanges(),document.body.focus()),await te(),this.autoscroll){const d=e.url.hash&&document.getElementById(e.url.hash.slice(1));h?scrollTo(h.x,h.y):d?d.scrollIntoView():scrollTo(0,0)}}else await te();if(this.loading.promise=null,this.loading.id=null,this.autoscroll=!0,this.updating=!1,!this.router)return;const s=a.state.branch[a.state.branch.length-1];s&&s.module.router===!1?this.router.disable():this.router.enable()}load(e){return this.loading.promise=this._get_navigation_result(e,!1),this.loading.id=e.id,this.loading.promise}invalidate(e){return this.invalid.add(e),this.invalidating||(this.invalidating=Promise.resolve().then(async()=>{const t=this.router&&this.router.parse(new URL(location.href));t&&await this.update(t,[],!0),this.invalidating=null})),this.invalidating}_init(e){this.current=e.state;const t=document.querySelector("style[data-svelte]");if(t&&t.remove(),this.root=new this.Root({target:this.target,props:y({stores:this.stores},e.props),hydrate:!0}),this.started=!0,this.router){const r={from:null,to:new URL(location.href)};this.router.callbacks.after_navigate.forEach(l=>l(r))}}async _get_navigation_result(e,t){if(this.loading.id===e.id&&this.loading.promise)return this.loading.promise;for(let r=0;r<e.routes.length;r+=1){const l=e.routes[r];let i=r+1;for(;i<e.routes.length;){const s=e.routes[i];if(s[0].toString()===l[0].toString())s[1].forEach(n=>n()),i+=1;else break}const a=await this._load({route:l,info:e},t);if(a)return a}return await this._load_error({status:404,error:new Error(`Not found: ${e.url.pathname}`),url:e.url})}async _get_navigation_result_from_branch({url:e,params:t,stuff:r,branch:l,status:i,error:a}){const s=l.filter(Boolean),n=s.find(u=>u.loaded&&u.loaded.redirect),c={redirect:n&&n.loaded?n.loaded.redirect:void 0,state:{url:e,params:t,branch:l,session_id:this.session_id},props:{components:s.map(u=>u.module.default)}};for(let u=0;u<s.length;u+=1){const d=s[u].loaded;c.props[`props_${u}`]=d?await d.props:null}if(!this.current.url||e.href!==this.current.url.href){c.props.page={url:e,params:t,status:i,error:a,stuff:r};const u=(d,_)=>{Object.defineProperty(c.props.page,d,{get:()=>{throw new Error(`$page.${d} has been replaced by $page.url.${_}`)}})};u("origin","origin"),u("path","pathname"),u("query","searchParams")}const f=s[s.length-1],h=f.loaded&&f.loaded.maxage;if(h){const u=e.pathname+e.search;let d=!1;const _=()=>{this.cache.get(u)===c&&this.cache.delete(u),E(),clearTimeout(T)},T=setTimeout(_,h*1e3),E=this.stores.session.subscribe(()=>{d&&_()});d=!0,this.cache.set(u,c)}return c}async _load_node({status:e,error:t,module:r,url:l,params:i,stuff:a,props:s}){const n={module:r,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:new Set},loaded:null,stuff:a};s&&n.uses.dependencies.add(l.href);const c={};for(const h in i)Object.defineProperty(c,h,{get(){return n.uses.params.add(h),i[h]},enumerable:!0});const f=this.$session;if(r.load){const{started:h}=this,u={params:c,props:s||{},get url(){return n.uses.url=!0,l},get session(){return n.uses.session=!0,f},get stuff(){return n.uses.stuff=!0,y({},a)},fetch(_,T){const E=typeof _=="string"?_:_.url,{href:R}=new URL(E,l);return n.uses.dependencies.add(R),h?fetch(_,T):Ke(_,T)}};t&&(u.status=e,u.error=t);const d=await r.load.call(null,u);if(!d)throw new Error("load function must return a value");n.loaded=le(d),n.loaded.stuff&&(n.stuff=n.loaded.stuff)}else s&&(n.loaded=le({props:s}));return n}async _load({route:e,info:{url:t,path:r}},l){const i=t.pathname+t.search;if(!l){const p=this.cache.get(i);if(p)return p}const[a,s,n,c,f]=e,h=c?c(a.exec(r)):{},u=this.current.url&&{url:i!==this.current.url.pathname+this.current.url.search,params:Object.keys(h).filter(p=>this.current.params[p]!==h[p]),session:this.session_id!==this.current.session_id};let d=[],_={},T=!1,E=200,R;s.forEach(p=>p());e:for(let p=0;p<s.length;p+=1){let g;try{if(!s[p])continue;const m=await s[p](),k=this.current.branch[p];if(!k||m!==k.module||u.url&&k.uses.url||u.params.some(O=>k.uses.params.has(O))||u.session&&k.uses.session||Array.from(k.uses.dependencies).some(O=>this.invalid.has(O))||T&&k.uses.stuff){let O={};if(f&&p===s.length-1){const W=await fetch(`${t.pathname}${t.pathname.endsWith("/")?"":"/"}__data.json`,{headers:{"x-sveltekit-noredirect":"true"}});if(W.ok){const X=W.headers.get("x-sveltekit-location");if(X)return{redirect:X,props:{},state:this.current};O=await W.json()}else E=W.status,R=new Error("Failed to load data")}if(R||(g=await this._load_node({module:m,url:t,params:h,props:O,stuff:_})),g&&g.loaded){if(g.loaded.fallthrough)return;if(g.loaded.error&&(E=g.loaded.status,R=g.loaded.error),g.loaded.redirect)return{redirect:g.loaded.redirect,props:{},state:this.current};g.loaded.stuff&&(T=!0)}}else g=k}catch(m){E=500,R=oe(m)}if(R){for(;p--;)if(n[p]){let m,k,q=p;for(;!(k=d[q]);)q-=1;try{if(m=await this._load_node({status:E,error:R,module:await n[p](),url:t,params:h,stuff:k.stuff}),m&&m.loaded&&m.loaded.error)continue;m&&m.loaded&&m.loaded.stuff&&(_=y(y({},_),m.loaded.stuff)),d=d.slice(0,q+1).concat(m);break e}catch{continue}}return await this._load_error({status:E,error:R,url:t})}else g&&g.loaded&&g.loaded.stuff&&(_=y(y({},_),g.loaded.stuff)),d.push(g)}return await this._get_navigation_result_from_branch({url:t,params:h,stuff:_,branch:d,status:E,error:R})}async _load_error({status:e,error:t,url:r}){var c,f;const l={},i=await this._load_node({module:await this.fallback[0],url:r,params:l,stuff:{}}),a=await this._load_node({status:e,error:t,module:await this.fallback[1],url:r,params:l,stuff:i&&i.loaded&&i.loaded.stuff||{}}),s=[i,a],n=y(y({},(c=i==null?void 0:i.loaded)==null?void 0:c.stuff),(f=a==null?void 0:a.loaded)==null?void 0:f.stuff);return await this._get_navigation_result_from_branch({url:r,params:l,stuff:n,branch:s,status:e,error:t})}}async function Ye({paths:o,target:e,session:t,route:r,spa:l,trailing_slash:i,hydrate:a}){const s=new ze({Root:xe,fallback:Ie,target:e,session:t}),n=r?new We({base:o.base,routes:Ve,trailing_slash:i,renderer:s}):null;qe(o),a&&await s.start(a),n&&(l&&n.goto(location.href,{replaceState:!0},[]),n.init_listeners()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{Ye as start};
static/_app/version.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":"1644810474077"}
static/favicon.png ADDED
static/index.html ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <base href="" />
5
+ <meta charset="utf-8" />
6
+ <meta name="description" content="" />
7
+ <link rel="icon" href="/static/favicon.png" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <meta http-equiv="content-security-policy" content="">
10
+ <link rel="stylesheet" href="/static/_app/assets/pages/__layout.svelte-fb585879.css">
11
+ <link rel="modulepreload" href="/static/_app/start-99eb6447.js">
12
+ <link rel="modulepreload" href="/static/_app/chunks/vendor-f86405dd.js">
13
+ <link rel="modulepreload" href="/static/_app/pages/__layout.svelte-edc9d39c.js">
14
+ <link rel="modulepreload" href="/static/_app/pages/index.svelte-9de47720.js">
15
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
16
+ </head>
17
+ <body>
18
+ <div>
19
+
20
+
21
+ <h1 class="text-3xl font-bold">The New York Times Homepage
22
+ </h1>
23
+
24
+
25
+ <p>Loading and running sentiment analysis on the latest news...</p>
26
+
27
+
28
+
29
+ <script type="module" data-hydrate="3zkzse">
30
+ import { start } from "/static/_app/start-99eb6447.js";
31
+ start({
32
+ target: document.querySelector('[data-hydrate="3zkzse"]').parentNode,
33
+ paths: {"base":"/static","assets":"/static"},
34
+ session: {},
35
+ route: true,
36
+ spa: false,
37
+ trailing_slash: "never",
38
+ hydrate: {
39
+ status: 200,
40
+ error: null,
41
+ nodes: [
42
+ import("/static/_app/pages/__layout.svelte-edc9d39c.js"),
43
+ import("/static/_app/pages/index.svelte-9de47720.js")
44
+ ],
45
+ url: new URL("http://sveltekit-prerender/static"),
46
+ params: {}
47
+ }
48
+ });
49
+ </script></div>
50
+ </body>
51
+ </html>