import{d as F}from"../chunks/environment.9aa685ef.js";import{S as V,i as q,s as z,k as _,q as T,a as E,l as m,m as g,r as $,h as c,c as O,n as k,b as D,D as p,Q as I,F as w,R as M,u as B,E as P,G as A,y as G,z as H,A as Q,g as K,d as L,B as W}from"../chunks/index.463cc238.js";function J(a){let e;return{c(){e=_("div"),this.h()},l(t){e=m(t,"DIV",{id:!0}),g(e).forEach(c),this.h()},h(){k(e,"id","loader")},m(t,s){D(t,e,s)},d(t){t&&c(e)}}}function R(a){let e,t,s=JSON.stringify(a[1])+"",o;return{c(){e=_("p"),t=T("Server response: "),o=T(s)},l(n){e=m(n,"P",{});var l=g(e);t=$(l,"Server response: "),o=$(l,s),l.forEach(c)},m(n,l){D(n,e,l),p(e,t),p(e,o)},p(n,l){l&2&&s!==(s=JSON.stringify(n[1])+"")&&B(o,s)},d(n){n&&c(e)}}}function X(a){let e,t,s,o,n,l,y,d,h,b,v,N,U,i=a[2]&&J(),r=!a[2]&&a[1]&&R(a);return{c(){e=_("div"),t=_("h1"),s=T("Upload"),o=E(),n=_("form"),l=_("input"),y=E(),d=_("button"),h=T(a[0]),b=E(),i&&i.c(),v=E(),r&&r.c(),this.h()},l(f){e=m(f,"DIV",{});var u=g(e);t=m(u,"H1",{});var j=g(t);s=$(j,"Upload"),j.forEach(c),o=O(u),n=m(u,"FORM",{});var S=g(n);l=m(S,"INPUT",{type:!0}),y=O(S),d=m(S,"BUTTON",{type:!0});var C=g(d);h=$(C,a[0]),C.forEach(c),S.forEach(c),b=O(u),i&&i.l(u),v=O(u),r&&r.l(u),u.forEach(c),this.h()},h(){k(l,"type","text"),k(d,"type","submit")},m(f,u){D(f,e,u),p(e,t),p(t,s),p(e,o),p(e,n),p(n,l),I(l,a[0]),p(n,y),p(n,d),p(d,h),p(e,b),i&&i.m(e,null),p(e,v),r&&r.m(e,null),N||(U=[w(l,"input",a[4]),w(n,"submit",M(a[3]))],N=!0)},p(f,[u]){u&1&&l.value!==f[0]&&I(l,f[0]),u&1&&B(h,f[0]),f[2]?i||(i=J(),i.c(),i.m(e,v)):i&&(i.d(1),i=null),!f[2]&&f[1]?r?r.p(f,u):(r=R(f),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i:P,o:P,d(f){f&&c(e),i&&i.d(),r&&r.d(),N=!1,A(U)}}}function Y(a,e,t){let s="hey",o=null,n=!1;async function l(d){d.preventDefault(),console.log("event",d),t(2,n=!0);let h={content:s};console.log("todo",h);const v=await(await fetch("/api/uploadTest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)})).json();console.log("response",v),t(2,n=!1),t(1,o=v)}function y(){s=this.value,t(0,s)}return[s,o,n,l,y]}class Z extends V{constructor(e){super(),q(this,e,Y,X,z,{})}}const x=F,ee=!0,oe=Object.freeze(Object.defineProperty({__proto__:null,csr:x,prerender:ee},Symbol.toStringTag,{value:"Module"}));function te(a){let e,t,s;return t=new Z({}),{c(){e=_("div"),G(t.$$.fragment),this.h()},l(o){e=m(o,"DIV",{class:!0});var n=g(e);H(t.$$.fragment,n),n.forEach(c),this.h()},h(){k(e,"class","myComponentStyle svelte-14ni1up")},m(o,n){D(o,e,n),Q(t,e,null),s=!0},p:P,i(o){s||(K(t.$$.fragment,o),s=!0)},o(o){L(t.$$.fragment,o),s=!1},d(o){o&&c(e),W(t)}}}class le extends V{constructor(e){super(),q(this,e,null,te,z,{})}}export{le as component,oe as universal};
