diff --git a/src/@evoposter/evaluator/src/metrics/VisualSemantics.mjs b/src/@evoposter/evaluator/src/metrics/VisualSemantics.mjs index 941af28..78d05ad 100644 --- a/src/@evoposter/evaluator/src/metrics/VisualSemantics.mjs +++ b/src/@evoposter/evaluator/src/metrics/VisualSemantics.mjs @@ -9,6 +9,13 @@ * return the mean of difference between all textboxes, * a value between 1 (good) and 0 (bad) * + * two modes: MIN and DIF + * MIN takes into account that the most important parts + * are typeset in the min value possible in the container + * DIF: take into account only the difference between the parts + * selects a style and compare based on the distribution of emotions. + * + * * * Sérgio M. Rebelo * CDV lab. (CMS, CISUC, Portugal) @@ -16,41 +23,119 @@ * * v1.0.0 November 2023 */ -import {arrMax, arrMean, arrMin, constraint, map} from "../utils.js"; +import {arrMax, arrMean, arrMin, arrSum, constraint, map} from "../utils.js"; -// by tradition, use more that a method to emphasize the text is considered typecrime -// this method enables turn on/off this, using the param allowMultiple -export const compute = (textboxes, dist, allowMultiple = false) => { - const fontWeight = 1-checkDifferenceVariableFeature(textboxes.map((b) => b["weight"]), dist.map((e) => e[3])); - const fontStretch = 1-checkDifferenceVariableFeature(textboxes.map((b) => b["font-stretch"]), dist.map((e) => e[3])); +let MIN_RANGE = 50; +let THRESHOLD_VALID = 0.2; - // console.log (`fontWeight=`, fontWeight); - // console.log (`fontStretch=`, fontStretch); - - // type design +// by tradition, use more that a method to emphasize +// the text is considered "typecrime". +// this method enables turn on/off this feature +// by using the param allowMultiple +export const compute = (textboxes, dist, noCurrentTypefaces = 1, allowMultiple = true, weights = [0.4, 0.3, 0.3]) => { + // if textboxes size is 1 ---> 1 + const perDist = dist.map((e) => e[3]); + const fontWeight = checkDifferenceVariableFeature(textboxes.map((b) => b["weight"]), perDist); + const fontStretch = checkDifferenceVariableFeature(textboxes.map((b) => b["font-stretch"]), perDist); + let typefaceDesign = noCurrentTypefaces > 1 ? (checkDifferenceUniqueFeatures(textboxes.map((b) => b["font-stretch"]), perDist)) : 0; // way of combine and only checks one - return fontWeight; + let res = [fontWeight, fontStretch, typefaceDesign]; + let weightedRes = res.map((x,i) => x*weights[i]); + + let value; + + if (!allowMultiple) { + // if not allowed multiple emphasis + // we check what fields are active + // and penalty when there is active fields + let active = res.map((r) => r > THRESHOLD_VALID); + let c = 0; + for (let a of active) { + if (a) { + c++; + } + } + value = arrMax(res)/c; + } else { + value = arrSum(weightedRes); + } + + return value; } -const checkDifferenceVariableFeature = (currentFeatures, dist) => { +// check the levels +const checkDifferenceUniqueFeatures = (currentFeatures, dist) => { + // available semantic level + const uniqueValues = dist.filter((value, index, array) => array.indexOf(value) === index); + const target = []; + + // define the target typeface for each semantic level + for (let uq of uniqueValues) { + for (let i=0; i target.indexOf(item) !== index); + + let value = 1; + // if there is duplicate in levels + // (if yes, difference is max) + if (!duplicates.length >= 1) { + // count the amount of tb not in the same typeface + let c = 0; + // for each typeface + for (let i in dist) { + let level = dist[i]; + let currentValue = currentFeatures[i]; + // get unique index of current semantic level + let index = uniqueValues.indexOf(level); + // get target value + let targetValue = target[index]; + if (currentValue !== targetValue) { + // if not the same as target + c++; + } + } + // map value to a value between 0 (no difference) and 1 (max difference) + value = map(c, 0, currentFeatures.length, 0, 1); + } + + return value; +} + +const checkDifferenceVariableFeature = (currentFeatures, dist, mode = `DIF`) => { + if (mode !== `MIN` && mode !== `DIF`) { + mode = `DIF`; + } // max feature range const maxFeature = arrMax(currentFeatures); const minFeature = arrMin(currentFeatures); let range = Math.abs(maxFeature - minFeature); + if (range < MIN_RANGE) { + return 1; + } // semantic data range const maxSemantic = arrMax(dist); const minSemantic = arrMin(dist); - // selects a style used in the first min semantic textbox - let def = 0; - for (let i in dist) { - if (dist[i] === minSemantic) { - def = currentFeatures[i]; - break; + // consider the current variable minimum + let def = minFeature; + if (mode === `DIF`) { + // selects a style used in the first min semantic textbox + for (let i in dist) { + if (dist[i] === minSemantic) { + // consider the difference + def = currentFeatures[i]; + break; + } } } @@ -66,10 +151,7 @@ const checkDifferenceVariableFeature = (currentFeatures, dist) => { const current = []; for (let i in currentFeatures) { let w = currentFeatures[i]; - // consider only the difference let currentDistance = Math.abs(w - def); - // consider the variable scale - // let currentDistance = Math.abs(w - minFeature); let dif = Math.abs(currentDistance - target[i]); current.push(dif); } diff --git a/src/client/Params.js b/src/client/Params.js index c1e908e..399dd81 100644 --- a/src/client/Params.js +++ b/src/client/Params.js @@ -45,8 +45,8 @@ export class Params { static evolution = { popSize: 50, noGen: 400, - crossoverProb: 0.75, - mutationProb: 0.30, + crossoverProb: 0.90, + mutationProb: 0.10, eliteSize: 1 } diff --git a/src/client/app.js b/src/client/app.js index 7ec70e2..27d8f1e 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -14,6 +14,7 @@ import Population from "./controllers/Population.js"; import 'bootstrap/scss/bootstrap.scss'; import './main.css'; + window.preload = () => {} window.setup = () => { @@ -46,6 +47,8 @@ window.keyPressed = () => { // } } + + export class App extends LitElement { static properties = { screen: 0, @@ -60,8 +63,8 @@ export class App extends LitElement { this.evolving = false; const fonts = this.#getAvailableTypefaces(); + // evolution controllers - // this.config = { evo: { popSize: Params.evolution.popSize, @@ -135,7 +138,11 @@ export class App extends LitElement { for (let font of Array.from(document.fonts)) { if (Params.availableTypefaces.includes(font.family)) { let stretch = font.stretch.replaceAll(`%`, ``); - let stretchValues = stretch.split(" ").map((x) => parseInt(x)); + let stretchValues = [100, 100]; + if (stretch !== `normal`) { + stretchValues = stretch.split(" ").map((x) => parseInt(x)); + } + if (fonts.stretch.min > stretchValues[0]) { fonts.stretch.min = stretchValues[0] } diff --git a/src/client/controllers/Population.js b/src/client/controllers/Population.js index 38b9034..0f8f204 100644 --- a/src/client/controllers/Population.js +++ b/src/client/controllers/Population.js @@ -254,8 +254,7 @@ export class Population { tb["typeface"] = this.params["typography"]["typefaces"][r]["family"]; } - // size. double probability - if (Math.random() < prob*2) { + if (Math.random() < prob) { let size = Math.round(tb["size"] + -SIZE_MUTATION_ADJUST+(Math.random()*SIZE_MUTATION_ADJUST)); // check if inside typeface min and max thresholds size = Math.min(Math.max(size, ind.minFontSize), ind.maxFontSize); @@ -271,7 +270,7 @@ export class Population { tb["weight"] = Math.round(Math.random() * (maxWeight - minWeight) + minWeight); } - // strech + // stretch if (Math.random() < prob) { let availableStretch = this.params["typography"]["typefaces"][selectedTypeface]["stretch"]; const minStretch = Math.max(parseInt(availableStretch[0]), this.params["typography"]["stretch"]["min"]); @@ -317,7 +316,7 @@ export class Population { // sort the population based on staticPenalty // enables visualisation and elite - // sort individuals in the population by fitness (fittest first) + // sort individuals in the population by fitness (the fittest first) await this.#staticPenalty(); } @@ -434,7 +433,7 @@ export class Population { // ensure that phenotype is created if (ind.phenotype === null) { this.updated = true; - await ind.evaluate(this.targetLayout); + await ind.evaluate(this.targetSemanticLayout); } // display diff --git a/src/client/controllers/Poster.js b/src/client/controllers/Poster.js index 628cf35..3e1195e 100644 --- a/src/client/controllers/Poster.js +++ b/src/client/controllers/Poster.js @@ -15,7 +15,7 @@ class Poster { this.generation = generation; this.ready = false; // ensure we use a deep copy of params - params = JSON.parse(JSON.stringify(params)); + this.params = JSON.parse(JSON.stringify(params)); this.fitness = 1; this.constraint = 0; @@ -32,7 +32,6 @@ class Poster { this.genotype = (genotype === null) ? this.#generateGenotype(params) : genotype; - // TODO: grid -> Local sotrage this.#showGrid = params !== null ? params.display.grid : false; this.phenotype = null; // this.evaluate(); @@ -75,7 +74,7 @@ class Poster { typography: typography, images: images } - return new Poster(this.n, this.generation, null, genotypeCopy); + return new Poster(this.n, this.generation, this.params, genotypeCopy); } #generateGenotype = (params) => { @@ -225,14 +224,16 @@ class Poster { } evaluate = async (dist) => { + // TODO: DIVIDE into parts this.phenotype = await this.draw(); - const layoutSemantics = evaluator.layoutSemantics(this.genotype["grid"]["rows"]["l"], dist, `RELATIVE`, this.genotype["size"]); - const visualSemantics = evaluator.visualSemantics(this.genotype["textboxes"], dist); + const noCurrentTypefaces = this.params["typography"]["typefaces"].length; - // console.log (`visualSemantics`, visualSemantics); + const layoutSemantics = evaluator.layoutSemantics(this.genotype["grid"]["rows"]["l"], dist, `FIXED`, this.genotype["size"]); + const visualSemantics = evaluator.visualSemantics(this.genotype["textboxes"], dist, noCurrentTypefaces); + const justification = evaluator.legibility(this.sentencesLenght, this.genotype["grid"].getAvailableWidth(), `JUSTIFY`); // this.fitness = layoutSemantics; - this.fitness = visualSemantics; + this.fitness = (visualSemantics * 0.3 + layoutSemantics * 0.3 + justification * 0.4); // constraints const legibility = evaluator.legibility(this.sentencesLenght, this.genotype["grid"].getAvailableWidth(), `OVERSET`); diff --git a/src/public/app.js b/src/public/app.js index 3ef5cff..5c66170 100644 --- a/src/public/app.js +++ b/src/public/app.js @@ -26,7 +26,7 @@ var ee,te;class re extends y{constructor(){super(...arguments),this.renderOption * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap=t(e.Popper)}(void 0,(function(e){function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const r=t(e),o=new Map,s={set(e,t,r){o.has(e)||o.set(e,new Map);const s=o.get(e);s.has(t)||0===s.size?s.set(t,r):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,t)=>o.has(e)&&o.get(e).get(t)||null,remove(e,t){if(!o.has(e))return;const r=o.get(e);r.delete(t),0===r.size&&o.delete(e)}},n="transitionend",i=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),a=e=>{e.dispatchEvent(new Event(n))},l=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),c=e=>l(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(i(e)):null,u=e=>{if(!l(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),r=e.closest("details:not([open])");if(!r)return t;if(r!==e){const t=e.closest("summary");if(t&&t.parentNode!==r)return!1;if(null===t)return!1}return t},d=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),h=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?h(e.parentNode):null},p=()=>{},f=e=>{e.offsetHeight},m=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,y=[],g=()=>"rtl"===document.documentElement.dir,v=e=>{var t;t=()=>{const t=m();if(t){const r=e.NAME,o=t.fn[r];t.fn[r]=e.jQueryInterface,t.fn[r].Constructor=e,t.fn[r].noConflict=()=>(t.fn[r]=o,e.jQueryInterface)}},"loading"===document.readyState?(y.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of y)e()})),y.push(t)):t()},b=(e,t=[],r=e)=>"function"==typeof e?e(...t):r,_=(e,t,r=!0)=>{if(!r)return void b(e);const o=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:r}=window.getComputedStyle(e);const o=Number.parseFloat(t),s=Number.parseFloat(r);return o||s?(t=t.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(r))):0})(t)+5;let s=!1;const i=({target:r})=>{r===t&&(s=!0,t.removeEventListener(n,i),b(e))};t.addEventListener(n,i),setTimeout((()=>{s||a(t)}),o)},w=(e,t,r,o)=>{const s=e.length;let n=e.indexOf(t);return-1===n?!r&&o?e[s-1]:e[0]:(n+=r?1:-1,o&&(n=(n+s)%s),e[Math.max(0,Math.min(n,s-1))])},x=/[^.]*(?=\..*)\.|.*/,j=/\..*/,S=/::\d+$/,E={};let M=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function A(e,t){return t&&`${t}::${M++}`||e.uidEvent||M++}function k(e){const t=A(e);return e.uidEvent=t,E[t]=E[t]||{},E[t]}function O(e,t,r=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===r))}function L(e,t,r){const o="string"==typeof t,s=o?r:t||r;let n=D(e);return C.has(n)||(n=e),[o,s,n]}function P(e,t,r,o,s){if("string"!=typeof t||!e)return;let[n,i,a]=L(t,r,o);if(t in T){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};i=e(i)}const l=k(e),c=l[a]||(l[a]={}),u=O(c,i,n?r:null);if(u)return void(u.oneOff=u.oneOff&&s);const d=A(i,t.replace(x,"")),h=n?function(e,t,r){return function o(s){const n=e.querySelectorAll(t);for(let{target:i}=s;i&&i!==this;i=i.parentNode)for(const a of n)if(a===i)return N(s,{delegateTarget:i}),o.oneOff&&F.off(e,s.type,t,r),r.apply(i,[s])}}(e,r,i):function(e,t){return function r(o){return N(o,{delegateTarget:e}),r.oneOff&&F.off(e,o.type,t),t.apply(e,[o])}}(e,i);h.delegationSelector=n?r:null,h.callable=i,h.oneOff=s,h.uidEvent=d,c[d]=h,e.addEventListener(a,h,n)}function R(e,t,r,o,s){const n=O(t[r],o,s);n&&(e.removeEventListener(r,n,Boolean(s)),delete t[r][n.uidEvent])}function I(e,t,r,o){const s=t[r]||{};for(const[n,i]of Object.entries(s))n.includes(o)&&R(e,t,r,i.callable,i.delegationSelector)}function D(e){return e=e.replace(j,""),T[e]||e}const F={on(e,t,r,o){P(e,t,r,o,!1)},one(e,t,r,o){P(e,t,r,o,!0)},off(e,t,r,o){if("string"!=typeof t||!e)return;const[s,n,i]=L(t,r,o),a=i!==t,l=k(e),c=l[i]||{},u=t.startsWith(".");if(void 0===n){if(u)for(const r of Object.keys(l))I(e,l,r,t.slice(1));for(const[r,o]of Object.entries(c)){const s=r.replace(S,"");a&&!t.includes(s)||R(e,l,i,o.callable,o.delegationSelector)}}else{if(!Object.keys(c).length)return;R(e,l,i,n,s?r:null)}},trigger(e,t,r){if("string"!=typeof t||!e)return null;const o=m();let s=null,n=!0,i=!0,a=!1;t!==D(t)&&o&&(s=o.Event(t,r),o(e).trigger(s),n=!s.isPropagationStopped(),i=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=N(new Event(t,{bubbles:n,cancelable:!0}),r);return a&&l.preventDefault(),i&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function N(e,t={}){for(const[r,o]of Object.entries(t))try{e[r]=o}catch(t){Object.defineProperty(e,r,{configurable:!0,get:()=>o})}return e}function U(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function B(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const G={setDataAttribute(e,t,r){e.setAttribute(`data-bs-${B(t)}`,r)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${B(t)}`)},getDataAttributes(e){if(!e)return{};const t={},r=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const o of r){let r=o.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1,r.length),t[r]=U(e.dataset[o])}return t},getDataAttribute:(e,t)=>U(e.getAttribute(`data-bs-${B(t)}`))};class z{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=l(t)?G.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof r?r:{},...l(t)?G.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[o,s]of Object.entries(t)){const t=e[o],n=l(t)?"element":null==(r=t)?`${r}`:Object.prototype.toString.call(r).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${o}" provided type "${n}" but expected type "${s}".`)}var r}}class V extends z{constructor(e,t){super(),(e=c(e))&&(this._element=e,this._config=this._getConfig(t),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),F.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){_(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return s.get(c(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.0"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const $=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let r=e.getAttribute("href");if(!r||!r.includes("#")&&!r.startsWith("."))return null;r.includes("#")&&!r.startsWith("#")&&(r=`#${r.split("#")[1]}`),t=r&&"#"!==r?r.trim():null}return i(t)},H={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const r=[];let o=e.parentNode.closest(t);for(;o;)r.push(o),o=o.parentNode.closest(t);return r},prev(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return[r];r=r.previousElementSibling}return[]},next(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return[r];r=r.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!d(e)&&u(e)))},getSelectorFromElement(e){const t=$(e);return t&&H.findOne(t)?t:null},getElementFromSelector(e){const t=$(e);return t?H.findOne(t):null},getMultipleElementsFromSelector(e){const t=$(e);return t?H.find(t):[]}},q=(e,t="hide")=>{const r=`click.dismiss${e.EVENT_KEY}`,o=e.NAME;F.on(document,r,`[data-bs-dismiss="${o}"]`,(function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),d(this))return;const s=H.getElementFromSelector(this)||this.closest(`.${o}`);e.getOrCreateInstance(s)[t]()}))},W=".bs.alert",X=`close${W}`,Y=`closed${W}`;class Z extends V{static get NAME(){return"alert"}close(){if(F.trigger(this._element,X).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),F.trigger(this._element,Y),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=Z.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}q(Z,"close"),v(Z);const J='[data-bs-toggle="button"]';class Q extends V{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=Q.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}F.on(document,"click.bs.button.data-api",J,(e=>{e.preventDefault();const t=e.target.closest(J);Q.getOrCreateInstance(t).toggle()})),v(Q);const K=".bs.swipe",ee=`touchstart${K}`,te=`touchmove${K}`,re=`touchend${K}`,oe=`pointerdown${K}`,se=`pointerup${K}`,ne={endCallback:null,leftCallback:null,rightCallback:null},ie={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ae extends z{constructor(e,t){super(),this._element=e,e&&ae.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return ne}static get DefaultType(){return ie}static get NAME(){return"swipe"}dispose(){F.off(this._element,K)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),b(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&b(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(F.on(this._element,oe,(e=>this._start(e))),F.on(this._element,se,(e=>this._end(e))),this._element.classList.add("pointer-event")):(F.on(this._element,ee,(e=>this._start(e))),F.on(this._element,te,(e=>this._move(e))),F.on(this._element,re,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const le=".bs.carousel",ce=".data-api",ue="next",de="prev",he="left",pe="right",fe=`slide${le}`,me=`slid${le}`,ye=`keydown${le}`,ge=`mouseenter${le}`,ve=`mouseleave${le}`,be=`dragstart${le}`,_e=`load${le}${ce}`,we=`click${le}${ce}`,xe="carousel",je="active",Se=".active",Ee=".carousel-item",Me=Se+Ee,Te={ArrowLeft:pe,ArrowRight:he},Ce={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ae={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ke extends V{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=H.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===xe&&this.cycle()}static get Default(){return Ce}static get DefaultType(){return Ae}static get NAME(){return"carousel"}next(){this._slide(ue)}nextWhenVisible(){!document.hidden&&u(this._element)&&this.next()}prev(){this._slide(de)}pause(){this._isSliding&&a(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?F.one(this._element,me,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void F.one(this._element,me,(()=>this.to(e)));const r=this._getItemIndex(this._getActive());if(r===e)return;const o=e>r?ue:de;this._slide(o,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&F.on(this._element,ye,(e=>this._keydown(e))),"hover"===this._config.pause&&(F.on(this._element,ge,(()=>this.pause())),F.on(this._element,ve,(()=>this._maybeEnableCycle()))),this._config.touch&&ae.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of H.find(".carousel-item img",this._element))F.on(e,be,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder(he)),rightCallback:()=>this._slide(this._directionToOrder(pe)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new ae(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Te[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=H.findOne(Se,this._indicatorsElement);t.classList.remove(je),t.removeAttribute("aria-current");const r=H.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(je),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),o=e===ue,s=t||w(this._getItems(),r,o,this._config.wrap);if(s===r)return;const n=this._getItemIndex(s),i=t=>F.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:n});if(i(fe).defaultPrevented)return;if(!r||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(n),this._activeElement=s;const l=o?"carousel-item-start":"carousel-item-end",c=o?"carousel-item-next":"carousel-item-prev";s.classList.add(c),f(s),r.classList.add(l),s.classList.add(l);this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(je),r.classList.remove(je,c,l),this._isSliding=!1,i(me)}),r,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return H.findOne(Me,this._element)}_getItems(){return H.find(Ee,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return g()?e===he?de:ue:e===he?ue:de}_orderToDirection(e){return g()?e===de?he:pe:e===de?pe:he}static jQueryInterface(e){return this.each((function(){const t=ke.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)}))}}F.on(document,we,"[data-bs-slide], [data-bs-slide-to]",(function(e){const t=H.getElementFromSelector(this);if(!t||!t.classList.contains(xe))return;e.preventDefault();const r=ke.getOrCreateInstance(t),o=this.getAttribute("data-bs-slide-to");return o?(r.to(o),void r._maybeEnableCycle()):"next"===G.getDataAttribute(this,"slide")?(r.next(),void r._maybeEnableCycle()):(r.prev(),void r._maybeEnableCycle())})),F.on(window,_e,(()=>{const e=H.find('[data-bs-ride="carousel"]');for(const t of e)ke.getOrCreateInstance(t)})),v(ke);const Oe=".bs.collapse",Le=`show${Oe}`,Pe=`shown${Oe}`,Re=`hide${Oe}`,Ie=`hidden${Oe}`,De=`click${Oe}.data-api`,Fe="show",Ne="collapse",Ue="collapsing",Be=`:scope .${Ne} .${Ne}`,Ge='[data-bs-toggle="collapse"]',ze={parent:null,toggle:!0},Ve={parent:"(null|element)",toggle:"boolean"};class $e extends V{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=H.find(Ge);for(const e of r){const t=H.getSelectorFromElement(e),r=H.find(t).filter((e=>e===this._element));null!==t&&r.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return ze}static get DefaultType(){return Ve}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>$e.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(F.trigger(this._element,Le).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Ne),this._element.classList.add(Ue),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const r=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ne,Fe),this._element.style[t]="",F.trigger(this._element,Pe)}),this._element,!0),this._element.style[t]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(F.trigger(this._element,Re).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,f(this._element),this._element.classList.add(Ue),this._element.classList.remove(Ne,Fe);for(const e of this._triggerArray){const t=H.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ne),F.trigger(this._element,Ie)}),this._element,!0)}_isShown(e=this._element){return e.classList.contains(Fe)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=c(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Ge);for(const t of e){const e=H.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=H.find(Be,this._config.parent);return H.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const r of e)r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const r=$e.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===r[e])throw new TypeError(`No method named "${e}"`);r[e]()}}))}}F.on(document,De,Ge,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of H.getMultipleElementsFromSelector(this))$e.getOrCreateInstance(e,{toggle:!1}).toggle()})),v($e);const He="dropdown",qe=".bs.dropdown",We=".data-api",Xe="ArrowUp",Ye="ArrowDown",Ze=`hide${qe}`,Je=`hidden${qe}`,Qe=`show${qe}`,Ke=`shown${qe}`,et=`click${qe}${We}`,tt=`keydown${qe}${We}`,rt=`keyup${qe}${We}`,ot="show",st='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',nt=`${st}.${ot}`,it=".dropdown-menu",at=g()?"top-end":"top-start",lt=g()?"top-start":"top-end",ct=g()?"bottom-end":"bottom-start",ut=g()?"bottom-start":"bottom-end",dt=g()?"left-start":"right-start",ht=g()?"right-start":"left-start",pt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ft={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class mt extends V{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=H.next(this._element,it)[0]||H.prev(this._element,it)[0]||H.findOne(it,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return pt}static get DefaultType(){return ft}static get NAME(){return He}toggle(){return this._isShown()?this.hide():this.show()}show(){if(d(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!F.trigger(this._element,Qe,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))F.on(e,"mouseover",p);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ot),this._element.classList.add(ot),F.trigger(this._element,Ke,e)}}hide(){if(d(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!F.trigger(this._element,Ze,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.off(e,"mouseover",p);this._popper&&this._popper.destroy(),this._menu.classList.remove(ot),this._element.classList.remove(ot),this._element.setAttribute("aria-expanded","false"),G.removeDataAttribute(this._menu,"popper"),F.trigger(this._element,Je,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!l(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${He.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===r)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:l(this._config.reference)?e=c(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=r.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(ot)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return dt;if(e.classList.contains("dropstart"))return ht;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?lt:at:t?ut:ct}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(G.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...b(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const r=H.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((e=>u(e)));r.length&&w(r,t,e===Ye,!r.includes(t)).focus()}static jQueryInterface(e){return this.each((function(){const t=mt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=H.find(nt);for(const r of t){const t=mt.getInstance(r);if(!t||!1===t._config.autoClose)continue;const o=e.composedPath(),s=o.includes(t._menu);if(o.includes(t._element)||"inside"===t._config.autoClose&&!s||"outside"===t._config.autoClose&&s)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const n={relatedTarget:t._element};"click"===e.type&&(n.clickEvent=e),t._completeHide(n)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r="Escape"===e.key,o=[Xe,Ye].includes(e.key);if(!o&&!r)return;if(t&&!r)return;e.preventDefault();const s=this.matches(st)?this:H.prev(this,st)[0]||H.next(this,st)[0]||H.findOne(st,e.delegateTarget.parentNode),n=mt.getOrCreateInstance(s);if(o)return e.stopPropagation(),n.show(),void n._selectMenuItem(e);n._isShown()&&(e.stopPropagation(),n.hide(),s.focus())}}F.on(document,tt,st,mt.dataApiKeydownHandler),F.on(document,tt,it,mt.dataApiKeydownHandler),F.on(document,et,mt.clearMenus),F.on(document,rt,mt.clearMenus),F.on(document,et,st,(function(e){e.preventDefault(),mt.getOrCreateInstance(this).toggle()})),v(mt);const yt="backdrop",gt="show",vt=`mousedown.bs.${yt}`,bt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},_t={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class wt extends z{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return bt}static get DefaultType(){return _t}static get NAME(){return yt}show(e){if(!this._config.isVisible)return void b(e);this._append();const t=this._getElement();this._config.isAnimated&&f(t),t.classList.add(gt),this._emulateAnimation((()=>{b(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(gt),this._emulateAnimation((()=>{this.dispose(),b(e)}))):b(e)}dispose(){this._isAppended&&(F.off(this._element,vt),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=c(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),F.on(e,vt,(()=>{b(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){_(e,this._getElement(),this._config.isAnimated)}}const xt=".bs.focustrap",jt=`focusin${xt}`,St=`keydown.tab${xt}`,Et="backward",Mt={autofocus:!0,trapElement:null},Tt={autofocus:"boolean",trapElement:"element"};class Ct extends z{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Mt}static get DefaultType(){return Tt}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),F.off(document,xt),F.on(document,jt,(e=>this._handleFocusin(e))),F.on(document,St,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,F.off(document,xt))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=H.focusableChildren(t);0===r.length?t.focus():this._lastTabNavDirection===Et?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Et:"forward")}}const At=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",kt=".sticky-top",Ot="padding-right",Lt="margin-right";class Pt{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ot,(t=>t+e)),this._setElementAttributes(At,Ot,(t=>t+e)),this._setElementAttributes(kt,Lt,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ot),this._resetElementAttributes(At,Ot),this._resetElementAttributes(kt,Lt)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const o=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+o)return;this._saveInitialAttribute(e,t);const s=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${r(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&G.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const r=G.getDataAttribute(e,t);null!==r?(G.removeDataAttribute(e,t),e.style.setProperty(t,r)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(l(e))t(e);else for(const r of H.find(e,this._element))t(r)}}const Rt=".bs.modal",It=`hide${Rt}`,Dt=`hidePrevented${Rt}`,Ft=`hidden${Rt}`,Nt=`show${Rt}`,Ut=`shown${Rt}`,Bt=`resize${Rt}`,Gt=`click.dismiss${Rt}`,zt=`mousedown.dismiss${Rt}`,Vt=`keydown.dismiss${Rt}`,$t=`click${Rt}.data-api`,Ht="modal-open",qt="show",Wt="modal-static",Xt={backdrop:!0,focus:!0,keyboard:!0},Yt={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Zt extends V{constructor(e,t){super(e,t),this._dialog=H.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Pt,this._addEventListeners()}static get Default(){return Xt}static get DefaultType(){return Yt}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;F.trigger(this._element,Nt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ht),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){if(!this._isShown||this._isTransitioning)return;F.trigger(this._element,It).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(qt),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){F.off(window,Rt),F.off(this._dialog,Rt),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new wt({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ct({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=H.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),f(this._element),this._element.classList.add(qt);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,F.trigger(this._element,Ut,{relatedTarget:e})}),this._dialog,this._isAnimated())}_addEventListeners(){F.on(this._element,Vt,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),F.on(window,Bt,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),F.on(this._element,zt,(e=>{F.one(this._element,Gt,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Ht),this._resetAdjustments(),this._scrollBar.reset(),F.trigger(this._element,Ft)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(F.trigger(this._element,Dt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Wt)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Wt),this._queueCallback((()=>{this._element.classList.remove(Wt),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const e=g()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!r&&e){const e=g()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const r=Zt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===r[e])throw new TypeError(`No method named "${e}"`);r[e](t)}}))}}F.on(document,$t,'[data-bs-toggle="modal"]',(function(e){const t=H.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),F.one(t,Nt,(e=>{e.defaultPrevented||F.one(t,Ft,(()=>{u(this)&&this.focus()}))}));const r=H.findOne(".modal.show");r&&Zt.getInstance(r).hide();Zt.getOrCreateInstance(t).toggle(this)})),q(Zt),v(Zt);const Jt=".bs.offcanvas",Qt=".data-api",Kt=`load${Jt}${Qt}`,er="show",tr="showing",rr="hiding",or=".offcanvas.show",sr=`show${Jt}`,nr=`shown${Jt}`,ir=`hide${Jt}`,ar=`hidePrevented${Jt}`,lr=`hidden${Jt}`,cr=`resize${Jt}`,ur=`click${Jt}${Qt}`,dr=`keydown.dismiss${Jt}`,hr={backdrop:!0,keyboard:!0,scroll:!1},pr={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class fr extends V{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return hr}static get DefaultType(){return pr}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(F.trigger(this._element,sr,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Pt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(tr);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(er),this._element.classList.remove(tr),F.trigger(this._element,nr,{relatedTarget:e})}),this._element,!0)}hide(){if(!this._isShown)return;if(F.trigger(this._element,ir).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(rr),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(er,rr),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Pt).reset(),F.trigger(this._element,lr)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new wt({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():F.trigger(this._element,ar)}:null})}_initializeFocusTrap(){return new Ct({trapElement:this._element})}_addEventListeners(){F.on(this._element,dr,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():F.trigger(this._element,ar))}))}static jQueryInterface(e){return this.each((function(){const t=fr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}F.on(document,ur,'[data-bs-toggle="offcanvas"]',(function(e){const t=H.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),d(this))return;F.one(t,lr,(()=>{u(this)&&this.focus()}));const r=H.findOne(or);r&&r!==t&&fr.getInstance(r).hide();fr.getOrCreateInstance(t).toggle(this)})),F.on(window,Kt,(()=>{for(const e of H.find(or))fr.getOrCreateInstance(e).show()})),F.on(window,cr,(()=>{for(const e of H.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&fr.getOrCreateInstance(e).hide()})),q(fr),v(fr);const mr={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},yr=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),gr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,vr=(e,t)=>{const r=e.nodeName.toLowerCase();return t.includes(r)?!yr.has(r)||Boolean(gr.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(r)))};const br={allowList:mr,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},_r={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},wr={entry:"(string|element|function|null)",selector:"(string|element)"};class xr extends z{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return br}static get DefaultType(){return _r}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((e=>this._resolvePossibleFunction(e))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,r]of Object.entries(this._config.content))this._setContent(e,r,t);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},wr)}_setContent(e,t,r){const o=H.findOne(r,e);o&&((t=this._resolvePossibleFunction(t))?l(t)?this._putElementInTemplate(c(t),o):this._config.html?o.innerHTML=this._maybeSanitize(t):o.textContent=t:o.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,r){if(!e.length)return e;if(r&&"function"==typeof r)return r(e);const o=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...o.body.querySelectorAll("*"));for(const e of s){const r=e.nodeName.toLowerCase();if(!Object.keys(t).includes(r)){e.remove();continue}const o=[].concat(...e.attributes),s=[].concat(t["*"]||[],t[r]||[]);for(const t of o)vr(t,s)||e.removeAttribute(t.nodeName)}return o.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return b(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const jr=new Set(["sanitize","allowList","sanitizeFn"]),Sr="fade",Er="show",Mr=".modal",Tr="hide.bs.modal",Cr="hover",Ar="focus",kr={AUTO:"auto",TOP:"top",RIGHT:g()?"left":"right",BOTTOM:"bottom",LEFT:g()?"right":"left"},Or={allowList:mr,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Lr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Pr extends V{constructor(e,t){if(void 0===r)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Or}static get DefaultType(){return Lr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),F.off(this._element.closest(Mr),Tr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=F.trigger(this._element,this.constructor.eventName("show")),t=(h(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(r),F.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(r),r.classList.add(Er),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.on(e,"mouseover",p);this._queueCallback((()=>{F.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(F.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(Er),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.off(e,"mouseover",p);this._activeTrigger.click=!1,this._activeTrigger[Ar]=!1,this._activeTrigger[Cr]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),F.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Sr,Er),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(Sr),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new xr({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Sr)}_isShown(){return this.tip&&this.tip.classList.contains(Er)}_createPopper(e){const t=b(this._config.placement,[this,e,this._element]),o=kr[t.toUpperCase()];return r.createPopper(this._element,e,this._getPopperConfig(o))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return b(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...b(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)F.on(this._element,this.constructor.eventName("click"),this._config.selector,(e=>{this._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==t){const e=t===Cr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),r=t===Cr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");F.on(this._element,e,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Ar:Cr]=!0,t._enter()})),F.on(this._element,r,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Ar:Cr]=t._element.contains(e.relatedTarget),t._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},F.on(this._element.closest(Mr),Tr,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=G.getDataAttributes(this._element);for(const e of Object.keys(t))jr.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:c(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each((function(){const t=Pr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}v(Pr);const Rr={...Pr.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Ir={...Pr.DefaultType,content:"(null|string|element|function)"};class Dr extends Pr{static get Default(){return Rr}static get DefaultType(){return Ir}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each((function(){const t=Dr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}v(Dr);const Fr=".bs.scrollspy",Nr=`activate${Fr}`,Ur=`click${Fr}`,Br=`load${Fr}.data-api`,Gr="active",zr="[href]",Vr=".nav-link",$r=`${Vr}, .nav-item > ${Vr}, .list-group-item`,Hr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},qr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Wr extends V{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Hr}static get DefaultType(){return qr}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=c(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(F.off(this._config.target,Ur),F.on(this._config.target,Ur,zr,(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,o=t.offsetTop-this._element.offsetTop;if(r.scrollTo)return void r.scrollTo({top:o,behavior:"smooth"});r.scrollTop=o}})))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),r=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},o=(this._rootElement||document.documentElement).scrollTop,s=o>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=o;for(const n of e){if(!n.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(n));continue}const e=n.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&e){if(r(n),!o)return}else s||e||r(n)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=H.find(zr,this._config.target);for(const t of e){if(!t.hash||d(t))continue;const e=H.findOne(decodeURI(t.hash),this._element);u(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Gr),this._activateParents(e),F.trigger(this._element,Nr,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))H.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Gr);else for(const t of H.parents(e,".nav, .list-group"))for(const e of H.prev(t,$r))e.classList.add(Gr)}_clearActiveClass(e){e.classList.remove(Gr);const t=H.find(`${zr}.${Gr}`,e);for(const e of t)e.classList.remove(Gr)}static jQueryInterface(e){return this.each((function(){const t=Wr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}F.on(window,Br,(()=>{for(const e of H.find('[data-bs-spy="scroll"]'))Wr.getOrCreateInstance(e)})),v(Wr);const Xr=".bs.tab",Yr=`hide${Xr}`,Zr=`hidden${Xr}`,Jr=`show${Xr}`,Qr=`shown${Xr}`,Kr=`click${Xr}`,eo=`keydown${Xr}`,to=`load${Xr}`,ro="ArrowLeft",oo="ArrowRight",so="ArrowUp",no="ArrowDown",io="active",ao="fade",lo="show",co=":not(.dropdown-toggle)",uo='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ho=`${`.nav-link${co}, .list-group-item${co}, [role="tab"]${co}`}, ${uo}`,po=`.${io}[data-bs-toggle="tab"], .${io}[data-bs-toggle="pill"], .${io}[data-bs-toggle="list"]`;class fo extends V{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),F.on(this._element,eo,(e=>this._keydown(e))))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?F.trigger(t,Yr,{relatedTarget:e}):null;F.trigger(e,Jr,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(io),this._activate(H.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),F.trigger(e,Qr,{relatedTarget:t})):e.classList.add(lo)}),e,e.classList.contains(ao))}_deactivate(e,t){if(!e)return;e.classList.remove(io),e.blur(),this._deactivate(H.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),F.trigger(e,Zr,{relatedTarget:t})):e.classList.remove(lo)}),e,e.classList.contains(ao))}_keydown(e){if(![ro,oo,so,no].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[oo,no].includes(e.key),r=w(this._getChildren().filter((e=>!d(e))),e.target,t,!0);r&&(r.focus({preventScroll:!0}),fo.getOrCreateInstance(r).show())}_getChildren(){return H.find(ho,this._parent)}_getActiveElem(){return this._getChildren().find((e=>this._elemIsActive(e)))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=H.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains("dropdown"))return;const o=(e,o)=>{const s=H.findOne(e,r);s&&s.classList.toggle(o,t)};o(".dropdown-toggle",io),o(".dropdown-menu",lo),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(io)}_getInnerElement(e){return e.matches(ho)?e:H.findOne(ho,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each((function(){const t=fo.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}F.on(document,Kr,uo,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),d(this)||fo.getOrCreateInstance(this).show()})),F.on(window,to,(()=>{for(const e of H.find(po))fo.getOrCreateInstance(e)})),v(fo);const mo=".bs.toast",yo=`mouseover${mo}`,go=`mouseout${mo}`,vo=`focusin${mo}`,bo=`focusout${mo}`,_o=`hide${mo}`,wo=`hidden${mo}`,xo=`show${mo}`,jo=`shown${mo}`,So="hide",Eo="show",Mo="showing",To={animation:"boolean",autohide:"boolean",delay:"number"},Co={animation:!0,autohide:!0,delay:5e3};class Ao extends V{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Co}static get DefaultType(){return To}static get NAME(){return"toast"}show(){if(F.trigger(this._element,xo).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(So),f(this._element),this._element.classList.add(Eo,Mo),this._queueCallback((()=>{this._element.classList.remove(Mo),F.trigger(this._element,jo),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(F.trigger(this._element,_o).defaultPrevented)return;this._element.classList.add(Mo),this._queueCallback((()=>{this._element.classList.add(So),this._element.classList.remove(Mo,Eo),F.trigger(this._element,wo)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Eo),super.dispose()}isShown(){return this._element.classList.contains(Eo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){F.on(this._element,yo,(e=>this._onInteraction(e,!0))),F.on(this._element,go,(e=>this._onInteraction(e,!1))),F.on(this._element,vo,(e=>this._onInteraction(e,!0))),F.on(this._element,bo,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=Ao.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}q(Ao),v(Ao);return{Alert:Z,Button:Q,Carousel:ke,Collapse:$e,Dropdown:mt,Modal:Zt,Offcanvas:fr,Popover:Dr,ScrollSpy:Wr,Tab:fo,Toast:Ao,Tooltip:Pr}})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}((function(){return function e(t,r,o){function s(i,a){if(!r[i]){if(!t[i]){var l="function"==typeof require&&require;if(!a&&l)return l(i,!0);if(n)return n(i,!0);throw(a=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",a}l=r[i]={exports:{}},t[i][0].call(l.exports,(function(e){return s(t[i][1][e]||e)}),l,l.exports,e,t,r,o)}return r[i].exports}for(var n="function"==typeof require&&require,i=0;i>16&255,a[c++]=t>>8&255,a[c++]=255&t;return 2===i&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,a[c++]=255&t),1===i&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t),a},r.fromByteArray=function(e){for(var t,r=e.length,s=r%3,n=[],i=0,a=r-s;i>18&63]+o[e>>12&63]+o[e>>6&63]+o[63&e]}(s));return n.join("")}(e,i,a>2]+o[t<<4&63]+"==")):2==s&&(t=(e[r-2]<<8)+e[r-1],n.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"=")),n.join("")};for(var o=[],s=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)o[a]=i[a],s[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(0>>1;case"base64":return A(e).length;default:if(n)return s?-1:C(e).length;r=(""+r).toLowerCase(),n=!0}}function f(e,t,r){var s,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var i=t,a=r,l=this.length;(!a||a<0||l=e.length){if(n)return-1;o=e.length-1}else if(o<0){if(!n)return-1;o=0}if("string"==typeof r&&(r=t.from(r,s)),t.isBuffer(r))return 0===r.length?-1:g(e,r,o,s,n);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,r,o):g(e,[r],o,s,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,o,s){var n=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=n=2,a/=2,r/=2}function l(e,t){return 1===n?e[t]:e.readUInt16BE(t*n)}if(s)for(var c=-1,u=r;u>8,o%=256,s.push(o),s.push(r);return s}(t,e.length-r),e,r,o)}function _(e,t,r){r=Math.min(e.length,r);for(var o=[],s=t;s>>10&1023|55296),u=56320|1023&u),o.push(u),s+=d}var h=o,p=h.length;if(p<=w)return String.fromCharCode.apply(String,h);for(var f="",m=0;mt&&(e+=" ... "),""},n&&(t.prototype[n]=t.prototype.inspect),t.prototype.compare=function(e,r,o,s,n){if(O(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===o&&(o=e?e.length:0),void 0===s&&(s=0),void 0===n&&(n=this.length),(r=void 0===r?0:r)<0||o>e.length||s<0||n>this.length)throw new RangeError("out of range index");if(n<=s&&o<=r)return 0;if(n<=s)return-1;if(o<=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(s>>>=0),a=(o>>>=0)-(r>>>=0),l=Math.min(i,a),c=this.slice(s,n),u=e.slice(r,o),d=0;d>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var s=this.length-t;if((void 0===r||sthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var n,i,a,l=!1;;)switch(o){case"hex":var c=e,u=t,d=r,h=(u=Number(u)||0,this.length-u);(!d||h<(d=Number(d)))&&(d=h),(h=c.length)/2e.length)throw new RangeError("Index out of range")}function S(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(e,t,r,o,n){return t=+t,r>>>=0,n||S(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function M(e,t,r,o,n){return t=+t,r>>>=0,n||S(e,0,r,8),s.write(e,t,r,o,52,8),r+8}t.prototype.slice=function(e,r){var o=this.length;(e=~~e)<0?(e+=o)<0&&(e=0):o>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e],s=1,n=0;++n>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e+--t],s=1;0>>=0,t||x(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e],s=1,n=0;++n>>=0,t>>>=0,r||x(e,t,this.length);for(var o=t,s=1,n=this[e+--o];0>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),32768&(t=this[e]|this[e+1]<<8)?4294901760|t:t},t.prototype.readInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),32768&(t=this[e+1]|this[e]<<8)?4294901760|t:t},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),s.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),s.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),s.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),s.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||j(this,e,t,r,Math.pow(2,8*r)-1,0);var s=1,n=0;for(this[t]=255&e;++n>>=0,r>>>=0,o||j(this,e,t,r,Math.pow(2,8*r)-1,0);var s=r-1,n=1;for(this[t+s]=255&e;0<=--s&&(n*=256);)this[t+s]=e/n&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||j(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var s=0,n=1,i=0;for(this[t]=255&e;++s>0)-i&255;return t+r},t.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||j(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var s=r-1,n=1,i=0;for(this[t+s]=255&e;0<=--s&&(n*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/n>>0)-i&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},t.prototype.copy=function(e,r,o,s){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(o=o||0,s||0===s||(s=this.length),r>=e.length&&(r=e.length),(s=0=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length);var n=(s=e.length-r>>=0,o=void 0===o?this.length:o>>>0,"number"==typeof(e=e||0))for(i=r;i>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function A(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var s=0;s=t.length||s>=e.length);++s)t[s+r]=e[s];return s}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function L(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,s=0;s<16;++s)t[o+s]=e[r]+e[s];return t}()}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:238}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),s=e("../internals/object-create"),n=(e=e("../internals/object-define-property"),o("unscopables")),i=Array.prototype;null==i[n]&&e.f(i,n,{configurable:!0,value:s(null)}),t.exports=function(e){i[n][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],8:[function(e,t,r){var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){function o(e){return l(e)&&c(M,u(e))}var s,n=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/has"),u=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),p=e("../internals/object-define-property").f,f=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),g=(e=e("../internals/uid"),a.Int8Array),v=g&&g.prototype,b=(b=a.Uint8ClampedArray)&&b.prototype,_=g&&f(g),w=v&&f(v),x=Object.prototype,j=x.isPrototypeOf,S=(y=y("toStringTag"),e("TYPED_ARRAY_TAG")),E=n&&!!m&&"Opera"!==u(a.opera),M=(e=!1,{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8});for(s in M)a[s]||(E=!1);if((!E||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},E))for(s in M)a[s]&&m(a[s],_);if((!E||!w||w===x)&&(w=_.prototype,E))for(s in M)a[s]&&m(a[s].prototype,w);if(E&&f(b)!==w&&m(b,w),i&&!c(w,y))for(s in e=!0,p(w,y,{get:function(){return l(this)?this[S]:void 0}}),M)a[s]&&d(a[s],S,s);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(j.call(_,e))return e}else for(var t in M)if(c(M,s)&&(t=a[t])&&(e===t||j.call(t,e)))return e;throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in M)(o=a[o])&&c(o.prototype,e)&&delete o.prototype[e];w[e]&&!r||h(w,e,!r&&E&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,s;if(i){if(m){if(r)for(o in M)(s=a[o])&&c(s,e)&&delete s[e];if(_[e]&&!r)return;try{return h(_,e,!r&&E&&g[e]||t)}catch(e){}}for(o in M)!(s=a[o])||s[e]&&!r||h(s,e,t)}},isView:function(e){return"DataView"===(e=u(e))||c(M,e)},isTypedArray:o,TypedArray:_,TypedArrayPrototype:w}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":143,"../internals/well-known-symbol":146}],13:[function(e,t,r){function o(e){return[255&e]}function s(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function i(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return B(e,23,4)}function l(e){return B(e,52,8)}function c(e,t){M(e[P],t,{get:function(){return A(this)[t]}})}function u(e,t,r,o){if((r=w(r))+t>(e=A(e)).byteLength)throw U(R);var s=A(e.buffer).bytes;r+=e.byteOffset,e=s.slice(r,r+t);return o?e:e.reverse()}function d(e,t,r,o,s,n){if((r=w(r))+t>(e=A(e)).byteLength)throw U(R);for(var i=A(e.buffer).bytes,a=r+e.byteOffset,l=o(+s),c=0;c$;)(z=V[$++])in D||m(D,z,I[z]);h.constructor=D}S&&j(e)!==N&&S(e,N);x=new F(new D(2));var H=e.setInt8;x.setInt8(0,2147483648),x.setInt8(1,2147483649),!x.getInt8(0)&&x.getInt8(1)||y(e,{setInt8:function(e,t){H.call(this,e,t<<24>>24)},setUint8:function(e,t){H.call(this,e,t<<24>>24)}},{unsafe:!0})}else D=function(e){v(this,D,O),e=w(e),k(this,{bytes:T.call(new Array(e),0),byteLength:e}),p||(this.byteLength=e)},F=function(e,t,r){v(this,F,L),v(e,D,L);var o=A(e).byteLength;if((t=b(t))<0||o>24},getUint8:function(e){return u(this,1,e)[0]},getInt16:function(e){return((e=u(this,2,e,1>16},getUint16:function(e){return(e=u(this,2,e,1>>0},getFloat32:function(e){return G(u(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){function o(){return this}var s=e("../internals/iterators-core").IteratorPrototype,n=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){return t+=" Iterator",e.prototype=n(s,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/object-define-property"),n=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return s.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){var o=e("../internals/to-primitive"),s=e("../internals/object-define-property"),n=e("../internals/create-property-descriptor");t.exports=function(e,t,r){(t=o(t))in e?s.f(e,t,n(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":138}],41:[function(e,t,r){function o(){return this}var s=e("../internals/export"),n=e("../internals/create-iterator-constructor"),i=e("../internals/object-get-prototype-of"),a=e("../internals/object-set-prototype-of"),l=e("../internals/set-to-string-tag"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/redefine"),d=e("../internals/well-known-symbol"),h=e("../internals/is-pure"),p=e("../internals/iterators"),f=(e=e("../internals/iterators-core")).IteratorPrototype,m=e.BUGGY_SAFARI_ITERATORS,y=d("iterator"),g="values",v="entries";t.exports=function(e,t,r,d,b,_,w){function x(e){if(e===b&&C)return C;if(!m&&e in M)return M[e];switch(e){case"keys":case g:case v:return function(){return new r(this,e)}}return function(){return new r(this)}}n(r,t,d);d=t+" Iterator";var j,S,E=!1,M=e.prototype,T=M[y]||M["@@iterator"]||b&&M[b],C=!m&&T||x(b),A="Array"==t&&M.entries||T;if(A&&(A=i(A.call(new e)),f!==Object.prototype&&A.next&&(h||i(A)===f||(a?a(A,f):"function"!=typeof A[y]&&c(A,y,o)),l(A,d,!0,!0),h&&(p[d]=o))),b==g&&T&&T.name!==g&&(E=!0,C=function(){return T.call(this)}),h&&!w||M[y]===C||c(M,y,C),p[t]=C,b)if(j={values:x(g),keys:_?C:x("keys"),entries:x(v)},w)for(S in j)!m&&!E&&S in M||u(M,S,j[S]);else s({target:t,proto:!0,forced:m||E},j);return j}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146}],42:[function(e,t,r){var o=e("../internals/path"),s=e("../internals/has"),n=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});s(t,e)||i(t,e,{value:n.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":145}],43:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),s=(e=e("../internals/is-object"),o.document),n=e(s)&&e(s.createElement);t.exports=function(e){return n?s.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent"),t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in"),t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,s,n=e("../internals/global");e=e("../internals/engine-user-agent");(n=(n=(n=n.process)&&n.versions)&&n.v8)?s=(o=n.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(s=o[1]),t.exports=s&&+s},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var o=e("../internals/global"),s=e("../internals/object-get-own-property-descriptor").f,n=e("../internals/create-non-enumerable-property"),i=e("../internals/redefine"),a=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var r,u,d,h=e.target,p=e.global,f=e.stat,m=p?o:f?o[h]||a(h,{}):(o[h]||{}).prototype;if(m)for(r in t){if(u=t[r],d=e.noTargetGet?(d=s(m,r))&&d.value:m[r],!c(p?r:h+(f?".":"#")+r,e.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(e.sham||d&&d.sham)&&n(u,"sham",!0),i(m,r,u,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){e("../modules/es.regexp.exec");var o=e("../internals/redefine"),s=e("../internals/fails"),n=e("../internals/well-known-symbol"),i=e("../internals/regexp-exec"),a=e("../internals/create-non-enumerable-property"),l=n("species"),c=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),u="$0"==="a".replace(/./,"$0"),d=!!/./[e=n("replace")]&&""===/./[e]("a","$0"),h=!s((function(){var e=(t=/(?:)/).exec,t=(t.exec=function(){return e.apply(this,arguments)},"ab".split(t));return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));t.exports=function(e,t,r,p){var f,m,y=n(e),g=!s((function(){var t={};return t[y]=function(){return 7},7!=""[e](t)})),v=g&&!s((function(){var t=!1,r=/a/;return"split"===e&&((r={constructor:{}}).constructor[l]=function(){return r},r.flags="",r[y]=/./[y]),r.exec=function(){return t=!0,null},r[y](""),!t}));g&&v&&("replace"!==e||c&&u&&!d)&&("split"!==e||h)||(f=/./[y],r=(v=r(y,""[e],(function(e,t,r,o,s){return t.exec===i?g&&!s?{done:!0,value:f.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}}),{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}))[0],m=v[1],o(String.prototype,e,r),o(RegExp.prototype,y,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})),p&&a(RegExp.prototype[y],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":146,"../modules/es.regexp.exec":181}],53:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return Object.isExtensible(Object.preventExtensions({}))}))},{"../internals/fails":51}],54:[function(e,t,r){var o=e("../internals/a-function");t.exports=function(e,t,r){if(o(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,o){return e.call(t,r,o)};case 3:return function(r,o,s){return e.call(t,r,o,s)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){var o=e("../internals/a-function"),s=e("../internals/is-object"),n=[].slice,i={};t.exports=Function.bind||function(e){var t=o(this),r=n.call(arguments,1),a=function(){var o=r.concat(n.call(arguments));if(this instanceof a){var s=t,l=o.length,c=o;if(!(l in i)){for(var u=[],d=0;d>1,f=23===t?s(2,-24)-s(2,-77):0,m=e<0||0===e&&1/e<0?1:0,y=0;for((e=o(e))!=e||e===1/0?(c=e!=e?1:0,l=r):(l=n(i(e)/a),e*(u=s(2,-l))<1&&(l--,u*=2),2<=(e+=1<=l+p?f/u:f*s(2,1-p))*u&&(l++,u/=2),r<=l+p?(c=0,l=r):1<=l+p?(c=(e*u-1)*s(2,t),l+=p):(c=e*s(2,p-1)*s(2,t),l=0));8<=t;d[y++]=255&c,c/=256,t-=8);for(l=l<>1,l=o-7,c=n-1,u=127&(o=e[c--]);for(o>>=7;0>=-l,l+=t;0"+e+""},m=function(){try{s=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=s?((e=s).write(f("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=u("iframe"),t="java"+h+":",e.style.display="none",c.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[p]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=n(e),r=new o,o[d]=null,r[p]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/object-define-property"),n=e("../internals/an-object"),i=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){n(e);for(var r,o=i(t),a=o.length,l=0;ll;)!o(a,r=t[l++])||~n(c,r)||c.push(r);return c}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":132}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),s=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,s)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){var o={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,n=s&&!o.call({1:2},1);r.f=n?function(e){return!!(e=s(this,e))&&e.enumerable}:o},{}],101:[function(e,t,r){var o=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(r){}return function(r,n){return o(r),s(n),t?e.call(r,n):r.__proto__=n,r}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){var o=e("../internals/to-string-tag-support"),s=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+s(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":139}],103:[function(e,t,r){var o=e("../internals/get-built-in"),s=e("../internals/object-get-own-property-names"),n=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=s.f(i(e)),r=n.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global"),t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),s=e("../internals/is-object"),n=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),s(t)&&t.constructor===e?t:((0,(e=n.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var o=e("../internals/redefine");t.exports=function(e,t,r){for(var s in t)o(e,s,t[s],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var o=e("../internals/global"),s=e("../internals/create-non-enumerable-property"),n=e("../internals/has"),i=e("../internals/set-global"),a=e("../internals/inspect-source"),l=(e=e("../internals/internal-state")).get,c=e.enforce,u=String(String).split("String");(t.exports=function(e,t,r,a){var l=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable;a=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof t||n(r,"name")||s(r,"name",t),c(r).source=u.join("string"==typeof t?t:"")),e===o?d?e[t]=r:i(t,r):(l?!a&&e[t]&&(d=!0):delete e[t],d?e[t]=r:s(e,t,r))})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||a(this)}))},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),s=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){if("object"!=typeof(r=r.call(e,t)))throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return s.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){var o,s,n=e("./regexp-flags"),i=(e=e("./regexp-sticky-helpers"),RegExp.prototype.exec),a=String.prototype.replace,l=i,c=(o=/a/,s=/b*/g,i.call(o,"a"),i.call(s,"a"),0!==o.lastIndex||0!==s.lastIndex),u=e.UNSUPPORTED_Y||e.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];t.exports=l=c||d||u?function(e){var t,r,o,s,l=this,h=u&&l.sticky,p=n.call(l),f=l.source,m=0,y=e;return h&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=String(e).slice(l.lastIndex),0f((n-d)/w))throw RangeError(h);for(d+=(b-u)*w,u=b,_=0;_n)throw RangeError(h);if(t==u){for(var x=d,j=i;;j+=i){var S=j<=y?1:y+a<=j?a:j-y;if(x>1,e+=f(e/t);p*a>>1>>=1)&&(t+=t))1&n&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],126:[function(e,t,r){var o=e("../internals/fails"),s=e("../internals/whitespaces");t.exports=function(e){return o((function(){return!!s[e]()||"​…᠎"!="​…᠎"[e]()||s[e].name!==e}))}},{"../internals/fails":51,"../internals/whitespaces":147}],127:[function(e,t,r){function o(e){return function(t){return t=String(s(t)),1&e&&(t=t.replace(n,"")),2&e?t.replace(i,""):t}}var s=e("../internals/require-object-coercible"),n=(e="["+e("../internals/whitespaces")+"]",RegExp("^"+e+e+"*")),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":147}],128:[function(e,t,r){function o(e){return function(){x(e)}}function s(e){x(e.data)}function n(e){a.postMessage(e+"",p.protocol+"//"+p.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),c=e("../internals/classof-raw"),u=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),p=(e=e("../internals/engine-is-ios"),a.location),f=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,_={},w="onreadystatechange",x=function(e){var t;_.hasOwnProperty(e)&&(t=_[e],delete _[e],t())};f&&m||(f=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}}),"values"),n.Arguments=n.Array,s("keys"),s("values"),s("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":132}],159:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/indexed-object"),n=e("../internals/to-indexed-object"),i=(e=e("../internals/array-method-is-strict"),[].join);s=s!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:s||!e},{join:function(e){return i.call(n(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":132}],160:[function(e,t,r){e("../internals/export")({target:"Array",proto:!0,forced:(e=e("../internals/array-last-index-of"))!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],161:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/array-iteration").map,n=e("../internals/array-method-has-species-support");e=e("../internals/array-method-uses-to-length"),n=n("map"),e=e("map");o({target:"Array",proto:!0,forced:!n||!e},{map:function(e){return s(this,e,1E;E++)l(b,x=S[E])&&!l(j,x)&&y(j,x,m(b,x));(j.prototype=_).constructor=j,a(n,v,j)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":127,"../internals/to-primitive":138}],170:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],171:[function(e,t,r){function o(e,t,r){return 0===t?r:t%2==1?o(e,t-1,r*e):o(e*e,t/2,r)}var s=e("../internals/export"),n=e("../internals/to-integer"),i=e("../internals/this-number-value"),a=e("../internals/string-repeat"),l=(e=e("../internals/fails"),1..toFixed),c=Math.floor;s({target:"Number",proto:!0,forced:l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!e((function(){l.call({})}))},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*h[r],h[r]=o%1e7,o=c(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=h[t],h[t]=c(r/e),r=r%e*1e7}function s(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===h[t]||(e=String(h[t]),r=""===r?e:r+a.call("0",7-e.length)+e);return r}var l,u,d=i(this),h=(e=n(e),[0,0,0,0,0,0]),p="",f="0";if(e<0||20l;){var u,d,h,p=o[l++],f=a?p.ok:p.fail,m=p.resolve,y=p.reject,g=p.domain;try{f?(a||(2===t.rejection&&function(e,t){S.call(c,(function(){q?z.emit("rejectionHandled",e):J("rejectionhandled",e,t.value)}))}(e,t),t.rejection=1),!0===f?u=i:(g&&g.enter(),u=f(i),g&&(g.exit(),h=!0)),u===p.promise?y(B("Promise-chain cycle")):(d=Y(u))?d.call(u,m,y):m(u)):y(i)}catch(i){g&&!h&&g.exit(),y(i)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&(s=e,n=t,S.call(c,(function(){var e=n.value,t=Q(n);if(t&&(t=A((function(){q?z.emit("unhandledRejection",e,s):J(X,s,e)})),n.rejection=q||Q(n)?2:1,t.error))throw t.value})))})))},J=function(e,t,r){var o;W?((o=G.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),c.dispatchEvent(o)):o={promise:t,reason:r},(t=c["on"+e])?t(o):e===X&&T("Unhandled promise rejection",r)},Q=function(e){return 1!==e.rejection&&!e.parent},K=function(e,t,r,o){return function(s){e(t,r,s,o)}},ee=function(e,t,r,o){t.done||(t.done=!0,(t=o||t).value=r,t.state=2,Z(e,t,!0))},te=function(e,t,r,o){if(!t.done){t.done=!0,o&&(t=o);try{if(e===r)throw B("Promise can't be resolved itself");var s=Y(r);s?E((function(){var o={done:!1};try{s.call(r,K(te,e,o,t),K(ee,e,o,t))}catch(r){ee(e,o,r,t)}})):(t.value=r,t.state=1,Z(e,t,!1))}catch(r){ee(e,{done:!1},r,t)}}};e&&(U=function(e){v(this,U,I),g(e),o.call(this);var t=D(this);try{e(K(te,this,t),K(ee,this,t))}catch(e){ee(this,t,e)}},(o=function(e){F(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=p(U.prototype,{then:function(e,t){var r=N(this),o=$(j(this,U));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=q?z.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&Z(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),s=function(){var e=new o,t=D(e);this.promise=e,this.resolve=K(te,e,t),this.reject=K(ee,e,t)},C.f=$=function(e){return e===U||e===n?new s:H(e)},l||"function"!=typeof d||(i=d.prototype.then,h(d.prototype,"then",(function(e,t){var r=this;return new U((function(e,t){i.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return M(U,V.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:e},{Promise:U}),f(U,I,!1,!0),m(I),n=u(I),a({target:I,stat:!0,forced:e},{reject:function(e){var t=$(this);return t.reject.call(void 0,e),t.promise}}),a({target:I,stat:!0,forced:l||e},{resolve:function(e){return M(l&&this===n?U:this,e)}}),a({target:I,stat:!0,forced:L},{all:function(e){var t=this,r=$(t),o=r.resolve,s=r.reject,n=A((function(){var r=g(t.resolve),n=[],i=0,a=1;w(e,(function(e){var l=i++,c=!1;n.push(void 0),a++,r.call(t,e).then((function(e){c||(c=!0,n[l]=e,--a||o(n))}),s)})),--a||o(n)}));return n.error&&s(n.value),r.promise},race:function(e){var t=this,r=$(t),o=r.reject,s=A((function(){var s=g(t.resolve);w(e,(function(e){s.call(t,e).then(r.resolve,o)}))}));return s.error&&o(s.value),r.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":128,"../internals/well-known-symbol":146}],179:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/get-built-in"),n=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),c=e("../internals/function-bind"),u=(e=e("../internals/fails"),s("Reflect","construct")),d=e((function(){function e(){}return!(u((function(){}),[],e)instanceof e)})),h=!e((function(){u((function(){}))}));o({target:"Reflect",stat:!0,forced:s=d||h,sham:s},{construct:function(e,t){n(e),i(t);var r=arguments.length<3?e:n(arguments[2]);if(h&&!d)return u(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(c.apply(e,o))}return o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t),a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],180:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/global"),n=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,c=e("../internals/is-regexp"),u=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),p=e("../internals/fails"),f=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=s.RegExp,v=g.prototype,b=/a/g,_=/a/g,w=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&n("RegExp",!w||x||p((function(){return _[y]=!1,g(b)!=b||g(_)==_||"/a/i"!=g(b,"i")})))){for(var j=function(e,t){var r,o=this instanceof j,s=c(e),n=void 0===t;return!o&&s&&e.constructor===j&&n?e:(w?s&&!n&&(e=e.source):e instanceof j&&(n&&(t=u.call(e)),e=e.source),x&&(r=!!t&&-1E;)!function(e){e in j||a(j,e,{configurable:!0,get:function(){return g[e]},set:function(t){g[e]=t}})}(S[E++]);(v.constructor=j).prototype=v,h(s,"RegExp",j)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":146}],181:[function(e,t,r){var o=e("../internals/export");e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],182:[function(e,t,r){var o=e("../internals/redefine"),s=e("../internals/an-object"),n=e("../internals/fails"),i=e("../internals/regexp-flags"),a=(e="toString",RegExp.prototype),l=a[e],c=(n=n((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),l.name!=e);(n||c)&&o(RegExp.prototype,e,(function(){var e=s(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)}),{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],183:[function(e,t,r){var o=e("../internals/collection");e=e("../internals/collection-strong");t.exports=o("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),e)},{"../internals/collection":32,"../internals/collection-strong":30}],184:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/object-get-own-property-descriptor").f,n=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),c=(e=e("../internals/is-pure"),"".endsWith),u=Math.min;l=l("endsWith");o({target:"String",proto:!0,forced:!(!e&&!l&&(o=s(String.prototype,"endsWith"))&&!o.writable||l)},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})}))},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],187:[function(e,t,r){var o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/an-object"),n=e("../internals/to-length"),i=e("../internals/require-object-coercible"),a=e("../internals/advance-string-index"),l=e("../internals/regexp-exec-abstract");o("match",1,(function(e,t,r){return[function(t){var r=i(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,r):new RegExp(t)[e](String(r))},function(e){var o=r(t,e,this);if(o.done)return o.value;var i=s(e),c=String(this);if(!i.global)return l(i,c);for(var u=i.unicode,d=[],h=i.lastIndex=0;null!==(p=l(i,c));){var p=String(p[0]);""===(d[h]=p)&&(i.lastIndex=a(c,n(i.lastIndex),u)),h++}return 0===h?null:d}]}))},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":134}],188:[function(e,t,r){e("../internals/export")({target:"String",proto:!0},{repeat:e("../internals/string-repeat")})},{"../internals/export":50,"../internals/string-repeat":125}],189:[function(e,t,r){var o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/an-object"),n=e("../internals/to-object"),i=e("../internals/to-length"),a=e("../internals/to-integer"),l=e("../internals/require-object-coercible"),c=e("../internals/advance-string-index"),u=e("../internals/regexp-exec-abstract"),d=Math.max,h=Math.min,p=Math.floor,f=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;o("replace",2,(function(e,t,r,o){var y=o.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,g=o.REPLACE_KEEPS_$0,v=y?"$":"$0";return[function(r,o){var s=l(this),n=null==r?void 0:r[e];return void 0!==n?n.call(r,s,o):t.call(String(s),r,o)},function(e,o){if(!y&&g||"string"==typeof o&&-1===o.indexOf(v)){var l=r(t,e,this,o);if(l.done)return l.value}for(var b,_=s(e),w=String(this),x="function"==typeof o,j=(x||(o=String(o)),_.global),S=(j&&(b=_.unicode,_.lastIndex=0),[]);null!==(A=u(_,w))&&(S.push(A),j);)""===String(A[0])&&(_.lastIndex=c(w,i(_.lastIndex),b));for(var E,M="",T=0,C=0;C>>0;if(0==n)return[];if(void 0===e)return[o];if(!s(e))return t.call(o,e,n);for(var a,l,c,u=[],p=(r=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),0),m=new RegExp(e.source,r+"g");(a=d.call(m,o))&&!(p<(l=m.lastIndex)&&(u.push(o.slice(p,a.index)),1=n));)m.lastIndex===a.index&&m.lastIndex++;return p===o.length?!c&&m.test("")||u.push(""):u.push(o.slice(p)),u.length>n?u.slice(0,n):u}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t;return[function(t,r){var s=i(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,s,r):o.call(String(s),t,r)},function(e,s){if((i=r(o,e,this,s,o!==t)).done)return i.value;var i=n(e),d=String(this),h=(e=a(i,RegExp),i.unicode),y=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(m?"y":"g"),g=new e(m?i:"^(?:"+i.source+")",y),v=void 0===s?f:s>>>0;if(0==v)return[];if(0===d.length)return null===u(g,d)?[d]:[];for(var b=0,_=0,w=[];_e.key){o.splice(t,0,e);break}t===n&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=L(this).entries,o=b(e,16)return;for(o=0;h();){if(s=null,o>0){if(!("."==h()&&o<4))return;d++}if(!N.test(h()))return;for(;N.test(h());){if(n=parseInt(h(),10),null===s)s=n;else{if(0==s)return;s=10*s+n}if(s>255)return;d++}l[c]=256*l[c]+s,2!=++o&&4!=o||c++}if(4!=o)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;l[c++]=t}else{if(null!==u)return;d++,u=++c}}if(null!==u)for(i=c-u,c=7;0!=c&&i>0;)a=l[c],l[c--]=l[u+i-1],l[u+--i]=a;else if(8!=c)return;return l}(t.slice(1,-1)))?void(e.host=r):R;if(te(e))return t=x(t),V.test(t)||null===(r=function(e){var t,r,o,s,n,i,a,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(r=[],o=0;o1&&"0"==s.charAt(0)&&(n=U.test(s)?16:8,s=s.slice(8==n?1:2)),""===s)i=0;else{if(!(10==n?G:8==n?B:z).test(s))return e;i=parseInt(s,n)}r.push(i)}for(o=0;o=O(256,5-t))return null}else if(i>255)return null;for(a=r.pop(),o=0;o":1,"`":1}),J=b({},Z,{"#":1,"?":1,"{":1,"}":1}),Q=b({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(e,t){var r=w(e,0);return 32x,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,u=l>>16&255,f=l>>8&255,m=(m=h(l=255&l,f,u,c))in a?a[m]:a[m]=function(e,t,r,o,s){let n=0,i=1e100;for(let c=0;ci||((l+=b(a[0]-e))>i||((l+=b(a[1]-t))>i||((l+=b(a[2]-r))>i||(i=l,n=c))))}return n}(l,f,u,c,t);i[e]=m}else{const e="rgb444"===r?p:d;for(let r=0;r>16&255,v=y>>8&255,_=(_=e(y=255&y,v,g))in a?a[_]:a[_]=function(e,t,r,o){let s=0,n=1e100;for(let l=0;ln||((a+=b(i[1]-t))>n||((a+=b(i[2]-r))>n||(n=a,s=l)))}return s}(y,v,g,t);i[r]=_}}return i},default:()=>T,nearestColor:()=>function(e,t,r=g){return e[_(e,t,r)]},nearestColorIndex:()=>_,nearestColorIndexWithDistance:()=>w,prequantize:()=>function(e,{roundRGB:t=5,roundAlpha:r=10,oneBitAlpha:o=null}={}){const s=new Uint32Array(e.buffer);for(let e=0;e>24&255;var n=a>>16&255,i=a>>8&255,a=255&a;l=v(l,r),o&&(l=l<=("number"==typeof o?o:127)?0:255),a=v(a,t),i=v(i,t),n=v(n,t),s[e]=l<<24|n<<16|i<<8|a<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:s=!0,clearAlphaColor:n=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const c="rgba4444"===o,u=function(e,t){const r=new Array("rgb444"===t?4096:65536),o=e.length;if("rgba4444"===t)for(let t=0;t>24&255,i=s>>16&255,a=s>>8&255,l=h(s=255&s,a,i,n);let o=l in r?r[l]:r[l]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=s,o.gc+=a,o.bc+=i,o.ac+=n,o.cnt++}else if("rgb444"===t)for(let t=0;t>16&255,f=c>>8&255,m=p(c=255&c,f,u);let o=m in r?r[m]:r[m]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=c,o.gc+=f,o.bc+=u,o.cnt++}else for(let t=0;t>16&255,v=y>>8&255,b=d(y=255&y,v,g);let o=b in r?r[b]:r[b]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=y,o.gc+=v,o.bc+=g,o.cnt++}return r}(e,o),g=u.length,v=g-1,b=new Uint32Array(g+1);for(var _=0,w=0;w>1]].err<=E);j=S)b[j]=x;b[j]=w}var M,T=_-t;for(w=0;w=M.mtm&&u[M.nn].mtm<=M.tm)break;for(M.mtm==v?C=b[1]=b[b[0]--]:(y(u,C,!1),M.tm=w),E=u[C].err,j=1;(S=j+j)<=b[0]&&(Su[b[S+1]].err&&S++,!(E<=u[x=b[S]].err));j=S)b[j]=x;b[j]=C}var A=u[M.nn],k=M.cnt,O=A.cnt,L=1/(k+O);c&&(M.ac=L*(k*M.ac+O*A.ac)),M.rc=L*(k*M.rc+O*A.rc),M.gc=L*(k*M.gc+O*A.gc),M.bc=L*(k*M.bc+O*A.bc),M.cnt+=A.cnt,M.mtm=++w,u[A.bk].fw=A.fw,u[A.fw].bk=A.bk,A.mtm=v}let P=[];for(w=0;;0){let e=f(Math.round(u[w].rc),0,255),t=f(Math.round(u[w].gc),0,255),r=f(Math.round(u[w].bc),0,255),o=255;c&&(o=f(Math.round(u[w].ac),0,255),a&&(o=o<=(R="number"==typeof a?a:127)?0:255),s&&o<=i&&(e=t=r=n,o=0));var R=c?[e,t,r,o]:[e,t,r];if(function(e,t){for(let s=0;sfunction(e,t,r=5){if(e.length&&t.length){var o=e.map((e=>e.slice(0,3))),s=r*r,n=e[0].length;for(let r=0;rn?l.slice(0,3):l.slice();var i,a=(i=w(o,l.slice(0,3),g))[0];0<(i=i[1])&&i<=s&&(e[a]=l)}}}};for(o in i)s(n,o,{get:i[o],enumerable:!0});var a={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function l(e=256){let t=0,r=new Uint8Array(e);return{get buffer(){return r.buffer},reset(){t=0},bytesView:()=>r.subarray(0,t),bytes:()=>r.slice(0,t),writeByte(e){o(t+1),r[t]=e,t++},writeBytes(e,s=0,n=e.length){o(t+n);for(let o=0;o>>0),0!=o&&(e=Math.max(e,256));const s=r;r=new Uint8Array(e),0>=8,h-=8;if((_>g||m)&&(m?(y=f,g=(1<>=8,h-=8;0>3}function h(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function p(e,t,r){return e>>4<<8|240&t|r>>4}function f(e,t,r){return eo.bytes(),bytesView:()=>o.bytesView(),get buffer(){return o.buffer},get stream(){return o},writeHeader:d,writeFrame(e,t,a,l={}){var{transparent:h=!1,transparentIndex:p=0,delay:f=0,palette:m=null,repeat:y=0,colorDepth:g=8,dispose:v=-1}=l;let b=!1;if(r?c||(b=!0,d(),c=!0):b=Boolean(l.first),t=Math.max(0,Math.floor(t)),a=Math.max(0,Math.floor(a)),b){if(!m)throw new Error("First frame must include a { palette } option");var[l,_,w,x,T=8]=[o,t,a,m,g];T=128|T-1<<4|(x=M(x.length)-1),S(l,_),S(l,w),l.writeBytes([T,0,0]),j(o,m),0<=y&&(_=y,(x=o).writeByte(33),x.writeByte(255),x.writeByte(11),E(x,"NETSCAPE2.0"),x.writeByte(3),x.writeByte(1),S(x,_),x.writeByte(0))}var C,w,T=v,y=w=Math.round(f/10),_=h,x=p,f=((l=o).writeByte(33),l.writeByte(249),l.writeByte(4),x<0&&(x=0,_=!1),_=_?(C=1,2):C=0,0<=T&&(_=7&T),_<<=2,l.writeByte(0|_|C),S(l,y),l.writeByte(x||0),l.writeByte(0),Boolean(m)&&!b);h=t,p=a,C=f?m:null,(v=o).writeByte(44),S(v,0),S(v,0),S(v,h),S(v,p),C?(h=M(C.length)-1,v.writeByte(128|h)):v.writeByte(0),f&&j(o,m),[y,l,p,h,v=8,f,m,e]=[o,e,t,a,g,s,n,i],u(p,h,l,v,y,f,m,e)}};function d(){E(o,"GIF89a")}}function j(e,t){var r=1<>8&255)}function E(e,t){for(var r=0;r>1,u=-7,d=r?s-1:0,h=r?-1:1;s=e[t+d];for(d+=h,n=s&(1<<-u)-1,s>>=-u,u+=a;0>=-u,u+=o;0>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:n-1,p=o?1:-1;n=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+u?d/o:d*Math.pow(2,1-u))*o&&(i++,o/=2),c<=i+u?(a=0,i=c):1<=i+u?(a=(t*o-1)*Math.pow(2,s),i+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,s),i=0));8<=s;e[r+h]=255&a,h+=p,a/=256,s-=8);for(i=i<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])?2:t}function E(e,t){e.f+=t.f,e.b.f+=t.b.f}function M(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?n(t.a,r.a)?a(r.b.a,t.a,r.a)<=0:0<=a(t.b.a,r.a,t.a):a(r.b.a,e,r.a)<=0:r.b.a===e?0<=a(t.b.a,e,t.a):(t=i(t.b.a,e,t.a),(e=i(r.b.a,e,r.a))<=t)}function T(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){f(e.a),e.c=!1,(e.a=t).i=e}function A(e){for(var t=e.a.a;(e=ce(e)).a.a===t;);return e.c&&(C(e,t=y(le(e).a.b,e.a.e)),e=ce(e)),e}function k(e,t,r){var o=new ae;return o.a=r,o.e=V(e.f,t.e,o),r.i=o}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],u[c[h]])?ne:ie)(r,h),u[l]=null,d[l]=r.b,r.b=l}else for(r.c[-(l+1)]=null;0Math.max(y.a,v.a))){if(n(f,y)){if(0r.f&&(r.f*=2,r.c=re(r.c,r.f+1)),0===r.b?s=o:(s=r.b,r.b=r.c[r.b]),r.e[s]=t,r.c[s]=o,r.d[o]=s,r.h&&ie(r,o),s):(r=e.a++,e.c[r]=t,-(r+1))}function ee(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&n(oe(e.b),t))return se(e.b);for(;--e.a,0e.a||n(o[a],o[c])){s[r[i]=a]=i;break}s[r[i]=c]=i,i=l}}function ie(e,t){for(var r=e.d,o=e.e,s=e.c,i=t,a=r[i];;){var l=i>>1,c=r[l];if(0==l||n(o[c],o[a])){s[r[i]=a]=i;break}s[r[i]=c]=i,i=l}}function ae(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function le(e){return e.e.c.b}function ce(e){return e.e.a.b}(o=H.prototype).x=function(){q(this,0)},o.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void W(this,100900)}W(this,100901)},o.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:W(this,100900)}return!1},o.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},o.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:W(this,100900)}},o.C=function(e,t){var r=!1,o=[0,0,0];q(this,2);for(var s=0;s<3;++s){var n=e[s];n<-1e150&&(n=-1e150,r=!0),1e150i[h]&&(i[h]=g,c[h]=d)}if(i[1]-l[1]>i[d=0]-l[0]&&(d=1),l[d=i[2]-l[2]>i[d]-l[d]?2:d]>=i[d])o[0]=0,o[1]=0,o[2]=1;else{for(l=u[d],c=c[d],u=[i=0,0,0],l=[l.g[0]-c.g[0],l.g[1]-c.g[1],l.g[2]-c.g[2]],h=[0,0,0],d=r.e;d!==r;d=d.e)h[0]=d.g[0]-c.g[0],h[1]=d.g[1]-c.g[1],h[2]=d.g[2]-c.g[2],u[0]=l[1]*h[2]-l[2]*h[1],u[1]=l[2]*h[0]-l[0]*h[2],u[2]=l[0]*h[1]-l[1]*h[0],i<(g=u[0]*u[0]+u[1]*u[1]+u[2]*u[2])&&(i=g,o[0]=u[0],o[1]=u[1],o[2]=u[2]);i<=0&&(o[0]=o[1]=o[2]=0,o[S(l)]=1)}r=!0}for(u=S(o),d=this.b.c,i=(u+1)%3,c=(u+2)%3,u=0>=l,u-=l,y==n)a=1+i,c=(1<<(l=s+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var _=b;if(o>=8;null!==m&&a<4096&&(f[a++]=m<<8|_,c+1<=a&&l<12&&(++l,c=c<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=function(e,t,r,o){var s=0,n=void 0===(o=void 0===o?{}:o).loop?null:o.loop,i=void 0===o.palette?null:o.palette;if(t<=0||r<=0||65535>=1;)++l;if(u=1<>8&255,e[s++]=255&r,e[s++]=r>>8&255,e[s++]=(null!==i?128:0)|l,e[s++]=c,e[s++]=0,null!==i)for(var d=0,h=i.length;d>16&255,e[s++]=p>>8&255,e[s++]=255&p}if(null!==n){if(n<0||65535>8&255,e[s++]=0}var f=!1;this.addFrame=function(t,r,o,n,l,c){if(!0===f&&(--s,f=!1),c=void 0===c?{}:c,t<0||r<0||65535>=1;)++p;h=1<>8&255,e[s++]=v,e[s++]=0),e[s++]=44,e[s++]=255&t,e[s++]=t>>8&255,e[s++]=255&r,e[s++]=r>>8&255,e[s++]=255&o,e[s++]=o>>8&255,e[s++]=255&n,e[s++]=n>>8&255,e[s++]=!0===u?128|p-1:0,!0===u)for(var b=0,_=d.length;b<_;++b){var w=d[b];e[s++]=w>>16&255,e[s++]=w>>8&255,e[s++]=255&w}return s=function(e,t,r,o){e[t++]=r;var s=t++,n=1<>=8,u-=8,t===s+256&&(e[s]=255,s=t++)}function p(e){d|=e<>=8,u-=8,t===s+256&&(e[s]=255,s=t++);4096===l?(p(n),l=1+a,c=r+1,m={}):(1<>7&&(a=t,t+=3*(l=i)),!0),u=[],d=0,h=null,p=0,f=null;for(this.width=r,this.height=s;c&&t>2&7,t++;break;case 254:for(;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var y,g=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,w=(E=e[t++])>>6&1,x=a,j=l,S=!1,E=(E>>7&&(S=!0,x=t,t+=3*(j=1<<1+(7&E))),t);for(t++;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}u.push({x:g,y:v,width:b,height:_,has_local_palette:S,palette_offset:x,palette_size:j,data_offset:E,data_length:t-E,transparent_index:h,interlaced:!!w,delay:d,disposal:p});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=u.length)throw new Error("Frame index out of range.");return u[e]},this.decodeAndBlitFrameBGRA=function(t,s){for(var n=(t=this.frameInfo(t)).width*t.height,i=new Uint8Array(n),a=(o(e,t.data_offset,i,n),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,d=c,h=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=h,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=i.length;g>=1)),w===l?f+=4:(b=e[a+3*w],_=e[a+3*w+1],w=e[a+3*w+2],s[f++]=w,s[f++]=_,s[f++]=b,s[f++]=255),--d}},this.decodeAndBlitFrameRGBA=function(t,s){for(var n=(t=this.frameInfo(t)).width*t.height,i=new Uint8Array(n),a=(o(e,t.data_offset,i,n),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,d=c,h=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=h,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=i.length;g>=1)),w===l?f+=4:(b=e[a+3*w],_=e[a+3*w+1],w=e[a+3*w+2],s[f++]=b,s[f++]=_,s[f++]=w,s[f++]=255),--d}}}}catch(e){}},{}],241:[function(e,t,r){(function(o){var s;s=function(t){function r(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length;if(!((e=(e=e?Number(e):0)!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function _(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++s],0<=(o-=t.table[s]););return e.tag=n,e.bitcount-=s,t.trans[r+o]}function w(e,t,r){for(;;){if(256===(n=_(e,t)))return 0;if(n<256)e.dest[e.destLen++]=n;else for(var o,s=b(e,c[n-=257],u[n]),n=_(e,r),i=o=e.destLen-b(e,d[n],h[n]);i>>=1,o=s,b(n,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},T.prototype.addX=function(e){this.addPoint(e,null)},T.prototype.addY=function(e){this.addPoint(null,e)},T.prototype.addBezier=function(e,t,r,o,s,n,i,a){var l=[e,t],c=[r,o],u=[s,n],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var p,f=6*l[h]-12*c[h]+6*u[h],m=-3*l[h]+9*c[h]-9*u[h]+3*d[h],y=3*c[h]-3*l[h];0==m?0==f||0<(p=-y/f)&&p<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],p)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],p))):(p=Math.pow(f,2)-4*y*m)<0||(0<(y=(-f+Math.sqrt(p))/(2*m))&&y<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],y)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],y))),0<(y=(-f-Math.sqrt(p))/(2*m))&&y<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],y)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],y))))}},T.prototype.addQuad=function(e,t,r,o,s,n){r=e+2/3*(r-e),o=t+2/3*(o-t),this.addBezier(e,t,r,o,r+1/3*(s-e),o+1/3*(n-t),s,n)},C.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},C.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},C.prototype.curveTo=C.prototype.bezierCurveTo=function(e,t,r,o,s,n){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:s,y:n})},C.prototype.quadTo=C.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},C.prototype.close=C.prototype.closePath=function(){this.commands.push({type:"Z"})},C.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof T)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},C.prototype.getBoundingBox=function(){for(var e=new T,t=0,r=0,o=0,s=0,n=0;n"},C.prototype.toDOMElement=function(e){e=this.toPathData(e);var t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var O={fail:A,argument:k,assert:k},L={},P={},R={};function I(e){return function(){return e}}P.BYTE=function(e){return O.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},R.BYTE=I(1),P.CHAR=function(e){return[e.charCodeAt(0)]},R.CHAR=I(1),P.CHARARRAY=function(e){for(var t=[],r=0;r>8&255,255&e]},R.USHORT=I(2),P.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},R.SHORT=I(2),P.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},R.UINT24=I(3),P.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},R.ULONG=I(4),P.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},R.LONG=I(4),P.FIXED=P.ULONG,R.FIXED=R.ULONG,P.FWORD=P.SHORT,R.FWORD=R.SHORT,P.UFWORD=P.USHORT,R.UFWORD=R.USHORT,P.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},R.LONGDATETIME=I(8),P.TAG=function(e){return O.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},R.TAG=I(4),P.Card8=P.BYTE,R.Card8=R.BYTE,P.Card16=P.USHORT,R.Card16=R.USHORT,P.OffSize=P.BYTE,R.OffSize=R.BYTE,P.SID=P.USHORT,R.SID=R.USHORT,P.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?P.NUMBER16(e):P.NUMBER32(e)},R.NUMBER=function(e){return P.NUMBER(e).length},P.NUMBER16=function(e){return[28,e>>8&255,255&e]},R.NUMBER16=I(3),P.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},R.NUMBER32=I(5),P.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),s=0,n=t.length;s>8&255,t[t.length]=255&o}return t},R.UTF16=function(e){return 2*e.length};var D,F={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},N=(L.MACSTRING=function(e,t,r,o){var s=F[o];if(void 0!==s){for(var n="",i=0;i>8&255,l+256&255)}return n})(e,t,r)}return r},P.INDEX=function(e){for(var t=1,r=[t],o=[],s=0;s>8,t[u+1]=255&d,t=t.concat(o[c])}return t},R.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var _,w=new oe.Parser(g,v+b+14),x=new oe.Parser(g,v+b+16+2*_),j=new oe.Parser(g,v+b+16+4*_),S=new oe.Parser(g,v+b+16+6*_),E=v+b+16+8*_,M=0;M<_-1;M+=1)for(var T=void 0,C=w.parseUShort(),A=x.parseUShort(),k=j.parseShort(),L=S.parseUShort(),P=A;P<=C;P+=1)0!==L?(E=(E=S.offset+S.relativeOffset-2)+L+2*(P-A),0!==(T=oe.getUShort(g,E))&&(T=T+k&65535)):T=P+k&65535,y.glyphIndexMap[P]=T}return r},ne=function(e){for(var t=!0,r=e.length-1;0>4,i=15&i;if(15==n)break;if(o+=s[n],15==i)break;o+=s[i]}return parseFloat(o)}if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function xe(e,t,r){var o=new oe.Parser(e,t=void 0!==t?t:0),s=[],n=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,p.length=0,m=!0}return function r(a){for(var u,x,j,S,E,M,T,C,A,k,O,L,P=0;PMath.abs(L-v)?g=O+p.shift():v=L+p.shift(),h.curveTo(o,s,n,i,T,C),h.curveTo(A,k,O,L,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+R),p.length=0}break;case 14:0>3;break;case 21:2>16),P+=2;break;case 29:E=p.pop()+e.gsubrsBias,(M=e.gsubrs[E])&&r(M);break;case 30:for(;0=r.begin&&e=ce.length&&(n=o.parseChar(),r.names.push(o.parseString(n)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1})),t.fields=t.fields.concat(o),t.fields=t.fields.concat(s),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");p|=1<>>1,n=e[s].tag;if(n===t)return s;n>>1,n=e[s];if(n===t)return s;n>>1,i=(s=e[n]).start;if(i===t)return s;i(s=e[r-1]).end?0:s}function Tt(e,t){this.font=e,this.tableName=t}function Ct(e){Tt.call(this,e,"gpos")}function At(e){Tt.call(this,e,"gsub")}function kt(e,t,r){for(var o=e.subtables,s=0;st.points.length-1||o.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=It([a=s.points[o.matchedPoints[1]]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0})[0];o.dx=i.x-a.x,o.dy=i.y-a.y,n=It(s.points,o)}t.points=t.points.concat(n)}}return Dt(t.points)}(Ct.prototype=Tt.prototype={searchTag:St,binSearch:Et,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e?this.font.tables[this.tableName]=this.createDefaultTable():t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=i[t-1].tag,"Features must be added in alphabetical order."),i.push(s={tag:r,feature:{params:0,lookupListIndexes:[]}}),n.push(t),s.feature}},getLookupTables:function(e,t,r,o,s){var n=[];if(e=this.getFeatureTable(e,t,r,s)){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,c=0;c",i),r.stack.push(Math.round(64*i))}function vr(e,r){var o=r.stack,s=o.pop(),n=r.fv,i=r.pv,a=r.ppem,l=r.deltaBase+16*(e-1),c=r.deltaShift,u=r.z0;t.DEBUG&&console.log(r.step,"DELTAP["+e+"]",s,o);for(var d=0;d>4)===a&&(0<=(p=(15&p)-8)&&p++,t.DEBUG&&console.log(r.step,"DELTAPFIX",h,"by",p*c),h=u[h],n.setRelative(h,h,p*c,i))}}function br(e,r){var o=r.stack,s=o.pop();t.DEBUG&&console.log(r.step,"ROUND[]"),o.push(64*r.round(s/64))}function _r(e,r){var o=r.stack,s=o.pop(),n=r.ppem,i=r.deltaBase+16*(e-1),a=r.deltaShift;t.DEBUG&&console.log(r.step,"DELTAC["+e+"]",s,o);for(var l=0;l>4)===n&&(0<=(u=(15&u)-8)&&u++,u*=a,t.DEBUG&&console.log(r.step,"DELTACFIX",c,"by",u),r.cvt[c]+=u)}}function wr(e,r){var o,s=(n=r.stack).pop(),n=n.pop(),i=r.z2[s],a=r.z1[n];t.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",s,n),s=e?(o=i.y-a.y,a.x-i.x):(o=a.x-i.x,a.y-i.y),r.dpv=Zt(o,s)}function xr(e,r){var o=r.stack,s=r.prog,n=r.ip;t.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var i=0;i":"_")+(s?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+i.cvt[u]+","+l+")":"",c,"(d =",a,"->",g*y,")"),i.rp1=i.rp0,i.rp2=c,r&&(i.rp0=c)}Ut.prototype.exec=function(e,r){if("number"!=typeof r)throw new Error("Point size is not a number!");if(!(2",s),l.interpolate(h,i,a,c),l.touch(h)}e.loop=1},fr.bind(void 0,0),fr.bind(void 0,1),function(e){for(var r=e.stack,o=e.rp0,s=e.z0[o],n=e.loop,i=e.fv,a=e.pv,l=e.z1;n--;){var c=r.pop(),u=l[c];t.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(s).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},o.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+s))?this.dummyDOM.querySelector("#"+o+i).insertAdjacentHTML("beforebegin",'

')):(r='

'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(n)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+a))?this.dummyDOM.querySelector("#".concat(o+c))&&this.dummyDOM.querySelector("#".concat(o+c)).insertAdjacentHTML("beforebegin",'

')):(r='

'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+l),this.descriptions.label.innerHTML=t)},o.default.prototype._describeElementHTML=function(e,t,r){var o,u=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(u+s))?this.dummyDOM.querySelector("#"+u+i)||this.dummyDOM.querySelector("#"+u+n).insertAdjacentHTML("afterend",'
Canvas elements and their descriptions
')):(o='
Canvas elements and their descriptions
'),this.dummyDOM.querySelector("#".concat(u,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+u).innerHTML=o),(o=document.createElement("tr")).id=u+"_fte_"+t,this.dummyDOM.querySelector("#"+u+i).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(u+a))?this.dummyDOM.querySelector("#".concat(u+c))||this.dummyDOM.querySelector("#"+u+l).insertAdjacentHTML("afterend",'
')):(o='
'),this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+u).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=u+"_lte_"+t,this.dummyDOM.querySelector("#"+u+c).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.replace":189}],248:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateGridOutput=function(e){var t,r,o,s;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){return t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]),t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1])}((r=function(e,t){var r,o="",s="",n=0;for(r in t){var i,a=0;for(i in t[r]){var l='
  • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
  • "),o+=l,a++,n++}s=1').concat(t[o][l].color," ").concat(o,"
    "):'').concat(t[o][l].color," ").concat(o," midpoint"),a[t[o][l].loc.locY][t[o][l].loc.locX]?a[t[o][l].loc.locY][t[o][l].loc.locX]=a[t[o][l].loc.locY][t[o][l].loc.locX]+" "+c:a[t[o][l].loc.locY][t[o][l].loc.locX]=c,n++}for(s in a){var u,d="";for(u in a[s])d+="",void 0!==a[s][u]&&(d+=a[s][u]),d+="";i=i+d+""}return i}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),s!==t.map.innerHTML&&(t.map.innerHTML=s),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.map":161}],249:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function s(e,t,r){return e[0]<.4*t?e[1]<.4*r?"top left":e[1]>.6*r?"bottom left":"mid left":e[0]>.6*t?e[1]<.4*r?"top right":e[1]>.6*r?"bottom right":"mid right":e[1]<.4*r?"top middle":e[1]>.6*r?"bottom middle":"middle"}function n(e,t,r){return 10===(t=Math.floor(e[0]/t*10))&&(t-=1),10===(e=Math.floor(e[1]/r*10))&&(e-=1),{locX:t,locY:e}}o.default.prototype.textOutput=function(e){o.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},o.default.prototype.gridOutput=function(e){o.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},o.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},o.default.prototype._createOutput=function(e,t){var r,o,s,n=this.canvas.id,i=(this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(n).parentNode),"");"Fallback"===t?(r=n+e,this.dummyDOM.querySelector("#".concat(o=n+"accessibleOutput"))||(this.dummyDOM.querySelector("#".concat(n,"_Description"))?this.dummyDOM.querySelector("#".concat(n,"_Description")).insertAdjacentHTML("afterend",'
    ')):this.dummyDOM.querySelector("#".concat(n)).innerHTML='
    '))):"Label"===t&&(r=n+e+(i=t),this.dummyDOM.querySelector("#".concat(o=n+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(n,"_Label"))?this.dummyDOM.querySelector("#".concat(n,"_Label")):this.dummyDOM.querySelector("#".concat(n))).insertAdjacentHTML("afterend",'
    '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(n,"gridOutput").concat(i),s='
    Text Output

      '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",s):this.dummyDOM.querySelector("#".concat(o)).innerHTML=s,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(n,"textOutput").concat(i),s='
      Grid Output

        '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",s):this.dummyDOM.querySelector("#".concat(o)).innerHTML=s,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,i={},a=!0,l=function(e,t){var r;return e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]),[r,e]}(e,t);if("line"===e?(i.color=this.ingredients.colors.stroke,i.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=s([t[0],[1]],this.width,this.height),o=s([t[2],[3]],this.width,this.height),i.loc=n(l,this.width,this.height),i.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?i.color=this.ingredients.colors.stroke:(i.color=this.ingredients.colors.fill,i.area=function(e,t,r,o){var s,n,i,a,l,c,u,d=0;return"arc"===e?(d=(s=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI))*t[2]*t[3]/8,"open"!==t[6]&&"chord"!==t[6]||(u=t[0],n=t[1],i=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),a=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),l=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),c=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),u=Math.abs(u*(a-c)+i*(c-n)+l*(n-a))/2,s>Math.PI?d+=u:d-=u)):"ellipse"===e||"circle"===e?d=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?d=0:"quadrilateral"===e?d=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?d=t[2]*t[3]:"triangle"===e&&(d=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),Math.round(100*d/(r*o))}(e,t,this.width,this.height)),i.pos=s(l,this.width,this.height),i.loc=n(l,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[i]){for(var c in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][c])===JSON.stringify(i)&&(a=!1);!0===a&&this.ingredients.shapes[e].push(i)}}else this.ingredients.shapes[e]=[i]},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.map":161,"core-js/modules/es.number.to-fixed":171}],250:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateTextOutput=function(e){var t,r,o,s;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){return r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following"),r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:")}((r=function(e,t){var r,o="",s=0;for(r in t)for(var n in t[r]){var i='
      • ').concat(t[r][n].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][n].pos,", ").concat(t[r][n].length," pixels long.
      • "):(i+=", at ".concat(t[r][n].pos),"point"!==r&&(i+=", covering ".concat(t[r][n].area,"% of the canvas")),i+="."),o+=i,s++}return{numShapes:s,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),s=function(e,t){var r,o="",s=0;for(r in t)for(var n in t[r]){var i='').concat(t[r][n].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][n].pos,"length = ").concat(t[r][n].length," pixels"):(i+="location = ".concat(t[r][n].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][n].area,"%")),i+=""),o+=i,s++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),s!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=s),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149}],251:[function(e,t,r){var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":246,"./accessibility/describe":247,"./accessibility/gridOutput":248,"./accessibility/outputs":249,"./accessibility/textOutput":250,"./color/color_conversion":252,"./color/creating_reading":253,"./color/p5.Color":254,"./color/setting":255,"./core/constants":256,"./core/environment":257,"./core/friendly_errors/fes_core":258,"./core/friendly_errors/file_errors":259,"./core/friendly_errors/sketch_reader":260,"./core/friendly_errors/stacktrace":261,"./core/friendly_errors/validate_params":262,"./core/helpers":263,"./core/init":264,"./core/legacy":266,"./core/main":267,"./core/p5.Element":268,"./core/p5.Graphics":269,"./core/p5.Renderer":270,"./core/p5.Renderer2D":271,"./core/preload":272,"./core/rendering":273,"./core/shape/2d_primitives":274,"./core/shape/attributes":275,"./core/shape/curves":276,"./core/shape/vertex":277,"./core/shim":278,"./core/structure":279,"./core/transform":280,"./data/local_storage.js":281,"./data/p5.TypedDict":282,"./dom/dom":283,"./events/acceleration":284,"./events/keyboard":285,"./events/mouse":286,"./events/touch":287,"./image/filters":288,"./image/image":289,"./image/loading_displaying":290,"./image/p5.Image":291,"./image/pixels":292,"./io/files":293,"./io/p5.Table":294,"./io/p5.TableRow":295,"./io/p5.XML":296,"./math/calculation":297,"./math/math":298,"./math/noise":299,"./math/p5.Vector":300,"./math/random":301,"./math/trigonometry":302,"./typography/attributes":303,"./typography/loading_displaying":304,"./typography/p5.Font":305,"./utilities/array_functions":306,"./utilities/conversion":307,"./utilities/string_functions":308,"./utilities/time_date":309,"./webgl/3d_primitives":310,"./webgl/interaction":311,"./webgl/light":312,"./webgl/loading":313,"./webgl/material":314,"./webgl/p5.Camera":315,"./webgl/p5.Geometry":316,"./webgl/p5.Matrix":317,"./webgl/p5.RenderBuffer":318,"./webgl/p5.RendererGL":321,"./webgl/p5.RendererGL.Immediate":319,"./webgl/p5.RendererGL.Retained":320,"./webgl/p5.Shader":322,"./webgl/p5.Texture":323,"./webgl/text":324}],252:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.ColorConversion={},e.default.ColorConversion._hsbaToHSLA=function(e){var t=e[0],r=e[1],o=e[2],s=(2-r)*o/2;return 0!=s&&(1==s?r=0:s<.5?r/=2-r:r=r*o/(2-2*s)),[t,r,s,e[3]]},e.default.ColorConversion._hsbaToRGBA=function(e){var t,r,o,s,n,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(s=o,n=l,r):2===t?(s=r,n=l,a):3===t?(s=r,n=o,l):4===t?(s=a,n=r,l):5===t?(s=l,n=r,o):(s=l,n=a,r),[s,n,i,e[3]])},e.default.ColorConversion._hslaToHSBA=function(e){var t=e[0],r=e[1],o=e[2],s=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(s-o)/s,s,e[3]]},e.default.ColorConversion._hslaToRGBA=function(e){var t,r=6*e[0],o=e[1],s=e[2];return 0===o?[s,s,s,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*s-(s=s<.5?(1+o)*s:s+o-s*o),s),t(r,o,s),t(r-2,o,s),e[3]]},e.default.ColorConversion._rgbaToHSBA=function(e){var t,r,o=e[0],s=e[1],n=e[2],i=Math.max(o,s,n),a=i-Math.min(o,s,n);return 0==a?r=t=0:(r=a/i,o===i?t=(s-n)/a:s===i?t=2+(n-o)/a:n===i&&(t=4+(o-s)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},e.default.ColorConversion._rgbaToHSLA=function(e){var t,r,o,s=e[0],n=e[1],i=e[2],a=Math.max(s,n,i),l=a+(o=Math.min(s,n,i));return 0==(o=a-o)?r=t=0:(r=l<1?o/l:o/(2-l),s===a?t=(n-i)/o:n===a?t=2+(i-s)/o:i===a&&(t=4+(s-n)/o),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]},e=e.default.ColorConversion,r.default=e},{"../core/main":267}],253:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../core/main"))&&l.__esModule?l:{default:l},i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),n.default.prototype.alpha=function(e){return n.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},n.default.prototype.blue=function(e){return n.default._validateParameters("blue",arguments),this.color(e)._getBlue()},n.default.prototype.brightness=function(e){return n.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},n.default.prototype.color=function(){var e;return n.default._validateParameters("color",arguments),arguments[0]instanceof n.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new n.default.Color(this,e))},n.default.prototype.green=function(e){return n.default._validateParameters("green",arguments),this.color(e)._getGreen()},n.default.prototype.hue=function(e){return n.default._validateParameters("hue",arguments),this.color(e)._getHue()},n.default.prototype.lerpColor=function(e,t,r){n.default._validateParameters("lerpColor",arguments);var o,s,a,l=this._colorMode,c=this._colorMaxes;if(l===i.RGB)s=e.levels.map((function(e){return e/255})),a=t.levels.map((function(e){return e/255}));else if(l===i.HSB)e._getBrightness(),t._getBrightness(),s=e.hsba,a=t.hsba;else{if(l!==i.HSL)throw new Error("".concat(l,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),s=e.hsla,a=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(s[0],a[0],r),t=this.lerp(s[1],a[1],r),o=this.lerp(s[2],a[2],r),s=this.lerp(s[3],a[3],r),e*=c[l][0],t*=c[l][1],o*=c[l][2],s*=c[l][3],this.color(e,t,o,s)},n.default.prototype.lightness=function(e){return n.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},n.default.prototype.red=function(e){return n.default._validateParameters("red",arguments),this.color(e)._getRed()},n.default.prototype.saturation=function(e){return n.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var l=n.default;r.default=l},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],254:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=c(e("../core/main")),i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants")),a=c(e("./color_conversion"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}n.default.Color=function(e,t){if(this._storeModeAndMaxes(e._colorMode,e._colorMaxes),this.mode!==i.RGB&&this.mode!==i.HSL&&this.mode!==i.HSB)throw new Error("".concat(this.mode," is an invalid colorMode."));return this._array=n.default.Color._parseInputs.apply(this,t),this._calculateLevels(),this},n.default.Color.prototype.toString=function(e){var t=this.levels,r=this._array,o=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[3].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[i.HSB][0],", ",this.hsba[1]*this.maxes[i.HSB][1],", ",this.hsba[2]*this.maxes[i.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[i.HSB][0],", ",this.hsba[1]*this.maxes[i.HSB][1],", ",this.hsba[2]*this.maxes[i.HSB][2],", ",o,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[i.HSL][0],", ",this.hsla[1]*this.maxes[i.HSL][1],", ",this.hsla[2]*this.maxes[i.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[i.HSL][0],", ",this.hsla[1]*this.maxes[i.HSL][1],", ",this.hsla[2]*this.maxes[i.HSL][2],", ",o,")");case"hsla%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",o,")")}},n.default.Color.prototype.setRed=function(e){this._array[0]=e/this.maxes[i.RGB][0],this._calculateLevels()},n.default.Color.prototype.setGreen=function(e){this._array[1]=e/this.maxes[i.RGB][1],this._calculateLevels()},n.default.Color.prototype.setBlue=function(e){this._array[2]=e/this.maxes[i.RGB][2],this._calculateLevels()},n.default.Color.prototype.setAlpha=function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()},n.default.Color.prototype._calculateLevels=function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r]);this.hsla=null,this.hsba=null},n.default.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},n.default.Color.prototype._storeModeAndMaxes=function(e,t){this.mode=e,this.maxes=t},n.default.Color.prototype._getMode=function(){return this.mode},n.default.Color.prototype._getMaxes=function(){return this.maxes},n.default.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[i.RGB][2]},n.default.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[i.HSB][2]},n.default.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[i.RGB][1]},n.default.Color.prototype._getHue=function(){return this.mode===i.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[i.HSB][0]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[i.HSL][0])},n.default.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[i.HSL][2]},n.default.Color.prototype._getRed=function(){return this._array[0]*this.maxes[i.RGB][0]},n.default.Color.prototype._getSaturation=function(){return this.mode===i.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[i.HSB][1]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[i.HSL][1])};var u={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},d=(e=/\s*/,/(\d{1,3})/),h=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,p=new RegExp("".concat(h.source,"%")),f={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",d.source,",",d.source,",",d.source,"\\)$"].join(e.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",p.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),RGBA:new RegExp(["^rgba\\(",d.source,",",d.source,",",d.source,",",h.source,"\\)$"].join(e.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",p.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i"),HSL:new RegExp(["^hsl\\(",d.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),HSLA:new RegExp(["^hsla\\(",d.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i"),HSB:new RegExp(["^hsb\\(",d.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),HSBA:new RegExp(["^hsba\\(",d.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i")};n.default.Color._parseInputs=function(e,t,r,o){var s,l=arguments.length,c=this.mode,d=this.maxes[c],h=[];if(3<=l){for(h[0]=e/d[0],h[1]=t/d[1],h[2]=r/d[2],h[3]="number"==typeof o?o/d[3]:1,s=h.length-1;0<=s;--s){var p=h[s];p<0?h[s]=0:1"].indexOf(t[0])?void 0:t[0],lineNumber:t[1],columnNumber:t[2],source:e}}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[2],source:e}}),this)},parseOpera:function(e){return!e.stacktrace||-1e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),o=[],s=2,n=r.length;s/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}}),this)}}}e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../main"))&&e.__esModule?e:{default:e}).default._getErrorStackParser=function(){return new o},e=e.default,r.default=e},{"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191}],262:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(s=e("../main"))&&s.__esModule?s:{default:s};function n(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,n=function(){return e},e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}(function(e){if(!(e&&e.__esModule||null===e||"object"!==i(e)&&"function"!=typeof e)){var t=n();if(t&&t.has(e))return t.get(e);var r,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=s?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r])}o.default=e,t&&t.set(e,o)}})(e("../constants")),e("../internationalization"),s.default._validateParameters=s.default._clearValidateParamsCache=function(){},e=s.default,r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.map":166,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],263:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=n?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("./constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,s){return s===n.CORNER?{x:e,y:t,w:r,h:o}:s===n.CORNERS?{x:e,y:t,w:r-e,h:o-t}:s===n.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:s===n.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":256,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],264:[function(e,t,r){e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(s=e("../core/main"))&&s.__esModule?s:{default:s};e("./internationalization");var s=Promise.resolve();Promise.all([new Promise((function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)})),s]).then((function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default}))},{"../core/main":267,"./internationalization":265,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/web.dom-collections.iterator":230}],265:[function(e,t,r){e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var o,s=i(e("i18next")),n=i(e("i18next-browser-languagedetector"));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.init(t,r)}var t;return(t=[{key:"fetchWithTimeout",value:function(e,t){var r=2=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);return(n=new s.default.Image(r,o)).canvas.getContext("2d").drawImage(a,e,t,r*i,o*i,0,0,r,o),n},s.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading},s.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*n._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},s.default.Renderer.prototype.textStyle=function(e){return e?(e!==n.NORMAL&&e!==n.ITALIC&&e!==n.BOLD&&e!==n.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},s.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},s.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},s.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},s.default.Renderer.prototype.textWrap=function(e){return this._setProperty("_textWrap",e),this._textWrap},s.default.Renderer.prototype.text=function(e,t,r,o,s){var i,a,l,c,u=this._pInst,d=this._textWrap,h=Number.MAX_VALUE,p=r;if((this._doFill||this._doStroke)&&void 0!==e){if(i=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===n.CENTER&&(t-=o/2),this._textAlign){case n.CENTER:t+=o/2;break;case n.RIGHT:t+=o}if(void 0!==s){this._rectMode===n.CENTER&&(r-=s/2,p-=s/2);e=r;var f=u.textAscent();switch(this._textBaseline){case n.BOTTOM:c=r+s,r=Math.max(c,r),p+=f;break;case n.CENTER:c=r+s/2,r=Math.max(c,r),p+=f/2}h=r+s-f,this._textBaseline===n.CENTER&&(h=e+s-f/2)}else{if(this._textBaseline===n.BOTTOM)return console.warn("textAlign(*, BOTTOM) requires x, y, width and height");if(this._textBaseline===n.CENTER)return console.warn("textAlign(*, CENTER) requires x, y, width and height")}if(d===n.WORD){for(var m=[],y=0;yi.HALF_PI&&e<=3*i.HALF_PI?Math.atan(r/o*Math.tan(e))+i.PI:Math.atan(r/o*Math.tan(e))+i.TWO_PI,t=t<=i.HALF_PI?Math.atan(r/o*Math.tan(t)):t>i.HALF_PI&&t<=3*i.HALF_PI?Math.atan(r/o*Math.tan(t))+i.PI:Math.atan(r/o*Math.tan(t))+i.TWO_PI),tf||Math.abs(this.accelerationY-this.pAccelerationY)>f||Math.abs(this.accelerationZ-this.pAccelerationZ)>f)&&n.deviceMoved(),"function"==typeof n.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},a._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},a._createImageData=function(e,t){return a._tmpCanvas=document.createElement("canvas"),a._tmpCtx=a._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},a.apply=function(e,t,r){var o=e.getContext("2d"),s=o.getImageData(0,0,e.width,e.height);(t=t(s,r))instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(s,0,0,0,0,e.width,e.height)},a.threshold=function(e,t){for(var r=a._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),s=0;s>8)/o,r[s+1]=255*(i*t>>8)/o,r[s+2]=255*(l*t>>8)/o}},a.dilate=function(e){for(var t,r,o,s,n,i,l,c,u,d=a._toPixels(e),h=0,p=d.length?d.length/4:0,f=new Int32Array(p);h>16&255)+151*(s>>8&255)+28*(255&s))<(l=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,s=l),s<(l=77*((u=a._getARGB(d,c))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,s=l),s<(c=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=n,s=c),s<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,s=u),f[h++]=o;a._setPixels(d,f)},a.erode=function(e){for(var t,r,o,s,n,i,l,c,u,d=a._toPixels(e),h=0,p=d.length?d.length/4:0,f=new Int32Array(p);h>16&255)+151*(u>>8&255)+28*(255&u))<(s=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=u,s=l),(l=77*((u=a._getARGB(d,c))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(n>>8&255)+28*(255&n))>16&255)+151*(i>>8&255)+28*(255&i))>>24],l+=G[(16711680&z)>>16],c+=G[(65280&z)>>8],u+=G[255&z],r+=n[E],h++}M[p=k+j]=d/r,T[p]=l/r,C[p]=c/r,A[p]=u/r}k+=v}for(m=(f=-o)*v,S=k=0;S"+p.length.toString()+" out of "+l.toString()),e.next=45,new Promise((function(e){return setTimeout(e,0)}));e.next=47;break;case 45:e.next=36;break;case 47:f.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(h),g=(0,c.GIFEncoder)(),v=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+j.toString()+" out of "+l.toString()),e.next=65,new Promise((function(e){return setTimeout(e,0)}));case 65:j++,e.next=57;break;case 68:g.finish(),T=g.bytesView(),T=new Blob([T],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),f.html("Done. Downloading your gif!🌸"),n.default.prototype.downloadFile(T,t,"gif");case 77:case"end":return e.stop()}}),e,this)}));var e,t=function(){var t=this,r=arguments;return new Promise((function(o,s){var n=e.apply(t,r);function i(e){h(n,o,s,i,a,"next",e)}function a(e){h(n,o,s,i,a,"throw",e)}i(void 0)}))};return function(e,r){return t.apply(this,arguments)}}(),n.default.prototype.image=function(e,t,r,o,s,l,c,u,d,h,f,m){n.default._validateParameters("image",arguments);var y=e.width,g=e.height,v=(m=m||a.CENTER,f=f||a.CENTER,e.elt&&e.elt.videoWidth&&!e.canvas&&(y=e.elt.videoWidth,g=e.elt.videoHeight),o||y);s=s||g,l=l||0,c=c||0,u=p(u||y,y),y=p(d||g,g),d=1;e.elt&&!e.canvas&&e.elt.style.width&&(d=e.elt.videoWidth&&!o?e.elt.videoWidth:e.elt.width,d/=parseInt(e.elt.style.width,10)),l*=d,c*=d,y*=d,u*=d,g=function(e,t,r,o,s,n,i,l,c,u,d){var h,p,f,m,y,g,v,b,_;return e===a.COVER&&(h=t,f=r,v=n,b=i,g=l,_=c,p=u,m=d,v/=y=Math.max(v/p,b/m),b/=y,y=g,g=_,h===a.CENTER?y+=(p-v)/2:h===a.RIGHT&&(y+=p-v),f===a.CENTER?g+=(m-b)/2:f===a.BOTTOM&&(g+=m-b),l=(_={x:y,y:g,w:v,h:b}).x,c=_.y,u=_.w,d=_.h),e===a.CONTAIN&&(h=t,p=r,f=o,m=s,y=n,g=i,v=u,b=d,v/=_=Math.max(v/y,b/g),b/=_,_=f,f=m,h===a.CENTER?_+=(y-v)/2:h===a.RIGHT&&(_+=y-v),p===a.CENTER?f+=(g-b)/2:p===a.BOTTOM&&(f+=g-b),o=(e={x:_,y:f,w:v,h:b}).x,s=e.y,n=e.w,i=e.h),{sx:l,sy:c,sw:u,sh:d,dx:o,dy:s,dw:n,dh:i}}(h,f,m,(g=i.default.modeAdjust(t,r,v,s,this._renderer._imageMode)).x,g.y,g.w,g.h,l,c,u,y),this._renderer.image(e,g.sx,g.sy,g.sw,g.sh,g.dx,g.dy,g.dw,g.dh)},n.default.prototype.tint=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))},o.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},o.default.Image.prototype.loadPixels=function(){o.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},o.default.Image.prototype.updatePixels=function(e,t,r,s){o.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,s),this.setModified(!0)},o.default.Image.prototype.get=function(e,t,r,s){return o.default._validateParameters("p5.Image.get",arguments),o.default.Renderer2D.prototype.get.apply(this,arguments)},o.default.Image.prototype._getPixel=o.default.Renderer2D.prototype._getPixel,o.default.Image.prototype.set=function(e,t,r){o.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},o.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var o=this.gifProperties,s=0;s/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),s.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print(""),n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==i[0]){n.print(" ");for(var h=0;h".concat(p)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var m=0;m".concat(y)),n.print(" ")}n.print(" ")}n.print("
        "),n.print(""),n.print("")}n.close(),n.clear()},s.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream";s.default.prototype._isSafari()&&(o="text/plain"),e=new Blob(e,{type:o});s.default.prototype.downloadFile(e,t,r)},s.default.prototype.downloadFile=function(e,t,r){var o;r=(t=u(t,r))[0];e instanceof Blob?i.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),s.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},s.default.prototype._checkFileExtension=u,s.default.prototype._isSafari=function(){return 0>>0},n=function(){return(t=(1664525*t+1013904223)%r)/r};o(e),s=new Array(4096);for(var i=0;i<4096;i++)s[i]=n()},e=e.default;r.default=e},{"../core/main":267}],300:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(u=e("../core/main"))&&u.__esModule?u:{default:u},i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function c(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}n.default.Vector=function(){var e,t,r="[object Function]"==={}.toString.call(arguments[0])?(this.isPInst=!0,this._fromRadians=arguments[0],this._toRadians=arguments[1],e=arguments[2]||0,t=arguments[3]||0,arguments[4]||0):(e=arguments[0]||0,t=arguments[1]||0,arguments[2]||0);this.x=e,this.y=t,this.z=r},n.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},n.default.Vector.prototype.set=function(e,t,r){return e instanceof n.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},n.default.Vector.prototype.copy=function(){return this.isPInst?new n.default.Vector(this._fromRadians,this._toRadians,this.x,this.y,this.z):new n.default.Vector(this.x,this.y,this.z)},n.default.Vector.prototype.add=function(e,t,r){return e instanceof n.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this},n.default.Vector.prototype.rem=function(e,t,r){var o;if(e instanceof n.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z))return s=parseFloat(e.x),i=parseFloat(e.y),o=parseFloat(e.z),c.call(this,s,i,o)}else if(e instanceof Array){if(e.every((function(e){return Number.isFinite(e)})))return 2===e.length?l.call(this,e[0],e[1]):3===e.length?c.call(this,e[0],e[1],e[2]):void 0}else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var s=Array.prototype.slice.call(arguments);if(s.every((function(e){return Number.isFinite(e)}))&&2===s.length)return l.call(this,s[0],s[1])}else if(3===arguments.length){var i=Array.prototype.slice.call(arguments);if(i.every((function(e){return Number.isFinite(e)}))&&3===i.length)return c.call(this,i[0],i[1],i[2])}},n.default.Vector.prototype.sub=function(e,t,r){return e instanceof n.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},n.default.Vector.prototype.mult=function(e,t,r){var o;return e instanceof n.default.Vector?Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z?(this.x*=e.x,this.y*=e.y,this.z*=e.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"):e instanceof Array?e.every((function(e){return Number.isFinite(e)}))&&e.every((function(e){return"number"==typeof e}))?1===e.length?(this.x*=e[0],this.y*=e[0],this.z*=e[0]):2===e.length?(this.x*=e[0],this.y*=e[1]):3===e.length&&(this.x*=e[0],this.y*=e[1],this.z*=e[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"):(o=Array.prototype.slice.call(arguments)).every((function(e){return Number.isFinite(e)}))&&o.every((function(e){return"number"==typeof e}))?(1===arguments.length&&(this.x*=e,this.y*=e,this.z*=e),2===arguments.length&&(this.x*=e,this.y*=t),3===arguments.length&&(this.x*=e,this.y*=t,this.z*=r)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this},n.default.Vector.prototype.div=function(e,t,r){if(e instanceof n.default.Vector)if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z){var o=0===e.z&&0===this.z;if(0===e.x||0===e.y||!o&&0===e.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=e.x,this.y/=e.y,o||(this.z/=e.z)}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(e instanceof Array)if(e.every((function(e){return Number.isFinite(e)}))&&e.every((function(e){return"number"==typeof e}))){if(e.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===e.length?(this.x/=e[0],this.y/=e[0],this.z/=e[0]):2===e.length?(this.x/=e[0],this.y/=e[1]):3===e.length&&(this.x/=e[0],this.y/=e[1],this.z/=e[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if((o=Array.prototype.slice.call(arguments)).every((function(e){return Number.isFinite(e)}))&&o.every((function(e){return"number"==typeof e}))){if(o.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===arguments.length&&(this.x/=e,this.y/=e,this.z/=e),2===arguments.length&&(this.x/=e,this.y/=t),3===arguments.length&&(this.x/=e,this.y/=t,this.z/=r)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number");return this},n.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},n.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},n.default.Vector.prototype.dot=function(e,t,r){return e instanceof n.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},n.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z;e=this.x*e.y-this.y*e.x;return this.isPInst?new n.default.Vector(this._fromRadians,this._toRadians,t,r,e):new n.default.Vector(t,r,e)},n.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},n.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},n.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},o.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},o.default.prototype.random=function(e,t){var r,n;return o.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(th&&(_=d,b=a,n=l,d=j+h*(i&&j=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.repeat":188}],308:[function(e,t,r){e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l};function s(e,t,r){var o=e<0,s=(e=o?e.toString().substring(1):e.toString()).indexOf("."),n=-1!==s?e.substring(0,s):e,i=-1!==s?e.substring(s+1):"",a=o?"-":"";if(void 0!==r){o="",(-1!==s||0r&&(i=i.substring(0,r));for(var l=0;lo.length)for(var s=t-(o+=-1===r?".":"").length+1,n=0;n=i.TWO_PI?"".concat(h="ellipse","|"):"".concat(h="arc","|").concat(a,"|").concat(l,"|").concat(c,"|")).concat(u,"|"),h=(this.geometryInHash(d)||((t=new n.default.Geometry(u,1,(function(){if(this.strokeIndices=[],a.toFixed(10)!==l.toFixed(10)){c!==i.PIE&&void 0!==c||(this.vertices.push(new n.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=e/u*(l-a)+a,r=.5+Math.cos(t)/2;t=.5+Math.sin(t)/2;this.vertices.push(new n.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(m>>10&31)/31):(r=a,s=l,c)),new o.default.Vector(g,v,b)),w=1;w<=3;w++){var x=y+12*w;x=new o.default.Vector(u.getFloat32(x,!0),u.getFloat32(4+x,!0),u.getFloat32(8+x,!0));e.vertices.push(x),e.vertexNormals.push(_),h&&i.push(r,s,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{if(t=new DataView(t),!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");(function(e,t){for(var r,s,n="",i=[],a=0;a=Math.PI)&&(s*=-1),(i+=r)<0&&(i=.1),e=Math.sin(n)*i*Math.sin(o),t=Math.cos(n)*i,r=Math.sin(n)*i*Math.cos(o);this.camera(e+this.centerX,t+this.centerY,r+this.centerZ,this.centerX,this.centerY,this.centerZ,0,s,0)},o.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},o.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])},e=o.default.Camera,r.default=e},{"../core/main":267}],316:[function(e,t,r){e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineTangentsIn=[],this.lineTangentsOut=[],this.lineSides=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.lineVertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},o.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},o.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,o=this.detailX+1,s=0;sthis.vertices.length-1-this.detailX;s--)e.add(this.vertexNormals[s]);e=o.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},o.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},o.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),r.drawArrays(r.Points,0,e.length),o.unbindShader()},o.default.RendererGL);r.default=n},{"../core/main":267,"./p5.RenderBuffer":318,"./p5.RendererGL":321,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.some":163,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/web.dom-collections.iterator":230}],321:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=c(e("../core/main")),i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants")),a=c(e("libtess"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n gl_FragColor *= saturate(max(antialias, cover));\n}\n",lineVert:m+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:m+"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n"};n.default.RendererGL=function(e,t,r,o){return n.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._pInst._setProperty("drawingContext",this.drawingContext),this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=i.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curAmbientColor=this._cachedFillStyle=[1,1,1,1],this.curSpecularColor=this._cachedFillStyle=[0,0,0,0],this.curEmissiveColor=this._cachedFillStyle=[0,0,0,0],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=i.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._useLineColor=!1,this._useVertexColor=!1,this.registerEnabled=[],this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new n.default.Matrix,this.uPMatrix=new n.default.Matrix,this.uNMatrix=new n.default.Matrix("mat3"),this._currentNormal=new n.default.Vector(0,0,1),this._curCamera=new n.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new n.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new n.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new n.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],fill:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new n.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new n.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new n.default.Geometry,shapeMode:i.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new n.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new n.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new n.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new n.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new n.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.curStrokeCap=i.ROUND,this.curStrokeJoin=i.ROUND,this.textures=[],this.textureMode=i.IMAGE,this.textureWrapX=i.CLAMP,this.textureWrapY=i.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this.isProcessingVertices=!1,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},n.default.RendererGL.prototype=Object.create(n.default.Renderer.prototype),n.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},n.default.RendererGL.prototype._initContext=function(){if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)},n.default.RendererGL.prototype._resetContext=function(e,t){var r,o=this.width,s=this.height,i=this.canvas.id,a=this._pInst instanceof n.default.Graphics;a?((r=this._pInst).canvas.parentNode.removeChild(r.canvas),r.canvas=document.createElement("canvas"),(r._pInst._userNode||document.body).appendChild(r.canvas),n.default.Element.call(r,r.canvas,r._pInst),r.width=o,r.height=s):((r=this.canvas)&&r.parentNode.removeChild(r),(r=document.createElement("canvas")).id=i,(this._pInst._userNode||document.body).appendChild(r),this._pInst.canvas=r,this.canvas=r),i=new n.default.RendererGL(this._pInst.canvas,this._pInst,!a);this._pInst._setProperty("_renderer",i),i.resize(o,s),i._applyDefaults(),a||this._pInst._elements.push(i),"function"==typeof t&&setTimeout((function(){t.apply(window._renderer,e)}),0)},n.default.prototype.setAttributes=function(e,t){if(void 0===this._glAttributes)console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");else{var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var o in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(o))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}},n.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},n.default.RendererGL.prototype.background=function(){var e=(o=(o=this._pInst).color.apply(o,arguments)).levels[0]/255,t=o.levels[1]/255,r=o.levels[2]/255,o=o.levels[3]/255;this.clear(e,t,r,o)},n.default.RendererGL.prototype.fill=function(e,t,r,o){var s=n.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=s._array,this.drawMode=i.FILL,this._useNormalMaterial=!1,this._tex=null},n.default.RendererGL.prototype.stroke=function(e,t,r,o){var s=n.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=s._array},n.default.RendererGL.prototype.strokeCap=function(e){this.curStrokeCap=e},n.default.RendererGL.prototype.strokeJoin=function(e){this.curStrokeJoin=e},n.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},n.default.RendererGL.prototype.blendMode=function(e){e===i.DARKEST||e===i.LIGHTEST||e===i.ADD||e===i.BLEND||e===i.SUBTRACT||e===i.SCREEN||e===i.EXCLUSION||e===i.REPLACE||e===i.MULTIPLY||e===i.REMOVE?this.curBlendMode=e:e!==i.BURN&&e!==i.OVERLAY&&e!==i.HARD_LIGHT&&e!==i.SOFT_LIGHT&&e!==i.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},n.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._applyBlendMode(i.REMOVE),this._isErasing=!0,this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])},n.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this._isErasing=!1,this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode))},n.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},n.default.RendererGL.prototype._getPixel=function(e,t){var r=new Uint8Array(4);return this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},n.default.RendererGL.prototype.loadPixels=function(){var e,t=this._pixelsState;!0!==this._pInst._glAttributes.preserveDrawingBuffer?console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true."):(t=t.pixels,e=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4,t instanceof Uint8Array&&t.length===e||(t=new Uint8Array(e),this._pixelsState._setProperty("pixels",t)),e=this._pInst._pixelDensity,this.GL.readPixels(0,0,this.width*e,this.height*e,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t))},n.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},n.default.RendererGL.prototype.resize=function(e,t){n.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize(),void 0!==(e=this._pixelsState).pixels&&e._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},n.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,o=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e*o,t*o,r*o,o),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},n.default.RendererGL.prototype.applyMatrix=function(e,t,r,o,s,i){16===arguments.length?n.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,o,0,0,0,0,1,0,s,i,0,1])},n.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof n.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},n.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},n.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(n.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},n.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},n.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},n.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},n.default.RendererGL.prototype.push=function(){var e=n.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t.curAmbientColor=this.curAmbientColor,t.curSpecularColor=this.curSpecularColor,t.curEmissiveColor=this.curEmissiveColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,t._currentNormal=this._currentNormal,t.curBlendMode=this.curBlendMode,e},n.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this},n.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},n.default.RendererGL.prototype._getRetainedStrokeShader=n.default.RendererGL.prototype._getImmediateStrokeShader,n.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},n.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},n.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},n.default.RendererGL.prototype._getRetainedLineShader=n.default.RendererGL.prototype._getImmediateLineShader,n.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new n.default.Shader(this,y.phongVert,y.phongFrag):this._defaultLightShader=new n.default.Shader(this,y.lightVert,y.lightTextureFrag)),this._defaultLightShader},n.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new n.default.Shader(this,y.immediateVert,y.vertexColorFrag)),this._defaultImmediateModeShader},n.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new n.default.Shader(this,y.normalVert,y.normalFrag)),this._defaultNormalShader},n.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new n.default.Shader(this,y.normalVert,y.basicFrag)),this._defaultColorShader},n.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new n.default.Shader(this,y.pointVert,y.pointFrag)),this._defaultPointShader},n.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new n.default.Shader(this,y.lineVert,y.lineFrag)),this._defaultLineShader},n.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new n.default.Shader(this,y.fontVert,y.fontFrag)),this._defaultFontShader},n.default.RendererGL.prototype._getEmptyTexture=function(){var e;return this._emptyTexture||((e=new n.default.Image(1,1)).set(0,0,255),this._emptyTexture=new n.default.Texture(this,e)),this._emptyTexture},n.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,o=!1,s=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var l=i.value;if(l.src===e)return l}}catch(e){o=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw s}}return o=new n.default.Texture(this,e),t.push(o),o},n.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uUseLineColor",this._useLineColor),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight),e.setUniform("uStrokeCap",p[this.curStrokeCap]),e.setUniform("uStrokeJoin",f[this.curStrokeJoin])},n.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uUseVertexColor",this._useVertexColor),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uAmbientMatColor",this.curAmbientColor),e.setUniform("uSpecularMatColor",this.curSpecularColor),e.setUniform("uEmissiveMatColor",this.curEmissiveColor),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors),t=this.directionalLightDiffuseColors.length/3,e.setUniform("uDirectionalLightCount",t),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors),t=this.ambientLightColors.length/3,e.setUniform("uAmbientLightCount",t),e.setUniform("uAmbientColor",this.ambientLightColors),t=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",t),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},n.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)},n.default.RendererGL.prototype._bindBuffer=function(e,t,r,o,s){t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r&&(e=new(o||Float32Array)(r),this.GL.bufferData(t,e,s||this.GL.STATIC_DRAW))},n.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var o=0;o>7,127&h,d>>7,127&d);for(var p=0;p>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:s}}}}e("./p5.Shader"),e("./p5.RendererGL.Retained"),i.default.RendererGL.prototype._applyTextProperties=function(){},i.default.RendererGL.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):0};var h=Math.sqrt(3);i.default.RendererGL.prototype._renderText=function(e,t,r,o,s){if(this._textFont&&"string"!=typeof this._textFont){if(!(s<=o)&&this._doFill){if(this._isOpenType()){e.push();s=this._doStroke;var n=this.drawMode,l=(this._doStroke=!1,this.drawMode=a.TEXTURE,this._textFont.font),c=(c=this._textFont._fontInfo)||(this._textFont._fontInfo=new d(l)),u=(r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/l.unitsPerEm,this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),h=(r=!this._defaultFontShader,this._getFontShader()),p=(h.init(),h.bindShader(),r&&(h.setUniform("uGridImageSize",[64,64]),h.setUniform("uCellsImageSize",[64,64]),h.setUniform("uStrokeImageSize",[64,64]),h.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),f=(p||((o=this._textGeom=new i.default.Geometry(1,1,(function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new i.default.Vector(t,e,0)),this.uvs.push(t,e)}))).computeFaces().computeNormals(),p=this.createBuffers("glyph",o)),!0);r=!1,o=void 0;try{for(var m,y=this.retainedMode.buffers.text[Symbol.iterator]();!(f=(m=y.next()).done);f=!0)m.value._prepareBuffer(p,h)}catch(e){r=!0,o=e}finally{try{f||null==y.return||y.return()}finally{if(r)throw o}}this._bindBuffer(p.indexBuffer,u.ELEMENT_ARRAY_BUFFER),h.setUniform("uMaterialColor",this.curFillColor);try{var g=0,v=null,b=l.stringToGlyphs(t),_=!0,w=!1,x=void 0;try{for(var j,S=b[Symbol.iterator]();!(_=(j=S.next()).done);_=!0){var E,M,T=j.value,C=(v&&(g+=l.getKerningValue(v,T)),c.getGlyphInfo(T));C.uGlyphRect&&(E=C.rowInfo,M=C.colInfo,h.setUniform("uSamplerStrokes",C.strokeImageInfo.imageData),h.setUniform("uSamplerRowStrokes",E.cellImageInfo.imageData),h.setUniform("uSamplerRows",E.dimImageInfo.imageData),h.setUniform("uSamplerColStrokes",M.cellImageInfo.imageData),h.setUniform("uSamplerCols",M.dimImageInfo.imageData),h.setUniform("uGridOffset",C.uGridOffset),h.setUniform("uGlyphRect",C.uGlyphRect),h.setUniform("uGlyphOffset",g),h.bindTextures(),u.drawElements(u.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),g+=T.advanceWidth,v=T}}catch(e){w=!0,x=e}finally{try{_||null==S.return||S.return()}finally{if(w)throw x}}}finally{h.unbindShader(),this._doStroke=s,this.drawMode=n,e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":256,"../core/main":267,"./p5.RendererGL.Retained":320,"./p5.Shader":322,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}]},{},[251])(251)}));class se{static availableLanguages=["ar","bn","bs","bg","zh","hr","cs","da","nl","en","et","fi","fr","de","el","gu","he","hi","hu","ga","id","it","ja","ko","lv","lt","ms","ml","mt","ne","nb","pl","pt","ro","ru","si","sk","sl","es","sv","ta","te","th","tr","uk","ur","vi","cy"];static availableTypefaces=["Amstelvar","Anybody","Barlow","Cabin","Emberly","Epilogue","IBMPlexSans","Inconsolata"];static availableTypefacesInfo={Amstelvar:{leading:1.05},Anybody:{leading:1.05},Barlow:{leading:1.05},Cabin:{leading:1.05},Emberly:{leading:1.05},Epilogue:{leading:1.05},IBMPlexSans:{leading:1.05},Inconsolata:{leading:1.05}};static visualisationGrid={height:423,width:300,marginY:20,posterMargins:[.05,.05,.05,.05]};static imageMaxSize=1024;static evolution={popSize:50,noGen:400,crossoverProb:.75,mutationProb:.3,eliteSize:1};static visiblePosters=10;static backgroundStyleOptions=[["Random",0],["Solid",1],["Gradient",2],["Triangle",2]];static textAlignmentOptions=[["Random"],["Top"],["Middle"],["Bottom"]];static textAlignmentTbOptions=[["Random"],["LEFT"],["CENTER"],["RIGHT"]];static typography={defaultColor:"#000000",range:.05,maxSize:.95,minSize:.05};static background={availableStyles:[["Random",2],["Solid",1],["Gradient",2],["Triangle",2]],defaultColors:["#ffffff","#000000"]}}class ne extends re{static get=()=>new ne;constructor(){super()}render(){return F`
        `}createRenderRoot(){return this}}customElements.define("section-divider",ne);class ie extends re{static properties={images:{}};constructor(e,t,r){super(),this.images={imageRandomPlacement:!0,hasImages:!1,blobs:[],amount:0,loading:!1,randomPlacement:!1},this.disable=!1,this._resultsContainer=t,this._errHandlerRef=r,this._onSubmit=async t=>{t.preventDefault(),await e()}}_toggleVisibility=e=>{const t=e.target.dataset.related,r=document.getElementById(t);e.target.checked&&null!==r?r.classList.add("d-none"):r.classList.remove("d-none")};dis=()=>{this.disable=!0,document.querySelector("fieldset").disabled=this.disable};data=()=>({textContent:encodeURIComponent(document.getElementById("formControlTextarea").value),shouldDivide:document.getElementById("lineDivisionCheck").checked,lang:encodeURIComponent(document.getElementById("formControlLang").value),delimiter:encodeURIComponent(document.getElementById("formControlTextDelimiter").value),images:this.images});_uploadImages=async e=>{this.images.blobs=[],this.images.hasImages=!0,this.images.loading=!0,this.images.amount=e.target.files.length,this.images.blobs=await this._readImages(e.target.files).catch((e=>{this._errHandlerRef.set({message:`not possible to load the image ${e}`})})),this.images.loading=!1,this._resultsContainer.displayImages(this.images.blobs)};_readImages=async e=>{const t=[];let r=[];const o=e=>{const t=new FileReader;return new Promise((r=>{t.onload=e=>{r(e.target.result)},t.readAsDataURL(e)}))};for(let s=0;s0){let e="";for(let t=0;t");this._errHandlerRef.set({message:e})}return await Promise.all(t)};render(){return F` +function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap=t(e.Popper)}(void 0,(function(e){function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const r=t(e),o=new Map,s={set(e,t,r){o.has(e)||o.set(e,new Map);const s=o.get(e);s.has(t)||0===s.size?s.set(t,r):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,t)=>o.has(e)&&o.get(e).get(t)||null,remove(e,t){if(!o.has(e))return;const r=o.get(e);r.delete(t),0===r.size&&o.delete(e)}},n="transitionend",i=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),a=e=>{e.dispatchEvent(new Event(n))},l=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),c=e=>l(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(i(e)):null,u=e=>{if(!l(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),r=e.closest("details:not([open])");if(!r)return t;if(r!==e){const t=e.closest("summary");if(t&&t.parentNode!==r)return!1;if(null===t)return!1}return t},d=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),h=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?h(e.parentNode):null},p=()=>{},f=e=>{e.offsetHeight},m=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,y=[],g=()=>"rtl"===document.documentElement.dir,v=e=>{var t;t=()=>{const t=m();if(t){const r=e.NAME,o=t.fn[r];t.fn[r]=e.jQueryInterface,t.fn[r].Constructor=e,t.fn[r].noConflict=()=>(t.fn[r]=o,e.jQueryInterface)}},"loading"===document.readyState?(y.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of y)e()})),y.push(t)):t()},b=(e,t=[],r=e)=>"function"==typeof e?e(...t):r,_=(e,t,r=!0)=>{if(!r)return void b(e);const o=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:r}=window.getComputedStyle(e);const o=Number.parseFloat(t),s=Number.parseFloat(r);return o||s?(t=t.split(",")[0],r=r.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(r))):0})(t)+5;let s=!1;const i=({target:r})=>{r===t&&(s=!0,t.removeEventListener(n,i),b(e))};t.addEventListener(n,i),setTimeout((()=>{s||a(t)}),o)},w=(e,t,r,o)=>{const s=e.length;let n=e.indexOf(t);return-1===n?!r&&o?e[s-1]:e[0]:(n+=r?1:-1,o&&(n=(n+s)%s),e[Math.max(0,Math.min(n,s-1))])},x=/[^.]*(?=\..*)\.|.*/,j=/\..*/,S=/::\d+$/,E={};let M=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function A(e,t){return t&&`${t}::${M++}`||e.uidEvent||M++}function k(e){const t=A(e);return e.uidEvent=t,E[t]=E[t]||{},E[t]}function O(e,t,r=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===r))}function L(e,t,r){const o="string"==typeof t,s=o?r:t||r;let n=D(e);return C.has(n)||(n=e),[o,s,n]}function P(e,t,r,o,s){if("string"!=typeof t||!e)return;let[n,i,a]=L(t,r,o);if(t in T){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};i=e(i)}const l=k(e),c=l[a]||(l[a]={}),u=O(c,i,n?r:null);if(u)return void(u.oneOff=u.oneOff&&s);const d=A(i,t.replace(x,"")),h=n?function(e,t,r){return function o(s){const n=e.querySelectorAll(t);for(let{target:i}=s;i&&i!==this;i=i.parentNode)for(const a of n)if(a===i)return N(s,{delegateTarget:i}),o.oneOff&&F.off(e,s.type,t,r),r.apply(i,[s])}}(e,r,i):function(e,t){return function r(o){return N(o,{delegateTarget:e}),r.oneOff&&F.off(e,o.type,t),t.apply(e,[o])}}(e,i);h.delegationSelector=n?r:null,h.callable=i,h.oneOff=s,h.uidEvent=d,c[d]=h,e.addEventListener(a,h,n)}function R(e,t,r,o,s){const n=O(t[r],o,s);n&&(e.removeEventListener(r,n,Boolean(s)),delete t[r][n.uidEvent])}function I(e,t,r,o){const s=t[r]||{};for(const[n,i]of Object.entries(s))n.includes(o)&&R(e,t,r,i.callable,i.delegationSelector)}function D(e){return e=e.replace(j,""),T[e]||e}const F={on(e,t,r,o){P(e,t,r,o,!1)},one(e,t,r,o){P(e,t,r,o,!0)},off(e,t,r,o){if("string"!=typeof t||!e)return;const[s,n,i]=L(t,r,o),a=i!==t,l=k(e),c=l[i]||{},u=t.startsWith(".");if(void 0===n){if(u)for(const r of Object.keys(l))I(e,l,r,t.slice(1));for(const[r,o]of Object.entries(c)){const s=r.replace(S,"");a&&!t.includes(s)||R(e,l,i,o.callable,o.delegationSelector)}}else{if(!Object.keys(c).length)return;R(e,l,i,n,s?r:null)}},trigger(e,t,r){if("string"!=typeof t||!e)return null;const o=m();let s=null,n=!0,i=!0,a=!1;t!==D(t)&&o&&(s=o.Event(t,r),o(e).trigger(s),n=!s.isPropagationStopped(),i=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=N(new Event(t,{bubbles:n,cancelable:!0}),r);return a&&l.preventDefault(),i&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function N(e,t={}){for(const[r,o]of Object.entries(t))try{e[r]=o}catch(t){Object.defineProperty(e,r,{configurable:!0,get:()=>o})}return e}function U(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function B(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const G={setDataAttribute(e,t,r){e.setAttribute(`data-bs-${B(t)}`,r)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${B(t)}`)},getDataAttributes(e){if(!e)return{};const t={},r=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const o of r){let r=o.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1,r.length),t[r]=U(e.dataset[o])}return t},getDataAttribute:(e,t)=>U(e.getAttribute(`data-bs-${B(t)}`))};class z{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=l(t)?G.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof r?r:{},...l(t)?G.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[o,s]of Object.entries(t)){const t=e[o],n=l(t)?"element":null==(r=t)?`${r}`:Object.prototype.toString.call(r).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${o}" provided type "${n}" but expected type "${s}".`)}var r}}class V extends z{constructor(e,t){super(),(e=c(e))&&(this._element=e,this._config=this._getConfig(t),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),F.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){_(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return s.get(c(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.0"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const $=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let r=e.getAttribute("href");if(!r||!r.includes("#")&&!r.startsWith("."))return null;r.includes("#")&&!r.startsWith("#")&&(r=`#${r.split("#")[1]}`),t=r&&"#"!==r?r.trim():null}return i(t)},H={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const r=[];let o=e.parentNode.closest(t);for(;o;)r.push(o),o=o.parentNode.closest(t);return r},prev(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return[r];r=r.previousElementSibling}return[]},next(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return[r];r=r.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!d(e)&&u(e)))},getSelectorFromElement(e){const t=$(e);return t&&H.findOne(t)?t:null},getElementFromSelector(e){const t=$(e);return t?H.findOne(t):null},getMultipleElementsFromSelector(e){const t=$(e);return t?H.find(t):[]}},q=(e,t="hide")=>{const r=`click.dismiss${e.EVENT_KEY}`,o=e.NAME;F.on(document,r,`[data-bs-dismiss="${o}"]`,(function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),d(this))return;const s=H.getElementFromSelector(this)||this.closest(`.${o}`);e.getOrCreateInstance(s)[t]()}))},W=".bs.alert",X=`close${W}`,Y=`closed${W}`;class Z extends V{static get NAME(){return"alert"}close(){if(F.trigger(this._element,X).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),F.trigger(this._element,Y),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=Z.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}q(Z,"close"),v(Z);const J='[data-bs-toggle="button"]';class Q extends V{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=Q.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}F.on(document,"click.bs.button.data-api",J,(e=>{e.preventDefault();const t=e.target.closest(J);Q.getOrCreateInstance(t).toggle()})),v(Q);const K=".bs.swipe",ee=`touchstart${K}`,te=`touchmove${K}`,re=`touchend${K}`,oe=`pointerdown${K}`,se=`pointerup${K}`,ne={endCallback:null,leftCallback:null,rightCallback:null},ie={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ae extends z{constructor(e,t){super(),this._element=e,e&&ae.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return ne}static get DefaultType(){return ie}static get NAME(){return"swipe"}dispose(){F.off(this._element,K)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),b(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&b(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(F.on(this._element,oe,(e=>this._start(e))),F.on(this._element,se,(e=>this._end(e))),this._element.classList.add("pointer-event")):(F.on(this._element,ee,(e=>this._start(e))),F.on(this._element,te,(e=>this._move(e))),F.on(this._element,re,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const le=".bs.carousel",ce=".data-api",ue="next",de="prev",he="left",pe="right",fe=`slide${le}`,me=`slid${le}`,ye=`keydown${le}`,ge=`mouseenter${le}`,ve=`mouseleave${le}`,be=`dragstart${le}`,_e=`load${le}${ce}`,we=`click${le}${ce}`,xe="carousel",je="active",Se=".active",Ee=".carousel-item",Me=Se+Ee,Te={ArrowLeft:pe,ArrowRight:he},Ce={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ae={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ke extends V{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=H.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===xe&&this.cycle()}static get Default(){return Ce}static get DefaultType(){return Ae}static get NAME(){return"carousel"}next(){this._slide(ue)}nextWhenVisible(){!document.hidden&&u(this._element)&&this.next()}prev(){this._slide(de)}pause(){this._isSliding&&a(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?F.one(this._element,me,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void F.one(this._element,me,(()=>this.to(e)));const r=this._getItemIndex(this._getActive());if(r===e)return;const o=e>r?ue:de;this._slide(o,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&F.on(this._element,ye,(e=>this._keydown(e))),"hover"===this._config.pause&&(F.on(this._element,ge,(()=>this.pause())),F.on(this._element,ve,(()=>this._maybeEnableCycle()))),this._config.touch&&ae.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of H.find(".carousel-item img",this._element))F.on(e,be,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder(he)),rightCallback:()=>this._slide(this._directionToOrder(pe)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new ae(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Te[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=H.findOne(Se,this._indicatorsElement);t.classList.remove(je),t.removeAttribute("aria-current");const r=H.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(je),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),o=e===ue,s=t||w(this._getItems(),r,o,this._config.wrap);if(s===r)return;const n=this._getItemIndex(s),i=t=>F.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:n});if(i(fe).defaultPrevented)return;if(!r||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(n),this._activeElement=s;const l=o?"carousel-item-start":"carousel-item-end",c=o?"carousel-item-next":"carousel-item-prev";s.classList.add(c),f(s),r.classList.add(l),s.classList.add(l);this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(je),r.classList.remove(je,c,l),this._isSliding=!1,i(me)}),r,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return H.findOne(Me,this._element)}_getItems(){return H.find(Ee,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return g()?e===he?de:ue:e===he?ue:de}_orderToDirection(e){return g()?e===de?he:pe:e===de?pe:he}static jQueryInterface(e){return this.each((function(){const t=ke.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)}))}}F.on(document,we,"[data-bs-slide], [data-bs-slide-to]",(function(e){const t=H.getElementFromSelector(this);if(!t||!t.classList.contains(xe))return;e.preventDefault();const r=ke.getOrCreateInstance(t),o=this.getAttribute("data-bs-slide-to");return o?(r.to(o),void r._maybeEnableCycle()):"next"===G.getDataAttribute(this,"slide")?(r.next(),void r._maybeEnableCycle()):(r.prev(),void r._maybeEnableCycle())})),F.on(window,_e,(()=>{const e=H.find('[data-bs-ride="carousel"]');for(const t of e)ke.getOrCreateInstance(t)})),v(ke);const Oe=".bs.collapse",Le=`show${Oe}`,Pe=`shown${Oe}`,Re=`hide${Oe}`,Ie=`hidden${Oe}`,De=`click${Oe}.data-api`,Fe="show",Ne="collapse",Ue="collapsing",Be=`:scope .${Ne} .${Ne}`,Ge='[data-bs-toggle="collapse"]',ze={parent:null,toggle:!0},Ve={parent:"(null|element)",toggle:"boolean"};class $e extends V{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=H.find(Ge);for(const e of r){const t=H.getSelectorFromElement(e),r=H.find(t).filter((e=>e===this._element));null!==t&&r.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return ze}static get DefaultType(){return Ve}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>$e.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(F.trigger(this._element,Le).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Ne),this._element.classList.add(Ue),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const r=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ne,Fe),this._element.style[t]="",F.trigger(this._element,Pe)}),this._element,!0),this._element.style[t]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(F.trigger(this._element,Re).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,f(this._element),this._element.classList.add(Ue),this._element.classList.remove(Ne,Fe);for(const e of this._triggerArray){const t=H.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ne),F.trigger(this._element,Ie)}),this._element,!0)}_isShown(e=this._element){return e.classList.contains(Fe)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=c(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Ge);for(const t of e){const e=H.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=H.find(Be,this._config.parent);return H.find(e,this._config.parent).filter((e=>!t.includes(e)))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const r of e)r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){const r=$e.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===r[e])throw new TypeError(`No method named "${e}"`);r[e]()}}))}}F.on(document,De,Ge,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of H.getMultipleElementsFromSelector(this))$e.getOrCreateInstance(e,{toggle:!1}).toggle()})),v($e);const He="dropdown",qe=".bs.dropdown",We=".data-api",Xe="ArrowUp",Ye="ArrowDown",Ze=`hide${qe}`,Je=`hidden${qe}`,Qe=`show${qe}`,Ke=`shown${qe}`,et=`click${qe}${We}`,tt=`keydown${qe}${We}`,rt=`keyup${qe}${We}`,ot="show",st='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',nt=`${st}.${ot}`,it=".dropdown-menu",at=g()?"top-end":"top-start",lt=g()?"top-start":"top-end",ct=g()?"bottom-end":"bottom-start",ut=g()?"bottom-start":"bottom-end",dt=g()?"left-start":"right-start",ht=g()?"right-start":"left-start",pt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},ft={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class mt extends V{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=H.next(this._element,it)[0]||H.prev(this._element,it)[0]||H.findOne(it,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return pt}static get DefaultType(){return ft}static get NAME(){return He}toggle(){return this._isShown()?this.hide():this.show()}show(){if(d(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!F.trigger(this._element,Qe,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))F.on(e,"mouseover",p);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ot),this._element.classList.add(ot),F.trigger(this._element,Ke,e)}}hide(){if(d(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!F.trigger(this._element,Ze,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.off(e,"mouseover",p);this._popper&&this._popper.destroy(),this._menu.classList.remove(ot),this._element.classList.remove(ot),this._element.setAttribute("aria-expanded","false"),G.removeDataAttribute(this._menu,"popper"),F.trigger(this._element,Je,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!l(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${He.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===r)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:l(this._config.reference)?e=c(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=r.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(ot)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return dt;if(e.classList.contains("dropstart"))return ht;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?lt:at:t?ut:ct}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(G.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...b(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const r=H.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((e=>u(e)));r.length&&w(r,t,e===Ye,!r.includes(t)).focus()}static jQueryInterface(e){return this.each((function(){const t=mt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=H.find(nt);for(const r of t){const t=mt.getInstance(r);if(!t||!1===t._config.autoClose)continue;const o=e.composedPath(),s=o.includes(t._menu);if(o.includes(t._element)||"inside"===t._config.autoClose&&!s||"outside"===t._config.autoClose&&s)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const n={relatedTarget:t._element};"click"===e.type&&(n.clickEvent=e),t._completeHide(n)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r="Escape"===e.key,o=[Xe,Ye].includes(e.key);if(!o&&!r)return;if(t&&!r)return;e.preventDefault();const s=this.matches(st)?this:H.prev(this,st)[0]||H.next(this,st)[0]||H.findOne(st,e.delegateTarget.parentNode),n=mt.getOrCreateInstance(s);if(o)return e.stopPropagation(),n.show(),void n._selectMenuItem(e);n._isShown()&&(e.stopPropagation(),n.hide(),s.focus())}}F.on(document,tt,st,mt.dataApiKeydownHandler),F.on(document,tt,it,mt.dataApiKeydownHandler),F.on(document,et,mt.clearMenus),F.on(document,rt,mt.clearMenus),F.on(document,et,st,(function(e){e.preventDefault(),mt.getOrCreateInstance(this).toggle()})),v(mt);const yt="backdrop",gt="show",vt=`mousedown.bs.${yt}`,bt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},_t={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class wt extends z{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return bt}static get DefaultType(){return _t}static get NAME(){return yt}show(e){if(!this._config.isVisible)return void b(e);this._append();const t=this._getElement();this._config.isAnimated&&f(t),t.classList.add(gt),this._emulateAnimation((()=>{b(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(gt),this._emulateAnimation((()=>{this.dispose(),b(e)}))):b(e)}dispose(){this._isAppended&&(F.off(this._element,vt),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=c(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),F.on(e,vt,(()=>{b(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){_(e,this._getElement(),this._config.isAnimated)}}const xt=".bs.focustrap",jt=`focusin${xt}`,St=`keydown.tab${xt}`,Et="backward",Mt={autofocus:!0,trapElement:null},Tt={autofocus:"boolean",trapElement:"element"};class Ct extends z{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Mt}static get DefaultType(){return Tt}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),F.off(document,xt),F.on(document,jt,(e=>this._handleFocusin(e))),F.on(document,St,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,F.off(document,xt))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=H.focusableChildren(t);0===r.length?t.focus():this._lastTabNavDirection===Et?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Et:"forward")}}const At=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",kt=".sticky-top",Ot="padding-right",Lt="margin-right";class Pt{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ot,(t=>t+e)),this._setElementAttributes(At,Ot,(t=>t+e)),this._setElementAttributes(kt,Lt,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ot),this._resetElementAttributes(At,Ot),this._resetElementAttributes(kt,Lt)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const o=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+o)return;this._saveInitialAttribute(e,t);const s=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${r(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&G.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const r=G.getDataAttribute(e,t);null!==r?(G.removeDataAttribute(e,t),e.style.setProperty(t,r)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(l(e))t(e);else for(const r of H.find(e,this._element))t(r)}}const Rt=".bs.modal",It=`hide${Rt}`,Dt=`hidePrevented${Rt}`,Ft=`hidden${Rt}`,Nt=`show${Rt}`,Ut=`shown${Rt}`,Bt=`resize${Rt}`,Gt=`click.dismiss${Rt}`,zt=`mousedown.dismiss${Rt}`,Vt=`keydown.dismiss${Rt}`,$t=`click${Rt}.data-api`,Ht="modal-open",qt="show",Wt="modal-static",Xt={backdrop:!0,focus:!0,keyboard:!0},Yt={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Zt extends V{constructor(e,t){super(e,t),this._dialog=H.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Pt,this._addEventListeners()}static get Default(){return Xt}static get DefaultType(){return Yt}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;F.trigger(this._element,Nt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ht),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){if(!this._isShown||this._isTransitioning)return;F.trigger(this._element,It).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(qt),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){F.off(window,Rt),F.off(this._dialog,Rt),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new wt({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ct({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=H.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),f(this._element),this._element.classList.add(qt);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,F.trigger(this._element,Ut,{relatedTarget:e})}),this._dialog,this._isAnimated())}_addEventListeners(){F.on(this._element,Vt,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),F.on(window,Bt,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),F.on(this._element,zt,(e=>{F.one(this._element,Gt,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Ht),this._resetAdjustments(),this._scrollBar.reset(),F.trigger(this._element,Ft)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(F.trigger(this._element,Dt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Wt)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Wt),this._queueCallback((()=>{this._element.classList.remove(Wt),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const e=g()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!r&&e){const e=g()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const r=Zt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===r[e])throw new TypeError(`No method named "${e}"`);r[e](t)}}))}}F.on(document,$t,'[data-bs-toggle="modal"]',(function(e){const t=H.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),F.one(t,Nt,(e=>{e.defaultPrevented||F.one(t,Ft,(()=>{u(this)&&this.focus()}))}));const r=H.findOne(".modal.show");r&&Zt.getInstance(r).hide();Zt.getOrCreateInstance(t).toggle(this)})),q(Zt),v(Zt);const Jt=".bs.offcanvas",Qt=".data-api",Kt=`load${Jt}${Qt}`,er="show",tr="showing",rr="hiding",or=".offcanvas.show",sr=`show${Jt}`,nr=`shown${Jt}`,ir=`hide${Jt}`,ar=`hidePrevented${Jt}`,lr=`hidden${Jt}`,cr=`resize${Jt}`,ur=`click${Jt}${Qt}`,dr=`keydown.dismiss${Jt}`,hr={backdrop:!0,keyboard:!0,scroll:!1},pr={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class fr extends V{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return hr}static get DefaultType(){return pr}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(F.trigger(this._element,sr,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Pt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(tr);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(er),this._element.classList.remove(tr),F.trigger(this._element,nr,{relatedTarget:e})}),this._element,!0)}hide(){if(!this._isShown)return;if(F.trigger(this._element,ir).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(rr),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(er,rr),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Pt).reset(),F.trigger(this._element,lr)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new wt({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():F.trigger(this._element,ar)}:null})}_initializeFocusTrap(){return new Ct({trapElement:this._element})}_addEventListeners(){F.on(this._element,dr,(e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():F.trigger(this._element,ar))}))}static jQueryInterface(e){return this.each((function(){const t=fr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}F.on(document,ur,'[data-bs-toggle="offcanvas"]',(function(e){const t=H.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),d(this))return;F.one(t,lr,(()=>{u(this)&&this.focus()}));const r=H.findOne(or);r&&r!==t&&fr.getInstance(r).hide();fr.getOrCreateInstance(t).toggle(this)})),F.on(window,Kt,(()=>{for(const e of H.find(or))fr.getOrCreateInstance(e).show()})),F.on(window,cr,(()=>{for(const e of H.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&fr.getOrCreateInstance(e).hide()})),q(fr),v(fr);const mr={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},yr=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),gr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,vr=(e,t)=>{const r=e.nodeName.toLowerCase();return t.includes(r)?!yr.has(r)||Boolean(gr.test(e.nodeValue)):t.filter((e=>e instanceof RegExp)).some((e=>e.test(r)))};const br={allowList:mr,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
        "},_r={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},wr={entry:"(string|element|function|null)",selector:"(string|element)"};class xr extends z{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return br}static get DefaultType(){return _r}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((e=>this._resolvePossibleFunction(e))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,r]of Object.entries(this._config.content))this._setContent(e,r,t);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},wr)}_setContent(e,t,r){const o=H.findOne(r,e);o&&((t=this._resolvePossibleFunction(t))?l(t)?this._putElementInTemplate(c(t),o):this._config.html?o.innerHTML=this._maybeSanitize(t):o.textContent=t:o.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,r){if(!e.length)return e;if(r&&"function"==typeof r)return r(e);const o=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...o.body.querySelectorAll("*"));for(const e of s){const r=e.nodeName.toLowerCase();if(!Object.keys(t).includes(r)){e.remove();continue}const o=[].concat(...e.attributes),s=[].concat(t["*"]||[],t[r]||[]);for(const t of o)vr(t,s)||e.removeAttribute(t.nodeName)}return o.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return b(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const jr=new Set(["sanitize","allowList","sanitizeFn"]),Sr="fade",Er="show",Mr=".modal",Tr="hide.bs.modal",Cr="hover",Ar="focus",kr={AUTO:"auto",TOP:"top",RIGHT:g()?"left":"right",BOTTOM:"bottom",LEFT:g()?"right":"left"},Or={allowList:mr,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Lr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Pr extends V{constructor(e,t){if(void 0===r)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Or}static get DefaultType(){return Lr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),F.off(this._element.closest(Mr),Tr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=F.trigger(this._element,this.constructor.eventName("show")),t=(h(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(r),F.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(r),r.classList.add(Er),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.on(e,"mouseover",p);this._queueCallback((()=>{F.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(F.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(Er),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))F.off(e,"mouseover",p);this._activeTrigger.click=!1,this._activeTrigger[Ar]=!1,this._activeTrigger[Cr]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),F.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Sr,Er),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(Sr),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new xr({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Sr)}_isShown(){return this.tip&&this.tip.classList.contains(Er)}_createPopper(e){const t=b(this._config.placement,[this,e,this._element]),o=kr[t.toUpperCase()];return r.createPopper(this._element,e,this._getPopperConfig(o))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map((e=>Number.parseInt(e,10))):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return b(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...b(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)F.on(this._element,this.constructor.eventName("click"),this._config.selector,(e=>{this._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==t){const e=t===Cr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),r=t===Cr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");F.on(this._element,e,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Ar:Cr]=!0,t._enter()})),F.on(this._element,r,this._config.selector,(e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Ar:Cr]=t._element.contains(e.relatedTarget),t._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},F.on(this._element.closest(Mr),Tr,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=G.getDataAttributes(this._element);for(const e of Object.keys(t))jr.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:c(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each((function(){const t=Pr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}v(Pr);const Rr={...Pr.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Ir={...Pr.DefaultType,content:"(null|string|element|function)"};class Dr extends Pr{static get Default(){return Rr}static get DefaultType(){return Ir}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each((function(){const t=Dr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}v(Dr);const Fr=".bs.scrollspy",Nr=`activate${Fr}`,Ur=`click${Fr}`,Br=`load${Fr}.data-api`,Gr="active",zr="[href]",Vr=".nav-link",$r=`${Vr}, .nav-item > ${Vr}, .list-group-item`,Hr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},qr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Wr extends V{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Hr}static get DefaultType(){return qr}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=c(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((e=>Number.parseFloat(e)))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(F.off(this._config.target,Ur),F.on(this._config.target,Ur,zr,(e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,o=t.offsetTop-this._element.offsetTop;if(r.scrollTo)return void r.scrollTo({top:o,behavior:"smooth"});r.scrollTop=o}})))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((e=>this._observerCallback(e)),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),r=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},o=(this._rootElement||document.documentElement).scrollTop,s=o>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=o;for(const n of e){if(!n.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(n));continue}const e=n.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&e){if(r(n),!o)return}else s||e||r(n)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=H.find(zr,this._config.target);for(const t of e){if(!t.hash||d(t))continue;const e=H.findOne(decodeURI(t.hash),this._element);u(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Gr),this._activateParents(e),F.trigger(this._element,Nr,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))H.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Gr);else for(const t of H.parents(e,".nav, .list-group"))for(const e of H.prev(t,$r))e.classList.add(Gr)}_clearActiveClass(e){e.classList.remove(Gr);const t=H.find(`${zr}.${Gr}`,e);for(const e of t)e.classList.remove(Gr)}static jQueryInterface(e){return this.each((function(){const t=Wr.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}F.on(window,Br,(()=>{for(const e of H.find('[data-bs-spy="scroll"]'))Wr.getOrCreateInstance(e)})),v(Wr);const Xr=".bs.tab",Yr=`hide${Xr}`,Zr=`hidden${Xr}`,Jr=`show${Xr}`,Qr=`shown${Xr}`,Kr=`click${Xr}`,eo=`keydown${Xr}`,to=`load${Xr}`,ro="ArrowLeft",oo="ArrowRight",so="ArrowUp",no="ArrowDown",io="active",ao="fade",lo="show",co=":not(.dropdown-toggle)",uo='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ho=`${`.nav-link${co}, .list-group-item${co}, [role="tab"]${co}`}, ${uo}`,po=`.${io}[data-bs-toggle="tab"], .${io}[data-bs-toggle="pill"], .${io}[data-bs-toggle="list"]`;class fo extends V{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),F.on(this._element,eo,(e=>this._keydown(e))))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?F.trigger(t,Yr,{relatedTarget:e}):null;F.trigger(e,Jr,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(io),this._activate(H.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),F.trigger(e,Qr,{relatedTarget:t})):e.classList.add(lo)}),e,e.classList.contains(ao))}_deactivate(e,t){if(!e)return;e.classList.remove(io),e.blur(),this._deactivate(H.getElementFromSelector(e));this._queueCallback((()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),F.trigger(e,Zr,{relatedTarget:t})):e.classList.remove(lo)}),e,e.classList.contains(ao))}_keydown(e){if(![ro,oo,so,no].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[oo,no].includes(e.key),r=w(this._getChildren().filter((e=>!d(e))),e.target,t,!0);r&&(r.focus({preventScroll:!0}),fo.getOrCreateInstance(r).show())}_getChildren(){return H.find(ho,this._parent)}_getActiveElem(){return this._getChildren().find((e=>this._elemIsActive(e)))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=H.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains("dropdown"))return;const o=(e,o)=>{const s=H.findOne(e,r);s&&s.classList.toggle(o,t)};o(".dropdown-toggle",io),o(".dropdown-menu",lo),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(io)}_getInnerElement(e){return e.matches(ho)?e:H.findOne(ho,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each((function(){const t=fo.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}))}}F.on(document,Kr,uo,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),d(this)||fo.getOrCreateInstance(this).show()})),F.on(window,to,(()=>{for(const e of H.find(po))fo.getOrCreateInstance(e)})),v(fo);const mo=".bs.toast",yo=`mouseover${mo}`,go=`mouseout${mo}`,vo=`focusin${mo}`,bo=`focusout${mo}`,_o=`hide${mo}`,wo=`hidden${mo}`,xo=`show${mo}`,jo=`shown${mo}`,So="hide",Eo="show",Mo="showing",To={animation:"boolean",autohide:"boolean",delay:"number"},Co={animation:!0,autohide:!0,delay:5e3};class Ao extends V{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Co}static get DefaultType(){return To}static get NAME(){return"toast"}show(){if(F.trigger(this._element,xo).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(So),f(this._element),this._element.classList.add(Eo,Mo),this._queueCallback((()=>{this._element.classList.remove(Mo),F.trigger(this._element,jo),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(F.trigger(this._element,_o).defaultPrevented)return;this._element.classList.add(Mo),this._queueCallback((()=>{this._element.classList.add(So),this._element.classList.remove(Mo,Eo),F.trigger(this._element,wo)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Eo),super.dispose()}isShown(){return this._element.classList.contains(Eo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){F.on(this._element,yo,(e=>this._onInteraction(e,!0))),F.on(this._element,go,(e=>this._onInteraction(e,!1))),F.on(this._element,vo,(e=>this._onInteraction(e,!0))),F.on(this._element,bo,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=Ao.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}q(Ao),v(Ao);return{Alert:Z,Button:Q,Carousel:ke,Collapse:$e,Dropdown:mt,Modal:Zt,Offcanvas:fr,Popover:Dr,ScrollSpy:Wr,Tab:fo,Toast:Ao,Tooltip:Pr}})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}((function(){return function e(t,r,o){function s(i,a){if(!r[i]){if(!t[i]){var l="function"==typeof require&&require;if(!a&&l)return l(i,!0);if(n)return n(i,!0);throw(a=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",a}l=r[i]={exports:{}},t[i][0].call(l.exports,(function(e){return s(t[i][1][e]||e)}),l,l.exports,e,t,r,o)}return r[i].exports}for(var n="function"==typeof require&&require,i=0;i>16&255,a[c++]=t>>8&255,a[c++]=255&t;return 2===i&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,a[c++]=255&t),1===i&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t),a},r.fromByteArray=function(e){for(var t,r=e.length,s=r%3,n=[],i=0,a=r-s;i>18&63]+o[e>>12&63]+o[e>>6&63]+o[63&e]}(s));return n.join("")}(e,i,a>2]+o[t<<4&63]+"==")):2==s&&(t=(e[r-2]<<8)+e[r-1],n.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"=")),n.join("")};for(var o=[],s=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)o[a]=i[a],s[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(0>>1;case"base64":return A(e).length;default:if(n)return s?-1:C(e).length;r=(""+r).toLowerCase(),n=!0}}function f(e,t,r){var s,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var i=t,a=r,l=this.length;(!a||a<0||l=e.length){if(n)return-1;o=e.length-1}else if(o<0){if(!n)return-1;o=0}if("string"==typeof r&&(r=t.from(r,s)),t.isBuffer(r))return 0===r.length?-1:g(e,r,o,s,n);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,r,o):g(e,[r],o,s,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,o,s){var n=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=n=2,a/=2,r/=2}function l(e,t){return 1===n?e[t]:e.readUInt16BE(t*n)}if(s)for(var c=-1,u=r;u>8,o%=256,s.push(o),s.push(r);return s}(t,e.length-r),e,r,o)}function _(e,t,r){r=Math.min(e.length,r);for(var o=[],s=t;s>>10&1023|55296),u=56320|1023&u),o.push(u),s+=d}var h=o,p=h.length;if(p<=w)return String.fromCharCode.apply(String,h);for(var f="",m=0;mt&&(e+=" ... "),""},n&&(t.prototype[n]=t.prototype.inspect),t.prototype.compare=function(e,r,o,s,n){if(O(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===o&&(o=e?e.length:0),void 0===s&&(s=0),void 0===n&&(n=this.length),(r=void 0===r?0:r)<0||o>e.length||s<0||n>this.length)throw new RangeError("out of range index");if(n<=s&&o<=r)return 0;if(n<=s)return-1;if(o<=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(s>>>=0),a=(o>>>=0)-(r>>>=0),l=Math.min(i,a),c=this.slice(s,n),u=e.slice(r,o),d=0;d>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var s=this.length-t;if((void 0===r||sthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var n,i,a,l=!1;;)switch(o){case"hex":var c=e,u=t,d=r,h=(u=Number(u)||0,this.length-u);(!d||h<(d=Number(d)))&&(d=h),(h=c.length)/2e.length)throw new RangeError("Index out of range")}function S(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(e,t,r,o,n){return t=+t,r>>>=0,n||S(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function M(e,t,r,o,n){return t=+t,r>>>=0,n||S(e,0,r,8),s.write(e,t,r,o,52,8),r+8}t.prototype.slice=function(e,r){var o=this.length;(e=~~e)<0?(e+=o)<0&&(e=0):o>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e],s=1,n=0;++n>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e+--t],s=1;0>>=0,t||x(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var o=this[e],s=1,n=0;++n>>=0,t>>>=0,r||x(e,t,this.length);for(var o=t,s=1,n=this[e+--o];0>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),32768&(t=this[e]|this[e+1]<<8)?4294901760|t:t},t.prototype.readInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),32768&(t=this[e+1]|this[e]<<8)?4294901760|t:t},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),s.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),s.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),s.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),s.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||j(this,e,t,r,Math.pow(2,8*r)-1,0);var s=1,n=0;for(this[t]=255&e;++n>>=0,r>>>=0,o||j(this,e,t,r,Math.pow(2,8*r)-1,0);var s=r-1,n=1;for(this[t+s]=255&e;0<=--s&&(n*=256);)this[t+s]=e/n&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||j(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var s=0,n=1,i=0;for(this[t]=255&e;++s>0)-i&255;return t+r},t.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||j(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var s=r-1,n=1,i=0;for(this[t+s]=255&e;0<=--s&&(n*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/n>>0)-i&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},t.prototype.copy=function(e,r,o,s){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(o=o||0,s||0===s||(s=this.length),r>=e.length&&(r=e.length),(s=0=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length);var n=(s=e.length-r>>=0,o=void 0===o?this.length:o>>>0,"number"==typeof(e=e||0))for(i=r;i>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function A(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var s=0;s=t.length||s>=e.length);++s)t[s+r]=e[s];return s}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function L(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,s=0;s<16;++s)t[o+s]=e[r]+e[s];return t}()}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:238}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),s=e("../internals/object-create"),n=(e=e("../internals/object-define-property"),o("unscopables")),i=Array.prototype;null==i[n]&&e.f(i,n,{configurable:!0,value:s(null)}),t.exports=function(e){i[n][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],8:[function(e,t,r){var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){function o(e){return l(e)&&c(M,u(e))}var s,n=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/has"),u=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),p=e("../internals/object-define-property").f,f=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),g=(e=e("../internals/uid"),a.Int8Array),v=g&&g.prototype,b=(b=a.Uint8ClampedArray)&&b.prototype,_=g&&f(g),w=v&&f(v),x=Object.prototype,j=x.isPrototypeOf,S=(y=y("toStringTag"),e("TYPED_ARRAY_TAG")),E=n&&!!m&&"Opera"!==u(a.opera),M=(e=!1,{Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8});for(s in M)a[s]||(E=!1);if((!E||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},E))for(s in M)a[s]&&m(a[s],_);if((!E||!w||w===x)&&(w=_.prototype,E))for(s in M)a[s]&&m(a[s].prototype,w);if(E&&f(b)!==w&&m(b,w),i&&!c(w,y))for(s in e=!0,p(w,y,{get:function(){return l(this)?this[S]:void 0}}),M)a[s]&&d(a[s],S,s);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(j.call(_,e))return e}else for(var t in M)if(c(M,s)&&(t=a[t])&&(e===t||j.call(t,e)))return e;throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in M)(o=a[o])&&c(o.prototype,e)&&delete o.prototype[e];w[e]&&!r||h(w,e,!r&&E&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,s;if(i){if(m){if(r)for(o in M)(s=a[o])&&c(s,e)&&delete s[e];if(_[e]&&!r)return;try{return h(_,e,!r&&E&&g[e]||t)}catch(e){}}for(o in M)!(s=a[o])||s[e]&&!r||h(s,e,t)}},isView:function(e){return"DataView"===(e=u(e))||c(M,e)},isTypedArray:o,TypedArray:_,TypedArrayPrototype:w}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":143,"../internals/well-known-symbol":146}],13:[function(e,t,r){function o(e){return[255&e]}function s(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function i(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return B(e,23,4)}function l(e){return B(e,52,8)}function c(e,t){M(e[P],t,{get:function(){return A(this)[t]}})}function u(e,t,r,o){if((r=w(r))+t>(e=A(e)).byteLength)throw U(R);var s=A(e.buffer).bytes;r+=e.byteOffset,e=s.slice(r,r+t);return o?e:e.reverse()}function d(e,t,r,o,s,n){if((r=w(r))+t>(e=A(e)).byteLength)throw U(R);for(var i=A(e.buffer).bytes,a=r+e.byteOffset,l=o(+s),c=0;c$;)(z=V[$++])in D||m(D,z,I[z]);h.constructor=D}S&&j(e)!==N&&S(e,N);x=new F(new D(2));var H=e.setInt8;x.setInt8(0,2147483648),x.setInt8(1,2147483649),!x.getInt8(0)&&x.getInt8(1)||y(e,{setInt8:function(e,t){H.call(this,e,t<<24>>24)},setUint8:function(e,t){H.call(this,e,t<<24>>24)}},{unsafe:!0})}else D=function(e){v(this,D,O),e=w(e),k(this,{bytes:T.call(new Array(e),0),byteLength:e}),p||(this.byteLength=e)},F=function(e,t,r){v(this,F,L),v(e,D,L);var o=A(e).byteLength;if((t=b(t))<0||o>24},getUint8:function(e){return u(this,1,e)[0]},getInt16:function(e){return((e=u(this,2,e,1>16},getUint16:function(e){return(e=u(this,2,e,1>>0},getFloat32:function(e){return G(u(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){function o(){return this}var s=e("../internals/iterators-core").IteratorPrototype,n=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){return t+=" Iterator",e.prototype=n(s,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/object-define-property"),n=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return s.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){var o=e("../internals/to-primitive"),s=e("../internals/object-define-property"),n=e("../internals/create-property-descriptor");t.exports=function(e,t,r){(t=o(t))in e?s.f(e,t,n(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":138}],41:[function(e,t,r){function o(){return this}var s=e("../internals/export"),n=e("../internals/create-iterator-constructor"),i=e("../internals/object-get-prototype-of"),a=e("../internals/object-set-prototype-of"),l=e("../internals/set-to-string-tag"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/redefine"),d=e("../internals/well-known-symbol"),h=e("../internals/is-pure"),p=e("../internals/iterators"),f=(e=e("../internals/iterators-core")).IteratorPrototype,m=e.BUGGY_SAFARI_ITERATORS,y=d("iterator"),g="values",v="entries";t.exports=function(e,t,r,d,b,_,w){function x(e){if(e===b&&C)return C;if(!m&&e in M)return M[e];switch(e){case"keys":case g:case v:return function(){return new r(this,e)}}return function(){return new r(this)}}n(r,t,d);d=t+" Iterator";var j,S,E=!1,M=e.prototype,T=M[y]||M["@@iterator"]||b&&M[b],C=!m&&T||x(b),A="Array"==t&&M.entries||T;if(A&&(A=i(A.call(new e)),f!==Object.prototype&&A.next&&(h||i(A)===f||(a?a(A,f):"function"!=typeof A[y]&&c(A,y,o)),l(A,d,!0,!0),h&&(p[d]=o))),b==g&&T&&T.name!==g&&(E=!0,C=function(){return T.call(this)}),h&&!w||M[y]===C||c(M,y,C),p[t]=C,b)if(j={values:x(g),keys:_?C:x("keys"),entries:x(v)},w)for(S in j)!m&&!E&&S in M||u(M,S,j[S]);else s({target:t,proto:!0,forced:m||E},j);return j}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146}],42:[function(e,t,r){var o=e("../internals/path"),s=e("../internals/has"),n=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});s(t,e)||i(t,e,{value:n.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":145}],43:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),s=(e=e("../internals/is-object"),o.document),n=e(s)&&e(s.createElement);t.exports=function(e){return n?s.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent"),t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in"),t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,s,n=e("../internals/global");e=e("../internals/engine-user-agent");(n=(n=(n=n.process)&&n.versions)&&n.v8)?s=(o=n.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(s=o[1]),t.exports=s&&+s},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var o=e("../internals/global"),s=e("../internals/object-get-own-property-descriptor").f,n=e("../internals/create-non-enumerable-property"),i=e("../internals/redefine"),a=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var r,u,d,h=e.target,p=e.global,f=e.stat,m=p?o:f?o[h]||a(h,{}):(o[h]||{}).prototype;if(m)for(r in t){if(u=t[r],d=e.noTargetGet?(d=s(m,r))&&d.value:m[r],!c(p?r:h+(f?".":"#")+r,e.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(e.sham||d&&d.sham)&&n(u,"sham",!0),i(m,r,u,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){e("../modules/es.regexp.exec");var o=e("../internals/redefine"),s=e("../internals/fails"),n=e("../internals/well-known-symbol"),i=e("../internals/regexp-exec"),a=e("../internals/create-non-enumerable-property"),l=n("species"),c=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),u="$0"==="a".replace(/./,"$0"),d=!!/./[e=n("replace")]&&""===/./[e]("a","$0"),h=!s((function(){var e=(t=/(?:)/).exec,t=(t.exec=function(){return e.apply(this,arguments)},"ab".split(t));return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));t.exports=function(e,t,r,p){var f,m,y=n(e),g=!s((function(){var t={};return t[y]=function(){return 7},7!=""[e](t)})),v=g&&!s((function(){var t=!1,r=/a/;return"split"===e&&((r={constructor:{}}).constructor[l]=function(){return r},r.flags="",r[y]=/./[y]),r.exec=function(){return t=!0,null},r[y](""),!t}));g&&v&&("replace"!==e||c&&u&&!d)&&("split"!==e||h)||(f=/./[y],r=(v=r(y,""[e],(function(e,t,r,o,s){return t.exec===i?g&&!s?{done:!0,value:f.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}}),{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}))[0],m=v[1],o(String.prototype,e,r),o(RegExp.prototype,y,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})),p&&a(RegExp.prototype[y],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":146,"../modules/es.regexp.exec":181}],53:[function(e,t,r){e=e("../internals/fails"),t.exports=!e((function(){return Object.isExtensible(Object.preventExtensions({}))}))},{"../internals/fails":51}],54:[function(e,t,r){var o=e("../internals/a-function");t.exports=function(e,t,r){if(o(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,o){return e.call(t,r,o)};case 3:return function(r,o,s){return e.call(t,r,o,s)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){var o=e("../internals/a-function"),s=e("../internals/is-object"),n=[].slice,i={};t.exports=Function.bind||function(e){var t=o(this),r=n.call(arguments,1),a=function(){var o=r.concat(n.call(arguments));if(this instanceof a){var s=t,l=o.length,c=o;if(!(l in i)){for(var u=[],d=0;d>1,f=23===t?s(2,-24)-s(2,-77):0,m=e<0||0===e&&1/e<0?1:0,y=0;for((e=o(e))!=e||e===1/0?(c=e!=e?1:0,l=r):(l=n(i(e)/a),e*(u=s(2,-l))<1&&(l--,u*=2),2<=(e+=1<=l+p?f/u:f*s(2,1-p))*u&&(l++,u/=2),r<=l+p?(c=0,l=r):1<=l+p?(c=(e*u-1)*s(2,t),l+=p):(c=e*s(2,p-1)*s(2,t),l=0));8<=t;d[y++]=255&c,c/=256,t-=8);for(l=l<>1,l=o-7,c=n-1,u=127&(o=e[c--]);for(o>>=7;0>=-l,l+=t;0"+e+""},m=function(){try{s=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=s?((e=s).write(f("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=u("iframe"),t="java"+h+":",e.style.display="none",c.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[p]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=n(e),r=new o,o[d]=null,r[p]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/object-define-property"),n=e("../internals/an-object"),i=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){n(e);for(var r,o=i(t),a=o.length,l=0;ll;)!o(a,r=t[l++])||~n(c,r)||c.push(r);return c}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":132}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),s=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,s)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){var o={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,n=s&&!o.call({1:2},1);r.f=n?function(e){return!!(e=s(this,e))&&e.enumerable}:o},{}],101:[function(e,t,r){var o=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(r){}return function(r,n){return o(r),s(n),t?e.call(r,n):r.__proto__=n,r}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){var o=e("../internals/to-string-tag-support"),s=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+s(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":139}],103:[function(e,t,r){var o=e("../internals/get-built-in"),s=e("../internals/object-get-own-property-names"),n=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=s.f(i(e)),r=n.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global"),t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),s=e("../internals/is-object"),n=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),s(t)&&t.constructor===e?t:((0,(e=n.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var o=e("../internals/redefine");t.exports=function(e,t,r){for(var s in t)o(e,s,t[s],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var o=e("../internals/global"),s=e("../internals/create-non-enumerable-property"),n=e("../internals/has"),i=e("../internals/set-global"),a=e("../internals/inspect-source"),l=(e=e("../internals/internal-state")).get,c=e.enforce,u=String(String).split("String");(t.exports=function(e,t,r,a){var l=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable;a=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof t||n(r,"name")||s(r,"name",t),c(r).source=u.join("string"==typeof t?t:"")),e===o?d?e[t]=r:i(t,r):(l?!a&&e[t]&&(d=!0):delete e[t],d?e[t]=r:s(e,t,r))})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||a(this)}))},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),s=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){if("object"!=typeof(r=r.call(e,t)))throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return s.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){var o,s,n=e("./regexp-flags"),i=(e=e("./regexp-sticky-helpers"),RegExp.prototype.exec),a=String.prototype.replace,l=i,c=(o=/a/,s=/b*/g,i.call(o,"a"),i.call(s,"a"),0!==o.lastIndex||0!==s.lastIndex),u=e.UNSUPPORTED_Y||e.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];t.exports=l=c||d||u?function(e){var t,r,o,s,l=this,h=u&&l.sticky,p=n.call(l),f=l.source,m=0,y=e;return h&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=String(e).slice(l.lastIndex),0f((n-d)/w))throw RangeError(h);for(d+=(b-u)*w,u=b,_=0;_n)throw RangeError(h);if(t==u){for(var x=d,j=i;;j+=i){var S=j<=y?1:y+a<=j?a:j-y;if(x>1,e+=f(e/t);p*a>>1>>=1)&&(t+=t))1&n&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],126:[function(e,t,r){var o=e("../internals/fails"),s=e("../internals/whitespaces");t.exports=function(e){return o((function(){return!!s[e]()||"​…᠎"!="​…᠎"[e]()||s[e].name!==e}))}},{"../internals/fails":51,"../internals/whitespaces":147}],127:[function(e,t,r){function o(e){return function(t){return t=String(s(t)),1&e&&(t=t.replace(n,"")),2&e?t.replace(i,""):t}}var s=e("../internals/require-object-coercible"),n=(e="["+e("../internals/whitespaces")+"]",RegExp("^"+e+e+"*")),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":147}],128:[function(e,t,r){function o(e){return function(){x(e)}}function s(e){x(e.data)}function n(e){a.postMessage(e+"",p.protocol+"//"+p.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),c=e("../internals/classof-raw"),u=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),p=(e=e("../internals/engine-is-ios"),a.location),f=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,_={},w="onreadystatechange",x=function(e){var t;_.hasOwnProperty(e)&&(t=_[e],delete _[e],t())};f&&m||(f=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}}),"values"),n.Arguments=n.Array,s("keys"),s("values"),s("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":132}],159:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/indexed-object"),n=e("../internals/to-indexed-object"),i=(e=e("../internals/array-method-is-strict"),[].join);s=s!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:s||!e},{join:function(e){return i.call(n(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":132}],160:[function(e,t,r){e("../internals/export")({target:"Array",proto:!0,forced:(e=e("../internals/array-last-index-of"))!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],161:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/array-iteration").map,n=e("../internals/array-method-has-species-support");e=e("../internals/array-method-uses-to-length"),n=n("map"),e=e("map");o({target:"Array",proto:!0,forced:!n||!e},{map:function(e){return s(this,e,1E;E++)l(b,x=S[E])&&!l(j,x)&&y(j,x,m(b,x));(j.prototype=_).constructor=j,a(n,v,j)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":127,"../internals/to-primitive":138}],170:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],171:[function(e,t,r){function o(e,t,r){return 0===t?r:t%2==1?o(e,t-1,r*e):o(e*e,t/2,r)}var s=e("../internals/export"),n=e("../internals/to-integer"),i=e("../internals/this-number-value"),a=e("../internals/string-repeat"),l=(e=e("../internals/fails"),1..toFixed),c=Math.floor;s({target:"Number",proto:!0,forced:l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!e((function(){l.call({})}))},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*h[r],h[r]=o%1e7,o=c(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=h[t],h[t]=c(r/e),r=r%e*1e7}function s(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===h[t]||(e=String(h[t]),r=""===r?e:r+a.call("0",7-e.length)+e);return r}var l,u,d=i(this),h=(e=n(e),[0,0,0,0,0,0]),p="",f="0";if(e<0||20l;){var u,d,h,p=o[l++],f=a?p.ok:p.fail,m=p.resolve,y=p.reject,g=p.domain;try{f?(a||(2===t.rejection&&function(e,t){S.call(c,(function(){q?z.emit("rejectionHandled",e):J("rejectionhandled",e,t.value)}))}(e,t),t.rejection=1),!0===f?u=i:(g&&g.enter(),u=f(i),g&&(g.exit(),h=!0)),u===p.promise?y(B("Promise-chain cycle")):(d=Y(u))?d.call(u,m,y):m(u)):y(i)}catch(i){g&&!h&&g.exit(),y(i)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&(s=e,n=t,S.call(c,(function(){var e=n.value,t=Q(n);if(t&&(t=A((function(){q?z.emit("unhandledRejection",e,s):J(X,s,e)})),n.rejection=q||Q(n)?2:1,t.error))throw t.value})))})))},J=function(e,t,r){var o;W?((o=G.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),c.dispatchEvent(o)):o={promise:t,reason:r},(t=c["on"+e])?t(o):e===X&&T("Unhandled promise rejection",r)},Q=function(e){return 1!==e.rejection&&!e.parent},K=function(e,t,r,o){return function(s){e(t,r,s,o)}},ee=function(e,t,r,o){t.done||(t.done=!0,(t=o||t).value=r,t.state=2,Z(e,t,!0))},te=function(e,t,r,o){if(!t.done){t.done=!0,o&&(t=o);try{if(e===r)throw B("Promise can't be resolved itself");var s=Y(r);s?E((function(){var o={done:!1};try{s.call(r,K(te,e,o,t),K(ee,e,o,t))}catch(r){ee(e,o,r,t)}})):(t.value=r,t.state=1,Z(e,t,!1))}catch(r){ee(e,{done:!1},r,t)}}};e&&(U=function(e){v(this,U,I),g(e),o.call(this);var t=D(this);try{e(K(te,this,t),K(ee,this,t))}catch(e){ee(this,t,e)}},(o=function(e){F(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=p(U.prototype,{then:function(e,t){var r=N(this),o=$(j(this,U));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=q?z.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&Z(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),s=function(){var e=new o,t=D(e);this.promise=e,this.resolve=K(te,e,t),this.reject=K(ee,e,t)},C.f=$=function(e){return e===U||e===n?new s:H(e)},l||"function"!=typeof d||(i=d.prototype.then,h(d.prototype,"then",(function(e,t){var r=this;return new U((function(e,t){i.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return M(U,V.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:e},{Promise:U}),f(U,I,!1,!0),m(I),n=u(I),a({target:I,stat:!0,forced:e},{reject:function(e){var t=$(this);return t.reject.call(void 0,e),t.promise}}),a({target:I,stat:!0,forced:l||e},{resolve:function(e){return M(l&&this===n?U:this,e)}}),a({target:I,stat:!0,forced:L},{all:function(e){var t=this,r=$(t),o=r.resolve,s=r.reject,n=A((function(){var r=g(t.resolve),n=[],i=0,a=1;w(e,(function(e){var l=i++,c=!1;n.push(void 0),a++,r.call(t,e).then((function(e){c||(c=!0,n[l]=e,--a||o(n))}),s)})),--a||o(n)}));return n.error&&s(n.value),r.promise},race:function(e){var t=this,r=$(t),o=r.reject,s=A((function(){var s=g(t.resolve);w(e,(function(e){s.call(t,e).then(r.resolve,o)}))}));return s.error&&o(s.value),r.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":128,"../internals/well-known-symbol":146}],179:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/get-built-in"),n=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),c=e("../internals/function-bind"),u=(e=e("../internals/fails"),s("Reflect","construct")),d=e((function(){function e(){}return!(u((function(){}),[],e)instanceof e)})),h=!e((function(){u((function(){}))}));o({target:"Reflect",stat:!0,forced:s=d||h,sham:s},{construct:function(e,t){n(e),i(t);var r=arguments.length<3?e:n(arguments[2]);if(h&&!d)return u(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(c.apply(e,o))}return o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t),a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],180:[function(e,t,r){var o=e("../internals/descriptors"),s=e("../internals/global"),n=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,c=e("../internals/is-regexp"),u=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),p=e("../internals/fails"),f=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=s.RegExp,v=g.prototype,b=/a/g,_=/a/g,w=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&n("RegExp",!w||x||p((function(){return _[y]=!1,g(b)!=b||g(_)==_||"/a/i"!=g(b,"i")})))){for(var j=function(e,t){var r,o=this instanceof j,s=c(e),n=void 0===t;return!o&&s&&e.constructor===j&&n?e:(w?s&&!n&&(e=e.source):e instanceof j&&(n&&(t=u.call(e)),e=e.source),x&&(r=!!t&&-1E;)!function(e){e in j||a(j,e,{configurable:!0,get:function(){return g[e]},set:function(t){g[e]=t}})}(S[E++]);(v.constructor=j).prototype=v,h(s,"RegExp",j)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":146}],181:[function(e,t,r){var o=e("../internals/export");e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],182:[function(e,t,r){var o=e("../internals/redefine"),s=e("../internals/an-object"),n=e("../internals/fails"),i=e("../internals/regexp-flags"),a=(e="toString",RegExp.prototype),l=a[e],c=(n=n((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),l.name!=e);(n||c)&&o(RegExp.prototype,e,(function(){var e=s(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)}),{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],183:[function(e,t,r){var o=e("../internals/collection");e=e("../internals/collection-strong");t.exports=o("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),e)},{"../internals/collection":32,"../internals/collection-strong":30}],184:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/object-get-own-property-descriptor").f,n=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),c=(e=e("../internals/is-pure"),"".endsWith),u=Math.min;l=l("endsWith");o({target:"String",proto:!0,forced:!(!e&&!l&&(o=s(String.prototype,"endsWith"))&&!o.writable||l)},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})}))},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],187:[function(e,t,r){var o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/an-object"),n=e("../internals/to-length"),i=e("../internals/require-object-coercible"),a=e("../internals/advance-string-index"),l=e("../internals/regexp-exec-abstract");o("match",1,(function(e,t,r){return[function(t){var r=i(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,r):new RegExp(t)[e](String(r))},function(e){var o=r(t,e,this);if(o.done)return o.value;var i=s(e),c=String(this);if(!i.global)return l(i,c);for(var u=i.unicode,d=[],h=i.lastIndex=0;null!==(p=l(i,c));){var p=String(p[0]);""===(d[h]=p)&&(i.lastIndex=a(c,n(i.lastIndex),u)),h++}return 0===h?null:d}]}))},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":134}],188:[function(e,t,r){e("../internals/export")({target:"String",proto:!0},{repeat:e("../internals/string-repeat")})},{"../internals/export":50,"../internals/string-repeat":125}],189:[function(e,t,r){var o=e("../internals/fix-regexp-well-known-symbol-logic"),s=e("../internals/an-object"),n=e("../internals/to-object"),i=e("../internals/to-length"),a=e("../internals/to-integer"),l=e("../internals/require-object-coercible"),c=e("../internals/advance-string-index"),u=e("../internals/regexp-exec-abstract"),d=Math.max,h=Math.min,p=Math.floor,f=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;o("replace",2,(function(e,t,r,o){var y=o.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,g=o.REPLACE_KEEPS_$0,v=y?"$":"$0";return[function(r,o){var s=l(this),n=null==r?void 0:r[e];return void 0!==n?n.call(r,s,o):t.call(String(s),r,o)},function(e,o){if(!y&&g||"string"==typeof o&&-1===o.indexOf(v)){var l=r(t,e,this,o);if(l.done)return l.value}for(var b,_=s(e),w=String(this),x="function"==typeof o,j=(x||(o=String(o)),_.global),S=(j&&(b=_.unicode,_.lastIndex=0),[]);null!==(A=u(_,w))&&(S.push(A),j);)""===String(A[0])&&(_.lastIndex=c(w,i(_.lastIndex),b));for(var E,M="",T=0,C=0;C>>0;if(0==n)return[];if(void 0===e)return[o];if(!s(e))return t.call(o,e,n);for(var a,l,c,u=[],p=(r=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),0),m=new RegExp(e.source,r+"g");(a=d.call(m,o))&&!(p<(l=m.lastIndex)&&(u.push(o.slice(p,a.index)),1=n));)m.lastIndex===a.index&&m.lastIndex++;return p===o.length?!c&&m.test("")||u.push(""):u.push(o.slice(p)),u.length>n?u.slice(0,n):u}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t;return[function(t,r){var s=i(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,s,r):o.call(String(s),t,r)},function(e,s){if((i=r(o,e,this,s,o!==t)).done)return i.value;var i=n(e),d=String(this),h=(e=a(i,RegExp),i.unicode),y=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(m?"y":"g"),g=new e(m?i:"^(?:"+i.source+")",y),v=void 0===s?f:s>>>0;if(0==v)return[];if(0===d.length)return null===u(g,d)?[d]:[];for(var b=0,_=0,w=[];_e.key){o.splice(t,0,e);break}t===n&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=L(this).entries,o=b(e,16)return;for(o=0;h();){if(s=null,o>0){if(!("."==h()&&o<4))return;d++}if(!N.test(h()))return;for(;N.test(h());){if(n=parseInt(h(),10),null===s)s=n;else{if(0==s)return;s=10*s+n}if(s>255)return;d++}l[c]=256*l[c]+s,2!=++o&&4!=o||c++}if(4!=o)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;l[c++]=t}else{if(null!==u)return;d++,u=++c}}if(null!==u)for(i=c-u,c=7;0!=c&&i>0;)a=l[c],l[c--]=l[u+i-1],l[u+--i]=a;else if(8!=c)return;return l}(t.slice(1,-1)))?void(e.host=r):R;if(te(e))return t=x(t),V.test(t)||null===(r=function(e){var t,r,o,s,n,i,a,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(r=[],o=0;o1&&"0"==s.charAt(0)&&(n=U.test(s)?16:8,s=s.slice(8==n?1:2)),""===s)i=0;else{if(!(10==n?G:8==n?B:z).test(s))return e;i=parseInt(s,n)}r.push(i)}for(o=0;o=O(256,5-t))return null}else if(i>255)return null;for(a=r.pop(),o=0;o":1,"`":1}),J=b({},Z,{"#":1,"?":1,"{":1,"}":1}),Q=b({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(e,t){var r=w(e,0);return 32x,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,u=l>>16&255,f=l>>8&255,m=(m=h(l=255&l,f,u,c))in a?a[m]:a[m]=function(e,t,r,o,s){let n=0,i=1e100;for(let c=0;ci||((l+=b(a[0]-e))>i||((l+=b(a[1]-t))>i||((l+=b(a[2]-r))>i||(i=l,n=c))))}return n}(l,f,u,c,t);i[e]=m}else{const e="rgb444"===r?p:d;for(let r=0;r>16&255,v=y>>8&255,_=(_=e(y=255&y,v,g))in a?a[_]:a[_]=function(e,t,r,o){let s=0,n=1e100;for(let l=0;ln||((a+=b(i[1]-t))>n||((a+=b(i[2]-r))>n||(n=a,s=l)))}return s}(y,v,g,t);i[r]=_}}return i},default:()=>T,nearestColor:()=>function(e,t,r=g){return e[_(e,t,r)]},nearestColorIndex:()=>_,nearestColorIndexWithDistance:()=>w,prequantize:()=>function(e,{roundRGB:t=5,roundAlpha:r=10,oneBitAlpha:o=null}={}){const s=new Uint32Array(e.buffer);for(let e=0;e>24&255;var n=a>>16&255,i=a>>8&255,a=255&a;l=v(l,r),o&&(l=l<=("number"==typeof o?o:127)?0:255),a=v(a,t),i=v(i,t),n=v(n,t),s[e]=l<<24|n<<16|i<<8|a<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:s=!0,clearAlphaColor:n=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const c="rgba4444"===o,u=function(e,t){const r=new Array("rgb444"===t?4096:65536),o=e.length;if("rgba4444"===t)for(let t=0;t>24&255,i=s>>16&255,a=s>>8&255,l=h(s=255&s,a,i,n);let o=l in r?r[l]:r[l]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=s,o.gc+=a,o.bc+=i,o.ac+=n,o.cnt++}else if("rgb444"===t)for(let t=0;t>16&255,f=c>>8&255,m=p(c=255&c,f,u);let o=m in r?r[m]:r[m]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=c,o.gc+=f,o.bc+=u,o.cnt++}else for(let t=0;t>16&255,v=y>>8&255,b=d(y=255&y,v,g);let o=b in r?r[b]:r[b]={ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0};o.rc+=y,o.gc+=v,o.bc+=g,o.cnt++}return r}(e,o),g=u.length,v=g-1,b=new Uint32Array(g+1);for(var _=0,w=0;w>1]].err<=E);j=S)b[j]=x;b[j]=w}var M,T=_-t;for(w=0;w=M.mtm&&u[M.nn].mtm<=M.tm)break;for(M.mtm==v?C=b[1]=b[b[0]--]:(y(u,C,!1),M.tm=w),E=u[C].err,j=1;(S=j+j)<=b[0]&&(Su[b[S+1]].err&&S++,!(E<=u[x=b[S]].err));j=S)b[j]=x;b[j]=C}var A=u[M.nn],k=M.cnt,O=A.cnt,L=1/(k+O);c&&(M.ac=L*(k*M.ac+O*A.ac)),M.rc=L*(k*M.rc+O*A.rc),M.gc=L*(k*M.gc+O*A.gc),M.bc=L*(k*M.bc+O*A.bc),M.cnt+=A.cnt,M.mtm=++w,u[A.bk].fw=A.fw,u[A.fw].bk=A.bk,A.mtm=v}let P=[];for(w=0;;0){let e=f(Math.round(u[w].rc),0,255),t=f(Math.round(u[w].gc),0,255),r=f(Math.round(u[w].bc),0,255),o=255;c&&(o=f(Math.round(u[w].ac),0,255),a&&(o=o<=(R="number"==typeof a?a:127)?0:255),s&&o<=i&&(e=t=r=n,o=0));var R=c?[e,t,r,o]:[e,t,r];if(function(e,t){for(let s=0;sfunction(e,t,r=5){if(e.length&&t.length){var o=e.map((e=>e.slice(0,3))),s=r*r,n=e[0].length;for(let r=0;rn?l.slice(0,3):l.slice();var i,a=(i=w(o,l.slice(0,3),g))[0];0<(i=i[1])&&i<=s&&(e[a]=l)}}}};for(o in i)s(n,o,{get:i[o],enumerable:!0});var a={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function l(e=256){let t=0,r=new Uint8Array(e);return{get buffer(){return r.buffer},reset(){t=0},bytesView:()=>r.subarray(0,t),bytes:()=>r.slice(0,t),writeByte(e){o(t+1),r[t]=e,t++},writeBytes(e,s=0,n=e.length){o(t+n);for(let o=0;o>>0),0!=o&&(e=Math.max(e,256));const s=r;r=new Uint8Array(e),0>=8,h-=8;if((_>g||m)&&(m?(y=f,g=(1<>=8,h-=8;0>3}function h(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function p(e,t,r){return e>>4<<8|240&t|r>>4}function f(e,t,r){return eo.bytes(),bytesView:()=>o.bytesView(),get buffer(){return o.buffer},get stream(){return o},writeHeader:d,writeFrame(e,t,a,l={}){var{transparent:h=!1,transparentIndex:p=0,delay:f=0,palette:m=null,repeat:y=0,colorDepth:g=8,dispose:v=-1}=l;let b=!1;if(r?c||(b=!0,d(),c=!0):b=Boolean(l.first),t=Math.max(0,Math.floor(t)),a=Math.max(0,Math.floor(a)),b){if(!m)throw new Error("First frame must include a { palette } option");var[l,_,w,x,T=8]=[o,t,a,m,g];T=128|T-1<<4|(x=M(x.length)-1),S(l,_),S(l,w),l.writeBytes([T,0,0]),j(o,m),0<=y&&(_=y,(x=o).writeByte(33),x.writeByte(255),x.writeByte(11),E(x,"NETSCAPE2.0"),x.writeByte(3),x.writeByte(1),S(x,_),x.writeByte(0))}var C,w,T=v,y=w=Math.round(f/10),_=h,x=p,f=((l=o).writeByte(33),l.writeByte(249),l.writeByte(4),x<0&&(x=0,_=!1),_=_?(C=1,2):C=0,0<=T&&(_=7&T),_<<=2,l.writeByte(0|_|C),S(l,y),l.writeByte(x||0),l.writeByte(0),Boolean(m)&&!b);h=t,p=a,C=f?m:null,(v=o).writeByte(44),S(v,0),S(v,0),S(v,h),S(v,p),C?(h=M(C.length)-1,v.writeByte(128|h)):v.writeByte(0),f&&j(o,m),[y,l,p,h,v=8,f,m,e]=[o,e,t,a,g,s,n,i],u(p,h,l,v,y,f,m,e)}};function d(){E(o,"GIF89a")}}function j(e,t){var r=1<>8&255)}function E(e,t){for(var r=0;r>1,u=-7,d=r?s-1:0,h=r?-1:1;s=e[t+d];for(d+=h,n=s&(1<<-u)-1,s>>=-u,u+=a;0>=-u,u+=o;0>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:n-1,p=o?1:-1;n=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+u?d/o:d*Math.pow(2,1-u))*o&&(i++,o/=2),c<=i+u?(a=0,i=c):1<=i+u?(a=(t*o-1)*Math.pow(2,s),i+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,s),i=0));8<=s;e[r+h]=255&a,h+=p,a/=256,s-=8);for(i=i<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])?2:t}function E(e,t){e.f+=t.f,e.b.f+=t.b.f}function M(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?n(t.a,r.a)?a(r.b.a,t.a,r.a)<=0:0<=a(t.b.a,r.a,t.a):a(r.b.a,e,r.a)<=0:r.b.a===e?0<=a(t.b.a,e,t.a):(t=i(t.b.a,e,t.a),(e=i(r.b.a,e,r.a))<=t)}function T(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){f(e.a),e.c=!1,(e.a=t).i=e}function A(e){for(var t=e.a.a;(e=ce(e)).a.a===t;);return e.c&&(C(e,t=y(le(e).a.b,e.a.e)),e=ce(e)),e}function k(e,t,r){var o=new ae;return o.a=r,o.e=V(e.f,t.e,o),r.i=o}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],u[c[h]])?ne:ie)(r,h),u[l]=null,d[l]=r.b,r.b=l}else for(r.c[-(l+1)]=null;0Math.max(y.a,v.a))){if(n(f,y)){if(0r.f&&(r.f*=2,r.c=re(r.c,r.f+1)),0===r.b?s=o:(s=r.b,r.b=r.c[r.b]),r.e[s]=t,r.c[s]=o,r.d[o]=s,r.h&&ie(r,o),s):(r=e.a++,e.c[r]=t,-(r+1))}function ee(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&n(oe(e.b),t))return se(e.b);for(;--e.a,0e.a||n(o[a],o[c])){s[r[i]=a]=i;break}s[r[i]=c]=i,i=l}}function ie(e,t){for(var r=e.d,o=e.e,s=e.c,i=t,a=r[i];;){var l=i>>1,c=r[l];if(0==l||n(o[c],o[a])){s[r[i]=a]=i;break}s[r[i]=c]=i,i=l}}function ae(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function le(e){return e.e.c.b}function ce(e){return e.e.a.b}(o=H.prototype).x=function(){q(this,0)},o.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void W(this,100900)}W(this,100901)},o.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:W(this,100900)}return!1},o.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},o.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:W(this,100900)}},o.C=function(e,t){var r=!1,o=[0,0,0];q(this,2);for(var s=0;s<3;++s){var n=e[s];n<-1e150&&(n=-1e150,r=!0),1e150i[h]&&(i[h]=g,c[h]=d)}if(i[1]-l[1]>i[d=0]-l[0]&&(d=1),l[d=i[2]-l[2]>i[d]-l[d]?2:d]>=i[d])o[0]=0,o[1]=0,o[2]=1;else{for(l=u[d],c=c[d],u=[i=0,0,0],l=[l.g[0]-c.g[0],l.g[1]-c.g[1],l.g[2]-c.g[2]],h=[0,0,0],d=r.e;d!==r;d=d.e)h[0]=d.g[0]-c.g[0],h[1]=d.g[1]-c.g[1],h[2]=d.g[2]-c.g[2],u[0]=l[1]*h[2]-l[2]*h[1],u[1]=l[2]*h[0]-l[0]*h[2],u[2]=l[0]*h[1]-l[1]*h[0],i<(g=u[0]*u[0]+u[1]*u[1]+u[2]*u[2])&&(i=g,o[0]=u[0],o[1]=u[1],o[2]=u[2]);i<=0&&(o[0]=o[1]=o[2]=0,o[S(l)]=1)}r=!0}for(u=S(o),d=this.b.c,i=(u+1)%3,c=(u+2)%3,u=0>=l,u-=l,y==n)a=1+i,c=(1<<(l=s+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var _=b;if(o>=8;null!==m&&a<4096&&(f[a++]=m<<8|_,c+1<=a&&l<12&&(++l,c=c<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=function(e,t,r,o){var s=0,n=void 0===(o=void 0===o?{}:o).loop?null:o.loop,i=void 0===o.palette?null:o.palette;if(t<=0||r<=0||65535>=1;)++l;if(u=1<>8&255,e[s++]=255&r,e[s++]=r>>8&255,e[s++]=(null!==i?128:0)|l,e[s++]=c,e[s++]=0,null!==i)for(var d=0,h=i.length;d>16&255,e[s++]=p>>8&255,e[s++]=255&p}if(null!==n){if(n<0||65535>8&255,e[s++]=0}var f=!1;this.addFrame=function(t,r,o,n,l,c){if(!0===f&&(--s,f=!1),c=void 0===c?{}:c,t<0||r<0||65535>=1;)++p;h=1<>8&255,e[s++]=v,e[s++]=0),e[s++]=44,e[s++]=255&t,e[s++]=t>>8&255,e[s++]=255&r,e[s++]=r>>8&255,e[s++]=255&o,e[s++]=o>>8&255,e[s++]=255&n,e[s++]=n>>8&255,e[s++]=!0===u?128|p-1:0,!0===u)for(var b=0,_=d.length;b<_;++b){var w=d[b];e[s++]=w>>16&255,e[s++]=w>>8&255,e[s++]=255&w}return s=function(e,t,r,o){e[t++]=r;var s=t++,n=1<>=8,u-=8,t===s+256&&(e[s]=255,s=t++)}function p(e){d|=e<>=8,u-=8,t===s+256&&(e[s]=255,s=t++);4096===l?(p(n),l=1+a,c=r+1,m={}):(1<>7&&(a=t,t+=3*(l=i)),!0),u=[],d=0,h=null,p=0,f=null;for(this.width=r,this.height=s;c&&t>2&7,t++;break;case 254:for(;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var y,g=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,w=(E=e[t++])>>6&1,x=a,j=l,S=!1,E=(E>>7&&(S=!0,x=t,t+=3*(j=1<<1+(7&E))),t);for(t++;;){if(!(0<=(y=e[t++])))throw Error("Invalid block size");if(0===y)break;t+=y}u.push({x:g,y:v,width:b,height:_,has_local_palette:S,palette_offset:x,palette_size:j,data_offset:E,data_length:t-E,transparent_index:h,interlaced:!!w,delay:d,disposal:p});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=u.length)throw new Error("Frame index out of range.");return u[e]},this.decodeAndBlitFrameBGRA=function(t,s){for(var n=(t=this.frameInfo(t)).width*t.height,i=new Uint8Array(n),a=(o(e,t.data_offset,i,n),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,d=c,h=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=h,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=i.length;g>=1)),w===l?f+=4:(b=e[a+3*w],_=e[a+3*w+1],w=e[a+3*w+2],s[f++]=w,s[f++]=_,s[f++]=b,s[f++]=255),--d}},this.decodeAndBlitFrameRGBA=function(t,s){for(var n=(t=this.frameInfo(t)).width*t.height,i=new Uint8Array(n),a=(o(e,t.data_offset,i,n),t.palette_offset),l=t.transparent_index,c=(null===l&&(l=256),t.width),u=r-c,d=c,h=4*(t.y*r+t.x),p=4*((t.y+t.height)*r+t.x),f=h,m=4*u,y=(!0===t.interlaced&&(m+=4*r*7),8),g=0,v=i.length;g>=1)),w===l?f+=4:(b=e[a+3*w],_=e[a+3*w+1],w=e[a+3*w+2],s[f++]=b,s[f++]=_,s[f++]=w,s[f++]=255),--d}}}}catch(e){}},{}],241:[function(e,t,r){(function(o){var s;s=function(t){function r(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length;if(!((e=(e=e?Number(e):0)!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function _(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++s],0<=(o-=t.table[s]););return e.tag=n,e.bitcount-=s,t.trans[r+o]}function w(e,t,r){for(;;){if(256===(n=_(e,t)))return 0;if(n<256)e.dest[e.destLen++]=n;else for(var o,s=b(e,c[n-=257],u[n]),n=_(e,r),i=o=e.destLen-b(e,d[n],h[n]);i>>=1,o=s,b(n,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},T.prototype.addX=function(e){this.addPoint(e,null)},T.prototype.addY=function(e){this.addPoint(null,e)},T.prototype.addBezier=function(e,t,r,o,s,n,i,a){var l=[e,t],c=[r,o],u=[s,n],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var p,f=6*l[h]-12*c[h]+6*u[h],m=-3*l[h]+9*c[h]-9*u[h]+3*d[h],y=3*c[h]-3*l[h];0==m?0==f||0<(p=-y/f)&&p<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],p)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],p))):(p=Math.pow(f,2)-4*y*m)<0||(0<(y=(-f+Math.sqrt(p))/(2*m))&&y<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],y)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],y))),0<(y=(-f-Math.sqrt(p))/(2*m))&&y<1&&(0===h&&this.addX(M(l[h],c[h],u[h],d[h],y)),1===h&&this.addY(M(l[h],c[h],u[h],d[h],y))))}},T.prototype.addQuad=function(e,t,r,o,s,n){r=e+2/3*(r-e),o=t+2/3*(o-t),this.addBezier(e,t,r,o,r+1/3*(s-e),o+1/3*(n-t),s,n)},C.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},C.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},C.prototype.curveTo=C.prototype.bezierCurveTo=function(e,t,r,o,s,n){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:s,y:n})},C.prototype.quadTo=C.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},C.prototype.close=C.prototype.closePath=function(){this.commands.push({type:"Z"})},C.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof T)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},C.prototype.getBoundingBox=function(){for(var e=new T,t=0,r=0,o=0,s=0,n=0;n"},C.prototype.toDOMElement=function(e){e=this.toPathData(e);var t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var O={fail:A,argument:k,assert:k},L={},P={},R={};function I(e){return function(){return e}}P.BYTE=function(e){return O.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},R.BYTE=I(1),P.CHAR=function(e){return[e.charCodeAt(0)]},R.CHAR=I(1),P.CHARARRAY=function(e){for(var t=[],r=0;r>8&255,255&e]},R.USHORT=I(2),P.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},R.SHORT=I(2),P.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},R.UINT24=I(3),P.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},R.ULONG=I(4),P.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},R.LONG=I(4),P.FIXED=P.ULONG,R.FIXED=R.ULONG,P.FWORD=P.SHORT,R.FWORD=R.SHORT,P.UFWORD=P.USHORT,R.UFWORD=R.USHORT,P.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},R.LONGDATETIME=I(8),P.TAG=function(e){return O.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},R.TAG=I(4),P.Card8=P.BYTE,R.Card8=R.BYTE,P.Card16=P.USHORT,R.Card16=R.USHORT,P.OffSize=P.BYTE,R.OffSize=R.BYTE,P.SID=P.USHORT,R.SID=R.USHORT,P.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?P.NUMBER16(e):P.NUMBER32(e)},R.NUMBER=function(e){return P.NUMBER(e).length},P.NUMBER16=function(e){return[28,e>>8&255,255&e]},R.NUMBER16=I(3),P.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},R.NUMBER32=I(5),P.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),s=0,n=t.length;s>8&255,t[t.length]=255&o}return t},R.UTF16=function(e){return 2*e.length};var D,F={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},N=(L.MACSTRING=function(e,t,r,o){var s=F[o];if(void 0!==s){for(var n="",i=0;i>8&255,l+256&255)}return n})(e,t,r)}return r},P.INDEX=function(e){for(var t=1,r=[t],o=[],s=0;s>8,t[u+1]=255&d,t=t.concat(o[c])}return t},R.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var _,w=new oe.Parser(g,v+b+14),x=new oe.Parser(g,v+b+16+2*_),j=new oe.Parser(g,v+b+16+4*_),S=new oe.Parser(g,v+b+16+6*_),E=v+b+16+8*_,M=0;M<_-1;M+=1)for(var T=void 0,C=w.parseUShort(),A=x.parseUShort(),k=j.parseShort(),L=S.parseUShort(),P=A;P<=C;P+=1)0!==L?(E=(E=S.offset+S.relativeOffset-2)+L+2*(P-A),0!==(T=oe.getUShort(g,E))&&(T=T+k&65535)):T=P+k&65535,y.glyphIndexMap[P]=T}return r},ne=function(e){for(var t=!0,r=e.length-1;0>4,i=15&i;if(15==n)break;if(o+=s[n],15==i)break;o+=s[i]}return parseFloat(o)}if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function xe(e,t,r){var o=new oe.Parser(e,t=void 0!==t?t:0),s=[],n=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,p.length=0,m=!0}return function r(a){for(var u,x,j,S,E,M,T,C,A,k,O,L,P=0;PMath.abs(L-v)?g=O+p.shift():v=L+p.shift(),h.curveTo(o,s,n,i,T,C),h.curveTo(A,k,O,L,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+R),p.length=0}break;case 14:0>3;break;case 21:2>16),P+=2;break;case 29:E=p.pop()+e.gsubrsBias,(M=e.gsubrs[E])&&r(M);break;case 30:for(;0=r.begin&&e=ce.length&&(n=o.parseChar(),r.names.push(o.parseString(n)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1})),t.fields=t.fields.concat(o),t.fields=t.fields.concat(s),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");p|=1<>>1,n=e[s].tag;if(n===t)return s;n>>1,n=e[s];if(n===t)return s;n>>1,i=(s=e[n]).start;if(i===t)return s;i(s=e[r-1]).end?0:s}function Tt(e,t){this.font=e,this.tableName=t}function Ct(e){Tt.call(this,e,"gpos")}function At(e){Tt.call(this,e,"gsub")}function kt(e,t,r){for(var o=e.subtables,s=0;st.points.length-1||o.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=It([a=s.points[o.matchedPoints[1]]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0})[0];o.dx=i.x-a.x,o.dy=i.y-a.y,n=It(s.points,o)}t.points=t.points.concat(n)}}return Dt(t.points)}(Ct.prototype=Tt.prototype={searchTag:St,binSearch:Et,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e?this.font.tables[this.tableName]=this.createDefaultTable():t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=i[t-1].tag,"Features must be added in alphabetical order."),i.push(s={tag:r,feature:{params:0,lookupListIndexes:[]}}),n.push(t),s.feature}},getLookupTables:function(e,t,r,o,s){var n=[];if(e=this.getFeatureTable(e,t,r,s)){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,c=0;c",i),r.stack.push(Math.round(64*i))}function vr(e,r){var o=r.stack,s=o.pop(),n=r.fv,i=r.pv,a=r.ppem,l=r.deltaBase+16*(e-1),c=r.deltaShift,u=r.z0;t.DEBUG&&console.log(r.step,"DELTAP["+e+"]",s,o);for(var d=0;d>4)===a&&(0<=(p=(15&p)-8)&&p++,t.DEBUG&&console.log(r.step,"DELTAPFIX",h,"by",p*c),h=u[h],n.setRelative(h,h,p*c,i))}}function br(e,r){var o=r.stack,s=o.pop();t.DEBUG&&console.log(r.step,"ROUND[]"),o.push(64*r.round(s/64))}function _r(e,r){var o=r.stack,s=o.pop(),n=r.ppem,i=r.deltaBase+16*(e-1),a=r.deltaShift;t.DEBUG&&console.log(r.step,"DELTAC["+e+"]",s,o);for(var l=0;l>4)===n&&(0<=(u=(15&u)-8)&&u++,u*=a,t.DEBUG&&console.log(r.step,"DELTACFIX",c,"by",u),r.cvt[c]+=u)}}function wr(e,r){var o,s=(n=r.stack).pop(),n=n.pop(),i=r.z2[s],a=r.z1[n];t.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",s,n),s=e?(o=i.y-a.y,a.x-i.x):(o=a.x-i.x,a.y-i.y),r.dpv=Zt(o,s)}function xr(e,r){var o=r.stack,s=r.prog,n=r.ip;t.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var i=0;i":"_")+(s?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+i.cvt[u]+","+l+")":"",c,"(d =",a,"->",g*y,")"),i.rp1=i.rp0,i.rp2=c,r&&(i.rp0=c)}Ut.prototype.exec=function(e,r){if("number"!=typeof r)throw new Error("Point size is not a number!");if(!(2",s),l.interpolate(h,i,a,c),l.touch(h)}e.loop=1},fr.bind(void 0,0),fr.bind(void 0,1),function(e){for(var r=e.stack,o=e.rp0,s=e.z0[o],n=e.loop,i=e.fv,a=e.pv,l=e.z1;n--;){var c=r.pop(),u=l[c];t.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(s).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},o.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+s))?this.dummyDOM.querySelector("#"+o+i).insertAdjacentHTML("beforebegin",'

        ')):(r='

        '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(n)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+a))?this.dummyDOM.querySelector("#".concat(o+c))&&this.dummyDOM.querySelector("#".concat(o+c)).insertAdjacentHTML("beforebegin",'

        ')):(r='

        '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+l),this.descriptions.label.innerHTML=t)},o.default.prototype._describeElementHTML=function(e,t,r){var o,u=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(u+s))?this.dummyDOM.querySelector("#"+u+i)||this.dummyDOM.querySelector("#"+u+n).insertAdjacentHTML("afterend",'
        Canvas elements and their descriptions
        ')):(o='
        Canvas elements and their descriptions
        '),this.dummyDOM.querySelector("#".concat(u,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+u).innerHTML=o),(o=document.createElement("tr")).id=u+"_fte_"+t,this.dummyDOM.querySelector("#"+u+i).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(u+a))?this.dummyDOM.querySelector("#".concat(u+c))||this.dummyDOM.querySelector("#"+u+l).insertAdjacentHTML("afterend",'
        ')):(o='
        '),this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(u,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+u).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=u+"_lte_"+t,this.dummyDOM.querySelector("#"+u+c).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(u).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.replace":189}],248:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateGridOutput=function(e){var t,r,o,s;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){return t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]),t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1])}((r=function(e,t){var r,o="",s="",n=0;for(r in t){var i,a=0;for(i in t[r]){var l='
      • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
      • "),o+=l,a++,n++}s=1').concat(t[o][l].color," ").concat(o,"
        "):'').concat(t[o][l].color," ").concat(o," midpoint"),a[t[o][l].loc.locY][t[o][l].loc.locX]?a[t[o][l].loc.locY][t[o][l].loc.locX]=a[t[o][l].loc.locY][t[o][l].loc.locX]+" "+c:a[t[o][l].loc.locY][t[o][l].loc.locX]=c,n++}for(s in a){var u,d="";for(u in a[s])d+="",void 0!==a[s][u]&&(d+=a[s][u]),d+="";i=i+d+""}return i}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),s!==t.map.innerHTML&&(t.map.innerHTML=s),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.map":161}],249:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function s(e,t,r){return e[0]<.4*t?e[1]<.4*r?"top left":e[1]>.6*r?"bottom left":"mid left":e[0]>.6*t?e[1]<.4*r?"top right":e[1]>.6*r?"bottom right":"mid right":e[1]<.4*r?"top middle":e[1]>.6*r?"bottom middle":"middle"}function n(e,t,r){return 10===(t=Math.floor(e[0]/t*10))&&(t-=1),10===(e=Math.floor(e[1]/r*10))&&(e-=1),{locX:t,locY:e}}o.default.prototype.textOutput=function(e){o.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},o.default.prototype.gridOutput=function(e){o.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},o.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},o.default.prototype._createOutput=function(e,t){var r,o,s,n=this.canvas.id,i=(this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(n).parentNode),"");"Fallback"===t?(r=n+e,this.dummyDOM.querySelector("#".concat(o=n+"accessibleOutput"))||(this.dummyDOM.querySelector("#".concat(n,"_Description"))?this.dummyDOM.querySelector("#".concat(n,"_Description")).insertAdjacentHTML("afterend",'
        ')):this.dummyDOM.querySelector("#".concat(n)).innerHTML='
        '))):"Label"===t&&(r=n+e+(i=t),this.dummyDOM.querySelector("#".concat(o=n+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(n,"_Label"))?this.dummyDOM.querySelector("#".concat(n,"_Label")):this.dummyDOM.querySelector("#".concat(n))).insertAdjacentHTML("afterend",'
        '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(n,"gridOutput").concat(i),s='
        Text Output

          '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",s):this.dummyDOM.querySelector("#".concat(o)).innerHTML=s,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(n,"textOutput").concat(i),s='
          Grid Output

            '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",s):this.dummyDOM.querySelector("#".concat(o)).innerHTML=s,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,i={},a=!0,l=function(e,t){var r;return e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]),[r,e]}(e,t);if("line"===e?(i.color=this.ingredients.colors.stroke,i.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=s([t[0],[1]],this.width,this.height),o=s([t[2],[3]],this.width,this.height),i.loc=n(l,this.width,this.height),i.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?i.color=this.ingredients.colors.stroke:(i.color=this.ingredients.colors.fill,i.area=function(e,t,r,o){var s,n,i,a,l,c,u,d=0;return"arc"===e?(d=(s=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI))*t[2]*t[3]/8,"open"!==t[6]&&"chord"!==t[6]||(u=t[0],n=t[1],i=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),a=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),l=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),c=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),u=Math.abs(u*(a-c)+i*(c-n)+l*(n-a))/2,s>Math.PI?d+=u:d-=u)):"ellipse"===e||"circle"===e?d=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?d=0:"quadrilateral"===e?d=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?d=t[2]*t[3]:"triangle"===e&&(d=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),Math.round(100*d/(r*o))}(e,t,this.width,this.height)),i.pos=s(l,this.width,this.height),i.loc=n(l,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[i]){for(var c in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][c])===JSON.stringify(i)&&(a=!1);!0===a&&this.ingredients.shapes[e].push(i)}}else this.ingredients.shapes[e]=[i]},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.map":161,"core-js/modules/es.number.to-fixed":171}],250:[function(e,t,r){e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.prototype._updateTextOutput=function(e){var t,r,o,s;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){return r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following"),r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:")}((r=function(e,t){var r,o="",s=0;for(r in t)for(var n in t[r]){var i='
          • ').concat(t[r][n].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][n].pos,", ").concat(t[r][n].length," pixels long.
          • "):(i+=", at ".concat(t[r][n].pos),"point"!==r&&(i+=", covering ".concat(t[r][n].area,"% of the canvas")),i+="."),o+=i,s++}return{numShapes:s,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),s=function(e,t){var r,o="",s=0;for(r in t)for(var n in t[r]){var i='').concat(t[r][n].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][n].pos,"length = ").concat(t[r][n].length," pixels"):(i+="location = ".concat(t[r][n].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][n].area,"%")),i+=""),o+=i,s++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),s!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=s),this._accessibleOutputs[e]=t)},e=e.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149}],251:[function(e,t,r){var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":246,"./accessibility/describe":247,"./accessibility/gridOutput":248,"./accessibility/outputs":249,"./accessibility/textOutput":250,"./color/color_conversion":252,"./color/creating_reading":253,"./color/p5.Color":254,"./color/setting":255,"./core/constants":256,"./core/environment":257,"./core/friendly_errors/fes_core":258,"./core/friendly_errors/file_errors":259,"./core/friendly_errors/sketch_reader":260,"./core/friendly_errors/stacktrace":261,"./core/friendly_errors/validate_params":262,"./core/helpers":263,"./core/init":264,"./core/legacy":266,"./core/main":267,"./core/p5.Element":268,"./core/p5.Graphics":269,"./core/p5.Renderer":270,"./core/p5.Renderer2D":271,"./core/preload":272,"./core/rendering":273,"./core/shape/2d_primitives":274,"./core/shape/attributes":275,"./core/shape/curves":276,"./core/shape/vertex":277,"./core/shim":278,"./core/structure":279,"./core/transform":280,"./data/local_storage.js":281,"./data/p5.TypedDict":282,"./dom/dom":283,"./events/acceleration":284,"./events/keyboard":285,"./events/mouse":286,"./events/touch":287,"./image/filters":288,"./image/image":289,"./image/loading_displaying":290,"./image/p5.Image":291,"./image/pixels":292,"./io/files":293,"./io/p5.Table":294,"./io/p5.TableRow":295,"./io/p5.XML":296,"./math/calculation":297,"./math/math":298,"./math/noise":299,"./math/p5.Vector":300,"./math/random":301,"./math/trigonometry":302,"./typography/attributes":303,"./typography/loading_displaying":304,"./typography/p5.Font":305,"./utilities/array_functions":306,"./utilities/conversion":307,"./utilities/string_functions":308,"./utilities/time_date":309,"./webgl/3d_primitives":310,"./webgl/interaction":311,"./webgl/light":312,"./webgl/loading":313,"./webgl/material":314,"./webgl/p5.Camera":315,"./webgl/p5.Geometry":316,"./webgl/p5.Matrix":317,"./webgl/p5.RenderBuffer":318,"./webgl/p5.RendererGL":321,"./webgl/p5.RendererGL.Immediate":319,"./webgl/p5.RendererGL.Retained":320,"./webgl/p5.Shader":322,"./webgl/p5.Texture":323,"./webgl/text":324}],252:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../core/main"))&&e.__esModule?e:{default:e}).default.ColorConversion={},e.default.ColorConversion._hsbaToHSLA=function(e){var t=e[0],r=e[1],o=e[2],s=(2-r)*o/2;return 0!=s&&(1==s?r=0:s<.5?r/=2-r:r=r*o/(2-2*s)),[t,r,s,e[3]]},e.default.ColorConversion._hsbaToRGBA=function(e){var t,r,o,s,n,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(s=o,n=l,r):2===t?(s=r,n=l,a):3===t?(s=r,n=o,l):4===t?(s=a,n=r,l):5===t?(s=l,n=r,o):(s=l,n=a,r),[s,n,i,e[3]])},e.default.ColorConversion._hslaToHSBA=function(e){var t=e[0],r=e[1],o=e[2],s=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(s-o)/s,s,e[3]]},e.default.ColorConversion._hslaToRGBA=function(e){var t,r=6*e[0],o=e[1],s=e[2];return 0===o?[s,s,s,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*s-(s=s<.5?(1+o)*s:s+o-s*o),s),t(r,o,s),t(r-2,o,s),e[3]]},e.default.ColorConversion._rgbaToHSBA=function(e){var t,r,o=e[0],s=e[1],n=e[2],i=Math.max(o,s,n),a=i-Math.min(o,s,n);return 0==a?r=t=0:(r=a/i,o===i?t=(s-n)/a:s===i?t=2+(n-o)/a:n===i&&(t=4+(o-s)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},e.default.ColorConversion._rgbaToHSLA=function(e){var t,r,o,s=e[0],n=e[1],i=e[2],a=Math.max(s,n,i),l=a+(o=Math.min(s,n,i));return 0==(o=a-o)?r=t=0:(r=l<1?o/l:o/(2-l),s===a?t=(n-i)/o:n===a?t=2+(i-s)/o:i===a&&(t=4+(s-n)/o),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]},e=e.default.ColorConversion,r.default=e},{"../core/main":267}],253:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../core/main"))&&l.__esModule?l:{default:l},i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),n.default.prototype.alpha=function(e){return n.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},n.default.prototype.blue=function(e){return n.default._validateParameters("blue",arguments),this.color(e)._getBlue()},n.default.prototype.brightness=function(e){return n.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},n.default.prototype.color=function(){var e;return n.default._validateParameters("color",arguments),arguments[0]instanceof n.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new n.default.Color(this,e))},n.default.prototype.green=function(e){return n.default._validateParameters("green",arguments),this.color(e)._getGreen()},n.default.prototype.hue=function(e){return n.default._validateParameters("hue",arguments),this.color(e)._getHue()},n.default.prototype.lerpColor=function(e,t,r){n.default._validateParameters("lerpColor",arguments);var o,s,a,l=this._colorMode,c=this._colorMaxes;if(l===i.RGB)s=e.levels.map((function(e){return e/255})),a=t.levels.map((function(e){return e/255}));else if(l===i.HSB)e._getBrightness(),t._getBrightness(),s=e.hsba,a=t.hsba;else{if(l!==i.HSL)throw new Error("".concat(l,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),s=e.hsla,a=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(s[0],a[0],r),t=this.lerp(s[1],a[1],r),o=this.lerp(s[2],a[2],r),s=this.lerp(s[3],a[3],r),e*=c[l][0],t*=c[l][1],o*=c[l][2],s*=c[l][3],this.color(e,t,o,s)},n.default.prototype.lightness=function(e){return n.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},n.default.prototype.red=function(e){return n.default._validateParameters("red",arguments),this.color(e)._getRed()},n.default.prototype.saturation=function(e){return n.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var l=n.default;r.default=l},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],254:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=c(e("../core/main")),i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants")),a=c(e("./color_conversion"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}n.default.Color=function(e,t){if(this._storeModeAndMaxes(e._colorMode,e._colorMaxes),this.mode!==i.RGB&&this.mode!==i.HSL&&this.mode!==i.HSB)throw new Error("".concat(this.mode," is an invalid colorMode."));return this._array=n.default.Color._parseInputs.apply(this,t),this._calculateLevels(),this},n.default.Color.prototype.toString=function(e){var t=this.levels,r=this._array,o=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[3].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[i.HSB][0],", ",this.hsba[1]*this.maxes[i.HSB][1],", ",this.hsba[2]*this.maxes[i.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[i.HSB][0],", ",this.hsba[1]*this.maxes[i.HSB][1],", ",this.hsba[2]*this.maxes[i.HSB][2],", ",o,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[i.HSL][0],", ",this.hsla[1]*this.maxes[i.HSL][1],", ",this.hsla[2]*this.maxes[i.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[i.HSL][0],", ",this.hsla[1]*this.maxes[i.HSL][1],", ",this.hsla[2]*this.maxes[i.HSL][2],", ",o,")");case"hsla%":return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",o,")")}},n.default.Color.prototype.setRed=function(e){this._array[0]=e/this.maxes[i.RGB][0],this._calculateLevels()},n.default.Color.prototype.setGreen=function(e){this._array[1]=e/this.maxes[i.RGB][1],this._calculateLevels()},n.default.Color.prototype.setBlue=function(e){this._array[2]=e/this.maxes[i.RGB][2],this._calculateLevels()},n.default.Color.prototype.setAlpha=function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()},n.default.Color.prototype._calculateLevels=function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r]);this.hsla=null,this.hsba=null},n.default.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},n.default.Color.prototype._storeModeAndMaxes=function(e,t){this.mode=e,this.maxes=t},n.default.Color.prototype._getMode=function(){return this.mode},n.default.Color.prototype._getMaxes=function(){return this.maxes},n.default.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[i.RGB][2]},n.default.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[i.HSB][2]},n.default.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[i.RGB][1]},n.default.Color.prototype._getHue=function(){return this.mode===i.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[i.HSB][0]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[i.HSL][0])},n.default.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[i.HSL][2]},n.default.Color.prototype._getRed=function(){return this._array[0]*this.maxes[i.RGB][0]},n.default.Color.prototype._getSaturation=function(){return this.mode===i.HSB?(this.hsba||(this.hsba=a.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[i.HSB][1]):(this.hsla||(this.hsla=a.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[i.HSL][1])};var u={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},d=(e=/\s*/,/(\d{1,3})/),h=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,p=new RegExp("".concat(h.source,"%")),f={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",d.source,",",d.source,",",d.source,"\\)$"].join(e.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",p.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),RGBA:new RegExp(["^rgba\\(",d.source,",",d.source,",",d.source,",",h.source,"\\)$"].join(e.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",p.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i"),HSL:new RegExp(["^hsl\\(",d.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),HSLA:new RegExp(["^hsla\\(",d.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i"),HSB:new RegExp(["^hsb\\(",d.source,",",p.source,",",p.source,"\\)$"].join(e.source),"i"),HSBA:new RegExp(["^hsba\\(",d.source,",",p.source,",",p.source,",",h.source,"\\)$"].join(e.source),"i")};n.default.Color._parseInputs=function(e,t,r,o){var s,l=arguments.length,c=this.mode,d=this.maxes[c],h=[];if(3<=l){for(h[0]=e/d[0],h[1]=t/d[1],h[2]=r/d[2],h[3]="number"==typeof o?o/d[3]:1,s=h.length-1;0<=s;--s){var p=h[s];p<0?h[s]=0:1"].indexOf(t[0])?void 0:t[0],lineNumber:t[1],columnNumber:t[2],source:e}}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[2],source:e}}),this)},parseOpera:function(e){return!e.stacktrace||-1e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),o=[],s=2,n=r.length;s/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}}),this)}}}e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,(e=(e=e("../main"))&&e.__esModule?e:{default:e}).default._getErrorStackParser=function(){return new o},e=e.default,r.default=e},{"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191}],262:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(s=e("../main"))&&s.__esModule?s:{default:s};function n(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,n=function(){return e},e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}(function(e){if(!(e&&e.__esModule||null===e||"object"!==i(e)&&"function"!=typeof e)){var t=n();if(t&&t.has(e))return t.get(e);var r,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=s?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r])}o.default=e,t&&t.set(e,o)}})(e("../constants")),e("../internationalization"),s.default._validateParameters=s.default._clearValidateParamsCache=function(){},e=s.default,r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.map":166,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],263:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var a;Object.prototype.hasOwnProperty.call(e,r)&&((a=n?Object.getOwnPropertyDescriptor(e,r):null)&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("./constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,s){return s===n.CORNER?{x:e,y:t,w:r,h:o}:s===n.CORNERS?{x:e,y:t,w:r-e,h:o-t}:s===n.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:s===n.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":256,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],264:[function(e,t,r){e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(s=e("../core/main"))&&s.__esModule?s:{default:s};e("./internationalization");var s=Promise.resolve();Promise.all([new Promise((function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)})),s]).then((function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default}))},{"../core/main":267,"./internationalization":265,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/web.dom-collections.iterator":230}],265:[function(e,t,r){e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var o,s=i(e("i18next")),n=i(e("i18next-browser-languagedetector"));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.init(t,r)}var t;return(t=[{key:"fetchWithTimeout",value:function(e,t){var r=2=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);return(n=new s.default.Image(r,o)).canvas.getContext("2d").drawImage(a,e,t,r*i,o*i,0,0,r,o),n},s.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading},s.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*n._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},s.default.Renderer.prototype.textStyle=function(e){return e?(e!==n.NORMAL&&e!==n.ITALIC&&e!==n.BOLD&&e!==n.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},s.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},s.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},s.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},s.default.Renderer.prototype.textWrap=function(e){return this._setProperty("_textWrap",e),this._textWrap},s.default.Renderer.prototype.text=function(e,t,r,o,s){var i,a,l,c,u=this._pInst,d=this._textWrap,h=Number.MAX_VALUE,p=r;if((this._doFill||this._doStroke)&&void 0!==e){if(i=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===n.CENTER&&(t-=o/2),this._textAlign){case n.CENTER:t+=o/2;break;case n.RIGHT:t+=o}if(void 0!==s){this._rectMode===n.CENTER&&(r-=s/2,p-=s/2);e=r;var f=u.textAscent();switch(this._textBaseline){case n.BOTTOM:c=r+s,r=Math.max(c,r),p+=f;break;case n.CENTER:c=r+s/2,r=Math.max(c,r),p+=f/2}h=r+s-f,this._textBaseline===n.CENTER&&(h=e+s-f/2)}else{if(this._textBaseline===n.BOTTOM)return console.warn("textAlign(*, BOTTOM) requires x, y, width and height");if(this._textBaseline===n.CENTER)return console.warn("textAlign(*, CENTER) requires x, y, width and height")}if(d===n.WORD){for(var m=[],y=0;yi.HALF_PI&&e<=3*i.HALF_PI?Math.atan(r/o*Math.tan(e))+i.PI:Math.atan(r/o*Math.tan(e))+i.TWO_PI,t=t<=i.HALF_PI?Math.atan(r/o*Math.tan(t)):t>i.HALF_PI&&t<=3*i.HALF_PI?Math.atan(r/o*Math.tan(t))+i.PI:Math.atan(r/o*Math.tan(t))+i.TWO_PI),tf||Math.abs(this.accelerationY-this.pAccelerationY)>f||Math.abs(this.accelerationZ-this.pAccelerationZ)>f)&&n.deviceMoved(),"function"==typeof n.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},a._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},a._createImageData=function(e,t){return a._tmpCanvas=document.createElement("canvas"),a._tmpCtx=a._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},a.apply=function(e,t,r){var o=e.getContext("2d"),s=o.getImageData(0,0,e.width,e.height);(t=t(s,r))instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(s,0,0,0,0,e.width,e.height)},a.threshold=function(e,t){for(var r=a._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),s=0;s>8)/o,r[s+1]=255*(i*t>>8)/o,r[s+2]=255*(l*t>>8)/o}},a.dilate=function(e){for(var t,r,o,s,n,i,l,c,u,d=a._toPixels(e),h=0,p=d.length?d.length/4:0,f=new Int32Array(p);h>16&255)+151*(s>>8&255)+28*(255&s))<(l=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,s=l),s<(l=77*((u=a._getARGB(d,c))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,s=l),s<(c=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=n,s=c),s<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,s=u),f[h++]=o;a._setPixels(d,f)},a.erode=function(e){for(var t,r,o,s,n,i,l,c,u,d=a._toPixels(e),h=0,p=d.length?d.length/4:0,f=new Int32Array(p);h>16&255)+151*(u>>8&255)+28*(255&u))<(s=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=u,s=l),(l=77*((u=a._getARGB(d,c))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(n>>8&255)+28*(255&n))>16&255)+151*(i>>8&255)+28*(255&i))>>24],l+=G[(16711680&z)>>16],c+=G[(65280&z)>>8],u+=G[255&z],r+=n[E],h++}M[p=k+j]=d/r,T[p]=l/r,C[p]=c/r,A[p]=u/r}k+=v}for(m=(f=-o)*v,S=k=0;S"+p.length.toString()+" out of "+l.toString()),e.next=45,new Promise((function(e){return setTimeout(e,0)}));e.next=47;break;case 45:e.next=36;break;case 47:f.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(h),g=(0,c.GIFEncoder)(),v=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+j.toString()+" out of "+l.toString()),e.next=65,new Promise((function(e){return setTimeout(e,0)}));case 65:j++,e.next=57;break;case 68:g.finish(),T=g.bytesView(),T=new Blob([T],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),f.html("Done. Downloading your gif!🌸"),n.default.prototype.downloadFile(T,t,"gif");case 77:case"end":return e.stop()}}),e,this)}));var e,t=function(){var t=this,r=arguments;return new Promise((function(o,s){var n=e.apply(t,r);function i(e){h(n,o,s,i,a,"next",e)}function a(e){h(n,o,s,i,a,"throw",e)}i(void 0)}))};return function(e,r){return t.apply(this,arguments)}}(),n.default.prototype.image=function(e,t,r,o,s,l,c,u,d,h,f,m){n.default._validateParameters("image",arguments);var y=e.width,g=e.height,v=(m=m||a.CENTER,f=f||a.CENTER,e.elt&&e.elt.videoWidth&&!e.canvas&&(y=e.elt.videoWidth,g=e.elt.videoHeight),o||y);s=s||g,l=l||0,c=c||0,u=p(u||y,y),y=p(d||g,g),d=1;e.elt&&!e.canvas&&e.elt.style.width&&(d=e.elt.videoWidth&&!o?e.elt.videoWidth:e.elt.width,d/=parseInt(e.elt.style.width,10)),l*=d,c*=d,y*=d,u*=d,g=function(e,t,r,o,s,n,i,l,c,u,d){var h,p,f,m,y,g,v,b,_;return e===a.COVER&&(h=t,f=r,v=n,b=i,g=l,_=c,p=u,m=d,v/=y=Math.max(v/p,b/m),b/=y,y=g,g=_,h===a.CENTER?y+=(p-v)/2:h===a.RIGHT&&(y+=p-v),f===a.CENTER?g+=(m-b)/2:f===a.BOTTOM&&(g+=m-b),l=(_={x:y,y:g,w:v,h:b}).x,c=_.y,u=_.w,d=_.h),e===a.CONTAIN&&(h=t,p=r,f=o,m=s,y=n,g=i,v=u,b=d,v/=_=Math.max(v/y,b/g),b/=_,_=f,f=m,h===a.CENTER?_+=(y-v)/2:h===a.RIGHT&&(_+=y-v),p===a.CENTER?f+=(g-b)/2:p===a.BOTTOM&&(f+=g-b),o=(e={x:_,y:f,w:v,h:b}).x,s=e.y,n=e.w,i=e.h),{sx:l,sy:c,sw:u,sh:d,dx:o,dy:s,dw:n,dh:i}}(h,f,m,(g=i.default.modeAdjust(t,r,v,s,this._renderer._imageMode)).x,g.y,g.w,g.h,l,c,u,y),this._renderer.image(e,g.sx,g.sy,g.sw,g.sh,g.dx,g.dy,g.dw,g.dh)},n.default.prototype.tint=function(){for(var e=arguments.length,t=new Array(e),r=0;r=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))},o.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},o.default.Image.prototype.loadPixels=function(){o.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},o.default.Image.prototype.updatePixels=function(e,t,r,s){o.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,s),this.setModified(!0)},o.default.Image.prototype.get=function(e,t,r,s){return o.default._validateParameters("p5.Image.get",arguments),o.default.Renderer2D.prototype.get.apply(this,arguments)},o.default.Image.prototype._getPixel=o.default.Renderer2D.prototype._getPixel,o.default.Image.prototype.set=function(e,t,r){o.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},o.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var o=this.gifProperties,s=0;s/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),s.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print(""),n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==i[0]){n.print(" ");for(var h=0;h".concat(p)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var m=0;m".concat(y)),n.print(" ")}n.print(" ")}n.print("
            "),n.print(""),n.print("")}n.close(),n.clear()},s.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream";s.default.prototype._isSafari()&&(o="text/plain"),e=new Blob(e,{type:o});s.default.prototype.downloadFile(e,t,r)},s.default.prototype.downloadFile=function(e,t,r){var o;r=(t=u(t,r))[0];e instanceof Blob?i.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),s.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},s.default.prototype._checkFileExtension=u,s.default.prototype._isSafari=function(){return 0>>0},n=function(){return(t=(1664525*t+1013904223)%r)/r};o(e),s=new Array(4096);for(var i=0;i<4096;i++)s[i]=n()},e=e.default;r.default=e},{"../core/main":267}],300:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(u=e("../core/main"))&&u.__esModule?u:{default:u},i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function c(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}n.default.Vector=function(){var e,t,r="[object Function]"==={}.toString.call(arguments[0])?(this.isPInst=!0,this._fromRadians=arguments[0],this._toRadians=arguments[1],e=arguments[2]||0,t=arguments[3]||0,arguments[4]||0):(e=arguments[0]||0,t=arguments[1]||0,arguments[2]||0);this.x=e,this.y=t,this.z=r},n.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},n.default.Vector.prototype.set=function(e,t,r){return e instanceof n.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},n.default.Vector.prototype.copy=function(){return this.isPInst?new n.default.Vector(this._fromRadians,this._toRadians,this.x,this.y,this.z):new n.default.Vector(this.x,this.y,this.z)},n.default.Vector.prototype.add=function(e,t,r){return e instanceof n.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this},n.default.Vector.prototype.rem=function(e,t,r){var o;if(e instanceof n.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z))return s=parseFloat(e.x),i=parseFloat(e.y),o=parseFloat(e.z),c.call(this,s,i,o)}else if(e instanceof Array){if(e.every((function(e){return Number.isFinite(e)})))return 2===e.length?l.call(this,e[0],e[1]):3===e.length?c.call(this,e[0],e[1],e[2]):void 0}else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var s=Array.prototype.slice.call(arguments);if(s.every((function(e){return Number.isFinite(e)}))&&2===s.length)return l.call(this,s[0],s[1])}else if(3===arguments.length){var i=Array.prototype.slice.call(arguments);if(i.every((function(e){return Number.isFinite(e)}))&&3===i.length)return c.call(this,i[0],i[1],i[2])}},n.default.Vector.prototype.sub=function(e,t,r){return e instanceof n.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},n.default.Vector.prototype.mult=function(e,t,r){var o;return e instanceof n.default.Vector?Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z?(this.x*=e.x,this.y*=e.y,this.z*=e.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"):e instanceof Array?e.every((function(e){return Number.isFinite(e)}))&&e.every((function(e){return"number"==typeof e}))?1===e.length?(this.x*=e[0],this.y*=e[0],this.z*=e[0]):2===e.length?(this.x*=e[0],this.y*=e[1]):3===e.length&&(this.x*=e[0],this.y*=e[1],this.z*=e[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"):(o=Array.prototype.slice.call(arguments)).every((function(e){return Number.isFinite(e)}))&&o.every((function(e){return"number"==typeof e}))?(1===arguments.length&&(this.x*=e,this.y*=e,this.z*=e),2===arguments.length&&(this.x*=e,this.y*=t),3===arguments.length&&(this.x*=e,this.y*=t,this.z*=r)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this},n.default.Vector.prototype.div=function(e,t,r){if(e instanceof n.default.Vector)if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z){var o=0===e.z&&0===this.z;if(0===e.x||0===e.y||!o&&0===e.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=e.x,this.y/=e.y,o||(this.z/=e.z)}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(e instanceof Array)if(e.every((function(e){return Number.isFinite(e)}))&&e.every((function(e){return"number"==typeof e}))){if(e.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===e.length?(this.x/=e[0],this.y/=e[0],this.z/=e[0]):2===e.length?(this.x/=e[0],this.y/=e[1]):3===e.length&&(this.x/=e[0],this.y/=e[1],this.z/=e[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if((o=Array.prototype.slice.call(arguments)).every((function(e){return Number.isFinite(e)}))&&o.every((function(e){return"number"==typeof e}))){if(o.some((function(e){return 0===e})))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===arguments.length&&(this.x/=e,this.y/=e,this.z/=e),2===arguments.length&&(this.x/=e,this.y/=t),3===arguments.length&&(this.x/=e,this.y/=t,this.z/=r)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number");return this},n.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},n.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},n.default.Vector.prototype.dot=function(e,t,r){return e instanceof n.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},n.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z;e=this.x*e.y-this.y*e.x;return this.isPInst?new n.default.Vector(this._fromRadians,this._toRadians,t,r,e):new n.default.Vector(t,r,e)},n.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},n.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},n.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},o.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},o.default.prototype.random=function(e,t){var r,n;return o.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(th&&(_=d,b=a,n=l,d=j+h*(i&&j=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)},e=o.default,r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.repeat":188}],308:[function(e,t,r){e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(l=e("../core/main"))&&l.__esModule?l:{default:l};function s(e,t,r){var o=e<0,s=(e=o?e.toString().substring(1):e.toString()).indexOf("."),n=-1!==s?e.substring(0,s):e,i=-1!==s?e.substring(s+1):"",a=o?"-":"";if(void 0!==r){o="",(-1!==s||0r&&(i=i.substring(0,r));for(var l=0;lo.length)for(var s=t-(o+=-1===r?".":"").length+1,n=0;n=i.TWO_PI?"".concat(h="ellipse","|"):"".concat(h="arc","|").concat(a,"|").concat(l,"|").concat(c,"|")).concat(u,"|"),h=(this.geometryInHash(d)||((t=new n.default.Geometry(u,1,(function(){if(this.strokeIndices=[],a.toFixed(10)!==l.toFixed(10)){c!==i.PIE&&void 0!==c||(this.vertices.push(new n.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=e/u*(l-a)+a,r=.5+Math.cos(t)/2;t=.5+Math.sin(t)/2;this.vertices.push(new n.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(m>>10&31)/31):(r=a,s=l,c)),new o.default.Vector(g,v,b)),w=1;w<=3;w++){var x=y+12*w;x=new o.default.Vector(u.getFloat32(x,!0),u.getFloat32(4+x,!0),u.getFloat32(8+x,!0));e.vertices.push(x),e.vertexNormals.push(_),h&&i.push(r,s,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{if(t=new DataView(t),!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");(function(e,t){for(var r,s,n="",i=[],a=0;a=Math.PI)&&(s*=-1),(i+=r)<0&&(i=.1),e=Math.sin(n)*i*Math.sin(o),t=Math.cos(n)*i,r=Math.sin(n)*i*Math.cos(o);this.camera(e+this.centerX,t+this.centerY,r+this.centerZ,this.centerX,this.centerY,this.centerZ,0,s,0)},o.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},o.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])},e=o.default.Camera,r.default=e},{"../core/main":267}],316:[function(e,t,r){e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineTangentsIn=[],this.lineTangentsOut=[],this.lineSides=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.lineVertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},o.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},o.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,o=this.detailX+1,s=0;sthis.vertices.length-1-this.detailX;s--)e.add(this.vertexNormals[s]);e=o.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},o.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},o.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),r.drawArrays(r.Points,0,e.length),o.unbindShader()},o.default.RendererGL);r.default=n},{"../core/main":267,"./p5.RenderBuffer":318,"./p5.RendererGL":321,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.some":163,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/web.dom-collections.iterator":230}],321:[function(e,t,r){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=c(e("../core/main")),i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var i;Object.prototype.hasOwnProperty.call(e,r)&&((i=n?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(o,r,i):o[r]=e[r])}return o.default=e,t&&t.set(e,o),o}(e("../core/constants")),a=c(e("libtess"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function c(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n gl_FragColor *= saturate(max(antialias, cover));\n}\n",lineVert:m+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:m+"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n"};n.default.RendererGL=function(e,t,r,o){return n.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._pInst._setProperty("drawingContext",this.drawingContext),this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=i.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curAmbientColor=this._cachedFillStyle=[1,1,1,1],this.curSpecularColor=this._cachedFillStyle=[0,0,0,0],this.curEmissiveColor=this._cachedFillStyle=[0,0,0,0],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=i.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._useLineColor=!1,this._useVertexColor=!1,this.registerEnabled=[],this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new n.default.Matrix,this.uPMatrix=new n.default.Matrix,this.uNMatrix=new n.default.Matrix("mat3"),this._currentNormal=new n.default.Vector(0,0,1),this._curCamera=new n.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new n.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new n.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new n.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],fill:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new n.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new n.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new n.default.Geometry,shapeMode:i.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new n.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new n.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new n.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new n.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new n.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new n.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new n.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new n.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new n.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.curStrokeCap=i.ROUND,this.curStrokeJoin=i.ROUND,this.textures=[],this.textureMode=i.IMAGE,this.textureWrapX=i.CLAMP,this.textureWrapY=i.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this.isProcessingVertices=!1,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},n.default.RendererGL.prototype=Object.create(n.default.Renderer.prototype),n.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},n.default.RendererGL.prototype._initContext=function(){if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)},n.default.RendererGL.prototype._resetContext=function(e,t){var r,o=this.width,s=this.height,i=this.canvas.id,a=this._pInst instanceof n.default.Graphics;a?((r=this._pInst).canvas.parentNode.removeChild(r.canvas),r.canvas=document.createElement("canvas"),(r._pInst._userNode||document.body).appendChild(r.canvas),n.default.Element.call(r,r.canvas,r._pInst),r.width=o,r.height=s):((r=this.canvas)&&r.parentNode.removeChild(r),(r=document.createElement("canvas")).id=i,(this._pInst._userNode||document.body).appendChild(r),this._pInst.canvas=r,this.canvas=r),i=new n.default.RendererGL(this._pInst.canvas,this._pInst,!a);this._pInst._setProperty("_renderer",i),i.resize(o,s),i._applyDefaults(),a||this._pInst._elements.push(i),"function"==typeof t&&setTimeout((function(){t.apply(window._renderer,e)}),0)},n.default.prototype.setAttributes=function(e,t){if(void 0===this._glAttributes)console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");else{var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var o in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(o))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}},n.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},n.default.RendererGL.prototype.background=function(){var e=(o=(o=this._pInst).color.apply(o,arguments)).levels[0]/255,t=o.levels[1]/255,r=o.levels[2]/255,o=o.levels[3]/255;this.clear(e,t,r,o)},n.default.RendererGL.prototype.fill=function(e,t,r,o){var s=n.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=s._array,this.drawMode=i.FILL,this._useNormalMaterial=!1,this._tex=null},n.default.RendererGL.prototype.stroke=function(e,t,r,o){var s=n.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=s._array},n.default.RendererGL.prototype.strokeCap=function(e){this.curStrokeCap=e},n.default.RendererGL.prototype.strokeJoin=function(e){this.curStrokeJoin=e},n.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},n.default.RendererGL.prototype.blendMode=function(e){e===i.DARKEST||e===i.LIGHTEST||e===i.ADD||e===i.BLEND||e===i.SUBTRACT||e===i.SCREEN||e===i.EXCLUSION||e===i.REPLACE||e===i.MULTIPLY||e===i.REMOVE?this.curBlendMode=e:e!==i.BURN&&e!==i.OVERLAY&&e!==i.HARD_LIGHT&&e!==i.SOFT_LIGHT&&e!==i.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},n.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._applyBlendMode(i.REMOVE),this._isErasing=!0,this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])},n.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this._isErasing=!1,this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode))},n.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},n.default.RendererGL.prototype._getPixel=function(e,t){var r=new Uint8Array(4);return this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},n.default.RendererGL.prototype.loadPixels=function(){var e,t=this._pixelsState;!0!==this._pInst._glAttributes.preserveDrawingBuffer?console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true."):(t=t.pixels,e=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4,t instanceof Uint8Array&&t.length===e||(t=new Uint8Array(e),this._pixelsState._setProperty("pixels",t)),e=this._pInst._pixelDensity,this.GL.readPixels(0,0,this.width*e,this.height*e,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t))},n.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},n.default.RendererGL.prototype.resize=function(e,t){n.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize(),void 0!==(e=this._pixelsState).pixels&&e._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},n.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,o=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e*o,t*o,r*o,o),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},n.default.RendererGL.prototype.applyMatrix=function(e,t,r,o,s,i){16===arguments.length?n.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,o,0,0,0,0,1,0,s,i,0,1])},n.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof n.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},n.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},n.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(n.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},n.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},n.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},n.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},n.default.RendererGL.prototype.push=function(){var e=n.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t.curAmbientColor=this.curAmbientColor,t.curSpecularColor=this.curSpecularColor,t.curEmissiveColor=this.curEmissiveColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,t._currentNormal=this._currentNormal,t.curBlendMode=this.curBlendMode,e},n.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this},n.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},n.default.RendererGL.prototype._getRetainedStrokeShader=n.default.RendererGL.prototype._getImmediateStrokeShader,n.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},n.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},n.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},n.default.RendererGL.prototype._getRetainedLineShader=n.default.RendererGL.prototype._getImmediateLineShader,n.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new n.default.Shader(this,y.phongVert,y.phongFrag):this._defaultLightShader=new n.default.Shader(this,y.lightVert,y.lightTextureFrag)),this._defaultLightShader},n.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new n.default.Shader(this,y.immediateVert,y.vertexColorFrag)),this._defaultImmediateModeShader},n.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new n.default.Shader(this,y.normalVert,y.normalFrag)),this._defaultNormalShader},n.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new n.default.Shader(this,y.normalVert,y.basicFrag)),this._defaultColorShader},n.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new n.default.Shader(this,y.pointVert,y.pointFrag)),this._defaultPointShader},n.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new n.default.Shader(this,y.lineVert,y.lineFrag)),this._defaultLineShader},n.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new n.default.Shader(this,y.fontVert,y.fontFrag)),this._defaultFontShader},n.default.RendererGL.prototype._getEmptyTexture=function(){var e;return this._emptyTexture||((e=new n.default.Image(1,1)).set(0,0,255),this._emptyTexture=new n.default.Texture(this,e)),this._emptyTexture},n.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,o=!1,s=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var l=i.value;if(l.src===e)return l}}catch(e){o=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw s}}return o=new n.default.Texture(this,e),t.push(o),o},n.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uUseLineColor",this._useLineColor),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight),e.setUniform("uStrokeCap",p[this.curStrokeCap]),e.setUniform("uStrokeJoin",f[this.curStrokeJoin])},n.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uUseVertexColor",this._useVertexColor),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uAmbientMatColor",this.curAmbientColor),e.setUniform("uSpecularMatColor",this.curSpecularColor),e.setUniform("uEmissiveMatColor",this.curEmissiveColor),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors),t=this.directionalLightDiffuseColors.length/3,e.setUniform("uDirectionalLightCount",t),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors),t=this.ambientLightColors.length/3,e.setUniform("uAmbientLightCount",t),e.setUniform("uAmbientColor",this.ambientLightColors),t=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",t),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},n.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)},n.default.RendererGL.prototype._bindBuffer=function(e,t,r,o,s){t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r&&(e=new(o||Float32Array)(r),this.GL.bufferData(t,e,s||this.GL.STATIC_DRAW))},n.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var o=0;o>7,127&h,d>>7,127&d);for(var p=0;p>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:s}}}}e("./p5.Shader"),e("./p5.RendererGL.Retained"),i.default.RendererGL.prototype._applyTextProperties=function(){},i.default.RendererGL.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):0};var h=Math.sqrt(3);i.default.RendererGL.prototype._renderText=function(e,t,r,o,s){if(this._textFont&&"string"!=typeof this._textFont){if(!(s<=o)&&this._doFill){if(this._isOpenType()){e.push();s=this._doStroke;var n=this.drawMode,l=(this._doStroke=!1,this.drawMode=a.TEXTURE,this._textFont.font),c=(c=this._textFont._fontInfo)||(this._textFont._fontInfo=new d(l)),u=(r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/l.unitsPerEm,this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),h=(r=!this._defaultFontShader,this._getFontShader()),p=(h.init(),h.bindShader(),r&&(h.setUniform("uGridImageSize",[64,64]),h.setUniform("uCellsImageSize",[64,64]),h.setUniform("uStrokeImageSize",[64,64]),h.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),f=(p||((o=this._textGeom=new i.default.Geometry(1,1,(function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new i.default.Vector(t,e,0)),this.uvs.push(t,e)}))).computeFaces().computeNormals(),p=this.createBuffers("glyph",o)),!0);r=!1,o=void 0;try{for(var m,y=this.retainedMode.buffers.text[Symbol.iterator]();!(f=(m=y.next()).done);f=!0)m.value._prepareBuffer(p,h)}catch(e){r=!0,o=e}finally{try{f||null==y.return||y.return()}finally{if(r)throw o}}this._bindBuffer(p.indexBuffer,u.ELEMENT_ARRAY_BUFFER),h.setUniform("uMaterialColor",this.curFillColor);try{var g=0,v=null,b=l.stringToGlyphs(t),_=!0,w=!1,x=void 0;try{for(var j,S=b[Symbol.iterator]();!(_=(j=S.next()).done);_=!0){var E,M,T=j.value,C=(v&&(g+=l.getKerningValue(v,T)),c.getGlyphInfo(T));C.uGlyphRect&&(E=C.rowInfo,M=C.colInfo,h.setUniform("uSamplerStrokes",C.strokeImageInfo.imageData),h.setUniform("uSamplerRowStrokes",E.cellImageInfo.imageData),h.setUniform("uSamplerRows",E.dimImageInfo.imageData),h.setUniform("uSamplerColStrokes",M.cellImageInfo.imageData),h.setUniform("uSamplerCols",M.dimImageInfo.imageData),h.setUniform("uGridOffset",C.uGridOffset),h.setUniform("uGlyphRect",C.uGlyphRect),h.setUniform("uGlyphOffset",g),h.bindTextures(),u.drawElements(u.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),g+=T.advanceWidth,v=T}}catch(e){w=!0,x=e}finally{try{_||null==S.return||S.return()}finally{if(w)throw x}}}finally{h.unbindShader(),this._doStroke=s,this.drawMode=n,e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":256,"../core/main":267,"./p5.RendererGL.Retained":320,"./p5.Shader":322,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}]},{},[251])(251)}));class se{static availableLanguages=["ar","bn","bs","bg","zh","hr","cs","da","nl","en","et","fi","fr","de","el","gu","he","hi","hu","ga","id","it","ja","ko","lv","lt","ms","ml","mt","ne","nb","pl","pt","ro","ru","si","sk","sl","es","sv","ta","te","th","tr","uk","ur","vi","cy"];static availableTypefaces=["Amstelvar","Anybody","Barlow","Cabin","Emberly","Epilogue","IBMPlexSans","Inconsolata"];static availableTypefacesInfo={Amstelvar:{leading:1.05},Anybody:{leading:1.05},Barlow:{leading:1.05},Cabin:{leading:1.05},Emberly:{leading:1.05},Epilogue:{leading:1.05},IBMPlexSans:{leading:1.05},Inconsolata:{leading:1.05}};static visualisationGrid={height:423,width:300,marginY:20,posterMargins:[.05,.05,.05,.05]};static imageMaxSize=1024;static evolution={popSize:50,noGen:400,crossoverProb:.9,mutationProb:.1,eliteSize:1};static visiblePosters=10;static backgroundStyleOptions=[["Random",0],["Solid",1],["Gradient",2],["Triangle",2]];static textAlignmentOptions=[["Random"],["Top"],["Middle"],["Bottom"]];static textAlignmentTbOptions=[["Random"],["LEFT"],["CENTER"],["RIGHT"]];static typography={defaultColor:"#000000",range:.05,maxSize:.95,minSize:.05};static background={availableStyles:[["Random",2],["Solid",1],["Gradient",2],["Triangle",2]],defaultColors:["#ffffff","#000000"]}}class ne extends re{static get=()=>new ne;constructor(){super()}render(){return F`
            `}createRenderRoot(){return this}}customElements.define("section-divider",ne);class ie extends re{static properties={images:{}};constructor(e,t,r){super(),this.images={imageRandomPlacement:!0,hasImages:!1,blobs:[],amount:0,loading:!1,randomPlacement:!1},this.disable=!1,this._resultsContainer=t,this._errHandlerRef=r,this._onSubmit=async t=>{t.preventDefault(),await e()}}_toggleVisibility=e=>{const t=e.target.dataset.related,r=document.getElementById(t);e.target.checked&&null!==r?r.classList.add("d-none"):r.classList.remove("d-none")};dis=()=>{this.disable=!0,document.querySelector("fieldset").disabled=this.disable};data=()=>({textContent:encodeURIComponent(document.getElementById("formControlTextarea").value),shouldDivide:document.getElementById("lineDivisionCheck").checked,lang:encodeURIComponent(document.getElementById("formControlLang").value),delimiter:encodeURIComponent(document.getElementById("formControlTextDelimiter").value),images:this.images});_uploadImages=async e=>{this.images.blobs=[],this.images.hasImages=!0,this.images.loading=!0,this.images.amount=e.target.files.length,this.images.blobs=await this._readImages(e.target.files).catch((e=>{this._errHandlerRef.set({message:`not possible to load the image ${e}`})})),this.images.loading=!1,this._resultsContainer.displayImages(this.images.blobs)};_readImages=async e=>{const t=[];let r=[];const o=e=>{const t=new FileReader;return new Promise((r=>{t.onload=e=>{r(e.target.result)},t.readAsDataURL(e)}))};for(let s=0;s0){let e="";for(let t=0;t");this._errHandlerRef.set({message:e})}return await Promise.all(t)};render(){return F`
            @@ -339,7 +339,7 @@ const ae=2;class le{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r)
            `:U}
            - `}createRenderRoot(){return this}}customElements.define("header-section",Me);var Te={solid:(e,t)=>{e.background(t)},gradient:(e,t,r)=>{push();const o=e.drawingContext;e.background(t);let s=e.height;const n=o.createLinearGradient(0,0,0,s);n.addColorStop(0,t),n.addColorStop(.25,t),n.addColorStop(.75,r),n.addColorStop(1,r),o.fillStyle=n,o.fillRect(0,0,e.width,s),pop()},triangle:(e,t,r)=>{push(),e.background(t),e.noStroke(),e.fill(r),e.triangle(0,0,0,e.height,e.width,e.height),pop()}};const Ce=(e,t,r,o,s)=>o+(e-t)/(r-t)*(s-o),Ae=(e,t,r)=>Math.min(r,Math.max(t,e)),ke=e=>{const t=e.reduce(((e,t)=>e+t),0);return t/e.length||0},Oe=e=>Math.max(...e),Le=e=>Math.min(...e),Pe=(e,t)=>Ce(e=(e=e>=0?0:e)<=-t?-t:e,-t,0,1,0),Re=(e,t)=>(e=Math.abs(e),Ce(e=e>t?t:e,t,0,1,0)),Ie=(e,t)=>Re(e=e>=0?e/3:e,t),De=(e,t)=>{const r=Oe(e),o=Le(e);let s=Math.abs(r-o);const n=Oe(t),i=Le(t);let a=0;for(let r in t)if(t[r]===i){a=e[r];break}const l=t.map((e=>{let t=Ce(e,i,n,0,s);return t=Ae(t,0,s),t})),c=[];for(let t in e){let r=e[t],o=Math.abs(r-a),s=Math.abs(o-l[t]);c.push(s)}let u=Ce(ke(c),0,s,1,0);return Ae(u,0,1)},Fe=(e=[],t,r="OVERSET",o=1)=>{let s=[],n=t*o;for(let o of e){let e=t-o,i=1;switch(r){case"JUSTIFY":i=Re(e,n);break;case"ATTEMPT_JUSTIFY":i=Ie(e,n);break;default:i=Pe(e,n)}s.push(i)}return ke([...s])},Ne=(e,t,r=[],o=[],s={left:0,top:0,right:0,bottom:0})=>{let n=!1,i="",a=Math.abs(s.top)+Math.abs(s.bottom);for(let e of r)a+=parseFloat(e);let l=Math.abs(s.left)+Math.abs(s.right);for(let e of o)l+=parseFloat(e);return l=Math.round(l),a=Math.round(a),a>t?(n=!0,i+=`Grid height is bigger than container (grid:${a}, container:${t}). `):ae?(n=!0,i+=`Grid width is bigger than container (grid:${l}, container:${e}). `):l{"RELATIVE"!==r&&"FIXED"!==r&&(r="RELATIVE");let s=0;"RELATIVE"===r?s=e.reduce(((e,t)=>e+t),0):"FIXED"===r&&(s=o.height-(o.height*o.margin[1]+o.height*o.margin[3]));const n=e.map((e=>e/s));let i=[];for(let e in t){const r=Math.abs(t[e][3]-n[e]);i.push(r)}return 1-ke(i)},Be=(e,t,r=!1)=>{const o=1-De(e.map((e=>e.weight)),t.map((e=>e[3])));return De(e.map((e=>e["font-stretch"])),t.map((e=>e[3]))),o};function Ge(e,t,r){return Math.max(t,Math.min(e,r))}function ze(e){return(e%360+360)%360}function Ve(e){var t,r;return ze(function(e,t){var r;return e*(null!==(r={rad:180/Math.PI,grad:.9,turn:360}[t.toLowerCase()])&&void 0!==r?r:1)}(parseFloat(e),null!==(r=null===(t=e.match(/deg|rad|grad|turn/i))||void 0===t?void 0:t[0])&&void 0!==r?r:"deg"))}function $e(e){return new RegExp(`^${e.source}$`,e.flags)}function He(e){return e.slice(1).filter((e=>void 0!==e))}const qe=/[+-]?(?=\.\d|\d)\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/,We=/(?=[,\s])\s*(?:,\s*)?/,Xe=/\s*[,\/]\s*/,Ye=qe.source,Ze=We.source,Je=new RegExp(`hsla?\\(\\s*(${Ye}(?:deg|rad|grad|turn)?)${Ze}(${Ye})%${Ze}(${Ye})%(?:${Xe.source}(${Ye}%?))?\\s*\\)`,"i");const Qe={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",goldenrod:"#DAA520",gold:"#FFD700",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavenderblush:"#FFF0F5",lavender:"#E6E6FA",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};const Ke=/[0-9a-fA-F]/.source,et=new RegExp(`#(${Ke}{2})(${Ke}{2})(${Ke}{2})(${Ke}{2})?`),tt=new RegExp(`#(${Ke})(${Ke})(${Ke})(${Ke})?`);const rt=qe.source,ot=We.source,st=new RegExp(`rgba?\\(\\s*(${rt}%?)${ot}(${rt}%?)${ot}(${rt}%?)(?:${Xe.source}(${rt}%?))?\\s*\\)`,"i");function nt(e){return{r:Ge(e.r,0,255),g:Ge(e.g,0,255),b:Ge(e.b,0,255),a:Ge(e.a,0,1)}}function it(e){if("transparent"===(e=e.trim()).toLowerCase())return{r:0,g:0,b:0,a:0};const t=Qe[e.toLowerCase()];let r;return t&&(e=t),null!==(r=function(e){var t;const r=null!==(t=$e(et).exec(e))&&void 0!==t?t:$e(tt).exec(e);return r?He(r):null}(e))?function(e){var t;const r=e.map((e=>(1===e.length&&(e=`${e}${e}`),parseInt(e,16)))),o=(null!==(t=r[3])&&void 0!==t?t:255)/255;return{r:r[0],g:r[1],b:r[2],a:o}}(r):null!==(r=function(e){const t=$e(st).exec(e);return t?He(t):null}(e))?function(e){var t;const r=e.map(((e,t)=>{let r=parseFloat(e);return e.indexOf("%")>-1&&(r*=.01,t<3&&(r*=255)),r}));return nt({r:r[0],g:r[1],b:r[2],a:null!==(t=r[3])&&void 0!==t?t:1})}(r):null}function at(e){return{h:ze(e.h),s:Ge(e.s,0,100),l:Ge(e.l,0,100),a:Ge(e.a,0,1)}}function lt(e){const t=it(e);return t?function(e){const{r:t,g:r,b:o,a:s}=nt(e),n=t/255,i=r/255,a=o/255,l=Math.max(n,i,a),c=Math.min(n,i,a),u=l-c,d=(c+l)/2;let h=NaN,p=0;if(0!==u){switch(p=(l-d)/Math.min(d,1-d),l){case n:h=(i-a)/u+(iparseFloat(e)));let s=null!==(t=o[3])&&void 0!==t?t:1;return(null===(r=e[3])||void 0===r?void 0:r.indexOf("%"))>-1&&(s*=.01),at({h:Ve(e[0]),s:o[1],l:o[2],a:s})}(t):null}function ut(e){return`rgba(${(e=function(e){return{r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b),a:e.a}}(e)).r}, ${e.g}, ${e.b}, ${e.a})`}function dt(e){const t=function(e){return"number"==typeof e.h&&"number"==typeof e.s&&"number"==typeof e.l&&"number"==typeof e.a}(e)?function(e){const{h:t,s:r,l:o,a:s}=at(e),n=t||0,i=r/100,a=o/100;function l(e){const t=(e+n/30)%12,r=i*Math.min(a,1-a);return a-r*Math.max(-1,Math.min(t-3,9-t,1))}return{r:255*l(0),g:255*l(8),b:255*l(4),a:s}}(e):nt(e);return 1===t.a?function(e){const t=(((255&Math.round(e.r))<<16)+((255&Math.round(e.g))<<8)+(255&Math.round(e.b))).toString(16).toUpperCase();return`#${"000000".substring(t.length)}${t}`}(t):ut(t)}var ht=(e,t)=>{if("number"!=typeof t||0===t)return e;const r=function(e){var t;const r=null!==(t=ct(e))&&void 0!==t?t:lt(e);if(null===r)throw new Error("Invalid color string");return r}(e),o=(r.h+t)%360;return dt(Object.assign(Object.assign({},r),{h:o}))};var pt=(e,t)=>"number"!=typeof t||0===t?e:ht(e,30*t);var ft=(e,t)=>{if("number"!=typeof t||0===t)return e;let r=0,o=t<0?-1:1,s=0;for(;s!==t;)s+=o,r+=s%2!=0?180*o:30*o;return ht(e,r)};const mt=()=>{const e=gt();return yt(e)},yt=e=>{const t=ft(e,1);return{baseColour:e,colorA:t,colorB:pt(t,Math.round(4*Math.random()-2))}},gt=()=>{const e=[Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())].map((e=>e.toString(16).padStart(2,"0")));return`#${e.join("")}`};class vt{#d=!1;#h=!1;constructor(e,t,r=null,o=null){this.id=`${t}-${e}`,this.n=e,this.generation=t,this.ready=!1,r=JSON.parse(JSON.stringify(r)),this.fitness=1,this.constraint=0,this.metrics={legibility:1,gridAppropriateness:1},this.sentencesLenght=[];const s=null===o?r.size.height:o.size.height;this.maxFontSize=se.typography.maxSize*s,this.minFontSize=se.typography.minSize*s,this.genotype=null===o?this.#p(r):o,this.#d=null!==r&&r.display.grid,this.phenotype=null}copy=()=>{const e=this.genotype.grid,t=new _t(JSON.parse(JSON.stringify(e.size)),JSON.parse(JSON.stringify(e.v)),JSON.parse(JSON.stringify(e.h)),JSON.parse(JSON.stringify(e.defaultMargins)),JSON.parse(JSON.stringify(e.gwper)),JSON.parse(JSON.stringify(e.ghper))),r=JSON.parse(JSON.stringify(this.genotype.size)),o=JSON.parse(JSON.stringify(this.genotype.textboxes));for(let e in o)o[e].color=color(this.genotype.textboxes[e].color);const s=JSON.parse(JSON.stringify(this.genotype.background));s.colors[0]=color(this.genotype.background.colors[0]),s.colors[1]=color(this.genotype.background.colors[1]);let n=[];for(let e of this.genotype.images){const t={scale:e.scale,src:e.src,x:e.x,y:e.y};n.push(t)}const i={grid:t,textboxes:o,size:r,background:s,typography:JSON.parse(JSON.stringify(this.genotype.typography)),images:n};return new vt(this.n,this.generation,null,i)};#p=e=>{const t=mt(),r=new _t({width:e.size.width,height:e.size.height,margin:e.size.margin},2,e.sentences.length,JSON.parse(JSON.stringify(e.size.margin))),o=[],s=0===e.typography.verticalAlignment?Math.round(Math.random()*(se.textAlignmentOptions.length-2)+1):e.typography.verticalAlignment;for(let n in e.sentences){const i=e.sentences[n],a=Math.round(Math.random()*(e.typography.typefaces.length-1));let l=e.typography.typefaces[a].stretch;l.map((e=>isNaN(e)?100:parseInt(e))),l.length<2&&l.push(100);let c=e.typography.typefaces[a].weight,u=Math.round(Math.random()*(e.typography.weight.max-e.typography.weight.min)+e.typography.weight.min);u=Math.max(c[0],Math.min(u,c[1]));let d=Math.round(Math.random()*(e.typography.stretch.max-e.typography.stretch.min)+e.typography.stretch.min);d=Math.max(l[0],Math.min(d,l[1]));const h=se.availableTypefacesInfo[se.availableTypefaces[a]].leading;let p=Math.round(r.rows.l[0])/h;p+=Math.round(-p*se.typography.range+Math.random()*(p*se.typography.range)),p=Math.max(Math.round(e.size.height*se.typography.minSize),Math.min(Math.round(e.size.height*se.typography.maxSize),p)),r.defineRow(n,p*h,s);const f=0===e.typography.textAlignment?Math.round(Math.random()*(se.textAlignmentTbOptions.length-2)+1):e.typography.textAlignment;o.push({content:i,weight:u,"font-stretch":d,alignment:f,size:p,typeface:e.typography.typefaces[a].family,color:e.typography.color.random?t.baseColour:color(e.typography.color.value),uppercase:e.typography.uppercase})}const n=[];for(let t of e.images){const r=t.src,o=loadImage(r,(async t=>{await t.resize(0,e.size.height),t.ready=!0}));n.push({x:Math.random(),y:Math.random(),scale:Math.random(),src:o})}return{grid:r,textboxes:o,size:{width:e.size.width,height:e.size.height,margin:e.size.margin},background:{style:0===e.background.style?Math.round(1+Math.random()*(se.background.availableStyles.length-2)):e.background.style,colors:[e.background.color.random?t.colorA:color(e.background.color.valueA),e.background.color.random?t.colorB:color(e.background.color.valueB)]},typography:{verticalAlignment:s},images:n}};draw=async()=>{this.ready=!0,this.phenotype=createGraphics(this.genotype.size.width,this.genotype.size.height),this.phenotype.id=this.n;const e=Object.keys(Te)[this.genotype.background.style-1];return(0,Te[e])(this.phenotype,this.genotype.background.colors[0],this.genotype.background.colors[1]),this.ready=await this.#f(this.phenotype),await this.typeset(this.phenotype),this.#h&&(pg.textSize(10),pg.fill(0),pg.text(`${this.id}+${this.genotype.typography.verticalAlignment}+style=${this.genotype.background.style}\nfitness=${this.fitness}`,20,20)),(this.#d||this.#h)&&this.genotype.grid.display(this.phenotype),this.phenotype};evaluate=async e=>{this.phenotype=await this.draw(),Ue(this.genotype.grid.rows.l,e,"RELATIVE",this.genotype.size);const t=Be(this.genotype.textboxes,e);this.fitness=t;const r=Fe(this.sentencesLenght,this.genotype.grid.getAvailableWidth(),"OVERSET"),o=Ne(this.genotype.size.width,this.genotype.size.height,this.genotype.grid.rows.l,this.genotype.grid.columns.l,this.genotype.grid.marginsPos);return this.constraint=r+o,this.metrics.legibility=r,this.metrics.gridAppropriateness=o,{fitness:this.fitness,constraints:this.constraint}};typeset=async e=>{this.sentencesLenght=[],e.push(),e.translate(e.width/2,e.height/2);const t=e.drawingContext;for(let r in this.genotype.textboxes){const o=this.genotype.textboxes[r];let s=o.alignment,n=LEFT;2===s?n=CENTER:3===s&&(n=RIGHT),e.textAlign(n,BASELINE);let i=this.genotype.grid.col(s-1,!1),a=this.genotype.grid.row(parseInt(r)+1,!1);e.fill(o.color),t.font=`${o.weight} ${bt(o["font-stretch"])} ${o.size}px ${o.typeface}`,drawingContext.font=`${o.weight} ${bt(o["font-stretch"])} ${o.size}px ${o.typeface}`;let l=!0===o.uppercase?o.content.toUpperCase():o.content;e.text(l,i,a);const c=t.measureText(l).width;this.sentencesLenght.push(c)}e.pop()};#f=async e=>{let t=!0;for(let r of this.genotype.images)if(void 0!==r.src&&r.src.hasOwnProperty("ready")){if(r.src.ready){let t=e.width*r.x,o=e.height*r.y;e.imageMode(CENTER),e.image(r.src,t,o,r.src.width*r.scale,r.src.height*r.scale)}}else t=!1;return t};toggleGrid=(e=null)=>{null===e&&(e=!this.#d),this.#d=e,this.draw()}}const bt=e=>e>-10&&e<=50?"ultra-condensed":e>50&&e<=62.5?"extra-condensed":e>62.5&&e<=75?"condensed":e>75&&e<=87.5?"semi-condensed":e>87.5&&e<=100?"normal":e>100&&e<=112.5?"semi-expanded":e>112.5&&e<=125?"expanded":e>125&&e<=150?"extra-expanded":"ultra-expanded";class _t{constructor(e,t=12,r=24,o,s=.03,n=null){null===n&&(n=s),this.pos=createVector(e.width/2,e.height/2),this.size=JSON.parse(JSON.stringify(e)),this.defaultMargins=o,this.v=t,this.h=r,this.gwper=s,this.ghper=n,this.gapw=this.size.width*this.gwper,this.gaph=this.size.height*this.ghper,this.regular=!0,this.verticalSpace=[],this.marginsPos={},this.columns={},this.columns.y={},this.columns.center={},this.columns.gap={},this.rows={},this.rows.x={},this.rows.center={},this.rows.gap={},this.def()}export=()=>({pos:[this.pos.x,this.pos.y,this.pos.z],size:this.size,defaultMargins:this.defaultMargins,v:this.v,h:this.h,gapw:this.gapw,gaph:this.gaph,marginsPos:this.marginsPos,columns:this.columns,rows:this.rows});copy=()=>new _t(JSON.parse(JSON.stringify(this.size)),JSON.parse(JSON.stringify(this.v)),JSON.parse(JSON.stringify(this.h)),JSON.parse(JSON.stringify(this.defaultMargins)),JSON.parse(JSON.stringify(this.gwper)),JSON.parse(JSON.stringify(this.ghper)));updateMarginsBasedOnSize=(e=0,t=1,r,o=this.size.height)=>{const s=t*r;let n=this.size.height-s;0===e&&(n/=2),(0===e||1===e)&&this.size.margin[1]{0===e&&(t/=2),(0===e||1===e)&&this.size.margin[1]{this.size.margin=this.defaultMargins,this.marginsPos.left=this.size.margin[0]*this.size.width,this.marginsPos.top=this.size.margin[1]*this.size.height,this.marginsPos.right=this.size.margin[2]*this.size.width,this.marginsPos.bottom=this.size.margin[3]*this.size.height,this.def()};def=()=>{this.#m(),this.#y(),this.#g()};update=(e=null,t=null)=>{null!==e&&e!==this.v&&console.log(`grid updated from ${this.v} to ${e}`)};defineRow=(e,t,r)=>{this.regular=!1;const o=this.rows.l[e];this.rows.l[e]=t;let s=this.rows.l[e]-o;s=2===r?s/2:s,this.marginsPos.bottom,this.size.height,r<=2&&(this.size.margin[3]=(this.marginsPos.bottom-s)/this.size.height),r>=2&&(this.size.margin[1]=(this.marginsPos.top-s)/this.size.height),this.def()};#m=()=>{this.marginsPos.left=this.size.margin[0]*this.size.width,this.marginsPos.top=this.size.margin[1]*this.size.height,this.marginsPos.right=this.size.margin[2]*this.size.width,this.marginsPos.bottom=this.size.margin[3]*this.size.height};getSpace=()=>{const e=this.rows.l.reduce(((e,t)=>e+t),0)/this.rows.l.length;return{centre:{col:this.columns.l,row:e},gap:{col:this.columns.l-this.gapw/2,row:e-this.gaph/2}}};#y=()=>{this.columns.y.top=-this.size.height/2+this.marginsPos.top,this.columns.y.bottom=this.size.height/2-this.marginsPos.bottom;const e=(this.size.width-(this.marginsPos.left+this.marginsPos.right))/this.v;let t=[];for(let r=0;r0&&t{this.rows.x.left=-this.size.width/2+this.marginsPos.left,this.rows.x.right=this.size.width/2-this.marginsPos.right;const t=e;this.rows.l=t;let r=-this.size.height/2+this.marginsPos.top;for(let e=0;e0&&e{this.rows.x.left=-this.size.width/2+this.marginsPos.left,this.rows.x.right=this.size.width/2-this.marginsPos.right;const e=(this.size.height-(this.marginsPos.top+this.marginsPos.bottom))/this.h;if(null===this.verticalSpace||this.verticalSpace.length!==this.h||this.regular){this.verticalSpace=[];for(let t=0;tthis.h?r+=parseInt(this.rows.l[e-1]):r+=parseInt(this.rows.l[e]),this.rows.gap[e]={},e>0&&ee=0?t?this.columns.center[e]:this.columns.gap[e].right:(console.error(`this col dod not exists in grid. requested number ${e}`),0);row=(e,t=!1)=>e=0?t?this.rows.center[e]:this.rows.gap[e].top:(console.error(`this row do not exists in grid. requested number ${e}`),0);getAvailableWidth=(e=!0)=>{if(e){return this.size.width-this.size.width*this.size.margin[0]-this.size.width*this.size.margin[2]}return this.size.width};width=(e,t=!1,r=!1)=>e0?t||e===this.v?this.columns.l*e:r?this.columns.l*e-this.gapw/2:this.columns.l*e-this.gapw:(console.error(`side bigger than grid. requested side ${e}`),0);height=(e,t=!1,r=!1)=>e0?t||e===this.h?this.rows.l*e:r?this.rows.l*e-this.gaph/2:this.rows.l*e-this.gaph:(console.error(`side bigger than row grid. requested side ${e}`),0);display=(e,t=!0,r=!0,o=!0)=>{e.push(),e.translate(this.size.width/2,this.size.height/2),r&&this.#v(e),o&&this.#b(e),t&&this.#_(e),e.pop()};#_=(e,t="#0000ff")=>{e.push(),e.stroke(t),e.rectMode(CORNER),e.noFill(),e.rect(this.rows.x.left,this.columns.y.top,this.size.width-(this.marginsPos.left+this.marginsPos.right),this.size.height-(this.marginsPos.top+this.marginsPos.bottom)),e.pop()};#v=(e,t="#ff00ff",r="#009800")=>{e.push(),e.stroke(t);for(let t of Object.keys(this.columns.center)){const r=this.columns.center[t];e.line(r,this.columns.y.top,r,this.columns.y.bottom)}e.stroke(r);for(let t of Object.keys(this.columns.gap)){const r=this.columns.gap[t];"0"!==t&&t!==""+this.v&&(e.line(r.left,this.columns.y.top,r.left,this.columns.y.bottom),e.line(r.right,this.columns.y.top,r.right,this.columns.y.bottom))}e.pop()};#b=(e,t="#ff00ff",r="#009800")=>{e.push(),e.stroke(t);for(let t of Object.keys(this.rows.center)){const r=this.rows.center[t];e.line(this.rows.x.left,r,this.rows.x.right,r)}e.stroke(r);for(let t of Object.keys(this.rows.gap)){t=parseInt(t);const r=this.rows.gap[t];0!==t&&t!==this.h&&(e.text(t,this.rows.x.left+this.rows.x.right/2,r.top),e.line(this.rows.x.left,r.top,this.rows.x.right,r.top),e.line(this.rows.x.left,r.bottom,this.rows.x.right,r.bottom))}e.pop()}}class wt{#w;#x;constructor(e,t){this.size=e.evo.popSize,this.params=e,this.population=[],this.generations=0,this.ready=!1,this.evolving=!1,this.pause=!1,this.#x=t,this.targetSemanticLayout=this.#j(this.#x),console.log("targetSemanticLayout",this.targetSemanticLayout),this.#w=[],this.updated=!0,this.log={config:this.params,generations:[]},this.initialisation()}initialisation=async()=>{this.updated=!0,this.generations=0,this.#S();for(let e=0;ee.typeface));for(const e of r)-1===this.#w.indexOf(e)&&this.#w.push(e)}await this.evaluate(),this.updated=!0};evolve=async()=>{await this.#S(),document.getElementById("generation-number").textContent=this.generations;const e=[],t=parseInt(this.params.evo.eliteSize);for(let r=0;re.fitness)),o=this.population.map((e=>e.constraint));const s=await this.#E(r,o);for(let r=t;r{this.evolve()}),100):(this.evolving=!1,console.group("stats"),console.log(this.log),console.groupEnd())};uniformCrossover=(e,t)=>{const r=e.copy();t=t.copy(),Math.random()>.5&&(r.genotype.typography.verticalAlignment=t.genotype.typography.verticalAlignment);for(const e in r.genotype.textboxes)Math.random()>.5&&(r.genotype.textboxes[e]=t.genotype.textboxes[e]);r.genotype.grid=new _t(this.params.size,2,this.params.sentences.length,this.params.size.margin);for(const e in r.genotype.textboxes){const t=r.genotype.textboxes[e],o=se.availableTypefacesInfo[t.typeface].leading;r.genotype.grid.defineRow(e,t.size*o,r.genotype.typography.verticalAlignment)}if(Math.random()>.5&&(r.genotype.background.style=t.genotype.background.style),Math.random()>.5){r.genotype.background.colors[0]=t.genotype.background.colors[0],r.genotype.background.colors[1]=t.genotype.background.colors[1];for(const e in r.genotype.textboxes)r.genotype.textboxes[e].color=t.genotype.textboxes[e].color}else{let t=e.genotype.textboxes[0].color,o=t.levels?color(t.levels[0],t.levels[1],t.levels[2]):color(t);for(const e in r.genotype.textboxes)r.genotype.textboxes[e].color=o}for(const e in r.genotype.images)Math.random()>.5&&(r.genotype.images[e]=t.genotype.images[e]);return r};mutate=e=>{let t=this.params.evo.mutationProb;if(Math.random()1){const e=Math.round(Math.random()*(this.params.typography.typefaces.length-1));n=e,s.typeface=this.params.typography.typefaces[e].family}if(Math.random()<2*t){let t=Math.round(s.size+-5+5*Math.random());t=Math.min(Math.max(t,e.minFontSize),e.maxFontSize),s.size=t,r=!0}if(Math.random(){for(let t of this.population)t.toggleGrid(e);this.updated=!0};evaluate=async()=>{for(let e of this.population)await e.evaluate(this.targetSemanticLayout);await this.#T()};#E=async(e,t,r=.45)=>{let o=this.population.length,s=Array.from(Array(o).keys());for(let n=0;ne[s[i+1]]||t[s[i]]>t[s[i+1]])&&(me(s,i,i+1),n=!1)}if(n)break;n=!0}return s};#T=async()=>{this.population=this.population.sort(((e,t)=>t.fitness-t.constraint-(e.fitness-e.constraint))),console.log("best individual=",this.population[0].fitness,this.population[0].constraint)};copy=e=>JSON.parse(JSON.stringify(e));#M=(e,t=5,r=2,o=2)=>{t=te-t));let i=n.map((e=>o-2*e*(o-1)/(this.population.length-1)));const a=ye(i);i=i.map((e=>e/a)),i=(e=>{for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e})(i);for(let e=0;e{for(let e of this.#w){if(!document.fonts.check(`12px ${e}`))return!1}return!0};#S=()=>{document.querySelectorAll("canvas:not(#defaultCanvas0)").forEach((e=>{e.remove()}))};draw=async()=>{this.updated=!1;const e=this.population.length{for(let e in this.population){const t=this.population[e];save(t.phenotype,`${Date.now()}-${this.generations}-${e}`)}};#j=(e,t=.1)=>{let r=[];for(let o of e.lexicon.sentences){let e=o.emotions.data.recognisedEmotions.length,s=o.emotions.data.recognisedEmotions.map((e=>e[0])),n=o.emotions.data.recognisedEmotions.reduce(((e,t)=>e+t[1]),0);n+=t,r.push([e,s,n])}const o=ye(r.map((e=>e[2])));return r=r.map((e=>[e[0],e[1],e[2],Math.round(e[2]/o*100)/100])),r}}window.preload=()=>{},window.setup=()=>{window.app=document.createElement("app-evo"),document.querySelector("main").appendChild(app),noCanvas(),noLoop(),frameRate(25)},window.draw=()=>{if(window.app.screen<3)return null;window.app.population.updated&&(push(),background(window.app.backgroundColor),window.app.population.draw(),pop())},window.windowResized=()=>{if(window.app.screen<2)return null},window.keyPressed=()=>{if(window.app.screen<2)return null};class xt extends re{static properties={screen:0,results:{},evolving:!1};constructor(){super(),this.results=null,this.screen=0,this.evolving=!1;const e=this.#A();this.config={evo:{popSize:se.evolution.popSize,noGen:se.evolution.noGen,crossoverProb:se.evolution.crossoverProb,mutationProb:se.evolution.mutationProb,eliteSize:se.evolution.eliteSize},size:{width:se.visualisationGrid.width,height:se.visualisationGrid.height,margin:se.visualisationGrid.posterMargins},images:[],sentences:null,background:{style:0,color:{random:!0,valueA:se.background.defaultColors[0],valueB:se.background.defaultColors[1]},lock:[!1,!1]},typography:{verticalAlignment:0,color:{random:!0,value:se.typography.defaultColor},textAlignment:0,typefaces:e.typefaces,weight:e.weight,stretch:e.stretch,uppercase:!1,texboxAlignment:0,lock:[!1,!1,!1,!1,!1,!1,!1,!1]},display:{grid:!0}},this.population=null,this.errorMessage=new he,this.resultsContainer=new de,this.inputForm=new ie(this.analyse,this.resultsContainer,this.errorMessage),this.header=new Me,this.initPopForm=new Ee(this.config,this.#k,this.population,this.errorMessage),document.getElementById("defaultCanvas0").style.visibility="visible",this.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--main-bg-color")}#A=()=>{const e={typefaces:[],weight:{min:Number.MAX_VALUE,max:Number.MIN_VALUE},stretch:{min:Number.MAX_VALUE,max:Number.MIN_VALUE}};for(let t of Array.from(document.fonts))if(se.availableTypefaces.includes(t.family)){let r=t.stretch.replaceAll("%","").split(" ").map((e=>parseInt(e)));e.stretch.min>r[0]&&(e.stretch.min=r[0]),e.stretch.maxparseInt(e)));e.weight.min>o[0]&&(e.weight.min=o[0]),e.weight.max{const e=this.inputForm.data();let t=`/${e.shouldDivide?"text":`lines/${e.delimiter}`}/${e.lang}/${e.textContent}`;fetch(t).then((e=>e.json())).then((e=>{this.results=e,!1===e.success&&this.errorMessage.set(e),this.resultsContainer.set(this.results),this.inputForm.dis(),this.screen=1})).catch((e=>{this.errorMessage.set(e)}))};setupEvolution=e=>{e.preventDefault(),this.screen=2,this.config.images=Array.from(document.querySelectorAll("#input-images img")),this.#O(),this.#k()};#k=(e=!1)=>{e&&this.#O(),background(this.backgroundColor),null!==this.results?(null==this.config.sentences&&(this.config.sentences=this.results.sentences),this.population=new wt(this.config,this.results),this.initPopForm.pop=this.population,this.screen=3,this.header.showControls()):this.errorMessage.set({msg:"text input not defined. Not possible to init population"})};#O=()=>{let e=se.visiblePosters,t=Math.ceil(e/Math.floor(windowWidth/this.config.size.width));t*=this.config.size.height+2*se.visualisationGrid.marginY,createCanvas(windowWidth,t),loop()};#L=()=>F` + `}createRenderRoot(){return this}}customElements.define("header-section",Me);var Te={solid:(e,t)=>{e.background(t)},gradient:(e,t,r)=>{push();const o=e.drawingContext;e.background(t);let s=e.height;const n=o.createLinearGradient(0,0,0,s);n.addColorStop(0,t),n.addColorStop(.25,t),n.addColorStop(.75,r),n.addColorStop(1,r),o.fillStyle=n,o.fillRect(0,0,e.width,s),pop()},triangle:(e,t,r)=>{push(),e.background(t),e.noStroke(),e.fill(r),e.triangle(0,0,0,e.height,e.width,e.height),pop()}};const Ce=(e,t,r,o,s)=>o+(e-t)/(r-t)*(s-o),Ae=(e,t,r)=>Math.min(r,Math.max(t,e)),ke=e=>{const t=e.reduce(((e,t)=>e+t),0);return t/e.length||0},Oe=e=>e.reduce(((e,t)=>e+t),0),Le=e=>Math.max(...e),Pe=e=>Math.min(...e),Re=(e,t)=>Ce(e=(e=e>=0?0:e)<=-t?-t:e,-t,0,1,0),Ie=(e,t)=>(e=Math.abs(e),Ce(e=e>t?t:e,t,0,1,0)),De=(e,t)=>Ie(e=e>=0?e/3:e,t);const Fe=(e,t)=>{const r=t.filter(((e,t,r)=>r.indexOf(e)===t)),o=[];for(let s of r)for(let r=0;ro.indexOf(e)!==t)).length>=1){let n=0;for(let s in t){let i=t[s],a=e[s],l=r.indexOf(i);a!==o[l]&&n++}s=Ce(n,0,e.length,0,1)}return s},Ne=(e,t,r="DIF")=>{"MIN"!==r&&"DIF"!==r&&(r="DIF");const o=Le(e),s=Pe(e);let n=Math.abs(o-s);if(n<50)return 1;const i=Le(t),a=Pe(t);let l=s;if("DIF"===r)for(let r in t)if(t[r]===a){l=e[r];break}const c=t.map((e=>{let t=Ce(e,a,i,0,n);return t=Ae(t,0,n),t})),u=[];for(let t in e){let r=e[t],o=Math.abs(r-l),s=Math.abs(o-c[t]);u.push(s)}let d=Ce(ke(u),0,n,1,0);return Ae(d,0,1)},Ue=(e=[],t,r="OVERSET",o=1)=>{let s=[],n=t*o;for(let o of e){let e=t-o,i=1;switch(r){case"JUSTIFY":i=Ie(e,n);break;case"ATTEMPT_JUSTIFY":i=De(e,n);break;default:i=Re(e,n)}s.push(i)}return ke([...s])},Be=(e,t,r=[],o=[],s={left:0,top:0,right:0,bottom:0})=>{let n=!1,i="",a=Math.abs(s.top)+Math.abs(s.bottom);for(let e of r)a+=parseFloat(e);let l=Math.abs(s.left)+Math.abs(s.right);for(let e of o)l+=parseFloat(e);return l=Math.round(l),a=Math.round(a),a>t?(n=!0,i+=`Grid height is bigger than container (grid:${a}, container:${t}). `):ae?(n=!0,i+=`Grid width is bigger than container (grid:${l}, container:${e}). `):l{"RELATIVE"!==r&&"FIXED"!==r&&(r="RELATIVE");let s=0;"RELATIVE"===r?s=Oe(e):"FIXED"===r&&(s=o.height-(o.height*o.margin[1]+o.height*o.margin[3]));const n=e.map((e=>e/s));let i=[];for(let e in t){const r=Math.abs(t[e][3]-n[e]);i.push(r)}return 1-ke(i)},ze=(e,t,r=1,o=!0,s=[.4,.3,.3])=>{const n=t.map((e=>e[3]));let i,a=[Ne(e.map((e=>e.weight)),n),Ne(e.map((e=>e["font-stretch"])),n),r>1?Fe(e.map((e=>e["font-stretch"])),n):0],l=a.map(((e,t)=>e*s[t]));if(o)i=Oe(l);else{let e=a.map((e=>e>.2)),t=0;for(let r of e)r&&t++;i=Le(a)/t}return i};function Ve(e,t,r){return Math.max(t,Math.min(e,r))}function $e(e){return(e%360+360)%360}function He(e){var t,r;return $e(function(e,t){var r;return e*(null!==(r={rad:180/Math.PI,grad:.9,turn:360}[t.toLowerCase()])&&void 0!==r?r:1)}(parseFloat(e),null!==(r=null===(t=e.match(/deg|rad|grad|turn/i))||void 0===t?void 0:t[0])&&void 0!==r?r:"deg"))}function qe(e){return new RegExp(`^${e.source}$`,e.flags)}function We(e){return e.slice(1).filter((e=>void 0!==e))}const Xe=/[+-]?(?=\.\d|\d)\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/,Ye=/(?=[,\s])\s*(?:,\s*)?/,Ze=/\s*[,\/]\s*/,Je=Xe.source,Qe=Ye.source,Ke=new RegExp(`hsla?\\(\\s*(${Je}(?:deg|rad|grad|turn)?)${Qe}(${Je})%${Qe}(${Je})%(?:${Ze.source}(${Je}%?))?\\s*\\)`,"i");const et={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",goldenrod:"#DAA520",gold:"#FFD700",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavenderblush:"#FFF0F5",lavender:"#E6E6FA",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};const tt=/[0-9a-fA-F]/.source,rt=new RegExp(`#(${tt}{2})(${tt}{2})(${tt}{2})(${tt}{2})?`),ot=new RegExp(`#(${tt})(${tt})(${tt})(${tt})?`);const st=Xe.source,nt=Ye.source,it=new RegExp(`rgba?\\(\\s*(${st}%?)${nt}(${st}%?)${nt}(${st}%?)(?:${Ze.source}(${st}%?))?\\s*\\)`,"i");function at(e){return{r:Ve(e.r,0,255),g:Ve(e.g,0,255),b:Ve(e.b,0,255),a:Ve(e.a,0,1)}}function lt(e){if("transparent"===(e=e.trim()).toLowerCase())return{r:0,g:0,b:0,a:0};const t=et[e.toLowerCase()];let r;return t&&(e=t),null!==(r=function(e){var t;const r=null!==(t=qe(rt).exec(e))&&void 0!==t?t:qe(ot).exec(e);return r?We(r):null}(e))?function(e){var t;const r=e.map((e=>(1===e.length&&(e=`${e}${e}`),parseInt(e,16)))),o=(null!==(t=r[3])&&void 0!==t?t:255)/255;return{r:r[0],g:r[1],b:r[2],a:o}}(r):null!==(r=function(e){const t=qe(it).exec(e);return t?We(t):null}(e))?function(e){var t;const r=e.map(((e,t)=>{let r=parseFloat(e);return e.indexOf("%")>-1&&(r*=.01,t<3&&(r*=255)),r}));return at({r:r[0],g:r[1],b:r[2],a:null!==(t=r[3])&&void 0!==t?t:1})}(r):null}function ct(e){return{h:$e(e.h),s:Ve(e.s,0,100),l:Ve(e.l,0,100),a:Ve(e.a,0,1)}}function ut(e){const t=lt(e);return t?function(e){const{r:t,g:r,b:o,a:s}=at(e),n=t/255,i=r/255,a=o/255,l=Math.max(n,i,a),c=Math.min(n,i,a),u=l-c,d=(c+l)/2;let h=NaN,p=0;if(0!==u){switch(p=(l-d)/Math.min(d,1-d),l){case n:h=(i-a)/u+(iparseFloat(e)));let s=null!==(t=o[3])&&void 0!==t?t:1;return(null===(r=e[3])||void 0===r?void 0:r.indexOf("%"))>-1&&(s*=.01),ct({h:He(e[0]),s:o[1],l:o[2],a:s})}(t):null}function ht(e){return`rgba(${(e=function(e){return{r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b),a:e.a}}(e)).r}, ${e.g}, ${e.b}, ${e.a})`}function pt(e){const t=function(e){return"number"==typeof e.h&&"number"==typeof e.s&&"number"==typeof e.l&&"number"==typeof e.a}(e)?function(e){const{h:t,s:r,l:o,a:s}=ct(e),n=t||0,i=r/100,a=o/100;function l(e){const t=(e+n/30)%12,r=i*Math.min(a,1-a);return a-r*Math.max(-1,Math.min(t-3,9-t,1))}return{r:255*l(0),g:255*l(8),b:255*l(4),a:s}}(e):at(e);return 1===t.a?function(e){const t=(((255&Math.round(e.r))<<16)+((255&Math.round(e.g))<<8)+(255&Math.round(e.b))).toString(16).toUpperCase();return`#${"000000".substring(t.length)}${t}`}(t):ht(t)}var ft=(e,t)=>{if("number"!=typeof t||0===t)return e;const r=function(e){var t;const r=null!==(t=dt(e))&&void 0!==t?t:ut(e);if(null===r)throw new Error("Invalid color string");return r}(e),o=(r.h+t)%360;return pt(Object.assign(Object.assign({},r),{h:o}))};var mt=(e,t)=>"number"!=typeof t||0===t?e:ft(e,30*t);var yt=(e,t)=>{if("number"!=typeof t||0===t)return e;let r=0,o=t<0?-1:1,s=0;for(;s!==t;)s+=o,r+=s%2!=0?180*o:30*o;return ft(e,r)};const gt=()=>{const e=bt();return vt(e)},vt=e=>{const t=yt(e,1);return{baseColour:e,colorA:t,colorB:mt(t,Math.round(4*Math.random()-2))}},bt=()=>{const e=[Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())].map((e=>e.toString(16).padStart(2,"0")));return`#${e.join("")}`};class _t{#d=!1;#h=!1;constructor(e,t,r=null,o=null){this.id=`${t}-${e}`,this.n=e,this.generation=t,this.ready=!1,this.params=JSON.parse(JSON.stringify(r)),this.fitness=1,this.constraint=0,this.metrics={legibility:1,gridAppropriateness:1},this.sentencesLenght=[];const s=null===o?r.size.height:o.size.height;this.maxFontSize=se.typography.maxSize*s,this.minFontSize=se.typography.minSize*s,this.genotype=null===o?this.#p(r):o,this.#d=null!==r&&r.display.grid,this.phenotype=null}copy=()=>{const e=this.genotype.grid,t=new xt(JSON.parse(JSON.stringify(e.size)),JSON.parse(JSON.stringify(e.v)),JSON.parse(JSON.stringify(e.h)),JSON.parse(JSON.stringify(e.defaultMargins)),JSON.parse(JSON.stringify(e.gwper)),JSON.parse(JSON.stringify(e.ghper))),r=JSON.parse(JSON.stringify(this.genotype.size)),o=JSON.parse(JSON.stringify(this.genotype.textboxes));for(let e in o)o[e].color=color(this.genotype.textboxes[e].color);const s=JSON.parse(JSON.stringify(this.genotype.background));s.colors[0]=color(this.genotype.background.colors[0]),s.colors[1]=color(this.genotype.background.colors[1]);let n=[];for(let e of this.genotype.images){const t={scale:e.scale,src:e.src,x:e.x,y:e.y};n.push(t)}const i={grid:t,textboxes:o,size:r,background:s,typography:JSON.parse(JSON.stringify(this.genotype.typography)),images:n};return new _t(this.n,this.generation,this.params,i)};#p=e=>{const t=gt(),r=new xt({width:e.size.width,height:e.size.height,margin:e.size.margin},2,e.sentences.length,JSON.parse(JSON.stringify(e.size.margin))),o=[],s=0===e.typography.verticalAlignment?Math.round(Math.random()*(se.textAlignmentOptions.length-2)+1):e.typography.verticalAlignment;for(let n in e.sentences){const i=e.sentences[n],a=Math.round(Math.random()*(e.typography.typefaces.length-1));let l=e.typography.typefaces[a].stretch;l.map((e=>isNaN(e)?100:parseInt(e))),l.length<2&&l.push(100);let c=e.typography.typefaces[a].weight,u=Math.round(Math.random()*(e.typography.weight.max-e.typography.weight.min)+e.typography.weight.min);u=Math.max(c[0],Math.min(u,c[1]));let d=Math.round(Math.random()*(e.typography.stretch.max-e.typography.stretch.min)+e.typography.stretch.min);d=Math.max(l[0],Math.min(d,l[1]));const h=se.availableTypefacesInfo[se.availableTypefaces[a]].leading;let p=Math.round(r.rows.l[0])/h;p+=Math.round(-p*se.typography.range+Math.random()*(p*se.typography.range)),p=Math.max(Math.round(e.size.height*se.typography.minSize),Math.min(Math.round(e.size.height*se.typography.maxSize),p)),r.defineRow(n,p*h,s);const f=0===e.typography.textAlignment?Math.round(Math.random()*(se.textAlignmentTbOptions.length-2)+1):e.typography.textAlignment;o.push({content:i,weight:u,"font-stretch":d,alignment:f,size:p,typeface:e.typography.typefaces[a].family,color:e.typography.color.random?t.baseColour:color(e.typography.color.value),uppercase:e.typography.uppercase})}const n=[];for(let t of e.images){const r=t.src,o=loadImage(r,(async t=>{await t.resize(0,e.size.height),t.ready=!0}));n.push({x:Math.random(),y:Math.random(),scale:Math.random(),src:o})}return{grid:r,textboxes:o,size:{width:e.size.width,height:e.size.height,margin:e.size.margin},background:{style:0===e.background.style?Math.round(1+Math.random()*(se.background.availableStyles.length-2)):e.background.style,colors:[e.background.color.random?t.colorA:color(e.background.color.valueA),e.background.color.random?t.colorB:color(e.background.color.valueB)]},typography:{verticalAlignment:s},images:n}};draw=async()=>{this.ready=!0,this.phenotype=createGraphics(this.genotype.size.width,this.genotype.size.height),this.phenotype.id=this.n;const e=Object.keys(Te)[this.genotype.background.style-1];return(0,Te[e])(this.phenotype,this.genotype.background.colors[0],this.genotype.background.colors[1]),this.ready=await this.#f(this.phenotype),await this.typeset(this.phenotype),this.#h&&(pg.textSize(10),pg.fill(0),pg.text(`${this.id}+${this.genotype.typography.verticalAlignment}+style=${this.genotype.background.style}\nfitness=${this.fitness}`,20,20)),(this.#d||this.#h)&&this.genotype.grid.display(this.phenotype),this.phenotype};evaluate=async e=>{this.phenotype=await this.draw();const t=this.params.typography.typefaces.length,r=Ge(this.genotype.grid.rows.l,e,"FIXED",this.genotype.size),o=ze(this.genotype.textboxes,e,t),s=Ue(this.sentencesLenght,this.genotype.grid.getAvailableWidth(),"JUSTIFY");this.fitness=.3*o+.3*r+.4*s;const n=Ue(this.sentencesLenght,this.genotype.grid.getAvailableWidth(),"OVERSET"),i=Be(this.genotype.size.width,this.genotype.size.height,this.genotype.grid.rows.l,this.genotype.grid.columns.l,this.genotype.grid.marginsPos);return this.constraint=n+i,this.metrics.legibility=n,this.metrics.gridAppropriateness=i,{fitness:this.fitness,constraints:this.constraint}};typeset=async e=>{this.sentencesLenght=[],e.push(),e.translate(e.width/2,e.height/2);const t=e.drawingContext;for(let r in this.genotype.textboxes){const o=this.genotype.textboxes[r];let s=o.alignment,n=LEFT;2===s?n=CENTER:3===s&&(n=RIGHT),e.textAlign(n,BASELINE);let i=this.genotype.grid.col(s-1,!1),a=this.genotype.grid.row(parseInt(r)+1,!1);e.fill(o.color),t.font=`${o.weight} ${wt(o["font-stretch"])} ${o.size}px ${o.typeface}`,drawingContext.font=`${o.weight} ${wt(o["font-stretch"])} ${o.size}px ${o.typeface}`;let l=!0===o.uppercase?o.content.toUpperCase():o.content;e.text(l,i,a);const c=t.measureText(l).width;this.sentencesLenght.push(c)}e.pop()};#f=async e=>{let t=!0;for(let r of this.genotype.images)if(void 0!==r.src&&r.src.hasOwnProperty("ready")){if(r.src.ready){let t=e.width*r.x,o=e.height*r.y;e.imageMode(CENTER),e.image(r.src,t,o,r.src.width*r.scale,r.src.height*r.scale)}}else t=!1;return t};toggleGrid=(e=null)=>{null===e&&(e=!this.#d),this.#d=e,this.draw()}}const wt=e=>e>-10&&e<=50?"ultra-condensed":e>50&&e<=62.5?"extra-condensed":e>62.5&&e<=75?"condensed":e>75&&e<=87.5?"semi-condensed":e>87.5&&e<=100?"normal":e>100&&e<=112.5?"semi-expanded":e>112.5&&e<=125?"expanded":e>125&&e<=150?"extra-expanded":"ultra-expanded";class xt{constructor(e,t=12,r=24,o,s=.03,n=null){null===n&&(n=s),this.pos=createVector(e.width/2,e.height/2),this.size=JSON.parse(JSON.stringify(e)),this.defaultMargins=o,this.v=t,this.h=r,this.gwper=s,this.ghper=n,this.gapw=this.size.width*this.gwper,this.gaph=this.size.height*this.ghper,this.regular=!0,this.verticalSpace=[],this.marginsPos={},this.columns={},this.columns.y={},this.columns.center={},this.columns.gap={},this.rows={},this.rows.x={},this.rows.center={},this.rows.gap={},this.def()}export=()=>({pos:[this.pos.x,this.pos.y,this.pos.z],size:this.size,defaultMargins:this.defaultMargins,v:this.v,h:this.h,gapw:this.gapw,gaph:this.gaph,marginsPos:this.marginsPos,columns:this.columns,rows:this.rows});copy=()=>new xt(JSON.parse(JSON.stringify(this.size)),JSON.parse(JSON.stringify(this.v)),JSON.parse(JSON.stringify(this.h)),JSON.parse(JSON.stringify(this.defaultMargins)),JSON.parse(JSON.stringify(this.gwper)),JSON.parse(JSON.stringify(this.ghper)));updateMarginsBasedOnSize=(e=0,t=1,r,o=this.size.height)=>{const s=t*r;let n=this.size.height-s;0===e&&(n/=2),(0===e||1===e)&&this.size.margin[1]{0===e&&(t/=2),(0===e||1===e)&&this.size.margin[1]{this.size.margin=this.defaultMargins,this.marginsPos.left=this.size.margin[0]*this.size.width,this.marginsPos.top=this.size.margin[1]*this.size.height,this.marginsPos.right=this.size.margin[2]*this.size.width,this.marginsPos.bottom=this.size.margin[3]*this.size.height,this.def()};def=()=>{this.#m(),this.#y(),this.#g()};update=(e=null,t=null)=>{null!==e&&e!==this.v&&console.log(`grid updated from ${this.v} to ${e}`)};defineRow=(e,t,r)=>{this.regular=!1;const o=this.rows.l[e];this.rows.l[e]=t;let s=this.rows.l[e]-o;s=2===r?s/2:s,this.marginsPos.bottom,this.size.height,r<=2&&(this.size.margin[3]=(this.marginsPos.bottom-s)/this.size.height),r>=2&&(this.size.margin[1]=(this.marginsPos.top-s)/this.size.height),this.def()};#m=()=>{this.marginsPos.left=this.size.margin[0]*this.size.width,this.marginsPos.top=this.size.margin[1]*this.size.height,this.marginsPos.right=this.size.margin[2]*this.size.width,this.marginsPos.bottom=this.size.margin[3]*this.size.height};getSpace=()=>{const e=this.rows.l.reduce(((e,t)=>e+t),0)/this.rows.l.length;return{centre:{col:this.columns.l,row:e},gap:{col:this.columns.l-this.gapw/2,row:e-this.gaph/2}}};#y=()=>{this.columns.y.top=-this.size.height/2+this.marginsPos.top,this.columns.y.bottom=this.size.height/2-this.marginsPos.bottom;const e=(this.size.width-(this.marginsPos.left+this.marginsPos.right))/this.v;let t=[];for(let r=0;r0&&t{this.rows.x.left=-this.size.width/2+this.marginsPos.left,this.rows.x.right=this.size.width/2-this.marginsPos.right;const t=e;this.rows.l=t;let r=-this.size.height/2+this.marginsPos.top;for(let e=0;e0&&e{this.rows.x.left=-this.size.width/2+this.marginsPos.left,this.rows.x.right=this.size.width/2-this.marginsPos.right;const e=(this.size.height-(this.marginsPos.top+this.marginsPos.bottom))/this.h;if(null===this.verticalSpace||this.verticalSpace.length!==this.h||this.regular){this.verticalSpace=[];for(let t=0;tthis.h?r+=parseInt(this.rows.l[e-1]):r+=parseInt(this.rows.l[e]),this.rows.gap[e]={},e>0&&ee=0?t?this.columns.center[e]:this.columns.gap[e].right:(console.error(`this col dod not exists in grid. requested number ${e}`),0);row=(e,t=!1)=>e=0?t?this.rows.center[e]:this.rows.gap[e].top:(console.error(`this row do not exists in grid. requested number ${e}`),0);getAvailableWidth=(e=!0)=>{if(e){return this.size.width-this.size.width*this.size.margin[0]-this.size.width*this.size.margin[2]}return this.size.width};width=(e,t=!1,r=!1)=>e0?t||e===this.v?this.columns.l*e:r?this.columns.l*e-this.gapw/2:this.columns.l*e-this.gapw:(console.error(`side bigger than grid. requested side ${e}`),0);height=(e,t=!1,r=!1)=>e0?t||e===this.h?this.rows.l*e:r?this.rows.l*e-this.gaph/2:this.rows.l*e-this.gaph:(console.error(`side bigger than row grid. requested side ${e}`),0);display=(e,t=!0,r=!0,o=!0)=>{e.push(),e.translate(this.size.width/2,this.size.height/2),r&&this.#v(e),o&&this.#b(e),t&&this.#_(e),e.pop()};#_=(e,t="#0000ff")=>{e.push(),e.stroke(t),e.rectMode(CORNER),e.noFill(),e.rect(this.rows.x.left,this.columns.y.top,this.size.width-(this.marginsPos.left+this.marginsPos.right),this.size.height-(this.marginsPos.top+this.marginsPos.bottom)),e.pop()};#v=(e,t="#ff00ff",r="#009800")=>{e.push(),e.stroke(t);for(let t of Object.keys(this.columns.center)){const r=this.columns.center[t];e.line(r,this.columns.y.top,r,this.columns.y.bottom)}e.stroke(r);for(let t of Object.keys(this.columns.gap)){const r=this.columns.gap[t];"0"!==t&&t!==""+this.v&&(e.line(r.left,this.columns.y.top,r.left,this.columns.y.bottom),e.line(r.right,this.columns.y.top,r.right,this.columns.y.bottom))}e.pop()};#b=(e,t="#ff00ff",r="#009800")=>{e.push(),e.stroke(t);for(let t of Object.keys(this.rows.center)){const r=this.rows.center[t];e.line(this.rows.x.left,r,this.rows.x.right,r)}e.stroke(r);for(let t of Object.keys(this.rows.gap)){t=parseInt(t);const r=this.rows.gap[t];0!==t&&t!==this.h&&(e.text(t,this.rows.x.left+this.rows.x.right/2,r.top),e.line(this.rows.x.left,r.top,this.rows.x.right,r.top),e.line(this.rows.x.left,r.bottom,this.rows.x.right,r.bottom))}e.pop()}}class jt{#w;#x;constructor(e,t){this.size=e.evo.popSize,this.params=e,this.population=[],this.generations=0,this.ready=!1,this.evolving=!1,this.pause=!1,this.#x=t,this.targetSemanticLayout=this.#j(this.#x),console.log("targetSemanticLayout",this.targetSemanticLayout),this.#w=[],this.updated=!0,this.log={config:this.params,generations:[]},this.initialisation()}initialisation=async()=>{this.updated=!0,this.generations=0,this.#S();for(let e=0;ee.typeface));for(const e of r)-1===this.#w.indexOf(e)&&this.#w.push(e)}await this.evaluate(),this.updated=!0};evolve=async()=>{await this.#S(),document.getElementById("generation-number").textContent=this.generations;const e=[],t=parseInt(this.params.evo.eliteSize);for(let r=0;re.fitness)),o=this.population.map((e=>e.constraint));const s=await this.#E(r,o);for(let r=t;r{this.evolve()}),100):(this.evolving=!1,console.group("stats"),console.log(this.log),console.groupEnd())};uniformCrossover=(e,t)=>{const r=e.copy();t=t.copy(),Math.random()>.5&&(r.genotype.typography.verticalAlignment=t.genotype.typography.verticalAlignment);for(const e in r.genotype.textboxes)Math.random()>.5&&(r.genotype.textboxes[e]=t.genotype.textboxes[e]);r.genotype.grid=new xt(this.params.size,2,this.params.sentences.length,this.params.size.margin);for(const e in r.genotype.textboxes){const t=r.genotype.textboxes[e],o=se.availableTypefacesInfo[t.typeface].leading;r.genotype.grid.defineRow(e,t.size*o,r.genotype.typography.verticalAlignment)}if(Math.random()>.5&&(r.genotype.background.style=t.genotype.background.style),Math.random()>.5){r.genotype.background.colors[0]=t.genotype.background.colors[0],r.genotype.background.colors[1]=t.genotype.background.colors[1];for(const e in r.genotype.textboxes)r.genotype.textboxes[e].color=t.genotype.textboxes[e].color}else{let t=e.genotype.textboxes[0].color,o=t.levels?color(t.levels[0],t.levels[1],t.levels[2]):color(t);for(const e in r.genotype.textboxes)r.genotype.textboxes[e].color=o}for(const e in r.genotype.images)Math.random()>.5&&(r.genotype.images[e]=t.genotype.images[e]);return r};mutate=e=>{let t=this.params.evo.mutationProb;if(Math.random()1){const e=Math.round(Math.random()*(this.params.typography.typefaces.length-1));n=e,s.typeface=this.params.typography.typefaces[e].family}if(Math.random(){for(let t of this.population)t.toggleGrid(e);this.updated=!0};evaluate=async()=>{for(let e of this.population)await e.evaluate(this.targetSemanticLayout);await this.#T()};#E=async(e,t,r=.45)=>{let o=this.population.length,s=Array.from(Array(o).keys());for(let n=0;ne[s[i+1]]||t[s[i]]>t[s[i+1]])&&(me(s,i,i+1),n=!1)}if(n)break;n=!0}return s};#T=async()=>{this.population=this.population.sort(((e,t)=>t.fitness-t.constraint-(e.fitness-e.constraint))),console.log("best individual=",this.population[0].fitness,this.population[0].constraint)};copy=e=>JSON.parse(JSON.stringify(e));#M=(e,t=5,r=2,o=2)=>{t=te-t));let i=n.map((e=>o-2*e*(o-1)/(this.population.length-1)));const a=ye(i);i=i.map((e=>e/a)),i=(e=>{for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e})(i);for(let e=0;e{for(let e of this.#w){if(!document.fonts.check(`12px ${e}`))return!1}return!0};#S=()=>{document.querySelectorAll("canvas:not(#defaultCanvas0)").forEach((e=>{e.remove()}))};draw=async()=>{this.updated=!1;const e=this.population.length{for(let e in this.population){const t=this.population[e];save(t.phenotype,`${Date.now()}-${this.generations}-${e}`)}};#j=(e,t=.1)=>{let r=[];for(let o of e.lexicon.sentences){let e=o.emotions.data.recognisedEmotions.length,s=o.emotions.data.recognisedEmotions.map((e=>e[0])),n=o.emotions.data.recognisedEmotions.reduce(((e,t)=>e+t[1]),0);n+=t,r.push([e,s,n])}const o=ye(r.map((e=>e[2])));return r=r.map((e=>[e[0],e[1],e[2],Math.round(e[2]/o*100)/100])),r}}window.preload=()=>{},window.setup=()=>{window.app=document.createElement("app-evo"),document.querySelector("main").appendChild(app),noCanvas(),noLoop(),frameRate(25)},window.draw=()=>{if(window.app.screen<3)return null;window.app.population.updated&&(push(),background(window.app.backgroundColor),window.app.population.draw(),pop())},window.windowResized=()=>{if(window.app.screen<2)return null},window.keyPressed=()=>{if(window.app.screen<2)return null};class St extends re{static properties={screen:0,results:{},evolving:!1};constructor(){super(),this.results=null,this.screen=0,this.evolving=!1;const e=this.#A();this.config={evo:{popSize:se.evolution.popSize,noGen:se.evolution.noGen,crossoverProb:se.evolution.crossoverProb,mutationProb:se.evolution.mutationProb,eliteSize:se.evolution.eliteSize},size:{width:se.visualisationGrid.width,height:se.visualisationGrid.height,margin:se.visualisationGrid.posterMargins},images:[],sentences:null,background:{style:0,color:{random:!0,valueA:se.background.defaultColors[0],valueB:se.background.defaultColors[1]},lock:[!1,!1]},typography:{verticalAlignment:0,color:{random:!0,value:se.typography.defaultColor},textAlignment:0,typefaces:e.typefaces,weight:e.weight,stretch:e.stretch,uppercase:!1,texboxAlignment:0,lock:[!1,!1,!1,!1,!1,!1,!1,!1]},display:{grid:!0}},this.population=null,this.errorMessage=new he,this.resultsContainer=new de,this.inputForm=new ie(this.analyse,this.resultsContainer,this.errorMessage),this.header=new Me,this.initPopForm=new Ee(this.config,this.#k,this.population,this.errorMessage),document.getElementById("defaultCanvas0").style.visibility="visible",this.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--main-bg-color")}#A=()=>{const e={typefaces:[],weight:{min:Number.MAX_VALUE,max:Number.MIN_VALUE},stretch:{min:Number.MAX_VALUE,max:Number.MIN_VALUE}};for(let t of Array.from(document.fonts))if(se.availableTypefaces.includes(t.family)){let r=t.stretch.replaceAll("%",""),o=[100,100];"normal"!==r&&(o=r.split(" ").map((e=>parseInt(e)))),e.stretch.min>o[0]&&(e.stretch.min=o[0]),e.stretch.maxparseInt(e)));e.weight.min>s[0]&&(e.weight.min=s[0]),e.weight.max{const e=this.inputForm.data();let t=`/${e.shouldDivide?"text":`lines/${e.delimiter}`}/${e.lang}/${e.textContent}`;fetch(t).then((e=>e.json())).then((e=>{this.results=e,!1===e.success&&this.errorMessage.set(e),this.resultsContainer.set(this.results),this.inputForm.dis(),this.screen=1})).catch((e=>{this.errorMessage.set(e)}))};setupEvolution=e=>{e.preventDefault(),this.screen=2,this.config.images=Array.from(document.querySelectorAll("#input-images img")),this.#O(),this.#k()};#k=(e=!1)=>{e&&this.#O(),background(this.backgroundColor),null!==this.results?(null==this.config.sentences&&(this.config.sentences=this.results.sentences),this.population=new jt(this.config,this.results),this.initPopForm.pop=this.population,this.screen=3,this.header.showControls()):this.errorMessage.set({msg:"text input not defined. Not possible to init population"})};#O=()=>{let e=se.visiblePosters,t=Math.ceil(e/Math.floor(windowWidth/this.config.size.width));t*=this.config.size.height+2*se.visualisationGrid.marginY,createCanvas(windowWidth,t),loop()};#L=()=>F`
            `:U} - `}createRenderRoot(){return this}}customElements.define("app-evo",xt);export{xt as App}; + `}createRenderRoot(){return this}}customElements.define("app-evo",St);export{St as App};