diff --git a/dist/build/bundle.js b/dist/build/bundle.js index 654ba0d..8d175b3 100644 --- a/dist/build/bundle.js +++ b/dist/build/bundle.js @@ -1,2 +1 @@ -var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function r(e){e.forEach(t)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function i(e,t){e.appendChild(t)}function s(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function l(e){return document.createTextNode(e)}function f(){return l(" ")}function p(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function d(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function h(e,t){t=""+t,e.data!==t&&(e.data=t)}function m(e,t){(null!=t||e.value)&&(e.value=t)}function v(e,t){for(let n=0;n{T.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function I(e){e&&e.c()}function M(e,n,a){const{fragment:i,on_mount:s,on_destroy:u,after_update:c}=e.$$;i&&i.m(n,a),S(()=>{const n=s.map(t).filter(o);u?u.push(...n):r(n),e.$$.on_mount=[]}),c.forEach(S)}function L(e,t){const n=e.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function U(e,t){-1===e.$$.dirty[0]&&(x.push(e),R||(R=!0,E.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const o=r.length?r[0]:n;return d.ctx&&s(d.ctx[e],d.ctx[e]=o)&&(d.bound[e]&&d.bound[e](o),h&&U(t,e)),n}):[],d.update(),h=!0,r(d.before_update),d.fragment=!!i&&i(d.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);d.fragment&&d.fragment.l(e),e.forEach(u)}else d.fragment&&d.fragment.c();o.intro&&B(t.$$.fragment),M(t,o.target,o.anchor),N()}y(f)}class F{$destroy(){L(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}}const D=[];function z(t,n=e){let r;const o=[];function i(e){if(a(t,e)&&(t=e,r)){const e=!D.length;for(let e=0;e{const e=o.indexOf(u);-1!==e&&o.splice(e,1),0===o.length&&(r(),r=null)}}}}var H=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;u[o]="set-cookie"===o?(u[o]?u[o]:[]).concat([i]):u[o]?u[o]+", "+i:i}})),u):u):null,l={data:e.responseType&&"text"!==e.responseType?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:c,config:e,request:a};!function(e,t,n){var r=n.config.validateStatus;!r||r(n.status)?e(n):t(ae("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,l),a=null}},a.onabort=function(){a&&(n(ae("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){n(ae("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(ae(t,e,"ECONNABORTED",a)),a=null},W.isStandardBrowserEnv()){var f=ue,p=(e.withCredentials||se(l))&&e.xsrfCookieName?f.read(e.xsrfCookieName):void 0;p&&(o[e.xsrfHeaderName]=p)}if("setRequestHeader"in a&&W.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),W.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),e.responseType)try{a.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),n(e),a=null)})),void 0===r&&(r=null),a.send(r)}))},le={"Content-Type":"application/x-www-form-urlencoded"};function fe(e,t){!W.isUndefined(e)&&W.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var pe,de={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(pe=ce),pe),transformRequest:[function(e,t){return oe(t,"Accept"),oe(t,"Content-Type"),W.isFormData(e)||W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)?e:W.isArrayBufferView(e)?e.buffer:W.isURLSearchParams(e)?(fe(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):W.isObject(e)?(fe(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};de.headers={common:{Accept:"application/json, text/plain, */*"}},W.forEach(["delete","get","head"],(function(e){de.headers[e]={}})),W.forEach(["post","put","patch"],(function(e){de.headers[e]=W.merge(le)}));var he=de;function me(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var ve=function(e){return me(e),e.headers=e.headers||{},e.data=ne(e.data,e.headers,e.transformRequest),e.headers=W.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),W.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||he.adapter)(e).then((function(t){return me(e),t.data=ne(t.data,t.headers,e.transformResponse),t}),(function(t){return re(t)||(me(e),t&&t.response&&(t.response.data=ne(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ge=function(e,t){t=t||{};var n={},r=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];W.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),W.forEach(o,(function(r){W.isObject(t[r])?n[r]=W.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:W.isObject(e[r])?n[r]=W.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),W.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var i=r.concat(o).concat(a),s=Object.keys(t).filter((function(e){return-1===i.indexOf(e)}));return W.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function be(e){this.defaults=e,this.interceptors={request:new te,response:new te}}be.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=ge(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[ve,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},be.prototype.getUri=function(e){return e=ge(this.defaults,e),Z(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},W.forEach(["delete","get","head","options"],(function(e){be.prototype[e]=function(t,n){return this.request(W.merge(n||{},{method:e,url:t}))}})),W.forEach(["post","put","patch"],(function(e){be.prototype[e]=function(t,n,r){return this.request(W.merge(r||{},{method:e,url:t,data:n}))}}));var ye=be;function _e(e){this.message=e}_e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_e.prototype.__CANCEL__=!0;var xe=_e;function we(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new xe(e),t(n.reason))}))}we.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},we.source=function(){var e;return{token:new we((function(t){e=t})),cancel:e}};var $e=we;function Ce(e){var t=new ye(e),n=H(ye.prototype.request,t);return W.extend(n,ye.prototype,t),W.extend(n,t),n}var Ee=Ce(he);Ee.Axios=ye,Ee.create=function(e){return Ce(ge(Ee.defaults,e))},Ee.Cancel=xe,Ee.CancelToken=$e,Ee.isCancel=re,Ee.all=function(e){return Promise.all(e)},Ee.spread=function(e){return function(t){return e.apply(null,t)}};var Re=Ee,Se=Ee;Re.default=Se;var ke=Re;const Ae="https://menu.silvrtree.co.uk/recipes";console.log("Using:",Ae);const Ne={editMode:function(){const{subscribe:e,set:t,update:n}=z(!1);return{subscribe:e,newRecipe:()=>n(e=>!0),closeEditor:()=>n(e=>!1)}}(),currentItem:function(){const{subscribe:e,set:t,update:n}=z({name:"",url:"",md:"",meat:"",mealtype:"",_id:"",short:"",hash:"",lastused:""});return{subscribe:e,clearItem:()=>n(e=>({name:"",url:"",md:"",meat:"",mealtype:"",_id:"",short:"",hash:"",lastused:""})),updateItem:e=>n(t=>e)}}(),recipes:function(){const{subscribe:e,set:t,update:n}=z([]);return{subscribe:e,set:t,update:n}}(),filter:function(){const{subscribe:e,set:t,update:n}=z({meat:"0",meal:"0"});return{subscribe:e,updateMeat:e=>n(t=>({...t,meat:e})),updateMeal:e=>n(t=>({...t,meal:e}))}}(),newRecipe(){console.log(">> Action:newRecipe"),this.editMode.newRecipe(),this.currentItem.clearItem()},async editRecipe(e){const t=await ke.get(`${Ae}/${e}`).catch(e=>{console.error(e)});this.currentItem.updateItem(t.data),this.editMode.newRecipe()},async saveRecipe(e){console.log(">> Action:saveRecipe");const t={...e};let n;""===t.hash?(console.log("Create new"),n=await ke.post(`${Ae}`,t).catch(e=>{console.error(e)})):(console.log("Update existing"),n=await ke.put(`${Ae}/${t.hash}`,t).catch(e=>{console.error(e)})),(n.data.changes>0||"Row inserted"===n.data.msg)&&(this.closeEditor(),this.fetchRecipes())},async fetchRecipes(){const e=await ke.get(Ae);this.recipes.set(e.data)},closeEditor(){this.editMode.closeEditor(),this.currentItem.clearItem()},updateMeatFilter(e){this.filter.updateMeat(e)},updateMealFilter(e){this.filter.updateMeal(e)}};function je(t){let n,r,o,a,l,h,m;return{c(){n=c("header"),r=c("h2"),r.textContent="Recipes",o=f(),a=c("ul"),l=c("li"),h=c("button"),h.textContent="New Recipe",d(h,"class","btn btn-sm"),d(h,"type","button"),d(n,"class","navbar bg-primary")},m(e,t,u){s(e,n,t),i(n,r),i(n,o),i(n,a),i(a,l),i(l,h),u&&m(),m=p(h,"click",Te)},p:e,i:e,o:e,d(e){e&&u(n),m()}}}function Te(){console.log("newRecipe"),Ne.newRecipe()}class qe extends F{constructor(e){super(),P(this,e,null,je,a,{})}}function Be(e,t,n){var r,o,a,i,s;function u(){var c=Date.now()-i;c=0?r=setTimeout(u,t-c):(r=null,n||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var c=function(){a=this,o=arguments,i=Date.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(s=e.apply(a,o),a=o=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(a,o),a=o=null,clearTimeout(r),r=null)},c}Be.debounce=Be;var Oe=Be;function Ie(e){let t,n,o,a,h,g,b,y,_,x,w,$,C,E,R,k,A,N,j,T,q,B,O,I,M,L,U,P,F,D,z,H,V,X,J,K,G,Q,W,Y,Z,ee,te,ne,re,oe,ae,ie,se;return{c(){t=c("div"),n=c("form"),o=c("label"),o.textContent="Name:",a=f(),h=c("input"),g=f(),b=c("label"),b.textContent="Url:",y=f(),_=c("input"),x=f(),w=c("label"),w.textContent="Markdown:",$=f(),C=c("textarea"),E=f(),R=c("label"),R.textContent="Meat",k=f(),A=c("select"),N=c("option"),j=c("option"),j.textContent="Chicken",T=c("option"),T.textContent="Beef",q=c("option"),q.textContent="Pork",B=c("option"),B.textContent="Fish",O=c("option"),O.textContent="Egg",I=c("option"),I.textContent="Vegetable",M=f(),L=c("label"),L.textContent="Meal type",U=f(),P=c("select"),F=c("option"),D=c("option"),D.textContent="Main",z=c("option"),z.textContent="Soup",H=c("option"),H.textContent="Note",V=f(),X=c("input"),J=f(),K=c("input"),G=f(),Q=c("input"),W=f(),Y=c("input"),Z=f(),ee=c("div"),te=c("button"),ne=l("Delete"),re=f(),oe=c("button"),oe.textContent="Close",ae=f(),ie=c("button"),ie.textContent="Save",d(o,"for","name"),d(h,"type","text"),d(h,"name","name"),d(h,"id","name"),h.required=!0,d(b,"for","url"),d(_,"type","text"),d(_,"name","url"),d(_,"id","url"),_.required=!0,d(w,"for","md"),d(C,"id","md"),d(C,"name","md"),d(C,"cols","50"),d(C,"rows","10"),d(R,"for","meat"),N.__value="",N.value=N.__value,j.__value="1",j.value=j.__value,T.__value="2",T.value=T.__value,q.__value="3",q.value=q.__value,B.__value="4",B.value=B.__value,O.__value="5",O.value=O.__value,I.__value="6",I.value=I.__value,d(A,"id","meat"),d(A,"name","meat"),A.required=!0,void 0===e[2]&&S(()=>e[12].call(A)),d(L,"for","mealtype"),F.__value="",F.value=F.__value,D.__value="1",D.value=D.__value,z.__value="2",z.value=z.__value,H.__value="128",H.value=H.__value,d(P,"id","mealtype"),d(P,"name","mealtype"),P.required=!0,void 0===e[3]&&S(()=>e[13].call(P)),d(X,"id","_id"),d(X,"name","id"),d(X,"type","hidden"),X.disabled=!0,d(K,"type","hidden"),d(K,"id","short"),d(K,"name","short"),K.disabled=!0,d(Q,"type","hidden"),d(Q,"id","hash"),d(Q,"name","hash"),Q.disabled=!0,d(Y,"type","hidden"),d(Y,"id","lastused"),d(Y,"name","lastused"),Y.disabled=!0,d(te,"class","btn btn-danger btn-sm"),d(te,"id","delete"),d(te,"type","button"),te.disabled=e[4],d(oe,"class","btn btn-sm"),d(oe,"type","button"),d(ie,"class","btn btn-primary btn-sm"),d(ie,"id","save"),d(ie,"type","button"),d(ee,"class","my text-right"),d(n,"autocomplete","off"),d(t,"class","container")},m(u,c,l){s(u,t,c),i(t,n),i(n,o),i(n,a),i(n,h),m(h,e[1].name),i(n,g),i(n,b),i(n,y),i(n,_),m(_,e[1].url),i(n,x),i(n,w),i(n,$),i(n,C),m(C,e[1].md),i(n,E),i(n,R),i(n,k),i(n,A),i(A,N),i(A,j),i(A,T),i(A,q),i(A,B),i(A,O),i(A,I),v(A,e[2]),i(n,M),i(n,L),i(n,U),i(n,P),i(P,F),i(P,D),i(P,z),i(P,H),v(P,e[3]),i(n,V),i(n,X),m(X,e[1]._id),i(n,J),i(n,K),m(K,e[1].short),i(n,G),i(n,Q),m(Q,e[1].hash),i(n,W),i(n,Y),m(Y,e[1].lastused),i(n,Z),i(n,ee),i(ee,te),i(te,ne),i(ee,re),i(ee,oe),i(ee,ae),i(ee,ie),l&&r(se),se=[p(h,"input",e[9]),p(_,"input",e[10]),p(C,"input",e[11]),p(C,"paste",e[6]),p(A,"change",e[12]),p(P,"change",e[13]),p(X,"input",e[14]),p(K,"input",e[15]),p(Q,"input",e[16]),p(Y,"input",e[17]),p(te,"click",Le),p(oe,"click",Ue),p(ie,"click",e[5])]},p(e,t){2&t&&h.value!==e[1].name&&m(h,e[1].name),2&t&&_.value!==e[1].url&&m(_,e[1].url),2&t&&m(C,e[1].md),4&t&&v(A,e[2]),8&t&&v(P,e[3]),2&t&&m(X,e[1]._id),2&t&&m(K,e[1].short),2&t&&m(Q,e[1].hash),2&t&&m(Y,e[1].lastused),16&t&&(te.disabled=e[4])},d(e){e&&u(t),r(se)}}}function Me(t){let n,r=t[0]&&Ie(t);return{c(){r&&r.c(),n=l("")},m(e,t){r&&r.m(e,t),s(e,n,t)},p(e,[t]){e[0]?r?r.p(e,t):(r=Ie(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&u(n)}}}function Le(){console.log(">> DELETE")}function Ue(){Ne.closeEditor()}function Pe(e,t,n){let r,o,a,i,s=!1;function u(e){const t=["x","chicken","beef","pork","fish","egg","vegetable"],r={},a={};let i=0,s=0;const u=/(?:#\s)(.*)(?:\n)/.exec(e.target.value),c=/(?:\[.*]\()(.*)(?:\))/.exec(e.target.value);null!==u&&(r.name=u[1]),null!==c&&(r.url=c[1]);const l=[...e.target.value.matchAll(/([vV]egetable|[pP]ork|[cC]hicken|[bB]eef|[fF]ish|[eE]gg)/g)],f=[...e.target.value.matchAll(/([sS]oup)/g)];if(l.length>0){l.map(e=>e[0].toLowerCase()).forEach(e=>{a[e]=a[e]+1||1});for(const e in a)a[e]>i&&(i=a[e],s=t.indexOf(e));r.meat=s}r.mealtype=f.length>0?2:1,n(1,o={...o,...r})}Ne.editMode.subscribe(async e=>{n(0,r=e)}),Ne.currentItem.subscribe(async e=>{n(1,o=e)});const c=Oe(u,250);return e.$$.update=()=>{2&e.$$.dirty&&(n(2,a=o.meat.toString()),n(3,i=o.mealtype.toString())),2&e.$$.dirty&&n(4,s=""===o.hash)},[r,o,a,i,s,async function(){await Ne.saveRecipe(o)},function(e){c(e)},u,c,function(){o.name=this.value,n(1,o)},function(){o.url=this.value,n(1,o)},function(){o.md=this.value,n(1,o)},function(){a=g(this),n(2,a),n(1,o)},function(){i=g(this),n(3,i),n(1,o)},function(){o._id=this.value,n(1,o)},function(){o.short=this.value,n(1,o)},function(){o.hash=this.value,n(1,o)},function(){o.lastused=this.value,n(1,o)}]}class Fe extends F{constructor(e){super(),P(this,e,Pe,Me,a,{})}}function De(t){let n,o,a,l,h,m,v,g,b,y,_,x,w,$,C,E,R;return{c(){n=c("div"),o=c("div"),a=c("select"),l=c("option"),l.textContent="All",h=c("option"),h.textContent="Chicken",m=c("option"),m.textContent="Beef",v=c("option"),v.textContent="Pork",g=c("option"),g.textContent="Fish",b=c("option"),b.textContent="Egg",y=c("option"),y.textContent="Vegetable",_=f(),x=c("select"),w=c("option"),w.textContent="All",$=c("option"),$.textContent="Mains",C=c("option"),C.textContent="Soups",E=c("option"),E.textContent="Notes",l.__value="0",l.value=l.__value,h.__value="1",h.value=h.__value,m.__value="2",m.value=m.__value,v.__value="3",v.value=v.__value,g.__value="4",g.value=g.__value,b.__value="5",b.value=b.__value,y.__value="6",y.value=y.__value,w.__value="0",w.value=w.__value,$.__value="1",$.value=$.__value,C.__value="2",C.value=C.__value,E.__value="128",E.value=E.__value,d(o,"class","filterBar grid-4 svelte-17lzm0a"),d(n,"class","container")},m(e,t,u){s(e,n,t),i(n,o),i(o,a),i(a,l),i(a,h),i(a,m),i(a,v),i(a,g),i(a,b),i(a,y),i(o,_),i(o,x),i(x,w),i(x,$),i(x,C),i(x,E),u&&r(R),R=[p(a,"change",ze),p(x,"change",He)]},p:e,i:e,o:e,d(e){e&&u(n),r(R)}}}function ze(e){const t=e.target.value;Ne.updateMeatFilter(t)}function He(e){const t=e.target.value;Ne.updateMealFilter(t)}class Ve extends F{constructor(e){super(),P(this,e,null,De,a,{})}}function Xe(e){let t;return{c(){t=c("span"),t.textContent="Note",d(t,"class","badge badge-dark")},m(e,n){s(e,t,n)},d(e){e&&u(t)}}}function Je(e){let t;return{c(){t=c("span"),t.textContent="Soup",d(t,"class","badge badge-light")},m(e,n){s(e,t,n)},d(e){e&&u(t)}}}function Ke(t){let n,r,a,m,v,g,b,y,_,x,w,$,C,E,R=t[0].name+"";function S(e,t){return 2===e[0].mealtype?Je:128===e[0].mealtype?Xe:void 0}let k=S(t),A=k&&k(t);return{c(){n=c("div"),r=c("div"),a=c("a"),m=l(R),v=f(),g=c("div"),A&&A.c(),b=f(),y=c("span"),_=l(t[2]),w=f(),$=c("div"),C=c("button"),C.textContent="Edit",d(a,"href",t[3]),d(r,"class","listItemSix svelte-qibu9a"),d(y,"class",x="badge "+t[1]+" svelte-qibu9a"),d(g,"class","listItemThree svelte-qibu9a"),d(C,"class","btn btn-primary btn-sm"),d(C,"type","button"),d($,"class","listItemThree all-center svelte-qibu9a"),d(n,"class","recipeItem svelte-qibu9a")},m(e,u,c){s(e,n,u),i(n,r),i(r,a),i(a,m),i(n,v),i(n,g),A&&A.m(g,null),i(g,b),i(g,y),i(y,_),i(n,w),i(n,$),i($,C),c&&E(),E=p(C,"click",(function(){o(Ge(t[0].hash))&&Ge(t[0].hash).apply(this,arguments)}))},p(e,[n]){t=e,1&n&&R!==(R=t[0].name+"")&&h(m,R),8&n&&d(a,"href",t[3]),k!==(k=S(t))&&(A&&A.d(1),A=k&&k(t),A&&(A.c(),A.m(g,b))),4&n&&h(_,t[2]),2&n&&x!==(x="badge "+t[1]+" svelte-qibu9a")&&d(y,"class",x)},i:e,o:e,d(e){e&&u(n),A&&A.d(),E()}}}function Ge(e){Ne.editRecipe(e)}function Qe(e,t,n){let r,o,a,{recipeItem:i={}}=t;const s=["x","Chicken","Beef","Pork","Fish","Egg","Vegetable"];return e.$set=e=>{"recipeItem"in e&&n(0,i=e.recipeItem)},e.$$.update=()=>{1&e.$$.dirty&&(n(2,o=s[i.meat]),n(1,r=""===i.meat?"":s[i.meat].toLowerCase()),n(3,a=`/view/${i.short}`))},[i,r,o,a]}class We extends F{constructor(e){super(),P(this,e,Qe,Ke,a,{recipeItem:0})}}function Ye(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ze(e){let t;const n=new We({props:{recipeItem:e[4]}});return{c(){I(n.$$.fragment)},m(e,r){M(n,e,r),t=!0},p(e,t){const r={};1&t&&(r.recipeItem=e[4]),n.$set(r)},i(e){t||(B(n.$$.fragment,e),t=!0)},o(e){O(n.$$.fragment,e),t=!1},d(e){L(n,e)}}}function et(e){let t,n,o=e[0],a=[];for(let t=0;tO(a[e],1,1,()=>{a[e]=null});return{c(){t=c("div");for(let e=0;e0===n||e.mealtype===n).filter(e=>0===t||e.meat===t).sort((e,t)=>{var n=e.short,r=t.short;return nr?1:0})}return Ne.recipes.subscribe(async e=>{r=e,n(0,o=i(r))}),Ne.filter.subscribe(async e=>{a=e,n(0,o=i(r))}),_(async()=>{await Ne.fetchRecipes()}),[o]}class nt extends F{constructor(e){super(),P(this,e,tt,et,a,{})}}function rt(t){let n,r,o,a,l;const p=new qe({}),d=new Fe({}),h=new Ve({}),m=new nt({});return{c(){n=c("main"),I(p.$$.fragment),r=f(),I(d.$$.fragment),o=f(),I(h.$$.fragment),a=f(),I(m.$$.fragment)},m(e,t){s(e,n,t),M(p,n,null),i(n,r),M(d,n,null),i(n,o),M(h,n,null),i(n,a),M(m,n,null),l=!0},p:e,i(e){l||(B(p.$$.fragment,e),B(d.$$.fragment,e),B(h.$$.fragment,e),B(m.$$.fragment,e),l=!0)},o(e){O(p.$$.fragment,e),O(d.$$.fragment,e),O(h.$$.fragment,e),O(m.$$.fragment,e),l=!1},d(e){e&&u(n),L(p),L(d),L(h),L(m)}}}return new class extends F{constructor(e){super(),P(this,e,null,rt,a,{})}}({target:document.body,props:{name:"world"}})}(); -//# sourceMappingURL=bundle.js.map +var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function r(e){e.forEach(t)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function i(e,t){e.appendChild(t)}function s(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function l(e){return document.createTextNode(e)}function f(){return l(" ")}function p(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function d(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function h(e,t){t=""+t,e.data!==t&&(e.data=t)}function m(e,t){(null!=t||e.value)&&(e.value=t)}function v(e,t){for(let n=0;n{T.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function I(e){e&&e.c()}function M(e,n,a){const{fragment:i,on_mount:s,on_destroy:u,after_update:c}=e.$$;i&&i.m(n,a),S(()=>{const n=s.map(t).filter(o);u?u.push(...n):r(n),e.$$.on_mount=[]}),c.forEach(S)}function L(e,t){const n=e.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function U(e,t){-1===e.$$.dirty[0]&&(x.push(e),R||(R=!0,E.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const o=r.length?r[0]:n;return d.ctx&&s(d.ctx[e],d.ctx[e]=o)&&(d.bound[e]&&d.bound[e](o),h&&U(t,e)),n}):[],d.update(),h=!0,r(d.before_update),d.fragment=!!i&&i(d.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);d.fragment&&d.fragment.l(e),e.forEach(u)}else d.fragment&&d.fragment.c();o.intro&&B(t.$$.fragment),M(t,o.target,o.anchor),N()}y(f)}class F{$destroy(){L(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}}const D=[];function z(t,n=e){let r;const o=[];function i(e){if(a(t,e)&&(t=e,r)){const e=!D.length;for(let e=0;e{const e=o.indexOf(u);-1!==e&&o.splice(e,1),0===o.length&&(r(),r=null)}}}}var H=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;u[o]="set-cookie"===o?(u[o]?u[o]:[]).concat([i]):u[o]?u[o]+", "+i:i}})),u):u):null,l={data:e.responseType&&"text"!==e.responseType?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:c,config:e,request:a};!function(e,t,n){var r=n.config.validateStatus;!r||r(n.status)?e(n):t(ae("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,l),a=null}},a.onabort=function(){a&&(n(ae("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){n(ae("Network Error",e,null,a)),a=null},a.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(ae(t,e,"ECONNABORTED",a)),a=null},W.isStandardBrowserEnv()){var f=ue,p=(e.withCredentials||se(l))&&e.xsrfCookieName?f.read(e.xsrfCookieName):void 0;p&&(o[e.xsrfHeaderName]=p)}if("setRequestHeader"in a&&W.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:a.setRequestHeader(t,e)})),W.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),e.responseType)try{a.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&a.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){a&&(a.abort(),n(e),a=null)})),void 0===r&&(r=null),a.send(r)}))},le={"Content-Type":"application/x-www-form-urlencoded"};function fe(e,t){!W.isUndefined(e)&&W.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var pe,de={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(pe=ce),pe),transformRequest:[function(e,t){return oe(t,"Accept"),oe(t,"Content-Type"),W.isFormData(e)||W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)?e:W.isArrayBufferView(e)?e.buffer:W.isURLSearchParams(e)?(fe(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):W.isObject(e)?(fe(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};de.headers={common:{Accept:"application/json, text/plain, */*"}},W.forEach(["delete","get","head"],(function(e){de.headers[e]={}})),W.forEach(["post","put","patch"],(function(e){de.headers[e]=W.merge(le)}));var he=de;function me(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var ve=function(e){return me(e),e.headers=e.headers||{},e.data=ne(e.data,e.headers,e.transformRequest),e.headers=W.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),W.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||he.adapter)(e).then((function(t){return me(e),t.data=ne(t.data,t.headers,e.transformResponse),t}),(function(t){return re(t)||(me(e),t&&t.response&&(t.response.data=ne(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ge=function(e,t){t=t||{};var n={},r=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];W.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),W.forEach(o,(function(r){W.isObject(t[r])?n[r]=W.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:W.isObject(e[r])?n[r]=W.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),W.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var i=r.concat(o).concat(a),s=Object.keys(t).filter((function(e){return-1===i.indexOf(e)}));return W.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function be(e){this.defaults=e,this.interceptors={request:new te,response:new te}}be.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=ge(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[ve,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},be.prototype.getUri=function(e){return e=ge(this.defaults,e),Z(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},W.forEach(["delete","get","head","options"],(function(e){be.prototype[e]=function(t,n){return this.request(W.merge(n||{},{method:e,url:t}))}})),W.forEach(["post","put","patch"],(function(e){be.prototype[e]=function(t,n,r){return this.request(W.merge(r||{},{method:e,url:t,data:n}))}}));var ye=be;function _e(e){this.message=e}_e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_e.prototype.__CANCEL__=!0;var xe=_e;function we(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new xe(e),t(n.reason))}))}we.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},we.source=function(){var e;return{token:new we((function(t){e=t})),cancel:e}};var $e=we;function Ce(e){var t=new ye(e),n=H(ye.prototype.request,t);return W.extend(n,ye.prototype,t),W.extend(n,t),n}var Ee=Ce(he);Ee.Axios=ye,Ee.create=function(e){return Ce(ge(Ee.defaults,e))},Ee.Cancel=xe,Ee.CancelToken=$e,Ee.isCancel=re,Ee.all=function(e){return Promise.all(e)},Ee.spread=function(e){return function(t){return e.apply(null,t)}};var Re=Ee,Se=Ee;Re.default=Se;var ke=Re;const Ae="https://menu.silvrtree.co.uk/recipes";console.log("Env:","production"),console.log("Using:",Ae);const Ne={editMode:function(){const{subscribe:e,set:t,update:n}=z(!1);return{subscribe:e,newRecipe:()=>n(e=>!0),closeEditor:()=>n(e=>!1)}}(),currentItem:function(){const{subscribe:e,set:t,update:n}=z({name:"",url:"",md:"",meat:"",mealtype:"",_id:"",short:"",hash:"",lastused:""});return{subscribe:e,clearItem:()=>n(e=>({name:"",url:"",md:"",meat:"",mealtype:"",_id:"",short:"",hash:"",lastused:""})),updateItem:e=>n(t=>e)}}(),recipes:function(){const{subscribe:e,set:t,update:n}=z([]);return{subscribe:e,set:t,update:n}}(),filter:function(){const{subscribe:e,set:t,update:n}=z({meat:"0",meal:"0"});return{subscribe:e,updateMeat:e=>n(t=>({...t,meat:e})),updateMeal:e=>n(t=>({...t,meal:e}))}}(),newRecipe(){console.log(">> Action:newRecipe"),this.editMode.newRecipe(),this.currentItem.clearItem()},async editRecipe(e){const t=await ke.get(`${Ae}/${e}`).catch(e=>{console.error(e)});this.currentItem.updateItem(t.data),this.editMode.newRecipe()},async saveRecipe(e){console.log(">> Action:saveRecipe");const t={...e};let n;""===t.hash?(console.log("Create new"),n=await ke.post(`${Ae}`,t).catch(e=>{console.error(e)})):(console.log("Update existing"),n=await ke.put(`${Ae}/${t.hash}`,t).catch(e=>{console.error(e)})),(n.data.changes>0||"Row inserted"===n.data.msg)&&(this.closeEditor(),this.fetchRecipes())},async fetchRecipes(){const e=await ke.get(Ae);this.recipes.set(e.data)},closeEditor(){this.editMode.closeEditor(),this.currentItem.clearItem()},updateMeatFilter(e){this.filter.updateMeat(e)},updateMealFilter(e){this.filter.updateMeal(e)}};function je(t){let n,r,o,a,l,h,m;return{c(){n=c("header"),r=c("h2"),r.textContent="Recipes",o=f(),a=c("ul"),l=c("li"),h=c("button"),h.textContent="New Recipe",d(h,"class","btn btn-sm"),d(h,"type","button"),d(n,"class","navbar bg-primary")},m(e,t,u){s(e,n,t),i(n,r),i(n,o),i(n,a),i(a,l),i(l,h),u&&m(),m=p(h,"click",Te)},p:e,i:e,o:e,d(e){e&&u(n),m()}}}function Te(){console.log("newRecipe"),Ne.newRecipe()}class qe extends F{constructor(e){super(),P(this,e,null,je,a,{})}}function Be(e,t,n){var r,o,a,i,s;function u(){var c=Date.now()-i;c=0?r=setTimeout(u,t-c):(r=null,n||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var c=function(){a=this,o=arguments,i=Date.now();var c=n&&!r;return r||(r=setTimeout(u,t)),c&&(s=e.apply(a,o),a=o=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(a,o),a=o=null,clearTimeout(r),r=null)},c}Be.debounce=Be;var Oe=Be;function Ie(e){let t,n,o,a,h,g,b,y,_,x,w,$,C,E,R,k,A,N,j,T,q,B,O,I,M,L,U,P,F,D,z,H,V,X,J,K,G,Q,W,Y,Z,ee,te,ne,re,oe,ae,ie,se;return{c(){t=c("div"),n=c("form"),o=c("label"),o.textContent="Name:",a=f(),h=c("input"),g=f(),b=c("label"),b.textContent="Url:",y=f(),_=c("input"),x=f(),w=c("label"),w.textContent="Markdown:",$=f(),C=c("textarea"),E=f(),R=c("label"),R.textContent="Meat",k=f(),A=c("select"),N=c("option"),j=c("option"),j.textContent="Chicken",T=c("option"),T.textContent="Beef",q=c("option"),q.textContent="Pork",B=c("option"),B.textContent="Fish",O=c("option"),O.textContent="Egg",I=c("option"),I.textContent="Vegetable",M=f(),L=c("label"),L.textContent="Meal type",U=f(),P=c("select"),F=c("option"),D=c("option"),D.textContent="Main",z=c("option"),z.textContent="Soup",H=c("option"),H.textContent="Note",V=f(),X=c("input"),J=f(),K=c("input"),G=f(),Q=c("input"),W=f(),Y=c("input"),Z=f(),ee=c("div"),te=c("button"),ne=l("Delete"),re=f(),oe=c("button"),oe.textContent="Close",ae=f(),ie=c("button"),ie.textContent="Save",d(o,"for","name"),d(h,"type","text"),d(h,"name","name"),d(h,"id","name"),h.required=!0,d(b,"for","url"),d(_,"type","text"),d(_,"name","url"),d(_,"id","url"),_.required=!0,d(w,"for","md"),d(C,"id","md"),d(C,"name","md"),d(C,"cols","50"),d(C,"rows","10"),d(R,"for","meat"),N.__value="",N.value=N.__value,j.__value="1",j.value=j.__value,T.__value="2",T.value=T.__value,q.__value="3",q.value=q.__value,B.__value="4",B.value=B.__value,O.__value="5",O.value=O.__value,I.__value="6",I.value=I.__value,d(A,"id","meat"),d(A,"name","meat"),A.required=!0,void 0===e[2]&&S(()=>e[12].call(A)),d(L,"for","mealtype"),F.__value="",F.value=F.__value,D.__value="1",D.value=D.__value,z.__value="2",z.value=z.__value,H.__value="128",H.value=H.__value,d(P,"id","mealtype"),d(P,"name","mealtype"),P.required=!0,void 0===e[3]&&S(()=>e[13].call(P)),d(X,"id","_id"),d(X,"name","id"),d(X,"type","hidden"),X.disabled=!0,d(K,"type","hidden"),d(K,"id","short"),d(K,"name","short"),K.disabled=!0,d(Q,"type","hidden"),d(Q,"id","hash"),d(Q,"name","hash"),Q.disabled=!0,d(Y,"type","hidden"),d(Y,"id","lastused"),d(Y,"name","lastused"),Y.disabled=!0,d(te,"class","btn btn-danger btn-sm"),d(te,"id","delete"),d(te,"type","button"),te.disabled=e[4],d(oe,"class","btn btn-sm"),d(oe,"type","button"),d(ie,"class","btn btn-primary btn-sm"),d(ie,"id","save"),d(ie,"type","button"),d(ee,"class","my text-right"),d(n,"autocomplete","off"),d(t,"class","container")},m(u,c,l){s(u,t,c),i(t,n),i(n,o),i(n,a),i(n,h),m(h,e[1].name),i(n,g),i(n,b),i(n,y),i(n,_),m(_,e[1].url),i(n,x),i(n,w),i(n,$),i(n,C),m(C,e[1].md),i(n,E),i(n,R),i(n,k),i(n,A),i(A,N),i(A,j),i(A,T),i(A,q),i(A,B),i(A,O),i(A,I),v(A,e[2]),i(n,M),i(n,L),i(n,U),i(n,P),i(P,F),i(P,D),i(P,z),i(P,H),v(P,e[3]),i(n,V),i(n,X),m(X,e[1]._id),i(n,J),i(n,K),m(K,e[1].short),i(n,G),i(n,Q),m(Q,e[1].hash),i(n,W),i(n,Y),m(Y,e[1].lastused),i(n,Z),i(n,ee),i(ee,te),i(te,ne),i(ee,re),i(ee,oe),i(ee,ae),i(ee,ie),l&&r(se),se=[p(h,"input",e[9]),p(_,"input",e[10]),p(C,"input",e[11]),p(C,"paste",e[6]),p(A,"change",e[12]),p(P,"change",e[13]),p(X,"input",e[14]),p(K,"input",e[15]),p(Q,"input",e[16]),p(Y,"input",e[17]),p(te,"click",Le),p(oe,"click",Ue),p(ie,"click",e[5])]},p(e,t){2&t&&h.value!==e[1].name&&m(h,e[1].name),2&t&&_.value!==e[1].url&&m(_,e[1].url),2&t&&m(C,e[1].md),4&t&&v(A,e[2]),8&t&&v(P,e[3]),2&t&&m(X,e[1]._id),2&t&&m(K,e[1].short),2&t&&m(Q,e[1].hash),2&t&&m(Y,e[1].lastused),16&t&&(te.disabled=e[4])},d(e){e&&u(t),r(se)}}}function Me(t){let n,r=t[0]&&Ie(t);return{c(){r&&r.c(),n=l("")},m(e,t){r&&r.m(e,t),s(e,n,t)},p(e,[t]){e[0]?r?r.p(e,t):(r=Ie(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&u(n)}}}function Le(){console.log(">> DELETE")}function Ue(){Ne.closeEditor()}function Pe(e,t,n){let r,o,a,i,s=!1;function u(e){const t=["x","chicken","beef","pork","fish","egg","vegetable"],r={},a={};let i=0,s=0;const u=/(?:#\s)(.*)(?:\n)/.exec(e.target.value),c=/(?:\[.*]\()(.*)(?:\))/.exec(e.target.value);null!==u&&(r.name=u[1]),null!==c&&(r.url=c[1]);const l=[...e.target.value.matchAll(/([vV]egetable|[pP]ork|[cC]hicken|[bB]eef|[fF]ish|[eE]gg)/g)],f=[...e.target.value.matchAll(/([sS]oup)/g)];if(l.length>0){l.map(e=>e[0].toLowerCase()).forEach(e=>{a[e]=a[e]+1||1});for(const e in a)a[e]>i&&(i=a[e],s=t.indexOf(e));r.meat=s}r.mealtype=f.length>0?2:1,n(1,o={...o,...r})}Ne.editMode.subscribe(async e=>{n(0,r=e)}),Ne.currentItem.subscribe(async e=>{n(1,o=e)});const c=Oe(u,250);return e.$$.update=()=>{2&e.$$.dirty&&(n(2,a=o.meat.toString()),n(3,i=o.mealtype.toString())),2&e.$$.dirty&&n(4,s=""===o.hash)},[r,o,a,i,s,async function(){await Ne.saveRecipe(o)},function(e){c(e)},u,c,function(){o.name=this.value,n(1,o)},function(){o.url=this.value,n(1,o)},function(){o.md=this.value,n(1,o)},function(){a=g(this),n(2,a),n(1,o)},function(){i=g(this),n(3,i),n(1,o)},function(){o._id=this.value,n(1,o)},function(){o.short=this.value,n(1,o)},function(){o.hash=this.value,n(1,o)},function(){o.lastused=this.value,n(1,o)}]}class Fe extends F{constructor(e){super(),P(this,e,Pe,Me,a,{})}}function De(t){let n,o,a,l,h,m,v,g,b,y,_,x,w,$,C,E,R;return{c(){n=c("div"),o=c("div"),a=c("select"),l=c("option"),l.textContent="All",h=c("option"),h.textContent="Chicken",m=c("option"),m.textContent="Beef",v=c("option"),v.textContent="Pork",g=c("option"),g.textContent="Fish",b=c("option"),b.textContent="Egg",y=c("option"),y.textContent="Vegetable",_=f(),x=c("select"),w=c("option"),w.textContent="All",$=c("option"),$.textContent="Mains",C=c("option"),C.textContent="Soups",E=c("option"),E.textContent="Notes",l.__value="0",l.value=l.__value,h.__value="1",h.value=h.__value,m.__value="2",m.value=m.__value,v.__value="3",v.value=v.__value,g.__value="4",g.value=g.__value,b.__value="5",b.value=b.__value,y.__value="6",y.value=y.__value,w.__value="0",w.value=w.__value,$.__value="1",$.value=$.__value,C.__value="2",C.value=C.__value,E.__value="128",E.value=E.__value,d(o,"class","filterBar grid-4 svelte-17lzm0a"),d(n,"class","container")},m(e,t,u){s(e,n,t),i(n,o),i(o,a),i(a,l),i(a,h),i(a,m),i(a,v),i(a,g),i(a,b),i(a,y),i(o,_),i(o,x),i(x,w),i(x,$),i(x,C),i(x,E),u&&r(R),R=[p(a,"change",ze),p(x,"change",He)]},p:e,i:e,o:e,d(e){e&&u(n),r(R)}}}function ze(e){const t=e.target.value;Ne.updateMeatFilter(t)}function He(e){const t=e.target.value;Ne.updateMealFilter(t)}class Ve extends F{constructor(e){super(),P(this,e,null,De,a,{})}}function Xe(e){let t;return{c(){t=c("span"),t.textContent="Note",d(t,"class","badge badge-dark")},m(e,n){s(e,t,n)},d(e){e&&u(t)}}}function Je(e){let t;return{c(){t=c("span"),t.textContent="Soup",d(t,"class","badge badge-light")},m(e,n){s(e,t,n)},d(e){e&&u(t)}}}function Ke(t){let n,r,a,m,v,g,b,y,_,x,w,$,C,E,R=t[0].name+"";function S(e,t){return 2===e[0].mealtype?Je:128===e[0].mealtype?Xe:void 0}let k=S(t),A=k&&k(t);return{c(){n=c("div"),r=c("div"),a=c("a"),m=l(R),v=f(),g=c("div"),A&&A.c(),b=f(),y=c("span"),_=l(t[2]),w=f(),$=c("div"),C=c("button"),C.textContent="Edit",d(a,"href",t[3]),d(r,"class","listItemSix svelte-qibu9a"),d(y,"class",x="badge "+t[1]+" svelte-qibu9a"),d(g,"class","listItemThree svelte-qibu9a"),d(C,"class","btn btn-primary btn-sm"),d(C,"type","button"),d($,"class","listItemThree all-center svelte-qibu9a"),d(n,"class","recipeItem svelte-qibu9a")},m(e,u,c){s(e,n,u),i(n,r),i(r,a),i(a,m),i(n,v),i(n,g),A&&A.m(g,null),i(g,b),i(g,y),i(y,_),i(n,w),i(n,$),i($,C),c&&E(),E=p(C,"click",(function(){o(Ge(t[0].hash))&&Ge(t[0].hash).apply(this,arguments)}))},p(e,[n]){t=e,1&n&&R!==(R=t[0].name+"")&&h(m,R),8&n&&d(a,"href",t[3]),k!==(k=S(t))&&(A&&A.d(1),A=k&&k(t),A&&(A.c(),A.m(g,b))),4&n&&h(_,t[2]),2&n&&x!==(x="badge "+t[1]+" svelte-qibu9a")&&d(y,"class",x)},i:e,o:e,d(e){e&&u(n),A&&A.d(),E()}}}function Ge(e){Ne.editRecipe(e)}function Qe(e,t,n){let r,o,a,{recipeItem:i={}}=t;const s=["x","Chicken","Beef","Pork","Fish","Egg","Vegetable"];return e.$set=e=>{"recipeItem"in e&&n(0,i=e.recipeItem)},e.$$.update=()=>{1&e.$$.dirty&&(n(2,o=s[i.meat]),n(1,r=""===i.meat?"":s[i.meat].toLowerCase()),n(3,a=`/view/${i.short}`))},[i,r,o,a]}class We extends F{constructor(e){super(),P(this,e,Qe,Ke,a,{recipeItem:0})}}function Ye(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ze(e){let t;const n=new We({props:{recipeItem:e[4]}});return{c(){I(n.$$.fragment)},m(e,r){M(n,e,r),t=!0},p(e,t){const r={};1&t&&(r.recipeItem=e[4]),n.$set(r)},i(e){t||(B(n.$$.fragment,e),t=!0)},o(e){O(n.$$.fragment,e),t=!1},d(e){L(n,e)}}}function et(e){let t,n,o=e[0],a=[];for(let t=0;tO(a[e],1,1,()=>{a[e]=null});return{c(){t=c("div");for(let e=0;e0===n||e.mealtype===n).filter(e=>0===t||e.meat===t).sort((e,t)=>{var n=e.short,r=t.short;return nr?1:0})}return Ne.recipes.subscribe(async e=>{r=e,n(0,o=i(r))}),Ne.filter.subscribe(async e=>{a=e,n(0,o=i(r))}),_(async()=>{await Ne.fetchRecipes()}),[o]}class nt extends F{constructor(e){super(),P(this,e,tt,et,a,{})}}function rt(t){let n,r,o,a,l;const p=new qe({}),d=new Fe({}),h=new Ve({}),m=new nt({});return{c(){n=c("main"),I(p.$$.fragment),r=f(),I(d.$$.fragment),o=f(),I(h.$$.fragment),a=f(),I(m.$$.fragment)},m(e,t){s(e,n,t),M(p,n,null),i(n,r),M(d,n,null),i(n,o),M(h,n,null),i(n,a),M(m,n,null),l=!0},p:e,i(e){l||(B(p.$$.fragment,e),B(d.$$.fragment,e),B(h.$$.fragment,e),B(m.$$.fragment,e),l=!0)},o(e){O(p.$$.fragment,e),O(d.$$.fragment,e),O(h.$$.fragment,e),O(m.$$.fragment,e),l=!1},d(e){e&&u(n),L(p),L(d),L(h),L(m)}}}return new class extends F{constructor(e){super(),P(this,e,null,rt,a,{})}}({target:document.body,props:{name:"world"}})}(); diff --git a/dist/build/bundle.js.map b/dist/build/bundle.js.map deleted file mode 100644 index d611de2..0000000 --- a/dist/build/bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.js","sources":["../../node_modules/svelte/internal/index.mjs","../../node_modules/svelte/store/index.mjs","../../node_modules/axios/lib/helpers/bind.js","../../node_modules/axios/lib/utils.js","../../node_modules/axios/lib/helpers/buildURL.js","../../node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/axios/lib/core/transformData.js","../../node_modules/axios/lib/cancel/isCancel.js","../../node_modules/axios/lib/helpers/normalizeHeaderName.js","../../node_modules/axios/lib/core/createError.js","../../node_modules/axios/lib/core/enhanceError.js","../../node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/axios/lib/helpers/cookies.js","../../node_modules/axios/lib/adapters/xhr.js","../../node_modules/axios/lib/core/buildFullPath.js","../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/axios/lib/core/settle.js","../../node_modules/axios/lib/defaults.js","../../node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/axios/lib/core/mergeConfig.js","../../node_modules/axios/lib/core/Axios.js","../../node_modules/axios/lib/cancel/Cancel.js","../../node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/axios/lib/axios.js","../../node_modules/axios/lib/helpers/spread.js","../../node_modules/axios/index.js","../../src/store/store.js","../../src/components/Header.svelte","../../node_modules/debounce/index.js","../../src/components/Editor.svelte","../../src/components/FilterBar.svelte","../../src/components/RecipeItem.svelte","../../src/components/Recipes.svelte","../../src/main.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction is_promise(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value = ret) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value' || descriptors[key] && descriptors[key].set) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group) {\n const value = [];\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.push(group[i].__value);\n }\n return value;\n}\nfunction to_number(value) {\n return value === '' ? undefined : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction claim_element(nodes, name, attributes, svg) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeName === name) {\n let j = 0;\n while (j < node.attributes.length) {\n const attribute = node.attributes[j];\n if (attributes[attribute.name]) {\n j++;\n }\n else {\n node.removeAttribute(attribute.name);\n }\n }\n return nodes.splice(i, 1)[0];\n }\n }\n return svg ? svg_element(name) : element(name);\n}\nfunction claim_text(nodes, data) {\n for (let i = 0; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 3) {\n node.data = '' + data;\n return nodes.splice(i, 1)[0];\n }\n }\n return text(data);\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data !== data)\n text.data = data;\n}\nfunction set_input_value(input, value) {\n if (value != null || input.value) {\n input.value = value;\n }\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n node.style.setProperty(key, value, important ? 'important' : '');\n}\nfunction select_option(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked') || select.options[0];\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\nfunction add_resize_listener(element, fn) {\n if (getComputedStyle(element).position === 'static') {\n element.style.position = 'relative';\n }\n const object = document.createElement('object');\n object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');\n object.setAttribute('aria-hidden', 'true');\n object.type = 'text/html';\n object.tabIndex = -1;\n let win;\n object.onload = () => {\n win = object.contentDocument.defaultView;\n win.addEventListener('resize', fn);\n };\n if (/Trident/.test(navigator.userAgent)) {\n element.appendChild(object);\n object.data = 'about:blank';\n }\n else {\n object.data = 'about:blank';\n element.appendChild(object);\n }\n return {\n cancel: () => {\n win && win.removeEventListener && win.removeEventListener('resize', fn);\n element.removeChild(object);\n }\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, false, false, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nclass HtmlTag {\n constructor(html, anchor = null) {\n this.e = element('div');\n this.a = anchor;\n this.u(html);\n }\n m(target, anchor = null) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(target, this.n[i], anchor);\n }\n this.t = target;\n }\n u(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n p(html) {\n this.d();\n this.u(html);\n this.m(this.t, this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\n\nconst active_docs = new Set();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = node.ownerDocument;\n active_docs.add(doc);\n const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);\n const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});\n if (!current_rules[name]) {\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n active_docs.forEach(doc => {\n const stylesheet = doc.__svelte_stylesheet;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n doc.__svelte_rules = {};\n });\n active_docs.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error(`Function called outside component initialization`);\n return current_component;\n}\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail);\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n }\n };\n}\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n}\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n callbacks.slice().forEach(fn => fn(event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\nlet flushing = false;\nconst seen_callbacks = new Set();\nfunction flush() {\n if (flushing)\n return;\n flushing = true;\n do {\n // first, call beforeUpdate functions\n // and update components\n for (let i = 0; i < dirty_components.length; i += 1) {\n const component = dirty_components[i];\n set_current_component(component);\n update(component.$$);\n }\n dirty_components.length = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n flushing = false;\n seen_callbacks.clear();\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n let config = fn(node, params);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = program.b - t;\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n info.blocks[i] = null;\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\n\nconst globals = (typeof window !== 'undefined' ? window : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next, lookup.has(block.key));\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error(`Cannot have duplicate keys in a keyed each`);\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, classes_to_add) {\n const attributes = Object.assign({}, ...args);\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += \" \" + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += \" \" + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${String(value).replace(/\"/g, '"').replace(/'/g, ''')}\"`;\n }\n });\n return str;\n}\nconst escaped = {\n '\"': '"',\n \"'\": ''',\n '&': '&',\n '<': '<',\n '>': '>'\n};\nfunction escape(html) {\n return String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(parent_component ? parent_component.$$.context : []),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, options = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, options);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `\"${value}\"`}`}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : ``;\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const prop_values = options.props || {};\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n before_update: [],\n after_update: [],\n context: new Map(parent_component ? parent_component.$$.context : []),\n // everything else\n callbacks: blank_object(),\n dirty\n };\n let ready = false;\n $$.ctx = instance\n ? instance(component, prop_values, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if ($$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor);\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n };\n}\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set() {\n // overridden by instance, if it has props\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.20.1' }, detail)));\n}\nfunction append_dev(target, node) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node });\n append(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev(\"SvelteDOMInsert\", { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev(\"SvelteDOMRemove\", { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? [\"capture\"] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev(\"SvelteDOMAddEventListener\", { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev(\"SvelteDOMRemoveEventListener\", { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev(\"SvelteDOMRemoveAttribute\", { node, attribute });\n else\n dispatch_dev(\"SvelteDOMSetAttribute\", { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev(\"SvelteDOMSetProperty\", { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev(\"SvelteDOMSetDataset\", { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev(\"SvelteDOMSetData\", { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(`'target' is a required option`);\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn(`Component was already destroyed`); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error(`Infinite loop detected`);\n }\n };\n}\n\nexport { HtmlTag, SvelteComponent, SvelteComponentDev, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_location, add_render_callback, add_resize_listener, add_transform, afterUpdate, append, append_dev, assign, attr, attr_dev, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, clear_loops, component_subscribe, compute_rest_props, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, escape, escaped, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, getContext, get_binding_group_value, get_current_component, get_slot_changes, get_slot_context, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, has_prop, identity, init, insert, insert_dev, intros, invalid_attribute_name_character, is_client, is_function, is_promise, listen, listen_dev, loop, loop_guard, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_data, set_data_dev, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, spread, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, update_keyed_each, validate_component, validate_each_argument, validate_each_keys, validate_slots, validate_store, xlink_attr };\n","import { noop, safe_not_equal, subscribe, run_all, is_function } from '../internal';\nexport { get_store_value as get } from '../internal';\n\nconst subscriber_queue = [];\n/**\n * Creates a `Readable` store that allows reading by subscription.\n * @param value initial value\n * @param {StartStopNotifier}start start and stop notifications for subscriptions\n */\nfunction readable(value, start) {\n return {\n subscribe: writable(value, start).subscribe,\n };\n}\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=}start start and stop notifications for subscriptions\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = [];\n function set(new_value) {\n if (safe_not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (let i = 0; i < subscribers.length; i += 1) {\n const s = subscribers[i];\n s[1]();\n subscriber_queue.push(s, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.push(subscriber);\n if (subscribers.length === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n const index = subscribers.indexOf(subscriber);\n if (index !== -1) {\n subscribers.splice(index, 1);\n }\n if (subscribers.length === 0) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\nfunction derived(stores, fn, initial_value) {\n const single = !Array.isArray(stores);\n const stores_array = single\n ? [stores]\n : stores;\n const auto = fn.length < 2;\n return readable(initial_value, (set) => {\n let inited = false;\n const values = [];\n let pending = 0;\n let cleanup = noop;\n const sync = () => {\n if (pending) {\n return;\n }\n cleanup();\n const result = fn(single ? values[0] : values, set);\n if (auto) {\n set(result);\n }\n else {\n cleanup = is_function(result) ? result : noop;\n }\n };\n const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {\n values[i] = value;\n pending &= ~(1 << i);\n if (inited) {\n sync();\n }\n }, () => {\n pending |= (1 << i);\n }));\n inited = true;\n sync();\n return function stop() {\n run_all(unsubscribers);\n cleanup();\n };\n });\n}\n\nexport { derived, readable, writable };\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction deepMerge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];\n var defaultToConfig2Keys = [\n 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',\n 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath'\n ];\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys);\n\n var otherKeys = Object\n .keys(config2)\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n return config;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","module.exports = require('./lib/axios');","import { writable } from 'svelte/store';\nimport axios from 'axios';\n\nconst url = (ENV === 'production') ? 'https://menu.silvrtree.co.uk/recipes' : 'http://localhost:3000/recipes';\nconsole.log('Using:', url);\n\nconst oldstate = writable({\n 'recipes': [],\n 'currentItem': {\n 'name': '',\n 'url': '',\n 'md': '',\n 'meat': '',\n 'mealtype': '',\n '_id': '',\n 'short': '',\n 'hash': '',\n 'lastused': ''\n },\n 'editMode': false,\n 'meatFilterMode':0,\n 'mealFilterMode':0\n\n});\n\nfunction Filter() {\n const { subscribe, set, update } = writable({ \n 'meat':'0',\n 'meal':'0'\n });\n\n return {\n subscribe,\n 'updateMeat': (newVal) => update(v => {\n return {\n ...v, ...{ 'meat':newVal }\n };\n }),\n 'updateMeal': (newVal) => update(v => {\n return {\n ...v, ...{ 'meal':newVal }\n };\n })\n };\n}\n\nfunction Recipes() {\n const { subscribe, set, update } = writable([]);\n \n return {\n subscribe,\n set,\n update\n };\n}\n\nfunction EditMode() {\n const { subscribe, set, update } = writable(false);\n\n return {\n subscribe,\n 'newRecipe': () => update(v => true),\n 'closeEditor': () => update( v => false)\n };\n}\n\nfunction CurrentItem() {\n const { subscribe, set, update } = writable({\n 'name': '',\n 'url': '',\n 'md': '',\n 'meat': '',\n 'mealtype': '',\n '_id': '',\n 'short': '',\n 'hash': '',\n 'lastused': ''\n });\n\n return {\n subscribe,\n 'clearItem': () => update(v => {\n return {\n 'name': '',\n 'url': '',\n 'md': '',\n 'meat': '',\n 'mealtype': '',\n '_id': '',\n 'short': '',\n 'hash': '',\n 'lastused': ''\n };\n }),\n 'updateItem': (payload) => update(v => {\n return payload;\n })\n };\n}\n\nconst state = {\n 'editMode': EditMode(),\n 'currentItem': CurrentItem(),\n 'recipes': Recipes(),\n 'filter': Filter(),\n \n newRecipe() {\n console.log('>> Action:newRecipe');\n this.editMode.newRecipe();\n this.currentItem.clearItem();\n },\n async editRecipe(hash) {\n const response = await axios.get(`${url}/${hash}`).catch((err) => {\n console.error(err);\n });\n\n this.currentItem.updateItem(response.data);\n this.editMode.newRecipe();\n },\n async saveRecipe(payload) {\n console.log('>> Action:saveRecipe');\n const data = { ...payload };\n\n let response;\n\n if (data.hash === '') {\n console.log('Create new');\n response = await axios.post(`${url}`, data).catch((err) => {\n console.error(err);\n });\n }\n else {\n console.log('Update existing');\n response = await axios.put(`${url}/${data.hash}`, data).catch((err) => {\n console.error(err);\n });\n }\n\n if (response.data.changes > 0 || response.data.msg === 'Row inserted') {\n this.closeEditor();\n this.fetchRecipes();\n }\n },\n async fetchRecipes() {\n const response = await axios.get(url);\n this.recipes.set(response.data);\n },\n closeEditor() {\n this.editMode.closeEditor();\n this.currentItem.clearItem();\n },\n updateMeatFilter(newVal) {\n this.filter.updateMeat(newVal);\n }, \n updateMealFilter(newVal) {\n this.filter.updateMeal(newVal);\n }\n};\n\n// export { currentItem, editMode, actions, state };\n\nexport { state };\n\n","\n\n\n\n
\n

\n Recipes\n

\n
    \n
  • \n \n
  • \n
\n
\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n\n var debounced = function(){\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n \n debounced.flush = function() {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n \n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\n","\n\n\n\n{#if _editMode}\n
\n
\n \n \n\n \n \n\n \n \n\n \n \n\n \n \n\n \n \n \n \n\n
\n \n \n \n
\n
\n
\n{/if}\n","\n\n\n\n
\n
\n \n\n \n
\n\n
\n","\n\n\n\n
\n \n
\n {#if recipeItem.mealtype ===2}\n Soup\n {:else if recipeItem.mealtype===128}\n Note\n\n {/if}\n {meatText}\n
\n
\n \n
\n
\n","\n\n\n\n
\n {#each _recipes as item}\n \n {/each}\n
\n","import App from './App.svelte';\n\nconst app = new App({\n\ttarget: document.body,\n\tprops: {\n\t\tname: 'world'\n\t}\n});\n\nexport default app;"],"names":["noop","run","fn","blank_object","Object","create","run_all","fns","forEach","is_function","thing","safe_not_equal","a","b","append","target","node","appendChild","insert","anchor","insertBefore","detach","parentNode","removeChild","element","name","document","createElement","text","data","createTextNode","space","listen","event","handler","options","addEventListener","removeEventListener","attr","attribute","value","removeAttribute","getAttribute","setAttribute","set_data","set_input_value","input","select_option","select","i","length","option","__value","selected","select_value","selected_option","querySelector","current_component","set_current_component","component","onMount","Error","get_current_component","$$","on_mount","push","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","Promise","resolve","update_scheduled","add_render_callback","flushing","seen_callbacks","Set","flush","update","pop","callback","has","add","clear","fragment","before_update","dirty","p","ctx","after_update","outroing","outros","transition_in","block","local","delete","transition_out","o","c","d","create_component","mount_component","on_destroy","m","new_on_destroy","map","filter","destroy_component","detaching","make_dirty","then","fill","init","instance","create_fragment","not_equal","props","parent_component","prop_values","bound","context","Map","callbacks","ready","ret","rest","hydrate","nodes","Array","from","childNodes","children","l","intro","SvelteComponent","[object Object]","this","$destroy","type","index","indexOf","splice","subscriber_queue","writable","start","stop","subscribers","set","new_value","run_queue","s","subscribe","invalidate","subscriber","thisArg","args","arguments","apply","toString","prototype","isArray","val","call","isUndefined","isObject","isFunction","obj","key","hasOwnProperty","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","window","merge","result","assignValue","deepMerge","extend","bind","trim","str","replace","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","utils","parts","v","toISOString","JSON","stringify","join","hashmarkIndex","slice","InterceptorManager","handlers","use","fulfilled","rejected","eject","id","h","headers","__CANCEL__","normalizedName","toUpperCase","message","config","code","request","response","error","isAxiosError","toJSON","description","number","fileName","lineNumber","columnNumber","stack","enhanceError","ignoreDuplicateOf","originURL","msie","test","userAgent","urlParsingNode","resolveURL","href","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","parsed","write","expires","path","domain","secure","cookie","Date","toGMTString","read","match","RegExp","decodeURIComponent","remove","now","reject","requestData","requestHeaders","XMLHttpRequest","auth","username","password","Authorization","btoa","baseURL","requestedURL","fullPath","isAbsoluteURL","relativeURL","combineURLs","open","method","buildURL","timeout","onreadystatechange","readyState","status","responseURL","responseHeaders","getAllResponseHeaders","split","line","substr","toLowerCase","concat","responseType","responseText","statusText","validateStatus","createError","settle","onabort","onerror","ontimeout","timeoutErrorMessage","cookies","require$$0","xsrfValue","withCredentials","isURLSameOrigin","xsrfCookieName","undefined","xsrfHeaderName","setRequestHeader","e","onDownloadProgress","onUploadProgress","upload","cancelToken","promise","cancel","abort","send","DEFAULT_CONTENT_TYPE","Content-Type","setContentTypeIfUnset","adapter","defaults","process","transformRequest","normalizeHeaderName","transformResponse","parse","maxContentLength","common","Accept","throwIfCancellationRequested","throwIfRequested","transformData","reason","isCancel","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","prop","axiosKeys","otherKeys","keys","Axios","instanceConfig","interceptors","mergeConfig","chain","dispatchRequest","interceptor","unshift","shift","getUri","Cancel","CancelToken","executor","TypeError","resolvePromise","token","source","createInstance","defaultConfig","axios","require$$1","require$$2","all","promises","spread","arr","console","log","state","editMode","newRecipe","closeEditor","EditMode","currentItem","md","meat","mealtype","_id","short","lastused","clearItem","updateItem","payload","CurrentItem","recipes","Recipes","meal","updateMeat","newVal","updateMeal","Filter","get","catch","err","post","put","changes","msg","fetchRecipes","handleNewRecipe","debounce","func","wait","immediate","timestamp","later","last","setTimeout","debounced","callNow","clearTimeout","deleteItem","_editMode","_currentItem","deleteEnabled","pasteProcessor","item","meats","newFragment","foodCount","winnerVal","winnerId","newTitle","exec","newLink","matchedFoods","matchAll","mealTypes","fooditem","el","debouncedPasteProcessor","saveRecipe","updateMeatFilter","updateMealFilter","editRecipe","meatClass","meatText","recipeItem","r","iterations","_storedRecipes","_recipes","_filter","doFilter","meatFilterMode","parseInt","mealFilterMode","sort","shortA","shortB","body"],"mappings":"gCAAA,SAASA,KAgBT,SAASC,EAAIC,GACT,OAAOA,IAEX,SAASC,IACL,OAAOC,OAAOC,OAAO,MAEzB,SAASC,EAAQC,GACbA,EAAIC,QAAQP,GAEhB,SAASQ,EAAYC,GACjB,MAAwB,mBAAVA,EAElB,SAASC,EAAeC,EAAGC,GACvB,OAAOD,GAAKA,EAAIC,GAAKA,EAAID,IAAMC,GAAOD,GAAkB,iBAANA,GAAgC,mBAANA,EA0IhF,SAASE,EAAOC,EAAQC,GACpBD,EAAOE,YAAYD,GAEvB,SAASE,EAAOH,EAAQC,EAAMG,GAC1BJ,EAAOK,aAAaJ,EAAMG,GAAU,MAExC,SAASE,EAAOL,GACZA,EAAKM,WAAWC,YAAYP,GAQhC,SAASQ,EAAQC,GACb,OAAOC,SAASC,cAAcF,GAoBlC,SAASG,EAAKC,GACV,OAAOH,SAASI,eAAeD,GAEnC,SAASE,IACL,OAAOH,EAAK,KAKhB,SAASI,EAAOhB,EAAMiB,EAAOC,EAASC,GAElC,OADAnB,EAAKoB,iBAAiBH,EAAOC,EAASC,GAC/B,IAAMnB,EAAKqB,oBAAoBJ,EAAOC,EAASC,GAuB1D,SAASG,EAAKtB,EAAMuB,EAAWC,GACd,MAATA,EACAxB,EAAKyB,gBAAgBF,GAChBvB,EAAK0B,aAAaH,KAAeC,GACtCxB,EAAK2B,aAAaJ,EAAWC,GAyFrC,SAASI,EAAShB,EAAMC,GACpBA,EAAO,GAAKA,EACRD,EAAKC,OAASA,IACdD,EAAKC,KAAOA,GAEpB,SAASgB,EAAgBC,EAAON,IACf,MAATA,GAAiBM,EAAMN,SACvBM,EAAMN,MAAQA,GActB,SAASO,EAAcC,EAAQR,GAC3B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