!function(t){vare={};functionr(n){if(e[n])returne[n].exports;vari=e[n]={i:n,l:!1,exports:{}};returnt[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)returnt;if(4&e&&"object"==typeoft&&t&&t.__esModule)returnt;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeoft)for(variint)r.d(n,i,function(e){returnt[e]}.bind(null,i));returnn},r.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returnr.d(e,"a",e),e},r.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){constn=r(1),s=r(2);addEventListener("fetch",t=>{t.respondWith(asyncfunction(t){conste=newn;e.get("/track/.*",()=>asyncfunction(t){conste=t.url.split("/")[4];if(""===e)returnnewResponse("Track ID needs to be specified",{status:400,headers:{"content-type":"text/plain"}});if(access_token=awaitKV.get("access_token"),null===access_token){constt=awaitfetch("https://connect.deezer.com/oauth/access_token.php?grant_type=client_credentials&client_id=447462&client_secret=a83bf7f38ad2f137e444727cfc3775cf&output=json"),e=awaitt.json();if(void0!==e.error)returnnewResponse("Couldn't get access token from Deezer",{status:500,headers:{"content-type":"text/plain"}});access_token=e.access_token,awaitKV.put("access_token",access_token,{expirationTtl:Number(e.expires)})}constr=awaitfetch(`https://api.deezer.com/track/${e}?access_token=${access_token}`),n=awaitr.json();if(void0!==n.error)returnnewResponse(JSON.stringify(n.error),{status:403,headers:{"content-type":"application/json"}});consta=n.md5_origin,h=n.media_version,u=awaitasyncfunction(t,e,r,n){consta=news.ModeOfOperation.ecb(o);for(result=[t,e,r,n].join("¤"),buf=newArrayBuffer(result.length),result_hash=newUint8Array(buf),i=0;i<result.length;i++)result_hash[i]=result.charCodeAt(i);returnresult_hash=awaitcrypto.subtle.digest("MD5",result_hash),result_hash=Array.from(newUint8Array(result_hash)),result_hash=result_hash.reduce((function(t,e){returnt+"0".concat(e.toString(16)).substr(-2,2)}),""),result=result_hash+"¤"+result+"¤",result+="\0".repeat(result.length%16?16-result.length%16:0),result=Array.from(result).map((function(t){returnt.charCodeAt(0)})),result=(result=a.encrypt(result)).reduce((function(t,e){returnt+"0".concat(e.toString(16)).substr(-2,2)}),""),`https://e-cdns-proxy-${t[0]}.dzcdn.net/api/1/${result}`}(a,"3",e,h);returnnewResponse(null,{status:302,headers:{location:u}})}(t)),e.get("/",()=>newResponse("Hello worker!"));returnawaite.route(t)}(t.request))});consto=[106,111,54,97,101,121,54,104,97,105,100,50,84,101,105,104]},function(t,e){constr=t=>e=>e.method.toLowerCase()===t.toLowerCase(),n=r("connect"),i=r("delete"),s=r("get"),o=r("head"),a=r("options"),h=r("patch"),u=r("post"),c=r("put"),l=r("trace"),f=t=>e=>{constr=newURL(e.url).pathname;return(r.match(t)||[])[0]===r};t.exports=class{constructor(){this.routes=[]}handle(t,e){returnthis.routes.push({conditions:t,handler:e}),this}connect(t,e){returnthis.handle([n,f(t)],e)}delete(t,e){returnthis.handle([i,f(t)],e)}get(t,e){returnthis.handle([s,f(t)],e)}head(t,e){returnthis.handle([o,f(t)],e)}options(t,e){returnthis.handle([a,f(t)],e)}patch(t,e){returnthis.handle([h,f(t)],e)}post(t,e){returnthis.handle([u,f(t)],e)}put(t,e){returnthis.handle([c,f(t)],e)}trace(t,e){returnthis.handle([l,f(t)],e)}all(t){returnthis.handle([],t)}route(t){conste=this.resolve(t);returne?e.handler(t):newResponse("resource not found",{status:404,statusText:"not found",headers:{"content-type":"text/plain"}})}resolve(t){returnthis.routes.find(e=>!(e.conditions&&(!Array.isArray(e)||e.conditions.length))||("function"==typeofe.conditions?e.conditions(t):e.conditions.every(e=>e(t))))}