var a,r=r||{};importScripts("h5p-version.js","h5p-content-upgrade-process.js");var e={newJob:function(e){new r.ContentUpgradeProcess(e.name,new r.Version(e.oldVersion),new r.Version(e.newVersion),e.params,e.id,(function loadLibrary(r,e,n){postMessage({action:"loadLibrary",name:r,version:e.toString()}),a=n}),(function done(a,r){a?postMessage({action:"error",id:e.id,err:a.message?a.message:a}):postMessage({action:"done",id:e.id,params:r})}))},libraryLoaded:function(r){var e=r.library;if(e.upgradesScript)try{importScripts(e.upgradesScript)}catch(r){return void a(r)}a(null,r.library)}};onmessage=function(a){void 0!==a.data.action&&e[a.data.action]&&e[a.data.action].call(this,a.data)};