-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.50ec2a83.js
4 lines (4 loc) · 2.62 KB
/
db.50ec2a83.js
1
2
3
4
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"f9V3":[function(require,module,exports) {
var e=[],t=0,s=[];function a(i){fetch("/receptes/"+i+".txt").then(function(c){200===c.status?c.text().then(function(c){if("["===c[0]){var o=(c=n(c)).Categories.categoria;void 0===o&&(o=c.Categories.Categoria),o in e||(e[o]={idx:t,recipes:[]},postMessage({type:"add_menu",data:{title:o,idx:t}}),++t),c.id=i,e[o].recipes.push(c),s[i]=c;var u=!1;void 0!==c.Categories.subcategoria&&(u=c.Categories.subcategoria,void 0===e[o].subcats&&(e[o].subcats=[]),-1===e[o].subcats.indexOf(u)&&(e[o].subcats.push(u),postMessage({type:"add_submenu",data:{title:u,menu_idx:e[o].idx}}))),postMessage({type:"add_recipe",data:{menu:{title:o,idx:e[o].idx,subcat:u},recipe:c}}),setTimeout(function(){a(i+1)},100)}else postMessage({type:"finish"})}):postMessage({type:"finish"})})}function i(e){fetch("/receptes/"+e+".txt").then(function(t){200===t.status&&t.text().then(function(t){"["===t[0]&&((t=n(t)).id=e,postMessage({type:"finished_recipe",data:t}))})})}function n(e){var t={section:/^\s*\[\s*([^\]]*)\s*\]\s*$/,param:/^\s*([^=]+?)\s*=\s*(.*?)\s*$/,comment:/^\s*;.*$/},s={},a=e.split(/[\r\n]+/),i=null,n=null;return a.forEach(function(e){if(!t.comment.test(e))if(t.param.test(e))"titol"==(a=e.match(t.param))[1]?(n=a[2],s[i][n]={}):n?s[i][n][a[1]]=a[2]:i?s[i][a[1]]=a[2]:s[a[1]]=a[2];else if(t.section.test(e)){n=null;var a=e.match(t.section);s[a[1]]={},i=a[1]}else 0==e.length&&i?i=null:(s[i]instanceof Array||(s[i]=[]),s[i].push(e))}),s}self.addEventListener("message",function(e){switch(e.data.type){case"init":a(1);break;case"get_recipe":i(e.data.data.id)}});
},{}]},{},["f9V3"], null)
//# sourceMappingURL=/db.50ec2a83.js.map