@adriansteffan/reactive 0.2.2 → 0.2.4
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/dist/{mod-CZYkml9p.js → mod-Cx6xH-XQ.js} +374 -373
- package/dist/mod.d.ts +2 -0
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +3 -3
- package/dist/{web-Ce2dHghr.js → web-BTzxclIT.js} +1 -1
- package/dist/{web-BVQpCNK1.js → web-DQBLwBB7.js} +1 -1
- package/package.json +1 -1
- package/src/components/upload.tsx +7 -6
- package/src/utils/common.ts +4 -2
- package/src/utils/upload.ts +9 -10
package/dist/reactive.umd.js
CHANGED
|
@@ -10145,11 +10145,11 @@
|
|
|
10145
10145
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10146
10146
|
* See the License for the specific language governing permissions and
|
|
10147
10147
|
* limitations under the License.
|
|
10148
|
-
*/var Yre=st,w2=Qre,Xre=Jre;Yre(w2,"factory",Xre);var ene=w2;const tne=Ga(ene),Rs=new Uint32Array(1);function sne(i){return Rs[0]=i,Rs[0]=(Rs[0]<<16|Rs[0]>>16)>>>0,Rs[0]=(Rs[0]&1431655765)<<1|(Rs[0]&2863311530)>>>1>>>0,Rs[0]=(Rs[0]&858993459)<<2|(Rs[0]&3435973836)>>>2>>>0,Rs[0]=(Rs[0]&252645135)<<4|(Rs[0]&4042322160)>>>4>>>0,Rs[0]=(Rs[0]&16711935)<<8|(Rs[0]&4278255360)>>>8>>>0,Rs[0]*23283064365386963e-26}function ine(i,e){let t=1,s=0;for(;i>0;)t/=e,s+=t*(i%e),i=~~(i/e);return s}const rne=(i,e=[2,3])=>Array.from({length:i},(t,s)=>e.map(r=>r===2?sne(s):ine(s,r)));K.normal=GC,K.poisson=wb,K.uniform=Db;function nne(i){const e=t$.factory({seed:i});K.normal=GC.factory({prng:e.normalized}),K.poisson=wb.factory({prng:e.normalized}),K.uniform=Db.factory({prng:e.normalized}),Math.random=()=>K.uniform(0,1)}function x2(i){return Math.max(1e-10,Math.min(1-1e-10,i))}function bm(i){switch(i.distribution){case"uniform":return e=>i.min+e*(i.max-i.min);case"normal":return e=>fZ(x2(e),i.mean,i.sd);case"poisson":return e=>tne(x2(e),i.mean);case"integer":return e=>Math.floor(i.min+e*(i.max-i.min+1));case"discrete":{const e=i.outcomes.reduce((s,r)=>s+r.weight,0),t=i.outcomes.map((()=>{let s=0;return r=>(s+=r.weight/e,s)})());return s=>{for(let r=0;r<t.length;r++)if(s<t[r])return i.outcomes[r].value;return i.outcomes[i.outcomes.length-1].value}}}}function E2(i,e){const t=e.map(bm);return e.length===1?i.map(s=>t[0](s[0])):i.map(s=>s.map((r,n)=>t[n](r)))}const ane=[[1,0,[1]],[2,1,[1,1]],[3,1,[1,3,7]],[3,2,[1,1,5]],[4,1,[1,3,1,1]],[4,4,[1,1,3,7]],[5,2,[1,3,3,9,9]],[5,13,[1,3,7,13,3]],[5,7,[1,1,5,11,27]],[5,14,[1,3,5,1,15]],[5,11,[1,1,7,3,29]],[5,4,[1,3,7,7,21]],[6,1,[1,1,1,9,23,37]],[6,16,[1,3,3,5,19,33]],[6,13,[1,1,3,13,11,7]],[6,22,[1,1,7,13,25,5]],[6,19,[1,3,5,11,7,11]],[6,25,[1,1,1,3,13,39]],[7,1,[1,3,1,15,17,63,13]],[7,32,[1,1,5,5,1,59,33]]],ho=32,one=2**ho;function lne(i){const e=new Uint32Array(ho);if(i===0){for(let n=0;n<ho;n++)e[n]=1<<ho-1-n;return e}const[t,s,r]=ane[i-1];for(let n=0;n<t;n++)e[n]=r[n]<<ho-1-n;for(let n=t;n<ho;n++){e[n]=e[n-t]^e[n-t]>>>t;for(let a=1;a<t;a++)s>>>t-1-a&1&&(e[n]^=e[n-a])}return e}function une(i,e){if(e<1||e>21)throw new RangeError("sobol() supports 1-21 dimensions");const t=Array.from({length:e},(n,a)=>lne(a)),s=new Uint32Array(e),r=[new Array(e).fill(0)];for(let n=1;n<i;n++){let a=0,o=n-1;for(;(o&1)===1;)o>>>=1,a++;for(let l=0;l<e;l++)s[l]^=t[l][a];r.push(Array.from(s,l=>l/one))}return r}const hne=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73],V2=6;function S2(i,e){const t=une(i+1,e.length).slice(1);return E2(t,e)}function T2(i,e){e.length>V2&&console.warn(`Halton sequence quality degrades above ${V2} dimensions. Consider using sobol() instead.`);const t=hne.slice(0,e.length),s=rne(i+1,t).slice(1);return E2(s,e)}function cne(i,e,t){const s=Object.keys(t),r=s.map(a=>t[a]);let n;switch(i){case"sobol":n=S2(e,r);break;case"halton":n=T2(e,r);break;case"random":n=dne(e,r);break}return Array.from({length:e},(a,o)=>{const l=s.length===1?[n[o]]:n[o];return{index:o,...Object.fromEntries(s.map((u,h)=>[u,l[h]]))}})}function dne(i,e){const t=e.map(bm);return e.length===1?Array.from({length:i},()=>t[0](K.uniform(0,1))):Array.from({length:i},()=>t.map(s=>s(K.uniform(0,1))))}function pne(i){return bm(i)(K.uniform(0,1))}function P2(i,e=1,t={}){const{replace:s=!0}=t;if(i.length===0)return[];if(s){const a=[];for(let o=0;o<e;o++){const l=Math.floor(K.uniform(0,1)*i.length);a.push(i[l])}return a}const r=[];let n=[];for(let a=0;a<e;a++)n.length===0&&(n=sc(i)),r.push(n.pop());return r}function sc(i){const e=[...i];for(let t=e.length-1;t>=0;t--){const s=Math.floor(K.uniform(0,1)*(t+1));[e[t],e[s]]=[e[s],e[t]]}return e}function I2(i,e){return e(i)}function R2(i,e){const t=Math.ceil(i.length/e);return Array.from({length:Math.ceil(i.length/t)},(s,r)=>i.slice(r*t,r*t+t))}function A2(i){return i.length===0?0:i.reduce((e,t)=>e+t,0)/i.length}function L2(i){return i.reduce((e,t)=>e+t,0)}function fne(){typeof Array.prototype.sample!="function"&&(Array.prototype.sample=function(i,e){return P2(this,i,e)}),typeof Array.prototype.shuffle!="function"&&(Array.prototype.shuffle=function(){return sc(this)}),typeof Array.prototype.pipe!="function"&&(Array.prototype.pipe=function(i){return I2(this,i)}),typeof Array.prototype.mean!="function"&&(Array.prototype.mean=function(){return A2(this)}),typeof Array.prototype.sum!="function"&&(Array.prototype.sum=function(){return L2(this)}),typeof Array.prototype.chunk!="function"&&(Array.prototype.chunk=function(i){return R2(this,i)})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var co;(function(i){i.Unimplemented="UNIMPLEMENTED",i.Unavailable="UNAVAILABLE"})(co||(co={}));class wm extends Error{constructor(e,t,s){super(e),this.message=e,this.code=t,this.data=s}}const mne=i=>{var e,t;return i!=null&&i.androidBridge?"android":!((t=(e=i==null?void 0:i.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},gne=i=>{const e=i.CapacitorCustomPlatform||null,t=i.Capacitor||{},s=t.Plugins=t.Plugins||{},r=()=>e!==null?e.name:mne(i),n=()=>r()!=="web",a=c=>{const d=u.get(c);return!!(d!=null&&d.platforms.has(r())||o(c))},o=c=>{var d;return(d=t.PluginHeaders)===null||d===void 0?void 0:d.find(f=>f.name===c)},l=c=>i.console.error(c),u=new Map,h=(c,d={})=>{const f=u.get(c);if(f)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),f.proxy;const y=r(),v=o(c);let m;const g=async()=>(!m&&y in d?m=typeof d[y]=="function"?m=await d[y]():m=d[y]:e!==null&&!m&&"web"in d&&(m=typeof d.web=="function"?m=await d.web():m=d.web),m),b=(P,O)=>{var D,$;if(v){const Q=v==null?void 0:v.methods.find(_=>O===_.name);if(Q)return Q.rtype==="promise"?_=>t.nativePromise(c,O.toString(),_):(_,B)=>t.nativeCallback(c,O.toString(),_,B);if(P)return(D=P[O])===null||D===void 0?void 0:D.bind(P)}else{if(P)return($=P[O])===null||$===void 0?void 0:$.bind(P);throw new wm(`"${c}" plugin is not implemented on ${y}`,co.Unimplemented)}},x=P=>{let O;const D=(...$)=>{const Q=g().then(_=>{const B=b(_,P);if(B){const H=B(...$);return O=H==null?void 0:H.remove,H}else throw new wm(`"${c}.${P}()" is not implemented on ${y}`,co.Unimplemented)});return P==="addListener"&&(Q.remove=async()=>O()),Q};return D.toString=()=>`${P.toString()}() { [capacitor code] }`,Object.defineProperty(D,"name",{value:P,writable:!1,configurable:!1}),D},I=x("addListener"),L=x("removeListener"),A=(P,O)=>{const D=I({eventName:P},O),$=async()=>{const _=await D;L({eventName:P,callbackId:_},O)},Q=new Promise(_=>D.then(()=>_({remove:$})));return Q.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await $()},Q},k=new Proxy({},{get(P,O){switch(O){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return v?A:I;case"removeListener":return L;default:return x(O)}}});return s[c]=k,u.set(c,{name:c,proxy:k,platforms:new Set([...Object.keys(d),...v?[y]:[]])}),k};return t.convertFileSrc||(t.convertFileSrc=c=>c),t.getPlatform=r,t.handleError=l,t.isNativePlatform=n,t.isPluginAvailable=a,t.registerPlugin=h,t.Exception=wm,t.DEBUG=!!t.DEBUG,t.isLoggingEnabled=!!t.isLoggingEnabled,t},Ca=(i=>i.Capacitor=gne(i))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ol=Ca.registerPlugin;class ic{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let s=!1;this.listeners[e]||(this.listeners[e]=[],s=!0),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n),s&&this.sendRetainedArgumentsForEvent(e);const a=async()=>this.removeListener(e,t);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,s){const r=this.listeners[e];if(!r){if(s){let n=this.retainedEventArguments[e];n||(n=[]),n.push(t),this.retainedEventArguments[e]=n}return}r.forEach(n=>n(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:s=>{this.notifyListeners(t,s)}}}unimplemented(e="not implemented"){return new Ca.Exception(e,co.Unimplemented)}unavailable(e="not available"){return new Ca.Exception(e,co.Unavailable)}async removeListener(e,t){const s=this.listeners[e];if(!s)return;const r=s.indexOf(t);this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(s=>{this.notifyListeners(e,s)}))}}const _2=i=>encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),D2=i=>i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class vne extends ic{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach(s=>{if(s.length<=0)return;let[r,n]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=D2(r).trim(),n=D2(n).trim(),t[r]=n}),t}async setCookie(e){try{const t=_2(e.key),s=_2(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,n=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${s||""}${r}; path=${n}; ${a};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Ol("CapacitorCookies",{web:()=>new vne});const yne=async i=>new Promise((e,t)=>{const s=new FileReader;s.onload=()=>{const r=s.result;e(r.indexOf(",")>=0?r.split(",")[1]:r)},s.onerror=r=>t(r),s.readAsDataURL(i)}),Cne=(i={})=>{const e=Object.keys(i);return Object.keys(i).map(r=>r.toLocaleLowerCase()).reduce((r,n,a)=>(r[n]=i[e[a]],r),{})},bne=(i,e=!0)=>i?Object.entries(i).reduce((s,r)=>{const[n,a]=r;let o,l;return Array.isArray(a)?(l="",a.forEach(u=>{o=e?encodeURIComponent(u):u,l+=`${n}=${o}&`}),l.slice(0,-1)):(o=e?encodeURIComponent(a):a,l=`${n}=${o}`),`${s}&${l}`},"").substr(1):null,k2=(i,e={})=>{const t=Object.assign({method:i.method||"GET",headers:i.headers},e),r=Cne(i.headers)["content-type"]||"";if(typeof i.data=="string")t.body=i.data;else if(r.includes("application/x-www-form-urlencoded")){const n=new URLSearchParams;for(const[a,o]of Object.entries(i.data||{}))n.set(a,o);t.body=n.toString()}else if(r.includes("multipart/form-data")||i.data instanceof FormData){const n=new FormData;if(i.data instanceof FormData)i.data.forEach((o,l)=>{n.append(l,o)});else for(const o of Object.keys(i.data))n.append(o,i.data[o]);t.body=n;const a=new Headers(t.headers);a.delete("content-type"),t.headers=a}else(r.includes("application/json")||typeof i.data=="object")&&(t.body=JSON.stringify(i.data));return t};class wne extends ic{async request(e){const t=k2(e,e.webFetchExtra),s=bne(e.params,e.shouldEncodeUrlParams),r=s?`${e.url}?${s}`:e.url,n=await fetch(r,t),a=n.headers.get("content-type")||"";let{responseType:o="text"}=n.ok?e:{};a.includes("application/json")&&(o="json");let l,u;switch(o){case"arraybuffer":case"blob":u=await n.blob(),l=await yne(u);break;case"json":l=await n.json();break;case"document":case"text":default:l=await n.text()}const h={};return n.headers.forEach((c,d)=>{h[d]=c}),{data:l,headers:h,status:n.status,url:n.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Ol("CapacitorHttp",{web:()=>new wne});function As(){return Math.round(performance.now())}function po(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}function xne(){return window.electronAPI!==void 0}function Ene(i,e){if(!e)return i.at(-1);for(let t=i.length-1;t>=0;t--)if(i[t].type===e)return i[t]}const Ml=[];function en(i,e,t="string",s,r){let n=Ml.find(d=>d.name===i);n||(n={name:i,defaultValue:r!==void 0?r:e,type:t,description:s,value:void 0},Ml.push(n));const a={string:d=>d,number:d=>{const f=Number(d);return isNaN(f)?e:f},boolean:d=>d.toLowerCase()==="true",array:d=>{try{return JSON.parse(d)}catch{return e}},json:d=>{try{return JSON.parse(d)}catch{return e}}},o=d=>t==="string"&&typeof d=="string"||t==="number"&&typeof d=="number"||t==="boolean"&&typeof d=="boolean"||t==="array"&&Array.isArray(d)||t==="json"&&typeof d=="object"&&d!==null?d:typeof d=="string"?d.toLowerCase()==="undefined"?e:a[t](d):e,l=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,u=l.get("_b");if(u)try{const d=atob(u),f=JSON.parse(d);if(i in f){const y=o(f[i]);return n.value=y,y}}catch{}const h=l.get(i);if(h==null)return e;const c=o(h);return n.value=c,c}const xm=[];class Nl{static getRegistry(){return[...Ml]}static getTimelineRepresentation(){return[...xm]}}const Fl=()=>window.electronAPI?"desktop":Ca.isNativePlatform()?"mobile":"web",O2={};function M2(i){i.forEach(e=>{const t=O2[e.type];if(t)for(const s of t)(!e.hideSettings||e.hideSettings!==!0&&!e.hideSettings.includes(s.name))&&(Ml.some(r=>r.name===s.name)||Ml.push(s))})}function Em(i,e){O2[i]=e}function Vne(i,e={}){if(M2(i),xm.length=0,i.forEach(n=>{xm.push({type:n.type??"NoTypeSpecified",name:n.name})}),!e.subset)return i;const t=en("includeSubset",void 0),s=en("excludeSubset",void 0);let r=[...i];if(t){const n=t.split(",");r=r.filter((a,o)=>{const l=n.some(h=>{const c=parseInt(h,10);return!isNaN(c)&&c-1===o}),u=a.name&&n.includes(a.name);return l||u})}if(s){const n=s.split(",");r=r.filter((a,o)=>{const l=n.some(h=>{const c=parseInt(h,10);return!isNaN(c)&&c-1===o}),u=a.name&&n.includes(a.name);return!(l||u)})}return r}function Sne(i){return i<=0?[]:Array.from({length:i},(e,t)=>{const s=i-t;return{draw:(r,n,a)=>{r.save(),r.fillStyle="black",r.font=`bold ${Math.min(n,a)*.02*2}px sans-serif`,r.textAlign="center",r.textBaseline="middle",r.fillText(s.toString(),n/2,a/2),r.restore()},displayDuration:1e3,ignoreData:!0}})}function N2(i){return`user_${i}`}function rc(i){const e=[],t={};let s=0;function r(l){return`${l}_auto_${s++}`}function n(l){return(u,h)=>l(h,u)}function a(l){return(u,h)=>{const c=l(h,u);return typeof c=="object"&&c!==null?{...u,...c}:(console.warn("Store update function did not return an object. Store remains unchanged.",{data:h,store:u}),u)}}function o(l){for(const u of l){let h=!1;if(typeof u=="object"&&u!==null&&"type"in u)switch(u.type){case"MARKER":{const d=u;t[N2(d.id)]=e.length,h=!0;break}case"IF_GOTO":{const d=u,f=n(d.cond);e.push({type:"IfGoto",cond:f,marker:N2(d.marker)}),h=!0;break}case"UPDATE_STORE":{const f=a(u.fun);e.push({type:"UpdateStore",fun:f}),h=!0;break}case"IF_BLOCK":{const d=u,f=r("if_end"),y=n(d.cond);e.push({type:"IfGoto",cond:(v,m)=>!y(v,m),marker:f}),o(d.timeline),t[f]=e.length,h=!0;break}case"WHILE_BLOCK":{const d=u,f=r("while_start"),y=r("while_end"),v=n(d.cond);t[f]=e.length,e.push({type:"IfGoto",cond:(m,g)=>!v(m,g),marker:y}),o(d.timeline),e.push({type:"IfGoto",cond:()=>!0,marker:f}),t[y]=e.length,h=!0;break}}h||e.push({type:"ExecuteContent",content:u})}}return o(i),{instructions:e,markers:t}}function nc(i,e,t,s){const r=typeof e.metadata=="function"?e.metadata(t,s):e.metadata;return e.nestMetadata?{...i,metadata:r}:r?{...r,...i}:i}function Dn(i,e,t,s,r){let n=e;for(;n<i.instructions.length;){const a=i.instructions[n];switch(a.type){case"ExecuteContent":return n;case"IfGoto":if(a.cond(t(),s())){const o=i.markers[a.marker];if(o!==void 0){n=o;continue}}n++;break;case"UpdateStore":r(a.fun(t(),s())),n++;break;default:n++}}return n}const Vm={};function $s(i,e,t){Vm[i]={simulate:e,defaultSimulators:t}}function Tne(i){return Vm[i]}const fo=(i,e,t,s)=>({responseData:{},participantState:s});function Sm(i,e,t){const s=typeof i.props=="function"?i.props(e,t):i.props||{},r=Vm[i.type],n=typeof i.simulate=="function"?i.simulate:r==null?void 0:r.simulate;if(!n)throw new Error(`No simulation registered for trial type '${i.type}' (name: '${i.name??"unnamed"}'). Register one with registerSimulation() or add a simulate function to the timeline item.`);const a={...r==null?void 0:r.defaultSimulators,...i.simulators};return{trialProps:s,simulateFn:n,simulators:a}}let F2="http://localhost:8001/backend";function Pne(i){F2=i}function q2(){return F2}let B2;function $2(){return B2}async function Ine(i,e){B2={...e};let t={...e};const s=rc(i);let r={};const n=[{index:-1,trialNumber:-1,start:0,end:0,duration:0,type:"",name:"",responseData:{userAgent:"simulated",params:Object.fromEntries((Nl.getRegistry()||[]).map(d=>[d.name,{value:d.value!==void 0?d.value:d.defaultValue,registered:!0,defaultValue:d.defaultValue,type:d.type,description:d.description}]))}}],a=()=>r,o=()=>n,l=d=>{r=d};let u=0,h=0,c=Dn(s,0,a,o,l);for(;c<s.instructions.length;){const d=s.instructions[c].content;if(typeof d!="object"||d===null||typeof d.type!="string"){c=Dn(s,c+1,a,o,l);continue}const{trialProps:f,simulateFn:y,simulators:v}=Sm(d,n,r),m=await y(f,{data:n,store:r},v,t);t=m.participantState,m.storeUpdates&&(r={...r,...m.storeUpdates}),u++;const g=m.duration??0,b=h;h+=g;let x={index:c,trialNumber:u,start:b,end:h,duration:g,type:d.type,name:d.name??"",...d.csv!==void 0?{csv:d.csv}:{},responseData:m.responseData};n.push(nc(x,d,n,r)),c=Dn(s,c+1,a,o,l)}return n}async function Rne(i,e){const{spawn:t}=await import("child_process"),s=i.backendPort??8001,r=`http://localhost:${s}/backend`,n=typeof i.participants=="function"?i.participants().length:Array.isArray(i.participants)?i.participants.length:i.participants.count,a=t("node",["src/backend.ts"],{cwd:"./backend",stdio:["ignore","pipe","pipe"]});await new Promise((o,l)=>{var u,h;a.on("error",l),(u=a.stdout)==null||u.on("data",c=>{c.toString().includes("REACTIVE_BACKEND_READY")&&o()}),(h=a.stderr)==null||h.on("data",c=>{console.error(`[backend] ${c.toString().trim()}`)}),setTimeout(()=>l(new Error("Backend did not start within 10 seconds")),1e4)}),console.log(`Backend running on port ${s}`);try{const o=i.concurrency??(await import("os")).cpus().length;console.log(`Simulating ${n} participants (concurrency: ${o})...`);let l=0;const u=[],h=()=>{const f=Math.min(100,Math.round(l/n*100)),y=Math.floor(f/2),v="█".repeat(y)+"░".repeat(50-y);process.stdout.write(`\r ${v} ${l}/${n} (${f}%)`)},c=f=>new Promise(y=>{var g;let v="";const m=t("node",[e],{env:{...process.env,_REACTIVE_WORKER_INDEX:String(f),_REACTIVE_BACKEND_URL:r,...i.seed!==void 0?{_REACTIVE_SIMULATION_SEED:String(i.seed)}:{}},stdio:["ignore","pipe","pipe"]});(g=m.stderr)==null||g.on("data",b=>{v+=b.toString()}),m.on("close",b=>{b!==0&&u.push({index:f,error:v.trim()||`exited with code ${b}`}),l++,h(),y()}),m.on("error",b=>{u.push({index:f,error:b.message}),l++,h(),y()})});h();let d=0;if(await new Promise(f=>{const y=()=>{if(d>=n){l>=n&&f();return}const v=d++;c(v).then(y)};for(let v=0;v<Math.min(o,n);v++)y()}),process.stdout.write(`
|
|
10148
|
+
*/var Yre=st,w2=Qre,Xre=Jre;Yre(w2,"factory",Xre);var ene=w2;const tne=Ga(ene),Rs=new Uint32Array(1);function sne(i){return Rs[0]=i,Rs[0]=(Rs[0]<<16|Rs[0]>>16)>>>0,Rs[0]=(Rs[0]&1431655765)<<1|(Rs[0]&2863311530)>>>1>>>0,Rs[0]=(Rs[0]&858993459)<<2|(Rs[0]&3435973836)>>>2>>>0,Rs[0]=(Rs[0]&252645135)<<4|(Rs[0]&4042322160)>>>4>>>0,Rs[0]=(Rs[0]&16711935)<<8|(Rs[0]&4278255360)>>>8>>>0,Rs[0]*23283064365386963e-26}function ine(i,e){let t=1,s=0;for(;i>0;)t/=e,s+=t*(i%e),i=~~(i/e);return s}const rne=(i,e=[2,3])=>Array.from({length:i},(t,s)=>e.map(r=>r===2?sne(s):ine(s,r)));K.normal=GC,K.poisson=wb,K.uniform=Db;function nne(i){const e=t$.factory({seed:i});K.normal=GC.factory({prng:e.normalized}),K.poisson=wb.factory({prng:e.normalized}),K.uniform=Db.factory({prng:e.normalized}),Math.random=()=>K.uniform(0,1)}function x2(i){return Math.max(1e-10,Math.min(1-1e-10,i))}function bm(i){switch(i.distribution){case"uniform":return e=>i.min+e*(i.max-i.min);case"normal":return e=>fZ(x2(e),i.mean,i.sd);case"poisson":return e=>tne(x2(e),i.mean);case"integer":return e=>Math.floor(i.min+e*(i.max-i.min+1));case"discrete":{const e=i.outcomes.reduce((s,r)=>s+r.weight,0),t=i.outcomes.map((()=>{let s=0;return r=>(s+=r.weight/e,s)})());return s=>{for(let r=0;r<t.length;r++)if(s<t[r])return i.outcomes[r].value;return i.outcomes[i.outcomes.length-1].value}}}}function E2(i,e){const t=e.map(bm);return e.length===1?i.map(s=>t[0](s[0])):i.map(s=>s.map((r,n)=>t[n](r)))}const ane=[[1,0,[1]],[2,1,[1,1]],[3,1,[1,3,7]],[3,2,[1,1,5]],[4,1,[1,3,1,1]],[4,4,[1,1,3,7]],[5,2,[1,3,3,9,9]],[5,13,[1,3,7,13,3]],[5,7,[1,1,5,11,27]],[5,14,[1,3,5,1,15]],[5,11,[1,1,7,3,29]],[5,4,[1,3,7,7,21]],[6,1,[1,1,1,9,23,37]],[6,16,[1,3,3,5,19,33]],[6,13,[1,1,3,13,11,7]],[6,22,[1,1,7,13,25,5]],[6,19,[1,3,5,11,7,11]],[6,25,[1,1,1,3,13,39]],[7,1,[1,3,1,15,17,63,13]],[7,32,[1,1,5,5,1,59,33]]],ho=32,one=2**ho;function lne(i){const e=new Uint32Array(ho);if(i===0){for(let n=0;n<ho;n++)e[n]=1<<ho-1-n;return e}const[t,s,r]=ane[i-1];for(let n=0;n<t;n++)e[n]=r[n]<<ho-1-n;for(let n=t;n<ho;n++){e[n]=e[n-t]^e[n-t]>>>t;for(let a=1;a<t;a++)s>>>t-1-a&1&&(e[n]^=e[n-a])}return e}function une(i,e){if(e<1||e>21)throw new RangeError("sobol() supports 1-21 dimensions");const t=Array.from({length:e},(n,a)=>lne(a)),s=new Uint32Array(e),r=[new Array(e).fill(0)];for(let n=1;n<i;n++){let a=0,o=n-1;for(;(o&1)===1;)o>>>=1,a++;for(let l=0;l<e;l++)s[l]^=t[l][a];r.push(Array.from(s,l=>l/one))}return r}const hne=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73],V2=6;function S2(i,e){const t=une(i+1,e.length).slice(1);return E2(t,e)}function T2(i,e){e.length>V2&&console.warn(`Halton sequence quality degrades above ${V2} dimensions. Consider using sobol() instead.`);const t=hne.slice(0,e.length),s=rne(i+1,t).slice(1);return E2(s,e)}function cne(i,e,t){const s=Object.keys(t),r=s.map(a=>t[a]);let n;switch(i){case"sobol":n=S2(e,r);break;case"halton":n=T2(e,r);break;case"random":n=dne(e,r);break}return Array.from({length:e},(a,o)=>{const l=s.length===1?[n[o]]:n[o];return{index:o,...Object.fromEntries(s.map((u,h)=>[u,l[h]]))}})}function dne(i,e){const t=e.map(bm);return e.length===1?Array.from({length:i},()=>t[0](K.uniform(0,1))):Array.from({length:i},()=>t.map(s=>s(K.uniform(0,1))))}function pne(i){return bm(i)(K.uniform(0,1))}function P2(i,e=1,t={}){const{replace:s=!0}=t;if(i.length===0)return[];if(s){const a=[];for(let o=0;o<e;o++){const l=Math.floor(K.uniform(0,1)*i.length);a.push(i[l])}return a}const r=[];let n=[];for(let a=0;a<e;a++)n.length===0&&(n=sc(i)),r.push(n.pop());return r}function sc(i){const e=[...i];for(let t=e.length-1;t>=0;t--){const s=Math.floor(K.uniform(0,1)*(t+1));[e[t],e[s]]=[e[s],e[t]]}return e}function I2(i,e){return e(i)}function R2(i,e){const t=Math.ceil(i.length/e);return Array.from({length:Math.ceil(i.length/t)},(s,r)=>i.slice(r*t,r*t+t))}function A2(i){return i.length===0?0:i.reduce((e,t)=>e+t,0)/i.length}function L2(i){return i.reduce((e,t)=>e+t,0)}function fne(){typeof Array.prototype.sample!="function"&&(Array.prototype.sample=function(i,e){return P2(this,i,e)}),typeof Array.prototype.shuffle!="function"&&(Array.prototype.shuffle=function(){return sc(this)}),typeof Array.prototype.pipe!="function"&&(Array.prototype.pipe=function(i){return I2(this,i)}),typeof Array.prototype.mean!="function"&&(Array.prototype.mean=function(){return A2(this)}),typeof Array.prototype.sum!="function"&&(Array.prototype.sum=function(){return L2(this)}),typeof Array.prototype.chunk!="function"&&(Array.prototype.chunk=function(i){return R2(this,i)})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var co;(function(i){i.Unimplemented="UNIMPLEMENTED",i.Unavailable="UNAVAILABLE"})(co||(co={}));class wm extends Error{constructor(e,t,s){super(e),this.message=e,this.code=t,this.data=s}}const mne=i=>{var e,t;return i!=null&&i.androidBridge?"android":!((t=(e=i==null?void 0:i.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},gne=i=>{const e=i.CapacitorCustomPlatform||null,t=i.Capacitor||{},s=t.Plugins=t.Plugins||{},r=()=>e!==null?e.name:mne(i),n=()=>r()!=="web",a=c=>{const d=u.get(c);return!!(d!=null&&d.platforms.has(r())||o(c))},o=c=>{var d;return(d=t.PluginHeaders)===null||d===void 0?void 0:d.find(f=>f.name===c)},l=c=>i.console.error(c),u=new Map,h=(c,d={})=>{const f=u.get(c);if(f)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),f.proxy;const y=r(),v=o(c);let m;const g=async()=>(!m&&y in d?m=typeof d[y]=="function"?m=await d[y]():m=d[y]:e!==null&&!m&&"web"in d&&(m=typeof d.web=="function"?m=await d.web():m=d.web),m),b=(P,O)=>{var D,$;if(v){const Q=v==null?void 0:v.methods.find(_=>O===_.name);if(Q)return Q.rtype==="promise"?_=>t.nativePromise(c,O.toString(),_):(_,B)=>t.nativeCallback(c,O.toString(),_,B);if(P)return(D=P[O])===null||D===void 0?void 0:D.bind(P)}else{if(P)return($=P[O])===null||$===void 0?void 0:$.bind(P);throw new wm(`"${c}" plugin is not implemented on ${y}`,co.Unimplemented)}},x=P=>{let O;const D=(...$)=>{const Q=g().then(_=>{const B=b(_,P);if(B){const H=B(...$);return O=H==null?void 0:H.remove,H}else throw new wm(`"${c}.${P}()" is not implemented on ${y}`,co.Unimplemented)});return P==="addListener"&&(Q.remove=async()=>O()),Q};return D.toString=()=>`${P.toString()}() { [capacitor code] }`,Object.defineProperty(D,"name",{value:P,writable:!1,configurable:!1}),D},I=x("addListener"),L=x("removeListener"),A=(P,O)=>{const D=I({eventName:P},O),$=async()=>{const _=await D;L({eventName:P,callbackId:_},O)},Q=new Promise(_=>D.then(()=>_({remove:$})));return Q.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await $()},Q},k=new Proxy({},{get(P,O){switch(O){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return v?A:I;case"removeListener":return L;default:return x(O)}}});return s[c]=k,u.set(c,{name:c,proxy:k,platforms:new Set([...Object.keys(d),...v?[y]:[]])}),k};return t.convertFileSrc||(t.convertFileSrc=c=>c),t.getPlatform=r,t.handleError=l,t.isNativePlatform=n,t.isPluginAvailable=a,t.registerPlugin=h,t.Exception=wm,t.DEBUG=!!t.DEBUG,t.isLoggingEnabled=!!t.isLoggingEnabled,t},Ca=(i=>i.Capacitor=gne(i))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ol=Ca.registerPlugin;class ic{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let s=!1;this.listeners[e]||(this.listeners[e]=[],s=!0),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n),s&&this.sendRetainedArgumentsForEvent(e);const a=async()=>this.removeListener(e,t);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,s){const r=this.listeners[e];if(!r){if(s){let n=this.retainedEventArguments[e];n||(n=[]),n.push(t),this.retainedEventArguments[e]=n}return}r.forEach(n=>n(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:s=>{this.notifyListeners(t,s)}}}unimplemented(e="not implemented"){return new Ca.Exception(e,co.Unimplemented)}unavailable(e="not available"){return new Ca.Exception(e,co.Unavailable)}async removeListener(e,t){const s=this.listeners[e];if(!s)return;const r=s.indexOf(t);this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(s=>{this.notifyListeners(e,s)}))}}const _2=i=>encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),D2=i=>i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class vne extends ic{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach(s=>{if(s.length<=0)return;let[r,n]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=D2(r).trim(),n=D2(n).trim(),t[r]=n}),t}async setCookie(e){try{const t=_2(e.key),s=_2(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,n=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${s||""}${r}; path=${n}; ${a};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Ol("CapacitorCookies",{web:()=>new vne});const yne=async i=>new Promise((e,t)=>{const s=new FileReader;s.onload=()=>{const r=s.result;e(r.indexOf(",")>=0?r.split(",")[1]:r)},s.onerror=r=>t(r),s.readAsDataURL(i)}),Cne=(i={})=>{const e=Object.keys(i);return Object.keys(i).map(r=>r.toLocaleLowerCase()).reduce((r,n,a)=>(r[n]=i[e[a]],r),{})},bne=(i,e=!0)=>i?Object.entries(i).reduce((s,r)=>{const[n,a]=r;let o,l;return Array.isArray(a)?(l="",a.forEach(u=>{o=e?encodeURIComponent(u):u,l+=`${n}=${o}&`}),l.slice(0,-1)):(o=e?encodeURIComponent(a):a,l=`${n}=${o}`),`${s}&${l}`},"").substr(1):null,k2=(i,e={})=>{const t=Object.assign({method:i.method||"GET",headers:i.headers},e),r=Cne(i.headers)["content-type"]||"";if(typeof i.data=="string")t.body=i.data;else if(r.includes("application/x-www-form-urlencoded")){const n=new URLSearchParams;for(const[a,o]of Object.entries(i.data||{}))n.set(a,o);t.body=n.toString()}else if(r.includes("multipart/form-data")||i.data instanceof FormData){const n=new FormData;if(i.data instanceof FormData)i.data.forEach((o,l)=>{n.append(l,o)});else for(const o of Object.keys(i.data))n.append(o,i.data[o]);t.body=n;const a=new Headers(t.headers);a.delete("content-type"),t.headers=a}else(r.includes("application/json")||typeof i.data=="object")&&(t.body=JSON.stringify(i.data));return t};class wne extends ic{async request(e){const t=k2(e,e.webFetchExtra),s=bne(e.params,e.shouldEncodeUrlParams),r=s?`${e.url}?${s}`:e.url,n=await fetch(r,t),a=n.headers.get("content-type")||"";let{responseType:o="text"}=n.ok?e:{};a.includes("application/json")&&(o="json");let l,u;switch(o){case"arraybuffer":case"blob":u=await n.blob(),l=await yne(u);break;case"json":l=await n.json();break;case"document":case"text":default:l=await n.text()}const h={};return n.headers.forEach((c,d)=>{h[d]=c}),{data:l,headers:h,status:n.status,url:n.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Ol("CapacitorHttp",{web:()=>new wne});function As(){return Math.round(performance.now())}function po(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}function xne(){return window.electronAPI!==void 0}function Ene(i,e){if(!e)return i.at(-1);for(let t=i.length-1;t>=0;t--)if(i[t].type===e)return i[t]}const Ml=[];function en(i,e,t="string",s,r){let n=Ml.find(d=>d.name===i);n||(n={name:i,defaultValue:r!==void 0?r:e,type:t,description:s,value:void 0},Ml.push(n));const a={string:d=>d,number:d=>{const f=Number(d);return isNaN(f)?e:f},boolean:d=>d.toLowerCase()==="true",array:d=>{try{return JSON.parse(d)}catch{return e}},json:d=>{try{return JSON.parse(d)}catch{return e}}},o=d=>t==="string"&&typeof d=="string"||t==="number"&&typeof d=="number"||t==="boolean"&&typeof d=="boolean"||t==="array"&&Array.isArray(d)||t==="json"&&typeof d=="object"&&d!==null?d:typeof d=="string"?d.toLowerCase()==="undefined"?e:a[t](d):e,l=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,u=l.get("_b");if(u)try{const d=atob(u),f=JSON.parse(d);if(i in f){const y=o(f[i]);return n.value=y,y}}catch{}const h=l.get(i);if(h==null)return e;const c=o(h);return n.value=c,c}const xm=[];class Nl{static getRegistry(){return[...Ml]}static getTimelineRepresentation(){return[...xm]}}const Fl=()=>window.electronAPI?"desktop":Ca.isNativePlatform()?"mobile":"web",O2={};function M2(i){i.forEach(e=>{const t=O2[e.type];if(t)for(const s of t)(!e.hideSettings||e.hideSettings!==!0&&!e.hideSettings.includes(s.name))&&(Ml.some(r=>r.name===s.name)||Ml.push(s))})}function Em(i,e){O2[i]=e}function Vne(i,e={}){if(M2(i),!e.subset)return i;xm.length=0,i.forEach(n=>{xm.push({type:n.type??"NoTypeSpecified",name:n.name})});const t=en("includeSubset",void 0),s=en("excludeSubset",void 0);let r=[...i];if(t){const n=t.split(",");r=r.filter((a,o)=>{const l=n.some(h=>{const c=parseInt(h,10);return!isNaN(c)&&c-1===o}),u=a.name&&n.includes(a.name);return l||u})}if(s){const n=s.split(",");r=r.filter((a,o)=>{const l=n.some(h=>{const c=parseInt(h,10);return!isNaN(c)&&c-1===o}),u=a.name&&n.includes(a.name);return!(l||u)})}return r}function Sne(i){return i<=0?[]:Array.from({length:i},(e,t)=>{const s=i-t;return{draw:(r,n,a)=>{r.save(),r.fillStyle="black",r.font=`bold ${Math.min(n,a)*.02*2}px sans-serif`,r.textAlign="center",r.textBaseline="middle",r.fillText(s.toString(),n/2,a/2),r.restore()},displayDuration:1e3,ignoreData:!0}})}function N2(i){return`user_${i}`}function rc(i){const e=[],t={};let s=0;function r(l){return`${l}_auto_${s++}`}function n(l){return(u,h)=>l(h,u)}function a(l){return(u,h)=>{const c=l(h,u);return typeof c=="object"&&c!==null?{...u,...c}:(console.warn("Store update function did not return an object. Store remains unchanged.",{data:h,store:u}),u)}}function o(l){for(const u of l){let h=!1;if(typeof u=="object"&&u!==null&&"type"in u)switch(u.type){case"MARKER":{const d=u;t[N2(d.id)]=e.length,h=!0;break}case"IF_GOTO":{const d=u,f=n(d.cond);e.push({type:"IfGoto",cond:f,marker:N2(d.marker)}),h=!0;break}case"UPDATE_STORE":{const f=a(u.fun);e.push({type:"UpdateStore",fun:f}),h=!0;break}case"IF_BLOCK":{const d=u,f=r("if_end"),y=n(d.cond);e.push({type:"IfGoto",cond:(v,m)=>!y(v,m),marker:f}),o(d.timeline),t[f]=e.length,h=!0;break}case"WHILE_BLOCK":{const d=u,f=r("while_start"),y=r("while_end"),v=n(d.cond);t[f]=e.length,e.push({type:"IfGoto",cond:(m,g)=>!v(m,g),marker:y}),o(d.timeline),e.push({type:"IfGoto",cond:()=>!0,marker:f}),t[y]=e.length,h=!0;break}}h||e.push({type:"ExecuteContent",content:u})}}return o(i),{instructions:e,markers:t}}function nc(i,e,t,s){const r=typeof e.metadata=="function"?e.metadata(t,s):e.metadata;return e.nestMetadata?{...i,metadata:r}:r?{...r,...i}:i}function Dn(i,e,t,s,r){let n=e;for(;n<i.instructions.length;){const a=i.instructions[n];switch(a.type){case"ExecuteContent":return n;case"IfGoto":if(a.cond(t(),s())){const o=i.markers[a.marker];if(o!==void 0){n=o;continue}}n++;break;case"UpdateStore":r(a.fun(t(),s())),n++;break;default:n++}}return n}const Vm={};function $s(i,e,t){Vm[i]={simulate:e,defaultSimulators:t}}function Tne(i){return Vm[i]}const fo=(i,e,t,s)=>({responseData:{},participantState:s});function Sm(i,e,t){const s=typeof i.props=="function"?i.props(e,t):i.props||{},r=Vm[i.type],n=typeof i.simulate=="function"?i.simulate:r==null?void 0:r.simulate;if(!n)throw new Error(`No simulation registered for trial type '${i.type}' (name: '${i.name??"unnamed"}'). Register one with registerSimulation() or add a simulate function to the timeline item.`);const a={...r==null?void 0:r.defaultSimulators,...i.simulators};return{trialProps:s,simulateFn:n,simulators:a}}let F2="http://localhost:8001/backend";function Pne(i){F2=i}function q2(){return F2}let B2;function $2(){return B2}async function Ine(i,e){B2={...e};let t={...e};const s=rc(i);let r={};const n=[{index:-1,trialNumber:-1,start:0,end:0,duration:0,type:"",name:"",responseData:{userAgent:"simulated",params:Object.fromEntries((Nl.getRegistry()||[]).map(d=>[d.name,{value:d.value!==void 0?d.value:d.defaultValue,registered:!0,defaultValue:d.defaultValue,type:d.type,description:d.description}]))}}],a=()=>r,o=()=>n,l=d=>{r=d};let u=0,h=0,c=Dn(s,0,a,o,l);for(;c<s.instructions.length;){const d=s.instructions[c].content;if(typeof d!="object"||d===null||typeof d.type!="string"){c=Dn(s,c+1,a,o,l);continue}const{trialProps:f,simulateFn:y,simulators:v}=Sm(d,n,r),m=await y(f,{data:n,store:r},v,t);t=m.participantState,m.storeUpdates&&(r={...r,...m.storeUpdates}),u++;const g=m.duration??0,b=h;h+=g;let x={index:c,trialNumber:u,start:b,end:h,duration:g,type:d.type,name:d.name??"",...d.csv!==void 0?{csv:d.csv}:{},responseData:m.responseData};n.push(nc(x,d,n,r)),c=Dn(s,c+1,a,o,l)}return n}async function Rne(i,e){const{spawn:t}=await import("child_process"),s=i.backendPort??8001,r=`http://localhost:${s}/backend`,n=typeof i.participants=="function"?i.participants().length:Array.isArray(i.participants)?i.participants.length:i.participants.count,a=t("node",["src/backend.ts"],{cwd:"./backend",stdio:["ignore","pipe","pipe"]});await new Promise((o,l)=>{var u,h;a.on("error",l),(u=a.stdout)==null||u.on("data",c=>{c.toString().includes("REACTIVE_BACKEND_READY")&&o()}),(h=a.stderr)==null||h.on("data",c=>{console.error(`[backend] ${c.toString().trim()}`)}),setTimeout(()=>l(new Error("Backend did not start within 10 seconds")),1e4)}),console.log(`Backend running on port ${s}`);try{const o=i.concurrency??(await import("os")).cpus().length;console.log(`Simulating ${n} participants (concurrency: ${o})...`);let l=0;const u=[],h=()=>{const f=Math.min(100,Math.round(l/n*100)),y=Math.floor(f/2),v="█".repeat(y)+"░".repeat(50-y);process.stdout.write(`\r ${v} ${l}/${n} (${f}%)`)},c=f=>new Promise(y=>{var g;let v="";const m=t("node",[e],{env:{...process.env,_REACTIVE_WORKER_INDEX:String(f),_REACTIVE_BACKEND_URL:r,...i.seed!==void 0?{_REACTIVE_SIMULATION_SEED:String(i.seed)}:{}},stdio:["ignore","pipe","pipe"]});(g=m.stderr)==null||g.on("data",b=>{v+=b.toString()}),m.on("close",b=>{b!==0&&u.push({index:f,error:v.trim()||`exited with code ${b}`}),l++,h(),y()}),m.on("error",b=>{u.push({index:f,error:b.message}),l++,h(),y()})});h();let d=0;if(await new Promise(f=>{const y=()=>{if(d>=n){l>=n&&f();return}const v=d++;c(v).then(y)};for(let v=0;v<Math.min(o,n);v++)y()}),process.stdout.write(`
|
|
10149
10149
|
`),u.length>0){console.error(`
|
|
10150
10150
|
${u.length} participant(s) failed:`);for(const{index:f,error:y}of u)console.error(` Participant ${f}: ${y}`)}console.log(`Simulation complete. ${l-u.length}/${n} participants simulated successfully.`)}finally{a.kill(),console.log("Backend stopped.")}}const ac={};function Zs(i,e,t){ac[i]||(ac[i]=[]),ac[i].push({csv:e,flatten:t})}function H2(i){const e=i.responseData;return Array.isArray(e)?e.map(t=>({block:i.name,...t})):[]}function Q2(i){if(i==null)return"";const e=typeof i=="object"?JSON.stringify(i):String(i);return e.includes(",")||e.includes('"')||e.includes(`
|
|
10151
10151
|
`)?`"${e.replace(/"/g,'""')}"`:e}function oc(i){if(!i||i.length===0)return"";const e=new Set;i.forEach(n=>{Object.keys(n).forEach(a=>{e.add(a)})});const t=Array.from(e),s=t.map(n=>Q2(n)).join(","),r=i.map(n=>t.map(a=>{const o=n[a];return Q2(o)}).join(","));return[s,...r].join(`
|
|
10152
|
-
`)}function Ane(i){var s,r;const e=(r=(s=i==null?void 0:i[0])==null?void 0:s.responseData)==null?void 0:r.params;if(!e||typeof e!="object")return{};const t={};for(const[n,a]of Object.entries(e))a&&typeof a=="object"&&(t[n]=a.value??a.defaultValue);return t}const U2=new Set(["index","trialNumber","start","end","duration","type","name","csv","responseData","metadata"]),Lne=new Set(["index","trialNumber","start","end","duration","type","name"]);function _ne(i,e,t){var a,o;const s=[],r={};for(const l of e){if(l.index===-1)continue;const u=l.csv,h=u?(Array.isArray(u)?u:[u]).map(c=>({csv:c})):ac[l.type]??[];for(const c of h)c.csv&&(r[c.csv]||(r[c.csv]=[]),r[c.csv].push({item:l,flatten:"flatten"in c?c.flatten:void 0}))}const n={sessionID:i,userAgent:(o=(a=e==null?void 0:e[0])==null?void 0:a.responseData)==null?void 0:o.userAgent,...Ane(e),...t};if(r.session){for(const{item:l}of r.session){const u=l.name||l.type;for(const[h,c]of Object.entries(l))U2.has(h)||(n[`${u}_${h}`]=typeof c=="object"&&c!==null&&!Array.isArray(c)?JSON.stringify(c):c);if(l.responseData&&typeof l.responseData=="object"&&!Array.isArray(l.responseData))for(const[h,c]of Object.entries(l.responseData))n[`${u}_${h}`]=typeof c=="object"&&c!==null&&!Array.isArray(c)?JSON.stringify(c):c}delete r.session}Object.keys(n).length>1&&s.push({filename:`session.${i}.${Date.now()}.csv`,content:oc([n]),encoding:"utf8"});for(const[l,u]of Object.entries(r)){const h=u.flatMap(({item:c,flatten:d})=>{const f={};for(const[v,m]of Object.entries(c))U2.has(v)?Lne.has(v)&&(f[`trial_${v}`]=m):f[v]=typeof m=="object"&&m!==null&&!Array.isArray(m)?JSON.stringify(m):m;return(d?d(c):[c.responseData&&typeof c.responseData=="object"?{...c.responseData}:{}]).map(v=>{const m={...f,...v};for(const g of Object.keys(m)){const b=m[g];typeof b=="object"&&b!==null&&!Array.isArray(b)&&(m[g]=JSON.stringify(b))}return m})});h.length>0&&s.push({filename:`${l}.${i}.${Date.now()}.csv`,content:oc(h),encoding:"utf8"})}return s}let Dne=0;function j2(i){return`audio_${i}_${Dne++}_${Date.now()}.webm`}function kne(i){const e=[],t=(s,r)=>{if((s==null?void 0:s.type)==="audiorecording"
|
|
10152
|
+
`)}function Ane(i){var s,r;const e=(r=(s=i==null?void 0:i[0])==null?void 0:s.responseData)==null?void 0:r.params;if(!e||typeof e!="object")return{};const t={};for(const[n,a]of Object.entries(e))a&&typeof a=="object"&&(t[n]=a.value??a.defaultValue);return t}const U2=new Set(["index","trialNumber","start","end","duration","type","name","csv","responseData","metadata"]),Lne=new Set(["index","trialNumber","start","end","duration","type","name"]);function _ne(i,e,t){var a,o;const s=[],r={};for(const l of e){if(l.index===-1)continue;const u=l.csv,h=u?(Array.isArray(u)?u:[u]).map(c=>({csv:c})):ac[l.type]??[];for(const c of h)c.csv&&(r[c.csv]||(r[c.csv]=[]),r[c.csv].push({item:l,flatten:"flatten"in c?c.flatten:void 0}))}const n={sessionID:i,userAgent:(o=(a=e==null?void 0:e[0])==null?void 0:a.responseData)==null?void 0:o.userAgent,...Ane(e),...t};if(r.session){for(const{item:l}of r.session){const u=l.name||l.type;for(const[h,c]of Object.entries(l))U2.has(h)||(n[`${u}_${h}`]=typeof c=="object"&&c!==null&&!Array.isArray(c)?JSON.stringify(c):c);if(l.responseData&&typeof l.responseData=="object"&&!Array.isArray(l.responseData))for(const[h,c]of Object.entries(l.responseData))n[`${u}_${h}`]=typeof c=="object"&&c!==null&&!Array.isArray(c)?JSON.stringify(c):c}delete r.session}Object.keys(n).length>1&&s.push({filename:`session.${i}.${Date.now()}.csv`,content:oc([n]),encoding:"utf8"});for(const[l,u]of Object.entries(r)){const h=u.flatMap(({item:c,flatten:d})=>{const f={};for(const[v,m]of Object.entries(c))U2.has(v)?Lne.has(v)&&(f[`trial_${v}`]=m):f[v]=typeof m=="object"&&m!==null&&!Array.isArray(m)?JSON.stringify(m):m;return(d?d(c):[c.responseData&&typeof c.responseData=="object"?{...c.responseData}:{}]).map(v=>{const m={...f,...v};for(const g of Object.keys(m)){const b=m[g];typeof b=="object"&&b!==null&&!Array.isArray(b)&&(m[g]=JSON.stringify(b))}return m})});h.length>0&&s.push({filename:`${l}.${i}.${Date.now()}.csv`,content:oc(h),encoding:"utf8"})}return s}let Dne=0;function j2(i){return`audio_${i}_${Dne++}_${Date.now()}.webm`}function kne(i){const e=[],t=(s,r)=>{if((s==null?void 0:s.type)==="audiorecording"&&s.data64){const n=s._audioPreUploadedFilename??j2(r);e.push({filename:n,content:s.data64,encoding:"base64",_alreadyUploaded:!!s._audioPreUploaded}),s.audioFile=n,delete s.data64,delete s.blob,delete s.url,delete s._audioPreUploaded,delete s._audioPreUploadedFilename}};for(const s of i){const r=s.responseData;if(!(!r||typeof r!="object")&&(t(r,s.name||s.type),!Array.isArray(r)))for(const[n,a]of Object.entries(r))a&&typeof a=="object"&&t(a,`${s.name||s.type}_${n}`)}return e}function z2(i){const{sessionID:e,data:t,store:s,generateFiles:r,sessionData:n,uploadRaw:a=!0}=i,o=r?r(e,t,s):[];return o.push(...kne(t)),a&&o.push({filename:`${e}.raw.json`,content:JSON.stringify(t),encoding:"utf8"}),o.push(..._ne(e,t,n)),o}const Tm=V.createContext("light"),qi=()=>V.useContext(Tm),W2={text:"text-[#f5f5f5]",prose:"prose-invert",proseLink:"prose-a:text-blue-400",buttonBg:"bg-white",buttonText:"text-black",buttonBorder:"border-black",buttonShadow:"shadow-[2px_2px_0px_rgba(0,0,0,1)]",buttonDisabledBg:"bg-gray-700",buttonDisabledText:"text-gray-500",buttonDisabledBorder:"border-gray-600",buttonDisabledShadow:"shadow-[2px_2px_0px_rgba(75,85,99,1)]",error:"text-red-400",focusRing:"focus:ring-blue-400",inputBg:"bg-gray-700",inputBorder:"border-gray-500",inputText:"text-[#f5f5f5]",progressBg:"bg-gray-700",progressStripe1:"#374151",progressStripe2:"#4B5563",dotActive:"#fff",dotInactive:"rgba(255,255,255,0.3)",toastTheme:"dark"},G2={light:{containerBg:"",text:"text-black",prose:"prose-slate",proseLink:"prose-a:text-blue-600",buttonBg:"bg-white",buttonText:"text-black",buttonBorder:"border-black",buttonShadow:"shadow-[2px_2px_0px_rgba(0,0,0,1)]",buttonDisabledBg:"bg-gray-200",buttonDisabledText:"text-gray-400",buttonDisabledBorder:"border-gray-400",buttonDisabledShadow:"shadow-[2px_2px_0px_rgba(156,163,175,1)]",error:"text-red-500",focusRing:"focus:ring-blue-500",inputBg:"",inputBorder:"border-black",inputText:"",progressBg:"bg-gray-200",progressStripe1:"#E5E7EB",progressStripe2:"#D1D5DB",dotActive:"#000",dotInactive:"rgba(0,0,0,0.2)",toastTheme:"light"},dark:{containerBg:"reactive-dark-bg",...W2},"dark-plain":{containerBg:"reactive-dark-bg-plain",...W2}},One="reactive-light-dot-bg",Mne="reactive-dark-bg",Nne="reactive-dark-bg-plain";function xi(i){return G2[i]}const Pm=V.createContext(void 0),K2=()=>V.useContext(Pm);let Im=null;async function lc(){return Im||(Im=(await import("module")).createRequire(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yi&&Yi.tagName.toUpperCase()==="SCRIPT"&&Yi.src||new URL("reactive.umd.js",document.baseURI).href)),Im}async function Z2(i){try{const e=await lc(),t=e("child_process"),s=e("path"),r=e("fs"),n=e("os"),{execSync:a}=t,o=r.mkdtempSync(s.join(n.tmpdir(),"reactive-tts-")),l=s.join(o,"tts.wav"),u=s.join(o,"tts.webm"),h=i.replace(/"/g,'\\"'),c=process.platform;if(c==="darwin"){let y="";try{a('say -v "?"',{encoding:"utf8"}).includes("Ava")&&(y='-v "Ava (Premium)"')}catch{}a(`say ${y} -o "${l}" --data-format=LEI16@22050 "${h}"`,{stdio:"ignore"})}else if(c==="win32"){const y=`Add-Type -AssemblyName System.Speech; $s = New-Object System.Speech.Synthesis.SpeechSynthesizer; $s.SetOutputToWaveFile('${l.replace(/'/g,"''")}'); $s.Speak('${h.replace(/'/g,"''")}'); $s.Dispose()`;a(`powershell -Command "${y.replace(/"/g,'\\"')}"`,{stdio:"ignore"})}else try{a(`espeak-ng -w "${l}" "${h}"`,{stdio:"ignore"})}catch{a(`espeak -w "${l}" "${h}"`,{stdio:"ignore"})}a(`ffmpeg -i "${l}" -c:a libopus -b:a 24k "${u}" -y`,{stdio:"ignore"});const f=r.readFileSync(u).toString("base64");try{r.unlinkSync(l)}catch{}try{r.unlinkSync(u)}catch{}try{r.rmdirSync(o)}catch{}return f}catch{return null}}async function J2(i){try{const e=await lc(),{execSync:t}=e("child_process"),s=e("fs"),r=e("path"),n=e("os"),a=r.join(n.tmpdir(),`reactive-probe-${Date.now()}.webm`);s.writeFileSync(a,Buffer.from(i,"base64"));const o=t(`ffprobe -v error -show_entries format=duration -of csv=p=0 "${a}"`,{encoding:"utf8"}).trim();return s.unlinkSync(a),Math.round(parseFloat(o)*1e3)}catch{return null}}var Rm={exports:{}},ql={};/**
|
|
10153
10153
|
* @license React
|
|
10154
10154
|
* react-jsx-runtime.production.min.js
|
|
10155
10155
|
*
|
|
@@ -10242,7 +10242,7 @@ Click the button below to add a new entry.`,noEntriesReadonlyText:"No entries",t
|
|
|
10242
10242
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
10243
10243
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
10244
10244
|
*/var Khe={themeName:"contrast",colorPalette:"light",isPanelless:!1,cssVariables:{"--sjs-general-backcolor":"rgba(255, 255, 255, 1)","--sjs-general-backcolor-dark":"rgba(255, 216, 77, 1)","--sjs-general-backcolor-dim":"rgba(255, 216, 77, 1)","--sjs-general-backcolor-dim-light":"rgba(255, 216, 77, 1)","--sjs-general-backcolor-dim-dark":"rgba(255, 216, 77, 1)","--sjs-general-forecolor":"rgba(0, 0, 0, 1)","--sjs-general-forecolor-light":"rgba(0, 0, 0, 1)","--sjs-general-dim-forecolor":"rgba(0, 0, 0, 1)","--sjs-general-dim-forecolor-light":"rgba(0, 0, 0, 1)","--sjs-primary-backcolor":"rgba(0, 0, 0, 1)","--sjs-primary-backcolor-light":"rgba(255, 216, 77, 1)","--sjs-primary-backcolor-dark":"rgba(83, 83, 83, 1)","--sjs-primary-forecolor":"rgba(255, 255, 255, 1)","--sjs-primary-forecolor-light":"rgba(255, 255, 255, 0.25)","--sjs-base-unit":"8px","--sjs-corner-radius":"4px","--sjs-secondary-backcolor":"rgba(255, 152, 20, 1)","--sjs-secondary-backcolor-light":"rgba(255, 152, 20, 0.1)","--sjs-secondary-backcolor-semi-light":"rgba(255, 152, 20, 0.25)","--sjs-secondary-forecolor":"rgba(255, 255, 255, 1)","--sjs-secondary-forecolor-light":"rgba(255, 255, 255, 0.25)","--sjs-shadow-small":"0px 0px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-small-reset":"0px 0px 0px 0px rgba(0, 0, 0, 1)","--sjs-shadow-medium":"0px 0px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-large":"0px 6px 0px 0px rgba(0, 0, 0, 1)","--sjs-shadow-inner":"0px 0px 0px 2px rgba(0, 0, 0, 1),0px -2px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-inner-reset":"0px 0px 0px 0px rgba(0, 0, 0, 1),0px 0px 0px 0px rgba(0, 0, 0, 1)","--sjs-border-light":"rgba(0, 0, 0, 0.2)","--sjs-border-default":"rgba(0, 0, 0, 1)","--sjs-border-inside":"rgba(0, 0, 0, 0.16)","--sjs-special-red":"rgba(156, 2, 39, 1)","--sjs-special-red-light":"rgba(229, 10, 62, 0.1)","--sjs-special-red-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-green":"rgba(25, 179, 148, 1)","--sjs-special-green-light":"rgba(25, 179, 148, 0.1)","--sjs-special-green-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-blue":"rgba(67, 127, 217, 1)","--sjs-special-blue-light":"rgba(67, 127, 217, 0.1)","--sjs-special-blue-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-yellow":"rgba(255, 152, 20, 1)","--sjs-special-yellow-light":"rgba(255, 152, 20, 0.1)","--sjs-special-yellow-forecolor":"rgba(255, 255, 255, 1)","--sjs-article-font-xx-large-textDecoration":"none","--sjs-article-font-xx-large-fontWeight":"700","--sjs-article-font-xx-large-fontStyle":"normal","--sjs-article-font-xx-large-fontStretch":"normal","--sjs-article-font-xx-large-letterSpacing":"0","--sjs-article-font-xx-large-lineHeight":"64px","--sjs-article-font-xx-large-paragraphIndent":"0px","--sjs-article-font-xx-large-textCase":"none","--sjs-article-font-x-large-textDecoration":"none","--sjs-article-font-x-large-fontWeight":"700","--sjs-article-font-x-large-fontStyle":"normal","--sjs-article-font-x-large-fontStretch":"normal","--sjs-article-font-x-large-letterSpacing":"0","--sjs-article-font-x-large-lineHeight":"56px","--sjs-article-font-x-large-paragraphIndent":"0px","--sjs-article-font-x-large-textCase":"none","--sjs-article-font-large-textDecoration":"none","--sjs-article-font-large-fontWeight":"700","--sjs-article-font-large-fontStyle":"normal","--sjs-article-font-large-fontStretch":"normal","--sjs-article-font-large-letterSpacing":"0","--sjs-article-font-large-lineHeight":"40px","--sjs-article-font-large-paragraphIndent":"0px","--sjs-article-font-large-textCase":"none","--sjs-article-font-medium-textDecoration":"none","--sjs-article-font-medium-fontWeight":"700","--sjs-article-font-medium-fontStyle":"normal","--sjs-article-font-medium-fontStretch":"normal","--sjs-article-font-medium-letterSpacing":"0","--sjs-article-font-medium-lineHeight":"32px","--sjs-article-font-medium-paragraphIndent":"0px","--sjs-article-font-medium-textCase":"none","--sjs-article-font-default-textDecoration":"none","--sjs-article-font-default-fontWeight":"400","--sjs-article-font-default-fontStyle":"normal","--sjs-article-font-default-fontStretch":"normal","--sjs-article-font-default-letterSpacing":"0","--sjs-article-font-default-lineHeight":"28px","--sjs-article-font-default-paragraphIndent":"0px","--sjs-article-font-default-textCase":"none"}},Zhe={themeName:"contrast",colorPalette:"dark",isPanelless:!1,cssVariables:{"--sjs-general-backcolor":"rgba(255, 216, 77, 1)","--sjs-general-backcolor-dark":"rgba(255, 255, 255, 1)","--sjs-general-backcolor-dim":"rgba(0, 0, 0, 1)","--sjs-general-backcolor-dim-light":"rgba(255, 255, 255, 1)","--sjs-general-backcolor-dim-dark":"rgba(255, 255, 255, 1)","--sjs-general-forecolor":"rgba(0, 0, 0, 1)","--sjs-general-forecolor-light":"rgba(0, 0, 0, 1)","--sjs-general-dim-forecolor":"rgba(255, 255, 255, 1)","--sjs-general-dim-forecolor-light":"rgba(255, 255, 255, 1)","--sjs-primary-backcolor":"rgba(0, 0, 0, 1)","--sjs-primary-backcolor-light":"rgba(255, 255, 255, 1)","--sjs-primary-backcolor-dark":"rgba(53, 53, 53, 1)","--sjs-primary-forecolor":"rgba(255, 255, 255, 1)","--sjs-primary-forecolor-light":"rgba(32, 32, 32, 0.25)","--sjs-base-unit":"8px","--sjs-corner-radius":"4px","--sjs-secondary-backcolor":"rgba(255, 152, 20, 1)","--sjs-secondary-backcolor-light":"rgba(255, 152, 20, 0.1)","--sjs-secondary-backcolor-semi-light":"rgba(255, 152, 20, 0.25)","--sjs-secondary-forecolor":"rgba(48, 48, 48, 1)","--sjs-secondary-forecolor-light":"rgba(48, 48, 48, 0.25)","--sjs-shadow-small":"0px 0px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-small-reset":"0px 0px 0px 0px rgba(0, 0, 0, 1)","--sjs-shadow-medium":"0px 0px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-large":"0px 6px 0px 0px rgba(0, 0, 0, 1)","--sjs-shadow-inner":"0px 0px 0px 2px rgba(0, 0, 0, 1),0px -2px 0px 2px rgba(0, 0, 0, 1)","--sjs-shadow-inner-reset":"0px 0px 0px 0px rgba(0, 0, 0, 1),0px 0px 0px 0px rgba(0, 0, 0, 1)","--sjs-border-light":"rgba(232, 192, 51, 1)","--sjs-border-default":"rgba(0, 0, 0, 1)","--sjs-border-inside":"rgba(255, 255, 255, 0.08)","--sjs-special-red":"rgba(156, 2, 39, 1)","--sjs-special-red-light":"rgba(254, 76, 108, 0.1)","--sjs-special-red-forecolor":"rgba(48, 48, 48, 1)","--sjs-special-green":"rgba(36, 197, 164, 1)","--sjs-special-green-light":"rgba(36, 197, 164, 0.1)","--sjs-special-green-forecolor":"rgba(48, 48, 48, 1)","--sjs-special-blue":"rgba(91, 151, 242, 1)","--sjs-special-blue-light":"rgba(91, 151, 242, 0.1)","--sjs-special-blue-forecolor":"rgba(48, 48, 48, 1)","--sjs-special-yellow":"rgba(255, 152, 20, 1)","--sjs-special-yellow-light":"rgba(255, 152, 20, 0.1)","--sjs-special-yellow-forecolor":"rgba(48, 48, 48, 1)","--sjs-article-font-xx-large-textDecoration":"none","--sjs-article-font-xx-large-fontWeight":"700","--sjs-article-font-xx-large-fontStyle":"normal","--sjs-article-font-xx-large-fontStretch":"normal","--sjs-article-font-xx-large-letterSpacing":"0","--sjs-article-font-xx-large-lineHeight":"64px","--sjs-article-font-xx-large-paragraphIndent":"0px","--sjs-article-font-xx-large-textCase":"none","--sjs-article-font-x-large-textDecoration":"none","--sjs-article-font-x-large-fontWeight":"700","--sjs-article-font-x-large-fontStyle":"normal","--sjs-article-font-x-large-fontStretch":"normal","--sjs-article-font-x-large-letterSpacing":"0","--sjs-article-font-x-large-lineHeight":"56px","--sjs-article-font-x-large-paragraphIndent":"0px","--sjs-article-font-x-large-textCase":"none","--sjs-article-font-large-textDecoration":"none","--sjs-article-font-large-fontWeight":"700","--sjs-article-font-large-fontStyle":"normal","--sjs-article-font-large-fontStretch":"normal","--sjs-article-font-large-letterSpacing":"0","--sjs-article-font-large-lineHeight":"40px","--sjs-article-font-large-paragraphIndent":"0px","--sjs-article-font-large-textCase":"none","--sjs-article-font-medium-textDecoration":"none","--sjs-article-font-medium-fontWeight":"700","--sjs-article-font-medium-fontStyle":"normal","--sjs-article-font-medium-fontStretch":"normal","--sjs-article-font-medium-letterSpacing":"0","--sjs-article-font-medium-lineHeight":"32px","--sjs-article-font-medium-paragraphIndent":"0px","--sjs-article-font-medium-textCase":"none","--sjs-article-font-default-textDecoration":"none","--sjs-article-font-default-fontWeight":"400","--sjs-article-font-default-fontStyle":"normal","--sjs-article-font-default-fontStretch":"normal","--sjs-article-font-default-letterSpacing":"0","--sjs-article-font-default-lineHeight":"28px","--sjs-article-font-default-paragraphIndent":"0px","--sjs-article-font-default-textCase":"none"}};Zs("Quest","session"),$s("Quest",(i,e,t,s)=>{var o,l;const r={};let n=0;const a=((o=i.surveyJson)==null?void 0:o.pages)||[{elements:((l=i.surveyJson)==null?void 0:l.elements)||[]}];for(const u of a)for(const h of u.elements||[]){if(!h.name)continue;const c=t.answerQuestion(h,s);s=c.participantState,r[h.name]=c.value,n+=c.duration??0}return{responseData:r,participantState:s,duration:n}},{answerQuestion:(i,e)=>{var s,r,n,a,o;let t;switch(i.type){case"rating":{const l=i.rateMin??1,u=i.rateMax??5;t=l+Math.floor(K.uniform(0,u-l+1));break}case"boolean":t=K.uniform(0,1)>.5;break;case"text":case"comment":t="simulated_response";break;case"radiogroup":case"dropdown":{const l=(r=i.choices)==null?void 0:r[Math.floor(K.uniform(0,((s=i.choices)==null?void 0:s.length)||0))];t=l!==void 0?typeof l=="object"?l.value:l:null;break}case"checkbox":{if((n=i.choices)!=null&&n.length){const l=1+Math.floor(K.uniform(0,i.choices.length));t=[...i.choices].sort(()=>K.uniform(0,1)-.5).slice(0,l).map(u=>typeof u=="object"?u.value:u)}break}case"matrix":{(a=i.rows)!=null&&a.length&&((o=i.columns)!=null&&o.length)&&(t=Object.fromEntries(i.rows.map(l=>{const u=i.columns[Math.floor(K.uniform(0,i.columns.length))];return[typeof l=="object"?l.value:l,typeof u=="object"?u.value:u]})));break}default:t=null}return{value:t,participantState:e,duration:K.uniform(1e3,5e3)}}});const Jhe=(i,e)=>{class t extends ys{getType(){return i}}z.addClass(i,[],function(){return new t("")},"question");class s extends ds{constructor(n){super(n),this.state={value:this.questionBase.value}}get question(){return this.questionBase}renderElement(){const n=e;return S.jsx(n,{setValue:a=>{this.question.value=a}})}}it.Instance.registerQuestion(i,r=>V.createElement(s,r))};function pE({next:i,surveyJson:e,customQuestions:t={},theme:s,containerClass:r}){const n=qi(),a=xi(n);Object.keys(t).forEach(h=>{Jhe(h,t[h])});const o=new je({...e,css:{...Oc,root:"sd-root-modern custom-root"}});o.applyTheme(s??(n.startsWith("dark")?Zhe:Khe));const l=V.useCallback(h=>{i({...h.data})},[i]);o.onComplete.add(l);const u=!!r||n.startsWith("dark");return S.jsxs("div",{className:`min-h-screen ${r??a.containerBg}`,children:[!u&&S.jsx("div",{className:"absolute inset-0 -z-10 h-full w-full bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]"}),S.jsx("div",{className:`max-w-4xl mx-auto px-4${u?" quest-custom-bg":""}`,children:S.jsx(j5,{model:o})})]})}var nu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Xc=typeof window>"u"||"Deno"in globalThis;function hr(){}function Yhe(i,e){return typeof i=="function"?i(e):i}function Xhe(i){return typeof i=="number"&&i>=0&&i!==1/0}function ece(i,e){return Math.max(i+(e||0)-Date.now(),0)}function fE(i,e){return typeof i=="function"?i(e):i}function tce(i,e){return typeof i=="function"?i(e):i}function mE(i,e){const{type:t="all",exact:s,fetchStatus:r,predicate:n,queryKey:a,stale:o}=i;if(a){if(s){if(e.queryHash!==Vg(a,e.options))return!1}else if(!au(e.queryKey,a))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||r&&r!==e.state.fetchStatus||n&&!n(e))}function gE(i,e){const{exact:t,status:s,predicate:r,mutationKey:n}=i;if(n){if(!e.options.mutationKey)return!1;if(t){if(Pa(e.options.mutationKey)!==Pa(n))return!1}else if(!au(e.options.mutationKey,n))return!1}return!(s&&e.state.status!==s||r&&!r(e))}function Vg(i,e){return((e==null?void 0:e.queryKeyHashFn)||Pa)(i)}function Pa(i){return JSON.stringify(i,(e,t)=>Tg(t)?Object.keys(t).sort().reduce((s,r)=>(s[r]=t[r],s),{}):t)}function au(i,e){return i===e?!0:typeof i!=typeof e?!1:i&&e&&typeof i=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!au(i[t],e[t])):!1}function Sg(i,e){if(i===e)return i;const t=vE(i)&&vE(e);if(t||Tg(i)&&Tg(e)){const s=t?i:Object.keys(i),r=s.length,n=t?e:Object.keys(e),a=n.length,o=t?[]:{};let l=0;for(let u=0;u<a;u++){const h=t?u:n[u];(!t&&s.includes(h)||t)&&i[h]===void 0&&e[h]===void 0?(o[h]=void 0,l++):(o[h]=Sg(i[h],e[h]),o[h]===i[h]&&i[h]!==void 0&&l++)}return r===a&&l===r?i:o}return e}function sce(i,e){if(!e||Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(i[t]!==e[t])return!1;return!0}function vE(i){return Array.isArray(i)&&i.length===Object.keys(i).length}function Tg(i){if(!yE(i))return!1;const e=i.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!yE(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(i)!==Object.prototype)}function yE(i){return Object.prototype.toString.call(i)==="[object Object]"}function ice(i){return new Promise(e=>{setTimeout(e,i)})}function rce(i,e,t){if(typeof t.structuralSharing=="function")return t.structuralSharing(i,e);if(t.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Sg(i,e)}catch(s){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${t.queryHash}]: ${s}`)}return Sg(i,e)}return e}function nce(i,e,t=0){const s=[...i,e];return t&&s.length>t?s.slice(1):s}function ace(i,e,t=0){const s=[e,...i];return t&&s.length>t?s.slice(0,-1):s}var ed=Symbol();function CE(i,e){return process.env.NODE_ENV!=="production"&&i.queryFn===ed&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${i.queryHash}'`),!i.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!i.queryFn||i.queryFn===ed?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}var oce=(nT=class extends nu{constructor(){super();at(this,$a);at(this,ia);at(this,Zo);ze(this,Zo,e=>{if(!Xc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){Y(this,ia)||this.setEventListener(Y(this,Zo))}onUnsubscribe(){var e;this.hasListeners()||((e=Y(this,ia))==null||e.call(this),ze(this,ia,void 0))}setEventListener(e){var t;ze(this,Zo,e),(t=Y(this,ia))==null||t.call(this),ze(this,ia,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Y(this,$a)!==e&&(ze(this,$a,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof Y(this,$a)=="boolean"?Y(this,$a):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},$a=new WeakMap,ia=new WeakMap,Zo=new WeakMap,nT),bE=new oce,lce=(aT=class extends nu{constructor(){super();at(this,Jo,!0);at(this,ra);at(this,Yo);ze(this,Yo,e=>{if(!Xc&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}})}onSubscribe(){Y(this,ra)||this.setEventListener(Y(this,Yo))}onUnsubscribe(){var e;this.hasListeners()||((e=Y(this,ra))==null||e.call(this),ze(this,ra,void 0))}setEventListener(e){var t;ze(this,Yo,e),(t=Y(this,ra))==null||t.call(this),ze(this,ra,e(this.setOnline.bind(this)))}setOnline(e){Y(this,Jo)!==e&&(ze(this,Jo,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Y(this,Jo)}},Jo=new WeakMap,ra=new WeakMap,Yo=new WeakMap,aT),td=new lce;function uce(){let i,e;const t=new Promise((r,n)=>{i=r,e=n});t.status="pending",t.catch(()=>{});function s(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{s({status:"fulfilled",value:r}),i(r)},t.reject=r=>{s({status:"rejected",reason:r}),e(r)},t}function hce(i){return Math.min(1e3*2**i,3e4)}function wE(i){return(i??"online")==="online"?td.isOnline():!0}var xE=class extends Error{constructor(i){super("CancelledError"),this.revert=i==null?void 0:i.revert,this.silent=i==null?void 0:i.silent}};function Pg(i){return i instanceof xE}function EE(i){let e=!1,t=0,s=!1,r;const n=uce(),a=v=>{var m;s||(d(new xE(v)),(m=i.abort)==null||m.call(i))},o=()=>{e=!0},l=()=>{e=!1},u=()=>bE.isFocused()&&(i.networkMode==="always"||td.isOnline())&&i.canRun(),h=()=>wE(i.networkMode)&&i.canRun(),c=v=>{var m;s||(s=!0,(m=i.onSuccess)==null||m.call(i,v),r==null||r(),n.resolve(v))},d=v=>{var m;s||(s=!0,(m=i.onError)==null||m.call(i,v),r==null||r(),n.reject(v))},f=()=>new Promise(v=>{var m;r=g=>{(s||u())&&v(g)},(m=i.onPause)==null||m.call(i)}).then(()=>{var v;r=void 0,s||(v=i.onContinue)==null||v.call(i)}),y=()=>{if(s)return;let v;const m=t===0?i.initialPromise:void 0;try{v=m??i.fn()}catch(g){v=Promise.reject(g)}Promise.resolve(v).then(c).catch(g=>{var A;if(s)return;const b=i.retry??(Xc?0:3),x=i.retryDelay??hce,I=typeof x=="function"?x(t,g):x,L=b===!0||typeof b=="number"&&t<b||typeof b=="function"&&b(t,g);if(e||!L){d(g);return}t++,(A=i.onFail)==null||A.call(i,t,g),ice(I).then(()=>u()?void 0:f()).then(()=>{e?d(g):y()})})};return{promise:n,cancel:a,continue:()=>(r==null||r(),n),cancelRetry:o,continueRetry:l,canStart:h,start:()=>(h()?y():f().then(y),n)}}function cce(){let i=[],e=0,t=o=>{o()},s=o=>{o()},r=o=>setTimeout(o,0);const n=o=>{e?i.push(o):r(()=>{t(o)})},a=()=>{const o=i;i=[],o.length&&r(()=>{s(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{n(()=>{o(...l)})},schedule:n,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{s=o},setScheduler:o=>{r=o}}}var _s=cce(),VE=(oT=class{constructor(){at(this,Ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xhe(this.gcTime)&&ze(this,Ha,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Xc?1/0:5*60*1e3))}clearGcTimeout(){Y(this,Ha)&&(clearTimeout(Y(this,Ha)),ze(this,Ha,void 0))}},Ha=new WeakMap,oT),dce=(lT=class extends VE{constructor(e){super();at(this,vr);at(this,Xo);at(this,el);at(this,Zi);at(this,Qs);at(this,Nu);at(this,Qa);ze(this,Qa,!1),ze(this,Nu,e.defaultOptions),this.setOptions(e.options),this.observers=[],ze(this,Zi,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ze(this,Xo,fce(this.options)),this.state=e.state??Y(this,Xo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Y(this,Qs))==null?void 0:e.promise}setOptions(e){this.options={...Y(this,Nu),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,Zi).remove(this)}setData(e,t){const s=rce(this.state.data,e,this.options);return os(this,vr,yn).call(this,{data:s,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),s}setState(e,t){os(this,vr,yn).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var s,r;const t=(s=Y(this,Qs))==null?void 0:s.promise;return(r=Y(this,Qs))==null||r.cancel(e),t?t.then(hr).catch(hr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Xo))}isActive(){return this.observers.some(e=>tce(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ed||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!ece(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=Y(this,Qs))==null||t.continue()}onOnline(){var t;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=Y(this,Qs))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Y(this,Zi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(Y(this,Qs)&&(Y(this,Qa)?Y(this,Qs).cancel({revert:!0}):Y(this,Qs).cancelRetry()),this.scheduleGc()),Y(this,Zi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||os(this,vr,yn).call(this,{type:"invalidate"})}fetch(e,t){var l,u,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(Y(this,Qs))return Y(this,Qs).continueRetry(),Y(this,Qs).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const s=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(ze(this,Qa,!0),s.signal)})},n=()=>{const c=CE(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return r(d),ze(this,Qa,!1),this.options.persister?this.options.persister(c,d,this):c(d)},a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:n};r(a),(l=this.options.behavior)==null||l.onFetch(a,this),ze(this,el,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&os(this,vr,yn).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const o=c=>{var d,f,y,v;Pg(c)&&c.silent||os(this,vr,yn).call(this,{type:"error",error:c}),Pg(c)||((f=(d=Y(this,Zi).config).onError)==null||f.call(d,c,this),(v=(y=Y(this,Zi).config).onSettled)==null||v.call(y,this.state.data,c,this)),this.scheduleGc()};return ze(this,Qs,EE({initialPromise:t==null?void 0:t.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:c=>{var d,f,y,v;if(c===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(m){o(m);return}(f=(d=Y(this,Zi).config).onSuccess)==null||f.call(d,c,this),(v=(y=Y(this,Zi).config).onSettled)==null||v.call(y,c,this.state.error,this),this.scheduleGc()},onError:o,onFail:(c,d)=>{os(this,vr,yn).call(this,{type:"failed",failureCount:c,error:d})},onPause:()=>{os(this,vr,yn).call(this,{type:"pause"})},onContinue:()=>{os(this,vr,yn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),Y(this,Qs).start()}},Xo=new WeakMap,el=new WeakMap,Zi=new WeakMap,Qs=new WeakMap,Nu=new WeakMap,Qa=new WeakMap,vr=new WeakSet,yn=function(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...pce(s.data,this.options),fetchMeta:e.meta??null};case"success":return{...s,data:e.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Pg(r)&&r.revert&&Y(this,el)?{...Y(this,el),fetchStatus:"idle"}:{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),_s.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Y(this,Zi).notify({query:this,type:"updated",action:e})})},lT);function pce(i,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wE(e.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function fce(i){const e=typeof i.initialData=="function"?i.initialData():i.initialData,t=e!==void 0,s=t?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var mce=(uT=class extends nu{constructor(e={}){super();at(this,Hr);this.config=e,ze(this,Hr,new Map)}build(e,t,s){const r=t.queryKey,n=t.queryHash??Vg(r,t);let a=this.get(n);return a||(a=new dce({cache:this,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){Y(this,Hr).has(e.queryHash)||(Y(this,Hr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=Y(this,Hr).get(e.queryHash);t&&(e.destroy(),t===e&&Y(this,Hr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){_s.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Y(this,Hr).get(e)}getAll(){return[...Y(this,Hr).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>mE(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>mE(e,s)):t}notify(e){_s.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_s.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_s.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hr=new WeakMap,uT),gce=(hT=class extends VE{constructor(e){super();at(this,Ur);at(this,Qr);at(this,si);at(this,Ua);this.mutationId=e.mutationId,ze(this,si,e.mutationCache),ze(this,Qr,[]),this.state=e.state||SE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Y(this,Qr).includes(e)||(Y(this,Qr).push(e),this.clearGcTimeout(),Y(this,si).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ze(this,Qr,Y(this,Qr).filter(t=>t!==e)),this.scheduleGc(),Y(this,si).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Y(this,Qr).length||(this.state.status==="pending"?this.scheduleGc():Y(this,si).remove(this))}continue(){var e;return((e=Y(this,Ua))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var r,n,a,o,l,u,h,c,d,f,y,v,m,g,b,x,I,L,A,k;ze(this,Ua,EE({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(P,O)=>{os(this,Ur,ca).call(this,{type:"failed",failureCount:P,error:O})},onPause:()=>{os(this,Ur,ca).call(this,{type:"pause"})},onContinue:()=>{os(this,Ur,ca).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,si).canRun(this)}));const t=this.state.status==="pending",s=!Y(this,Ua).canStart();try{if(!t){os(this,Ur,ca).call(this,{type:"pending",variables:e,isPaused:s}),await((n=(r=Y(this,si).config).onMutate)==null?void 0:n.call(r,e,this));const O=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));O!==this.state.context&&os(this,Ur,ca).call(this,{type:"pending",context:O,variables:e,isPaused:s})}const P=await Y(this,Ua).start();return await((u=(l=Y(this,si).config).onSuccess)==null?void 0:u.call(l,P,e,this.state.context,this)),await((c=(h=this.options).onSuccess)==null?void 0:c.call(h,P,e,this.state.context)),await((f=(d=Y(this,si).config).onSettled)==null?void 0:f.call(d,P,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,P,null,e,this.state.context)),os(this,Ur,ca).call(this,{type:"success",data:P}),P}catch(P){try{throw await((g=(m=Y(this,si).config).onError)==null?void 0:g.call(m,P,e,this.state.context,this)),await((x=(b=this.options).onError)==null?void 0:x.call(b,P,e,this.state.context)),await((L=(I=Y(this,si).config).onSettled)==null?void 0:L.call(I,void 0,P,this.state.variables,this.state.context,this)),await((k=(A=this.options).onSettled)==null?void 0:k.call(A,void 0,P,e,this.state.context)),P}finally{os(this,Ur,ca).call(this,{type:"error",error:P})}}finally{Y(this,si).runNext(this)}}},Qr=new WeakMap,si=new WeakMap,Ua=new WeakMap,Ur=new WeakSet,ca=function(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),_s.batch(()=>{Y(this,Qr).forEach(s=>{s.onMutationUpdate(e)}),Y(this,si).notify({mutation:this,type:"updated",action:e})})},hT);function SE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vce=(cT=class extends nu{constructor(e={}){super();at(this,Li);at(this,Fu);this.config=e,ze(this,Li,new Map),ze(this,Fu,Date.now())}build(e,t,s){const r=new gce({mutationCache:this,mutationId:++cp(this,Fu)._,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){const t=sd(e),s=Y(this,Li).get(t)??[];s.push(e),Y(this,Li).set(t,s),this.notify({type:"added",mutation:e})}remove(e){var s;const t=sd(e);if(Y(this,Li).has(t)){const r=(s=Y(this,Li).get(t))==null?void 0:s.filter(n=>n!==e);r&&(r.length===0?Y(this,Li).delete(t):Y(this,Li).set(t,r))}this.notify({type:"removed",mutation:e})}canRun(e){var s;const t=(s=Y(this,Li).get(sd(e)))==null?void 0:s.find(r=>r.state.status==="pending");return!t||t===e}runNext(e){var s;const t=(s=Y(this,Li).get(sd(e)))==null?void 0:s.find(r=>r!==e&&r.state.isPaused);return(t==null?void 0:t.continue())??Promise.resolve()}clear(){_s.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...Y(this,Li).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(s=>gE(t,s))}findAll(e={}){return this.getAll().filter(t=>gE(e,t))}notify(e){_s.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return _s.batch(()=>Promise.all(e.map(t=>t.continue().catch(hr))))}},Li=new WeakMap,Fu=new WeakMap,cT);function sd(i){var e;return((e=i.options.scope)==null?void 0:e.id)??String(i.mutationId)}function TE(i){return{onFetch:(e,t)=>{var h,c,d,f,y;const s=e.options,r=(d=(c=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,n=((f=e.state.data)==null?void 0:f.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const m=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},g=CE(e.options,e.fetchOptions),b=async(x,I,L)=>{if(v)return Promise.reject();if(I==null&&x.pages.length)return Promise.resolve(x);const A={queryKey:e.queryKey,pageParam:I,direction:L?"backward":"forward",meta:e.options.meta};m(A);const k=await g(A),{maxPages:P}=e.options,O=L?ace:nce;return{pages:O(x.pages,k,P),pageParams:O(x.pageParams,I,P)}};if(r&&n.length){const x=r==="backward",I=x?yce:PE,L={pages:n,pageParams:a},A=I(s,L);o=await b(L,A,x)}else{const x=i??n.length;do{const I=l===0?a[0]??s.initialPageParam:PE(s,o);if(l>0&&I==null)break;o=await b(o,I),l++}while(l<x)}return o};e.options.persister?e.fetchFn=()=>{var v,m;return(m=(v=e.options).persister)==null?void 0:m.call(v,u,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=u}}}function PE(i,{pages:e,pageParams:t}){const s=e.length-1;return e.length>0?i.getNextPageParam(e[s],e,t[s],t):void 0}function yce(i,{pages:e,pageParams:t}){var s;return e.length>0?(s=i.getPreviousPageParam)==null?void 0:s.call(i,e[0],e,t[0],t):void 0}var Cce=(dT=class{constructor(i={}){at(this,Xt);at(this,na);at(this,aa);at(this,tl);at(this,sl);at(this,oa);at(this,il);at(this,rl);ze(this,Xt,i.queryCache||new mce),ze(this,na,i.mutationCache||new vce),ze(this,aa,i.defaultOptions||{}),ze(this,tl,new Map),ze(this,sl,new Map),ze(this,oa,0)}mount(){cp(this,oa)._++,Y(this,oa)===1&&(ze(this,il,bE.subscribe(async i=>{i&&(await this.resumePausedMutations(),Y(this,Xt).onFocus())})),ze(this,rl,td.subscribe(async i=>{i&&(await this.resumePausedMutations(),Y(this,Xt).onOnline())})))}unmount(){var i,e;cp(this,oa)._--,Y(this,oa)===0&&((i=Y(this,il))==null||i.call(this),ze(this,il,void 0),(e=Y(this,rl))==null||e.call(this),ze(this,rl,void 0))}isFetching(i){return Y(this,Xt).findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return Y(this,na).findAll({...i,status:"pending"}).length}getQueryData(i){var t;const e=this.defaultQueryOptions({queryKey:i});return(t=Y(this,Xt).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(i){const e=this.getQueryData(i.queryKey);if(e===void 0)return this.fetchQuery(i);{const t=this.defaultQueryOptions(i),s=Y(this,Xt).build(this,t);return i.revalidateIfStale&&s.isStaleByTime(fE(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(e)}}getQueriesData(i){return Y(this,Xt).findAll(i).map(({queryKey:e,state:t})=>{const s=t.data;return[e,s]})}setQueryData(i,e,t){const s=this.defaultQueryOptions({queryKey:i}),r=Y(this,Xt).get(s.queryHash),n=r==null?void 0:r.state.data,a=Yhe(e,n);if(a!==void 0)return Y(this,Xt).build(this,s).setData(a,{...t,manual:!0})}setQueriesData(i,e,t){return _s.batch(()=>Y(this,Xt).findAll(i).map(({queryKey:s})=>[s,this.setQueryData(s,e,t)]))}getQueryState(i){var t;const e=this.defaultQueryOptions({queryKey:i});return(t=Y(this,Xt).get(e.queryHash))==null?void 0:t.state}removeQueries(i){const e=Y(this,Xt);_s.batch(()=>{e.findAll(i).forEach(t=>{e.remove(t)})})}resetQueries(i,e){const t=Y(this,Xt),s={type:"active",...i};return _s.batch(()=>(t.findAll(i).forEach(r=>{r.reset()}),this.refetchQueries(s,e)))}cancelQueries(i={},e={}){const t={revert:!0,...e},s=_s.batch(()=>Y(this,Xt).findAll(i).map(r=>r.cancel(t)));return Promise.all(s).then(hr).catch(hr)}invalidateQueries(i={},e={}){return _s.batch(()=>{if(Y(this,Xt).findAll(i).forEach(s=>{s.invalidate()}),i.refetchType==="none")return Promise.resolve();const t={...i,type:i.refetchType??i.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(i={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},s=_s.batch(()=>Y(this,Xt).findAll(i).filter(r=>!r.isDisabled()).map(r=>{let n=r.fetch(void 0,t);return t.throwOnError||(n=n.catch(hr)),r.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(s).then(hr)}fetchQuery(i){const e=this.defaultQueryOptions(i);e.retry===void 0&&(e.retry=!1);const t=Y(this,Xt).build(this,e);return t.isStaleByTime(fE(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(hr).catch(hr)}fetchInfiniteQuery(i){return i.behavior=TE(i.pages),this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(hr).catch(hr)}ensureInfiniteQueryData(i){return i.behavior=TE(i.pages),this.ensureQueryData(i)}resumePausedMutations(){return td.isOnline()?Y(this,na).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,Xt)}getMutationCache(){return Y(this,na)}getDefaultOptions(){return Y(this,aa)}setDefaultOptions(i){ze(this,aa,i)}setQueryDefaults(i,e){Y(this,tl).set(Pa(i),{queryKey:i,defaultOptions:e})}getQueryDefaults(i){const e=[...Y(this,tl).values()];let t={};return e.forEach(s=>{au(i,s.queryKey)&&(t={...t,...s.defaultOptions})}),t}setMutationDefaults(i,e){Y(this,sl).set(Pa(i),{mutationKey:i,defaultOptions:e})}getMutationDefaults(i){const e=[...Y(this,sl).values()];let t={};return e.forEach(s=>{au(i,s.mutationKey)&&(t={...t,...s.defaultOptions})}),t}defaultQueryOptions(i){if(i._defaulted)return i;const e={...Y(this,aa).queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return e.queryHash||(e.queryHash=Vg(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===ed&&(e.enabled=!1),e}defaultMutationOptions(i){return i!=null&&i._defaulted?i:{...Y(this,aa).mutations,...(i==null?void 0:i.mutationKey)&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){Y(this,Xt).clear(),Y(this,na).clear()}},Xt=new WeakMap,na=new WeakMap,aa=new WeakMap,tl=new WeakMap,sl=new WeakMap,oa=new WeakMap,il=new WeakMap,rl=new WeakMap,dT),bce=(pT=class extends nu{constructor(e,t){super();at(this,mn);at(this,la);at(this,ua);at(this,vi);at(this,fn);ze(this,la,e),this.setOptions(t),this.bindMethods(),os(this,mn,dp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var s;const t=this.options;this.options=Y(this,la).defaultMutationOptions(e),sce(this.options,t)||Y(this,la).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,vi),observer:this}),t!=null&&t.mutationKey&&this.options.mutationKey&&Pa(t.mutationKey)!==Pa(this.options.mutationKey)?this.reset():((s=Y(this,vi))==null?void 0:s.state.status)==="pending"&&Y(this,vi).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=Y(this,vi))==null||e.removeObserver(this)}onMutationUpdate(e){os(this,mn,dp).call(this),os(this,mn,B0).call(this,e)}getCurrentResult(){return Y(this,ua)}reset(){var e;(e=Y(this,vi))==null||e.removeObserver(this),ze(this,vi,void 0),os(this,mn,dp).call(this),os(this,mn,B0).call(this)}mutate(e,t){var s;return ze(this,fn,t),(s=Y(this,vi))==null||s.removeObserver(this),ze(this,vi,Y(this,la).getMutationCache().build(Y(this,la),this.options)),Y(this,vi).addObserver(this),Y(this,vi).execute(e)}},la=new WeakMap,ua=new WeakMap,vi=new WeakMap,fn=new WeakMap,mn=new WeakSet,dp=function(){var t;const e=((t=Y(this,vi))==null?void 0:t.state)??SE();ze(this,ua,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},B0=function(e){_s.batch(()=>{var t,s,r,n,a,o,l,u;if(Y(this,fn)&&this.hasListeners()){const h=Y(this,ua).variables,c=Y(this,ua).context;(e==null?void 0:e.type)==="success"?((s=(t=Y(this,fn)).onSuccess)==null||s.call(t,e.data,h,c),(n=(r=Y(this,fn)).onSettled)==null||n.call(r,e.data,null,h,c)):(e==null?void 0:e.type)==="error"&&((o=(a=Y(this,fn)).onError)==null||o.call(a,e.error,h,c),(u=(l=Y(this,fn)).onSettled)==null||u.call(l,void 0,e.error,h,c))}this.listeners.forEach(h=>{h(Y(this,ua))})})},pT),IE=p.createContext(void 0),wce=i=>{const e=p.useContext(IE);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},xce=({client:i,children:e})=>(p.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),S.jsx(IE.Provider,{value:i,children:e}));function Ece(i,e){return typeof i=="function"?i(...e):!!i}function Vce(){}function Sce(i,e){const t=wce(),[s]=p.useState(()=>new bce(t,i));p.useEffect(()=>{s.setOptions(i)},[s,i]);const r=p.useSyncExternalStore(p.useCallback(a=>s.subscribe(_s.batchCalls(a)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),n=p.useCallback((a,o)=>{s.mutate(a,o).catch(Vce)},[s]);if(r.error&&Ece(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:n,mutateAsync:r.mutate}}const Ds=[];for(let i=0;i<256;++i)Ds.push((i+256).toString(16).slice(1));function Tce(i,e=0){return(Ds[i[e+0]]+Ds[i[e+1]]+Ds[i[e+2]]+Ds[i[e+3]]+"-"+Ds[i[e+4]]+Ds[i[e+5]]+"-"+Ds[i[e+6]]+Ds[i[e+7]]+"-"+Ds[i[e+8]]+Ds[i[e+9]]+"-"+Ds[i[e+10]]+Ds[i[e+11]]+Ds[i[e+12]]+Ds[i[e+13]]+Ds[i[e+14]]+Ds[i[e+15]]).toLowerCase()}let Ig;const Pce=new Uint8Array(16);function Ice(){if(!Ig){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ig=crypto.getRandomValues.bind(crypto)}return Ig(Pce)}const RE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function AE(i,e,t){if(RE.randomUUID&&!i)return RE.randomUUID();i=i||{};const s=i.random||(i.rng||Ice)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Tce(s)}const ou=15,Rg=30,Ag=19,Rce=29,id=256,Lg=id+1+Rce,LE=2*Lg+1,lu=256,Ace=7,_E=16,DE=17,kE=18,_g=8*2,rd=-1,Lce=1,nd=2,_ce=0,ko=0,OE=1,Dce=3,ci=4,cr=0,ME=1,ad=2,dr=-2,kce=-3,Oo=-5;function od(i){return ld(i.map(([e,t])=>new Array(e).fill(t,0,e)))}function ld(i){return i.reduce((e,t)=>e.concat(Array.isArray(t)?ld(t):t),[])}const NE=[0,1,2,3].concat(...od([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Nt(){const i=this;function e(r){const n=i.dyn_tree,a=i.stat_desc.static_tree,o=i.stat_desc.extra_bits,l=i.stat_desc.extra_base,u=i.stat_desc.max_length;let h,c,d,f,y,v,m=0;for(f=0;f<=ou;f++)r.bl_count[f]=0;for(n[r.heap[r.heap_max]*2+1]=0,h=r.heap_max+1;h<LE;h++)c=r.heap[h],f=n[n[c*2+1]*2+1]+1,f>u&&(f=u,m++),n[c*2+1]=f,!(c>i.max_code)&&(r.bl_count[f]++,y=0,c>=l&&(y=o[c-l]),v=n[c*2],r.opt_len+=v*(f+y),a&&(r.static_len+=v*(a[c*2+1]+y)));if(m!==0){do{for(f=u-1;r.bl_count[f]===0;)f--;r.bl_count[f]--,r.bl_count[f+1]+=2,r.bl_count[u]--,m-=2}while(m>0);for(f=u;f!==0;f--)for(c=r.bl_count[f];c!==0;)d=r.heap[--h],!(d>i.max_code)&&(n[d*2+1]!=f&&(r.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}}function t(r,n){let a=0;do a|=r&1,r>>>=1,a<<=1;while(--n>0);return a>>>1}function s(r,n,a){const o=[];let l=0,u,h,c;for(u=1;u<=ou;u++)o[u]=l=l+a[u-1]<<1;for(h=0;h<=n;h++)c=r[h*2+1],c!==0&&(r[h*2]=t(o[c]++,c))}i.build_tree=function(r){const n=i.dyn_tree,a=i.stat_desc.static_tree,o=i.stat_desc.elems;let l,u,h=-1,c;for(r.heap_len=0,r.heap_max=LE,l=0;l<o;l++)n[l*2]!==0?(r.heap[++r.heap_len]=h=l,r.depth[l]=0):n[l*2+1]=0;for(;r.heap_len<2;)c=r.heap[++r.heap_len]=h<2?++h:0,n[c*2]=1,r.depth[c]=0,r.opt_len--,a&&(r.static_len-=a[c*2+1]);for(i.max_code=h,l=Math.floor(r.heap_len/2);l>=1;l--)r.pqdownheap(n,l);c=o;do l=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(n,1),u=r.heap[1],r.heap[--r.heap_max]=l,r.heap[--r.heap_max]=u,n[c*2]=n[l*2]+n[u*2],r.depth[c]=Math.max(r.depth[l],r.depth[u])+1,n[l*2+1]=n[u*2+1]=c,r.heap[1]=c++,r.pqdownheap(n,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],e(r),s(n,i.max_code,r.bl_count)}}Nt._length_code=[0,1,2,3,4,5,6,7].concat(...od([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Nt.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Nt.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Nt.d_code=function(i){return i<256?NE[i]:NE[256+(i>>>7)]},Nt.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Nt.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Nt.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Nt.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ks(i,e,t,s,r){const n=this;n.static_tree=i,n.extra_bits=e,n.extra_base=t,n.elems=s,n.max_length=r}const Oce=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Mce=od([[144,8],[112,9],[24,7],[8,8]]);ks.static_ltree=ld(Oce.map((i,e)=>[i,Mce[e]]));const Nce=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Fce=od([[30,5]]);ks.static_dtree=ld(Nce.map((i,e)=>[i,Fce[e]])),ks.static_l_desc=new ks(ks.static_ltree,Nt.extra_lbits,id+1,Lg,ou),ks.static_d_desc=new ks(ks.static_dtree,Nt.extra_dbits,0,Rg,ou),ks.static_bl_desc=new ks(null,Nt.extra_blbits,0,Ag,Ace);const qce=9,Bce=8;function Dr(i,e,t,s,r){const n=this;n.good_length=i,n.max_lazy=e,n.nice_length=t,n.max_chain=s,n.func=r}const FE=0,ud=1,Ia=2,pr=[new Dr(0,0,0,0,FE),new Dr(4,4,8,4,ud),new Dr(4,5,16,8,ud),new Dr(4,6,32,32,ud),new Dr(4,4,16,16,Ia),new Dr(8,16,32,32,Ia),new Dr(8,16,128,128,Ia),new Dr(8,32,128,256,Ia),new Dr(32,128,258,1024,Ia),new Dr(32,258,258,4096,Ia)],hd=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],zi=0,cd=1,uu=2,dd=3,$ce=32,Dg=42,pd=113,hu=666,kg=8,Hce=0,Og=1,Qce=2,Qt=3,fd=258,Ii=fd+Qt+1;function qE(i,e,t,s){const r=i[e*2],n=i[t*2];return r<n||r==n&&s[e]<=s[t]}function Uce(){const i=this;let e,t,s,r,n,a,o,l,u,h,c,d,f,y,v,m,g,b,x,I,L,A,k,P,O,D,$,Q,_,B,H,U,G;const j=new Nt,ae=new Nt,X=new Nt;i.depth=[];let ue,ie,se,fe,de,te;i.bl_count=[],i.heap=[],H=[],U=[],G=[];function pe(){u=2*n,c[f-1]=0;for(let J=0;J<f-1;J++)c[J]=0;D=pr[$].max_lazy,_=pr[$].good_length,B=pr[$].nice_length,O=pr[$].max_chain,L=0,g=0,k=0,b=P=Qt-1,I=0,d=0}function Ne(){let J;for(J=0;J<Lg;J++)H[J*2]=0;for(J=0;J<Rg;J++)U[J*2]=0;for(J=0;J<Ag;J++)G[J*2]=0;H[lu*2]=1,i.opt_len=i.static_len=0,ie=se=0}function gt(){j.dyn_tree=H,j.stat_desc=ks.static_l_desc,ae.dyn_tree=U,ae.stat_desc=ks.static_d_desc,X.dyn_tree=G,X.stat_desc=ks.static_bl_desc,de=0,te=0,fe=8,Ne()}i.pqdownheap=function(J,oe){const re=i.heap,he=re[oe];let ye=oe<<1;for(;ye<=i.heap_len&&(ye<i.heap_len&&qE(J,re[ye+1],re[ye],i.depth)&&ye++,!qE(J,he,re[ye],i.depth));)re[oe]=re[ye],oe=ye,ye<<=1;re[oe]=he};function $t(J,oe){let re=-1,he,ye=J[0*2+1],_e=0,We=7,as=4;ye===0&&(We=138,as=3),J[(oe+1)*2+1]=65535;for(let Fs=0;Fs<=oe;Fs++)he=ye,ye=J[(Fs+1)*2+1],!(++_e<We&&he==ye)&&(_e<as?G[he*2]+=_e:he!==0?(he!=re&&G[he*2]++,G[_E*2]++):_e<=10?G[DE*2]++:G[kE*2]++,_e=0,re=he,ye===0?(We=138,as=3):he==ye?(We=6,as=3):(We=7,as=4))}function Us(){let J;for($t(H,j.max_code),$t(U,ae.max_code),X.build_tree(i),J=Ag-1;J>=3&&G[Nt.bl_order[J]*2+1]===0;J--);return i.opt_len+=3*(J+1)+5+5+4,J}function Vt(J){i.pending_buf[i.pending++]=J}function ms(J){Vt(J&255),Vt(J>>>8&255)}function ws(J){Vt(J>>8&255),Vt(J&255&255)}function Ze(J,oe){let re;const he=oe;te>_g-he?(re=J,de|=re<<te&65535,ms(de),de=re>>>_g-te,te+=he-_g):(de|=J<<te&65535,te+=he)}function mt(J,oe){const re=J*2;Ze(oe[re]&65535,oe[re+1]&65535)}function gs(J,oe){let re,he=-1,ye,_e=J[0*2+1],We=0,as=7,Fs=4;for(_e===0&&(as=138,Fs=3),re=0;re<=oe;re++)if(ye=_e,_e=J[(re+1)*2+1],!(++We<as&&ye==_e)){if(We<Fs)do mt(ye,G);while(--We!==0);else ye!==0?(ye!=he&&(mt(ye,G),We--),mt(_E,G),Ze(We-3,2)):We<=10?(mt(DE,G),Ze(We-3,3)):(mt(kE,G),Ze(We-11,7));We=0,he=ye,_e===0?(as=138,Fs=3):ye==_e?(as=6,Fs=3):(as=7,Fs=4)}}function es(J,oe,re){let he;for(Ze(J-257,5),Ze(oe-1,5),Ze(re-4,4),he=0;he<re;he++)Ze(G[Nt.bl_order[he]*2+1],3);gs(H,J-1),gs(U,oe-1)}function Ct(){te==16?(ms(de),de=0,te=0):te>=8&&(Vt(de&255),de>>>=8,te-=8)}function Le(){Ze(Og<<1,3),mt(lu,ks.static_ltree),Ct(),1+fe+10-te<9&&(Ze(Og<<1,3),mt(lu,ks.static_ltree),Ct()),fe=7}function Ye(J,oe){let re,he,ye;if(i.dist_buf[ie]=J,i.lc_buf[ie]=oe&255,ie++,J===0?H[oe*2]++:(se++,J--,H[(Nt._length_code[oe]+id+1)*2]++,U[Nt.d_code(J)*2]++),!(ie&8191)&&$>2){for(re=ie*8,he=L-g,ye=0;ye<Rg;ye++)re+=U[ye*2]*(5+Nt.extra_dbits[ye]);if(re>>>=3,se<Math.floor(ie/2)&&re<Math.floor(he/2))return!0}return ie==ue-1}function we(J,oe){let re,he,ye=0,_e,We;if(ie!==0)do re=i.dist_buf[ye],he=i.lc_buf[ye],ye++,re===0?mt(he,J):(_e=Nt._length_code[he],mt(_e+id+1,J),We=Nt.extra_lbits[_e],We!==0&&(he-=Nt.base_length[_e],Ze(he,We)),re--,_e=Nt.d_code(re),mt(_e,oe),We=Nt.extra_dbits[_e],We!==0&&(re-=Nt.base_dist[_e],Ze(re,We)));while(ye<ie);mt(lu,J),fe=J[lu*2+1]}function Ht(){te>8?ms(de):te>0&&Vt(de&255),de=0,te=0}function Ut(J,oe,re){Ht(),fe=8,ms(oe),ms(~oe),i.pending_buf.set(l.subarray(J,J+oe),i.pending),i.pending+=oe}function ns(J,oe,re){Ze((Hce<<1)+(re?1:0),3),Ut(J,oe)}function ii(J,oe,re){let he,ye,_e=0;$>0?(j.build_tree(i),ae.build_tree(i),_e=Us(),he=i.opt_len+3+7>>>3,ye=i.static_len+3+7>>>3,ye<=he&&(he=ye)):he=ye=oe+5,oe+4<=he&&J!=-1?ns(J,oe,re):ye==he?(Ze((Og<<1)+(re?1:0),3),we(ks.static_ltree,ks.static_dtree)):(Ze((Qce<<1)+(re?1:0),3),es(j.max_code+1,ae.max_code+1,_e+1),we(H,U)),Ne(),re&&Ht()}function js(J){ii(g>=0?g:-1,L-g,J),g=L,e.flush_pending()}function ts(){let J,oe,re,he;do{if(he=u-k-L,he===0&&L===0&&k===0)he=n;else if(he==-1)he--;else if(L>=n+n-Ii){l.set(l.subarray(n,n+n),0),A-=n,L-=n,g-=n,J=f,re=J;do oe=c[--re]&65535,c[re]=oe>=n?oe-n:0;while(--J!==0);J=n,re=J;do oe=h[--re]&65535,h[re]=oe>=n?oe-n:0;while(--J!==0);he+=n}if(e.avail_in===0)return;J=e.read_buf(l,L+k,he),k+=J,k>=Qt&&(d=l[L]&255,d=(d<<m^l[L+1]&255)&v)}while(k<Ii&&e.avail_in!==0)}function xs(J){let oe=65535,re;for(oe>s-5&&(oe=s-5);;){if(k<=1){if(ts(),k===0&&J==ko)return zi;if(k===0)break}if(L+=k,k=0,re=g+oe,(L===0||L>=re)&&(k=L-re,L=re,js(!1),e.avail_out===0)||L-g>=n-Ii&&(js(!1),e.avail_out===0))return zi}return js(J==ci),e.avail_out===0?J==ci?uu:zi:J==ci?dd:cd}function Ss(J){let oe=O,re=L,he,ye,_e=P;const We=L>n-Ii?L-(n-Ii):0;let as=B;const Fs=o,gn=L+fd;let nl=l[re+_e-1],ja=l[re+_e];P>=_&&(oe>>=2),as>k&&(as=k);do if(he=J,!(l[he+_e]!=ja||l[he+_e-1]!=nl||l[he]!=l[re]||l[++he]!=l[re+1])){re+=2,he++;do;while(l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&l[++re]==l[++he]&&re<gn);if(ye=fd-(gn-re),re=gn-fd,ye>_e){if(A=J,_e=ye,ye>=as)break;nl=l[re+_e-1],ja=l[re+_e]}}while((J=h[J&Fs]&65535)>We&&--oe!==0);return _e<=k?_e:k}function zs(J){let oe=0,re;for(;;){if(k<Ii){if(ts(),k<Ii&&J==ko)return zi;if(k===0)break}if(k>=Qt&&(d=(d<<m^l[L+(Qt-1)]&255)&v,oe=c[d]&65535,h[L&o]=c[d],c[d]=L),oe!==0&&(L-oe&65535)<=n-Ii&&Q!=nd&&(b=Ss(oe)),b>=Qt)if(re=Ye(L-A,b-Qt),k-=b,b<=D&&k>=Qt){b--;do L++,d=(d<<m^l[L+(Qt-1)]&255)&v,oe=c[d]&65535,h[L&o]=c[d],c[d]=L;while(--b!==0);L++}else L+=b,b=0,d=l[L]&255,d=(d<<m^l[L+1]&255)&v;else re=Ye(0,l[L]&255),k--,L++;if(re&&(js(!1),e.avail_out===0))return zi}return js(J==ci),e.avail_out===0?J==ci?uu:zi:J==ci?dd:cd}function Ji(J){let oe=0,re,he;for(;;){if(k<Ii){if(ts(),k<Ii&&J==ko)return zi;if(k===0)break}if(k>=Qt&&(d=(d<<m^l[L+(Qt-1)]&255)&v,oe=c[d]&65535,h[L&o]=c[d],c[d]=L),P=b,x=A,b=Qt-1,oe!==0&&P<D&&(L-oe&65535)<=n-Ii&&(Q!=nd&&(b=Ss(oe)),b<=5&&(Q==Lce||b==Qt&&L-A>4096)&&(b=Qt-1)),P>=Qt&&b<=P){he=L+k-Qt,re=Ye(L-1-x,P-Qt),k-=P-1,P-=2;do++L<=he&&(d=(d<<m^l[L+(Qt-1)]&255)&v,oe=c[d]&65535,h[L&o]=c[d],c[d]=L);while(--P!==0);if(I=0,b=Qt-1,L++,re&&(js(!1),e.avail_out===0))return zi}else if(I!==0){if(re=Ye(0,l[L-1]&255),re&&js(!1),L++,k--,e.avail_out===0)return zi}else I=1,L++,k--}return I!==0&&(re=Ye(0,l[L-1]&255),I=0),js(J==ci),e.avail_out===0?J==ci?uu:zi:J==ci?dd:cd}function Ws(J){return J.total_in=J.total_out=0,J.msg=null,i.pending=0,i.pending_out=0,t=pd,r=ko,gt(),pe(),cr}i.deflateInit=function(J,oe,re,he,ye,_e){return he||(he=kg),ye||(ye=Bce),_e||(_e=_ce),J.msg=null,oe==rd&&(oe=6),ye<1||ye>qce||he!=kg||re<9||re>15||oe<0||oe>9||_e<0||_e>nd?dr:(J.dstate=i,a=re,n=1<<a,o=n-1,y=ye+7,f=1<<y,v=f-1,m=Math.floor((y+Qt-1)/Qt),l=new Uint8Array(n*2),h=[],c=[],ue=1<<ye+6,i.pending_buf=new Uint8Array(ue*4),s=ue*4,i.dist_buf=new Uint16Array(ue),i.lc_buf=new Uint8Array(ue),$=oe,Q=_e,Ws(J))},i.deflateEnd=function(){return t!=Dg&&t!=pd&&t!=hu?dr:(i.lc_buf=null,i.dist_buf=null,i.pending_buf=null,c=null,h=null,l=null,i.dstate=null,t==pd?kce:cr)},i.deflateParams=function(J,oe,re){let he=cr;return oe==rd&&(oe=6),oe<0||oe>9||re<0||re>nd?dr:(pr[$].func!=pr[oe].func&&J.total_in!==0&&(he=J.deflate(OE)),$!=oe&&($=oe,D=pr[$].max_lazy,_=pr[$].good_length,B=pr[$].nice_length,O=pr[$].max_chain),Q=re,he)},i.deflateSetDictionary=function(J,oe,re){let he=re,ye,_e=0;if(!oe||t!=Dg)return dr;if(he<Qt)return cr;for(he>n-Ii&&(he=n-Ii,_e=re-he),l.set(oe.subarray(_e,_e+he),0),L=he,g=he,d=l[0]&255,d=(d<<m^l[1]&255)&v,ye=0;ye<=he-Qt;ye++)d=(d<<m^l[ye+(Qt-1)]&255)&v,h[ye&o]=c[d],c[d]=ye;return cr},i.deflate=function(J,oe){let re,he,ye,_e,We;if(oe>ci||oe<0)return dr;if(!J.next_out||!J.next_in&&J.avail_in!==0||t==hu&&oe!=ci)return J.msg=hd[ad-dr],dr;if(J.avail_out===0)return J.msg=hd[ad-Oo],Oo;if(e=J,_e=r,r=oe,t==Dg&&(he=kg+(a-8<<4)<<8,ye=($-1&255)>>1,ye>3&&(ye=3),he|=ye<<6,L!==0&&(he|=$ce),he+=31-he%31,t=pd,ws(he)),i.pending!==0){if(e.flush_pending(),e.avail_out===0)return r=-1,cr}else if(e.avail_in===0&&oe<=_e&&oe!=ci)return e.msg=hd[ad-Oo],Oo;if(t==hu&&e.avail_in!==0)return J.msg=hd[ad-Oo],Oo;if(e.avail_in!==0||k!==0||oe!=ko&&t!=hu){switch(We=-1,pr[$].func){case FE:We=xs(oe);break;case ud:We=zs(oe);break;case Ia:We=Ji(oe);break}if((We==uu||We==dd)&&(t=hu),We==zi||We==uu)return e.avail_out===0&&(r=-1),cr;if(We==cd){if(oe==OE)Le();else if(ns(0,0,!1),oe==Dce)for(re=0;re<f;re++)c[re]=0;if(e.flush_pending(),e.avail_out===0)return r=-1,cr}}return oe!=ci?cr:ME}}function BE(){const i=this;i.next_in_index=0,i.next_out_index=0,i.avail_in=0,i.total_in=0,i.avail_out=0,i.total_out=0}BE.prototype={deflateInit(i,e){const t=this;return t.dstate=new Uce,e||(e=ou),t.dstate.deflateInit(t,i,e)},deflate(i){const e=this;return e.dstate?e.dstate.deflate(e,i):dr},deflateEnd(){const i=this;if(!i.dstate)return dr;const e=i.dstate.deflateEnd();return i.dstate=null,e},deflateParams(i,e){const t=this;return t.dstate?t.dstate.deflateParams(t,i,e):dr},deflateSetDictionary(i,e){const t=this;return t.dstate?t.dstate.deflateSetDictionary(t,i,e):dr},read_buf(i,e,t){const s=this;let r=s.avail_in;return r>t&&(r=t),r===0?0:(s.avail_in-=r,i.set(s.next_in.subarray(s.next_in_index,s.next_in_index+r),e),s.next_in_index+=r,s.total_in+=r,r)},flush_pending(){const i=this;let e=i.dstate.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.next_out.set(i.dstate.pending_buf.subarray(i.dstate.pending_out,i.dstate.pending_out+e),i.next_out_index),i.next_out_index+=e,i.dstate.pending_out+=e,i.total_out+=e,i.avail_out-=e,i.dstate.pending-=e,i.dstate.pending===0&&(i.dstate.pending_out=0))}};function jce(i){const e=this,t=new BE,s=zce(i&&i.chunkSize?i.chunkSize:64*1024),r=ko,n=new Uint8Array(s);let a=i?i.level:rd;typeof a>"u"&&(a=rd),t.deflateInit(a),t.next_out=n,e.append=function(o,l){let u,h,c=0,d=0,f=0;const y=[];if(o.length){t.next_in_index=0,t.next_in=o,t.avail_in=o.length;do{if(t.next_out_index=0,t.avail_out=s,u=t.deflate(r),u!=cr)throw new Error("deflating: "+t.msg);t.next_out_index&&(t.next_out_index==s?y.push(new Uint8Array(n)):y.push(n.subarray(0,t.next_out_index))),f+=t.next_out_index,l&&t.next_in_index>0&&t.next_in_index!=c&&(l(t.next_in_index),c=t.next_in_index)}while(t.avail_in>0||t.avail_out===0);return y.length>1?(h=new Uint8Array(f),y.forEach(function(v){h.set(v,d),d+=v.length})):h=y[0]?new Uint8Array(y[0]):new Uint8Array,h}},e.flush=function(){let o,l,u=0,h=0;const c=[];do{if(t.next_out_index=0,t.avail_out=s,o=t.deflate(ci),o!=ME&&o!=cr)throw new Error("deflating: "+t.msg);s-t.avail_out>0&&c.push(n.slice(0,t.next_out_index)),h+=t.next_out_index}while(t.avail_in>0||t.avail_out===0);return t.deflateEnd(),l=new Uint8Array(h),c.forEach(function(d){l.set(d,u),u+=d.length}),l}}function zce(i){return i+5*(Math.floor(i/16383)+1)}const Wce=15,pt=0,hn=1,Gce=2,di=-2,Ft=-3,$E=-4,cn=-5,Ri=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],HE=1440,Kce=0,Zce=4,Jce=9,Yce=5,Xce=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ede=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],tde=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],sde=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ide=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],rde=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Un=15;function Mg(){const i=this;let e,t,s,r,n,a;function o(u,h,c,d,f,y,v,m,g,b,x){let I,L,A,k,P,O,D,$,Q,_,B,H,U,G,j;_=0,P=c;do s[u[h+_]]++,_++,P--;while(P!==0);if(s[0]==c)return v[0]=-1,m[0]=0,pt;for($=m[0],O=1;O<=Un&&s[O]===0;O++);for(D=O,$<O&&($=O),P=Un;P!==0&&s[P]===0;P--);for(A=P,$>P&&($=P),m[0]=$,G=1<<O;O<P;O++,G<<=1)if((G-=s[O])<0)return Ft;if((G-=s[P])<0)return Ft;for(s[P]+=G,a[1]=O=0,_=1,U=2;--P!==0;)a[U]=O+=s[_],U++,_++;P=0,_=0;do(O=u[h+_])!==0&&(x[a[O]++]=P),_++;while(++P<c);for(c=a[A],a[0]=P=0,_=0,k=-1,H=-$,n[0]=0,B=0,j=0;D<=A;D++)for(I=s[D];I--!==0;){for(;D>H+$;){if(k++,H+=$,j=A-H,j=j>$?$:j,(L=1<<(O=D-H))>I+1&&(L-=I+1,U=D,O<j))for(;++O<j&&!((L<<=1)<=s[++U]);)L-=s[U];if(j=1<<O,b[0]+j>HE)return Ft;n[k]=B=b[0],b[0]+=j,k!==0?(a[k]=P,r[0]=O,r[1]=$,O=P>>>H-$,r[2]=B-n[k-1]-O,g.set(r,(n[k-1]+O)*3)):v[0]=B}for(r[1]=D-H,_>=c?r[0]=192:x[_]<d?(r[0]=x[_]<256?0:96,r[2]=x[_++]):(r[0]=y[x[_]-d]+16+64,r[2]=f[x[_++]-d]),L=1<<D-H,O=P>>>H;O<j;O+=L)g.set(r,(B+O)*3);for(O=1<<D-1;P&O;O>>>=1)P^=O;for(P^=O,Q=(1<<H)-1;(P&Q)!=a[k];)k--,H-=$,Q=(1<<H)-1}return G!==0&&A!=1?cn:pt}function l(u){let h;for(e||(e=[],t=[],s=new Int32Array(Un+1),r=[],n=new Int32Array(Un),a=new Int32Array(Un+1)),t.length<u&&(t=[]),h=0;h<u;h++)t[h]=0;for(h=0;h<Un+1;h++)s[h]=0;for(h=0;h<3;h++)r[h]=0;n.set(s.subarray(0,Un),0),a.set(s.subarray(0,Un+1),0)}i.inflate_trees_bits=function(u,h,c,d,f){let y;return l(19),e[0]=0,y=o(u,0,19,19,null,null,c,h,d,e,t),y==Ft?f.msg="oversubscribed dynamic bit lengths tree":(y==cn||h[0]===0)&&(f.msg="incomplete dynamic bit lengths tree",y=Ft),y},i.inflate_trees_dynamic=function(u,h,c,d,f,y,v,m,g){let b;return l(288),e[0]=0,b=o(c,0,u,257,tde,sde,y,d,m,e,t),b!=pt||d[0]===0?(b==Ft?g.msg="oversubscribed literal/length tree":b!=$E&&(g.msg="incomplete literal/length tree",b=Ft),b):(l(288),b=o(c,u,h,0,ide,rde,v,f,m,e,t),b!=pt||f[0]===0&&u>257?(b==Ft?g.msg="oversubscribed distance tree":b==cn?(g.msg="incomplete distance tree",b=Ft):b!=$E&&(g.msg="empty distance tree with lengths",b=Ft),b):pt)}}Mg.inflate_trees_fixed=function(i,e,t,s){return i[0]=Jce,e[0]=Yce,t[0]=Xce,s[0]=ede,pt};const md=0,QE=1,UE=2,jE=3,zE=4,WE=5,GE=6,Ng=7,KE=8,gd=9;function nde(){const i=this;let e,t=0,s,r=0,n=0,a=0,o=0,l=0,u=0,h=0,c,d=0,f,y=0;function v(m,g,b,x,I,L,A,k){let P,O,D,$,Q,_,B,H,U,G,j,ae,X,ue,ie,se;B=k.next_in_index,H=k.avail_in,Q=A.bitb,_=A.bitk,U=A.write,G=U<A.read?A.read-U-1:A.end-U,j=Ri[m],ae=Ri[g];do{for(;_<20;)H--,Q|=(k.read_byte(B++)&255)<<_,_+=8;if(P=Q&j,O=b,D=x,se=(D+P)*3,($=O[se])===0){Q>>=O[se+1],_-=O[se+1],A.win[U++]=O[se+2],G--;continue}do{if(Q>>=O[se+1],_-=O[se+1],$&16){for($&=15,X=O[se+2]+(Q&Ri[$]),Q>>=$,_-=$;_<15;)H--,Q|=(k.read_byte(B++)&255)<<_,_+=8;P=Q&ae,O=I,D=L,se=(D+P)*3,$=O[se];do if(Q>>=O[se+1],_-=O[se+1],$&16){for($&=15;_<$;)H--,Q|=(k.read_byte(B++)&255)<<_,_+=8;if(ue=O[se+2]+(Q&Ri[$]),Q>>=$,_-=$,G-=X,U>=ue)ie=U-ue,U-ie>0&&2>U-ie?(A.win[U++]=A.win[ie++],A.win[U++]=A.win[ie++],X-=2):(A.win.set(A.win.subarray(ie,ie+2),U),U+=2,ie+=2,X-=2);else{ie=U-ue;do ie+=A.end;while(ie<0);if($=A.end-ie,X>$){if(X-=$,U-ie>0&&$>U-ie)do A.win[U++]=A.win[ie++];while(--$!==0);else A.win.set(A.win.subarray(ie,ie+$),U),U+=$,ie+=$,$=0;ie=0}}if(U-ie>0&&X>U-ie)do A.win[U++]=A.win[ie++];while(--X!==0);else A.win.set(A.win.subarray(ie,ie+X),U),U+=X,ie+=X,X=0;break}else if(!($&64))P+=O[se+2],P+=Q&Ri[$],se=(D+P)*3,$=O[se];else return k.msg="invalid distance code",X=k.avail_in-H,X=_>>3<X?_>>3:X,H+=X,B-=X,_-=X<<3,A.bitb=Q,A.bitk=_,k.avail_in=H,k.total_in+=B-k.next_in_index,k.next_in_index=B,A.write=U,Ft;while(!0);break}if($&64)return $&32?(X=k.avail_in-H,X=_>>3<X?_>>3:X,H+=X,B-=X,_-=X<<3,A.bitb=Q,A.bitk=_,k.avail_in=H,k.total_in+=B-k.next_in_index,k.next_in_index=B,A.write=U,hn):(k.msg="invalid literal/length code",X=k.avail_in-H,X=_>>3<X?_>>3:X,H+=X,B-=X,_-=X<<3,A.bitb=Q,A.bitk=_,k.avail_in=H,k.total_in+=B-k.next_in_index,k.next_in_index=B,A.write=U,Ft);if(P+=O[se+2],P+=Q&Ri[$],se=(D+P)*3,($=O[se])===0){Q>>=O[se+1],_-=O[se+1],A.win[U++]=O[se+2],G--;break}}while(!0)}while(G>=258&&H>=10);return X=k.avail_in-H,X=_>>3<X?_>>3:X,H+=X,B-=X,_-=X<<3,A.bitb=Q,A.bitk=_,k.avail_in=H,k.total_in+=B-k.next_in_index,k.next_in_index=B,A.write=U,pt}i.init=function(m,g,b,x,I,L){e=md,u=m,h=g,c=b,d=x,f=I,y=L,s=null},i.proc=function(m,g,b){let x,I,L,A=0,k=0,P=0,O,D,$,Q;for(P=g.next_in_index,O=g.avail_in,A=m.bitb,k=m.bitk,D=m.write,$=D<m.read?m.read-D-1:m.end-D;;)switch(e){case md:if($>=258&&O>=10&&(m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,b=v(u,h,c,d,f,y,m,g),P=g.next_in_index,O=g.avail_in,A=m.bitb,k=m.bitk,D=m.write,$=D<m.read?m.read-D-1:m.end-D,b!=pt)){e=b==hn?Ng:gd;break}n=u,s=c,r=d,e=QE;case QE:for(x=n;k<x;){if(O!==0)b=pt;else return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);O--,A|=(g.read_byte(P++)&255)<<k,k+=8}if(I=(r+(A&Ri[x]))*3,A>>>=s[I+1],k-=s[I+1],L=s[I],L===0){a=s[I+2],e=GE;break}if(L&16){o=L&15,t=s[I+2],e=UE;break}if(!(L&64)){n=L,r=I/3+s[I+2];break}if(L&32){e=Ng;break}return e=gd,g.msg="invalid literal/length code",b=Ft,m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);case UE:for(x=o;k<x;){if(O!==0)b=pt;else return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);O--,A|=(g.read_byte(P++)&255)<<k,k+=8}t+=A&Ri[x],A>>=x,k-=x,n=h,s=f,r=y,e=jE;case jE:for(x=n;k<x;){if(O!==0)b=pt;else return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);O--,A|=(g.read_byte(P++)&255)<<k,k+=8}if(I=(r+(A&Ri[x]))*3,A>>=s[I+1],k-=s[I+1],L=s[I],L&16){o=L&15,l=s[I+2],e=zE;break}if(!(L&64)){n=L,r=I/3+s[I+2];break}return e=gd,g.msg="invalid distance code",b=Ft,m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);case zE:for(x=o;k<x;){if(O!==0)b=pt;else return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);O--,A|=(g.read_byte(P++)&255)<<k,k+=8}l+=A&Ri[x],A>>=x,k-=x,e=WE;case WE:for(Q=D-l;Q<0;)Q+=m.end;for(;t!==0;){if($===0&&(D==m.end&&m.read!==0&&(D=0,$=D<m.read?m.read-D-1:m.end-D),$===0&&(m.write=D,b=m.inflate_flush(g,b),D=m.write,$=D<m.read?m.read-D-1:m.end-D,D==m.end&&m.read!==0&&(D=0,$=D<m.read?m.read-D-1:m.end-D),$===0)))return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);m.win[D++]=m.win[Q++],$--,Q==m.end&&(Q=0),t--}e=md;break;case GE:if($===0&&(D==m.end&&m.read!==0&&(D=0,$=D<m.read?m.read-D-1:m.end-D),$===0&&(m.write=D,b=m.inflate_flush(g,b),D=m.write,$=D<m.read?m.read-D-1:m.end-D,D==m.end&&m.read!==0&&(D=0,$=D<m.read?m.read-D-1:m.end-D),$===0)))return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);b=pt,m.win[D++]=a,$--,e=md;break;case Ng:if(k>7&&(k-=8,O++,P--),m.write=D,b=m.inflate_flush(g,b),D=m.write,$=D<m.read?m.read-D-1:m.end-D,m.read!=m.write)return m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);e=KE;case KE:return b=hn,m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);case gd:return b=Ft,m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b);default:return b=di,m.bitb=A,m.bitk=k,g.avail_in=O,g.total_in+=P-g.next_in_index,g.next_in_index=P,m.write=D,m.inflate_flush(g,b)}},i.free=function(){}}const ZE=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Mo=0,Fg=1,JE=2,YE=3,XE=4,eV=5,vd=6,yd=7,tV=8,Ra=9;function ade(i,e){const t=this;let s=Mo,r=0,n=0,a=0,o;const l=[0],u=[0],h=new nde;let c=0,d=new Int32Array(HE*3);const f=0,y=new Mg;t.bitk=0,t.bitb=0,t.win=new Uint8Array(e),t.end=e,t.read=0,t.write=0,t.reset=function(v,m){m&&(m[0]=f),s==vd&&h.free(v),s=Mo,t.bitk=0,t.bitb=0,t.read=t.write=0},t.reset(i,null),t.inflate_flush=function(v,m){let g,b,x;return b=v.next_out_index,x=t.read,g=(x<=t.write?t.write:t.end)-x,g>v.avail_out&&(g=v.avail_out),g!==0&&m==cn&&(m=pt),v.avail_out-=g,v.total_out+=g,v.next_out.set(t.win.subarray(x,x+g),b),b+=g,x+=g,x==t.end&&(x=0,t.write==t.end&&(t.write=0),g=t.write-x,g>v.avail_out&&(g=v.avail_out),g!==0&&m==cn&&(m=pt),v.avail_out-=g,v.total_out+=g,v.next_out.set(t.win.subarray(x,x+g),b),b+=g,x+=g),v.next_out_index=b,t.read=x,m},t.proc=function(v,m){let g,b,x,I,L,A,k,P;for(I=v.next_in_index,L=v.avail_in,b=t.bitb,x=t.bitk,A=t.write,k=A<t.read?t.read-A-1:t.end-A;;){let O,D,$,Q,_,B,H,U;switch(s){case Mo:for(;x<3;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}switch(g=b&7,c=g&1,g>>>1){case 0:b>>>=3,x-=3,g=x&7,b>>>=g,x-=g,s=Fg;break;case 1:O=[],D=[],$=[[]],Q=[[]],Mg.inflate_trees_fixed(O,D,$,Q),h.init(O[0],D[0],$[0],0,Q[0],0),b>>>=3,x-=3,s=vd;break;case 2:b>>>=3,x-=3,s=YE;break;case 3:return b>>>=3,x-=3,s=Ra,v.msg="invalid block type",m=Ft,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m)}break;case Fg:for(;x<32;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}if((~b>>>16&65535)!=(b&65535))return s=Ra,v.msg="invalid stored block lengths",m=Ft,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);r=b&65535,b=x=0,s=r!==0?JE:c!==0?yd:Mo;break;case JE:if(L===0||k===0&&(A==t.end&&t.read!==0&&(A=0,k=A<t.read?t.read-A-1:t.end-A),k===0&&(t.write=A,m=t.inflate_flush(v,m),A=t.write,k=A<t.read?t.read-A-1:t.end-A,A==t.end&&t.read!==0&&(A=0,k=A<t.read?t.read-A-1:t.end-A),k===0)))return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);if(m=pt,g=r,g>L&&(g=L),g>k&&(g=k),t.win.set(v.read_buf(I,g),A),I+=g,L-=g,A+=g,k-=g,(r-=g)!==0)break;s=c!==0?yd:Mo;break;case YE:for(;x<14;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}if(n=g=b&16383,(g&31)>29||(g>>5&31)>29)return s=Ra,v.msg="too many length or distance symbols",m=Ft,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);if(g=258+(g&31)+(g>>5&31),!o||o.length<g)o=[];else for(P=0;P<g;P++)o[P]=0;b>>>=14,x-=14,a=0,s=XE;case XE:for(;a<4+(n>>>10);){for(;x<3;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}o[ZE[a++]]=b&7,b>>>=3,x-=3}for(;a<19;)o[ZE[a++]]=0;if(l[0]=7,g=y.inflate_trees_bits(o,l,u,d,v),g!=pt)return m=g,m==Ft&&(o=null,s=Ra),t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);a=0,s=eV;case eV:for(;g=n,!(a>=258+(g&31)+(g>>5&31));){let G,j;for(g=l[0];x<g;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}if(g=d[(u[0]+(b&Ri[g]))*3+1],j=d[(u[0]+(b&Ri[g]))*3+2],j<16)b>>>=g,x-=g,o[a++]=j;else{for(P=j==18?7:j-14,G=j==18?11:3;x<g+P;){if(L!==0)m=pt;else return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);L--,b|=(v.read_byte(I++)&255)<<x,x+=8}if(b>>>=g,x-=g,G+=b&Ri[P],b>>>=P,x-=P,P=a,g=n,P+G>258+(g&31)+(g>>5&31)||j==16&&P<1)return o=null,s=Ra,v.msg="invalid bit length repeat",m=Ft,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);j=j==16?o[P-1]:0;do o[P++]=j;while(--G!==0);a=P}}if(u[0]=-1,_=[],B=[],H=[],U=[],_[0]=9,B[0]=6,g=n,g=y.inflate_trees_dynamic(257+(g&31),1+(g>>5&31),o,_,B,H,U,d,v),g!=pt)return g==Ft&&(o=null,s=Ra),m=g,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);h.init(_[0],B[0],d,H[0],d,U[0]),s=vd;case vd:if(t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,(m=h.proc(t,v,m))!=hn)return t.inflate_flush(v,m);if(m=pt,h.free(v),I=v.next_in_index,L=v.avail_in,b=t.bitb,x=t.bitk,A=t.write,k=A<t.read?t.read-A-1:t.end-A,c===0){s=Mo;break}s=yd;case yd:if(t.write=A,m=t.inflate_flush(v,m),A=t.write,k=A<t.read?t.read-A-1:t.end-A,t.read!=t.write)return t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);s=tV;case tV:return m=hn,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);case Ra:return m=Ft,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m);default:return m=di,t.bitb=b,t.bitk=x,v.avail_in=L,v.total_in+=I-v.next_in_index,v.next_in_index=I,t.write=A,t.inflate_flush(v,m)}}},t.free=function(v){t.reset(v,null),t.win=null,d=null},t.set_dictionary=function(v,m,g){t.win.set(v.subarray(m,m+g),0),t.read=t.write=g},t.sync_point=function(){return s==Fg?1:0}}const ode=32,lde=8,ude=0,sV=1,iV=2,rV=3,nV=4,aV=5,qg=6,cu=7,oV=12,jn=13,hde=[0,0,255,255];function cde(){const i=this;i.mode=0,i.method=0,i.was=[0],i.need=0,i.marker=0,i.wbits=0;function e(t){return!t||!t.istate?di:(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=cu,t.istate.blocks.reset(t,null),pt)}i.inflateEnd=function(t){return i.blocks&&i.blocks.free(t),i.blocks=null,pt},i.inflateInit=function(t,s){return t.msg=null,i.blocks=null,s<8||s>15?(i.inflateEnd(t),di):(i.wbits=s,t.istate.blocks=new ade(t,1<<s),e(t),pt)},i.inflate=function(t,s){let r,n;if(!t||!t.istate||!t.next_in)return di;const a=t.istate;for(s=s==Zce?cn:pt,r=cn;;)switch(a.mode){case ude:if(t.avail_in===0)return r;if(r=s,t.avail_in--,t.total_in++,((a.method=t.read_byte(t.next_in_index++))&15)!=lde){a.mode=jn,t.msg="unknown compression method",a.marker=5;break}if((a.method>>4)+8>a.wbits){a.mode=jn,t.msg="invalid win size",a.marker=5;break}a.mode=sV;case sV:if(t.avail_in===0)return r;if(r=s,t.avail_in--,t.total_in++,n=t.read_byte(t.next_in_index++)&255,((a.method<<8)+n)%31!==0){a.mode=jn,t.msg="incorrect header check",a.marker=5;break}if(!(n&ode)){a.mode=cu;break}a.mode=iV;case iV:if(t.avail_in===0)return r;r=s,t.avail_in--,t.total_in++,a.need=(t.read_byte(t.next_in_index++)&255)<<24&4278190080,a.mode=rV;case rV:if(t.avail_in===0)return r;r=s,t.avail_in--,t.total_in++,a.need+=(t.read_byte(t.next_in_index++)&255)<<16&16711680,a.mode=nV;case nV:if(t.avail_in===0)return r;r=s,t.avail_in--,t.total_in++,a.need+=(t.read_byte(t.next_in_index++)&255)<<8&65280,a.mode=aV;case aV:return t.avail_in===0?r:(r=s,t.avail_in--,t.total_in++,a.need+=t.read_byte(t.next_in_index++)&255,a.mode=qg,Gce);case qg:return a.mode=jn,t.msg="need dictionary",a.marker=0,di;case cu:if(r=a.blocks.proc(t,r),r==Ft){a.mode=jn,a.marker=0;break}if(r==pt&&(r=s),r!=hn)return r;r=s,a.blocks.reset(t,a.was),a.mode=oV;case oV:return t.avail_in=0,hn;case jn:return Ft;default:return di}},i.inflateSetDictionary=function(t,s,r){let n=0,a=r;if(!t||!t.istate||t.istate.mode!=qg)return di;const o=t.istate;return a>=1<<o.wbits&&(a=(1<<o.wbits)-1,n=r-a),o.blocks.set_dictionary(s,n,a),o.mode=cu,pt},i.inflateSync=function(t){let s,r,n,a,o;if(!t||!t.istate)return di;const l=t.istate;if(l.mode!=jn&&(l.mode=jn,l.marker=0),(s=t.avail_in)===0)return cn;for(r=t.next_in_index,n=l.marker;s!==0&&n<4;)t.read_byte(r)==hde[n]?n++:t.read_byte(r)!==0?n=0:n=4-n,r++,s--;return t.total_in+=r-t.next_in_index,t.next_in_index=r,t.avail_in=s,l.marker=n,n!=4?Ft:(a=t.total_in,o=t.total_out,e(t),t.total_in=a,t.total_out=o,l.mode=cu,pt)},i.inflateSyncPoint=function(t){return!t||!t.istate||!t.istate.blocks?di:t.istate.blocks.sync_point()}}function lV(){}lV.prototype={inflateInit(i){const e=this;return e.istate=new cde,i||(i=Wce),e.istate.inflateInit(e,i)},inflate(i){const e=this;return e.istate?e.istate.inflate(e,i):di},inflateEnd(){const i=this;if(!i.istate)return di;const e=i.istate.inflateEnd(i);return i.istate=null,e},inflateSync(){const i=this;return i.istate?i.istate.inflateSync(i):di},inflateSetDictionary(i,e){const t=this;return t.istate?t.istate.inflateSetDictionary(t,i,e):di},read_byte(i){return this.next_in[i]},read_buf(i,e){return this.next_in.subarray(i,i+e)}};function dde(i){const e=this,t=new lV,s=i&&i.chunkSize?Math.floor(i.chunkSize*2):128*1024,r=Kce,n=new Uint8Array(s);let a=!1;t.inflateInit(),t.next_out=n,e.append=function(o,l){const u=[];let h,c,d=0,f=0,y=0;if(o.length!==0){t.next_in_index=0,t.next_in=o,t.avail_in=o.length;do{if(t.next_out_index=0,t.avail_out=s,t.avail_in===0&&!a&&(t.next_in_index=0,a=!0),h=t.inflate(r),a&&h===cn){if(t.avail_in!==0)throw new Error("inflating: bad input")}else if(h!==pt&&h!==hn)throw new Error("inflating: "+t.msg);if((a||h===hn)&&t.avail_in===o.length)throw new Error("inflating: bad input");t.next_out_index&&(t.next_out_index===s?u.push(new Uint8Array(n)):u.push(n.subarray(0,t.next_out_index))),y+=t.next_out_index,l&&t.next_in_index>0&&t.next_in_index!=d&&(l(t.next_in_index),d=t.next_in_index)}while(t.avail_in>0||t.avail_out===0);return u.length>1?(c=new Uint8Array(y),u.forEach(function(v){c.set(v,f),f+=v.length})):c=u[0]?new Uint8Array(u[0]):new Uint8Array,c}},e.flush=function(){t.inflateEnd()}}const pi=4294967295,fi=65535,uV=8,pde=0,fde=99,mde=67324752,hV=134695760,gde=hV,vde=33639248,yde=101010256,Cde=101075792,bde=117853008,Bg=22,cV=20,dV=56,wde=Bg+cV+dV,xde=1,Ede=39169,Vde=10,Sde=1,pV=21589,Tde=6534,Pde=1,Ide=8,Rde=2048,Ade=16,Lde=20,fV=45,mV=51,$g="/",gV=new Date(2107,11,31),vV=new Date(1980,0,1),qt=void 0,zn="undefined",du="function";class yV{constructor(e){return class extends TransformStream{constructor(t,s){const r=new e(s);super({transform(n,a){a.enqueue(r.append(n))},flush(n){const a=r.flush();a&&n.enqueue(a)}})}}}}const _de=64;let CV=2;try{typeof navigator!=zn&&navigator.hardwareConcurrency&&(CV=navigator.hardwareConcurrency)}catch{}const Dde={chunkSize:512*1024,maxWorkers:CV,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:qt,CompressionStreamNative:typeof CompressionStream!=zn&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=zn&&DecompressionStream},Wn=Object.assign({},Dde);function kde(){return Wn}function Ode(i){return Math.max(i.chunkSize,_de)}function Hg(i){const{baseURL:e,chunkSize:t,maxWorkers:s,terminateWorkerTimeout:r,useCompressionStream:n,useWebWorkers:a,Deflate:o,Inflate:l,CompressionStream:u,DecompressionStream:h,workerScripts:c}=i;if(Gn("baseURL",e),Gn("chunkSize",t),Gn("maxWorkers",s),Gn("terminateWorkerTimeout",r),Gn("useCompressionStream",n),Gn("useWebWorkers",a),o&&(Wn.CompressionStream=new yV(o)),l&&(Wn.DecompressionStream=new yV(l)),Gn("CompressionStream",u),Gn("DecompressionStream",h),c!==qt){const{deflate:d,inflate:f}=c;if((d||f)&&(Wn.workerScripts||(Wn.workerScripts={})),d){if(!Array.isArray(d))throw new Error("workerScripts.deflate must be an array");Wn.workerScripts.deflate=d}if(f){if(!Array.isArray(f))throw new Error("workerScripts.inflate must be an array");Wn.workerScripts.inflate=f}}}function Gn(i,e){e!==qt&&(Wn[i]=e)}const Qg={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const i={};for(const e of Object.keys(Qg))for(const t of Object.keys(Qg[e])){const s=Qg[e][t];if(typeof s=="string")i[s]=e+"/"+t;else for(let r=0;r<s.length;r++)i[s[r]]=e+"/"+t}return i})();const bV=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;bV[i]=e}class Ug{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let s=0,r=e.length|0;s<r;s++)t=t>>>8^bV[(t^e[s])&255];this.crc=t}get(){return~this.crc}}class wV extends TransformStream{constructor(){let e;const t=new Ug;super({transform(s,r){t.append(s),r.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,t.get()),e.value=s}}),e=this}}function Cd(i){if(typeof TextEncoder==zn){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const Ys={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],s=Ys.getPartial(t);return s===32?i.concat(e):Ys._shiftRight(e,s,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+Ys.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=Ys.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(t),t=0;if(e===0)return s.concat(i);for(let a=0;a<i.length;a++)s.push(t|i[a]>>>e),t=i[a]<<32-e;const r=i.length?i[i.length-1]:0,n=Ys.getPartial(r);return s.push(Ys.partial(e+n&31,e+n>32?t:s.pop(),1)),s}},bd={bytes:{fromBits(i){const t=Ys.bitLength(i)/8,s=new Uint8Array(t);let r;for(let n=0;n<t;n++)n&3||(r=i[n/4]),s[n]=r>>>24,r<<=8;return s},toBits(i){const e=[];let t,s=0;for(t=0;t<i.length;t++)s=s<<8|i[t],(t&3)===3&&(e.push(s),s=0);return t&3&&e.push(Ys.partial(8*(t&3),s)),e}}},xV={};xV.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=bd.utf8String.toBits(i));const t=e._buffer=Ys.concat(e._buffer,i),s=e._length,r=e._length=s+Ys.bitLength(i);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const n=new Uint32Array(t);let a=0;for(let o=e.blockSize+s-(e.blockSize+s&e.blockSize-1);o<=r;o+=e.blockSize)e._block(n.subarray(16*a,16*(a+1))),a+=1;return t.splice(0,16*a),e}finalize(){const i=this;let e=i._buffer;const t=i._h;e=Ys.concat(e,[Ys.partial(1,1)]);for(let s=e.length+2;s&15;s++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,s){if(i<=19)return e&t|~e&s;if(i<=39)return e^t^s;if(i<=59)return e&t|e&s|t&s;if(i<=79)return e^t^s}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,s=Array(80);for(let u=0;u<16;u++)s[u]=i[u];let r=t[0],n=t[1],a=t[2],o=t[3],l=t[4];for(let u=0;u<=79;u++){u>=16&&(s[u]=e._S(1,s[u-3]^s[u-8]^s[u-14]^s[u-16]));const h=e._S(5,r)+e._f(u,n,a,o)+l+s[u]+e._key[Math.floor(u/20)]|0;l=o,o=a,a=e._S(30,n),n=r,r=h}t[0]=t[0]+r|0,t[1]=t[1]+n|0,t[2]=t[2]+a|0,t[3]=t[3]+o|0,t[4]=t[4]+l|0}};const EV={};EV.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],s=e._tables[1],r=i.length;let n,a,o,l=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(e._key=[a=i.slice(0),o=[]],n=r;n<4*r+28;n++){let u=a[n-1];(n%r===0||r===8&&n%r===4)&&(u=t[u>>>24]<<24^t[u>>16&255]<<16^t[u>>8&255]<<8^t[u&255],n%r===0&&(u=u<<8^u>>>24^l<<24,l=l<<1^(l>>7)*283)),a[n]=a[n-r]^u}for(let u=0;n;u++,n--){const h=a[u&3?n:n-4];n<=4||u<4?o[u]=h:o[u]=s[0][t[h>>>24]]^s[1][t[h>>16&255]]^s[2][t[h>>8&255]]^s[3][t[h&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],s=e[4],r=[],n=[];let a,o,l,u;for(let h=0;h<256;h++)n[(r[h]=h<<1^(h>>7)*283)^h]=h;for(let h=a=0;!t[h];h^=o||1,a=n[a]||1){let c=a^a<<1^a<<2^a<<3^a<<4;c=c>>8^c&255^99,t[h]=c,s[c]=h,u=r[l=r[o=r[h]]];let d=u*16843009^l*65537^o*257^h*16843008,f=r[c]*257^c*16843008;for(let y=0;y<4;y++)i[y][h]=f=f<<24^f>>>8,e[y][c]=d=d<<24^d>>>8}for(let h=0;h<5;h++)i[h]=i[h].slice(0),e[h]=e[h].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],s=t.length/4-2,r=[0,0,0,0],n=this._tables[e],a=n[0],o=n[1],l=n[2],u=n[3],h=n[4];let c=i[0]^t[0],d=i[e?3:1]^t[1],f=i[2]^t[2],y=i[e?1:3]^t[3],v=4,m,g,b;for(let x=0;x<s;x++)m=a[c>>>24]^o[d>>16&255]^l[f>>8&255]^u[y&255]^t[v],g=a[d>>>24]^o[f>>16&255]^l[y>>8&255]^u[c&255]^t[v+1],b=a[f>>>24]^o[y>>16&255]^l[c>>8&255]^u[d&255]^t[v+2],y=a[y>>>24]^o[c>>16&255]^l[d>>8&255]^u[f&255]^t[v+3],v+=4,c=m,d=g,f=b;for(let x=0;x<4;x++)r[e?3&-x:x]=h[c>>>24]<<24^h[d>>16&255]<<16^h[f>>8&255]<<8^h[y&255]^t[v++],m=c,c=d,d=f,f=y,y=m;return r}};const Mde={getRandomValues(i){const e=new Uint32Array(i.buffer),t=s=>{let r=987654321;const n=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&n,s=18e3*(s&65535)+(s>>16)&n,(((r<<16)+s&n)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,r;s<i.length;s+=4){const n=t((r||Math.random())*4294967296);r=n()*987654071,e[s/4]=n()*4294967296|0}return i}},VV={};VV.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,s=i&255;e===255?(e=0,t===255?(t=0,s===255?s=0:++s):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=s}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let s;if(!(s=e.length))return[];const r=Ys.bitLength(e);for(let n=0;n<s;n+=4){this.incCounter(t);const a=i.encrypt(t);e[n]^=a[0],e[n+1]^=a[1],e[n+2]^=a[2],e[n+3]^=a[3]}return Ys.clamp(e,r)}};const Aa={importKey(i){return new Aa.hmacSha1(bd.bytes.toBits(i))},pbkdf2(i,e,t,s){if(t=t||1e4,s<0||t<0)throw new Error("invalid params to pbkdf2");const r=(s>>5)+1<<2;let n,a,o,l,u;const h=new ArrayBuffer(r),c=new DataView(h);let d=0;const f=Ys;for(e=bd.bytes.toBits(e),u=1;d<(r||1);u++){for(n=a=i.encrypt(f.concat(e,[u])),o=1;o<t;o++)for(a=i.encrypt(a),l=0;l<a.length;l++)n[l]^=a[l];for(o=0;d<(r||1)&&o<n.length;o++)c.setInt32(d,n[o]),d+=4}return h.slice(0,s/8)}};Aa.hmacSha1=class{constructor(i){const e=this,t=e._hash=xV.sha1,s=[[],[]];e._baseHash=[new t,new t];const r=e._baseHash[0].blockSize/32;i.length>r&&(i=new t().update(i).finalize());for(let n=0;n<r;n++)s[0][n]=i[n]^909522486,s[1][n]=i[n]^1549556828;e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const Nde=typeof crypto!=zn&&typeof crypto.getRandomValues==du,SV="Invalid password",TV="Invalid signature",PV="zipjs-abort-check-password";function IV(i){return Nde?crypto.getRandomValues(i):Mde.getRandomValues(i)}const No=16,Fde="raw",RV={name:"PBKDF2"},qde={name:"HMAC"},Bde="SHA-1",$de=Object.assign({hash:qde},RV),jg=Object.assign({iterations:1e3,hash:{name:Bde}},RV),Hde=["deriveBits"],pu=[8,12,16],fu=[16,24,32],Kn=10,Qde=[0,0,0,0],wd=typeof crypto!=zn,mu=wd&&crypto.subtle,AV=wd&&typeof mu!=zn,kr=bd.bytes,Ude=EV.aes,jde=VV.ctrGladman,zde=Aa.hmacSha1;let LV=wd&&AV&&typeof mu.importKey==du,_V=wd&&AV&&typeof mu.deriveBits==du;class Wde extends TransformStream{constructor({password:e,rawPassword:t,signed:s,encryptionStrength:r,checkPasswordOnly:n}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:OV(e,t),signed:s,strength:r-1,pending:new Uint8Array})},async transform(a,o){const l=this,{password:u,strength:h,resolveReady:c,ready:d}=l;u?(await Kde(l,h,u,Wi(a,0,pu[h]+2)),a=Wi(a,pu[h]+2),n?o.error(new Error(PV)):c()):await d;const f=new Uint8Array(a.length-Kn-(a.length-Kn)%No);o.enqueue(DV(l,a,f,0,Kn,!0))},async flush(a){const{signed:o,ctr:l,hmac:u,pending:h,ready:c}=this;if(u&&l){await c;const d=Wi(h,0,h.length-Kn),f=Wi(h,h.length-Kn);let y=new Uint8Array;if(d.length){const v=vu(kr,d);u.update(v);const m=l.update(v);y=gu(kr,m)}if(o){const v=Wi(gu(kr,u.digest()),0,Kn);for(let m=0;m<Kn;m++)if(v[m]!=f[m])throw new Error(TV)}a.enqueue(y)}}})}}class Gde extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:s}){let r;super({start(){Object.assign(this,{ready:new Promise(n=>this.resolveReady=n),password:OV(e,t),strength:s-1,pending:new Uint8Array})},async transform(n,a){const o=this,{password:l,strength:u,resolveReady:h,ready:c}=o;let d=new Uint8Array;l?(d=await Zde(o,u,l),h()):await c;const f=new Uint8Array(d.length+n.length-n.length%No);f.set(d,0),a.enqueue(DV(o,n,f,d.length,0))},async flush(n){const{ctr:a,hmac:o,pending:l,ready:u}=this;if(o&&a){await u;let h=new Uint8Array;if(l.length){const c=a.update(vu(kr,l));o.update(c),h=gu(kr,c)}r.signature=gu(kr,o.digest()).slice(0,Kn),n.enqueue(zg(h,r.signature))}}}),r=this}}function DV(i,e,t,s,r,n){const{ctr:a,hmac:o,pending:l}=i,u=e.length-r;l.length&&(e=zg(l,e),t=Xde(t,u-u%No));let h;for(h=0;h<=u-No;h+=No){const c=vu(kr,Wi(e,h,h+No));n&&o.update(c);const d=a.update(c);n||o.update(d),t.set(gu(kr,d),h+s)}return i.pending=Wi(e,h),t}async function Kde(i,e,t,s){const r=await kV(i,e,t,Wi(s,0,pu[e])),n=Wi(s,pu[e]);if(r[0]!=n[0]||r[1]!=n[1])throw new Error(SV)}async function Zde(i,e,t){const s=IV(new Uint8Array(pu[e])),r=await kV(i,e,t,s);return zg(s,r)}async function kV(i,e,t,s){i.password=null;const r=await Jde(Fde,t,$de,!1,Hde),n=await Yde(Object.assign({salt:s},jg),r,8*(fu[e]*2+2)),a=new Uint8Array(n),o=vu(kr,Wi(a,0,fu[e])),l=vu(kr,Wi(a,fu[e],fu[e]*2)),u=Wi(a,fu[e]*2);return Object.assign(i,{keys:{key:o,authentication:l,passwordVerification:u},ctr:new jde(new Ude(o),Array.from(Qde)),hmac:new zde(l)}),u}async function Jde(i,e,t,s,r){if(LV)try{return await mu.importKey(i,e,t,s,r)}catch{return LV=!1,Aa.importKey(e)}else return Aa.importKey(e)}async function Yde(i,e,t){if(_V)try{return await mu.deriveBits(i,e,t)}catch{return _V=!1,Aa.pbkdf2(e,i.salt,jg.iterations,t)}else return Aa.pbkdf2(e,i.salt,jg.iterations,t)}function OV(i,e){return e===qt?Cd(i):e}function zg(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function Xde(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function Wi(i,e,t){return i.subarray(e,t)}function gu(i,e){return i.fromBits(e)}function vu(i,e){return i.toBits(e)}const Fo=12;class epe extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),FV(this,e)},transform(r,n){const a=this;if(a.password){const o=MV(a,r.subarray(0,Fo));if(a.password=null,o[Fo-1]!=a.passwordVerification)throw new Error(SV);r=r.subarray(Fo)}s?n.error(new Error(PV)):n.enqueue(MV(a,r))}})}}class tpe extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),FV(this,e)},transform(s,r){const n=this;let a,o;if(n.password){n.password=null;const l=IV(new Uint8Array(Fo));l[Fo-1]=n.passwordVerification,a=new Uint8Array(s.length+l.length),a.set(NV(n,l),0),o=Fo}else a=new Uint8Array(s.length),o=0;a.set(NV(n,s),o),r.enqueue(a)}})}}function MV(i,e){const t=new Uint8Array(e.length);for(let s=0;s<e.length;s++)t[s]=qV(i)^e[s],Wg(i,t[s]);return t}function NV(i,e){const t=new Uint8Array(e.length);for(let s=0;s<e.length;s++)t[s]=qV(i)^e[s],Wg(i,e[s]);return t}function FV(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new Ug(t[0]),crcKey2:new Ug(t[2])});for(let s=0;s<e.length;s++)Wg(i,e.charCodeAt(s))}function Wg(i,e){let[t,s,r]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),s=$V(Math.imul($V(s+BV(t)),134775813)+1),i.crcKey2.append([s>>>24]),r=~i.crcKey2.get(),i.keys=[t,s,r]}function qV(i){const e=i.keys[2]|2;return BV(Math.imul(e,e^1)>>>8)}function BV(i){return i&255}function $V(i){return i&4294967295}const HV="deflate-raw";class spe extends TransformStream{constructor(e,{chunkSize:t,CompressionStream:s,CompressionStreamNative:r}){super({});const{compressed:n,encrypted:a,useCompressionStream:o,zipCrypto:l,signed:u,level:h}=e,c=this;let d,f,y=QV(super.readable);(!a||l)&&u&&(d=new wV,y=Or(y,d)),n&&(y=jV(y,o,{level:h,chunkSize:t},r,s)),a&&(l?y=Or(y,new tpe(e)):(f=new Gde(e),y=Or(y,f))),UV(c,y,()=>{let v;a&&!l&&(v=f.signature),(!a||l)&&u&&(v=new DataView(d.value.buffer).getUint32(0)),c.signature=v})}}class ipe extends TransformStream{constructor(e,{chunkSize:t,DecompressionStream:s,DecompressionStreamNative:r}){super({});const{zipCrypto:n,encrypted:a,signed:o,signature:l,compressed:u,useCompressionStream:h}=e;let c,d,f=QV(super.readable);a&&(n?f=Or(f,new epe(e)):(d=new Wde(e),f=Or(f,d))),u&&(f=jV(f,h,{chunkSize:t},r,s)),(!a||n)&&o&&(c=new wV,f=Or(f,c)),UV(this,f,()=>{if((!a||n)&&o){const y=new DataView(c.value.buffer);if(l!=y.getUint32(0,!1))throw new Error(TV)}})}}function QV(i){return Or(i,new TransformStream({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function UV(i,e,t){e=Or(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function jV(i,e,t,s,r){try{const n=e&&s?s:r;i=Or(i,new n(HV,t))}catch{if(e)try{i=Or(i,new r(HV,t))}catch{return i}else return i}return i}function Or(i,e){return i.pipeThrough(e)}const rpe="message",npe="start",ape="pull",zV="data",ope="ack",WV="close",GV="deflate",lpe="inflate";class upe extends TransformStream{constructor(e,t){super({});const s=this,{codecType:r}=e;let n;r.startsWith(GV)?n=spe:r.startsWith(lpe)&&(n=ipe);let a=0,o=0;const l=new n(e,t),u=super.readable,h=new TransformStream({transform(d,f){d&&d.length&&(o+=d.length,f.enqueue(d))},flush(){Object.assign(s,{inputSize:o})}}),c=new TransformStream({transform(d,f){d&&d.length&&(a+=d.length,f.enqueue(d))},flush(){const{signature:d}=l;Object.assign(s,{signature:d,outputSize:a,inputSize:o})}});Object.defineProperty(s,"readable",{get(){return u.pipeThrough(h).pipeThrough(l).pipeThrough(c)}})}}class hpe extends TransformStream{constructor(e){let t;super({transform:s,flush(r){t&&t.length&&r.enqueue(t)}});function s(r,n){if(t){const a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length),r=a,t=null}r.length>e?(n.enqueue(r.slice(0,e)),s(r.slice(e),n)):t=r}}}let KV=typeof Worker!=zn;class Gg{constructor(e,{readable:t,writable:s},{options:r,config:n,streamOptions:a,useWebWorkers:o,transferStreams:l,scripts:u},h){const{signal:c}=a;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new hpe(n.chunkSize)).pipeThrough(new cpe(t,a),{signal:c}),writable:s,options:Object.assign({},r),scripts:u,transferStreams:l,terminate(){return new Promise(d=>{const{worker:f,busy:y}=e;f?(y?e.resolveTerminated=d:(f.terminate(),d()),e.interface=null):d()})},onTaskFinished(){const{resolveTerminated:d}=e;d&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),d()),e.busy=!1,h(e)}}),(o&&KV?dpe:ZV)(e,n)}}class cpe extends TransformStream{constructor(e,{onstart:t,onprogress:s,size:r,onend:n}){let a=0;super({async start(){t&&await Kg(t,r)},async transform(o,l){a+=o.length,s&&await Kg(s,a,r),l.enqueue(o)},async flush(){e.size=a,n&&await Kg(n,a)}})}}async function Kg(i,...e){try{await i(...e)}catch{}}function ZV(i,e){return{run:()=>ppe(i,e)}}function dpe(i,e){const{baseURL:t,chunkSize:s}=e;if(!i.interface){let r;try{r=gpe(i.scripts[0],t,i)}catch{return KV=!1,ZV(i,e)}Object.assign(i,{worker:r,interface:{run:()=>fpe(i,{chunkSize:s})}})}return i.interface}async function ppe({options:i,readable:e,writable:t,onTaskFinished:s},r){try{const n=new upe(i,r);await e.pipeThrough(n).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:o,outputSize:l}=n;return{signature:a,inputSize:o,outputSize:l}}finally{s()}}async function fpe(i,e){let t,s;const r=new Promise((d,f)=>{t=d,s=f});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:s,result:r});const{readable:n,options:a,scripts:o}=i,{writable:l,closed:u}=mpe(i.writable),h=xd({type:npe,scripts:o.slice(1),options:a,config:e,readable:n,writable:l},i);h||Object.assign(i,{reader:n.getReader(),writer:l.getWriter()});const c=await r;return h||await l.getWriter().close(),await u,c}function mpe(i){let e;const t=new Promise(r=>e=r);return{writable:new WritableStream({async write(r){const n=i.getWriter();await n.ready,await n.write(r),n.releaseLock()},close(){e()},abort(r){return i.getWriter().abort(r)}}),closed:t}}let JV=!0,YV=!0;function gpe(i,e,t){const s={type:"module"};let r,n;typeof i==du&&(i=i());try{r=new URL(i,e)}catch{r=i}if(JV)try{n=new Worker(r)}catch{JV=!1,n=new Worker(r,s)}else n=new Worker(r,s);return n.addEventListener(rpe,a=>vpe(a,t)),n}function xd(i,{worker:e,writer:t,onTaskFinished:s,transferStreams:r}){try{let{value:n,readable:a,writable:o}=i;const l=[];if(n&&(n.byteLength<n.buffer.byteLength?i.value=n.buffer.slice(0,n.byteLength):i.value=n.buffer,l.push(i.value)),r&&YV?(a&&l.push(a),o&&l.push(o)):i.readable=i.writable=null,l.length)try{return e.postMessage(i,l),!0}catch{YV=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(n){throw t&&t.releaseLock(),s(),n}}async function vpe({data:i},e){const{type:t,value:s,messageId:r,result:n,error:a}=i,{reader:o,writer:l,resolveResult:u,rejectResult:h,onTaskFinished:c}=e;try{if(a){const{message:f,stack:y,code:v,name:m}=a,g=new Error(f);Object.assign(g,{stack:y,code:v,name:m}),d(g)}else{if(t==ape){const{value:f,done:y}=await o.read();xd({type:zV,value:f,done:y,messageId:r},e)}t==zV&&(await l.ready,await l.write(new Uint8Array(s)),xd({type:ope,messageId:r},e)),t==WV&&d(null,n)}}catch(f){xd({type:WV,messageId:r},e),d(f)}function d(f,y){f?h(f):u(y),l&&l.releaseLock(),c()}}let La=[];const Zg=[];let XV=0;async function ype(i,e){const{options:t,config:s}=e,{transferStreams:r,useWebWorkers:n,useCompressionStream:a,codecType:o,compressed:l,signed:u,encrypted:h}=t,{workerScripts:c,maxWorkers:d}=s;e.transferStreams=r||r===qt;const f=!l&&!u&&!h&&!e.transferStreams;return e.useWebWorkers=!f&&(n||n===qt&&s.useWebWorkers),e.scripts=e.useWebWorkers&&c?c[o]:[],t.useCompressionStream=a||a===qt&&s.useCompressionStream,(await y()).run();async function y(){const m=La.find(g=>!g.busy);if(m)return eS(m),new Gg(m,i,e,v);if(La.length<d){const g={indexWorker:XV};return XV++,La.push(g),new Gg(g,i,e,v)}else return new Promise(g=>Zg.push({resolve:g,stream:i,workerOptions:e}))}function v(m){if(Zg.length){const[{resolve:g,stream:b,workerOptions:x}]=Zg.splice(0,1);g(new Gg(m,b,x,v))}else m.worker?(eS(m),Cpe(m,e)):La=La.filter(g=>g!=m)}}function Cpe(i,e){const{config:t}=e,{terminateWorkerTimeout:s}=t;Number.isFinite(s)&&s>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{La=La.filter(r=>r!=i);try{await i.terminate()}catch{}},s))}function eS(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}function bpe(i,e={}){const t=`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={p:{m(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},k(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.v=[1732584193,4023233417,2562383102,271733878,3285377520],t.S=[1518500249,1859775393,2400959708,3395469782],e?(t.C=e.C.slice(0),t.A=e.A.slice(0),t._=e._):t.reset()}reset(){const e=this;return e.C=e.v.slice(0),e.A=[],e._=0,e}update(e){const t=this;"string"==typeof e&&(e=I.I.k(e));const n=t.A=_.concat(t.A,e),r=t._,i=t._=r+_.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.P(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.A;const n=e.C;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.P(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}R(e,t){return t<<e|t>>>32-e}P(t){const n=this,s=n.C,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.R(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.R(5,o)+n.V(e,c,f,a)+l+i[e]+n.S[r.floor(e/20)]|0;l=a,a=f,f=n.R(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.B(I.p.k(e)),M(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.p.k(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},B:class{constructor(e){const t=this,n=t.U=P,r=[[],[]];t.K=[new n,new n];const s=t.K[0].blockSize/32;e.length>s&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.N=new n(t.K[0])}reset(){const e=this;e.N=new e.U(e.K[0]),e.O=!1}update(e){this.O=!0,this.N.update(e)}digest(){const e=this,t=e.N.D(),n=new e.U(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.O)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.p,X=class{constructor(e){const t=this;t.T=[[[],[],[],[],[]],[[],[],[],[],[]]],t.T[0][0][0]||t.W();const n=t.T[0][4],r=t.T[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.S=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.j(e,0)}decrypt(e){return this.j(e,1)}W(){const e=this.T[0],t=this.T[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}j(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.S[t],r=n.length/4-2,i=[0,0,0,0],o=this.T[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.H=e,this.L=t,this.F=t}reset(){this.F=this.L}update(e){return this.q(this.H,e,this.F)}G(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}J(e){0===(e[0]=this.G(e[0]))&&(e[1]=this.G(e[1]))}q(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.J(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.B;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),signed:r,Y:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:o,X:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Z:n,$:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),Y:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:s,X:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Z:t,$:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Z:c,$:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.M(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.M(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,ee:u,passwordVerification:w},Z:new Y(new X(l),e.from(F)),$:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.m(t)}function ae(e,t){return e.k(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,te:new x(r[0]),ne:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.te.append([t]),n=~e.te.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.ne.append([s>>>24]),i=~e.ne.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=-2;function Te(t){return We(t.map((([t,n])=>new e(t).fill(n,0,t))))}function We(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?We(n):n)),[])}const je=[0,1,2,3].concat(...Te([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function He(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.re=n=>{const s=e.se,i=e.oe.ie,o=e.oe.ce;let c,f,a,l=-1;for(n.fe=0,n.ae=573,c=0;o>c;c++)0!==s[2*c]?(n.le[++n.fe]=l=c,n.ue[c]=0):s[2*c+1]=0;for(;2>n.fe;)a=n.le[++n.fe]=2>l?++l:0,s[2*a]=1,n.ue[a]=0,n.we--,i&&(n.he-=i[2*a+1]);for(e.de=l,c=r.floor(n.fe/2);c>=1;c--)n.pe(s,c);a=o;do{c=n.le[1],n.le[1]=n.le[n.fe--],n.pe(s,1),f=n.le[1],n.le[--n.ae]=c,n.le[--n.ae]=f,s[2*a]=s[2*c]+s[2*f],n.ue[a]=r.max(n.ue[c],n.ue[f])+1,s[2*c+1]=s[2*f+1]=a,n.le[1]=a++,n.pe(s,1)}while(n.fe>=2);n.le[--n.ae]=n.le[1],(t=>{const n=e.se,r=e.oe.ie,s=e.oe.ye,i=e.oe.me,o=e.oe.be;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.ge[l]=0;for(n[2*t.le[t.ae]+1]=0,c=t.ae+1;573>c;c++)f=t.le[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.de||(t.ge[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.we+=w*(l+u),r&&(t.he+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.ge[l];)l--;t.ge[l]--,t.ge[l+1]+=2,t.ge[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.ge[l];0!==f;)a=t.le[--c],a>e.de||(n[2*a+1]!=l&&(t.we+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.de,n.ge)}}function Le(e,t,n,r,s){const i=this;i.ie=e,i.ye=t,i.me=n,i.ce=r,i.be=s}He.ke=[0,1,2,3,4,5,6,7].concat(...Te([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),He.ve=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],He.Se=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],He.ze=e=>256>e?je[e]:je[256+(e>>>7)],He.Ce=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],He.xe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],He.Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],He._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Fe=Te([[144,8],[112,9],[24,7],[8,8]]);Le.Ie=We([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Fe[t]])));const qe=Te([[30,5]]);function Ge(e,t,n,r,s){const i=this;i.Pe=e,i.De=t,i.Ve=n,i.Re=r,i.Be=s}Le.Ee=We([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,qe[t]]))),Le.Me=new Le(Le.Ie,He.Ce,257,286,15),Le.Ue=new Le(Le.Ee,He.xe,0,30,15),Le.Ke=new Le(null,He.Ae,0,19,7);const Je=[new Ge(0,0,0,0,0),new Ge(4,4,8,4,1),new Ge(4,5,16,8,1),new Ge(4,6,32,32,1),new Ge(4,4,16,16,2),new Ge(8,16,32,32,2),new Ge(8,16,128,128,2),new Ge(8,32,128,256,2),new Ge(32,128,258,1024,2),new Ge(32,258,258,4096,2)],Qe=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Xe=113,Ye=666,Ze=262;function $e(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function et(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new He,N=new He,O=new He;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.we=e.he=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ne[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Oe[W]=t,e.Te[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(He.ke[n]+256+1)]++,M[2*He.ze(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+He.xe[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Oe[c],s=e.Te[c],c++,0===r?Y(s,t):(i=He.ke[s],Y(i+256+1,t),o=He.Ce[i],0!==o&&(s-=He.ve[i],X(s,o)),r--,i=He.ze(r),Y(i,n),o=He.xe[i],0!==o&&(r-=He.Se[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ne.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.re(e),N.re(e),o=(()=>{let t;for(G(E,K.de),G(M,N.de),O.re(e),t=18;t>=3&&0===U[2*He._e[t]+1];t--);return e.we+=14+3*(t+1),t})(),s=e.we+3+7>>>3,i=e.he+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Le.Ie,Le.Ee)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*He._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.de+1,N.de+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.We()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-Ze){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.je)return;e=t.He(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(Ze>A&&0!==t.je)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-Ze?C-(f-Ze):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.ue=[],e.ge=[],e.le=[],E=[],M=[],U=[],e.pe=(t,n)=>{const r=e.le,s=r[n];let i=n<<1;for(;i<=e.fe&&(i<e.fe&&$e(t,r[i+1],r[i],e.ue)&&i++,!$e(t,s,r[i],e.ue));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.Le=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Fe=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Oe:(t.qe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ne=new i(4*T),s=4*T,e.Oe=new o(T),e.Te=new i(T),D=S,V=G,(t=>(t.Ge=t.Je=0,t.Fe=null,e.pending=0,e.Qe=0,n=Xe,c=0,K.se=E,K.oe=Le.Me,N.se=M,N.oe=Le.Ue,O.se=U,O.oe=Le.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Je[D].De,R=Je[D].Pe,B=Je[D].Ve,I=Je[D].Re,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Xe=()=>42!=n&&n!=Xe&&n!=Ye?Oe:(e.Te=null,e.Oe=null,e.Ne=null,d=null,h=null,u=null,e.qe=null,n==Xe?-3:0),e.Ye=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Oe:(Je[D].Be!=Je[t].Be&&0!==e.Ge&&(r=e.Ze(1)),D!=t&&(D=t,P=Je[D].De,R=Je[D].Pe,B=Je[D].Ve,I=Je[D].Re),V=n,r)},e.$e=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Oe;if(3>i)return 0;for(i>f-Ze&&(i=f-Ze,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ze=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return Oe;if(!r.et||!r.tt&&0!==r.je||n==Ye&&4!=i)return r.Fe=Qe[4],Oe;if(0===r.nt)return r.Fe=Qe[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Xe,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.We(),0===t.nt)return c=-1,0}else if(0===t.je&&I>=i&&4!=i)return t.Fe=Qe[7],-5;if(n==Ye&&0!==t.je)return r.Fe=Qe[7],-5;if(0!==t.je||0!==A||0!=i&&n!=Ye){switch(R=-1,Je[D].Be){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.nt))return 0;if(C-k>=f-Ze&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-Ze||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-Ze>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.nt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.nt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=Ye),0==R||2==R)return 0===t.nt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,Le.Ie),$(),9>1+H+10-F&&(X(2,3),Y(256,Le.Ie),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.We(),0===t.nt)return c=-1,0}}return 4!=i?0:1}}function tt(){const e=this;e.rt=0,e.st=0,e.je=0,e.Ge=0,e.nt=0,e.Je=0}function nt(e){const t=new tt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.Le(f),t.et=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,o=t.Ze(0),0!=o)throw new s("deflating: "+t.Fe);t.st&&(t.st==n?w.push(new i(c)):w.push(c.subarray(0,t.st))),u+=t.st,r&&t.rt>0&&t.rt!=a&&(r(t.rt),a=t.rt)}while(t.je>0||0===t.nt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.st=0,t.nt=n,e=t.Ze(4),1!=e&&0!=e)throw new s("deflating: "+t.Fe);n-t.nt>0&&a.push(c.slice(0,t.st)),f+=t.st}while(t.je>0||0===t.nt);return t.Xe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}tt.prototype={Le(e,t){const n=this;return n.qe=new et,t||(t=15),n.qe.Le(n,e,t)},Ze(e){const t=this;return t.qe?t.qe.Ze(t,e):Oe},Xe(){const e=this;if(!e.qe)return Oe;const t=e.qe.Xe();return e.qe=null,t},Ye(e,t){const n=this;return n.qe?n.qe.Ye(n,e,t):Oe},$e(e,t){const n=this;return n.qe?n.qe.$e(n,e,t):Oe},He(e,t,n){const r=this;let s=r.je;return s>n&&(s=n),0===s?0:(r.je-=s,e.set(r.tt.subarray(r.rt,r.rt+s),t),r.rt+=s,r.Ge+=s,s)},We(){const e=this;let t=e.qe.pending;t>e.nt&&(t=e.nt),0!==t&&(e.et.set(e.qe.Ne.subarray(e.qe.Qe,e.qe.Qe+t),e.st),e.st+=t,e.qe.Qe+=t,e.Je+=t,e.nt-=t,e.qe.pending-=t,0===e.qe.pending&&(e.qe.Qe=0))}};const rt=-2,st=-3,it=-5,ot=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ct=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ft=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],at=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ut=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ht(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return st;if(0>(I-=n[g]))return st;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>1440)return st;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?it:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.it=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==st?f.Fe="oversubscribed dynamic bit lengths tree":a!=it&&0!==r[0]||(f.Fe="incomplete dynamic bit lengths tree",a=st),a},this.ot=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,at,lt,a,i,u,e,t),0!=h||0===i[0]?(h==st?w.Fe="oversubscribed literal/length tree":-4!=h&&(w.Fe="incomplete literal/length tree",h=st),h):(c(288),h=o(s,n,r,0,ut,wt,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==st?w.Fe="oversubscribed distance tree":h==it?(w.Fe="incomplete distance tree",h=st):-4!=h&&(w.Fe="empty distance tree with lengths",h=st),h):0)}}function dt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.rt,p=c.je,w=o.ct,h=o.ft,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ot[e],g=ot[t];do{for(;20>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ot[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.lt(d++))<<h,h+=8;if(v=a[z+2]+(w&ot[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.ut[y++]=o.ut[S++]}while(0!=--u);else o.ut.set(o.ut.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.ut[y++]=o.ut[S++],o.ut[y++]=o.ut[S++],k-=2):(o.ut.set(o.ut.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.ut[y++]=o.ut[S++]}while(0!=--k);else o.ut.set(o.ut.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Fe="invalid distance code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,st;f+=a[z+2],f+=w&ot[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,1):(c.Fe="invalid literal/length code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,st);if(f+=a[z+2],f+=w&ot[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.ut[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.ut[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ct=w,o.ft=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.wt=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.rt,v=y.je,x=e.ct,A=e.ft,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case 0:if(z>=258&&v>=10&&(e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.rt,v=y.je,x=e.ct,A=e.ft,S=e.write,z=S<e.read?e.read-S-1:e.end-S,0!=m)){t=1==m?7:9;break}c=u,n=r,o=h,t=1;case 1:for(b=c;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(16&k){a=15&k,i=n[g+2],t=2;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=7;break}return t=9,y.Fe="invalid literal/length code",m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 2:for(b=a;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}i+=x&ot[b],x>>=b,A-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=4;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Fe="invalid distance code",m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 4:for(b=a;b>A;){if(0===v)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,v--,x|=(255&y.lt(_++))<<A,A+=8}l+=x&ot[b],x>>=b,A-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);e.ut[S++]=e.ut[C++],z--,C==e.end&&(C=0),i--}t=0;break;case 6:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);m=0,e.ut[S++]=f,z--,t=0;break;case 7:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.ht(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);t=8;case 8:return m=1,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);case 9:return m=st,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m);default:return m=rt,e.ct=x,e.ft=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.ht(y,m)}},e.dt=()=>{}}ht.yt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ct,r[0]=ft,0);const pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function yt(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new dt;let h=0,d=new f(4320);const p=new ht;n.ft=0,n.ct=0,n.ut=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.dt(e),s=0,n.ft=0,n.ct=0,n.read=n.write=0},n.reset(e,null),n.ht=(e,t)=>{let r,s,i;return s=e.st,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.nt&&(r=e.nt),0!==r&&t==it&&(t=0),e.nt-=r,e.Je+=r,e.et.set(n.ut.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.nt&&(r=e.nt),0!==r&&t==it&&(t=0),e.nt-=r,e.Je+=r,e.et.set(n.ut.subarray(i,i+r),s),s+=r,i+=r),e.st=s,n.read=i,t},n.wt=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.rt,b=e.je,f=n.ct,y=n.ft,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case 0:for(;3>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ht.yt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Fe="invalid block type",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=9,e.Fe="invalid stored block lengths",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.ht(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(t=0,i=o,i>b&&(i=b),i>k&&(i=k),n.ut.set(e.He(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=9,e.Fe="too many length or distance symbols",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}r[pt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[pt[a++]]=0;if(l[0]=7,i=p.it(r,l,u,d,e),0!=i)return(t=i)==st&&(r=null,s=9),n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ot[i]))+1],w=d[3*(u[0]+(f&ot[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);t=0,b--,f|=(255&e.lt(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ot[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Fe="invalid bit length repeat",t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.ot(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),0!=i)return i==st&&(r=null,s=9),t=i,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=6;case 6:if(n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,1!=(t=w.wt(n,e,t)))return n.ht(e,t);if(t=0,w.dt(e),m=e.rt,b=e.je,f=n.ct,y=n.ft,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=0;break}s=7;case 7:if(n.write=g,t=n.ht(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);s=8;case 8:return t=1,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);case 9:return t=st,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t);default:return t=rt,n.ct=f,n.ft=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.ht(e,t)}}},n.dt=e=>{n.reset(e,null),n.ut=null,d=null},n.bt=(e,t,r)=>{n.ut.set(e.subarray(t,t+r),0),n.read=n.write=r},n.gt=()=>1==s?1:0}const mt=13,bt=[0,0,255,255];function gt(){const e=this;function t(e){return e&&e.kt?(e.Ge=e.Je=0,e.Fe=null,e.kt.mode=7,e.kt.vt.reset(e,null),0):rt}e.mode=0,e.method=0,e.St=[0],e.zt=0,e.marker=0,e.Ct=0,e.xt=t=>(e.vt&&e.vt.dt(t),e.vt=null,0),e.At=(n,r)=>(n.Fe=null,e.vt=null,8>r||r>15?(e.xt(n),rt):(e.Ct=r,n.kt.vt=new yt(n,1<<r),t(n),0)),e._t=(e,t)=>{let n,r;if(!e||!e.kt||!e.tt)return rt;const s=e.kt;for(t=4==t?it:0,n=it;;)switch(s.mode){case 0:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,8!=(15&(s.method=e.lt(e.rt++)))){s.mode=mt,e.Fe="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.Ct){s.mode=mt,e.Fe="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,r=255&e.lt(e.rt++),((s.method<<8)+r)%31!=0){s.mode=mt,e.Fe="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt=(255&e.lt(e.rt++))<<24&4278190080,s.mode=3;case 3:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.lt(e.rt++))<<16&16711680,s.mode=4;case 4:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.lt(e.rt++))<<8&65280,s.mode=5;case 5:return 0===e.je?n:(n=t,e.je--,e.Ge++,s.zt+=255&e.lt(e.rt++),s.mode=6,2);case 6:return s.mode=mt,e.Fe="need dictionary",s.marker=0,rt;case 7:if(n=s.vt.wt(e,n),n==st){s.mode=mt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.vt.reset(e,s.St),s.mode=12;case 12:return e.je=0,1;case mt:return st;default:return rt}},e.It=(e,t,n)=>{let r=0,s=n;if(!e||!e.kt||6!=e.kt.mode)return rt;const i=e.kt;return s<1<<i.Ct||(s=(1<<i.Ct)-1,r=n-s),i.vt.bt(t,r,s),i.mode=7,0},e.Pt=e=>{let n,r,s,i,o;if(!e||!e.kt)return rt;const c=e.kt;if(c.mode!=mt&&(c.mode=mt,c.marker=0),0===(n=e.je))return it;for(r=e.rt,s=c.marker;0!==n&&4>s;)e.lt(r)==bt[s]?s++:s=0!==e.lt(r)?0:4-s,r++,n--;return e.Ge+=r-e.rt,e.rt=r,e.je=n,c.marker=s,4!=s?st:(i=e.Ge,o=e.Je,t(e),e.Ge=i,e.Je=o,c.mode=7,0)},e.Dt=e=>e&&e.kt&&e.kt.vt?e.kt.vt.gt():rt}function kt(){}function vt(e){const t=new kt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.At(),t.et=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,0!==t.je||c||(t.rt=0,c=!0),a=t._t(0),c&&a===it){if(0!==t.je)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Fe);if((c||1===a)&&t.je===e.length)throw new s("inflating: bad input");t.st&&(t.st===n?f.push(new i(o)):f.push(o.subarray(0,t.st))),h+=t.st,r&&t.rt>0&&t.rt!=u&&(r(t.rt),u=t.rt)}while(t.je>0||0===t.nt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.xt()}}kt.prototype={At(e){const t=this;return t.kt=new gt,e||(e=15),t.kt.At(t,e)},_t(e){const t=this;return t.kt?t.kt._t(t,e):rt},xt(){const e=this;if(!e.kt)return rt;const t=e.kt.xt(e);return e.kt=null,t},Pt(){const e=this;return e.kt?e.kt.Pt(e):rt},It(e,t){const n=this;return n.kt?n.kt.It(n,e,t):rt},lt(e){return this.tt[e]},He(e,t){return this.tt.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=nt,self.Inflate=vt};
|
|
10245
|
-
`,s=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(t):URL.createObjectURL(new Blob([t],{type:"text/javascript"}));i({workerScripts:{inflate:[s],deflate:[s]}})}const wpe="Writer iterator completed too soon",xpe="text/plain",Epe="Content-Type",Vpe=64*1024,tS="writable";class Jg{constructor(){this.size=0}init(){this.initialized=!0}}class sS extends Jg{get readable(){const e=this,{chunkSize:t=Vpe}=e,s=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:n=0,size:a,diskNumberStart:o}=s,{chunkOffset:l}=this;r.enqueue(await Yg(e,n+l,Math.min(t,a-l),o)),l+t>a?r.close():this.chunkOffset+=t}});return s}}class Spe extends sS{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const s=this,r=e+t;let a=await(e||r<s.size?s.blob.slice(e,r):s.blob).arrayBuffer();return a.byteLength>t&&(a=a.slice(e,r)),new Uint8Array(a)}}class Tpe extends Jg{constructor(e){super();const t=this,s=new TransformStream,r=[];e&&r.push([Epe,e]),Object.defineProperty(t,tS,{get(){return s.writable}}),t.blob=new Response(s.readable,{headers:r}).blob()}getData(){return this.blob}}class Ppe extends Spe{constructor(e){super(new Blob([e],{type:xpe}))}}class Ipe extends sS{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(s,r)=>{await s.init(),r!=t.length-1&&(e.lastDiskOffset+=s.size),e.size+=s.size})),super.init()}async readUint8Array(e,t,s=0){const r=this,{readers:n}=this;let a,o=s;o==-1&&(o=n.length-1);let l=e;for(;l>=n[o].size;)l-=n[o].size,o++;const u=n[o],h=u.size;if(l+t<=h)a=await Yg(u,l,t);else{const c=h-l;a=new Uint8Array(t),a.set(await Yg(u,l,c)),a.set(await r.readUint8Array(e+c,t-c,s),c)}return r.lastDiskNumber=Math.max(o,r.lastDiskNumber),a}}class iS extends Jg{constructor(e,t=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let r,n,a;const o=new WritableStream({async write(h){const{availableSize:c}=s;if(a)h.length>=c?(await l(h.slice(0,c)),await u(),s.diskOffset+=r.size,s.diskNumber++,a=null,await this.write(h.slice(c))):await l(h);else{const{value:d,done:f}=await e.next();if(f&&!d)throw new Error(wpe);r=d,r.size=0,r.maxSize&&(s.maxSize=r.maxSize),s.availableSize=s.maxSize,await yu(r),n=d.writable,a=n.getWriter(),await this.write(h)}},async close(){await a.ready,await u()}});Object.defineProperty(s,tS,{get(){return o}});async function l(h){const c=h.length;c&&(await a.ready,await a.write(h),r.size+=c,s.size+=c,s.availableSize-=c)}async function u(){n.size=r.size,await a.close()}}}async function yu(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function Rpe(i){return Array.isArray(i)&&(i=new Ipe(i)),i instanceof ReadableStream&&(i={readable:i}),i}function Ape(i){i.writable===qt&&typeof i.next==du&&(i=new iS(i)),i instanceof WritableStream&&(i={writable:i});const{writable:e}=i;return e.size===qt&&(e.size=0),i instanceof iS||Object.assign(i,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),i}function Yg(i,e,t,s){return i.readUint8Array(e,t,s)}"\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("").length==256;const Lpe="filename",_pe="rawFilename",Dpe="comment",kpe="rawComment",Ope="uncompressedSize",Mpe="compressedSize",Npe="offset",rS="diskNumberStart",nS="lastModDate",Fpe="rawLastModDate",aS="lastAccessDate",oS="creationDate",lS="internalFileAttribute",uS="externalFileAttribute",hS="msDosCompatible",Xg="zip64",cS="encrypted",dS="version",pS="versionMadeBy",fS="zipCrypto",qpe=[Lpe,_pe,Mpe,Ope,nS,Fpe,Dpe,kpe,aS,oS,Npe,rS,rS,lS,uS,hS,Xg,cS,dS,pS,fS,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class mS{constructor(e){qpe.forEach(t=>this[t]=e[t])}}const Bpe="File already exists",$pe="Zip file comment exceeds 64KB",Hpe="File entry comment exceeds 64KB",Qpe="File entry name exceeds 64KB",gS="Version exceeds 65535",Upe="The strength must equal 1, 2, or 3",jpe="Extra field type exceeds 65535",zpe="Extra field data exceeds 64KB",ev="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Wpe="Undefined uncompressed size",vS=new Uint8Array([7,0,2,0,65,69,3,0,0]);let tv=0;const yS=[];class Gpe{constructor(e,t={}){e=Ape(e);const s=e.availableSize!==qt&&e.availableSize>0&&e.availableSize!==1/0&&e.maxSize!==qt&&e.maxSize>0&&e.maxSize!==1/0;Object.assign(this,{writer:e,addSplitZipSignature:s,options:t,config:kde(),files:new Map,filenames:new Set,offset:t.offset===qt?e.writable.size:t.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(e="",t,s={}){const r=this,{pendingAddFileCalls:n,config:a}=r;tv<a.maxWorkers?tv++:await new Promise(l=>yS.push(l));let o;try{if(e=e.trim(),r.filenames.has(e))throw new Error(Bpe);return r.filenames.add(e),o=Kpe(r,e,t,s),n.add(o),await o}catch(l){throw r.filenames.delete(e),l}finally{n.delete(o);const l=yS.shift();l?l():tv--}}async close(e=new Uint8Array,t={}){const s=this,{pendingAddFileCalls:r,writer:n}=this,{writable:a}=n;for(;r.size;)await Promise.allSettled(Array.from(r));return await rfe(this,e,t),yt(s,t,"preventClose")||await a.getWriter().close(),n.getData?n.getData():a}}async function Kpe(i,e,t,s){e=e.trim(),s.directory&&!e.endsWith($g)?e+=$g:s.directory=e.endsWith($g);const r=yt(i,s,"encodeText",Cd);let n=r(e);if(n===qt&&(n=Cd(e)),nt(n)>fi)throw new Error(Qpe);const a=s.comment||"";let o=r(a);if(o===qt&&(o=Cd(a)),nt(o)>fi)throw new Error(Hpe);const l=yt(i,s,dS,Lde);if(l>fi)throw new Error(gS);const u=yt(i,s,pS,20);if(u>fi)throw new Error(gS);const h=yt(i,s,nS,new Date),c=yt(i,s,aS),d=yt(i,s,oS),f=yt(i,s,hS,!0),y=yt(i,s,lS,0),v=yt(i,s,uS,0),m=yt(i,s,"passThrough");let g,b;m||(g=yt(i,s,"password"),b=yt(i,s,"rawPassword"));const x=yt(i,s,"encryptionStrength",3),I=yt(i,s,fS),L=yt(i,s,"extendedTimestamp",!0),A=yt(i,s,"keepOrder",!0),k=yt(i,s,"level"),P=yt(i,s,"useWebWorkers"),O=yt(i,s,"bufferedWrite"),D=yt(i,s,"dataDescriptorSignature",!1),$=yt(i,s,"signal"),Q=yt(i,s,"useUnicodeFileNames",!0),_=yt(i,s,"useCompressionStream"),B=yt(i,s,"compressionMethod");let H=yt(i,s,"dataDescriptor",!0),U=yt(i,s,Xg);if(!I&&(g!==qt||b!==qt)&&!(x>=1&&x<=3))throw new Error(Upe);let G=new Uint8Array;const{extraField:j}=s;if(j){let gs=0,es=0;j.forEach(Ct=>gs+=4+nt(Ct)),G=new Uint8Array(gs),j.forEach((Ct,Le)=>{if(Le>fi)throw new Error(jpe);if(nt(Ct)>fi)throw new Error(zpe);ps(G,new Uint16Array([Le]),es),ps(G,new Uint16Array([nt(Ct)]),es+2),ps(G,Ct,es+4),es+=4+nt(Ct)})}let ae=0,X=0,ue=0;if(m&&({uncompressedSize:ue}=s,ue===qt))throw new Error(Wpe);const ie=U===!0;t&&(t=Rpe(t),await yu(t),m?ae=CS(ue):t.size===qt?(H=!0,(U||U===qt)&&(U=!0,ue=ae=pi+1)):(ue=t.size,ae=CS(ue)));const{diskOffset:se,diskNumber:fe,maxSize:de}=i.writer,te=ie||ue>pi,pe=ie||ae>pi,Ne=ie||i.offset+i.pendingEntriesSize-se>pi,$t=yt(i,s,"supportZip64SplitFile",!0)&&ie||fe+Math.ceil(i.pendingEntriesSize/de)>fi;if(Ne||te||pe||$t){if(U===!1||!A)throw new Error(ev);U=!0}U=U||!1;const Us=yt(i,s,cS),{signature:Vt}=s;s=Object.assign({},s,{rawFilename:n,rawComment:o,version:l,versionMadeBy:u,lastModDate:h,lastAccessDate:c,creationDate:d,rawExtraField:G,zip64:U,zip64UncompressedSize:te,zip64CompressedSize:pe,zip64Offset:Ne,zip64DiskNumberStart:$t,password:g,rawPassword:b,level:!_&&i.config.CompressionStream===qt&&i.config.CompressionStreamNative===qt?0:k,useWebWorkers:P,encryptionStrength:x,extendedTimestamp:L,zipCrypto:I,bufferedWrite:O,keepOrder:A,useUnicodeFileNames:Q,dataDescriptor:H,dataDescriptorSignature:D,signal:$,msDosCompatible:f,internalFileAttribute:y,externalFileAttribute:v,useCompressionStream:_,passThrough:m,encrypted:!!(g&&nt(g)||b&&nt(b))||m&&Us,signature:Vt,compressionMethod:B});const ms=Ype(s),ws=efe(s),Ze=nt(ms.localHeaderArray,ws.dataDescriptorArray);X=Ze+ae,i.options.usdz&&(X+=X+64),i.pendingEntriesSize+=X;let mt;try{mt=await Zpe(i,e,t,{headerInfo:ms,dataDescriptorInfo:ws,metadataSize:Ze},s)}finally{i.pendingEntriesSize-=X}return Object.assign(mt,{name:e,comment:a,extraField:j}),new mS(mt)}async function Zpe(i,e,t,s,r){const{files:n,writer:a}=i,{keepOrder:o,dataDescriptor:l,signal:u}=r,{headerInfo:h}=s,{usdz:c}=i.options,d=Array.from(n.values()).pop();let f={},y,v,m,g,b,x,I;n.set(e,f);try{let P;o&&(P=d&&d.lock,L()),(r.bufferedWrite||i.writerLocked||i.bufferedWrites&&o||!l)&&!c?(x=new TransformStream,I=new Response(x.readable).blob(),x.writable.size=0,y=!0,i.bufferedWrites++,await yu(a)):(x=a,await A()),await yu(x);const{writable:O}=a;let{diskOffset:D}=a;if(i.addSplitZipSignature){delete i.addSplitZipSignature;const Q=new Uint8Array(4),_=Os(Q);rt(_,0,hV),await Mr(O,Q),i.offset+=4}c&&Xpe(s,i.offset-D),y||(await P,await k(O));const{diskNumber:$}=a;if(b=!0,f.diskNumberStart=$,f=await Jpe(t,x,f,s,i.config,r),b=!1,n.set(e,f),f.filename=e,y){await x.writable.getWriter().close();let Q=await I;await P,await A(),g=!0,l||(Q=await sfe(f,Q,O,r)),await k(O),f.diskNumberStart=a.diskNumber,D=a.diskOffset,await Q.stream().pipeTo(O,{preventClose:!0,preventAbort:!0,signal:u}),O.size+=Q.size,g=!1}if(f.offset=i.offset-D,f.zip64)ife(f,r);else if(f.offset>pi)throw new Error(ev);return i.offset+=f.size,f}catch(P){if(y&&g||!y&&b){if(i.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}y?i.offset+=x.writable.size:i.offset=x.writable.size}throw n.delete(e),P}finally{y&&i.bufferedWrites--,m&&m(),v&&v()}function L(){f.lock=new Promise(P=>m=P)}async function A(){i.writerLocked=!0;const{lockWriter:P}=i;i.lockWriter=new Promise(O=>v=()=>{i.writerLocked=!1,O()}),await P}async function k(P){nt(h.localHeaderArray)>a.availableSize&&(a.availableSize=0,await Mr(P,new Uint8Array))}}async function Jpe(i,e,{diskNumberStart:t,lock:s},r,n,a){const{headerInfo:o,dataDescriptorInfo:l,metadataSize:u}=r,{localHeaderArray:h,headerArray:c,lastModDate:d,rawLastModDate:f,encrypted:y,compressed:v,version:m,compressionMethod:g,rawExtraFieldExtendedTimestamp:b,extraFieldExtendedTimestampFlag:x,rawExtraFieldNTFS:I,rawExtraFieldAES:L}=o,{dataDescriptorArray:A}=l,{rawFilename:k,lastAccessDate:P,creationDate:O,password:D,rawPassword:$,level:Q,zip64:_,zip64UncompressedSize:B,zip64CompressedSize:H,zip64Offset:U,zip64DiskNumberStart:G,zipCrypto:j,dataDescriptor:ae,directory:X,versionMadeBy:ue,rawComment:ie,rawExtraField:se,useWebWorkers:fe,onstart:de,onprogress:te,onend:pe,signal:Ne,encryptionStrength:gt,extendedTimestamp:$t,msDosCompatible:Us,internalFileAttribute:Vt,externalFileAttribute:ms,useCompressionStream:ws,passThrough:Ze}=a,mt={lock:s,versionMadeBy:ue,zip64:_,directory:!!X,filenameUTF8:!0,rawFilename:k,commentUTF8:!0,rawComment:ie,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:I,rawExtraFieldAES:L,rawExtraField:se,extendedTimestamp:$t,msDosCompatible:Us,internalFileAttribute:Vt,externalFileAttribute:ms,diskNumberStart:t};let{signature:gs,uncompressedSize:es}=a,Ct=0;Ze||(es=0);const{writable:Le}=e;if(i){i.chunkSize=Ode(n),await Mr(Le,h);const we=i.readable,Ht=we.size=i.size,Ut={options:{codecType:GV,level:Q,rawPassword:$,password:D,encryptionStrength:gt,zipCrypto:y&&j,passwordVerification:y&&j&&f>>8&255,signed:!Ze,compressed:v&&!Ze,encrypted:y&&!Ze,useWebWorkers:fe,useCompressionStream:ws,transferStreams:!1},config:n,streamOptions:{signal:Ne,size:Ht,onstart:de,onprogress:te,onend:pe}},ns=await ype({readable:we,writable:Le},Ut);Ct=ns.outputSize,Ze||(es=ns.inputSize,gs=ns.signature),Le.size+=es}else await Mr(Le,h);let Ye;if(_){let we=4;B&&(we+=8),H&&(we+=8),U&&(we+=8),G&&(we+=4),Ye=new Uint8Array(we)}else Ye=new Uint8Array;return tfe({signature:gs,rawExtraFieldZip64:Ye,compressedSize:Ct,uncompressedSize:es,headerInfo:o,dataDescriptorInfo:l},a),ae&&await Mr(Le,A),Object.assign(mt,{uncompressedSize:es,compressedSize:Ct,lastModDate:d,rawLastModDate:f,creationDate:O,lastAccessDate:P,encrypted:y,zipCrypto:j,size:u+Ct,compressionMethod:g,version:m,headerArray:c,signature:gs,rawExtraFieldZip64:Ye,extraFieldExtendedTimestampFlag:x,zip64UncompressedSize:B,zip64CompressedSize:H,zip64Offset:U,zip64DiskNumberStart:G}),mt}function Ype(i){const{rawFilename:e,lastModDate:t,lastAccessDate:s,creationDate:r,level:n,zip64:a,zipCrypto:o,useUnicodeFileNames:l,dataDescriptor:u,directory:h,rawExtraField:c,encryptionStrength:d,extendedTimestamp:f,encrypted:y}=i,v=n!==0&&!h;let{version:m,compressionMethod:g}=i,b;if(y&&!o){b=new Uint8Array(nt(vS)+2);const U=Os(b);ft(U,0,Ede),ps(b,vS,2),Ed(U,8,d)}else b=new Uint8Array;let x,I,L;if(f){I=new Uint8Array(9+(s?4:0)+(r?4:0));const U=Os(I);ft(U,0,pV),ft(U,2,nt(I)-4),L=1+(s?2:0)+(r?4:0),Ed(U,4,L);let G=5;rt(U,G,Math.floor(t.getTime()/1e3)),G+=4,s&&(rt(U,G,Math.floor(s.getTime()/1e3)),G+=4),r&&rt(U,G,Math.floor(r.getTime()/1e3));try{x=new Uint8Array(36);const j=Os(x),ae=sv(t);ft(j,0,Vde),ft(j,2,32),ft(j,8,Sde),ft(j,10,24),mi(j,12,ae),mi(j,20,sv(s)||ae),mi(j,28,sv(r)||ae)}catch{x=new Uint8Array}}else x=I=new Uint8Array;let A=0;l&&(A=A|Rde),u&&(A=A|Ide),g===qt&&(g=v?uV:pde),g==uV&&(n>=1&&n<3&&(A=A|6),n>=3&&n<5&&(A=A|1),n===9&&(A=A|2)),a&&(m=m>fV?m:fV),y&&(A=A|Pde,o||(m=m>mV?m:mV,b[9]=g,g=fde));const k=new Uint8Array(26),P=Os(k);ft(P,0,m),ft(P,2,A),ft(P,4,g);const O=new Uint32Array(1),D=Os(O);let $;t<vV?$=vV:t>gV?$=gV:$=t,ft(D,0,($.getHours()<<6|$.getMinutes())<<5|$.getSeconds()/2),ft(D,2,($.getFullYear()-1980<<4|$.getMonth()+1)<<5|$.getDate());const Q=O[0];rt(P,6,Q),ft(P,22,nt(e));const _=nt(b,I,x,c);ft(P,24,_);const B=new Uint8Array(30+nt(e)+_),H=Os(B);return rt(H,0,mde),ps(B,k,4),ps(B,e,30),ps(B,b,30+nt(e)),ps(B,I,30+nt(e,b)),ps(B,x,30+nt(e,b,I)),ps(B,c,30+nt(e,b,I,x)),{localHeaderArray:B,headerArray:k,headerView:P,lastModDate:t,rawLastModDate:Q,encrypted:y,compressed:v,version:m,compressionMethod:g,extraFieldExtendedTimestampFlag:L,rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:x,rawExtraFieldAES:b,extraFieldLength:_}}function Xpe(i,e){const{headerInfo:t}=i;let{localHeaderArray:s,extraFieldLength:r}=t,n=Os(s),a=64-(e+nt(s))%64;a<4&&(a+=64);const o=new Uint8Array(a),l=Os(o);ft(l,0,Tde),ft(l,2,a-2);const u=s;t.localHeaderArray=s=new Uint8Array(nt(u)+a),ps(s,u),ps(s,o,nt(u)),n=Os(s),ft(n,28,r+a),i.metadataSize+=a}function efe(i){const{zip64:e,dataDescriptor:t,dataDescriptorSignature:s}=i;let r=new Uint8Array,n,a=0;return t&&(r=new Uint8Array(e?s?24:20:s?16:12),n=Os(r),s&&(a=4,rt(n,0,gde))),{dataDescriptorArray:r,dataDescriptorView:n,dataDescriptorOffset:a}}function tfe(i,e){const{signature:t,rawExtraFieldZip64:s,compressedSize:r,uncompressedSize:n,headerInfo:a,dataDescriptorInfo:o}=i,{headerView:l,encrypted:u}=a,{dataDescriptorView:h,dataDescriptorOffset:c}=o,{zip64:d,zip64UncompressedSize:f,zip64CompressedSize:y,zipCrypto:v,dataDescriptor:m}=e;if((!u||v)&&t!==qt&&(rt(l,10,t),m&&rt(h,c,t)),d){const g=Os(s);ft(g,0,xde),ft(g,2,nt(s)-4);let b=4;f&&(rt(l,18,pi),mi(g,b,BigInt(n)),b+=8),y&&(rt(l,14,pi),mi(g,b,BigInt(r))),m&&(mi(h,c+4,BigInt(r)),mi(h,c+12,BigInt(n)))}else rt(l,14,r),rt(l,18,n),m&&(rt(h,c+4,r),rt(h,c+8,n))}async function sfe(i,e,t,{zipCrypto:s}){let r;r=await e.slice(0,26).arrayBuffer(),r.byteLength!=26&&(r=r.slice(0,26));const n=new DataView(r);return(!i.encrypted||s)&&rt(n,14,i.signature),i.zip64?(rt(n,18,pi),rt(n,22,pi)):(rt(n,18,i.compressedSize),rt(n,22,i.uncompressedSize)),await Mr(t,new Uint8Array(r)),e.slice(r.byteLength)}function ife(i,e){const{rawExtraFieldZip64:t,offset:s,diskNumberStart:r}=i,{zip64UncompressedSize:n,zip64CompressedSize:a,zip64Offset:o,zip64DiskNumberStart:l}=e,u=Os(t);let h=4;n&&(h+=8),a&&(h+=8),o&&(mi(u,h,BigInt(s)),h+=8),l&&rt(u,h,r)}async function rfe(i,e,t){const{files:s,writer:r}=i,{diskOffset:n,writable:a}=r;let{diskNumber:o}=r,l=0,u=0,h=i.offset-n,c=s.size;for(const[,L]of s){const{rawFilename:A,rawExtraFieldZip64:k,rawExtraFieldAES:P,rawComment:O,rawExtraFieldNTFS:D,rawExtraField:$,extendedTimestamp:Q,extraFieldExtendedTimestampFlag:_,lastModDate:B}=L;let H;if(Q){H=new Uint8Array(9);const U=Os(H);ft(U,0,pV),ft(U,2,5),Ed(U,4,_),rt(U,5,Math.floor(B.getTime()/1e3))}else H=new Uint8Array;L.rawExtraFieldCDExtendedTimestamp=H,u+=46+nt(A,O,k,P,D,H,$)}const d=new Uint8Array(u),f=Os(d);await yu(r);let y=0;for(const[L,A]of Array.from(s.values()).entries()){const{offset:k,rawFilename:P,rawExtraFieldZip64:O,rawExtraFieldAES:D,rawExtraFieldCDExtendedTimestamp:$,rawExtraFieldNTFS:Q,rawExtraField:_,rawComment:B,versionMadeBy:H,headerArray:U,directory:G,zip64:j,zip64UncompressedSize:ae,zip64CompressedSize:X,zip64DiskNumberStart:ue,zip64Offset:ie,msDosCompatible:se,internalFileAttribute:fe,externalFileAttribute:de,diskNumberStart:te,uncompressedSize:pe,compressedSize:Ne}=A,gt=nt(O,D,$,Q,_);rt(f,l,vde),ft(f,l+4,H);const $t=Os(U);ae||rt($t,18,pe),X||rt($t,14,Ne),ps(d,U,l+6),ft(f,l+30,gt),ft(f,l+32,nt(B)),ft(f,l+34,j&&ue?fi:te),ft(f,l+36,fe),de?rt(f,l+38,de):G&&se&&Ed(f,l+38,Ade),rt(f,l+42,j&&ie?pi:k),ps(d,P,l+46),ps(d,O,l+46+nt(P)),ps(d,D,l+46+nt(P,O)),ps(d,$,l+46+nt(P,O,D)),ps(d,Q,l+46+nt(P,O,D,$)),ps(d,_,l+46+nt(P,O,D,$,Q)),ps(d,B,l+46+nt(P)+gt);const Us=46+nt(P,B)+gt;if(l-y>r.availableSize&&(r.availableSize=0,await Mr(a,d.slice(y,l)),y=l),l+=Us,t.onprogress)try{await t.onprogress(L+1,s.size,new mS(A))}catch{}}await Mr(a,y?d.slice(y):d);let v=r.diskNumber;const{availableSize:m}=r;m<Bg&&v++;let g=yt(i,t,Xg);if(h>pi||u>pi||c>fi||v>fi){if(g===!1)throw new Error(ev);g=!0}const b=new Uint8Array(g?wde:Bg),x=Os(b);l=0,g&&(rt(x,0,Cde),mi(x,4,BigInt(44)),ft(x,12,45),ft(x,14,45),rt(x,16,v),rt(x,20,o),mi(x,24,BigInt(c)),mi(x,32,BigInt(c)),mi(x,40,BigInt(u)),mi(x,48,BigInt(h)),rt(x,56,bde),mi(x,64,BigInt(h)+BigInt(u)),rt(x,72,v+1),yt(i,t,"supportZip64SplitFile",!0)&&(v=fi,o=fi),c=fi,h=pi,u=pi,l+=dV+cV),rt(x,l,yde),ft(x,l+4,v),ft(x,l+6,o),ft(x,l+8,c),ft(x,l+10,c),rt(x,l+12,u),rt(x,l+16,h);const I=nt(e);if(I)if(I<=fi)ft(x,l+20,I);else throw new Error($pe);await Mr(a,b),I&&await Mr(a,e)}async function Mr(i,e){const t=i.getWriter();try{await t.ready,i.size+=nt(e),await t.write(e)}finally{t.releaseLock()}}function sv(i){if(i)return(BigInt(i.getTime())+BigInt(116444736e5))*BigInt(1e4)}function yt(i,e,t,s){const r=e[t]===qt?i.options[t]:e[t];return r===qt?s:r}function CS(i){return i+5*(Math.floor(i/16383)+1)}function Ed(i,e,t){i.setUint8(e,t)}function ft(i,e,t){i.setUint16(e,t,!0)}function rt(i,e,t){i.setUint32(e,t,!0)}function mi(i,e,t){i.setBigUint64(e,t,!0)}function ps(i,e,t){i.set(e,t)}function Os(i){return new DataView(i.buffer)}function nt(...i){let e=0;return i.forEach(t=>t&&(e+=t.length)),e}let bS;try{bS=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yi&&Yi.tagName.toUpperCase()==="SCRIPT"&&Yi.src||new URL("reactive.umd.js",document.baseURI).href}catch{}Hg({baseURL:bS}),bpe(Hg),Hg({Deflate:jce,Inflate:dde});var dn;(function(i){i.Documents="DOCUMENTS",i.Data="DATA",i.Library="LIBRARY",i.Cache="CACHE",i.External="EXTERNAL",i.ExternalStorage="EXTERNAL_STORAGE"})(dn||(dn={}));var Vd;(function(i){i.UTF8="utf8",i.ASCII="ascii",i.UTF16="utf16"})(Vd||(Vd={}));const _a=Ol("Filesystem",{web:()=>Promise.resolve().then(()=>M1e).then(i=>new i.FilesystemWeb)});$s("Upload",async(i,e,t,s)=>{const r=i.sessionID||`sim_${Date.now()}_${Math.floor(K.uniform(0,2176782336)).toString(36)}`,n=z2({sessionID:r,data:e.data||[],store:e.store,generateFiles:i.generateFiles,sessionData:i.sessionData,uploadRaw:i.uploadRaw??!0}),a=$2();a&&(n.push({filename:`${r}_participant_initial.csv`,content:oc([a]),encoding:"utf8"}),n.push({filename:`${r}_participant_final.csv`,content:oc([s]),encoding:"utf8"}));const o=q2();if(o){const l={sessionId:r,files:n.map(h=>({...h,encoding:h.encoding??"utf8"}))},u=await fetch(`${o}/data`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});u.ok||console.error(`Simulation upload failed: ${u.status} ${u.statusText}`)}return{responseData:{files:n},participantState:s}},{});const iv=[{name:"upload",defaultValue:!0,type:"boolean",description:"Upload the data at the end of the experiment?"},{name:"download",defaultValue:!1,type:"boolean",description:"Locally download the data at the end of the experiment?"}];Em("Upload",iv);const nfe=()=>{const i=window.electronAPI;return{directoryExists:async e=>{const t=await i.directoryExists(e);return t.success&&t.exists},createDirectory:async e=>{await i.createDirectory(e)},saveFile:async(e,t,s)=>{await i.saveFile(e,t,s)}}},afe=i=>{const e=t=>i?t?`${i}/${t}`:i:t;return{directoryExists:async t=>{try{if(i)try{await _a.readdir({path:i,directory:dn.Documents})}catch{return!1}const s=e(t);return(await _a.readdir({path:s,directory:dn.Documents})).files.length>=0}catch{return!1}},createDirectory:async t=>{try{if(i)try{await _a.mkdir({path:i,directory:dn.Documents,recursive:!1})}catch{}const s=e(t);await _a.mkdir({path:s,directory:dn.Documents,recursive:!0})}catch(s){throw console.error("Error creating directory:",s),s}},saveFile:async(t,s,r)=>{const n=e(r);await _a.writeFile({path:`${n}/${t}`,data:s,directory:dn.Documents,encoding:"utf8"})}}},ofe=i=>{const e=Fl();switch(e){case"desktop":return{backend:nfe(),type:e};case"mobile":return{backend:afe(i),type:e};case"web":return{backend:null,type:e}}},lfe=async(i,e)=>{let t=e;if(await i.directoryExists(t)){let s=1;for(t=`${e}_${s}`;await i.directoryExists(t);)s++,t=`${e}_${s}`}return t};function wS({data:i,next:e,store:t,sessionID:s,generateFiles:r,sessionData:n,uploadRaw:a=!0,autoUpload:o=!1,androidFolderName:l,className:u,containerClass:h,centered:c,content:d,uploadingContent:f,errorContent:y}){const[v,m]=V.useState("initial"),g=V.useRef(!1),b=iv.find($=>$.name==="upload"),x=iv.find($=>$.name==="download"),I=en(b.name,b.defaultValue,b.type),L=en(x.name,x.defaultValue,x.type),A=Sce({mutationFn:async $=>await ox("/data",$),onSuccess:$=>{$.status===200?(m("success"),e({})):m("error")},onError:()=>{m("error")}}),k=V.useCallback(async $=>{const Q=new Gpe(new Tpe);for(const U of $)await Q.add(U.filename,new Ppe(U.content));const _=await Q.close(),B=URL.createObjectURL(_),H=document.createElement("a");H.href=B,H.download="study-data.zip",document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(B)},[]),P=V.useCallback(async()=>{if(m("uploading"),g.current)return;g.current=!0;const $=s??(t==null?void 0:t._uploadId)??AE(),Q=z2({sessionID:$,data:i,store:t,generateFiles:r,sessionData:n,uploadRaw:a});try{const _={sessionId:$,...t!=null&&t._uploadId&&t._uploadId!==$?{_uploadId:t._uploadId}:{},files:Q.map(U=>({...U,encoding:U.encoding??"utf8"}))};if(L&&await k(Q),!I){e({});return}const{backend:B,type:H}=ofe(l);if(H==="web")A.mutate(_);else if(B)try{const U=await lfe(B,$);await B.createDirectory(U);for(const G of Q)await B.saveFile(G.filename,G.content,U);m("success"),e({})}catch(U){console.error(`Error saving files with ${H}:`,U),m("error")}}catch(_){console.error("Error uploading:",_),m("error")}},[s,r,i,a,L,I,k,e,A]);V.useEffect(()=>{o&&!g.current&&P&&P()},[o,P]),V.useEffect(()=>{v==="error"&&(g.current=!1)},[v]);const O=xi(qi()),D=`cursor-pointer ${O.buttonBg} px-8 py-3 border-2 ${O.buttonBorder} font-bold ${O.buttonText} text-lg rounded-xl ${O.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`;return S.jsx("div",{className:`${c?"flex items-center justify-center":""} ${h??O.containerBg}`,style:{position:"fixed",inset:0},children:S.jsxs("div",{className:`flex flex-col items-center justify-center gap-4 p-6 text-xl mt-16 px-10 h-full ${O.text} ${u??""}`,children:[v=="initial"&&!o&&S.jsxs(S.Fragment,{children:[d??S.jsx("p",{children:"Thank you for participating! Please click the button below to submit your data."}),S.jsx("button",{onClick:P,className:`mt-8 ${D}`,children:"Submit Data"})]}),v=="uploading"&&S.jsx(S.Fragment,{children:f??S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"}),S.jsx("p",{children:"Uploading your data..."})]})}),v=="success"&&S.jsx(S.Fragment,{}),v=="error"&&S.jsxs(S.Fragment,{children:[y??S.jsxs("div",{className:`${O.error} mb-4`,children:[S.jsx("p",{children:"Sorry, there was an error uploading your data."}),S.jsx("p",{children:"Please try again or contact the researcher."})]}),S.jsx("button",{onClick:P,className:D,children:"Try Again"})]})]})})}var xS;(function(i){i.Dark="DARK",i.Light="LIGHT",i.Default="DEFAULT"})(xS||(xS={}));var ES;(function(i){i.None="NONE",i.Slide="SLIDE",i.Fade="FADE"})(ES||(ES={}));const VS=Ol("StatusBar"),SS=Ol("ImmersiveMode",{web:()=>Promise.resolve().then(()=>F1e).then(i=>new i.ImmersiveModeWeb)});Zs("EnterFullscreen","session"),$s("EnterFullscreen",fo,{});function TS({content:i,buttonText:e,className:t,containerClass:s,centered:r,animate:n,next:a,data:o,updateStore:l,delayMs:u=0}){const h=S.jsxs("div",{className:"flex flex-col items-center",children:[!!i&&i,!i&&S.jsx("p",{className:"",children:"Please click the Button below to enter Fullscreen mode."})]}),[c,d]=V.useState(!1),f=V.useRef(!1),y=V.useRef(null),v=V.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),m=V.useCallback(()=>{document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b),document.removeEventListener("mozfullscreenchange",b),document.removeEventListener("MSFullscreenChange",b),v(),f.current=!1},[v]),g=V.useCallback(()=>{v(),d(!0),y.current=setTimeout(()=>{y.current=null,a({})},u)},[a,u,v]),b=V.useCallback(()=>{if(!f.current)return;const A=po();m(),A?g():d(!1)},[g,m]),x=V.useCallback(()=>{m(),f.current=!0,document.addEventListener("fullscreenchange",b),document.addEventListener("webkitfullscreenchange",b),document.addEventListener("mozfullscreenchange",b),document.addEventListener("MSFullscreenChange",b)},[b,m]),I=V.useCallback(async()=>{d(!0),m();const A=document.documentElement;if(Fl()==="mobile"&&Ca.getPlatform()==="android"&&(VS.hide(),SS.enable()),A.requestFullscreen)try{await A.requestFullscreen(),g();return}catch(k){console.error("Fullscreen request failed:",k);return}A.mozRequestFullScreen?(A.mozRequestFullScreen(),x()):A.webkitRequestFullscreen?(A.webkitRequestFullscreen(),x()):A.msRequestFullscreen?(A.msRequestFullscreen(),x()):console.warn("Fullscreen API is not supported by this browser.")},[g,x,m]);V.useEffect(()=>()=>{m()},[m]);const L=xi(qi());return c?S.jsx("div",{className:`min-h-screen ${s??L.containerBg}`}):S.jsx(dc,{data:o,updateStore:l,className:t,containerClass:s,centered:r,animate:n,content:h,buttonText:e??"Enter Fullscreen Mode",next:I})}Zs("ExitFullscreen","session"),$s("ExitFullscreen",fo,{});function PS({next:i,delayMs:e=0}){const t=V.useRef(!1),s=V.useRef(null),r=V.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),n=V.useCallback(()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o),document.removeEventListener("mozfullscreenchange",o),document.removeEventListener("MSFullscreenChange",o),r(),t.current=!1},[r]),a=V.useCallback(()=>{r(),s.current=setTimeout(()=>{s.current=null,i({})},e)},[i,e,r]),o=V.useCallback(()=>{if(!t.current)return;const u=po();n(),u||a()},[a,n]),l=V.useCallback(()=>{n(),t.current=!0,document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),document.addEventListener("mozfullscreenchange",o),document.addEventListener("MSFullscreenChange",o)},[o,n]);return V.useEffect(()=>((async()=>{if(!po()){i({});return}if(Fl()==="mobile"&&Ca.getPlatform()==="android"&&(VS.show(),SS.disable()),document.exitFullscreen)try{await document.exitFullscreen(),a();return}catch(h){console.error("Exiting fullscreen failed:",h),i({});return}document.mozCancelFullScreen?(document.mozCancelFullScreen(),l()):document.webkitExitFullscreen?(document.webkitExitFullscreen(),l()):document.msExitFullscreen?(document.msExitFullscreen(),l()):(console.warn("Fullscreen API is not supported by this browser."),i({}))})(),()=>{n()}),[a,l,n]),null}function IS(i){var e,t,s="";if(typeof i=="string"||typeof i=="number")s+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=IS(i[e]))&&(s&&(s+=" "),s+=t)}else for(t in i)i[t]&&(s&&(s+=" "),s+=t);return s}function Zn(){for(var i,e,t=0,s="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=IS(i))&&(s&&(s+=" "),s+=e);return s}const Cu=i=>typeof i=="number"&&!isNaN(i),Da=i=>typeof i=="string",Ai=i=>typeof i=="function",Sd=i=>Da(i)||Ai(i)?i:null,rv=i=>V.isValidElement(i)||Da(i)||Ai(i)||Cu(i);function RS(i,e,t){t===void 0&&(t=300);const{scrollHeight:s,style:r}=i;requestAnimationFrame(()=>{r.minHeight="initial",r.height=s+"px",r.transition=`all ${t}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(e,t)})})}function bu(i){let{enter:e,exit:t,appendPosition:s=!1,collapse:r=!0,collapseDuration:n=300}=i;return function(a){let{children:o,position:l,preventExitTransition:u,done:h,nodeRef:c,isIn:d,playToast:f}=a;const y=s?`${e}--${l}`:e,v=s?`${t}--${l}`:t,m=V.useRef(0);return V.useLayoutEffect(()=>{const g=c.current,b=y.split(" "),x=I=>{I.target===c.current&&(f(),g.removeEventListener("animationend",x),g.removeEventListener("animationcancel",x),m.current===0&&I.type!=="animationcancel"&&g.classList.remove(...b))};g.classList.add(...b),g.addEventListener("animationend",x),g.addEventListener("animationcancel",x)},[]),V.useEffect(()=>{const g=c.current,b=()=>{g.removeEventListener("animationend",b),r?RS(g,h,n):h()};d||(u?b():(m.current=1,g.className+=` ${v}`,g.addEventListener("animationend",b)))},[d]),V.createElement(V.Fragment,null,o)}}function AS(i,e){return i!=null?{content:i.content,containerId:i.props.containerId,id:i.props.toastId,theme:i.props.theme,type:i.props.type,data:i.props.data||{},isLoading:i.props.isLoading,icon:i.props.icon,status:e}:{}}const Xs=new Map;let wu=[];const nv=new Set,ufe=i=>nv.forEach(e=>e(i)),LS=()=>Xs.size>0;function _S(i,e){var t;if(e)return!((t=Xs.get(e))==null||!t.isToastActive(i));let s=!1;return Xs.forEach(r=>{r.isToastActive(i)&&(s=!0)}),s}function DS(i,e){rv(i)&&(LS()||wu.push({content:i,options:e}),Xs.forEach(t=>{t.buildToast(i,e)}))}function kS(i,e){Xs.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(i,e==null?void 0:e.id):t.toggle(i,e==null?void 0:e.id)})}function OS(i){const{subscribe:e,getSnapshot:t,setProps:s}=V.useRef(function(n){const a=n.containerId||1;return{subscribe(o){const l=function(h,c,d){let f=1,y=0,v=[],m=[],g=[],b=c;const x=new Map,I=new Set,L=()=>{g=Array.from(x.values()),I.forEach(P=>P())},A=P=>{m=P==null?[]:m.filter(O=>O!==P),L()},k=P=>{const{toastId:O,onOpen:D,updateId:$,children:Q}=P.props,_=$==null;P.staleId&&x.delete(P.staleId),x.set(O,P),m=[...m,P.props.toastId].filter(B=>B!==P.staleId),L(),d(AS(P,_?"added":"updated")),_&&Ai(D)&&D(V.isValidElement(Q)&&Q.props)};return{id:h,props:b,observe:P=>(I.add(P),()=>I.delete(P)),toggle:(P,O)=>{x.forEach(D=>{O!=null&&O!==D.props.toastId||Ai(D.toggle)&&D.toggle(P)})},removeToast:A,toasts:x,clearQueue:()=>{y-=v.length,v=[]},buildToast:(P,O)=>{if((ie=>{let{containerId:se,toastId:fe,updateId:de}=ie;const te=se?se!==h:h!==1,pe=x.has(fe)&&de==null;return te||pe})(O))return;const{toastId:D,updateId:$,data:Q,staleId:_,delay:B}=O,H=()=>{A(D)},U=$==null;U&&y++;const G={...b,style:b.toastStyle,key:f++,...Object.fromEntries(Object.entries(O).filter(ie=>{let[se,fe]=ie;return fe!=null})),toastId:D,updateId:$,data:Q,closeToast:H,isIn:!1,className:Sd(O.className||b.toastClassName),bodyClassName:Sd(O.bodyClassName||b.bodyClassName),progressClassName:Sd(O.progressClassName||b.progressClassName),autoClose:!O.isLoading&&(j=O.autoClose,ae=b.autoClose,j===!1||Cu(j)&&j>0?j:ae),deleteToast(){const ie=x.get(D),{onClose:se,children:fe}=ie.props;Ai(se)&&se(V.isValidElement(fe)&&fe.props),d(AS(ie,"removed")),x.delete(D),y--,y<0&&(y=0),v.length>0?k(v.shift()):L()}};var j,ae;G.closeButton=b.closeButton,O.closeButton===!1||rv(O.closeButton)?G.closeButton=O.closeButton:O.closeButton===!0&&(G.closeButton=!rv(b.closeButton)||b.closeButton);let X=P;V.isValidElement(P)&&!Da(P.type)?X=V.cloneElement(P,{closeToast:H,toastProps:G,data:Q}):Ai(P)&&(X=P({closeToast:H,toastProps:G,data:Q}));const ue={content:X,props:G,staleId:_};b.limit&&b.limit>0&&y>b.limit&&U?v.push(ue):Cu(B)?setTimeout(()=>{k(ue)},B):k(ue)},setProps(P){b=P},setToggle:(P,O)=>{x.get(P).toggle=O},isToastActive:P=>m.some(O=>O===P),getSnapshot:()=>g}}(a,n,ufe);Xs.set(a,l);const u=l.observe(o);return wu.forEach(h=>DS(h.content,h.options)),wu=[],()=>{u(),Xs.delete(a)}},setProps(o){var l;(l=Xs.get(a))==null||l.setProps(o)},getSnapshot(){var o;return(o=Xs.get(a))==null?void 0:o.getSnapshot()}}}(i)).current;s(i);const r=V.useSyncExternalStore(e,t,t);return{getToastToRender:function(n){if(!r)return[];const a=new Map;return i.newestOnTop&&r.reverse(),r.forEach(o=>{const{position:l}=o.props;a.has(l)||a.set(l,[]),a.get(l).push(o)}),Array.from(a,o=>n(o[0],o[1]))},isToastActive:_S,count:r==null?void 0:r.length}}function MS(i){const[e,t]=V.useState(!1),[s,r]=V.useState(!1),n=V.useRef(null),a=V.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:o,pauseOnHover:l,closeToast:u,onClick:h,closeOnClick:c}=i;var d,f;function y(){t(!0)}function v(){t(!1)}function m(x){const I=n.current;a.canDrag&&I&&(a.didMove=!0,e&&v(),a.delta=i.draggableDirection==="x"?x.clientX-a.start:x.clientY-a.start,a.start!==x.clientX&&(a.canCloseOnClick=!1),I.style.transform=`translate3d(${i.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function g(){document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",g);const x=n.current;if(a.canDrag&&a.didMove&&x){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return r(!0),i.closeToast(),void i.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=Xs.get((d={id:i.toastId,containerId:i.containerId,fn:t}).containerId||1))==null||f.setToggle(d.id,d.fn),V.useEffect(()=>{if(i.pauseOnFocusLoss)return document.hasFocus()||v(),window.addEventListener("focus",y),window.addEventListener("blur",v),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",v)}},[i.pauseOnFocusLoss]);const b={onPointerDown:function(x){if(i.draggable===!0||i.draggable===x.pointerType){a.didMove=!1,document.addEventListener("pointermove",m),document.addEventListener("pointerup",g);const I=n.current;a.canCloseOnClick=!0,a.canDrag=!0,I.style.transition="none",i.draggableDirection==="x"?(a.start=x.clientX,a.removalDistance=I.offsetWidth*(i.draggablePercent/100)):(a.start=x.clientY,a.removalDistance=I.offsetHeight*(i.draggablePercent===80?1.5*i.draggablePercent:i.draggablePercent)/100)}},onPointerUp:function(x){const{top:I,bottom:L,left:A,right:k}=n.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&i.pauseOnHover&&x.clientX>=A&&x.clientX<=k&&x.clientY>=I&&x.clientY<=L?v():y()}};return o&&l&&(b.onMouseEnter=v,i.stacked||(b.onMouseLeave=y)),c&&(b.onClick=x=>{h&&h(x),a.canCloseOnClick&&u()}),{playToast:y,pauseToast:v,isRunning:e,preventExitTransition:s,toastRef:n,eventHandlers:b}}function hfe(i){let{delay:e,isRunning:t,closeToast:s,type:r="default",hide:n,className:a,style:o,controlledProgress:l,progress:u,rtl:h,isIn:c,theme:d}=i;const f=n||l&&u===0,y={...o,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(y.transform=`scaleX(${u})`);const v=Zn("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":h}),m=Ai(a)?a({rtl:h,type:r,defaultClassName:v}):Zn(v,a),g={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{c&&s()}};return V.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},V.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),V.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:y,...g}))}let cfe=1;const NS=()=>""+cfe++;function dfe(i){return i&&(Da(i.toastId)||Cu(i.toastId))?i.toastId:NS()}function xu(i,e){return DS(i,e),e.toastId}function Td(i,e){return{...e,type:e&&e.type||i,toastId:dfe(e)}}function Pd(i){return(e,t)=>xu(e,Td(i,t))}function Dt(i,e){return xu(i,Td("default",e))}Dt.loading=(i,e)=>xu(i,Td("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Dt.promise=function(i,e,t){let s,{pending:r,error:n,success:a}=e;r&&(s=Da(r)?Dt.loading(r,t):Dt.loading(r.render,{...t,...r}));const o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,c,d)=>{if(c==null)return void Dt.dismiss(s);const f={type:h,...o,...t,data:d},y=Da(c)?{render:c}:c;return s?Dt.update(s,{...f,...y}):Dt(y.render,{...f,...y}),d},u=Ai(i)?i():i;return u.then(h=>l("success",a,h)).catch(h=>l("error",n,h)),u},Dt.success=Pd("success"),Dt.info=Pd("info"),Dt.error=Pd("error"),Dt.warning=Pd("warning"),Dt.warn=Dt.warning,Dt.dark=(i,e)=>xu(i,Td("default",{theme:"dark",...e})),Dt.dismiss=function(i){(function(e){var t;if(LS()){if(e==null||Da(t=e)||Cu(t))Xs.forEach(s=>{s.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const s=Xs.get(e.containerId);s?s.removeToast(e.id):Xs.forEach(r=>{r.removeToast(e.id)})}}else wu=wu.filter(s=>e!=null&&s.options.toastId!==e)})(i)},Dt.clearWaitingQueue=function(i){i===void 0&&(i={}),Xs.forEach(e=>{!e.props.limit||i.containerId&&e.id!==i.containerId||e.clearQueue()})},Dt.isActive=_S,Dt.update=function(i,e){e===void 0&&(e={});const t=((s,r)=>{var n;let{containerId:a}=r;return(n=Xs.get(a||1))==null?void 0:n.toasts.get(s)})(i,e);if(t){const{props:s,content:r}=t,n={delay:100,...s,...e,toastId:e.toastId||i,updateId:NS()};n.toastId!==i&&(n.staleId=i);const a=n.render||r;delete n.render,xu(a,n)}},Dt.done=i=>{Dt.update(i,{progress:1})},Dt.onChange=function(i){return nv.add(i),()=>{nv.delete(i)}},Dt.play=i=>kS(!0,i),Dt.pause=i=>kS(!1,i);const pfe=typeof window<"u"?V.useLayoutEffect:V.useEffect,Id=i=>{let{theme:e,type:t,isLoading:s,...r}=i;return V.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r})},Rd={info:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return V.createElement("div",{className:"Toastify__spinner"})}},ffe=i=>{const{isRunning:e,preventExitTransition:t,toastRef:s,eventHandlers:r,playToast:n}=MS(i),{closeButton:a,children:o,autoClose:l,onClick:u,type:h,hideProgressBar:c,closeToast:d,transition:f,position:y,className:v,style:m,bodyClassName:g,bodyStyle:b,progressClassName:x,progressStyle:I,updateId:L,role:A,progress:k,rtl:P,toastId:O,deleteToast:D,isIn:$,isLoading:Q,closeOnClick:_,theme:B}=i,H=Zn("Toastify__toast",`Toastify__toast-theme--${B}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":_}),U=Ai(v)?v({rtl:P,position:y,type:h,defaultClassName:H}):Zn(H,v),G=function(ue){let{theme:ie,type:se,isLoading:fe,icon:de}=ue,te=null;const pe={theme:ie,type:se};return de===!1||(Ai(de)?te=de({...pe,isLoading:fe}):V.isValidElement(de)?te=V.cloneElement(de,pe):fe?te=Rd.spinner():(Ne=>Ne in Rd)(se)&&(te=Rd[se](pe))),te}(i),j=!!k||!l,ae={closeToast:d,type:h,theme:B};let X=null;return a===!1||(X=Ai(a)?a(ae):V.isValidElement(a)?V.cloneElement(a,ae):function(ue){let{closeToast:ie,theme:se,ariaLabel:fe="close"}=ue;return V.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:de=>{de.stopPropagation(),ie(de)},"aria-label":fe},V.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},V.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(ae)),V.createElement(f,{isIn:$,done:D,position:y,preventExitTransition:t,nodeRef:s,playToast:n},V.createElement("div",{id:O,onClick:u,"data-in":$,className:U,...r,style:m,ref:s},V.createElement("div",{...$&&{role:A},className:Ai(g)?g({type:h}):Zn("Toastify__toast-body",g),style:b},G!=null&&V.createElement("div",{className:Zn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Q})},G),V.createElement("div",null,o)),X,V.createElement(hfe,{...L&&!j?{key:`pb-${L}`}:{},rtl:P,theme:B,delay:l,isRunning:e,isIn:$,closeToast:d,hide:c,type:h,style:I,className:x,controlledProgress:j,progress:k||0})))},Ad=function(i,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${i}-enter`,exit:`Toastify--animate Toastify__${i}-exit`,appendPosition:e}},FS=bu(Ad("bounce",!0)),mfe=bu(Ad("slide",!0)),gfe=bu(Ad("zoom")),vfe=bu(Ad("flip")),yfe={position:"top-right",transition:FS,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function qS(i){let e={...yfe,...i};const t=i.stacked,[s,r]=V.useState(!0),n=V.useRef(null),{getToastToRender:a,isToastActive:o,count:l}=OS(e),{className:u,style:h,rtl:c,containerId:d}=e;function f(v){const m=Zn("Toastify__toast-container",`Toastify__toast-container--${v}`,{"Toastify__toast-container--rtl":c});return Ai(u)?u({position:v,rtl:c,defaultClassName:m}):Zn(m,Sd(u))}function y(){t&&(r(!0),Dt.play())}return pfe(()=>{if(t){var v;const m=n.current.querySelectorAll('[data-in="true"]'),g=12,b=(v=e.position)==null?void 0:v.includes("top");let x=0,I=0;Array.from(m).reverse().forEach((L,A)=>{const k=L;k.classList.add("Toastify__toast--stacked"),A>0&&(k.dataset.collapsed=`${s}`),k.dataset.pos||(k.dataset.pos=b?"top":"bot");const P=x*(s?.2:1)+(s?0:g*A);k.style.setProperty("--y",`${b?P:-1*P}px`),k.style.setProperty("--g",`${g}`),k.style.setProperty("--s",""+(1-(s?I:0))),x+=k.offsetHeight,I+=.025})}},[s,l,t]),V.createElement("div",{ref:n,className:"Toastify",id:d,onMouseEnter:()=>{t&&(r(!1),Dt.pause())},onMouseLeave:y},a((v,m)=>{const g=m.length?{...h}:{...h,pointerEvents:"none"};return V.createElement("div",{className:f(v),style:g,key:`container-${v}`},m.map(b=>{let{content:x,props:I}=b;return V.createElement(ffe,{...I,stacked:t,collapseAll:y,isIn:o(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},x)}))}))}const Cfe=({paramRegistry:i,timelineRepresentation:e})=>{const[t,s]=V.useState({}),[r,n]=V.useState([]),[a,o]=V.useState(""),[l,u]=V.useState("Copy URL"),[h,c]=V.useState(!1),[d,f]=V.useState(!1),[y,v]=V.useState([]),m=V.useRef(null),g=[...i].filter(_=>_.name!=="includeSubset"&&_.name!=="excludeSubset").sort((_,B)=>_.name.localeCompare(B.name));V.useEffect(()=>{const _=new URLSearchParams(window.location.search),B={},H=[];let U=[],G=!1;const j=_.get("includeSubset"),ae=_.get("excludeSubset"),X=_.get("_b");if(X)try{const se=atob(X),fe=JSON.parse(se);fe.excludeSubset?(G=!0,U=fe.excludeSubset.split(",")):fe.includeSubset&&(G=!1,U=fe.includeSubset.split(","))}catch{ae?(G=!0,U=ae.split(",")):j&&(G=!1,U=j.split(","))}else ae?(G=!0,U=ae.split(",")):j&&(G=!1,U=j.split(","));f(G),ae||j?v(U):e.length>0&&v(G?[]:Array.from({length:e.length},(se,fe)=>(fe+1).toString()));const ue=_.get("_b");if(ue)try{const se=atob(ue),fe=JSON.parse(se),de=i.map(te=>te.name);Object.entries(fe).forEach(([te,pe])=>{de.includes(te)?B[te]=String(pe):te!=="_b"&&H.push({name:te,value:typeof pe=="object"?JSON.stringify(pe):String(pe),type:typeof pe=="boolean"?"boolean":typeof pe=="number"?"number":Array.isArray(pe)?"array":typeof pe=="object"?"json":"string"})}),i.forEach(te=>{te.name in B||(te.type==="boolean"&&te.defaultValue!==void 0?B[te.name]=String(te.defaultValue):B[te.name]="")}),c(!0)}catch{ie(_)}else ie(_);function ie(se){i.forEach(de=>{const te=se.get(de.name);te!==null?B[de.name]=te:de.type==="boolean"&&de.defaultValue!==void 0&&(B[de.name]=String(de.defaultValue))});const fe=i.map(de=>de.name);se.forEach((de,te)=>{if(!fe.includes(te)&&te!=="_b"){let pe="string";if(de==="true"||de==="false")pe="boolean";else if(!isNaN(Number(de)))pe="number";else try{const Ne=JSON.parse(de);pe=Array.isArray(Ne)?"array":"json"}catch{}H.push({name:te,value:de,type:pe})}})}s(B),n(H)},[i]),V.useEffect(()=>{const _=window.location.pathname.replace(/\/settings$/,"");let B="";const H={...t};if(y.length>0?d?(H.excludeSubset=y.sort().join(","),delete H.includeSubset):y.length!=e.length&&(H.includeSubset=y.sort().join(","),delete H.excludeSubset):(delete H.includeSubset,delete H.excludeSubset),r.forEach(G=>{G.name&&G.value!==""&&G.name!=="includeSubset"&&G.name!=="excludeSubset"&&(H[G.name]=G.value)}),h){const G={};Object.entries(H).forEach(([X,ue])=>{if(ue!==""){const ie=i.find(de=>de.name===X),se=r.find(de=>de.name===X),fe=(ie==null?void 0:ie.type)||(se==null?void 0:se.type)||"string";if(fe==="boolean"&&(ie==null?void 0:ie.defaultValue)!==void 0&&String(ie.defaultValue)===ue)return;switch(fe){case"number":G[X]=Number(ue);break;case"boolean":G[X]=ue==="true";break;case"array":case"json":try{G[X]=JSON.parse(ue)}catch{G[X]=ue}break;default:G[X]=ue}}});const j=JSON.stringify(G);B=`?_b=${btoa(j)}`}else{const G=new URLSearchParams;Object.entries(H).forEach(([j,ae])=>{if(ae!==""){const X=i.find(ue=>ue.name===j);if((X==null?void 0:X.type)==="boolean"&&X.defaultValue!==void 0&&String(X.defaultValue)===ae)return;G.set(j,String(ae))}}),B=G.toString()?`?${G.toString()}`:""}const U=`${window.location.origin}${_}${B}`;o(U)},[t,r,h,i,y,d]);const b=(_,B)=>{s(H=>({...H,[_]:B}))},x=(_,B,H)=>{n(U=>{const G=[...U];return G[_]={...G[_],[B]:H},G})},I=_=>{const B=`${_+1}`;v(H=>H.includes(B)?H.filter(G=>G!==B):[...H,B])},L=()=>{f(_=>!_)},A=()=>{n(_=>[..._,{name:"",value:"",type:"string"}])},k=r.filter(_=>_.name!=="includeSubset"&&_.name!=="excludeSubset"),P=_=>{n(B=>B.filter((H,U)=>U!==_))},O=()=>{m.current&&(m.current.select(),document.execCommand("copy"),u("Copied!"),setTimeout(()=>u("Copy URL"),2e3))},D=()=>{c(!h)},$=_=>{const{name:B,type:H,defaultValue:U}=_;if(B==="includeSubset"||B==="excludeSubset")return null;const G=t[B]||"";switch(H){case"boolean":return S.jsxs(S.Fragment,{children:[S.jsx("button",{onClick:()=>b(B,G==="true"?"false":"true"),className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${G==="true"?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":G==="true",children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${G==="true"?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-4 text-gray-500",children:G==="true"?"True":"False"})]});case"number":return S.jsx("input",{type:"number",className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:U!==void 0?`Default: ${U}`:"Enter number..."});case"array":case"json":return S.jsx("textarea",{className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:H==="array"?"Enter comma-separated values or JSON array":"Enter JSON object",rows:3});case"string":default:return S.jsx("input",{type:"text",className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:U!==void 0&&U!==""?`Default: ${U}`:"Enter value..."})}},Q=(_,B)=>_.name==="includeSubset"||_.name==="excludeSubset"?null:S.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center mb-2",children:[S.jsx("div",{className:"col-span-3",children:S.jsx("input",{type:"text",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.name,onChange:H=>x(B,"name",H.target.value),placeholder:"Parameter name"})}),S.jsx("div",{className:"col-span-2",children:S.jsxs("select",{className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md",value:_.type,onChange:H=>x(B,"type",H.target.value),children:[S.jsx("option",{value:"string",children:"String"}),S.jsx("option",{value:"number",children:"Number"}),S.jsx("option",{value:"boolean",children:"Boolean"}),S.jsx("option",{value:"array",children:"Array"}),S.jsx("option",{value:"json",children:"JSON"})]})}),S.jsx("div",{className:"col-span-6",children:_.type==="boolean"?S.jsx(S.Fragment,{children:S.jsx("button",{onClick:()=>x(B,"value",_.value==="true"?"false":"true"),className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${_.value==="true"?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":_.value==="true",children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${_.value==="true"?"translate-x-5":"translate-x-0"}`})})}):_.type==="array"||_.type==="json"?S.jsx("textarea",{className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:_.type==="array"?"Enter JSON array [1,2,3]":'Enter JSON object {"key":"value"}',rows:1}):_.type==="number"?S.jsx("input",{type:"number",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:"Enter number..."}):S.jsx("input",{type:"text",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:"Enter value..."})}),S.jsx("div",{className:"col-span-1",children:S.jsx("button",{onClick:()=>P(B),className:"inline-flex cursor-pointer items-center justify-center p-2 border border-transparent rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500","aria-label":"Remove parameter",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:S.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})})]});return S.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[S.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Experiment Parameters"}),S.jsx("p",{className:"text-gray-700 mb-6",children:"Configure the experiment by setting parameter values below. Fields left empty will be assigned their default value. Once configured, you can copy the URL to run the experiment with these settings."}),S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsxs("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Registered Parameters"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Parameters defined in the experiment configuration."})]}),S.jsx("ul",{className:"divide-y divide-gray-200",children:g.map(_=>S.jsx("li",{className:"px-4 py-4 sm:px-6",children:S.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[S.jsx("div",{className:"col-span-2",children:S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsxs("div",{className:"flex items-center",children:[S.jsx("label",{className:"text-base font-medium text-gray-900",children:_.name}),S.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-600",children:_.type})]}),_.description&&S.jsx("p",{className:"mt-1 text-sm text-gray-500 flex-grow",children:_.description}),_.defaultValue!==void 0&&S.jsxs("p",{className:"mt-auto pt-2 text-xs text-gray-500",children:["Default: ",S.jsxs("code",{children:[" ",JSON.stringify(_.defaultValue)]})]})]})}),S.jsx("div",{className:"col-span-1 flex items-center",children:$(_)})]})},_.name))})]}),S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsx("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Custom Parameters"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Add any additional parameters to be stored in the data for this run."})]}),S.jsxs("button",{onClick:A,className:"inline-flex cursor-pointer items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:S.jsx("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"})}),"Add Parameter"]})]})}),S.jsx("div",{className:"px-4 py-5 sm:px-6",children:k.length===0?S.jsx("p",{className:"text-sm text-gray-500 italic",children:'No custom parameters added. Click "Add Parameter" to create one.'}):S.jsxs("div",{children:[S.jsxs("div",{className:"grid grid-cols-12 gap-2 mb-2",children:[S.jsx("div",{className:"col-span-3",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"PARAMETER NAME"})}),S.jsx("div",{className:"col-span-2",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"TYPE"})}),S.jsx("div",{className:"col-span-6",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"VALUE"})}),S.jsx("div",{className:"col-span-1"})]}),k.map((_,B)=>S.jsx("div",{children:Q(_,B)},B))]})})]}),e.length>0&&S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsx("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Trial Selection"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Select which trials to include or exclude from the experiment."})]}),S.jsxs("div",{className:"flex items-center",children:[S.jsx("button",{onClick:L,className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${d?"bg-red-600":"bg-green-600"}`,role:"switch","aria-checked":d,children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${d?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-2 text-sm text-gray-600",children:d?"Exclude mode":"Include mode"})]})]})}),S.jsxs("div",{className:"px-4 py-5 sm:px-6",children:[S.jsx("p",{className:"mb-4 text-sm font-medium text-gray-500",children:d?"Check trials you want to EXCLUDE from the experiment":"Check trials you want to INCLUDE in the experiment"}),S.jsx("div",{className:"border border-gray-200 rounded-md overflow-hidden",children:S.jsx("ul",{className:"divide-y divide-gray-200",children:e.map((_,B)=>S.jsx("li",{className:"cursor-pointer px-4 py-3 hover:bg-gray-50",onClick:H=>{H.target.type!=="checkbox"&&!H.target.closest("label")&&I(B)},children:S.jsx("div",{className:"flex items-center",children:S.jsxs("div",{className:"flex items-center flex-grow",children:[S.jsx("input",{id:`trial-${B}`,type:"checkbox",className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded cursor-pointer",checked:y.includes(`${B+1}`),onChange:()=>I(B)}),S.jsxs("label",{htmlFor:`trial-${B}`,className:"ml-3 flex-grow flex items-center cursor-pointer",children:[S.jsxs("div",{className:"w-8 text-center text-xs text-gray-500 font-medium",children:["#",B+1]}),S.jsx("div",{className:"flex-grow",children:_.name?S.jsx("span",{className:"font-medium text-gray-900",children:_.name}):S.jsx("span",{className:"font-medium text-gray-500",children:_.type})}),S.jsx("div",{className:"ml-2",children:S.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:_.type})})]})]})})},B))})})]})]}),S.jsxs("div",{className:"bg-white shadow sm:rounded-md p-6 mb-8",children:[S.jsxs("div",{className:"flex justify-between items-center mb-4",children:[S.jsx("h2",{className:"text-lg font-medium",children:"Generated URL"}),S.jsxs("div",{className:"flex items-center",children:[S.jsx("button",{onClick:D,className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${h?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":h,children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${h?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-2 text-sm text-gray-600",children:h?"Base64 Encoded":"Plain Parameters"})]})]}),S.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[S.jsx("input",{ref:m,type:"text",className:"flex-grow px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:a,readOnly:!0}),S.jsx("button",{onClick:O,className:"inline-flex cursor-pointer justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:l})]}),h&&S.jsxs("p",{className:"mt-4 text-sm text-gray-600",children:[S.jsx("span",{className:"font-medium",children:"Note:"}),' Base64 encoding combines all parameters into a single "_b" parameter, creating shorter URLs that hide parameter details.']})]}),S.jsx("div",{className:"flex justify-center",children:S.jsx("a",{href:a,className:"inline-flex justify-center py-4 px-5 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Launch Experiment with these Settings"})})]})},bfe=new Cce,BS=V.createContext(!1),wfe=()=>V.useContext(BS);function $S(i){if(typeof i=="boolean")return i;if(typeof i=="string"){const e=i.trim().toLowerCase();return e!==""&&e!=="false"&&e!=="0"}return!!i}function xfe({children:i,disableSettings:e,disableHybridSimulation:t}){return V.useEffect(()=>{const s=r=>{r.key===" "&&!(r.target instanceof HTMLInputElement)&&!(r.target instanceof HTMLTextAreaElement)&&!r.target.isContentEditable&&r.preventDefault()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),window.location.pathname.endsWith("/settings")&&!$S(e)?S.jsx(Cfe,{paramRegistry:Nl.getRegistry(),timelineRepresentation:Nl.getTimelineRepresentation()}):S.jsxs(xce,{client:bfe,children:[S.jsx(BS.Provider,{value:$S(t),children:i}),S.jsx(qS,{position:"top-center",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!1,pauseOnHover:!0,theme:"light",toastClassName:()=>"relative flex p-4 min-h-10 rounded-none justify-between overflow-hidden cursor-pointer border-2 border-black shadow-[2px_2px_0px_rgba(0,0,0,1)] bg-white",bodyClassName:"text-black font-sans"})]})}Zs("RequestFilePermission",null),$s("RequestFilePermission",fo,{});function HS({next:i}){const[e,t]=V.useState("checking");return V.useEffect(()=>{if(e!=="checking")return;(async()=>{if(Fl()!=="mobile"||Ca.getPlatform()!=="android"){i({});return}try{await _a.writeFile({path:"permission_check.txt",data:"Testing permissions",directory:dn.Documents,encoding:Vd.UTF8});try{await _a.deleteFile({path:"permission_check.txt",directory:dn.Documents})}catch(r){console.log("Cleanup error:",r)}t("granted"),i({})}catch(r){console.error("Permission denied or error:",r),t("denied")}})()},[i,e]),e==="checking"?null:S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-6 text-xl mt-16 px-10",children:[S.jsx("p",{children:"Storage permission is required to save your data."}),S.jsx("p",{children:"Please grant permission when prompted."}),S.jsxs("p",{children:['If there is no popup, go to "Settings" ',">",' "Apps" ',">",' "Name of the App" ',">",' "Permissions" ',">",' "Storage" ',">",' "Allow"']}),S.jsx("button",{onClick:()=>t("checking"),className:"mt-8 bg-white px-8 py-3 border-2 border-black font-bold text-black text-lg rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"Try Again"})]})}Zs("CanvasBlock","canvas",H2);function Efe(i){return typeof i=="function"}function Vfe(i){return typeof i=="object"&&i!==null&&typeof i.draw=="function"}function QS({next:i,updateStore:e,timeline:t,width:s,height:r,store:n,styleCanvas:a,initCanvas:o}){const{instructions:l,markers:u}=V.useMemo(()=>rc(t),[t]),h=V.useRef(0),c=V.useRef(0),d=V.useRef(!0),f=V.useRef(null),y=V.useRef(null),v=V.useRef([]),m=V.useRef(n??{}),g=V.useRef(null),b=V.useRef(0),x=V.useRef(null);V.useEffect(()=>{const Q=m.current._reactiveScreenRefreshRate,_=typeof Q=="number"&&Q>=20&&Q<=300;x.current=_?1e3/Q:null},[n]);const I=V.useCallback(Q=>{if(Q.type!=="ExecuteContent")return null;const _=Q.content;if(Efe(_))try{return _(v.current,m.current)}catch(B){return console.error("Error executing dynamic canvas slide generator:",B),null}else if(Vfe(_))return _;return console.warn("ExecuteContent instruction content is not a valid CanvasSlide or Generator:",_),null},[]),L=V.useCallback(()=>{const Q=y.current;if(!Q)return{};const _=Q.getContext("2d");if(!_)return{};const B=window.devicePixelRatio||1,H=Q.width/B,U=Q.height/B;return{ctx:_,canvasWidth:H,canvasHeight:U}},[]),A=V.useCallback(()=>{const{ctx:Q,canvasWidth:_,canvasHeight:B}=L();Q&&(Q.fillStyle="white",Q.fillRect(0,0,_,B),d.current=!1)},[L]),k=V.useCallback(Q=>{const{ctx:_,canvasWidth:B,canvasHeight:H}=L();if(_){if(_.fillStyle="white",_.fillRect(0,0,B,H),a)try{a(_,B,H)}catch(U){console.error("Error during styleCanvas function:",U)}else _.fillStyle="black";try{Q.draw(_,B,H)}catch(U){console.error("Error during slide draw function:",U)}c.current=As(),d.current=!0,f.current=null,b.current+=1}},[L]);let P;const O=V.useCallback(()=>{const Q=As(),_=h.current;if(_<0||_>=l.length){g.current&&cancelAnimationFrame(g.current),g.current=null;return}const B=l[_],H=I(B);if(!H){g.current&&cancelAnimationFrame(g.current),g.current=null;return}const U=H.displayDuration??1/0,G=H.responseTimeLimit??1/0,j=H.allowedKeys??!1,ae=j===!1||Array.isArray(j)&&j.length===0;let X=!1;const ue=Q-c.current+(x.current!==null?x.current*.5:0);d.current&&U!==1/0&&ue>=U&&(A(),(ae||G===1/0)&&(X=!0)),!X&&G!==1/0&&ue>=G&&(X=!0,d.current&&U!==1/0&&ue<U&&A()),X?P():d.current&&U!==1/0&&ue<U||G!==1/0&&ue<G?g.current=requestAnimationFrame(O):(g.current&&cancelAnimationFrame(g.current),g.current=null)},[l,I,A]),D=V.useCallback(()=>{g.current&&cancelAnimationFrame(g.current),g.current=null;const Q=Dn({instructions:l,markers:u},h.current,()=>m.current,()=>v.current,B=>{m.current=B});if(h.current=Q,Q>=l.length){e(m.current),i(v.current);return}if(!y.current){console.error("Canvas element not found during control flow.");return}const _=I(l[Q]);if(_){k(_);const B=_.displayDuration??1/0,H=_.responseTimeLimit??1/0;(B!==1/0||H!==1/0)&&(g.current=requestAnimationFrame(O))}else console.error("Failed to resolve slide content during control flow:",l[Q]),h.current++,D()},[l,u,I,k,O,i]);P=V.useCallback(()=>{const Q=f.current,_=As();g.current&&cancelAnimationFrame(g.current),g.current=null;const B=h.current;if(B>=l.length||l[B].type!=="ExecuteContent"){h.current++,D();return}const H=l[B],U=I(H);if(U&&!U.ignoreData){let G={index:h.current,trialNumber:b.current-1,start:c.current,end:_,duration:_-c.current,key:Q?Q.key:null,reactionTime:Q?Q.reactionTime:null};G=nc(G,U,v.current,m.current),v.current.push(G)}h.current++,f.current=null,D()},[l,I,D]);const $=V.useCallback(Q=>{const _=As(),B=h.current;if(B>=l.length||!d.current)return;const H=l[B];if(H.type!=="ExecuteContent")return;const U=I(H);if(!U)return;const G=U.responseTimeLimit??1/0,j=_-c.current<G,ae=U.allowedKeys??!1;if((ae===!0||Array.isArray(ae)&&ae.includes(Q.key))&&j){const ue=U.endSlideOnResponse??!0,ie=U.hideOnResponse??!1,se=U.ignoreData??!1;(!f.current||!ue)&&(!f.current&&!se&&(f.current={key:Q.key,time:_,reactionTime:_-c.current}),ie&&A(),ue&&P())}},[l,I,P,A]);return V.useEffect(()=>{const Q=y.current;if(!Q)return;const _=po()?window.screen.width:window.innerWidth,B=po()?window.screen.height:window.innerHeight;let H,U;const G=(te,pe)=>{if(typeof te=="number")return te;if(typeof te=="string"&&te.includes("%")){const Ne=parseFloat(te);if(!isNaN(Ne))return pe*Ne/100}return null};let j=G(s,_),ae=G(r,B);const X=typeof s=="string"&&/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(s),ue=typeof r=="string"&&/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(r);if(j!==null&&ae!==null)H=j,U=ae;else if(j!==null&&ae===null&&!ue)H=j,U=j;else if(ae!==null&&j===null&&!X)U=ae,H=ae;else if(j===null&&ae===null&&!X&&!ue){const te=Math.min(_,B);H=te,U=te}else{let te=j,pe=ae;if(ue&&te===null&&(te=pe??B),X&&pe===null&&(pe=te??_),te===null&&pe===null){const Ne=Math.min(_,B);te=Ne,pe=Ne}else te===null?te=pe:pe===null&&(pe=te);H=te,U=pe??0}if(X&&!ue)try{const te=s.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);te&&(H=U/parseFloat(te[2])*parseFloat(te[1]))}catch{console.error("Invalid width ratio string:",s)}else if(ue&&!X)try{const te=r.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);te&&(U=H/parseFloat(te[1])*parseFloat(te[2]))}catch{console.error("Invalid height ratio string:",r)}else if(X&&ue){console.warn(`Both width (${s}) and height (${r}) are ratios. Prioritizing width.`);try{const te=s.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);if(te){H=B/parseFloat(te[2])*parseFloat(te[1]);const pe=r.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);pe?U=H/parseFloat(pe[1])*parseFloat(pe[2]):U=H}else{const pe=Math.min(_,B);H=pe,U=pe}}catch(te){console.error("Error parsing ratios:",te);const pe=Math.min(_,B);H=pe,U=pe}}const ie=window.devicePixelRatio||1,se=Math.round(H),fe=Math.round(U);Q.width=Math.round(se*ie),Q.height=Math.round(fe*ie),Q.style.width=se+"px",Q.style.height=fe+"px";const de=Q.getContext("2d");if(de&&de.scale(ie,ie),o&&de)try{o(de,se,fe)}catch(te){console.error("Error during canvas initialization:",te)}return window.addEventListener("keydown",$),D(),()=>{window.removeEventListener("keydown",$),g.current&&cancelAnimationFrame(g.current)}},[t,s,r,$,D]),S.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:S.jsx("canvas",{ref:y})})}$s("CanvasBlock",(i,e,t,s)=>{const r=i.timeline;if(!r)return{responseData:[],participantState:s};const n=rc(r),a=[];let o={...e.store||{}},l=0,u=0;const h=()=>o,c=()=>a,d=y=>{o=y};let f=Dn(n,0,h,c,d);for(;f<n.instructions.length;){let y=n.instructions[f].content;typeof y=="function"&&(y=y(a,o));const m=(y.simulate||t.respondToSlide)(y,s);if(s=m.participantState,!y.ignoreData){const g=y.displayDuration||m.reactionTime||1e3;let b={index:f,trialNumber:u,start:l,end:l+g,duration:g,key:m.key,reactionTime:m.reactionTime};b=nc(b,y,a,o),a.push(b),l+=g}u++,f=Dn(n,f+1,h,c,d)}return{responseData:a,participantState:s,storeUpdates:o,duration:l}},{respondToSlide:(i,e)=>{const t=i.allowedKeys;return t===!0?{key:" ",reactionTime:K.uniform(200,800),participantState:e}:Array.isArray(t)&&t.length>0?{key:t[Math.floor(K.uniform(0,t.length))],reactionTime:K.uniform(200,800),participantState:e}:{key:null,reactionTime:null,participantState:e}}}),Zs("CheckDevice","session"),$s("CheckDevice",(i,e,t,s)=>{const r={windowWidth:1920,windowHeight:1080,screenWidth:1920,screenHeight:1080,browser:"Simulated",browserVersion:"1.0",isMobile:!1,operatingSystem:"Simulated",hasWebAudio:!0,hasFullscreen:!0,hasWebcam:!0,hasMicrophone:!0};return{responseData:r,participantState:s,storeUpdates:{_reactiveDeviceInfo:r}}},{});function US({check:i,content:e=S.jsx("div",{children:"Your device doesn't meet the requirements for this experiment."}),data:t,store:s,updateStore:r,next:n}){const[a,o]=V.useState(!1),l=V.useRef(!1);V.useEffect(()=>{if(l.current)return;(async()=>{const c=window.innerWidth,d=window.innerHeight,f=window.screen.width,y=window.screen.height,v=navigator.userAgent;let m="Unknown",g="Unknown";if(v.indexOf("Chrome")>-1){m="Chrome";const D=v.match(/Chrome\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Firefox")>-1){m="Firefox";const D=v.match(/Firefox\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Safari")>-1){m="Safari";const D=v.match(/Version\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Edge")>-1){m="Edge";const D=v.match(/Edge\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("MSIE")>-1||v.indexOf("Trident/")>-1){m="Internet Explorer";const D=v.match(/(?:MSIE |rv:)(\d+\.\d+)/);g=D?D[1]:"Unknown"}const b=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(v);let x="Unknown";/Windows/.test(v)?x="Windows":/Macintosh|Mac OS X/.test(v)?x="MacOS":/Linux/.test(v)?x="Linux":/Android/.test(v)?x="Android":/iOS|iPhone|iPad|iPod/.test(v)&&(x="iOS");const I=!!(window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext),L=!!(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen||document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled);let A=!1,k=!1;try{const D=await navigator.mediaDevices.enumerateDevices();A=D.some($=>$.kind==="videoinput"),k=D.some($=>$.kind==="audioinput")}catch(D){console.error("Error checking media devices:",D)}const P={windowWidth:c,windowHeight:d,screenWidth:f,screenHeight:y,browser:m,browserVersion:g,isMobile:b,operatingSystem:x,hasWebAudio:I,hasFullscreen:L,hasWebcam:A,hasMicrophone:k};r({_reactiveDeviceInfo:P}),(i?i(P,t,s):!0)&&!l.current?(l.current=!0,n(P)):o(!0)})()},[i,t,r,n]);const u=xi(qi());return a?S.jsx("div",{className:`min-h-screen ${u.containerBg}`,children:S.jsx("div",{className:"max-w-prose mx-auto mt-20 mb-20 px-4",children:S.jsx("article",{className:`prose prose-2xl ${u.prose} text-xl ${u.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${u.text} leading-relaxed`,children:e})})}):null}Zs("StoreUI","storeui");function jS(i,e){const t={};return i.forEach(s=>{t[s.storeKey]=(e==null?void 0:e[s.storeKey])!==void 0?e[s.storeKey]:s.defaultValue}),t}$s("StoreUI",(i,e,t,s)=>{const r=jS(i.fields||[],e.store);return{responseData:r,participantState:s,storeUpdates:r}},{});function Sfe({next:i,updateStore:e,store:t,title:s="Settings",description:r,fields:n,saveButtonText:a="Save Configuration"}){const[o,l]=V.useState({}),[u,h]=V.useState({}),[c,d]=V.useState({});V.useEffect(()=>{l(jS(n,t));const g={};n.forEach(b=>{g[b.storeKey]=!1}),d(g)},[t,n]);const f=(g,b)=>{if(g.type==="integer"||g.type==="float"){if(b==null||b==="")return"This field is required";if(g.min!==void 0&&b<g.min)return`Value must be at least ${g.min}`;if(g.max!==void 0&&b>g.max)return`Value must be at most ${g.max}`}else if(g.type==="string"){if(g.minLength!==void 0&&b.length<g.minLength)return`Must be at least ${g.minLength} characters`;if(g.maxLength!==void 0&&b.length>g.maxLength)return`Must be at most ${g.maxLength} characters`}if(g.validate){const x=g.validate(b);if(x!==!0&&x!=="")return typeof x=="string"?x:"Invalid value"}return null};V.useEffect(()=>{const g={};n.forEach(b=>{const x=o[b.storeKey];if(!c[b.storeKey])return;const I=f(b,x);I&&(g[b.storeKey]=I)}),h(g)},[o,n,c]);const y=(g,b)=>{l(x=>({...x,[g]:b})),d(x=>({...x,[g]:!0}))},v=()=>{const g={};n.forEach(x=>{g[x.storeKey]=!0}),d(g);const b={};n.forEach(x=>{const I=o[x.storeKey];if(x.type==="integer"||x.type==="float"?I==null||I===""?b[x.storeKey]="This field is required":x.min!==void 0&&I<x.min?b[x.storeKey]=`Value must be at least ${x.min}`:x.max!==void 0&&I>x.max&&(b[x.storeKey]=`Value must be at most ${x.max}`):x.type==="string"&&(x.minLength!==void 0&&I.length<x.minLength?b[x.storeKey]=`Must be at least ${x.minLength} characters`:x.maxLength!==void 0&&I.length>x.maxLength&&(b[x.storeKey]=`Must be at most ${x.maxLength} characters`)),x.validate&&!b[x.storeKey]){const L=x.validate(I);L!==!0&&L!==""&&(b[x.storeKey]=typeof L=="string"?L:"Invalid value")}}),h(b),Object.keys(b).length===0&&(e(o),i(o))},m=Object.keys(u).length>0;return S.jsxs("div",{className:"max-w-prose mx-auto mt-20 mb-20 px-4",children:[S.jsx("h1",{className:"text-4xl font-bold mb-6",children:s}),r&&S.jsx("article",{className:"prose prose-lg mb-10",children:r}),S.jsx("div",{className:"mt-12 space-y-12",children:n.map(g=>S.jsxs("div",{className:"space-y-2",children:[S.jsxs("label",{className:"block text-xl font-medium text-gray-900",children:[g.label,g.type==="integer"&&g.min!==void 0&&g.max!==void 0&&` (${g.min}-${g.max})`,g.type==="float"&&g.min!==void 0&&g.max!==void 0&&` (${g.min}-${g.max})`]}),g.prompt&&S.jsx("p",{className:"mb-4 text-base text-gray-700 mb-2",children:g.prompt}),g.type==="boolean"&&S.jsxs("div",{className:"flex items-center",children:[S.jsxs("div",{className:`relative cursor-pointer w-10 h-10 flex items-center justify-center border-2 border-black rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none ${o[g.storeKey]?"bg-blue-600 text-white":"bg-white"}`,onClick:()=>y(g.storeKey,!o[g.storeKey]),children:[S.jsx("input",{type:"checkbox",checked:!!o[g.storeKey],onChange:b=>y(g.storeKey,b.target.checked),className:"absolute opacity-0 h-0 w-0"}),o[g.storeKey]&&S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})]}),S.jsx("span",{className:"ml-3 text-lg",children:"Enabled"})]}),(g.type==="integer"||g.type==="float")&&S.jsxs("div",{className:"flex items-center space-x-4",children:[g.min!==void 0&&g.max!==void 0&&S.jsx("button",{onClick:()=>y(g.storeKey,Math.max(g.min||0,(o[g.storeKey]||0)-(g.step||1))),className:"cursor-pointer bg-white h-10 w-10 flex items-center justify-center border-2 border-black font-bold text-black text-lg rounded-full shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"-"}),S.jsx("input",{type:"text",value:o[g.storeKey]||"",onChange:b=>{const x=b.target.value;let I;g.type==="integer"?I=x===""?"":parseInt(x,10):g.type==="float"&&(I=x===""?"":parseFloat(x)),(x===""||!isNaN(I))&&y(g.storeKey,I)},step:g.step||(g.type==="integer"?1:.1),min:g.min,max:g.max,className:"w-24 px-4 py-2 text-center border-2 border-black rounded-xl text-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),g.min!==void 0&&g.max!==void 0&&S.jsx("button",{onClick:()=>y(g.storeKey,Math.min(g.max||1/0,(o[g.storeKey]||0)+(g.step||1))),className:"cursor-pointer bg-white h-10 w-10 flex items-center justify-center border-2 border-black font-bold text-black text-lg rounded-full shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"+"})]}),g.type==="string"&&S.jsx("input",{type:"text",value:o[g.storeKey]||"",onChange:b=>y(g.storeKey,b.target.value),className:"w-full px-4 py-2 border-2 border-black rounded-xl text-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),u[g.storeKey]&&c[g.storeKey]&&S.jsx("div",{className:"text-red-500 text-sm mt-1",children:u[g.storeKey]}),g.component&&S.jsx("div",{className:"mt-4",children:V.createElement(g.component,{value:o[g.storeKey]})})]},g.storeKey))}),S.jsx("div",{className:"mt-12 flex justify-center",children:S.jsx("button",{onClick:v,disabled:m,className:`bg-white cursor-pointer px-8 py-3 border-2 border-black font-bold text-black text-lg rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none ${m?"opacity-50 cursor-not-allowed":""}`,children:a})})]})}const Eu=V.createContext({});function av(i){const e=V.useRef(null);return e.current===null&&(e.current=i()),e.current}const ov=typeof window<"u"?V.useLayoutEffect:V.useEffect,Ld=V.createContext(null);function lv(i,e){i.indexOf(e)===-1&&i.push(e)}function _d(i,e){const t=i.indexOf(e);t>-1&&i.splice(t,1)}const Nr=(i,e,t)=>t>e?e:t<i?i:t;function uv(i,e){return e?`${i}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:i}let qo=()=>{},pn=()=>{};typeof process<"u"&&((fT=process.env)==null?void 0:fT.NODE_ENV)!=="production"&&(qo=(i,e,t)=>{!i&&typeof console<"u"&&console.warn(uv(e,t))},pn=(i,e,t)=>{if(!i)throw new Error(uv(e,t))});const Jn={},zS=i=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i);function WS(i){return typeof i=="object"&&i!==null}const GS=i=>/^0[^.\s]+$/u.test(i);function KS(i){let e;return()=>(e===void 0&&(e=i()),e)}const Gi=i=>i,Tfe=(i,e)=>t=>e(i(t)),Vu=(...i)=>i.reduce(Tfe),Su=(i,e,t)=>{const s=e-i;return s===0?1:(t-i)/s};class hv{constructor(){this.subscriptions=[]}add(e){return lv(this.subscriptions,e),()=>_d(this.subscriptions,e)}notify(e,t,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,s);else for(let n=0;n<r;n++){const a=this.subscriptions[n];a&&a(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const gi=i=>i*1e3,Ki=i=>i/1e3;function ZS(i,e){return e?i*(1e3/e):0}const JS=new Set;function cv(i,e,t){i||JS.has(e)||(console.warn(uv(e,t)),JS.add(e))}const YS=(i,e,t)=>(((1-3*t+3*e)*i+(3*t-6*e))*i+3*e)*i,Pfe=1e-7,Ife=12;function Rfe(i,e,t,s,r){let n,a,o=0;do a=e+(t-e)/2,n=YS(a,s,r)-i,n>0?t=a:e=a;while(Math.abs(n)>Pfe&&++o<Ife);return a}function Tu(i,e,t,s){if(i===e&&t===s)return Gi;const r=n=>Rfe(n,0,1,i,t);return n=>n===0||n===1?n:YS(r(n),e,s)}const XS=i=>e=>e<=.5?i(2*e)/2:(2-i(2*(1-e)))/2,e3=i=>e=>1-i(1-e),t3=Tu(.33,1.53,.69,.99),dv=e3(t3),s3=XS(dv),i3=i=>i>=1?1:(i*=2)<1?.5*dv(i):.5*(2-Math.pow(2,-10*(i-1))),pv=i=>1-Math.sin(Math.acos(i)),r3=e3(pv),n3=XS(pv),Afe=Tu(.42,0,1,1),Lfe=Tu(0,0,.58,1),a3=Tu(.42,0,.58,1),_fe=i=>Array.isArray(i)&&typeof i[0]!="number",o3=i=>Array.isArray(i)&&typeof i[0]=="number",l3={linear:Gi,easeIn:Afe,easeInOut:a3,easeOut:Lfe,circIn:pv,circInOut:n3,circOut:r3,backIn:dv,backInOut:s3,backOut:t3,anticipate:i3},Dfe=i=>typeof i=="string",u3=i=>{if(o3(i)){pn(i.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,t,s,r]=i;return Tu(e,t,s,r)}else if(Dfe(i))return pn(l3[i]!==void 0,`Invalid easing type '${i}'`,"invalid-easing-type"),l3[i];return i},Dd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function kfe(i,e){let t=new Set,s=new Set,r=!1,n=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(h){a.has(h)&&(u.schedule(h),i()),h(o)}const u={schedule:(h,c=!1,d=!1)=>{const y=d&&r?t:s;return c&&a.add(h),y.add(h),h},cancel:h=>{s.delete(h),a.delete(h)},process:h=>{if(o=h,r){n=!0;return}r=!0;const c=t;t=s,s=c,t.forEach(l),t.clear(),r=!1,n&&(n=!1,u.process(h))}};return u}const Ofe=40;function h3(i,e){let t=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},n=()=>t=!0,a=Dd.reduce((x,I)=>(x[I]=kfe(n),x),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:h,update:c,preRender:d,render:f,postRender:y}=a,v=()=>{const x=Jn.useManualTiming,I=x?r.timestamp:performance.now();t=!1,x||(r.delta=s?1e3/60:Math.max(Math.min(I-r.timestamp,Ofe),1)),r.timestamp=I,r.isProcessing=!0,o.process(r),l.process(r),u.process(r),h.process(r),c.process(r),d.process(r),f.process(r),y.process(r),r.isProcessing=!1,t&&e&&(s=!1,i(v))},m=()=>{t=!0,s=!0,r.isProcessing||i(v)};return{schedule:Dd.reduce((x,I)=>{const L=a[I];return x[I]=(A,k=!1,P=!1)=>(t||m(),L.schedule(A,k,P)),x},{}),cancel:x=>{for(let I=0;I<Dd.length;I++)a[Dd[I]].cancel(x)},state:r,steps:a}}const{schedule:Pt,cancel:Yn,state:Ms,steps:fv}=h3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gi,!0);let kd;function Mfe(){kd=void 0}const ei={now:()=>(kd===void 0&&ei.set(Ms.isProcessing||Jn.useManualTiming?Ms.timestamp:performance.now()),kd),set:i=>{kd=i,queueMicrotask(Mfe)}},c3=i=>e=>typeof e=="string"&&e.startsWith(i),d3=c3("--"),Nfe=c3("var(--"),mv=i=>Nfe(i)?Ffe.test(i.split("/*")[0].trim()):!1,Ffe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function p3(i){return typeof i!="string"?!1:i.split("/*")[0].includes("var(--")}const Bo={test:i=>typeof i=="number",parse:parseFloat,transform:i=>i},Pu={...Bo,transform:i=>Nr(0,1,i)},Od={...Bo,default:1},Iu=i=>Math.round(i*1e5)/1e5,gv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qfe(i){return i==null}const Bfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vv=(i,e)=>t=>!!(typeof t=="string"&&Bfe.test(t)&&t.startsWith(i)||e&&!qfe(t)&&Object.prototype.hasOwnProperty.call(t,e)),f3=(i,e,t)=>s=>{if(typeof s!="string")return s;const[r,n,a,o]=s.match(gv);return{[i]:parseFloat(r),[e]:parseFloat(n),[t]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},$fe=i=>Nr(0,255,i),yv={...Bo,transform:i=>Math.round($fe(i))},ka={test:vv("rgb","red"),parse:f3("red","green","blue"),transform:({red:i,green:e,blue:t,alpha:s=1})=>"rgba("+yv.transform(i)+", "+yv.transform(e)+", "+yv.transform(t)+", "+Iu(Pu.transform(s))+")"};function Hfe(i){let e="",t="",s="",r="";return i.length>5?(e=i.substring(1,3),t=i.substring(3,5),s=i.substring(5,7),r=i.substring(7,9)):(e=i.substring(1,2),t=i.substring(2,3),s=i.substring(3,4),r=i.substring(4,5),e+=e,t+=t,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Cv={test:vv("#"),parse:Hfe,transform:ka.transform},Ru=i=>({test:e=>typeof e=="string"&&e.endsWith(i)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${i}`}),Xn=Ru("deg"),Fr=Ru("%"),Ee=Ru("px"),Qfe=Ru("vh"),Ufe=Ru("vw"),m3={...Fr,parse:i=>Fr.parse(i)/100,transform:i=>Fr.transform(i*100)},$o={test:vv("hsl","hue"),parse:f3("hue","saturation","lightness"),transform:({hue:i,saturation:e,lightness:t,alpha:s=1})=>"hsla("+Math.round(i)+", "+Fr.transform(Iu(e))+", "+Fr.transform(Iu(t))+", "+Iu(Pu.transform(s))+")"},fs={test:i=>ka.test(i)||Cv.test(i)||$o.test(i),parse:i=>ka.test(i)?ka.parse(i):$o.test(i)?$o.parse(i):Cv.parse(i),transform:i=>typeof i=="string"?i:i.hasOwnProperty("red")?ka.transform(i):$o.transform(i),getAnimatableNone:i=>{const e=fs.parse(i);return e.alpha=0,fs.transform(e)}},jfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zfe(i){var e,t;return isNaN(i)&&typeof i=="string"&&(((e=i.match(gv))==null?void 0:e.length)||0)+(((t=i.match(jfe))==null?void 0:t.length)||0)>0}const g3="number",v3="color",Wfe="var",Gfe="var(",y3="${}",Kfe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ho(i){const e=i.toString(),t=[],s={color:[],number:[],var:[]},r=[];let n=0;const o=e.replace(Kfe,l=>(fs.test(l)?(s.color.push(n),r.push(v3),t.push(fs.parse(l))):l.startsWith(Gfe)?(s.var.push(n),r.push(Wfe),t.push(l)):(s.number.push(n),r.push(g3),t.push(parseFloat(l))),++n,y3)).split(y3);return{values:t,split:o,indexes:s,types:r}}function Zfe(i){return Ho(i).values}function C3({split:i,types:e}){const t=i.length;return s=>{let r="";for(let n=0;n<t;n++)if(r+=i[n],s[n]!==void 0){const a=e[n];a===g3?r+=Iu(s[n]):a===v3?r+=fs.transform(s[n]):r+=s[n]}return r}}function Jfe(i){return C3(Ho(i))}const Yfe=i=>typeof i=="number"?0:fs.test(i)?fs.getAnimatableNone(i):i,Xfe=(i,e)=>typeof i=="number"?e!=null&&e.trim().endsWith("/")?i:0:Yfe(i);function eme(i){const e=Ho(i);return C3(e)(e.values.map((s,r)=>Xfe(s,e.split[r])))}const fr={test:zfe,parse:Zfe,createTransformer:Jfe,getAnimatableNone:eme};function bv(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function tme({hue:i,saturation:e,lightness:t,alpha:s}){i/=360,e/=100,t/=100;let r=0,n=0,a=0;if(!e)r=n=a=t;else{const o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;r=bv(l,o,i+1/3),n=bv(l,o,i),a=bv(l,o,i-1/3)}return{red:Math.round(r*255),green:Math.round(n*255),blue:Math.round(a*255),alpha:s}}function Md(i,e){return t=>t>0?e:i}const Bt=(i,e,t)=>i+(e-i)*t,wv=(i,e,t)=>{const s=i*i,r=t*(e*e-s)+s;return r<0?0:Math.sqrt(r)},sme=[Cv,ka,$o],ime=i=>sme.find(e=>e.test(i));function b3(i){const e=ime(i);if(qo(!!e,`'${i}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let t=e.parse(i);return e===$o&&(t=tme(t)),t}const w3=(i,e)=>{const t=b3(i),s=b3(e);if(!t||!s)return Md(i,e);const r={...t};return n=>(r.red=wv(t.red,s.red,n),r.green=wv(t.green,s.green,n),r.blue=wv(t.blue,s.blue,n),r.alpha=Bt(t.alpha,s.alpha,n),ka.transform(r))},xv=new Set(["none","hidden"]);function rme(i,e){return xv.has(i)?t=>t<=0?i:e:t=>t>=1?e:i}function nme(i,e){return t=>Bt(i,e,t)}function Ev(i){return typeof i=="number"?nme:typeof i=="string"?mv(i)?Md:fs.test(i)?w3:lme:Array.isArray(i)?x3:typeof i=="object"?fs.test(i)?w3:ame:Md}function x3(i,e){const t=[...i],s=t.length,r=i.map((n,a)=>Ev(n)(n,e[a]));return n=>{for(let a=0;a<s;a++)t[a]=r[a](n);return t}}function ame(i,e){const t={...i,...e},s={};for(const r in t)i[r]!==void 0&&e[r]!==void 0&&(s[r]=Ev(i[r])(i[r],e[r]));return r=>{for(const n in s)t[n]=s[n](r);return t}}function ome(i,e){const t=[],s={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const n=e.types[r],a=i.indexes[n][s[n]],o=i.values[a]??0;t[r]=o,s[n]++}return t}const lme=(i,e)=>{const t=fr.createTransformer(e),s=Ho(i),r=Ho(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?xv.has(i)&&!r.values.length||xv.has(e)&&!s.values.length?rme(i,e):Vu(x3(ome(s,r),r.values),t):(qo(!0,`Complex values '${i}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Md(i,e))};function E3(i,e,t){return typeof i=="number"&&typeof e=="number"&&typeof t=="number"?Bt(i,e,t):Ev(i)(i,e)}const ume=i=>{const e=({timestamp:t})=>i(t);return{start:(t=!0)=>Pt.update(e,t),stop:()=>Yn(e),now:()=>Ms.isProcessing?Ms.timestamp:ei.now()}},V3=(i,e,t=10)=>{let s="";const r=Math.max(Math.round(e/t),2);for(let n=0;n<r;n++)s+=Math.round(i(n/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Nd=2e4;function Vv(i){let e=0;const t=50;let s=i.next(e);for(;!s.done&&e<Nd;)e+=t,s=i.next(e);return e>=Nd?1/0:e}function hme(i,e=100,t){const s=t({...i,keyframes:[0,e]}),r=Math.min(Vv(s),Nd);return{type:"keyframes",ease:n=>s.next(r*n).value/e,duration:Ki(r)}}const Wt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Sv(i,e){return i*Math.sqrt(1-e*e)}const cme=12;function dme(i,e,t){let s=t;for(let r=1;r<cme;r++)s=s-i(s)/e(s);return s}const Tv=.001;function pme({duration:i=Wt.duration,bounce:e=Wt.bounce,velocity:t=Wt.velocity,mass:s=Wt.mass}){let r,n;qo(i<=gi(Wt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=Nr(Wt.minDamping,Wt.maxDamping,a),i=Nr(Wt.minDuration,Wt.maxDuration,Ki(i)),a<1?(r=u=>{const h=u*a,c=h*i,d=h-t,f=Sv(u,a),y=Math.exp(-c);return Tv-d/f*y},n=u=>{const c=u*a*i,d=c*t+t,f=Math.pow(a,2)*Math.pow(u,2)*i,y=Math.exp(-c),v=Sv(Math.pow(u,2),a);return(-r(u)+Tv>0?-1:1)*((d-f)*y)/v}):(r=u=>{const h=Math.exp(-u*i),c=(u-t)*i+1;return-Tv+h*c},n=u=>{const h=Math.exp(-u*i),c=(t-u)*(i*i);return h*c});const o=5/i,l=dme(r,n,o);if(i=gi(i),isNaN(l))return{stiffness:Wt.stiffness,damping:Wt.damping,duration:i};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:a*2*Math.sqrt(s*u),duration:i}}}const fme=["duration","bounce"],mme=["stiffness","damping","mass"];function S3(i,e){return e.some(t=>i[t]!==void 0)}function gme(i){let e={velocity:Wt.velocity,stiffness:Wt.stiffness,damping:Wt.damping,mass:Wt.mass,isResolvedFromDuration:!1,...i};if(!S3(i,mme)&&S3(i,fme))if(e.velocity=0,i.visualDuration){const t=i.visualDuration,s=2*Math.PI/(t*1.2),r=s*s,n=2*Nr(.05,1,1-(i.bounce||0))*Math.sqrt(r);e={...e,mass:Wt.mass,stiffness:r,damping:n}}else{const t=pme({...i,velocity:0});e={...e,...t,mass:Wt.mass},e.isResolvedFromDuration=!0}return e}function Fd(i=Wt.visualDuration,e=Wt.bounce){const t=typeof i!="object"?{visualDuration:i,keyframes:[0,1],bounce:e}:i;let{restSpeed:s,restDelta:r}=t;const n=t.keyframes[0],a=t.keyframes[t.keyframes.length-1],o={done:!1,value:n},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:f}=gme({...t,velocity:-Ki(t.velocity||0)}),y=d||0,v=u/(2*Math.sqrt(l*h)),m=a-n,g=Ki(Math.sqrt(l/h)),b=Math.abs(m)<5;s||(s=b?Wt.restSpeed.granular:Wt.restSpeed.default),r||(r=b?Wt.restDelta.granular:Wt.restDelta.default);let x,I,L,A,k,P;if(v<1)L=Sv(g,v),A=(y+v*g*m)/L,x=D=>{const $=Math.exp(-v*g*D);return a-$*(A*Math.sin(L*D)+m*Math.cos(L*D))},k=v*g*A+m*L,P=v*g*m-A*L,I=D=>Math.exp(-v*g*D)*(k*Math.sin(L*D)+P*Math.cos(L*D));else if(v===1){x=$=>a-Math.exp(-g*$)*(m+(y+g*m)*$);const D=y+g*m;I=$=>Math.exp(-g*$)*(g*D*$-y)}else{const D=g*Math.sqrt(v*v-1);x=B=>{const H=Math.exp(-v*g*B),U=Math.min(D*B,300);return a-H*((y+v*g*m)*Math.sinh(U)+D*m*Math.cosh(U))/D};const $=(y+v*g*m)/D,Q=v*g*$-m*D,_=v*g*m-$*D;I=B=>{const H=Math.exp(-v*g*B),U=Math.min(D*B,300);return H*(Q*Math.sinh(U)+_*Math.cosh(U))}}const O={calculatedDuration:f&&c||null,velocity:D=>gi(I(D)),next:D=>{if(!f&&v<1){const Q=Math.exp(-v*g*D),_=Math.sin(L*D),B=Math.cos(L*D),H=a-Q*(A*_+m*B),U=gi(Q*(k*_+P*B));return o.done=Math.abs(U)<=s&&Math.abs(a-H)<=r,o.value=o.done?a:H,o}const $=x(D);if(f)o.done=D>=c;else{const Q=gi(I(D));o.done=Math.abs(Q)<=s&&Math.abs(a-$)<=r}return o.value=o.done?a:$,o},toString:()=>{const D=Math.min(Vv(O),Nd),$=V3(Q=>O.next(D*Q).value,D,30);return D+"ms "+$},toTransition:()=>{}};return O}Fd.applyToOptions=i=>{const e=hme(i,100,Fd);return i.ease=e.ease,i.duration=gi(e.duration),i.type="keyframes",i};const vme=5;function T3(i,e,t){const s=Math.max(e-vme,0);return ZS(t-i(s),e-s)}function Pv({keyframes:i,velocity:e=0,power:t=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=i[0],d={done:!1,value:c},f=P=>o!==void 0&&P<o||l!==void 0&&P>l,y=P=>o===void 0?l:l===void 0||Math.abs(o-P)<Math.abs(l-P)?o:l;let v=t*e;const m=c+v,g=a===void 0?m:a(m);g!==m&&(v=g-c);const b=P=>-v*Math.exp(-P/s),x=P=>g+b(P),I=P=>{const O=b(P),D=x(P);d.done=Math.abs(O)<=u,d.value=d.done?g:D};let L,A;const k=P=>{f(d.value)&&(L=P,A=Fd({keyframes:[d.value,y(d.value)],velocity:T3(x,P,d.value),damping:r,stiffness:n,restDelta:u,restSpeed:h}))};return k(0),{calculatedDuration:null,next:P=>{let O=!1;return!A&&L===void 0&&(O=!0,I(P),k(P)),L!==void 0&&P>=L?A.next(P-L):(!O&&I(P),d)}}}function yme(i,e,t){const s=[],r=t||Jn.mix||E3,n=i.length-1;for(let a=0;a<n;a++){let o=r(i[a],i[a+1]);if(e){const l=Array.isArray(e)?e[a]||Gi:e;o=Vu(l,o)}s.push(o)}return s}function Cme(i,e,{clamp:t=!0,ease:s,mixer:r}={}){const n=i.length;if(pn(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return()=>e[0];if(n===2&&e[0]===e[1])return()=>e[1];const a=i[0]===i[1];i[0]>i[n-1]&&(i=[...i].reverse(),e=[...e].reverse());const o=yme(e,s,r),l=o.length,u=h=>{if(a&&h<i[0])return e[0];let c=0;if(l>1)for(;c<i.length-2&&!(h<i[c+1]);c++);const d=Su(i[c],i[c+1],h);return o[c](d)};return t?h=>u(Nr(i[0],i[n-1],h)):u}function bme(i,e){const t=i[i.length-1];for(let s=1;s<=e;s++){const r=Su(0,e,s);i.push(Bt(t,1,r))}}function wme(i){const e=[0];return bme(e,i.length-1),e}function xme(i,e){return i.map(t=>t*e)}function Eme(i,e){return i.map(()=>e||a3).splice(0,i.length-1)}function Qo({duration:i=300,keyframes:e,times:t,ease:s="easeInOut"}){const r=_fe(s)?s.map(u3):u3(s),n={done:!1,value:e[0]},a=xme(t&&t.length===e.length?t:wme(e),i),o=Cme(a,e,{ease:Array.isArray(r)?r:Eme(e,r)});return{calculatedDuration:i,next:l=>(n.value=o(l),n.done=l>=i,n)}}const Vme=i=>i!==null;function qd(i,{repeat:e,repeatType:t="loop"},s,r=1){const n=i.filter(Vme),o=r<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return!o||s===void 0?n[o]:s}const Sme={decay:Pv,inertia:Pv,tween:Qo,keyframes:Qo,spring:Fd};function P3(i){typeof i.type=="string"&&(i.type=Sme[i.type])}class Iv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Tme=i=>i/100;class Bd extends Iv{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,r;const{motionValue:t}=this.options;t&&t.updatedAt!==ei.now()&&this.tick(ei.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;P3(e);const{type:t=Qo,repeat:s=0,repeatDelay:r=0,repeatType:n,velocity:a=0}=e;let{keyframes:o}=e;const l=t||Qo;process.env.NODE_ENV!=="production"&&l!==Qo&&pn(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,"spring-two-frames"),l!==Qo&&typeof o[0]!="number"&&(this.mixKeyframes=Vu(Tme,E3(o[0],o[1])),o=[0,100]);const u=l({...e,keyframes:o});n==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=Vv(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:s,totalDuration:r,mixKeyframes:n,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:f,type:y,onUpdate:v,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,I=s;if(c){const P=Math.min(this.currentTime,r)/o;let O=Math.floor(P),D=P%1;!D&&P>=1&&(D=1),D===1&&O--,O=Math.min(O,c+1),!!(O%2)&&(d==="reverse"?(D=1-D,f&&(D-=f/o)):d==="mirror"&&(I=a)),x=Nr(0,1,D)*o}let L;b?(this.delayState.value=h[0],L=this.delayState):L=I.next(x),n&&!b&&(L.value=n(L.value));let{done:A}=L;!b&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return k&&y!==Pv&&(L.value=qd(h,this.options,m,this.speed)),v&&v(L.value),k&&this.finish(),L}then(e,t){return this.finished.then(e,t)}get duration(){return Ki(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(this.currentTime)}set time(e){e=gi(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return T3(s=>this.generator.next(s).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ei.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Ki(this.currentTime))}play(){var r,n;if(this.isStopped)return;const{driver:e=ume,startTime:t}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(n=(r=this.options).onPlay)==null||n.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ei.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",(t=(e=this.options).onComplete)==null||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(t=(e=this.options).onCancel)==null||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(t=this.driver)==null||t.stop(),e.observe(this)}}function Pme(i){for(let e=1;e<i.length;e++)i[e]??(i[e]=i[e-1])}const Oa=i=>i*180/Math.PI,Rv=i=>{const e=Oa(Math.atan2(i[1],i[0]));return Av(e)},Ime={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:i=>(Math.abs(i[0])+Math.abs(i[3]))/2,rotate:Rv,rotateZ:Rv,skewX:i=>Oa(Math.atan(i[1])),skewY:i=>Oa(Math.atan(i[2])),skew:i=>(Math.abs(i[1])+Math.abs(i[2]))/2},Av=i=>(i=i%360,i<0&&(i+=360),i),I3=Rv,R3=i=>Math.sqrt(i[0]*i[0]+i[1]*i[1]),A3=i=>Math.sqrt(i[4]*i[4]+i[5]*i[5]),Rme={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:R3,scaleY:A3,scale:i=>(R3(i)+A3(i))/2,rotateX:i=>Av(Oa(Math.atan2(i[6],i[5]))),rotateY:i=>Av(Oa(Math.atan2(-i[2],i[0]))),rotateZ:I3,rotate:I3,skewX:i=>Oa(Math.atan(i[4])),skewY:i=>Oa(Math.atan(i[1])),skew:i=>(Math.abs(i[1])+Math.abs(i[4]))/2};function Lv(i){return i.includes("scale")?1:0}function _v(i,e){if(!i||i==="none")return Lv(e);const t=i.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(t)s=Rme,r=t;else{const o=i.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ime,r=o}if(!r)return Lv(e);const n=s[e],a=r[1].split(",").map(Lme);return typeof n=="function"?n(a):a[n]}const Ame=(i,e)=>{const{transform:t="none"}=getComputedStyle(i);return _v(t,e)};function Lme(i){return parseFloat(i.trim())}const Uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jo=new Set(Uo),L3=i=>i===Bo||i===Ee,_me=new Set(["x","y","z"]),Dme=Uo.filter(i=>!_me.has(i));function kme(i){const e=[];return Dme.forEach(t=>{const s=i.getValue(t);s!==void 0&&(e.push([t,s.get()]),s.set(t.startsWith("scale")?1:0))}),e}const ea={width:({x:i},{paddingLeft:e="0",paddingRight:t="0",boxSizing:s})=>{const r=i.max-i.min;return s==="border-box"?r:r-parseFloat(e)-parseFloat(t)},height:({y:i},{paddingTop:e="0",paddingBottom:t="0",boxSizing:s})=>{const r=i.max-i.min;return s==="border-box"?r:r-parseFloat(e)-parseFloat(t)},top:(i,{top:e})=>parseFloat(e),left:(i,{left:e})=>parseFloat(e),bottom:({y:i},{top:e})=>parseFloat(e)+(i.max-i.min),right:({x:i},{left:e})=>parseFloat(e)+(i.max-i.min),x:(i,{transform:e})=>_v(e,"x"),y:(i,{transform:e})=>_v(e,"y")};ea.translateX=ea.x,ea.translateY=ea.y;const Ma=new Set;let Dv=!1,kv=!1,Ov=!1;function _3(){if(kv){const i=Array.from(Ma).filter(s=>s.needsMeasurement),e=new Set(i.map(s=>s.element)),t=new Map;e.forEach(s=>{const r=kme(s);r.length&&(t.set(s,r),s.render())}),i.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const r=t.get(s);r&&r.forEach(([n,a])=>{var o;(o=s.getValue(n))==null||o.set(a)})}),i.forEach(s=>s.measureEndState()),i.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}kv=!1,Dv=!1,Ma.forEach(i=>i.complete(Ov)),Ma.clear()}function D3(){Ma.forEach(i=>{i.readKeyframes(),i.needsMeasurement&&(kv=!0)})}function Ome(){Ov=!0,D3(),_3(),Ov=!1}class Mv{constructor(e,t,s,r,n,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=r,this.element=n,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ma.add(this),Dv||(Dv=!0,Pt.read(D3),Pt.resolveKeyframes(_3))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:s,motionValue:r}=this;if(e[0]===null){const n=r==null?void 0:r.get(),a=e[e.length-1];if(n!==void 0)e[0]=n;else if(s&&t){const o=s.readValue(t,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),r&&n===void 0&&r.set(e[0])}Pme(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ma.delete(this)}cancel(){this.state==="scheduled"&&(Ma.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Mme=i=>i.startsWith("--");function k3(i,e,t){Mme(e)?i.style.setProperty(e,t):i.style[e]=t}const Nme={};function O3(i,e){const t=KS(i);return()=>Nme[e]??t()}const Fme=O3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),M3=O3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Au=([i,e,t,s])=>`cubic-bezier(${i}, ${e}, ${t}, ${s})`,N3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Au([0,.65,.55,1]),circOut:Au([.55,0,1,.45]),backIn:Au([.31,.01,.66,-.59]),backOut:Au([.33,1.53,.69,.99])};function F3(i,e){if(i)return typeof i=="function"?M3()?V3(i,e):"ease-out":o3(i)?Au(i):Array.isArray(i)?i.map(t=>F3(t,e)||N3.easeOut):N3[i]}function qme(i,e,t,{delay:s=0,duration:r=300,repeat:n=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:t};l&&(h.offset=l);const c=F3(o,r);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:n+1,direction:a==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),i.animate(h,d)}function q3(i){return typeof i=="function"&&"applyToOptions"in i}function Bme({type:i,...e}){return q3(i)&&M3()?i.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class B3 extends Iv{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:r,pseudoElement:n,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!n,this.allowFlatten=a,this.options=e,pn(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Bme(e);this.animation=qme(t,s,r,u,n),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){const h=qd(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(h),k3(t,s,h),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;(t=(e=this.animation).finish)==null||t.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,s,r;const e=(t=this.options)==null?void 0:t.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var t,s;const e=((s=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:s.call(t).duration)||0;return Ki(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gi(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:s,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Fme()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),s&&(this.animation.rangeEnd=s),Gi):r(this)}}const $3={anticipate:i3,backInOut:s3,circInOut:n3};function $me(i){return i in $3}function Hme(i){typeof i.ease=="string"&&$me(i.ease)&&(i.ease=$3[i.ease])}const Nv=10;class Qme extends B3{constructor(e){Hme(e),P3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:s,onComplete:r,element:n,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const o=new Bd({...a,autoplay:!1}),l=Math.max(Nv,ei.now()-this.startTime),u=Nr(0,Nv,l-Nv),h=o.sample(l).value,{name:c}=this.options;n&&c&&k3(n,c,h),t.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const H3=(i,e)=>e==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(fr.test(i)||i==="0")&&!i.startsWith("url("));function Ume(i){const e=i[0];if(i.length===1)return!0;for(let t=0;t<i.length;t++)if(i[t]!==e)return!0}function jme(i,e,t,s){const r=i[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const n=i[i.length-1],a=H3(r,e),o=H3(n,e);return qo(a===o,`You are trying to animate ${e} from "${r}" to "${n}". "${a?n:r}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:Ume(i)||(t==="spring"||q3(t))&&s}function Fv(i){i.duration=0,i.type="keyframes"}const Q3=new Set(["opacity","clipPath","filter","transform"]),zme=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Wme(i){for(let e=0;e<i.length;e++)if(typeof i[e]=="string"&&zme.test(i[e]))return!0;return!1}const Gme=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Kme=KS(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Zme(i){var c;const{motionValue:e,name:t,repeatDelay:s,repeatType:r,damping:n,type:a,keyframes:o}=i;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:h}=e.owner.getProps();return Kme()&&t&&(Q3.has(t)||Gme.has(t)&&Wme(o))&&(t!=="transform"||!h)&&!u&&!s&&r!=="mirror"&&n!==0&&a!=="inertia"}const Jme=40;class Yme extends Iv{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:a="loop",keyframes:o,name:l,motionValue:u,element:h,...c}){var y;super(),this.stop=()=>{var v,m;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=ei.now();const d={autoplay:e,delay:t,type:s,repeat:r,repeatDelay:n,repeatType:a,name:l,motionValue:u,element:h,...c},f=(h==null?void 0:h.KeyframeResolver)||Mv;this.keyframeResolver=new f(o,(v,m,g)=>this.onKeyframesResolved(v,m,d,!g),l,u,h),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,t,s,r){var g,b;this.keyframeResolver=void 0;const{name:n,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:h}=s;this.resolvedAt=ei.now();let c=!0;jme(e,n,a,o)||(c=!1,(Jn.instantAnimations||!l)&&(h==null||h(qd(e,s,t))),e[0]=e[e.length-1],Fv(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Jme?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},y=c&&!u&&Zme(f),v=(b=(g=f.motionValue)==null?void 0:g.owner)==null?void 0:b.current;let m;if(y)try{m=new Qme({...f,element:v})}catch{m=new Bd(f)}else m=new Bd(f);m.finished.then(()=>{this.notifyFinished()}).catch(Gi),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ome()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function U3(i,e,t,s=0,r=1){const n=Array.from(i).sort((u,h)=>u.sortNodePosition(h)).indexOf(e),a=i.size,o=(a-1)*s;return typeof t=="function"?t(n,a):r===1?n*s:o-n*s}const Xme=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ege(i){const e=Xme.exec(i);if(!e)return[,];const[,t,s,r]=e;return[`--${t??s}`,r]}const tge=4;function j3(i,e,t=1){pn(t<=tge,`Max CSS variable fallback depth detected in property "${i}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=ege(i);if(!s)return;const n=window.getComputedStyle(e).getPropertyValue(s);if(n){const a=n.trim();return zS(a)?parseFloat(a):a}return mv(r)?j3(r,e,t+1):r}const sge={type:"spring",stiffness:500,damping:25,restSpeed:10},ige=i=>({type:"spring",stiffness:550,damping:i===0?2*Math.sqrt(550):30,restSpeed:10}),rge={type:"keyframes",duration:.8},nge={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},age=(i,{keyframes:e})=>e.length>2?rge:jo.has(i)?i.startsWith("scale")?ige(e[1]):sge:nge;function z3(i,e){if(i!=null&&i.inherit&&e){const{inherit:t,...s}=i;return{...e,...s}}return i}function qv(i,e){const t=(i==null?void 0:i[e])??(i==null?void 0:i.default)??i;return t!==i?z3(t,i):t}const oge=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function lge(i){for(const e in i)if(!oge.has(e))return!0;return!1}const Bv=(i,e,t,s={},r,n)=>a=>{const o=qv(s,i)||{},l=o.delay||s.delay||0;let{elapsed:u=0}=s;u=u-gi(l);const h={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:d=>{e.set(d),o.onUpdate&&o.onUpdate(d)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:i,motionValue:e,element:n?void 0:r};lge(o)||Object.assign(h,age(i,h)),h.duration&&(h.duration=gi(h.duration)),h.repeatDelay&&(h.repeatDelay=gi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let c=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Fv(h),h.delay===0&&(c=!0)),(Jn.instantAnimations||Jn.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(c=!0,Fv(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,c&&!n&&e.get()!==void 0){const d=qd(h.keyframes,o);if(d!==void 0){Pt.update(()=>{h.onUpdate(d),h.onComplete()});return}}return o.isSync?new Bd(h):new Yme(h)};function W3(i){const e=[{},{}];return i==null||i.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function $v(i,e,t,s){if(typeof e=="function"){const[r,n]=W3(s);e=e(t!==void 0?t:i.custom,r,n)}if(typeof e=="string"&&(e=i.variants&&i.variants[e]),typeof e=="function"){const[r,n]=W3(s);e=e(t!==void 0?t:i.custom,r,n)}return e}function Na(i,e,t){const s=i.getProps();return $v(s,e,t!==void 0?t:s.custom,i)}const G3=new Set(["width","height","top","left","right","bottom",...Uo]),K3=30,uge=i=>!isNaN(parseFloat(i));class hge{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var n;const r=ei.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((n=this.events.change)==null||n.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ei.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uge(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&cv(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new hv);const s=this.events[e].add(t);return e==="change"?()=>{s(),Pt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>K3)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,K3);return ZS(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,t;(e=this.dependents)==null||e.clear(),(t=this.events.destroy)==null||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zo(i,e){return new hge(i,e)}const Hv=i=>Array.isArray(i);function cge(i,e,t){i.hasValue(e)?i.getValue(e).set(t):i.addValue(e,zo(t))}function dge(i){return Hv(i)?i[i.length-1]||0:i}function pge(i,e){const t=Na(i,e);let{transitionEnd:s={},transition:r={},...n}=t||{};n={...n,...s};for(const a in n){const o=dge(n[a]);cge(i,a,o)}}const Ns=i=>!!(i&&i.getVelocity);function fge(i){return!!(Ns(i)&&i.add)}function Qv(i,e){const t=i.getValue("willChange");if(fge(t))return t.add(e);if(!t&&Jn.WillChange){const s=new Jn.WillChange("auto");i.addValue("willChange",s),s.add(e)}}function Uv(i){return i.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Z3="data-"+Uv("framerAppearId");function J3(i){return i.props[Z3]}function mge({protectedKeys:i,needsAnimating:e},t){const s=i.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,s}function Y3(i,e,{delay:t=0,transitionOverride:s,type:r}={}){let{transition:n,transitionEnd:a,...o}=e;const l=i.getDefaultTransition();n=n?z3(n,l):l;const u=n==null?void 0:n.reduceMotion;s&&(n=s);const h=[],c=r&&i.animationState&&i.animationState.getState()[r];for(const d in o){const f=i.getValue(d,i.latestValues[d]??null),y=o[d];if(y===void 0||c&&mge(c,d))continue;const v={delay:t,...qv(n||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating()&&!Array.isArray(y)&&y===m&&!v.velocity){Pt.update(()=>f.set(y));continue}let g=!1;if(window.MotionHandoffAnimation){const I=J3(i);if(I){const L=window.MotionHandoffAnimation(I,d,Pt);L!==null&&(v.startTime=L,g=!0)}}Qv(i,d);const b=u??i.shouldReduceMotion;f.start(Bv(d,f,y,b&&G3.has(d)?{type:!1}:v,i,g));const x=f.animation;x&&h.push(x)}if(a){const d=()=>Pt.update(()=>{a&&pge(i,a)});h.length?Promise.all(h).then(d):d()}return h}function jv(i,e,t={}){var l;const s=Na(i,e,t.type==="exit"?(l=i.presenceContext)==null?void 0:l.custom:void 0);let{transition:r=i.getDefaultTransition()||{}}=s||{};t.transitionOverride&&(r=t.transitionOverride);const n=s?()=>Promise.all(Y3(i,s,t)):()=>Promise.resolve(),a=i.variantChildren&&i.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:c,staggerDirection:d}=r;return gge(i,e,u,h,c,d,t)}:()=>Promise.resolve(),{when:o}=r;if(o){const[u,h]=o==="beforeChildren"?[n,a]:[a,n];return u().then(()=>h())}else return Promise.all([n(),a(t.delay)])}function gge(i,e,t=0,s=0,r=0,n=1,a){const o=[];for(const l of i.variantChildren)l.notify("AnimationStart",e),o.push(jv(l,e,{...a,delay:t+(typeof s=="function"?0:s)+U3(i.variantChildren,l,s,r,n)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function vge(i,e,t={}){i.notify("AnimationStart",e);let s;if(Array.isArray(e)){const r=e.map(n=>jv(i,n,t));s=Promise.all(r)}else if(typeof e=="string")s=jv(i,e,t);else{const r=typeof e=="function"?Na(i,e,t.custom):e;s=Promise.all(Y3(i,r,t))}return s.then(()=>{i.notify("AnimationComplete",e)})}const yge={test:i=>i==="auto",parse:i=>i},X3=i=>e=>e.test(i),e7=[Bo,Ee,Fr,Xn,Ufe,Qfe,yge],t7=i=>e7.find(X3(i));function Cge(i){return typeof i=="number"?i===0:i!==null?i==="none"||i==="0"||GS(i):!0}const bge=new Set(["brightness","contrast","saturate","opacity"]);function wge(i){const[e,t]=i.slice(0,-1).split("(");if(e==="drop-shadow")return i;const[s]=t.match(gv)||[];if(!s)return i;const r=t.replace(s,"");let n=bge.has(e)?1:0;return s!==t&&(n*=100),e+"("+n+r+")"}const xge=/\b([a-z-]*)\(.*?\)/gu,zv={...fr,getAnimatableNone:i=>{const e=i.match(xge);return e?e.map(wge).join(" "):i}},Wv={...fr,getAnimatableNone:i=>{const e=fr.parse(i);return fr.createTransformer(i)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},s7={...Bo,transform:Math.round},Gv={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,inset:Ee,insetBlock:Ee,insetBlockStart:Ee,insetBlockEnd:Ee,insetInline:Ee,insetInlineStart:Ee,insetInlineEnd:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,paddingBlock:Ee,paddingBlockStart:Ee,paddingBlockEnd:Ee,paddingInline:Ee,paddingInlineStart:Ee,paddingInlineEnd:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,marginBlock:Ee,marginBlockStart:Ee,marginBlockEnd:Ee,marginInline:Ee,marginInlineStart:Ee,marginInlineEnd:Ee,fontSize:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee,...{rotate:Xn,rotateX:Xn,rotateY:Xn,rotateZ:Xn,scale:Od,scaleX:Od,scaleY:Od,scaleZ:Od,skew:Xn,skewX:Xn,skewY:Xn,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Pu,originX:m3,originY:m3,originZ:Ee},zIndex:s7,fillOpacity:Pu,strokeOpacity:Pu,numOctaves:s7},Ege={...Gv,color:fs,backgroundColor:fs,outlineColor:fs,fill:fs,stroke:fs,borderColor:fs,borderTopColor:fs,borderRightColor:fs,borderBottomColor:fs,borderLeftColor:fs,filter:zv,WebkitFilter:zv,mask:Wv,WebkitMask:Wv},i7=i=>Ege[i],Vge=new Set([zv,Wv]);function r7(i,e){let t=i7(i);return Vge.has(t)||(t=fr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const Sge=new Set(["auto","none","0"]);function Tge(i,e,t){let s=0,r;for(;s<i.length&&!r;){const n=i[s];typeof n=="string"&&!Sge.has(n)&&Ho(n).values.length&&(r=i[s]),s++}if(r&&t)for(const n of e)i[n]=r7(t,r)}class Pge extends Mv{constructor(e,t,s,r,n){super(e,t,s,r,n,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let c=e[h];if(typeof c=="string"&&(c=c.trim(),mv(c))){const d=j3(c,t.current);d!==void 0&&(e[h]=d),h===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!G3.has(s)||e.length!==2)return;const[r,n]=e,a=t7(r),o=t7(n),l=p3(r),u=p3(n);if(l!==u&&ea[s]){this.needsMeasurement=!0;return}if(a!==o)if(L3(a)&&L3(o))for(let h=0;h<e.length;h++){const c=e[h];typeof c=="string"&&(e[h]=parseFloat(c))}else ea[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,s=[];for(let r=0;r<e.length;r++)(e[r]===null||Cge(e[r]))&&s.push(r);s.length&&Tge(e,s,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ea[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(s,r).jump(r,!1)}measureEndState(){var o;const{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const n=s.length-1,a=s[n];s[n]=ea[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function n7(i,e,t){if(i==null)return[];if(i instanceof EventTarget)return[i];if(typeof i=="string"){let s=document;const r=(t==null?void 0:t[i])??s.querySelectorAll(i);return r?Array.from(r):[]}return Array.from(i).filter(s=>s!=null)}const a7=(i,e)=>e&&typeof i=="number"?e.transform(i):i;function $d(i){return WS(i)&&"offsetHeight"in i&&!("ownerSVGElement"in i)}const{schedule:Kv}=h3(queueMicrotask,!1),mr={x:!1,y:!1};function o7(){return mr.x||mr.y}function Ige(i){return i==="x"||i==="y"?mr[i]?null:(mr[i]=!0,()=>{mr[i]=!1}):mr.x||mr.y?null:(mr.x=mr.y=!0,()=>{mr.x=mr.y=!1})}function l7(i,e){const t=n7(i),s=new AbortController,r={passive:!0,...e,signal:s.signal};return[t,r,()=>s.abort()]}function Rge(i){return!(i.pointerType==="touch"||o7())}function Age(i,e,t={}){const[s,r,n]=l7(i,t);return s.forEach(a=>{let o=!1,l=!1,u;const h=()=>{a.removeEventListener("pointerleave",y)},c=m=>{u&&(u(m),u=void 0),h()},d=m=>{o=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,c(m))},f=()=>{o=!0,window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",d,r)},y=m=>{if(m.pointerType!=="touch"){if(o){l=!0;return}c(m)}},v=m=>{if(!Rge(m))return;l=!1;const g=e(a,m);typeof g=="function"&&(u=g,a.addEventListener("pointerleave",y,r))};a.addEventListener("pointerenter",v,r),a.addEventListener("pointerdown",f,r)}),n}const u7=(i,e)=>e?i===e?!0:u7(i,e.parentElement):!1,Zv=i=>i.pointerType==="mouse"?typeof i.button!="number"||i.button<=0:i.isPrimary!==!1,Lge=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _ge(i){return Lge.has(i.tagName)||i.isContentEditable===!0}const Dge=new Set(["INPUT","SELECT","TEXTAREA"]);function kge(i){return Dge.has(i.tagName)||i.isContentEditable===!0}const Hd=new WeakSet;function h7(i){return e=>{e.key==="Enter"&&i(e)}}function Jv(i,e){i.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Oge=(i,e)=>{const t=i.currentTarget;if(!t)return;const s=h7(()=>{if(Hd.has(t))return;Jv(t,"down");const r=h7(()=>{Jv(t,"up")}),n=()=>Jv(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",n,e)});t.addEventListener("keydown",s,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",s),e)};function c7(i){return Zv(i)&&!o7()}const d7=new WeakSet;function Mge(i,e,t={}){const[s,r,n]=l7(i,t),a=o=>{const l=o.currentTarget;if(!c7(o)||d7.has(o))return;Hd.add(l),t.stopPropagation&&d7.add(o);const u=e(l,o),h=(f,y)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",d),Hd.has(l)&&Hd.delete(l),c7(f)&&typeof u=="function"&&u(f,{success:y})},c=f=>{h(f,l===window||l===document||t.useGlobalTarget||u7(l,f.target))},d=f=>{h(f,!1)};window.addEventListener("pointerup",c,r),window.addEventListener("pointercancel",d,r)};return s.forEach(o=>{(t.useGlobalTarget?window:o).addEventListener("pointerdown",a,r),$d(o)&&(o.addEventListener("focus",u=>Oge(u,r)),!_ge(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),n}function Yv(i){return WS(i)&&"ownerSVGElement"in i}const Qd=new WeakMap;let ta;const p7=(i,e,t)=>(s,r)=>r&&r[0]?r[0][i+"Size"]:Yv(s)&&"getBBox"in s?s.getBBox()[e]:s[t],Nge=p7("inline","width","offsetWidth"),Fge=p7("block","height","offsetHeight");function qge({target:i,borderBoxSize:e}){var t;(t=Qd.get(i))==null||t.forEach(s=>{s(i,{get width(){return Nge(i,e)},get height(){return Fge(i,e)}})})}function Bge(i){i.forEach(qge)}function $ge(){typeof ResizeObserver>"u"||(ta=new ResizeObserver(Bge))}function Hge(i,e){ta||$ge();const t=n7(i);return t.forEach(s=>{let r=Qd.get(s);r||(r=new Set,Qd.set(s,r)),r.add(e),ta==null||ta.observe(s)}),()=>{t.forEach(s=>{const r=Qd.get(s);r==null||r.delete(e),r!=null&&r.size||ta==null||ta.unobserve(s)})}}const Ud=new Set;let Wo;function Qge(){Wo=()=>{const i={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ud.forEach(e=>e(i))},window.addEventListener("resize",Wo)}function Uge(i){return Ud.add(i),Wo||Qge(),()=>{Ud.delete(i),!Ud.size&&typeof Wo=="function"&&(window.removeEventListener("resize",Wo),Wo=void 0)}}function f7(i,e){return typeof i=="function"?Uge(i):Hge(i,e)}function jge(i){return Yv(i)&&i.tagName==="svg"}const zge=[...e7,fs,fr],Wge=i=>zge.find(X3(i)),m7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Go=()=>({x:m7(),y:m7()}),g7=()=>({min:0,max:0}),bs=()=>({x:g7(),y:g7()}),Gge=new WeakMap;function jd(i){return i!==null&&typeof i=="object"&&typeof i.start=="function"}function Lu(i){return typeof i=="string"||Array.isArray(i)}const Xv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],e0=["initial",...Xv];function zd(i){return jd(i.animate)||e0.some(e=>Lu(i[e]))}function v7(i){return!!(zd(i)||i.variants)}function Kge(i,e,t){for(const s in e){const r=e[s],n=t[s];if(Ns(r))i.addValue(s,r);else if(Ns(n))i.addValue(s,zo(r,{owner:i}));else if(n!==r)if(i.hasValue(s)){const a=i.getValue(s);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=i.getStaticValue(s);i.addValue(s,zo(a!==void 0?a:r,{owner:i}))}}for(const s in t)e[s]===void 0&&i.removeValue(s);return e}const t0={current:null},y7={current:!1},Zge=typeof window<"u";function Jge(){if(y7.current=!0,!!Zge)if(window.matchMedia){const i=window.matchMedia("(prefers-reduced-motion)"),e=()=>t0.current=i.matches;i.addEventListener("change",e),e()}else t0.current=!1}const C7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wd={};function b7(i){Wd=i}function Yge(){return Wd}class Xge{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:r,skipAnimations:n,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Mv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=ei.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Pt.render(this.render,!1,!0))};const{latestValues:u,renderState:h}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=h,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=n,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=zd(t),this.isVariantNode=v7(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const y=d[f];u[f]!==void 0&&Ns(y)&&y.set(u[f])}}mount(e){var t,s;if(this.hasBeenMounted)for(const r in this.initialValues)(t=this.values.get(r))==null||t.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,Gge.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(y7.current||Jge(),this.shouldReduceMotion=t0.current),process.env.NODE_ENV!=="production"&&cv(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Yn(this.notifyUpdate),Yn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Q3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:u,duration:h}=t.accelerate,c=new B3({element:this.current,name:e,keyframes:o,times:l,ease:u,duration:gi(h)}),d=a(c);this.valueSubscriptions.set(e,()=>{d(),c.cancel()});return}const s=jo.has(e);s&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Pt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let n;typeof window<"u"&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),n&&n(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Wd){const t=Wd[e];if(!t)continue;const{isEnabled:s,Feature:r}=t;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bs()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let s=0;s<C7.length;s++){const r=C7[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n="on"+r,a=e[n];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=Kge(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&t!==void 0&&(s=zo(t===null?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(zS(s)||GS(s))?s=parseFloat(s):!Wge(s)&&fr.test(t)&&(s=r7(e,t)),this.setBaseTarget(e,Ns(s)?s.get():s)),Ns(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var n;const{initial:t}=this.props;let s;if(typeof t=="string"||typeof t=="object"){const a=$v(this.props,t,(n=this.presenceContext)==null?void 0:n.custom);a&&(s=a[e])}if(t&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ns(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new hv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Kv.render(this.render)}}class w7 extends Xge{constructor(){super(...arguments),this.KeyframeResolver=Pge}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ns(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class sa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function x7({top:i,left:e,right:t,bottom:s}){return{x:{min:e,max:t},y:{min:i,max:s}}}function eve({x:i,y:e}){return{top:e.min,right:i.max,bottom:e.max,left:i.min}}function tve(i,e){if(!e)return i;const t=e({x:i.left,y:i.top}),s=e({x:i.right,y:i.bottom});return{top:t.y,left:t.x,bottom:s.y,right:s.x}}function s0(i){return i===void 0||i===1}function i0({scale:i,scaleX:e,scaleY:t}){return!s0(i)||!s0(e)||!s0(t)}function Fa(i){return i0(i)||E7(i)||i.z||i.rotate||i.rotateX||i.rotateY||i.skewX||i.skewY}function E7(i){return V7(i.x)||V7(i.y)}function V7(i){return i&&i!=="0%"}function Gd(i,e,t){const s=i-t,r=e*s;return t+r}function S7(i,e,t,s,r){return r!==void 0&&(i=Gd(i,r,s)),Gd(i,t,s)+e}function r0(i,e=0,t=1,s,r){i.min=S7(i.min,e,t,s,r),i.max=S7(i.max,e,t,s,r)}function T7(i,{x:e,y:t}){r0(i.x,e.translate,e.scale,e.originPoint),r0(i.y,t.translate,t.scale,t.originPoint)}const P7=.999999999999,I7=1.0000000000001;function sve(i,e,t,s=!1){var o;const r=t.length;if(!r)return;e.x=e.y=1;let n,a;for(let l=0;l<r;l++){n=t[l],a=n.projectionDelta;const{visualElement:u}=n.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qr(i.x,-n.scroll.offset.x),qr(i.y,-n.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,T7(i,a)),s&&Fa(n.latestValues)&&Kd(i,n.latestValues,(o=n.layout)==null?void 0:o.layoutBox))}e.x<I7&&e.x>P7&&(e.x=1),e.y<I7&&e.y>P7&&(e.y=1)}function qr(i,e){i.min+=e,i.max+=e}function R7(i,e,t,s,r=.5){const n=Bt(i.min,i.max,r);r0(i,e,t,n,s)}function A7(i,e){return typeof i=="string"?parseFloat(i)/100*(e.max-e.min):i}function Kd(i,e,t){const s=t??i;R7(i.x,A7(e.x,s.x),e.scaleX,e.scale,e.originX),R7(i.y,A7(e.y,s.y),e.scaleY,e.scale,e.originY)}function L7(i,e){return x7(tve(i.getBoundingClientRect(),e))}function ive(i,e,t){const s=L7(i,t),{scroll:r}=e;return r&&(qr(s.x,r.offset.x),qr(s.y,r.offset.y)),s}const rve={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nve=Uo.length;function ave(i,e,t){let s="",r=!0;for(let n=0;n<nve;n++){const a=Uo[n],o=i[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);l=a.startsWith("scale")?u===1:u===0}if(!l||t){const u=a7(o,Gv[a]);if(!l){r=!1;const h=rve[a]||a;s+=`${h}(${u}) `}t&&(e[a]=u)}}return s=s.trim(),t?s=t(e,r?"":s):r&&(s="none"),s}function n0(i,e,t){const{style:s,vars:r,transformOrigin:n}=i;let a=!1,o=!1;for(const l in e){const u=e[l];if(jo.has(l)){a=!0;continue}else if(d3(l)){r[l]=u;continue}else{const h=a7(u,Gv[l]);l.startsWith("origin")?(o=!0,n[l]=h):s[l]=h}}if(e.transform||(a||t?s.transform=ave(e,i.transform,t):s.transform&&(s.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:h=0}=n;s.transformOrigin=`${l} ${u} ${h}`}}function _7(i,{style:e,vars:t},s,r){const n=i.style;let a;for(a in e)n[a]=e[a];r==null||r.applyProjectionStyles(n,s);for(a in t)n.setProperty(a,t[a])}function D7(i,e){return e.max===e.min?0:i/(e.max-e.min)*100}const _u={correct:(i,e)=>{if(!e.target)return i;if(typeof i=="string")if(Ee.test(i))i=parseFloat(i);else return i;const t=D7(i,e.target.x),s=D7(i,e.target.y);return`${t}% ${s}%`}},ove={correct:(i,{treeScale:e,projectionDelta:t})=>{const s=i,r=fr.parse(i);if(r.length>5)return s;const n=fr.createTransformer(i),a=typeof r[0]!="number"?1:0,o=t.x.scale*e.x,l=t.y.scale*e.y;r[0+a]/=o,r[1+a]/=l;const u=Bt(o,l,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),n(r)}},a0={borderRadius:{..._u,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_u,borderTopRightRadius:_u,borderBottomLeftRadius:_u,borderBottomRightRadius:_u,boxShadow:ove};function k7(i,{layout:e,layoutId:t}){return jo.has(i)||i.startsWith("origin")||(e||t!==void 0)&&(!!a0[i]||i==="opacity")}function o0(i,e,t){var a;const s=i.style,r=e==null?void 0:e.style,n={};if(!s)return n;for(const o in s)(Ns(s[o])||r&&Ns(r[o])||k7(o,i)||((a=t==null?void 0:t.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(n[o]=s[o]);return n}function lve(i){return window.getComputedStyle(i)}class uve extends w7{constructor(){super(...arguments),this.type="html",this.renderInstance=_7}readValueFromInstance(e,t){var s;if(jo.has(t))return(s=this.projection)!=null&&s.isProjecting?Lv(t):Ame(e,t);{const r=lve(e),n=(d3(t)?r.getPropertyValue(t):r[t])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return L7(e,t)}build(e,t,s){n0(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return o0(e,t,s)}}const hve={offset:"stroke-dashoffset",array:"stroke-dasharray"},cve={offset:"strokeDashoffset",array:"strokeDasharray"};function dve(i,e,t=1,s=0,r=!0){i.pathLength=1;const n=r?hve:cve;i[n.offset]=`${-s}`,i[n.array]=`${e} ${t}`}const pve=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function O7(i,{attrX:e,attrY:t,attrScale:s,pathLength:r,pathSpacing:n=1,pathOffset:a=0,...o},l,u,h){if(n0(i,o,u),l){i.style.viewBox&&(i.attrs.viewBox=i.style.viewBox);return}i.attrs=i.style,i.style={};const{attrs:c,style:d}=i;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete c.transformBox);for(const f of pve)c[f]!==void 0&&(d[f]=c[f],delete c[f]);e!==void 0&&(c.x=e),t!==void 0&&(c.y=t),s!==void 0&&(c.scale=s),r!==void 0&&dve(c,r,n,a,!1)}const M7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),N7=i=>typeof i=="string"&&i.toLowerCase()==="svg";function fve(i,e,t,s){_7(i,e,void 0,s);for(const r in e.attrs)i.setAttribute(M7.has(r)?r:Uv(r),e.attrs[r])}function F7(i,e,t){const s=o0(i,e,t);for(const r in i)if(Ns(i[r])||Ns(e[r])){const n=Uo.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[n]=i[r]}return s}class mve extends w7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bs}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(jo.has(t)){const s=i7(t);return s&&s.default||0}return t=M7.has(t)?t:Uv(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return F7(e,t,s)}build(e,t,s){O7(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,r){fve(e,t,s,r)}mount(e){this.isSVGTag=N7(e.tagName),super.mount(e)}}const gve=e0.length;function q7(i){if(!i)return;if(!i.isControllingVariants){const t=i.parent?q7(i.parent)||{}:{};return i.props.initial!==void 0&&(t.initial=i.props.initial),t}const e={};for(let t=0;t<gve;t++){const s=e0[t],r=i.props[s];(Lu(r)||r===!1)&&(e[s]=r)}return e}function B7(i,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==i.length)return!1;for(let s=0;s<t;s++)if(e[s]!==i[s])return!1;return!0}const vve=[...Xv].reverse(),yve=Xv.length;function Cve(i){return e=>Promise.all(e.map(({animation:t,options:s})=>vge(i,t,s)))}function bve(i){let e=Cve(i),t=$7(),s=!0,r=!1;const n=u=>(h,c)=>{var f;const d=Na(i,c,u==="exit"?(f=i.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:y,transitionEnd:v,...m}=d;h={...h,...m,...v}}return h};function a(u){e=u(i)}function o(u){const{props:h}=i,c=q7(i.parent)||{},d=[],f=new Set;let y={},v=1/0;for(let g=0;g<yve;g++){const b=vve[g],x=t[b],I=h[b]!==void 0?h[b]:c[b],L=Lu(I),A=b===u?x.isActive:null;A===!1&&(v=g);let k=I===c[b]&&I!==h[b]&&L;if(k&&(s||r)&&i.manuallyAnimateOnMount&&(k=!1),x.protectedKeys={...y},!x.isActive&&A===null||!I&&!x.prevProp||jd(I)||typeof I=="boolean")continue;if(b==="exit"&&x.isActive&&A!==!0){x.prevResolvedValues&&(y={...y,...x.prevResolvedValues});continue}const P=wve(x.prevProp,I);let O=P||b===u&&x.isActive&&!k&&L||g>v&&L,D=!1;const $=Array.isArray(I)?I:[I];let Q=$.reduce(n(b),{});A===!1&&(Q={});const{prevResolvedValues:_={}}=x,B={..._,...Q},H=j=>{O=!0,f.has(j)&&(D=!0,f.delete(j)),x.needsAnimating[j]=!0;const ae=i.getValue(j);ae&&(ae.liveStyle=!1)};for(const j in B){const ae=Q[j],X=_[j];if(y.hasOwnProperty(j))continue;let ue=!1;Hv(ae)&&Hv(X)?ue=!B7(ae,X):ue=ae!==X,ue?ae!=null?H(j):f.add(j):ae!==void 0&&f.has(j)?H(j):x.protectedKeys[j]=!0}x.prevProp=I,x.prevResolvedValues=Q,x.isActive&&(y={...y,...Q}),(s||r)&&i.blockInitialAnimation&&(O=!1);const U=k&&P;O&&(!U||D)&&d.push(...$.map(j=>{const ae={type:b};if(typeof j=="string"&&(s||r)&&!U&&i.manuallyAnimateOnMount&&i.parent){const{parent:X}=i,ue=Na(X,j);if(X.enteringChildren&&ue){const{delayChildren:ie}=ue.transition||{};ae.delay=U3(X.enteringChildren,i,ie)}}return{animation:j,options:ae}}))}if(f.size){const g={};if(typeof h.initial!="boolean"){const b=Na(i,Array.isArray(h.initial)?h.initial[0]:h.initial);b&&b.transition&&(g.transition=b.transition)}f.forEach(b=>{const x=i.getBaseTarget(b),I=i.getValue(b);I&&(I.liveStyle=!0),g[b]=x??null}),d.push({animation:g})}let m=!!d.length;return s&&(h.initial===!1||h.initial===h.animate)&&!i.manuallyAnimateOnMount&&(m=!1),s=!1,r=!1,m?e(d):Promise.resolve()}function l(u,h){var d;if(t[u].isActive===h)return Promise.resolve();(d=i.variantChildren)==null||d.forEach(f=>{var y;return(y=f.animationState)==null?void 0:y.setActive(u,h)}),t[u].isActive=h;const c=o(u);for(const f in t)t[f].protectedKeys={};return c}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>t,reset:()=>{t=$7(),r=!0}}}function wve(i,e){return typeof e=="string"?e!==i:Array.isArray(e)?!B7(e,i):!1}function qa(i=!1){return{isActive:i,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $7(){return{animate:qa(!0),whileInView:qa(),whileHover:qa(),whileTap:qa(),whileDrag:qa(),whileFocus:qa(),exit:qa()}}function l0(i,e){i.min=e.min,i.max=e.max}function gr(i,e){l0(i.x,e.x),l0(i.y,e.y)}function H7(i,e){i.translate=e.translate,i.scale=e.scale,i.originPoint=e.originPoint,i.origin=e.origin}const Q7=1e-4,xve=1-Q7,Eve=1+Q7,U7=.01,Vve=0-U7,Sve=0+U7;function ti(i){return i.max-i.min}function Tve(i,e,t){return Math.abs(i-e)<=t}function j7(i,e,t,s=.5){i.origin=s,i.originPoint=Bt(e.min,e.max,i.origin),i.scale=ti(t)/ti(e),i.translate=Bt(t.min,t.max,i.origin)-i.originPoint,(i.scale>=xve&&i.scale<=Eve||isNaN(i.scale))&&(i.scale=1),(i.translate>=Vve&&i.translate<=Sve||isNaN(i.translate))&&(i.translate=0)}function Du(i,e,t,s){j7(i.x,e.x,t.x,s?s.originX:void 0),j7(i.y,e.y,t.y,s?s.originY:void 0)}function z7(i,e,t,s=0){const r=s?Bt(t.min,t.max,s):t.min;i.min=r+e.min,i.max=i.min+ti(e)}function Pve(i,e,t,s){z7(i.x,e.x,t.x,s==null?void 0:s.x),z7(i.y,e.y,t.y,s==null?void 0:s.y)}function W7(i,e,t,s=0){const r=s?Bt(t.min,t.max,s):t.min;i.min=e.min-r,i.max=i.min+ti(e)}function Zd(i,e,t,s){W7(i.x,e.x,t.x,s==null?void 0:s.x),W7(i.y,e.y,t.y,s==null?void 0:s.y)}function G7(i,e,t,s,r){return i-=e,i=Gd(i,1/t,s),r!==void 0&&(i=Gd(i,1/r,s)),i}function Ive(i,e=0,t=1,s=.5,r,n=i,a=i){if(Fr.test(e)&&(e=parseFloat(e),e=Bt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=Bt(n.min,n.max,s);i===n&&(o-=e),i.min=G7(i.min,e,t,o,r),i.max=G7(i.max,e,t,o,r)}function K7(i,e,[t,s,r],n,a){Ive(i,e[t],e[s],e[r],e.scale,n,a)}const Rve=["x","scaleX","originX"],Ave=["y","scaleY","originY"];function Z7(i,e,t,s){K7(i.x,e,Rve,t?t.x:void 0,s?s.x:void 0),K7(i.y,e,Ave,t?t.y:void 0,s?s.y:void 0)}function J7(i){return i.translate===0&&i.scale===1}function Y7(i){return J7(i.x)&&J7(i.y)}function X7(i,e){return i.min===e.min&&i.max===e.max}function Lve(i,e){return X7(i.x,e.x)&&X7(i.y,e.y)}function e4(i,e){return Math.round(i.min)===Math.round(e.min)&&Math.round(i.max)===Math.round(e.max)}function t4(i,e){return e4(i.x,e.x)&&e4(i.y,e.y)}function s4(i){return ti(i.x)/ti(i.y)}function i4(i,e){return i.translate===e.translate&&i.scale===e.scale&&i.originPoint===e.originPoint}function Br(i){return[i("x"),i("y")]}function _ve(i,e,t){let s="";const r=i.x.translate/e.x,n=i.y.translate/e.y,a=(t==null?void 0:t.z)||0;if((r||n||a)&&(s=`translate3d(${r}px, ${n}px, ${a}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:u,rotate:h,rotateX:c,rotateY:d,skewX:f,skewY:y}=t;u&&(s=`perspective(${u}px) ${s}`),h&&(s+=`rotate(${h}deg) `),c&&(s+=`rotateX(${c}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),y&&(s+=`skewY(${y}deg) `)}const o=i.x.scale*e.x,l=i.y.scale*e.y;return(o!==1||l!==1)&&(s+=`scale(${o}, ${l})`),s||"none"}const r4=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Dve=r4.length,n4=i=>typeof i=="string"?parseFloat(i):i,a4=i=>typeof i=="number"||Ee.test(i);function kve(i,e,t,s,r,n){r?(i.opacity=Bt(0,t.opacity??1,Ove(s)),i.opacityExit=Bt(e.opacity??1,0,Mve(s))):n&&(i.opacity=Bt(e.opacity??1,t.opacity??1,s));for(let a=0;a<Dve;a++){const o=r4[a];let l=o4(e,o),u=o4(t,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||a4(l)===a4(u)?(i[o]=Math.max(Bt(n4(l),n4(u),s),0),(Fr.test(u)||Fr.test(l))&&(i[o]+="%")):i[o]=u}(e.rotate||t.rotate)&&(i.rotate=Bt(e.rotate||0,t.rotate||0,s))}function o4(i,e){return i[e]!==void 0?i[e]:i.borderRadius}const Ove=l4(0,.5,r3),Mve=l4(.5,.95,Gi);function l4(i,e,t){return s=>s<i?0:s>e?1:t(Su(i,e,s))}function Nve(i,e,t){const s=Ns(i)?i:zo(i);return s.start(Bv("",s,e,t)),s.animation}function ku(i,e,t,s={passive:!0}){return i.addEventListener(e,t,s),()=>i.removeEventListener(e,t)}const Fve=(i,e)=>i.depth-e.depth;class qve{constructor(){this.children=[],this.isDirty=!1}add(e){lv(this.children,e),this.isDirty=!0}remove(e){_d(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Fve),this.isDirty=!1,this.children.forEach(e)}}function Bve(i,e){const t=ei.now(),s=({timestamp:r})=>{const n=r-t;n>=e&&(Yn(s),i(n-e))};return Pt.setup(s,!0),()=>Yn(s)}function Jd(i){return Ns(i)?i.get():i}class $ve{constructor(){this.members=[]}add(e){lv(this.members,e);for(let t=this.members.length-1;t>=0;t--){const s=this.members[t];if(s===e||s===this.lead||s===this.prevLead)continue;const r=s.instance;(!r||r.isConnected===!1)&&!s.snapshot&&(_d(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(_d(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){var t;for(let s=this.members.indexOf(e)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&((t=r.instance)==null?void 0:t.isConnected)!==!1)return this.promote(r),!0}return!1}promote(e,t){var r;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:n}=s.options,{layoutDependency:a}=e.options;(n===void 0||n!==a)&&(e.resumeFrom=s,t&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(r=e.root)!=null&&r.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,s,r,n,a;(s=(t=e.options).onExitComplete)==null||s.call(t),(a=(r=e.resumingFrom)==null?void 0:(n=r.options).onExitComplete)==null||a.call(n)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Yd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},u0=["","X","Y","Z"],Hve=1e3;let Qve=0;function h0(i,e,t,s){const{latestValues:r}=e;r[i]&&(t[i]=r[i],e.setStaticValue(i,0),s&&(s[i]=0))}function u4(i){if(i.hasCheckedOptimisedAppear=!0,i.root===i)return;const{visualElement:e}=i.options;if(!e)return;const t=J3(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:n}=i.options;window.MotionCancelOptimisedAnimation(t,"transform",Pt,!(r||n))}const{parent:s}=i;s&&!s.hasCheckedOptimisedAppear&&u4(s)}function h4({attachResizeListener:i,defaultParent:e,measureScroll:t,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(a={},o=e==null?void 0:e()){this.id=Qve++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(zve),this.nodes.forEach(Yve),this.nodes.forEach(Xve),this.nodes.forEach(Wve)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new qve)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new hv),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Yv(a)&&!jge(a),this.instance=a;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),i){let h,c=0;const d=()=>this.root.updateBlockedByResize=!1;Pt.read(()=>{c=window.innerWidth}),i(a,()=>{const f=window.innerWidth;f!==c&&(c=f,this.root.updateBlockedByResize=!0,h&&h(),h=Bve(d,250),Yd.hasAnimatedSinceResize&&(Yd.hasAnimatedSinceResize=!1,this.nodes.forEach(p4)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:c,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||r0e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:m}=u.getProps(),g=!this.targetLayout||!t4(this.targetLayout,f),b=!c&&d;if(this.options.layoutRoot||this.resumeFrom||b||c&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...qv(y,"layout"),onPlay:v,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(h,b)}else c||p4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Yn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e0e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&u4(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const c=this.path[h];c.shouldResetTransform=!0,(typeof c.latestValues.x=="string"||typeof c.latestValues.y=="string")&&(c.isLayoutDirty=!0),c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Kve),this.nodes.forEach(c4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zve),this.nodes.forEach(Jve),this.nodes.forEach(Uve),this.nodes.forEach(jve)):this.nodes.forEach(d4),this.clearAllSnapshots();const o=ei.now();Ms.delta=Nr(0,1e3/60,o-Ms.timestamp),Ms.timestamp=o,Ms.isProcessing=!0,fv.update.process(Ms),fv.preRender.process(Ms),fv.render.process(Ms),Ms.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gve),this.sharedNodes.forEach(t0e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ti(this.snapshot.measuredBox.x)&&!ti(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=bs()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!Y7(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||Fa(this.latestValues)||h)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),n0e(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return bs();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(a0e))){const{scroll:h}=this.root;h&&(qr(o.x,h.offset.x),qr(o.y,h.offset.y))}return o}removeElementScroll(a){var l;const o=bs();if(gr(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const h=this.path[u],{scroll:c,options:d}=h;h!==this.root&&c&&d.layoutScroll&&(c.wasRoot&&gr(o,a),qr(o.x,c.offset.x),qr(o.y,c.offset.y))}return o}applyTransform(a,o=!1,l){var h,c;const u=l||bs();gr(u,a);for(let d=0;d<this.path.length;d++){const f=this.path[d];!o&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(qr(u.x,-f.scroll.offset.x),qr(u.y,-f.scroll.offset.y)),Fa(f.latestValues)&&Kd(u,f.latestValues,(h=f.layout)==null?void 0:h.layoutBox)}return Fa(this.latestValues)&&Kd(u,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),u}removeTransform(a){var l;const o=bs();gr(o,a);for(let u=0;u<this.path.length;u++){const h=this.path[u];if(!Fa(h.latestValues))continue;let c;h.instance&&(i0(h.latestValues)&&h.updateSnapshot(),c=bs(),gr(c,h.measurePageBox())),Z7(o,h.latestValues,(l=h.snapshot)==null?void 0:l.layoutBox,c)}return Fa(this.latestValues)&&Z7(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ms.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:c}=this.options;if(!this.layout||!(h||c))return;this.resolvedRelativeTargetAt=Ms.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bs(),this.targetWithTransforms=bs()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pve(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gr(this.target,this.layout.layoutBox),T7(this.target,this.targetDelta)):gr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||i0(this.parent.latestValues)||E7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bs(),this.relativeTargetOrigin=bs(),Zd(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),gr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ms.timestamp&&(l=!1),l)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;gr(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,d=this.treeScale.y;sve(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=bs());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(H7(this.prevProjectionDelta.x,this.projectionDelta.x),H7(this.prevProjectionDelta.y,this.projectionDelta.y)),Du(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==d||!i4(this.projectionDelta.x,this.prevProjectionDelta.x)||!i4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Go(),this.projectionDelta=Go(),this.projectionDeltaWithTransform=Go()}setAnimationOrigin(a,o=!1){const l=this.snapshot,u=l?l.latestValues:{},h={...this.latestValues},c=Go();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=bs(),f=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=f!==y,m=this.getStack(),g=!m||m.members.length<=1,b=!!(v&&!g&&this.options.crossfade===!0&&!this.path.some(i0e));this.animationProgress=0;let x;this.mixTargetDelta=I=>{const L=I/1e3;f4(c.x,a.x,L),f4(c.y,a.y,L),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zd(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),s0e(this.relativeTarget,this.relativeTargetOrigin,d,L),x&&Lve(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=bs()),gr(x,this.relativeTarget)),v&&(this.animationValues=h,kve(h,u,this.latestValues,L,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Yn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{Yd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zo(0)),this.motionValue.jump(0,!1),this.currentAnimation=Nve(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Hve),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:h}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&C4(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||bs();const c=ti(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+c;const d=ti(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}gr(o,l),Kd(o,h),Du(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new $ve),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&h0("z",a,u,this.animationValues);for(let h=0;h<u0.length;h++)h0(`rotate${u0[h]}`,a,u,this.animationValues),h0(`skew${u0[h]}`,a,u,this.animationValues);a.render();for(const h in u)a.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Jd(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Jd(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Fa(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=u.animationValues||u.latestValues;this.applyTransformsToTarget();let c=_ve(this.projectionDeltaWithTransform,this.treeScale,h);l&&(c=l(h,c)),a.transform=c;const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=u===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in a0){if(h[y]===void 0)continue;const{correct:v,applyTo:m,isCSSVariable:g}=a0[y],b=c==="none"?h[y]:v(h[y],u);if(m){const x=m.length;for(let I=0;I<x;I++)a[m[I]]=b}else g?this.options.visualElement.renderState.vars[y]=b:a[y]=b}this.options.layoutId&&(a.pointerEvents=u===this?Jd(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(c4),this.root.sharedNodes.clear()}}}function Uve(i){i.updateLayout()}function jve(i){var t;const e=((t=i.resumeFrom)==null?void 0:t.snapshot)||i.snapshot;if(i.isLead()&&i.layout&&e&&i.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=i.layout,{animationType:n}=i.options,a=e.source!==i.layout.source;if(n==="size")Br(c=>{const d=a?e.measuredBox[c]:e.layoutBox[c],f=ti(d);d.min=s[c].min,d.max=d.min+f});else if(n==="x"||n==="y"){const c=n==="x"?"y":"x";l0(a?e.measuredBox[c]:e.layoutBox[c],s[c])}else C4(n,e.layoutBox,s)&&Br(c=>{const d=a?e.measuredBox[c]:e.layoutBox[c],f=ti(s[c]);d.max=d.min+f,i.relativeTarget&&!i.currentAnimation&&(i.isProjectionDirty=!0,i.relativeTarget[c].max=i.relativeTarget[c].min+f)});const o=Go();Du(o,s,e.layoutBox);const l=Go();a?Du(l,i.applyTransform(r,!0),e.measuredBox):Du(l,s,e.layoutBox);const u=!Y7(o);let h=!1;if(!i.resumeFrom){const c=i.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:d,layout:f}=c;if(d&&f){const y=i.options.layoutAnchor||void 0,v=bs();Zd(v,e.layoutBox,d.layoutBox,y);const m=bs();Zd(m,s,f.layoutBox,y),t4(v,m)||(h=!0),c.options.layoutRoot&&(i.relativeTarget=m,i.relativeTargetOrigin=v,i.relativeParent=c)}}}i.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:h})}else if(i.isLead()){const{onExitComplete:s}=i.options;s&&s()}i.options.transition=void 0}function zve(i){i.parent&&(i.isProjecting()||(i.isProjectionDirty=i.parent.isProjectionDirty),i.isSharedProjectionDirty||(i.isSharedProjectionDirty=!!(i.isProjectionDirty||i.parent.isProjectionDirty||i.parent.isSharedProjectionDirty)),i.isTransformDirty||(i.isTransformDirty=i.parent.isTransformDirty))}function Wve(i){i.isProjectionDirty=i.isSharedProjectionDirty=i.isTransformDirty=!1}function Gve(i){i.clearSnapshot()}function c4(i){i.clearMeasurements()}function Kve(i){i.isLayoutDirty=!0,i.updateLayout()}function d4(i){i.isLayoutDirty=!1}function Zve(i){i.isAnimationBlocked&&i.layout&&!i.isLayoutDirty&&(i.snapshot=i.layout,i.isLayoutDirty=!0)}function Jve(i){const{visualElement:e}=i.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),i.resetTransform()}function p4(i){i.finishAnimation(),i.targetDelta=i.relativeTarget=i.target=void 0,i.isProjectionDirty=!0}function Yve(i){i.resolveTargetDelta()}function Xve(i){i.calcProjection()}function e0e(i){i.resetSkewAndRotation()}function t0e(i){i.removeLeadSnapshot()}function f4(i,e,t){i.translate=Bt(e.translate,0,t),i.scale=Bt(e.scale,1,t),i.origin=e.origin,i.originPoint=e.originPoint}function m4(i,e,t,s){i.min=Bt(e.min,t.min,s),i.max=Bt(e.max,t.max,s)}function s0e(i,e,t,s){m4(i.x,e.x,t.x,s),m4(i.y,e.y,t.y,s)}function i0e(i){return i.animationValues&&i.animationValues.opacityExit!==void 0}const r0e={duration:.45,ease:[.4,0,.1,1]},g4=i=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(i),v4=g4("applewebkit/")&&!g4("chrome/")?Math.round:Gi;function y4(i){i.min=v4(i.min),i.max=v4(i.max)}function n0e(i){y4(i.x),y4(i.y)}function C4(i,e,t){return i==="position"||i==="preserve-aspect"&&!Tve(s4(e),s4(t),.2)}function a0e(i){var e;return i!==i.root&&((e=i.scroll)==null?void 0:e.wasRoot)}const o0e=h4({attachResizeListener:(i,e)=>ku(i,"resize",e),measureScroll:()=>{var i,e;return{x:document.documentElement.scrollLeft||((i=document.body)==null?void 0:i.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),l0e=i=>!i.isLayoutDirty&&i.willUpdate(!1);function b4(){const i=new Set,e=new WeakMap,t=()=>i.forEach(l0e);return{add:s=>{i.add(s),e.set(s,s.addEventListener("willUpdate",t))},remove:s=>{i.delete(s);const r=e.get(s);r&&(r(),e.delete(s)),t()},dirty:t}}const c0={current:void 0},w4=h4({measureScroll:i=>({x:i.scrollLeft,y:i.scrollTop}),defaultParent:()=>{if(!c0.current){const i=new o0e({});i.mount(window),i.setOptions({layoutScroll:!0}),c0.current=i}return c0.current},resetTransform:(i,e)=>{i.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:i=>window.getComputedStyle(i).position==="fixed"}),d0=V.createContext({transformPagePoint:i=>i,isStatic:!1,reducedMotion:"never"});function x4(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function u0e(...i){return e=>{let t=!1;const s=i.map(r=>{const n=x4(r,e);return!t&&typeof n=="function"&&(t=!0),n});if(t)return()=>{for(let r=0;r<s.length;r++){const n=s[r];typeof n=="function"?n():x4(i[r],null)}}}}function h0e(...i){return p.useCallback(u0e(...i),i)}class c0e extends p.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if($d(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=t.offsetParent,r=$d(s)&&s.offsetWidth||0,n=$d(s)&&s.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=n-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function d0e({children:i,isPresent:e,anchorX:t,anchorY:s,root:r,pop:n}){var d;const a=V.useId(),o=V.useRef(null),l=V.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=V.useContext(d0),h=((d=i.props)==null?void 0:d.ref)??(i==null?void 0:i.ref),c=h0e(o,h);return V.useInsertionEffect(()=>{const{width:f,height:y,top:v,left:m,right:g,bottom:b}=l.current;if(e||n===!1||!o.current||!f||!y)return;const x=t==="left"?`left: ${m}`:`right: ${g}`,I=s==="bottom"?`bottom: ${b}`:`top: ${v}`;o.current.dataset.motionPopId=a;const L=document.createElement("style");u&&(L.nonce=u);const A=r??document.head;return A.appendChild(L),L.sheet&&L.sheet.insertRule(`
|
|
10245
|
+
`,s=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(t):URL.createObjectURL(new Blob([t],{type:"text/javascript"}));i({workerScripts:{inflate:[s],deflate:[s]}})}const wpe="Writer iterator completed too soon",xpe="text/plain",Epe="Content-Type",Vpe=64*1024,tS="writable";class Jg{constructor(){this.size=0}init(){this.initialized=!0}}class sS extends Jg{get readable(){const e=this,{chunkSize:t=Vpe}=e,s=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:n=0,size:a,diskNumberStart:o}=s,{chunkOffset:l}=this;r.enqueue(await Yg(e,n+l,Math.min(t,a-l),o)),l+t>a?r.close():this.chunkOffset+=t}});return s}}class Spe extends sS{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const s=this,r=e+t;let a=await(e||r<s.size?s.blob.slice(e,r):s.blob).arrayBuffer();return a.byteLength>t&&(a=a.slice(e,r)),new Uint8Array(a)}}class Tpe extends Jg{constructor(e){super();const t=this,s=new TransformStream,r=[];e&&r.push([Epe,e]),Object.defineProperty(t,tS,{get(){return s.writable}}),t.blob=new Response(s.readable,{headers:r}).blob()}getData(){return this.blob}}class Ppe extends Spe{constructor(e){super(new Blob([e],{type:xpe}))}}class Ipe extends sS{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(s,r)=>{await s.init(),r!=t.length-1&&(e.lastDiskOffset+=s.size),e.size+=s.size})),super.init()}async readUint8Array(e,t,s=0){const r=this,{readers:n}=this;let a,o=s;o==-1&&(o=n.length-1);let l=e;for(;l>=n[o].size;)l-=n[o].size,o++;const u=n[o],h=u.size;if(l+t<=h)a=await Yg(u,l,t);else{const c=h-l;a=new Uint8Array(t),a.set(await Yg(u,l,c)),a.set(await r.readUint8Array(e+c,t-c,s),c)}return r.lastDiskNumber=Math.max(o,r.lastDiskNumber),a}}class iS extends Jg{constructor(e,t=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let r,n,a;const o=new WritableStream({async write(h){const{availableSize:c}=s;if(a)h.length>=c?(await l(h.slice(0,c)),await u(),s.diskOffset+=r.size,s.diskNumber++,a=null,await this.write(h.slice(c))):await l(h);else{const{value:d,done:f}=await e.next();if(f&&!d)throw new Error(wpe);r=d,r.size=0,r.maxSize&&(s.maxSize=r.maxSize),s.availableSize=s.maxSize,await yu(r),n=d.writable,a=n.getWriter(),await this.write(h)}},async close(){await a.ready,await u()}});Object.defineProperty(s,tS,{get(){return o}});async function l(h){const c=h.length;c&&(await a.ready,await a.write(h),r.size+=c,s.size+=c,s.availableSize-=c)}async function u(){n.size=r.size,await a.close()}}}async function yu(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function Rpe(i){return Array.isArray(i)&&(i=new Ipe(i)),i instanceof ReadableStream&&(i={readable:i}),i}function Ape(i){i.writable===qt&&typeof i.next==du&&(i=new iS(i)),i instanceof WritableStream&&(i={writable:i});const{writable:e}=i;return e.size===qt&&(e.size=0),i instanceof iS||Object.assign(i,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),i}function Yg(i,e,t,s){return i.readUint8Array(e,t,s)}"\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("").length==256;const Lpe="filename",_pe="rawFilename",Dpe="comment",kpe="rawComment",Ope="uncompressedSize",Mpe="compressedSize",Npe="offset",rS="diskNumberStart",nS="lastModDate",Fpe="rawLastModDate",aS="lastAccessDate",oS="creationDate",lS="internalFileAttribute",uS="externalFileAttribute",hS="msDosCompatible",Xg="zip64",cS="encrypted",dS="version",pS="versionMadeBy",fS="zipCrypto",qpe=[Lpe,_pe,Mpe,Ope,nS,Fpe,Dpe,kpe,aS,oS,Npe,rS,rS,lS,uS,hS,Xg,cS,dS,pS,fS,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class mS{constructor(e){qpe.forEach(t=>this[t]=e[t])}}const Bpe="File already exists",$pe="Zip file comment exceeds 64KB",Hpe="File entry comment exceeds 64KB",Qpe="File entry name exceeds 64KB",gS="Version exceeds 65535",Upe="The strength must equal 1, 2, or 3",jpe="Extra field type exceeds 65535",zpe="Extra field data exceeds 64KB",ev="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Wpe="Undefined uncompressed size",vS=new Uint8Array([7,0,2,0,65,69,3,0,0]);let tv=0;const yS=[];class Gpe{constructor(e,t={}){e=Ape(e);const s=e.availableSize!==qt&&e.availableSize>0&&e.availableSize!==1/0&&e.maxSize!==qt&&e.maxSize>0&&e.maxSize!==1/0;Object.assign(this,{writer:e,addSplitZipSignature:s,options:t,config:kde(),files:new Map,filenames:new Set,offset:t.offset===qt?e.writable.size:t.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(e="",t,s={}){const r=this,{pendingAddFileCalls:n,config:a}=r;tv<a.maxWorkers?tv++:await new Promise(l=>yS.push(l));let o;try{if(e=e.trim(),r.filenames.has(e))throw new Error(Bpe);return r.filenames.add(e),o=Kpe(r,e,t,s),n.add(o),await o}catch(l){throw r.filenames.delete(e),l}finally{n.delete(o);const l=yS.shift();l?l():tv--}}async close(e=new Uint8Array,t={}){const s=this,{pendingAddFileCalls:r,writer:n}=this,{writable:a}=n;for(;r.size;)await Promise.allSettled(Array.from(r));return await rfe(this,e,t),yt(s,t,"preventClose")||await a.getWriter().close(),n.getData?n.getData():a}}async function Kpe(i,e,t,s){e=e.trim(),s.directory&&!e.endsWith($g)?e+=$g:s.directory=e.endsWith($g);const r=yt(i,s,"encodeText",Cd);let n=r(e);if(n===qt&&(n=Cd(e)),nt(n)>fi)throw new Error(Qpe);const a=s.comment||"";let o=r(a);if(o===qt&&(o=Cd(a)),nt(o)>fi)throw new Error(Hpe);const l=yt(i,s,dS,Lde);if(l>fi)throw new Error(gS);const u=yt(i,s,pS,20);if(u>fi)throw new Error(gS);const h=yt(i,s,nS,new Date),c=yt(i,s,aS),d=yt(i,s,oS),f=yt(i,s,hS,!0),y=yt(i,s,lS,0),v=yt(i,s,uS,0),m=yt(i,s,"passThrough");let g,b;m||(g=yt(i,s,"password"),b=yt(i,s,"rawPassword"));const x=yt(i,s,"encryptionStrength",3),I=yt(i,s,fS),L=yt(i,s,"extendedTimestamp",!0),A=yt(i,s,"keepOrder",!0),k=yt(i,s,"level"),P=yt(i,s,"useWebWorkers"),O=yt(i,s,"bufferedWrite"),D=yt(i,s,"dataDescriptorSignature",!1),$=yt(i,s,"signal"),Q=yt(i,s,"useUnicodeFileNames",!0),_=yt(i,s,"useCompressionStream"),B=yt(i,s,"compressionMethod");let H=yt(i,s,"dataDescriptor",!0),U=yt(i,s,Xg);if(!I&&(g!==qt||b!==qt)&&!(x>=1&&x<=3))throw new Error(Upe);let G=new Uint8Array;const{extraField:j}=s;if(j){let gs=0,es=0;j.forEach(Ct=>gs+=4+nt(Ct)),G=new Uint8Array(gs),j.forEach((Ct,Le)=>{if(Le>fi)throw new Error(jpe);if(nt(Ct)>fi)throw new Error(zpe);ps(G,new Uint16Array([Le]),es),ps(G,new Uint16Array([nt(Ct)]),es+2),ps(G,Ct,es+4),es+=4+nt(Ct)})}let ae=0,X=0,ue=0;if(m&&({uncompressedSize:ue}=s,ue===qt))throw new Error(Wpe);const ie=U===!0;t&&(t=Rpe(t),await yu(t),m?ae=CS(ue):t.size===qt?(H=!0,(U||U===qt)&&(U=!0,ue=ae=pi+1)):(ue=t.size,ae=CS(ue)));const{diskOffset:se,diskNumber:fe,maxSize:de}=i.writer,te=ie||ue>pi,pe=ie||ae>pi,Ne=ie||i.offset+i.pendingEntriesSize-se>pi,$t=yt(i,s,"supportZip64SplitFile",!0)&&ie||fe+Math.ceil(i.pendingEntriesSize/de)>fi;if(Ne||te||pe||$t){if(U===!1||!A)throw new Error(ev);U=!0}U=U||!1;const Us=yt(i,s,cS),{signature:Vt}=s;s=Object.assign({},s,{rawFilename:n,rawComment:o,version:l,versionMadeBy:u,lastModDate:h,lastAccessDate:c,creationDate:d,rawExtraField:G,zip64:U,zip64UncompressedSize:te,zip64CompressedSize:pe,zip64Offset:Ne,zip64DiskNumberStart:$t,password:g,rawPassword:b,level:!_&&i.config.CompressionStream===qt&&i.config.CompressionStreamNative===qt?0:k,useWebWorkers:P,encryptionStrength:x,extendedTimestamp:L,zipCrypto:I,bufferedWrite:O,keepOrder:A,useUnicodeFileNames:Q,dataDescriptor:H,dataDescriptorSignature:D,signal:$,msDosCompatible:f,internalFileAttribute:y,externalFileAttribute:v,useCompressionStream:_,passThrough:m,encrypted:!!(g&&nt(g)||b&&nt(b))||m&&Us,signature:Vt,compressionMethod:B});const ms=Ype(s),ws=efe(s),Ze=nt(ms.localHeaderArray,ws.dataDescriptorArray);X=Ze+ae,i.options.usdz&&(X+=X+64),i.pendingEntriesSize+=X;let mt;try{mt=await Zpe(i,e,t,{headerInfo:ms,dataDescriptorInfo:ws,metadataSize:Ze},s)}finally{i.pendingEntriesSize-=X}return Object.assign(mt,{name:e,comment:a,extraField:j}),new mS(mt)}async function Zpe(i,e,t,s,r){const{files:n,writer:a}=i,{keepOrder:o,dataDescriptor:l,signal:u}=r,{headerInfo:h}=s,{usdz:c}=i.options,d=Array.from(n.values()).pop();let f={},y,v,m,g,b,x,I;n.set(e,f);try{let P;o&&(P=d&&d.lock,L()),(r.bufferedWrite||i.writerLocked||i.bufferedWrites&&o||!l)&&!c?(x=new TransformStream,I=new Response(x.readable).blob(),x.writable.size=0,y=!0,i.bufferedWrites++,await yu(a)):(x=a,await A()),await yu(x);const{writable:O}=a;let{diskOffset:D}=a;if(i.addSplitZipSignature){delete i.addSplitZipSignature;const Q=new Uint8Array(4),_=Os(Q);rt(_,0,hV),await Mr(O,Q),i.offset+=4}c&&Xpe(s,i.offset-D),y||(await P,await k(O));const{diskNumber:$}=a;if(b=!0,f.diskNumberStart=$,f=await Jpe(t,x,f,s,i.config,r),b=!1,n.set(e,f),f.filename=e,y){await x.writable.getWriter().close();let Q=await I;await P,await A(),g=!0,l||(Q=await sfe(f,Q,O,r)),await k(O),f.diskNumberStart=a.diskNumber,D=a.diskOffset,await Q.stream().pipeTo(O,{preventClose:!0,preventAbort:!0,signal:u}),O.size+=Q.size,g=!1}if(f.offset=i.offset-D,f.zip64)ife(f,r);else if(f.offset>pi)throw new Error(ev);return i.offset+=f.size,f}catch(P){if(y&&g||!y&&b){if(i.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}y?i.offset+=x.writable.size:i.offset=x.writable.size}throw n.delete(e),P}finally{y&&i.bufferedWrites--,m&&m(),v&&v()}function L(){f.lock=new Promise(P=>m=P)}async function A(){i.writerLocked=!0;const{lockWriter:P}=i;i.lockWriter=new Promise(O=>v=()=>{i.writerLocked=!1,O()}),await P}async function k(P){nt(h.localHeaderArray)>a.availableSize&&(a.availableSize=0,await Mr(P,new Uint8Array))}}async function Jpe(i,e,{diskNumberStart:t,lock:s},r,n,a){const{headerInfo:o,dataDescriptorInfo:l,metadataSize:u}=r,{localHeaderArray:h,headerArray:c,lastModDate:d,rawLastModDate:f,encrypted:y,compressed:v,version:m,compressionMethod:g,rawExtraFieldExtendedTimestamp:b,extraFieldExtendedTimestampFlag:x,rawExtraFieldNTFS:I,rawExtraFieldAES:L}=o,{dataDescriptorArray:A}=l,{rawFilename:k,lastAccessDate:P,creationDate:O,password:D,rawPassword:$,level:Q,zip64:_,zip64UncompressedSize:B,zip64CompressedSize:H,zip64Offset:U,zip64DiskNumberStart:G,zipCrypto:j,dataDescriptor:ae,directory:X,versionMadeBy:ue,rawComment:ie,rawExtraField:se,useWebWorkers:fe,onstart:de,onprogress:te,onend:pe,signal:Ne,encryptionStrength:gt,extendedTimestamp:$t,msDosCompatible:Us,internalFileAttribute:Vt,externalFileAttribute:ms,useCompressionStream:ws,passThrough:Ze}=a,mt={lock:s,versionMadeBy:ue,zip64:_,directory:!!X,filenameUTF8:!0,rawFilename:k,commentUTF8:!0,rawComment:ie,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:I,rawExtraFieldAES:L,rawExtraField:se,extendedTimestamp:$t,msDosCompatible:Us,internalFileAttribute:Vt,externalFileAttribute:ms,diskNumberStart:t};let{signature:gs,uncompressedSize:es}=a,Ct=0;Ze||(es=0);const{writable:Le}=e;if(i){i.chunkSize=Ode(n),await Mr(Le,h);const we=i.readable,Ht=we.size=i.size,Ut={options:{codecType:GV,level:Q,rawPassword:$,password:D,encryptionStrength:gt,zipCrypto:y&&j,passwordVerification:y&&j&&f>>8&255,signed:!Ze,compressed:v&&!Ze,encrypted:y&&!Ze,useWebWorkers:fe,useCompressionStream:ws,transferStreams:!1},config:n,streamOptions:{signal:Ne,size:Ht,onstart:de,onprogress:te,onend:pe}},ns=await ype({readable:we,writable:Le},Ut);Ct=ns.outputSize,Ze||(es=ns.inputSize,gs=ns.signature),Le.size+=es}else await Mr(Le,h);let Ye;if(_){let we=4;B&&(we+=8),H&&(we+=8),U&&(we+=8),G&&(we+=4),Ye=new Uint8Array(we)}else Ye=new Uint8Array;return tfe({signature:gs,rawExtraFieldZip64:Ye,compressedSize:Ct,uncompressedSize:es,headerInfo:o,dataDescriptorInfo:l},a),ae&&await Mr(Le,A),Object.assign(mt,{uncompressedSize:es,compressedSize:Ct,lastModDate:d,rawLastModDate:f,creationDate:O,lastAccessDate:P,encrypted:y,zipCrypto:j,size:u+Ct,compressionMethod:g,version:m,headerArray:c,signature:gs,rawExtraFieldZip64:Ye,extraFieldExtendedTimestampFlag:x,zip64UncompressedSize:B,zip64CompressedSize:H,zip64Offset:U,zip64DiskNumberStart:G}),mt}function Ype(i){const{rawFilename:e,lastModDate:t,lastAccessDate:s,creationDate:r,level:n,zip64:a,zipCrypto:o,useUnicodeFileNames:l,dataDescriptor:u,directory:h,rawExtraField:c,encryptionStrength:d,extendedTimestamp:f,encrypted:y}=i,v=n!==0&&!h;let{version:m,compressionMethod:g}=i,b;if(y&&!o){b=new Uint8Array(nt(vS)+2);const U=Os(b);ft(U,0,Ede),ps(b,vS,2),Ed(U,8,d)}else b=new Uint8Array;let x,I,L;if(f){I=new Uint8Array(9+(s?4:0)+(r?4:0));const U=Os(I);ft(U,0,pV),ft(U,2,nt(I)-4),L=1+(s?2:0)+(r?4:0),Ed(U,4,L);let G=5;rt(U,G,Math.floor(t.getTime()/1e3)),G+=4,s&&(rt(U,G,Math.floor(s.getTime()/1e3)),G+=4),r&&rt(U,G,Math.floor(r.getTime()/1e3));try{x=new Uint8Array(36);const j=Os(x),ae=sv(t);ft(j,0,Vde),ft(j,2,32),ft(j,8,Sde),ft(j,10,24),mi(j,12,ae),mi(j,20,sv(s)||ae),mi(j,28,sv(r)||ae)}catch{x=new Uint8Array}}else x=I=new Uint8Array;let A=0;l&&(A=A|Rde),u&&(A=A|Ide),g===qt&&(g=v?uV:pde),g==uV&&(n>=1&&n<3&&(A=A|6),n>=3&&n<5&&(A=A|1),n===9&&(A=A|2)),a&&(m=m>fV?m:fV),y&&(A=A|Pde,o||(m=m>mV?m:mV,b[9]=g,g=fde));const k=new Uint8Array(26),P=Os(k);ft(P,0,m),ft(P,2,A),ft(P,4,g);const O=new Uint32Array(1),D=Os(O);let $;t<vV?$=vV:t>gV?$=gV:$=t,ft(D,0,($.getHours()<<6|$.getMinutes())<<5|$.getSeconds()/2),ft(D,2,($.getFullYear()-1980<<4|$.getMonth()+1)<<5|$.getDate());const Q=O[0];rt(P,6,Q),ft(P,22,nt(e));const _=nt(b,I,x,c);ft(P,24,_);const B=new Uint8Array(30+nt(e)+_),H=Os(B);return rt(H,0,mde),ps(B,k,4),ps(B,e,30),ps(B,b,30+nt(e)),ps(B,I,30+nt(e,b)),ps(B,x,30+nt(e,b,I)),ps(B,c,30+nt(e,b,I,x)),{localHeaderArray:B,headerArray:k,headerView:P,lastModDate:t,rawLastModDate:Q,encrypted:y,compressed:v,version:m,compressionMethod:g,extraFieldExtendedTimestampFlag:L,rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:x,rawExtraFieldAES:b,extraFieldLength:_}}function Xpe(i,e){const{headerInfo:t}=i;let{localHeaderArray:s,extraFieldLength:r}=t,n=Os(s),a=64-(e+nt(s))%64;a<4&&(a+=64);const o=new Uint8Array(a),l=Os(o);ft(l,0,Tde),ft(l,2,a-2);const u=s;t.localHeaderArray=s=new Uint8Array(nt(u)+a),ps(s,u),ps(s,o,nt(u)),n=Os(s),ft(n,28,r+a),i.metadataSize+=a}function efe(i){const{zip64:e,dataDescriptor:t,dataDescriptorSignature:s}=i;let r=new Uint8Array,n,a=0;return t&&(r=new Uint8Array(e?s?24:20:s?16:12),n=Os(r),s&&(a=4,rt(n,0,gde))),{dataDescriptorArray:r,dataDescriptorView:n,dataDescriptorOffset:a}}function tfe(i,e){const{signature:t,rawExtraFieldZip64:s,compressedSize:r,uncompressedSize:n,headerInfo:a,dataDescriptorInfo:o}=i,{headerView:l,encrypted:u}=a,{dataDescriptorView:h,dataDescriptorOffset:c}=o,{zip64:d,zip64UncompressedSize:f,zip64CompressedSize:y,zipCrypto:v,dataDescriptor:m}=e;if((!u||v)&&t!==qt&&(rt(l,10,t),m&&rt(h,c,t)),d){const g=Os(s);ft(g,0,xde),ft(g,2,nt(s)-4);let b=4;f&&(rt(l,18,pi),mi(g,b,BigInt(n)),b+=8),y&&(rt(l,14,pi),mi(g,b,BigInt(r))),m&&(mi(h,c+4,BigInt(r)),mi(h,c+12,BigInt(n)))}else rt(l,14,r),rt(l,18,n),m&&(rt(h,c+4,r),rt(h,c+8,n))}async function sfe(i,e,t,{zipCrypto:s}){let r;r=await e.slice(0,26).arrayBuffer(),r.byteLength!=26&&(r=r.slice(0,26));const n=new DataView(r);return(!i.encrypted||s)&&rt(n,14,i.signature),i.zip64?(rt(n,18,pi),rt(n,22,pi)):(rt(n,18,i.compressedSize),rt(n,22,i.uncompressedSize)),await Mr(t,new Uint8Array(r)),e.slice(r.byteLength)}function ife(i,e){const{rawExtraFieldZip64:t,offset:s,diskNumberStart:r}=i,{zip64UncompressedSize:n,zip64CompressedSize:a,zip64Offset:o,zip64DiskNumberStart:l}=e,u=Os(t);let h=4;n&&(h+=8),a&&(h+=8),o&&(mi(u,h,BigInt(s)),h+=8),l&&rt(u,h,r)}async function rfe(i,e,t){const{files:s,writer:r}=i,{diskOffset:n,writable:a}=r;let{diskNumber:o}=r,l=0,u=0,h=i.offset-n,c=s.size;for(const[,L]of s){const{rawFilename:A,rawExtraFieldZip64:k,rawExtraFieldAES:P,rawComment:O,rawExtraFieldNTFS:D,rawExtraField:$,extendedTimestamp:Q,extraFieldExtendedTimestampFlag:_,lastModDate:B}=L;let H;if(Q){H=new Uint8Array(9);const U=Os(H);ft(U,0,pV),ft(U,2,5),Ed(U,4,_),rt(U,5,Math.floor(B.getTime()/1e3))}else H=new Uint8Array;L.rawExtraFieldCDExtendedTimestamp=H,u+=46+nt(A,O,k,P,D,H,$)}const d=new Uint8Array(u),f=Os(d);await yu(r);let y=0;for(const[L,A]of Array.from(s.values()).entries()){const{offset:k,rawFilename:P,rawExtraFieldZip64:O,rawExtraFieldAES:D,rawExtraFieldCDExtendedTimestamp:$,rawExtraFieldNTFS:Q,rawExtraField:_,rawComment:B,versionMadeBy:H,headerArray:U,directory:G,zip64:j,zip64UncompressedSize:ae,zip64CompressedSize:X,zip64DiskNumberStart:ue,zip64Offset:ie,msDosCompatible:se,internalFileAttribute:fe,externalFileAttribute:de,diskNumberStart:te,uncompressedSize:pe,compressedSize:Ne}=A,gt=nt(O,D,$,Q,_);rt(f,l,vde),ft(f,l+4,H);const $t=Os(U);ae||rt($t,18,pe),X||rt($t,14,Ne),ps(d,U,l+6),ft(f,l+30,gt),ft(f,l+32,nt(B)),ft(f,l+34,j&&ue?fi:te),ft(f,l+36,fe),de?rt(f,l+38,de):G&&se&&Ed(f,l+38,Ade),rt(f,l+42,j&&ie?pi:k),ps(d,P,l+46),ps(d,O,l+46+nt(P)),ps(d,D,l+46+nt(P,O)),ps(d,$,l+46+nt(P,O,D)),ps(d,Q,l+46+nt(P,O,D,$)),ps(d,_,l+46+nt(P,O,D,$,Q)),ps(d,B,l+46+nt(P)+gt);const Us=46+nt(P,B)+gt;if(l-y>r.availableSize&&(r.availableSize=0,await Mr(a,d.slice(y,l)),y=l),l+=Us,t.onprogress)try{await t.onprogress(L+1,s.size,new mS(A))}catch{}}await Mr(a,y?d.slice(y):d);let v=r.diskNumber;const{availableSize:m}=r;m<Bg&&v++;let g=yt(i,t,Xg);if(h>pi||u>pi||c>fi||v>fi){if(g===!1)throw new Error(ev);g=!0}const b=new Uint8Array(g?wde:Bg),x=Os(b);l=0,g&&(rt(x,0,Cde),mi(x,4,BigInt(44)),ft(x,12,45),ft(x,14,45),rt(x,16,v),rt(x,20,o),mi(x,24,BigInt(c)),mi(x,32,BigInt(c)),mi(x,40,BigInt(u)),mi(x,48,BigInt(h)),rt(x,56,bde),mi(x,64,BigInt(h)+BigInt(u)),rt(x,72,v+1),yt(i,t,"supportZip64SplitFile",!0)&&(v=fi,o=fi),c=fi,h=pi,u=pi,l+=dV+cV),rt(x,l,yde),ft(x,l+4,v),ft(x,l+6,o),ft(x,l+8,c),ft(x,l+10,c),rt(x,l+12,u),rt(x,l+16,h);const I=nt(e);if(I)if(I<=fi)ft(x,l+20,I);else throw new Error($pe);await Mr(a,b),I&&await Mr(a,e)}async function Mr(i,e){const t=i.getWriter();try{await t.ready,i.size+=nt(e),await t.write(e)}finally{t.releaseLock()}}function sv(i){if(i)return(BigInt(i.getTime())+BigInt(116444736e5))*BigInt(1e4)}function yt(i,e,t,s){const r=e[t]===qt?i.options[t]:e[t];return r===qt?s:r}function CS(i){return i+5*(Math.floor(i/16383)+1)}function Ed(i,e,t){i.setUint8(e,t)}function ft(i,e,t){i.setUint16(e,t,!0)}function rt(i,e,t){i.setUint32(e,t,!0)}function mi(i,e,t){i.setBigUint64(e,t,!0)}function ps(i,e,t){i.set(e,t)}function Os(i){return new DataView(i.buffer)}function nt(...i){let e=0;return i.forEach(t=>t&&(e+=t.length)),e}let bS;try{bS=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yi&&Yi.tagName.toUpperCase()==="SCRIPT"&&Yi.src||new URL("reactive.umd.js",document.baseURI).href}catch{}Hg({baseURL:bS}),bpe(Hg),Hg({Deflate:jce,Inflate:dde});var dn;(function(i){i.Documents="DOCUMENTS",i.Data="DATA",i.Library="LIBRARY",i.Cache="CACHE",i.External="EXTERNAL",i.ExternalStorage="EXTERNAL_STORAGE"})(dn||(dn={}));var Vd;(function(i){i.UTF8="utf8",i.ASCII="ascii",i.UTF16="utf16"})(Vd||(Vd={}));const _a=Ol("Filesystem",{web:()=>Promise.resolve().then(()=>M1e).then(i=>new i.FilesystemWeb)});$s("Upload",async(i,e,t,s)=>{const r=i.sessionID||`sim_${Date.now()}_${Math.floor(K.uniform(0,2176782336)).toString(36)}`,n=z2({sessionID:r,data:e.data||[],store:e.store,generateFiles:i.generateFiles,sessionData:i.sessionData,uploadRaw:i.uploadRaw??!0}),a=$2();a&&(n.push({filename:`${r}_participant_initial.csv`,content:oc([a]),encoding:"utf8"}),n.push({filename:`${r}_participant_final.csv`,content:oc([s]),encoding:"utf8"}));const o=q2();if(o){const l={sessionId:r,files:n.map(h=>({...h,encoding:h.encoding??"utf8"}))},u=await fetch(`${o}/data`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});u.ok||console.error(`Simulation upload failed: ${u.status} ${u.statusText}`)}return{responseData:{files:n},participantState:s}},{});const iv=[{name:"upload",defaultValue:!0,type:"boolean",description:"Upload the data at the end of the experiment?"},{name:"download",defaultValue:!1,type:"boolean",description:"Locally download the data at the end of the experiment?"}];Em("Upload",iv);const nfe=()=>{const i=window.electronAPI;return{directoryExists:async e=>{const t=await i.directoryExists(e);return t.success&&t.exists},createDirectory:async e=>{await i.createDirectory(e)},saveFile:async(e,t,s)=>{await i.saveFile(e,t,s)}}},afe=i=>{const e=t=>i?t?`${i}/${t}`:i:t;return{directoryExists:async t=>{try{if(i)try{await _a.readdir({path:i,directory:dn.Documents})}catch{return!1}const s=e(t);return(await _a.readdir({path:s,directory:dn.Documents})).files.length>=0}catch{return!1}},createDirectory:async t=>{try{if(i)try{await _a.mkdir({path:i,directory:dn.Documents,recursive:!1})}catch{}const s=e(t);await _a.mkdir({path:s,directory:dn.Documents,recursive:!0})}catch(s){throw console.error("Error creating directory:",s),s}},saveFile:async(t,s,r)=>{const n=e(r);await _a.writeFile({path:`${n}/${t}`,data:s,directory:dn.Documents,encoding:"utf8"})}}},ofe=i=>{const e=Fl();switch(e){case"desktop":return{backend:nfe(),type:e};case"mobile":return{backend:afe(i),type:e};case"web":return{backend:null,type:e}}},lfe=async(i,e)=>{let t=e;if(await i.directoryExists(t)){let s=1;for(t=`${e}_${s}`;await i.directoryExists(t);)s++,t=`${e}_${s}`}return t};function wS({data:i,next:e,store:t,sessionID:s,generateFiles:r,sessionData:n,uploadRaw:a=!0,autoUpload:o=!1,androidFolderName:l,className:u,containerClass:h,centered:c,content:d,uploadingContent:f,errorContent:y}){const[v,m]=V.useState("initial"),g=V.useRef(!1),b=iv.find($=>$.name==="upload"),x=iv.find($=>$.name==="download"),I=en(b.name,b.defaultValue,b.type),L=en(x.name,x.defaultValue,x.type),A=Sce({mutationFn:async $=>await ox("/data",$),onSuccess:$=>{$.status===200?(m("success"),e({})):m("error")},onError:()=>{m("error")}}),k=V.useCallback(async $=>{const Q=new Gpe(new Tpe);for(const U of $)await Q.add(U.filename,new Ppe(U.content));const _=await Q.close(),B=URL.createObjectURL(_),H=document.createElement("a");H.href=B,H.download="study-data.zip",document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(B)},[]),P=V.useCallback(async()=>{if(m("uploading"),g.current)return;g.current=!0;const $=s??(t==null?void 0:t._uploadId)??AE(),Q=z2({sessionID:$,data:i,store:t,generateFiles:r,sessionData:n,uploadRaw:a});try{L&&await k(Q);const _=Q.filter(G=>!G._alreadyUploaded),B={sessionId:$,...t!=null&&t._uploadId&&t._uploadId!==$?{_uploadId:t._uploadId}:{},files:_.map(G=>({...G,encoding:G.encoding??"utf8"}))};if(!I){e({});return}const{backend:H,type:U}=ofe(l);if(U==="web")A.mutate(B);else if(H)try{const G=await lfe(H,$);await H.createDirectory(G);for(const j of Q)await H.saveFile(j.filename,j.content,G);m("success"),e({})}catch(G){console.error(`Error saving files with ${U}:`,G),m("error")}}catch(_){console.error("Error uploading:",_),m("error")}},[s,r,i,a,L,I,k,e,A]);V.useEffect(()=>{o&&!g.current&&P&&P()},[o,P]),V.useEffect(()=>{v==="error"&&(g.current=!1)},[v]);const O=xi(qi()),D=`cursor-pointer ${O.buttonBg} px-8 py-3 border-2 ${O.buttonBorder} font-bold ${O.buttonText} text-lg rounded-xl ${O.buttonShadow} hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none`;return S.jsx("div",{className:`${c?"flex items-center justify-center":""} ${h??O.containerBg}`,style:{position:"fixed",inset:0},children:S.jsxs("div",{className:`flex flex-col items-center justify-center gap-4 p-6 text-xl mt-16 px-10 h-full ${O.text} ${u??""}`,children:[v=="initial"&&!o&&S.jsxs(S.Fragment,{children:[d??S.jsx("p",{children:"Thank you for participating! Please click the button below to submit your data."}),S.jsx("button",{onClick:P,className:`mt-8 ${D}`,children:"Submit Data"})]}),v=="uploading"&&S.jsx(S.Fragment,{children:f??S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"}),S.jsx("p",{children:"Uploading your data..."})]})}),v=="success"&&S.jsx(S.Fragment,{}),v=="error"&&S.jsxs(S.Fragment,{children:[y??S.jsxs("div",{className:`${O.error} mb-4`,children:[S.jsx("p",{children:"Sorry, there was an error uploading your data."}),S.jsx("p",{children:"Please try again or contact the researcher."})]}),S.jsx("button",{onClick:P,className:D,children:"Try Again"})]})]})})}var xS;(function(i){i.Dark="DARK",i.Light="LIGHT",i.Default="DEFAULT"})(xS||(xS={}));var ES;(function(i){i.None="NONE",i.Slide="SLIDE",i.Fade="FADE"})(ES||(ES={}));const VS=Ol("StatusBar"),SS=Ol("ImmersiveMode",{web:()=>Promise.resolve().then(()=>F1e).then(i=>new i.ImmersiveModeWeb)});Zs("EnterFullscreen","session"),$s("EnterFullscreen",fo,{});function TS({content:i,buttonText:e,className:t,containerClass:s,centered:r,animate:n,next:a,data:o,updateStore:l,delayMs:u=0}){const h=S.jsxs("div",{className:"flex flex-col items-center",children:[!!i&&i,!i&&S.jsx("p",{className:"",children:"Please click the Button below to enter Fullscreen mode."})]}),[c,d]=V.useState(!1),f=V.useRef(!1),y=V.useRef(null),v=V.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),m=V.useCallback(()=>{document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b),document.removeEventListener("mozfullscreenchange",b),document.removeEventListener("MSFullscreenChange",b),v(),f.current=!1},[v]),g=V.useCallback(()=>{v(),d(!0),y.current=setTimeout(()=>{y.current=null,a({})},u)},[a,u,v]),b=V.useCallback(()=>{if(!f.current)return;const A=po();m(),A?g():d(!1)},[g,m]),x=V.useCallback(()=>{m(),f.current=!0,document.addEventListener("fullscreenchange",b),document.addEventListener("webkitfullscreenchange",b),document.addEventListener("mozfullscreenchange",b),document.addEventListener("MSFullscreenChange",b)},[b,m]),I=V.useCallback(async()=>{d(!0),m();const A=document.documentElement;if(Fl()==="mobile"&&Ca.getPlatform()==="android"&&(VS.hide(),SS.enable()),A.requestFullscreen)try{await A.requestFullscreen(),g();return}catch(k){console.error("Fullscreen request failed:",k);return}A.mozRequestFullScreen?(A.mozRequestFullScreen(),x()):A.webkitRequestFullscreen?(A.webkitRequestFullscreen(),x()):A.msRequestFullscreen?(A.msRequestFullscreen(),x()):console.warn("Fullscreen API is not supported by this browser.")},[g,x,m]);V.useEffect(()=>()=>{m()},[m]);const L=xi(qi());return c?S.jsx("div",{className:`min-h-screen ${s??L.containerBg}`}):S.jsx(dc,{data:o,updateStore:l,className:t,containerClass:s,centered:r,animate:n,content:h,buttonText:e??"Enter Fullscreen Mode",next:I})}Zs("ExitFullscreen","session"),$s("ExitFullscreen",fo,{});function PS({next:i,delayMs:e=0}){const t=V.useRef(!1),s=V.useRef(null),r=V.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),n=V.useCallback(()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o),document.removeEventListener("mozfullscreenchange",o),document.removeEventListener("MSFullscreenChange",o),r(),t.current=!1},[r]),a=V.useCallback(()=>{r(),s.current=setTimeout(()=>{s.current=null,i({})},e)},[i,e,r]),o=V.useCallback(()=>{if(!t.current)return;const u=po();n(),u||a()},[a,n]),l=V.useCallback(()=>{n(),t.current=!0,document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),document.addEventListener("mozfullscreenchange",o),document.addEventListener("MSFullscreenChange",o)},[o,n]);return V.useEffect(()=>((async()=>{if(!po()){i({});return}if(Fl()==="mobile"&&Ca.getPlatform()==="android"&&(VS.show(),SS.disable()),document.exitFullscreen)try{await document.exitFullscreen(),a();return}catch(h){console.error("Exiting fullscreen failed:",h),i({});return}document.mozCancelFullScreen?(document.mozCancelFullScreen(),l()):document.webkitExitFullscreen?(document.webkitExitFullscreen(),l()):document.msExitFullscreen?(document.msExitFullscreen(),l()):(console.warn("Fullscreen API is not supported by this browser."),i({}))})(),()=>{n()}),[a,l,n]),null}function IS(i){var e,t,s="";if(typeof i=="string"||typeof i=="number")s+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=IS(i[e]))&&(s&&(s+=" "),s+=t)}else for(t in i)i[t]&&(s&&(s+=" "),s+=t);return s}function Zn(){for(var i,e,t=0,s="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=IS(i))&&(s&&(s+=" "),s+=e);return s}const Cu=i=>typeof i=="number"&&!isNaN(i),Da=i=>typeof i=="string",Ai=i=>typeof i=="function",Sd=i=>Da(i)||Ai(i)?i:null,rv=i=>V.isValidElement(i)||Da(i)||Ai(i)||Cu(i);function RS(i,e,t){t===void 0&&(t=300);const{scrollHeight:s,style:r}=i;requestAnimationFrame(()=>{r.minHeight="initial",r.height=s+"px",r.transition=`all ${t}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(e,t)})})}function bu(i){let{enter:e,exit:t,appendPosition:s=!1,collapse:r=!0,collapseDuration:n=300}=i;return function(a){let{children:o,position:l,preventExitTransition:u,done:h,nodeRef:c,isIn:d,playToast:f}=a;const y=s?`${e}--${l}`:e,v=s?`${t}--${l}`:t,m=V.useRef(0);return V.useLayoutEffect(()=>{const g=c.current,b=y.split(" "),x=I=>{I.target===c.current&&(f(),g.removeEventListener("animationend",x),g.removeEventListener("animationcancel",x),m.current===0&&I.type!=="animationcancel"&&g.classList.remove(...b))};g.classList.add(...b),g.addEventListener("animationend",x),g.addEventListener("animationcancel",x)},[]),V.useEffect(()=>{const g=c.current,b=()=>{g.removeEventListener("animationend",b),r?RS(g,h,n):h()};d||(u?b():(m.current=1,g.className+=` ${v}`,g.addEventListener("animationend",b)))},[d]),V.createElement(V.Fragment,null,o)}}function AS(i,e){return i!=null?{content:i.content,containerId:i.props.containerId,id:i.props.toastId,theme:i.props.theme,type:i.props.type,data:i.props.data||{},isLoading:i.props.isLoading,icon:i.props.icon,status:e}:{}}const Xs=new Map;let wu=[];const nv=new Set,ufe=i=>nv.forEach(e=>e(i)),LS=()=>Xs.size>0;function _S(i,e){var t;if(e)return!((t=Xs.get(e))==null||!t.isToastActive(i));let s=!1;return Xs.forEach(r=>{r.isToastActive(i)&&(s=!0)}),s}function DS(i,e){rv(i)&&(LS()||wu.push({content:i,options:e}),Xs.forEach(t=>{t.buildToast(i,e)}))}function kS(i,e){Xs.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(i,e==null?void 0:e.id):t.toggle(i,e==null?void 0:e.id)})}function OS(i){const{subscribe:e,getSnapshot:t,setProps:s}=V.useRef(function(n){const a=n.containerId||1;return{subscribe(o){const l=function(h,c,d){let f=1,y=0,v=[],m=[],g=[],b=c;const x=new Map,I=new Set,L=()=>{g=Array.from(x.values()),I.forEach(P=>P())},A=P=>{m=P==null?[]:m.filter(O=>O!==P),L()},k=P=>{const{toastId:O,onOpen:D,updateId:$,children:Q}=P.props,_=$==null;P.staleId&&x.delete(P.staleId),x.set(O,P),m=[...m,P.props.toastId].filter(B=>B!==P.staleId),L(),d(AS(P,_?"added":"updated")),_&&Ai(D)&&D(V.isValidElement(Q)&&Q.props)};return{id:h,props:b,observe:P=>(I.add(P),()=>I.delete(P)),toggle:(P,O)=>{x.forEach(D=>{O!=null&&O!==D.props.toastId||Ai(D.toggle)&&D.toggle(P)})},removeToast:A,toasts:x,clearQueue:()=>{y-=v.length,v=[]},buildToast:(P,O)=>{if((ie=>{let{containerId:se,toastId:fe,updateId:de}=ie;const te=se?se!==h:h!==1,pe=x.has(fe)&&de==null;return te||pe})(O))return;const{toastId:D,updateId:$,data:Q,staleId:_,delay:B}=O,H=()=>{A(D)},U=$==null;U&&y++;const G={...b,style:b.toastStyle,key:f++,...Object.fromEntries(Object.entries(O).filter(ie=>{let[se,fe]=ie;return fe!=null})),toastId:D,updateId:$,data:Q,closeToast:H,isIn:!1,className:Sd(O.className||b.toastClassName),bodyClassName:Sd(O.bodyClassName||b.bodyClassName),progressClassName:Sd(O.progressClassName||b.progressClassName),autoClose:!O.isLoading&&(j=O.autoClose,ae=b.autoClose,j===!1||Cu(j)&&j>0?j:ae),deleteToast(){const ie=x.get(D),{onClose:se,children:fe}=ie.props;Ai(se)&&se(V.isValidElement(fe)&&fe.props),d(AS(ie,"removed")),x.delete(D),y--,y<0&&(y=0),v.length>0?k(v.shift()):L()}};var j,ae;G.closeButton=b.closeButton,O.closeButton===!1||rv(O.closeButton)?G.closeButton=O.closeButton:O.closeButton===!0&&(G.closeButton=!rv(b.closeButton)||b.closeButton);let X=P;V.isValidElement(P)&&!Da(P.type)?X=V.cloneElement(P,{closeToast:H,toastProps:G,data:Q}):Ai(P)&&(X=P({closeToast:H,toastProps:G,data:Q}));const ue={content:X,props:G,staleId:_};b.limit&&b.limit>0&&y>b.limit&&U?v.push(ue):Cu(B)?setTimeout(()=>{k(ue)},B):k(ue)},setProps(P){b=P},setToggle:(P,O)=>{x.get(P).toggle=O},isToastActive:P=>m.some(O=>O===P),getSnapshot:()=>g}}(a,n,ufe);Xs.set(a,l);const u=l.observe(o);return wu.forEach(h=>DS(h.content,h.options)),wu=[],()=>{u(),Xs.delete(a)}},setProps(o){var l;(l=Xs.get(a))==null||l.setProps(o)},getSnapshot(){var o;return(o=Xs.get(a))==null?void 0:o.getSnapshot()}}}(i)).current;s(i);const r=V.useSyncExternalStore(e,t,t);return{getToastToRender:function(n){if(!r)return[];const a=new Map;return i.newestOnTop&&r.reverse(),r.forEach(o=>{const{position:l}=o.props;a.has(l)||a.set(l,[]),a.get(l).push(o)}),Array.from(a,o=>n(o[0],o[1]))},isToastActive:_S,count:r==null?void 0:r.length}}function MS(i){const[e,t]=V.useState(!1),[s,r]=V.useState(!1),n=V.useRef(null),a=V.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:o,pauseOnHover:l,closeToast:u,onClick:h,closeOnClick:c}=i;var d,f;function y(){t(!0)}function v(){t(!1)}function m(x){const I=n.current;a.canDrag&&I&&(a.didMove=!0,e&&v(),a.delta=i.draggableDirection==="x"?x.clientX-a.start:x.clientY-a.start,a.start!==x.clientX&&(a.canCloseOnClick=!1),I.style.transform=`translate3d(${i.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function g(){document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",g);const x=n.current;if(a.canDrag&&a.didMove&&x){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return r(!0),i.closeToast(),void i.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=Xs.get((d={id:i.toastId,containerId:i.containerId,fn:t}).containerId||1))==null||f.setToggle(d.id,d.fn),V.useEffect(()=>{if(i.pauseOnFocusLoss)return document.hasFocus()||v(),window.addEventListener("focus",y),window.addEventListener("blur",v),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",v)}},[i.pauseOnFocusLoss]);const b={onPointerDown:function(x){if(i.draggable===!0||i.draggable===x.pointerType){a.didMove=!1,document.addEventListener("pointermove",m),document.addEventListener("pointerup",g);const I=n.current;a.canCloseOnClick=!0,a.canDrag=!0,I.style.transition="none",i.draggableDirection==="x"?(a.start=x.clientX,a.removalDistance=I.offsetWidth*(i.draggablePercent/100)):(a.start=x.clientY,a.removalDistance=I.offsetHeight*(i.draggablePercent===80?1.5*i.draggablePercent:i.draggablePercent)/100)}},onPointerUp:function(x){const{top:I,bottom:L,left:A,right:k}=n.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&i.pauseOnHover&&x.clientX>=A&&x.clientX<=k&&x.clientY>=I&&x.clientY<=L?v():y()}};return o&&l&&(b.onMouseEnter=v,i.stacked||(b.onMouseLeave=y)),c&&(b.onClick=x=>{h&&h(x),a.canCloseOnClick&&u()}),{playToast:y,pauseToast:v,isRunning:e,preventExitTransition:s,toastRef:n,eventHandlers:b}}function hfe(i){let{delay:e,isRunning:t,closeToast:s,type:r="default",hide:n,className:a,style:o,controlledProgress:l,progress:u,rtl:h,isIn:c,theme:d}=i;const f=n||l&&u===0,y={...o,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(y.transform=`scaleX(${u})`);const v=Zn("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":h}),m=Ai(a)?a({rtl:h,type:r,defaultClassName:v}):Zn(v,a),g={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{c&&s()}};return V.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},V.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),V.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:y,...g}))}let cfe=1;const NS=()=>""+cfe++;function dfe(i){return i&&(Da(i.toastId)||Cu(i.toastId))?i.toastId:NS()}function xu(i,e){return DS(i,e),e.toastId}function Td(i,e){return{...e,type:e&&e.type||i,toastId:dfe(e)}}function Pd(i){return(e,t)=>xu(e,Td(i,t))}function Dt(i,e){return xu(i,Td("default",e))}Dt.loading=(i,e)=>xu(i,Td("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Dt.promise=function(i,e,t){let s,{pending:r,error:n,success:a}=e;r&&(s=Da(r)?Dt.loading(r,t):Dt.loading(r.render,{...t,...r}));const o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,c,d)=>{if(c==null)return void Dt.dismiss(s);const f={type:h,...o,...t,data:d},y=Da(c)?{render:c}:c;return s?Dt.update(s,{...f,...y}):Dt(y.render,{...f,...y}),d},u=Ai(i)?i():i;return u.then(h=>l("success",a,h)).catch(h=>l("error",n,h)),u},Dt.success=Pd("success"),Dt.info=Pd("info"),Dt.error=Pd("error"),Dt.warning=Pd("warning"),Dt.warn=Dt.warning,Dt.dark=(i,e)=>xu(i,Td("default",{theme:"dark",...e})),Dt.dismiss=function(i){(function(e){var t;if(LS()){if(e==null||Da(t=e)||Cu(t))Xs.forEach(s=>{s.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const s=Xs.get(e.containerId);s?s.removeToast(e.id):Xs.forEach(r=>{r.removeToast(e.id)})}}else wu=wu.filter(s=>e!=null&&s.options.toastId!==e)})(i)},Dt.clearWaitingQueue=function(i){i===void 0&&(i={}),Xs.forEach(e=>{!e.props.limit||i.containerId&&e.id!==i.containerId||e.clearQueue()})},Dt.isActive=_S,Dt.update=function(i,e){e===void 0&&(e={});const t=((s,r)=>{var n;let{containerId:a}=r;return(n=Xs.get(a||1))==null?void 0:n.toasts.get(s)})(i,e);if(t){const{props:s,content:r}=t,n={delay:100,...s,...e,toastId:e.toastId||i,updateId:NS()};n.toastId!==i&&(n.staleId=i);const a=n.render||r;delete n.render,xu(a,n)}},Dt.done=i=>{Dt.update(i,{progress:1})},Dt.onChange=function(i){return nv.add(i),()=>{nv.delete(i)}},Dt.play=i=>kS(!0,i),Dt.pause=i=>kS(!1,i);const pfe=typeof window<"u"?V.useLayoutEffect:V.useEffect,Id=i=>{let{theme:e,type:t,isLoading:s,...r}=i;return V.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r})},Rd={info:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(i){return V.createElement(Id,{...i},V.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return V.createElement("div",{className:"Toastify__spinner"})}},ffe=i=>{const{isRunning:e,preventExitTransition:t,toastRef:s,eventHandlers:r,playToast:n}=MS(i),{closeButton:a,children:o,autoClose:l,onClick:u,type:h,hideProgressBar:c,closeToast:d,transition:f,position:y,className:v,style:m,bodyClassName:g,bodyStyle:b,progressClassName:x,progressStyle:I,updateId:L,role:A,progress:k,rtl:P,toastId:O,deleteToast:D,isIn:$,isLoading:Q,closeOnClick:_,theme:B}=i,H=Zn("Toastify__toast",`Toastify__toast-theme--${B}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":_}),U=Ai(v)?v({rtl:P,position:y,type:h,defaultClassName:H}):Zn(H,v),G=function(ue){let{theme:ie,type:se,isLoading:fe,icon:de}=ue,te=null;const pe={theme:ie,type:se};return de===!1||(Ai(de)?te=de({...pe,isLoading:fe}):V.isValidElement(de)?te=V.cloneElement(de,pe):fe?te=Rd.spinner():(Ne=>Ne in Rd)(se)&&(te=Rd[se](pe))),te}(i),j=!!k||!l,ae={closeToast:d,type:h,theme:B};let X=null;return a===!1||(X=Ai(a)?a(ae):V.isValidElement(a)?V.cloneElement(a,ae):function(ue){let{closeToast:ie,theme:se,ariaLabel:fe="close"}=ue;return V.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:de=>{de.stopPropagation(),ie(de)},"aria-label":fe},V.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},V.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(ae)),V.createElement(f,{isIn:$,done:D,position:y,preventExitTransition:t,nodeRef:s,playToast:n},V.createElement("div",{id:O,onClick:u,"data-in":$,className:U,...r,style:m,ref:s},V.createElement("div",{...$&&{role:A},className:Ai(g)?g({type:h}):Zn("Toastify__toast-body",g),style:b},G!=null&&V.createElement("div",{className:Zn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Q})},G),V.createElement("div",null,o)),X,V.createElement(hfe,{...L&&!j?{key:`pb-${L}`}:{},rtl:P,theme:B,delay:l,isRunning:e,isIn:$,closeToast:d,hide:c,type:h,style:I,className:x,controlledProgress:j,progress:k||0})))},Ad=function(i,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${i}-enter`,exit:`Toastify--animate Toastify__${i}-exit`,appendPosition:e}},FS=bu(Ad("bounce",!0)),mfe=bu(Ad("slide",!0)),gfe=bu(Ad("zoom")),vfe=bu(Ad("flip")),yfe={position:"top-right",transition:FS,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function qS(i){let e={...yfe,...i};const t=i.stacked,[s,r]=V.useState(!0),n=V.useRef(null),{getToastToRender:a,isToastActive:o,count:l}=OS(e),{className:u,style:h,rtl:c,containerId:d}=e;function f(v){const m=Zn("Toastify__toast-container",`Toastify__toast-container--${v}`,{"Toastify__toast-container--rtl":c});return Ai(u)?u({position:v,rtl:c,defaultClassName:m}):Zn(m,Sd(u))}function y(){t&&(r(!0),Dt.play())}return pfe(()=>{if(t){var v;const m=n.current.querySelectorAll('[data-in="true"]'),g=12,b=(v=e.position)==null?void 0:v.includes("top");let x=0,I=0;Array.from(m).reverse().forEach((L,A)=>{const k=L;k.classList.add("Toastify__toast--stacked"),A>0&&(k.dataset.collapsed=`${s}`),k.dataset.pos||(k.dataset.pos=b?"top":"bot");const P=x*(s?.2:1)+(s?0:g*A);k.style.setProperty("--y",`${b?P:-1*P}px`),k.style.setProperty("--g",`${g}`),k.style.setProperty("--s",""+(1-(s?I:0))),x+=k.offsetHeight,I+=.025})}},[s,l,t]),V.createElement("div",{ref:n,className:"Toastify",id:d,onMouseEnter:()=>{t&&(r(!1),Dt.pause())},onMouseLeave:y},a((v,m)=>{const g=m.length?{...h}:{...h,pointerEvents:"none"};return V.createElement("div",{className:f(v),style:g,key:`container-${v}`},m.map(b=>{let{content:x,props:I}=b;return V.createElement(ffe,{...I,stacked:t,collapseAll:y,isIn:o(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},x)}))}))}const Cfe=({paramRegistry:i,timelineRepresentation:e})=>{const[t,s]=V.useState({}),[r,n]=V.useState([]),[a,o]=V.useState(""),[l,u]=V.useState("Copy URL"),[h,c]=V.useState(!1),[d,f]=V.useState(!1),[y,v]=V.useState([]),m=V.useRef(null),g=[...i].filter(_=>_.name!=="includeSubset"&&_.name!=="excludeSubset").sort((_,B)=>_.name.localeCompare(B.name));V.useEffect(()=>{const _=new URLSearchParams(window.location.search),B={},H=[];let U=[],G=!1;const j=_.get("includeSubset"),ae=_.get("excludeSubset"),X=_.get("_b");if(X)try{const se=atob(X),fe=JSON.parse(se);fe.excludeSubset?(G=!0,U=fe.excludeSubset.split(",")):fe.includeSubset&&(G=!1,U=fe.includeSubset.split(","))}catch{ae?(G=!0,U=ae.split(",")):j&&(G=!1,U=j.split(","))}else ae?(G=!0,U=ae.split(",")):j&&(G=!1,U=j.split(","));f(G),ae||j?v(U):e.length>0&&v(G?[]:Array.from({length:e.length},(se,fe)=>(fe+1).toString()));const ue=_.get("_b");if(ue)try{const se=atob(ue),fe=JSON.parse(se),de=i.map(te=>te.name);Object.entries(fe).forEach(([te,pe])=>{de.includes(te)?B[te]=String(pe):te!=="_b"&&H.push({name:te,value:typeof pe=="object"?JSON.stringify(pe):String(pe),type:typeof pe=="boolean"?"boolean":typeof pe=="number"?"number":Array.isArray(pe)?"array":typeof pe=="object"?"json":"string"})}),i.forEach(te=>{te.name in B||(te.type==="boolean"&&te.defaultValue!==void 0?B[te.name]=String(te.defaultValue):B[te.name]="")}),c(!0)}catch{ie(_)}else ie(_);function ie(se){i.forEach(de=>{const te=se.get(de.name);te!==null?B[de.name]=te:de.type==="boolean"&&de.defaultValue!==void 0&&(B[de.name]=String(de.defaultValue))});const fe=i.map(de=>de.name);se.forEach((de,te)=>{if(!fe.includes(te)&&te!=="_b"){let pe="string";if(de==="true"||de==="false")pe="boolean";else if(!isNaN(Number(de)))pe="number";else try{const Ne=JSON.parse(de);pe=Array.isArray(Ne)?"array":"json"}catch{}H.push({name:te,value:de,type:pe})}})}s(B),n(H)},[i]),V.useEffect(()=>{const _=window.location.pathname.replace(/\/settings$/,"");let B="";const H={...t};if(y.length>0?d?(H.excludeSubset=y.sort().join(","),delete H.includeSubset):y.length!=e.length&&(H.includeSubset=y.sort().join(","),delete H.excludeSubset):(delete H.includeSubset,delete H.excludeSubset),r.forEach(G=>{G.name&&G.value!==""&&G.name!=="includeSubset"&&G.name!=="excludeSubset"&&(H[G.name]=G.value)}),h){const G={};Object.entries(H).forEach(([X,ue])=>{if(ue!==""){const ie=i.find(de=>de.name===X),se=r.find(de=>de.name===X),fe=(ie==null?void 0:ie.type)||(se==null?void 0:se.type)||"string";if(fe==="boolean"&&(ie==null?void 0:ie.defaultValue)!==void 0&&String(ie.defaultValue)===ue)return;switch(fe){case"number":G[X]=Number(ue);break;case"boolean":G[X]=ue==="true";break;case"array":case"json":try{G[X]=JSON.parse(ue)}catch{G[X]=ue}break;default:G[X]=ue}}});const j=JSON.stringify(G);B=`?_b=${btoa(j)}`}else{const G=new URLSearchParams;Object.entries(H).forEach(([j,ae])=>{if(ae!==""){const X=i.find(ue=>ue.name===j);if((X==null?void 0:X.type)==="boolean"&&X.defaultValue!==void 0&&String(X.defaultValue)===ae)return;G.set(j,String(ae))}}),B=G.toString()?`?${G.toString()}`:""}const U=`${window.location.origin}${_}${B}`;o(U)},[t,r,h,i,y,d]);const b=(_,B)=>{s(H=>({...H,[_]:B}))},x=(_,B,H)=>{n(U=>{const G=[...U];return G[_]={...G[_],[B]:H},G})},I=_=>{const B=`${_+1}`;v(H=>H.includes(B)?H.filter(G=>G!==B):[...H,B])},L=()=>{f(_=>!_)},A=()=>{n(_=>[..._,{name:"",value:"",type:"string"}])},k=r.filter(_=>_.name!=="includeSubset"&&_.name!=="excludeSubset"),P=_=>{n(B=>B.filter((H,U)=>U!==_))},O=()=>{m.current&&(m.current.select(),document.execCommand("copy"),u("Copied!"),setTimeout(()=>u("Copy URL"),2e3))},D=()=>{c(!h)},$=_=>{const{name:B,type:H,defaultValue:U}=_;if(B==="includeSubset"||B==="excludeSubset")return null;const G=t[B]||"";switch(H){case"boolean":return S.jsxs(S.Fragment,{children:[S.jsx("button",{onClick:()=>b(B,G==="true"?"false":"true"),className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${G==="true"?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":G==="true",children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${G==="true"?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-4 text-gray-500",children:G==="true"?"True":"False"})]});case"number":return S.jsx("input",{type:"number",className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:U!==void 0?`Default: ${U}`:"Enter number..."});case"array":case"json":return S.jsx("textarea",{className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:H==="array"?"Enter comma-separated values or JSON array":"Enter JSON object",rows:3});case"string":default:return S.jsx("input",{type:"text",className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:G,onChange:j=>b(B,j.target.value),placeholder:U!==void 0&&U!==""?`Default: ${U}`:"Enter value..."})}},Q=(_,B)=>_.name==="includeSubset"||_.name==="excludeSubset"?null:S.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center mb-2",children:[S.jsx("div",{className:"col-span-3",children:S.jsx("input",{type:"text",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.name,onChange:H=>x(B,"name",H.target.value),placeholder:"Parameter name"})}),S.jsx("div",{className:"col-span-2",children:S.jsxs("select",{className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md",value:_.type,onChange:H=>x(B,"type",H.target.value),children:[S.jsx("option",{value:"string",children:"String"}),S.jsx("option",{value:"number",children:"Number"}),S.jsx("option",{value:"boolean",children:"Boolean"}),S.jsx("option",{value:"array",children:"Array"}),S.jsx("option",{value:"json",children:"JSON"})]})}),S.jsx("div",{className:"col-span-6",children:_.type==="boolean"?S.jsx(S.Fragment,{children:S.jsx("button",{onClick:()=>x(B,"value",_.value==="true"?"false":"true"),className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${_.value==="true"?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":_.value==="true",children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${_.value==="true"?"translate-x-5":"translate-x-0"}`})})}):_.type==="array"||_.type==="json"?S.jsx("textarea",{className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:_.type==="array"?"Enter JSON array [1,2,3]":'Enter JSON object {"key":"value"}',rows:1}):_.type==="number"?S.jsx("input",{type:"number",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:"Enter number..."}):S.jsx("input",{type:"text",className:"block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:_.value,onChange:H=>x(B,"value",H.target.value),placeholder:"Enter value..."})}),S.jsx("div",{className:"col-span-1",children:S.jsx("button",{onClick:()=>P(B),className:"inline-flex cursor-pointer items-center justify-center p-2 border border-transparent rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500","aria-label":"Remove parameter",children:S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:S.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})})]});return S.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[S.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Experiment Parameters"}),S.jsx("p",{className:"text-gray-700 mb-6",children:"Configure the experiment by setting parameter values below. Fields left empty will be assigned their default value. Once configured, you can copy the URL to run the experiment with these settings."}),S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsxs("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Registered Parameters"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Parameters defined in the experiment configuration."})]}),S.jsx("ul",{className:"divide-y divide-gray-200",children:g.map(_=>S.jsx("li",{className:"px-4 py-4 sm:px-6",children:S.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[S.jsx("div",{className:"col-span-2",children:S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsxs("div",{className:"flex items-center",children:[S.jsx("label",{className:"text-base font-medium text-gray-900",children:_.name}),S.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-600",children:_.type})]}),_.description&&S.jsx("p",{className:"mt-1 text-sm text-gray-500 flex-grow",children:_.description}),_.defaultValue!==void 0&&S.jsxs("p",{className:"mt-auto pt-2 text-xs text-gray-500",children:["Default: ",S.jsxs("code",{children:[" ",JSON.stringify(_.defaultValue)]})]})]})}),S.jsx("div",{className:"col-span-1 flex items-center",children:$(_)})]})},_.name))})]}),S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsx("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Custom Parameters"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Add any additional parameters to be stored in the data for this run."})]}),S.jsxs("button",{onClick:A,className:"inline-flex cursor-pointer items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:S.jsx("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"})}),"Add Parameter"]})]})}),S.jsx("div",{className:"px-4 py-5 sm:px-6",children:k.length===0?S.jsx("p",{className:"text-sm text-gray-500 italic",children:'No custom parameters added. Click "Add Parameter" to create one.'}):S.jsxs("div",{children:[S.jsxs("div",{className:"grid grid-cols-12 gap-2 mb-2",children:[S.jsx("div",{className:"col-span-3",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"PARAMETER NAME"})}),S.jsx("div",{className:"col-span-2",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"TYPE"})}),S.jsx("div",{className:"col-span-6",children:S.jsx("label",{className:"block text-xs font-medium text-gray-500",children:"VALUE"})}),S.jsx("div",{className:"col-span-1"})]}),k.map((_,B)=>S.jsx("div",{children:Q(_,B)},B))]})})]}),e.length>0&&S.jsxs("div",{className:"bg-white shadow overflow-hidden sm:rounded-md mb-8",children:[S.jsx("div",{className:"px-4 py-5 border-b border-gray-200 sm:px-6",children:S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Trial Selection"}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Select which trials to include or exclude from the experiment."})]}),S.jsxs("div",{className:"flex items-center",children:[S.jsx("button",{onClick:L,className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${d?"bg-red-600":"bg-green-600"}`,role:"switch","aria-checked":d,children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${d?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-2 text-sm text-gray-600",children:d?"Exclude mode":"Include mode"})]})]})}),S.jsxs("div",{className:"px-4 py-5 sm:px-6",children:[S.jsx("p",{className:"mb-4 text-sm font-medium text-gray-500",children:d?"Check trials you want to EXCLUDE from the experiment":"Check trials you want to INCLUDE in the experiment"}),S.jsx("div",{className:"border border-gray-200 rounded-md overflow-hidden",children:S.jsx("ul",{className:"divide-y divide-gray-200",children:e.map((_,B)=>S.jsx("li",{className:"cursor-pointer px-4 py-3 hover:bg-gray-50",onClick:H=>{H.target.type!=="checkbox"&&!H.target.closest("label")&&I(B)},children:S.jsx("div",{className:"flex items-center",children:S.jsxs("div",{className:"flex items-center flex-grow",children:[S.jsx("input",{id:`trial-${B}`,type:"checkbox",className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded cursor-pointer",checked:y.includes(`${B+1}`),onChange:()=>I(B)}),S.jsxs("label",{htmlFor:`trial-${B}`,className:"ml-3 flex-grow flex items-center cursor-pointer",children:[S.jsxs("div",{className:"w-8 text-center text-xs text-gray-500 font-medium",children:["#",B+1]}),S.jsx("div",{className:"flex-grow",children:_.name?S.jsx("span",{className:"font-medium text-gray-900",children:_.name}):S.jsx("span",{className:"font-medium text-gray-500",children:_.type})}),S.jsx("div",{className:"ml-2",children:S.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:_.type})})]})]})})},B))})})]})]}),S.jsxs("div",{className:"bg-white shadow sm:rounded-md p-6 mb-8",children:[S.jsxs("div",{className:"flex justify-between items-center mb-4",children:[S.jsx("h2",{className:"text-lg font-medium",children:"Generated URL"}),S.jsxs("div",{className:"flex items-center",children:[S.jsx("button",{onClick:D,className:`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${h?"bg-blue-600":"bg-gray-200"}`,role:"switch","aria-checked":h,children:S.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200 ${h?"translate-x-5":"translate-x-0"}`})}),S.jsx("span",{className:"ml-2 text-sm text-gray-600",children:h?"Base64 Encoded":"Plain Parameters"})]})]}),S.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[S.jsx("input",{ref:m,type:"text",className:"flex-grow px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",value:a,readOnly:!0}),S.jsx("button",{onClick:O,className:"inline-flex cursor-pointer justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:l})]}),h&&S.jsxs("p",{className:"mt-4 text-sm text-gray-600",children:[S.jsx("span",{className:"font-medium",children:"Note:"}),' Base64 encoding combines all parameters into a single "_b" parameter, creating shorter URLs that hide parameter details.']})]}),S.jsx("div",{className:"flex justify-center",children:S.jsx("a",{href:a,className:"inline-flex justify-center py-4 px-5 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Launch Experiment with these Settings"})})]})},bfe=new Cce,BS=V.createContext(!1),wfe=()=>V.useContext(BS);function $S(i){if(typeof i=="boolean")return i;if(typeof i=="string"){const e=i.trim().toLowerCase();return e!==""&&e!=="false"&&e!=="0"}return!!i}function xfe({children:i,disableSettings:e,disableHybridSimulation:t}){return V.useEffect(()=>{const s=r=>{r.key===" "&&!(r.target instanceof HTMLInputElement)&&!(r.target instanceof HTMLTextAreaElement)&&!r.target.isContentEditable&&r.preventDefault()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),window.location.pathname.endsWith("/settings")&&!$S(e)?S.jsx(Cfe,{paramRegistry:Nl.getRegistry(),timelineRepresentation:Nl.getTimelineRepresentation()}):S.jsxs(xce,{client:bfe,children:[S.jsx(BS.Provider,{value:$S(t),children:i}),S.jsx(qS,{position:"top-center",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!1,pauseOnHover:!0,theme:"light",toastClassName:()=>"relative flex p-4 min-h-10 rounded-none justify-between overflow-hidden cursor-pointer border-2 border-black shadow-[2px_2px_0px_rgba(0,0,0,1)] bg-white",bodyClassName:"text-black font-sans"})]})}Zs("RequestFilePermission",null),$s("RequestFilePermission",fo,{});function HS({next:i}){const[e,t]=V.useState("checking");return V.useEffect(()=>{if(e!=="checking")return;(async()=>{if(Fl()!=="mobile"||Ca.getPlatform()!=="android"){i({});return}try{await _a.writeFile({path:"permission_check.txt",data:"Testing permissions",directory:dn.Documents,encoding:Vd.UTF8});try{await _a.deleteFile({path:"permission_check.txt",directory:dn.Documents})}catch(r){console.log("Cleanup error:",r)}t("granted"),i({})}catch(r){console.error("Permission denied or error:",r),t("denied")}})()},[i,e]),e==="checking"?null:S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-6 text-xl mt-16 px-10",children:[S.jsx("p",{children:"Storage permission is required to save your data."}),S.jsx("p",{children:"Please grant permission when prompted."}),S.jsxs("p",{children:['If there is no popup, go to "Settings" ',">",' "Apps" ',">",' "Name of the App" ',">",' "Permissions" ',">",' "Storage" ',">",' "Allow"']}),S.jsx("button",{onClick:()=>t("checking"),className:"mt-8 bg-white px-8 py-3 border-2 border-black font-bold text-black text-lg rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"Try Again"})]})}Zs("CanvasBlock","canvas",H2);function Efe(i){return typeof i=="function"}function Vfe(i){return typeof i=="object"&&i!==null&&typeof i.draw=="function"}function QS({next:i,updateStore:e,timeline:t,width:s,height:r,store:n,styleCanvas:a,initCanvas:o}){const{instructions:l,markers:u}=V.useMemo(()=>rc(t),[t]),h=V.useRef(0),c=V.useRef(0),d=V.useRef(!0),f=V.useRef(null),y=V.useRef(null),v=V.useRef([]),m=V.useRef(n??{}),g=V.useRef(null),b=V.useRef(0),x=V.useRef(null);V.useEffect(()=>{const Q=m.current._reactiveScreenRefreshRate,_=typeof Q=="number"&&Q>=20&&Q<=300;x.current=_?1e3/Q:null},[n]);const I=V.useCallback(Q=>{if(Q.type!=="ExecuteContent")return null;const _=Q.content;if(Efe(_))try{return _(v.current,m.current)}catch(B){return console.error("Error executing dynamic canvas slide generator:",B),null}else if(Vfe(_))return _;return console.warn("ExecuteContent instruction content is not a valid CanvasSlide or Generator:",_),null},[]),L=V.useCallback(()=>{const Q=y.current;if(!Q)return{};const _=Q.getContext("2d");if(!_)return{};const B=window.devicePixelRatio||1,H=Q.width/B,U=Q.height/B;return{ctx:_,canvasWidth:H,canvasHeight:U}},[]),A=V.useCallback(()=>{const{ctx:Q,canvasWidth:_,canvasHeight:B}=L();Q&&(Q.fillStyle="white",Q.fillRect(0,0,_,B),d.current=!1)},[L]),k=V.useCallback(Q=>{const{ctx:_,canvasWidth:B,canvasHeight:H}=L();if(_){if(_.fillStyle="white",_.fillRect(0,0,B,H),a)try{a(_,B,H)}catch(U){console.error("Error during styleCanvas function:",U)}else _.fillStyle="black";try{Q.draw(_,B,H)}catch(U){console.error("Error during slide draw function:",U)}c.current=As(),d.current=!0,f.current=null,b.current+=1}},[L]);let P;const O=V.useCallback(()=>{const Q=As(),_=h.current;if(_<0||_>=l.length){g.current&&cancelAnimationFrame(g.current),g.current=null;return}const B=l[_],H=I(B);if(!H){g.current&&cancelAnimationFrame(g.current),g.current=null;return}const U=H.displayDuration??1/0,G=H.responseTimeLimit??1/0,j=H.allowedKeys??!1,ae=j===!1||Array.isArray(j)&&j.length===0;let X=!1;const ue=Q-c.current+(x.current!==null?x.current*.5:0);d.current&&U!==1/0&&ue>=U&&(A(),(ae||G===1/0)&&(X=!0)),!X&&G!==1/0&&ue>=G&&(X=!0,d.current&&U!==1/0&&ue<U&&A()),X?P():d.current&&U!==1/0&&ue<U||G!==1/0&&ue<G?g.current=requestAnimationFrame(O):(g.current&&cancelAnimationFrame(g.current),g.current=null)},[l,I,A]),D=V.useCallback(()=>{g.current&&cancelAnimationFrame(g.current),g.current=null;const Q=Dn({instructions:l,markers:u},h.current,()=>m.current,()=>v.current,B=>{m.current=B});if(h.current=Q,Q>=l.length){e(m.current),i(v.current);return}if(!y.current){console.error("Canvas element not found during control flow.");return}const _=I(l[Q]);if(_){k(_);const B=_.displayDuration??1/0,H=_.responseTimeLimit??1/0;(B!==1/0||H!==1/0)&&(g.current=requestAnimationFrame(O))}else console.error("Failed to resolve slide content during control flow:",l[Q]),h.current++,D()},[l,u,I,k,O,i]);P=V.useCallback(()=>{const Q=f.current,_=As();g.current&&cancelAnimationFrame(g.current),g.current=null;const B=h.current;if(B>=l.length||l[B].type!=="ExecuteContent"){h.current++,D();return}const H=l[B],U=I(H);if(U&&!U.ignoreData){let G={index:h.current,trialNumber:b.current-1,start:c.current,end:_,duration:_-c.current,key:Q?Q.key:null,reactionTime:Q?Q.reactionTime:null};G=nc(G,U,v.current,m.current),v.current.push(G)}h.current++,f.current=null,D()},[l,I,D]);const $=V.useCallback(Q=>{const _=As(),B=h.current;if(B>=l.length||!d.current)return;const H=l[B];if(H.type!=="ExecuteContent")return;const U=I(H);if(!U)return;const G=U.responseTimeLimit??1/0,j=_-c.current<G,ae=U.allowedKeys??!1;if((ae===!0||Array.isArray(ae)&&ae.includes(Q.key))&&j){const ue=U.endSlideOnResponse??!0,ie=U.hideOnResponse??!1,se=U.ignoreData??!1;(!f.current||!ue)&&(!f.current&&!se&&(f.current={key:Q.key,time:_,reactionTime:_-c.current}),ie&&A(),ue&&P())}},[l,I,P,A]);return V.useEffect(()=>{const Q=y.current;if(!Q)return;const _=po()?window.screen.width:window.innerWidth,B=po()?window.screen.height:window.innerHeight;let H,U;const G=(te,pe)=>{if(typeof te=="number")return te;if(typeof te=="string"&&te.includes("%")){const Ne=parseFloat(te);if(!isNaN(Ne))return pe*Ne/100}return null};let j=G(s,_),ae=G(r,B);const X=typeof s=="string"&&/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(s),ue=typeof r=="string"&&/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(r);if(j!==null&&ae!==null)H=j,U=ae;else if(j!==null&&ae===null&&!ue)H=j,U=j;else if(ae!==null&&j===null&&!X)U=ae,H=ae;else if(j===null&&ae===null&&!X&&!ue){const te=Math.min(_,B);H=te,U=te}else{let te=j,pe=ae;if(ue&&te===null&&(te=pe??B),X&&pe===null&&(pe=te??_),te===null&&pe===null){const Ne=Math.min(_,B);te=Ne,pe=Ne}else te===null?te=pe:pe===null&&(pe=te);H=te,U=pe??0}if(X&&!ue)try{const te=s.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);te&&(H=U/parseFloat(te[2])*parseFloat(te[1]))}catch{console.error("Invalid width ratio string:",s)}else if(ue&&!X)try{const te=r.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);te&&(U=H/parseFloat(te[1])*parseFloat(te[2]))}catch{console.error("Invalid height ratio string:",r)}else if(X&&ue){console.warn(`Both width (${s}) and height (${r}) are ratios. Prioritizing width.`);try{const te=s.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);if(te){H=B/parseFloat(te[2])*parseFloat(te[1]);const pe=r.match(/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/);pe?U=H/parseFloat(pe[1])*parseFloat(pe[2]):U=H}else{const pe=Math.min(_,B);H=pe,U=pe}}catch(te){console.error("Error parsing ratios:",te);const pe=Math.min(_,B);H=pe,U=pe}}const ie=window.devicePixelRatio||1,se=Math.round(H),fe=Math.round(U);Q.width=Math.round(se*ie),Q.height=Math.round(fe*ie),Q.style.width=se+"px",Q.style.height=fe+"px";const de=Q.getContext("2d");if(de&&de.scale(ie,ie),o&&de)try{o(de,se,fe)}catch(te){console.error("Error during canvas initialization:",te)}return window.addEventListener("keydown",$),D(),()=>{window.removeEventListener("keydown",$),g.current&&cancelAnimationFrame(g.current)}},[t,s,r,$,D]),S.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:S.jsx("canvas",{ref:y})})}$s("CanvasBlock",(i,e,t,s)=>{const r=i.timeline;if(!r)return{responseData:[],participantState:s};const n=rc(r),a=[];let o={...e.store||{}},l=0,u=0;const h=()=>o,c=()=>a,d=y=>{o=y};let f=Dn(n,0,h,c,d);for(;f<n.instructions.length;){let y=n.instructions[f].content;typeof y=="function"&&(y=y(a,o));const m=(y.simulate||t.respondToSlide)(y,s);if(s=m.participantState,!y.ignoreData){const g=y.displayDuration||m.reactionTime||1e3;let b={index:f,trialNumber:u,start:l,end:l+g,duration:g,key:m.key,reactionTime:m.reactionTime};b=nc(b,y,a,o),a.push(b),l+=g}u++,f=Dn(n,f+1,h,c,d)}return{responseData:a,participantState:s,storeUpdates:o,duration:l}},{respondToSlide:(i,e)=>{const t=i.allowedKeys;return t===!0?{key:" ",reactionTime:K.uniform(200,800),participantState:e}:Array.isArray(t)&&t.length>0?{key:t[Math.floor(K.uniform(0,t.length))],reactionTime:K.uniform(200,800),participantState:e}:{key:null,reactionTime:null,participantState:e}}}),Zs("CheckDevice","session"),$s("CheckDevice",(i,e,t,s)=>{const r={windowWidth:1920,windowHeight:1080,screenWidth:1920,screenHeight:1080,browser:"Simulated",browserVersion:"1.0",isMobile:!1,operatingSystem:"Simulated",hasWebAudio:!0,hasFullscreen:!0,hasWebcam:!0,hasMicrophone:!0};return{responseData:r,participantState:s,storeUpdates:{_reactiveDeviceInfo:r}}},{});function US({check:i,content:e=S.jsx("div",{children:"Your device doesn't meet the requirements for this experiment."}),data:t,store:s,updateStore:r,next:n}){const[a,o]=V.useState(!1),l=V.useRef(!1);V.useEffect(()=>{if(l.current)return;(async()=>{const c=window.innerWidth,d=window.innerHeight,f=window.screen.width,y=window.screen.height,v=navigator.userAgent;let m="Unknown",g="Unknown";if(v.indexOf("Chrome")>-1){m="Chrome";const D=v.match(/Chrome\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Firefox")>-1){m="Firefox";const D=v.match(/Firefox\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Safari")>-1){m="Safari";const D=v.match(/Version\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("Edge")>-1){m="Edge";const D=v.match(/Edge\/(\d+\.\d+)/);g=D?D[1]:"Unknown"}else if(v.indexOf("MSIE")>-1||v.indexOf("Trident/")>-1){m="Internet Explorer";const D=v.match(/(?:MSIE |rv:)(\d+\.\d+)/);g=D?D[1]:"Unknown"}const b=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(v);let x="Unknown";/Windows/.test(v)?x="Windows":/Macintosh|Mac OS X/.test(v)?x="MacOS":/Linux/.test(v)?x="Linux":/Android/.test(v)?x="Android":/iOS|iPhone|iPad|iPod/.test(v)&&(x="iOS");const I=!!(window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext),L=!!(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen||document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled);let A=!1,k=!1;try{const D=await navigator.mediaDevices.enumerateDevices();A=D.some($=>$.kind==="videoinput"),k=D.some($=>$.kind==="audioinput")}catch(D){console.error("Error checking media devices:",D)}const P={windowWidth:c,windowHeight:d,screenWidth:f,screenHeight:y,browser:m,browserVersion:g,isMobile:b,operatingSystem:x,hasWebAudio:I,hasFullscreen:L,hasWebcam:A,hasMicrophone:k};r({_reactiveDeviceInfo:P}),(i?i(P,t,s):!0)&&!l.current?(l.current=!0,n(P)):o(!0)})()},[i,t,r,n]);const u=xi(qi());return a?S.jsx("div",{className:`min-h-screen ${u.containerBg}`,children:S.jsx("div",{className:"max-w-prose mx-auto mt-20 mb-20 px-4",children:S.jsx("article",{className:`prose prose-2xl ${u.prose} text-xl ${u.proseLink} prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold ${u.text} leading-relaxed`,children:e})})}):null}Zs("StoreUI","storeui");function jS(i,e){const t={};return i.forEach(s=>{t[s.storeKey]=(e==null?void 0:e[s.storeKey])!==void 0?e[s.storeKey]:s.defaultValue}),t}$s("StoreUI",(i,e,t,s)=>{const r=jS(i.fields||[],e.store);return{responseData:r,participantState:s,storeUpdates:r}},{});function Sfe({next:i,updateStore:e,store:t,title:s="Settings",description:r,fields:n,saveButtonText:a="Save Configuration"}){const[o,l]=V.useState({}),[u,h]=V.useState({}),[c,d]=V.useState({});V.useEffect(()=>{l(jS(n,t));const g={};n.forEach(b=>{g[b.storeKey]=!1}),d(g)},[t,n]);const f=(g,b)=>{if(g.type==="integer"||g.type==="float"){if(b==null||b==="")return"This field is required";if(g.min!==void 0&&b<g.min)return`Value must be at least ${g.min}`;if(g.max!==void 0&&b>g.max)return`Value must be at most ${g.max}`}else if(g.type==="string"){if(g.minLength!==void 0&&b.length<g.minLength)return`Must be at least ${g.minLength} characters`;if(g.maxLength!==void 0&&b.length>g.maxLength)return`Must be at most ${g.maxLength} characters`}if(g.validate){const x=g.validate(b);if(x!==!0&&x!=="")return typeof x=="string"?x:"Invalid value"}return null};V.useEffect(()=>{const g={};n.forEach(b=>{const x=o[b.storeKey];if(!c[b.storeKey])return;const I=f(b,x);I&&(g[b.storeKey]=I)}),h(g)},[o,n,c]);const y=(g,b)=>{l(x=>({...x,[g]:b})),d(x=>({...x,[g]:!0}))},v=()=>{const g={};n.forEach(x=>{g[x.storeKey]=!0}),d(g);const b={};n.forEach(x=>{const I=o[x.storeKey];if(x.type==="integer"||x.type==="float"?I==null||I===""?b[x.storeKey]="This field is required":x.min!==void 0&&I<x.min?b[x.storeKey]=`Value must be at least ${x.min}`:x.max!==void 0&&I>x.max&&(b[x.storeKey]=`Value must be at most ${x.max}`):x.type==="string"&&(x.minLength!==void 0&&I.length<x.minLength?b[x.storeKey]=`Must be at least ${x.minLength} characters`:x.maxLength!==void 0&&I.length>x.maxLength&&(b[x.storeKey]=`Must be at most ${x.maxLength} characters`)),x.validate&&!b[x.storeKey]){const L=x.validate(I);L!==!0&&L!==""&&(b[x.storeKey]=typeof L=="string"?L:"Invalid value")}}),h(b),Object.keys(b).length===0&&(e(o),i(o))},m=Object.keys(u).length>0;return S.jsxs("div",{className:"max-w-prose mx-auto mt-20 mb-20 px-4",children:[S.jsx("h1",{className:"text-4xl font-bold mb-6",children:s}),r&&S.jsx("article",{className:"prose prose-lg mb-10",children:r}),S.jsx("div",{className:"mt-12 space-y-12",children:n.map(g=>S.jsxs("div",{className:"space-y-2",children:[S.jsxs("label",{className:"block text-xl font-medium text-gray-900",children:[g.label,g.type==="integer"&&g.min!==void 0&&g.max!==void 0&&` (${g.min}-${g.max})`,g.type==="float"&&g.min!==void 0&&g.max!==void 0&&` (${g.min}-${g.max})`]}),g.prompt&&S.jsx("p",{className:"mb-4 text-base text-gray-700 mb-2",children:g.prompt}),g.type==="boolean"&&S.jsxs("div",{className:"flex items-center",children:[S.jsxs("div",{className:`relative cursor-pointer w-10 h-10 flex items-center justify-center border-2 border-black rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none ${o[g.storeKey]?"bg-blue-600 text-white":"bg-white"}`,onClick:()=>y(g.storeKey,!o[g.storeKey]),children:[S.jsx("input",{type:"checkbox",checked:!!o[g.storeKey],onChange:b=>y(g.storeKey,b.target.checked),className:"absolute opacity-0 h-0 w-0"}),o[g.storeKey]&&S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})]}),S.jsx("span",{className:"ml-3 text-lg",children:"Enabled"})]}),(g.type==="integer"||g.type==="float")&&S.jsxs("div",{className:"flex items-center space-x-4",children:[g.min!==void 0&&g.max!==void 0&&S.jsx("button",{onClick:()=>y(g.storeKey,Math.max(g.min||0,(o[g.storeKey]||0)-(g.step||1))),className:"cursor-pointer bg-white h-10 w-10 flex items-center justify-center border-2 border-black font-bold text-black text-lg rounded-full shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"-"}),S.jsx("input",{type:"text",value:o[g.storeKey]||"",onChange:b=>{const x=b.target.value;let I;g.type==="integer"?I=x===""?"":parseInt(x,10):g.type==="float"&&(I=x===""?"":parseFloat(x)),(x===""||!isNaN(I))&&y(g.storeKey,I)},step:g.step||(g.type==="integer"?1:.1),min:g.min,max:g.max,className:"w-24 px-4 py-2 text-center border-2 border-black rounded-xl text-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),g.min!==void 0&&g.max!==void 0&&S.jsx("button",{onClick:()=>y(g.storeKey,Math.min(g.max||1/0,(o[g.storeKey]||0)+(g.step||1))),className:"cursor-pointer bg-white h-10 w-10 flex items-center justify-center border-2 border-black font-bold text-black text-lg rounded-full shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",children:"+"})]}),g.type==="string"&&S.jsx("input",{type:"text",value:o[g.storeKey]||"",onChange:b=>y(g.storeKey,b.target.value),className:"w-full px-4 py-2 border-2 border-black rounded-xl text-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),u[g.storeKey]&&c[g.storeKey]&&S.jsx("div",{className:"text-red-500 text-sm mt-1",children:u[g.storeKey]}),g.component&&S.jsx("div",{className:"mt-4",children:V.createElement(g.component,{value:o[g.storeKey]})})]},g.storeKey))}),S.jsx("div",{className:"mt-12 flex justify-center",children:S.jsx("button",{onClick:v,disabled:m,className:`bg-white cursor-pointer px-8 py-3 border-2 border-black font-bold text-black text-lg rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none ${m?"opacity-50 cursor-not-allowed":""}`,children:a})})]})}const Eu=V.createContext({});function av(i){const e=V.useRef(null);return e.current===null&&(e.current=i()),e.current}const ov=typeof window<"u"?V.useLayoutEffect:V.useEffect,Ld=V.createContext(null);function lv(i,e){i.indexOf(e)===-1&&i.push(e)}function _d(i,e){const t=i.indexOf(e);t>-1&&i.splice(t,1)}const Nr=(i,e,t)=>t>e?e:t<i?i:t;function uv(i,e){return e?`${i}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:i}let qo=()=>{},pn=()=>{};typeof process<"u"&&((fT=process.env)==null?void 0:fT.NODE_ENV)!=="production"&&(qo=(i,e,t)=>{!i&&typeof console<"u"&&console.warn(uv(e,t))},pn=(i,e,t)=>{if(!i)throw new Error(uv(e,t))});const Jn={},zS=i=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i);function WS(i){return typeof i=="object"&&i!==null}const GS=i=>/^0[^.\s]+$/u.test(i);function KS(i){let e;return()=>(e===void 0&&(e=i()),e)}const Gi=i=>i,Tfe=(i,e)=>t=>e(i(t)),Vu=(...i)=>i.reduce(Tfe),Su=(i,e,t)=>{const s=e-i;return s===0?1:(t-i)/s};class hv{constructor(){this.subscriptions=[]}add(e){return lv(this.subscriptions,e),()=>_d(this.subscriptions,e)}notify(e,t,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,s);else for(let n=0;n<r;n++){const a=this.subscriptions[n];a&&a(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const gi=i=>i*1e3,Ki=i=>i/1e3;function ZS(i,e){return e?i*(1e3/e):0}const JS=new Set;function cv(i,e,t){i||JS.has(e)||(console.warn(uv(e,t)),JS.add(e))}const YS=(i,e,t)=>(((1-3*t+3*e)*i+(3*t-6*e))*i+3*e)*i,Pfe=1e-7,Ife=12;function Rfe(i,e,t,s,r){let n,a,o=0;do a=e+(t-e)/2,n=YS(a,s,r)-i,n>0?t=a:e=a;while(Math.abs(n)>Pfe&&++o<Ife);return a}function Tu(i,e,t,s){if(i===e&&t===s)return Gi;const r=n=>Rfe(n,0,1,i,t);return n=>n===0||n===1?n:YS(r(n),e,s)}const XS=i=>e=>e<=.5?i(2*e)/2:(2-i(2*(1-e)))/2,e3=i=>e=>1-i(1-e),t3=Tu(.33,1.53,.69,.99),dv=e3(t3),s3=XS(dv),i3=i=>i>=1?1:(i*=2)<1?.5*dv(i):.5*(2-Math.pow(2,-10*(i-1))),pv=i=>1-Math.sin(Math.acos(i)),r3=e3(pv),n3=XS(pv),Afe=Tu(.42,0,1,1),Lfe=Tu(0,0,.58,1),a3=Tu(.42,0,.58,1),_fe=i=>Array.isArray(i)&&typeof i[0]!="number",o3=i=>Array.isArray(i)&&typeof i[0]=="number",l3={linear:Gi,easeIn:Afe,easeInOut:a3,easeOut:Lfe,circIn:pv,circInOut:n3,circOut:r3,backIn:dv,backInOut:s3,backOut:t3,anticipate:i3},Dfe=i=>typeof i=="string",u3=i=>{if(o3(i)){pn(i.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,t,s,r]=i;return Tu(e,t,s,r)}else if(Dfe(i))return pn(l3[i]!==void 0,`Invalid easing type '${i}'`,"invalid-easing-type"),l3[i];return i},Dd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function kfe(i,e){let t=new Set,s=new Set,r=!1,n=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(h){a.has(h)&&(u.schedule(h),i()),h(o)}const u={schedule:(h,c=!1,d=!1)=>{const y=d&&r?t:s;return c&&a.add(h),y.add(h),h},cancel:h=>{s.delete(h),a.delete(h)},process:h=>{if(o=h,r){n=!0;return}r=!0;const c=t;t=s,s=c,t.forEach(l),t.clear(),r=!1,n&&(n=!1,u.process(h))}};return u}const Ofe=40;function h3(i,e){let t=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},n=()=>t=!0,a=Dd.reduce((x,I)=>(x[I]=kfe(n),x),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:h,update:c,preRender:d,render:f,postRender:y}=a,v=()=>{const x=Jn.useManualTiming,I=x?r.timestamp:performance.now();t=!1,x||(r.delta=s?1e3/60:Math.max(Math.min(I-r.timestamp,Ofe),1)),r.timestamp=I,r.isProcessing=!0,o.process(r),l.process(r),u.process(r),h.process(r),c.process(r),d.process(r),f.process(r),y.process(r),r.isProcessing=!1,t&&e&&(s=!1,i(v))},m=()=>{t=!0,s=!0,r.isProcessing||i(v)};return{schedule:Dd.reduce((x,I)=>{const L=a[I];return x[I]=(A,k=!1,P=!1)=>(t||m(),L.schedule(A,k,P)),x},{}),cancel:x=>{for(let I=0;I<Dd.length;I++)a[Dd[I]].cancel(x)},state:r,steps:a}}const{schedule:Pt,cancel:Yn,state:Ms,steps:fv}=h3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gi,!0);let kd;function Mfe(){kd=void 0}const ei={now:()=>(kd===void 0&&ei.set(Ms.isProcessing||Jn.useManualTiming?Ms.timestamp:performance.now()),kd),set:i=>{kd=i,queueMicrotask(Mfe)}},c3=i=>e=>typeof e=="string"&&e.startsWith(i),d3=c3("--"),Nfe=c3("var(--"),mv=i=>Nfe(i)?Ffe.test(i.split("/*")[0].trim()):!1,Ffe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function p3(i){return typeof i!="string"?!1:i.split("/*")[0].includes("var(--")}const Bo={test:i=>typeof i=="number",parse:parseFloat,transform:i=>i},Pu={...Bo,transform:i=>Nr(0,1,i)},Od={...Bo,default:1},Iu=i=>Math.round(i*1e5)/1e5,gv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qfe(i){return i==null}const Bfe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vv=(i,e)=>t=>!!(typeof t=="string"&&Bfe.test(t)&&t.startsWith(i)||e&&!qfe(t)&&Object.prototype.hasOwnProperty.call(t,e)),f3=(i,e,t)=>s=>{if(typeof s!="string")return s;const[r,n,a,o]=s.match(gv);return{[i]:parseFloat(r),[e]:parseFloat(n),[t]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},$fe=i=>Nr(0,255,i),yv={...Bo,transform:i=>Math.round($fe(i))},ka={test:vv("rgb","red"),parse:f3("red","green","blue"),transform:({red:i,green:e,blue:t,alpha:s=1})=>"rgba("+yv.transform(i)+", "+yv.transform(e)+", "+yv.transform(t)+", "+Iu(Pu.transform(s))+")"};function Hfe(i){let e="",t="",s="",r="";return i.length>5?(e=i.substring(1,3),t=i.substring(3,5),s=i.substring(5,7),r=i.substring(7,9)):(e=i.substring(1,2),t=i.substring(2,3),s=i.substring(3,4),r=i.substring(4,5),e+=e,t+=t,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Cv={test:vv("#"),parse:Hfe,transform:ka.transform},Ru=i=>({test:e=>typeof e=="string"&&e.endsWith(i)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${i}`}),Xn=Ru("deg"),Fr=Ru("%"),Ee=Ru("px"),Qfe=Ru("vh"),Ufe=Ru("vw"),m3={...Fr,parse:i=>Fr.parse(i)/100,transform:i=>Fr.transform(i*100)},$o={test:vv("hsl","hue"),parse:f3("hue","saturation","lightness"),transform:({hue:i,saturation:e,lightness:t,alpha:s=1})=>"hsla("+Math.round(i)+", "+Fr.transform(Iu(e))+", "+Fr.transform(Iu(t))+", "+Iu(Pu.transform(s))+")"},fs={test:i=>ka.test(i)||Cv.test(i)||$o.test(i),parse:i=>ka.test(i)?ka.parse(i):$o.test(i)?$o.parse(i):Cv.parse(i),transform:i=>typeof i=="string"?i:i.hasOwnProperty("red")?ka.transform(i):$o.transform(i),getAnimatableNone:i=>{const e=fs.parse(i);return e.alpha=0,fs.transform(e)}},jfe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zfe(i){var e,t;return isNaN(i)&&typeof i=="string"&&(((e=i.match(gv))==null?void 0:e.length)||0)+(((t=i.match(jfe))==null?void 0:t.length)||0)>0}const g3="number",v3="color",Wfe="var",Gfe="var(",y3="${}",Kfe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ho(i){const e=i.toString(),t=[],s={color:[],number:[],var:[]},r=[];let n=0;const o=e.replace(Kfe,l=>(fs.test(l)?(s.color.push(n),r.push(v3),t.push(fs.parse(l))):l.startsWith(Gfe)?(s.var.push(n),r.push(Wfe),t.push(l)):(s.number.push(n),r.push(g3),t.push(parseFloat(l))),++n,y3)).split(y3);return{values:t,split:o,indexes:s,types:r}}function Zfe(i){return Ho(i).values}function C3({split:i,types:e}){const t=i.length;return s=>{let r="";for(let n=0;n<t;n++)if(r+=i[n],s[n]!==void 0){const a=e[n];a===g3?r+=Iu(s[n]):a===v3?r+=fs.transform(s[n]):r+=s[n]}return r}}function Jfe(i){return C3(Ho(i))}const Yfe=i=>typeof i=="number"?0:fs.test(i)?fs.getAnimatableNone(i):i,Xfe=(i,e)=>typeof i=="number"?e!=null&&e.trim().endsWith("/")?i:0:Yfe(i);function eme(i){const e=Ho(i);return C3(e)(e.values.map((s,r)=>Xfe(s,e.split[r])))}const fr={test:zfe,parse:Zfe,createTransformer:Jfe,getAnimatableNone:eme};function bv(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function tme({hue:i,saturation:e,lightness:t,alpha:s}){i/=360,e/=100,t/=100;let r=0,n=0,a=0;if(!e)r=n=a=t;else{const o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;r=bv(l,o,i+1/3),n=bv(l,o,i),a=bv(l,o,i-1/3)}return{red:Math.round(r*255),green:Math.round(n*255),blue:Math.round(a*255),alpha:s}}function Md(i,e){return t=>t>0?e:i}const Bt=(i,e,t)=>i+(e-i)*t,wv=(i,e,t)=>{const s=i*i,r=t*(e*e-s)+s;return r<0?0:Math.sqrt(r)},sme=[Cv,ka,$o],ime=i=>sme.find(e=>e.test(i));function b3(i){const e=ime(i);if(qo(!!e,`'${i}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let t=e.parse(i);return e===$o&&(t=tme(t)),t}const w3=(i,e)=>{const t=b3(i),s=b3(e);if(!t||!s)return Md(i,e);const r={...t};return n=>(r.red=wv(t.red,s.red,n),r.green=wv(t.green,s.green,n),r.blue=wv(t.blue,s.blue,n),r.alpha=Bt(t.alpha,s.alpha,n),ka.transform(r))},xv=new Set(["none","hidden"]);function rme(i,e){return xv.has(i)?t=>t<=0?i:e:t=>t>=1?e:i}function nme(i,e){return t=>Bt(i,e,t)}function Ev(i){return typeof i=="number"?nme:typeof i=="string"?mv(i)?Md:fs.test(i)?w3:lme:Array.isArray(i)?x3:typeof i=="object"?fs.test(i)?w3:ame:Md}function x3(i,e){const t=[...i],s=t.length,r=i.map((n,a)=>Ev(n)(n,e[a]));return n=>{for(let a=0;a<s;a++)t[a]=r[a](n);return t}}function ame(i,e){const t={...i,...e},s={};for(const r in t)i[r]!==void 0&&e[r]!==void 0&&(s[r]=Ev(i[r])(i[r],e[r]));return r=>{for(const n in s)t[n]=s[n](r);return t}}function ome(i,e){const t=[],s={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const n=e.types[r],a=i.indexes[n][s[n]],o=i.values[a]??0;t[r]=o,s[n]++}return t}const lme=(i,e)=>{const t=fr.createTransformer(e),s=Ho(i),r=Ho(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?xv.has(i)&&!r.values.length||xv.has(e)&&!s.values.length?rme(i,e):Vu(x3(ome(s,r),r.values),t):(qo(!0,`Complex values '${i}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Md(i,e))};function E3(i,e,t){return typeof i=="number"&&typeof e=="number"&&typeof t=="number"?Bt(i,e,t):Ev(i)(i,e)}const ume=i=>{const e=({timestamp:t})=>i(t);return{start:(t=!0)=>Pt.update(e,t),stop:()=>Yn(e),now:()=>Ms.isProcessing?Ms.timestamp:ei.now()}},V3=(i,e,t=10)=>{let s="";const r=Math.max(Math.round(e/t),2);for(let n=0;n<r;n++)s+=Math.round(i(n/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Nd=2e4;function Vv(i){let e=0;const t=50;let s=i.next(e);for(;!s.done&&e<Nd;)e+=t,s=i.next(e);return e>=Nd?1/0:e}function hme(i,e=100,t){const s=t({...i,keyframes:[0,e]}),r=Math.min(Vv(s),Nd);return{type:"keyframes",ease:n=>s.next(r*n).value/e,duration:Ki(r)}}const Wt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Sv(i,e){return i*Math.sqrt(1-e*e)}const cme=12;function dme(i,e,t){let s=t;for(let r=1;r<cme;r++)s=s-i(s)/e(s);return s}const Tv=.001;function pme({duration:i=Wt.duration,bounce:e=Wt.bounce,velocity:t=Wt.velocity,mass:s=Wt.mass}){let r,n;qo(i<=gi(Wt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=Nr(Wt.minDamping,Wt.maxDamping,a),i=Nr(Wt.minDuration,Wt.maxDuration,Ki(i)),a<1?(r=u=>{const h=u*a,c=h*i,d=h-t,f=Sv(u,a),y=Math.exp(-c);return Tv-d/f*y},n=u=>{const c=u*a*i,d=c*t+t,f=Math.pow(a,2)*Math.pow(u,2)*i,y=Math.exp(-c),v=Sv(Math.pow(u,2),a);return(-r(u)+Tv>0?-1:1)*((d-f)*y)/v}):(r=u=>{const h=Math.exp(-u*i),c=(u-t)*i+1;return-Tv+h*c},n=u=>{const h=Math.exp(-u*i),c=(t-u)*(i*i);return h*c});const o=5/i,l=dme(r,n,o);if(i=gi(i),isNaN(l))return{stiffness:Wt.stiffness,damping:Wt.damping,duration:i};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:a*2*Math.sqrt(s*u),duration:i}}}const fme=["duration","bounce"],mme=["stiffness","damping","mass"];function S3(i,e){return e.some(t=>i[t]!==void 0)}function gme(i){let e={velocity:Wt.velocity,stiffness:Wt.stiffness,damping:Wt.damping,mass:Wt.mass,isResolvedFromDuration:!1,...i};if(!S3(i,mme)&&S3(i,fme))if(e.velocity=0,i.visualDuration){const t=i.visualDuration,s=2*Math.PI/(t*1.2),r=s*s,n=2*Nr(.05,1,1-(i.bounce||0))*Math.sqrt(r);e={...e,mass:Wt.mass,stiffness:r,damping:n}}else{const t=pme({...i,velocity:0});e={...e,...t,mass:Wt.mass},e.isResolvedFromDuration=!0}return e}function Fd(i=Wt.visualDuration,e=Wt.bounce){const t=typeof i!="object"?{visualDuration:i,keyframes:[0,1],bounce:e}:i;let{restSpeed:s,restDelta:r}=t;const n=t.keyframes[0],a=t.keyframes[t.keyframes.length-1],o={done:!1,value:n},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:f}=gme({...t,velocity:-Ki(t.velocity||0)}),y=d||0,v=u/(2*Math.sqrt(l*h)),m=a-n,g=Ki(Math.sqrt(l/h)),b=Math.abs(m)<5;s||(s=b?Wt.restSpeed.granular:Wt.restSpeed.default),r||(r=b?Wt.restDelta.granular:Wt.restDelta.default);let x,I,L,A,k,P;if(v<1)L=Sv(g,v),A=(y+v*g*m)/L,x=D=>{const $=Math.exp(-v*g*D);return a-$*(A*Math.sin(L*D)+m*Math.cos(L*D))},k=v*g*A+m*L,P=v*g*m-A*L,I=D=>Math.exp(-v*g*D)*(k*Math.sin(L*D)+P*Math.cos(L*D));else if(v===1){x=$=>a-Math.exp(-g*$)*(m+(y+g*m)*$);const D=y+g*m;I=$=>Math.exp(-g*$)*(g*D*$-y)}else{const D=g*Math.sqrt(v*v-1);x=B=>{const H=Math.exp(-v*g*B),U=Math.min(D*B,300);return a-H*((y+v*g*m)*Math.sinh(U)+D*m*Math.cosh(U))/D};const $=(y+v*g*m)/D,Q=v*g*$-m*D,_=v*g*m-$*D;I=B=>{const H=Math.exp(-v*g*B),U=Math.min(D*B,300);return H*(Q*Math.sinh(U)+_*Math.cosh(U))}}const O={calculatedDuration:f&&c||null,velocity:D=>gi(I(D)),next:D=>{if(!f&&v<1){const Q=Math.exp(-v*g*D),_=Math.sin(L*D),B=Math.cos(L*D),H=a-Q*(A*_+m*B),U=gi(Q*(k*_+P*B));return o.done=Math.abs(U)<=s&&Math.abs(a-H)<=r,o.value=o.done?a:H,o}const $=x(D);if(f)o.done=D>=c;else{const Q=gi(I(D));o.done=Math.abs(Q)<=s&&Math.abs(a-$)<=r}return o.value=o.done?a:$,o},toString:()=>{const D=Math.min(Vv(O),Nd),$=V3(Q=>O.next(D*Q).value,D,30);return D+"ms "+$},toTransition:()=>{}};return O}Fd.applyToOptions=i=>{const e=hme(i,100,Fd);return i.ease=e.ease,i.duration=gi(e.duration),i.type="keyframes",i};const vme=5;function T3(i,e,t){const s=Math.max(e-vme,0);return ZS(t-i(s),e-s)}function Pv({keyframes:i,velocity:e=0,power:t=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=i[0],d={done:!1,value:c},f=P=>o!==void 0&&P<o||l!==void 0&&P>l,y=P=>o===void 0?l:l===void 0||Math.abs(o-P)<Math.abs(l-P)?o:l;let v=t*e;const m=c+v,g=a===void 0?m:a(m);g!==m&&(v=g-c);const b=P=>-v*Math.exp(-P/s),x=P=>g+b(P),I=P=>{const O=b(P),D=x(P);d.done=Math.abs(O)<=u,d.value=d.done?g:D};let L,A;const k=P=>{f(d.value)&&(L=P,A=Fd({keyframes:[d.value,y(d.value)],velocity:T3(x,P,d.value),damping:r,stiffness:n,restDelta:u,restSpeed:h}))};return k(0),{calculatedDuration:null,next:P=>{let O=!1;return!A&&L===void 0&&(O=!0,I(P),k(P)),L!==void 0&&P>=L?A.next(P-L):(!O&&I(P),d)}}}function yme(i,e,t){const s=[],r=t||Jn.mix||E3,n=i.length-1;for(let a=0;a<n;a++){let o=r(i[a],i[a+1]);if(e){const l=Array.isArray(e)?e[a]||Gi:e;o=Vu(l,o)}s.push(o)}return s}function Cme(i,e,{clamp:t=!0,ease:s,mixer:r}={}){const n=i.length;if(pn(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return()=>e[0];if(n===2&&e[0]===e[1])return()=>e[1];const a=i[0]===i[1];i[0]>i[n-1]&&(i=[...i].reverse(),e=[...e].reverse());const o=yme(e,s,r),l=o.length,u=h=>{if(a&&h<i[0])return e[0];let c=0;if(l>1)for(;c<i.length-2&&!(h<i[c+1]);c++);const d=Su(i[c],i[c+1],h);return o[c](d)};return t?h=>u(Nr(i[0],i[n-1],h)):u}function bme(i,e){const t=i[i.length-1];for(let s=1;s<=e;s++){const r=Su(0,e,s);i.push(Bt(t,1,r))}}function wme(i){const e=[0];return bme(e,i.length-1),e}function xme(i,e){return i.map(t=>t*e)}function Eme(i,e){return i.map(()=>e||a3).splice(0,i.length-1)}function Qo({duration:i=300,keyframes:e,times:t,ease:s="easeInOut"}){const r=_fe(s)?s.map(u3):u3(s),n={done:!1,value:e[0]},a=xme(t&&t.length===e.length?t:wme(e),i),o=Cme(a,e,{ease:Array.isArray(r)?r:Eme(e,r)});return{calculatedDuration:i,next:l=>(n.value=o(l),n.done=l>=i,n)}}const Vme=i=>i!==null;function qd(i,{repeat:e,repeatType:t="loop"},s,r=1){const n=i.filter(Vme),o=r<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return!o||s===void 0?n[o]:s}const Sme={decay:Pv,inertia:Pv,tween:Qo,keyframes:Qo,spring:Fd};function P3(i){typeof i.type=="string"&&(i.type=Sme[i.type])}class Iv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Tme=i=>i/100;class Bd extends Iv{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,r;const{motionValue:t}=this.options;t&&t.updatedAt!==ei.now()&&this.tick(ei.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;P3(e);const{type:t=Qo,repeat:s=0,repeatDelay:r=0,repeatType:n,velocity:a=0}=e;let{keyframes:o}=e;const l=t||Qo;process.env.NODE_ENV!=="production"&&l!==Qo&&pn(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,"spring-two-frames"),l!==Qo&&typeof o[0]!="number"&&(this.mixKeyframes=Vu(Tme,E3(o[0],o[1])),o=[0,100]);const u=l({...e,keyframes:o});n==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=Vv(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:s,totalDuration:r,mixKeyframes:n,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:f,type:y,onUpdate:v,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,I=s;if(c){const P=Math.min(this.currentTime,r)/o;let O=Math.floor(P),D=P%1;!D&&P>=1&&(D=1),D===1&&O--,O=Math.min(O,c+1),!!(O%2)&&(d==="reverse"?(D=1-D,f&&(D-=f/o)):d==="mirror"&&(I=a)),x=Nr(0,1,D)*o}let L;b?(this.delayState.value=h[0],L=this.delayState):L=I.next(x),n&&!b&&(L.value=n(L.value));let{done:A}=L;!b&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return k&&y!==Pv&&(L.value=qd(h,this.options,m,this.speed)),v&&v(L.value),k&&this.finish(),L}then(e,t){return this.finished.then(e,t)}get duration(){return Ki(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(this.currentTime)}set time(e){e=gi(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return T3(s=>this.generator.next(s).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ei.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Ki(this.currentTime))}play(){var r,n;if(this.isStopped)return;const{driver:e=ume,startTime:t}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(n=(r=this.options).onPlay)==null||n.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ei.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",(t=(e=this.options).onComplete)==null||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(t=(e=this.options).onCancel)==null||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(t=this.driver)==null||t.stop(),e.observe(this)}}function Pme(i){for(let e=1;e<i.length;e++)i[e]??(i[e]=i[e-1])}const Oa=i=>i*180/Math.PI,Rv=i=>{const e=Oa(Math.atan2(i[1],i[0]));return Av(e)},Ime={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:i=>(Math.abs(i[0])+Math.abs(i[3]))/2,rotate:Rv,rotateZ:Rv,skewX:i=>Oa(Math.atan(i[1])),skewY:i=>Oa(Math.atan(i[2])),skew:i=>(Math.abs(i[1])+Math.abs(i[2]))/2},Av=i=>(i=i%360,i<0&&(i+=360),i),I3=Rv,R3=i=>Math.sqrt(i[0]*i[0]+i[1]*i[1]),A3=i=>Math.sqrt(i[4]*i[4]+i[5]*i[5]),Rme={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:R3,scaleY:A3,scale:i=>(R3(i)+A3(i))/2,rotateX:i=>Av(Oa(Math.atan2(i[6],i[5]))),rotateY:i=>Av(Oa(Math.atan2(-i[2],i[0]))),rotateZ:I3,rotate:I3,skewX:i=>Oa(Math.atan(i[4])),skewY:i=>Oa(Math.atan(i[1])),skew:i=>(Math.abs(i[1])+Math.abs(i[4]))/2};function Lv(i){return i.includes("scale")?1:0}function _v(i,e){if(!i||i==="none")return Lv(e);const t=i.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(t)s=Rme,r=t;else{const o=i.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ime,r=o}if(!r)return Lv(e);const n=s[e],a=r[1].split(",").map(Lme);return typeof n=="function"?n(a):a[n]}const Ame=(i,e)=>{const{transform:t="none"}=getComputedStyle(i);return _v(t,e)};function Lme(i){return parseFloat(i.trim())}const Uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jo=new Set(Uo),L3=i=>i===Bo||i===Ee,_me=new Set(["x","y","z"]),Dme=Uo.filter(i=>!_me.has(i));function kme(i){const e=[];return Dme.forEach(t=>{const s=i.getValue(t);s!==void 0&&(e.push([t,s.get()]),s.set(t.startsWith("scale")?1:0))}),e}const ea={width:({x:i},{paddingLeft:e="0",paddingRight:t="0",boxSizing:s})=>{const r=i.max-i.min;return s==="border-box"?r:r-parseFloat(e)-parseFloat(t)},height:({y:i},{paddingTop:e="0",paddingBottom:t="0",boxSizing:s})=>{const r=i.max-i.min;return s==="border-box"?r:r-parseFloat(e)-parseFloat(t)},top:(i,{top:e})=>parseFloat(e),left:(i,{left:e})=>parseFloat(e),bottom:({y:i},{top:e})=>parseFloat(e)+(i.max-i.min),right:({x:i},{left:e})=>parseFloat(e)+(i.max-i.min),x:(i,{transform:e})=>_v(e,"x"),y:(i,{transform:e})=>_v(e,"y")};ea.translateX=ea.x,ea.translateY=ea.y;const Ma=new Set;let Dv=!1,kv=!1,Ov=!1;function _3(){if(kv){const i=Array.from(Ma).filter(s=>s.needsMeasurement),e=new Set(i.map(s=>s.element)),t=new Map;e.forEach(s=>{const r=kme(s);r.length&&(t.set(s,r),s.render())}),i.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const r=t.get(s);r&&r.forEach(([n,a])=>{var o;(o=s.getValue(n))==null||o.set(a)})}),i.forEach(s=>s.measureEndState()),i.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}kv=!1,Dv=!1,Ma.forEach(i=>i.complete(Ov)),Ma.clear()}function D3(){Ma.forEach(i=>{i.readKeyframes(),i.needsMeasurement&&(kv=!0)})}function Ome(){Ov=!0,D3(),_3(),Ov=!1}class Mv{constructor(e,t,s,r,n,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=r,this.element=n,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ma.add(this),Dv||(Dv=!0,Pt.read(D3),Pt.resolveKeyframes(_3))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:s,motionValue:r}=this;if(e[0]===null){const n=r==null?void 0:r.get(),a=e[e.length-1];if(n!==void 0)e[0]=n;else if(s&&t){const o=s.readValue(t,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),r&&n===void 0&&r.set(e[0])}Pme(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ma.delete(this)}cancel(){this.state==="scheduled"&&(Ma.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Mme=i=>i.startsWith("--");function k3(i,e,t){Mme(e)?i.style.setProperty(e,t):i.style[e]=t}const Nme={};function O3(i,e){const t=KS(i);return()=>Nme[e]??t()}const Fme=O3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),M3=O3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Au=([i,e,t,s])=>`cubic-bezier(${i}, ${e}, ${t}, ${s})`,N3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Au([0,.65,.55,1]),circOut:Au([.55,0,1,.45]),backIn:Au([.31,.01,.66,-.59]),backOut:Au([.33,1.53,.69,.99])};function F3(i,e){if(i)return typeof i=="function"?M3()?V3(i,e):"ease-out":o3(i)?Au(i):Array.isArray(i)?i.map(t=>F3(t,e)||N3.easeOut):N3[i]}function qme(i,e,t,{delay:s=0,duration:r=300,repeat:n=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:t};l&&(h.offset=l);const c=F3(o,r);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:n+1,direction:a==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),i.animate(h,d)}function q3(i){return typeof i=="function"&&"applyToOptions"in i}function Bme({type:i,...e}){return q3(i)&&M3()?i.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class B3 extends Iv{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:r,pseudoElement:n,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!n,this.allowFlatten=a,this.options=e,pn(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Bme(e);this.animation=qme(t,s,r,u,n),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){const h=qd(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(h),k3(t,s,h),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;(t=(e=this.animation).finish)==null||t.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,s,r;const e=(t=this.options)==null?void 0:t.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var t,s;const e=((s=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:s.call(t).duration)||0;return Ki(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ki(e)}get time(){return Ki(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gi(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:s,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Fme()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),s&&(this.animation.rangeEnd=s),Gi):r(this)}}const $3={anticipate:i3,backInOut:s3,circInOut:n3};function $me(i){return i in $3}function Hme(i){typeof i.ease=="string"&&$me(i.ease)&&(i.ease=$3[i.ease])}const Nv=10;class Qme extends B3{constructor(e){Hme(e),P3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:s,onComplete:r,element:n,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const o=new Bd({...a,autoplay:!1}),l=Math.max(Nv,ei.now()-this.startTime),u=Nr(0,Nv,l-Nv),h=o.sample(l).value,{name:c}=this.options;n&&c&&k3(n,c,h),t.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const H3=(i,e)=>e==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(fr.test(i)||i==="0")&&!i.startsWith("url("));function Ume(i){const e=i[0];if(i.length===1)return!0;for(let t=0;t<i.length;t++)if(i[t]!==e)return!0}function jme(i,e,t,s){const r=i[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const n=i[i.length-1],a=H3(r,e),o=H3(n,e);return qo(a===o,`You are trying to animate ${e} from "${r}" to "${n}". "${a?n:r}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:Ume(i)||(t==="spring"||q3(t))&&s}function Fv(i){i.duration=0,i.type="keyframes"}const Q3=new Set(["opacity","clipPath","filter","transform"]),zme=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Wme(i){for(let e=0;e<i.length;e++)if(typeof i[e]=="string"&&zme.test(i[e]))return!0;return!1}const Gme=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Kme=KS(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Zme(i){var c;const{motionValue:e,name:t,repeatDelay:s,repeatType:r,damping:n,type:a,keyframes:o}=i;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:h}=e.owner.getProps();return Kme()&&t&&(Q3.has(t)||Gme.has(t)&&Wme(o))&&(t!=="transform"||!h)&&!u&&!s&&r!=="mirror"&&n!==0&&a!=="inertia"}const Jme=40;class Yme extends Iv{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:a="loop",keyframes:o,name:l,motionValue:u,element:h,...c}){var y;super(),this.stop=()=>{var v,m;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=ei.now();const d={autoplay:e,delay:t,type:s,repeat:r,repeatDelay:n,repeatType:a,name:l,motionValue:u,element:h,...c},f=(h==null?void 0:h.KeyframeResolver)||Mv;this.keyframeResolver=new f(o,(v,m,g)=>this.onKeyframesResolved(v,m,d,!g),l,u,h),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,t,s,r){var g,b;this.keyframeResolver=void 0;const{name:n,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:h}=s;this.resolvedAt=ei.now();let c=!0;jme(e,n,a,o)||(c=!1,(Jn.instantAnimations||!l)&&(h==null||h(qd(e,s,t))),e[0]=e[e.length-1],Fv(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Jme?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},y=c&&!u&&Zme(f),v=(b=(g=f.motionValue)==null?void 0:g.owner)==null?void 0:b.current;let m;if(y)try{m=new Qme({...f,element:v})}catch{m=new Bd(f)}else m=new Bd(f);m.finished.then(()=>{this.notifyFinished()}).catch(Gi),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ome()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function U3(i,e,t,s=0,r=1){const n=Array.from(i).sort((u,h)=>u.sortNodePosition(h)).indexOf(e),a=i.size,o=(a-1)*s;return typeof t=="function"?t(n,a):r===1?n*s:o-n*s}const Xme=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ege(i){const e=Xme.exec(i);if(!e)return[,];const[,t,s,r]=e;return[`--${t??s}`,r]}const tge=4;function j3(i,e,t=1){pn(t<=tge,`Max CSS variable fallback depth detected in property "${i}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=ege(i);if(!s)return;const n=window.getComputedStyle(e).getPropertyValue(s);if(n){const a=n.trim();return zS(a)?parseFloat(a):a}return mv(r)?j3(r,e,t+1):r}const sge={type:"spring",stiffness:500,damping:25,restSpeed:10},ige=i=>({type:"spring",stiffness:550,damping:i===0?2*Math.sqrt(550):30,restSpeed:10}),rge={type:"keyframes",duration:.8},nge={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},age=(i,{keyframes:e})=>e.length>2?rge:jo.has(i)?i.startsWith("scale")?ige(e[1]):sge:nge;function z3(i,e){if(i!=null&&i.inherit&&e){const{inherit:t,...s}=i;return{...e,...s}}return i}function qv(i,e){const t=(i==null?void 0:i[e])??(i==null?void 0:i.default)??i;return t!==i?z3(t,i):t}const oge=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function lge(i){for(const e in i)if(!oge.has(e))return!0;return!1}const Bv=(i,e,t,s={},r,n)=>a=>{const o=qv(s,i)||{},l=o.delay||s.delay||0;let{elapsed:u=0}=s;u=u-gi(l);const h={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:d=>{e.set(d),o.onUpdate&&o.onUpdate(d)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:i,motionValue:e,element:n?void 0:r};lge(o)||Object.assign(h,age(i,h)),h.duration&&(h.duration=gi(h.duration)),h.repeatDelay&&(h.repeatDelay=gi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let c=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Fv(h),h.delay===0&&(c=!0)),(Jn.instantAnimations||Jn.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(c=!0,Fv(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,c&&!n&&e.get()!==void 0){const d=qd(h.keyframes,o);if(d!==void 0){Pt.update(()=>{h.onUpdate(d),h.onComplete()});return}}return o.isSync?new Bd(h):new Yme(h)};function W3(i){const e=[{},{}];return i==null||i.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function $v(i,e,t,s){if(typeof e=="function"){const[r,n]=W3(s);e=e(t!==void 0?t:i.custom,r,n)}if(typeof e=="string"&&(e=i.variants&&i.variants[e]),typeof e=="function"){const[r,n]=W3(s);e=e(t!==void 0?t:i.custom,r,n)}return e}function Na(i,e,t){const s=i.getProps();return $v(s,e,t!==void 0?t:s.custom,i)}const G3=new Set(["width","height","top","left","right","bottom",...Uo]),K3=30,uge=i=>!isNaN(parseFloat(i));class hge{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var n;const r=ei.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((n=this.events.change)==null||n.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ei.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uge(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&cv(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new hv);const s=this.events[e].add(t);return e==="change"?()=>{s(),Pt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>K3)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,K3);return ZS(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,t;(e=this.dependents)==null||e.clear(),(t=this.events.destroy)==null||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zo(i,e){return new hge(i,e)}const Hv=i=>Array.isArray(i);function cge(i,e,t){i.hasValue(e)?i.getValue(e).set(t):i.addValue(e,zo(t))}function dge(i){return Hv(i)?i[i.length-1]||0:i}function pge(i,e){const t=Na(i,e);let{transitionEnd:s={},transition:r={},...n}=t||{};n={...n,...s};for(const a in n){const o=dge(n[a]);cge(i,a,o)}}const Ns=i=>!!(i&&i.getVelocity);function fge(i){return!!(Ns(i)&&i.add)}function Qv(i,e){const t=i.getValue("willChange");if(fge(t))return t.add(e);if(!t&&Jn.WillChange){const s=new Jn.WillChange("auto");i.addValue("willChange",s),s.add(e)}}function Uv(i){return i.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Z3="data-"+Uv("framerAppearId");function J3(i){return i.props[Z3]}function mge({protectedKeys:i,needsAnimating:e},t){const s=i.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,s}function Y3(i,e,{delay:t=0,transitionOverride:s,type:r}={}){let{transition:n,transitionEnd:a,...o}=e;const l=i.getDefaultTransition();n=n?z3(n,l):l;const u=n==null?void 0:n.reduceMotion;s&&(n=s);const h=[],c=r&&i.animationState&&i.animationState.getState()[r];for(const d in o){const f=i.getValue(d,i.latestValues[d]??null),y=o[d];if(y===void 0||c&&mge(c,d))continue;const v={delay:t,...qv(n||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating()&&!Array.isArray(y)&&y===m&&!v.velocity){Pt.update(()=>f.set(y));continue}let g=!1;if(window.MotionHandoffAnimation){const I=J3(i);if(I){const L=window.MotionHandoffAnimation(I,d,Pt);L!==null&&(v.startTime=L,g=!0)}}Qv(i,d);const b=u??i.shouldReduceMotion;f.start(Bv(d,f,y,b&&G3.has(d)?{type:!1}:v,i,g));const x=f.animation;x&&h.push(x)}if(a){const d=()=>Pt.update(()=>{a&&pge(i,a)});h.length?Promise.all(h).then(d):d()}return h}function jv(i,e,t={}){var l;const s=Na(i,e,t.type==="exit"?(l=i.presenceContext)==null?void 0:l.custom:void 0);let{transition:r=i.getDefaultTransition()||{}}=s||{};t.transitionOverride&&(r=t.transitionOverride);const n=s?()=>Promise.all(Y3(i,s,t)):()=>Promise.resolve(),a=i.variantChildren&&i.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:c,staggerDirection:d}=r;return gge(i,e,u,h,c,d,t)}:()=>Promise.resolve(),{when:o}=r;if(o){const[u,h]=o==="beforeChildren"?[n,a]:[a,n];return u().then(()=>h())}else return Promise.all([n(),a(t.delay)])}function gge(i,e,t=0,s=0,r=0,n=1,a){const o=[];for(const l of i.variantChildren)l.notify("AnimationStart",e),o.push(jv(l,e,{...a,delay:t+(typeof s=="function"?0:s)+U3(i.variantChildren,l,s,r,n)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function vge(i,e,t={}){i.notify("AnimationStart",e);let s;if(Array.isArray(e)){const r=e.map(n=>jv(i,n,t));s=Promise.all(r)}else if(typeof e=="string")s=jv(i,e,t);else{const r=typeof e=="function"?Na(i,e,t.custom):e;s=Promise.all(Y3(i,r,t))}return s.then(()=>{i.notify("AnimationComplete",e)})}const yge={test:i=>i==="auto",parse:i=>i},X3=i=>e=>e.test(i),e7=[Bo,Ee,Fr,Xn,Ufe,Qfe,yge],t7=i=>e7.find(X3(i));function Cge(i){return typeof i=="number"?i===0:i!==null?i==="none"||i==="0"||GS(i):!0}const bge=new Set(["brightness","contrast","saturate","opacity"]);function wge(i){const[e,t]=i.slice(0,-1).split("(");if(e==="drop-shadow")return i;const[s]=t.match(gv)||[];if(!s)return i;const r=t.replace(s,"");let n=bge.has(e)?1:0;return s!==t&&(n*=100),e+"("+n+r+")"}const xge=/\b([a-z-]*)\(.*?\)/gu,zv={...fr,getAnimatableNone:i=>{const e=i.match(xge);return e?e.map(wge).join(" "):i}},Wv={...fr,getAnimatableNone:i=>{const e=fr.parse(i);return fr.createTransformer(i)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},s7={...Bo,transform:Math.round},Gv={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,inset:Ee,insetBlock:Ee,insetBlockStart:Ee,insetBlockEnd:Ee,insetInline:Ee,insetInlineStart:Ee,insetInlineEnd:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,paddingBlock:Ee,paddingBlockStart:Ee,paddingBlockEnd:Ee,paddingInline:Ee,paddingInlineStart:Ee,paddingInlineEnd:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,marginBlock:Ee,marginBlockStart:Ee,marginBlockEnd:Ee,marginInline:Ee,marginInlineStart:Ee,marginInlineEnd:Ee,fontSize:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee,...{rotate:Xn,rotateX:Xn,rotateY:Xn,rotateZ:Xn,scale:Od,scaleX:Od,scaleY:Od,scaleZ:Od,skew:Xn,skewX:Xn,skewY:Xn,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Pu,originX:m3,originY:m3,originZ:Ee},zIndex:s7,fillOpacity:Pu,strokeOpacity:Pu,numOctaves:s7},Ege={...Gv,color:fs,backgroundColor:fs,outlineColor:fs,fill:fs,stroke:fs,borderColor:fs,borderTopColor:fs,borderRightColor:fs,borderBottomColor:fs,borderLeftColor:fs,filter:zv,WebkitFilter:zv,mask:Wv,WebkitMask:Wv},i7=i=>Ege[i],Vge=new Set([zv,Wv]);function r7(i,e){let t=i7(i);return Vge.has(t)||(t=fr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const Sge=new Set(["auto","none","0"]);function Tge(i,e,t){let s=0,r;for(;s<i.length&&!r;){const n=i[s];typeof n=="string"&&!Sge.has(n)&&Ho(n).values.length&&(r=i[s]),s++}if(r&&t)for(const n of e)i[n]=r7(t,r)}class Pge extends Mv{constructor(e,t,s,r,n){super(e,t,s,r,n,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let c=e[h];if(typeof c=="string"&&(c=c.trim(),mv(c))){const d=j3(c,t.current);d!==void 0&&(e[h]=d),h===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!G3.has(s)||e.length!==2)return;const[r,n]=e,a=t7(r),o=t7(n),l=p3(r),u=p3(n);if(l!==u&&ea[s]){this.needsMeasurement=!0;return}if(a!==o)if(L3(a)&&L3(o))for(let h=0;h<e.length;h++){const c=e[h];typeof c=="string"&&(e[h]=parseFloat(c))}else ea[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,s=[];for(let r=0;r<e.length;r++)(e[r]===null||Cge(e[r]))&&s.push(r);s.length&&Tge(e,s,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ea[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(s,r).jump(r,!1)}measureEndState(){var o;const{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const n=s.length-1,a=s[n];s[n]=ea[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function n7(i,e,t){if(i==null)return[];if(i instanceof EventTarget)return[i];if(typeof i=="string"){let s=document;const r=(t==null?void 0:t[i])??s.querySelectorAll(i);return r?Array.from(r):[]}return Array.from(i).filter(s=>s!=null)}const a7=(i,e)=>e&&typeof i=="number"?e.transform(i):i;function $d(i){return WS(i)&&"offsetHeight"in i&&!("ownerSVGElement"in i)}const{schedule:Kv}=h3(queueMicrotask,!1),mr={x:!1,y:!1};function o7(){return mr.x||mr.y}function Ige(i){return i==="x"||i==="y"?mr[i]?null:(mr[i]=!0,()=>{mr[i]=!1}):mr.x||mr.y?null:(mr.x=mr.y=!0,()=>{mr.x=mr.y=!1})}function l7(i,e){const t=n7(i),s=new AbortController,r={passive:!0,...e,signal:s.signal};return[t,r,()=>s.abort()]}function Rge(i){return!(i.pointerType==="touch"||o7())}function Age(i,e,t={}){const[s,r,n]=l7(i,t);return s.forEach(a=>{let o=!1,l=!1,u;const h=()=>{a.removeEventListener("pointerleave",y)},c=m=>{u&&(u(m),u=void 0),h()},d=m=>{o=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,c(m))},f=()=>{o=!0,window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",d,r)},y=m=>{if(m.pointerType!=="touch"){if(o){l=!0;return}c(m)}},v=m=>{if(!Rge(m))return;l=!1;const g=e(a,m);typeof g=="function"&&(u=g,a.addEventListener("pointerleave",y,r))};a.addEventListener("pointerenter",v,r),a.addEventListener("pointerdown",f,r)}),n}const u7=(i,e)=>e?i===e?!0:u7(i,e.parentElement):!1,Zv=i=>i.pointerType==="mouse"?typeof i.button!="number"||i.button<=0:i.isPrimary!==!1,Lge=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _ge(i){return Lge.has(i.tagName)||i.isContentEditable===!0}const Dge=new Set(["INPUT","SELECT","TEXTAREA"]);function kge(i){return Dge.has(i.tagName)||i.isContentEditable===!0}const Hd=new WeakSet;function h7(i){return e=>{e.key==="Enter"&&i(e)}}function Jv(i,e){i.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Oge=(i,e)=>{const t=i.currentTarget;if(!t)return;const s=h7(()=>{if(Hd.has(t))return;Jv(t,"down");const r=h7(()=>{Jv(t,"up")}),n=()=>Jv(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",n,e)});t.addEventListener("keydown",s,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",s),e)};function c7(i){return Zv(i)&&!o7()}const d7=new WeakSet;function Mge(i,e,t={}){const[s,r,n]=l7(i,t),a=o=>{const l=o.currentTarget;if(!c7(o)||d7.has(o))return;Hd.add(l),t.stopPropagation&&d7.add(o);const u=e(l,o),h=(f,y)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",d),Hd.has(l)&&Hd.delete(l),c7(f)&&typeof u=="function"&&u(f,{success:y})},c=f=>{h(f,l===window||l===document||t.useGlobalTarget||u7(l,f.target))},d=f=>{h(f,!1)};window.addEventListener("pointerup",c,r),window.addEventListener("pointercancel",d,r)};return s.forEach(o=>{(t.useGlobalTarget?window:o).addEventListener("pointerdown",a,r),$d(o)&&(o.addEventListener("focus",u=>Oge(u,r)),!_ge(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),n}function Yv(i){return WS(i)&&"ownerSVGElement"in i}const Qd=new WeakMap;let ta;const p7=(i,e,t)=>(s,r)=>r&&r[0]?r[0][i+"Size"]:Yv(s)&&"getBBox"in s?s.getBBox()[e]:s[t],Nge=p7("inline","width","offsetWidth"),Fge=p7("block","height","offsetHeight");function qge({target:i,borderBoxSize:e}){var t;(t=Qd.get(i))==null||t.forEach(s=>{s(i,{get width(){return Nge(i,e)},get height(){return Fge(i,e)}})})}function Bge(i){i.forEach(qge)}function $ge(){typeof ResizeObserver>"u"||(ta=new ResizeObserver(Bge))}function Hge(i,e){ta||$ge();const t=n7(i);return t.forEach(s=>{let r=Qd.get(s);r||(r=new Set,Qd.set(s,r)),r.add(e),ta==null||ta.observe(s)}),()=>{t.forEach(s=>{const r=Qd.get(s);r==null||r.delete(e),r!=null&&r.size||ta==null||ta.unobserve(s)})}}const Ud=new Set;let Wo;function Qge(){Wo=()=>{const i={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ud.forEach(e=>e(i))},window.addEventListener("resize",Wo)}function Uge(i){return Ud.add(i),Wo||Qge(),()=>{Ud.delete(i),!Ud.size&&typeof Wo=="function"&&(window.removeEventListener("resize",Wo),Wo=void 0)}}function f7(i,e){return typeof i=="function"?Uge(i):Hge(i,e)}function jge(i){return Yv(i)&&i.tagName==="svg"}const zge=[...e7,fs,fr],Wge=i=>zge.find(X3(i)),m7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Go=()=>({x:m7(),y:m7()}),g7=()=>({min:0,max:0}),bs=()=>({x:g7(),y:g7()}),Gge=new WeakMap;function jd(i){return i!==null&&typeof i=="object"&&typeof i.start=="function"}function Lu(i){return typeof i=="string"||Array.isArray(i)}const Xv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],e0=["initial",...Xv];function zd(i){return jd(i.animate)||e0.some(e=>Lu(i[e]))}function v7(i){return!!(zd(i)||i.variants)}function Kge(i,e,t){for(const s in e){const r=e[s],n=t[s];if(Ns(r))i.addValue(s,r);else if(Ns(n))i.addValue(s,zo(r,{owner:i}));else if(n!==r)if(i.hasValue(s)){const a=i.getValue(s);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=i.getStaticValue(s);i.addValue(s,zo(a!==void 0?a:r,{owner:i}))}}for(const s in t)e[s]===void 0&&i.removeValue(s);return e}const t0={current:null},y7={current:!1},Zge=typeof window<"u";function Jge(){if(y7.current=!0,!!Zge)if(window.matchMedia){const i=window.matchMedia("(prefers-reduced-motion)"),e=()=>t0.current=i.matches;i.addEventListener("change",e),e()}else t0.current=!1}const C7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wd={};function b7(i){Wd=i}function Yge(){return Wd}class Xge{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:r,skipAnimations:n,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Mv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=ei.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Pt.render(this.render,!1,!0))};const{latestValues:u,renderState:h}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=h,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=n,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=zd(t),this.isVariantNode=v7(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in d){const y=d[f];u[f]!==void 0&&Ns(y)&&y.set(u[f])}}mount(e){var t,s;if(this.hasBeenMounted)for(const r in this.initialValues)(t=this.values.get(r))==null||t.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,Gge.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(y7.current||Jge(),this.shouldReduceMotion=t0.current),process.env.NODE_ENV!=="production"&&cv(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Yn(this.notifyUpdate),Yn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Q3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:u,duration:h}=t.accelerate,c=new B3({element:this.current,name:e,keyframes:o,times:l,ease:u,duration:gi(h)}),d=a(c);this.valueSubscriptions.set(e,()=>{d(),c.cancel()});return}const s=jo.has(e);s&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Pt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let n;typeof window<"u"&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),n&&n(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Wd){const t=Wd[e];if(!t)continue;const{isEnabled:s,Feature:r}=t;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bs()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let s=0;s<C7.length;s++){const r=C7[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n="on"+r,a=e[n];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=Kge(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&t!==void 0&&(s=zo(t===null?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(zS(s)||GS(s))?s=parseFloat(s):!Wge(s)&&fr.test(t)&&(s=r7(e,t)),this.setBaseTarget(e,Ns(s)?s.get():s)),Ns(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var n;const{initial:t}=this.props;let s;if(typeof t=="string"||typeof t=="object"){const a=$v(this.props,t,(n=this.presenceContext)==null?void 0:n.custom);a&&(s=a[e])}if(t&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ns(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new hv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Kv.render(this.render)}}class w7 extends Xge{constructor(){super(...arguments),this.KeyframeResolver=Pge}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ns(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class sa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function x7({top:i,left:e,right:t,bottom:s}){return{x:{min:e,max:t},y:{min:i,max:s}}}function eve({x:i,y:e}){return{top:e.min,right:i.max,bottom:e.max,left:i.min}}function tve(i,e){if(!e)return i;const t=e({x:i.left,y:i.top}),s=e({x:i.right,y:i.bottom});return{top:t.y,left:t.x,bottom:s.y,right:s.x}}function s0(i){return i===void 0||i===1}function i0({scale:i,scaleX:e,scaleY:t}){return!s0(i)||!s0(e)||!s0(t)}function Fa(i){return i0(i)||E7(i)||i.z||i.rotate||i.rotateX||i.rotateY||i.skewX||i.skewY}function E7(i){return V7(i.x)||V7(i.y)}function V7(i){return i&&i!=="0%"}function Gd(i,e,t){const s=i-t,r=e*s;return t+r}function S7(i,e,t,s,r){return r!==void 0&&(i=Gd(i,r,s)),Gd(i,t,s)+e}function r0(i,e=0,t=1,s,r){i.min=S7(i.min,e,t,s,r),i.max=S7(i.max,e,t,s,r)}function T7(i,{x:e,y:t}){r0(i.x,e.translate,e.scale,e.originPoint),r0(i.y,t.translate,t.scale,t.originPoint)}const P7=.999999999999,I7=1.0000000000001;function sve(i,e,t,s=!1){var o;const r=t.length;if(!r)return;e.x=e.y=1;let n,a;for(let l=0;l<r;l++){n=t[l],a=n.projectionDelta;const{visualElement:u}=n.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qr(i.x,-n.scroll.offset.x),qr(i.y,-n.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,T7(i,a)),s&&Fa(n.latestValues)&&Kd(i,n.latestValues,(o=n.layout)==null?void 0:o.layoutBox))}e.x<I7&&e.x>P7&&(e.x=1),e.y<I7&&e.y>P7&&(e.y=1)}function qr(i,e){i.min+=e,i.max+=e}function R7(i,e,t,s,r=.5){const n=Bt(i.min,i.max,r);r0(i,e,t,n,s)}function A7(i,e){return typeof i=="string"?parseFloat(i)/100*(e.max-e.min):i}function Kd(i,e,t){const s=t??i;R7(i.x,A7(e.x,s.x),e.scaleX,e.scale,e.originX),R7(i.y,A7(e.y,s.y),e.scaleY,e.scale,e.originY)}function L7(i,e){return x7(tve(i.getBoundingClientRect(),e))}function ive(i,e,t){const s=L7(i,t),{scroll:r}=e;return r&&(qr(s.x,r.offset.x),qr(s.y,r.offset.y)),s}const rve={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nve=Uo.length;function ave(i,e,t){let s="",r=!0;for(let n=0;n<nve;n++){const a=Uo[n],o=i[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);l=a.startsWith("scale")?u===1:u===0}if(!l||t){const u=a7(o,Gv[a]);if(!l){r=!1;const h=rve[a]||a;s+=`${h}(${u}) `}t&&(e[a]=u)}}return s=s.trim(),t?s=t(e,r?"":s):r&&(s="none"),s}function n0(i,e,t){const{style:s,vars:r,transformOrigin:n}=i;let a=!1,o=!1;for(const l in e){const u=e[l];if(jo.has(l)){a=!0;continue}else if(d3(l)){r[l]=u;continue}else{const h=a7(u,Gv[l]);l.startsWith("origin")?(o=!0,n[l]=h):s[l]=h}}if(e.transform||(a||t?s.transform=ave(e,i.transform,t):s.transform&&(s.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:h=0}=n;s.transformOrigin=`${l} ${u} ${h}`}}function _7(i,{style:e,vars:t},s,r){const n=i.style;let a;for(a in e)n[a]=e[a];r==null||r.applyProjectionStyles(n,s);for(a in t)n.setProperty(a,t[a])}function D7(i,e){return e.max===e.min?0:i/(e.max-e.min)*100}const _u={correct:(i,e)=>{if(!e.target)return i;if(typeof i=="string")if(Ee.test(i))i=parseFloat(i);else return i;const t=D7(i,e.target.x),s=D7(i,e.target.y);return`${t}% ${s}%`}},ove={correct:(i,{treeScale:e,projectionDelta:t})=>{const s=i,r=fr.parse(i);if(r.length>5)return s;const n=fr.createTransformer(i),a=typeof r[0]!="number"?1:0,o=t.x.scale*e.x,l=t.y.scale*e.y;r[0+a]/=o,r[1+a]/=l;const u=Bt(o,l,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),n(r)}},a0={borderRadius:{..._u,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_u,borderTopRightRadius:_u,borderBottomLeftRadius:_u,borderBottomRightRadius:_u,boxShadow:ove};function k7(i,{layout:e,layoutId:t}){return jo.has(i)||i.startsWith("origin")||(e||t!==void 0)&&(!!a0[i]||i==="opacity")}function o0(i,e,t){var a;const s=i.style,r=e==null?void 0:e.style,n={};if(!s)return n;for(const o in s)(Ns(s[o])||r&&Ns(r[o])||k7(o,i)||((a=t==null?void 0:t.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(n[o]=s[o]);return n}function lve(i){return window.getComputedStyle(i)}class uve extends w7{constructor(){super(...arguments),this.type="html",this.renderInstance=_7}readValueFromInstance(e,t){var s;if(jo.has(t))return(s=this.projection)!=null&&s.isProjecting?Lv(t):Ame(e,t);{const r=lve(e),n=(d3(t)?r.getPropertyValue(t):r[t])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return L7(e,t)}build(e,t,s){n0(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return o0(e,t,s)}}const hve={offset:"stroke-dashoffset",array:"stroke-dasharray"},cve={offset:"strokeDashoffset",array:"strokeDasharray"};function dve(i,e,t=1,s=0,r=!0){i.pathLength=1;const n=r?hve:cve;i[n.offset]=`${-s}`,i[n.array]=`${e} ${t}`}const pve=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function O7(i,{attrX:e,attrY:t,attrScale:s,pathLength:r,pathSpacing:n=1,pathOffset:a=0,...o},l,u,h){if(n0(i,o,u),l){i.style.viewBox&&(i.attrs.viewBox=i.style.viewBox);return}i.attrs=i.style,i.style={};const{attrs:c,style:d}=i;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete c.transformBox);for(const f of pve)c[f]!==void 0&&(d[f]=c[f],delete c[f]);e!==void 0&&(c.x=e),t!==void 0&&(c.y=t),s!==void 0&&(c.scale=s),r!==void 0&&dve(c,r,n,a,!1)}const M7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),N7=i=>typeof i=="string"&&i.toLowerCase()==="svg";function fve(i,e,t,s){_7(i,e,void 0,s);for(const r in e.attrs)i.setAttribute(M7.has(r)?r:Uv(r),e.attrs[r])}function F7(i,e,t){const s=o0(i,e,t);for(const r in i)if(Ns(i[r])||Ns(e[r])){const n=Uo.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[n]=i[r]}return s}class mve extends w7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bs}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(jo.has(t)){const s=i7(t);return s&&s.default||0}return t=M7.has(t)?t:Uv(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return F7(e,t,s)}build(e,t,s){O7(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,r){fve(e,t,s,r)}mount(e){this.isSVGTag=N7(e.tagName),super.mount(e)}}const gve=e0.length;function q7(i){if(!i)return;if(!i.isControllingVariants){const t=i.parent?q7(i.parent)||{}:{};return i.props.initial!==void 0&&(t.initial=i.props.initial),t}const e={};for(let t=0;t<gve;t++){const s=e0[t],r=i.props[s];(Lu(r)||r===!1)&&(e[s]=r)}return e}function B7(i,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==i.length)return!1;for(let s=0;s<t;s++)if(e[s]!==i[s])return!1;return!0}const vve=[...Xv].reverse(),yve=Xv.length;function Cve(i){return e=>Promise.all(e.map(({animation:t,options:s})=>vge(i,t,s)))}function bve(i){let e=Cve(i),t=$7(),s=!0,r=!1;const n=u=>(h,c)=>{var f;const d=Na(i,c,u==="exit"?(f=i.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:y,transitionEnd:v,...m}=d;h={...h,...m,...v}}return h};function a(u){e=u(i)}function o(u){const{props:h}=i,c=q7(i.parent)||{},d=[],f=new Set;let y={},v=1/0;for(let g=0;g<yve;g++){const b=vve[g],x=t[b],I=h[b]!==void 0?h[b]:c[b],L=Lu(I),A=b===u?x.isActive:null;A===!1&&(v=g);let k=I===c[b]&&I!==h[b]&&L;if(k&&(s||r)&&i.manuallyAnimateOnMount&&(k=!1),x.protectedKeys={...y},!x.isActive&&A===null||!I&&!x.prevProp||jd(I)||typeof I=="boolean")continue;if(b==="exit"&&x.isActive&&A!==!0){x.prevResolvedValues&&(y={...y,...x.prevResolvedValues});continue}const P=wve(x.prevProp,I);let O=P||b===u&&x.isActive&&!k&&L||g>v&&L,D=!1;const $=Array.isArray(I)?I:[I];let Q=$.reduce(n(b),{});A===!1&&(Q={});const{prevResolvedValues:_={}}=x,B={..._,...Q},H=j=>{O=!0,f.has(j)&&(D=!0,f.delete(j)),x.needsAnimating[j]=!0;const ae=i.getValue(j);ae&&(ae.liveStyle=!1)};for(const j in B){const ae=Q[j],X=_[j];if(y.hasOwnProperty(j))continue;let ue=!1;Hv(ae)&&Hv(X)?ue=!B7(ae,X):ue=ae!==X,ue?ae!=null?H(j):f.add(j):ae!==void 0&&f.has(j)?H(j):x.protectedKeys[j]=!0}x.prevProp=I,x.prevResolvedValues=Q,x.isActive&&(y={...y,...Q}),(s||r)&&i.blockInitialAnimation&&(O=!1);const U=k&&P;O&&(!U||D)&&d.push(...$.map(j=>{const ae={type:b};if(typeof j=="string"&&(s||r)&&!U&&i.manuallyAnimateOnMount&&i.parent){const{parent:X}=i,ue=Na(X,j);if(X.enteringChildren&&ue){const{delayChildren:ie}=ue.transition||{};ae.delay=U3(X.enteringChildren,i,ie)}}return{animation:j,options:ae}}))}if(f.size){const g={};if(typeof h.initial!="boolean"){const b=Na(i,Array.isArray(h.initial)?h.initial[0]:h.initial);b&&b.transition&&(g.transition=b.transition)}f.forEach(b=>{const x=i.getBaseTarget(b),I=i.getValue(b);I&&(I.liveStyle=!0),g[b]=x??null}),d.push({animation:g})}let m=!!d.length;return s&&(h.initial===!1||h.initial===h.animate)&&!i.manuallyAnimateOnMount&&(m=!1),s=!1,r=!1,m?e(d):Promise.resolve()}function l(u,h){var d;if(t[u].isActive===h)return Promise.resolve();(d=i.variantChildren)==null||d.forEach(f=>{var y;return(y=f.animationState)==null?void 0:y.setActive(u,h)}),t[u].isActive=h;const c=o(u);for(const f in t)t[f].protectedKeys={};return c}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>t,reset:()=>{t=$7(),r=!0}}}function wve(i,e){return typeof e=="string"?e!==i:Array.isArray(e)?!B7(e,i):!1}function qa(i=!1){return{isActive:i,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $7(){return{animate:qa(!0),whileInView:qa(),whileHover:qa(),whileTap:qa(),whileDrag:qa(),whileFocus:qa(),exit:qa()}}function l0(i,e){i.min=e.min,i.max=e.max}function gr(i,e){l0(i.x,e.x),l0(i.y,e.y)}function H7(i,e){i.translate=e.translate,i.scale=e.scale,i.originPoint=e.originPoint,i.origin=e.origin}const Q7=1e-4,xve=1-Q7,Eve=1+Q7,U7=.01,Vve=0-U7,Sve=0+U7;function ti(i){return i.max-i.min}function Tve(i,e,t){return Math.abs(i-e)<=t}function j7(i,e,t,s=.5){i.origin=s,i.originPoint=Bt(e.min,e.max,i.origin),i.scale=ti(t)/ti(e),i.translate=Bt(t.min,t.max,i.origin)-i.originPoint,(i.scale>=xve&&i.scale<=Eve||isNaN(i.scale))&&(i.scale=1),(i.translate>=Vve&&i.translate<=Sve||isNaN(i.translate))&&(i.translate=0)}function Du(i,e,t,s){j7(i.x,e.x,t.x,s?s.originX:void 0),j7(i.y,e.y,t.y,s?s.originY:void 0)}function z7(i,e,t,s=0){const r=s?Bt(t.min,t.max,s):t.min;i.min=r+e.min,i.max=i.min+ti(e)}function Pve(i,e,t,s){z7(i.x,e.x,t.x,s==null?void 0:s.x),z7(i.y,e.y,t.y,s==null?void 0:s.y)}function W7(i,e,t,s=0){const r=s?Bt(t.min,t.max,s):t.min;i.min=e.min-r,i.max=i.min+ti(e)}function Zd(i,e,t,s){W7(i.x,e.x,t.x,s==null?void 0:s.x),W7(i.y,e.y,t.y,s==null?void 0:s.y)}function G7(i,e,t,s,r){return i-=e,i=Gd(i,1/t,s),r!==void 0&&(i=Gd(i,1/r,s)),i}function Ive(i,e=0,t=1,s=.5,r,n=i,a=i){if(Fr.test(e)&&(e=parseFloat(e),e=Bt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=Bt(n.min,n.max,s);i===n&&(o-=e),i.min=G7(i.min,e,t,o,r),i.max=G7(i.max,e,t,o,r)}function K7(i,e,[t,s,r],n,a){Ive(i,e[t],e[s],e[r],e.scale,n,a)}const Rve=["x","scaleX","originX"],Ave=["y","scaleY","originY"];function Z7(i,e,t,s){K7(i.x,e,Rve,t?t.x:void 0,s?s.x:void 0),K7(i.y,e,Ave,t?t.y:void 0,s?s.y:void 0)}function J7(i){return i.translate===0&&i.scale===1}function Y7(i){return J7(i.x)&&J7(i.y)}function X7(i,e){return i.min===e.min&&i.max===e.max}function Lve(i,e){return X7(i.x,e.x)&&X7(i.y,e.y)}function e4(i,e){return Math.round(i.min)===Math.round(e.min)&&Math.round(i.max)===Math.round(e.max)}function t4(i,e){return e4(i.x,e.x)&&e4(i.y,e.y)}function s4(i){return ti(i.x)/ti(i.y)}function i4(i,e){return i.translate===e.translate&&i.scale===e.scale&&i.originPoint===e.originPoint}function Br(i){return[i("x"),i("y")]}function _ve(i,e,t){let s="";const r=i.x.translate/e.x,n=i.y.translate/e.y,a=(t==null?void 0:t.z)||0;if((r||n||a)&&(s=`translate3d(${r}px, ${n}px, ${a}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:u,rotate:h,rotateX:c,rotateY:d,skewX:f,skewY:y}=t;u&&(s=`perspective(${u}px) ${s}`),h&&(s+=`rotate(${h}deg) `),c&&(s+=`rotateX(${c}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),y&&(s+=`skewY(${y}deg) `)}const o=i.x.scale*e.x,l=i.y.scale*e.y;return(o!==1||l!==1)&&(s+=`scale(${o}, ${l})`),s||"none"}const r4=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Dve=r4.length,n4=i=>typeof i=="string"?parseFloat(i):i,a4=i=>typeof i=="number"||Ee.test(i);function kve(i,e,t,s,r,n){r?(i.opacity=Bt(0,t.opacity??1,Ove(s)),i.opacityExit=Bt(e.opacity??1,0,Mve(s))):n&&(i.opacity=Bt(e.opacity??1,t.opacity??1,s));for(let a=0;a<Dve;a++){const o=r4[a];let l=o4(e,o),u=o4(t,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||a4(l)===a4(u)?(i[o]=Math.max(Bt(n4(l),n4(u),s),0),(Fr.test(u)||Fr.test(l))&&(i[o]+="%")):i[o]=u}(e.rotate||t.rotate)&&(i.rotate=Bt(e.rotate||0,t.rotate||0,s))}function o4(i,e){return i[e]!==void 0?i[e]:i.borderRadius}const Ove=l4(0,.5,r3),Mve=l4(.5,.95,Gi);function l4(i,e,t){return s=>s<i?0:s>e?1:t(Su(i,e,s))}function Nve(i,e,t){const s=Ns(i)?i:zo(i);return s.start(Bv("",s,e,t)),s.animation}function ku(i,e,t,s={passive:!0}){return i.addEventListener(e,t,s),()=>i.removeEventListener(e,t)}const Fve=(i,e)=>i.depth-e.depth;class qve{constructor(){this.children=[],this.isDirty=!1}add(e){lv(this.children,e),this.isDirty=!0}remove(e){_d(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Fve),this.isDirty=!1,this.children.forEach(e)}}function Bve(i,e){const t=ei.now(),s=({timestamp:r})=>{const n=r-t;n>=e&&(Yn(s),i(n-e))};return Pt.setup(s,!0),()=>Yn(s)}function Jd(i){return Ns(i)?i.get():i}class $ve{constructor(){this.members=[]}add(e){lv(this.members,e);for(let t=this.members.length-1;t>=0;t--){const s=this.members[t];if(s===e||s===this.lead||s===this.prevLead)continue;const r=s.instance;(!r||r.isConnected===!1)&&!s.snapshot&&(_d(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(_d(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){var t;for(let s=this.members.indexOf(e)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&((t=r.instance)==null?void 0:t.isConnected)!==!1)return this.promote(r),!0}return!1}promote(e,t){var r;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:n}=s.options,{layoutDependency:a}=e.options;(n===void 0||n!==a)&&(e.resumeFrom=s,t&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(r=e.root)!=null&&r.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,s,r,n,a;(s=(t=e.options).onExitComplete)==null||s.call(t),(a=(r=e.resumingFrom)==null?void 0:(n=r.options).onExitComplete)==null||a.call(n)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Yd={hasAnimatedSinceResize:!0,hasEverUpdated:!1},u0=["","X","Y","Z"],Hve=1e3;let Qve=0;function h0(i,e,t,s){const{latestValues:r}=e;r[i]&&(t[i]=r[i],e.setStaticValue(i,0),s&&(s[i]=0))}function u4(i){if(i.hasCheckedOptimisedAppear=!0,i.root===i)return;const{visualElement:e}=i.options;if(!e)return;const t=J3(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:n}=i.options;window.MotionCancelOptimisedAnimation(t,"transform",Pt,!(r||n))}const{parent:s}=i;s&&!s.hasCheckedOptimisedAppear&&u4(s)}function h4({attachResizeListener:i,defaultParent:e,measureScroll:t,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(a={},o=e==null?void 0:e()){this.id=Qve++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(zve),this.nodes.forEach(Yve),this.nodes.forEach(Xve),this.nodes.forEach(Wve)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new qve)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new hv),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Yv(a)&&!jge(a),this.instance=a;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),i){let h,c=0;const d=()=>this.root.updateBlockedByResize=!1;Pt.read(()=>{c=window.innerWidth}),i(a,()=>{const f=window.innerWidth;f!==c&&(c=f,this.root.updateBlockedByResize=!0,h&&h(),h=Bve(d,250),Yd.hasAnimatedSinceResize&&(Yd.hasAnimatedSinceResize=!1,this.nodes.forEach(p4)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:c,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||r0e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:m}=u.getProps(),g=!this.targetLayout||!t4(this.targetLayout,f),b=!c&&d;if(this.options.layoutRoot||this.resumeFrom||b||c&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...qv(y,"layout"),onPlay:v,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(h,b)}else c||p4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Yn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e0e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&u4(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const c=this.path[h];c.shouldResetTransform=!0,(typeof c.latestValues.x=="string"||typeof c.latestValues.y=="string")&&(c.isLayoutDirty=!0),c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Kve),this.nodes.forEach(c4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zve),this.nodes.forEach(Jve),this.nodes.forEach(Uve),this.nodes.forEach(jve)):this.nodes.forEach(d4),this.clearAllSnapshots();const o=ei.now();Ms.delta=Nr(0,1e3/60,o-Ms.timestamp),Ms.timestamp=o,Ms.isProcessing=!0,fv.update.process(Ms),fv.preRender.process(Ms),fv.render.process(Ms),Ms.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gve),this.sharedNodes.forEach(t0e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ti(this.snapshot.measuredBox.x)&&!ti(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=bs()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!Y7(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||Fa(this.latestValues)||h)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),n0e(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return bs();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(a0e))){const{scroll:h}=this.root;h&&(qr(o.x,h.offset.x),qr(o.y,h.offset.y))}return o}removeElementScroll(a){var l;const o=bs();if(gr(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const h=this.path[u],{scroll:c,options:d}=h;h!==this.root&&c&&d.layoutScroll&&(c.wasRoot&&gr(o,a),qr(o.x,c.offset.x),qr(o.y,c.offset.y))}return o}applyTransform(a,o=!1,l){var h,c;const u=l||bs();gr(u,a);for(let d=0;d<this.path.length;d++){const f=this.path[d];!o&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(qr(u.x,-f.scroll.offset.x),qr(u.y,-f.scroll.offset.y)),Fa(f.latestValues)&&Kd(u,f.latestValues,(h=f.layout)==null?void 0:h.layoutBox)}return Fa(this.latestValues)&&Kd(u,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),u}removeTransform(a){var l;const o=bs();gr(o,a);for(let u=0;u<this.path.length;u++){const h=this.path[u];if(!Fa(h.latestValues))continue;let c;h.instance&&(i0(h.latestValues)&&h.updateSnapshot(),c=bs(),gr(c,h.measurePageBox())),Z7(o,h.latestValues,(l=h.snapshot)==null?void 0:l.layoutBox,c)}return Fa(this.latestValues)&&Z7(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ms.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:c}=this.options;if(!this.layout||!(h||c))return;this.resolvedRelativeTargetAt=Ms.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bs(),this.targetWithTransforms=bs()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pve(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gr(this.target,this.layout.layoutBox),T7(this.target,this.targetDelta)):gr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||i0(this.parent.latestValues)||E7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bs(),this.relativeTargetOrigin=bs(),Zd(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),gr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ms.timestamp&&(l=!1),l)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;gr(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,d=this.treeScale.y;sve(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=bs());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(H7(this.prevProjectionDelta.x,this.projectionDelta.x),H7(this.prevProjectionDelta.y,this.projectionDelta.y)),Du(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==d||!i4(this.projectionDelta.x,this.prevProjectionDelta.x)||!i4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Go(),this.projectionDelta=Go(),this.projectionDeltaWithTransform=Go()}setAnimationOrigin(a,o=!1){const l=this.snapshot,u=l?l.latestValues:{},h={...this.latestValues},c=Go();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=bs(),f=l?l.source:void 0,y=this.layout?this.layout.source:void 0,v=f!==y,m=this.getStack(),g=!m||m.members.length<=1,b=!!(v&&!g&&this.options.crossfade===!0&&!this.path.some(i0e));this.animationProgress=0;let x;this.mixTargetDelta=I=>{const L=I/1e3;f4(c.x,a.x,L),f4(c.y,a.y,L),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zd(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),s0e(this.relativeTarget,this.relativeTargetOrigin,d,L),x&&Lve(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=bs()),gr(x,this.relativeTarget)),v&&(this.animationValues=h,kve(h,u,this.latestValues,L,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Yn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{Yd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zo(0)),this.motionValue.jump(0,!1),this.currentAnimation=Nve(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Hve),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:h}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&C4(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||bs();const c=ti(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+c;const d=ti(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}gr(o,l),Kd(o,h),Du(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new $ve),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&h0("z",a,u,this.animationValues);for(let h=0;h<u0.length;h++)h0(`rotate${u0[h]}`,a,u,this.animationValues),h0(`skew${u0[h]}`,a,u,this.animationValues);a.render();for(const h in u)a.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Jd(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Jd(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Fa(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=u.animationValues||u.latestValues;this.applyTransformsToTarget();let c=_ve(this.projectionDeltaWithTransform,this.treeScale,h);l&&(c=l(h,c)),a.transform=c;const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=u===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in a0){if(h[y]===void 0)continue;const{correct:v,applyTo:m,isCSSVariable:g}=a0[y],b=c==="none"?h[y]:v(h[y],u);if(m){const x=m.length;for(let I=0;I<x;I++)a[m[I]]=b}else g?this.options.visualElement.renderState.vars[y]=b:a[y]=b}this.options.layoutId&&(a.pointerEvents=u===this?Jd(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(c4),this.root.sharedNodes.clear()}}}function Uve(i){i.updateLayout()}function jve(i){var t;const e=((t=i.resumeFrom)==null?void 0:t.snapshot)||i.snapshot;if(i.isLead()&&i.layout&&e&&i.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=i.layout,{animationType:n}=i.options,a=e.source!==i.layout.source;if(n==="size")Br(c=>{const d=a?e.measuredBox[c]:e.layoutBox[c],f=ti(d);d.min=s[c].min,d.max=d.min+f});else if(n==="x"||n==="y"){const c=n==="x"?"y":"x";l0(a?e.measuredBox[c]:e.layoutBox[c],s[c])}else C4(n,e.layoutBox,s)&&Br(c=>{const d=a?e.measuredBox[c]:e.layoutBox[c],f=ti(s[c]);d.max=d.min+f,i.relativeTarget&&!i.currentAnimation&&(i.isProjectionDirty=!0,i.relativeTarget[c].max=i.relativeTarget[c].min+f)});const o=Go();Du(o,s,e.layoutBox);const l=Go();a?Du(l,i.applyTransform(r,!0),e.measuredBox):Du(l,s,e.layoutBox);const u=!Y7(o);let h=!1;if(!i.resumeFrom){const c=i.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:d,layout:f}=c;if(d&&f){const y=i.options.layoutAnchor||void 0,v=bs();Zd(v,e.layoutBox,d.layoutBox,y);const m=bs();Zd(m,s,f.layoutBox,y),t4(v,m)||(h=!0),c.options.layoutRoot&&(i.relativeTarget=m,i.relativeTargetOrigin=v,i.relativeParent=c)}}}i.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:h})}else if(i.isLead()){const{onExitComplete:s}=i.options;s&&s()}i.options.transition=void 0}function zve(i){i.parent&&(i.isProjecting()||(i.isProjectionDirty=i.parent.isProjectionDirty),i.isSharedProjectionDirty||(i.isSharedProjectionDirty=!!(i.isProjectionDirty||i.parent.isProjectionDirty||i.parent.isSharedProjectionDirty)),i.isTransformDirty||(i.isTransformDirty=i.parent.isTransformDirty))}function Wve(i){i.isProjectionDirty=i.isSharedProjectionDirty=i.isTransformDirty=!1}function Gve(i){i.clearSnapshot()}function c4(i){i.clearMeasurements()}function Kve(i){i.isLayoutDirty=!0,i.updateLayout()}function d4(i){i.isLayoutDirty=!1}function Zve(i){i.isAnimationBlocked&&i.layout&&!i.isLayoutDirty&&(i.snapshot=i.layout,i.isLayoutDirty=!0)}function Jve(i){const{visualElement:e}=i.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),i.resetTransform()}function p4(i){i.finishAnimation(),i.targetDelta=i.relativeTarget=i.target=void 0,i.isProjectionDirty=!0}function Yve(i){i.resolveTargetDelta()}function Xve(i){i.calcProjection()}function e0e(i){i.resetSkewAndRotation()}function t0e(i){i.removeLeadSnapshot()}function f4(i,e,t){i.translate=Bt(e.translate,0,t),i.scale=Bt(e.scale,1,t),i.origin=e.origin,i.originPoint=e.originPoint}function m4(i,e,t,s){i.min=Bt(e.min,t.min,s),i.max=Bt(e.max,t.max,s)}function s0e(i,e,t,s){m4(i.x,e.x,t.x,s),m4(i.y,e.y,t.y,s)}function i0e(i){return i.animationValues&&i.animationValues.opacityExit!==void 0}const r0e={duration:.45,ease:[.4,0,.1,1]},g4=i=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(i),v4=g4("applewebkit/")&&!g4("chrome/")?Math.round:Gi;function y4(i){i.min=v4(i.min),i.max=v4(i.max)}function n0e(i){y4(i.x),y4(i.y)}function C4(i,e,t){return i==="position"||i==="preserve-aspect"&&!Tve(s4(e),s4(t),.2)}function a0e(i){var e;return i!==i.root&&((e=i.scroll)==null?void 0:e.wasRoot)}const o0e=h4({attachResizeListener:(i,e)=>ku(i,"resize",e),measureScroll:()=>{var i,e;return{x:document.documentElement.scrollLeft||((i=document.body)==null?void 0:i.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),l0e=i=>!i.isLayoutDirty&&i.willUpdate(!1);function b4(){const i=new Set,e=new WeakMap,t=()=>i.forEach(l0e);return{add:s=>{i.add(s),e.set(s,s.addEventListener("willUpdate",t))},remove:s=>{i.delete(s);const r=e.get(s);r&&(r(),e.delete(s)),t()},dirty:t}}const c0={current:void 0},w4=h4({measureScroll:i=>({x:i.scrollLeft,y:i.scrollTop}),defaultParent:()=>{if(!c0.current){const i=new o0e({});i.mount(window),i.setOptions({layoutScroll:!0}),c0.current=i}return c0.current},resetTransform:(i,e)=>{i.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:i=>window.getComputedStyle(i).position==="fixed"}),d0=V.createContext({transformPagePoint:i=>i,isStatic:!1,reducedMotion:"never"});function x4(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function u0e(...i){return e=>{let t=!1;const s=i.map(r=>{const n=x4(r,e);return!t&&typeof n=="function"&&(t=!0),n});if(t)return()=>{for(let r=0;r<s.length;r++){const n=s[r];typeof n=="function"?n():x4(i[r],null)}}}}function h0e(...i){return p.useCallback(u0e(...i),i)}class c0e extends p.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if($d(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=t.offsetParent,r=$d(s)&&s.offsetWidth||0,n=$d(s)&&s.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=n-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function d0e({children:i,isPresent:e,anchorX:t,anchorY:s,root:r,pop:n}){var d;const a=V.useId(),o=V.useRef(null),l=V.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=V.useContext(d0),h=((d=i.props)==null?void 0:d.ref)??(i==null?void 0:i.ref),c=h0e(o,h);return V.useInsertionEffect(()=>{const{width:f,height:y,top:v,left:m,right:g,bottom:b}=l.current;if(e||n===!1||!o.current||!f||!y)return;const x=t==="left"?`left: ${m}`:`right: ${g}`,I=s==="bottom"?`bottom: ${b}`:`top: ${v}`;o.current.dataset.motionPopId=a;const L=document.createElement("style");u&&(L.nonce=u);const A=r??document.head;return A.appendChild(L),L.sheet&&L.sheet.insertRule(`
|
|
10246
10246
|
[data-motion-pop-id="${a}"] {
|
|
10247
10247
|
position: absolute !important;
|
|
10248
10248
|
width: ${f}px !important;
|