diff --git a/xenpaper/CNAME b/xenpaper/CNAME new file mode 100644 index 0000000..8924b1a --- /dev/null +++ b/xenpaper/CNAME @@ -0,0 +1 @@ +xenpaper.com \ No newline at end of file diff --git a/xenpaper/android-chrome-192x192.png b/xenpaper/android-chrome-192x192.png new file mode 100644 index 0000000..28e6aa7 Binary files /dev/null and b/xenpaper/android-chrome-192x192.png differ diff --git a/xenpaper/android-chrome-512x512.png b/xenpaper/android-chrome-512x512.png new file mode 100644 index 0000000..3c5b0fa Binary files /dev/null and b/xenpaper/android-chrome-512x512.png differ diff --git a/xenpaper/apple-touch-icon.png b/xenpaper/apple-touch-icon.png new file mode 100644 index 0000000..9134348 Binary files /dev/null and b/xenpaper/apple-touch-icon.png differ diff --git a/xenpaper/asset-manifest.json b/xenpaper/asset-manifest.json new file mode 100644 index 0000000..d063008 --- /dev/null +++ b/xenpaper/asset-manifest.json @@ -0,0 +1,20 @@ +{ + "files": { + "main.js": "/static/js/main.bbf5526c.chunk.js", + "main.js.map": "/static/js/main.bbf5526c.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.8b262454.js", + "runtime-main.js.map": "/static/js/runtime-main.8b262454.js.map", + "static/js/2.08158775.chunk.js": "/static/js/2.08158775.chunk.js", + "static/js/2.08158775.chunk.js.map": "/static/js/2.08158775.chunk.js.map", + "static/js/3.2bd85485.chunk.js": "/static/js/3.2bd85485.chunk.js", + "static/js/3.2bd85485.chunk.js.map": "/static/js/3.2bd85485.chunk.js.map", + "index.html": "/index.html", + "static/js/2.08158775.chunk.js.LICENSE.txt": "/static/js/2.08158775.chunk.js.LICENSE.txt", + "static/media/xenpaper-logo-512x512.19f23cff.png": "/static/media/xenpaper-logo-512x512.19f23cff.png" + }, + "entrypoints": [ + "static/js/runtime-main.8b262454.js", + "static/js/2.08158775.chunk.js", + "static/js/main.bbf5526c.chunk.js" + ] +} \ No newline at end of file diff --git a/xenpaper/favicon-16x16.png b/xenpaper/favicon-16x16.png new file mode 100644 index 0000000..f60f47e Binary files /dev/null and b/xenpaper/favicon-16x16.png differ diff --git a/xenpaper/favicon-32x32.png b/xenpaper/favicon-32x32.png new file mode 100644 index 0000000..ceae99f Binary files /dev/null and b/xenpaper/favicon-32x32.png differ diff --git a/xenpaper/favicon.ico b/xenpaper/favicon.ico new file mode 100644 index 0000000..39a2999 Binary files /dev/null and b/xenpaper/favicon.ico differ diff --git a/xenpaper/index.html b/xenpaper/index.html new file mode 100644 index 0000000..37b46d1 --- /dev/null +++ b/xenpaper/index.html @@ -0,0 +1 @@ +
255?255:a,o=(o*=255)<0?0:o>255?255:o,s=(s*=255)<0?0:s>255?255:s,r[t]=a,r[t+1]=o,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),i=this.embossBlend(),a=0,o=0,s=e.data,u=e.width,l=e.height,c=4*u,f=l;switch(r){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:b.error("Unknown emboss direction: "+r)}do{var h=(f-1)*c,d=a;f+d<1&&(d=0),f+d>l&&(d=0);var p=(f-1+d)*u*4,v=u;do{var g=h+4*(v-1),m=o;v+m<1&&(m=0),v+m>u&&(m=0);var y=p+4*(v-1+m),_=s[g]-s[y],k=s[g+1]-s[y+1],w=s[g+2]-s[y+2],x=_,S=x>0?x:-x;if((k>0?k:-k)>S&&(x=k),(w>0?w:-w)>S&&(x=w),x*=t,i){var O=s[g]+x,C=s[g+1]+x,T=s[g+2]+x;s[g]=O>255?255:O<0?0:O,s[g+1]=C>255?255:C<0?0:C,s[g+2]=T>255?255:T<0?0:T}else{var E=n-x;E<0?E=0:E>255&&(E=255),s[g]=s[g+1]=s[g+2]=E}}while(--v)}while(--f)},Enhance:function(e){var t,n,r,i,a=e.data,o=a.length,s=a[0],u=s,l=a[1],c=l,f=a[2],h=f,d=this.enhance();if(0!==d){for(i=0;ir.charCodeAt(0)&&(r=r.trim()),r=[r],0
note * .octaves
and ramps to note
\n * over the duration of .pitchDecay
.\n * @example\n * const synth = new Tone.MembraneSynth().toDestination();\n * synth.triggerAttackRelease(\"C2\", \"8n\");\n * @category Instrument\n */\nexport class MembraneSynth extends Synth {\n constructor() {\n super(optionsFromArguments(MembraneSynth.getDefaults(), arguments));\n this.name = \"MembraneSynth\";\n /**\n * Portamento is ignored in this synth. use pitch decay instead.\n */\n this.portamento = 0;\n const options = optionsFromArguments(MembraneSynth.getDefaults(), arguments);\n this.pitchDecay = options.pitchDecay;\n this.octaves = options.octaves;\n readOnly(this, [\"oscillator\", \"envelope\"]);\n }\n static getDefaults() {\n return deepMerge(Monophonic.getDefaults(), Synth.getDefaults(), {\n envelope: {\n attack: 0.001,\n attackCurve: \"exponential\",\n decay: 0.4,\n release: 1.4,\n sustain: 0.01,\n },\n octaves: 10,\n oscillator: {\n type: \"sine\",\n },\n pitchDecay: 0.05,\n });\n }\n setNote(note, time) {\n const seconds = this.toSeconds(time);\n const hertz = this.toFrequency(note instanceof FrequencyClass ? note.toFrequency() : note);\n const maxNote = hertz * this.octaves;\n this.oscillator.frequency.setValueAtTime(maxNote, seconds);\n this.oscillator.frequency.exponentialRampToValueAtTime(hertz, seconds + this.toSeconds(this.pitchDecay));\n return this;\n }\n dispose() {\n super.dispose();\n return this;\n }\n}\n__decorate([\n range(0)\n], MembraneSynth.prototype, \"octaves\", void 0);\n__decorate([\n timeRange(0)\n], MembraneSynth.prototype, \"pitchDecay\", void 0);\n//# sourceMappingURL=MembraneSynth.js.map","import { AmplitudeEnvelope } from \"../component/envelope/AmplitudeEnvelope\";\nimport { omitFromObject, optionsFromArguments } from \"../core/util/Defaults\";\nimport { Noise } from \"../source/Noise\";\nimport { Instrument } from \"./Instrument\";\nimport { ToneAudioNode } from \"../core/context/ToneAudioNode\";\nimport { Envelope } from \"../component/envelope/Envelope\";\nimport { Source } from \"../source/Source\";\n/**\n * Tone.NoiseSynth is composed of [[Noise]] through an [[AmplitudeEnvelope]].\n * ```\n * +-------+ +-------------------+\n * | Noise +>--> AmplitudeEnvelope +>--> Output\n * +-------+ +-------------------+\n * ```\n * @example\n * const noiseSynth = new Tone.NoiseSynth().toDestination();\n * noiseSynth.triggerAttackRelease(\"8n\", 0.05);\n * @category Instrument\n */\nexport class NoiseSynth extends Instrument {\n constructor() {\n super(optionsFromArguments(NoiseSynth.getDefaults(), arguments));\n this.name = \"NoiseSynth\";\n const options = optionsFromArguments(NoiseSynth.getDefaults(), arguments);\n this.noise = new Noise(Object.assign({\n context: this.context,\n }, options.noise));\n this.envelope = new AmplitudeEnvelope(Object.assign({\n context: this.context,\n }, options.envelope));\n // connect the noise to the output\n this.noise.chain(this.envelope, this.output);\n }\n static getDefaults() {\n return Object.assign(Instrument.getDefaults(), {\n envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), {\n decay: 0.1,\n sustain: 0.0,\n }),\n noise: Object.assign(omitFromObject(Noise.getDefaults(), Object.keys(Source.getDefaults())), {\n type: \"white\",\n }),\n });\n }\n /**\n * Start the attack portion of the envelopes. Unlike other\n * instruments, Tone.NoiseSynth doesn't have a note.\n * @example\n * const noiseSynth = new Tone.NoiseSynth().toDestination();\n * noiseSynth.triggerAttack();\n */\n triggerAttack(time, velocity = 1) {\n time = this.toSeconds(time);\n // the envelopes\n this.envelope.triggerAttack(time, velocity);\n // start the noise\n this.noise.start(time);\n if (this.envelope.sustain === 0) {\n this.noise.stop(time + this.toSeconds(this.envelope.attack) + this.toSeconds(this.envelope.decay));\n }\n return this;\n }\n /**\n * Start the release portion of the envelopes.\n */\n triggerRelease(time) {\n time = this.toSeconds(time);\n this.envelope.triggerRelease(time);\n this.noise.stop(time + this.toSeconds(this.envelope.release));\n return this;\n }\n sync() {\n if (this._syncState()) {\n this._syncMethod(\"triggerAttack\", 0);\n this._syncMethod(\"triggerRelease\", 0);\n }\n return this;\n }\n triggerAttackRelease(duration, time, velocity = 1) {\n time = this.toSeconds(time);\n duration = this.toSeconds(duration);\n this.triggerAttack(time, velocity);\n this.triggerRelease(time + duration);\n return this;\n }\n dispose() {\n super.dispose();\n this.noise.dispose();\n this.envelope.dispose();\n return this;\n }\n}\n//# sourceMappingURL=NoiseSynth.js.map","/**\n * All of the classes or functions which are loaded into the AudioWorkletGlobalScope\n */\nconst workletContext = new Set();\n/**\n * Add a class to the AudioWorkletGlobalScope\n */\nexport function addToWorklet(classOrFunction) {\n workletContext.add(classOrFunction);\n}\n/**\n * Register a processor in the AudioWorkletGlobalScope with the given name\n */\nexport function registerProcessor(name, classDesc) {\n const processor = /* javascript */ `registerProcessor(\"${name}\", ${classDesc})`;\n workletContext.add(processor);\n}\n/**\n * Get all of the modules which have been registered to the AudioWorkletGlobalScope\n */\nexport function getWorkletGlobalScope() {\n return Array.from(workletContext).join(\"\\n\");\n}\n//# sourceMappingURL=WorkletGlobalScope.js.map","import { addToWorklet } from \"./WorkletGlobalScope\";\nconst toneAudioWorkletProcessor = /* javascript */ `\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it's disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === \"dispose\") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n`;\naddToWorklet(toneAudioWorkletProcessor);\n//# sourceMappingURL=ToneAudioWorkletProcessor.worklet.js.map","import \"./ToneAudioWorkletProcessor.worklet\";\nimport { addToWorklet } from \"./WorkletGlobalScope\";\nexport const singleIOProcess = /* javascript */ `\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n`;\naddToWorklet(singleIOProcess);\n//# sourceMappingURL=SingleIOProcessor.worklet.js.map","import { addToWorklet } from \"./WorkletGlobalScope\";\nconst delayLine = /* javascript */ `\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n`;\naddToWorklet(delayLine);\n//# sourceMappingURL=DelayLine.worklet.js.map","import \"../../core/worklet/SingleIOProcessor.worklet\";\nimport \"../../core/worklet/DelayLine.worklet\";\nimport { registerProcessor } from \"../../core/worklet/WorkletGlobalScope\";\nexport const workletName = \"feedback-comb-filter\";\nconst feedbackCombFilter = /* javascript */ `\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"delayTime\",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: \"k-rate\"\n\t\t\t}, {\n\t\t\t\tname: \"feedback\",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: \"k-rate\"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n`;\nregisterProcessor(workletName, feedbackCombFilter);\n//# sourceMappingURL=FeedbackCombFilter.worklet.js.map","import { Gain } from \"../../core/context/Gain\";\nimport { Param } from \"../../core/context/Param\";\nimport { connectSeries, ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\nimport { readOnly } from \"../../core/util/Interface\";\nimport { ToneAudioWorklet } from \"../../core/worklet/ToneAudioWorklet\";\nimport { workletName } from \"./FeedbackCombFilter.worklet\";\n/**\n * Comb filters are basic building blocks for physical modeling. Read more\n * about comb filters on [CCRMA's website](https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html).\n *\n * This comb filter is implemented with the AudioWorkletNode which allows it to have feedback delays less than the\n * Web Audio processing block of 128 samples. There is a polyfill for browsers that don't yet support the\n * AudioWorkletNode, but it will add some latency and have slower performance than the AudioWorkletNode.\n * @category Component\n */\nexport class FeedbackCombFilter extends ToneAudioWorklet {\n constructor() {\n super(optionsFromArguments(FeedbackCombFilter.getDefaults(), arguments, [\"delayTime\", \"resonance\"]));\n this.name = \"FeedbackCombFilter\";\n const options = optionsFromArguments(FeedbackCombFilter.getDefaults(), arguments, [\"delayTime\", \"resonance\"]);\n this.input = new Gain({ context: this.context });\n this.output = new Gain({ context: this.context });\n this.delayTime = new Param({\n context: this.context,\n value: options.delayTime,\n units: \"time\",\n minValue: 0,\n maxValue: 1,\n param: this._dummyParam,\n swappable: true,\n });\n this.resonance = new Param({\n context: this.context,\n value: options.resonance,\n units: \"normalRange\",\n param: this._dummyParam,\n swappable: true,\n });\n readOnly(this, [\"resonance\", \"delayTime\"]);\n }\n _audioWorkletName() {\n return workletName;\n }\n /**\n * The default parameters\n */\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n delayTime: 0.1,\n resonance: 0.5,\n });\n }\n onReady(node) {\n connectSeries(this.input, node, this.output);\n const delayTime = node.parameters.get(\"delayTime\");\n ;\n this.delayTime.setParam(delayTime);\n const feedback = node.parameters.get(\"feedback\");\n ;\n this.resonance.setParam(feedback);\n }\n dispose() {\n super.dispose();\n this.input.dispose();\n this.output.dispose();\n this.delayTime.dispose();\n this.resonance.dispose();\n return this;\n }\n}\n//# sourceMappingURL=FeedbackCombFilter.js.map","import { MidiClass } from \"../core/type/Midi\";\nimport { deepMerge, omitFromObject, optionsFromArguments } from \"../core/util/Defaults\";\nimport { isArray, isNumber } from \"../core/util/TypeCheck\";\nimport { Instrument } from \"./Instrument\";\nimport { Synth } from \"./Synth\";\nimport { assert, warn } from \"../core/util/Debug\";\n/**\n * PolySynth handles voice creation and allocation for any\n * instruments passed in as the second paramter. PolySynth is\n * not a synthesizer by itself, it merely manages voices of\n * one of the other types of synths, allowing any of the\n * monophonic synthesizers to be polyphonic.\n *\n * @example\n * const synth = new Tone.PolySynth().toDestination();\n * // set the attributes across all the voices using 'set'\n * synth.set({ detune: -1200 });\n * // play a chord\n * synth.triggerAttackRelease([\"C4\", \"E4\", \"A4\"], 1);\n * @category Instrument\n */\nexport class PolySynth extends Instrument {\n constructor() {\n super(optionsFromArguments(PolySynth.getDefaults(), arguments, [\"voice\", \"options\"]));\n this.name = \"PolySynth\";\n /**\n * The voices which are not currently in use\n */\n this._availableVoices = [];\n /**\n * The currently active voices\n */\n this._activeVoices = [];\n /**\n * All of the allocated voices for this synth.\n */\n this._voices = [];\n /**\n * The GC timeout. Held so that it could be cancelled when the node is disposed.\n */\n this._gcTimeout = -1;\n /**\n * A moving average of the number of active voices\n */\n this._averageActiveVoices = 0;\n const options = optionsFromArguments(PolySynth.getDefaults(), arguments, [\"voice\", \"options\"]);\n // check against the old API (pre 14.3.0)\n assert(!isNumber(options.voice), \"DEPRECATED: The polyphony count is no longer the first argument.\");\n const defaults = options.voice.getDefaults();\n this.options = Object.assign(defaults, options.options);\n this.voice = options.voice;\n this.maxPolyphony = options.maxPolyphony;\n // create the first voice\n this._dummyVoice = this._getNextAvailableVoice();\n // remove it from the voices list\n const index = this._voices.indexOf(this._dummyVoice);\n this._voices.splice(index, 1);\n // kick off the GC interval\n this._gcTimeout = this.context.setInterval(this._collectGarbage.bind(this), 1);\n }\n static getDefaults() {\n return Object.assign(Instrument.getDefaults(), {\n maxPolyphony: 32,\n options: {},\n voice: Synth,\n });\n }\n /**\n * The number of active voices.\n */\n get activeVoices() {\n return this._activeVoices.length;\n }\n /**\n * Invoked when the source is done making sound, so that it can be\n * readded to the pool of available voices\n */\n _makeVoiceAvailable(voice) {\n this._availableVoices.push(voice);\n // remove the midi note from 'active voices'\n const activeVoiceIndex = this._activeVoices.findIndex((e) => e.voice === voice);\n this._activeVoices.splice(activeVoiceIndex, 1);\n }\n /**\n * Get an available voice from the pool of available voices.\n * If one is not available and the maxPolyphony limit is reached,\n * steal a voice, otherwise return null.\n */\n _getNextAvailableVoice() {\n // if there are available voices, return the first one\n if (this._availableVoices.length) {\n return this._availableVoices.shift();\n }\n else if (this._voices.length < this.maxPolyphony) {\n // otherwise if there is still more maxPolyphony, make a new voice\n const voice = new this.voice(Object.assign(this.options, {\n context: this.context,\n onsilence: this._makeVoiceAvailable.bind(this),\n }));\n voice.connect(this.output);\n this._voices.push(voice);\n return voice;\n }\n else {\n warn(\"Max polyphony exceeded. Note dropped.\");\n }\n }\n /**\n * Occasionally check if there are any allocated voices which can be cleaned up.\n */\n _collectGarbage() {\n this._averageActiveVoices = Math.max(this._averageActiveVoices * 0.95, this.activeVoices);\n if (this._availableVoices.length && this._voices.length > Math.ceil(this._averageActiveVoices + 1)) {\n // take off an available note\n const firstAvail = this._availableVoices.shift();\n const index = this._voices.indexOf(firstAvail);\n this._voices.splice(index, 1);\n if (!this.context.isOffline) {\n firstAvail.dispose();\n }\n }\n }\n /**\n * Internal method which triggers the attack\n */\n _triggerAttack(notes, time, velocity) {\n notes.forEach(note => {\n const midiNote = new MidiClass(this.context, note).toMidi();\n const voice = this._getNextAvailableVoice();\n if (voice) {\n voice.triggerAttack(note, time, velocity);\n this._activeVoices.push({\n midi: midiNote, voice, released: false,\n });\n this.log(\"triggerAttack\", note, time);\n }\n });\n }\n /**\n * Internal method which triggers the release\n */\n _triggerRelease(notes, time) {\n notes.forEach(note => {\n const midiNote = new MidiClass(this.context, note).toMidi();\n const event = this._activeVoices.find(({ midi, released }) => midi === midiNote && !released);\n if (event) {\n // trigger release on that note\n event.voice.triggerRelease(time);\n // mark it as released\n event.released = true;\n this.log(\"triggerRelease\", note, time);\n }\n });\n }\n /**\n * Schedule the attack/release events. If the time is in the future, then it should set a timeout\n * to wait for just-in-time scheduling\n */\n _scheduleEvent(type, notes, time, velocity) {\n assert(!this.disposed, \"Synth was already disposed\");\n // if the notes are greater than this amount of time in the future, they should be scheduled with setTimeout\n if (time <= this.now()) {\n // do it immediately\n if (type === \"attack\") {\n this._triggerAttack(notes, time, velocity);\n }\n else {\n this._triggerRelease(notes, time);\n }\n }\n else {\n // schedule it to start in the future\n this.context.setTimeout(() => {\n this._scheduleEvent(type, notes, time, velocity);\n }, time - this.now());\n }\n }\n /**\n * Trigger the attack portion of the note\n * @param notes The notes to play. Accepts a single Frequency or an array of frequencies.\n * @param time The start time of the note.\n * @param velocity The velocity of the note.\n * @example\n * const synth = new Tone.PolySynth(Tone.FMSynth).toDestination();\n * // trigger a chord immediately with a velocity of 0.2\n * synth.triggerAttack([\"Ab3\", \"C4\", \"F5\"], Tone.now(), 0.2);\n */\n triggerAttack(notes, time, velocity) {\n if (!Array.isArray(notes)) {\n notes = [notes];\n }\n const computedTime = this.toSeconds(time);\n this._scheduleEvent(\"attack\", notes, computedTime, velocity);\n return this;\n }\n /**\n * Trigger the release of the note. Unlike monophonic instruments,\n * a note (or array of notes) needs to be passed in as the first argument.\n * @param notes The notes to play. Accepts a single Frequency or an array of frequencies.\n * @param time When the release will be triggered.\n * @example\n * @example\n * const poly = new Tone.PolySynth(Tone.AMSynth).toDestination();\n * poly.triggerAttack([\"Ab3\", \"C4\", \"F5\"]);\n * // trigger the release of the given notes.\n * poly.triggerRelease([\"Ab3\", \"C4\"], \"+1\");\n * poly.triggerRelease(\"F5\", \"+3\");\n */\n triggerRelease(notes, time) {\n if (!Array.isArray(notes)) {\n notes = [notes];\n }\n const computedTime = this.toSeconds(time);\n this._scheduleEvent(\"release\", notes, computedTime);\n return this;\n }\n /**\n * Trigger the attack and release after the specified duration\n * @param notes The notes to play. Accepts a single Frequency or an array of frequencies.\n * @param duration the duration of the note\n * @param time if no time is given, defaults to now\n * @param velocity the velocity of the attack (0-1)\n * @example\n * const poly = new Tone.PolySynth(Tone.AMSynth).toDestination();\n * // can pass in an array of durations as well\n * poly.triggerAttackRelease([\"Eb3\", \"G4\", \"Bb4\", \"D5\"], [4, 3, 2, 1]);\n */\n triggerAttackRelease(notes, duration, time, velocity) {\n const computedTime = this.toSeconds(time);\n this.triggerAttack(notes, computedTime, velocity);\n if (isArray(duration)) {\n assert(isArray(notes), \"If the duration is an array, the notes must also be an array\");\n notes = notes;\n for (let i = 0; i < notes.length; i++) {\n const d = duration[Math.min(i, duration.length - 1)];\n const durationSeconds = this.toSeconds(d);\n assert(durationSeconds > 0, \"The duration must be greater than 0\");\n this.triggerRelease(notes[i], computedTime + durationSeconds);\n }\n }\n else {\n const durationSeconds = this.toSeconds(duration);\n assert(durationSeconds > 0, \"The duration must be greater than 0\");\n this.triggerRelease(notes, computedTime + durationSeconds);\n }\n return this;\n }\n sync() {\n if (this._syncState()) {\n this._syncMethod(\"triggerAttack\", 1);\n this._syncMethod(\"triggerRelease\", 1);\n }\n return this;\n }\n /**\n * Set a member/attribute of the voices\n * @example\n * const poly = new Tone.PolySynth().toDestination();\n * // set all of the voices using an options object for the synth type\n * poly.set({\n * \tenvelope: {\n * \t\tattack: 0.25\n * \t}\n * });\n * poly.triggerAttackRelease(\"Bb3\", 0.2);\n */\n set(options) {\n // remove options which are controlled by the PolySynth\n const sanitizedOptions = omitFromObject(options, [\"onsilence\", \"context\"]);\n // store all of the options\n this.options = deepMerge(this.options, sanitizedOptions);\n this._voices.forEach(voice => voice.set(sanitizedOptions));\n this._dummyVoice.set(sanitizedOptions);\n return this;\n }\n get() {\n return this._dummyVoice.get();\n }\n /**\n * Trigger the release portion of all the currently active voices immediately.\n * Useful for silencing the synth.\n */\n releaseAll(time) {\n const computedTime = this.toSeconds(time);\n this._activeVoices.forEach(({ voice }) => {\n voice.triggerRelease(computedTime);\n });\n return this;\n }\n dispose() {\n super.dispose();\n this._dummyVoice.dispose();\n this._voices.forEach(v => v.dispose());\n this._activeVoices = [];\n this._availableVoices = [];\n this.context.clearInterval(this._gcTimeout);\n return this;\n }\n}\n//# sourceMappingURL=PolySynth.js.map","import { __decorate } from \"tslib\";\nimport { ToneAudioBuffers } from \"../core/context/ToneAudioBuffers\";\nimport { ftomf, intervalToFrequencyRatio } from \"../core/type/Conversions\";\nimport { FrequencyClass } from \"../core/type/Frequency\";\nimport { optionsFromArguments } from \"../core/util/Defaults\";\nimport { noOp } from \"../core/util/Interface\";\nimport { isArray, isNote, isNumber } from \"../core/util/TypeCheck\";\nimport { Instrument } from \"../instrument/Instrument\";\nimport { ToneBufferSource } from \"../source/buffer/ToneBufferSource\";\nimport { timeRange } from \"../core/util/Decorator\";\nimport { assert } from \"../core/util/Debug\";\n/**\n * Pass in an object which maps the note's pitch or midi value to the url,\n * then you can trigger the attack and release of that note like other instruments.\n * By automatically repitching the samples, it is possible to play pitches which\n * were not explicitly included which can save loading time.\n *\n * For sample or buffer playback where repitching is not necessary,\n * use [[Player]].\n * @example\n * const sampler = new Tone.Sampler({\n * \turls: {\n * \t\tA1: \"A1.mp3\",\n * \t\tA2: \"A2.mp3\",\n * \t},\n * \tbaseUrl: \"https://tonejs.github.io/audio/casio/\",\n * \tonload: () => {\n * \t\tsampler.triggerAttackRelease([\"C1\", \"E1\", \"G1\", \"B1\"], 0.5);\n * \t}\n * }).toDestination();\n * @category Instrument\n */\nexport class Sampler extends Instrument {\n constructor() {\n super(optionsFromArguments(Sampler.getDefaults(), arguments, [\"urls\", \"onload\", \"baseUrl\"], \"urls\"));\n this.name = \"Sampler\";\n /**\n * The object of all currently playing BufferSources\n */\n this._activeSources = new Map();\n const options = optionsFromArguments(Sampler.getDefaults(), arguments, [\"urls\", \"onload\", \"baseUrl\"], \"urls\");\n const urlMap = {};\n Object.keys(options.urls).forEach((note) => {\n const noteNumber = parseInt(note, 10);\n assert(isNote(note)\n || (isNumber(noteNumber) && isFinite(noteNumber)), `url key is neither a note or midi pitch: ${note}`);\n if (isNote(note)) {\n // convert the note name to MIDI\n const mid = new FrequencyClass(this.context, note).toMidi();\n urlMap[mid] = options.urls[note];\n }\n else if (isNumber(noteNumber) && isFinite(noteNumber)) {\n // otherwise if it's numbers assume it's midi\n urlMap[noteNumber] = options.urls[noteNumber];\n }\n });\n this._buffers = new ToneAudioBuffers({\n urls: urlMap,\n onload: options.onload,\n baseUrl: options.baseUrl,\n onerror: options.onerror,\n });\n this.attack = options.attack;\n this.release = options.release;\n this.curve = options.curve;\n // invoke the callback if it's already loaded\n if (this._buffers.loaded) {\n // invoke onload deferred\n Promise.resolve().then(options.onload);\n }\n }\n static getDefaults() {\n return Object.assign(Instrument.getDefaults(), {\n attack: 0,\n baseUrl: \"\",\n curve: \"exponential\",\n onload: noOp,\n onerror: noOp,\n release: 0.1,\n urls: {},\n });\n }\n /**\n * Returns the difference in steps between the given midi note at the closets sample.\n */\n _findClosest(midi) {\n // searches within 8 octaves of the given midi note\n const MAX_INTERVAL = 96;\n let interval = 0;\n while (interval < MAX_INTERVAL) {\n // check above and below\n if (this._buffers.has(midi + interval)) {\n return -interval;\n }\n else if (this._buffers.has(midi - interval)) {\n return interval;\n }\n interval++;\n }\n throw new Error(`No available buffers for note: ${midi}`);\n }\n /**\n * @param notes\tThe note to play, or an array of notes.\n * @param time When to play the note\n * @param velocity The velocity to play the sample back.\n */\n triggerAttack(notes, time, velocity = 1) {\n this.log(\"triggerAttack\", notes, time, velocity);\n if (!Array.isArray(notes)) {\n notes = [notes];\n }\n notes.forEach(note => {\n const midiFloat = ftomf(new FrequencyClass(this.context, note).toFrequency());\n const midi = Math.round(midiFloat);\n const remainder = midiFloat - midi;\n // find the closest note pitch\n const difference = this._findClosest(midi);\n const closestNote = midi - difference;\n const buffer = this._buffers.get(closestNote);\n const playbackRate = intervalToFrequencyRatio(difference + remainder);\n // play that note\n const source = new ToneBufferSource({\n url: buffer,\n context: this.context,\n curve: this.curve,\n fadeIn: this.attack,\n fadeOut: this.release,\n playbackRate,\n }).connect(this.output);\n source.start(time, 0, buffer.duration / playbackRate, velocity);\n // add it to the active sources\n if (!isArray(this._activeSources.get(midi))) {\n this._activeSources.set(midi, []);\n }\n this._activeSources.get(midi).push(source);\n // remove it when it's done\n source.onended = () => {\n if (this._activeSources && this._activeSources.has(midi)) {\n const sources = this._activeSources.get(midi);\n const index = sources.indexOf(source);\n if (index !== -1) {\n sources.splice(index, 1);\n }\n }\n };\n });\n return this;\n }\n /**\n * @param notes\tThe note to release, or an array of notes.\n * @param time \tWhen to release the note.\n */\n triggerRelease(notes, time) {\n this.log(\"triggerRelease\", notes, time);\n if (!Array.isArray(notes)) {\n notes = [notes];\n }\n notes.forEach(note => {\n const midi = new FrequencyClass(this.context, note).toMidi();\n // find the note\n if (this._activeSources.has(midi) && this._activeSources.get(midi).length) {\n const sources = this._activeSources.get(midi);\n time = this.toSeconds(time);\n sources.forEach(source => {\n source.stop(time);\n });\n this._activeSources.set(midi, []);\n }\n });\n return this;\n }\n /**\n * Release all currently active notes.\n * @param time \tWhen to release the notes.\n */\n releaseAll(time) {\n const computedTime = this.toSeconds(time);\n this._activeSources.forEach(sources => {\n while (sources.length) {\n const source = sources.shift();\n source.stop(computedTime);\n }\n });\n return this;\n }\n sync() {\n if (this._syncState()) {\n this._syncMethod(\"triggerAttack\", 1);\n this._syncMethod(\"triggerRelease\", 1);\n }\n return this;\n }\n /**\n * Invoke the attack phase, then after the duration, invoke the release.\n * @param notes\tThe note to play and release, or an array of notes.\n * @param duration The time the note should be held\n * @param time When to start the attack\n * @param velocity The velocity of the attack\n */\n triggerAttackRelease(notes, duration, time, velocity = 1) {\n const computedTime = this.toSeconds(time);\n this.triggerAttack(notes, computedTime, velocity);\n if (isArray(duration)) {\n assert(isArray(notes), \"notes must be an array when duration is array\");\n notes.forEach((note, index) => {\n const d = duration[Math.min(index, duration.length - 1)];\n this.triggerRelease(note, computedTime + this.toSeconds(d));\n });\n }\n else {\n this.triggerRelease(notes, computedTime + this.toSeconds(duration));\n }\n return this;\n }\n /**\n * Add a note to the sampler.\n * @param note The buffer's pitch.\n * @param url Either the url of the buffer, or a buffer which will be added with the given name.\n * @param callback The callback to invoke when the url is loaded.\n */\n add(note, url, callback) {\n assert(isNote(note) || isFinite(note), `note must be a pitch or midi: ${note}`);\n if (isNote(note)) {\n // convert the note name to MIDI\n const mid = new FrequencyClass(this.context, note).toMidi();\n this._buffers.add(mid, url, callback);\n }\n else {\n // otherwise if it's numbers assume it's midi\n this._buffers.add(note, url, callback);\n }\n return this;\n }\n /**\n * If the buffers are loaded or not\n */\n get loaded() {\n return this._buffers.loaded;\n }\n /**\n * Clean up\n */\n dispose() {\n super.dispose();\n this._buffers.dispose();\n this._activeSources.forEach(sources => {\n sources.forEach(source => source.dispose());\n });\n this._activeSources.clear();\n return this;\n }\n}\n__decorate([\n timeRange(0)\n], Sampler.prototype, \"attack\", void 0);\n__decorate([\n timeRange(0)\n], Sampler.prototype, \"release\", void 0);\n//# sourceMappingURL=Sampler.js.map","import { Loop } from \"./Loop\";\nimport { PatternGenerator } from \"./PatternGenerator\";\nimport { optionsFromArguments } from \"../core/util/Defaults\";\nimport { noOp } from \"../core/util/Interface\";\n/**\n * Pattern arpeggiates between the given notes\n * in a number of patterns.\n * @example\n * const pattern = new Tone.Pattern((time, note) => {\n * \t// the order of the notes passed in depends on the pattern\n * }, [\"C2\", \"D4\", \"E5\", \"A6\"], \"upDown\");\n * @category Event\n */\nexport class Pattern extends Loop {\n constructor() {\n super(optionsFromArguments(Pattern.getDefaults(), arguments, [\"callback\", \"values\", \"pattern\"]));\n this.name = \"Pattern\";\n const options = optionsFromArguments(Pattern.getDefaults(), arguments, [\"callback\", \"values\", \"pattern\"]);\n this.callback = options.callback;\n this._values = options.values;\n this._pattern = PatternGenerator(options.values, options.pattern);\n this._type = options.pattern;\n }\n static getDefaults() {\n return Object.assign(Loop.getDefaults(), {\n pattern: \"up\",\n values: [],\n callback: noOp,\n });\n }\n /**\n * Internal function called when the notes should be called\n */\n _tick(time) {\n const value = this._pattern.next();\n this._value = value.value;\n this.callback(time, this._value);\n }\n /**\n * The array of events.\n */\n get values() {\n return this._values;\n }\n set values(val) {\n this._values = val;\n // reset the pattern\n this.pattern = this._type;\n }\n /**\n * The current value of the pattern.\n */\n get value() {\n return this._value;\n }\n /**\n * The pattern type. See Tone.CtrlPattern for the full list of patterns.\n */\n get pattern() {\n return this._type;\n }\n set pattern(pattern) {\n this._type = pattern;\n this._pattern = PatternGenerator(this._values, this._type);\n }\n}\n//# sourceMappingURL=Pattern.js.map","import { Param } from \"../../core/context/Param\";\nimport { ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\nimport { readOnly } from \"../../core/util/Interface\";\n/**\n * Panner is an equal power Left/Right Panner. It is a wrapper around the StereoPannerNode.\n * @example\n * return Tone.Offline(() => {\n * // move the input signal from right to left\n * \tconst panner = new Tone.Panner(1).toDestination();\n * \tpanner.pan.rampTo(-1, 0.5);\n * \tconst osc = new Tone.Oscillator(100).connect(panner).start();\n * }, 0.5, 2);\n * @category Component\n */\nexport class Panner extends ToneAudioNode {\n constructor() {\n super(Object.assign(optionsFromArguments(Panner.getDefaults(), arguments, [\"pan\"])));\n this.name = \"Panner\";\n /**\n * the panner node\n */\n this._panner = this.context.createStereoPanner();\n this.input = this._panner;\n this.output = this._panner;\n const options = optionsFromArguments(Panner.getDefaults(), arguments, [\"pan\"]);\n this.pan = new Param({\n context: this.context,\n param: this._panner.pan,\n value: options.pan,\n minValue: -1,\n maxValue: 1,\n });\n // this is necessary for standardized-audio-context\n // doesn't make any difference for the native AudioContext\n // https://github.com/chrisguttandin/standardized-audio-context/issues/647\n this._panner.channelCount = options.channelCount;\n this._panner.channelCountMode = \"explicit\";\n // initial value\n readOnly(this, \"pan\");\n }\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n pan: 0,\n channelCount: 1,\n });\n }\n dispose() {\n super.dispose();\n this._panner.disconnect();\n this.pan.dispose();\n return this;\n }\n}\n//# sourceMappingURL=Panner.js.map","import \"../core/worklet/SingleIOProcessor.worklet\";\nimport { registerProcessor } from \"../core/worklet/WorkletGlobalScope\";\nexport const workletName = \"bit-crusher\";\nexport const bitCrusherWorklet = /* javascript */ `\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n`;\nregisterProcessor(workletName, bitCrusherWorklet);\n//# sourceMappingURL=BitCrusher.worklet.js.map","import { ToneAudioWorklet } from \"../core/worklet/ToneAudioWorklet\";\nimport { Effect } from \"./Effect\";\nimport { Gain } from \"../core/context/Gain\";\nimport { optionsFromArguments } from \"../core/util/Defaults\";\nimport { connectSeries } from \"../core/context/ToneAudioNode\";\nimport { Param } from \"../core/context/Param\";\nimport { workletName } from \"./BitCrusher.worklet\";\n/**\n * BitCrusher down-samples the incoming signal to a different bit depth.\n * Lowering the bit depth of the signal creates distortion. Read more about BitCrushing\n * on [Wikipedia](https://en.wikipedia.org/wiki/Bitcrusher).\n * @example\n * // initialize crusher and route a synth through it\n * const crusher = new Tone.BitCrusher(4).toDestination();\n * const synth = new Tone.Synth().connect(crusher);\n * synth.triggerAttackRelease(\"C2\", 2);\n *\n * @category Effect\n */\nexport class BitCrusher extends Effect {\n constructor() {\n super(optionsFromArguments(BitCrusher.getDefaults(), arguments, [\"bits\"]));\n this.name = \"BitCrusher\";\n const options = optionsFromArguments(BitCrusher.getDefaults(), arguments, [\"bits\"]);\n this._bitCrusherWorklet = new BitCrusherWorklet({\n context: this.context,\n bits: options.bits,\n });\n // connect it up\n this.connectEffect(this._bitCrusherWorklet);\n this.bits = this._bitCrusherWorklet.bits;\n }\n static getDefaults() {\n return Object.assign(Effect.getDefaults(), {\n bits: 4,\n });\n }\n dispose() {\n super.dispose();\n this._bitCrusherWorklet.dispose();\n return this;\n }\n}\n/**\n * Internal class which creates an AudioWorklet to do the bit crushing\n */\nclass BitCrusherWorklet extends ToneAudioWorklet {\n constructor() {\n super(optionsFromArguments(BitCrusherWorklet.getDefaults(), arguments));\n this.name = \"BitCrusherWorklet\";\n const options = optionsFromArguments(BitCrusherWorklet.getDefaults(), arguments);\n this.input = new Gain({ context: this.context });\n this.output = new Gain({ context: this.context });\n this.bits = new Param({\n context: this.context,\n value: options.bits,\n units: \"positive\",\n minValue: 1,\n maxValue: 16,\n param: this._dummyParam,\n swappable: true,\n });\n }\n static getDefaults() {\n return Object.assign(ToneAudioWorklet.getDefaults(), {\n bits: 12,\n });\n }\n _audioWorkletName() {\n return workletName;\n }\n onReady(node) {\n connectSeries(this.input, node, this.output);\n const bits = node.parameters.get(\"bits\");\n this.bits.setParam(bits);\n }\n dispose() {\n super.dispose();\n this.input.dispose();\n this.output.dispose();\n this.bits.dispose();\n return this;\n }\n}\n//# sourceMappingURL=BitCrusher.js.map","import { Gain } from \"../../core/context/Gain\";\nimport { ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\n/**\n * Solo lets you isolate a specific audio stream. When an instance is set to `solo=true`,\n * it will mute all other instances of Solo.\n * @example\n * const soloA = new Tone.Solo().toDestination();\n * const oscA = new Tone.Oscillator(\"C4\", \"sawtooth\").connect(soloA);\n * const soloB = new Tone.Solo().toDestination();\n * const oscB = new Tone.Oscillator(\"E4\", \"square\").connect(soloB);\n * soloA.solo = true;\n * // no audio will pass through soloB\n * @category Component\n */\nexport class Solo extends ToneAudioNode {\n constructor() {\n super(optionsFromArguments(Solo.getDefaults(), arguments, [\"solo\"]));\n this.name = \"Solo\";\n const options = optionsFromArguments(Solo.getDefaults(), arguments, [\"solo\"]);\n this.input = this.output = new Gain({\n context: this.context,\n });\n if (!Solo._allSolos.has(this.context)) {\n Solo._allSolos.set(this.context, new Set());\n }\n Solo._allSolos.get(this.context).add(this);\n // set initially\n this.solo = options.solo;\n }\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n solo: false,\n });\n }\n /**\n * Isolates this instance and mutes all other instances of Solo.\n * Only one instance can be soloed at a time. A soloed\n * instance will report `solo=false` when another instance is soloed.\n */\n get solo() {\n return this._isSoloed();\n }\n set solo(solo) {\n if (solo) {\n this._addSolo();\n }\n else {\n this._removeSolo();\n }\n Solo._allSolos.get(this.context).forEach(instance => instance._updateSolo());\n }\n /**\n * If the current instance is muted, i.e. another instance is soloed\n */\n get muted() {\n return this.input.gain.value === 0;\n }\n /**\n * Add this to the soloed array\n */\n _addSolo() {\n if (!Solo._soloed.has(this.context)) {\n Solo._soloed.set(this.context, new Set());\n }\n Solo._soloed.get(this.context).add(this);\n }\n /**\n * Remove this from the soloed array\n */\n _removeSolo() {\n if (Solo._soloed.has(this.context)) {\n Solo._soloed.get(this.context).delete(this);\n }\n }\n /**\n * Is this on the soloed array\n */\n _isSoloed() {\n return Solo._soloed.has(this.context) && Solo._soloed.get(this.context).has(this);\n }\n /**\n * Returns true if no one is soloed\n */\n _noSolos() {\n // either does not have any soloed added\n return !Solo._soloed.has(this.context) ||\n // or has a solo set but doesn't include any items\n (Solo._soloed.has(this.context) && Solo._soloed.get(this.context).size === 0);\n }\n /**\n * Solo the current instance and unsolo all other instances.\n */\n _updateSolo() {\n if (this._isSoloed()) {\n this.input.gain.value = 1;\n }\n else if (this._noSolos()) {\n // no one is soloed\n this.input.gain.value = 1;\n }\n else {\n this.input.gain.value = 0;\n }\n }\n dispose() {\n super.dispose();\n Solo._allSolos.get(this.context).delete(this);\n this._removeSolo();\n return this;\n }\n}\n/**\n * Hold all of the solo'ed tracks belonging to a specific context\n */\nSolo._allSolos = new Map();\n/**\n * Hold the currently solo'ed instance(s)\n */\nSolo._soloed = new Map();\n//# sourceMappingURL=Solo.js.map","import { readOnly } from \"../../core/util/Interface\";\nimport { ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\nimport { Panner } from \"./Panner\";\nimport { Volume } from \"./Volume\";\n/**\n * PanVol is a Tone.Panner and Tone.Volume in one.\n * @example\n * // pan the incoming signal left and drop the volume\n * const panVol = new Tone.PanVol(-0.25, -12).toDestination();\n * const osc = new Tone.Oscillator().connect(panVol).start();\n * @category Component\n */\nexport class PanVol extends ToneAudioNode {\n constructor() {\n super(optionsFromArguments(PanVol.getDefaults(), arguments, [\"pan\", \"volume\"]));\n this.name = \"PanVol\";\n const options = optionsFromArguments(PanVol.getDefaults(), arguments, [\"pan\", \"volume\"]);\n this._panner = this.input = new Panner({\n context: this.context,\n pan: options.pan,\n channelCount: options.channelCount,\n });\n this.pan = this._panner.pan;\n this._volume = this.output = new Volume({\n context: this.context,\n volume: options.volume,\n });\n this.volume = this._volume.volume;\n // connections\n this._panner.connect(this._volume);\n this.mute = options.mute;\n readOnly(this, [\"pan\", \"volume\"]);\n }\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n mute: false,\n pan: 0,\n volume: 0,\n channelCount: 1,\n });\n }\n /**\n * Mute/unmute the volume\n */\n get mute() {\n return this._volume.mute;\n }\n set mute(mute) {\n this._volume.mute = mute;\n }\n dispose() {\n super.dispose();\n this._panner.dispose();\n this.pan.dispose();\n this._volume.dispose();\n this.volume.dispose();\n return this;\n }\n}\n//# sourceMappingURL=PanVol.js.map","import { ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\nimport { Solo } from \"./Solo\";\nimport { PanVol } from \"./PanVol\";\nimport { readOnly } from \"../../core/util/Interface\";\nimport { Gain } from \"../../core/context/Gain\";\n/**\n * Channel provides a channel strip interface with volume, pan, solo and mute controls.\n * See [[PanVol]] and [[Solo]]\n * @example\n * // pan the incoming signal left and drop the volume 12db\n * const channel = new Tone.Channel(-0.25, -12);\n * @category Component\n */\nexport class Channel extends ToneAudioNode {\n constructor() {\n super(optionsFromArguments(Channel.getDefaults(), arguments, [\"volume\", \"pan\"]));\n this.name = \"Channel\";\n const options = optionsFromArguments(Channel.getDefaults(), arguments, [\"volume\", \"pan\"]);\n this._solo = this.input = new Solo({\n solo: options.solo,\n context: this.context,\n });\n this._panVol = this.output = new PanVol({\n context: this.context,\n pan: options.pan,\n volume: options.volume,\n mute: options.mute,\n channelCount: options.channelCount\n });\n this.pan = this._panVol.pan;\n this.volume = this._panVol.volume;\n this._solo.connect(this._panVol);\n readOnly(this, [\"pan\", \"volume\"]);\n }\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n pan: 0,\n volume: 0,\n mute: false,\n solo: false,\n channelCount: 1,\n });\n }\n /**\n * Solo/unsolo the channel. Soloing is only relative to other [[Channels]] and [[Solo]] instances\n */\n get solo() {\n return this._solo.solo;\n }\n set solo(solo) {\n this._solo.solo = solo;\n }\n /**\n * If the current instance is muted, i.e. another instance is soloed,\n * or the channel is muted\n */\n get muted() {\n return this._solo.muted || this.mute;\n }\n /**\n * Mute/unmute the volume\n */\n get mute() {\n return this._panVol.mute;\n }\n set mute(mute) {\n this._panVol.mute = mute;\n }\n /**\n * Get the gain node belonging to the bus name. Create it if\n * it doesn't exist\n * @param name The bus name\n */\n _getBus(name) {\n if (!Channel.buses.has(name)) {\n Channel.buses.set(name, new Gain({ context: this.context }));\n }\n return Channel.buses.get(name);\n }\n /**\n * Send audio to another channel using a string. `send` is a lot like\n * [[connect]], except it uses a string instead of an object. This can\n * be useful in large applications to decouple sections since [[send]]\n * and [[receive]] can be invoked separately in order to connect an object\n * @param name The channel name to send the audio\n * @param volume The amount of the signal to send.\n * \tDefaults to 0db, i.e. send the entire signal\n * @returns Returns the gain node of this connection.\n */\n send(name, volume = 0) {\n const bus = this._getBus(name);\n const sendKnob = new Gain({\n context: this.context,\n units: \"decibels\",\n gain: volume,\n });\n this.connect(sendKnob);\n sendKnob.connect(bus);\n return sendKnob;\n }\n /**\n * Receive audio from a channel which was connected with [[send]].\n * @param name The channel name to receive audio from.\n */\n receive(name) {\n const bus = this._getBus(name);\n bus.connect(this);\n return this;\n }\n dispose() {\n super.dispose();\n this._panVol.dispose();\n this.pan.dispose();\n this.volume.dispose();\n this._solo.dispose();\n return this;\n }\n}\n/**\n * Store the send/receive channels by name.\n */\nChannel.buses = new Map();\n//# sourceMappingURL=Channel.js.map","import { Gain } from \"../../core/context/Gain\";\nimport { ToneAudioNode } from \"../../core/context/ToneAudioNode\";\nimport { optionsFromArguments } from \"../../core/util/Defaults\";\nimport { Merge } from \"./Merge\";\n/**\n * Mono coerces the incoming mono or stereo signal into a mono signal\n * where both left and right channels have the same value. This can be useful\n * for [stereo imaging](https://en.wikipedia.org/wiki/Stereo_imaging).\n * @category Component\n */\nexport class Mono extends ToneAudioNode {\n constructor() {\n super(optionsFromArguments(Mono.getDefaults(), arguments));\n this.name = \"Mono\";\n this.input = new Gain({ context: this.context });\n this._merge = this.output = new Merge({\n channels: 2,\n context: this.context,\n });\n this.input.connect(this._merge, 0, 0);\n this.input.connect(this._merge, 0, 1);\n }\n dispose() {\n super.dispose();\n this._merge.dispose();\n this.input.dispose();\n return this;\n }\n}\n//# sourceMappingURL=Mono.js.map","import { ToneAudioNode } from \"./ToneAudioNode\";\nimport { Param } from \"./Param\";\nimport { onContextClose, onContextInit } from \"./ContextInitialization\";\n/**\n * Tone.Listener is a thin wrapper around the AudioListener. Listener combined\n * with [[Panner3D]] makes up the Web Audio API's 3D panning system. Panner3D allows you\n * to place sounds in 3D and Listener allows you to navigate the 3D sound environment from\n * a first-person perspective. There is only one listener per audio context.\n */\nexport class Listener extends ToneAudioNode {\n constructor() {\n super(...arguments);\n this.name = \"Listener\";\n this.positionX = new Param({\n context: this.context,\n param: this.context.rawContext.listener.positionX,\n });\n this.positionY = new Param({\n context: this.context,\n param: this.context.rawContext.listener.positionY,\n });\n this.positionZ = new Param({\n context: this.context,\n param: this.context.rawContext.listener.positionZ,\n });\n this.forwardX = new Param({\n context: this.context,\n param: this.context.rawContext.listener.forwardX,\n });\n this.forwardY = new Param({\n context: this.context,\n param: this.context.rawContext.listener.forwardY,\n });\n this.forwardZ = new Param({\n context: this.context,\n param: this.context.rawContext.listener.forwardZ,\n });\n this.upX = new Param({\n context: this.context,\n param: this.context.rawContext.listener.upX,\n });\n this.upY = new Param({\n context: this.context,\n param: this.context.rawContext.listener.upY,\n });\n this.upZ = new Param({\n context: this.context,\n param: this.context.rawContext.listener.upZ,\n });\n }\n static getDefaults() {\n return Object.assign(ToneAudioNode.getDefaults(), {\n positionX: 0,\n positionY: 0,\n positionZ: 0,\n forwardX: 0,\n forwardY: 0,\n forwardZ: -1,\n upX: 0,\n upY: 1,\n upZ: 0,\n });\n }\n dispose() {\n super.dispose();\n this.positionX.dispose();\n this.positionY.dispose();\n this.positionZ.dispose();\n this.forwardX.dispose();\n this.forwardY.dispose();\n this.forwardZ.dispose();\n this.upX.dispose();\n this.upY.dispose();\n this.upZ.dispose();\n return this;\n }\n}\n//-------------------------------------\n// \tINITIALIZATION\n//-------------------------------------\nonContextInit(context => {\n context.listener = new Listener({ context });\n});\nonContextClose(context => {\n context.listener.dispose();\n});\n//# sourceMappingURL=Listener.js.map","export { getContext, setContext } from \"./core/Global\";\nexport * from \"./classes\";\nexport * from \"./version\";\nimport { getContext } from \"./core/Global\";\nimport { ToneAudioBuffer } from \"./core/context/ToneAudioBuffer\";\nexport { start } from \"./core/Global\";\nexport { supported } from \"./core/context/AudioContext\";\n/**\n * The current audio context time of the global [[Context]].\n * See [[Context.now]]\n * @category Core\n */\nexport function now() {\n return getContext().now();\n}\n/**\n * The current audio context time of the global [[Context]] without the [[Context.lookAhead]]\n * See [[Context.immediate]]\n * @category Core\n */\nexport function immediate() {\n return getContext().immediate();\n}\n/**\n * The Transport object belonging to the global Tone.js Context.\n * See [[Transport]]\n * @category Core\n */\nexport const Transport = getContext().transport;\n/**\n * The Transport object belonging to the global Tone.js Context.\n * See [[Transport]]\n * @category Core\n */\nexport function getTransport() {\n return getContext().transport;\n}\n/**\n * The Destination (output) belonging to the global Tone.js Context.\n * See [[Destination]]\n * @category Core\n */\nexport const Destination = getContext().destination;\n/**\n * @deprecated Use [[Destination]]\n */\nexport const Master = getContext().destination;\n/**\n * The Destination (output) belonging to the global Tone.js Context.\n * See [[Destination]]\n * @category Core\n */\nexport function getDestination() {\n return getContext().destination;\n}\n/**\n * The [[Listener]] belonging to the global Tone.js Context.\n * @category Core\n */\nexport const Listener = getContext().listener;\n/**\n * The [[Listener]] belonging to the global Tone.js Context.\n * @category Core\n */\nexport function getListener() {\n return getContext().listener;\n}\n/**\n * Draw is used to synchronize the draw frame with the Transport's callbacks.\n * See [[Draw]]\n * @category Core\n */\nexport const Draw = getContext().draw;\n/**\n * Get the singleton attached to the global context.\n * Draw is used to synchronize the draw frame with the Transport's callbacks.\n * See [[Draw]]\n * @category Core\n */\nexport function getDraw() {\n return getContext().draw;\n}\n/**\n * A reference to the global context\n * See [[Context]]\n */\nexport const context = getContext();\n/**\n * Promise which resolves when all of the loading promises are resolved.\n * Alias for static [[ToneAudioBuffer.loaded]] method.\n * @category Core\n */\nexport function loaded() {\n return ToneAudioBuffer.loaded();\n}\n// this fills in name changes from 13.x to 14.x\nimport { ToneAudioBuffers } from \"./core/context/ToneAudioBuffers\";\nimport { ToneBufferSource } from \"./source/buffer/ToneBufferSource\";\nexport const Buffer = ToneAudioBuffer;\nexport const Buffers = ToneAudioBuffers;\nexport const BufferSource = ToneBufferSource;\n//# sourceMappingURL=index.js.map","import assign from 'object-assign';\nexport var merge = function merge(a, b) {\n var result = assign({}, a, b);\n\n for (var key in a) {\n var _assign;\n\n if (!a[key] || typeof b[key] !== 'object') continue;\n assign(result, (_assign = {}, _assign[key] = assign(a[key], b[key]), _assign));\n }\n\n return result;\n}; // sort object-value responsive styles\n\nvar sort = function sort(obj) {\n var next = {};\n Object.keys(obj).sort(function (a, b) {\n return a.localeCompare(b, undefined, {\n numeric: true,\n sensitivity: 'base'\n });\n }).forEach(function (key) {\n next[key] = obj[key];\n });\n return next;\n};\n\nvar defaults = {\n breakpoints: [40, 52, 64].map(function (n) {\n return n + 'em';\n })\n};\n\nvar createMediaQuery = function createMediaQuery(n) {\n return \"@media screen and (min-width: \" + n + \")\";\n};\n\nvar getValue = function getValue(n, scale) {\n return get(scale, n, n);\n};\n\nexport var get = function get(obj, key, def, p, undef) {\n key = key && key.split ? key.split('.') : [key];\n\n for (p = 0; p < key.length; p++) {\n obj = obj ? obj[key[p]] : undef;\n }\n\n return obj === undef ? def : obj;\n};\nexport var createParser = function createParser(config) {\n var cache = {};\n\n var parse = function parse(props) {\n var styles = {};\n var shouldSort = false;\n var isCacheDisabled = props.theme && props.theme.disableStyledSystemCache;\n\n for (var key in props) {\n if (!config[key]) continue;\n var sx = config[key];\n var raw = props[key];\n var scale = get(props.theme, sx.scale, sx.defaults);\n\n if (typeof raw === 'object') {\n cache.breakpoints = !isCacheDisabled && cache.breakpoints || get(props.theme, 'breakpoints', defaults.breakpoints);\n\n if (Array.isArray(raw)) {\n cache.media = !isCacheDisabled && cache.media || [null].concat(cache.breakpoints.map(createMediaQuery));\n styles = merge(styles, parseResponsiveStyle(cache.media, sx, scale, raw, props));\n continue;\n }\n\n if (raw !== null) {\n styles = merge(styles, parseResponsiveObject(cache.breakpoints, sx, scale, raw, props));\n shouldSort = true;\n }\n\n continue;\n }\n\n assign(styles, sx(raw, scale, props));\n } // sort object-based responsive styles\n\n\n if (shouldSort) {\n styles = sort(styles);\n }\n\n return styles;\n };\n\n parse.config = config;\n parse.propNames = Object.keys(config);\n parse.cache = cache;\n var keys = Object.keys(config).filter(function (k) {\n return k !== 'config';\n });\n\n if (keys.length > 1) {\n keys.forEach(function (key) {\n var _createParser;\n\n parse[key] = createParser((_createParser = {}, _createParser[key] = config[key], _createParser));\n });\n }\n\n return parse;\n};\n\nvar parseResponsiveStyle = function parseResponsiveStyle(mediaQueries, sx, scale, raw, _props) {\n var styles = {};\n raw.slice(0, mediaQueries.length).forEach(function (value, i) {\n var media = mediaQueries[i];\n var style = sx(value, scale, _props);\n\n if (!media) {\n assign(styles, style);\n } else {\n var _assign2;\n\n assign(styles, (_assign2 = {}, _assign2[media] = assign({}, styles[media], style), _assign2));\n }\n });\n return styles;\n};\n\nvar parseResponsiveObject = function parseResponsiveObject(breakpoints, sx, scale, raw, _props) {\n var styles = {};\n\n for (var key in raw) {\n var breakpoint = breakpoints[key];\n var value = raw[key];\n var style = sx(value, scale, _props);\n\n if (!breakpoint) {\n assign(styles, style);\n } else {\n var _assign3;\n\n var media = createMediaQuery(breakpoint);\n assign(styles, (_assign3 = {}, _assign3[media] = assign({}, styles[media], style), _assign3));\n }\n }\n\n return styles;\n};\n\nexport var createStyleFunction = function createStyleFunction(_ref) {\n var properties = _ref.properties,\n property = _ref.property,\n scale = _ref.scale,\n _ref$transform = _ref.transform,\n transform = _ref$transform === void 0 ? getValue : _ref$transform,\n defaultScale = _ref.defaultScale;\n properties = properties || [property];\n\n var sx = function sx(value, scale, _props) {\n var result = {};\n var n = transform(value, scale, _props);\n if (n === null) return;\n properties.forEach(function (prop) {\n result[prop] = n;\n });\n return result;\n };\n\n sx.scale = scale;\n sx.defaults = defaultScale;\n return sx;\n}; // new v5 API\n\nexport var system = function system(args) {\n if (args === void 0) {\n args = {};\n }\n\n var config = {};\n Object.keys(args).forEach(function (key) {\n var conf = args[key];\n\n if (conf === true) {\n // shortcut definition\n config[key] = createStyleFunction({\n property: key,\n scale: key\n });\n return;\n }\n\n if (typeof conf === 'function') {\n config[key] = conf;\n return;\n }\n\n config[key] = createStyleFunction(conf);\n });\n var parser = createParser(config);\n return parser;\n};\nexport var compose = function compose() {\n var config = {};\n\n for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {\n parsers[_key] = arguments[_key];\n }\n\n parsers.forEach(function (parser) {\n if (!parser || !parser.config) return;\n assign(config, parser.config);\n });\n var parser = createParser(config);\n return parser;\n};\n","import { system, get } from '@styled-system/core';\n\nvar isNumber = function isNumber(n) {\n return typeof n === 'number' && !isNaN(n);\n};\n\nvar getWidth = function getWidth(n, scale) {\n return get(scale, n, !isNumber(n) || n > 1 ? n : n * 100 + '%');\n};\n\nvar config = {\n width: {\n property: 'width',\n scale: 'sizes',\n transform: getWidth\n },\n height: {\n property: 'height',\n scale: 'sizes'\n },\n minWidth: {\n property: 'minWidth',\n scale: 'sizes'\n },\n minHeight: {\n property: 'minHeight',\n scale: 'sizes'\n },\n maxWidth: {\n property: 'maxWidth',\n scale: 'sizes'\n },\n maxHeight: {\n property: 'maxHeight',\n scale: 'sizes'\n },\n size: {\n properties: ['width', 'height'],\n scale: 'sizes'\n },\n overflow: true,\n overflowX: true,\n overflowY: true,\n display: true,\n verticalAlign: true\n};\nexport var layout = system(config);\nexport default layout;\n","import { system } from '@styled-system/core';\nvar config = {\n color: {\n property: 'color',\n scale: 'colors'\n },\n backgroundColor: {\n property: 'backgroundColor',\n scale: 'colors'\n },\n opacity: true\n};\nconfig.bg = config.backgroundColor;\nexport var color = system(config);\nexport default color;\n","import { system } from '@styled-system/core';\nvar defaults = {\n fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]\n};\nvar config = {\n fontFamily: {\n property: 'fontFamily',\n scale: 'fonts'\n },\n fontSize: {\n property: 'fontSize',\n scale: 'fontSizes',\n defaultScale: defaults.fontSizes\n },\n fontWeight: {\n property: 'fontWeight',\n scale: 'fontWeights'\n },\n lineHeight: {\n property: 'lineHeight',\n scale: 'lineHeights'\n },\n letterSpacing: {\n property: 'letterSpacing',\n scale: 'letterSpacings'\n },\n textAlign: true,\n fontStyle: true\n};\nexport var typography = system(config);\nexport default typography;\n","import { system } from '@styled-system/core';\nvar config = {\n alignItems: true,\n alignContent: true,\n justifyItems: true,\n justifyContent: true,\n flexWrap: true,\n flexDirection: true,\n // item\n flex: true,\n flexGrow: true,\n flexShrink: true,\n flexBasis: true,\n justifySelf: true,\n alignSelf: true,\n order: true\n};\nexport var flexbox = system(config);\nexport default flexbox;\n","import { system } from '@styled-system/core';\nvar defaults = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512]\n};\nvar config = {\n gridGap: {\n property: 'gridGap',\n scale: 'space',\n defaultScale: defaults.space\n },\n gridColumnGap: {\n property: 'gridColumnGap',\n scale: 'space',\n defaultScale: defaults.space\n },\n gridRowGap: {\n property: 'gridRowGap',\n scale: 'space',\n defaultScale: defaults.space\n },\n gridColumn: true,\n gridRow: true,\n gridAutoFlow: true,\n gridAutoColumns: true,\n gridAutoRows: true,\n gridTemplateColumns: true,\n gridTemplateRows: true,\n gridTemplateAreas: true,\n gridArea: true\n};\nexport var grid = system(config);\nexport default grid;\n","import { system } from '@styled-system/core';\nvar config = {\n border: {\n property: 'border',\n scale: 'borders'\n },\n borderWidth: {\n property: 'borderWidth',\n scale: 'borderWidths'\n },\n borderStyle: {\n property: 'borderStyle',\n scale: 'borderStyles'\n },\n borderColor: {\n property: 'borderColor',\n scale: 'colors'\n },\n borderRadius: {\n property: 'borderRadius',\n scale: 'radii'\n },\n borderTop: {\n property: 'borderTop',\n scale: 'borders'\n },\n borderTopLeftRadius: {\n property: 'borderTopLeftRadius',\n scale: 'radii'\n },\n borderTopRightRadius: {\n property: 'borderTopRightRadius',\n scale: 'radii'\n },\n borderRight: {\n property: 'borderRight',\n scale: 'borders'\n },\n borderBottom: {\n property: 'borderBottom',\n scale: 'borders'\n },\n borderBottomLeftRadius: {\n property: 'borderBottomLeftRadius',\n scale: 'radii'\n },\n borderBottomRightRadius: {\n property: 'borderBottomRightRadius',\n scale: 'radii'\n },\n borderLeft: {\n property: 'borderLeft',\n scale: 'borders'\n },\n borderX: {\n properties: ['borderLeft', 'borderRight'],\n scale: 'borders'\n },\n borderY: {\n properties: ['borderTop', 'borderBottom'],\n scale: 'borders'\n }\n};\nconfig.borderTopWidth = {\n property: 'borderTopWidth',\n scale: 'borderWidths'\n};\nconfig.borderTopColor = {\n property: 'borderTopColor',\n scale: 'colors'\n};\nconfig.borderTopStyle = {\n property: 'borderTopStyle',\n scale: 'borderStyles'\n};\nconfig.borderTopLeftRadius = {\n property: 'borderTopLeftRadius',\n scale: 'radii'\n};\nconfig.borderTopRightRadius = {\n property: 'borderTopRightRadius',\n scale: 'radii'\n};\nconfig.borderBottomWidth = {\n property: 'borderBottomWidth',\n scale: 'borderWidths'\n};\nconfig.borderBottomColor = {\n property: 'borderBottomColor',\n scale: 'colors'\n};\nconfig.borderBottomStyle = {\n property: 'borderBottomStyle',\n scale: 'borderStyles'\n};\nconfig.borderBottomLeftRadius = {\n property: 'borderBottomLeftRadius',\n scale: 'radii'\n};\nconfig.borderBottomRightRadius = {\n property: 'borderBottomRightRadius',\n scale: 'radii'\n};\nconfig.borderLeftWidth = {\n property: 'borderLeftWidth',\n scale: 'borderWidths'\n};\nconfig.borderLeftColor = {\n property: 'borderLeftColor',\n scale: 'colors'\n};\nconfig.borderLeftStyle = {\n property: 'borderLeftStyle',\n scale: 'borderStyles'\n};\nconfig.borderRightWidth = {\n property: 'borderRightWidth',\n scale: 'borderWidths'\n};\nconfig.borderRightColor = {\n property: 'borderRightColor',\n scale: 'colors'\n};\nconfig.borderRightStyle = {\n property: 'borderRightStyle',\n scale: 'borderStyles'\n};\nexport var border = system(config);\nexport default border;\n","import { system } from '@styled-system/core';\nvar config = {\n background: true,\n backgroundImage: true,\n backgroundSize: true,\n backgroundPosition: true,\n backgroundRepeat: true\n};\nconfig.bgImage = config.backgroundImage;\nconfig.bgSize = config.backgroundSize;\nconfig.bgPosition = config.backgroundPosition;\nconfig.bgRepeat = config.backgroundRepeat;\nexport var background = system(config);\nexport default background;\n","import { system } from '@styled-system/core';\nvar defaults = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512]\n};\nvar config = {\n position: true,\n zIndex: {\n property: 'zIndex',\n scale: 'zIndices'\n },\n top: {\n property: 'top',\n scale: 'space',\n defaultScale: defaults.space\n },\n right: {\n property: 'right',\n scale: 'space',\n defaultScale: defaults.space\n },\n bottom: {\n property: 'bottom',\n scale: 'space',\n defaultScale: defaults.space\n },\n left: {\n property: 'left',\n scale: 'space',\n defaultScale: defaults.space\n }\n};\nexport var position = system(config);\nexport default position;\n","import { get, system, compose } from '@styled-system/core';\nvar defaults = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512]\n};\n\nvar isNumber = function isNumber(n) {\n return typeof n === 'number' && !isNaN(n);\n};\n\nvar getMargin = function getMargin(n, scale) {\n if (!isNumber(n)) {\n return get(scale, n, n);\n }\n\n var isNegative = n < 0;\n var absolute = Math.abs(n);\n var value = get(scale, absolute, absolute);\n\n if (!isNumber(value)) {\n return isNegative ? '-' + value : value;\n }\n\n return value * (isNegative ? -1 : 1);\n};\n\nvar configs = {};\nconfigs.margin = {\n margin: {\n property: 'margin',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginTop: {\n property: 'marginTop',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginRight: {\n property: 'marginRight',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginBottom: {\n property: 'marginBottom',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginLeft: {\n property: 'marginLeft',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginX: {\n properties: ['marginLeft', 'marginRight'],\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginY: {\n properties: ['marginTop', 'marginBottom'],\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n }\n};\nconfigs.margin.m = configs.margin.margin;\nconfigs.margin.mt = configs.margin.marginTop;\nconfigs.margin.mr = configs.margin.marginRight;\nconfigs.margin.mb = configs.margin.marginBottom;\nconfigs.margin.ml = configs.margin.marginLeft;\nconfigs.margin.mx = configs.margin.marginX;\nconfigs.margin.my = configs.margin.marginY;\nconfigs.padding = {\n padding: {\n property: 'padding',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingTop: {\n property: 'paddingTop',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingRight: {\n property: 'paddingRight',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingBottom: {\n property: 'paddingBottom',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingLeft: {\n property: 'paddingLeft',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingX: {\n properties: ['paddingLeft', 'paddingRight'],\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingY: {\n properties: ['paddingTop', 'paddingBottom'],\n scale: 'space',\n defaultScale: defaults.space\n }\n};\nconfigs.padding.p = configs.padding.padding;\nconfigs.padding.pt = configs.padding.paddingTop;\nconfigs.padding.pr = configs.padding.paddingRight;\nconfigs.padding.pb = configs.padding.paddingBottom;\nconfigs.padding.pl = configs.padding.paddingLeft;\nconfigs.padding.px = configs.padding.paddingX;\nconfigs.padding.py = configs.padding.paddingY;\nexport var margin = system(configs.margin);\nexport var padding = system(configs.padding);\nexport var space = compose(margin, padding);\nexport default space;\n","import { system } from '@styled-system/core';\nexport var shadow = system({\n boxShadow: {\n property: 'boxShadow',\n scale: 'shadows'\n },\n textShadow: {\n property: 'textShadow',\n scale: 'shadows'\n }\n});\nexport default shadow;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n// based on https://github.com/developit/dlv\nexport var get = function get(obj, key, def, p, undef) {\n key = key && key.split ? key.split('.') : [key];\n\n for (p = 0; p < key.length; p++) {\n obj = obj ? obj[key[p]] : undef;\n }\n\n return obj === undef ? def : obj;\n};\nvar defaultBreakpoints = [40, 52, 64].map(function (n) {\n return n + 'em';\n});\nvar defaultTheme = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512],\n fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]\n};\nvar aliases = {\n bg: 'backgroundColor',\n m: 'margin',\n mt: 'marginTop',\n mr: 'marginRight',\n mb: 'marginBottom',\n ml: 'marginLeft',\n mx: 'marginX',\n my: 'marginY',\n p: 'padding',\n pt: 'paddingTop',\n pr: 'paddingRight',\n pb: 'paddingBottom',\n pl: 'paddingLeft',\n px: 'paddingX',\n py: 'paddingY'\n};\nvar multiples = {\n marginX: ['marginLeft', 'marginRight'],\n marginY: ['marginTop', 'marginBottom'],\n paddingX: ['paddingLeft', 'paddingRight'],\n paddingY: ['paddingTop', 'paddingBottom'],\n size: ['width', 'height']\n};\nvar scales = {\n color: 'colors',\n backgroundColor: 'colors',\n borderColor: 'colors',\n margin: 'space',\n marginTop: 'space',\n marginRight: 'space',\n marginBottom: 'space',\n marginLeft: 'space',\n marginX: 'space',\n marginY: 'space',\n padding: 'space',\n paddingTop: 'space',\n paddingRight: 'space',\n paddingBottom: 'space',\n paddingLeft: 'space',\n paddingX: 'space',\n paddingY: 'space',\n top: 'space',\n right: 'space',\n bottom: 'space',\n left: 'space',\n gridGap: 'space',\n gridColumnGap: 'space',\n gridRowGap: 'space',\n gap: 'space',\n columnGap: 'space',\n rowGap: 'space',\n fontFamily: 'fonts',\n fontSize: 'fontSizes',\n fontWeight: 'fontWeights',\n lineHeight: 'lineHeights',\n letterSpacing: 'letterSpacings',\n border: 'borders',\n borderTop: 'borders',\n borderRight: 'borders',\n borderBottom: 'borders',\n borderLeft: 'borders',\n borderWidth: 'borderWidths',\n borderStyle: 'borderStyles',\n borderRadius: 'radii',\n borderTopRightRadius: 'radii',\n borderTopLeftRadius: 'radii',\n borderBottomRightRadius: 'radii',\n borderBottomLeftRadius: 'radii',\n borderTopWidth: 'borderWidths',\n borderTopColor: 'colors',\n borderTopStyle: 'borderStyles',\n borderBottomWidth: 'borderWidths',\n borderBottomColor: 'colors',\n borderBottomStyle: 'borderStyles',\n borderLeftWidth: 'borderWidths',\n borderLeftColor: 'colors',\n borderLeftStyle: 'borderStyles',\n borderRightWidth: 'borderWidths',\n borderRightColor: 'colors',\n borderRightStyle: 'borderStyles',\n outlineColor: 'colors',\n boxShadow: 'shadows',\n textShadow: 'shadows',\n zIndex: 'zIndices',\n width: 'sizes',\n minWidth: 'sizes',\n maxWidth: 'sizes',\n height: 'sizes',\n minHeight: 'sizes',\n maxHeight: 'sizes',\n flexBasis: 'sizes',\n size: 'sizes',\n // svg\n fill: 'colors',\n stroke: 'colors'\n};\n\nvar positiveOrNegative = function positiveOrNegative(scale, value) {\n if (typeof value !== 'number' || value >= 0) {\n return get(scale, value, value);\n }\n\n var absolute = Math.abs(value);\n var n = get(scale, absolute, absolute);\n if (typeof n === 'string') return '-' + n;\n return n * -1;\n};\n\nvar transforms = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'top', 'bottom', 'left', 'right'].reduce(function (acc, curr) {\n var _extends2;\n\n return _extends({}, acc, (_extends2 = {}, _extends2[curr] = positiveOrNegative, _extends2));\n}, {});\nexport var responsive = function responsive(styles) {\n return function (theme) {\n var next = {};\n var breakpoints = get(theme, 'breakpoints', defaultBreakpoints);\n var mediaQueries = [null].concat(breakpoints.map(function (n) {\n return \"@media screen and (min-width: \" + n + \")\";\n }));\n\n for (var key in styles) {\n var value = typeof styles[key] === 'function' ? styles[key](theme) : styles[key];\n if (value == null) continue;\n\n if (!Array.isArray(value)) {\n next[key] = value;\n continue;\n }\n\n for (var i = 0; i < value.slice(0, mediaQueries.length).length; i++) {\n var media = mediaQueries[i];\n\n if (!media) {\n next[key] = value[i];\n continue;\n }\n\n next[media] = next[media] || {};\n if (value[i] == null) continue;\n next[media][key] = value[i];\n }\n }\n\n return next;\n };\n};\nexport var css = function css(args) {\n return function (props) {\n if (props === void 0) {\n props = {};\n }\n\n var theme = _extends({}, defaultTheme, {}, props.theme || props);\n\n var result = {};\n var obj = typeof args === 'function' ? args(theme) : args;\n var styles = responsive(obj)(theme);\n\n for (var key in styles) {\n var x = styles[key];\n var val = typeof x === 'function' ? x(theme) : x;\n\n if (key === 'variant') {\n var variant = css(get(theme, val))(theme);\n result = _extends({}, result, {}, variant);\n continue;\n }\n\n if (val && typeof val === 'object') {\n result[key] = css(val)(theme);\n continue;\n }\n\n var prop = get(aliases, key, key);\n var scaleName = get(scales, prop);\n var scale = get(theme, scaleName, get(theme, prop, {}));\n var transform = get(transforms, prop, get);\n var value = transform(scale, val, val);\n\n if (multiples[prop]) {\n var dirs = multiples[prop];\n\n for (var i = 0; i < dirs.length; i++) {\n result[dirs[i]] = value;\n }\n } else {\n result[prop] = value;\n }\n }\n\n return result;\n };\n};\nexport default css;\n","import { get, createParser } from '@styled-system/core';\nimport css from '@styled-system/css';\nexport var variant = function variant(_ref) {\n var _config;\n\n var scale = _ref.scale,\n _ref$prop = _ref.prop,\n prop = _ref$prop === void 0 ? 'variant' : _ref$prop,\n _ref$variants = _ref.variants,\n variants = _ref$variants === void 0 ? {} : _ref$variants,\n key = _ref.key;\n var sx;\n\n if (Object.keys(variants).length) {\n sx = function sx(value, scale, props) {\n return css(get(scale, value, null))(props.theme);\n };\n } else {\n sx = function sx(value, scale) {\n return get(scale, value, null);\n };\n }\n\n sx.scale = scale || key;\n sx.defaults = variants;\n var config = (_config = {}, _config[prop] = sx, _config);\n var parser = createParser(config);\n return parser;\n};\nexport default variant;\nexport var buttonStyle = variant({\n key: 'buttons'\n});\nexport var textStyle = variant({\n key: 'textStyles',\n prop: 'textStyle'\n});\nexport var colorStyle = variant({\n key: 'colorStyles',\n prop: 'colors'\n});\n","import { createStyleFunction, createParser } from '@styled-system/core'; // v4 api shims\n\nimport layout from '@styled-system/layout';\nimport color from '@styled-system/color';\nimport typography from '@styled-system/typography';\nimport flexbox from '@styled-system/flexbox';\nimport grid from '@styled-system/grid';\nimport border from '@styled-system/border';\nimport background from '@styled-system/background';\nimport position from '@styled-system/position';\nexport { get, createParser, createStyleFunction, compose, system } from '@styled-system/core';\nexport { margin, padding, space } from '@styled-system/space';\nexport { color } from '@styled-system/color';\nexport { layout } from '@styled-system/layout';\nexport { typography } from '@styled-system/typography';\nexport { flexbox } from '@styled-system/flexbox';\nexport { border } from '@styled-system/border';\nexport { background } from '@styled-system/background';\nexport { position } from '@styled-system/position';\nexport { grid } from '@styled-system/grid';\nexport { shadow } from '@styled-system/shadow';\nexport { default as boxShadow, default as textShadow } from '@styled-system/shadow';\nexport { variant, buttonStyle, textStyle, colorStyle } from '@styled-system/variant';\nvar width = layout.width,\n height = layout.height,\n minWidth = layout.minWidth,\n minHeight = layout.minHeight,\n maxWidth = layout.maxWidth,\n maxHeight = layout.maxHeight,\n size = layout.size,\n verticalAlign = layout.verticalAlign,\n display = layout.display,\n overflow = layout.overflow,\n overflowX = layout.overflowX,\n overflowY = layout.overflowY;\nvar opacity = color.opacity;\nvar fontSize = typography.fontSize,\n fontFamily = typography.fontFamily,\n fontWeight = typography.fontWeight,\n lineHeight = typography.lineHeight,\n textAlign = typography.textAlign,\n fontStyle = typography.fontStyle,\n letterSpacing = typography.letterSpacing;\nvar alignItems = flexbox.alignItems,\n alignContent = flexbox.alignContent,\n justifyItems = flexbox.justifyItems,\n justifyContent = flexbox.justifyContent,\n flexWrap = flexbox.flexWrap,\n flexDirection = flexbox.flexDirection,\n flex = flexbox.flex,\n flexGrow = flexbox.flexGrow,\n flexShrink = flexbox.flexShrink,\n flexBasis = flexbox.flexBasis,\n justifySelf = flexbox.justifySelf,\n alignSelf = flexbox.alignSelf,\n order = flexbox.order;\nvar gridGap = grid.gridGap,\n gridColumnGap = grid.gridColumnGap,\n gridRowGap = grid.gridRowGap,\n gridColumn = grid.gridColumn,\n gridRow = grid.gridRow,\n gridAutoFlow = grid.gridAutoFlow,\n gridAutoColumns = grid.gridAutoColumns,\n gridAutoRows = grid.gridAutoRows,\n gridTemplateColumns = grid.gridTemplateColumns,\n gridTemplateRows = grid.gridTemplateRows,\n gridTemplateAreas = grid.gridTemplateAreas,\n gridArea = grid.gridArea;\nvar borderWidth = border.borderWidth,\n borderStyle = border.borderStyle,\n borderColor = border.borderColor,\n borderTop = border.borderTop,\n borderRight = border.borderRight,\n borderBottom = border.borderBottom,\n borderLeft = border.borderLeft,\n borderRadius = border.borderRadius;\nvar backgroundImage = background.backgroundImage,\n backgroundSize = background.backgroundSize,\n backgroundPosition = background.backgroundPosition,\n backgroundRepeat = background.backgroundRepeat;\nvar zIndex = position.zIndex,\n top = position.top,\n right = position.right,\n bottom = position.bottom,\n left = position.left;\nexport { default as borders } from '@styled-system/border';\nexport { width, height, minWidth, minHeight, maxWidth, maxHeight, size, verticalAlign, display, overflow, overflowX, overflowY // color\n, opacity // typography\n, fontSize, fontFamily, fontWeight, lineHeight, textAlign, fontStyle, letterSpacing // flexbox\n, alignItems, alignContent, justifyItems, justifyContent, flexWrap, flexDirection, flex, flexGrow, flexShrink, flexBasis, justifySelf, alignSelf, order // grid\n, gridGap, gridColumnGap, gridRowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea // border\n, borderWidth, borderStyle, borderColor, borderTop, borderRight, borderBottom, borderLeft, borderRadius // background\n, backgroundImage, backgroundSize, backgroundPosition, backgroundRepeat // position\n, zIndex, top, right, bottom, left }; // v4 style API shim\n\nexport var style = function style(_ref) {\n var prop = _ref.prop,\n cssProperty = _ref.cssProperty,\n alias = _ref.alias,\n key = _ref.key,\n transformValue = _ref.transformValue,\n scale = _ref.scale,\n properties = _ref.properties;\n var config = {};\n config[prop] = createStyleFunction({\n properties: properties,\n property: cssProperty || prop,\n scale: key,\n defaultScale: scale,\n transform: transformValue\n });\n if (alias) config[alias] = config[prop];\n var parse = createParser(config);\n return parse;\n};\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","const errors = {\n\t0: \"Illegal state\",\n\t1: \"Immer drafts cannot have computed properties\",\n\t2: \"This object has been frozen and should not be mutated\",\n\t3(data: any) {\n\t\treturn (\n\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\tdata\n\t\t)\n\t},\n\t4: \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t5: \"Immer forbids circular references\",\n\t6: \"The first or second argument to `produce` must be a function\",\n\t7: \"The third argument to `produce` must be a function or undefined\",\n\t8: \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t9: \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t10: \"The given draft is already finalized\",\n\t11: \"Object.defineProperty() cannot be used on an Immer draft\",\n\t12: \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t13: \"Immer only supports deleting array indices\",\n\t14: \"Immer only supports setting array indices and the 'length' property\",\n\t15(path: string) {\n\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path\n\t},\n\t16: 'Sets cannot have \"replace\" patches.',\n\t17(op: string) {\n\t\treturn \"Unsupported patch operation: \" + op\n\t},\n\t18(plugin: string) {\n\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t},\n\t20: \"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\",\n\t21(thing: string) {\n\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t},\n\t22(thing: string) {\n\t\treturn `'current' expects a draft, got: ${thing}`\n\t},\n\t23(thing: string) {\n\t\treturn `'original' expects a draft, got: ${thing}`\n\t},\n\t24: \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n} as const\n\nexport function die(error: keyof typeof errors, ...args: any[]): never {\n\tif (__DEV__) {\n\t\tconst e = errors[error]\n\t\tconst msg = !e\n\t\t\t? \"unknown error nr: \" + error\n\t\t\t: typeof e === \"function\"\n\t\t\t? e.apply(null, args as any)\n\t\t\t: e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}${\n\t\t\targs.length ? \" \" + args.map(s => `'${s}'`).join(\",\") : \"\"\n\t\t}. Find the full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\thasSet,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\thasMap,\n\tArchtypeObject,\n\tArchtypeArray,\n\tArchtypeMap,\n\tArchtypeSet,\n\tdie\n} from \"../internal\"\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original