@memori.ai/memori-webcomponent 7.8.5 → 7.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
 
2
2
 
3
+ ## [7.8.6](https://github.com/memori-ai/memori-webcomponent/compare/v7.8.5...v7.8.6) (2024-11-11)
4
+
5
+
6
+ ### Maintenance
7
+
8
+ * update memori-react ([d33ad06](https://github.com/memori-ai/memori-webcomponent/commit/d33ad06dc757cdd1a8a4afd9a5c4a66c1133aea0))
9
+
3
10
  ## [7.8.5](https://github.com/memori-ai/memori-webcomponent/compare/v7.8.4...v7.8.5) (2024-11-07)
4
11
 
5
12
 
@@ -250,7 +250,7 @@ const $f="144",em={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},tm={ROTATE:0,
250
250
  * @author George Michael Brower
251
251
  * @license MIT
252
252
  */
253
- class PB{constructor(e,t,n,r,i="div"){this.parent=e,this.object=t,this.property=n,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(i),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),PB.nextNameID=PB.nextNameID||0,this.$name.id="lil-gui-name-"+ ++PB.nextNameID,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",(e=>e.stopPropagation())),this.domElement.addEventListener("keyup",(e=>e.stopPropagation())),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(n)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),void 0!==this._onChange&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),void 0!==this._onFinishChange&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled||(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e)),this}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,void 0!==this._listenCallbackID&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class NB extends PB{constructor(e,t,n){super(e,t,n,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",(()=>{this.setValue(this.$input.checked),this._callOnFinishChange()})),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function OB(e){let t,n;return(t=e.match(/(#|0x)?([a-f0-9]{6})/i))?n=t[2]:(t=e.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?n=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=e.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(n=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),!!n&&"#"+n}const kB={isPrimitive:!0,match:e=>"number"==typeof e,fromHexString:e=>parseInt(e.substring(1),16),toHexString:e=>"#"+e.toString(16).padStart(6,0)},LB={isPrimitive:!1,match:e=>Array.isArray(e),fromHexString(e,t,n=1){const r=kB.fromHexString(e);t[0]=(r>>16&255)/255*n,t[1]=(r>>8&255)/255*n,t[2]=(255&r)/255*n},toHexString:([e,t,n],r=1)=>kB.toHexString(e*(r=255/r)<<16^t*r<<8^n*r<<0)},DB={isPrimitive:!1,match:e=>Object(e)===e,fromHexString(e,t,n=1){const r=kB.fromHexString(e);t.r=(r>>16&255)/255*n,t.g=(r>>8&255)/255*n,t.b=(255&r)/255*n},toHexString:({r:e,g:t,b:n},r=1)=>kB.toHexString(e*(r=255/r)<<16^t*r<<8^n*r<<0)},BB=[{isPrimitive:!0,match:e=>"string"==typeof e,fromHexString:OB,toHexString:OB},kB,LB,DB];class zB extends PB{constructor(e,t,n,r){var i;super(e,t,n,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(i=this.initialValue,BB.find((e=>e.match(i)))),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",(()=>{this._setValueFromHexString(this.$input.value)})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$text.addEventListener("input",(()=>{const e=OB(this.$text.value);e&&this._setValueFromHexString(e)})),this.$text.addEventListener("focus",(()=>{this._textFocused=!0,this.$text.select()})),this.$text.addEventListener("blur",(()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()})),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class FB extends PB{constructor(e,t,n){super(e,t,n,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",(e=>{e.preventDefault(),this.getValue().call(this.object),this._callOnChange()})),this.$button.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$disable=this.$button}}class UB extends PB{constructor(e,t,n,r,i,o){super(e,t,n,"number"),this._initInput(),this.min(r),this.max(i);const s=void 0!==o;this.step(s?o:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=100*t+"%"}return this._inputFocused||(this.$input.value=void 0===this._decimals?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id);window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=e=>{const t=parseFloat(this.$input.value);isNaN(t)||(this._snapClampSetValue(t+e),this.$input.value=this.getValue())};let t,n,r,i,o,s=!1;const a=e=>{if(s){const r=e.clientX-t,i=e.clientY-n;Math.abs(i)>5?(e.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(r)>5&&l()}if(!s){const t=e.clientY-r;o-=t*this._step*this._arrowKeyMultiplier(e),i+o>this._max?o=this._max-i:i+o<this._min&&(o=this._min-i),this._snapClampSetValue(i+o)}r=e.clientY},l=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",l)};this.$input.addEventListener("input",(()=>{let e=parseFloat(this.$input.value);isNaN(e)||(this._stepExplicit&&(e=this._snap(e)),this.setValue(this._clamp(e)))})),this.$input.addEventListener("keydown",(t=>{"Enter"===t.key&&this.$input.blur(),"ArrowUp"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t))),"ArrowDown"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t)*-1))})),this.$input.addEventListener("wheel",(t=>{this._inputFocused&&(t.preventDefault(),e(this._step*this._normalizeMouseWheel(t)))}),{passive:!1}),this.$input.addEventListener("mousedown",(e=>{t=e.clientX,n=r=e.clientY,s=!0,i=this.getValue(),o=0,window.addEventListener("mousemove",a),window.addEventListener("mouseup",l)})),this.$input.addEventListener("focus",(()=>{this._inputFocused=!0})),this.$input.addEventListener("blur",(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()}))}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=e=>{const t=this.$slider.getBoundingClientRect();let n=((e,t,n,r,i)=>(e-t)/(n-t)*(i-r)+r)(e,t.left,t.right,this._min,this._max);this._snapClampSetValue(n)},t=t=>{e(t.clientX)},n=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};let r,i,o=!1;const s=t=>{t.preventDefault(),this._setDraggingStyle(!0),e(t.touches[0].clientX),o=!1},a=t=>{if(o){const e=t.touches[0].clientX-r,n=t.touches[0].clientY-i;Math.abs(e)>Math.abs(n)?s(t):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",l))}else t.preventDefault(),e(t.touches[0].clientX)},l=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",l)},c=this._callOnFinishChange.bind(this);let u;this.$slider.addEventListener("mousedown",(r=>{this._setDraggingStyle(!0),e(r.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)})),this.$slider.addEventListener("touchstart",(e=>{e.touches.length>1||(this._hasScrollBar?(r=e.touches[0].clientX,i=e.touches[0].clientY,o=!0):s(e),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",l))}),{passive:!1}),this.$slider.addEventListener("wheel",(e=>{if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const t=this._normalizeMouseWheel(e)*this._step;this._snapClampSetValue(this.getValue()+t),this.$input.value=this.getValue(),clearTimeout(u),u=setTimeout(c,400)}),{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:n}=e;Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,n=-e.wheelDelta/120,n*=this._stepExplicit?1:10);return t+-n}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class jB extends PB{constructor(e,t,n,r){super(e,t,n,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",(()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()})),this.$select.addEventListener("focus",(()=>{this.$display.classList.add("focus")})),this.$select.addEventListener("blur",(()=>{this.$display.classList.remove("focus")})),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(r)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach((e=>{const t=document.createElement("option");t.textContent=e,this.$select.appendChild(t)})),this.updateDisplay(),this}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.textContent=-1===t?e:this._names[t],this}}class HB extends PB{constructor(e,t,n){super(e,t,n,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",(()=>{this.setValue(this.$input.value)})),this.$input.addEventListener("keydown",(e=>{"Enter"===e.code&&this.$input.blur()})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let GB=!1;class VB{constructor({parent:e,autoPlace:t=void 0===e,container:n,width:r,title:i="Controls",closeFolders:o=!1,injectStyles:s=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",(()=>this.openAnimated(this._closed))),this.$title.addEventListener("keydown",(e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),this.$title.click())})),this.$title.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(i),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),a&&this.domElement.classList.add("allow-touch-styles"),!GB&&s&&(!function(e){const t=document.createElement("style");t.innerHTML=e;const n=document.querySelector("head link[rel=stylesheet], head style");n?document.head.insertBefore(t,n):document.head.appendChild(t)}('.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "↕";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "▾";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "▸";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "✓";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjK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=!0),n?n.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=o}add(e,t,n,r,i){if(Object(n)===n)return new jB(this,e,t,n);const o=e[t];switch(typeof o){case"number":return new UB(this,e,t,n,r,i);case"boolean":return new NB(this,e,t);case"string":return new HB(this,e,t);case"function":return new FB(this,e,t)}console.error("gui.add failed\n\tproperty:",t,"\n\tobject:",e,"\n\tvalue:",o)}addColor(e,t,n=1){return new zB(this,e,t,n)}addFolder(e){const t=new VB({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach((t=>{t instanceof FB||t._name in e.controllers&&t.load(e.controllers[t._name])})),t&&e.folders&&this.folders.forEach((t=>{t._title in e.folders&&t.load(e.folders[t._title])})),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach((e=>{if(!(e instanceof FB)){if(e._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);t.controllers[e._name]=e.save()}})),e&&this.folders.forEach((e=>{if(e._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);t.folders[e._title]=e.save()})),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame((()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const n=e=>{e.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",n))};this.$children.addEventListener("transitionend",n);const r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame((()=>{this.$children.style.height=r+"px"}))})),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach((e=>e.reset())),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),void 0!==this._onChange&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),void 0!==this._onFinishChange&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),void 0!==this._onOpenClose&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach((e=>e.destroy()))}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach((t=>{e=e.concat(t.controllersRecursive())})),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach((t=>{e=e.concat(t.foldersRecursive())})),e}}var WB=VB;var qB=({onBaseActionChange:e,baseActions:t,modifyTimeScale:n,onMorphTargetInfluencesChange:r,onMorphTargetDictionaryChange:i,morphTargetDictionary:o,timeScale:s})=>{const a=(0,c.useRef)(null),l=(0,c.useRef)({"modify time scale":s}),u=(0,c.useRef)([]);return(0,c.useEffect)((()=>{const i=new WB({width:310});a.current=i;const s=i.addFolder("Base Actions"),c=i.addFolder("Additive Action Weights"),d=i.addFolder("General Speed");return["None",...Object.keys(t)].forEach((n=>{t[n];l.current[n]=()=>{e(n)};const r=s.add(l.current,n);u.current.push(r)})),Object.entries(o).forEach((([e,t])=>{l.current[e]=t/100,c.add(l.current,e,-1,1,.01).listen().onChange((t=>{r({[e]:t})}))})),d.add(l.current,"modify time scale",0,1.5,.01).onChange((e=>{n(e)})),s.open(),c.open(),d.open(),()=>{i.destroy()}}),[e,r,i,n,t,o,s]),null};c=o("85Hg2"),c=o("85Hg2");function KB(e,t){const n=c.useRef(),[r]=c.useState((()=>t?t instanceof rS?{current:t}:t:n)),[i]=c.useState((()=>new NI(void 0))),o=c.useRef({}),[s]=c.useState((()=>{const t={};return e.forEach((e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(r.current)return o.current[e.name]||(o.current[e.name]=i.clipAction(e,r.current))}}))),{ref:r,clips:e,actions:t,names:e.map((e=>e.name)),mixer:i}}));return eB(((e,t)=>i.update(t))),c.useEffect((()=>{const e=r.current;return()=>{o.current={},Object.values(s.actions).forEach((t=>{e&&i.uncacheAction(t,e)}))}}),[e]),s}const JB=new WeakMap;class YB extends fT{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new vT(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const e in t.attributeTypes){const n=t.attributeTypes[e];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=n.name)}const n=JSON.stringify(t);if(JB.has(e)){const t=JB.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,o=e.byteLength,s=this._getWorker(i,o).then((n=>(r=n,new Promise(((n,o)=>{r._callbacks[i]={resolve:n,reject:o},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return s.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),JB.set(e,{key:n,promise:s}),s}_createGeometry(e){const t=new zS;e.index&&t.setIndex(new SS(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,o=r.array,s=r.itemSize;t.setAttribute(i,new SS(o,s))}return t}_loadLibrary(e,t){const n=new vT(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=XB.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function XB(){let e,t;function n(e,t,n,r,i,o){const s=o.num_components(),a=n.num_points()*s,l=a*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),u=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,c,l,u);const d=new i(e.HEAPF32.buffer,u,a).slice();return e._free(u),{name:r,array:d,itemSize:s}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,o=i.taskConfig;t.then((e=>{const t=e.draco,s=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const o=i.attributeIDs,s=i.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeBufferToMesh(r,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const r in o){const l=self[s[r]];let c,d;if(i.useUniqueIDs)d=o[r],c=t.GetAttributeByUniqueId(a,d);else{if(d=t.GetAttributeId(a,e[o[r]]),-1===d)continue;c=t.GetAttribute(a,d)}u.attributes.push(n(e,t,a,r,l,c))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,n){const r=n.num_faces(),i=3*r,o=4*i,s=e._malloc(o);t.GetTrianglesUInt32Array(n,o,s);const a=new Uint32Array(e.HEAPF32.buffer,s,i).slice();return e._free(s),{array:a,itemSize:1}}(e,t,a));return e.destroy(a),u}(t,s,a,o),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(a),t.destroy(s)}}))}}}let QB;const ZB=()=>{if(QB)return QB;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n,r="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9k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8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const i=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(r),{}).then((e=>{n=e.instance,n.exports.__wasm_call_ctors()}));function o(e,t,r,i,o,s){const a=n.exports.sbrk,l=r+3&-4,c=a(l*i),u=a(o.length),d=new Uint8Array(n.exports.memory.buffer);d.set(o,u);const h=e(c,r,i,u,o.length);if(0===h&&s&&s(c,l,i),t.set(d.subarray(c,c+r*i)),a(c-a(0)),0!==h)throw new Error(`Malformed buffer data: ${h}`)}const s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},a={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return QB={ready:i,supported:!0,decodeVertexBuffer(e,t,r,i,a){o(n.exports.meshopt_decodeVertexBuffer,e,t,r,i,n.exports[s[a]])},decodeIndexBuffer(e,t,r,i){o(n.exports.meshopt_decodeIndexBuffer,e,t,r,i)},decodeIndexSequence(e,t,r,i){o(n.exports.meshopt_decodeIndexSequence,e,t,r,i)},decodeGltfBuffer(e,t,r,i,l,c){o(n.exports[a[l]],e,t,r,i,n.exports[s[c]])}},QB};class $B extends fT{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new oz(e)})),this.register((function(e){return new hz(e)})),this.register((function(e){return new pz(e)})),this.register((function(e){return new az(e)})),this.register((function(e){return new lz(e)})),this.register((function(e){return new cz(e)})),this.register((function(e){return new uz(e)})),this.register((function(e){return new iz(e)})),this.register((function(e){return new dz(e)})),this.register((function(e){return new sz(e)})),this.register((function(e){return new nz(e)})),this.register((function(e){return new fz(e)}))}load(e,t,n,r){const i=this;let o;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:VT.extractUrlBase(e),this.manager.itemStart(e);const s=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},a=new vT(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{i.parse(n,o,(function(n){t(n),i.manager.itemEnd(e)}),s)}catch(e){s(e)}}),n,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const o={},s={};if("string"==typeof e)i=e;else{if(VT.decodeText(new Uint8Array(e,0,4))===mz){try{o[tz.KHR_BINARY_GLTF]=new yz(e)}catch(e){return void(r&&r(e))}i=o[tz.KHR_BINARY_GLTF].content}else i=VT.decodeText(new Uint8Array(e))}const a=JSON.parse(i);if(void 0===a.asset||a.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new Xz(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);s[t.name]=t,o[t.name]=!0}if(a.extensionsUsed)for(let e=0;e<a.extensionsUsed.length;++e){const t=a.extensionsUsed[e],n=a.extensionsRequired||[];switch(t){case tz.KHR_MATERIALS_UNLIT:o[t]=new rz;break;case tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[t]=new _z;break;case tz.KHR_DRACO_MESH_COMPRESSION:o[t]=new bz(a,this.dracoLoader);break;case tz.KHR_TEXTURE_TRANSFORM:o[t]=new Sz;break;case tz.KHR_MESH_QUANTIZATION:o[t]=new wz;break;default:n.indexOf(t)>=0&&void 0===s[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(o),l.setPlugins(s),l.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function ez(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const tz={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class nz{constructor(e){this.parser=e,this.name=tz.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,o=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let s;const a=new Uy(16777215);void 0!==o.color&&a.fromArray(o.color);const l=void 0!==o.range?o.range:0;switch(o.type){case"directional":s=new zT(a),s.target.position.set(0,0,-1),s.add(s.target);break;case"point":s=new DT(a),s.distance=l;break;case"spot":s=new PT(a),s.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,s.angle=o.spot.outerConeAngle,s.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return s.position.set(0,0,0),s.decay=2,void 0!==o.intensity&&(s.intensity=o.intensity),s.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(s),t.cache.add(n,r),r}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class rz{constructor(){this.name=tz.KHR_MATERIALS_UNLIT}getMaterialType(){return vS}extendParams(e,t,n){const r=[];e.color=new Uy(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,Tv))}return Promise.all(r)}}class iz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class oz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Cy(e,e)}return Promise.all(i)}}class sz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];return void 0!==o.iridescenceFactor&&(t.iridescence=o.iridescenceFactor),void 0!==o.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),void 0!==o.iridescenceIor&&(t.iridescenceIOR=o.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==o.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),void 0!==o.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}}class az{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new Uy(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];return void 0!==o.sheenColorFactor&&t.sheenColor.fromArray(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Tv)),void 0!==o.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}}class lz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];return void 0!==o.transmissionFactor&&(t.transmission=o.transmissionFactor),void 0!==o.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}}class cz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const s=o.attenuationColor||[1,1,1];return t.attenuationColor=new Uy(s[0],s[1],s[2]),Promise.all(i)}}class uz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class dz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const s=o.specularColorFactor||[1,1,1];return t.specularColor=new Uy(s[0],s[1],s[2]),void 0!==o.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Tv)),Promise.all(i)}}class hz{constructor(e){this.parser=e,this.name=tz.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class pz{constructor(e){this.parser=e,this.name=tz.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],s=r.images[o.source];let a=n.textureLoader;if(s.uri){const e=n.options.manager.getHandler(s.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,o.source,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class fz{constructor(e){this.name=tz.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,o=e.count,s=e.byteStride,a=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(o,s,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(o*s);return i.decodeGltfBuffer(new Uint8Array(t),o,s,a,e.mode,e.filter),t}))}))}return null}}const mz="glTF",gz=1313821514,vz=5130562;class yz{constructor(e){this.name=tz.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:VT.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==mz)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===gz){const n=new Uint8Array(e,12+i,t);this.content=VT.decodeText(n)}else if(n===vz){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class bz{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=tz.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},a={},l={};for(const e in o){const t=zz[e]||e.toLowerCase();s[t]=o[e]}for(const t in e.attributes){const r=zz[t]||t.toLowerCase();if(void 0!==o[t]){const i=n.accessors[e.attributes[t]],o=kz[i.componentType];l[r]=o.name,a[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=a[t];void 0!==r&&(n.normalized=r)}t(e)}),s,l)}))}))}}class Sz{constructor(){this.name=tz.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class xz extends DE{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),i=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),s={specular:{value:(new Uy).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(const t in s)e.uniforms[t]=s[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",i).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class _z{constructor(){this.name=tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return xz}extendParams(e,t,n){const r=t.extensions[this.name];e.color=new Uy(1,1,1),e.opacity=1;const i=[];if(Array.isArray(r.diffuseFactor)){const t=r.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture,Tv)),e.emissive=new Uy(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new Uy(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const t=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",t)),i.push(n.assignTexture(e,"specularMap",t,Tv))}return Promise.all(i)}createMaterial(e){const t=new xz(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=Rv,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class wz{constructor(){this.name=tz.KHR_MESH_QUANTIZATION}}class Cz extends QE{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,l=3*s,c=r-t,u=(n-t)/c,d=u*u,h=d*u,p=e*l,f=p-l,m=-2*h+3*d,g=h-d,v=1-m,y=g-d+u;for(let e=0;e!==s;e++){const t=o[f+e+s],n=o[f+e+a]*c,r=o[p+e+s],l=o[p+e]*c;i[e]=v*t+y*n+m*r+g*l}return i}}const Az=new eb;class Ez extends Cz{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return Az.fromArray(i).normalize().toArray(i),i}}const Tz=0,Iz=1,Mz=2,Rz=3,Pz=4,Nz=5,Oz=6,kz={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Lz={9728:ag,9729:hg,9984:lg,9985:pg,9986:ug,9987:mg},Dz={33071:og,33648:sg,10497:ig},Bz={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zz={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Fz={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Uz={CUBICSPLINE:void 0,LINEAR:gv,STEP:mv},jz="OPAQUE",Hz="MASK",Gz="BLEND";function Vz(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Wz(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function qz(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Kz(e){const t=e.extensions&&e.extensions[tz.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+Jz(t.attributes):e.indices+":"+Jz(e.attributes)+":"+e.mode,n}function Jz(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function Yz(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class Xz{constructor(e={},t={}){var n,r;this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ez,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const i="undefined"!=typeof navigator&&!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o="undefined"!=typeof navigator&&(null===(n=navigator.userAgent)||void 0===n?void 0:n.indexOf("Firefox"))>-1,s="undefined"!=typeof navigator&&o?null===(r=navigator.userAgent)||void 0===r?void 0:r.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||o&&s<98?this.textureLoader=new wT(this.options.manager):this.textureLoader=new QT(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new vT(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const o={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Vz(i,o,r),Wz(o,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(o)}))).then((function(){e(o)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[tz.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load(VT.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],o=Bz[r.type],s=kz[r.componentType],a=s.BYTES_PER_ELEMENT,l=a*o,c=r.byteOffset||0,u=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let h,p;if(u&&u!==l){const e=Math.floor(c/u),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(h=new s(i,e*u,r.count*u/a),l=new iC(h,u/a),t.cache.add(n,l)),p=new sC(l,o,c%u/a,d)}else h=null===i?new s(r.count*o):new s(i,c,r.count*o),p=new SS(h,o,d);if(void 0!==r.sparse){const t=Bz.SCALAR,n=kz[r.sparse.indices.componentType],a=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,c=new n(e[1],a,r.sparse.count*t),u=new s(e[2],l,r.sparse.count*o);null!==i&&(p=new SS(p.array.slice(),p.itemSize,p.normalized));for(let e=0,t=c.length;e<t;e++){const t=c[e];if(p.setX(t,u[e*o]),o>=2&&p.setY(t,u[e*o+1]),o>=3&&p.setZ(t,u[e*o+2]),o>=4&&p.setW(t,u[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let o=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(o=e)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,n){const r=this,i=this.json,o=i.textures[e],s=i.images[t],a=(s.uri||s.bufferView)+":"+o.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,o.name&&(t.name=o.name);const n=(i.samplers||{})[o.sampler]||{};return t.magFilter=Lz[n.magFilter]||hg,t.minFilter=Lz[n.minFilter]||mg,t.wrapS=Dz[n.wrapS]||ig,t.wrapT=Dz[n.wrapT]||ig,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const i=n.images[e],o=self.URL||self.webkitURL;let s=i.uri||"",a=!1;if(void 0!==i.bufferView)s=this.getDependency("bufferView",i.bufferView).then((function(e){a=!0;const t=new Blob([e],{type:i.mimeType});return s=o.createObjectURL(t),s}));else if(void 0===i.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(s).then((function(e){return new Promise((function(n,i){let o=n;!0===t.isImageBitmapLoader&&(o=function(e){const t=new qy(e);t.needsUpdate=!0,n(t)}),t.load(VT.resolveURL(e,r.path),o,void 0,i)}))})).then((function(e){var t;return!0===a&&o.revokeObjectURL(s),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e}));return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(o){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[tz.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[tz.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(o);o=i.extensions[tz.KHR_TEXTURE_TRANSFORM].extendTexture(o,e),i.associations.set(o,t)}}return void 0!==r&&(o.encoding=r),e[t]=o,o}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new eA,gS.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new GC,gS.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(r||i||o){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),o&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return DE}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let o;const s={},a=i.extensions||{},l=[];if(a[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=r[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=e.getMaterialType(),l.push(e.extendParams(s,i,t))}else if(a[tz.KHR_MATERIALS_UNLIT]){const e=r[tz.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(s,i,t))}else{const n=i.pbrMetallicRoughness||{};if(s.color=new Uy(1,1,1),s.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;s.color.fromArray(e),s.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(s,"map",n.baseColorTexture,Tv)),s.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,s.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(s,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(s,"roughnessMap",n.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===i.doubleSided&&(s.side=hm);const c=i.alphaMode||jz;if(c===Gz?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===Hz&&(s.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&o!==vS&&(l.push(t.assignTexture(s,"normalMap",i.normalTexture)),s.normalScale=new Cy(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;s.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&o!==vS&&(l.push(t.assignTexture(s,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(s.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&o!==vS&&(s.emissive=(new Uy).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&o!==vS&&l.push(t.assignTexture(s,"emissiveMap",i.emissiveTexture,Tv)),Promise.all(l).then((function(){let n;return n=o===xz?r[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new o(s),i.name&&(n.name=i.name),Wz(n,i),t.associations.set(n,{materials:e}),i.extensions&&Vz(r,n,i),n}))}createUniqueName(e){const t=II.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[tz.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return Zz(n,e,t)}))}const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n],a=Kz(s),l=r[a];if(l)o.push(l.promise);else{let e;e=s.extensions&&s.extensions[tz.KHR_DRACO_MESH_COMPRESSION]?i(s):Zz(new zS,s,t),r[a]={primitive:s,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],o=i.primitives,s=[];for(let e=0,t=o.length;e<t;e++){const t=void 0===o[e].material?(void 0===(a=this.cache).DefaultMaterial&&(a.DefaultMaterial=new DE({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:um})),a.DefaultMaterial):this.getDependency("material",o[e].material);s.push(t)}var a;return s.push(t.loadGeometries(o)),Promise.all(s).then((function(n){const s=n.slice(0,n.length-1),a=n[n.length-1],l=[];for(let n=0,c=a.length;n<c;n++){const c=a[n],u=o[n];let d;const h=s[n];if(u.mode===Pz||u.mode===Nz||u.mode===Oz||void 0===u.mode)d=!0===i.isSkinnedMesh?new PC(c,h):new nx(c,h),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),u.mode===Nz?d.geometry=$z(d.geometry,Cv):u.mode===Oz&&(d.geometry=$z(d.geometry,Av));else if(u.mode===Iz)d=new ZC(c,h);else if(u.mode===Rz)d=new YC(c,h);else if(u.mode===Mz)d=new $C(c,h);else{if(u.mode!==Tz)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);d=new oA(c,h)}Object.keys(d.geometry.morphAttributes).length>0&&qz(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),Wz(d,i),u.extensions&&Vz(r,d,u),t.assignFinalMaterial(d),l.push(d)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const c=new qw;t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new ux(wy.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new kx(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Wz(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],r=[],i=[],o=[],s=[];for(let e=0,a=t.channels.length;e<a;e++){const a=t.channels[e],l=t.samplers[a.sampler],c=a.target,u=c.node,d=void 0!==t.parameters?t.parameters[l.input]:l.input,h=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",d)),i.push(this.getDependency("accessor",h)),o.push(l),s.push(c)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(i),Promise.all(o),Promise.all(s)]).then((function(n){const r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=i[e],c=o[e],u=s[e],d=a[e];if(void 0===t)continue;let h;switch(t.updateMatrix(),Fz[d.path]){case Fz.weights:h=iT;break;case Fz.rotation:h=sT;break;default:h=lT}const p=t.name?t.name:t.uuid,f=void 0!==u.interpolation?Uz[u.interpolation]:gv,m=[];Fz[d.path]===Fz.weights?t.traverse((function(e){e.morphTargetInfluences&&m.push(e.name?e.name:e.uuid)})):m.push(p);let g=c.array;if(c.normalized){const e=Yz(g.constructor),t=new Float32Array(g.length);for(let n=0,r=g.length;n<r;n++)t[n]=g[n]*e;g=t}for(let e=0,t=m.length;e<t;e++){const t=new h(m[e]+"."+Fz[d.path],n.array,g,f);"CUBICSPLINE"===u.interpolation&&(t.createInterpolant=function(e){return new(this instanceof sT?Ez:Cz)(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const c=t.name?t.name:"animation_"+e;return new cT(c,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,r=this,i=t.nodes[e],o=i.name?r.createUniqueName(i.name):"";return function(){const t=[],n=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return n&&t.push(n),void 0!==i.camera&&t.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let s;if(s=!0===i.isBone?new NC:t.length>1?new qw:1===t.length?t[0]:new rS,s!==t[0])for(let e=0,n=t.length;e<n;e++)s.add(t[e]);if(i.name&&(s.userData.name=i.name,s.name=o),Wz(s,i),i.extensions&&Vz(n,s,i),void 0!==i.matrix){const e=new Nb;e.fromArray(i.matrix),s.applyMatrix4(e)}else void 0!==i.translation&&s.position.fromArray(i.translation),void 0!==i.rotation&&s.quaternion.fromArray(i.rotation),void 0!==i.scale&&s.scale.fromArray(i.scale);return r.associations.has(s)||r.associations.set(s,{}),r.associations.get(s).nodes=e,s}))}loadScene(e){const t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,o=new qw;r.name&&(o.name=i.createUniqueName(r.name)),Wz(o,r),r.extensions&&Vz(n,o,r);const s=r.nodes||[],a=[];for(let e=0,n=s.length;e<n;e++)a.push(Qz(s[e],o,t,i));return Promise.all(a).then((function(){return i.associations=(e=>{const t=new Map;for(const[e,n]of i.associations)(e instanceof gS||e instanceof qy)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(o),o}))}}function Qz(e,t,n,r){const i=n.nodes[e];return r.getDependency("node",e).then((function(e){if(void 0===i.skin)return e;let t;return r.getDependency("skin",i.skin).then((function(e){t=e;const n=[];for(let e=0,i=t.joints.length;e<i;e++)n.push(r.getDependency("node",t.joints[e]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const r=[],i=[];for(let e=0,o=n.length;e<o;e++){const o=n[e];if(o){r.push(o);const n=new Nb;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),i.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new DC(r,i),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const o=[];if(i.children){const t=i.children;for(let i=0,s=t.length;i<s;i++){const s=t[i];o.push(Qz(s,e,n,r))}}return Promise.all(o)}))}function Zz(e,t,n){const r=t.attributes,i=[];function o(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const t in r){const n=zz[t]||t.toLowerCase();n in e.attributes||i.push(o(r[t],n))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return Wz(e,t),function(e,t,n){const r=t.attributes,i=new ib;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new tb(t[0],t[1],t[2]),new tb(o[0],o[1],o[2])),e.normalized){const t=Yz(kz[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const o=t.targets;if(void 0!==o){const e=new tb,t=new tb;for(let r=0,i=o.length;r<i;r++){const i=o[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],o=r.min,s=r.max;if(void 0!==o&&void 0!==s){if(t.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),t.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),t.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),r.normalized){const e=Yz(kz[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const s=new wb;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=s}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,o=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),void 0!==n.COLOR_0&&(o=!0),r&&i&&o)break}if(!r&&!i&&!o)return Promise.resolve(e);const s=[],a=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(r){const t=void 0!==u.POSITION?n.getDependency("accessor",u.POSITION):e.attributes.position;s.push(t)}if(i){const t=void 0!==u.NORMAL?n.getDependency("accessor",u.NORMAL):e.attributes.normal;a.push(t)}if(o){const t=void 0!==u.COLOR_0?n.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(l)]).then((function(t){const n=t[0],s=t[1],a=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=s),o&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function $z(e,t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(t===Av)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=e.clone();return o.setIndex(i),o}let eF=null;function tF(e,t,n){return r=>{n&&n(r),e&&(eF||(eF=new YB),eF.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),r.setDRACOLoader(eF)),t&&r.setMeshoptDecoder(ZB())}}function nF(e,t=!0,n=!0,r){return rB($B,e,tF(t,n,r))}var rF,iF;nF.preload=(e,t=!0,n=!0,r)=>rB.preload($B,e,tF(t,n,r)),nF.clear=e=>rB.clear($B,e),(iF=rF||(rF={})).LOADING="LOADING",iF.EMOTION="EMOTION",iF.IDLE="IDLE";const oF=new tb(0,-1,0),sF=new Hb(.175,0,0),aF=new tb(0,-1.45,0),lF={MALE:"https://assets.memori.ai/api/v2/asset/2c5e88a4-cf62-408b-9ef0-518b099dfcb2.glb",FEMALE:"https://assets.memori.ai/api/v2/asset/8d1a5853-f05a-4a34-9f99-6eff64986081.glb"},cF={minInterval:1e3,maxInterval:5e3,blinkDuration:150},uF={fadeInDuration:.8,fadeOutDuration:.8,idleCount:5,timeScale:1};class dF{constructor(e,t,n=uF){this.currentState=rF.LOADING,this.currentAction=null,this.lastIdleIndex=-1,this.isTransitioning=!1,this.currentIdleLoopCount=0,this.MAX_IDLE_LOOPS=5,this.lastAnimationTime=0,this.isChatAlreadyStarted=!1,this.mixer=e,this.actions=t,this.config=n}checkForLoop(){if(!this.currentAction||this.currentState!==rF.IDLE)return;this.currentAction.getClip();const e=this.currentAction.time;e<this.lastAnimationTime&&(this.currentIdleLoopCount++,this.currentIdleLoopCount>=this.MAX_IDLE_LOOPS&&this.forceIdleChange()),this.lastAnimationTime=e}forceIdleChange(){this.currentIdleLoopCount=0,this.lastAnimationTime=0,this.transitionTo(rF.IDLE)}getNextIdleAnimation(){let e;do{e=Math.floor(Math.random()*this.config.idleCount)+1}while(e===this.lastIdleIndex);this.isChatAlreadyStarted&&3===e&&(e=4!==this.lastIdleIndex?4:2),this.lastIdleIndex=e;const t=this.actions[`Idle${e}`];if(!t)throw new Error(`Idle animation ${e} not found`);return t}transitionTo(e,t){if(!this.isTransitioning){this.isTransitioning=!0;try{let n=null;switch(e){case rF.LOADING:n=this.actions[t||"Loading1"],this.currentIdleLoopCount=0,this.lastAnimationTime=0;break;case rF.EMOTION:n=this.actions[t||"Timore1"],this.currentIdleLoopCount=0,this.lastAnimationTime=0;break;case rF.IDLE:n=this.getNextIdleAnimation(),this.currentState!==rF.IDLE&&(this.currentIdleLoopCount=0,this.lastAnimationTime=0)}if(!n)throw new Error(`No animation found for state: ${e}`);this.currentAction&&this.currentAction.fadeOut(this.config.fadeOutDuration),n.reset().fadeIn(this.config.fadeInDuration).play(),n.timeScale=this.config.timeScale,e!==rF.IDLE?(n.setLoop(hv,1),n.clampWhenFinished=!0):n.setLoop(1/0,1/0),this.currentAction=n,this.currentState=e}catch(t){console.error("[AnimationController] Error during animation transition:",t),e!==rF.IDLE&&this.transitionTo(rF.IDLE)}finally{this.isTransitioning=!1}}}update(e){this.currentAction&&(this.checkForLoop(),this.currentState!==rF.IDLE&&this.currentAction.time>=.9*this.currentAction.getClip().duration&&this.transitionTo(rF.IDLE),this.mixer.update(e))}getCurrentState(){return this.currentState}getLoopCount(){return this.currentIdleLoopCount}setTimeScale(e){this.config.timeScale=e,this.currentAction&&(this.currentAction.timeScale=e)}updateIsChatAlreadyStarted(e){this.isChatAlreadyStarted=e}getDebugInfo(){var e;return{currentState:this.currentState,currentIdleIndex:this.lastIdleIndex,loopCount:this.currentIdleLoopCount,currentTime:(null===(e=this.currentAction)||void 0===e?void 0:e.time)||0,lastTime:this.lastAnimationTime,isTransitioning:this.isTransitioning,isChatAlreadyStarted:this.isChatAlreadyStarted}}}class hF{constructor(e){this.currentEmotionValues={},this.previousEmotionKeys=new Set,this.headMesh=e}updateMorphTargets(e,t,n,r,i){if(!this.headMesh.morphTargetDictionary||!this.headMesh.morphTargetInfluences)return;const o=this.calculateBlinkValue(e,i,r),s=new Set(Object.keys(t));Object.entries(this.headMesh.morphTargetDictionary).forEach((([e,i])=>{if("number"!=typeof i)return;let a=0;if(s.has(e)){const n=t[e],r=this.currentEmotionValues[e]||0,i=wy.lerp(r,2.5*n,.3);this.currentEmotionValues[e]=i,a+=i}n&&e===n.name&&(a+=n.weight),"eyesClosed"===e&&r&&(a+=o),a=wy.clamp(a,0,1),this.headMesh.morphTargetInfluences&&(this.headMesh.morphTargetInfluences[i]=wy.lerp(this.headMesh.morphTargetInfluences[i]||0,a,.5))})),this.previousEmotionKeys=s}calculateBlinkValue(e,t,n){if(!n)return 0;let r=0;if(e>=t.nextBlinkTime&&!t.isBlinking&&(t.isBlinking=!0,t.blinkStartTime=e,t.lastBlinkTime=e,t.nextBlinkTime=e+Math.random()*(cF.maxInterval-cF.minInterval)+cF.minInterval),t.isBlinking){const n=(e-t.blinkStartTime)/cF.blinkDuration;n<=.5?r=2*n:n<=1?r=2-2*n:(t.isBlinking=!1,r=0)}return r}}function pF({url:e,sex:t,currentBaseAction:n,timeScale:r,isZoomed:i,eyeBlink:o,updateCurrentViseme:a,setMorphTargetDictionary:l,setMorphTargetInfluences:u,emotionMorphTargets:d}){const{scene:h}=nF(e),{animations:p}=nF(lF[t]),{actions:f}=KB(p,h),m=(0,c.useRef)(),g=(0,c.useRef)(),v=(0,c.useRef)({isBlinking:!1,lastBlinkTime:0,nextBlinkTime:0,blinkStartTime:0}),y=(0,c.useMemo)((()=>{let e;return h.traverse((t=>{t instanceof PC&&("GBNL__Head"===t.name||"Wolf3D_Avatar"===t.name)&&(e=t)})),e}),[h]);return(0,c.useEffect)((()=>{if(!f||!y)return;const e=new NI(h);if(m.current=new dF(e,f,{...uF}),g.current=new hF(y),y.morphTargetDictionary&&y.morphTargetInfluences){l(y.morphTargetDictionary);const e=Object.keys(y.morphTargetDictionary).reduce(((e,t)=>({...e,[t]:0})),{});u(e)}}),[f,y,h,l,u,r]),(0,c.useEffect)((()=>{m.current&&(n.action.startsWith("Loading")?m.current.transitionTo(rF.LOADING,n.action):n.action.startsWith("Idle")?m.current.transitionTo(rF.IDLE):(m.current.updateIsChatAlreadyStarted(!0),m.current.transitionTo(rF.EMOTION,n.action)))}),[n]),(0,c.useEffect)((()=>{var e;null===(e=m.current)||void 0===e||e.setTimeScale(r)}),[r]),eB((e=>{var t;const n=1e3*e.clock.elapsedTime;if(null===(t=m.current)||void 0===t||t.update(e.clock.getDelta()),g.current){const e=a(n/1e3);g.current.updateMorphTargets(n,d,e,o||!1,v.current)}})),(0,s.jsx)("group",{position:i?aF:oF,rotation:sF,children:(0,s.jsx)("primitive",{object:h})})}c=o("85Hg2");const fF=new tb(0,-.6,0),mF=1e3,gF=5e3,vF=150;function yF({url:e,setMorphTargetInfluences:t,setMorphTargetDictionary:n,eyeBlink:r,onLoaded:i,morphTargetSmoothing:o=.5,updateCurrentViseme:a}){const{scene:l}=nF(e),{nodes:u,materials:d}=(h=l,c.useMemo((()=>tB(h)),[h]));var h;const p=(0,c.useRef)(new NI(l)),f=((0,c.useRef)(null),(0,c.useRef)(0)),m=(0,c.useRef)(0),g=(0,c.useRef)(!1),v=(0,c.useRef)(0),y=(0,c.useRef)();return(0,c.useEffect)((()=>(pR(d),l.traverse((e=>{if(e instanceof PC&&("GBNL__Head"===e.name||"Wolf3D_Avatar"===e.name)&&(y.current=e,e.morphTargetDictionary&&e.morphTargetInfluences)){n(e.morphTargetDictionary);const r=Object.keys(e.morphTargetDictionary).reduce(((e,t)=>({...e,[t]:0})),{});t(r)}})),null==i||i(),()=>{Object.values(d).forEach((e=>e.dispose())),Object.values(u).filter(fR).forEach((e=>e.geometry.dispose()))})),[d,u,e,i,l]),eB((e=>{if(y.current&&y.current.morphTargetDictionary&&y.current.morphTargetInfluences){const t=1e3*e.clock.getElapsedTime();let n=0;if(r&&(t>=m.current&&!g.current&&(g.current=!0,v.current=t,f.current=t,m.current=t+Math.random()*(gF-mF)+mF),g.current)){const e=(t-v.current)/vF;e<=.5?n=2*e:e<=1?n=2-2*e:(g.current=!1,n=0)}const i=a(t/1e3);Object.entries(y.current.morphTargetDictionary).forEach((([e,t])=>{if("number"==typeof t){let s=0;i&&e===i.name&&(s+=1.3*i.weight),"eyesClosed"===e&&r&&(s+=n),s=wy.clamp(s,0,1),y.current&&y.current.morphTargetInfluences&&(y.current.morphTargetInfluences[t]=wy.lerp(y.current.morphTargetInfluences[t],s,o))}})),p.current.update(.01)}})),(0,s.jsx)("group",{position:fF,children:(0,s.jsx)("primitive",{object:l})})}const bF={Gioia1:{weight:0},Gioia2:{weight:0},Gioia3:{weight:0},Idle1:{weight:1},Idle2:{weight:0},Idle3:{weight:0},Idle4:{weight:0},Idle5:{weight:0},Rabbia1:{weight:0},Rabbia2:{weight:0},Rabbia3:{weight:0},Sorpresa1:{weight:0},Sorpresa2:{weight:0},Sorpresa3:{weight:0},Timore1:{weight:0},Timore2:{weight:0},Timore3:{weight:0},Tristezza1:{weight:0},Tristezza2:{weight:0},Tristezza3:{weight:0},Loading1:{weight:0},Loading2:{weight:0},Loading3:{weight:0}},SF=({stopProcessing:e,chatEmission:t,showControls:n,animation:r,url:i,sex:o,eyeBlink:a,headMovement:l,speaking:u,halfBody:d,loading:h,isZoomed:p,updateCurrentViseme:f,resetVisemeQueue:m})=>{const[g,v]=(0,c.useState)({action:r||"Idle1",weight:1}),[y,b]=(0,c.useState)({}),[S,x]=(0,c.useState)({}),[_,w]=(0,c.useState)({}),[C,A]=(0,c.useState)(.8),E=(0,c.useCallback)((e=>{if("Loading1"===e||"Loading2"===e||"Loading3"===e)return;const t={Gioia:{Gioria:1},Rabbia:{Rabbia:1},Sorpresa:{Sorpresa:1},Tristezza:{Tristezza:1},Timore:{Timore:1}},n=Object.keys(t).reduce(((e,t)=>(e[t]=0,e)),{}),r=Object.keys(t).find((t=>e.startsWith(t)))||"default",i="default"===r?n:t[r];w((e=>({...n,...i})))}),[]),T=(0,c.useCallback)((e=>{E(e),v({action:e,weight:1})}),[]),I=(0,c.useCallback)((e=>{b((t=>({...t,...e})))}),[]),M=(0,c.useCallback)((e=>{x(e)}),[]),R=(0,c.useCallback)((e=>{A(e)}),[]);return(0,c.useEffect)((()=>{var e,n;const r=(null==t?void 0:t.includes('<output class="memori-emotion">'))?null===(n=null===(e=null==t?void 0:t.split('<output class="memori-emotion">')[1])||void 0===e?void 0:e.split("</output>")[0])||void 0===n?void 0:n.trim():null;if(r){const e=Math.floor(3*Math.random())+1;T(`${r}${e}`)}else{const e=Math.floor(5*Math.random())+1;T(`Idle${3===e?4:e}`)}}),[t]),(0,c.useEffect)((()=>{if(h){const e=Math.floor(3*Math.random())+1;T(`Loading${e}`)}}),[h]),(0,s.jsxs)(s.Fragment,{children:[n&&(0,s.jsx)(qB,{timeScale:C,morphTargetDictionary:S,onBaseActionChange:T,onMorphTargetInfluencesChange:I,onMorphTargetDictionaryChange:M,baseActions:bF,currentBaseAction:g,modifyTimeScale:R}),d?(0,s.jsx)(yF,{url:i,headMovement:l,speaking:u,eyeBlink:a,morphTargetInfluences:y,setMorphTargetInfluences:b,setMorphTargetDictionary:x,updateCurrentViseme:f}):(0,s.jsx)(pF,{url:i,sex:o,resetVisemeQueue:m,eyeBlink:a,currentBaseAction:g,timeScale:C,morphTargetInfluences:y,isZoomed:p,updateCurrentViseme:f,stopProcessing:e,setMorphTargetDictionary:x,setMorphTargetInfluences:b,emotionMorphTargets:_})]})};let xF=0;const _F=t(hD)((e=>(pT.onStart=(t,n,r)=>{e({active:!0,item:t,loaded:n,total:r,progress:(n-xF)/(r-xF)*100})},pT.onLoad=()=>{e({active:!1})},pT.onError=t=>e((e=>({errors:[...e.errors,t]}))),pT.onProgress=(t,n,r)=>{n===r&&(xF=r),e({active:!0,item:t,loaded:n,total:r,progress:(n-xF)/(r-xF)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})));c=o("85Hg2");const wF=new tb,CF=new tb,AF=new tb;function EF(e,t,n){const r=wF.setFromMatrixPosition(e.matrixWorld);r.project(t);const i=n.width/2,o=n.height/2;return[r.x*i+i,-r.y*o+o]}const TF=e=>Math.abs(e)<1e-10?0:e;function IF(e,t,n=""){let r="matrix3d(";for(let n=0;16!==n;n++)r+=TF(t[n]*e.elements[n])+(15!==n?",":")");return n+r}const MF=(RF=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>IF(e,RF));var RF;const PF=(e,t)=>{return IF(e,[1/(n=t),1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1],"translate(-50%,-50%)");var n},NF=c.forwardRef((({children:e,eps:t=.001,style:n,className:r,prepend:i,center:o,fullscreen:s,portal:l,distanceFactor:u,sprite:d=!1,transform:h=!1,occlude:p,onOcclude:f,zIndexRange:m=[16777271,0],calculatePosition:g=EF,as:v="div",wrapperClass:y,pointerEvents:b="auto",...S},x)=>{var _;const w=$D((({gl:e})=>e)),C=$D((({camera:e})=>e)),A=$D((({scene:e})=>e)),E=$D((({size:e})=>e)),T=$D((({raycaster:e})=>e)),[I]=c.useState((()=>document.createElement(v))),M=c.useRef(null),R=c.useRef(0),P=c.useRef([0,0]),N=c.useRef(null),O=c.useRef(null),k=null!==(_=null==l?void 0:l.current)&&void 0!==_?_:w.domElement.parentNode;c.useEffect((()=>{if(M.current){if(A.updateMatrixWorld(),h)I.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const e=g(M.current,C,E);I.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return k&&(i?k.prepend(I):k.appendChild(I)),()=>{k&&k.removeChild(I),a.unmountComponentAtNode(I)}}}),[k,h]),c.useLayoutEffect((()=>{y&&(I.className=y)}),[y]);const L=c.useMemo((()=>h?{position:"absolute",top:0,left:0,width:E.width,height:E.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:o?"translate3d(-50%,-50%,0)":"none",...s&&{top:-E.height/2,left:-E.width/2,width:E.width,height:E.height},...n}),[n,o,s,E,h]),D=c.useMemo((()=>({position:"absolute",pointerEvents:b})),[b]);c.useLayoutEffect((()=>{h?a.render(c.createElement("div",{ref:N,style:L},c.createElement("div",{ref:O,style:D},c.createElement("div",{ref:x,className:r,style:n,children:e}))),I):a.render(c.createElement("div",{ref:x,style:L,className:r,children:e}),I)}));const B=c.useRef(!0);return eB((()=>{if(M.current){C.updateMatrixWorld(),M.current.updateWorldMatrix(!0,!1);const e=h?P.current:g(M.current,C,E);if(h||Math.abs(R.current-C.zoom)>t||Math.abs(P.current[0]-e[0])>t||Math.abs(P.current[1]-e[1])>t){const t=function(e,t){const n=wF.setFromMatrixPosition(e.matrixWorld),r=CF.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(AF);return i.angleTo(o)>Math.PI/2}(M.current,C);let n=!1;"boolean"==typeof p?!0===p&&(n=[A]):Array.isArray(p)&&(n=p.map((e=>e.current)));const r=B.current;if(n){const e=function(e,t,n,r){const i=wF.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),n.setFromCamera(o,t);const s=n.intersectObjects(r,!0);if(s.length){const e=s[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}(M.current,C,T,n);B.current=e&&!t}else B.current=!t;if(r!==B.current&&(f?f(!B.current):I.style.display=B.current?"block":"none"),I.style.zIndex=`${function(e,t,n){if(t instanceof ux||t instanceof kx){const r=wF.setFromMatrixPosition(e.matrixWorld),i=CF.setFromMatrixPosition(t.matrixWorld),o=r.distanceTo(i),s=(n[1]-n[0])/(t.far-t.near),a=n[1]-s*t.far;return Math.round(s*o+a)}}(M.current,C,m)}`,h){const[e,t]=[E.width/2,E.height/2],n=C.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:o,bottom:s,right:a}=C,l=MF(C.matrixWorldInverse),c=r?`scale(${n})translate(${TF(-(a+o)/2)}px,${TF((i+s)/2)}px)`:`translateZ(${n}px)`;let h=M.current.matrixWorld;d&&(h=C.matrixWorldInverse.clone().transpose().copyPosition(h).scale(M.current.scale),h.elements[3]=h.elements[7]=h.elements[11]=0,h.elements[15]=1),I.style.width=E.width+"px",I.style.height=E.height+"px",I.style.perspective=r?"":`${n}px`,N.current&&O.current&&(N.current.style.transform=`${c}${l}translate(${e}px,${t}px)`,O.current.style.transform=PF(h,1/((u||10)/400)))}else{const t=void 0===u?1:function(e,t){if(t instanceof kx)return t.zoom;if(t instanceof ux){const n=wF.setFromMatrixPosition(e.matrixWorld),r=CF.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,o=n.distanceTo(r);return 1/(2*Math.tan(i/2)*o)}return 1}(M.current,C)*u;I.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}P.current=e,R.current=C.zoom}}})),c.createElement("group",pB({},S,{ref:M}))}));var OF=({fallbackImg:e})=>{const{progress:t}=_F();return(0,s.jsx)(NF,{center:!0,className:"avatar-loader",children:(0,s.jsx)(xf,{spinning:!0,children:e?(0,s.jsxs)("figure",{children:[(0,s.jsx)("img",{src:e,alt:`${Math.round(t)}% loaded`,title:`${Math.round(t)}% loaded`}),(0,s.jsx)("figcaption",{children:`${Math.round(t)}%`})]}):(0,s.jsxs)(s.Fragment,{children:[Math.round(t)," % loaded"]})})})};const kF={halfBody:{width:"100%",height:"100%",minHeight:"500px",backgroundColor:"white",borderRadius:"100%"},fullBody:{width:"500px",height:"500px",backgroundColor:"white"}},LF=(e,t)=>e?{fov:40,position:[0,0,.6]}:!e&&t?{fov:44,position:[0,0,1.25]}:{fov:40,position:[0,175e-7,3]},DF=()=>{return"android"===((null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown").toLowerCase()||navigator.userAgent.includes("Android")||$M()?(0,s.jsx)(gB,{distance:100,position:[-.3,.2,1.25],angle:Math.PI/2,attenuation:5,anglePower:5}):(0,s.jsx)(SB,{files:"https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/venice_sunset_1k.hdr"});var e};function BF({url:e,sex:t,style:n,rotateAvatar:r,eyeBlink:i,headMovement:o,speaking:a,fallback:l,fallbackImg:u,halfBody:d=!0,loading:h,animation:p,showControls:f=!1,isZoomed:m,chatEmission:g,stopProcessing:v,resetVisemeQueue:y,updateCurrentViseme:b}){return(0,s.jsx)(QD,{style:n||(d?kF.halfBody:kF.fullBody),camera:LF(d,m),children:(0,s.jsxs)(c.Suspense,{fallback:l||(0,s.jsx)(OF,{fallbackImg:u}),children:[DF(),r&&(0,s.jsx)(RB,{enablePan:!1,enableZoom:!1}),(0,s.jsx)(SF,{url:e,sex:t,showControls:f,loading:h||!1,animation:p,isZoomed:m||!1,eyeBlink:i||!1,headMovement:o||!1,speaking:a||!1,halfBody:d||!1,chatEmission:g,updateCurrentViseme:b,stopProcessing:v,resetVisemeQueue:y})]})})}const zF=(0,(c=o("85Hg2")).createContext)(void 0),FF={0:"viseme_sil",1:"viseme_PP",2:"viseme_FF",3:"viseme_TH",4:"viseme_DD",5:"viseme_kk",6:"viseme_CH",7:"viseme_SS",8:"viseme_nn",9:"viseme_RR",10:"viseme_aa",11:"viseme_E",12:"viseme_I",13:"viseme_O",14:"viseme_U",15:"viseme_kk",16:"viseme_CH",17:"viseme_SS",18:"viseme_TH",19:"viseme_RR",20:"viseme_kk",21:"viseme_PP"},{DEFAULT_VISEME_DURATION:UF,VISEME_OVERLAP:jF,SMOOTHING_FACTOR:HF,LOG_INTERVAL:GF,PRELOAD:VF,WEIGHT_MULTIPLIER:WF}={DEFAULT_VISEME_DURATION:.1,VISEME_OVERLAP:.02,SMOOTHING_FACTOR:.4,LOG_INTERVAL:60,PRELOAD:.5,WEIGHT_MULTIPLIER:.8},qF=(e,t)=>e.endTime<t-jF,KF=e=>Math.sin(Math.PI*Math.min(e,1))*WF,JF=(e,t)=>e+(t-e)*HF,YF=e=>(t,n)=>{console.log(`%c[VisemeContext] ${t}`,{event:"color: #4CAF50; font-weight: bold;",error:"color: #f44336; font-weight: bold;",debug:"color: #2196F3; font-weight: bold;"}[e],n)},XF=YF("event"),QF=YF("error"),ZF=YF("debug"),$F=({children:e})=>{const t=(0,c.useRef)([]),n=(0,c.useRef)(null),r=(0,c.useRef)(null),[i,o]=(0,c.useState)(!1),[a,l]=(0,c.useState)("idle"),u=(0,c.useRef)(null),d=(0,c.useRef)(0),h=(0,c.useRef)(null),p=(0,c.useCallback)((e=>{n.current=e,e.onstatechange=()=>{switch(XF("Audio Context State Change",{state:e.state,currentTime:e.currentTime}),e.state){case"running":l("active");break;case"suspended":l("paused");break;case"closed":l("finished"),g()}}}),[]),f=(0,c.useCallback)(((e,n)=>{if("finished"===a)return;const r=FF[e]||"viseme_sil",i=n/1e7;null===h.current&&(h.current=i);const o=i-(h.current||0),s={name:r,weight:0,startTime:o,endTime:o+UF};t.current.push(s),"idle"===a&&l("preparing")}),[a]),m=(0,c.useCallback)((e=>{e?(n.current=e,r.current=e.currentTime,d.current=0,o(!0),l("active"),XF("Started Processing",{audioTime:e.currentTime,queueLength:t.current.length,state:a})):QF("No audio context provided",{state:a})}),[]),g=(0,c.useCallback)((()=>{o(!1),l("finished"),r.current=null,u.current=null,d.current=0,n.current=null,XF("Stopped Processing",{queueLength:t.current.length,state:a})}),[]),v=(0,c.useCallback)((e=>{if(!i||!n.current)return null;const o=n.current.currentTime-(r.current||0)+VF;t.current=t.current.filter((e=>!qF(e,o)));const s=t.current.find((e=>e.startTime<=o&&e.endTime>o-jF));if(d.current%GF==60&&ZF("Current Viseme",{currentViseme:s,audioTime:o,visemeQueue:t.current}),s){const e=(o-s.startTime)/(s.endTime-s.startTime),t=KF(e),n=u.current?JF(u.current.weight,t):t,r={...s,weight:n};return u.current=r,r}if(u.current){const e=u.current.weight*(1-HF);u.current={...u.current,weight:e}}return u.current=null,null}),[i]),y=(0,c.useCallback)((()=>{t.current=[],u.current=null,r.current=null,h.current=null,d.current=0,l("idle"),XF("Reset Viseme Queue",{previousState:a})}),[a]),b=(0,c.useCallback)((e=>{XF("Reset And Start Processing",{previousState:a,queueLength:t.current.length}),g(),y(),m(e)}),[g,y,m,a]),S=(0,c.useMemo)((()=>({addViseme:f,updateCurrentViseme:v,startProcessing:m,stopProcessing:g,resetAndStartProcessing:b,resetVisemeQueue:y,isProcessing:i,setAudioContext:p})),[f,v,m,g,b,y,i,p]);return(0,s.jsx)(zF.Provider,{value:S,children:e})},eU=()=>{const e=(0,c.useContext)(zF);if(!e)throw new Error("useVisemeContext must be used within a VisemeProvider");return e};var tU=(0,c.memo)((({memori:e,integration:n,integrationConfig:r,tenant:i,instruct:o=!1,avatar3dVisible:a=!1,setAvatar3dVisible:l,hasUserActivatedSpeak:u=!1,isPlayingAudio:d=!1,loading:h=!1,baseUrl:p,apiUrl:f,animation:m,isZoomed:g=!1,chatProps:v})=>{const{t:y}=_e(),[b,S]=(0,c.useState)(!1),{stopProcessing:x,updateCurrentViseme:_,resetVisemeQueue:w}=eU();(0,c.useEffect)((()=>{S(!0)}),[]);const C=()=>{if("userAvatar"===(null==r?void 0:r.avatar)&&e.avatarURL&&e.avatarURL.length>0)return xN({type:"avatar",tenantID:null==i?void 0:i.id,resourceURI:e.avatarURL,baseURL:p,apiURL:f})},A=()=>{var t;return b?"readyplayerme"===(null==r?void 0:r.avatar)||"readyplayerme-full"===(null==r?void 0:r.avatar)||"customrpm"===(null==r?void 0:r.avatar)?(0,s.jsx)(aD,{fallback:(0,s.jsx)("div",{className:"memori--blob-container",children:b&&(0,s.jsx)(lD,{speaking:d,avatar:C()})}),children:(0,s.jsx)(BF,{updateCurrentViseme:_,url:r.avatarURL,sex:"FEMALE"===e.voiceType?"FEMALE":"MALE",fallbackImg:C(),headMovement:!0,eyeBlink:!0,animation:m,halfBody:"readyplayerme"===r.avatar,speaking:d,loading:h,style:T(),stopProcessing:x,resetVisemeQueue:w,isZoomed:g,chatEmission:null===(t=null==v?void 0:v.dialogState)||void 0===t?void 0:t.emission})}):"customglb"===(null==r?void 0:r.avatar)?(0,s.jsx)(CL,{poster:C()||"",src:r.avatarURL,alt:""}):null:null},E=()=>(0,s.jsx)("div",{className:"memori--avatar-toggle",children:(0,s.jsx)(_f,{ghost:!0,onClick:()=>l(!a),icon:a?(0,s.jsx)(uD,{}):(0,s.jsx)(cD,{}),children:(0,s.jsx)("span",{className:"memori--avatar-toggle-text",children:y(a?"hide":"show")})})}),T=()=>"readyplayerme"===(null==r?void 0:r.avatar)?{width:"300px",height:"300px",backgroundColor:"none",borderRadius:"100%",boxShadow:"none"}:{width:"100%",height:"100%",backgroundColor:"none"};return(0,s.jsxs)(s.Fragment,{children:["readyplayerme"!==(null==r?void 0:r.avatar)&&"readyplayerme-full"!==(null==r?void 0:r.avatar)&&"customglb"!==(null==r?void 0:r.avatar)&&"customrpm"!==(null==r?void 0:r.avatar)||!(null==r?void 0:r.avatarURL)?(0,s.jsx)("div",{className:"memori--blob-container",children:b&&(0,s.jsx)(lD,{speaking:d,avatar:C()})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:t(ws)("memori--avatar-wrapper",`memori--avatar-${(null==r?void 0:r.avatar)||"default"}`,{hidden:!a}),children:A()}),E()]}),(()=>{if(!o||u||!e.isGiver||!(null==i?void 0:i.id))return null;const t=`https://${i.id}/${"it-IT"===e.culture?"it":"en"}/${e.ownerUserName}/${e.name}/integrations${(null==n?void 0:n.integrationID)?`?integration=${n.integrationID}&openAvatarModal=true`:""}`;return(0,s.jsx)("div",{className:"memori--avatar-link-to-integrations",children:(0,s.jsx)("a",{className:"memori-button memori-button--circle memori-button--outlined",href:t,children:(0,s.jsx)(AN,{content:y("widgetgoToIntegrationsToCustomizeAvatar"),children:(0,s.jsx)("span",{className:"memori-button--icon",children:(0,s.jsx)(dD,{})})})})})})()]})}),((e,t)=>JSON.stringify(e)===JSON.stringify(t)));c=o("85Hg2"),c=o("85Hg2");function nU(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let rU=(0,(c=o("85Hg2")).createContext)(null);function iU(){let e=(0,c.useContext)(rU);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,iU),e}return e}function oU(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=_h((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(rU.Provider,{value:i},e.children)}),[n])]}let sU=gh((function(e,t){let{passive:n=!1,...r}=e,i=iU(),o=`headlessui-label-${kh()}`,s=Ah(t);Sh((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),ph({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));var aU,lU=((aU=lU||{})[aU.RegisterOption=0]="RegisterOption",aU[aU.UnregisterOption=1]="UnregisterOption",aU);let cU={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Zh(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},uU=(0,c.createContext)(null);function dU(e){let t=(0,c.useContext)(uU);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,dU),t}return t}function hU(e,t){return ch(t.type,cU,e,t)}uU.displayName="RadioGroupContext";let pU=gh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=_h("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[h,p]=(0,c.useReducer)(hU,{options:[]}),f=h.options,[m,g]=oU(),[v,y]=Ep(),b=`headlessui-radiogroup-${kh()}`,S=(0,c.useRef)(null),x=Ah(S,n),[_,w]=AR(r,s,i),C=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),A=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,_)))),[f,_]),E=_h((e=>{var t;if(l||d(e,_))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==w||w(e),!0)}));yR({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=_h((e=>{let t=S.current;if(!t)return;let n=Fh(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Th.Enter:CR(e.currentTarget);break;case Th.ArrowLeft:case Th.ArrowUp:if(e.preventDefault(),e.stopPropagation(),ep(r,Gh.Previous|Gh.WrapAround)===Vh.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Th.ArrowRight:case Th.ArrowDown:if(e.preventDefault(),e.stopPropagation(),ep(r,Gh.Next|Gh.WrapAround)===Vh.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Th.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),I=_h((e=>(p({type:0,...e}),()=>p({type:1,id:e.id})))),M=(0,c.useMemo)((()=>({registerOption:I,firstOption:C,containsCheckedOption:A,change:E,disabled:l,value:_,compare:d})),[I,C,A,E,l,_,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:_})),[_]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(uU.Provider,{value:M},null!=o&&null!=_&&xR({[o]:_}).map((([e,n])=>t(c).createElement(Dh,{features:Lh.Hidden,...vh({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),ph({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var fU=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(fU||{});let mU=gh((function(e,n){let r=(0,c.useRef)(null),i=Ah(r,n),o=`headlessui-radiogroup-option-${kh()}`,[s,a]=oU(),[l,u]=Ep(),{addFlag:d,removeFlag:h,hasFlag:p}=nU(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});Sh((()=>{v.current.value=f}),[f,v]),Sh((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:_,value:w,compare:C}=dU("RadioGroup.Option");Sh((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let A=_h((e=>{var t;if(Ih(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),E=_h((e=>{if(Ih(e.currentTarget))return e.preventDefault();d(2)})),T=_h((()=>h(2))),I=(null==x?void 0:x.id)===o,M=b||m,R=C(w,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!M||void 0,tabIndex:M?-1:R||!_&&I?0:-1,onClick:M?void 0:A,onFocus:M?void 0:E,onBlur:M?void 0:T},N=(0,c.useMemo)((()=>({checked:R,disabled:M,active:p(2)})),[R,M,p]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},ph({ourProps:P,theirProps:g,slot:N,defaultTag:"div",name:"RadioGroup.Option"})))})),gU=Object.assign(pU,{Option:mU,Label:sU,Description:Tp});var vU=({instruct:e,canInstruct:t,onChangeMode:n})=>{const{t:r}=_e();return t?(0,s.jsx)("div",{className:"memori--changeMode-instruct",children:(0,s.jsxs)(gU,{name:"instruct",value:e?"instruct":"test",defaultValue:e?"instruct":"test",className:"memori--changeMode-instruct-radio",onChange:n,children:[(0,s.jsx)(gU.Option,{value:"instruct",className:"memori--changeMode-instruct-radio-button",children:({checked:e})=>(0,s.jsx)(_f,{primary:e,children:r("widget.instruct")||"Instruct"})}),(0,s.jsx)(gU.Option,{value:"test",className:"memori--changeMode-instruct-radio-button",children:({checked:e})=>(0,s.jsx)(_f,{primary:e,children:r("widget.test")||"Test"})})]})}):null};c=o("85Hg2");var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",viewBox:"0 0 40 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M25.085.277c-.264 0-.531.071-.777.236L8.482 10.857H1.161a.716.716 0 00-.715.714V24.43c0 .392.322.714.715.714h7.321l15.826 10.344c.246.16.518.236.777.236.745 0 1.433-.593 1.433-1.433V1.71c0-.84-.688-1.433-1.433-1.433zM23.304 30.99l-13.063-8.54-.803-.522H3.66V14.07h5.777l.799-.522 13.067-8.54V30.99zM39.534 15.148L36.967 18l2.567 2.852a1.09 1.09 0 010 1.427l-1.283 1.426a.845.845 0 01-1.284 0L34.4 20.852l-2.567 2.852a.845.845 0 01-1.283 0l-1.284-1.426a1.09 1.09 0 010-1.426L31.833 18l-2.567-2.852a1.09 1.09 0 010-1.426l1.283-1.427a.845.845 0 011.284 0l2.567 2.853 2.567-2.853a.845.845 0 011.284 0l1.283 1.427a1.09 1.09 0 010 1.426z",fill:"currentColor"})});var bU,SU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"})}),xU=(c=o("85Hg2"),(bU=xU||{})[bU.Open=0]="Open",bU[bU.Closed=1]="Closed",bU),_U=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(_U||{});let wU={0:e=>({...e,popoverState:ch(e.popoverState,{0:1,1:0})}),1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},CU=(0,c.createContext)(null);function AU(e){let t=(0,c.useContext)(CU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,AU),t}return t}CU.displayName="PopoverContext";let EU=(0,c.createContext)(null);function TU(e){let t=(0,c.useContext)(EU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,TU),t}return t}EU.displayName="PopoverAPIContext";let IU=(0,c.createContext)(null);function MU(){return(0,c.useContext)(IU)}IU.displayName="PopoverGroupContext";let RU=(0,c.createContext)(null);function PU(e,t){return ch(t.type,wU,e,t)}RU.displayName="PopoverPanelContext";let NU=gh((function(e,n){var r;let i=`headlessui-popover-button-${kh()}`,o=`headlessui-popover-panel-${kh()}`,s=(0,c.useRef)(null),a=Ah(n,Ch((e=>{s.current=e}))),l=(0,c.useReducer)(PU,{popoverState:1,button:null,buttonId:i,panel:null,panelId:o,beforePanelSentinel:(0,c.createRef)(),afterPanelSentinel:(0,c.createRef)()}),[{popoverState:u,button:d,panel:h,beforePanelSentinel:p,afterPanelSentinel:f},m]=l,g=op(null!=(r=s.current)?r:d);(0,c.useEffect)((()=>m({type:3,buttonId:i})),[i,m]),(0,c.useEffect)((()=>m({type:5,panelId:o})),[o,m]);let v=(0,c.useMemo)((()=>{if(!d||!h)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(d))^Number(null==e?void 0:e.contains(h)))return!0;let e=qh(),t=e.indexOf(d),n=(t+e.length-1)%e.length,r=(t+1)%e.length,i=e[n],o=e[r];return!h.contains(i)&&!h.contains(o)}),[d,h]),y=(0,c.useMemo)((()=>({buttonId:i,panelId:o,close:()=>m({type:1})})),[i,o,m]),b=MU(),S=null==b?void 0:b.registerPopover,x=_h((()=>{var e;return null!=(e=null==b?void 0:b.isFocusWithinPopoverGroup())?e:(null==g?void 0:g.activeElement)&&((null==d?void 0:d.contains(g.activeElement))||(null==h?void 0:h.contains(g.activeElement)))}));(0,c.useEffect)((()=>null==S?void 0:S(y)),[S,y]),sp(null==g?void 0:g.defaultView,"focus",(e=>{var t,n,r,i;0===u&&(x()||!d||!h||null!=(n=null==(t=p.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(i=null==(r=f.current)?void 0:r.contains)&&i.call(r,e.target)||m({type:1}))}),!0),Dp([d,h],((e,t)=>{m({type:1}),Jh(t,Kh.Loose)||(e.preventDefault(),null==d||d.focus())}),0===u);let _=_h((e=>{m({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:d:d;null==t||t.focus()})),w=(0,c.useMemo)((()=>({close:_,isPortalled:v})),[_,v]),C=(0,c.useMemo)((()=>({open:0===u,close:_})),[u,_]),A=e,E={ref:a};return t(c).createElement(CU.Provider,{value:l},t(c).createElement(EU.Provider,{value:w},t(c).createElement(Pp,{value:ch(u,{0:Mp.Open,1:Mp.Closed})},ph({ourProps:E,theirProps:A,slot:C,defaultTag:"div",name:"Popover"}))))})),OU=gh((function(e,n){let[r,i]=AU("Popover.Button"),{isPortalled:o}=TU("Popover.Button"),s=(0,c.useRef)(null),a=`headlessui-focus-sentinel-${kh()}`,l=MU(),u=null==l?void 0:l.closeOthers,d=(0,c.useContext)(RU),h=null!==d&&d===r.panelId,p=Ah(s,n,h?null:e=>e&&i({type:2,button:e})),f=Ah(s,n),m=op(s),g=_h((e=>{var t,n,o;if(h){if(1===r.popoverState)return;switch(e.key){case Th.Space:case Th.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(o=r.button)||o.focus()}}else switch(e.key){case Th.Space:case Th.Enter:e.preventDefault(),e.stopPropagation(),1===r.popoverState&&(null==u||u(r.buttonId)),i({type:0});break;case Th.Escape:if(0!==r.popoverState)return null==u?void 0:u(r.buttonId);if(!s.current||(null==m?void 0:m.activeElement)&&!s.current.contains(m.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}})),v=_h((e=>{h||e.key===Th.Space&&e.preventDefault()})),y=_h((t=>{var n,o;Ih(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=r.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===r.popoverState&&(null==u||u(r.buttonId)),i({type:0}),null==(o=r.button)||o.focus()))})),b=_h((e=>{e.preventDefault(),e.stopPropagation()})),S=0===r.popoverState,x=(0,c.useMemo)((()=>({open:S})),[S]),_=vR(e,s),w=e,C=h?{ref:f,type:_,onKeyDown:g,onClick:y}:{ref:p,id:r.buttonId,type:_,"aria-expanded":e.disabled?void 0:0===r.popoverState,"aria-controls":r.panel?r.panelId:void 0,onKeyDown:g,onKeyUp:v,onClick:y,onMouseDown:b},A=rp(),E=_h((()=>{let e=r.panel;e&&ch(A.current,{[np.Forwards]:()=>ep(e,Gh.First),[np.Backwards]:()=>ep(e,Gh.Last)})}));return t(c).createElement(t(c).Fragment,null,ph({ourProps:C,theirProps:w,slot:x,defaultTag:"button",name:"Popover.Button"}),S&&!h&&o&&t(c).createElement(Dh,{id:a,features:Lh.Focusable,as:"button",type:"button",onFocus:E}))})),kU=dh.RenderStrategy|dh.Static,LU=gh((function(e,t){let[{popoverState:n},r]=AU("Popover.Overlay"),i=Ah(t),o=`headlessui-popover-overlay-${kh()}`,s=Rp(),a=null!==s?s===Mp.Open:0===n;return ph({ourProps:{ref:i,id:o,"aria-hidden":!0,onClick:_h((e=>{if(Ih(e.currentTarget))return e.preventDefault();r({type:1})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",features:kU,visible:a,name:"Popover.Overlay"})})),DU=dh.RenderStrategy|dh.Static,BU=gh((function(e,n){let{focus:r=!1,...i}=e,[o,s]=AU("Popover.Panel"),{close:a,isPortalled:l}=TU("Popover.Panel"),u=`headlessui-focus-sentinel-before-${kh()}`,d=`headlessui-focus-sentinel-after-${kh()}`,h=(0,c.useRef)(null),p=Ah(h,n,(e=>{s({type:4,panel:e})})),f=op(h),m=Rp(),g=null!==m?m===Mp.Open:0===o.popoverState,v=_h((e=>{var t;if(e.key===Th.Escape){if(0!==o.popoverState||!h.current||(null==f?void 0:f.activeElement)&&!h.current.contains(f.activeElement))return;e.preventDefault(),e.stopPropagation(),s({type:1}),null==(t=o.button)||t.focus()}}));(0,c.useEffect)((()=>{var t;e.static||1===o.popoverState&&(null==(t=e.unmount)||t)&&s({type:4,panel:null})}),[o.popoverState,e.unmount,e.static,s]),(0,c.useEffect)((()=>{if(!r||0!==o.popoverState||!h.current)return;let e=null==f?void 0:f.activeElement;h.current.contains(e)||ep(h.current,Gh.First)}),[r,h,o.popoverState]);let y=(0,c.useMemo)((()=>({open:0===o.popoverState,close:a})),[o,a]),b={ref:p,id:o.panelId,onKeyDown:v,onBlur:r&&0===o.popoverState?e=>{var t,n,r,i,a;let l=e.relatedTarget;!l||!h.current||null!=(t=h.current)&&t.contains(l)||(s({type:1}),((null==(r=null==(n=o.beforePanelSentinel.current)?void 0:n.contains)?void 0:r.call(n,l))||(null==(a=null==(i=o.afterPanelSentinel.current)?void 0:i.contains)?void 0:a.call(i,l)))&&l.focus({preventScroll:!0}))}:void 0,tabIndex:-1},S=rp(),x=_h((()=>{let e=h.current;e&&ch(S.current,{[np.Forwards]:()=>{ep(e,Gh.First)},[np.Backwards]:()=>{var e;null==(e=o.button)||e.focus({preventScroll:!0})}})})),_=_h((()=>{let e=h.current;e&&ch(S.current,{[np.Forwards]:()=>{var e,t,n;if(!o.button)return;let r=qh(),i=r.indexOf(o.button),s=r.slice(0,i+1),a=[...r.slice(i+1),...s];for(let r of a.slice())if((null==(t=null==(e=null==r?void 0:r.id)?void 0:e.startsWith)?void 0:t.call(e,"headlessui-focus-sentinel-"))||(null==(n=o.panel)?void 0:n.contains(r))){let e=a.indexOf(r);-1!==e&&a.splice(e,1)}ep(a,Gh.First,!1)},[np.Backwards]:()=>ep(e,Gh.Last)})}));return t(c).createElement(RU.Provider,{value:o.panelId},g&&l&&t(c).createElement(Dh,{id:u,ref:o.beforePanelSentinel,features:Lh.Focusable,as:"button",type:"button",onFocus:x}),ph({ourProps:b,theirProps:i,slot:y,defaultTag:"div",features:DU,visible:g,name:"Popover.Panel"}),g&&l&&t(c).createElement(Dh,{id:d,ref:o.afterPanelSentinel,features:Lh.Focusable,as:"button",type:"button",onFocus:_}))})),zU=gh((function(e,n){let r=(0,c.useRef)(null),i=Ah(r,n),[o,s]=(0,c.useState)([]),a=_h((e=>{s((t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t}))})),l=_h((e=>(s((t=>[...t,e])),()=>a(e)))),u=_h((()=>{var e;let t=Fh(r);if(!t)return!1;let n=t.activeElement;return!(null==(e=r.current)||!e.contains(n))||o.some((e=>{var r,i;return(null==(r=t.getElementById(e.buttonId))?void 0:r.contains(n))||(null==(i=t.getElementById(e.panelId))?void 0:i.contains(n))}))})),d=_h((e=>{for(let t of o)t.buttonId!==e&&t.close()})),h=(0,c.useMemo)((()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:u,closeOthers:d})),[l,a,u,d]),p=(0,c.useMemo)((()=>({})),[]),f=e,m={ref:i};return t(c).createElement(IU.Provider,{value:h},ph({ourProps:m,theirProps:f,slot:p,defaultTag:"div",name:"Popover.Group"}))})),FU=Object.assign(NU,{Button:OU,Overlay:LU,Panel:BU,Group:zU});var UU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})});var jU=({history:e,memori:n,className:r,buttonClassName:i,icon:o,disabled:a=!1,align:l="right",filename:c})=>{const{t:u}=_e(),d=`${u("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(e.map((e=>`${e.fromUser?"YOU":n.name}: ${e.text}`)).join("\n"));return(0,s.jsx)(FU,{title:u("write_and_speak.exportChatHistoryMessage"),className:t(ws)("memori-export-history-button",r,{"memori-export-history-button--align-left":"left"===l}),children:({close:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(FU.Button,{disabled:a,className:t(ws)("memori-button","memori-button--circle","memori-button--icon-only",i,{"memori-button--disabled":a,"memori-button--primary":!a}),children:(0,s.jsx)("div",{className:"memori-button--icon",children:o||(0,s.jsx)(UU,{})})}),(0,s.jsxs)(FU.Panel,{className:"memori-export-history-button--panel",children:[(0,s.jsx)("p",{children:u("write_and_speak.exportChatHistory")}),(0,s.jsx)(_f,{primary:!0,onClick:()=>((e,t="export-chat.txt")=>{const n=new Blob([e],{type:"text/plain"}),r=URL.createObjectURL(n),i=document.createElement("a");i.setAttribute("href",r),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)})(d,c||`${n.name.replace(/\W+/g,"-")}-export-chat.txt`),children:u("yes")||"Yes"}),(0,s.jsx)(_f,{onClick:()=>e(),children:u("no")||"No"})]})]})})};var HU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"})});c=o("85Hg2");var GU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"})});var VU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0 0 75-94 336.64 336.64 0 0 1-108.2 41.2A170.1 170.1 0 0 0 672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 0 0-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 0 1-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 0 1-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"})});var WU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 1 0-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"})});var qU=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M713.5 599.9c-10.9-5.6-65.2-32.2-75.3-35.8-10.1-3.8-17.5-5.6-24.8 5.6-7.4 11.1-28.4 35.8-35 43.3-6.4 7.4-12.9 8.3-23.8 2.8-64.8-32.4-107.3-57.8-150-131.1-11.3-19.5 11.3-18.1 32.4-60.2 3.6-7.4 1.8-13.7-1-19.3-2.8-5.6-24.8-59.8-34-81.9-8.9-21.5-18.1-18.5-24.8-18.9-6.4-.4-13.7-.4-21.1-.4-7.4 0-19.3 2.8-29.4 13.7-10.1 11.1-38.6 37.8-38.6 92s39.5 106.7 44.9 114.1c5.6 7.4 77.7 118.6 188.4 166.5 70 30.2 97.4 32.8 132.4 27.6 21.3-3.2 65.2-26.6 74.3-52.5 9.1-25.8 9.1-47.9 6.4-52.5-2.7-4.9-10.1-7.7-21-13z"}),(0,s.jsx)("path",{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3-41.3-41.3-89.5-73.8-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9-53.3 22.8-101.1 55.2-142 96.5-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9.3 69.4 16.9 138.3 48 199.9v152c0 25.4 20.6 46 46 46h152.1c61.6 31.1 130.5 47.7 199.9 48h2.1c59.9 0 118-11.6 172.7-34.3 53.5-22.3 101.6-54.3 142.8-95.2 41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})]});var KU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0 0 68.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"})});var JU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"})});var YU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});var XU,QU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"})}),ZU=(c=o("85Hg2"),Object.defineProperty),$U=Object.getOwnPropertySymbols,ej=Object.prototype.hasOwnProperty,tj=Object.prototype.propertyIsEnumerable,nj=(e,t,n)=>t in e?ZU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rj=(e,t)=>{for(var n in t||(t={}))ej.call(t,n)&&nj(e,n,t[n]);if($U)for(var n of $U(t))tj.call(t,n)&&nj(e,n,t[n]);return e},ij=(e,t)=>{var n={};for(var r in e)ej.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&$U)for(var r of $U(e))t.indexOf(r)<0&&tj.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,l=-1,c=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let u,d;for(u=i;;u++){const r=8*t.getNumDataCodewords(u,n),i=a.getTotalBits(e,u);if(i<=r){d=i;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(u),h);for(const e of t.getData())h.push(e)}o(h.length==d);const p=8*t.getNumDataCodewords(u,n);o(h.length<=p),r(0,Math.min(4,p-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)r(e,8,h);let f=[];for(;8*f.length<h.length;)f.push(0);return h.forEach(((e,t)=>f[t>>>3]|=e<<7-(7&t))),new t(u,n,f,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),l=i-a%i,c=Math.floor(a/i);let u=[];const d=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+c-s+(n<l?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,d);n<l&&i.push(0),u.push(i.concat(o))}let h=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=c-s||n>=l)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(XU||(XU={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(XU||(XU={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(XU||(XU={}));var oj=XU,sj={L:oj.QrCode.Ecc.LOW,M:oj.QrCode.Ecc.MEDIUM,Q:oj.QrCode.Ecc.QUARTILE,H:oj.QrCode.Ecc.HIGH},aj=128,lj="L",cj="#FFFFFF",uj="#000000",dj=!1;
253
+ class PB{constructor(e,t,n,r,i="div"){this.parent=e,this.object=t,this.property=n,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(i),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),PB.nextNameID=PB.nextNameID||0,this.$name.id="lil-gui-name-"+ ++PB.nextNameID,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",(e=>e.stopPropagation())),this.domElement.addEventListener("keyup",(e=>e.stopPropagation())),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(n)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),void 0!==this._onChange&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),void 0!==this._onFinishChange&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled||(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e)),this}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,void 0!==this._listenCallbackID&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class NB extends PB{constructor(e,t,n){super(e,t,n,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",(()=>{this.setValue(this.$input.checked),this._callOnFinishChange()})),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function OB(e){let t,n;return(t=e.match(/(#|0x)?([a-f0-9]{6})/i))?n=t[2]:(t=e.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?n=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=e.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(n=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),!!n&&"#"+n}const kB={isPrimitive:!0,match:e=>"number"==typeof e,fromHexString:e=>parseInt(e.substring(1),16),toHexString:e=>"#"+e.toString(16).padStart(6,0)},LB={isPrimitive:!1,match:e=>Array.isArray(e),fromHexString(e,t,n=1){const r=kB.fromHexString(e);t[0]=(r>>16&255)/255*n,t[1]=(r>>8&255)/255*n,t[2]=(255&r)/255*n},toHexString:([e,t,n],r=1)=>kB.toHexString(e*(r=255/r)<<16^t*r<<8^n*r<<0)},DB={isPrimitive:!1,match:e=>Object(e)===e,fromHexString(e,t,n=1){const r=kB.fromHexString(e);t.r=(r>>16&255)/255*n,t.g=(r>>8&255)/255*n,t.b=(255&r)/255*n},toHexString:({r:e,g:t,b:n},r=1)=>kB.toHexString(e*(r=255/r)<<16^t*r<<8^n*r<<0)},BB=[{isPrimitive:!0,match:e=>"string"==typeof e,fromHexString:OB,toHexString:OB},kB,LB,DB];class zB extends PB{constructor(e,t,n,r){var i;super(e,t,n,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(i=this.initialValue,BB.find((e=>e.match(i)))),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",(()=>{this._setValueFromHexString(this.$input.value)})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$text.addEventListener("input",(()=>{const e=OB(this.$text.value);e&&this._setValueFromHexString(e)})),this.$text.addEventListener("focus",(()=>{this._textFocused=!0,this.$text.select()})),this.$text.addEventListener("blur",(()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()})),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class FB extends PB{constructor(e,t,n){super(e,t,n,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",(e=>{e.preventDefault(),this.getValue().call(this.object),this._callOnChange()})),this.$button.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$disable=this.$button}}class UB extends PB{constructor(e,t,n,r,i,o){super(e,t,n,"number"),this._initInput(),this.min(r),this.max(i);const s=void 0!==o;this.step(s?o:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=100*t+"%"}return this._inputFocused||(this.$input.value=void 0===this._decimals?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id);window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=e=>{const t=parseFloat(this.$input.value);isNaN(t)||(this._snapClampSetValue(t+e),this.$input.value=this.getValue())};let t,n,r,i,o,s=!1;const a=e=>{if(s){const r=e.clientX-t,i=e.clientY-n;Math.abs(i)>5?(e.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(r)>5&&l()}if(!s){const t=e.clientY-r;o-=t*this._step*this._arrowKeyMultiplier(e),i+o>this._max?o=this._max-i:i+o<this._min&&(o=this._min-i),this._snapClampSetValue(i+o)}r=e.clientY},l=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",l)};this.$input.addEventListener("input",(()=>{let e=parseFloat(this.$input.value);isNaN(e)||(this._stepExplicit&&(e=this._snap(e)),this.setValue(this._clamp(e)))})),this.$input.addEventListener("keydown",(t=>{"Enter"===t.key&&this.$input.blur(),"ArrowUp"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t))),"ArrowDown"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t)*-1))})),this.$input.addEventListener("wheel",(t=>{this._inputFocused&&(t.preventDefault(),e(this._step*this._normalizeMouseWheel(t)))}),{passive:!1}),this.$input.addEventListener("mousedown",(e=>{t=e.clientX,n=r=e.clientY,s=!0,i=this.getValue(),o=0,window.addEventListener("mousemove",a),window.addEventListener("mouseup",l)})),this.$input.addEventListener("focus",(()=>{this._inputFocused=!0})),this.$input.addEventListener("blur",(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()}))}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=e=>{const t=this.$slider.getBoundingClientRect();let n=((e,t,n,r,i)=>(e-t)/(n-t)*(i-r)+r)(e,t.left,t.right,this._min,this._max);this._snapClampSetValue(n)},t=t=>{e(t.clientX)},n=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};let r,i,o=!1;const s=t=>{t.preventDefault(),this._setDraggingStyle(!0),e(t.touches[0].clientX),o=!1},a=t=>{if(o){const e=t.touches[0].clientX-r,n=t.touches[0].clientY-i;Math.abs(e)>Math.abs(n)?s(t):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",l))}else t.preventDefault(),e(t.touches[0].clientX)},l=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",l)},c=this._callOnFinishChange.bind(this);let u;this.$slider.addEventListener("mousedown",(r=>{this._setDraggingStyle(!0),e(r.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)})),this.$slider.addEventListener("touchstart",(e=>{e.touches.length>1||(this._hasScrollBar?(r=e.touches[0].clientX,i=e.touches[0].clientY,o=!0):s(e),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",l))}),{passive:!1}),this.$slider.addEventListener("wheel",(e=>{if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const t=this._normalizeMouseWheel(e)*this._step;this._snapClampSetValue(this.getValue()+t),this.$input.value=this.getValue(),clearTimeout(u),u=setTimeout(c,400)}),{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:n}=e;Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,n=-e.wheelDelta/120,n*=this._stepExplicit?1:10);return t+-n}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class jB extends PB{constructor(e,t,n,r){super(e,t,n,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",(()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()})),this.$select.addEventListener("focus",(()=>{this.$display.classList.add("focus")})),this.$select.addEventListener("blur",(()=>{this.$display.classList.remove("focus")})),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(r)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach((e=>{const t=document.createElement("option");t.textContent=e,this.$select.appendChild(t)})),this.updateDisplay(),this}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.textContent=-1===t?e:this._names[t],this}}class HB extends PB{constructor(e,t,n){super(e,t,n,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",(()=>{this.setValue(this.$input.value)})),this.$input.addEventListener("keydown",(e=>{"Enter"===e.code&&this.$input.blur()})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let GB=!1;class VB{constructor({parent:e,autoPlace:t=void 0===e,container:n,width:r,title:i="Controls",closeFolders:o=!1,injectStyles:s=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",(()=>this.openAnimated(this._closed))),this.$title.addEventListener("keydown",(e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),this.$title.click())})),this.$title.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(i),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),a&&this.domElement.classList.add("allow-touch-styles"),!GB&&s&&(!function(e){const t=document.createElement("style");t.innerHTML=e;const n=document.querySelector("head link[rel=stylesheet], head style");n?document.head.insertBefore(t,n):document.head.appendChild(t)}('.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "↕";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "▾";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "▸";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "✓";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3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B1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}'),GB=!0),n?n.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=o}add(e,t,n,r,i){if(Object(n)===n)return new jB(this,e,t,n);const o=e[t];switch(typeof o){case"number":return new UB(this,e,t,n,r,i);case"boolean":return new NB(this,e,t);case"string":return new HB(this,e,t);case"function":return new FB(this,e,t)}console.error("gui.add failed\n\tproperty:",t,"\n\tobject:",e,"\n\tvalue:",o)}addColor(e,t,n=1){return new zB(this,e,t,n)}addFolder(e){const t=new VB({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach((t=>{t instanceof FB||t._name in e.controllers&&t.load(e.controllers[t._name])})),t&&e.folders&&this.folders.forEach((t=>{t._title in e.folders&&t.load(e.folders[t._title])})),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach((e=>{if(!(e instanceof FB)){if(e._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);t.controllers[e._name]=e.save()}})),e&&this.folders.forEach((e=>{if(e._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);t.folders[e._title]=e.save()})),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame((()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const n=e=>{e.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",n))};this.$children.addEventListener("transitionend",n);const r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame((()=>{this.$children.style.height=r+"px"}))})),this}title(e){return this._title=e,this.$title.textContent=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach((e=>e.reset())),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),void 0!==this._onChange&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),void 0!==this._onFinishChange&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),void 0!==this._onOpenClose&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach((e=>e.destroy()))}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach((t=>{e=e.concat(t.controllersRecursive())})),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach((t=>{e=e.concat(t.foldersRecursive())})),e}}var WB=VB;var qB=({onBaseActionChange:e,baseActions:t,modifyTimeScale:n,onMorphTargetInfluencesChange:r,onMorphTargetDictionaryChange:i,morphTargetDictionary:o,timeScale:s})=>{const a=(0,c.useRef)(null),l=(0,c.useRef)({"modify time scale":s}),u=(0,c.useRef)([]);return(0,c.useEffect)((()=>{const i=new WB({width:310});a.current=i;const s=i.addFolder("Base Actions"),c=i.addFolder("Additive Action Weights"),d=i.addFolder("General Speed");return["None",...Object.keys(t)].forEach((n=>{t[n];l.current[n]=()=>{e(n)};const r=s.add(l.current,n);u.current.push(r)})),Object.entries(o).forEach((([e,t])=>{l.current[e]=t/100,c.add(l.current,e,-1,1,.01).listen().onChange((t=>{r({[e]:t})}))})),d.add(l.current,"modify time scale",0,1.5,.01).onChange((e=>{n(e)})),s.open(),c.open(),d.open(),()=>{i.destroy()}}),[e,r,i,n,t,o,s]),null};c=o("85Hg2"),c=o("85Hg2");function KB(e,t){const n=c.useRef(),[r]=c.useState((()=>t?t instanceof rS?{current:t}:t:n)),[i]=c.useState((()=>new NI(void 0))),o=c.useRef({}),[s]=c.useState((()=>{const t={};return e.forEach((e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(r.current)return o.current[e.name]||(o.current[e.name]=i.clipAction(e,r.current))}}))),{ref:r,clips:e,actions:t,names:e.map((e=>e.name)),mixer:i}}));return eB(((e,t)=>i.update(t))),c.useEffect((()=>{const e=r.current;return()=>{o.current={},Object.values(s.actions).forEach((t=>{e&&i.uncacheAction(t,e)}))}}),[e]),s}const JB=new WeakMap;class YB extends fT{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new vT(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const e in t.attributeTypes){const n=t.attributeTypes[e];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=n.name)}const n=JSON.stringify(t);if(JB.has(e)){const t=JB.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,o=e.byteLength,s=this._getWorker(i,o).then((n=>(r=n,new Promise(((n,o)=>{r._callbacks[i]={resolve:n,reject:o},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return s.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),JB.set(e,{key:n,promise:s}),s}_createGeometry(e){const t=new zS;e.index&&t.setIndex(new SS(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,o=r.array,s=r.itemSize;t.setAttribute(i,new SS(o,s))}return t}_loadLibrary(e,t){const n=new vT(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=XB.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function XB(){let e,t;function n(e,t,n,r,i,o){const s=o.num_components(),a=n.num_points()*s,l=a*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),u=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,c,l,u);const d=new i(e.HEAPF32.buffer,u,a).slice();return e._free(u),{name:r,array:d,itemSize:s}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,o=i.taskConfig;t.then((e=>{const t=e.draco,s=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const o=i.attributeIDs,s=i.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeBufferToMesh(r,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const r in o){const l=self[s[r]];let c,d;if(i.useUniqueIDs)d=o[r],c=t.GetAttributeByUniqueId(a,d);else{if(d=t.GetAttributeId(a,e[o[r]]),-1===d)continue;c=t.GetAttribute(a,d)}u.attributes.push(n(e,t,a,r,l,c))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,n){const r=n.num_faces(),i=3*r,o=4*i,s=e._malloc(o);t.GetTrianglesUInt32Array(n,o,s);const a=new Uint32Array(e.HEAPF32.buffer,s,i).slice();return e._free(s),{array:a,itemSize:1}}(e,t,a));return e.destroy(a),u}(t,s,a,o),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(a),t.destroy(s)}}))}}}let QB;const ZB=()=>{if(QB)return QB;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n,r="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFa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DYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");const i=WebAssembly.instantiate(function(e){const n=new Uint8Array(e.length);for(let t=0;t<e.length;++t){const r=e.charCodeAt(t);n[t]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let r=0;for(let i=0;i<e.length;++i)n[r++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,r)}(r),{}).then((e=>{n=e.instance,n.exports.__wasm_call_ctors()}));function o(e,t,r,i,o,s){const a=n.exports.sbrk,l=r+3&-4,c=a(l*i),u=a(o.length),d=new Uint8Array(n.exports.memory.buffer);d.set(o,u);const h=e(c,r,i,u,o.length);if(0===h&&s&&s(c,l,i),t.set(d.subarray(c,c+r*i)),a(c-a(0)),0!==h)throw new Error(`Malformed buffer data: ${h}`)}const s={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},a={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return QB={ready:i,supported:!0,decodeVertexBuffer(e,t,r,i,a){o(n.exports.meshopt_decodeVertexBuffer,e,t,r,i,n.exports[s[a]])},decodeIndexBuffer(e,t,r,i){o(n.exports.meshopt_decodeIndexBuffer,e,t,r,i)},decodeIndexSequence(e,t,r,i){o(n.exports.meshopt_decodeIndexSequence,e,t,r,i)},decodeGltfBuffer(e,t,r,i,l,c){o(n.exports[a[l]],e,t,r,i,n.exports[s[c]])}},QB};class $B extends fT{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new oz(e)})),this.register((function(e){return new hz(e)})),this.register((function(e){return new pz(e)})),this.register((function(e){return new az(e)})),this.register((function(e){return new lz(e)})),this.register((function(e){return new cz(e)})),this.register((function(e){return new uz(e)})),this.register((function(e){return new iz(e)})),this.register((function(e){return new dz(e)})),this.register((function(e){return new sz(e)})),this.register((function(e){return new nz(e)})),this.register((function(e){return new fz(e)}))}load(e,t,n,r){const i=this;let o;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:VT.extractUrlBase(e),this.manager.itemStart(e);const s=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},a=new vT(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{i.parse(n,o,(function(n){t(n),i.manager.itemEnd(e)}),s)}catch(e){s(e)}}),n,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const o={},s={};if("string"==typeof e)i=e;else{if(VT.decodeText(new Uint8Array(e,0,4))===mz){try{o[tz.KHR_BINARY_GLTF]=new yz(e)}catch(e){return void(r&&r(e))}i=o[tz.KHR_BINARY_GLTF].content}else i=VT.decodeText(new Uint8Array(e))}const a=JSON.parse(i);if(void 0===a.asset||a.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new Xz(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);s[t.name]=t,o[t.name]=!0}if(a.extensionsUsed)for(let e=0;e<a.extensionsUsed.length;++e){const t=a.extensionsUsed[e],n=a.extensionsRequired||[];switch(t){case tz.KHR_MATERIALS_UNLIT:o[t]=new rz;break;case tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[t]=new _z;break;case tz.KHR_DRACO_MESH_COMPRESSION:o[t]=new bz(a,this.dracoLoader);break;case tz.KHR_TEXTURE_TRANSFORM:o[t]=new Sz;break;case tz.KHR_MESH_QUANTIZATION:o[t]=new wz;break;default:n.indexOf(t)>=0&&void 0===s[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(o),l.setPlugins(s),l.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function ez(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const tz={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class nz{constructor(e){this.parser=e,this.name=tz.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,o=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let s;const a=new Uy(16777215);void 0!==o.color&&a.fromArray(o.color);const l=void 0!==o.range?o.range:0;switch(o.type){case"directional":s=new zT(a),s.target.position.set(0,0,-1),s.add(s.target);break;case"point":s=new DT(a),s.distance=l;break;case"spot":s=new PT(a),s.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,s.angle=o.spot.outerConeAngle,s.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return s.position.set(0,0,0),s.decay=2,void 0!==o.intensity&&(s.intensity=o.intensity),s.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(s),t.cache.add(n,r),r}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class rz{constructor(){this.name=tz.KHR_MATERIALS_UNLIT}getMaterialType(){return vS}extendParams(e,t,n){const r=[];e.color=new Uy(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,Tv))}return Promise.all(r)}}class iz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class oz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const e=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Cy(e,e)}return Promise.all(i)}}class sz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];return void 0!==o.iridescenceFactor&&(t.iridescence=o.iridescenceFactor),void 0!==o.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),void 0!==o.iridescenceIor&&(t.iridescenceIOR=o.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==o.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),void 0!==o.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),void 0!==o.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}}class az{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new Uy(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];return void 0!==o.sheenColorFactor&&t.sheenColor.fromArray(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&(t.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Tv)),void 0!==o.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}}class lz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];return void 0!==o.transmissionFactor&&(t.transmission=o.transmissionFactor),void 0!==o.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}}class cz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];t.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const s=o.attenuationColor||[1,1,1];return t.attenuationColor=new Uy(s[0],s[1],s[2]),Promise.all(i)}}class uz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class dz{constructor(e){this.parser=e,this.name=tz.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?BE:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],o=r.extensions[this.name];t.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const s=o.specularColorFactor||[1,1,1];return t.specularColor=new Uy(s[0],s[1],s[2]),void 0!==o.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Tv)),Promise.all(i)}}class hz{constructor(e){this.parser=e,this.name=tz.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class pz{constructor(e){this.parser=e,this.name=tz.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],s=r.images[o.source];let a=n.textureLoader;if(s.uri){const e=n.options.manager.getHandler(s.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,o.source,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class fz{constructor(e){this.name=tz.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,o=e.count,s=e.byteStride,a=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(o,s,a,e.mode,e.filter).then((function(e){return e.buffer})):i.ready.then((function(){const t=new ArrayBuffer(o*s);return i.decodeGltfBuffer(new Uint8Array(t),o,s,a,e.mode,e.filter),t}))}))}return null}}const mz="glTF",gz=1313821514,vz=5130562;class yz{constructor(e){this.name=tz.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:VT.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==mz)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,n===gz){const n=new Uint8Array(e,12+i,t);this.content=VT.decodeText(n)}else if(n===vz){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class bz{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=tz.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},a={},l={};for(const e in o){const t=zz[e]||e.toLowerCase();s[t]=o[e]}for(const t in e.attributes){const r=zz[t]||t.toLowerCase();if(void 0!==o[t]){const i=n.accessors[e.attributes[t]],o=kz[i.componentType];l[r]=o.name,a[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=a[t];void 0!==r&&(n.normalized=r)}t(e)}),s,l)}))}))}}class Sz{constructor(){this.name=tz.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class xz extends DE{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),i=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),s={specular:{value:(new Uy).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(const t in s)e.uniforms[t]=s[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",i).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class _z{constructor(){this.name=tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return xz}extendParams(e,t,n){const r=t.extensions[this.name];e.color=new Uy(1,1,1),e.opacity=1;const i=[];if(Array.isArray(r.diffuseFactor)){const t=r.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture,Tv)),e.emissive=new Uy(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new Uy(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const t=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",t)),i.push(n.assignTexture(e,"specularMap",t,Tv))}return Promise.all(i)}createMaterial(e){const t=new xz(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=Rv,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class wz{constructor(){this.name=tz.KHR_MESH_QUANTIZATION}}class Cz extends QE{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,l=3*s,c=r-t,u=(n-t)/c,d=u*u,h=d*u,p=e*l,f=p-l,m=-2*h+3*d,g=h-d,v=1-m,y=g-d+u;for(let e=0;e!==s;e++){const t=o[f+e+s],n=o[f+e+a]*c,r=o[p+e+s],l=o[p+e]*c;i[e]=v*t+y*n+m*r+g*l}return i}}const Az=new eb;class Ez extends Cz{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return Az.fromArray(i).normalize().toArray(i),i}}const Tz=0,Iz=1,Mz=2,Rz=3,Pz=4,Nz=5,Oz=6,kz={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Lz={9728:ag,9729:hg,9984:lg,9985:pg,9986:ug,9987:mg},Dz={33071:og,33648:sg,10497:ig},Bz={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zz={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Fz={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Uz={CUBICSPLINE:void 0,LINEAR:gv,STEP:mv},jz="OPAQUE",Hz="MASK",Gz="BLEND";function Vz(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Wz(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function qz(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Kz(e){const t=e.extensions&&e.extensions[tz.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+Jz(t.attributes):e.indices+":"+Jz(e.attributes)+":"+e.mode,n}function Jz(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function Yz(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class Xz{constructor(e={},t={}){var n,r;this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ez,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const i="undefined"!=typeof navigator&&!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o="undefined"!=typeof navigator&&(null===(n=navigator.userAgent)||void 0===n?void 0:n.indexOf("Firefox"))>-1,s="undefined"!=typeof navigator&&o?null===(r=navigator.userAgent)||void 0===r?void 0:r.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||o&&s<98?this.textureLoader=new wT(this.options.manager):this.textureLoader=new QT(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new vT(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const o={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Vz(i,o,r),Wz(o,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(o)}))).then((function(){e(o)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[tz.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load(VT.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],o=Bz[r.type],s=kz[r.componentType],a=s.BYTES_PER_ELEMENT,l=a*o,c=r.byteOffset||0,u=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let h,p;if(u&&u!==l){const e=Math.floor(c/u),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(h=new s(i,e*u,r.count*u/a),l=new iC(h,u/a),t.cache.add(n,l)),p=new sC(l,o,c%u/a,d)}else h=null===i?new s(r.count*o):new s(i,c,r.count*o),p=new SS(h,o,d);if(void 0!==r.sparse){const t=Bz.SCALAR,n=kz[r.sparse.indices.componentType],a=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,c=new n(e[1],a,r.sparse.count*t),u=new s(e[2],l,r.sparse.count*o);null!==i&&(p=new SS(p.array.slice(),p.itemSize,p.normalized));for(let e=0,t=c.length;e<t;e++){const t=c[e];if(p.setX(t,u[e*o]),o>=2&&p.setY(t,u[e*o+1]),o>=3&&p.setZ(t,u[e*o+2]),o>=4&&p.setW(t,u[e*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let o=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(o=e)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,n){const r=this,i=this.json,o=i.textures[e],s=i.images[t],a=(s.uri||s.bufferView)+":"+o.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,o.name&&(t.name=o.name);const n=(i.samplers||{})[o.sampler]||{};return t.magFilter=Lz[n.magFilter]||hg,t.minFilter=Lz[n.minFilter]||mg,t.wrapS=Dz[n.wrapS]||ig,t.wrapT=Dz[n.wrapT]||ig,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const i=n.images[e],o=self.URL||self.webkitURL;let s=i.uri||"",a=!1;if(void 0!==i.bufferView)s=this.getDependency("bufferView",i.bufferView).then((function(e){a=!0;const t=new Blob([e],{type:i.mimeType});return s=o.createObjectURL(t),s}));else if(void 0===i.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(s).then((function(e){return new Promise((function(n,i){let o=n;!0===t.isImageBitmapLoader&&(o=function(e){const t=new qy(e);t.needsUpdate=!0,n(t)}),t.load(VT.resolveURL(e,r.path),o,void 0,i)}))})).then((function(e){var t;return!0===a&&o.revokeObjectURL(s),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e}));return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(o){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[tz.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[tz.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(o);o=i.extensions[tz.KHR_TEXTURE_TRANSFORM].extendTexture(o,e),i.associations.set(o,t)}}return void 0!==r&&(o.encoding=r),e[t]=o,o}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,o=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new eA,gS.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new GC,gS.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(r||i||o){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),o&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return DE}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let o;const s={},a=i.extensions||{},l=[];if(a[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=r[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=e.getMaterialType(),l.push(e.extendParams(s,i,t))}else if(a[tz.KHR_MATERIALS_UNLIT]){const e=r[tz.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),l.push(e.extendParams(s,i,t))}else{const n=i.pbrMetallicRoughness||{};if(s.color=new Uy(1,1,1),s.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;s.color.fromArray(e),s.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(s,"map",n.baseColorTexture,Tv)),s.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,s.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(s,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(s,"roughnessMap",n.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===i.doubleSided&&(s.side=hm);const c=i.alphaMode||jz;if(c===Gz?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===Hz&&(s.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&o!==vS&&(l.push(t.assignTexture(s,"normalMap",i.normalTexture)),s.normalScale=new Cy(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;s.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&o!==vS&&(l.push(t.assignTexture(s,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(s.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&o!==vS&&(s.emissive=(new Uy).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&o!==vS&&l.push(t.assignTexture(s,"emissiveMap",i.emissiveTexture,Tv)),Promise.all(l).then((function(){let n;return n=o===xz?r[tz.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new o(s),i.name&&(n.name=i.name),Wz(n,i),t.associations.set(n,{materials:e}),i.extensions&&Vz(r,n,i),n}))}createUniqueName(e){const t=II.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[tz.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return Zz(n,e,t)}))}const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n],a=Kz(s),l=r[a];if(l)o.push(l.promise);else{let e;e=s.extensions&&s.extensions[tz.KHR_DRACO_MESH_COMPRESSION]?i(s):Zz(new zS,s,t),r[a]={primitive:s,promise:e},o.push(e)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],o=i.primitives,s=[];for(let e=0,t=o.length;e<t;e++){const t=void 0===o[e].material?(void 0===(a=this.cache).DefaultMaterial&&(a.DefaultMaterial=new DE({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:um})),a.DefaultMaterial):this.getDependency("material",o[e].material);s.push(t)}var a;return s.push(t.loadGeometries(o)),Promise.all(s).then((function(n){const s=n.slice(0,n.length-1),a=n[n.length-1],l=[];for(let n=0,c=a.length;n<c;n++){const c=a[n],u=o[n];let d;const h=s[n];if(u.mode===Pz||u.mode===Nz||u.mode===Oz||void 0===u.mode)d=!0===i.isSkinnedMesh?new PC(c,h):new nx(c,h),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),u.mode===Nz?d.geometry=$z(d.geometry,Cv):u.mode===Oz&&(d.geometry=$z(d.geometry,Av));else if(u.mode===Iz)d=new ZC(c,h);else if(u.mode===Rz)d=new YC(c,h);else if(u.mode===Mz)d=new $C(c,h);else{if(u.mode!==Tz)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);d=new oA(c,h)}Object.keys(d.geometry.morphAttributes).length>0&&qz(d,i),d.name=t.createUniqueName(i.name||"mesh_"+e),Wz(d,i),u.extensions&&Vz(r,d,u),t.assignFinalMaterial(d),l.push(d)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const c=new qw;t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new ux(wy.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new kx(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Wz(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],r=[],i=[],o=[],s=[];for(let e=0,a=t.channels.length;e<a;e++){const a=t.channels[e],l=t.samplers[a.sampler],c=a.target,u=c.node,d=void 0!==t.parameters?t.parameters[l.input]:l.input,h=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",d)),i.push(this.getDependency("accessor",h)),o.push(l),s.push(c)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(i),Promise.all(o),Promise.all(s)]).then((function(n){const r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=i[e],c=o[e],u=s[e],d=a[e];if(void 0===t)continue;let h;switch(t.updateMatrix(),Fz[d.path]){case Fz.weights:h=iT;break;case Fz.rotation:h=sT;break;default:h=lT}const p=t.name?t.name:t.uuid,f=void 0!==u.interpolation?Uz[u.interpolation]:gv,m=[];Fz[d.path]===Fz.weights?t.traverse((function(e){e.morphTargetInfluences&&m.push(e.name?e.name:e.uuid)})):m.push(p);let g=c.array;if(c.normalized){const e=Yz(g.constructor),t=new Float32Array(g.length);for(let n=0,r=g.length;n<r;n++)t[n]=g[n]*e;g=t}for(let e=0,t=m.length;e<t;e++){const t=new h(m[e]+"."+Fz[d.path],n.array,g,f);"CUBICSPLINE"===u.interpolation&&(t.createInterpolant=function(e){return new(this instanceof sT?Ez:Cz)(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const c=t.name?t.name:"animation_"+e;return new cT(c,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,r=this,i=t.nodes[e],o=i.name?r.createUniqueName(i.name):"";return function(){const t=[],n=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return n&&t.push(n),void 0!==i.camera&&t.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let s;if(s=!0===i.isBone?new NC:t.length>1?new qw:1===t.length?t[0]:new rS,s!==t[0])for(let e=0,n=t.length;e<n;e++)s.add(t[e]);if(i.name&&(s.userData.name=i.name,s.name=o),Wz(s,i),i.extensions&&Vz(n,s,i),void 0!==i.matrix){const e=new Nb;e.fromArray(i.matrix),s.applyMatrix4(e)}else void 0!==i.translation&&s.position.fromArray(i.translation),void 0!==i.rotation&&s.quaternion.fromArray(i.rotation),void 0!==i.scale&&s.scale.fromArray(i.scale);return r.associations.has(s)||r.associations.set(s,{}),r.associations.get(s).nodes=e,s}))}loadScene(e){const t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,o=new qw;r.name&&(o.name=i.createUniqueName(r.name)),Wz(o,r),r.extensions&&Vz(n,o,r);const s=r.nodes||[],a=[];for(let e=0,n=s.length;e<n;e++)a.push(Qz(s[e],o,t,i));return Promise.all(a).then((function(){return i.associations=(e=>{const t=new Map;for(const[e,n]of i.associations)(e instanceof gS||e instanceof qy)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(o),o}))}}function Qz(e,t,n,r){const i=n.nodes[e];return r.getDependency("node",e).then((function(e){if(void 0===i.skin)return e;let t;return r.getDependency("skin",i.skin).then((function(e){t=e;const n=[];for(let e=0,i=t.joints.length;e<i;e++)n.push(r.getDependency("node",t.joints[e]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const r=[],i=[];for(let e=0,o=n.length;e<o;e++){const o=n[e];if(o){r.push(o);const n=new Nb;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),i.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new DC(r,i),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const o=[];if(i.children){const t=i.children;for(let i=0,s=t.length;i<s;i++){const s=t[i];o.push(Qz(s,e,n,r))}}return Promise.all(o)}))}function Zz(e,t,n){const r=t.attributes,i=[];function o(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const t in r){const n=zz[t]||t.toLowerCase();n in e.attributes||i.push(o(r[t],n))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return Wz(e,t),function(e,t,n){const r=t.attributes,i=new ib;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,o=e.max;if(void 0===t||void 0===o)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new tb(t[0],t[1],t[2]),new tb(o[0],o[1],o[2])),e.normalized){const t=Yz(kz[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const o=t.targets;if(void 0!==o){const e=new tb,t=new tb;for(let r=0,i=o.length;r<i;r++){const i=o[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],o=r.min,s=r.max;if(void 0!==o&&void 0!==s){if(t.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),t.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),t.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),r.normalized){const e=Yz(kz[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const s=new wb;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=s}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,o=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),void 0!==n.COLOR_0&&(o=!0),r&&i&&o)break}if(!r&&!i&&!o)return Promise.resolve(e);const s=[],a=[],l=[];for(let c=0,u=t.length;c<u;c++){const u=t[c];if(r){const t=void 0!==u.POSITION?n.getDependency("accessor",u.POSITION):e.attributes.position;s.push(t)}if(i){const t=void 0!==u.NORMAL?n.getDependency("accessor",u.NORMAL):e.attributes.normal;a.push(t)}if(o){const t=void 0!==u.COLOR_0?n.getDependency("accessor",u.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(l)]).then((function(t){const n=t[0],s=t[1],a=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=s),o&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function $z(e,t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(t===Av)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=e.clone();return o.setIndex(i),o}let eF=null;function tF(e,t,n){return r=>{n&&n(r),e&&(eF||(eF=new YB),eF.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),r.setDRACOLoader(eF)),t&&r.setMeshoptDecoder(ZB())}}function nF(e,t=!0,n=!0,r){return rB($B,e,tF(t,n,r))}var rF,iF;nF.preload=(e,t=!0,n=!0,r)=>rB.preload($B,e,tF(t,n,r)),nF.clear=e=>rB.clear($B,e),(iF=rF||(rF={})).LOADING="LOADING",iF.EMOTION="EMOTION",iF.IDLE="IDLE";const oF=new tb(0,-1,0),sF=new Hb(.175,0,0),aF=new tb(0,-1.45,0),lF={MALE:"https://assets.memori.ai/api/v2/asset/2c5e88a4-cf62-408b-9ef0-518b099dfcb2.glb",FEMALE:"https://assets.memori.ai/api/v2/asset/2adc934b-24b2-45bd-94ad-ffec58d3cb32.glb"},cF={minInterval:1e3,maxInterval:5e3,blinkDuration:150},uF={fadeInDuration:.8,fadeOutDuration:.8,idleCount:5,timeScale:1};class dF{constructor(e,t,n=uF){this.currentState=rF.LOADING,this.currentAction=null,this.lastIdleIndex=-1,this.isTransitioning=!1,this.currentIdleLoopCount=0,this.MAX_IDLE_LOOPS=5,this.lastAnimationTime=0,this.isChatAlreadyStarted=!1,this.mixer=e,this.actions=t,this.config=n}checkForLoop(){if(!this.currentAction||this.currentState!==rF.IDLE)return;this.currentAction.getClip();const e=this.currentAction.time;e<this.lastAnimationTime&&(this.currentIdleLoopCount++,this.currentIdleLoopCount>=this.MAX_IDLE_LOOPS&&this.forceIdleChange()),this.lastAnimationTime=e}forceIdleChange(){this.currentIdleLoopCount=0,this.lastAnimationTime=0,this.transitionTo(rF.IDLE)}getNextIdleAnimation(){let e;do{e=Math.floor(Math.random()*this.config.idleCount)+1}while(e===this.lastIdleIndex);this.isChatAlreadyStarted&&3===e&&(e=4!==this.lastIdleIndex?4:2),this.lastIdleIndex=e;const t=this.actions[`Idle${e}`];if(!t)throw new Error(`Idle animation ${e} not found`);return t}transitionTo(e,t){if(!this.isTransitioning){this.isTransitioning=!0;try{let n=null;switch(e){case rF.LOADING:n=this.actions[t||"Loading1"],this.currentIdleLoopCount=0,this.lastAnimationTime=0;break;case rF.EMOTION:n=this.actions[t||"Timore1"],this.currentIdleLoopCount=0,this.lastAnimationTime=0;break;case rF.IDLE:n=this.getNextIdleAnimation(),this.currentState!==rF.IDLE&&(this.currentIdleLoopCount=0,this.lastAnimationTime=0)}if(!n)throw new Error(`No animation found for state: ${e}`);this.currentAction&&this.currentAction.fadeOut(this.config.fadeOutDuration),n.reset().fadeIn(this.config.fadeInDuration).play(),n.timeScale=this.config.timeScale,e!==rF.IDLE?(n.setLoop(hv,1),n.clampWhenFinished=!0):n.setLoop(1/0,1/0),this.currentAction=n,this.currentState=e}catch(t){console.error("[AnimationController] Error during animation transition:",t),e!==rF.IDLE&&this.transitionTo(rF.IDLE)}finally{this.isTransitioning=!1}}}update(e){this.currentAction&&(this.checkForLoop(),this.currentState!==rF.IDLE&&this.currentAction.time>=.9*this.currentAction.getClip().duration&&this.transitionTo(rF.IDLE),this.mixer.update(e))}getCurrentState(){return this.currentState}getLoopCount(){return this.currentIdleLoopCount}setTimeScale(e){this.config.timeScale=e,this.currentAction&&(this.currentAction.timeScale=e)}updateIsChatAlreadyStarted(e){this.isChatAlreadyStarted=e}getDebugInfo(){var e;return{currentState:this.currentState,currentIdleIndex:this.lastIdleIndex,loopCount:this.currentIdleLoopCount,currentTime:(null===(e=this.currentAction)||void 0===e?void 0:e.time)||0,lastTime:this.lastAnimationTime,isTransitioning:this.isTransitioning,isChatAlreadyStarted:this.isChatAlreadyStarted}}}class hF{constructor(e){this.currentEmotionValues={},this.previousEmotionKeys=new Set,this.headMesh=e}updateMorphTargets(e,t,n,r,i){if(!this.headMesh.morphTargetDictionary||!this.headMesh.morphTargetInfluences)return;const o=this.calculateBlinkValue(e,i,r),s=new Set(Object.keys(t));Object.entries(this.headMesh.morphTargetDictionary).forEach((([e,i])=>{if("number"!=typeof i)return;let a=0;if(s.has(e)){const n=t[e],r=this.currentEmotionValues[e]||0,i=wy.lerp(r,2.5*n,.3);this.currentEmotionValues[e]=i,a+=i}n&&e===n.name&&(a+=n.weight),"eyesClosed"===e&&r&&(a+=o),a=wy.clamp(a,0,1),this.headMesh.morphTargetInfluences&&(this.headMesh.morphTargetInfluences[i]=wy.lerp(this.headMesh.morphTargetInfluences[i]||0,a,.5))})),this.previousEmotionKeys=s}calculateBlinkValue(e,t,n){if(!n)return 0;let r=0;if(e>=t.nextBlinkTime&&!t.isBlinking&&(t.isBlinking=!0,t.blinkStartTime=e,t.lastBlinkTime=e,t.nextBlinkTime=e+Math.random()*(cF.maxInterval-cF.minInterval)+cF.minInterval),t.isBlinking){const n=(e-t.blinkStartTime)/cF.blinkDuration;n<=.5?r=2*n:n<=1?r=2-2*n:(t.isBlinking=!1,r=0)}return r}}function pF({url:e,sex:t,currentBaseAction:n,timeScale:r,isZoomed:i,eyeBlink:o,updateCurrentViseme:a,setMorphTargetDictionary:l,setMorphTargetInfluences:u,emotionMorphTargets:d}){const{scene:h}=nF(e),{animations:p}=nF(lF[t]),{actions:f}=KB(p,h),m=(0,c.useRef)(),g=(0,c.useRef)(),v=(0,c.useRef)({isBlinking:!1,lastBlinkTime:0,nextBlinkTime:0,blinkStartTime:0}),y=(0,c.useMemo)((()=>{let e;return h.traverse((t=>{t instanceof PC&&("GBNL__Head"===t.name||"Wolf3D_Avatar"===t.name)&&(e=t)})),e}),[h]);return(0,c.useEffect)((()=>{if(!f||!y)return;const e=new NI(h);if(m.current=new dF(e,f,{...uF}),g.current=new hF(y),y.morphTargetDictionary&&y.morphTargetInfluences){l(y.morphTargetDictionary);const e=Object.keys(y.morphTargetDictionary).reduce(((e,t)=>({...e,[t]:0})),{});u(e)}}),[f,y,h,l,u,r]),(0,c.useEffect)((()=>{m.current&&(n.action.startsWith("Loading")?m.current.transitionTo(rF.LOADING,n.action):n.action.startsWith("Idle")?m.current.transitionTo(rF.IDLE):(m.current.updateIsChatAlreadyStarted(!0),m.current.transitionTo(rF.EMOTION,n.action)))}),[n]),(0,c.useEffect)((()=>{var e;null===(e=m.current)||void 0===e||e.setTimeScale(r)}),[r]),eB((e=>{var t;const n=1e3*e.clock.elapsedTime;if(null===(t=m.current)||void 0===t||t.update(e.clock.getDelta()),g.current){const e=a(n/1e3);g.current.updateMorphTargets(n,d,e,o||!1,v.current)}})),(0,s.jsx)("group",{position:i?aF:oF,rotation:sF,children:(0,s.jsx)("primitive",{object:h})})}c=o("85Hg2");const fF=new tb(0,-.6,0),mF=1e3,gF=5e3,vF=150;function yF({url:e,setMorphTargetInfluences:t,setMorphTargetDictionary:n,eyeBlink:r,onLoaded:i,morphTargetSmoothing:o=.5,updateCurrentViseme:a}){const{scene:l}=nF(e),{nodes:u,materials:d}=(h=l,c.useMemo((()=>tB(h)),[h]));var h;const p=(0,c.useRef)(new NI(l)),f=((0,c.useRef)(null),(0,c.useRef)(0)),m=(0,c.useRef)(0),g=(0,c.useRef)(!1),v=(0,c.useRef)(0),y=(0,c.useRef)();return(0,c.useEffect)((()=>(pR(d),l.traverse((e=>{if(e instanceof PC&&("GBNL__Head"===e.name||"Wolf3D_Avatar"===e.name)&&(y.current=e,e.morphTargetDictionary&&e.morphTargetInfluences)){n(e.morphTargetDictionary);const r=Object.keys(e.morphTargetDictionary).reduce(((e,t)=>({...e,[t]:0})),{});t(r)}})),null==i||i(),()=>{Object.values(d).forEach((e=>e.dispose())),Object.values(u).filter(fR).forEach((e=>e.geometry.dispose()))})),[d,u,e,i,l]),eB((e=>{if(y.current&&y.current.morphTargetDictionary&&y.current.morphTargetInfluences){const t=1e3*e.clock.getElapsedTime();let n=0;if(r&&(t>=m.current&&!g.current&&(g.current=!0,v.current=t,f.current=t,m.current=t+Math.random()*(gF-mF)+mF),g.current)){const e=(t-v.current)/vF;e<=.5?n=2*e:e<=1?n=2-2*e:(g.current=!1,n=0)}const i=a(t/1e3);Object.entries(y.current.morphTargetDictionary).forEach((([e,t])=>{if("number"==typeof t){let s=0;i&&e===i.name&&(s+=1.3*i.weight),"eyesClosed"===e&&r&&(s+=n),s=wy.clamp(s,0,1),y.current&&y.current.morphTargetInfluences&&(y.current.morphTargetInfluences[t]=wy.lerp(y.current.morphTargetInfluences[t],s,o))}})),p.current.update(.01)}})),(0,s.jsx)("group",{position:fF,children:(0,s.jsx)("primitive",{object:l})})}const bF={Gioia1:{weight:0},Gioia2:{weight:0},Gioia3:{weight:0},Idle1:{weight:1},Idle2:{weight:0},Idle3:{weight:0},Idle4:{weight:0},Idle5:{weight:0},Rabbia1:{weight:0},Rabbia2:{weight:0},Rabbia3:{weight:0},Sorpresa1:{weight:0},Sorpresa2:{weight:0},Sorpresa3:{weight:0},Timore1:{weight:0},Timore2:{weight:0},Timore3:{weight:0},Tristezza1:{weight:0},Tristezza2:{weight:0},Tristezza3:{weight:0},Loading1:{weight:0},Loading2:{weight:0},Loading3:{weight:0}},SF=({stopProcessing:e,chatEmission:t,showControls:n,animation:r,url:i,sex:o,eyeBlink:a,headMovement:l,speaking:u,halfBody:d,loading:h,isZoomed:p,updateCurrentViseme:f,resetVisemeQueue:m})=>{const[g,v]=(0,c.useState)({action:r||"Idle1",weight:1}),[y,b]=(0,c.useState)({}),[S,x]=(0,c.useState)({}),[_,w]=(0,c.useState)({}),[C,A]=(0,c.useState)(.8),E=(0,c.useCallback)((e=>{if("Loading1"===e||"Loading2"===e||"Loading3"===e)return;const t={Gioia:{Gioria:1},Rabbia:{Rabbia:1},Sorpresa:{Sorpresa:1},Tristezza:{Tristezza:1},Timore:{Timore:1}},n=Object.keys(t).reduce(((e,t)=>(e[t]=0,e)),{}),r=Object.keys(t).find((t=>e.startsWith(t)))||"default",i="default"===r?n:t[r];w((e=>({...n,...i})))}),[]),T=(0,c.useCallback)((e=>{E(e),v({action:e,weight:1})}),[]),I=(0,c.useCallback)((e=>{b((t=>({...t,...e})))}),[]),M=(0,c.useCallback)((e=>{x(e)}),[]),R=(0,c.useCallback)((e=>{A(e)}),[]);return(0,c.useEffect)((()=>{var e,n;const r=(null==t?void 0:t.includes('<output class="memori-emotion">'))?null===(n=null===(e=null==t?void 0:t.split('<output class="memori-emotion">')[1])||void 0===e?void 0:e.split("</output>")[0])||void 0===n?void 0:n.trim():null;if(r){const e=Math.floor(3*Math.random())+1;T(`${r}${e}`)}else{const e=Math.floor(5*Math.random())+1;T(`Idle${3===e?4:e}`)}}),[t]),(0,c.useEffect)((()=>{if(h){const e=Math.floor(3*Math.random())+1;T(`Loading${e}`)}}),[h]),(0,s.jsxs)(s.Fragment,{children:[n&&(0,s.jsx)(qB,{timeScale:C,morphTargetDictionary:S,onBaseActionChange:T,onMorphTargetInfluencesChange:I,onMorphTargetDictionaryChange:M,baseActions:bF,currentBaseAction:g,modifyTimeScale:R}),d?(0,s.jsx)(yF,{url:i,headMovement:l,speaking:u,eyeBlink:a,morphTargetInfluences:y,setMorphTargetInfluences:b,setMorphTargetDictionary:x,updateCurrentViseme:f}):(0,s.jsx)(pF,{url:i,sex:o,resetVisemeQueue:m,eyeBlink:a,currentBaseAction:g,timeScale:C,morphTargetInfluences:y,isZoomed:p,updateCurrentViseme:f,stopProcessing:e,setMorphTargetDictionary:x,setMorphTargetInfluences:b,emotionMorphTargets:_})]})};let xF=0;const _F=t(hD)((e=>(pT.onStart=(t,n,r)=>{e({active:!0,item:t,loaded:n,total:r,progress:(n-xF)/(r-xF)*100})},pT.onLoad=()=>{e({active:!1})},pT.onError=t=>e((e=>({errors:[...e.errors,t]}))),pT.onProgress=(t,n,r)=>{n===r&&(xF=r),e({active:!0,item:t,loaded:n,total:r,progress:(n-xF)/(r-xF)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})));c=o("85Hg2");const wF=new tb,CF=new tb,AF=new tb;function EF(e,t,n){const r=wF.setFromMatrixPosition(e.matrixWorld);r.project(t);const i=n.width/2,o=n.height/2;return[r.x*i+i,-r.y*o+o]}const TF=e=>Math.abs(e)<1e-10?0:e;function IF(e,t,n=""){let r="matrix3d(";for(let n=0;16!==n;n++)r+=TF(t[n]*e.elements[n])+(15!==n?",":")");return n+r}const MF=(RF=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>IF(e,RF));var RF;const PF=(e,t)=>{return IF(e,[1/(n=t),1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1],"translate(-50%,-50%)");var n},NF=c.forwardRef((({children:e,eps:t=.001,style:n,className:r,prepend:i,center:o,fullscreen:s,portal:l,distanceFactor:u,sprite:d=!1,transform:h=!1,occlude:p,onOcclude:f,zIndexRange:m=[16777271,0],calculatePosition:g=EF,as:v="div",wrapperClass:y,pointerEvents:b="auto",...S},x)=>{var _;const w=$D((({gl:e})=>e)),C=$D((({camera:e})=>e)),A=$D((({scene:e})=>e)),E=$D((({size:e})=>e)),T=$D((({raycaster:e})=>e)),[I]=c.useState((()=>document.createElement(v))),M=c.useRef(null),R=c.useRef(0),P=c.useRef([0,0]),N=c.useRef(null),O=c.useRef(null),k=null!==(_=null==l?void 0:l.current)&&void 0!==_?_:w.domElement.parentNode;c.useEffect((()=>{if(M.current){if(A.updateMatrixWorld(),h)I.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const e=g(M.current,C,E);I.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return k&&(i?k.prepend(I):k.appendChild(I)),()=>{k&&k.removeChild(I),a.unmountComponentAtNode(I)}}}),[k,h]),c.useLayoutEffect((()=>{y&&(I.className=y)}),[y]);const L=c.useMemo((()=>h?{position:"absolute",top:0,left:0,width:E.width,height:E.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:o?"translate3d(-50%,-50%,0)":"none",...s&&{top:-E.height/2,left:-E.width/2,width:E.width,height:E.height},...n}),[n,o,s,E,h]),D=c.useMemo((()=>({position:"absolute",pointerEvents:b})),[b]);c.useLayoutEffect((()=>{h?a.render(c.createElement("div",{ref:N,style:L},c.createElement("div",{ref:O,style:D},c.createElement("div",{ref:x,className:r,style:n,children:e}))),I):a.render(c.createElement("div",{ref:x,style:L,className:r,children:e}),I)}));const B=c.useRef(!0);return eB((()=>{if(M.current){C.updateMatrixWorld(),M.current.updateWorldMatrix(!0,!1);const e=h?P.current:g(M.current,C,E);if(h||Math.abs(R.current-C.zoom)>t||Math.abs(P.current[0]-e[0])>t||Math.abs(P.current[1]-e[1])>t){const t=function(e,t){const n=wF.setFromMatrixPosition(e.matrixWorld),r=CF.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),o=t.getWorldDirection(AF);return i.angleTo(o)>Math.PI/2}(M.current,C);let n=!1;"boolean"==typeof p?!0===p&&(n=[A]):Array.isArray(p)&&(n=p.map((e=>e.current)));const r=B.current;if(n){const e=function(e,t,n,r){const i=wF.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),n.setFromCamera(o,t);const s=n.intersectObjects(r,!0);if(s.length){const e=s[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}(M.current,C,T,n);B.current=e&&!t}else B.current=!t;if(r!==B.current&&(f?f(!B.current):I.style.display=B.current?"block":"none"),I.style.zIndex=`${function(e,t,n){if(t instanceof ux||t instanceof kx){const r=wF.setFromMatrixPosition(e.matrixWorld),i=CF.setFromMatrixPosition(t.matrixWorld),o=r.distanceTo(i),s=(n[1]-n[0])/(t.far-t.near),a=n[1]-s*t.far;return Math.round(s*o+a)}}(M.current,C,m)}`,h){const[e,t]=[E.width/2,E.height/2],n=C.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:o,bottom:s,right:a}=C,l=MF(C.matrixWorldInverse),c=r?`scale(${n})translate(${TF(-(a+o)/2)}px,${TF((i+s)/2)}px)`:`translateZ(${n}px)`;let h=M.current.matrixWorld;d&&(h=C.matrixWorldInverse.clone().transpose().copyPosition(h).scale(M.current.scale),h.elements[3]=h.elements[7]=h.elements[11]=0,h.elements[15]=1),I.style.width=E.width+"px",I.style.height=E.height+"px",I.style.perspective=r?"":`${n}px`,N.current&&O.current&&(N.current.style.transform=`${c}${l}translate(${e}px,${t}px)`,O.current.style.transform=PF(h,1/((u||10)/400)))}else{const t=void 0===u?1:function(e,t){if(t instanceof kx)return t.zoom;if(t instanceof ux){const n=wF.setFromMatrixPosition(e.matrixWorld),r=CF.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,o=n.distanceTo(r);return 1/(2*Math.tan(i/2)*o)}return 1}(M.current,C)*u;I.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}P.current=e,R.current=C.zoom}}})),c.createElement("group",pB({},S,{ref:M}))}));var OF=({fallbackImg:e})=>{const{progress:t}=_F();return(0,s.jsx)(NF,{center:!0,className:"avatar-loader",children:(0,s.jsx)(xf,{spinning:!0,children:e?(0,s.jsxs)("figure",{children:[(0,s.jsx)("img",{src:e,alt:`${Math.round(t)}% loaded`,title:`${Math.round(t)}% loaded`}),(0,s.jsx)("figcaption",{children:`${Math.round(t)}%`})]}):(0,s.jsxs)(s.Fragment,{children:[Math.round(t)," % loaded"]})})})};const kF={halfBody:{width:"100%",height:"100%",minHeight:"500px",backgroundColor:"white",borderRadius:"100%"},fullBody:{width:"500px",height:"500px",backgroundColor:"white"}},LF=(e,t)=>e?{fov:40,position:[0,0,.6]}:!e&&t?{fov:44,position:[0,0,1.25]}:{fov:40,position:[0,175e-7,3]},DF=()=>{return"android"===((null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown").toLowerCase()||navigator.userAgent.includes("Android")||$M()?(0,s.jsx)(gB,{distance:100,position:[-.3,.2,1.25],angle:Math.PI/2,attenuation:5,anglePower:5}):(0,s.jsx)(SB,{files:"https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/venice_sunset_1k.hdr"});var e};function BF({url:e,sex:t,style:n,rotateAvatar:r,eyeBlink:i,headMovement:o,speaking:a,fallback:l,fallbackImg:u,halfBody:d=!0,loading:h,animation:p,showControls:f=!1,isZoomed:m,chatEmission:g,stopProcessing:v,resetVisemeQueue:y,updateCurrentViseme:b}){return(0,s.jsx)(QD,{style:n||(d?kF.halfBody:kF.fullBody),camera:LF(d,m),children:(0,s.jsxs)(c.Suspense,{fallback:l||(0,s.jsx)(OF,{fallbackImg:u}),children:[DF(),r&&(0,s.jsx)(RB,{enablePan:!1,enableZoom:!1}),(0,s.jsx)(SF,{url:e,sex:t,showControls:f,loading:h||!1,animation:p,isZoomed:m||!1,eyeBlink:i||!1,headMovement:o||!1,speaking:a||!1,halfBody:d||!1,chatEmission:g,updateCurrentViseme:b,stopProcessing:v,resetVisemeQueue:y})]})})}const zF=(0,(c=o("85Hg2")).createContext)(void 0),FF={0:"viseme_sil",1:"viseme_PP",2:"viseme_FF",3:"viseme_TH",4:"viseme_DD",5:"viseme_kk",6:"viseme_CH",7:"viseme_SS",8:"viseme_nn",9:"viseme_RR",10:"viseme_aa",11:"viseme_E",12:"viseme_I",13:"viseme_O",14:"viseme_U",15:"viseme_kk",16:"viseme_CH",17:"viseme_SS",18:"viseme_TH",19:"viseme_RR",20:"viseme_kk",21:"viseme_PP"},{DEFAULT_VISEME_DURATION:UF,VISEME_OVERLAP:jF,SMOOTHING_FACTOR:HF,LOG_INTERVAL:GF,PRELOAD:VF,WEIGHT_MULTIPLIER:WF}={DEFAULT_VISEME_DURATION:.1,VISEME_OVERLAP:.02,SMOOTHING_FACTOR:.4,LOG_INTERVAL:60,PRELOAD:.5,WEIGHT_MULTIPLIER:.8},qF=(e,t)=>e.endTime<t-jF,KF=e=>Math.sin(Math.PI*Math.min(e,1))*WF,JF=(e,t)=>e+(t-e)*HF,YF=e=>(t,n)=>{console.log(`%c[VisemeContext] ${t}`,{event:"color: #4CAF50; font-weight: bold;",error:"color: #f44336; font-weight: bold;",debug:"color: #2196F3; font-weight: bold;"}[e],n)},XF=YF("event"),QF=YF("error"),ZF=YF("debug"),$F=({children:e})=>{const t=(0,c.useRef)([]),n=(0,c.useRef)(null),r=(0,c.useRef)(null),[i,o]=(0,c.useState)(!1),[a,l]=(0,c.useState)("idle"),u=(0,c.useRef)(null),d=(0,c.useRef)(0),h=(0,c.useRef)(null),p=(0,c.useCallback)((e=>{n.current=e,e.onstatechange=()=>{switch(XF("Audio Context State Change",{state:e.state,currentTime:e.currentTime}),e.state){case"running":l("active");break;case"suspended":l("paused");break;case"closed":l("finished"),g()}}}),[]),f=(0,c.useCallback)(((e,n)=>{if("finished"===a)return;const r=FF[e]||"viseme_sil",i=n/1e7;null===h.current&&(h.current=i);const o=i-(h.current||0),s={name:r,weight:0,startTime:o,endTime:o+UF};t.current.push(s),"idle"===a&&l("preparing")}),[a]),m=(0,c.useCallback)((e=>{e?(n.current=e,r.current=e.currentTime,d.current=0,o(!0),l("active"),XF("Started Processing",{audioTime:e.currentTime,queueLength:t.current.length,state:a})):QF("No audio context provided",{state:a})}),[]),g=(0,c.useCallback)((()=>{o(!1),l("finished"),r.current=null,u.current=null,d.current=0,n.current=null,XF("Stopped Processing",{queueLength:t.current.length,state:a})}),[]),v=(0,c.useCallback)((e=>{if(!i||!n.current)return null;const o=n.current.currentTime-(r.current||0)+VF;t.current=t.current.filter((e=>!qF(e,o)));const s=t.current.find((e=>e.startTime<=o&&e.endTime>o-jF));if(d.current%GF==60&&ZF("Current Viseme",{currentViseme:s,audioTime:o,visemeQueue:t.current}),s){const e=(o-s.startTime)/(s.endTime-s.startTime),t=KF(e),n=u.current?JF(u.current.weight,t):t,r={...s,weight:n};return u.current=r,r}if(u.current){const e=u.current.weight*(1-HF);u.current={...u.current,weight:e}}return u.current=null,null}),[i]),y=(0,c.useCallback)((()=>{t.current=[],u.current=null,r.current=null,h.current=null,d.current=0,l("idle"),XF("Reset Viseme Queue",{previousState:a})}),[a]),b=(0,c.useCallback)((e=>{XF("Reset And Start Processing",{previousState:a,queueLength:t.current.length}),g(),y(),m(e)}),[g,y,m,a]),S=(0,c.useMemo)((()=>({addViseme:f,updateCurrentViseme:v,startProcessing:m,stopProcessing:g,resetAndStartProcessing:b,resetVisemeQueue:y,isProcessing:i,setAudioContext:p})),[f,v,m,g,b,y,i,p]);return(0,s.jsx)(zF.Provider,{value:S,children:e})},eU=()=>{const e=(0,c.useContext)(zF);if(!e)throw new Error("useVisemeContext must be used within a VisemeProvider");return e};var tU=(0,c.memo)((({memori:e,integration:n,integrationConfig:r,tenant:i,instruct:o=!1,avatar3dVisible:a=!1,setAvatar3dVisible:l,hasUserActivatedSpeak:u=!1,isPlayingAudio:d=!1,loading:h=!1,baseUrl:p,apiUrl:f,animation:m,isZoomed:g=!1,chatProps:v})=>{const{t:y}=_e(),[b,S]=(0,c.useState)(!1),{stopProcessing:x,updateCurrentViseme:_,resetVisemeQueue:w}=eU();(0,c.useEffect)((()=>{S(!0)}),[]);const C=()=>{if("userAvatar"===(null==r?void 0:r.avatar)&&e.avatarURL&&e.avatarURL.length>0)return xN({type:"avatar",tenantID:null==i?void 0:i.id,resourceURI:e.avatarURL,baseURL:p,apiURL:f})},A=()=>{var t;return b?"readyplayerme"===(null==r?void 0:r.avatar)||"readyplayerme-full"===(null==r?void 0:r.avatar)||"customrpm"===(null==r?void 0:r.avatar)?(0,s.jsx)(aD,{fallback:(0,s.jsx)("div",{className:"memori--blob-container",children:b&&(0,s.jsx)(lD,{speaking:d,avatar:C()})}),children:(0,s.jsx)(BF,{updateCurrentViseme:_,url:r.avatarURL,sex:"FEMALE"===e.voiceType?"FEMALE":"MALE",fallbackImg:C(),headMovement:!0,eyeBlink:!0,animation:m,halfBody:"readyplayerme"===r.avatar,speaking:d,loading:h,style:T(),stopProcessing:x,resetVisemeQueue:w,isZoomed:g,chatEmission:null===(t=null==v?void 0:v.dialogState)||void 0===t?void 0:t.emission})}):"customglb"===(null==r?void 0:r.avatar)?(0,s.jsx)(CL,{poster:C()||"",src:r.avatarURL,alt:""}):null:null},E=()=>(0,s.jsx)("div",{className:"memori--avatar-toggle",children:(0,s.jsx)(_f,{ghost:!0,onClick:()=>l(!a),icon:a?(0,s.jsx)(uD,{}):(0,s.jsx)(cD,{}),children:(0,s.jsx)("span",{className:"memori--avatar-toggle-text",children:y(a?"hide":"show")})})}),T=()=>"readyplayerme"===(null==r?void 0:r.avatar)?{width:"300px",height:"300px",backgroundColor:"none",borderRadius:"100%",boxShadow:"none"}:{width:"100%",height:"100%",backgroundColor:"none"};return(0,s.jsxs)(s.Fragment,{children:["readyplayerme"!==(null==r?void 0:r.avatar)&&"readyplayerme-full"!==(null==r?void 0:r.avatar)&&"customglb"!==(null==r?void 0:r.avatar)&&"customrpm"!==(null==r?void 0:r.avatar)||!(null==r?void 0:r.avatarURL)?(0,s.jsx)("div",{className:"memori--blob-container",children:b&&(0,s.jsx)(lD,{speaking:d,avatar:C()})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:t(ws)("memori--avatar-wrapper",`memori--avatar-${(null==r?void 0:r.avatar)||"default"}`,{hidden:!a}),children:A()}),E()]}),(()=>{if(!o||u||!e.isGiver||!(null==i?void 0:i.id))return null;const t=`https://${i.id}/${"it-IT"===e.culture?"it":"en"}/${e.ownerUserName}/${e.name}/integrations${(null==n?void 0:n.integrationID)?`?integration=${n.integrationID}&openAvatarModal=true`:""}`;return(0,s.jsx)("div",{className:"memori--avatar-link-to-integrations",children:(0,s.jsx)("a",{className:"memori-button memori-button--circle memori-button--outlined",href:t,children:(0,s.jsx)(AN,{content:y("widgetgoToIntegrationsToCustomizeAvatar"),children:(0,s.jsx)("span",{className:"memori-button--icon",children:(0,s.jsx)(dD,{})})})})})})()]})}),((e,t)=>JSON.stringify(e)===JSON.stringify(t)));c=o("85Hg2"),c=o("85Hg2");function nU(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let rU=(0,(c=o("85Hg2")).createContext)(null);function iU(){let e=(0,c.useContext)(rU);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,iU),e}return e}function oU(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=_h((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(rU.Provider,{value:i},e.children)}),[n])]}let sU=gh((function(e,t){let{passive:n=!1,...r}=e,i=iU(),o=`headlessui-label-${kh()}`,s=Ah(t);Sh((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),ph({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));var aU,lU=((aU=lU||{})[aU.RegisterOption=0]="RegisterOption",aU[aU.UnregisterOption=1]="UnregisterOption",aU);let cU={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Zh(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},uU=(0,c.createContext)(null);function dU(e){let t=(0,c.useContext)(uU);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,dU),t}return t}function hU(e,t){return ch(t.type,cU,e,t)}uU.displayName="RadioGroupContext";let pU=gh((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=_h("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[h,p]=(0,c.useReducer)(hU,{options:[]}),f=h.options,[m,g]=oU(),[v,y]=Ep(),b=`headlessui-radiogroup-${kh()}`,S=(0,c.useRef)(null),x=Ah(S,n),[_,w]=AR(r,s,i),C=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),A=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,_)))),[f,_]),E=_h((e=>{var t;if(l||d(e,_))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==w||w(e),!0)}));yR({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=_h((e=>{let t=S.current;if(!t)return;let n=Fh(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Th.Enter:CR(e.currentTarget);break;case Th.ArrowLeft:case Th.ArrowUp:if(e.preventDefault(),e.stopPropagation(),ep(r,Gh.Previous|Gh.WrapAround)===Vh.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Th.ArrowRight:case Th.ArrowDown:if(e.preventDefault(),e.stopPropagation(),ep(r,Gh.Next|Gh.WrapAround)===Vh.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Th.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),I=_h((e=>(p({type:0,...e}),()=>p({type:1,id:e.id})))),M=(0,c.useMemo)((()=>({registerOption:I,firstOption:C,containsCheckedOption:A,change:E,disabled:l,value:_,compare:d})),[I,C,A,E,l,_,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:_})),[_]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(uU.Provider,{value:M},null!=o&&null!=_&&xR({[o]:_}).map((([e,n])=>t(c).createElement(Dh,{features:Lh.Hidden,...vh({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),ph({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var fU=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(fU||{});let mU=gh((function(e,n){let r=(0,c.useRef)(null),i=Ah(r,n),o=`headlessui-radiogroup-option-${kh()}`,[s,a]=oU(),[l,u]=Ep(),{addFlag:d,removeFlag:h,hasFlag:p}=nU(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});Sh((()=>{v.current.value=f}),[f,v]),Sh((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:_,value:w,compare:C}=dU("RadioGroup.Option");Sh((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let A=_h((e=>{var t;if(Ih(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),E=_h((e=>{if(Ih(e.currentTarget))return e.preventDefault();d(2)})),T=_h((()=>h(2))),I=(null==x?void 0:x.id)===o,M=b||m,R=C(w,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!M||void 0,tabIndex:M?-1:R||!_&&I?0:-1,onClick:M?void 0:A,onFocus:M?void 0:E,onBlur:M?void 0:T},N=(0,c.useMemo)((()=>({checked:R,disabled:M,active:p(2)})),[R,M,p]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},ph({ourProps:P,theirProps:g,slot:N,defaultTag:"div",name:"RadioGroup.Option"})))})),gU=Object.assign(pU,{Option:mU,Label:sU,Description:Tp});var vU=({instruct:e,canInstruct:t,onChangeMode:n})=>{const{t:r}=_e();return t?(0,s.jsx)("div",{className:"memori--changeMode-instruct",children:(0,s.jsxs)(gU,{name:"instruct",value:e?"instruct":"test",defaultValue:e?"instruct":"test",className:"memori--changeMode-instruct-radio",onChange:n,children:[(0,s.jsx)(gU.Option,{value:"instruct",className:"memori--changeMode-instruct-radio-button",children:({checked:e})=>(0,s.jsx)(_f,{primary:e,children:r("widget.instruct")||"Instruct"})}),(0,s.jsx)(gU.Option,{value:"test",className:"memori--changeMode-instruct-radio-button",children:({checked:e})=>(0,s.jsx)(_f,{primary:e,children:r("widget.test")||"Test"})})]})}):null};c=o("85Hg2");var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",viewBox:"0 0 40 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M25.085.277c-.264 0-.531.071-.777.236L8.482 10.857H1.161a.716.716 0 00-.715.714V24.43c0 .392.322.714.715.714h7.321l15.826 10.344c.246.16.518.236.777.236.745 0 1.433-.593 1.433-1.433V1.71c0-.84-.688-1.433-1.433-1.433zM23.304 30.99l-13.063-8.54-.803-.522H3.66V14.07h5.777l.799-.522 13.067-8.54V30.99zM39.534 15.148L36.967 18l2.567 2.852a1.09 1.09 0 010 1.427l-1.283 1.426a.845.845 0 01-1.284 0L34.4 20.852l-2.567 2.852a.845.845 0 01-1.283 0l-1.284-1.426a1.09 1.09 0 010-1.426L31.833 18l-2.567-2.852a1.09 1.09 0 010-1.426l1.283-1.427a.845.845 0 011.284 0l2.567 2.853 2.567-2.853a.845.845 0 011.284 0l1.283 1.427a1.09 1.09 0 010 1.426z",fill:"currentColor"})});var bU,SU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"})}),xU=(c=o("85Hg2"),(bU=xU||{})[bU.Open=0]="Open",bU[bU.Closed=1]="Closed",bU),_U=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(_U||{});let wU={0:e=>({...e,popoverState:ch(e.popoverState,{0:1,1:0})}),1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},CU=(0,c.createContext)(null);function AU(e){let t=(0,c.useContext)(CU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,AU),t}return t}CU.displayName="PopoverContext";let EU=(0,c.createContext)(null);function TU(e){let t=(0,c.useContext)(EU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,TU),t}return t}EU.displayName="PopoverAPIContext";let IU=(0,c.createContext)(null);function MU(){return(0,c.useContext)(IU)}IU.displayName="PopoverGroupContext";let RU=(0,c.createContext)(null);function PU(e,t){return ch(t.type,wU,e,t)}RU.displayName="PopoverPanelContext";let NU=gh((function(e,n){var r;let i=`headlessui-popover-button-${kh()}`,o=`headlessui-popover-panel-${kh()}`,s=(0,c.useRef)(null),a=Ah(n,Ch((e=>{s.current=e}))),l=(0,c.useReducer)(PU,{popoverState:1,button:null,buttonId:i,panel:null,panelId:o,beforePanelSentinel:(0,c.createRef)(),afterPanelSentinel:(0,c.createRef)()}),[{popoverState:u,button:d,panel:h,beforePanelSentinel:p,afterPanelSentinel:f},m]=l,g=op(null!=(r=s.current)?r:d);(0,c.useEffect)((()=>m({type:3,buttonId:i})),[i,m]),(0,c.useEffect)((()=>m({type:5,panelId:o})),[o,m]);let v=(0,c.useMemo)((()=>{if(!d||!h)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(d))^Number(null==e?void 0:e.contains(h)))return!0;let e=qh(),t=e.indexOf(d),n=(t+e.length-1)%e.length,r=(t+1)%e.length,i=e[n],o=e[r];return!h.contains(i)&&!h.contains(o)}),[d,h]),y=(0,c.useMemo)((()=>({buttonId:i,panelId:o,close:()=>m({type:1})})),[i,o,m]),b=MU(),S=null==b?void 0:b.registerPopover,x=_h((()=>{var e;return null!=(e=null==b?void 0:b.isFocusWithinPopoverGroup())?e:(null==g?void 0:g.activeElement)&&((null==d?void 0:d.contains(g.activeElement))||(null==h?void 0:h.contains(g.activeElement)))}));(0,c.useEffect)((()=>null==S?void 0:S(y)),[S,y]),sp(null==g?void 0:g.defaultView,"focus",(e=>{var t,n,r,i;0===u&&(x()||!d||!h||null!=(n=null==(t=p.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(i=null==(r=f.current)?void 0:r.contains)&&i.call(r,e.target)||m({type:1}))}),!0),Dp([d,h],((e,t)=>{m({type:1}),Jh(t,Kh.Loose)||(e.preventDefault(),null==d||d.focus())}),0===u);let _=_h((e=>{m({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:d:d;null==t||t.focus()})),w=(0,c.useMemo)((()=>({close:_,isPortalled:v})),[_,v]),C=(0,c.useMemo)((()=>({open:0===u,close:_})),[u,_]),A=e,E={ref:a};return t(c).createElement(CU.Provider,{value:l},t(c).createElement(EU.Provider,{value:w},t(c).createElement(Pp,{value:ch(u,{0:Mp.Open,1:Mp.Closed})},ph({ourProps:E,theirProps:A,slot:C,defaultTag:"div",name:"Popover"}))))})),OU=gh((function(e,n){let[r,i]=AU("Popover.Button"),{isPortalled:o}=TU("Popover.Button"),s=(0,c.useRef)(null),a=`headlessui-focus-sentinel-${kh()}`,l=MU(),u=null==l?void 0:l.closeOthers,d=(0,c.useContext)(RU),h=null!==d&&d===r.panelId,p=Ah(s,n,h?null:e=>e&&i({type:2,button:e})),f=Ah(s,n),m=op(s),g=_h((e=>{var t,n,o;if(h){if(1===r.popoverState)return;switch(e.key){case Th.Space:case Th.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(o=r.button)||o.focus()}}else switch(e.key){case Th.Space:case Th.Enter:e.preventDefault(),e.stopPropagation(),1===r.popoverState&&(null==u||u(r.buttonId)),i({type:0});break;case Th.Escape:if(0!==r.popoverState)return null==u?void 0:u(r.buttonId);if(!s.current||(null==m?void 0:m.activeElement)&&!s.current.contains(m.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}})),v=_h((e=>{h||e.key===Th.Space&&e.preventDefault()})),y=_h((t=>{var n,o;Ih(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=r.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===r.popoverState&&(null==u||u(r.buttonId)),i({type:0}),null==(o=r.button)||o.focus()))})),b=_h((e=>{e.preventDefault(),e.stopPropagation()})),S=0===r.popoverState,x=(0,c.useMemo)((()=>({open:S})),[S]),_=vR(e,s),w=e,C=h?{ref:f,type:_,onKeyDown:g,onClick:y}:{ref:p,id:r.buttonId,type:_,"aria-expanded":e.disabled?void 0:0===r.popoverState,"aria-controls":r.panel?r.panelId:void 0,onKeyDown:g,onKeyUp:v,onClick:y,onMouseDown:b},A=rp(),E=_h((()=>{let e=r.panel;e&&ch(A.current,{[np.Forwards]:()=>ep(e,Gh.First),[np.Backwards]:()=>ep(e,Gh.Last)})}));return t(c).createElement(t(c).Fragment,null,ph({ourProps:C,theirProps:w,slot:x,defaultTag:"button",name:"Popover.Button"}),S&&!h&&o&&t(c).createElement(Dh,{id:a,features:Lh.Focusable,as:"button",type:"button",onFocus:E}))})),kU=dh.RenderStrategy|dh.Static,LU=gh((function(e,t){let[{popoverState:n},r]=AU("Popover.Overlay"),i=Ah(t),o=`headlessui-popover-overlay-${kh()}`,s=Rp(),a=null!==s?s===Mp.Open:0===n;return ph({ourProps:{ref:i,id:o,"aria-hidden":!0,onClick:_h((e=>{if(Ih(e.currentTarget))return e.preventDefault();r({type:1})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",features:kU,visible:a,name:"Popover.Overlay"})})),DU=dh.RenderStrategy|dh.Static,BU=gh((function(e,n){let{focus:r=!1,...i}=e,[o,s]=AU("Popover.Panel"),{close:a,isPortalled:l}=TU("Popover.Panel"),u=`headlessui-focus-sentinel-before-${kh()}`,d=`headlessui-focus-sentinel-after-${kh()}`,h=(0,c.useRef)(null),p=Ah(h,n,(e=>{s({type:4,panel:e})})),f=op(h),m=Rp(),g=null!==m?m===Mp.Open:0===o.popoverState,v=_h((e=>{var t;if(e.key===Th.Escape){if(0!==o.popoverState||!h.current||(null==f?void 0:f.activeElement)&&!h.current.contains(f.activeElement))return;e.preventDefault(),e.stopPropagation(),s({type:1}),null==(t=o.button)||t.focus()}}));(0,c.useEffect)((()=>{var t;e.static||1===o.popoverState&&(null==(t=e.unmount)||t)&&s({type:4,panel:null})}),[o.popoverState,e.unmount,e.static,s]),(0,c.useEffect)((()=>{if(!r||0!==o.popoverState||!h.current)return;let e=null==f?void 0:f.activeElement;h.current.contains(e)||ep(h.current,Gh.First)}),[r,h,o.popoverState]);let y=(0,c.useMemo)((()=>({open:0===o.popoverState,close:a})),[o,a]),b={ref:p,id:o.panelId,onKeyDown:v,onBlur:r&&0===o.popoverState?e=>{var t,n,r,i,a;let l=e.relatedTarget;!l||!h.current||null!=(t=h.current)&&t.contains(l)||(s({type:1}),((null==(r=null==(n=o.beforePanelSentinel.current)?void 0:n.contains)?void 0:r.call(n,l))||(null==(a=null==(i=o.afterPanelSentinel.current)?void 0:i.contains)?void 0:a.call(i,l)))&&l.focus({preventScroll:!0}))}:void 0,tabIndex:-1},S=rp(),x=_h((()=>{let e=h.current;e&&ch(S.current,{[np.Forwards]:()=>{ep(e,Gh.First)},[np.Backwards]:()=>{var e;null==(e=o.button)||e.focus({preventScroll:!0})}})})),_=_h((()=>{let e=h.current;e&&ch(S.current,{[np.Forwards]:()=>{var e,t,n;if(!o.button)return;let r=qh(),i=r.indexOf(o.button),s=r.slice(0,i+1),a=[...r.slice(i+1),...s];for(let r of a.slice())if((null==(t=null==(e=null==r?void 0:r.id)?void 0:e.startsWith)?void 0:t.call(e,"headlessui-focus-sentinel-"))||(null==(n=o.panel)?void 0:n.contains(r))){let e=a.indexOf(r);-1!==e&&a.splice(e,1)}ep(a,Gh.First,!1)},[np.Backwards]:()=>ep(e,Gh.Last)})}));return t(c).createElement(RU.Provider,{value:o.panelId},g&&l&&t(c).createElement(Dh,{id:u,ref:o.beforePanelSentinel,features:Lh.Focusable,as:"button",type:"button",onFocus:x}),ph({ourProps:b,theirProps:i,slot:y,defaultTag:"div",features:DU,visible:g,name:"Popover.Panel"}),g&&l&&t(c).createElement(Dh,{id:d,ref:o.afterPanelSentinel,features:Lh.Focusable,as:"button",type:"button",onFocus:_}))})),zU=gh((function(e,n){let r=(0,c.useRef)(null),i=Ah(r,n),[o,s]=(0,c.useState)([]),a=_h((e=>{s((t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t}))})),l=_h((e=>(s((t=>[...t,e])),()=>a(e)))),u=_h((()=>{var e;let t=Fh(r);if(!t)return!1;let n=t.activeElement;return!(null==(e=r.current)||!e.contains(n))||o.some((e=>{var r,i;return(null==(r=t.getElementById(e.buttonId))?void 0:r.contains(n))||(null==(i=t.getElementById(e.panelId))?void 0:i.contains(n))}))})),d=_h((e=>{for(let t of o)t.buttonId!==e&&t.close()})),h=(0,c.useMemo)((()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:u,closeOthers:d})),[l,a,u,d]),p=(0,c.useMemo)((()=>({})),[]),f=e,m={ref:i};return t(c).createElement(IU.Provider,{value:h},ph({ourProps:m,theirProps:f,slot:p,defaultTag:"div",name:"Popover.Group"}))})),FU=Object.assign(NU,{Button:OU,Overlay:LU,Panel:BU,Group:zU});var UU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})});var jU=({history:e,memori:n,className:r,buttonClassName:i,icon:o,disabled:a=!1,align:l="right",filename:c})=>{const{t:u}=_e(),d=`${u("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(e.map((e=>`${e.fromUser?"YOU":n.name}: ${e.text}`)).join("\n"));return(0,s.jsx)(FU,{title:u("write_and_speak.exportChatHistoryMessage"),className:t(ws)("memori-export-history-button",r,{"memori-export-history-button--align-left":"left"===l}),children:({close:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(FU.Button,{disabled:a,className:t(ws)("memori-button","memori-button--circle","memori-button--icon-only",i,{"memori-button--disabled":a,"memori-button--primary":!a}),children:(0,s.jsx)("div",{className:"memori-button--icon",children:o||(0,s.jsx)(UU,{})})}),(0,s.jsxs)(FU.Panel,{className:"memori-export-history-button--panel",children:[(0,s.jsx)("p",{children:u("write_and_speak.exportChatHistory")}),(0,s.jsx)(_f,{primary:!0,onClick:()=>((e,t="export-chat.txt")=>{const n=new Blob([e],{type:"text/plain"}),r=URL.createObjectURL(n),i=document.createElement("a");i.setAttribute("href",r),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)})(d,c||`${n.name.replace(/\W+/g,"-")}-export-chat.txt`),children:u("yes")||"Yes"}),(0,s.jsx)(_f,{onClick:()=>e(),children:u("no")||"No"})]})]})})};var HU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"})});c=o("85Hg2");var GU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"})});var VU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0 0 75-94 336.64 336.64 0 0 1-108.2 41.2A170.1 170.1 0 0 0 672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 0 0-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 0 1-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 0 1-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"})});var WU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 1 0-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"})});var qU=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M713.5 599.9c-10.9-5.6-65.2-32.2-75.3-35.8-10.1-3.8-17.5-5.6-24.8 5.6-7.4 11.1-28.4 35.8-35 43.3-6.4 7.4-12.9 8.3-23.8 2.8-64.8-32.4-107.3-57.8-150-131.1-11.3-19.5 11.3-18.1 32.4-60.2 3.6-7.4 1.8-13.7-1-19.3-2.8-5.6-24.8-59.8-34-81.9-8.9-21.5-18.1-18.5-24.8-18.9-6.4-.4-13.7-.4-21.1-.4-7.4 0-19.3 2.8-29.4 13.7-10.1 11.1-38.6 37.8-38.6 92s39.5 106.7 44.9 114.1c5.6 7.4 77.7 118.6 188.4 166.5 70 30.2 97.4 32.8 132.4 27.6 21.3-3.2 65.2-26.6 74.3-52.5 9.1-25.8 9.1-47.9 6.4-52.5-2.7-4.9-10.1-7.7-21-13z"}),(0,s.jsx)("path",{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3-41.3-41.3-89.5-73.8-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9-53.3 22.8-101.1 55.2-142 96.5-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9.3 69.4 16.9 138.3 48 199.9v152c0 25.4 20.6 46 46 46h152.1c61.6 31.1 130.5 47.7 199.9 48h2.1c59.9 0 118-11.6 172.7-34.3 53.5-22.3 101.6-54.3 142.8-95.2 41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})]});var KU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0 0 68.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"})});var JU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"})});var YU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});var XU,QU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{fill:"currentColor",d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"})}),ZU=(c=o("85Hg2"),Object.defineProperty),$U=Object.getOwnPropertySymbols,ej=Object.prototype.hasOwnProperty,tj=Object.prototype.propertyIsEnumerable,nj=(e,t,n)=>t in e?ZU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rj=(e,t)=>{for(var n in t||(t={}))ej.call(t,n)&&nj(e,n,t[n]);if($U)for(var n of $U(t))tj.call(t,n)&&nj(e,n,t[n]);return e},ij=(e,t)=>{var n={};for(var r in e)ej.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&$U)for(var r of $U(e))t.indexOf(r)<0&&tj.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(r);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,r){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,n,i=1,s=40,l=-1,c=!0){if(!(t.MIN_VERSION<=i&&i<=s&&s<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let u,d;for(u=i;;u++){const r=8*t.getNumDataCodewords(u,n),i=a.getTotalBits(e,u);if(i<=r){d=i;break}if(u>=s)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(u),h);for(const e of t.getData())h.push(e)}o(h.length==d);const p=8*t.getNumDataCodewords(u,n);o(h.length<=p),r(0,Math.min(4,p-h.length),h),r(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)r(e,8,h);let f=[];for(;8*f.length<h.length;)f.push(0);return h.forEach(((e,t)=>f[t>>>3]|=e<<7-(7&t))),new t(u,n,f,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);o(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(r,e));this.setFunctionModule(8,7,i(r,6)),this.setFunctionModule(8,8,i(r,7)),this.setFunctionModule(7,8,i(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),r=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(r,o,n),this.setFunctionModule(o,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),l=i-a%i,c=Math.floor(a/i);let u=[];const d=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<i;n++){let i=e.slice(r,r+c-s+(n<l?0:1));r+=i.length;const o=t.reedSolomonComputeRemainder(i,d);n<l&&i.push(0),u.push(i.concat(o))}let h=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=c-s||n>=l)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const s=t-o,a=0==(t+1&2)?this.size-1-r:r;!this.isFunction[a][s]&&n<8*e.length&&(this.modules[a][s]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*r)/r)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const i of e){const e=i^r.shift();r.push(0),n.forEach(((n,i)=>r[i]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const s=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new s(s.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!s.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);r(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new s(s.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!s.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(i,11,n)}return t<e.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new s(s.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:s.isNumeric(e)?[s.makeNumeric(e)]:s.isAlphanumeric(e)?[s.makeAlphanumeric(e)]:[s.makeBytes(s.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new s(s.Mode.ECI,0,t)}static isNumeric(e){return s.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return s.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=s;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(XU||(XU={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(XU||(XU={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(XU||(XU={}));var oj=XU,sj={L:oj.QrCode.Ecc.LOW,M:oj.QrCode.Ecc.MEDIUM,Q:oj.QrCode.Ecc.QUARTILE,H:oj.QrCode.Ecc.HIGH},aj=128,lj="L",cj="#FFFFFF",uj="#000000",dj=!1;
254
254
  /**
255
255
  * @license qrcode.react
256
256
  * Copyright (c) Paul O'Shannessy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memori.ai/memori-webcomponent",
3
- "version": "7.8.5",
3
+ "version": "7.8.6",
4
4
  "description": "WebComponent to integrate a Memori in your app or website",
5
5
  "author": "Memori Srl",
6
6
  "source": "src/index.tsx",
@@ -219,7 +219,7 @@
219
219
  "util": "^0.12.3"
220
220
  },
221
221
  "dependencies": {
222
- "@memori.ai/memori-react": "^7.8.5",
222
+ "@memori.ai/memori-react": "^7.8.6",
223
223
  "react": "17.0.2",
224
224
  "react-dom": "17.0.2"
225
225
  }