/*!
* PennController for IBEX
* This software is licensed under a BSD license; see the LICENSE file for details.
*
* - Version 2.0
* - Last Update: 2021, July 26
* - Major changes in version 2.0:
* * Fixed Controller element duplicating lines and not rerunning properly
* * Fixed selector.shuffle and its order logging
* * Improved handling of trial end for the MediaRecorder element
* * Improved audio/video recording upload
* * Fixed print/canvas.add coordinates format bug (introduced in 1.9)
* * Can now pass opacity of 0 to audio.disable and video.disable
* * Fixed all-digit strings passed to Key element
* * Fixed MediaRecorder stop / end of trials
* * Fixed problems with some special commands (eg. fullscreen) not being properly executed as callback
* * Fixed: Controller elements no longer appear multiple times when printed onto a Canvas element
* * Fixed: calling print() after print(x,y[, canvas]) no longer preserves old positioning
* * Fixed: referencing PennController element in scale.label before printing it
* * Fixed elusive flickering with scaling
* * Fixed selector.shuffle with elements printed before/after other elements
* * Replaced the EyeTracker test with a smoother one
* * Resources are now preloading 4 at a time, following the running order (= less aggressive requests)
* * Fixed audio and video preloading problems
* * Fixed video.disable semi-opaque layer
* + Added newTrial().noTrialLog("start","end") to skip the tria's Start and/or End lines in the results file
* + Added controller.callback
* + Added textinput.callback
* + Added specialcommand jump to navigate the sequence
* + Added element DragDrop
* + Added support of flac audios in zip files
*
*/!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=45)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(1);let r=[],s={keypress:[]};class o{constructor(e,t,n){this.name=e,this.value=e,this.creator=t,this.controllers=[],this.object=null,this.status="void",this.useURLs=void 0===n||n,this.created_at=0}create(){this.status="pending",this.created_at=Date.now(),this.creator.call(this,()=>this.resolve())}resolve(){this.status="ready",a.debug.log("
Successfully preloaded resource "+this.name+"
")}}var a={resources:{list:[],fetch:function(e,t,n){var i=a.resources.list.filter(t=>t.name==e&&t.controllers.indexOf(a.controllers.underConstruction.id)<0);return(i=i.length?i[0]:new o(e,t,n)).controllers.push(a.controllers.underConstruction.id),a.controllers.underConstruction.resources.push(i),"void"!=i.status||(i.creator=t,a.resources.list.push(i)),i}},controllers:{list:[],running:null,underConstruction:null},elements:{list:[]},events:{keypress:e=>{let t=[e,a.controllers.running||a.controllers.underConstruction];if(s.keypress.push(t),a.controllers.running){let e=a.controllers._endTrial;a.controllers.running._endTrial=async function(){await e.apply(a.controllers.running),t[0]=()=>{}}}else{let e=a.controllers.underConstruction.sequence;a.controllers.underConstruction.sequence=Object(i.d)([e,e=>{t[0]=()=>{},e()}])}}},URLs:[],utils:{guidGenerator:i.b,parseCoordinates:i.h,printAndRefreshUntil:i.j,levensthein:i.e,upload:i.k,overToScale:i.g},tmpItems:[],tables:{},Prerun:function(e){r.push(e)}};let l=window.ibex_controller_set_properties;window.ibex_controller_set_properties=function(e,t){if(l(e,t),"__SendResults__"==e){document.addEventListener("keydown",e=>{if(!e.repeat&&a.controllers.running)for(let t=0;t{const e=t=>{a.runningOrder&&a.runningOrder.active?t():window.requestAnimationFrame(()=>e(t))};await new Promise(e);let t=[];a.runningOrder.active.forEach(e=>e.forEach(e=>{"PennController"==e.controller&&(t=[...t,...e.options.resources])}));let n=[];const i=()=>{if(n=n.filter(e=>"ready"!=e.status||e.created_at&&Date.now()-e.created_at>1e4),t.length>0&&n.length<4){let e=t.shift();for(;(void 0===e||"ready"==e.status)&&t.length;)e=t.shift();e&&"ready"!=e.status&&n.push(e)}0!=n.length&&(n.forEach(e=>{if(e instanceof o&&"void"==e.status&&(e.create(),e.useURLs))for(let t in a.URLs)e.create.apply($.extend({},e,{value:a.URLs[t]+e.name,resolve:function(){"ready"!=e.status&&(e.object=this.object,e.resolve())}}))}),window.requestAnimationFrame(i))};i()})},function(e,t,n){"use strict";function i(e){return()=>new Promise((async function(t){for(let t in e)if(e[t]instanceof Function)var n=await e[t]();t(n)}))}function r(e){const t=new Uint8Array(e);let n=[];return t.forEach(e=>{n.push(e.toString(16))}),n.join("").toUpperCase()}n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"g",(function(){return o})),n.d(t,"k",(function(){return a})),n.d(t,"a",(function(){return l})),n.d(t,"f",(function(){return u})),n.d(t,"b",(function(){return h})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"e",(function(){return m}));const s=function(e){const t=this.css("transform").match(/matrix\(\s*(-?\d+(.\d+)?),[^,]+,[^,]+,\s*(-?\d+(.\d+)?),/);return t&&(e.x=e.x*Number(t[1]),e.y=e.y*Number(t[3])),e};function o(e,t){let n=this,i={x:1,y:1};for(;n;)s.call(n,i),n=n.parent(),n[0]===document&&(n=void 0);let r=this.offset(),o=this.width(),a=this.height(),l=o*i.x,u=a*i.y;return r.left<=e&&r.top<=t&&r.left+l>=e&&r.top+u>=t}async function a(e,t,n,i){let r;try{r=await new Promise((n,r)=>{const s=new XMLHttpRequest,o=e.match(/\?/)?"&":"?";s.open("GET",e+o+"filename="+encodeURIComponent(t)+"&mimetype="+encodeURIComponent(i),!0),s.setRequestHeader("Content-Type","application/json"),s.onerror=t=>r("Could not GET "+e+";"),s.onload=function(){let e=null;try{e=JSON.parse(this.responseText)}catch{e=this.responseText}console.log("response",e),n(e)},console.log("before sending xhr"),s.send(),console.log("after sending xhr")})}catch(e){return new Promise((t,n)=>n(e))}console.log("presignedPostData",r);const s=new FormData;return void 0===r||"string"==typeof r?(s.append("fileName",t),s.append("mimeType",i),s.append("file",n)):(Object.keys(r).forEach(t=>{"url"==t?e=r.url:s.append(t,r[t])}),s.append("file",n),r.key&&(t=r.key)),new Promise((n,i)=>{const r=new XMLHttpRequest;r.open("POST",e,!0),r.onload=()=>n(t),r.onerror=()=>i(r.responseText);try{r.send(s)}catch(t){return i("Could not POST to "+e+"; "+t)}})}function l(e,t){if(e.match(/^00000[12]00/i))return"image/x-icon";if(e.match(/424D/i))return"image/bmp";if(e.match(/^89504E470?D0?A1A0?A/i))return"image/png";if(e.match(/^474946383[79]61/i))return"image/gif";if(e.match(/^52494646........574542505650/i))return"image/webp";if(e.match(/^FFD8FF/i))return"image/jpeg";if(e.match(/^2E736E64/i))return"audio/basic";if(e.match(/^464F524D........41494646/i))return"audio/aiff";if(e.match(/^(fff[b3a2]|494433)/i))return"audio/mpeg";if(e.match(/^664C6143/i))return"audio/flac";if(e.match(/^4F67675300/i))return"application/ogg";if(e.match(/^4D546864......06/i))return"audio/midi";if(e.match(/^52494646........41564920/i))return"video/avi";if(e.match(/^52494646.{4,8}57415645/i))return"audio/wave";if(e.match(/^1A45DFA3/i))return"video/webm";if(e.match(/^25504446/i))return"application/pdf";if(e.match(/^504B0304/i))return"application/zip";{let e=t.match(/\.([^.]+)$/);if(!e)return"";switch(e[1].toLowerCase()){case"bmp":return"image/bmp";case"png":return"image/png";case"gif":return"image/gif";case"webp":return"image/webp";case"jpg":case"jpeg":return"image/jpeg";case"mp3":return"audio/mpeg";case"flac":return"audio/flac";case"ogg":case"oga":return"audio/ogg";case"midi":case"mid":return"audio/midi";case"wav":return"audio/wave";case"webm":return"video/webm";case"avi":return"video/avi";case"mp4":return"video/mp4";case"ogv":return"video/ogg";case"mov":return"video/quicktime";default:return""}}}function u(e){let t=e/1e3%60,n=Math.trunc(e/6e4);return(n>0?n+"min":"")+(t>0?t+"s":"")}function h(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function c(e){return e.map(e=>e instanceof Object&&e.hasOwnProperty("_promises")&&e.type&&e._element?e.type+":"+e._element.id:e)}function d(e,t){const n=this.css("transform").match(/matrix\(\s*(-?\d+(.\d+)?),[^,]+,[^,]+,\s*(-?\d+(.\d+)?),/),i=window.getComputedStyle(this[0]),r=Number(i.width.replace(/px$/,"")),s=Number(i.height.replace(/px$/,""));let o=r,a=s;n&&(o=Math.abs(o*n[1]),a=Math.abs(a*n[3]));let l=String(e).match(/^(.+)\s+at\s+(.+)$/i),u=String(t).match(/^(.+)\s+at\s+(.+)$/i);if(l&&(e=String(l[2])),u&&(t=String(u[2])),isNaN(e)||(e+="px"),isNaN(t)||(t+="px"),l){if(l[1].match(/top|bottom/i))throw"Passed Y coordinate in place of X";e=l[1].match(/center|middle/i)?`calc(${e} - ${r/2}px)`:l[1].match(/right/i)?`calc(${e} - ${o-(o-r)/2}px)`:`calc(${e} + ${(o-r)/2}px)`}else e=`calc(${e} + ${(o-r)/2}px)`;if(u){if(u[1].match(/left|right/i))throw"Passed X coordinate in place of Y";t=u[1].match(/center|middle/i)?`calc(${t} - ${s/2}px)`:u[1].match(/bottom/i)?`calc(${t} - ${a-(a-s)/2}px)`:`calc(${t} + ${(a-s)/2}px)`}else t=`calc(${t} + ${(a-s)/2}px)`;return{x:e,y:t}}function f(e,t,n,i,r){if(i instanceof Function&&i())return this.css(r);const s=d.call(this,e,t);this.css({position:"absolute",left:s.x,top:s.y}),window.requestAnimationFrame(()=>f.call(this,e,t,n,i,r))}function p(e,t,n,i){n=n||$("body");const r=this.parent()[0],s={display:this.css("display"),position:this.css("position"),left:this.css("left"),top:this.css("top")};void 0!==r&&r==n[0]||this.appendTo(n).css("display","inline-block"),f.call(this,e,t,n,i,s)}function m(e,t){let n=[];n[0]=("a"+t).split("").map((e,t)=>t);for(let i=1;i0)];for(let i=1;ie.toUpperCase());String.prototype.isSpecialKey=function(e){return e?g.indexOf(this)>-1:y.indexOf(this.toUpperCase())>-1},jQuery.fn.printed=function(){let e=this.parent();for(;e.length;){if(e[0]==document.body)return!0;e=e.parent()}return!1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return h}));var i=n(0),r=n(1);let s=null,o=null,a=[];class l{constructor(){if(this.id=i.a.controllers.list.length,this.useLabel=!1,this.addToItems=!0,this.appendResultLine=[],this.linesToSave=[],this.resources=[],this.elements={},this.ambiguousElementNames=[],this.preloadDelay=6e4,i.a.controllers.list.push(this),this.defaultCommands={},this.headerDefaultCommands={},s&&s.defaultCommands)for(let e in s.defaultCommands)this.defaultCommands[e]=[].concat(s.defaultCommands[e])}_addElement(e){if(!e.hasOwnProperty("type")||!e.hasOwnProperty("id"))return i.a.debug.error("Attempted to create an invalid element");this.elements.hasOwnProperty(e.type)||(this.elements[e.type]={}),this.elements[e.type].hasOwnProperty(e.id)&&i.a.debug.warning("Overwrting another "+e.type+" element with the same name ("+e.id+")"),this.elements[e.type][e.id]=e}_getElement(e,t){if("string"!=typeof e||e.length<1||"string"!=typeof t||t.length<1)return i.a.debug.error("Attempted to get an invalid element",e,t);if(!this.elements.hasOwnProperty(t))return i.a.debug.error("Attempted to get an element of an invalid type ("+t+")",e);if(!this.elements[t].hasOwnProperty(e)){let n=[];for(let t in this.elements)this.elements[t].hasOwnProperty(e)&&n.push(t);return i.a.debug.error("No "+t+" element named ""+e+"" found",n.length?"Found ""+e+"" of type "+n.join(","):null)}return this.elements[t][e]}label(e){return this.useLabel=e,this}logAppend(e,t,n){return this.linesToSave.push(["PennController",this.id,e,t,Date.now(),n]),this}log(e,t){return null==t&&(t=e),void 0===e?(i.a.debug.warning("Used newTrial().log with no arguments"),this):(this.appendResultLine.push([csv_url_encode(e),t]),this)}noHeader(){return this.runHeader=!1,this}noFooter(){return this.runFooter=!1,this}setOption(e,t){return this[e]=t,this}noTrialLog(...e){return this.skipLog=e,this}}i.a.controllers.underConstruction=new l,i.a.controllers.new=()=>new l;const u=[];var h=function(...e){let t=i.a.controllers.underConstruction;if(window.items)for(let e in window.items)i.a.tmpItems.indexOf(window.items[e])<0&&i.a.tmpItems.push(window.items[e]);i.a.tmpItems.push(t),e.length&&"string"==typeof e[0]&&(t.useLabel=e[0]);let n=[];return function e(...t){for(let n in t)u.filter(e=>e instanceof Function&&e.call(null,t[n])),t[n]&&t[n]._promises?this.push(Object(r.d)(t[n]._promises)):t[n]&&t[n]instanceof Array&&e.apply(this,t[n])}.apply(n,e),t.sequence=Object(r.d)(n),i.a.controllers.underConstruction=new l,t};i.a.NewTrialArgumentCallback=e=>u.push(e),h.newTrial=h,h.Debug=function(e){i.a.debug.on=null==e||e},h.DebugOff=()=>h.Debug(!1),h.Sequence=function(...e){for(let t=0;t1&&"__SendResults__"==e[t]._item[1]){let n="sendResults-"+Object(r.b)();e[t].label(n),e[t]=n}window.shuffleSequence=window.seq(...e)};let c={};h.GetURLParameter=function(e){if(!Object.keys(c).length){let e=window.location.search.replace("?","").split("&");for(let t in e)c[e[t].split("=")[0]]=e[t].split("=")[1]}if(c.hasOwnProperty(e))return c[e]},h.AddHost=function(...e){for(let t in e)"string"==typeof e[t]&&e[t].match(/^https?:\/\//i)?i.a.URLs.push(e[t]):i.a.debug.warning("URL #"+t+" is not a valid URL (PennController.AddHost).",e[t])},h.CheckPreloaded=function(...e){let t=new l;t.id="Preloader-"+a.length,t.runHeader=!1,t.runFooter=!1,a.push(t),i.a.controllers.list.pop(),t.sequence=()=>new Promise(e=>e()),t.ignoreWhenCheckingPreload=!0,i.a.tmpItems.push(t),e.length&&Number(e[e.length-1])>0&&(t.preloadDelay=Number(e[e.length-1]),e.pop());let n=[];if(e.length)for(let t in e){let i=e[t];"string"==typeof i&&(i=n=>n==e[t]),i instanceof Function&&n.push(i)}else n=[e=>!0];return i.a.Prerun(()=>{let e=window.conf_modifyRunningOrder;window.conf_modifyRunningOrder=function(i){e instanceof Function&&(i=e.call(this,i));for(let e=0;e{let t=!1;for(let i=0;it.resources.indexOf(e)<0))}return i}}),t};const d=window.JSON.stringify;window.JSON.stringify=function(...e){const t=d.apply(this,e);if(1==e.length&&e[0]instanceof Array&&6==e[0].length&&!1===e[0][0]&&e[0][1]==window.__counter_value_from_server__&&e[0][4]==(()=>{for(var e=(new Date).getTimezoneOffset()+":",t=["Java","QuickTime","DevalVR","Shockwave","Flash","Windows Media Player","Silverlight","VLC Player"],n=0;nnew Promise(e=>{const n=window.__server_py_script_name__;let r={_finishedCallback:()=>{window.__server_py_script_name__=n,e()},_cssPrefix:"",_utils:i.a.controllers.running.utils},s=window.$("
").addClass("PennController-SendResults");i.a.controllers.running.element.append(s),addSafeBindMethodPair("__SendResults__"),"string"==typeof t&&(window.__server_py_script_name__=t),s.__SendResults__(r)}),o={label:e=>(r[0]=e,o),setOption:(e,t)=>(n[e]=t,o)};o._item=r,o.type="__SendResults__",o._element={id:"SendResults"};const a=e=>{if(e==o){let e=window.items&&window.items.indexOf(r);e>=0&&window.items.splice(e,1),i.a.tmpItems=i.a.tmpItems.filter(e=>e!=r)}};return i.a.ArgumentCallback(a),i.a.NewTrialArgumentCallback(a),o._promises=[s],o._runPromises=s,window.items.push(r),o},h.SetCounter=function(...e){null==window.items&&(window.items=[]);let t="setCounter",n={};e.length&&(isNaN(Number(e[0]))?1==e.length?isNaN(Number(e[0]))?t=e[0]:n.set=Number(e[0]):2!=e.length||isNaN(Number(e[1]))?e.length>2&&!isNaN(Number(e[2]))?(t=e[0],e[1].match(/\s*inc\s*$/i)?n.inc=e[2]:n.set=e[2]):t=e[0]:e[0].match(/\s*inc\s*$/i)?n.inc=e[1]:(n.set=e[1],e[0].match(/\s*set\s*$/i)||(t=e[0])):n.set=Number(e[0]));let i=[t,"__SetCounter__",n];return n.label=e=>(i[0]=e,n),n.setOption=(e,t)=>(n[e]=t,n),window.items.push(i),n},h.Header=function(...e){let t=i.a.controllers.underConstruction;t.id="Header",t.addToItems=!1,i.a.controllers.list.pop(),t.sequence=Object(r.d)(e.map(e=>Object(r.d)(e._promises)));for(let e in t.defaultCommands)for(let n in t.defaultCommands[e])t.defaultCommands[e][n].push("header");return s?(s.resources=s.resources.concat(t.resources),$.extend(!0,s.elements,t.elements),s.headerDefaultCommands=t.headerDefaultCommands,s.sequence=Object(r.d)([s.sequence,t.sequence])):s=t,i.a.controllers.underConstruction=new l,s},h.Footer=function(...e){let t=i.a.controllers.underConstruction;return t.id="Footer",t.addToItems=!1,i.a.controllers.list.pop(),t.sequence=Object(r.d)(e.map(e=>Object(r.d)(e._promises))),o?(o.resources=o.resources.concat(t.resources),$.extend(!0,o.elements,t.elements),o.headerDefaultCommands=t.headerDefaultCommands,o.sequence=Object(r.d)([o.sequence,t.sequence])):o=t,i.a.controllers.underConstruction=new l,o},define_ibex_controller({name:"PennController",jqueryWidget:{_init:function(){var e=this;i.a.controllers.running=e,e.cssPrefix=e.options._cssPrefix,e.utils=e.options._utils,e.finishedCallback=e.options._finishedCallback,e.id=e.options.id,"string"==typeof e.id&&e.id.match(/^Preloader-/)?e.controller=a[Number(e.id.replace(/Preloader-/,""))]:"Header"==e.id?e.controller=s:"Footer"==e.id?e.controller=o:Number(e.id)>=0&&Number(e.id)e.controller.resources.indexOf(t)<0)),$.extend(!0,e.controller.elements,s.elements);for(let t=0;te.controller.resources.indexOf(t)<0)),$.extend(!0,e.controller.elements,o.elements);for(let t=0;t0&&0==o.skipLog.filter(e=>e.match(/start/i)).length)||e.save("PennController",e.id,"_Footer_","Start",Date.now(),"NULL"),o._getElement=(t,n)=>e.controller._getElement(t,n),await o.sequence(),o.skipLog instanceof Array&&!(o.skipLog.length>0&&0==o.skipLog.filter(e=>e.match(/end/i)).length)||e.save("PennController",e.id,"_Footer_","End",Date.now(),"NULL"));for(let t in e.controller.elements)for(let n in e.controller.elements[t])await e.controller.elements[t][n].end();e.controller.skipLog instanceof Array&&!(e.controller.skipLog.length>0&&0==e.controller.skipLog.filter(e=>e.match(/end/i)).length)||e.save("PennController",e.id,"_Trial_","End",Date.now(),"NULL"),n.sort((e,t)=>e[4][1]>t[4][1]),n.map(e=>{for(let t in e){e[t][1]instanceof Function&&(e[t][1]=e[t][1]());let n=[];for(;e[t][1].value&&e[t][1].value._element;)n.indexOf(e[t][1]._element)<0?(n.push(e[t][1]._element),e[t][1]=e[t][1].value):e[t][1]=e[t][1]._element.id;e[t][1]._element&&e[t][1]._element.id&&(e[t][1]=e[t][1]._element.value),e[t][1]=csv_url_encode(""+e[t][1])}}),e.finishedCallback(n)}};e.endTrial=h;let c=!1,d=async function(t){if(!c){if(e.element.css({display:"flex","flex-direction":"column",position:"absolute",left:0,width:"100vw"}),c=!0,t)for(let t in e.controller.resources.filter(e=>"ready"!=e.status))e.save("PennController",e.id,"_PreloadFailed_",csv_url_encode(e.controller.resources[t].name),Date.now(),"NULL");f.remove(),e.controller.skipLog instanceof Array&&!(e.controller.skipLog.length>0&&0==e.controller.skipLog.filter(e=>e.match(/start/i)).length)||e.save("PennController",e.id,"_Trial_","Start",Date.now(),"NULL"),e.runHeader&&s instanceof l&&(s.skipLog instanceof Array&&!(s.skipLog.length>0&&0==s.skipLog.filter(e=>e.match(/start/i)).length)||e.save("PennController",e.id,"_Header_","Start",Date.now(),"NULL"),await s.sequence(),s.skipLog instanceof Array&&!(s.skipLog.length>0&&0==s.skipLog.filter(e=>e.match(/end/i)).length)||e.save("PennController",e.id,"_Header_","End",Date.now(),"NULL")),e.controller.sequence().then(h)}},f=$("
Please wait while the resources are preloading
This may take up to "+Object(r.f)(t)+".
");e.element.append(f);for(let t in e.controller.resources){let n=e.controller.resources[t],i=n.resolve;"ready"!=n.status&&(n.resolve=function(){i.apply(n),0==e.controller.resources.filter(e=>"ready"!=e.status).length&&d()})}0==e.controller.resources.filter(e=>"ready"!=e.status).length?d():setTimeout((function(){d(!0)}),t)}},properties:{obligatory:[],countsForProgressBar:!0,htmlDescription:null}}),window.PennController=new Proxy(h,{get:(e,t)=>{if(t in e)return e[t];i.a.debug.error("Unknown global PennController command: ‘"+t+"’")}})},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var i={};function r(){try{return new window.XMLHttpRequest}catch(e){}}i._getBinaryFromXHR=function(e){return e.response||e.responseText};var s=window.ActiveXObject?function(){return r()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:r;i.getBinaryContent=function(e,t){try{var n=s();n.open("GET",e,!0),"responseType"in n&&(n.responseType="arraybuffer"),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.onreadystatechange=function(r){var s,o;if(4===n.readyState)if(200===n.status||0===n.status){s=null,o=null;try{s=i._getBinaryFromXHR(n)}catch(e){o=new Error(e)}t(o,s)}else t(new Error("Ajax error for "+e+" : "+this.status+" "+this.statusText),null)},n.send()}catch(e){t(new Error(e),null)}},e.exports=i},function(e,t,n){(function(n){var i,r,s;r=[],void 0===(s="function"==typeof(i=function(){"use strict";function t(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){o(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function i(e){var t=new XMLHttpRequest;return t.open("HEAD",e,!1),t.send(),200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,o=s.saveAs||"object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype?function(e,n,o){var a=s.URL||s.webkitURL,l=document.createElement("a");n=n||e.name||"download",l.download=n,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):i(l.href)?t(e,n,o):r(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){r(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,s){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Depricated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,s),n);else if(i(e))t(e,n,s);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){r(o)}))}}:function(e,n,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,i);var o="application/octet-stream"===e.type,a=/constructor/i.test(s.HTMLElement)||s.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||o&&a)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},u.readAsDataURL(e)}else{var h=s.URL||s.webkitURL,c=h.createObjectURL(e);r?r.location=c:location.href=c,r=null,setTimeout((function(){h.revokeObjectURL(c)}),4e4)}};s.saveAs=o.saveAs=o,e.exports=o})?i.apply(t,r):i)||(e.exports=s)}).call(this,n(3))},function(e,t,n){"use strict";var i=n(0),r=n(1);$.prototype.left=function(){return Number(this.css("left").replace(/px/,""))},$.prototype.top=function(){return Number(this.css("top").replace(/px/,""))};i.a.Prerun(()=>{const e=window.location.pathname;if(!i.a.debug.on||null==="2.0".match(/beta/i)||window.localStorage&&window.localStorage.getItem(e))return;const t=new s("Beta Version",400,200,"calc(50vw - 200px)","calc(50vh - 100px)");t.container.find("div:nth-child(3)").remove(),t.content.html("
Please note that this project is using a beta version of PennController (2.0).
").css({width:"100%",height:"100%","white-space":"nowrap",position:"relative",overflow:"hidden"}).append(a).append(o).append(s)},f=e=>{if(a.tablePopin.hasOwnProperty("container"))a.tablePopin.container.parent().length>0?a.tablePopin.tabs[e].jQuery.click():$(document.body).append(a.tablePopin.container);else{a.tablePopin=new s("Tables",window.innerWidth-320,190,10,window.innerHeight-200);let t=Object.keys(i.a.tables);for(let e=0;e{if(a.runningIndex<0&&(a.runningIndex=0),a.runningElement<0?a.runningElement=0:(a.runningElement++,a.runningElement>=a.runningOrder[a.runningIndex].length&&(a.runningElement=0,a.runningIndex++)),"__SendResults__"==a.runningOrder[a.runningIndex][a.runningElement].controller&&(o=!0),!i.a.debug.on)return void(window.items=void 0);if(b(),g(),u.detach(),c.detach(),a.currentTable=null,a.currentTableName="NA",a.currentRow=-1,a.currentController=a.runningOrder[a.runningIndex][a.runningElement].options,a.currentController.hasOwnProperty("_PennController")){a.currentTable=a.currentController._PennController.table;for(let e in i.a.tables)i.a.tables[e]==a.currentTable&&(a.currentTableName=e);a.currentRow=Number(a.currentController._PennController.row),l()}let e=a.runningOrder[a.runningIndex][a.runningElement];a.infoTab.content.empty(),a.infoTab.content.append($("
Trial in sequence "+Number(a.runningIndex+1)+" / "+a.runningOrder.length+"
")).append($("
Element in trial "+Number(a.runningElement+1)+" / "+a.runningOrder[a.runningIndex].length+"
")),"PennController"==e.controller?$(a.logTab.controls.children()[1]).css("display","inline-block"):$(a.logTab.controls.children()[1]).css("display","none")};let m=window.dget;window.dget=(...e)=>{let t=m(...e);return e[1]&&"displayMode"==e[1]&&e[2]&&"overwrite"==e[2]&&p(),t};const g=()=>{if(window.conf_showProgressBar){let e=0,t=0;a.runningOrder.forEach((n,i)=>n.forEach((n,r)=>{const s=ibex_controller_get_property(n.controller,"countsForProgressBar");(void 0===s||s)&&(e++,(i table div.bar-container"),i=n.find(".bar"),r=5*e<300?5*e:300,s=t*r/e;n.css("width",r),i.css("width",Math.round(s)+"px")}},y=e=>{a.runningIndexy(e),1))},b=()=>{const e=$("");for(let t=0;t").append(s);t<=a.runningIndex?o.css({color:"gray","background-color":t==a.runningIndex?"pink":"transparent"}):o.append($("").click(()=>y(t))),e.append(o)}a.sequenceTab.content.empty().append(e)};let w=window.$.ajax;window.$.ajax=(...e)=>(i.a.debug.on&&e[0]&&e[0].url&&e[0].url.match(/\?allchunks=1$/)&&a.popin.popIn(),w(...e)),i.a.Prerun(()=>{window.onbeforeunload=function(){if(!o)return"Your results have not been sent yet. Do you really want to leave the page?"};let e=!1;PennController.version="2.0";let t=window.assert;window.assert=function(...n){if(e||"There must be some items in the running order!"!=n[1])return t.apply(this,n);e=!0;let r=window.conf_modifyRunningOrder;return window.conf_modifyRunningOrder=function(e){a.runningOrder=r instanceof Function?r.call(this,e):e,i.a.runningOrder={active:a.runningOrder,original:[...a.runningOrder]};const t=i.a.runningOrder.active.push;let n=!1;return i.a.runningOrder.active.push=function(...e){const r=t.apply(this,e);return!n&&e[0]instanceof Array&&e[0][0]&&"__SendResults__"==e[0][0].controller&&(i.a.runningOrder.original=[...this],n=!0),r},Object.defineProperty(i.a.runningOrder,"runningIndex",{get:()=>a.runningIndex}),i.a.debug.on&&(()=>{let e=Object.keys(i.a.tables);if(e.length>0){let t=$("
");for(let n=0;n").html(e[n]).click(()=>f(n)).css("cursor","pointer"));a.popin.newTab("Tables",t)}a.sequenceTab=a.popin.newTab("Sequence"),a.infoTab=a.popin.newTab("Info"),b(),a.activeTab?a.activeTab.jQuery.click():a.errorsTab.jQuery.click(),$(window.document).bind("keyup keydown",(function(e){if(e.ctrlKey&&68==e.keyCode){let t=window.innerWidth-450,n=window.innerHeight-250;return $(window.document.body).append(a.popin.container),a.popin.x=t,a.popin.y=n,a.popin.container.css({top:n,left:t}),e.preventDefault(),e.stopPropagation(),!1}}))})(),p(),a.runningOrder},t.apply(this,n)}}),window.onerror=function(e,t,n){if(!t.match(/include=data$/))return;let s=e.match(/ReferenceError: (.+) is not defined/);if(s)if(s[1].match(/^(new|get|default)/)&&PennController.Elements[s[1]])i.a.debug.error("Tried to use ‘"+s[1]+"’ without a prefix on line "+n+"; did you forget to use PennController.ResetPrefix?");else{let e={score:1,command:""},t=Object.getOwnPropertyNames(PennController.Elements);for(let n=0;n"+e.command+"’?"):i.a.debug.error("Unrecognized expression ‘"+s[1]+"’ (line "+n+")")}else i.a.debug.error(e)};let v=window.ibex_controller_get_property;window.ibex_controller_get_property=(e,t)=>{let n=Object.getOwnPropertyNames($.ui);if(n.indexOf(e)>-1)return v(e,t);let s={score:1,controllerName:""};for(let t=0;t"+s.controllerName+"?"):i.a.debug.error("Invalid controller reference: ‘"+e+"’")}},function(e,t,n){"use strict";var i=n(1),r=n(2),s=n(0);r.b.Elements={};class o{constructor(){this._commands=[],this._currentType="action."}}Object.defineProperty(r.b.Elements,"self",{get:()=>{const e=new o,t=new Proxy(e,{get:(n,i)=>{if("_commands"==i||"_currentType"==i||"hasOwnProperty"==i)return e[i];if(console.log("Getting self's proxy, with",i),"settings"==i)e._currentType="settings.";else if("test"==i)e._currentType="test.";else{if("testNot"!=i){console.log("Action on self");let n={name:e._currentType.replace("action.","")+i};e._commands.push(n);const r=(...e)=>(n.args=e,console.log("Added args",e,"to",n),t);return e._currentType="action.",r}e._currentType="testNot."}return t}});return t}});const a=[];s.a.ArgumentCallback=e=>a.push(e);const l=async function(e){for(let t=0;tn instanceof Function&&n.call(null,e[t])),e[t]instanceof f&&"Var"==e[t].type&&0==e[t]._promises.length)e[t]._runPromises instanceof Function&&await e[t]._runPromises(),e[t]=e[t].value;else if(e[t]instanceof o){let n=new f(this,m[this.type]),i=n._proxy;const r=e[t]._commands;for(let e=0;e{let r=s.a.controllers.running;s.a.debug.currentPromise=i;await l.call(n,t),e.apply(n,[(...e)=>s.a.controllers.running!=r||i(...e)].concat(t))})}},h=function(e){let t=[],n=()=>new Promise(e=>e()),r=()=>new Promise(e=>e()),o=function(...i){let o=this;return new Promise((async function(a){let u=s.a.controllers.running;s.a.debug.currentPromise=a;let h=(...e)=>s.a.controllers.running!=u||a(...e);await l.call(o,i);let c=e.apply(o,i),d="and";for(let e=0;e{t.push("and"),t.push(e)},o.or=e=>{t.push("or"),t.push(e)},o.success=function(...e){n=Object(i.d)(e.map(e=>async()=>{const t=await l.call(this,[e]);t[0]&&t[0]._runPromises instanceof Function&&await t[0]._runPromises()}))},o.failure=function(...e){r=Object(i.d)(e.map(e=>async()=>{const t=await l.call(this,[e]);t[0]&&t[0]._runPromises instanceof Function&&await t[0]._runPromises()}))},o};class c{constructor(e,t,n){let i=$(""),r=i.css,o=[];i.css=(...e)=>{o.push(e),r.apply(i,e)};let a=!1;Object.defineProperty(this,"jQueryElement",{set:function(t){if(!(t instanceof jQuery))return s.a.debug.error("Tried to assign a non jQuery element to PennElement named "+e);if(a)return i=t;let n=i.data("events");n&&$.each(n,(function(){$.each(this,(function(){t.bind(this.type,this.handler)}))}));for(let e in o)t.css(...o[e]);i=t,a=!0},get:function(){return i}}),this.jQueryContainer=$("
"),this.id=e,this.type=t,this.validate=()=>this.hasValidated=!0,this._printCallback=[],n.hasOwnProperty("end")&&(this.end=async function(){await n.end.apply(this)})}}s.a.PennElement=c;let d=(e,t,n,r)=>{let o="",a=e.replace(/^\.(settings|testNot|test)\./,"");Object(i.e)(a,"settings")/"settings".length<.5&&(o=" Did you mean to type ‘settings’?"),Object(i.e)(a,"test")/"test".length<.5&&(o=" Did you mean to type ‘test’?"),Object(i.e)(a,"testNot")/"testNot".length<.5&&(o=" Did you mean to type ‘testNot’?");let l={score:1,command:""};for(let e=0;e"+e.replace(a,l.command)+"?"),s.a.debug.error("Command ‘"+e+"’ unknown on "+t+" element ‘"+n+"’."+o)};class f{constructor(e,t){let n=new Proxy(this,{get:(e,i)=>{if(i in this)return e[i];{if("_runPromises"==i)return()=>this._runPromises.call(this);let e;try{e=this[i]}catch(e){return d(i,this.type,this._element.id,Object.getOwnPropertyNames(t.actions)),n}return void 0===e&&"string"==typeof i&&"nodeType"!=i&&d(i,this.type,this._element.id,Object.getOwnPropertyNames(t.actions)),e}}});if(this._proxy=n,e instanceof c)n._element=e;else if("string"==typeof e){let i;i=s.a.controllers.running?s.a.controllers.list[s.a.controllers.running.id]:s.a.controllers.underConstruction,Object.defineProperty(n,"_element",{get:()=>i._getElement(e,t.name)})}n.type=t.name,n._promises=[];for(let e in t.actions)n[e]=function(...r){let o=u((function(...r){s.a.debug.on&&s.a.debug.log("
"),t.actions[e].apply(this,r)}));return n._promises.push(()=>o.apply(n._element,r)),n};n.settings=new Proxy({},{get:(e,n)=>{if(n in e)return e[n];d(".settings."+n,this.type,this._element.id,Object.getOwnPropertyNames(t.settings))}});for(let e in t.settings)n.settings[e]=function(...r){let o=u((function(...r){s.a.debug.on&&s.a.debug.log("
"),t.settings[e].apply(this,r)}));return n._promises.push(()=>o.apply(n._element,r)),n};n.test=new Proxy({},{get:(e,n)=>{if(n in e)return e[n];d(".test."+n,this.type,this._element.id,Object.getOwnPropertyNames(t.test))}}),n.testNot=new Proxy({},{get:(e,n)=>{if(n in e)return e[n];d(".testNot."+n,this.type,this._element.id,Object.getOwnPropertyNames(t.test))}});for(let e in t.test)n.test[e]=function(...r){let o=h((function(...r){return s.a.debug.on&&s.a.debug.log("
"+n._element.id+" ("+t.name+") Test command '"+e+"' running, params: "+JSON.stringify(Object(i.i)(r))+"
").css("display","inline-block").addClass("PennController-after");this.jQueryElement.before(r),this.jQueryElement.after(o);for(let e in this.jQueryBefore)this.jQueryBefore[e]&&this.jQueryBefore[e]._element&&await new Promise(t=>p.actions.print.call(this.jQueryBefore[e]._element,t,r));for(let e in this.jQueryAfter)this.jQueryAfter[e]&&this.jQueryAfter[e]._element&&await new Promise(t=>p.actions.print.call(this.jQueryAfter[e]._element,t,o))}else s.a.debug.warning("No jQuery instance to print for element "+this.id);this.printTime=Date.now();for(let e=0;e");t.before(n),r.b.Elements["get"+this.type](this.id).print(n)._runPromises().then(()=>{n.before(this.jQueryElement.parent()),n.remove(),e()})},remove:function(e){if(this.jQueryContainer instanceof jQuery&&this.jQueryContainer.detach(),this.jQueryElement instanceof jQuery?this.jQueryElement.detach():s.a.debug.error("No jQuery instance to remove for element "+this.id),this.jQueryBefore&&this.jQueryBefore.length)for(let e in this.jQueryBefore)this.jQueryBefore[e]._element&&this.jQueryBefore[e]._element.jQueryElement instanceof jQuery&&this.jQueryBefore[e]._element.jQueryElement.detach();if(this.jQueryAfter&&this.jQueryAfter.length)for(let e in this.jQueryAfter)this.jQueryAfter[e]._element&&this.jQueryAfter[e]._element.jQueryElement instanceof jQuery&&this.jQueryAfter[e]._element.jQueryElement.detach();e()},wait:function(e,t){if("first"==t&&this.hasValidated)e();else{let n=!1,i=this.validate;if(this.validate=()=>{if(i.apply(this),!n)if(t instanceof Object&&t._runPromises&&t.success){let i=this.disabled;this.jQueryElement.attr("disabled",!0),this.disabled="tmp",t._runPromises().then(t=>{"success"==t&&(n=!0,e()),"tmp"==this.disabled&&(this.disabled=i,this.jQueryElement.attr("disabled",i))})}else n=!0,e()},"number"==typeof t&&t>0){let e=Date.now(),t=()=>{Date.now()-e<=0?this.validate():window.requestAnimationFrame(t)};window.requestAnimationFrame(t)}}}},settings:{after:function(e,t){t._element&&t._element.jQueryElement instanceof jQuery?(t._element.jQueryAfter instanceof Array&&(t._element.jQueryAfter=t._element.jQueryAfter.filter(e=>e._element!=this)),this.jQueryElement instanceof jQuery&&this.jQueryElement.printed()&&(t=t.print(this.jQueryContainer.find(".PennController-after"))),t._runPromises().then(()=>{this.jQueryAfter.push(t),e()})):(s.a.debug.error("Tried to add an invalid element after element named "+this.id),e())},before:function(e,t){t._element&&t._element.jQueryElement instanceof jQuery?(t._element.jQueryBefore instanceof Array&&(t._element.jQueryBefore=t._element.jQueryBefore.filter(e=>e._element!=this)),this.jQueryElement instanceof jQuery&&this.jQueryElement.printed()&&t.print(this.jQueryContainer.find(".PennController-"+this.type+"-before")),t._runPromises().then(()=>{this.jQueryBefore.push(t),e()})):(s.a.debug.error("Tried to add an invalid element before element named "+this.id),e())},bold:function(e){this.jQueryElement instanceof jQuery?this.jQueryElement.css("font-weight","bold"):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as bold"),e()},center:function(e){this.jQueryElement instanceof jQuery?(this.jQueryAlignment="center",this.jQueryElement.parent().length&&this.jQueryContainer.css("align-self","center")):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as centered"),e()},color:function(e,t){this.jQueryElement&&"string"==typeof t?this.jQueryElement.css("color",t):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as "+t),e()},cssContainer:function(e,...t){this.cssContainer||(this.cssContainer=[]),this.cssContainer.push(t),this.jQueryContainer.printed()&&this.jQueryContainer.css(...t),e()},css:function(e,...t){this.cssToApply||(this.cssToApply=[]),this.cssToApply.push(t),this.jQueryElement instanceof jQuery?this.jQueryElement.css(...t):s.a.debug.error("Element named "+this.id+" has not jQuery element on which to apply the CSS"),e()},disable:function(e){this.hasOwnProperty("jQueryElement")&&this.jQueryElement instanceof jQuery?this.jQueryElement.attr("disabled",!0).addClass("PennController-disabled"):s.a.debug.error("No jQuery instance to disable for element "+this.id),e()},enable:function(e){this.hasOwnProperty("jQueryElement")&&this.jQueryElement instanceof jQuery?this.jQueryElement.removeAttr("disabled").removeClass("PennController-disabled"):s.a.debug.error("No jQuery instance to enable for element "+this.id),e()},hidden:function(e){this.hasOwnProperty("jQueryElement")&&this.jQueryElement instanceof jQuery?this.jQueryElement.css({visibility:"hidden"}):s.a.debug.error("No jQuery instance to hide for element "+this.id),e()},italic:function(e){this.jQueryElement instanceof jQuery?this.jQueryElement.css("font-style","italic"):s.a.debug.error("Element named "+this.id+" has not jQuery element to render in italic"),e()},left:function(e){this.jQueryElement instanceof jQuery?(this.jQueryAlignment="left",this.jQueryElement.parent().length&&this.jQueryContainer.css("align-self","left")):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as aligned to the left"),e()},log:function(e,t){this.log=void 0===t||t,e()},once:function(e){if(this.hasValidated)this.disabled=!0,this.jQueryElement.attr("disabled",!0);else{let e=this.validate;this.validate=()=>{e.apply(this),this.disabled=!0,this.jQueryElement.attr("disabled",!0)}}e()},right:function(e){this.jQueryElement instanceof jQuery?(this.jQueryAlignment="right",this.jQueryElement.parent().length&&this.jQueryContainer.css("align-self","right")):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as aligned to the right"),e()},size:function(e,t,n){this.jQueryElement instanceof jQuery?(this.jQueryElement.width(t),this.jQueryElement.height(n),this.jQueryContainer instanceof jQuery&&("string"==typeof t&&t.match(/%$/)&&this.jQueryContainer.width("100%"),"string"==typeof n&&n.match(/%$/)&&this.jQueryContainer.height("100%"))):s.a.debug.error("Element named "+this.id+" has not jQuery element to render as aligned to the right"),e()},visible:function(e){this.hasOwnProperty("jQueryElement")&&this.jQueryElement instanceof jQuery?this.jQueryElement.css({visibility:"visible"}):s.a.debug.error("No jQuery instance to make visible for element "+this.id),e()}},test:{printed:function(){return!!(this.hasOwnProperty("jQueryElement")&&this.jQueryElement instanceof jQuery)&&this.jQueryElement.printed()}}};s.a.elements.standardCommands=p,r.b.Elements.jump=function(e){var t;"string"==typeof e&&(t=e,e=e=>e==t);let n=-1;const r=e=>s.a.runningOrder&&e()||setTimeout(()=>r(e),50);new Promise(e=>r(e)).then(()=>{console.log("ro",s.a.runningOrder);for(let t=0;tnew Promise(e=>{if(n<0)return e();s.a.runningOrder.active.splice(s.a.runningOrder.runningIndex+1,s.a.runningOrder.active.length,...s.a.runningOrder.original.slice(n,s.a.runningOrder.original.length)),e()});return{_promises:[o],_runPromises:()=>Object(i.d)([o])()}},r.b.Elements.fullscreen=function(){const e=()=>new Promise(e=>{if(document.documentElement.requestFullscreen)return document.documentElement.requestFullscreen().then(e).catch(e);document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen?document.documentElement.webkitRequestFullscreen():document.documentElement.msRequestFullscreen&&document.documentElement.msRequestFullscreen(),e()});return{_promises:[e],_runPromises:()=>Object(i.d)([e])()}},r.b.Elements.exitFullscreen=function(){const e=()=>new Promise(e=>{if(document.exitFullscreen)return document.exitFullscreen().then(e).catch(e);document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),e()});return{_promises:[e],_runPromises:()=>Object(i.d)([e])()}},r.b.Elements.clear=function(){const e=()=>new Promise(async e=>{let t=s.a.controllers.list[s.a.controllers.running.id];for(let e in t.elements)for(let n in t.elements[e]){let i=t.elements[e][n],s=r.b.Elements["get"+i.type](i.id);await s.remove()._runPromises()}e()});return{_promises:[e],_runPromises:()=>Object(i.d)([e])()}},r.b.Elements.end=function(){const e=()=>new Promise(async e=>{await s.a.controllers.running.endTrial(),e()});return{_promises:[e],_runPromises:()=>Object(i.d)([e])()}};let m={};r.b._AddElementType=function(e,t){m.hasOwnProperty(e)&&s.a.debug.error("Element type "+e+" defined more than once"),m[e]=function(t){let n=new t(s.a);n.hasOwnProperty("actions")||(n.actions={}),n.hasOwnProperty("settings")||(n.settings={}),n.hasOwnProperty("test")||(n.test={});for(let e in p.actions)n.actions.hasOwnProperty(e)||(n.actions[e]=p.actions[e]);for(let e in p.settings)n.settings.hasOwnProperty(e)||(n.settings[e]=p.settings[e]);for(let e in p.test)n.test.hasOwnProperty(e)||(n.test[e]=p.test[e]);for(let e in n.settings)n.actions.hasOwnProperty(e)||(n.actions[e]=n.settings[e]);let i=n.uponCreation;n.uponCreation=function(e){this.jQueryAfter=[],this.jQueryBefore=[],this.jQueryElement&&this.jQueryElement instanceof jQuery&&this.jQueryElement.removeAttr("style"),this.jQuerycontainer&&this.jQueryContainer instanceof jQuery&&(this.jQuerycontainer=$("
")),i instanceof Function?i.apply(this,[e]):e()};let r=n.end;return n.end=async function(){this.jQueryElement instanceof jQuery&&this.jQueryElement.remove();for(let e in this.jQueryBefore)this.jQueryBefore[e]._element&&this.jQueryBefore[e]._element.jQueryElement instanceof jQuery&&this.jQueryBefore[e]._element.jQueryElement.remove();for(let e in this.jQueryAfter)this.jQueryAfter[e]._element&&this.jQueryAfter[e]._element.jQueryElement instanceof jQuery&&this.jQueryAfter[e]._element.jQueryElement.remove();this.jQueryContainer instanceof jQuery&&this.jQueryContainer.remove(),r instanceof Function&&await r.apply(this)},n.name=e,n}(t),r.b.Elements["new"+e]=function(...t){let n=m[e],i=s.a.controllers.underConstruction;s.a.controllers.running&&(i=s.a.controllers.list[s.a.controllers.running.id]);let r="unnamed-"+e;t.length<1?t=[r]:"string"==typeof t[0]&&t[0].length>0&&(r=t[0]);let o=new c(r,e,n);l.call(o,t),n.hasOwnProperty("immediate")&&n.immediate instanceof Function&&n.immediate.apply(o,t);let a=o.id;for(let t=2;i.elements.hasOwnProperty(e)&&i.elements[e].hasOwnProperty(o.id);t++)o.id=a+String(t);a!=o.id&&(s.a.debug.warning("Found an existing "+o.type+" element named “"+a+"”--using name “"+o.id+"” instead for new element"),i.ambiguousElementNames.push(a)),i._addElement(o);let u=new f(o,n);if(u=u._proxy,u._promises.push(()=>new Promise(e=>{o.printTime=0,o.log=!1,e()})),u._promises.push(()=>new Promise(e=>n.uponCreation.apply(o,[e]))),i.defaultCommands.hasOwnProperty(e))for(let t in i.defaultCommands[e]){let n=i.defaultCommands[e][t];u._promises.push(()=>new Promise(e=>{"header"==n[2]&&0==s.a.controllers.running.options.runHeader?e():n[0].apply(o,[e,...n[1]])}))}return u},r.b.Elements["get"+e]=function(t){let n=s.a.controllers.underConstruction;s.a.controllers.running&&(n=s.a.controllers.list[s.a.controllers.running.id]);let i=m[e];return n.ambiguousElementNames.indexOf(t)>=0&&s.a.debug.error("Ambiguous use of get"+e+"(“"+t+"”): more than one elements were created with that name-- get"+e+"(“"+t+"”) will refer to the first one"),new f(t,i)._proxy},Object.defineProperty(r.b.Elements,"default"+e,{get:function(){let t=m[e],n={},i=function(){s.a.controllers.underConstruction.hasOwnProperty("defaultCommands")||(s.a.controllers.underConstruction.defaultCommands={}),s.a.controllers.underConstruction.defaultCommands.hasOwnProperty(e)||(s.a.controllers.underConstruction.defaultCommands[e]=[])};for(let r in t.actions)n[r]=function(...o){return i(),s.a.controllers.underConstruction.defaultCommands[e].push([t.actions[r],o]),n};n.settings={};for(let r in t.settings)n.settings[r]=function(...o){return i(),s.a.controllers.underConstruction.defaultCommands[e].push([t.settings[r],o]),n};return n}})},r.b._AddStandardCommands=function(e){let t=new e(s.a);for(let e in t)if(e.match(/^(actions|settings|test)$/))for(let n in t[e]){let i=t[e][n];if(p[e].hasOwnProperty(n))s.a.debug.error("There already is a standard "+e+" command named "+n);else if(i instanceof Function){p[e][n]=i;for(let t in m)m[t][e].hasOwnProperty(n)||(m[t][e][n]=i),"settings"!=e||m[t].actions.hasOwnProperty(n)||(m[t].actions[n]=i)}else s.a.debug.error("Standard "+e+" command "+n+" should be a function")}else s.a.debug.error("Standard command type unknown",e)}},function(e,t,n){"use strict";var i=n(4),r=n(1),s=n(2),o=n(0),a=n(5),l=n(9);let u=[];o.a.utils.JSZip=l,o.a.utils.JSZip.getBinaryContent=i.getBinaryContent,o.a.utils.saveAs=a.saveAs,s.b.PreloadZip=function(){for(let e in arguments)u.push(arguments[e])},o.a.Prerun((function(){if(u.length){var e=function(e){function t(){let t=u.indexOf(e);t>=0&&u.splice(t,1)}var n=new l;Object(i.getBinaryContent)(e,(function(i,s){if(i)throw t(),o.a.debug.error("Error downloading "+e+":",i),i;n.loadAsync(s).then((function(){o.a.debug.log("Download of "+e+" complete");var i=0;n.forEach((function(e,s){s.async("arraybuffer").then((function(s){if(!e.match(/__MACOS.+\/\.[^\/]+$/)){let t=e.replace(/^.*?([^\/]+)$/,"$1"),n=Object(r.a)(Object(r.c)(s.slice(0,28)),t);if(n){let e=URL.createObjectURL(new Blob([s],{type:n}));console.log("Found a resource named",t,"of type",n,"with url",e);var a=!1;for(let n in o.a.resources.list){let i=o.a.resources.list[n];i.name==t&&"ready"!=i.status&&(console.log("Applying create to a copye of",t),i.create.apply($.extend({},i,{value:e,object:null,resolve:function(){console.log("Resolving",t,"current status",i.status),"ready"!=i.status&&(i.object=this.object,console.log("Set",t," object to",i.object,"calling resolve now"),i.resolve())}})),a=!0)}a||o.a.resources.list.push({name:t,value:e,controllers:[],object:null,status:"void",create:function(){this.status="pending"},resolve:function(){this.status="ready"}})}}++i>=Object.keys(n.files).length&&t()}))}))}))}))};for(let t in u){let n=u[t],i=n.match(/^https?:\/\/.+\.(zip)$/i);"string"==typeof n&&i?"zip"==i[1].toLowerCase()&&e(n):o.a.debug.warning("Preload: entry #"+t+" is not a valid URL, ignoring it")}}}))},function(e,t,n){(function(t,n,i){e.exports=function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return r(t[o][1][e]||e)}),u,u.exports,e,t,n,i)}return n[o].exports}for(var s=!1,o=0;o>2,a=(3&t)<<4|n>>4,l=1>6:64,u=2>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(u++)))>>2,i=(3&a)<<6|(l=s.indexOf(e.charAt(u++))),c[h++]=t,64!==a&&(c[h++]=n),64!==l&&(c[h++]=i);return c}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var i=e("./external"),r=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function a(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,n){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var i=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==i.getTypeOf(e)?function(e,t,n){var i=r,s=0+n;e^=-1;for(var o=0;o>>8^i[255&(e^t[o])];return-1^e}(0|t,e,e.length):function(e,t,n){var i=r,s=0+n;e^=-1;for(var o=0;o>>8^i[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var i;i="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:i}},{lie:37}],7:[function(e,t,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),s=e("./utils"),o=e("./stream/GenericWorker"),a=i?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function i(e,t){var n,i="";for(n=0;n>>=8;return i}function r(e,t,n,r,o,h){var c,d,f=e.file,p=e.compression,m=h!==a.utf8encode,g=s.transformTo("string",h(f.name)),y=s.transformTo("string",a.utf8encode(f.name)),b=f.comment,w=s.transformTo("string",h(b)),v=s.transformTo("string",a.utf8encode(b)),_=y.length!==f.name.length,E=v.length!==b.length,k="",C="",A="",P=f.dir,x=f.date,j={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(j.crc32=e.crc32,j.compressedSize=e.compressedSize,j.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),m||!_&&!E||(T|=2048);var S,O=0,Q=0;P&&(O|=16),"UNIX"===o?(Q=798,O|=((S=f.unixPermissions)||(S=P?16893:33204),(65535&S)<<16)):(Q=20,O|=63&(f.dosPermissions||0)),c=x.getUTCHours(),c<<=6,c|=x.getUTCMinutes(),c<<=5,c|=x.getUTCSeconds()/2,d=x.getUTCFullYear()-1980,d<<=4,d|=x.getUTCMonth()+1,d<<=5,d|=x.getUTCDate(),_&&(k+="up"+i((C=i(1,1)+i(l(g),4)+y).length,2)+C),E&&(k+="uc"+i((A=i(1,1)+i(l(w),4)+v).length,2)+A);var N="";return N+="\n\0",N+=i(T,2),N+=p.magic,N+=i(c,2),N+=i(d,2),N+=i(j.crc32,4),N+=i(j.compressedSize,4),N+=i(j.uncompressedSize,4),N+=i(g.length,2),N+=i(k.length,2),{fileRecord:u.LOCAL_FILE_HEADER+N+g+k,dirRecord:u.CENTRAL_FILE_HEADER+i(Q,2)+N+i(w.length,2)+"\0\0\0\0"+i(O,4)+i(r,4)+g+k+w}}var s=e("../utils"),o=e("../stream/GenericWorker"),a=e("../utf8"),l=e("../crc32"),u=e("../signature");function h(e,t,n,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},h.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(e){this.accumulate=!1;var t,n=this.streamFiles&&!e.file.dir,s=r(e,n,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(s.dirRecord),n)this.push({data:(t=e,u.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:s.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){"use strict";var i=e("./Uint8ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var i=e("./DataReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var i=e("./ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var i=e("../utils"),r=e("../support"),s=e("./ArrayReader"),o=e("./StringReader"),a=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new a(e):r.uint8array?new l(i.transformTo("uint8array",e)):new s(i.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){"use strict";var i=e("./GenericWorker"),r=e("../utils");function s(e){i.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(s,i),s.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var i=e("./GenericWorker"),r=e("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,i),s.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var i=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(s,r),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var i=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}i.inherits(s,r),s.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function i(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=i},{}],29:[function(e,t,i){"use strict";var r=e("../utils"),s=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),l=e("../support"),u=e("../external"),h=null;if(l.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t,n){var i=t;switch(t){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=t,this._mimeType=n,r.checkSupport(i),this._worker=e.pipe(new s(i)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return t=this,i=e,new u.Promise((function(e,s){var o=[],l=t._internalType,u=t._outputType,h=t._mimeType;t.on("data",(function(e,t){o.push(e),i&&i(t)})).on("error",(function(e){o=[],s(e)})).on("end",(function(){try{var t=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(u,function(e,t){var i,r=0,s=null,o=0;for(i=0;i>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return r.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,s,o=e.length,l=new Array(2*o);for(t=n=0;t>10&1023,l[n++]=56320|1023&r)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),i.applyFromCharCode(l)}(e=i.transformTo(r.uint8array?"uint8array":"array",e))},i.inherits(u,o),u.prototype.processChunk=function(e){var t=i.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=t;(t=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),t.set(s,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}(t),l=t;o!==t.length&&(r.uint8array?(l=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(l=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(h,o),h.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var i=e("./support"),r=e("./base64"),s=e("./nodejsUtils"),o=e("set-immediate-shim"),a=e("./external");function l(e){return e}function u(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n>10&1023,u[i++]=56320|1023&r)}return l(u,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,i){for(var r=65535&e|0,s=e>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var s=i,o=r+n;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){"use strict";var i,r=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),l=e("./messages"),u=-2,h=258,c=262,d=113;function f(e,t){return e.msg=l[t],t}function p(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),0!==n&&(r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function y(e,t){s._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,g(e.strm)}function b(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function v(e,t){var n,i,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-c?e.strstart-(e.w_size-c):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+h,m=u[s+o-1],g=u[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(n=t)+o]===g&&u[n+o-1]===m&&u[n]===u[s]&&u[++n]===u[s+1]){s+=2,n++;do{}while(u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&s